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 |  177 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 170 insertions(+), 7 deletions(-)

diff --git a/src/views/mes/MesMaterialTransferRequestList.vue b/src/views/mes/MesMaterialTransferRequestList.vue
index 66e40e5..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',
@@ -141,6 +157,11 @@
           dataIndex: 'publishStatus_dictText'
         },
         {
+          title: '鍙戝竷鏃堕棿',
+          align: 'center',
+          dataIndex: 'publishTime'
+        },
+        {
           title: '璇锋眰鐘舵��',
           align: 'center',
           dataIndex: 'requestStatus_dictText'
@@ -182,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