Browse Source

采购计划修改为只做离散单的校验

master
zhaoxuebing 10 months ago
parent
commit
e602b48957
  1. 5
      src/api/wms/purchaseDetail/index.ts
  2. 24
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

5
src/api/wms/purchaseDetail/index.ts

@ -43,6 +43,11 @@ export const getPurchaseDetailPage = async (params) => {
}
}
// 校验子表数据
export const getPurchaseDetailPageCheckData = async (params) => {
return await request.get({ url: `/wms/purchase-detail/pageCheckData`, params })
}
// 查询采购订单子列表
export const getPurchaseDetailPagePoNumber = async (params) => {
if (params.isSearch) {

24
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -388,14 +388,16 @@
const submitForm = async (formType, data) => {
data.subList = []
for (let item of tableData.value) {
await PurchaseDetailApi.getPurchaseDetailPage({
await PurchaseDetailApi.getPurchaseDetailPageCheckData({
number: item.poNumber,
lineNumber: item.poLine,
}).then(res => {
console.log("【要货计划】-每条数据结果",item)
if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
return
if(res.list[0].type == 'DISCRETE'){//
if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
return
}
}
data.subList.push(item) //
})
@ -422,14 +424,18 @@
// /
const detailValidate = async (data) => {
let tag = false
await PurchaseDetailApi.getPurchaseDetailPage({
await PurchaseDetailApi.getPurchaseDetailPageCheckData({
number: data.poNumber,
lineNumber: data.poLine
}).then(res => {
if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
tag = false
} else {
if(res.list[0].type == 'DISCRETE'){//
if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
tag = false
} else {
tag = true
}
}else{
tag = true
}
}).catch(err =>{

Loading…
Cancel
Save