From 2a12da2908a1be0d5174ab9a5217a426736f60fe Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 11 十二月 2025 13:56:06 +0800
Subject: [PATCH] 1.生产工单新增修改时销售订单号

---
 src/views/produce/productWarehouse.vue |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/views/produce/productWarehouse.vue b/src/views/produce/productWarehouse.vue
index 0f12a78..b365178 100644
--- a/src/views/produce/productWarehouse.vue
+++ b/src/views/produce/productWarehouse.vue
@@ -783,9 +783,11 @@
           })
           const D1 = {
             'dto': {
-              'IsModifiedCode': true,
+              // 'IsModifiedCode': true,
+              'IsModifiedCode': false,
               'ExternalCode': this.form.hbillno,
-              'Code': this.form.hbillno,
+              // 'Code': this.form.hbillno,
+              'Code': '',
               'VoucherType': {
                 'Code': 'ST1002'
               },
@@ -837,7 +839,8 @@
                 'Code': this.form.stockcode// 浠撳簱缂栫爜
               },
               'Code': this.form.hbillno, // 鍗曟嵁缂栫爜
-              'IsModifiedCode': true,
+              // 'IsModifiedCode': true,
+              'IsModifiedCode': false,
               'BusiType': {
                 'Code': '03'// 涓氬姟绫诲瀷缂栫爜
               },
@@ -869,17 +872,24 @@
                 'Content-Type': 'application/json'
               }
             }
-          )
+          ).catch(e => {
+            // this.$message.error(JSON.stringify(e.response.data.message))
+            this.$message.error(e.response.data.message)
+          })
         }
 
-        // console.log(res)
-        // console.log(res.data.code)
+        console.log(res)
+        console.log(res.data.code)
+        console.log('``````````')
+        console.log(res.data.data.Code)
         // || res.data === null
+
         if (res.data.code === 0) {
           const TableDetailData = []
           this.multipleSelection.forEach((i, index) => {
             TableDetailData.push({
               'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+              'InOrdercode': res.data.data.Code,
               'wocode': i.wo_code, // 宸ュ崟鍙�
               'rownumber': (index + 1).toString(), // 琛屽彿
               'sourceVoucherId': i.mpoid ? i.mpoid.toString() : '', // 鏉ユ簮鍗曟嵁id
@@ -909,6 +919,7 @@
               [
                 {
                   'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+                  'InOrdercode': res.data.data.Code,
                   'madedate': handleDatetime(this.form.hbdate) + ' 00:00:00', // 鍒跺崟鏃ユ湡锛堝勾鏈堟棩 00:00:00锛�
                   'hbdate': this.multipleSelection[this.multipleSelection.length - 1].voucherdate,
 
@@ -937,9 +948,9 @@
           // console.log(JSON.stringify(data))
 
           // this.$store.state.app.buttonIsDisabled = true
-          const res = await InHouseOrderSpSeave(data)
+          const res2 = await InHouseOrderSpSeave(data)
           this.$store.state.app.buttonIsDisabled = false
-          if (res.code === '200') {
+          if (res2.code === '200') {
             this.$message.success('鍏ュ簱鎴愬姛锛�')
             this.multipleSelection = []
             // this.form.deptno = ''
@@ -949,8 +960,6 @@
             await this.getProductInHouseOrderCodeSearch()
           }
         } else {
-          // console.log(res.data)
-
           this.$store.state.app.buttonIsDisabled = false
           this.$message.error(res.data.message)
         }

--
Gitblit v1.9.3