Răsfoiți Sursa

物料明细bizType=2不显示;入库单产品信息-采购原因;

yijing 1 an în urmă
părinte
comite
a1254e9303

+ 2 - 1
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -193,6 +193,7 @@
       ></add>
     </keep-alive>
     <detailDialog
+      :bizType="2"
       v-if="activeComp == 'inoutBoundView'"
       :businessId="form.receiveNo"
       :isUpload="isUpload"
@@ -579,7 +580,7 @@
           isAllChecked:
             this.$refs.procurementWarehousing &&
             (await this.$refs.procurementWarehousing.getStatus()),
-            
+
           qualityInspector:
             (this.$refs.detailDialog &&
               this.$refs.detailDialog.getQualityFile()) ||

+ 19 - 7
src/views/bpm/stockManagement/details.vue

@@ -379,7 +379,7 @@
             </el-table-column>
           </el-table>
         </div>
-        <div class="mt20">
+        <div class="mt20" v-if="bizType != '2'">
           <header-title :title="`物料明细`" size="16px"> </header-title>
           <el-table
             ref="multipleTable"
@@ -470,6 +470,10 @@
     },
     components: { fileUpload },
     props: {
+      bizType: {
+        type: String,
+        default: ''
+      },
       businessId: {
         type: String,
         default: ''
@@ -643,23 +647,31 @@
         } else {
           res = await storageApi.getInfoBySourceBizNo(id);
         }
+        console.log(
+          'idsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss',
+          this.isIds
+        );
         if (this.isIds) {
           this.infoData = resAll[0];
           this.extInfo = resAll[0].extInfo;
-          res=resAll[0]
-          res['bizNo']=resAll.map(item=>item.bizNo)
-          res.outInDetailList=resAll.map(item=>item.outInDetailList[0])
+          res = resAll[0];
+          res['bizNo'] = resAll.map((item) => item.bizNo);
+          res.outInDetailList = resAll.map((item) => item.outInDetailList[0]);
+          console.log('resAll---------------', resAll);
         } else {
           this.infoData = res;
           this.extInfo = res.extInfo;
- 
+          console.log(
+            res,
+            'resresresresresresresresresresresresresresresresresresresresres2222'
+          );
         }
         console.log('===', res);
 
         this.productList = res.outInDetailList.map(
           (productItem, productIndex) => {
-            if(this.isIds){
-              productItem['bizNo']=res.bizNo[productIndex]
+            if (this.isIds) {
+              productItem['bizNo'] = res.bizNo[productIndex];
             }
             return {
               ...productItem,

+ 5 - 1
src/views/bpm/stockManagement/quality.vue

@@ -249,7 +249,11 @@
               align="center"
               prop="purpose"
               :show-overflow-tooltip="true"
-            ></el-table-column>
+            >
+              <template slot-scope="{ row, $index }">
+                <el-input v-model="row.purpose" placeholder="请输入"></el-input>
+              </template>
+            </el-table-column>
             <el-table-column
               label="供应商"
               prop="supplierName"

+ 115 - 70
src/views/bpm/stockManagement/storage.vue

@@ -933,7 +933,7 @@
       detailList: { type: Array, default: () => [] },
       saleProductList: { type: Array, default: () => [] },
       detailProductList: { type: Array, default: () => [] },
-      isMoreProduct: { type: Boolean, default:false }, //多产品包装明细
+      isMoreProduct: { type: Boolean, default: false } //多产品包装明细
     },
     data() {
       return {
@@ -1270,18 +1270,19 @@
               warehouseIds.push(this.form.warehouseId);
               warehouseNames.push(this.form.warehouseName);
             }
-            if(this.isMoreProduct){
-              this.formData.extInfo.assetType=[]
-              res.map(item=>{
-                this.formData.extInfo.assetType.push(item.categoryLevelPathIdParent)
-              })
+            if (this.isMoreProduct) {
+              this.formData.extInfo.assetType = [];
+              res.map((item) => {
+                this.formData.extInfo.assetType.push(
+                  item.categoryLevelPathIdParent
+                );
+              });
               this.formData.extInfo.assetType = Array.from(
-                  new Set(...this.formData.extInfo.assetType)
-               );
-              }
+                new Set(...this.formData.extInfo.assetType)
+              );
+            }
             // 生成产品列表
             this.productList = res.map((item, index) => {
-              
               // 显示规格
               let packingSpecificationLabel = this.packingSpecificationOption[
                 index
@@ -1342,9 +1343,15 @@
                   this.packingSpecificationOption[index], // 包装规格选项
                 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, // 包装数量
                 packingUnit: item.packingUnit, // 单位
-                measureQuantity: this.isMoreProduct?this.getMeasureQuantity(item.code):this.form.totalCount, // 计量数量
+                measureQuantity: this.isMoreProduct
+                  ? this.getMeasureQuantity(item.code)
+                  : this.form.totalCount, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
                 weight: weight, // 重量
@@ -1353,26 +1360,43 @@
                 price: item.price, // 单价
                 purpose: '', // 用途
                 isUnpack: item.isUnpack, // 是否允许拆包
-                warehouseId:this.isMoreProduct?this.detailList.find(val=>val.productCode==item.code)?.warehouseId:this.form.warehouseId, // 仓库id
-                warehouseName: this.isMoreProduct?this.detailList.find(val=>val.productCode==item.code)?.warehouseName:this.form.warehouseName, // 仓库名称
-                warehouseIds:this.isMoreProduct?this.detailList.filter(val=>val.productCode==item.code).map(item=>item.warehouseId):warehouseIds,
-                warehouseNames:this.isMoreProduct?this.detailList.filter(val=>val.productCode==item.code).map(item=>item.warehouseName):warehouseNames,
+                warehouseId: this.isMoreProduct
+                  ? this.detailList.find((val) => val.productCode == item.code)
+                      ?.warehouseId
+                  : this.form.warehouseId, // 仓库id
+                warehouseName: this.isMoreProduct
+                  ? this.detailList.find((val) => val.productCode == item.code)
+                      ?.warehouseName
+                  : this.form.warehouseName, // 仓库名称
+                warehouseIds: this.isMoreProduct
+                  ? this.detailList
+                      .filter((val) => val.productCode == item.code)
+                      .map((item) => item.warehouseId)
+                  : warehouseIds,
+                warehouseNames: this.isMoreProduct
+                  ? this.detailList
+                      .filter((val) => val.productCode == item.code)
+                      .map((item) => item.warehouseName)
+                  : warehouseNames
               };
             });
-           let getAssetNumPr=this.isMoreProduct? this.detailList.map(val=>{
-            return {
-                assetCode:val.productCode,
-                batchNum: val.productBrand,
-                num: 1
-              }
-           }):[
-              {
-                assetCode:
-                  this.productList[0].categoryCode + this.productList[0].index,
-                batchNum: this.productList[0].batchNo,
-                num: this.detailList.length
-              }
-            ]
+            let getAssetNumPr = this.isMoreProduct
+              ? this.detailList.map((val) => {
+                  return {
+                    assetCode: val.productCode,
+                    batchNum: val.productBrand,
+                    num: 1
+                  };
+                })
+              : [
+                  {
+                    assetCode:
+                      this.productList[0].categoryCode +
+                      this.productList[0].index,
+                    batchNum: this.productList[0].batchNo,
+                    num: this.detailList.length
+                  }
+                ];
             // 生成包装编码
             const { data } = await storageApi.getAssetNum(getAssetNumPr);
             let packingCodeList = data;
@@ -1418,30 +1442,52 @@
                 this.curDateType = 'purchaseDate';
               }
               return {
-                index: this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode).index+'-'+index:this.productList[0].index + '-' + index, // 包装索引
-                warehouseId:item.warehouseId|| this.productList[0].warehouseIds[index], // 仓库id
-                warehouseName:item.warehouseName|| this.productList[0].warehouseNames[index], // 仓库名称
-                categoryName: item.productName||this.productList[0].categoryName, // 产品名称
-                categoryCode: item.productCode||this.productList[0].categoryCode, // 产品编码
-                categoryModel:item.modelType|| this.productList[0].categoryModel, // 物品型号
-                specification: item.specification||this.productList[0].specification, // 规格
-                brandNum: item.productBrand||this.productList[0].brandNum, // 牌号
-                parentIndex: this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode).index:this.productList[0].index, // 产品索引
+                index: this.isMoreProduct
+                  ? this.productList.find(
+                      (val) => val.categoryCode == item.productCode
+                    ).index +
+                    '-' +
+                    index
+                  : this.productList[0].index + '-' + index, // 包装索引
+                warehouseId:
+                  item.warehouseId || this.productList[0].warehouseIds[index], // 仓库id
+                warehouseName:
+                  item.warehouseName ||
+                  this.productList[0].warehouseNames[index], // 仓库名称
+                categoryName:
+                  item.productName || this.productList[0].categoryName, // 产品名称
+                categoryCode:
+                  item.productCode || this.productList[0].categoryCode, // 产品编码
+                categoryModel:
+                  item.modelType || this.productList[0].categoryModel, // 物品型号
+                specification:
+                  item.specification || this.productList[0].specification, // 规格
+                brandNum: item.productBrand || this.productList[0].brandNum, // 牌号
+                parentIndex: this.isMoreProduct
+                  ? this.productList.find(
+                      (val) => val.categoryCode == item.productCode
+                    ).index
+                  : this.productList[0].index, // 产品索引
                 batchNo: this.productList[0].batchNo, // 批次号
-                packageNo:packingCodeList[index].onlyCode, // 包装编码
+                packageNo: packingCodeList[index].onlyCode, // 包装编码
                 packingQuantity: 1, // 包装数量
                 packingUnit: item.packingUnit, // 单位
                 measureQuantity: item.quantity, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 weight: item.packingWeight, // 重量
-                weightUnit: item.weightUnit||this.productList[0].weightUnit, // 重量单位
-                packingSpecificationOption:this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode)?.packingSpecificationOption:this.productList[0].packingSpecificationOption, // 包装规格
-                  
+                weightUnit: item.weightUnit || this.productList[0].weightUnit, // 重量单位
+                packingSpecificationOption: this.isMoreProduct
+                  ? this.productList.find(
+                      (val) => val.categoryCode == item.productCode
+                    )?.packingSpecificationOption
+                  : this.productList[0].packingSpecificationOption, // 包装规格
+
                 netWeight: this.productList[0].netWeight, // 净重
-                barcodes: item.barcodes||item.sendCode, // 发货条码
-                clientCode: item.clientCode||item.extInfo?.clientCode, // 客户代号
-                materielDesignation:item.materielDesignation|| item.extInfo?.materielCode, // 物料代号
-                engrave: item.engrave||item.extInfo?.engrave, // 刻码
+                barcodes: item.barcodes || item.sendCode, // 发货条码
+                clientCode: item.clientCode || item.extInfo?.clientCode, // 客户代号
+                materielDesignation:
+                  item.materielDesignation || item.extInfo?.materielCode, // 物料代号
+                engrave: item.engrave || item.extInfo?.engrave, // 刻码
                 isUnpack: this.productList[0].isUnpack, // 是否允许拆包
                 productionDate: productionDate, // 生产日期
                 purchaseDate: purchaseDate, // 采购时间
@@ -1453,28 +1499,27 @@
           });
         }
       },
