From f8c8e4a223e9b8aad3c5aa73de33fef0668fa904 Mon Sep 17 00:00:00 2001
From: lixiangyu <lixiangyu@xalxzn.com>
Date: 星期一, 15 九月 2025 13:41:47 +0800
Subject: [PATCH] feat(cms): 恢复刀具领用页面

---
 src/views/cms/CuttingReceiveList.vue |  149 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 143 insertions(+), 6 deletions(-)

diff --git a/src/views/cms/CuttingReceiveList.vue b/src/views/cms/CuttingReceiveList.vue
index 36899db..b407a53 100644
--- a/src/views/cms/CuttingReceiveList.vue
+++ b/src/views/cms/CuttingReceiveList.vue
@@ -100,9 +100,27 @@
           </a-button>
         </template>
 
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
+        <!--        <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>-->
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)" :disabled="record.orderStatus === '2' || record.orderStatus === '3'">缂栬緫</a>
           <a-divider type="vertical" />
           <a-dropdown>
             <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
@@ -110,10 +128,16 @@
               <a-menu-item>
                 <a @click="handleDetail(record)">璇︽儏</a>
               </a-menu-item>
-              <a-menu-item>
+              <a-menu-item v-if="record.orderStatus === '1'">
+                  <a @click="handleSubmit(record.id)" :disabled="record.orderStatus === '3'">鎻愪氦</a>
+              </a-menu-item>
+              <a-menu-item v-if="record.orderStatus === '1'">
                 <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
                   <a>鍒犻櫎</a>
                 </a-popconfirm>
+              </a-menu-item>
+               <a-menu-item v-if="record.orderStatus === '2'">
+                  <a @click="handleBack(record.id)">褰掕繕</a>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
@@ -137,6 +161,7 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import CuttingReceiveModal from './modules/CuttingReceiveModal'
 import CuttingReceiveDetailList from './CuttingReceiveDetailList'
+import { httpAction } from '@api/manage'
 
 export default {
   name: 'CuttingReceiveList',
@@ -235,7 +260,7 @@
         {
           title: '棰嗙敤鍗曠姸鎬�',
           align: 'center',
-          dataIndex: 'orderStatus'
+          dataIndex: 'orderStatus_dictText'
         },
         {
           title: '鎿嶄綔',
@@ -251,8 +276,9 @@
         delete: '/cms/cuttingReceive/delete',
         deleteBatch: '/cms/cuttingReceive/deleteBatch',
         exportXlsUrl: '/cms/cuttingReceive/exportXls',
-        importExcelUrl: 'cms/cuttingReceive/importExcel'
-
+        importExcelUrl: 'cms/cuttingReceive/importExcel',
+        submit: '/cms/cuttingReceive/submit',
+        returnBack: '/cms/cuttingReceive/handleBack'
       },
       dictOptions: {},
       superFieldList: []
@@ -307,6 +333,117 @@
           }
         }
       }
+    },
+
+    /**
+     *  鍗曟嵁鎻愪氦
+     */
+    handleSubmit: function(id) {
+      if (!this.url.submit) {
+        this.$message.error('璇疯缃畊rl.submit灞炴��!')
+        return
+      }
+
+      let targetId = id // 浠庡弬鏁拌幏鍙朓D
+      // 濡傛灉娌℃湁閫氳繃鍙傛暟浼犻�扞D锛屽垯妫�鏌ラ�変腑鐨勮褰�
+      if (!targetId) {
+        if (this.selectedRowKeys.length != 1) {
+          this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+          return
+        } else {
+          targetId = this.selectedRowKeys[0]
+        }
+      }
+
+      // 灏嗗弬鏁颁綔涓烘煡璇㈠弬鏁伴檮鍔犲埌URL涓�
+      let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId)
+      let method = 'get'
+      var params = {}  // 娓呯┖params锛屽洜涓哄弬鏁板凡缁忓湪URL涓紶閫�
+
+      const that = this
+
+      this.$confirm({
+        title: '纭鎻愪氦锛�',
+        // content: '姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          // 鏄剧ず鍔犺浇鎻愮ず
+          const hide = that.$message.loading('姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...', 0)
+
+          // 鍙戦�佽姹�
+          return httpAction(httpurl, params, method).then((res) => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            if (res.success) {
+              that.$message.success(res.message)
+              that.loadData()
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).catch(error => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            that.$message.error('鎻愪氦澶辫触: ' + error.message)
+          }).finally(() => {
+            that.loading = false
+          })
+        }
+      })
+    },
+
+    /**
+     *  鍗曟嵁棰嗙敤
+     */
+
+    handleBack: function(id) {
+      if (!this.url.returnBack) {
+        this.$message.error('璇疯缃畊rl.return灞炴��!')
+        return
+      }
+
+      let targetId = id // 浠庡弬鏁拌幏鍙朓D
+      // 濡傛灉娌℃湁閫氳繃鍙傛暟浼犻�扞D锛屽垯妫�鏌ラ�変腑鐨勮褰�
+      if (!targetId) {
+        if (this.selectedRowKeys.length != 1) {
+          this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+          return
+        } else {
+          targetId = this.selectedRowKeys[0]
+        }
+      }
+
+      // 灏嗗弬鏁颁綔涓烘煡璇㈠弬鏁伴檮鍔犲埌URL涓�
+      let httpurl = this.url.returnBack + '?orderId=' + encodeURIComponent(targetId)
+      let method = 'get'
+      var params = {}  // 娓呯┖params锛屽洜涓哄弬鏁板凡缁忓湪URL涓紶閫�
+
+      const that = this
+
+      this.$confirm({
+        title: '纭鎻愪氦锛�',
+        // content: '姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          // 鏄剧ず鍔犺浇鎻愮ず
+          const hide = that.$message.loading('姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...', 0)
+
+          // 鍙戦�佽姹�
+          return httpAction(httpurl, params, method).then((res) => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            if (res.success) {
+              that.$message.success(res.message)
+              that.loadData()
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).catch(error => {
+            hide() // 闅愯棌鍔犺浇鎻愮ず
+            that.$message.error('鎻愪氦澶辫触: ' + error.message)
+          }).finally(() => {
+            that.loading = false
+          })
+        }
+      })
     }
   }
 }

--
Gitblit v1.9.3