haoxuan
2024-04-19 4d41577c2d01648ba3e9919fbd540380279ca85f
src/views/overview/AddOverviewDialog.vue
@@ -1044,6 +1044,8 @@
                    productId: item.productId,
                    auxiliaryUnit:item.auxiliaryUnit,
                    auxiliaryAmount:item.auxiliaryAmount,
                    totalNetWeight:item.totalNetWeight,
                    totalGrossWeight:item.totalGrossWeight,
                  });
                });
                params.details = arr;
@@ -1057,6 +1059,8 @@
                      productId: item.productId,
                      auxiliaryUnit:item.auxiliaryUnit,
                      auxiliaryAmount:item.auxiliaryAmount,
                      totalNetWeight:item.totalNetWeight,
                     totalGrossWeight:item.totalGrossWeight,
                    });
                  } else {
                    arr.push({
@@ -1066,6 +1070,8 @@
                      productId: item.productId,
                      auxiliaryUnit:item.auxiliaryUnit,
                      auxiliaryAmount:item.auxiliaryAmount,
                      totalNetWeight:item.totalNetWeight,
                     totalGrossWeight:item.totalGrossWeight,
                    });
                  }
                });
@@ -1085,6 +1091,8 @@
                    productId: item.productId,
                    auxiliaryUnit:item.auxiliaryUnit,
                    auxiliaryAmount:item.auxiliaryAmount,
                    totalNetWeight:item.totalNetWeight,
                    totalGrossWeight:item.totalGrossWeight,
                  });
                  // if(item.fromLocationId.value){
                  //   arr.push({
