|
|
@ -71,7 +71,6 @@ |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
|
@submitForm="submitForm" |
|
|
|
@tableFormSelectOnBlur="tableFormSelectOnBlur" |
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
|
/> |
|
|
|
|
|
|
@ -90,7 +89,6 @@ |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
@detailBasicFormOnChange="qtyOnChange" |
|
|
|
:detailValidate="detailValidate" |
|
|
|
@onBlur="onBlur" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
@ -139,7 +137,11 @@ const tableColumns = ref([ |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
const defaultReasonCodeRequisition = ref(true) |
|
|
|
const setDefaultrReasonCodeRequisition = ()=>{ |
|
|
|
formRef.value.setDefaultBlurValue('reasonCodeRequisition','SC99') |
|
|
|
defaultReasonCodeRequisition.value = false |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
nextTick(() => { |
|
|
@ -201,6 +203,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
} |
|
|
|
if (formField == 'q2Number') { |
|
|
|
setV['noticeRemark'] = val[0]['desc'] |
|
|
|
if(val[0]['number']){ |
|
|
|
setV['reasonCodeRequisition'] = '' |
|
|
|
setV['projectCode'] = '' |
|
|
|
} |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q1Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = false |
|
|
@ -227,14 +233,43 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
setV['costcentreCode'] = val[0]['costcentreCode'] |
|
|
|
setV['costCenterType'] = val[0]['costcentreType'] |
|
|
|
} |
|
|
|
if(formField === 'reasonCodeRequisition'){ |
|
|
|
if(formField == 'reasonCodeRequisition'){ |
|
|
|
setV['reasonCodeRequisition'] = val[0]['code'] |
|
|
|
// 项目是否必填 |
|
|
|
if(ScrapRequestMainRules['projectCode']){ |
|
|
|
ScrapRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE' |
|
|
|
} |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'projectCode') { |
|
|
|
//项目代码 |
|
|
|
if(val[0]['isProject']=='TRUE'){ |
|
|
|
//是-可编辑,可选择 |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
}else{ |
|
|
|
//否-不可编辑,内容为空 |
|
|
|
setV['projectCode'] = '' |
|
|
|
item.componentProps.enterSearch = false |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
if(val[0]['code']){ |
|
|
|
setV['q2Number'] = '' |
|
|
|
} |
|
|
|
} |
|
|
|
if(formField === 'projectCode'){ |
|
|
|
setV['projectCode'] = val[0]['projectCode'] |
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
if(formField == 'costCenterCode'){ |
|
|
|
if(defaultReasonCodeRequisition.value){ |
|
|
|
setDefaultrReasonCodeRequisition() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
@ -578,6 +613,12 @@ const openForm = async (type: string, row?: any) => { |
|
|
|
|
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
if(type == 'create'){ |
|
|
|
nextTick(()=>{ |
|
|
|
defaultReasonCodeRequisition.value = true |
|
|
|
// formRef.value.setDefaultBlurValue('costCenterCode','DEFC') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
|