From 64c031d2ba1659b7fc111ce4f5101ef8a222a89c Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期一, 28 七月 2025 21:11:54 +0800 Subject: [PATCH] 刀具管理 --- src/views/cms/modules/ToolStocktakingInventoryChangeModal.vue | 60 src/views/cms/ToolStocktakingDetailList.vue | 189 + src/views/cms/CuttingScrapList.vue | 278 + src/views/cms/modules/CuttingInboundModal.vue | 314 ++ src/views/cms/EdgeGrindingList.vue | 309 ++ src/views/cms/modules/EdgeGrindingDetailModal.vue | 60 src/views/cms/modules/CuttingInventoryForm.vue | 119 src/views/cms/modules/CuttingPropertiesForm.vue | 124 src/views/cms/modules/EdgeGrindingDetailForm.vue | 124 src/views/cms/modules/CuttingScrapForm.vue | 139 src/views/cms/modules/ToolStocktakingModal.vue | 60 src/views/cms/modules/CuttingInboundInventoryForm.vue | 109 src/views/cms/modules/CuttingReceiveForm.vue | 169 + src/views/cms/modules/EdgeGrindingForm.vue | 164 + src/views/cms/modules/JSelectToolingModal.vue | 242 + src/views/cms/modules/RatedLifeModal.vue | 60 src/views/cms/modules/CuttingScrapModal.vue | 310 ++ src/views/cms/ToolStocktakingInventoryChangeList.vue | 195 + src/views/cms/modules/CuttingInventoryModal.vue | 60 src/views/cms/RatedLifeList.vue | 206 + src/views/cms/modules/CuttingScrapDetailForm.vue | 114 src/views/cms/modules/EdgeGrindingModal.vue | 362 ++ src/views/cms/CuttingInventoryList.vue | 212 + src/views/cms/modules/CuttingReceiveModal.vue | 379 ++ src/views/cms/modules/RatedLifeForm.vue | 114 src/views/cms/modules/CuttingReceiveDetailModal.vue | 359 ++ src/views/cms/CuttingPropertiesList.vue | 150 + src/views/cms/EdgeGrindingDetailList.vue | 157 + src/views/cms/CuttingScrapDetailList.vue | 176 + src/views/cms/CuttingReceiveDetailList.vue | 160 + src/views/cms/modules/ToolStocktakingForm.vue | 129 src/views/cms/ToolStocktakingList.vue | 204 + src/views/cms/modules/CuttingScrapDetailModal.vue | 60 src/views/cms/modules/ToolStocktakingDetailForm.vue | 119 src/views/cms/modules/CuttingInboundDetailModal.vue | 60 src/views/cms/CuttingInboundDetailList.vue | 156 + src/views/cms/modules/CuttingInboundForm.vue | 139 src/views/cms/modules/ToolStocktakingDetailModal.vue | 60 src/views/cms/CuttingInboundInventoryList.vue | 177 + src/views/cms/modules/CuttingToolModal.vue | 434 +++ src/views/cms/CuttingReceiveList.vue | 314 ++ src/views/cms/modules/CuttingInboundInventoryModal.vue | 60 src/views/cms/CuttingToolList.vue | 301 ++ src/views/cms/modules/CuttingInboundDetailForm.vue | 114 src/views/cms/modules/CuttingPropertiesModal.vue | 60 src/views/cms/CuttingInboundList.vue | 279 + src/views/cms/modules/CuttingReceiveDetailForm.vue | 124 src/views/cms/modules/ToolStocktakingInventoryChangeForm.vue | 124 48 files changed, 8,388 insertions(+), 0 deletions(-) diff --git a/src/views/cms/CuttingInboundDetailList.vue b/src/views/cms/CuttingInboundDetailList.vue new file mode 100644 index 0000000..56947aa --- /dev/null +++ b/src/views/cms/CuttingInboundDetailList.vue @@ -0,0 +1,156 @@ +<template> + <a-card :bordered="false"> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <cutting-inbound-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingInboundDetailModal from './modules/CuttingInboundDetailModal' + + export default { + name: 'CuttingInboundDetailList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingInboundDetailModal + }, + data () { + return { + description: '鍏ュ簱鍗曟槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鍙�', + align:"center", + dataIndex: 'cuttingCode' + }, + { + title:'鍒�鍏峰悕绉�', + align:"center", + dataIndex: 'cuttingName' + }, + { + title:'鍏ュ簱鏁伴噺', + align:"center", + dataIndex: 'receiveNumber' + }, + ], + url: { + list: "/cms/cuttingInbound/detailList", + delete: "/cms/cuttingInboundDetail/delete", + deleteBatch: "/cms/cuttingInboundDetail/deleteBatch", + exportXlsUrl: "/cms/cuttingInboundDetail/exportXls", + importExcelUrl: "cms/cuttingInboundDetail/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + disableMixinCreated:true + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'鍏ュ簱鍗�'}) + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'int',value:'receiveNumber',text:'鍏ュ簱鏁伴噺'}) + this.superFieldList = fieldList + } + }, + mounted() { + this.$bus.$on('getToolingStorageData', (data) => { + this.queryParam.orderId = data.id; + this.searchQuery(); + }) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingInboundInventoryList.vue b/src/views/cms/CuttingInboundInventoryList.vue new file mode 100644 index 0000000..70723df --- /dev/null +++ b/src/views/cms/CuttingInboundInventoryList.vue @@ -0,0 +1,177 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鍏ュ簱鍗曞簱瀛樺叧绯�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <cutting-inbound-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-inventory-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingInboundInventoryModal from './modules/CuttingInboundInventoryModal' + + export default { + name: 'CuttingInboundInventoryList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingInboundInventoryModal + }, + data () { + return { + description: '鍏ュ簱鍗曞簱瀛樺叧绯荤鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍏ュ簱鍗旾D', + align:"center", + dataIndex: 'orderId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingInboundInventory/list", + delete: "/cms/cuttingInboundInventory/delete", + deleteBatch: "/cms/cuttingInboundInventory/deleteBatch", + exportXlsUrl: "/cms/cuttingInboundInventory/exportXls", + importExcelUrl: "cms/cuttingInboundInventory/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'鍏ュ簱鍗旾D'}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingInboundList.vue b/src/views/cms/CuttingInboundList.vue new file mode 100644 index 0000000..0f1df64 --- /dev/null +++ b/src/views/cms/CuttingInboundList.vue @@ -0,0 +1,279 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="鍏ュ簱鍗曠姸鎬�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" + v-model="queryParam.orderStatus" + dict="order_status" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍏ュ簱浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍏ュ簱浜�" + v-model="queryParam.receiver" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏峰叆搴撳崟')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍒�鍏峰叆搴撴槑缁�" key="1"> + <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list> + </a-tab-pane> + </a-tabs> + <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingInboundModal from './modules/CuttingInboundModal' + import CuttingInboundDetailList from './CuttingInboundDetailList' + + + export default { + name: 'CuttingInboundList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingInboundModal, + CuttingInboundDetailList + }, + data () { + return { + description: '鍒�鍏峰叆搴撳崟绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍏ュ簱浜�', + align:"center", + dataIndex: 'receiver_dictText' + }, + { + title:'鍏ュ簱鏃堕棿', + align:"center", + dataIndex: 'receiveTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'鍏ュ簱璇存槑', + align:"center", + dataIndex: 'receiveComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer_dictText' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title:'鍏ュ簱鍗曠姸鎬�', + align:"center", + dataIndex: 'orderStatus' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingInbound/list", + delete: "/cms/cuttingInbound/delete", + deleteBatch: "/cms/cuttingInbound/deleteBatch", + exportXlsUrl: "/cms/cuttingInbound/exportXls", + importExcelUrl: "cms/cuttingInbound/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + searchReset() { + this.queryParam = {} + this.$refs.cuttingInbounDetailList.dataSource = [] + this.loadData(1); + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail:function(record){ + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title="璇︽儏"; + this.$refs.modalForm.disableSubmit = true; + }, + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + }, + }, + } + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingInventoryList.vue b/src/views/cms/CuttingInventoryList.vue new file mode 100644 index 0000000..0e58ea9 --- /dev/null +++ b/src/views/cms/CuttingInventoryList.vue @@ -0,0 +1,212 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏风紪鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" v-model="queryParam.cuttingId" /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏锋潯鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏锋潯鐮�" v-model="queryParam.cuttingBarcode" /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <!-- <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> --> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏峰簱瀛�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <cutting-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inventory-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingInventoryModal from './modules/CuttingInventoryModal' + + export default { + name: 'CuttingInventoryList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingInventoryModal + }, + data () { + return { + description: '鍒�鍏峰簱瀛樼鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingId' + }, + { + title:'鍒�鍏锋潯鐮�', + align:"center", + dataIndex: 'cuttingBarcode' + }, + { + title:'搴撳瓨鐘舵��', + align:"center", + dataIndex: 'inventoryStatus' + }, + { + title:'褰撳墠瀵垮懡(鐧惧垎姣�)', + align:"center", + dataIndex: 'currentLife' + }, + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align:"center", + // fixed:"right", + // width:147, + // scopedSlots: { customRender: 'action' } + // } + ], + url: { + list: "/cms/cuttingInventory/list", + delete: "/cms/cuttingInventory/delete", + deleteBatch: "/cms/cuttingInventory/deleteBatch", + exportXlsUrl: "/cms/cuttingInventory/exportXls", + importExcelUrl: "cms/cuttingInventory/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'cuttingBarcode',text:'鍒�鍏锋潯鐮�'}) + fieldList.push({type:'string',value:'inventoryStatus',text:'搴撳瓨鐘舵��'}) + fieldList.push({type:'number',value:'currentLife',text:'褰撳墠瀵垮懡(鐧惧垎姣�)'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingPropertiesList.vue b/src/views/cms/CuttingPropertiesList.vue new file mode 100644 index 0000000..8d710c5 --- /dev/null +++ b/src/views/cms/CuttingPropertiesList.vue @@ -0,0 +1,150 @@ +<template> + <a-card :bordered="false"> + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + + export default { + name: 'CuttingPropertiesList', + mixins:[JeecgListMixin, mixinDevice], + components: { + }, + data () { + return { + description: '鍒�鍏锋墿灞曞睘鎬х鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'灞炴�х紪鐮�', + align:"center", + dataIndex: 'propertyCode' + }, + { + title:'灞炴�у悕绉�', + align:"center", + dataIndex: 'propertyName' + }, + { + title:'璁¢噺鍗曚綅', + align:"center", + dataIndex: 'propertyUnit' + }, + { + title:'灞炴�у��', + align:"center", + dataIndex: 'propertyValue' + } + ], + url: { + list: "/cms/cuttingProperties/list", + delete: "/cms/cuttingProperties/delete", + deleteBatch: "/cms/cuttingProperties/deleteBatch", + exportXlsUrl: "/cms/cuttingProperties/exportXls", + importExcelUrl: "cms/cuttingProperties/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'propertyCode',text:'灞炴�х紪鐮�'}) + fieldList.push({type:'string',value:'propertyName',text:'灞炴�у悕绉�'}) + fieldList.push({type:'string',value:'propertyUnit',text:'璁¢噺鍗曚綅'}) + fieldList.push({type:'string',value:'propertyValue',text:'灞炴�у��'}) + this.superFieldList = fieldList + }, + getCuttingProperties(cuttingId) { + this.queryParam.cuttingId = cuttingId; + this.loadData(1); + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingReceiveDetailList.vue b/src/views/cms/CuttingReceiveDetailList.vue new file mode 100644 index 0000000..ebb39c0 --- /dev/null +++ b/src/views/cms/CuttingReceiveDetailList.vue @@ -0,0 +1,160 @@ +<template> + <a-card :bordered="false"> + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + + export default { + name: 'CuttingReceiveDetailList', + mixins:[JeecgListMixin, mixinDevice], + components: { + }, + data () { + return { + description: '棰嗙敤鍗曟槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingCode' + }, + { + title:'鍒�鍏峰悕绉�', + align:"center", + dataIndex: 'cuttingName' + }, + { + title:'宸ヤ欢鏉愯川', + align:"center", + dataIndex: 'workpieceMaterial' + }, + { + title:'浣跨敤瀵垮懡', + align:"center", + dataIndex: 'usedLife' + }, + ], + url: { + list: "/cms/cuttingReceive/detailList", + delete: "/cms/cuttingReceiveDetail/delete", + deleteBatch: "/cms/cuttingReceiveDetail/deleteBatch", + exportXlsUrl: "/cms/cuttingReceiveDetail/exportXls", + importExcelUrl: "cms/cuttingReceiveDetail/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + disableMixinCreated:true + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'棰嗙敤鍗旾D'}) + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID'}) + fieldList.push({type:'string',value:'workpieceMaterial',text:'宸ヤ欢鏉愯川'}) + fieldList.push({type:'int',value:'usedLife',text:'浣跨敤瀵垮懡'}) + this.superFieldList = fieldList + } + }, + mounted() { + this.$bus.$on('getToolingStorageData', (data) => { + this.queryParam.orderId = data.id; + this.searchQuery(); + }) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingReceiveList.vue b/src/views/cms/CuttingReceiveList.vue new file mode 100644 index 0000000..a12e0e6 --- /dev/null +++ b/src/views/cms/CuttingReceiveList.vue @@ -0,0 +1,314 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="棰嗙敤鍗曠姸鎬�"> + <j-search-select-tag + placeholder="璇烽�夋嫨棰嗙敤鍗曠姸鎬�" + v-model="queryParam.orderStatus" + dict="order_status" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="棰嗙敤浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨棰嗙敤浜�" + v-model="queryParam.receiver" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏烽鐢ㄥ崟')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> +<a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍒�鍏烽鐢ㄦ槑缁�" key="1"> + <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list> + </a-tab-pane> + </a-tabs> + <cutting-receive-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingReceiveModal from './modules/CuttingReceiveModal' + import CuttingReceiveDetailList from './CuttingReceiveDetailList' + + export default { + name: 'CuttingReceiveList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingReceiveModal, + CuttingReceiveDetailList + }, + data () { + return { + description: '鍒�鍏烽鐢ㄥ崟绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'棰嗙敤浜�', + align:"center", + dataIndex: 'receiver_dictText' + }, + { + title:'棰嗙敤鏃堕棿', + align:"center", + dataIndex: 'receiveTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'棰嗙敤璇存槑', + align:"center", + dataIndex: 'receiveComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer_dictText' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title:'鏄惁浼氬綊杩�', + align:"center", + dataIndex: 'returnFlag' + }, + { + title:'褰掕繕鏃堕棿', + align:"center", + dataIndex: 'returnTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'褰掕繕璇存槑', + align:"center", + dataIndex: 'returnComment' + }, + { + title:'褰掕繕纭浜�', + align:"center", + dataIndex: 'returnConfirmer_dictText' + }, + { + title:'褰掕繕纭鏃堕棿', + align:"center", + dataIndex: 'returnConfirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'褰掕繕纭鎰忚', + align:"center", + dataIndex: 'returnConfirmComment' + }, + { + title:'棰嗙敤鍗曠姸鎬�', + align:"center", + dataIndex: 'orderStatus' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingReceive/list", + delete: "/cms/cuttingReceive/delete", + deleteBatch: "/cms/cuttingReceive/deleteBatch", + exportXlsUrl: "/cms/cuttingReceive/exportXls", + importExcelUrl: "cms/cuttingReceive/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + searchReset() { + this.queryParam = {} + this.$refs.cuttingReceiveDetailList.dataSource = [] + this.loadData(1); + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail:function(record){ + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title="璇︽儏"; + this.$refs.modalForm.disableSubmit = true; + }, + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + }, + }, + } + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingScrapDetailList.vue b/src/views/cms/CuttingScrapDetailList.vue new file mode 100644 index 0000000..026b4d8 --- /dev/null +++ b/src/views/cms/CuttingScrapDetailList.vue @@ -0,0 +1,176 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏锋姤搴熸槑缁�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <cutting-scrap-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-scrap-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingScrapDetailModal from './modules/CuttingScrapDetailModal' + + export default { + name: 'CuttingScrapDetailList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingScrapDetailModal + }, + data () { + return { + description: '鍒�鍏锋姤搴熸槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingCode' + }, + { + title:'鍒�鍏峰悕绉�', + align:"center", + dataIndex: 'cuttingName' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingScrap/detailList", + delete: "/cms/cuttingScrapDetail/delete", + deleteBatch: "/cms/cuttingScrapDetail/deleteBatch", + exportXlsUrl: "/cms/cuttingScrapDetail/exportXls", + importExcelUrl: "cms/cuttingScrapDetail/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + disableMixinCreated:true + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'鎶ュ簾鍗旾D'}) + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID'}) + this.superFieldList = fieldList + } + }, + mounted() { + this.$bus.$on('getToolingStorageData', (data) => { + this.queryParam.orderId = data.id; + this.searchQuery(); + }) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingScrapList.vue b/src/views/cms/CuttingScrapList.vue new file mode 100644 index 0000000..cb27f29 --- /dev/null +++ b/src/views/cms/CuttingScrapList.vue @@ -0,0 +1,278 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="鎶ュ簾鍗曠姸鎬�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鎶ュ簾鍗曠姸鎬�" + v-model="queryParam.orderStatus" + dict="order_status" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鐢宠浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鐢宠浜�" + v-model="queryParam.applicant" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏锋姤搴�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> +<a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍒�鍏锋姤搴熸槑缁�" key="1"> + <cutting-scrap-detail-list ref="cuttingScrapDetailList"></cutting-scrap-detail-list> + </a-tab-pane> + </a-tabs> + <cutting-scrap-modal ref="modalForm" @ok="modalFormOk"></cutting-scrap-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingScrapModal from './modules/CuttingScrapModal' + import CuttingScrapDetailList from './CuttingScrapDetailList' + + export default { + name: 'CuttingScrapList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingScrapModal, + CuttingScrapDetailList + }, + data () { + return { + description: '鍒�鍏锋姤搴熺鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鐢宠浜�', + align:"center", + dataIndex: 'applicant_dictText' + }, + { + title:'鐢宠鏃堕棿', + align:"center", + dataIndex: 'applicationTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'鐢宠璇存槑', + align:"center", + dataIndex: 'applicationComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer_dictText' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title:'鎶ュ簾鍗曠姸鎬�', + align:"center", + dataIndex: 'orderStatus' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingScrap/list", + delete: "/cms/cuttingScrap/delete", + deleteBatch: "/cms/cuttingScrap/deleteBatch", + exportXlsUrl: "/cms/cuttingScrap/exportXls", + importExcelUrl: "cms/cuttingScrap/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + searchReset() { + this.queryParam = {} + this.$refs.cuttingScrapDetailList.dataSource = [] + this.loadData(1); + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail:function(record){ + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title="璇︽儏"; + this.$refs.modalForm.disableSubmit = true; + }, + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + }, + }, + } + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/CuttingToolList.vue b/src/views/cms/CuttingToolList.vue new file mode 100644 index 0000000..f1fdce4 --- /dev/null +++ b/src/views/cms/CuttingToolList.vue @@ -0,0 +1,301 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏风紪鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" v-model="queryParam.cuttingCode" /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏峰悕绉�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏峰悕绉�" v-model="queryParam.cuttingName" /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏峰垎绫�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍒�鍏峰垎绫�" + v-model="queryParam.cuttingCategory" + dict="cutting_category" + /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏蜂俊鎭�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鎵╁睍灞炴��" key="1"> + <cutting-properties-list ref="cuttingPropertiesList"></cutting-properties-list> + </a-tab-pane> + <!-- <a-tab-pane tab="棰濆畾瀵垮懡" key="2"> + <rated-life-list ref="ratedLifeList"></rated-life-list> + </a-tab-pane> --> + </a-tabs> + <!-- table鍖哄煙-end --> + <cutting-tool-modal ref="modalForm" @ok="modalFormOk"></cutting-tool-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import CuttingToolModal from './modules/CuttingToolModal' + import CuttingPropertiesList from './CuttingPropertiesList' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + + export default { + name: 'CuttingToolList', + mixins:[JeecgListMixin, mixinDevice], + components: { + CuttingToolModal,CuttingPropertiesList, JDictSelectTag, + JSearchSelectTag + }, + data () { + return { + description: '鍒�鍏蜂俊鎭鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingCode' + }, + { + title:'鍒�鍏峰悕绉�', + align:"center", + dataIndex: 'cuttingName' + }, + { + title:'鍒�鍏峰垎绫�', + align:"center", + dataIndex: 'cuttingCategory' + }, + { + title:'瀛樻斁浣嶇疆', + align:"center", + dataIndex: 'storeLocation' + }, + { + title:'渚涘簲鍟�', + align:"center", + dataIndex: 'supplierId' + }, + { + title:'鏈�灏忓寘瑁呭崟浣�', + align:"center", + dataIndex: 'minimumPackageUnit' + }, + { + title:'鍒�鍏锋潗璐�', + align:"center", + dataIndex: 'cuttingMaterial' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'cuttingModel' + }, + { + title:'鍥惧彿', + align:"center", + dataIndex: 'drawingNumber' + }, + { + title:'搴撳瓨棰勮鍊�', + align:"center", + dataIndex: 'inventoryWarning' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/cuttingTool/getCuttingToolList", + delete: "/cms/cuttingTool/delete", + deleteBatch: "/cms/cuttingTool/deleteBatch", + exportXlsUrl: "/cms/cuttingTool/exportXls", + importExcelUrl: "cms/cuttingTool/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + customRow(record) { + return { + on: { + click: e => { + this.onSelectChange(record.id.split(","), [record]); + } + } + }; + }, + onSelectChange(selectedRowKeys) { + this.selectedRowKeys = selectedRowKeys; + this.$refs.cuttingPropertiesList.getCuttingProperties(selectedRowKeys[0]); + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail:function(record){ + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title="璇︽儏"; + this.$refs.modalForm.disableSubmit = true; + }, + searchQuery() { + this.selectedRowKeys = []; + this.$refs.cuttingPropertiesList.getCuttingProperties("-1"); + this.$refs.cuttingPropertiesList.loadData(); + this.$refs.cuttingPropertiesList.selectedRowKeys = []; + this.loadData(); + }, + searchReset() { + this.queryParam.cuttingCode = ''; + this.queryParam.cuttingName = ''; + this.queryParam.cuttingCategory = ''; + this.$refs.cuttingPropertiesList.getCuttingProperties("-1"); + this.loadData(); + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/EdgeGrindingDetailList.vue b/src/views/cms/EdgeGrindingDetailList.vue new file mode 100644 index 0000000..4ec4fda --- /dev/null +++ b/src/views/cms/EdgeGrindingDetailList.vue @@ -0,0 +1,157 @@ +<template> + <a-card :bordered="false"> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <edge-grinding-detail-modal ref="modalForm" @ok="modalFormOk"></edge-grinding-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + + export default { + name: 'EdgeGrindingDetailList', + mixins:[JeecgListMixin, mixinDevice], + components: { + }, + data () { + return { + description: '鍒�鍏蜂慨纾ㄦ槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingCode' + }, + { + title:'鍒�鍏峰悕绉�', + align:"center", + dataIndex: 'cuttingName' + }, + { + title:'鏂板垁鍏风紪鐮�', + align:"center", + dataIndex: 'newCuttingId' + }, + ], + url: { + list: "/cms/edgeGrinding/detailList", + delete: "/cms/edgeGrindingDetail/delete", + deleteBatch: "/cms/edgeGrindingDetail/deleteBatch", + exportXlsUrl: "/cms/edgeGrindingDetail/exportXls", + importExcelUrl: "cms/edgeGrindingDetail/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + disableMixinCreated:true + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'淇(鍗旾D'}) + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID'}) + fieldList.push({type:'string',value:'newCuttingId',text:'鏂板垁鍏稩D'}) + fieldList.push({type:'string',value:'newInventoryId',text:'鏂板簱瀛業D'}) + this.superFieldList = fieldList + } + }, + mounted() { + this.$bus.$on('getToolingStorageData', (data) => { + this.queryParam.orderId = data.id; + this.searchQuery(); + }) + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/EdgeGrindingList.vue b/src/views/cms/EdgeGrindingList.vue new file mode 100644 index 0000000..0f89337 --- /dev/null +++ b/src/views/cms/EdgeGrindingList.vue @@ -0,0 +1,309 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="淇(鍗曠姸鎬�"> + <j-search-select-tag + placeholder="璇烽�夋嫨淇(鍗曠姸鎬�" + v-model="queryParam.orderStatus" + dict="order_status" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鐢宠浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鐢宠浜�" + v-model="queryParam.applicant" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏蜂慨纾�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> +<a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍒�鍏蜂慨纾ㄦ槑缁�" key="1"> + <edge-grinding-detail-list ref="edgeGrindingDetailList"></edge-grinding-detail-list> + </a-tab-pane> + </a-tabs> + <edge-grinding-modal ref="modalForm" @ok="modalFormOk"></edge-grinding-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EdgeGrindingModal from './modules/EdgeGrindingModal' + import EdgeGrindingDetailList from './EdgeGrindingDetailList' + + export default { + name: 'EdgeGrindingList', + mixins:[JeecgListMixin, mixinDevice], + components: { + EdgeGrindingModal, + EdgeGrindingDetailList + }, + data () { + return { + description: '鍒�鍏蜂慨纾ㄧ鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鐢宠浜�', + align:"center", + dataIndex: 'applicant_dictText' + }, + { + title:'鐢宠鏃堕棿', + align:"center", + dataIndex: 'applicationTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'鐢宠璇存槑', + align:"center", + dataIndex: 'applicationComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer_dictText' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title:'褰掕繕鏃堕棿', + align:"center", + dataIndex: 'returnTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'褰掕繕璇存槑', + align:"center", + dataIndex: 'returnComment' + }, + { + title:'褰掕繕纭浜�', + align:"center", + dataIndex: 'returnConfirmer_dictText' + }, + { + title:'褰掕繕纭鏃堕棿', + align:"center", + dataIndex: 'returnConfirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'褰掕繕纭鎰忚', + align:"center", + dataIndex: 'returnConfirmComment' + }, + { + title:'淇(鍗曠姸鎬�', + align:"center", + dataIndex: 'orderStatus' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/edgeGrinding/list", + delete: "/cms/edgeGrinding/delete", + deleteBatch: "/cms/edgeGrinding/deleteBatch", + exportXlsUrl: "/cms/edgeGrinding/exportXls", + importExcelUrl: "cms/edgeGrinding/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + searchReset() { + this.queryParam = {} + this.$refs.edgeGrindingDetailList.dataSource = [] + this.loadData(1); + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail:function(record){ + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title="璇︽儏"; + this.$refs.modalForm.disableSubmit = true; + }, + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + }, + }, + } + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/RatedLifeList.vue b/src/views/cms/RatedLifeList.vue new file mode 100644 index 0000000..e07526a --- /dev/null +++ b/src/views/cms/RatedLifeList.vue @@ -0,0 +1,206 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏风紪鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" v-model="queryParam.cuttingId" /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="宸ヤ欢鏉愯川"> + <a-input placeholder="璇疯緭鍏ュ伐浠舵潗璐�" v-model="queryParam.workpieceMaterial" /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('棰濆畾瀵垮懡')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> --> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <rated-life-modal ref="modalForm" @ok="modalFormOk"></rated-life-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import RatedLifeModal from './modules/RatedLifeModal' + + export default { + name: 'RatedLifeList', + mixins:[JeecgListMixin, mixinDevice], + components: { + RatedLifeModal + }, + data () { + return { + description: '棰濆畾瀵垮懡绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingId' + }, + { + title:'宸ヤ欢鏉愯川', + align:"center", + dataIndex: 'workpieceMaterial' + }, + { + title:'棰濆畾瀵垮懡', + align:"center", + dataIndex: 'ratedLife' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/ratedLife/list", + delete: "/cms/ratedLife/delete", + deleteBatch: "/cms/ratedLife/deleteBatch", + exportXlsUrl: "/cms/ratedLife/exportXls", + importExcelUrl: "cms/ratedLife/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'cuttingId',text:'鍒�鍏稩D'}) + fieldList.push({type:'string',value:'workpieceMaterial',text:'宸ヤ欢鏉愯川'}) + fieldList.push({type:'number',value:'ratedLife',text:'棰濆畾瀵垮懡'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/ToolStocktakingDetailList.vue b/src/views/cms/ToolStocktakingDetailList.vue new file mode 100644 index 0000000..84dbd95 --- /dev/null +++ b/src/views/cms/ToolStocktakingDetailList.vue @@ -0,0 +1,189 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏风洏鐐规槑缁�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <tool-stocktaking-detail-modal ref="modalForm" @ok="modalFormOk"></tool-stocktaking-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import ToolStocktakingDetailModal from './modules/ToolStocktakingDetailModal' + + export default { + name: 'ToolStocktakingDetailList', + mixins:[JeecgListMixin, mixinDevice], + components: { + ToolStocktakingDetailModal + }, + data () { + return { + description: '鍒�鍏风洏鐐规槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒�鍏稩D', + align:"center", + dataIndex: 'toolId' + }, + { + title:'鐩樼偣鍓嶆暟閲�', + align:"center", + dataIndex: 'beforeNumber' + }, + { + title:'瀹為檯鐩樼偣鏁伴噺', + align:"center", + dataIndex: 'actualNumber' + }, + { + title:'鐩樼偣缁撴灉', + align:"center", + dataIndex: 'stocktakingResult' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/toolStocktakingDetail/list", + delete: "/cms/toolStocktakingDetail/delete", + deleteBatch: "/cms/toolStocktakingDetail/deleteBatch", + exportXlsUrl: "/cms/toolStocktakingDetail/exportXls", + importExcelUrl: "cms/toolStocktakingDetail/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'toolId',text:'鍒�鍏稩D'}) + fieldList.push({type:'number',value:'beforeNumber',text:'鐩樼偣鍓嶆暟閲�'}) + fieldList.push({type:'number',value:'actualNumber',text:'瀹為檯鐩樼偣鏁伴噺'}) + fieldList.push({type:'string',value:'stocktakingResult',text:'鐩樼偣缁撴灉'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/ToolStocktakingInventoryChangeList.vue b/src/views/cms/ToolStocktakingInventoryChangeList.vue new file mode 100644 index 0000000..5829839 --- /dev/null +++ b/src/views/cms/ToolStocktakingInventoryChangeList.vue @@ -0,0 +1,195 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鐩樼偣搴撳瓨鍙樻洿')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <tool-stocktaking-inventory-change-modal ref="modalForm" @ok="modalFormOk"></tool-stocktaking-inventory-change-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import ToolStocktakingInventoryChangeModal from './modules/ToolStocktakingInventoryChangeModal' + + export default { + name: 'ToolStocktakingInventoryChangeList', + mixins:[JeecgListMixin, mixinDevice], + components: { + ToolStocktakingInventoryChangeModal + }, + data () { + return { + description: '鐩樼偣搴撳瓨鍙樻洿绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鐩樼偣鏄庣粏ID', + align:"center", + dataIndex: 'detailId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title:'鍒�鍏锋潯鐮�', + align:"center", + dataIndex: 'toolBarcode' + }, + { + title:'鏁伴噺(榛樿1)', + align:"center", + dataIndex: 'number' + }, + { + title:'鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱', + align:"center", + dataIndex: 'changeType' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/toolStocktakingInventoryChange/list", + delete: "/cms/toolStocktakingInventoryChange/delete", + deleteBatch: "/cms/toolStocktakingInventoryChange/deleteBatch", + exportXlsUrl: "/cms/toolStocktakingInventoryChange/exportXls", + importExcelUrl: "cms/toolStocktakingInventoryChange/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'detailId',text:'鐩樼偣鏄庣粏ID'}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID'}) + fieldList.push({type:'string',value:'toolBarcode',text:'鍒�鍏锋潯鐮�'}) + fieldList.push({type:'number',value:'number',text:'鏁伴噺(榛樿1)'}) + fieldList.push({type:'string',value:'changeType',text:'鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/ToolStocktakingList.vue b/src/views/cms/ToolStocktakingList.vue new file mode 100644 index 0000000..67ac216 --- /dev/null +++ b/src/views/cms/ToolStocktakingList.vue @@ -0,0 +1,204 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏风洏鐐�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <tool-stocktaking-modal ref="modalForm" @ok="modalFormOk"></tool-stocktaking-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import ToolStocktakingModal from './modules/ToolStocktakingModal' + + export default { + name: 'ToolStocktakingList', + mixins:[JeecgListMixin, mixinDevice], + components: { + ToolStocktakingModal + }, + data () { + return { + description: '鍒�鍏风洏鐐圭鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍒犻櫎鏍囪', + align:"center", + dataIndex: 'delFlag' + }, + { + title:'鐩樼偣鍗曞彿', + align:"center", + dataIndex: 'orderCode' + }, + { + title:'鐩樼偣鐘舵��', + align:"center", + dataIndex: 'orderStatus' + }, + { + title:'鐩樼偣浜�', + align:"center", + dataIndex: 'operator' + }, + { + title:'鐩樼偣鏃堕棿', + align:"center", + dataIndex: 'operateTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/cms/toolStocktaking/list", + delete: "/cms/toolStocktaking/delete", + deleteBatch: "/cms/toolStocktaking/deleteBatch", + exportXlsUrl: "/cms/toolStocktaking/exportXls", + importExcelUrl: "cms/toolStocktaking/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'int',value:'delFlag',text:'鍒犻櫎鏍囪'}) + fieldList.push({type:'string',value:'orderCode',text:'鐩樼偣鍗曞彿'}) + fieldList.push({type:'string',value:'orderStatus',text:'鐩樼偣鐘舵��'}) + fieldList.push({type:'string',value:'operator',text:'鐩樼偣浜�'}) + fieldList.push({type:'date',value:'operateTime',text:'鐩樼偣鏃堕棿'}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundDetailForm.vue b/src/views/cms/modules/CuttingInboundDetailForm.vue new file mode 100644 index 0000000..253e81a --- /dev/null +++ b/src/views/cms/modules/CuttingInboundDetailForm.vue @@ -0,0 +1,114 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鍗�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ュ叆搴撳崟" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveNumber"> + <a-input-number v-model="model.receiveNumber" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" style="width: 100%" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingInboundDetailForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingInboundDetail/add", + edit: "/cms/cuttingInboundDetail/edit", + queryById: "/cms/cuttingInboundDetail/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundDetailModal.vue b/src/views/cms/modules/CuttingInboundDetailModal.vue new file mode 100644 index 0000000..8745ff7 --- /dev/null +++ b/src/views/cms/modules/CuttingInboundDetailModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <cutting-inbound-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inbound-detail-form> + </j-modal> +</template> + +<script> + + import CuttingInboundDetailForm from './CuttingInboundDetailForm' + export default { + name: 'CuttingInboundDetailModal', + components: { + CuttingInboundDetailForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundForm.vue b/src/views/cms/modules/CuttingInboundForm.vue new file mode 100644 index 0000000..35dce24 --- /dev/null +++ b/src/views/cms/modules/CuttingInboundForm.vue @@ -0,0 +1,139 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> + <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ュ叆搴撳崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> + <a-input v-model="model.receiver" placeholder="璇疯緭鍏ュ叆搴撲汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime"> + <j-date placeholder="璇烽�夋嫨鍏ュ簱鏃堕棿" v-model="model.receiveTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment"> + <a-input v-model="model.receiveComment" placeholder="璇疯緭鍏ュ叆搴撹鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-input v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingInboundForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingInbound/add", + edit: "/cms/cuttingInbound/edit", + queryById: "/cms/cuttingInbound/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundInventoryForm.vue b/src/views/cms/modules/CuttingInboundInventoryForm.vue new file mode 100644 index 0000000..9932287 --- /dev/null +++ b/src/views/cms/modules/CuttingInboundInventoryForm.vue @@ -0,0 +1,109 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ュ叆搴撳崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingInboundInventoryForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingInboundInventory/add", + edit: "/cms/cuttingInboundInventory/edit", + queryById: "/cms/cuttingInboundInventory/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundInventoryModal.vue b/src/views/cms/modules/CuttingInboundInventoryModal.vue new file mode 100644 index 0000000..e5a3424 --- /dev/null +++ b/src/views/cms/modules/CuttingInboundInventoryModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <cutting-inbound-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inbound-inventory-form> + </j-modal> +</template> + +<script> + + import CuttingInboundInventoryForm from './CuttingInboundInventoryForm' + export default { + name: 'CuttingInboundInventoryModal', + components: { + CuttingInboundInventoryForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInboundModal.vue b/src/views/cms/modules/CuttingInboundModal.vue new file mode 100644 index 0000000..1c508c2 --- /dev/null +++ b/src/views/cms/modules/CuttingInboundModal.vue @@ -0,0 +1,314 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鍏ュ簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨鍏ュ簱浜�" + v-decorator="['receiver', { rules: [{ required: true, message: '璇烽�夋嫨鍏ュ簱浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['receiveTime', validatorRules.receiveTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="鍏ュ簱璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ叆搴撹鏄�" v-decorator="['receiveComment', validatorRules.receiveComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" + >閫夋嫨鍒�鍏�</a-button + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input-number + v-if="col.dataIndex == 'receiveNumber'" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + </a-modal> +</template> + +<script> + + import pick from 'lodash.pick' + import JSelectToolingModal from './JSelectToolingModal' + import moment from 'moment' + import { getAction, postAction, requestPut } from '@/api/manage' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + import JMultiSelectTag from '@/components/dict/JMultiSelectTag' + import { filterObj } from '@/utils/util' + import store from '@/store/' + export default { + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data () { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + title:'鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + }, + { + title: '鍏ュ簱鏁伴噺', + align: 'center', + dataIndex: 'receiveNumber', + scopedSlots: { customRender: 'receiveNumber' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + url: { + add: '/cms/cuttingInbound/add', + detailList: '/cms/cuttingInbound/detailList', + }, + orderId:'', + disableSubmit:false + } + }, + methods: { + modalFormOk(){ + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let receiver = store.getters.userInfo.id + let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ receiver: receiver, receiveTime: receiveTime }) + }, + edit(record) { + record.receiver = store.getters.userInfo.id + record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].cuttingId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + this.$refs.toolingModalForm.disableSubmit = false + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨鍏ュ簱鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('鍏ュ簱鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + cuttingId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName + }) + } + }) + }, + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInventoryForm.vue b/src/views/cms/modules/CuttingInventoryForm.vue new file mode 100644 index 0000000..dbce8ca --- /dev/null +++ b/src/views/cms/modules/CuttingInventoryForm.vue @@ -0,0 +1,119 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏风紪鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏锋潯鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingBarcode"> + <a-input v-model="model.cuttingBarcode" placeholder="璇疯緭鍏ュ垁鍏锋潯鐮�" ></a-input> + </a-form-model-item> + </a-col> + <!-- <a-col :span="24"> + <a-form-model-item label="搴撳瓨鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus"> + <a-input v-model="model.inventoryStatus" placeholder="璇疯緭鍏ュ簱瀛樼姸鎬�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰撳墠瀵垮懡(鐧惧垎姣�)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentLife"> + <a-input-number v-model="model.currentLife" placeholder="璇疯緭鍏ュ綋鍓嶅鍛�(鐧惧垎姣�)" style="width: 100%" /> + </a-form-model-item> + </a-col> --> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingInventoryForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingInventory/add", + edit: "/cms/cuttingInventory/edit", + queryById: "/cms/cuttingInventory/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingInventoryModal.vue b/src/views/cms/modules/CuttingInventoryModal.vue new file mode 100644 index 0000000..a9fcf22 --- /dev/null +++ b/src/views/cms/modules/CuttingInventoryModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <cutting-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-inventory-form> + </j-modal> +</template> + +<script> + + import CuttingInventoryForm from './CuttingInventoryForm' + export default { + name: 'CuttingInventoryModal', + components: { + CuttingInventoryForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingPropertiesForm.vue b/src/views/cms/modules/CuttingPropertiesForm.vue new file mode 100644 index 0000000..0a82515 --- /dev/null +++ b/src/views/cms/modules/CuttingPropertiesForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="灞炴�х紪鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyCode"> + <a-input v-model="model.propertyCode" placeholder="璇疯緭鍏ュ睘鎬х紪鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="灞炴�у悕绉�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyName"> + <a-input v-model="model.propertyName" placeholder="璇疯緭鍏ュ睘鎬у悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="璁¢噺鍗曚綅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyUnit"> + <a-input v-model="model.propertyUnit" placeholder="璇疯緭鍏ヨ閲忓崟浣�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="灞炴�у��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyValue"> + <a-input v-model="model.propertyValue" placeholder="璇疯緭鍏ュ睘鎬у��" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingPropertiesForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingProperties/add", + edit: "/cms/cuttingProperties/edit", + queryById: "/cms/cuttingProperties/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingPropertiesModal.vue b/src/views/cms/modules/CuttingPropertiesModal.vue new file mode 100644 index 0000000..050b8d6 --- /dev/null +++ b/src/views/cms/modules/CuttingPropertiesModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <cutting-properties-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-properties-form> + </j-modal> +</template> + +<script> + + import CuttingPropertiesForm from './CuttingPropertiesForm' + export default { + name: 'CuttingPropertiesModal', + components: { + CuttingPropertiesForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingReceiveDetailForm.vue b/src/views/cms/modules/CuttingReceiveDetailForm.vue new file mode 100644 index 0000000..3bb29a7 --- /dev/null +++ b/src/views/cms/modules/CuttingReceiveDetailForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ラ鐢ㄥ崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヤ欢鏉愯川" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workpieceMaterial"> + <a-input v-model="model.workpieceMaterial" placeholder="璇疯緭鍏ュ伐浠舵潗璐�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="浣跨敤瀵垮懡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usedLife"> + <a-input-number v-model="model.usedLife" placeholder="璇疯緭鍏ヤ娇鐢ㄥ鍛�" style="width: 100%" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingReceiveDetailForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingReceiveDetail/add", + edit: "/cms/cuttingReceiveDetail/edit", + queryById: "/cms/cuttingReceiveDetail/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingReceiveDetailModal.vue b/src/views/cms/modules/CuttingReceiveDetailModal.vue new file mode 100644 index 0000000..8d02bd5 --- /dev/null +++ b/src/views/cms/modules/CuttingReceiveDetailModal.vue @@ -0,0 +1,359 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨棰嗙敤浜�" + v-decorator="['receiver', { rules: [{ required: true, message: '璇烽�夋嫨棰嗙敤浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="棰嗙敤鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['receiveTime', validatorRules.receiveTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="棰嗙敤璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" v-decorator="['receiveComment', validatorRules.receiveComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnTime', validatorRules.returnTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樿鏄�" v-decorator="['returnComment', validatorRules.returnComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨褰掕繕纭浜�" + v-decorator="['returnConfirmer', { rules: [{ required: false, message: '璇烽�夋嫨褰掕繕纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" + >閫夋嫨鍒�鍏�</a-button + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input-number + v-if="col.dataIndex == 'receiveNumber'" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + </a-modal> +</template> + +<script> + + import pick from 'lodash.pick' + import JSelectToolingModal from './JSelectToolingModal' + import moment from 'moment' + import { getAction, postAction, requestPut } from '@/api/manage' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + import JMultiSelectTag from '@/components/dict/JMultiSelectTag' + import { filterObj } from '@/utils/util' + import store from '@/store/' + export default { + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data () { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + title:'鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + url: { + add: '/cms/cuttingReceive/add', + detailList: '/cms/cuttingInbound/detailList', + }, + orderId:'', + disableSubmit:false + } + }, + methods: { + modalFormOk(){ + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let receiver = store.getters.userInfo.id + let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ receiver: receiver, receiveTime: receiveTime }) + }, + edit(record) { + record.receiver = store.getters.userInfo.id + record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].cuttingId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + this.$refs.toolingModalForm.disableSubmit = false + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨鍏ュ簱鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('棰嗙敤鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + cuttingId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName + }) + } + }) + }, + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingReceiveForm.vue b/src/views/cms/modules/CuttingReceiveForm.vue new file mode 100644 index 0000000..5097170 --- /dev/null +++ b/src/views/cms/modules/CuttingReceiveForm.vue @@ -0,0 +1,169 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> + <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ラ鐢ㄥ崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> + <a-input v-model="model.receiver" placeholder="璇疯緭鍏ラ鐢ㄤ汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime"> + <j-date placeholder="璇烽�夋嫨棰嗙敤鏃堕棿" v-model="model.receiveTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment"> + <a-input v-model="model.receiveComment" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-input v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnFlag"> + <a-input v-model="model.returnFlag" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕鏃堕棿" v-model="model.returnTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment"> + <a-input v-model="model.returnComment" placeholder="璇疯緭鍏ュ綊杩樿鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmer"> + <a-input v-model="model.returnConfirmer" placeholder="璇疯緭鍏ュ綊杩樼‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕纭鏃堕棿" v-model="model.returnConfirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment"> + <a-input v-model="model.returnConfirmComment" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingReceiveForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingReceive/add", + edit: "/cms/cuttingReceive/edit", + queryById: "/cms/cuttingReceive/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingReceiveModal.vue b/src/views/cms/modules/CuttingReceiveModal.vue new file mode 100644 index 0000000..d6e3212 --- /dev/null +++ b/src/views/cms/modules/CuttingReceiveModal.vue @@ -0,0 +1,379 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨棰嗙敤浜�" + v-decorator="['receiver', { rules: [{ required: true, message: '璇烽�夋嫨棰嗙敤浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="棰嗙敤鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['receiveTime', validatorRules.receiveTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="棰嗙敤璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" v-decorator="['receiveComment', validatorRules.receiveComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnTime', validatorRules.returnTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樿鏄�" v-decorator="['returnComment', validatorRules.returnComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨褰掕繕纭浜�" + v-decorator="['returnConfirmer', { rules: [{ required: false, message: '璇烽�夋嫨褰掕繕纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" + >閫夋嫨鍒�鍏�</a-button + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input + :value="text" + :disabled="disableSubmit" + v-if="col.dataIndex == 'workpieceMaterial'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + <a-input-number + v-if="col.dataIndex == 'usedLife'" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + </a-modal> +</template> + +<script> + + import pick from 'lodash.pick' + import JSelectToolingModal from './JSelectToolingModal' + import moment from 'moment' + import { getAction, postAction, requestPut } from '@/api/manage' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + import JMultiSelectTag from '@/components/dict/JMultiSelectTag' + import { filterObj } from '@/utils/util' + import store from '@/store/' + export default { + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data () { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + title:'鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + }, + { + title: '宸ヤ欢鏉愯川', + align: 'center', + dataIndex: 'workpieceMaterial', + scopedSlots: { customRender: 'workpieceMaterial' }, + + }, + { + title: '浣跨敤瀵垮懡', + align: 'center', + dataIndex: 'usedLife', + scopedSlots: { customRender: 'usedLife' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + url: { + add: '/cms/cuttingReceive/add', + detailList: '/cms/cuttingReceive/detailList', + }, + orderId:'', + disableSubmit:false + } + }, + methods: { + modalFormOk(){ + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let receiver = store.getters.userInfo.id + let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ receiver: receiver, receiveTime: receiveTime }) + }, + edit(record) { + record.receiver = store.getters.userInfo.id + record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment' + , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].cuttingId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + this.$refs.toolingModalForm.disableSubmit = false + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨鍏ュ簱鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('棰嗙敤鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + cuttingId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName + }) + } + }) + }, + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingScrapDetailForm.vue b/src/views/cms/modules/CuttingScrapDetailForm.vue new file mode 100644 index 0000000..46e795c --- /dev/null +++ b/src/views/cms/modules/CuttingScrapDetailForm.vue @@ -0,0 +1,114 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鎶ュ簾鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ユ姤搴熷崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingScrapDetailForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingScrapDetail/add", + edit: "/cms/cuttingScrapDetail/edit", + queryById: "/cms/cuttingScrapDetail/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingScrapDetailModal.vue b/src/views/cms/modules/CuttingScrapDetailModal.vue new file mode 100644 index 0000000..75fcd2c --- /dev/null +++ b/src/views/cms/modules/CuttingScrapDetailModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <cutting-scrap-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cutting-scrap-detail-form> + </j-modal> +</template> + +<script> + + import CuttingScrapDetailForm from './CuttingScrapDetailForm' + export default { + name: 'CuttingScrapDetailModal', + components: { + CuttingScrapDetailForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingScrapForm.vue b/src/views/cms/modules/CuttingScrapForm.vue new file mode 100644 index 0000000..d2770e9 --- /dev/null +++ b/src/views/cms/modules/CuttingScrapForm.vue @@ -0,0 +1,139 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> + <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鎶ュ簾鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ユ姤搴熷崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> + <a-input v-model="model.applicant" placeholder="璇疯緭鍏ョ敵璇蜂汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime"> + <j-date placeholder="璇烽�夋嫨鐢宠鏃堕棿" v-model="model.applicationTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment"> + <a-input v-model="model.applicationComment" placeholder="璇疯緭鍏ョ敵璇疯鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-input v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'CuttingScrapForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/cuttingScrap/add", + edit: "/cms/cuttingScrap/edit", + queryById: "/cms/cuttingScrap/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingScrapModal.vue b/src/views/cms/modules/CuttingScrapModal.vue new file mode 100644 index 0000000..027d35c --- /dev/null +++ b/src/views/cms/modules/CuttingScrapModal.vue @@ -0,0 +1,310 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨鐢宠浜�" + v-decorator="['applicant', { rules: [{ required: true, message: '璇烽�夋嫨鐢宠浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鐢宠鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['applicationTime', validatorRules.applicationTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="鐢宠璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ敵璇疯鏄�" v-decorator="['applicationComment', validatorRules.applicationComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" + >閫夋嫨鍒�鍏�</a-button + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input + :value="text" + :disabled="disableSubmit" + v-if="col.dataIndex == 'newCuttingId'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + </a-modal> +</template> + +<script> + + import pick from 'lodash.pick' + import JSelectToolingModal from './JSelectToolingModal' + import moment from 'moment' + import { getAction, postAction, requestPut } from '@/api/manage' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + import JMultiSelectTag from '@/components/dict/JMultiSelectTag' + import { filterObj } from '@/utils/util' + import store from '@/store/' + export default { + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data () { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + title:'鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + url: { + add: '/cms/cuttingScrap/add', + detailList: '/cms/cuttingScrap/detailList', + }, + orderId:'', + disableSubmit:false + } + }, + methods: { + modalFormOk(){ + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let applicant = store.getters.userInfo.id + let applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ applicant: applicant, applicationTime: applicationTime }) + }, + edit(record) { + record.applicant = store.getters.userInfo.id + record.applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'applicant', 'applicationTime', 'applicationComment', 'confirmer', 'confirmTime', 'confirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].cuttingId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + this.$refs.toolingModalForm.disableSubmit = false + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨鎶ュ簾鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('鎶ュ簾鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + cuttingId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName + }) + } + }) + }, + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/CuttingToolModal.vue b/src/views/cms/modules/CuttingToolModal.vue new file mode 100644 index 0000000..b6cc324 --- /dev/null +++ b/src/views/cms/modules/CuttingToolModal.vue @@ -0,0 +1,434 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍒�鍏风紪鐮�"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" v-decorator="['cuttingCode', validatorRules.cuttingCode]" /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍒�鍏峰悕绉�"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ垁鍏峰悕绉�" v-decorator="['cuttingName', validatorRules.cuttingName]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍒�鍏峰垎绫�"> + <j-search-select-tag + :disabled="isEdit" + placeholder="璇烽�夋嫨鍒�鍏峰垎绫�" + v-decorator="['cuttingCategory', validatorRules.cuttingCategory]" + dict="cutting_category" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="瀛樻斁浣嶇疆" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ瓨鏀句綅缃�" v-decorator="['storeLocation', validatorRules.storeLocation]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="渚涘簲鍟�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ヤ緵搴斿晢" v-decorator="['supplierId', validatorRules.supplierId]" /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="鏈�灏忓寘瑁呭崟浣�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ渶灏忓寘瑁呭崟浣�" v-decorator="['minimumPackageUnit', validatorRules.minimumPackageUnit]" /> + </a-form-item> + </a-col> + </a-row> + + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鍒�鍏锋潗璐�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ垁鍏锋潗璐�" v-decorator="['cuttingMaterial', validatorRules.cuttingMaterial]" /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="鍨嬪彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ瀷鍙�" v-decorator="['cuttingModel', validatorRules.cuttingModel]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鍥惧彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ュ浘鍙�" v-decorator="['drawingNumber', validatorRules.drawingNumber]" /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="搴撳瓨棰勮鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input-number :disabled="disableSubmit" style="width: 100%" :min=1 placeholder="璇疯緭鍏ュ簱瀛橀璀﹀��" v-decorator="['inventoryWarning', validatorRules.inventoryWarning]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="澶囨敞" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ娉�" v-decorator="['remark', validatorRules.remark]" /> + </a-form-item> + </a-col> + </a-row> + <!-- 瀛愯〃鏍间俊鎭�--> + <a-tabs defaultActiveKey="1"> + <a-tab-pane + tab="鍒�鍏锋槑缁�" + key="1" + > + + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination=false + > + + <template + v-for="col in columns" + :slot="col.dataIndex" + slot-scope='text, record, index' + > + <div :key="col.dataIndex"> + + + + <a-input + :value="text" + :disabled="disableSubmit" + v-if="col.dataIndex == 'propertyCode'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + <a-input + :value="text" + :disabled="disableSubmit" + v-else-if="col.dataIndex == 'propertyName'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + <a-input + :value="text" + :disabled="disableSubmit" + v-else-if="col.dataIndex == 'propertyUnit'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + <a-input + :value="text" + :disabled="disableSubmit" + v-else-if="col.dataIndex == 'propertyValue'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + </div> + </template> + + <template + slot="action" + slot-scope="text,record,index" + > + <a-popconfirm + title="鏄惁瑕佸垹闄ゆ琛岋紵" + @confirm="handleDelete(text,record,index)" + > + <Tooltip + placement="top" + title="鍒犻櫎" + > + <!-- shape="circle" --> + <a-button + :disabled="disableSubmit" + icon="delete" + /> + </Tooltip> + </a-popconfirm> + </template> + + </a-table> + + <a-button + :disabled="disableSubmit" + style="width: 100%; margin-top: 16px; margin-bottom: 8px" + type="dashed" + icon="plus" + @click="addPropertiesList" + >娣诲姞鎵╁睍灞炴��</a-button> + </a-tab-pane> + </a-tabs> + <!-- 瀛愯〃鏍间俊鎭粨鏉�--> + </a-form> + </a-spin> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" :disabled="isDisabled" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + </a-modal> +</template> + +<script> +import pick from 'lodash.pick' +import { ajaxGetDictItems } from '@/api/api' +import moment from 'moment' +import { getAction, postAction, requestPut } from '@/api/manage' +import JDictSelectTag from '@/components/dict/JDictSelectTag' +import JSearchSelectTag from '@/components/dict/JSearchSelectTag' +import JMultiSelectTag from '@/components/dict/JMultiSelectTag' +import { filterObj } from '@/utils/util' +import store from '@/store/' + +export default { + name: 'CuttingToolModel', + components: { + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data() { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + isDisabled: false, + selectedRowKeys: {}, + state: { + show: false, + maintenanceValue: 1, + checkValue: 1, + maintenanceState: false, + checkState: false, + }, + disableSubmit: false, + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + cuttingCode: { + rules: [ + { + required: true, + message: '璇疯緭鍏ュ垁鍏风紪鐮�!', + }, + ], + }, + cuttingName: { + rules: [ + { + required: true, + message: '璇疯緭鍏ュ垁鍏峰悕绉�!', + }, + ], + }, + cuttingCategory: { + rules: [ + { + required: true, + message: '璇烽�夋嫨鍒�鍏峰垎绫�!', + }, + ], + }, + }, + url: { + add: '/cms/cuttingTool/add', + edit: '/cms/cuttingTool/edit', + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '灞炴�х紪鐮�', + align: 'center', + dataIndex: 'propertyCode', + width: 150, + scopedSlots: { customRender: 'propertyCode' }, + }, + { + title: '灞炴�у悕绉�', + align: 'center', + dataIndex: 'propertyName', + scopedSlots: { customRender: 'propertyName' }, + }, + { + title: '灞炴�у崟浣�', + align: 'center', + dataIndex: 'propertyUnit', + scopedSlots: { customRender: 'propertyUnit' }, + }, + { + title: '灞炴�у��', + align: 'center', + dataIndex: 'propertyValue', + scopedSlots: { customRender: 'propertyValue' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + cuttingId:'', + deletePropertiesIds: [], + } + }, + created() { + }, + methods: { + add() { + this.edit() + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + if (record.id) { + this.dataSource = record.cuttingPropertiesList + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'cuttingCode', 'cuttingName', 'cuttingCategory', 'storeLocation','cuttingModel', 'supplierId', 'minimumPackageUnit', + 'cuttingMaterial','drawingNumber','inventoryWarning','remark') + ) + }) + }, + handleChange(value, key, column, index) { + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + handleDelete(text, record, index) { + this.dataSource.splice(index, 1); + if (undefined != record.id) { + this.deletePropertiesIds.push(record.id); + } + }, + handleOk() { + const that = this + let dataSource = that.dataSource; + let deletePropertiesIds = this.deletePropertiesIds; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + formData.cuttingPropertiesList = dataSource; + formData.deletePropertiesIds = deletePropertiesIds; + let obj; + if (!this.model.id) { + obj = postAction(this.url.add, formData); + } else { + obj = requestPut(this.url.edit, formData, { id: this.model.id }); + } + obj.then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }).catch((e) => { }) + }, + handleCancel() { + this.close() + }, + + //娣诲姞鎵╁睍灞炴�� + addPropertiesList() { + const temp = [...(this.dataSource || [])] + temp.push({}) + this.dataSource = temp + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + }, + watch: {}, + computed: { + }, + mounted() { + }, +} +</script> + + +<style lang="less" scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} + +/deep/ .notshow { + display: none; +} +</style> diff --git a/src/views/cms/modules/EdgeGrindingDetailForm.vue b/src/views/cms/modules/EdgeGrindingDetailForm.vue new file mode 100644 index 0000000..aae4eee --- /dev/null +++ b/src/views/cms/modules/EdgeGrindingDetailForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="淇(鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ヤ慨纾ㄥ崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏂板垁鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="newCuttingId"> + <a-input v-model="model.newCuttingId" placeholder="璇疯緭鍏ユ柊鍒�鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏂板簱瀛業D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="newInventoryId"> + <a-input v-model="model.newInventoryId" placeholder="璇疯緭鍏ユ柊搴撳瓨ID" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'EdgeGrindingDetailForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/edgeGrindingDetail/add", + edit: "/cms/edgeGrindingDetail/edit", + queryById: "/cms/edgeGrindingDetail/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/EdgeGrindingDetailModal.vue b/src/views/cms/modules/EdgeGrindingDetailModal.vue new file mode 100644 index 0000000..9a191f4 --- /dev/null +++ b/src/views/cms/modules/EdgeGrindingDetailModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <edge-grinding-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></edge-grinding-detail-form> + </j-modal> +</template> + +<script> + + import EdgeGrindingDetailForm from './EdgeGrindingDetailForm' + export default { + name: 'EdgeGrindingDetailModal', + components: { + EdgeGrindingDetailForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/EdgeGrindingForm.vue b/src/views/cms/modules/EdgeGrindingForm.vue new file mode 100644 index 0000000..5a5a602 --- /dev/null +++ b/src/views/cms/modules/EdgeGrindingForm.vue @@ -0,0 +1,164 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> + <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="淇(鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ヤ慨纾ㄥ崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> + <a-input v-model="model.applicant" placeholder="璇疯緭鍏ョ敵璇蜂汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime"> + <j-date placeholder="璇烽�夋嫨鐢宠鏃堕棿" v-model="model.applicationTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐢宠璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment"> + <a-input v-model="model.applicationComment" placeholder="璇疯緭鍏ョ敵璇疯鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-input v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕鏃堕棿" v-model="model.returnTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment"> + <a-input v-model="model.returnComment" placeholder="璇疯緭鍏ュ綊杩樿鏄�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmer"> + <a-input v-model="model.returnConfirmer" placeholder="璇疯緭鍏ュ綊杩樼‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕纭鏃堕棿" v-model="model.returnConfirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰掕繕纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment"> + <a-input v-model="model.returnConfirmComment" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'EdgeGrindingForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/edgeGrinding/add", + edit: "/cms/edgeGrinding/edit", + queryById: "/cms/edgeGrinding/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/EdgeGrindingModal.vue b/src/views/cms/modules/EdgeGrindingModal.vue new file mode 100644 index 0000000..9f37d63 --- /dev/null +++ b/src/views/cms/modules/EdgeGrindingModal.vue @@ -0,0 +1,362 @@ +<template> + <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨鐢宠浜�" + v-decorator="['applicant', { rules: [{ required: true, message: '璇烽�夋嫨鐢宠浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鐢宠鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['applicationTime', validatorRules.applicationTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="鐢宠璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ敵璇疯鏄�" v-decorator="['applicationComment', validatorRules.applicationComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨纭浜�" + v-decorator="['confirmer', { rules: [{ required: false, message: '璇烽�夋嫨纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['confirmTime', validatorRules.confirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnTime', validatorRules.returnTime]" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="褰掕繕璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樿鏄�" v-decorator="['returnComment', validatorRules.returnComment]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨褰掕繕纭浜�" + v-decorator="['returnConfirmer', { rules: [{ required: false, message: '璇烽�夋嫨褰掕繕纭浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="褰掕繕纭鏃ユ湡"> + <a-date-picker + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item label="褰掕繕纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" + >閫夋嫨鍒�鍏�</a-button + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input + :value="text" + :disabled="disableSubmit" + v-if="col.dataIndex == 'newCuttingId'" + @change="(e)=>handleChange(e.target.value, record.key, col, index)" + /> + + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit == false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" type="primary">鎻愪氦</a-button> + </template> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + </a-modal> +</template> + +<script> + + import pick from 'lodash.pick' + import JSelectToolingModal from './JSelectToolingModal' + import moment from 'moment' + import { getAction, postAction, requestPut } from '@/api/manage' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSearchSelectTag from '@/components/dict/JSearchSelectTag' + import JMultiSelectTag from '@/components/dict/JMultiSelectTag' + import { filterObj } from '@/utils/util' + import store from '@/store/' + export default { + name: 'CuttingInboundModal', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + store, + moment, + }, + data () { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + title:'鏂板', + visible: false, + selectedRowKeys: {}, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + param: {}, + validatorRules: { + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + width: 150, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + }, + { + title: '鏂板垁鍏风紪鐮�', + align: 'center', + dataIndex: 'newCuttingId', + scopedSlots: { customRender: 'newCuttingId' }, + + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + url: { + add: '/cms/edgeGrinding/add', + detailList: '/cms/edgeGrinding/detailList', + }, + orderId:'', + disableSubmit:false + } + }, + methods: { + modalFormOk(){ + + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + let applicant = store.getters.userInfo.id + let applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.edit({ applicant: applicant, applicationTime: applicationTime }) + }, + edit(record) { + record.applicant = store.getters.userInfo.id + record.applicationTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.disableSubmit = false + if (record.id) { + this.orderId = record.id + this.detailList(this.orderId) + } + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'applicant', 'applicationTime', 'applicationComment', 'confirmer', 'confirmTime', 'confirmComment' + , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') + ) + }) + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter((item) => key === item.key)[index] + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].cuttingId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨鍒�鍏�' + this.$refs.toolingModalForm.disableSubmit = false + }, + detailList(orderId) { + this.param.orderId = orderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleOk() { + if (this.dataSource.length == 0) { + this.$message.error('璇峰厛閫夋嫨淇(鍒�鍏�') + return + } + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + postAction(that.url.add, formData) + .then((res) => { + if (res.success) { + that.$message.success('淇(鍙戣捣鎴愬姛') + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.disableSubmit = false + }, + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + cuttingId: data[i].id, + cuttingCode: data[i].cuttingCode, + cuttingName: data[i].cuttingName + }) + } + }) + }, + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/JSelectToolingModal.vue b/src/views/cms/modules/JSelectToolingModal.vue new file mode 100644 index 0000000..6a9d294 --- /dev/null +++ b/src/views/cms/modules/JSelectToolingModal.vue @@ -0,0 +1,242 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <j-modal + :visible="visible" + :title="title" + switchFullscreen + :width="1200" + @ok="handleSubmit" + @cancel="close" + style="top: 50px" + cancelText="鍏抽棴" + > + <a-card :bordered="false"> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍒�鍏风紪鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.cuttingCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍒�鍏峰悕绉�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏峰悕绉�,鏀寔妯$硦鏌ヨ" v-model="queryParam.cuttingName"></a-input> + </a-form-item> + </a-col> + + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </a-row> + </a-form> + </div> + <!--鍒�鍏峰垪琛�--> + <a-table + ref="table" + :scroll="scrollTrigger" + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </a-card> + </j-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@/api/manage' + +export default { + name: 'JSelectToolingModal', + components: {}, + props: {}, + data() { + return { + queryParam: {}, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍒�鍏风紪鐮�', + align: 'center', + dataIndex: 'cuttingCode', + sorter: true, + }, + { + title: '鍒�鍏峰悕绉�', + align: 'center', + dataIndex: 'cuttingName', + sorter: true, + }, + { + title: '鍒�鍏峰垎绫�', + align: 'center', + dataIndex: 'cuttingCategory', + sorter: true, + }, + ], + selectedRowKeys: [], + oldSlelectRows: [], + scrollTrigger: {}, + dataSource: [], + selectionRows: [], + title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨鍒�鍏�', + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['5', '10', '20'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + isorter: { + column: 'num', + order: 'desc', + }, + departTree: [], + visible: false, + loading: false, + url: { + list: '/cms/cuttingTool/getCuttingToolList', + }, + } + }, + computed: { + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys + this.onSelectChange(selectedRows) + }, + getCheckboxProps: (record) => ({ + props: { + disabled: record.distable, + }, + }), + selectedRowKeys: this.selectedRowKeys, + } + }, + }, + watch: {}, + created() {}, + methods: { + async loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + let that = this + this.loading = true + let params = this.getQueryParams() //鏌ヨ鏉′欢 + await getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) { + res.result.records[i].distable = true + } else { + res.result.records[i].distable = false + } + } + this.dataSource = res.result.records + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + showModal(oldSlelectRows) { + this.oldSlelectRows = oldSlelectRows + this.visible = true + this.loadData(1) + }, + getQueryParams() { + let param = Object.assign({}, this.queryParam, this.isorter) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, + //鏌ヨ鏉′欢澶勭悊 + getQueryField() { + let str = 'id,' + for (let a = 0; a < this.columns.length; a++) { + str += ',' + this.columns[a].dataIndex + } + return str + }, + searchReset(num) { + let that = this + if (num !== 0) { + that.loadData(1) + } + that.selectborrowIds = [] + }, + close() { + this.searchReset(0) + this.selectedRowKeys = [] + this.visible = false + }, + handleTableChange(pagination, filters, sorter) { + //TODO 绛涢�� + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field + this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' + } + this.ipagination = pagination + this.loadData() + }, + handleSubmit() { + this.$bus.$emit('selectionRows', this.selectionRows) + this.searchReset(0) + this.close() + }, + onSelectChange(selectionRows) { + this.selectionRows = selectionRows + }, + onSearch() { + this.loadData(1) + }, + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {} + this.loadData(1) + }, + }, +} +</script> + +<style scoped> +.ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; +} + +#components-layout-demo-custom-trigger .trigger { + font-size: 18px; + line-height: 64px; + padding: 0 24px; + cursor: pointer; + transition: color 0.3s; +} +</style> \ No newline at end of file diff --git a/src/views/cms/modules/RatedLifeForm.vue b/src/views/cms/modules/RatedLifeForm.vue new file mode 100644 index 0000000..f780224 --- /dev/null +++ b/src/views/cms/modules/RatedLifeForm.vue @@ -0,0 +1,114 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏风紪鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> + <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヤ欢鏉愯川" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workpieceMaterial"> + <a-input v-model="model.workpieceMaterial" placeholder="璇疯緭鍏ュ伐浠舵潗璐�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="棰濆畾瀵垮懡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratedLife"> + <a-input-number v-model="model.ratedLife" placeholder="璇疯緭鍏ラ瀹氬鍛�" style="width: 100%" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'RatedLifeForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/ratedLife/add", + edit: "/cms/ratedLife/edit", + queryById: "/cms/ratedLife/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/RatedLifeModal.vue b/src/views/cms/modules/RatedLifeModal.vue new file mode 100644 index 0000000..87a72aa --- /dev/null +++ b/src/views/cms/modules/RatedLifeModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <rated-life-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rated-life-form> + </j-modal> +</template> + +<script> + + import RatedLifeForm from './RatedLifeForm' + export default { + name: 'RatedLifeModal', + components: { + RatedLifeForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingDetailForm.vue b/src/views/cms/modules/ToolStocktakingDetailForm.vue new file mode 100644 index 0000000..ece912e --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingDetailForm.vue @@ -0,0 +1,119 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏稩D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId" placeholder="璇疯緭鍏ュ垁鍏稩D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鍓嶆暟閲�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="beforeNumber"> + <a-input-number v-model="model.beforeNumber" placeholder="璇疯緭鍏ョ洏鐐瑰墠鏁伴噺" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="瀹為檯鐩樼偣鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualNumber"> + <a-input-number v-model="model.actualNumber" placeholder="璇疯緭鍏ュ疄闄呯洏鐐规暟閲�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣缁撴灉" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stocktakingResult"> + <a-input v-model="model.stocktakingResult" placeholder="璇疯緭鍏ョ洏鐐圭粨鏋�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'ToolStocktakingDetailForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/toolStocktakingDetail/add", + edit: "/cms/toolStocktakingDetail/edit", + queryById: "/cms/toolStocktakingDetail/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingDetailModal.vue b/src/views/cms/modules/ToolStocktakingDetailModal.vue new file mode 100644 index 0000000..62febb5 --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingDetailModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tool-stocktaking-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-detail-form> + </j-modal> +</template> + +<script> + + import ToolStocktakingDetailForm from './ToolStocktakingDetailForm' + export default { + name: 'ToolStocktakingDetailModal', + components: { + ToolStocktakingDetailForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingForm.vue b/src/views/cms/modules/ToolStocktakingForm.vue new file mode 100644 index 0000000..af27038 --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingForm.vue @@ -0,0 +1,129 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> + <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鍗曞彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode"> + <a-input v-model="model.orderCode" placeholder="璇疯緭鍏ョ洏鐐瑰崟鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ョ洏鐐圭姸鎬�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> + <a-input v-model="model.operator" placeholder="璇疯緭鍏ョ洏鐐逛汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> + <j-date placeholder="璇烽�夋嫨鐩樼偣鏃堕棿" v-model="model.operateTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-input v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'ToolStocktakingForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/toolStocktaking/add", + edit: "/cms/toolStocktaking/edit", + queryById: "/cms/toolStocktaking/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingInventoryChangeForm.vue b/src/views/cms/modules/ToolStocktakingInventoryChangeForm.vue new file mode 100644 index 0000000..087eadd --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingInventoryChangeForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鏄庣粏ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="detailId"> + <a-input v-model="model.detailId" placeholder="璇疯緭鍏ョ洏鐐规槑缁咺D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍒�鍏锋潯鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode"> + <a-input v-model="model.toolBarcode" placeholder="璇疯緭鍏ュ垁鍏锋潯鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁伴噺(榛樿1)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number"> + <a-input-number v-model="model.number" placeholder="璇疯緭鍏ユ暟閲�(榛樿1)" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeType"> + <a-input v-model="model.changeType" placeholder="璇疯緭鍏ュ彉鏇寸被鍨�;姝e父/鍑哄簱/鍏ュ簱" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'ToolStocktakingInventoryChangeForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/cms/toolStocktakingInventoryChange/add", + edit: "/cms/toolStocktakingInventoryChange/edit", + queryById: "/cms/toolStocktakingInventoryChange/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingInventoryChangeModal.vue b/src/views/cms/modules/ToolStocktakingInventoryChangeModal.vue new file mode 100644 index 0000000..5722dea --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingInventoryChangeModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tool-stocktaking-inventory-change-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-inventory-change-form> + </j-modal> +</template> + +<script> + + import ToolStocktakingInventoryChangeForm from './ToolStocktakingInventoryChangeForm' + export default { + name: 'ToolStocktakingInventoryChangeModal', + components: { + ToolStocktakingInventoryChangeForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/cms/modules/ToolStocktakingModal.vue b/src/views/cms/modules/ToolStocktakingModal.vue new file mode 100644 index 0000000..2ea7e1a --- /dev/null +++ b/src/views/cms/modules/ToolStocktakingModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tool-stocktaking-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-stocktaking-form> + </j-modal> +</template> + +<script> + + import ToolStocktakingForm from './ToolStocktakingForm' + export default { + name: 'ToolStocktakingModal', + components: { + ToolStocktakingForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3