From f2ca54c4037fe550253e46356cf34b446c645938 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期五, 19 四月 2024 11:05:32 +0800 Subject: [PATCH] 新增产品的时候产品不显示的 样式调整 --- src/views/overview/AddOverviewDialog.vue | 83 +++++++++++++++++++++++++++++++++-------- 1 files changed, 66 insertions(+), 17 deletions(-) diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue index 7efbea8..df3c3a5 100644 --- a/src/views/overview/AddOverviewDialog.vue +++ b/src/views/overview/AddOverviewDialog.vue @@ -1154,13 +1154,13 @@ }, saveParams() { let data = this.editConfig.infomation; - let companyID = 0; + let companyID = ''; let companyName = ""; - let contacterID = 0; + let contacterID = ''; let contacterName = ""; if (this.editConfig.title == "鏂板缓") { companyID = - Object.keys(this.companyObj).length == 0 ? 0 : this.companyObj.value; + Object.keys(this.companyObj).length == 0 ? '' : this.companyObj.value; companyName = Object.keys(this.companyObj).length == 0 ? "" @@ -1196,7 +1196,7 @@ params = { baseOperationType: data.baseOperationType, comment: data.comment || "", - companyID: companyID, + companyID: companyID+'', companyName: companyName, contacterID: contacterID, contacterName: contacterName, @@ -1230,7 +1230,7 @@ params = { baseOperationType: data.baseOperationType, comment: data.comment || "", - companyID: companyID, + companyID: companyID+'', companyName: companyName, contacterID: contacterID, contacterName: contacterName, @@ -1293,13 +1293,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 +1314,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 +1327,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 +1341,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 +1360,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 +1374,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 +1393,7 @@ toLocation: true, isRequird: true, }, + { label: "鏁伴噺", prop: "amount", inputFloat: true }, { label: "璁¢噺鍗曚綅", prop: "unit" }, ]; } else if (this.workType == 5) { @@ -1397,11 +1401,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 +1420,7 @@ toLocation: true, isRequird: true, }, + { label: "鏁伴噺", prop: "amount", inputFloat: true }, { label: "璁¢噺鍗曚綅", prop: "unit" }, ]; } @@ -1468,8 +1473,11 @@ 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, totalGrossWeight:res.totalGrossWeight, @@ -1483,7 +1491,8 @@ productName: res.name, productId: res.id, auxiliaryUnit:adjunctUnit, - auxiliaryAmount:adjunctAmount, + auxiliaryAmount:adjunctAmount?Number(adjunctAmount)*1:0, + auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0, inputFloatAuxiliaryAmount:isValue, grossWeight:res.grossWeight, totalGrossWeight:res.grossWeight?Number(res.grossWeight)*1:'', @@ -1494,15 +1503,50 @@ }); 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) { this.countId = row.countId; this.tableData.map((item) => { if (item.id == row.id) { + debugger 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 +1601,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 +1728,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", -- Gitblit v1.8.0