fix
This commit is contained in:
@@ -208,6 +208,12 @@ const loadContractOptions = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const onContractSelectVisibleChange = (visible: boolean) => {
|
||||
if (visible && form.hasContract === '1' && contractOptions.value.length === 0) {
|
||||
loadContractOptions()
|
||||
}
|
||||
}
|
||||
|
||||
const searchPurchaser = async (query: string) => {
|
||||
if (!query) {
|
||||
purchaserOptions.value = []
|
||||
@@ -240,9 +246,29 @@ const searchAssetAdmin = async (query: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const onContractSelectVisibleChange = (visible: boolean) => {
|
||||
if (visible && form.hasContract === '1' && contractOptions.value.length === 0) {
|
||||
loadContractOptions()
|
||||
const onPurchaserChange = (teacherNo: string) => {
|
||||
if (!teacherNo) {
|
||||
form.purchaserId = ''
|
||||
form.purchaserName = ''
|
||||
return
|
||||
}
|
||||
const selected = purchaserOptions.value.find((item: any) => item.teacherNo === teacherNo)
|
||||
if (selected) {
|
||||
form.purchaserId = selected.teacherNo
|
||||
form.purchaserName = selected.realName || selected.name
|
||||
}
|
||||
}
|
||||
|
||||
const onAssetAdminChange = (teacherNo: string) => {
|
||||
if (!teacherNo) {
|
||||
form.assetAdminId = ''
|
||||
form.assetAdminName = ''
|
||||
return
|
||||
}
|
||||
const selected = assetAdminOptions.value.find((item: any) => item.teacherNo === teacherNo)
|
||||
if (selected) {
|
||||
form.assetAdminId = selected.teacherNo
|
||||
form.assetAdminName = selected.realName || selected.name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,32 +322,6 @@ onMounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const onPurchaserChange = (teacherNo: string) => {
|
||||
if (!teacherNo) {
|
||||
form.purchaserId = ''
|
||||
form.purchaserName = ''
|
||||
return
|
||||
}
|
||||
const selected = purchaserOptions.value.find((item: any) => item.teacherNo === teacherNo)
|
||||
if (selected) {
|
||||
form.purchaserId = selected.teacherNo
|
||||
form.purchaserName = selected.realName || selected.name
|
||||
}
|
||||
}
|
||||
|
||||
const onAssetAdminChange = (teacherNo: string) => {
|
||||
if (!teacherNo) {
|
||||
form.assetAdminId = ''
|
||||
form.assetAdminName = ''
|
||||
return
|
||||
}
|
||||
const selected = assetAdminOptions.value.find((item: any) => item.teacherNo === teacherNo)
|
||||
if (selected) {
|
||||
form.assetAdminId = selected.teacherNo
|
||||
form.assetAdminName = selected.realName || selected.name
|
||||
}
|
||||
}
|
||||
|
||||
const rules: FormRules = {
|
||||
isInstallment: [{ required: true, message: '请选择是否分期验收', trigger: 'change' }],
|
||||
totalPhases: [{ required: true, message: '请输入分期次数', trigger: 'blur' }],
|
||||
|
||||
@@ -177,7 +177,13 @@ const loadData = async () => {
|
||||
|
||||
if (config?.common) {
|
||||
applyInfo.value = config.common
|
||||
// 仅当存在已保存批次时,才用接口数据回填公共信息;否则保持 open() 中的默认清空值
|
||||
// 采购人员和资产管理员始终回填
|
||||
commonForm.value.purchaserId = config.common.purchaserId || ''
|
||||
commonForm.value.purchaserName = config.common.purchaserName || ''
|
||||
commonForm.value.assetAdminId = config.common.assetAdminId || ''
|
||||
commonForm.value.assetAdminName = config.common.assetAdminName || ''
|
||||
|
||||
// 其他字段仅当存在已保存批次时回填
|
||||
if (config?.batches?.length) {
|
||||
Object.assign(commonForm.value, {
|
||||
hasContract: config.common.hasContract || '0',
|
||||
|
||||
Reference in New Issue
Block a user