From 2a73c13dbf00d9218e398ee40a4522bf67e1e7e7 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期一, 25 八月 2025 16:00:33 +0800 Subject: [PATCH] art: 物料拉动前端逻辑添加 --- src/views/mes/MesMaterialTransferRequestList.vue | 209 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 196 insertions(+), 13 deletions(-) diff --git a/src/views/mes/MesMaterialTransferRequestList.vue b/src/views/mes/MesMaterialTransferRequestList.vue index c2242c4..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', @@ -106,9 +122,9 @@ dataIndex: 'requestCode' }, { - title: '宸ュ崟ID', + title: '浠诲姟鍙�', align: 'center', - dataIndex: 'workOrderId' + dataIndex: 'workOrderId_dictText' }, { title: 'SAP棰勭暀鍙�', @@ -116,9 +132,34 @@ dataIndex: 'reservationCode' }, { + title: '鐗╂枡缂栫爜', + align: 'center', + dataIndex: 'materialNumber' + }, + { + title: '鐗╂枡鍚嶇О', + align: 'center', + dataIndex: 'materialName' + }, + { + title: '鐞嗚鎷夊姩鏁伴噺', + align: 'center', + dataIndex: 'specifiedQuantity' + }, + { + title: '瀹為檯鎷夊姩鏁伴噺', + align: 'center', + dataIndex: 'actualQuantity' + }, + { title: '鍙戝竷鐘舵��', align: 'center', dataIndex: 'publishStatus_dictText' + }, + { + title: '鍙戝竷鏃堕棿', + align: 'center', + dataIndex: 'publishTime' }, { title: '璇锋眰鐘舵��', @@ -133,17 +174,17 @@ { title: '鍘熷簱瀛樺湴', align: 'center', - dataIndex: 'originalWarehouseId' + dataIndex: 'originalWarehouseId_dictText' }, { title: '鐩爣搴撳瓨鍦�', align: 'center', - dataIndex: 'targetWarehouseId' + dataIndex: 'targetWarehouseId_dictText' }, { - title: '浼樺厛绾э紙鎷夊姩绫诲瀷锛�', + title: '鎷夊姩绫诲瀷', align: 'center', - dataIndex: 'priority_dictText' + dataIndex: 'materialTransferCategory_dictText' }, { title: '鏈�鏅氶厤閫佹椂闂�', @@ -162,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> -- Gitblit v1.9.3