change - 销售订单绑定采购订单校验优化

master
yinq 8 months ago
parent 733a748704
commit c4debaa7de

@ -158,6 +158,28 @@ public class MesPurchaseOrder extends BaseEntity {
/** 条码数 */ /** 条码数 */
private BigDecimal barcodeAmount; private BigDecimal barcodeAmount;
/** 更新绑定数量 */
private BigDecimal updateAmount;
/** 序号 */
private Long serialNumber;
public Long getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(Long serialNumber) {
this.serialNumber = serialNumber;
}
public BigDecimal getUpdateAmount() {
return updateAmount;
}
public void setUpdateAmount(BigDecimal updateAmount) {
this.updateAmount = updateAmount;
}
public BigDecimal getBoundAmount() { public BigDecimal getBoundAmount() {
return boundAmount; return boundAmount;
} }

@ -246,6 +246,8 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
if (StringUtils.isNull(saleOrderId)){ if (StringUtils.isNull(saleOrderId)){
return 0; return 0;
} }
//校验数据
checkSaveSalesBindPurchase(purchaseOrderList);
MesSaleOrder mesSaleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(saleOrderId); MesSaleOrder mesSaleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(saleOrderId);
String saleorderCode = mesSaleOrder.getSaleorderCode(); String saleorderCode = mesSaleOrder.getSaleorderCode();
Long productId = mesSaleOrder.getMaterialId(); Long productId = mesSaleOrder.getMaterialId();
@ -267,7 +269,6 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
String materialCode = mesPurchaseOrder.getMaterialCode(); String materialCode = mesPurchaseOrder.getMaterialCode();
String materialName = mesPurchaseOrder.getMaterialName(); String materialName = mesPurchaseOrder.getMaterialName();
String poNo = mesPurchaseOrder.getPoNo(); String poNo = mesPurchaseOrder.getPoNo();
BigDecimal orderAmount = mesPurchaseOrder.getOrderAmount();
orderBind.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); orderBind.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
orderBind.setSaleOrderId(saleOrderId); orderBind.setSaleOrderId(saleOrderId);
orderBind.setSaleOrderCode(saleorderCode); orderBind.setSaleOrderCode(saleorderCode);
@ -278,14 +279,14 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
orderBind.setMaterialId(materialId); orderBind.setMaterialId(materialId);
orderBind.setMaterialCode(materialCode); orderBind.setMaterialCode(materialCode);
orderBind.setMaterialName(materialName); orderBind.setMaterialName(materialName);
orderBind.setBindAmount(purchaseOrder.getSaleBindAmount()); orderBind.setBindAmount(purchaseOrder.getUpdateAmount());
orderBind.setPoNo(poNo); orderBind.setPoNo(poNo);
orderBind.setCreateTime(currentDate); orderBind.setCreateTime(currentDate);
orderBind.setCreateBy(userName); orderBind.setCreateBy(userName);
mesOrderBindMapper.insertMesOrderBind(orderBind); mesOrderBindMapper.insertMesOrderBind(orderBind);
} else { } else {
MesOrderBind bind = bindList.get(0); MesOrderBind bind = bindList.get(0);
bind.setBindAmount(purchaseOrder.getSaleBindAmount()); bind.setBindAmount(purchaseOrder.getUpdateAmount());
bind.setUpdateBy(SecurityUtils.getUsername()); bind.setUpdateBy(SecurityUtils.getUsername());
bind.setUpdateTime(DateUtils.getNowDate()); bind.setUpdateTime(DateUtils.getNowDate());
mesOrderBindMapper.updateMesOrderBind(bind); mesOrderBindMapper.updateMesOrderBind(bind);
@ -294,6 +295,23 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
return 1; return 1;
} }
private void checkSaveSalesBindPurchase(List<MesPurchaseOrder> purchaseOrderList) {
for (MesPurchaseOrder purchaseOrder : purchaseOrderList) {
BigDecimal boundAmount = purchaseOrder.getBoundAmount();//已绑定总数
BigDecimal saleBindAmount = purchaseOrder.getSaleBindAmount();//销售订单已绑定数
BigDecimal updateAmount = purchaseOrder.getUpdateAmount();//更新绑定数量
BigDecimal orderAmount = purchaseOrder.getOrderAmount();//采购订单数量
BigDecimal safeAmount = purchaseOrder.getSafeAmount();//安全库存数
BigDecimal barcodeAmount = purchaseOrder.getBarcodeAmount();//条码数
BigDecimal totalBindAmount = boundAmount.subtract(saleBindAmount).add(updateAmount);
// (已绑定总数 - 销售订单已绑定数 + 更新绑定数量) 需要小于等于 采购订单数量
if (totalBindAmount.compareTo(orderAmount) > 0) {
throw new ServiceException("序号: " + purchaseOrder.getSerialNumber() + " 总绑定数大于订单数!");
}
}
}
/** /**
* *
* *

@ -256,12 +256,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from mes_purchase_order mpo from mes_purchase_order mpo
left join mes_base_material_info mbmi on mbmi.material_id = mpo.material_id left join mes_base_material_info mbmi on mbmi.material_id = mpo.material_id
<where> <where>
<if test="poNo != null and poNo != ''"> and mpo.po_no = #{poNo}</if> <if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mpo.material_code = #{materialCode}</if> <if test="materialCode != null and materialCode != ''"> and mpo.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mpo.material_name like concat('%', #{materialName}, '%')</if> <if test="materialName != null and materialName != ''"> and mpo.material_name like concat('%', #{materialName}, '%')</if>
<if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if> <if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where> </where>
order by sale_bind_amount desc order by mpo.po_no ,mpo.material_code
</select> </select>
<select id="saleBindPurchaseOrderList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult"> <select id="saleBindPurchaseOrderList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">

@ -529,7 +529,7 @@ export const dynamicRoutes = [
path: '/wms/product-outstock', path: '/wms/product-outstock',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['wms:productoutstock:info'], permissions: ['wms:productoutstock:audit:list'],
children: [ children: [
{ {
path: 'audit/:taskCode', path: 'audit/:taskCode',
@ -544,7 +544,7 @@ export const dynamicRoutes = [
path: '/wms/raw-outstock', path: '/wms/raw-outstock',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['wms:rawoutstock:audit'], permissions: ['wms:rawoutstock:audit:list'],
children: [ children: [
{ {
path: 'audit/:taskCode/:detailFlag/:warehouseName', path: 'audit/:taskCode/:detailFlag/:warehouseName',
@ -575,7 +575,7 @@ export const dynamicRoutes = [
path: '/wms/raw-return', path: '/wms/raw-return',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['wms:rawreturn:audit'], permissions: ['wms:rawreturn:audit:list'],
children: [ children: [
{ {
path: 'audit/:rawReturnId/:detailFlag/:warehouseName', path: 'audit/:rawReturnId/:detailFlag/:warehouseName',

@ -30,10 +30,77 @@
</el-form> </el-form>
<el-row> <el-row>
<el-col :span="12"> <!-- <el-col :span="12">-->
<h4 class="form-header h4">已选采购订单</h4> <!-- <h4 class="form-header h4">已选采购订单</h4>-->
<el-form :model="allocatePurchaseOrderQueryParams" ref="allocateMaterialQueryForm" size="small" :inline="true" <!-- <el-form :model="allocatePurchaseOrderQueryParams" ref="allocateMaterialQueryForm" size="small" :inline="true"-->
v-show="showSearch" <!-- v-show="showSearch"-->
<!-- label-width="68px">-->
<!-- <el-form-item label="订单编号" prop="poNo">-->
<!-- <el-input-->
<!-- v-model="allocatePurchaseOrderQueryParams.poNo"-->
<!-- placeholder="请输入物料编码"-->
<!-- style="width:140px;"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleAllocateMaterialQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料编码" prop="materialCode">-->
<!-- <el-input-->
<!-- v-model="allocatePurchaseOrderQueryParams.materialCode"-->
<!-- placeholder="请输入物料编码"-->
<!-- style="width:140px;"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleAllocateMaterialQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input-->
<!-- v-model="allocatePurchaseOrderQueryParams.materialName"-->
<!-- placeholder="请输入物料名称"-->
<!-- style="width:140px;"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleAllocateMaterialQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleAllocateMaterialQuery">-->
<!-- </el-button>-->
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetAllocateMaterialQuery"></el-button>-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- @click="handleUnallocateBarCodes"-->
<!-- v-hasPermi="['mes:saleOrder:bind']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <el-table v-loading="allocateLoading" :data="allocatePurchaseOrderList"-->
<!-- @selection-change="handleAllocateMaterialSelectionChange">-->
<!-- <el-table-column type="selection" width="55" align="center"/>-->
<!-- <el-table-column label="订单编号" align="center" prop="poNo"/>-->
<!-- <el-table-column label="物料编码" align="center" prop="materialCode"/>-->
<!-- <el-table-column label="物料名称" align="center" prop="materialName"/>-->
<!-- <el-table-column label="物料规格" align="center" prop="materialSpec"/>-->
<!-- <el-table-column label="规格参数" align="center" prop="specificationParameter" :show-overflow-tooltip="true"/>-->
<!-- <el-table-column label="数量" align="center" prop="orderAmount"/>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- v-show="allocatePurchaseOrderTotal>0"-->
<!-- :total="allocatePurchaseOrderTotal"-->
<!-- :page.sync="allocatePurchaseOrderQueryParams.pageNum"-->
<!-- :limit.sync="allocatePurchaseOrderQueryParams.pageSize"-->
<!-- @pagination="getAllocatePurchaseOrderList"-->
<!-- />-->
<!-- </el-col>-->
<!-- <el-col :span="12" >-->
<h4 class="form-header h4">可选采购订单</h4>
<el-form :model="purchaseOrderQueryParams" ref="materialQueryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px"> label-width="68px">
<el-form-item label="订单编号" prop="poNo"> <el-form-item label="订单编号" prop="poNo">
<el-input <el-input
@ -46,84 +113,35 @@
</el-form-item> </el-form-item>
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode">
<el-input <el-input
v-model="allocatePurchaseOrderQueryParams.materialCode" v-model="purchaseOrderQueryParams.materialCode"
placeholder="请输入物料编码" placeholder="请输入物料编码"
style="width:140px;" style="width:140px;"
clearable clearable
@keyup.enter.native="handleAllocateMaterialQuery" @keyup.enter.native="handlePurchaseOrderQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料名称" prop="materialName"> <el-form-item label="物料名称" prop="materialName">
<el-input <el-input
v-model="allocatePurchaseOrderQueryParams.materialName" v-model="purchaseOrderQueryParams.materialName"
placeholder="请输入物料名称" placeholder="请输入物料名称"
style="width:140px;" style="width:140px;"
clearable clearable
@keyup.enter.native="handleAllocateMaterialQuery" @keyup.enter.native="handlePurchaseOrderQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleAllocateMaterialQuery">
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetAllocateMaterialQuery"></el-button>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleUnallocateBarCodes"
v-hasPermi="['mes:productOrder:bind']"
>删除
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="allocateLoading" :data="allocatePurchaseOrderList"
@selection-change="handleAllocateMaterialSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="订单编号" align="center" prop="poNo"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="规格参数" align="center" prop="specificationParameter" :show-overflow-tooltip="true"/>
<el-table-column label="数量" align="center" prop="orderAmount"/>
</el-table>
<pagination
v-show="allocatePurchaseOrderTotal>0"
:total="allocatePurchaseOrderTotal"
:page.sync="allocatePurchaseOrderQueryParams.pageNum"
:limit.sync="allocatePurchaseOrderQueryParams.pageSize"
@pagination="getAllocatePurchaseOrderList"
/>
</el-col>
<el-col :span="12" >
<h4 class="form-header h4">可选采购订单</h4>
<el-form :model="purchaseOrderQueryParams" ref="materialQueryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="订单编号" prop="poNo">
<el-input
v-model="allocatePurchaseOrderQueryParams.poNo"
placeholder="请输入物料编码"
style="width:140px;"
clearable
@keyup.enter.native="handleAllocateMaterialQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料规格" prop="materialSpec">
<el-input <el-input
v-model="purchaseOrderQueryParams.materialCode" v-model="purchaseOrderQueryParams.materialSpec"
placeholder="请输入物料编码" placeholder="请输入物料规格"
style="width:140px;" style="width:140px;"
clearable clearable
@keyup.enter.native="handlePurchaseOrderQuery" @keyup.enter.native="handlePurchaseOrderQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料名称" prop="materialName"> <el-form-item label="规格参数" prop="specificationParameter">
<el-input <el-input
v-model="purchaseOrderQueryParams.materialName" v-model="purchaseOrderQueryParams.specificationParameter"
placeholder="请输入物料名称" placeholder="请输入规格参数"
style="width:140px;" style="width:140px;"
clearable clearable
@keyup.enter.native="handlePurchaseOrderQuery" @keyup.enter.native="handlePurchaseOrderQuery"
@ -137,24 +155,46 @@
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
:disabled="allocateBarCodeBtnDisable" :disabled="multiple"
@click="submitForm" @click="submitForm"
v-hasPermi="['mes:productOrder:bind']" v-hasPermi="['mes:saleOrder:bind']"
>保存 >保存
</el-button> </el-button>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleUnallocateBarCodes"
v-hasPermi="['mes:saleOrder:bind']"
>删除
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="selectableLoading" :data="purchaseOrderList" <el-table v-loading="selectableLoading"
@selection-change="handleMaterialSelectionChange"> :data="purchaseOrderList"
@selection-change="handleMaterialSelectionChange"
:row-class-name="rowSerialNumberProcess"
:row-style="getRowStyle">
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" prop="serialNumber"/>
<el-table-column label="订单编号" align="center" prop="poNo"/> <el-table-column label="订单编号" align="center" prop="poNo"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/> <el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/> <el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/> <el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="规格参数" align="center" prop="specificationParameter" :show-overflow-tooltip="true"/> <el-table-column label="规格参数" align="center" prop="specificationParameter" :show-overflow-tooltip="true"/>
<el-table-column label="数量" align="center" prop="orderAmount"/> <el-table-column label="订单数" align="center" prop="orderAmount"/>
<el-table-column label="已绑定数" align="center" prop="boundAmount"/>
<el-table-column label="销售订单绑定数" align="center" prop="saleBindAmount"/>
<el-table-column label="更新绑定数" align="center" prop="updateAmount" width="150">
<template slot-scope="scope">
<el-input-number v-model="scope.row.updateAmount" size="mini"/>
</template>
</el-table-column>
<el-table-column label="安全库存数" align="center" prop="safeAmount"/>
<el-table-column label="条码数" align="center" prop="barcodeAmount"/>
</el-table> </el-table>
<pagination <pagination
@ -164,7 +204,7 @@
:limit.sync="purchaseOrderQueryParams.pageSize" :limit.sync="purchaseOrderQueryParams.pageSize"
@pagination="getUnbindPurchaseOrderList" @pagination="getUnbindPurchaseOrderList"
/> />
</el-col> <!-- </el-col>-->
</el-row> </el-row>
</div> </div>
@ -192,6 +232,8 @@ export default {
barcodeInfos: [], barcodeInfos: [],
//ID //ID
purchaseOrderIds: [], purchaseOrderIds: [],
//
purchaseOrderSelectableList: [],
// //
allocateMaterialSingle: true, allocateMaterialSingle: true,
// //
@ -202,6 +244,8 @@ export default {
materialMultiple: true, materialMultiple: true,
// //
showSearch: true, showSearch: true,
single: true,
multiple: true,
// //
allocatePurchaseOrderTotal: 0, allocatePurchaseOrderTotal: 0,
// //
@ -231,6 +275,7 @@ export default {
saleOrderId: null, saleOrderId: null,
materialCode: null, materialCode: null,
materialName: null, materialName: null,
specificationParameter: null,
poNo: null poNo: null
}, },
}; };
@ -240,16 +285,14 @@ export default {
const saleOrderId = this.$route.params && this.$route.params.saleOrderId; const saleOrderId = this.$route.params && this.$route.params.saleOrderId;
let saleorderCode = this.$route.query && this.$route.query.saleorderCode; let saleorderCode = this.$route.query && this.$route.query.saleorderCode;
this.purchaseOrderQueryParams.saleOrderId = saleOrderId; this.purchaseOrderQueryParams.saleOrderId = saleOrderId;
// this.purchaseOrderQueryParams.saleorderCode = saleorderCode;
this.allocatePurchaseOrderQueryParams.saleOrderId = saleOrderId; this.allocatePurchaseOrderQueryParams.saleOrderId = saleOrderId;
// this.allocatePurchaseOrderQueryParams.saleorderCode = saleorderCode;
this.saleOrderForm.saleorderCode = saleorderCode; this.saleOrderForm.saleorderCode = saleorderCode;
this.saleOrderForm.saleOrderId = saleOrderId; this.saleOrderForm.saleOrderId = saleOrderId;
this.saleOrderForm.materialCode = this.$route.query && this.$route.query.materialCode; this.saleOrderForm.materialCode = this.$route.query && this.$route.query.materialCode;
this.saleOrderForm.materialName = this.$route.query && this.$route.query.materialName; this.saleOrderForm.materialName = this.$route.query && this.$route.query.materialName;
this.saleOrderForm.materialModel = this.$route.query && this.$route.query.materialModel; this.saleOrderForm.materialModel = this.$route.query && this.$route.query.materialModel;
this.getAllocatePurchaseOrderList(); // this.getAllocatePurchaseOrderList();
this.getUnbindPurchaseOrderList(); this.getUnbindPurchaseOrderList();
}, },
methods: { methods: {
@ -278,6 +321,9 @@ export default {
this.allocatePurchaseOrderQueryParams.pageNum = 1; this.allocatePurchaseOrderQueryParams.pageNum = 1;
this.getAllocatePurchaseOrderList(); this.getAllocatePurchaseOrderList();
}, },
getRowStyle({ row }) {
return row.saleBindAmount > 0 ? { backgroundColor: '#8ee38e' } : {};
},
/** 已选采购订单重置按钮操作 */ /** 已选采购订单重置按钮操作 */
resetAllocateMaterialQuery() { resetAllocateMaterialQuery() {
this.resetForm("allocateMaterialQueryForm"); this.resetForm("allocateMaterialQueryForm");
@ -286,8 +332,7 @@ export default {
/** 已选采购订单多选框选中数据 */ /** 已选采购订单多选框选中数据 */
handleAllocateMaterialSelectionChange(selection) { handleAllocateMaterialSelectionChange(selection) {
this.orderBindIds = selection.map(item => item.orderBindId) this.orderBindIds = selection.map(item => item.orderBindId)
this.allocatePoNos = selection.map(item => item.poNo) // this.single = selection.length !== 1
this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 可选采购订单搜索按钮操作 */ /** 可选采购订单搜索按钮操作 */
@ -303,20 +348,25 @@ export default {
// //
handleMaterialSelectionChange(selection) { handleMaterialSelectionChange(selection) {
this.purchaseOrderIds = selection.map(item => item.purchaseOrderId) this.purchaseOrderIds = selection.map(item => item.purchaseOrderId)
this.allocatePoNos = selection.map(item => item.poNo)
this.purchaseOrderSelectableList = selection.map(item => item)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
rowSerialNumberProcess({row, rowIndex}) {
row.serialNumber = rowIndex + 1;
},
handleUnallocateBarCodes() { handleUnallocateBarCodes() {
const orderBindIds = this.orderBindIds.join(","); const purchaseOrderIds = this.purchaseOrderIds.join(",");
const allocatePoNos = this.allocatePoNos; const allocatePoNos = this.allocatePoNos;
const params = { const params = {
orderBindIds: orderBindIds saleOrderId: this.saleOrderForm.saleOrderId,
purchaseOrderIds: purchaseOrderIds,
} }
this.$modal.confirm('是否确认删除采购订单编号为"' + allocatePoNos + '"的数据项?').then(function () { this.$modal.confirm('是否确认删除采购订单编号为"' + allocatePoNos + '"的数据项?').then(function () {
return removeSalesBindPurchase(params); return removeSalesBindPurchase(params);
}).then(() => { }).then(() => {
this.getAllocatePurchaseOrderList(); // this.getAllocatePurchaseOrderList();
this.getUnbindPurchaseOrderList(); this.getUnbindPurchaseOrderList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { }).catch(() => {
@ -325,19 +375,39 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.allocateBarCodeBtnDisable = true; this.allocateBarCodeBtnDisable = true;
const saleOrderId = this.saleOrderForm.saleOrderId; // const purchaseOrderIds = this.purchaseOrderIds.join(",");
const purchaseOrderIds = this.purchaseOrderIds.join(","); for (let obj of this.purchaseOrderSelectableList) {
saveSalesBindPurchase({ obj.saleOrderId = this.saleOrderForm.saleOrderId;
saleOrderId: saleOrderId, const orderAmount = obj.orderAmount;
purchaseOrderIds: purchaseOrderIds const boundAmount = obj.boundAmount;
}).then((response) => { const saleBindAmount = obj.saleBindAmount;
const safeAmount = obj.safeAmount;
const barcodeAmount = obj.barcodeAmount;
const updateAmount = obj.updateAmount;
if (updateAmount == null){
this.$modal.msgWarning("订单编号:" + obj.poNo + "请输入更新绑定数");
return;
}
// - +
// if ((boundAmount - saleBindAmount + updateAmount) > orderAmount){
// this.$modal.msgWarning(":" + obj.poNo + "");
// return;
// }
// if (updateAmount > barcodeAmount){
// this.$modal.msgWarning(":" + obj.poNo + "");
// return;
// }
// obj.saleBindAmount = updateAmount;
}
saveSalesBindPurchase(this.purchaseOrderSelectableList).then((response) => {
this.$modal.msgSuccess("保存成功"); this.$modal.msgSuccess("保存成功");
this.selectBarCodeAllocationWarehouse(); this.getUnbindPurchaseOrderList();
this.getAllocatePurchaseOrderList(); // this.getAllocatePurchaseOrderList();
this.allocateBarCodeBtnDisable = false; this.allocateBarCodeBtnDisable = false;
}).catch(() => { }).catch(() => {
this.getAllocatePurchaseOrderList(); // this.getAllocatePurchaseOrderList();
this.getUnbindPurchaseOrderList(); // this.getUnbindPurchaseOrderList();
this.allocateBarCodeBtnDisable = false; this.allocateBarCodeBtnDisable = false;
}); });
}, },

Loading…
Cancel
Save