From 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期二, 06 八月 2024 11:16:58 +0800
Subject: [PATCH] gitlab上面的wms转移到公司git

---
 src/views/productManage/product/AddProductDialog.vue |   94 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 69 insertions(+), 25 deletions(-)

diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index fd0e079..7e042ab 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -148,9 +148,8 @@
                       placeholder="鍗曚綅"
                       filterable
                       @change="Gtechange"
-                      style="width: calc(85% - 0px)"
+                      style="width: calc(85% - 120px)"
                     >
-                    <!-- style="width: calc(85% - 110px)" -->
                       <el-option
                         v-for="ele in unitList"
                         :key="ele.id"
@@ -163,13 +162,11 @@
                       style="font-size: 20px; color: gray"
                       @click="handleUnitShow"
                     ></i>
-                    <!-- <el-checkbox
+                    <el-checkbox
                     class="margin_left_10px"
                     :disabled="editConfig.infomation.unit&&showFooter?false:true"
                     v-model="editConfig.infomation.moreUnit"
-                    @change="moreUnitChange"
-                    ></el-checkbox
-                  > -->
+                    @change="moreUnitChange">鍚敤澶氬崟浣�</el-checkbox>
                   <!-- <span class="margin_left_10px cursor_pointer"  @click="handleUnitMore">鍚敤澶氬崟浣�</span> -->
                   </el-form-item>
                   
@@ -231,6 +228,7 @@
                       placeholder="璇烽�夋嫨"
                       size="mini"
                       clearable
+                      filterable
                       style="width: 85%"
                       :disabled="!showFooter"
                     >
@@ -247,6 +245,7 @@
                     <el-input
                       style="width: 85%"
                       :disabled="!showFooter"
+                      filterable
                       v-model="editConfig.infomation.type"
                       placeholder="璇疯緭鍏�"
                     ></el-input>
@@ -268,9 +267,9 @@
                       :disabled="!showFooter"
                     ></el-input>
                   </el-form-item>
-                  <el-form-item label="鏉$爜" prop="barcode">
+                  <el-form-item label="鏉$爜" prop="barCode">
                     <el-input
-                      v-model.trim="editConfig.infomation.barcode"
+                      v-model.trim="editConfig.infomation.barCode"
                       placeholder="璇疯緭鍏�"
                       size="mini"
                       style="width: 85%"
@@ -278,6 +277,23 @@
                     ></el-input>
                   </el-form-item>
                 </div>
+              </div>
+              <div class="dynamic-attribute">
+                <el-form-item  :label="attribute.name+':'" v-for="(attribute,index) in editConfig.attributeList" :key="attribute.id">
+                  <el-select v-if="attribute.dataType==3" v-model="attribute.value" style="width: 60%">
+                    <el-option  v-for="ele in attribute.selectValues" :label="ele" :value="ele" :key="ele"></el-option>
+                  </el-select>
+                  <el-input
+                          v-else
+                          v-model.trim="attribute.value"
+                          :type="attribute.dataType==2?'number':'text'"
+                          :placeholder="`璇疯緭鍏�${attribute.name}`"
+                          size="mini"
+                          style="width: 60%"
+                          :disabled="!showFooter"
+                  ></el-input>
+                  <el-button :disabled="editConfig.title==='鏌ョ湅'" size="mini" @click="deleteDynamicAttribute(index)" style="margin-left: 10px">鍒犻櫎</el-button>
+                </el-form-item>
               </div>
               <div class="all">
                 <!-- <div class="second-label">澶囨敞</div> -->
@@ -318,7 +334,7 @@
                       v-model="editConfig.infomation.principal"
                       placeholder="璇烽�夋嫨"
                       size="mini"
-                      style="width: 85%"
+                      style="width: 88%"
                       disabled
                     >
                       <el-option
@@ -342,7 +358,7 @@
                     ></el-input-number>
                     <span> kg</span>
                   </el-form-item> -->
-                  <el-form-item label="姣涢噸" prop="grossWeight">
+                  <el-form-item label="姣涢噸" prop="grossWeight"  label-width="80px">
                   <el-col :span="15"
                 >
                     <el-input
@@ -352,7 +368,7 @@
                       ></el-input>
                   </el-col>
                   <el-col :span="1">&nbsp;</el-col>
