|
|
@ -56,6 +56,7 @@ |
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
|
@submitForm="submitForm" |
|
|
|
@onChange="onChangeQty" |
|
|
|
@onEnter="onEnter" |
|
|
@ -120,6 +121,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const clearSearchInput = (formField)=>{ |
|
|
|
tableData.value = [] |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
nextTick(async() => { |
|
|
@ -140,6 +144,15 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc |
|
|
|
message.warning(`物料代码${repeatCode.join(',')}已经存在`); |
|
|
|
} |
|
|
|
if(val.length>0){ |
|
|
|
//frm表单回显 |
|
|
|
const setV = {} |
|
|
|
tableData.value = [] // 清空子表数据 |
|
|
|
setV['contactName']=val[0]['contacts'] |
|
|
|
setV['contactPhone']=val[0]['phone'] |
|
|
|
setV['contactEmail']=val[0]['email'] |
|
|
|
setV['taxRate']=val[0]['taxRate'] |
|
|
|
formRef.setValues(setV) |
|
|
|
//明细 |
|
|
|
val.forEach(item=>{ |
|
|
|
const newRow = {...row} |
|
|
|
newRow[formField] = item[searchField] |
|
|
@ -169,8 +182,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc |
|
|
|
setV['contactPhone']=val[0]['phone'] |
|
|
|
setV['contactEmail']=val[0]['email'] |
|
|
|
setV['taxRate']=val[0]['taxRate'] |
|
|
|
formRef.setValues(setV) |
|
|
|
onEnter('supplierCode') |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -516,7 +530,12 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc |
|
|
|
} |
|
|
|
|
|
|
|
const onEnter = (field)=>{ |
|
|
|
formRef.value.handleAddTable() |
|
|
|
const timer = setTimeout(()=>{ |
|
|
|
formRef.value.handleAddTable() |
|
|
|
if(timer){ |
|
|
|
clearTimeout(timer) |
|
|
|
} |
|
|
|
},500) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|