695593266@qq.com пре 9 месеци
родитељ
комит
87aa04cfb2

+ 19 - 3
src/views/bpm/handleTask/components/productionWarehousing/detailDialog.vue

@@ -69,10 +69,18 @@
         ref="add"
         :form="form"
         :bizType="taskDefinitionKey == 'wmsBizType4' ? 4 : 1"
-        v-if="form.code"
+        v-if="form.code && !isDetail"
         :sourceBizNo="form.code"
         :detailList="form.detailList"
       ></add>
+      <add
+        ref="add"
+        :form="form"
+        :bizType="taskDefinitionKey == 'wmsBizType4' ? 4 : 1"
+        v-if="form.code && isDetail"
+        :sourceBizNo="form.code"
+        :saleProductList="form.detailList"
+      ></add>
     </keep-alive>
   </div>
 </template>
@@ -112,7 +120,8 @@
         form: {},
         detailData: {},
         totalPackage: '',
-        totalCount: ''
+        totalCount: '',
+        isDetail: false
       };
     },
     async created() {
@@ -171,8 +180,15 @@
             );
           }
 
+          this.isDetail =
+            this.form.detailList[0].isAllPackageData == 1 ? true : false;
+
           this.totalPackage =
-            this.form.detailList.length + this.form?.detailList[0]?.packingUnit;
+            this.form.detailList[0].isAllPackageData == 1
+              ? this.form.detailList[0].packingCount +
+                this.form?.detailList[0]?.packingUnit
+              : this.form.detailList.length +
+                this.form?.detailList[0]?.packingUnit;
           this.totalCount =
             this.form.totalCount + this.form?.detailList[0]?.measuringUnit;
           this.detailData = data;

+ 210 - 195
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -15,20 +15,39 @@
       <div v-for="item in tabOptions" :label="item.name" :name="item.name">
         <headerTitle :title="item.name"></headerTitle>
         <div v-if="item.key == 'main'">
-          <receiptInfo ref="modalRefs" :businessId="businessId" :form="form" :detailData="detailData">
+          <receiptInfo
+            ref="modalRefs"
+            :businessId="businessId"
+            :form="form"
+            :detailData="detailData"
+          >
           </receiptInfo>
         </div>
         <div v-if="item.key == 'inoutBound'">
-          <add ref="inoutBoundRef" :form="form" :sourceBizNo="form.receiveNo" :saleProductList="form.productList"
-            :bizType="form.outsourceSendCode?10:2" :detailProductList="detailData.productList"></add>
+          <add
+            ref="inoutBoundRef"
+            :form="form"
+            :sourceBizNo="form.receiveNo"
+            :saleProductList="form.productList"
+            :bizType="form.outsourceSendCode ? 10 : 2"
+            :detailProductList="detailData.productList"
+          ></add>
         </div>
         <div v-if="item.key == 'inoutBoundView'">
-          <detailDialog ref="inoutBoundViewRef"  :bizType="form.outsourceSendCode?10:2" :businessId="form.receiveNo" :isUpload="isUpload">
+          <detailDialog
+            ref="inoutBoundViewRef"
+            :bizType="form.outsourceSendCode ? 10 : 2"
+            :businessId="form.receiveNo"
+            :isUpload="isUpload"
+          >
           </detailDialog>
         </div>
         <div v-if="item.key == 'inoutBoundEdit'">
-          <procurementWarehousing :businessId="form.receiveNo" :qualityInspectionItems="qualityInspectionItems"
-            ref="inoutBoundEditRef">
+          <procurementWarehousing
+            :businessId="form.receiveNo"
+            :qualityInspectionItems="qualityInspectionItems"
+            ref="inoutBoundEditRef"
+          >
           </procurementWarehousing>
         </div>
       </div>
@@ -37,216 +56,212 @@
 </template>
 
 <script>
-import dictMixins from '@/mixins/dictMixins';
+  import dictMixins from '@/mixins/dictMixins';
 
-import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
+  import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
 
-import detailDialog from '@/views/bpm/stockManagement/details.vue';
+  import detailDialog from '@/views/bpm/stockManagement/details.vue';
 
-import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
+  import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
 
+  import receiptInfo from './receiptInfo.vue';
+  import add from '@/views/bpm/stockManagement/storage.vue';
 
+  import storageApi from '@/api/warehouseManagement';
+  // import fileMain from '@/components/addDoc/index.vue';
 
