Эх сурвалжийг харах

feat: 颜色从多选变成单选

liujt 1 сар өмнө
parent
commit
9f5203cbbd

+ 6 - 8
src/BIZComponents/inventoryTable.vue

@@ -296,7 +296,6 @@
             v-model="scope.row.modelKey"
             :isOne="scope.$index === 0"
             :key="scope.$index + '物品机型'"
-            multiple
             filterable
             allow-create
             default-first-option
@@ -311,7 +310,6 @@
             clearable
             v-model="scope.row.colorKey"
             :isOne="scope.$index === 0"
-            multiple
             filterable
             allow-create
             default-first-option
@@ -1261,10 +1259,10 @@
             );
           }
           if (v.modelKey) {
-            v.modelKey = v.modelKey.toString();
+            v.modelKey = v.modelKey;
           }
           if (v.colorKey) {
-            v.colorKey = v.colorKey.toString();
+            v.colorKey = v.colorKey;
           }
           v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
           v.customerReqFiles = v.customerReqFiles || [];
@@ -1340,10 +1338,10 @@
         if (productList) {
           productList.forEach((item) => {
             if (item.modelKey) {
-              item.modelKey = item.modelKey.split(',');
+              item.modelKey = item.modelKey;
             }
             if (item.colorKey) {
-              item.colorKey = item.colorKey.split(',');
+              item.colorKey = item.colorKey;
             }
             item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
               ? item.guaranteePeriodUnitCode + ''
@@ -1442,10 +1440,10 @@
           this.$set(parasm, 'singleWeight', item.netWeight);
           this.$set(parasm, 'pricingWay', item.pricingWay || 1);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey.split(','));
+            this.$set(parasm, 'modelKey', item.modelKey);
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey.split(','));
+            this.$set(parasm, 'colorKey', item.colorKey);
           }
           this.$set(parasm, 'imgCode', item.imgCode);
           this.$set(parasm, 'produceType', item.produceType);

+ 14 - 18
src/views/bpm/handleTask/components/productionWarehousing/storage.vue

@@ -442,7 +442,6 @@
                   clearable
                   v-model="row.colorKey"
                   :isOne="$index == 1"
-                  multiple
                   filterable
                   allow-create
                   default-first-option
@@ -457,7 +456,6 @@
                   clearable
                   v-model="row.modelKey"
                   :isOne="$index == 1"
-                  multiple
                   filterable
                   allow-create
                   default-first-option
@@ -698,7 +696,6 @@
                 clearable
                 v-model="row.modelKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -713,7 +710,6 @@
                 clearable
                 v-model="row.colorKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -1798,10 +1794,10 @@
                 packingUnitId:
                   filtersItem.purchaseUnitId || filtersItem.saleUnitId,
                 modelKey: filtersItem.modelKey
-                  ? filtersItem.modelKey.split(',')
+                  ? filtersItem.modelKey
                   : '', // 机型
                 colorKey: filtersItem.colorKey
-                  ? filtersItem.colorKey.split(',')
+                  ? filtersItem.colorKey
                   : '', // 颜色
                 measureType: item.measureType, // 计量方式
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
@@ -2003,18 +1999,18 @@
                 colorKey:
                   this.bizType == 1
                     ? this.form.colorKey
-                      ? this.form.colorKey.split(',')
+                      ? this.form.colorKey
                       : ''
                     : item.colorKey
-                    ? item.colorKey.split(',')
+                    ? item.colorKey
                     : '', // 颜色
                 modelKey:
                   this.bizType == 1
                     ? this.form.modelKey
-                      ? this.form.modelKey.split(',')
+                      ? this.form.modelKey
                       : ''
                     : item.modelKey
-                    ? item.modelKey.split(',')
+                    ? item.modelKey
                     : '', // 机型
                 batchNo: [1, 3, 6].includes(this.bizType)
                   ? this.detailList[0]?.batchNo || batchNo
@@ -2208,10 +2204,10 @@
                   item.specification || this.productList[0].specification, // 规格
                 brandNum: item.productBrand || this.productList[0].brandNum, // 牌号
                 colorKey:
-                  (item.colorKey ? item.colorKey.split(',') : '') ||
+                  (item.colorKey ? item.colorKey : '') ||
                   this.productList[0].colorKey, // 颜色
                 modelKey:
-                  (item.modelKey ? item.modelKey.split(',') : '') ||
+                  (item.modelKey ? item.modelKey : '') ||
                   this.productList[0].modelKey, // 机型
                 parentIndex: this.isMoreProduct
                   ? this.productList.find(
@@ -2562,10 +2558,10 @@
             _taskId = this.detailProductList[0]?.taskId;
           }
           if (packingItem.modelKey) {
-            packingItem.modelKey = packingItem.modelKey.toString();
+            packingItem.modelKey = packingItem.modelKey;
           }
           if (packingItem.colorKey) {
-            packingItem.colorKey = packingItem.colorKey.toString();
+            packingItem.colorKey = packingItem.colorKey;
           }
           return {
             ...packingItem,
@@ -2582,10 +2578,10 @@
         // 处理产品数据
         this.productList = this.productList.map((productItem) => {
           if (productItem.modelKey) {
-            productItem.modelKey = productItem.modelKey.toString();
+            productItem.modelKey = productItem.modelKey;
           }
           if (productItem.colorKey) {
-            productItem.colorKey = productItem.colorKey.toString();
+            productItem.colorKey = productItem.colorKey;
           }
           return {
             ...productItem,
@@ -3002,8 +2998,8 @@
             categoryCode: item.code, // 物品编码
             categoryModel: item.modelType, // 物品型号
             specification: item.specification, // 规格
-            modelKey: item.modelKey ? item.modelKey.split(',') : '', // 机型
-            colorKey: item.colorKey ? item.colorKey.split(',') : '', // 颜色
+            modelKey: item.modelKey ? item.modelKey : '', // 机型
+            colorKey: item.colorKey ? item.colorKey : '', // 颜色
             brandNum: item.brandNum, // 牌号
             batchNo: batchNo, // 批次号
             supplierListOptions: supplierList[item.id], // 供应商列表

+ 14 - 18
src/views/bpm/stockManagement/storage.vue

@@ -440,7 +440,6 @@
                   clearable
                   v-model="row.colorKey"
                   :isOne="$index == 1"
-                  multiple
                   filterable
                   allow-create
                   default-first-option
@@ -455,7 +454,6 @@
                   clearable
                   v-model="row.modelKey"
                   :isOne="$index == 1"
-                  multiple
                   filterable
                   allow-create
                   default-first-option
@@ -695,7 +693,6 @@
                 clearable
                 v-model="row.modelKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -710,7 +707,6 @@
                 clearable
                 v-model="row.colorKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -1801,10 +1797,10 @@
                   packingUnitId:
                     filtersItem.purchaseUnitId || filtersItem.saleUnitId,
                   modelKey: filtersItem.modelKey
-                    ? filtersItem.modelKey.split(',')
+                    ? filtersItem.modelKey
                     : '', // 机型
                   colorKey: filtersItem.colorKey
-                    ? filtersItem.colorKey.split(',')
+                    ? filtersItem.colorKey
                     : '', // 颜色
                   measureType: item.measureType, // 计量方式
                   netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
@@ -2013,18 +2009,18 @@
                   colorKey:
                     this.bizType == 1
                       ? this.form.colorKey
-                        ? this.form.colorKey.split(',')
+                        ? this.form.colorKey
                         : ''
                       : item.colorKey
-                      ? item.colorKey.split(',')
+                      ? item.colorKey
                       : '', // 颜色
                   modelKey:
                     this.bizType == 1
                       ? this.form.modelKey
-                        ? this.form.modelKey.split(',')
+                        ? this.form.modelKey
                         : ''
                       : item.modelKey
-                      ? item.modelKey.split(',')
+                      ? item.modelKey
                       : '', // 机型
                   batchNo: [1, 3, 6].includes(this.bizType)
                     ? this.detailList[0]?.batchNo || batchNo
@@ -2222,10 +2218,10 @@
                     item.specification || this.productList[0].specification, // 规格
                   brandNum: item.productBrand || this.productList[0].brandNum, // 牌号
                   colorKey:
-                    (item.colorKey ? item.colorKey.split(',') : '') ||
+                    (item.colorKey ? item.colorKey : '') ||
                     this.productList[0].colorKey, // 颜色
                   modelKey:
-                    (item.modelKey ? item.modelKey.split(',') : '') ||
+                    (item.modelKey ? item.modelKey : '') ||
                     this.productList[0].modelKey, // 机型
                   parentIndex: this.isMoreProduct
                     ? this.productList.find(
@@ -2576,10 +2572,10 @@
             _taskId = this.detailProductList[0]?.taskId;
           }
           if (packingItem.modelKey) {
-            packingItem.modelKey = packingItem.modelKey.toString();
+            packingItem.modelKey = packingItem.modelKey;
           }
           if (packingItem.colorKey) {
-            packingItem.colorKey = packingItem.colorKey.toString();
+            packingItem.colorKey = packingItem.colorKey;
           }
           return {
             ...packingItem,
@@ -2596,10 +2592,10 @@
         // 处理产品数据
         this.productList = this.productList.map((productItem) => {
           if (productItem.modelKey) {
-            productItem.modelKey = productItem.modelKey.toString();
+            productItem.modelKey = productItem.modelKey;
           }
           if (productItem.colorKey) {
-            productItem.colorKey = productItem.colorKey.toString();
+            productItem.colorKey = productItem.colorKey;
           }
           return {
             ...productItem,
@@ -3016,8 +3012,8 @@
             categoryCode: item.code, // 物品编码
             categoryModel: item.modelType, // 物品型号
             specification: item.specification, // 规格
-            modelKey: item.modelKey ? item.modelKey.split(',') : '', // 机型
-            colorKey: item.colorKey ? item.colorKey.split(',') : '', // 颜色
+            modelKey: item.modelKey ? item.modelKey : '', // 机型
+            colorKey: item.colorKey ? item.colorKey : '', // 颜色
             brandNum: item.brandNum, // 牌号
             batchNo: batchNo, // 批次号
             supplierListOptions: supplierList[item.id], // 供应商列表