@@ -1196,7 +1204,7 @@
        params = {
          baseOperationType: data.baseOperationType,
          comment: data.comment || "",
          companyID: companyID,
          companyID: companyID+'',
          companyName: companyName,
          contacterID: contacterID,
          contacterName: contacterName,
@@ -1230,7 +1238,7 @@
        params = {
          baseOperationType: data.baseOperationType,
          comment: data.comment || "",
          companyID: companyID,
          companyID: companyID+'',
          companyName: companyName,
          contacterID: contacterID,
          contacterName: contacterName,
@@ -1293,13 +1301,14 @@
          {
            label: "产品名称",
            prop: "productName",
            min:150,
            productName: true,
            isRequird: true,
          },
          { label: "产品编码", prop: "productId" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "计量单位", prop: "unit" },
          { label: "辅助数量", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
          { label: "辅助单位", prop: "auxiliaryUnit" },
@@ -1313,11 +1322,11 @@
          {
            label: "产品名称",
            prop: "productName",
            min:150,
            productName: true,
            isRequird: true,
          },
          { label: "产品编码", prop: "productId" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          {
@@ -1326,6 +1335,7 @@
            sonLocation: true,
            isRequird: true,
          },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "计量单位", prop: "unit" },
          { label: "辅助数量", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
          { label: "辅助单位", prop: "auxiliaryUnit" },
@@ -1339,11 +1349,11 @@
          {
            label: "产品名称",
            prop: "productName",
            min:150,
            productName: true,
            isRequird: true,
          },
          { label: "产品编码", prop: "productId" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          {
@@ -1358,6 +1368,7 @@
            toLocation: true,
            isRequird: true,
          },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "计量单位", prop: "unit" },
          { label: "辅助数量", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
          { label: "辅助单位", prop: "auxiliaryUnit" },
@@ -1371,11 +1382,11 @@
          {
            label: "产品名称",
            prop: "productName",
            min:150,
            productName: true,
            isRequird: true,
          },
          { label: "产品编码", prop: "productId" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          {
@@ -1390,6 +1401,7 @@
            toLocation: true,
            isRequird: true,
          },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "计量单位", prop: "unit" },
        ];
      } else if (this.workType == 5) {
@@ -1397,11 +1409,11 @@
          {
            label: "产品名称",
            prop: "productName",
            min:150,
            productName: true,
            isRequird: true,
          },
          { label: "产品编码", prop: "productId" },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          {
@@ -1416,6 +1428,7 @@
            toLocation: true,
            isRequird: true,
          },
          { label: "数量", prop: "amount", inputFloat: true },
          { label: "计量单位", prop: "unit" },
        ];
      }
@@ -1468,12 +1481,15 @@
            unit: res.product.unit,
            model:res.product.model,
            specs:res.product.specs,
            moreUnit:res.product.moreUnit,
            moreUnitList:res.product.moreUnitList,
            auxiliaryUnit:res.auxiliaryUnit,
            auxiliaryAmount:res.auxiliaryAmount,
            auxiliaryAmount:res.amount&&adjunctAmount?Number(adjunctAmount)*Number(res.amount):0,
            auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0,
            inputFloatAuxiliaryAmount:isValue,
            grossWeight:res.product.grossWeight,
            grossWeight:res.product.grossWeight==0?'':res.product.grossWeight,
            totalGrossWeight:res.totalGrossWeight,
            netWeight:res.product.netWeight,
            netWeight:res.product.netWeight==0?'':res.product.netWeight,
            totalNetWeight:res.totalNetWeight,  
          };
        }else{
@@ -1483,16 +1499,49 @@
            productName: res.name,
            productId: res.id,
            auxiliaryUnit:adjunctUnit,
            auxiliaryAmount:Number(adjunctAmount),
            auxiliaryAmount:adjunctAmount?Number(adjunctAmount)*1:0,
            auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0,
            inputFloatAuxiliaryAmount:isValue,
            grossWeight:Number(res.grossWeight),
            grossWeight:res.grossWeight==0?'':res.grossWeight,
            totalGrossWeight:res.grossWeight?Number(res.grossWeight)*1:'',
            netWeight:Number(res.netWeight),
            netWeight:res.netWeight==0?'':res.netWeight,
            totalNetWeight:res.netWeight?Number(res.netWeight)*1:'', 
          };
        }
      });
        return list||[];
    },
    getAuxiligyAmount(unit,unitList){
      let adjunctUnit=''
        let adjunctAmount=''
        let isValue=false
        let moreUnit=unit?unit:''
        let moreUnitList=unitList?unitList:[]
        if(moreUnit&&moreUnitList){
          if(moreUnitList.length>0){
            for(let j in moreUnitList){
              if(moreUnitList[j].floating){
                isValue=true;
                adjunctUnit=moreUnitList[j].unit
                adjunctAmount=moreUnitList[j].amount
                break;
              }
            }
            if(!isValue){
              for(let j in moreUnitList){
                 if(moreUnitList[j].unit){
                  adjunctUnit=moreUnitList[j].unit
                  adjunctAmount=moreUnitList[j].amount
                  break;
                }
              }
            }
          }
        }
        return {
          auxiliaryAmount:adjunctAmount,
          auxiliaryUnit:adjunctUnit,
        }
    },
    // 操作输入
    inputContent(val, prop, row) {
@@ -1500,9 +1549,11 @@
      this.tableData.map((item) => {
        if (item.id == row.id) {
          item[prop] = val;
          let auxiliaryAmountObject=this.getAuxiligyAmount(item.moreUnit,item.moreUnitList)
          if(prop=='amount'){
            item.totalGrossWeight=item[prop]&&item.grossWeight?Number(item.grossWeight)*Number(item[prop]):''
            item.totalNetWeight=item[prop]&&item.netWeight?Number(item.netWeight)*Number(item[prop]):''
            item.auxiliaryAmount=item[prop]&&auxiliaryAmountObject.auxiliaryAmount?Number(auxiliaryAmountObject.auxiliaryAmount)*Number(item[prop]):''
          }
        }
      });
@@ -1557,7 +1608,7 @@
    },
    // 新增方式修改
    getSelectArray(val, index) {
      if (this.tableData.length == 1 && this.tableData[0].number.length == 0) {
      if (this.tableData.length == 1 && this.tableData[0].number&&this.tableData[0].number.length == 0) {
        this.tableData = [];
      }
      if (index < this.tableData.length) {
@@ -1684,14 +1735,19 @@
          console.log(res);
          if (res.code == 200) {
            console.log(this.editConfig.infomation.baseOperationType, "类型");
            let name=''
            if(res.data){
              name=res.data.name?res.data.name:''
            }
            let pdfParams = {
              url: res.data,
              url: res.data?res.data.url:'',
              baseOperationType:
                this.editConfig.infomation.baseOperationType || undefined,
              cutAfterWidth:
                this.editConfig.infomation.baseOperationType == 2
              // 1是嘉联
              cutAfterWidth:name=='jialian'?52.6:
               (this.editConfig.infomation.baseOperationType == 2
                  ? 50.8
                  : 53.3,
                  : 53.3),
            };
            var { href } = this.$router.resolve({
              path: "/overview/previewExcel",