liujt 1 месяц назад
Родитель
Сommit
c8ee86f5e1

+ 1 - 1
lib/vue-form-making/src/components/Upload/file.vue

@@ -9,7 +9,7 @@
       <!-- <el-button v-if="ui == 'element'" type="primary" :disabled="disabled || fileList.length == limit"
                  @click="handleAdd">{{ $t('fm.actions.upload') }}
       </el-button> -->
-      <fileMain v-if="ui == 'element'" :type="disabled || fileList.length == limit ? 'view' : 'add'" v-model="fileList" @updateVal="getFiles"></fileMain>
+      <fileMain v-if="ui == 'element'" :type="disabled || fileList.length == limit ? 'view' : 'add'" v-model="fileList" @updateVal="getFiles" :isDefaultPersonal="true"></fileMain>
       <a-button :size="size" v-if="ui == 'antd'" icon="upload" :disabled="disabled || fileList.length == limit"
                 @click="handleAdd">{{ $t('fm.actions.upload') }}
       </a-button>

+ 18 - 1
src/components/addDoc/file-edit.vue

@@ -130,6 +130,12 @@
   import { mapGetters } from 'vuex';
   export default {
     components: { FileUpload },
+    props: {
+      isDefaultPersonal: {
+        type: Boolean,
+        default: false
+      }
+    },
 
     data() {
       const defaultForm = {
@@ -192,7 +198,10 @@
         type: 1,
         currentUserId: this.user.info.userId
       });
-      this.folderList = this.allFolderList;
+
+      this.activeName = this.isDefaultPersonal ? '2' : '1';
+      console.log(this.activeName, 'this.activeName');
+      this.folderList = this.activeName == '2' ? this.myFolderList : this.allFolderList;
       setFolderList(this.folderList); //权限过滤
     },
     methods: {
@@ -205,6 +214,10 @@
         } else {
           this.folderList = this.allFolderList;
         }
+
+        if(this.isDefaultPersonal && this.activeName == '2') {
+          this.form.directoryId = this.folderList[0]?.id || '';
+        }
       },
       async getTreeCode() {
         let nodeData = {};
@@ -220,6 +233,7 @@
         };
       },
       async initFileCode() {
+        console.log('getTreeCode~~~', this.nodeData);
         await this.getTreeCode();
         this.options = this.nodeData.id ? await listCode(this.nodeData) : [];
         if (this.options.length > 0) {
@@ -233,6 +247,9 @@
         this.showEditFlag = true;
         this.$nextTick(async () => {
           this.list = await selectTreeList();
+          if(this.isDefaultPersonal && this.activeName == '2') {
+            this.form.directoryId = this.folderList[0]?.id || '';
+          }
           await this.initFileCode();
           this.setTree(this.list);
         });

+ 5 - 1
src/components/addDoc/index.vue

@@ -21,7 +21,7 @@
       >
     </el-badge>
 
-    <file-upload @success="getFiles" ref="fileUploadRef"></file-upload>
+    <file-upload @success="getFiles" ref="fileUploadRef" :isDefaultPersonal="isDefaultPersonal"></file-upload>
   </div>
 </template>
 
@@ -53,6 +53,10 @@
       size: {
         type: String,
         default: 'mini'
+      },
+      isDefaultPersonal: {
+        type: Boolean,
+        default: false
       }
     },
     data() {

+ 7 - 1
src/components/addDoc/main.vue

@@ -57,7 +57,7 @@
         确认
       </el-button>
     </template>
-    <fileEdit ref="fileEditRef" @done="done"></fileEdit>
+    <fileEdit ref="fileEditRef" :isDefaultPersonal="isDefaultPersonal" @done="done"></fileEdit>
     <ele-modal
       width="80%"
       :visible.sync="fileShow"
@@ -91,6 +91,12 @@
   export default {
     components: { doc_template, fileEdit, browse },
     mixins: [tableColumnsMixin],
+    props: {
+      isDefaultPersonal: {
+        type: Boolean,
+        default: false
+      }
+    },
     data() {
       return {
         cacheKeyUrl: 'addDoc-main-view',

+ 22 - 1
src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/detailDialog.vue

@@ -437,7 +437,8 @@
             slot: 'remark',
             align: 'center'
           }
-        ]
+        ],
+        mergeData: []
       };
     },
     props: {
@@ -517,6 +518,26 @@
             item['packingWeight'] = item.receiveTotalWeight;
             item['quantity'] = item.totalCount;
           });
