| | |
| | | <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> |
| | | <el-table |
| | | ref="fromTable" |
| | | :border="isBorder" |
| | | :data="tableList.tableData" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | isBorder:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | | default: () => { |
| | |
| | | TabsIndex: "0", |
| | | productTableList: {}, |
| | | productColumn: productColumn, |
| | | showProductCol: ["产品编号", "产品名称","产品规格", "单位", "订单数量", "已完成数量", "已发货数量", "采购数量", "生产数量", "委外数量","销售单价","成本单价","毛利","毛利率","价税合计"], |
| | | showProductCol: ["产品编号", "产品名称","产品规格", "单位", "订单数量", "已完成数量", "已发货数量", "采购数量", "生产数量", "委外数量","销售单价","成本单价","毛利","毛利率(%)","价税合计"], |
| | | inventoryColumn: inventoryColumn, |
| | | showInventoryCol: [ |
| | | "出库单", |
| | |
| | | "状态" |
| | | ], |
| | | makeColumn: makeColumn, |
| | | showMakeCol: ["生产订单", "产品名称", "订单状态", "工单编号", "工单状态", "计划开始时间", "计划结束时间"], |
| | | showMakeCol: ["生产订单", "产品编号", "产品名称", "产品规格", "产品单位", "订单数量", "完成数量","工单编号","工单状态","计划开始时间","计划结束时间"], |
| | | // 采购 |
| | | purchaseColumn: purchaseColumn, |
| | | outsourceColumn:outsourceColumn, |
| | |
| | | this.loading = true |
| | | await getProductInventoryInfo(row.number) |
| | | .then((res) => { |
| | | console.log(res,"resss") |
| | | this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : [] |
| | | this.loading = false |
| | | }) |
| | |
| | | }, |
| | | // 确认发货完成 |
| | | async confirmClick(row){ |
| | | await confirmOutputOver({saleDetailNumber:row.number}).then((res)=>{ |
| | | if(res&&res.code===200){ |
| | | this.$message.success("确认发货完成") |
| | | this.getData() |
| | | this.selectRow = row |
| | | await getProductInventoryInfo(this.selectRow.number) |
| | | .then((res) => { |
| | | console.log(res,"resss") |
| | | if(res.data){ |
| | | this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : [] |
| | | // let accumulator=res.data |
| | | // const reducedArray = array.reduce((accumulator, currentItem) => { |
| | | // // 查找当前number是否已存在于accumulator中 |
| | | // const existingItem = accumulator.find(item => item.number === currentItem.number); |
| | | // if (existingItem) { |
| | | // // 如果存在,累加num |
| | | // existingItem.amount += currentItem.amount; |
| | | // } else { |
| | | // // 如果不存在,将当前项添加到accumulator中 |
| | | // accumulator.push(currentItem); |
| | | // } |
| | | // return accumulator; |
| | | // }, []); // 初始化accumulator为一个空数组 |
| | | |
| | | // console.log(reducedArray,"新数组"); |
| | | } |
| | | this.loading = false |
| | | }) |
| | | // let obj=[ |
| | | // { |
| | | // name:"小明", |
| | | // id:1, |
| | | // num:10 |
| | | // }, |
| | | // { |
| | | // name:"小明", |
| | | // id:1, |
| | | // num:20 |
| | | // }, |
| | | // { |
| | | // name:"小明", |
| | | // id:1, |
| | | // num:5 |
| | | // }, |
| | | // { |
| | | // name:"小红", |
| | | // id:1, |
| | | // num:5 |
| | | // }, |
| | | // { |
| | | // name:"小红", |
| | | // id:1, |
| | | // num:10 |
| | | // }, |
| | | // { |
| | | // name:"小房", |
| | | // id:5, |
| | | // num:3 |
| | | // }, |
| | | // ] |
| | | .catch(() => { |
| | | this.productTableList.tableInfomation = [] |
| | | this.loading = false |
| | | }) |
| | | // await confirmOutputOver({saleDetailNumber:row.number}).then((res)=>{ |
| | | // if(res&&res.code===200){ |
| | | // this.$message.success("确认发货完成") |
| | | // this.getData() |
| | | // } |
| | | // }) |
| | | }, |
| | | // 关闭 |
| | | closeClick(row) { |
| | |
| | | if (this.selectRow.status == 1) { |
| | | this.productTableList.tableInfomation = [] |
| | | } else { |
| | | console.log(this.selectRow,"看看") |
| | | this.getProductInventoryInfo(this.selectRow) |
| | | } |
| | | } else if (this.TabsIndex == 2) { |
| | |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-position="left" |
| | | label-width="10%" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | |
| | | :selectBox="false" |
| | | :addTypeIdMultiple="true" |
| | | pageName="quotation" |
| | | :isBorder="true" |
| | | :detailEnter="true" |
| | | :isOperate=" |
| | | (autoCodeHeadersObj.Bjd == 'yes' && editConfig.infomation.quotation_number) || |
| | | autoCodeHeadersObj.Bjd != 'yes' |
| | | ? true |
| | | : false |
| | | " |
| | | :quotationNumber="autoCodeHeadersObj.Bjd == 'yes' ? editConfig.infomation.quotation_number : ''" |
| | | :product-table-list="productTableList" |
| | | :isOperate="true" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @getSelectArray="getSelectArray" |
| | |
| | | let shipmentsNum=false |
| | | this.shipmentsList.map((item)=>{ |
| | | if(this.shipmentsType===1){ |
| | | if(item.leftAmount<item.availableAmount){ |
| | | if(item.leftAmount<item.availableAmount&&item.leftAmount>0){ |
| | | isShipments=false |
| | | }else if(item.leftAmount<=0){ |
| | | shipmentsNum=true |
| | | }else{ |
| | | isShipments=true |
| | | } |
| | |
| | | shipmentsNum=true |
| | | }else if(!item.outputAmount){ |
| | | shipmentsNum=true |
| | | }else if(item.leftAmount<=0){ |
| | | isShipments=true |
| | | }else{ |
| | | isShipments=false |
| | | } |
| | |
| | | ] |
| | | this.dissatisfy=false |
| | | let portion=0 |
| | | // let noUsable=false |
| | | this.productTableList.tableData.map((item)=>{ |
| | | if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){ |
| | | item.availableAmount=Number(item.availableAmount) |
| | | item.leftAmount=Number(item.leftAmount) |
| | | item.finishAmount=Number(item.finishAmount) |
| | | item.orderAmount=Number(item.orderAmount) |
| | | console.log(item,"item") |
| | | if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){ |
| | | portion++ |
| | | this.shipmentsList.push(item) |
| | | } |
| | | // if(item.availableAmount<item.leftAmount){ |
| | | // noUsable=true |
| | | // } |
| | | }) |
| | | if(portion===0){// 没有产品满足发货条件 |
| | | this.completely=false |
| | | this.dissatisfy=true |
| | | this.shipmentsMsg="当前仓库库存不足,不能完成一次发货" |
| | | // if(noUsable){ |
| | | // this.shipmentsMsg="可用库存不满足未发货数量,无法发货" |
| | | // }else{ |
| | | // } |
| | | this.shipmentsMsg="可用库存或未发货数量为0或当前可用库存不满足未发货数量,不能完成一次发货" |
| | | |
| | | }else if(portion>0&&portion<this.productTableList.tableData.length){// 部分产品满足发货条件 |
| | | this.dissatisfy=false |
| | | this.completely=true |
| | | this.shipmentsMsg="只能满足部分发货需求,是否确认发货" |
| | | |
| | | }else if(portion===this.productTableList.tableData.length){// 充分满足 |
| | | }else if(portion!==0){ |
| | | this.dissatisfy=false |
| | | this.completely=true |
| | | console.log(portion,"portion") |
| | | this.shipmentsMsg="能满足发货需求,直接发货吧" |
| | | } |
| | | }) |
| | | |
| | | if(portion===this.productTableList.tableData.length){ // 全部满足发货条件 |
| | | this.dissatisfy=false |
| | | this.completely=false |
| | |
| | | ] |
| | | let portion=0 |
| | | this.productTableList.tableData.map((item)=>{ |
| | | if(item.availableAmount>0){ |
| | | item.availableAmount=Number(item.availableAmount) |
| | | item.leftAmount=Number(item.leftAmount) |
| | | item.finishAmount=Number(item.finishAmount) |
| | | item.orderAmount=Number(item.orderAmount) |
| | | if(item.availableAmount>0&&item.leftAmount>0){ |
| | | portion++ |
| | | this.shipmentsList.push(item) |
| | | } |
| | | }) |
| | | if(portion===0){ // 没有一件产品能满足发货条件 |
| | | this.completely=false |
| | | this.dissatisfy=true |
| | | this.shipmentsMsg="当前仓库库存为0,无法发货" |
| | | this.shipmentsMsg="可用库存或未发货数量为0,无法发货" |
| | | }else if(portion>0&&portion<this.productTableList.tableData.length){ |
| | | this.dissatisfy=false |
| | | this.completely=true |
| | |
| | | this.completely=true |
| | | this.shipmentsMsg="能满足发货需求,直接发货吧" |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 产品入库信息 |
| | |
| | | if(this.shipmentsType===1){ |
| | | let portion=0 |
| | | this.productTableList.tableData.map((item)=>{ |
| | | if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){ |
| | | item.availableAmount=Number(item.availableAmount) |
| | | item.leftAmount=Number(item.leftAmount) |
| | | item.finishAmount=Number(item.finishAmount) |
| | | item.orderAmount=Number(item.orderAmount) |
| | | if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){ |
| | | portion++ |
| | | this.shipmentsList.push(item) |
| | | } |
| | | }) |
| | | console.log(portion,"portion2") |
| | | if(portion===0){// 没有产品满足发货条件 |
| | | this.completely=false |
| | | this.dissatisfy=true |
| | | this.shipmentsMsg="当前产品可用库存为0,无法发货" |
| | | this.shipmentsMsg="可用库存或未发货数量为0或当前可用库存不满足未发货数量,不能完成一次发货" |
| | | }else if(portion>0&&portion<this.productTableList.tableData.length){ |
| | | this.dissatisfy=false |
| | | this.completely=true |
| | | this.shipmentsMsg="只能满足部分发货需求,是否确认发货" |
| | | // 部分产品满足发货条件 |
| | | }else if(portion===this.productTableList.tableData.length){ |
| | | }else{ |
| | | this.dissatisfy=false |
| | | this.completely=true |
| | | this.shipmentsMsg="能满足发货需求,直接发货吧" |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | |
| | | } |
| | | } |
| | | .basic-info { |
| | | padding: 0px 20px ; |
| | | .product-view{ |
| | | } |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |
| | | padding-left: 10px; |
| | |
| | | .tips{ |
| | | font-size: 16px; |
| | | display: flex; |
| | | margin-left: 20px; |
| | | i{ |
| | | font-size: 24px; |
| | | margin-right: 10px; |
| | |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | text-align: right !important; |
| | | } |
| | | .el-input__inner { |
| | | text-align: left; |
| | | // .el-input__inner { |
| | | // text-align: left; |
| | | // } |
| | | } |
| | | .el-table tr { |
| | | background-color: #fff; |
| | | } |
| | | .el-table th.el-table__cell.is-leaf{ |
| | | background-color: #F1F3F8 !important; |
| | | } |
| | | .el-dialog__footer{ |
| | | text-align: right !important; |
| | | padding-right: 20px; |
| | | } |
| | | .el-dialog__header { |
| | | background: #f5f7fa; |
| | | height: 50px !important; |
| | | line-height: 50px !important; |
| | | padding: 0; |
| | | font-weight: 600 !important; |
| | | font-size: 15px !important; |
| | | padding-left: 20px !important; |
| | | } |
| | | // .el-table{ |
| | | // border: 1px solid #e1e1e1; |
| | | // } |
| | | } |
| | | </style> |