From d86353384f4071a3cea77e6151e1a7bda4486501 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周三, 24 4月 2024 13:40:12 +0800
Subject: [PATCH] 物料tab

---
 iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue |   84 ++++++++++++++++++-----------------------
 1 files changed, 37 insertions(+), 47 deletions(-)

diff --git a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
index fb67c03..e9a5f21 100644
--- a/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
+++ b/iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
@@ -1,12 +1,6 @@
 <template>
-  <a-modal
-    title="鏂板鐗╂枡淇℃伅"
-    :width="900"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    @ok="handleSubmit"
-    @cancel="handleCancel"
-  >
+  <a-modal title="鏂板鐗╂枡淇℃伅" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit"
+    @cancel="handleCancel">
     <a-spin :spinning="confirmLoading">
       <!-- tab -->
       <a-tabs default-active-key="1" @change="callbacktab">
@@ -16,16 +10,12 @@
           <!-- 鍩烘湰淇℃伅 -->
           <a-form :form="form">
             <a-form-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
-              <a-input
-                placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
-                v-decorator="['materialName', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欏悕绉帮紒' }] }]"
-              />
+              <a-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+                v-decorator="['materialName', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欏悕绉帮紒' }] }]" />
             </a-form-item>
             <a-form-item label="鐗╂枡缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
-              <a-input
-                placeholder="璇疯緭鍏ョ墿鏂欑紪鍙�"
-                v-decorator="['materialCode', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欑紪鍙凤紒' }] }]"
-              />
+              <a-input placeholder="璇疯緭鍏ョ墿鏂欑紪鍙�"
+                v-decorator="['materialCode', { rules: [{ required: true, message: '璇疯緭鍏ョ墿鏂欑紪鍙凤紒' }] }]" />
             </a-form-item>
             <a-form-item label="ERP缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
               <a-input placeholder="璇疯緭鍏RP缂栧彿" v-decorator="['erpCode']" />
@@ -93,7 +83,7 @@
           闇�姹傚緟瀹�
         </a-tab-pane>
         <a-tab-pane key="4" tab="鏇夸唬鍝佺鐞�">
-          <add-form-sub ref="addFormWmsSubstituteGood" @ok="handleOk" />
+          <add-form-sub ref="addFormWmsSubstituteGoodRef" @ok="handleOk" />
         </a-tab-pane>
         <a-tab-pane key="5" tab="瀹㈡埛">
           <add-form-base-customer ref="addFormBaseCustomer" @ok="handleOk" />
@@ -149,8 +139,6 @@
       if (e == 6) {
         this.$nextTick(() => {
           // 璋冩帴鍙� 浼犵墿鏂欑被鍨�
-          console.log(99999999999999)
-          console.log(this.data)
           const {
             form: { validateFields }
           } = this
@@ -162,41 +150,43 @@
                   values[key] = JSON.stringify(values[key])
                 }
               }
-              console.log(22222222222222222)
               console.log(values)
               this.confirmLoading = false
-
-              // var res1 = this.$refs.addFormRef.handleSubmit2()
-              // console.log("5555555")
-              // console.log( res1 )
-
-              // console.log(this.$refs.addFormRef.data)
-              // console.log(this.$refs.addFormRef.form.materialType)
-
               this.$refs.addFormContainerPackagingRef.initShow(values.materialType)
-
-              // WmsMaterialAdd(values).then((res) => {
-              //   if (res.success) {
-              //     this.$message.success('鏂板鎴愬姛')
-              //     this.confirmLoading = false
-              //     this.$emit('ok', values)
-              //     this.handleCancel()
-              //   } else {
-              //     this.$message.error('鏂板澶辫触锛�' + JSON.stringify(res.message))
-              //   }
-              // }).finally((res) => {
-              //   this.confirmLoading = false
-              // })
-
-              // return values
+             
             } else {
               this.confirmLoading = false
             }
           })
         })
       }
+      // 鏇夸唬鍝�
+      if (e == 4) {
+          const {
+            form: { validateFields }
+          } = this
+          this.confirmLoading = true
+          validateFields((errors, values) => {
+            if (!errors) {
+              for (const key in values) {
+                if (typeof values[key] === 'object') {
+                  values[key] = JSON.stringify(values[key])
+                }
+              }
+              console.log(66666666666)
+              console.log(values)
+              this.confirmLoading = false
+              debugger
+              // materialName  materialCode
+              this.$refs.addFormWmsSubstituteGoodRef.initShow(values.materialCode,values.materialName)
+             
+            } else {
+              this.confirmLoading = false
+            }
+          })
+      }
     },
-    handleOk() {},
+    handleOk() { },
     // 鍒濆鍖栨柟娉�
     add(record) {
       this.visible = true
@@ -246,13 +236,13 @@
             })
             values.stationNameParameter = values.stationNameParameterArr.join(',')
           }
-   
+
           console.log(6666666666666 + '鎺у埗灞炴��')
           console.log(this.$refs.WmsControlRule.selectedRows)
           var ControlRuleld = this.$refs.WmsControlRule.selectedRows[0].id
 
           console.log(6666666666666 + '鏇夸唬鍝�')
-          console.log(this.$refs.addFormWmsSubstituteGood.list)
+          console.log(this.$refs.addFormWmsSubstituteGoodRef.list)
 
           console.log(6666666666666 + '瀹㈡埛妗f闆嗗悎')
           console.log(this.$refs.addFormBaseCustomer.list)
@@ -263,7 +253,7 @@
           var param = {
             MaterialInput: values,
             ControlRuleld: ControlRuleld, //鎺у埗灞炴��
-            SubstituteGoodLis: this.$refs.addFormWmsSubstituteGood.list, //鏇夸唬鍝�
+            SubstituteGoodLis: this.$refs.addFormWmsSubstituteGoodRef.list, //鏇夸唬鍝�
             BaseCustomerList: this.$refs.addFormBaseCustomer.list, //瀹㈡埛妗f闆嗗悎
             ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //鍖呰鍏崇郴
           }

--
Gitblit v1.9.3