From f69afc7461e1c2d92a935c0228b77388637de2e4 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 22 十二月 2023 11:25:31 +0800
Subject: [PATCH] 明细单添加编辑接口+编辑产品列表赋值逻辑修改+查看时限制操作的方法逻辑修改+毛利毛利率计算给列表赋值

---
 src/components/makepager/mixin/codeMixin.js |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/components/makepager/mixin/codeMixin.js b/src/components/makepager/mixin/codeMixin.js
index 515cf09..7ec1914 100644
--- a/src/components/makepager/mixin/codeMixin.js
+++ b/src/components/makepager/mixin/codeMixin.js
@@ -18,7 +18,12 @@
       objCode: { name: "", page: 0, pageSize: 0, type: "璺熻繘璁板綍缂栫爜", codeStandID: "" },
       codeRule: {},
       codeLength: 0,
-      autoCodeObj: {}
+      // header澶寸殑鍙傛暟
+      autoCodeHeadersObj:{
+        xsjh:'',
+        bjd:'',
+        ywjh:'',
+      }
     }
   },
 
@@ -34,7 +39,7 @@
           if (res.code == 200) {
             const { List = [], ID, AutoRule = {}, Method } = res.data && res.data.data ? res.data.data[0] : []
             this.codeRule = res.data && res.data.data ? res.data.data[0] : {}
-            let autoRule = AutoRule
+            let autoRule = AutoRule  
             let method = Method ? Method : 0
             this.method = method
             let rules = List
@@ -73,7 +78,6 @@
                   // this.codeList(
                   //   this.editConfig.infomation.number ? this.editConfig.infomation.number : autoRule.PrefixValue
                   // )
-                  return true
                 }
               }
             }
@@ -91,11 +95,16 @@
       }
     },
     async getAutoCodeValue() {
-      const res = await getAutoCode({ codeType: this.objCode.type,autoIncr:this.autoIncr });
-      if (res.code == 200) {
-        this.autoCodeObj = res.data;
-        this.$set(this.editConfig.infomation, 'number', this.autoCodeObj.id)
+      if(Object.keys(this.codeRule).length>0){
+        const res = await getAutoCode(this.codeRule);
+        this.autoCodeHeadersObj=res.headers
+        if (res.data.code == 200) {
+          this.$set(this.editConfig.infomation, 'number', res.data.data?res.data.data:'')
+        }else{
+          this.$set(this.editConfig.infomation, 'number', this.codeRule.AutoRule.PrefixValue?this.codeRule.AutoRule.PrefixValue:'')
+        }
       }
+      
     },
     codeList(val) {
       this.inputValue = val
@@ -103,10 +112,6 @@
       this.editConfig.infomation.number = this.codenumberList.length > 0 ? this.codenumberList.replace(/,/g, "") : ""
       console.log(this.codenumberList.replace(/,/g, ""))
     },
-    // validateFormNumber() {
-    //   this.$set(this.editConfig.infomation, 'number', this.editConfig.infomation.number)
-    //   this.$refs.form.validateField('number')
-    // },
      // 璁㈠崟缂栫爜鍗曠嫭鏍¢獙
      validateCheckCode(rule, value, callback) {
       if (value && value.length > 0) {

--
Gitblit v1.8.0