Browse Source

要货计划 代码优化

master
陈薪名 11 months ago
parent
commit
f289cd8a25
  1. 67
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  2. 13
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

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

@ -81,23 +81,39 @@
row['itemCode'] = val[0]['code']
row['poNumber'] = val[0]['number']
row['poLine'] = val[0]['lineNumber']
await PurchaseDetailApi.getPurchaseDetailPage({
number: row['poNumber'],
available: 'TRUE',
// poLine: row['lineNumber'],
}).then(res => {
if (formField == 'poLine') {
row['itemCode'] = res.list[0].itemCode
row['uom'] = res.list[0].uom
row['orderQty'] = res.list[0].orderQty
row['planQty'] = res.list[0].orderQty-res.list[0].plannedQty
row['available'] = res.list[0].available
}
})
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['orderQty'] = val[0]['orderQty']
row['planQty'] = val[0]['orderQty']-val[0]['plannedQty']
row['available'] = val[0]['available']
}
// await PurchaseDetailApi.getPurchaseDetailPage({
// number: row['poNumber'],
// available: 'TRUE',
// // poLine: row['lineNumber'],
// }).then(res => {
// if (formField == 'poLine') {
// row['itemCode'] = res.list[0].itemCode
// row['uom'] = res.list[0].uom
// row['orderQty'] = res.list[0].orderQty
// row['planQty'] = res.list[0].orderQty-res.list[0].plannedQty
// row['available'] = res.list[0].available
// }
// })
} else {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemCode'] = val[0]['code']
setV['poNumber'] = val[0]['number']
setV['poLine'] = val[0]['lineNumber']
if (formField == 'poLine') {
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['orderQty'] = val[0]['orderQty']
setV['planQty'] = val[0]['orderQty']-val[0]['plannedQty']
setV['available'] = val[0]['available']
}
formRef.setValues(setV)
}
})
@ -109,16 +125,23 @@
setV[formField] = val[0][searchField]
setV['poNumber'] = val[0]['number']
setV['poLine'] = val[0]['lineNumber']
if (formField == 'poLine') {
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['orderQty'] = val[0]['orderQty']
setV['planQty'] = val[0]['orderQty']-val[0]['plannedQty']
setV['available'] = val[0]['available']
}
// await PurchaseDetailApi.getPurchaseDetailPage({
// number: setV['poNumber'],
// lineNumber: setV['poLine'],
// }).then(res => {
// if (res.list.length == 1) {
// //
// setV['itemCode'] = res.list[0].itemCode
// }
// })
formRef.setValues(setV)
await PurchaseDetailApi.getPurchaseDetailPage({
number: setV['poNumber'],
lineNumber: setV['poLine'],
}).then(res => {
if (res.list.length == 1) {
//
setV['itemCode'] = res.list[0].itemCode
}
})
})
}

13
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -314,6 +314,15 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseDetail.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [{
key: 'number',
value: 'poNumber',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm: {
@ -327,6 +336,10 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
key: 'number',
value: 'poNumber',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},

Loading…
Cancel
Save