-                  <el-col :span="4">
+                  <el-col :span="5">
                   <el-select
                     v-model="editConfig.infomation.grossUnit"
                     placeholder="鍗曚綅"
@@ -370,7 +386,7 @@
                   </el-select>
                   </el-col>
               </el-form-item>
-              <el-form-item label="鍑�閲�" prop="netWeight">
+              <el-form-item label="鍑�閲�" prop="netWeight"  label-width="80px">
                 <el-col :span="15"
               >
                   <el-input
@@ -380,7 +396,7 @@
                     ></el-input>
                 </el-col>
                 <el-col :span="1">&nbsp;</el-col>
-                 <el-col :span="4">
+                 <el-col :span="5">
                 <el-select
                   v-model="editConfig.infomation.netUnit"
                   placeholder="鍗曚綅"
@@ -613,7 +629,9 @@
     <UnitMoreDialog
       ref="unitMoreDialog"
       @saveUnitMore="saveUnitMore"
+      @cancelUnitMore='cancelUnitMore'
       :workList="unitList"
+      :unitRight='editConfig.infomation.unit'
       :dataList="editConfig.infomation.moreUnitList"
       title="鍚敤澶氬崟浣�"
     ></UnitMoreDialog>
@@ -631,7 +649,6 @@
 import {getUnitInfo,  } from "@/api/basic/standard";
 // import { postGetSaveSUnitDict  } from "@/api/basic/standard";
 import UnitMoreDialog from "./components/UnitMoreDialog";
-
 export default {
   mixins: [codeMixin],
   name: "AddProductDialog",
@@ -782,8 +799,13 @@
     this.formInfo()
     this.getUserInfo()
     this.getUnitInfo()
+    //this.queryAttribute()
   },
   methods: {
+      deleteDynamicAttribute(index){
+          this.editConfig.attributeList.splice(index,1);
+      },
+
     validatorNumFour(rule, value, callback) {
       if (value != "") {
         if (value == undefined || value == null) {
@@ -814,23 +836,34 @@
       }
     },
     saveUnitMore(list){
+      this.editConfig.infomation.moreUnit=true
       this.editConfig.infomation.moreUnitList=list
+    },
+    cancelUnitMore(){
+      this.editConfig.infomation.moreUnit=false
     },
     // 鍚敤澶氬崟浣嶇殑寮�鍏�
     moreUnitChange(){
-      let string=false;
-      if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
-        for(let i in this.editConfig.infomation.moreUnitList){
-          if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
-            string=true;
-            break;
-          }
+      // let string=false;
+      if(this.editConfig.infomation.unit){
+        // if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
+        //   for(let i in this.editConfig.infomation.moreUnitList){
+        //     if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
+        //       string=true;
+        //       break;
+        //     }
+        //   }
+        // }
+        if(this.editConfig.infomation.moreUnit){
+          // this.editConfig.infomation.moreUnit=false
+          // this.$message.error('璇峰厛閰嶇疆澶氬崟浣嶏紒')
+          this.$refs.unitMoreDialog.editDialogVisible = true;
         }
-      }
-      if(!string){
+      }else{
         this.editConfig.infomation.moreUnit=false
-        this.$message.error('璇峰厛閰嶇疆澶氬崟浣嶏紒')
+        this.$message.error('璇峰厛閫夋嫨鍗曚綅锛�')
       }
+      
     },
     handleConfirmSave(dataList) {
       saveUnitDict({ data: dataList }).then((res) => {
@@ -982,11 +1015,12 @@
         params.codeStandardID = this.autoCodeObj.codeStandardID
         params.autoIncr = this.autoCodeObj.maxAutoIncr
       }
-      if(params.moreUnitList.length>0){
+      if(params.moreUnitList&&params.moreUnitList.length>0){
         for(let i in params.moreUnitList){
           params.moreUnitList[i].amount=Number(params.moreUnitList[i].amount)
         }
       }
+      params.attributes=this.editConfig.attributeList||[];
       requestUrl(params).then((res) => {
         console.log(res)
         this.editConfig.visible = false
@@ -1150,6 +1184,16 @@
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
+  .dynamic-attribute{
+    display:flex;
+    flex-wrap: wrap;
+    flex: 1;
+    ::v-deep{
+      .el-form-item{
+        width: 50%;
+      }
+    }
+  }
 .dialog-header {
   display: flex;
   align-items: center;

--
Gitblit v1.8.0