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 | 444 +++++++++++++++++++++++++++++++++++------------------- 1 files changed, 286 insertions(+), 158 deletions(-) diff --git a/src/views/mes/MesMaterialTransferRequestList.vue b/src/views/mes/MesMaterialTransferRequestList.vue index b370b82..f025d83 100644 --- a/src/views/mes/MesMaterialTransferRequestList.vue +++ b/src/views/mes/MesMaterialTransferRequestList.vue @@ -12,24 +12,32 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <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-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> </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + <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>椤� + <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> @@ -46,38 +54,24 @@ :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 @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> @@ -95,138 +89,272 @@ <script> - import '@/assets/less/TableExpand.less' - import { mixinDevice } from '@/utils/mixin' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import MesMaterialTransferRequestModal from './modules/MesMaterialTransferRequestModal' - import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import MesMaterialTransferRequestModal from './modules/MesMaterialTransferRequestModal' +import { putAction } from '@api/manage' - export default { - name: 'MesMaterialTransferRequestList', - mixins:[JeecgListMixin, mixinDevice], - components: { - MesMaterialTransferRequestModal - }, - 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: 'requestCode' - }, - { - title:'宸ュ崟ID', - align:"center", - dataIndex: 'workOrderId' - }, - { - title:'SAP棰勭暀鍙�', - align:"center", - dataIndex: 'reservationCode' - }, - { - title:'鍙戝竷鐘舵��', - align:"center", - dataIndex: 'publishStatus_dictText' - }, - { - title:'璇锋眰鐘舵��', - align:"center", - dataIndex: 'requestStatus_dictText' - }, - { - title:'璇锋眰鏃堕棿', - align:"center", - dataIndex: 'requestTime' - }, - { - title:'鍘熷簱瀛樺湴', - align:"center", - dataIndex: 'originalWarehouseId' - }, - { - title:'鐩爣搴撳瓨鍦�', - align:"center", - dataIndex: 'targetWarehouseId' - }, - { - title:'浼樺厛绾э紙鎷夊姩绫诲瀷锛�', - align:"center", - dataIndex: 'priority_dictText' - }, - { - title:'鏈�鏅氶厤閫佹椂闂�', - align:"center", - dataIndex: 'latestDeliveryTime' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } +export default { + name: 'MesMaterialTransferRequestList', + mixins: [JeecgListMixin, mixinDevice], + components: { + MesMaterialTransferRequestModal + }, + data() { + return { + description: '鐗╂枡鎷夊姩鐢宠绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } - ], - url: { - list: "/mesmaterialtransferrequest/mesMaterialTransferRequest/list", - delete: "/mesmaterialtransferrequest/mesMaterialTransferRequest/delete", - deleteBatch: "/mesmaterialtransferrequest/mesMaterialTransferRequest/deleteBatch", - exportXlsUrl: "/mesmaterialtransferrequest/mesMaterialTransferRequest/exportXls", - importExcelUrl: "mesmaterialtransferrequest/mesMaterialTransferRequest/importExcel", - }, - dictOptions:{}, - superFieldList:[], + { + title: '鎷夊姩鍗曞彿', + align: 'center', + dataIndex: 'requestCode' + }, + { + title: '浠诲姟鍙�', + align: 'center', + dataIndex: 'workOrderId_dictText' + }, + { + title: 'SAP棰勭暀鍙�', + align: 'center', + 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: '璇锋眰鐘舵��', + align: 'center', + dataIndex: 'requestStatus_dictText' + }, + { + title: '璇锋眰鏃堕棿', + align: 'center', + dataIndex: 'requestTime' + }, + { + title: '鍘熷簱瀛樺湴', + align: 'center', + dataIndex: 'originalWarehouseId_dictText' + }, + { + title: '鐩爣搴撳瓨鍦�', + align: 'center', + dataIndex: 'targetWarehouseId_dictText' + }, + { + title: '鎷夊姩绫诲瀷', + align: 'center', + dataIndex: 'materialTransferCategory_dictText' + }, + { + title: '鏈�鏅氶厤閫佹椂闂�', + align: 'center', + dataIndex: 'latestDeliveryTime' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/mes/mesMaterialTransferRequest/list', + delete: '/mes/mesMaterialTransferRequest/delete', + deleteBatch: '/mes/mesMaterialTransferRequest/deleteBatch', + publish: '/mes/mesMaterialTransferRequest/publish', + publishBatch: '/mes/mesMaterialTransferRequest/publishBatch', + request: '/mes/mesMaterialTransferRequest/request', + requestBatch: '/mes/mesMaterialTransferRequest/requestBatch' + } + } + }, + created() { + }, + computed: {}, + 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 + }) + } + }) } }, - 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:'鍒犻櫎鏍囪',dictCode:''}) - fieldList.push({type:'string',value:'requestCode',text:'鎷夊姩鍗曞彿',dictCode:''}) - fieldList.push({type:'string',value:'workOrderId',text:'宸ュ崟ID',dictCode:''}) - fieldList.push({type:'string',value:'reservationCode',text:'SAP棰勭暀鍙�',dictCode:''}) - fieldList.push({type:'string',value:'publishStatus',text:'鍙戝竷鐘舵��',dictCode:'publish_status'}) - fieldList.push({type:'string',value:'requestStatus',text:'璇锋眰鐘舵��',dictCode:'request_status'}) - fieldList.push({type:'datetime',value:'requestTime',text:'璇锋眰鏃堕棿'}) - fieldList.push({type:'string',value:'originalWarehouseId',text:'鍘熷簱瀛樺湴',dictCode:''}) - fieldList.push({type:'string',value:'targetWarehouseId',text:'鐩爣搴撳瓨鍦�',dictCode:''}) - fieldList.push({type:'string',value:'priority',text:'浼樺厛绾э紙鎷夊姩绫诲瀷锛�',dictCode:'priority'}) - fieldList.push({type:'datetime',value:'latestDeliveryTime',text:'鏈�鏅氶厤閫佹椂闂�'}) - this.superFieldList = fieldList + 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> - @import '~@assets/less/common.less'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file -- Gitblit v1.9.3