|
|
@ -131,13 +131,20 @@ const clearSearchInput = (formField) => { |
|
|
|
if (formField == 'itemCode') { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
itemName: '', |
|
|
|
SupplierCode: '', |
|
|
|
SupplierName: '' |
|
|
|
supplierCode: '', |
|
|
|
supplierName: '', |
|
|
|
purchaseReceiptNumber: '' |
|
|
|
}) |
|
|
|
Q2.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.options = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (formField == 'lightItemCode') { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: '', |
|
|
|
lightItemName: '', |
|
|
|
lightQty: 0, |
|
|
|
claimAmount: '', |
|
|
|
otherClaimAmount: 0, |
|
|
@ -147,7 +154,9 @@ const clearSearchInput = (formField) => { |
|
|
|
}) |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode }], |
|
|
|
filters: [ |
|
|
|
{ column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode } |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
@ -212,22 +221,22 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
setV['summaryAmount'] = 0 |
|
|
|
setV['disbursementAmount'] = 0 |
|
|
|
setV['remainingAmount'] = 0 |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].code }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].code }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
@ -245,9 +254,10 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
} |
|
|
|
|
|
|
|
if (formField == 'itemCode') { |
|
|
|
setV['SupplierCode'] = '' |
|
|
|
setV['SupplierName'] = '' |
|
|
|
setV['supplierCode'] = '' |
|
|
|
setV['supplierName'] = '' |
|
|
|
setV['itemName'] = '' |
|
|
|
setV['purchaseReceiptNumber'] = '' |
|
|
|
setV['uom'] = val[0].supplierUom |
|
|
|
|
|
|
|
Q2Api.getEmail().then((res) => { |
|
|
@ -293,8 +303,9 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (val[0].lightItemCode == null) { |
|
|
|
if (basicFormRef.value.formRef.formModel.lightItemCode == null|| |
|
|
|
basicFormRef.value.formRef.formModel.lightItemCode == '' |
|
|
|
) { |
|
|
|
setV['standardCostPrice'] = '' |
|
|
|
setV['lightQty'] = 0 |
|
|
|
setV['claimAmount'] = '' |
|
|
|