From ab497be6338bfdeaefbaebc60081ba18453da4ef Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期二, 26 八月 2025 15:06:29 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/mes/modules/MesMaterialTransferRequestForm.vue | 8 .env.production | 2 src/views/cms/CuttingInventoryList.vue | 208 +++++++++++++++++++++++++++++ src/views/mes/MesMaterialTransferRequestList.vue | 172 +++++++++++++++++++++++- 4 files changed, 376 insertions(+), 14 deletions(-) diff --git a/.env.production b/.env.production index 8215371..32d31f8 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://127.0.0.1:9989 +VUE_APP_API_BASE_URL=http://10.210.199.3:6099 VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/src/views/cms/CuttingInventoryList.vue b/src/views/cms/CuttingInventoryList.vue index 7d31077..b1a972f 100644 --- a/src/views/cms/CuttingInventoryList.vue +++ b/src/views/cms/CuttingInventoryList.vue @@ -108,8 +108,23 @@ </a-menu> </a-dropdown> </span> - </a-table> + </div> + <!-- 搴撳瓨缁熻琛ㄦ牸 --> + <div style="margin-top: 20px;"> + <a-card title="搴撳瓨缁熻"> + <a-table + :pagination="statisticsPagination" + :columns="statisticsColumns"/>in + :dataSource="statisticsData" + :loading="statisticsLoading" + bordered + size="middle"> + <span slot="inventoryStatus" slot-scope="text"> + <a-tag :color="getTagColor(text)">{{ text }}</a-tag> + </span> + /> + </a-card> </div> <cutting-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inventory-modal> @@ -173,20 +188,80 @@ // scopedSlots: { customRender: 'action' } // } ], + // 缁熻琛ㄦ牸鍒楀畾涔� + statisticsColumns: [ + { + title:'鍒�鍏风紪鐮�', + align:"center", + dataIndex: 'cuttingCode', + customRender: (text, record, index) => { + const obj = { + children: text, + attrs: {} + }; + // 璁剧疆鍚堝苟閫昏緫 + if (record.rowSpan !== undefined) { + obj.attrs.rowSpan = record.rowSpan; + } else { + obj.attrs.rowSpan = 1; + } + return obj; + } + }, + { + title: '搴撳瓨鐘舵��', + dataIndex: 'inventoryStatus', + align: "center", + }, + { + title: '鏁伴噺', + dataIndex: 'cuttingIdNumber', + align: "center" + } + ], url: { list: "/cms/cuttingInventory/list", delete: "/cms/cuttingInventory/delete", deleteBatch: "/cms/cuttingInventory/deleteBatch", exportXlsUrl: "/cms/cuttingInventory/exportXls", importExcelUrl: "cms/cuttingInventory/importExcel", - + statistics: "/cms/cuttingInventory/statistics" // 娣诲姞缁熻鎺ュ彛鍦板潃 }, dictOptions:{}, superFieldList:[], + // 缁熻鏁版嵁 + statisticsData: [], + statisticsLoading: false, + + // 涓轰富琛ㄦ牸淇濈暀鍘熸湁鐨勫垎椤甸厤缃� + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + // 涓虹粺璁¤〃鏍兼坊鍔犲崟鐙殑鍒嗛〉閰嶇疆 + statisticsPagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + } } }, created() { - this.getSuperFieldList(); + this.getSuperFieldList(); + this.loadStatisticsData(); }, computed: { importExcelUrl: function(){ @@ -203,8 +278,133 @@ fieldList.push({type:'string',value:'inventoryStatus',text:'搴撳瓨鐘舵��'}) fieldList.push({type:'number',value:'currentLife',text:'褰撳墠瀵垮懡(鐧惧垎姣�)'}) this.superFieldList = fieldList + }, + // 鍔犺浇缁熻淇℃伅 + loadStatisticsData() { + this.statisticsLoading = true; + // 璋冪敤鍚庣鎺ュ彛鑾峰彇缁熻鏁版嵁 + this.$http({ + url: this.url.statistics, + method: "get", + params: { + ...this.getQueryParams(), + pageNo: this.statisticsPagination.current, + pageSize: this.statisticsPagination.pageSize + } + }).then((res) => { + if (res.success) { + // 鏇存柊缁熻琛ㄦ牸鐨勫垎椤垫�绘暟 + this.statisticsPagination.total = res.result.total; + // 瀵规暟鎹繘琛屽悎骞跺鐞嗭紝浣跨敤 res.result.records 鑰屼笉鏄� res.result + this.statisticsData = this.mergeStatisticsData(res.result.records); + } + this.statisticsLoading = false; + }).catch(() => { + this.statisticsLoading = false; + }); + }, + + // 鏍规嵁鐘舵�佽繑鍥炴爣绛鹃鑹� + getTagColor(status) { + const colorMap = { + '姝e父': 'green', + '宸插嚭搴�': 'orange', + }; + return colorMap[status]; + }, + + // 閲嶅啓鎼滅储鏂规硶锛屽湪鎼滅储瀹屾垚鍚庡姞杞界粺璁′俊鎭� + searchQuery() { + this.loadData(1); + // 鎼滅储瀹屾垚鍚庡姞杞界粺璁′俊鎭� + this.$nextTick(() => { + this.loadStatisticsData(); + }); + }, + + // 閲嶅啓閲嶇疆鏂规硶 + searchReset() { + this.queryParam = {}; + this.loadData(1); + this.$nextTick(() => { + this.loadStatisticsData(); + }); + }, + + // 閲嶅啓鍔犺浇鏁版嵁鏂规硶 + loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + this.$http({ + url: this.url.list, + method: "get", + params: params + }).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + + // 鍔犺浇缁熻淇℃伅 + this.loadStatisticsData(); + } + this.loading = false; + }) + }, + // 鍚堝苟缁熻鏁版嵁鏂规硶 + mergeStatisticsData(data) { + if (!data || data.length === 0) return []; + + const grouped = {}; + + // 鎸夊垁鍏风紪鐮佸垎缁� + data.forEach(item => { + const key = item.cuttingCode; + if (!grouped[key]) { + grouped[key] = { + cuttingCode: item.cuttingCode, + cuttingId: item.cuttingId, + statuses: [] + }; + } + // 浣跨敤 item.inventoryStatus 鍜� item.cuttingIdNumber + grouped[key].statuses.push({ + status: item.inventoryStatus, + count: item.cuttingIdNumber + }); + }); + + // 杞崲涓鸿〃鏍奸渶瑕佺殑鏍煎紡锛屽苟娣诲姞琛屽悎骞朵俊鎭� + const result = []; + Object.values(grouped).forEach(group => { + const statuses = group.statuses; + const totalCount = statuses.reduce((sum, s) => sum + s.count, 0); + + // 绗竴琛屾樉绀哄垁鍏风紪鐮侊紝璁剧疆rowSpan + result.push({ + cuttingCode: group.cuttingCode, + cuttingId: group.cuttingId, + inventoryStatus: `${statuses[0].status}:${statuses[0].count}`, + cuttingIdNumber: totalCount, + rowSpan: statuses.length // 鍚堝苟鐨勮鏁� + }); + + // 鍓╀綑琛屽彧鏄剧ず鐘舵�佷俊鎭紝鍒�鍏风紪鐮佸垪rowSpan涓�0 + for (let i = 1; i < statuses.length; i++) { + result.push({ + cuttingCode: group.cuttingCode, + cuttingId: group.cuttingId, + inventoryStatus: `${statuses[i].status}:${statuses[i].count}`, + cuttingIdNumber: totalCount, + rowSpan: 0 // 琛ㄧず琚悎骞� + }); + } + }); + return result; } - } + }, } </script> <style scoped> diff --git a/src/views/mes/MesMaterialTransferRequestList.vue b/src/views/mes/MesMaterialTransferRequestList.vue index 1f757c4..f025d83 100644 --- a/src/views/mes/MesMaterialTransferRequestList.vue +++ b/src/views/mes/MesMaterialTransferRequestList.vue @@ -14,7 +14,15 @@ <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"> + <a-menu-item key="1" @click="batchPublish"> + <a-icon type="check-circle" theme="filled" /> + 鍙戝竷 + </a-menu-item> + <a-menu-item key="2" @click="batchRequest"> + <a-icon type="check-square" theme="filled" /> + 璇锋眰WMS + </a-menu-item> + <a-menu-item key="3" @click="batchDel"> <a-icon type="delete" /> 鍒犻櫎 </a-menu-item> @@ -47,16 +55,23 @@ class="j-table-force-nowrap" @change="handleTableChange"> <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical" /> + <a @click="handleEdit(record)" v-if="record.publishStatus === 'WAIT_PUBLISH'">缂栬緫</a> + <a-divider type="vertical" v-if="record.publishStatus === 'WAIT_PUBLISH'" /> + <a-popconfirm title="纭畾鍙戝竷鍚�?" @confirm="() => handlePublish(record.id)" v-if="record.publishStatus === 'WAIT_PUBLISH'"> + <a>鍙戝竷</a> + </a-popconfirm> + <a-divider type="vertical" v-if="record.publishStatus === 'WAIT_PUBLISH'" /> + <a-popconfirm title="纭畾璇锋眰WMS鍚�?" @confirm="() => handleRequest(record.id)" v-if="record.publishStatus === 'PUBLISHED' && record.requestStatus === 'WAIT_REQUEST'"> + <a>璇锋眰WMS</a> + </a-popconfirm> + <a-divider type="vertical" v-if="record.publishStatus === 'PUBLISHED' && record.requestStatus === 'WAIT_REQUEST'" /> <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-menu-item v-if="record.publishStatus === 'WAIT_PUBLISH'"> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> </a-popconfirm> @@ -78,6 +93,7 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import MesMaterialTransferRequestModal from './modules/MesMaterialTransferRequestModal' +import { putAction } from '@api/manage' export default { name: 'MesMaterialTransferRequestList', @@ -187,14 +203,156 @@ url: { list: '/mes/mesMaterialTransferRequest/list', delete: '/mes/mesMaterialTransferRequest/delete', - deleteBatch: '/mes/mesMaterialTransferRequest/deleteBatch' + deleteBatch: '/mes/mesMaterialTransferRequest/deleteBatch', + publish: '/mes/mesMaterialTransferRequest/publish', + publishBatch: '/mes/mesMaterialTransferRequest/publishBatch', + request: '/mes/mesMaterialTransferRequest/request', + requestBatch: '/mes/mesMaterialTransferRequest/requestBatch' } } }, created() { }, computed: {}, - methods: {} + methods: { + handlePublish(id) { + if(!this.url.publish){ + this.$message.error("璇疯缃畊rl.publish灞炴��!") + return + } + let that = this; + putAction(that.url.publish, {id: id}).then((res) => { + if (res.success) { + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.loadData(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }); + }, + handleRequest(id) { + if(!this.url.request){ + this.$message.error("璇疯缃畊rl.request灞炴��!") + return + } + let that = this; + putAction(that.url.request, {id: id}).then((res) => { + if (res.success) { + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.loadData(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }); + + }, + batchPublish() { + if (!this.url.publishBatch) { + this.$message.error('璇疯缃畊rl.publishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } else { + let ids = '' + for (let a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + let that = this + this.$confirm({ + title: '纭鍙戝竷', + content: '鏄惁鍙戝竷閫変腑鏁版嵁?', + onOk: function() { + that.loading = true + putAction(that.url.publishBatch, { ids: ids }).then((res) => { + if (res.success) { + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + batchRequest() { + if (!this.url.requestBatch) { + this.$message.error('璇疯缃畊rl.requestBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } else { + let ids = '' + for (let a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + let that = this + this.$confirm({ + title: '纭璇锋眰WMS', + content: '鏄惁灏嗛�変腑鏁版嵁璇锋眰WMS?', + onOk: function() { + that.loading = true + putAction(that.url.requestBatch, { ids: ids }).then((res) => { + if (res.success) { + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + } + } } </script> <style scoped> diff --git a/src/views/mes/modules/MesMaterialTransferRequestForm.vue b/src/views/mes/modules/MesMaterialTransferRequestForm.vue index 8bbbbf1..5881aca 100644 --- a/src/views/mes/modules/MesMaterialTransferRequestForm.vue +++ b/src/views/mes/modules/MesMaterialTransferRequestForm.vue @@ -12,12 +12,12 @@ <a-form-model-item label="璧峰搴撳瓨鍦扮偣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalWarehouseId"> <j-dict-select-tag type="list" v-model="model.originalWarehouseId" dictCode="original_warehouse_list" - placeholder="璇烽�夋嫨璧峰搴撳瓨鍦扮偣" /> + placeholder="璇烽�夋嫨璧峰搴撳瓨鍦扮偣" :disabled="formDisabled || editable" /> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item label="浠诲姟鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderCode"> - <work-order-select-modal :workOrder="workOrderObj" :submitDisabled="formDisabled" + <work-order-select-modal :workOrder="workOrderObj" :submitDisabled="formDisabled || editable" orderStatus="PUBLISHED" @ok="selectConfirm"></work-order-select-modal> </a-form-model-item> </a-col> @@ -91,6 +91,7 @@ sm: { span: 16 } }, confirmLoading: false, + editable: false, validatorRules: { originalWarehouseId: [ { required: true, message: '璧峰搴撳瓨鍦扮偣蹇呴��', trigger: 'change' } @@ -139,6 +140,7 @@ this.model.workOrderCode = this.model.workOrderId_dictText this.visible = true if (this.model.workOrderId) { + this.editable = true; let workOrderRes = await this.loadProductionWorkOrder(this.model.workOrderId) if(!workOrderRes.success || !workOrderRes.result) { return; @@ -161,6 +163,8 @@ this.model.targetWarehouseId = undefined this.model.warehouseName = '' } + }else { + this.editable = false; } }, async selectConfirm(rows) { -- Gitblit v1.9.3