| | |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="left" |
| | | label-width="10%" |
| | | label-width="90px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item width="50%" label="交付类型" prop="addressee"> |
| | | <el-radio-group v-model="shipmentsType" @change="handleRadioChange"> |
| | | <el-form-item width="50%" label="交付类型:" prop="deliverType"> |
| | | <el-radio-group v-model="editConfig.infomation.deliverType" @change="handleRadioChange"> |
| | | <el-radio :label="1">一次发货</el-radio> |
| | | <el-radio :label="2">多次发货</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="关联项目" prop="projectId"> |
| | | <el-form-item label="关联项目:" prop="projectId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.projectId" |
| | | placeholder="请选择" |
| | |
| | | @getSelectArray="getSelectArray" |
| | | @emptyProductClick="emptyProductClick" |
| | | @clearupProduct="clearupProduct" |
| | | @selTableCol="selTableCol" |
| | | ></CommonFormTableView> |
| | | </div> |
| | | <p class="tips tips_success" v-if="completely"><i class="el-icon-warning-outline"></i>{{ shipmentsMsg }}</p> |
| | |
| | | }, |
| | | }, |
| | | data() { |
| | | // 产品信息 |
| | | const productColumn = [ |
| | | { label: "产品编号", prop: "number", isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount", isShowColumn:true,}, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | { label: "未发货数量", prop: "leftAmount", isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount",isShowColumn:true,}, |
| | | ] |
| | | return { |
| | | dialogWidth: "60%", |
| | | editConfig: this.editCommonConfig, |
| | |
| | | wechatOrderStatusOptions: [], // 微信订单状态 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | productTableList: { |
| | | allcol: [], |
| | | showcol: ['产品编号','产品名称', "订单数量", "订单完成数量",], |
| | | tableData: [], |
| | | tableColumn: [] |
| | | }, |
| | | tableColumn: productColumn, |
| | | searchOptions: [], |
| | | |
| | | showSummary: { |
| | | show: true, |
| | | total: true, |
| | |
| | | return time.getTime() > Date.now() |
| | | } |
| | | }, |
| | | shipmentsType:1, |
| | | options: [{ |
| | | value: '1', |
| | | label: '仓库1--库存不足的情况' |
| | |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.setTableForm() |
| | | this.handleRadioChange() |
| | | this.getCommonData() |
| | | this.formInfo() |
| | | this.getUseSystemSet({ modeType: "xsmx" }) |
| | | this.getProjectList() |
| | | this.getDeliveryPrepareInfo({ |
| | | saleDetailID: this.editCommonConfig.infomation.saleDetailID, |
| | | saleDetailNumber: this.editCommonConfig.infomation.saleDetailNumber |
| | | saleDetailID: this.editCommonConfig.infomation.saleDetailID, |
| | | saleDetailNumber: this.editCommonConfig.infomation.saleDetailNumber |
| | | }) |
| | | }, |
| | | watch: { |
| | | "editClientManageConfig.visible"(val) { |
| | | if (val) { |
| | | this.handleRadioChange() |
| | | this.formInfo() |
| | | |
| | | } |
| | | } |
| | | }, |
| | |
| | | let isShipments=false |
| | | let shipmentsNum=false |
| | | this.shipmentsList.map((item)=>{ |
| | | if(this.shipmentsType===1){ |
| | | if(this.editConfig.infomation.deliverType===1){ |
| | | if(item.leftAmount<item.availableAmount&&item.leftAmount>0){ |
| | | isShipments=false |
| | | }else if(item.leftAmount<=0){ |
| | |
| | | this.shipmentsList.map((item)=>{ |
| | | let obj={ |
| | | number:item.number, |
| | | outputAmount:this.shipmentsType===1?item.leftAmount:item.outputAmount // 本次发货数量 |
| | | outputAmount:this.editConfig.infomation.deliverType===1?item.leftAmount:item.outputAmount // 本次发货数量 |
| | | } |
| | | params.products.push(obj) |
| | | }) |
| | |
| | | } |
| | | ] |
| | | } else { |
| | | this.tableData = this.editConfig.infomation.products |
| | | this.tableData = this.editConfig.infomation.products?this.editConfig.infomation.products:[] |
| | | this.tableData.map((item, index) => { |
| | | item.productId = index + 1 |
| | | }) |
| | | this.getQuotation(this.editConfig.infomation.saleChanceId, "全部产品") |
| | | } |
| | | this.tableColumn=[ |
| | | { label: "产品编号", prop: "number", isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount", isShowColumn:true,}, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, } |
| | | ] |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | isReturn: true, |
| | | tableColumn: [ |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "产品名称", prop: "name", min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount" }, |
| | | { label: "订单完成数量", prop: "finishAmount" }, |
| | | // { label: "可用库存", prop: "unit" }, |
| | | ] |
| | | // tableColumn: [ |
| | | // { label: "产品编号", prop: "number", isShowColumn:true, }, |
| | | // { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | // { label: "订单数量", prop: "orderAmount", isShowColumn:true,}, |
| | | // { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, } |
| | | // ], |
| | | tableColumn: this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | } |
| | | this.setTableList(this.productTableList) |
| | | }, |
| | | setTableList(tableList) { |
| | | tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < tableList.tableColumn.length; i++) { |
| | | const label = tableList.tableColumn[i].label |
| | | const value = tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | setColumnVisible(showcol, tableColumn) { |
| | | return tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showcol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | selTableCol(val) { |
| | | this.productTableList.showcol = val |
| | | this.productTableList.tableColumn = this.setColumnVisible(val, this.tableColumn) |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | |
| | | } |
| | | }, |
| | | // 选择发货方式 |
| | | handleRadioChange(value) { |
| | | handleRadioChange() { |
| | | let value=this.editConfig.infomation.deliverType |
| | | this.shipmentsList=[] |
| | | this.dissatisfy=false |
| | | this.completely=false |
| | | if(value===1){ |
| | | this.productTableList.tableColumn=[ |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "产品名称", prop: "name", min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount" }, |
| | | { label: "订单完成数量", prop: "finishAmount" }, |
| | | { label: "可用库存", prop: "availableAmount" }, |
| | | if(value==1){ |
| | | this.productTableList.showcol= ['产品编号','产品名称', "订单数量", "订单完成数量","可用库存"] |
| | | this.productTableList.allcol= ["订单数量", "订单完成数量","可用库存"] |
| | | this.tableColumn=[ |
| | | { label: "产品编号", prop: "number",isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name",isShowColumn:true, min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount",isShowColumn:true, }, |
| | | { label: "订单完成数量", prop: "finishAmount",isShowColumn:true, }, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | ] |
| | | this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | this.dissatisfy=false |
| | | let portion=0 |
| | | // let noUsable=false |
| | |
| | | this.completely=false |
| | | this.completely=true |
| | | } |
| | | }else if(value===2){ |
| | | this.productTableList.tableColumn= [ |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "产品名称", prop: "name", min: 110 }, |
| | | { label: "订单数量", prop: "orderAmount" }, |
| | | { label: "订单完成数量", prop: "finishAmount" }, |
| | | { label: "可用库存", prop: "availableAmount" }, |
| | | { label: "未发货数量", prop: "leftAmount", }, |
| | | { label: "本次发货数量", prop: "outputAmount", inputFloat: true,isRequird:true }, |
| | | { label: "剩余发货数量", prop: "availableAmount",}, |
| | | }else if(value==2){ |
| | | this.productTableList.showcol= ['产品编号','产品名称', "订单数量", "订单完成数量","可用库存","未发货数量", "本次发货数量","剩余发货数量",] |
| | | this.productTableList.allcol= [ "订单数量", "订单完成数量","可用库存","未发货数量", "剩余发货数量",] |
| | | this.tableColumn= [ |
| | | { label: "产品编号", prop: "number",isShowColumn:true, }, |
| | | { label: "产品名称", prop: "name", min: 110 ,isShowColumn:true,}, |
| | | { label: "订单数量", prop: "orderAmount",isShowColumn:true, }, |
| | | { label: "订单完成数量", prop: "finishAmount" ,isShowColumn:true,}, |
| | | { label: "可用库存", prop: "availableAmount",isShowColumn:true, }, |
| | | { label: "未发货数量", prop: "leftAmount", isShowColumn:true, }, |
| | | { label: "本次发货数量", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,}, |
| | | { label: "剩余发货数量", prop: "availableAmount",isShowColumn:true,}, |
| | | ] |
| | | this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn) |
| | | let portion=0 |
| | | this.productTableList.tableData.map((item)=>{ |
| | | item.availableAmount=Number(item.availableAmount) |
| | |
| | | this.shipmentsList=[] |
| | | if(res&&res.code===200){ |
| | | this.productTableList.tableData=res.data||[] |
| | | if(this.shipmentsType===1){ |
| | | if(this.editConfig.infomation.deliverType===1){ |
| | | let portion=0 |
| | | this.productTableList.tableData.map((item)=>{ |
| | | item.availableAmount=Number(item.availableAmount) |