-import receiptInfo from './receiptInfo.vue';
-import add from '@/views/bpm/stockManagement/storage.vue';
-
-import storageApi from '@/api/warehouseManagement';
-// import fileMain from '@/components/addDoc/index.vue';
-
-export default {
-  props: {
-    businessId: {
-      default: ''
+  export default {
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
     },
-    taskId: {
-      default: ''
+    components: {
+      // fileMain,
+      detailDialog,
+      procurementWarehousing,
+      add,
+      receiptInfo
     },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  components: {
-    // fileMain,
-    detailDialog,
-    procurementWarehousing,
-    add,
-    receiptInfo
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      qualityInspectionItems: [
-        'materielDesignation',
-        'clientCode',
-        'engrave',
-        'weight',
-        'result'
-      ],
-      isUpload: false,
-      activeComp: 'main',
-      tabOptions: [{ key: 'main', name: '收货单详情' }],
-
-      visible: false,
-      detailId: '',
-      title: '详情',
-      row: {},
-      activeName: 'base',
-      form: {
-        orderFiles: [{ name: '222' }]
-      },
-      detailData: {},
-
-    };
-  },
-  async created() {
-    await this.getDetailData(this.businessId);
-    // getOutInBySourceBizNoOrError(this.form.receiveNo)
-    await storageApi
-      .getInfoBySourceBizNo(this.form.receiveNo)
-      .then((res) => {
-        if (JSON.stringify(res) == '{}') {
-          // 未查询到相关信息(未入库)
-          if (this.taskDefinitionKey == 'storeManagerApprove') {
-            this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
-            this.activeComp = 'inoutBound';
-            this.$emit('activeCompChange', 'inoutBound');
-            // this.$nextTick(() => {
-            //   this.$refs.add.pickerSuccess(this.form);
-            // });
-          }
-        } else {
-          if (this.taskDefinitionKey == 'qualityInspection') {
-            this.tabOptions.push({
-              key: 'inoutBoundEdit',
-              name: '入库单详情(已入库)'
-            });
-            this.activeComp = 'inoutBoundEdit';
-          } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
-            this.tabOptions.push({
-              key: 'inoutBoundView',
-              name: '入库单详情'
-            });
-            this.isUpload = true;
-            this.activeComp = 'inoutBoundView';
+    mixins: [dictMixins],
+    data() {
+      return {
+        qualityInspectionItems: [
+          'materielDesignation',
+          'clientCode',
+          'engrave',
+          'weight',
+          'result'
+        ],
+        isUpload: false,
+        activeComp: 'main',
+        tabOptions: [{ key: 'main', name: '收货单详情' }],
+
+        visible: false,
+        detailId: '',
+        title: '详情',
+        row: {},
+        activeName: 'base',
+        form: {
+          orderFiles: [{ name: '222' }]
+        },
+        detailData: {}
+      };
+    },
+    async created() {
+      await this.getDetailData(this.businessId);
+      // getOutInBySourceBizNoOrError(this.form.receiveNo)
+      await storageApi
+        .getInfoBySourceBizNo(this.form.receiveNo)
+        .then((res) => {
+          if (JSON.stringify(res) == '{}') {
+            // 未查询到相关信息(未入库)
+            if (this.taskDefinitionKey == 'storeManagerApprove') {
+              this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
+              this.activeComp = 'inoutBound';
+              this.$emit('activeCompChange', 'inoutBound');
+              // this.$nextTick(() => {
+              //   this.$refs.add.pickerSuccess(this.form);
+              // });
+            }
           } else {
-            this.tabOptions.push({
-              key: 'inoutBoundView',
-              name: '入库单详情'
-            });
-            this.isUpload = false;
-            this.activeComp = 'inoutBoundView';
+            if (this.taskDefinitionKey == 'qualityInspection') {
+              this.tabOptions.push({
+                key: 'inoutBoundEdit',
+                name: '入库单详情(已入库)'
+              });
+              this.activeComp = 'inoutBoundEdit';
+            } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
+              this.tabOptions.push({
+                key: 'inoutBoundView',
+                name: '入库单详情'
+              });
+              this.isUpload = true;
+              this.activeComp = 'inoutBoundView';
+            } else {
+              this.tabOptions.push({
+                key: 'inoutBoundView',
+                name: '入库单详情'
+              });
+              this.isUpload = false;
+              this.activeComp = 'inoutBoundView';
+            }
+            // if (
+            //   ![
+            //     'starter',
+            //     'deptLeaderApprove',
+            //     'storeManagerApprove',
+            //     'qualityInspection'
+            //   ].includes(this.taskDefinitionKey)
+            // ) {
+            //   this.tabOptions.push({
+            //     key: 'inoutBoundView',
+            //     name: '入库单详情'
+            //   });
+            //   this.isUpload = true;
+            //   this.activeComp = 'inoutBoundView';
+            // } else {
+            //   this.tabOptions.push({
+            //     key: 'inoutBoundEdit',
+            //     name: '入库单详情(已入库)'
+            //   });
+            //   this.activeComp = 'inoutBoundEdit';
+            // }
           }
-          // if (
-          //   ![
-          //     'starter',
-          //     'deptLeaderApprove',
-          //     'storeManagerApprove',
-          //     'qualityInspection'
-          //   ].includes(this.taskDefinitionKey)
-          // ) {
-          //   this.tabOptions.push({
-          //     key: 'inoutBoundView',
-          //     name: '入库单详情'
-          //   });
-          //   this.isUpload = true;
-          //   this.activeComp = 'inoutBoundView';
-          // } else {
-          //   this.tabOptions.push({
-          //     key: 'inoutBoundEdit',
-          //     name: '入库单详情(已入库)'
-          //   });
-          //   this.activeComp = 'inoutBoundEdit';
-          // }
-        }
-      })
-      .catch(() => {
-        this.$message.error('获取入库单详情失败');
-      });
-    console.log(this.tabOptions, 'this.tabOptions')
-
-
-  },
-
-  methods: {
-
-    changeActive(item) {
-      this.activeComp = item.key;
-      this.$emit('activeCompChange', item.key);
-      // if (
-      //   this.taskDefinitionKey == 'storeManagerApprove' &&
-      //   item.key == 'inoutBound'
-      // ) {
-      //   this.$nextTick(() => {
-      //     this.$refs.add.pickerSuccess(this.form);
-      //   });
-      // }
-    },
-    save(data) {
-      this.$refs.inoutBoundRef?.[0].handleSave(data);
+        })
+        .catch(() => {
+          this.$message.error('获取入库单详情失败');
+        });
+      console.log(this.tabOptions, 'this.tabOptions');
     },
-    success() {
-      // this.$parent.handleClose()
 
-      this.$emit('handleClose');
-    },
+    methods: {
+      changeActive(item) {
+        this.activeComp = item.key;
+        this.$emit('activeCompChange', item.key);
+        // if (
+        //   this.taskDefinitionKey == 'storeManagerApprove' &&
+        //   item.key == 'inoutBound'
+        // ) {
+        //   this.$nextTick(() => {
+        //     this.$refs.add.pickerSuccess(this.form);
+        //   });
+        // }
+      },
+      save(data) {
+        this.$refs.inoutBoundRef?.[0].handleSave(data);
+      },
+      success() {
+        // this.$parent.handleClose()
 
-    // 判断质检状态是否全部已检
-    allListChecked() {
-      return (
-        this.$refs.inoutBoundEditRef?.[0] &&
-        this.$refs.inoutBoundEditRef[0].getStatus()
-      );
-    },
-    async getTableValue() {
-      console.log(this.$refs)
-      return {
-        form: this.form,
-        returnStorageData: this.$refs.inoutBoundRef?.[0]&& await this.$refs.inoutBoundRef[0].getReturnStorage(),
-        isAllChecked:
+        this.$emit('handleClose');
+      },
+
+      // 判断质检状态是否全部已检
+      allListChecked() {
+        return (
           this.$refs.inoutBoundEditRef?.[0] &&
-          (await this.$refs.inoutBoundEditRef[0].getStatus()),
-
-        qualityInspector:
-          (this.$refs.inoutBoundViewRef?.[0] &&
-            this.$refs.inoutBoundViewRef[0].getQualityFile()) ||
-          {}
-        // qualityInspector:
-        //   (this.$refs.detailDialog &&
-        //     this.$refs.detailDialog.getQualityFile()) ||
-        //   {}
-      };
-    },
-    async getDetailData(id) {
-      this.loading = true;
-      const data = await getReceiveSaleOrderrecordDetail(id);
-      this.loading = false;
-      if (data) {
-        console.log(data, '1111111111111111111111');
-
-        this.form = data;
-        this.detailData = data;
+          this.$refs.inoutBoundEditRef[0].getStatus()
+        );
+      },
+      async getTableValue() {
+        console.log(this.$refs);
+        return {
+          form: this.form,
+          returnStorageData:
+            this.$refs.inoutBoundRef?.[0] &&
+            (await this.$refs.inoutBoundRef[0].getReturnStorage()),
+          isAllChecked:
+            this.$refs.inoutBoundEditRef?.[0] &&
+            (await this.$refs.inoutBoundEditRef[0].getStatus()),
+
+          qualityInspector:
+            (this.$refs.inoutBoundViewRef?.[0] &&
+              this.$refs.inoutBoundViewRef[0].getQualityFile()) ||
+            {}
+          // qualityInspector:
+          //   (this.$refs.detailDialog &&
+          //     this.$refs.detailDialog.getQualityFile()) ||
+          //   {}
+        };
+      },
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getReceiveSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          console.log(data, '1111111111111111111111');
+
+          this.form = data;
+          this.detailData = data;
+        }
       }
     }
-  }
-};
+  };
 </script>
 
 <style scoped lang="scss">
-.ele-dialog-form {
-  .el-form-item {
-    margin-bottom: 10px;
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
   }
-}
 
-.headbox {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
-    margin-right: 20px;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
 </style>

+ 40 - 10
src/views/bpm/stockManagement/storage.vue

@@ -1488,7 +1488,7 @@
 
           // 物品列表
           let codeList = this.saleProductList.map((item) => {
-            return item.productCode;
+            return item.productCode || item.categoryCode;
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             if (res.length <= 0) {
@@ -1522,7 +1522,8 @@
 
             this.productList = res.map((item, index) => {
               let filtersItem = this.saleProductList.filter(
-                (detailItem) => detailItem.productCode == item.code
+                (detailItem) =>
+                  detailItem.productCode || detailItem.categoryCode == item.code
               )[0];
 
               // 显示规格
@@ -1541,6 +1542,8 @@
               );
               console.log(newSpecificationOption, '啵啵啵啵啵啵啵啵啵啵啵啵2');
 
+              console.log(filtersItem, 'filtersItemfiltersItemfiltersItem');
+
               let warehouseId = filtersItem.warehouseId;
               let warehouseName = filtersItem.warehouseName;
               let measureQuantity = filtersItem.totalCount || 0;
@@ -1589,9 +1592,9 @@
                 brandNum: item.brandNum, // 牌号
                 batchNo: batchNo, // 批次号
                 supplierListOptions: supplierList[item.id], // 供应商列表
-                supplierId:this.form.supplierId, // 供应商id
+                supplierId: this.form.supplierId, // 供应商id
                 supplierCode:
-                  this.bizType == 2||this.bizType == 7
+                  this.bizType == 2 || this.bizType == 7
                     ? filtersItem.supplierMark
                     : item.supplierCode, // 供应商代号
                 supplierName: this.form.supplierName, // 供应商名称
@@ -1600,10 +1603,30 @@
                 packingSpecificationOption: newSpecificationOption[index], // 包装规格选项
                 packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
                 // minPackingQuantity: minPackingQuantity, // 最小包装单元数量
-                packingQuantity: packingQuantity, // 包装数量
-                packingUnit: packingUnit, // 单位
-                measureQuantity: measureQuantity, // 计量数量
-                measureUnit: item.measuringUnit, // 计量单位
+                packingQuantity:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].packingCount
+                    : packingQuantity, // 包装数量
+                packingUnit:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].packingUnit
+                    : packingUnit, // 单位
+                measureQuantity:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].quantity
+                    : measureQuantity, // 计量数量
+                measureUnit:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].measuringUnit
+                    : item.measuringUnit, // 计量单位
                 modelKey: filtersItem.modelKey
                   ? filtersItem.modelKey.split(',')
                   : '', // 机型
@@ -1794,6 +1817,11 @@
               }
               let packingUnit = item.packingUnit;
               let singleWeight = item.singleWeight || 0; // 单重重量
+              console.log(
+                this.isMoreProduct,
+                this.detailList,
+                'this.isMoreProduct'
+              );
               return {
                 index: this.productList.length + index,
                 isSave: true,
@@ -1887,6 +1915,8 @@
             let packingCodeList = data;
             // 生产包装
             this.packingList = this.detailList.map((item, index) => {
+              // if (item.isAllPackageData != 1) {
+              console.log(item.packingUnit, 'itemitemitemitemitemitem1');
               console.log(item.packingUnit, 'itemitemitemitemitemitem2');
               // 换算重量
               let weight = 0;
@@ -2027,6 +2057,7 @@
                 status: 2, // 状态(0=未质检 1待检 2已检)
                 serialNumber: item.productSequence // 产品序号
               };
+              // }
             });
             console.log(this.packingList, '包装明细列表');
             this.packingList.forEach((item) => {
@@ -2398,7 +2429,7 @@
           batchNos: this.productList.map((item) => item.batchNo)
         });
 
-        return  new Promise((resolve, reject) => {
+        return new Promise((resolve, reject) => {
           if (isVerifyData?.length) {
             this.$confirm(
               `当前批次:${isVerifyData[0].batchNo},物品${isVerifyData
@@ -2419,7 +2450,6 @@
             resolve(obj);
           }
         });
-
       },
       pickingHandleScroll() {
         if (this.showPackingList.length < this.packingList.length) {