diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index 89d43ca3b..fe4f9e7da 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/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 - } - }) + if (formField == 'poLine') { + 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 - } - }) }) } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts index 32e7bbd2e..fb5aae880 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts @@ -314,6 +314,15 @@ export const PurchasePlanDetail = useCrudSchemas(reactive([ searchTitle: '采购订单信息', searchAllSchemas: PurchaseDetail.allSchemas, searchPage: PurchaseDetailApi.getPurchaseDetailPage, + searchCondition: [{ + key: 'number', + value: 'poNumber', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] } }, tableForm: { @@ -323,10 +332,14 @@ export const PurchasePlanDetail = useCrudSchemas(reactive([ searchTitle: '采购订单信息', searchAllSchemas: PurchaseDetail.allSchemas, searchPage: PurchaseDetailApi.getPurchaseDetailPage, - searchCondition: [ { + searchCondition: [{ key: 'number', value: 'poNumber', isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false }] } },