-     //获取计量数量
-     getMeasureQuantity(code){
-          let measureQuantity=0
-          this.detailList.forEach(item=>{
-            if(code==item.productCode){
-              measureQuantity+=item.quantity
-            }
-            
-          })
-         return measureQuantity
-     },
-         //多产品明细数据转换
-    async getDetailsVal(code,productBrand) {
-       const {data} =await storageApi.getAssetNum([
-              {
-                assetCode:code,
-                batchNum: 1,
-                num: 1
-              }
-            ]);
-            console.log(data)
-           return data[0].onlyCode
+      //获取计量数量
+      getMeasureQuantity(code) {
+        let measureQuantity = 0;
+        this.detailList.forEach((item) => {
+          if (code == item.productCode) {
+            measureQuantity += item.quantity;
+          }
+        });
+        return measureQuantity;
+      },
+      //多产品明细数据转换
+      async getDetailsVal(code, productBrand) {
+        const { data } = await storageApi.getAssetNum([
+          {
+            assetCode: code,
+            batchNum: 1,
+            num: 1
+          }
+        ]);
+        console.log(data);
+        return data[0].onlyCode;
       },
       // 获取当前时间函数
       getNowDate() {
@@ -1772,7 +1817,7 @@
           });
           obj.warehouseIds = warehouseId;
           obj.warehouseNames = warehouseName;
-          obj._packingList=_packingList
+          obj._packingList = _packingList;
           console.log('yyyyy', obj);
           setTimeout(() => {
             resolve(obj);