+
+          const mergedList = [];
+          this.form.productList.filter((item) => item.packageId).forEach((item) => {
+            const key = `${item.productCode}_${item.batchNo}_${item.colorKey}`;
+            const existIndex = mergedList.findIndex(
+              (m) => `${m.productCode}_${m.batchNo}_${m.colorKey}` === key
+            );
+            if (existIndex > -1) {
+              mergedList[existIndex].quantity += item.quantity;
+              mergedList[existIndex].packingWeight += item.packingWeight;
+              mergedList[existIndex].packingQuantity += item.packingQuantity;
+
+            } else {
+              mergedList.push({ ...item });
+            }
+          });
+          this.mergeData = mergedList;
+
+          console.log('this.mergeData----------------', this.mergeData);
+
           this.$nextTick(() => {
             if (this.taskDefinitionKey == 'storemanApprove') {
               this.activeComp = 'inoutBound';

+ 30 - 39
src/views/bpm/stockManagement/storage.vue

@@ -695,7 +695,6 @@
                 clearable
                 v-model="row.modelKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -710,7 +709,6 @@
                 clearable
                 v-model="row.colorKey"
                 :isOne="$index == 1"
-                multiple
                 filterable
                 allow-create
                 default-first-option
@@ -1801,10 +1799,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, // 净重
@@ -1816,12 +1814,8 @@
                   pricingWay: pricingWay, //计价方式
                   purpose: '', // 用途
                   detailPurchaseDate,
-                  detailExpireDate: this.saleProductList.find(
-                    (product) => product.productId == item.id
-                  )?.guaranteePeriodDeadline,
-                  detailProductionDate: this.saleProductList.find(
-                    (product) => product.productId == item.id
-                  )?.productionDate,
+                  detailExpireDate: filtersItem?.guaranteePeriodDeadline,
+                  detailProductionDate: filtersItem?.productionDate,
 
                   provenance: filtersItem.provenance, //产地
                   isUnpack: item.isUnpack, // 是否允许拆包
@@ -2045,18 +2039,18 @@
                   colorKey:
                     this.bizType == 1
                       ? this.form.colorKey
-                        ? this.form.colorKey.split(',')
+                        ? this.form.colorKey
                         : ''
                       : filtersItem.colorKey
-                      ? filtersItem.colorKey.split(',')
+                      ? filtersItem.colorKey
                       : '', // 颜色
                   modelKey:
                     this.bizType == 1
                       ? this.form.modelKey
-                        ? this.form.modelKey.split(',')
+                        ? this.form.modelKey
                         : ''
                       : filtersItem.modelKey
-                      ? filtersItem.modelKey.split(',')
+                      ? filtersItem.modelKey
                       : '', // 机型
                   batchNo: [1, 3, 6].includes(this.bizType)
                     ? filtersItem.batchNo || batchNo
@@ -2077,17 +2071,18 @@
                   packingSpecificationOption: newSpecificationOption, // 包装规格选项
                   packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
                   // minPackingQuantity: 1, // 最小包装单元数量
-                  packingQuantity: this.isMoreProduct
-                    ? this.detailList.filter(
-                        (val) => val.productCode == item.code
-                      ).length
-                    : this.detailList.length || this.form.detailList.length, // 包装数量
+                  // packingQuantity: this.isMoreProduct
+                  //   ? this.detailList.filter(
+                  //       (val) => val.productCode == item.code
+                  //     ).length
+                  //   : this.detailList.length || this.form.detailList.length, // 包装数量
+                  packingQuantity: this.isMoreProduct ? filtersItem.packingQuantity : this.detailList.length || this.detailList.length, 
                   packingUnit: packingUnit, // 单位
                   measureQuantity: this.isMoreProduct
-                    ? this.getMeasureQuantity(item.code)
+                    ? filtersItem.quantity
                     : this.form.totalCount, // 计量数量
-                  measureUnit: item.measuringUnit, // 计量单位
-                  measureType: item.measureType, // 计量方式
+                  measureUnit: filtersItem.measuringUnit, // 计量单位
+                  measureType: filtersItem.measureType, // 计量方式
                   netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
                   weight: weight || 0, // 重量
                   singleWeight: singleWeight || 0,
@@ -2097,14 +2092,10 @@
                   purpose: '', // 用途
                   isUnpack: item.isUnpack, // 是否允许拆包
                   warehouseId: this.isMoreProduct
-                    ? this.detailList.find(
-                        (val) => val.productCode == item.code
-                      )?.warehouseId
+                    ? filtersItem?.warehouseId
                     : this.form.warehouseId, // 仓库id
                   warehouseName: this.isMoreProduct
-                    ? this.detailList.find(
-                        (val) => val.productCode == item.code
-                      )?.warehouseName
+                    ? filtersItem?.warehouseName
                     : this.form.warehouseName, // 仓库名称
                   warehouseIds: this.isMoreProduct
                     ? this.detailList
@@ -2254,17 +2245,17 @@
                     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(
                         (val) => val.categoryCode == item.productCode
                       ).index
                     : this.productList[0].index, // 产品索引
-                  batchNo: this.productList[0].batchNo, // 批次号
+                  batchNo: item.batchNo || this.productList[0].batchNo, // 批次号
                   packageNo:
                     item.packageNo ||
                     item.packingCode ||
@@ -2286,13 +2277,13 @@
                       )?.packingSpecificationOption
                     : this.productList[0].packingSpecificationOption, // 包装规格
 
-                  netWeight: this.productList[0].netWeight, // 净重
+                  netWeight: item.netWeight || this.productList[0].netWeight, // 净重
                   barcodes: item.barcodes || item.sendCode, // 发货条码
                   clientCode: clientCode, // 客户代号
                   materielDesignation:
                     item.materielDesignation || item.extInfo?.materielCode, // 物料代号
                   engrave: item.engrave || item.extInfo?.engrave, // 刻码
-                  isUnpack: this.productList[0].isUnpack, // 是否允许拆包
+                  isUnpack: item.isUnpack || this.productList[0].isUnpack, // 是否允许拆包
                   productionDate: productionDate, // 生产日期
                   purchaseDate: purchaseDate, // 采购时间
                   result: 1, // 结果(1合格 2不合格)
@@ -2608,10 +2599,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,
@@ -2628,10 +2619,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,
@@ -3048,8 +3039,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], // 供应商列表