| | |
| | | :addTypeIdMultiple="true" |
| | | :product-table-list="productTableList" |
| | | :detail-enter="!showFooter" |
| | | @selProductClick="selProductClick" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick('操作')" |
| | | @getSelectArray="getSelectArray" |
| | | @selSonLocationClick="selSonLocationClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @clearupProduct="clearupProduct" |
| | | > |
| | | <template v-if="showFooter" slot="tableButton"> |
| | | <!-- fixed="right" --> |
| | | <el-table-column |
| | | label="操作" |
| | | width="60" |
| | | fixed="right" |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | getLogisticCompanyList, |
| | | printReceipts, |
| | | } from "@/api/overview/overview"; |
| | | import { |
| | | getLocationProductAmount |
| | | } from "@/api/operate/inventoryAdjustment" |
| | | import { |
| | | getSupplierList, |
| | | getCompanyList, |
| | |
| | | productId: item.productId, |
| | | auxiliaryUnit:item.auxiliaryUnit, |
| | | auxiliaryAmount:item.auxiliaryAmount, |
| | | totalNetWeight:item.totalNetWeight, |
| | | totalGrossWeight:item.totalGrossWeight, |
| | | }); |
| | | }); |
| | | params.details = arr; |
| | |
| | | productId: item.productId, |
| | | auxiliaryUnit:item.auxiliaryUnit, |
| | | auxiliaryAmount:item.auxiliaryAmount, |
| | | totalNetWeight:item.totalNetWeight, |
| | | totalGrossWeight:item.totalGrossWeight, |
| | | }); |
| | | } else { |
| | | arr.push({ |
| | |
| | | productId: item.productId, |
| | | auxiliaryUnit:item.auxiliaryUnit, |
| | | auxiliaryAmount:item.auxiliaryAmount, |
| | | totalNetWeight:item.totalNetWeight, |
| | | totalGrossWeight:item.totalGrossWeight, |
| | | }); |
| | | } |
| | | }); |
| | |
| | | productId: item.productId, |
| | | auxiliaryUnit:item.auxiliaryUnit, |
| | | auxiliaryAmount:item.auxiliaryAmount, |
| | | totalNetWeight:item.totalNetWeight, |
| | | totalGrossWeight:item.totalGrossWeight, |
| | | }); |
| | | // if(item.fromLocationId.value){ |
| | | // arr.push({ |
| | |
| | | }, |
| | | 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 |
| | | ? "" |
| | |
| | | params = { |
| | | baseOperationType: data.baseOperationType, |
| | | comment: data.comment || "", |
| | | companyID: companyID, |
| | | companyID: companyID+'', |
| | | companyName: companyName, |
| | | contacterID: contacterID, |
| | | contacterName: contacterName, |
| | |
| | | params = { |
| | | baseOperationType: data.baseOperationType, |
| | | comment: data.comment || "", |
| | | companyID: companyID, |
| | | companyID: companyID+'', |
| | | companyName: companyName, |
| | | contacterID: contacterID, |
| | | contacterName: contacterName, |
| | |
| | | { |
| | | 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" }, |
| | |
| | | { |
| | | 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: "fromLocationId", |
| | | min:120, |
| | | sonLocation: true, |
| | | isRequird: true, |
| | | }, |
| | | { label: "在库数量", prop: "inLibraryAmount" }, |
| | | { label: "数量", prop: "amount", inputFloat: true }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "辅助数量", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' }, |
| | | { label: "辅助单位", prop: "auxiliaryUnit" }, |
| | |
| | | { |
| | | 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: "fromLocationId", |
| | | sonLocation: true, |
| | | min:120, |
| | | isRequird: true, |
| | | }, |
| | | { |
| | |
| | | toLocation: true, |
| | | isRequird: true, |
| | | }, |
| | | { label: "数量", prop: "amount", inputFloat: true }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "辅助数量", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' }, |
| | | { label: "辅助单位", prop: "auxiliaryUnit" }, |
| | |
| | | { |
| | | 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: "fromLocationId", |
| | | min:120, |
| | | sonLocation: true, |
| | | isRequird: true, |
| | | }, |
| | |
| | | toLocation: true, |
| | | isRequird: true, |
| | | }, |
| | | { label: "数量", prop: "amount", inputFloat: true }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | ]; |
| | | } else if (this.workType == 5) { |
| | |
| | | { |
| | | 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: "fromLocationId", |
| | | min:120, |
| | | sonLocation: true, |
| | | isRequird: true, |
| | | }, |
| | |
| | | toLocation: true, |
| | | isRequird: true, |
| | | }, |
| | | { label: "数量", prop: "amount", inputFloat: true }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | ]; |
| | | } |
| | | console.log(this.tableData,'===tableData') |
| | | if(this.workType == 2){ |
| | | for(let i in this.tableData){ |
| | | this.selSonLocationClick(this.tableData[i].fromLocation.id,'fromLocationId',this.tableData[i],i,3) |
| | | } |
| | | } |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | tableColumn: tableColumnArr, |
| | | }; |
| | | |
| | | }, |
| | | getTwoTable(data,value){ |
| | | let list = data.map((res) => { |
| | |
| | | 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.amount&&adjunctAmount?Number(adjunctAmount)*Number(res.amount):0, |
| | | auxiliaryAmount:res.auxiliaryAmount, |
| | | auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0, |
| | | inputFloatAuxiliaryAmount:isValue, |
| | | grossWeight:res.product.grossWeight, |
| | | totalGrossWeight:res.totalGrossWeight, |
| | | netWeight:res.product.netWeight, |
| | | totalNetWeight:res.totalNetWeight, |
| | | grossWeight:res.product.grossWeight==0?null:res.product.grossWeight, |
| | | totalGrossWeight:res.totalGrossWeight==0?null:Number(res.totalGrossWeight), |
| | | netWeight:res.product.netWeight==0?null:res.product.netWeight, |
| | | totalNetWeight:res.totalNetWeight==0?null:Number(res.totalNetWeight), |
| | | }; |
| | | }else{ |
| | | return { |
| | | ...res, |
| | | amount: 1, |
| | | productName: res.name, |
| | | productId: res.id, |
| | | productName: res.productId?res.productName:res.name, |
| | | productId: res.productId?res.productId:res.id, |
| | | auxiliaryUnit:adjunctUnit, |
| | | auxiliaryAmount:adjunctAmount, |
| | | auxiliaryAmount:adjunctAmount?(1/Number(adjunctAmount)).toFixed(2):0, |
| | | auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0, |
| | | inputFloatAuxiliaryAmount:isValue, |
| | | grossWeight:res.grossWeight, |
| | | totalGrossWeight:res.grossWeight?Number(res.grossWeight)*1:'', |
| | | netWeight:res.netWeight, |
| | | totalNetWeight:res.netWeight?Number(res.netWeight)*1:'', |
| | | grossWeight:res.grossWeight==0?null:res.grossWeight, |
| | | totalGrossWeight:res.grossWeight==0?null:Number(res.grossWeight)*1, |
| | | netWeight:res.netWeight==0?null:res.netWeight, |
| | | totalNetWeight:res.netWeight==0?null: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) { |
| | |
| | | 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.totalGrossWeight=item[prop]&&item.grossWeight?Number(item.grossWeight)*Number(item[prop]):null |
| | | item.totalNetWeight=item[prop]&&item.netWeight?Number(item.netWeight)*Number(item[prop]):null |
| | | item.auxiliaryAmount=item[prop]&&auxiliaryAmountObject.auxiliaryAmount?(Number(item[prop])/Number(auxiliaryAmountObject.auxiliaryAmount)).toFixed(2):null |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | selSonLocationClick(val, prop, row,scope,type){ |
| | | if(this.workType == 2){ |
| | | if(prop=='fromLocationId'){ |
| | | getLocationProductAmount({ |
| | | locationId:type==3?val:val.value, |
| | | productId:row.productId |
| | | }).then((res)=>{ |
| | | if(res.code==200){ |
| | | if(type==3){ |
| | | this.$set(this.tableData[scope],'inLibraryAmount',res.data?res.data.amount:0) |
| | | }else{ |
| | | this.$set(this.tableData[scope.$index],'inLibraryAmount',res.data?res.data.amount:0) |
| | | } |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | // 新增 |
| | | addProductClick(value) { |
| | |
| | | // } |
| | | // } |
| | | }, |
| | | selProductClick(value, prop,row,scope){ |
| | | this.getSelectArray([value],scope.$index) |
| | | }, |
| | | // 新增方式修改 |
| | | 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) { |
| | |
| | | if (this.workType == "内部调拨"||this.workType==3) { |
| | | this.tableColumn = [ |
| | | { label: "产品", prop: "name", productName: true, isRequird: true }, |
| | | { label: "从", prop: "number", select: true }, |
| | | { label: "从", prop: "number", select: true,min:120,}, |
| | | { label: "至", prop: "amount", select: true }, |
| | | { label: "完成", prop: "total", inputFloat: true }, |
| | | { label: "计量单位", prop: "total", select: true }, |
| | |
| | | } else { |
| | | this.tableColumn = [ |
| | | { label: "产品", prop: "name", productName: true, isRequird: true }, |
| | | { label: "从", prop: "number", select: true }, |
| | | { label: "从", prop: "number", select: true , min:120,}, |
| | | { label: "完成", prop: "total", inputFloat: true }, |
| | | { label: "计量单位", prop: "total", select: true }, |
| | | ]; |
| | |
| | | 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'?53.9: |
| | | (this.editConfig.infomation.baseOperationType == 2 |
| | | ? 50.8 |
| | | : 53.3, |
| | | : 53.3), |
| | | }; |
| | | var { href } = this.$router.resolve({ |
| | | path: "/overview/previewExcel", |