From 642ae743bc6009e4ae95e6e47831396ba54bcde7 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 29 十月 2024 16:58:52 +0800
Subject: [PATCH] 1.生产入库实现18%

---
 src/views/produce/productWarehouse.vue |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/src/views/produce/productWarehouse.vue b/src/views/produce/productWarehouse.vue
index f6ec5a7..36dcab9 100644
--- a/src/views/produce/productWarehouse.vue
+++ b/src/views/produce/productWarehouse.vue
@@ -130,10 +130,11 @@
             <el-form-item label="鍗曟嵁缂栧彿" style=" display: flex;">
               <el-input
                 v-model="form.hbillno"
-                readonly
+
                 placeholder="璇疯緭鍏�"
                 style="width: 200px"
               />
+              <!--              readonly-->
             </el-form-item>
 
             <el-form-item label="鍏ュ簱浠撳簱" required style=" display: flex;">
@@ -675,18 +676,29 @@
 
     },
     // 澶嶉�夋鍒囨崲
-    handleSelectionChange() {
-
+    handleSelectionChange(val) {
+      this.multipleSelection = val
     },
     // 閫掍氦
     async  submit() {
       // usercode
       // console.log(localStorage.getItem('username'))
+
+      if (this.multipleSelection.length === 0) {
+        return this.$message.info('璇峰厛鍕鹃�夊崟鎹紒')
+      }
+      if (this.form.stockcode === '') {
+        return this.$message.info('鍏ュ簱浠撳簱涓嶈兘涓虹┖锛�')
+      }
+      if (this.form.deptno === '') {
+        return this.$message.info('鍏ュ簱閮ㄩ棬涓嶈兘涓虹┖锛�')
+      }
+
       const TableDetailData = []
-      this.tableDataDetail.forEach((i, index) => {
+      this.multipleSelection.forEach((i, index) => {
         TableDetailData.push({
           'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
-          'rownumber': i.sbid.toString(), // 琛屽彿
+          'rownumber': (index + 1).toString(), // 琛屽彿
           'inbarcode': i.inbarcode, // 鍏ュ簱鏉$爜
           'mo_id': i.sbid.toString(), // 璁㈠崟id(琛屽彿)
           'mo_no': i.m_po, // 璁㈠崟鍙�
@@ -695,7 +707,8 @@
           'unitcode': i.unitcode, // 鍗曚綅缂栫爜
           'unit_rate': '1', // 鍗曚綅鎹㈢畻鐜�
           'stockcode': i.stockcode, // 浠撳簱缂栫爜
-          'qty': i.qty.toString(), // 鍏ュ簱鏁伴噺
+          // 'qty': i.qty.toString(), // 鍏ュ簱鏁伴噺
+          'qty': i.good_qty.toString(), // 鍏ュ簱鏁伴噺
           'price': '0', // 鍏ュ簱鍗曚环
           'saleid': i.saleOrderDetailId.toString(), // 閿�鍞崟id(琛屽彿)
           'salecode': i.saleOrderCode, // 閿�鍞崟鍙�
@@ -726,10 +739,14 @@
         ]
       }
 
-      console.log(JSON.stringify(data))
-
       const res = await ProductInHouseOrderSeave(data)
-      console.log(res)
+      if (res.code === '200') {
+        this.multipleSelection = []
+        this.form.deptno = ''
+        this.form.stockcode = ''
+        await this.getProductInHouseOrderSearch()
+        await this.getProductInHouseOrderCodeSearch()
+      }
     },
     // 閲嶇疆
     reset() {

--
Gitblit v1.9.3