From eb50cc99c74372f449c20f92a79721dc6843c02f Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 15 九月 2025 19:33:18 +0800
Subject: [PATCH] art: 生产订单SAP同步

---
 src/views/cms/modules/CuttingReceiveModal.vue |   54 +++++++++++++++++++++++++-----------------------------
 1 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/src/views/cms/modules/CuttingReceiveModal.vue b/src/views/cms/modules/CuttingReceiveModal.vue
index 75531e4..577ef59 100644
--- a/src/views/cms/modules/CuttingReceiveModal.vue
+++ b/src/views/cms/modules/CuttingReceiveModal.vue
@@ -116,7 +116,7 @@
         </a-row>
       </a-form>
     </a-spin>
-    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">閫夋嫨鍒�鍏�</a-button>
+    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">閫夋嫨搴撳瓨鍒�鍏�</a-button>
     <a-table
       ref="table"
       bordered
@@ -127,7 +127,7 @@
       :pagination="ipagination"
       :loading="loading"
     >
-      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index" >
+      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
         <div :key="col.dataIndex">
           <a-input
             :value="text"
@@ -158,7 +158,7 @@
       <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button>
     </template>
     <j-select-inventory-modal ref="inventoryModalForm" @ok="modalFormOk"></j-select-inventory-modal>
-<!--    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>-->
+    <!--    <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>-->
   </a-modal>
 </template>
 
@@ -178,7 +178,6 @@
 export default {
   name: 'CuttingInboundModal',
   components: {
-    JSelectToolingModal,
     JSelectInventoryModal,
     JMultiSelectTag,
     JDictSelectTag,
@@ -253,8 +252,8 @@
         },
         {
           title: '鎿嶄綔',
-          dataIndex: 'action',
           align: 'center',
+          dataIndex: 'action',
           scopedSlots: { customRender: 'action' }
         }
       ],
@@ -321,7 +320,7 @@
       // this.$refs.toolingModalForm.disableSubmit = false
 
       this.$refs.inventoryModalForm.showModal(ids)
-      this.$refs.inventoryModalForm.title = '閫夋嫨鍒�鍏�'
+      this.$refs.inventoryModalForm.title = '閫夋嫨搴撳瓨鍒�鍏�'
       this.$refs.inventoryModalForm.disableSubmit = false
 
     },
@@ -349,29 +348,26 @@
           let formData = Object.assign(this.model, values)
           formData.detailData = this.dataSource
 
-          // 娣诲姞鏇存柊搴撳瓨鐘舵�佺殑閫昏緫
-          const inventoryIds = this.dataSource.map(item => item.inventoryId)
-          const updateInventoryStatus = inventoryIds.length > 0 ?
-            //闇�瑕佸啓涓�涓洿鏂板簱瀛樼姸鎬佺殑鎺ュ彛鍦ㄥ悗绔紙杩樻病鍐�25/9/9锛�
-            postAction('/cms/inventory/updateStatus', {
-              ids: inventoryIds,
-              status: '寰呭嚭搴�' //璁句负寰呭嚭搴�
-            }) : Promise.resolve()
-          updateInventoryStatus.then(() => {
-            return postAction(that.url.add, formData)
-          }).then((res) => {
-                if (res.success) {
-                  that.$message.success('棰嗙敤鎴愬姛')
-                  that.$emit('ok', new Date())
-                } else {
-                  that.$message.warning(res.message)
-                }
-              }).catch((error) => {
-                that.$message.error('鎿嶄綔澶辫触: ' + error.message)
-              }).finally(() => {
-                that.confirmLoading = false
-                that.close()
-              })
+          // 纭繚 detailData 鍖呭惈 inventoryId
+          formData.detailData = this.dataSource.map(item => ({
+            ...item,
+            // 纭繚 inventoryId 琚纭紶閫�
+            inventoryId: item.inventoryId
+          }))
+
+          postAction(that.url.add, formData)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success('棰嗙敤鎴愬姛')
+                that.$emit('ok', new Date())
+              } else {
+                that.$message.warning(res.message)
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
         }
       })
     },

--
Gitblit v1.9.3