huang_an 1 سال پیش
والد
کامیت
36503b7712
1فایلهای تغییر یافته به همراه71 افزوده شده و 13 حذف شده
  1. 71 13
      src/views/bpm/stockManagement/storage_3.vue

+ 71 - 13
src/views/bpm/stockManagement/storage_3.vue

@@ -1125,21 +1125,49 @@
             return item.productCode;
             return item.productCode;
           });
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
+            // 获取批次号
             const batchNo = await getCode('lot_number_code');
             const batchNo = await getCode('lot_number_code');
+            // 获取供应商
             const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
             const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
               categoryIds: res.map((item) => item.id)
               categoryIds: res.map((item) => item.id)
             });
             });
+            // 获取包装规格
+            let packingSpecification =
+              await storageApi.getCategoryPackageDisposition({
+                categoryIds: res.map((item) => item.id)
+              });
+            this.packingSpecificationOption = res.map((item) => {
+              return packingSpecification
+                .filter((ite) => item.id == ite.categoryId)
+                .sort((a, b) => a.sort - b.sort);
+            });
             this.productList = res.map((item, index) => {
             this.productList = res.map((item, index) => {
               let filtersItem = this.saleProductList.filter(
               let filtersItem = this.saleProductList.filter(
                 (detailItem) => detailItem.productCode == item.code
                 (detailItem) => detailItem.productCode == item.code
               )[0];
               )[0];
+              // 显示规格
+              let packingSpecificationLabel = this.packingSpecificationOption[
+                index
+              ]
+                .map((item) => {
+                  if (item.sort > 0) {
+                    return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`;
+                  }
+                })
+                .filter((item) => !!item);
               console.log('filtersItem---------', filtersItem);
               console.log('filtersItem---------', filtersItem);
               let warehouseId = filtersItem.warehouseId;
               let warehouseId = filtersItem.warehouseId;
               let warehouseName = filtersItem.warehouseName;
               let warehouseName = filtersItem.warehouseName;
-              let minPackingQuantity = filtersItem.totalCount;
               let measureQuantity = filtersItem.totalCount;
               let measureQuantity = filtersItem.totalCount;
-              let packingQuantity = 1;
+              let packingQuantity = filtersItem.totalCount;
               let price = filtersItem.singlePrice;
               let price = filtersItem.singlePrice;
+              // 获取相同仓库
+              let warehouseIds = [];
+              let warehouseNames = [];
+              for (let i = 0; i < filtersItem.totalCount; i++) {
+                warehouseIds.push(filtersItem.warehouseId);
+                warehouseNames.push(filtersItem.warehouseName);
+              }
               return {
               return {
                 index: this.productList.length + index,
                 index: this.productList.length + index,
                 categoryId: item.id, // 物品id
                 categoryId: item.id, // 物品id
@@ -1154,22 +1182,25 @@
                 supplierName: '', // 供应商名称
                 supplierName: '', // 供应商名称
                 approvalNumber: item.approvalNumber, // 批准文号
                 approvalNumber: item.approvalNumber, // 批准文号
                 packingSpecification: item.packingSpecification, // 包装规格
                 packingSpecification: item.packingSpecification, // 包装规格
-                minPackingQuantity: minPackingQuantity, // 最小包装单元数量
+                packingSpecificationOption:
+                  this.packingSpecificationOption[index], // 包装规格选项
+                packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
+                // minPackingQuantity: minPackingQuantity, // 最小包装单元数量
                 packingQuantity: packingQuantity, // 包装数量
                 packingQuantity: packingQuantity, // 包装数量
                 packingUnit: item.packingUnit, // 包装单位
                 packingUnit: item.packingUnit, // 包装单位
                 measureQuantity: measureQuantity, // 计量数量
                 measureQuantity: measureQuantity, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 measureUnit: item.measuringUnit, // 计量单位
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
-                weight: item.packingWeight, // 重量
+                weight: 0, // 重量
                 weightUnit: item.weightUnit, // 重量单位
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: '', // 总价
                 totalMoney: '', // 总价
                 price: item.price || price, // 单价
                 price: item.price || price, // 单价
-                purpose: item.purpose, // 用途
+                purpose: '', // 用途
                 isUnpack: item.isUnpack, // 是否允许拆包
                 isUnpack: item.isUnpack, // 是否允许拆包
                 warehouseId, // 仓库id
                 warehouseId, // 仓库id
                 warehouseName, // 仓库名称
                 warehouseName, // 仓库名称
-                warehouseIds: [warehouseId],
-                warehouseNames: [warehouseName]
+                warehouseIds,
+                warehouseNames
               };
               };
             });
             });
             this.$nextTick(() => {
             this.$nextTick(() => {
@@ -1184,17 +1215,40 @@
           console.log('codeList-----------', codeList);
           console.log('codeList-----------', codeList);
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             console.log(res);
             console.log(res);
+            // 获取批次号
             const batchNo = await getCode('lot_number_code');
             const batchNo = await getCode('lot_number_code');
+            // 获取供应商
+            const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
+              categoryIds: res.map((item) => item.id)
+            });
+            // 获取包装规格
+            let packingSpecification =
+              await storageApi.getCategoryPackageDisposition({
+                categoryIds: res.map((item) => item.id)
+              });
+            this.packingSpecificationOption = res.map((item) => {
+              return packingSpecification
+                .filter((ite) => item.id == ite.categoryId)
+                .sort((a, b) => a.sort - b.sort);
+            });
+            // 获取相同仓库
             let warehouseIds = [];
             let warehouseIds = [];
             let warehouseNames = [];
             let warehouseNames = [];
             for (let index = 0; index < this.form.totalCount; index++) {
             for (let index = 0; index < this.form.totalCount; index++) {
               warehouseIds.push(this.form.warehouseId);
               warehouseIds.push(this.form.warehouseId);
               warehouseNames.push(this.form.warehouseName);
               warehouseNames.push(this.form.warehouseName);
             }
             }
-            const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
-              categoryIds: res.map((item) => item.id)
-            });
             this.productList = res.map((item, index) => {
             this.productList = res.map((item, index) => {
+              // 显示规格
+              let packingSpecificationLabel = this.packingSpecificationOption[
+                index
+              ]
+                .map((item) => {
+                  if (item.sort > 0) {
+                    return `${item.packageCell}${item.packageUnit}/${item.conversionUnit}`;
+                  }
+                })
+                .filter((item) => !!item);
               return {
               return {
                 index: this.productList.length + index,
                 index: this.productList.length + index,
                 categoryId: item.id, // 物品id
                 categoryId: item.id, // 物品id
@@ -1209,17 +1263,20 @@
                 supplierName: '', // 供应商名称
                 supplierName: '', // 供应商名称
                 approvalNumber: item.approvalNumber, // 批准文号
                 approvalNumber: item.approvalNumber, // 批准文号
                 packingSpecification: item.packingSpecification, // 包装规格
                 packingSpecification: item.packingSpecification, // 包装规格
-                minPackingQuantity: 1, // 最小包装单元数量
+                packingSpecificationOption:
+                  this.packingSpecificationOption[index], // 包装规格选项
+                packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
+                // minPackingQuantity: 1, // 最小包装单元数量
                 packingQuantity: this.form.totalCount, // 包装数量
                 packingQuantity: this.form.totalCount, // 包装数量
                 packingUnit: item.packingUnit, // 包装单位
                 packingUnit: item.packingUnit, // 包装单位
                 measureQuantity: this.form.totalCount, // 计量数量
                 measureQuantity: this.form.totalCount, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 measureUnit: item.measuringUnit, // 计量单位
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
-                weight: item.packingWeight, // 重量
+                weight: 0, // 重量
                 weightUnit: item.weightUnit, // 重量单位
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: '', // 总价
                 totalMoney: '', // 总价
                 price: item.price, // 单价
                 price: item.price, // 单价
-                purpose: item.purpose, // 用途
+                purpose: '', // 用途
                 isUnpack: item.isUnpack, // 是否允许拆包
                 isUnpack: item.isUnpack, // 是否允许拆包
                 warehouseId: this.form.warehouseId, // 仓库id
                 warehouseId: this.form.warehouseId, // 仓库id
                 warehouseName: this.form.warehouseName, // 仓库名称
                 warehouseName: this.form.warehouseName, // 仓库名称
@@ -2073,6 +2130,7 @@
       },
       },
       // 产品保存操作
       // 产品保存操作
       listSave(row, index) {
       listSave(row, index) {
+        console.log('row', row);
         this.validateFormIndividually(index).then(async () => {
         this.validateFormIndividually(index).then(async () => {
           // 判断包装单位和计量单位是否为不拆物料层规格
           // 判断包装单位和计量单位是否为不拆物料层规格
           let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
           let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)