|
@ -72,7 +72,6 @@ |
|
|
<el-cascader v-model.trim="form[itemj.id].partyOrgId" :props="casProps" |
|
|
<el-cascader v-model.trim="form[itemj.id].partyOrgId" :props="casProps" |
|
|
:options="itemk.opction" class="list_item_width_1" clearable size="small" |
|
|
:options="itemk.opction" class="list_item_width_1" clearable size="small" |
|
|
@change="handlePartyOrgCascadarChange" ></el-cascader> |
|
|
@change="handlePartyOrgCascadarChange" ></el-cascader> |
|
|
<!-- {{form[itemj.id].partyOrgId}} --> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<template v-else-if="itemk.itemType == 'number'"> |
|
|
<template v-else-if="itemk.itemType == 'number'"> |
|
@ -277,42 +276,50 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
showForm() { |
|
|
async showForm() { |
|
|
this.$nextTick(() => { |
|
|
await this.$nextTick(); |
|
|
console.log(this.form, '拓展组件form'); |
|
|
console.log(this.form, '拓展组件form'); |
|
|
console.log(this.formList, '拓展组件formList'); |
|
|
console.log(this.formList, '拓展组件formList'); |
|
|
const promises = this.formList.forEach((item) => { |
|
|
const promises = this.formList.map(async (item) => { |
|
|
item.form.map(async (group) => { |
|
|
const groupPromises = item.form.map(async (group) => { |
|
|
return group.children.reduce(async (accPromise, item) => { |
|
|
await group.children.reduce(async (accPromise, childItem) => { |
|
|
const acc = await accPromise; |
|
|
const acc = await accPromise; |
|
|
acc[item.formName] = null; |
|
|
acc[childItem.formName] = null; |
|
|
this.form[item.pformName].id = item.id |
|
|
this.form[childItem.pformName].id = childItem.id; |
|
|
if (item.itemType == 'checkbox') { |
|
|
|
|
|
this.form[item.pformName][item.formName] = item.value || [] |
|
|
if (childItem.itemType === 'checkbox') { |
|
|
} else if (item.itemType == 'cascader1' && item.orgPath) { |
|
|
this.form[childItem.pformName][childItem.formName] = childItem.value || []; |
|
|
await this.getOrgTree() |
|
|
} else if (childItem.itemType === 'cascader1' && childItem.orgPath) { |
|
|
this.form[item.pformName][item.formName] = item.orgPath.split(':') || null |
|
|
await this.getOrgTree(); |
|
|
|
|
|
let maxId = this.formList.filter(item => item.formId == 'parymemberInfoDto')[0].form[0].children.filter(item => item.formName == 'partyOrgId')[0].opction[0].id; |
|
|
|
|
|
let orgId = JSON.parse(JSON.stringify(childItem.orgPath.split(':'))); |
|
|
|
|
|
orgId = orgId.slice(orgId.findIndex(item => item === maxId), orgId.length - 1) |
|
|
|
|
|
this.form[childItem.pformName][childItem.formName] = orgId; |
|
|
} else { |
|
|
} else { |
|
|
this.form[item.pformName][item.formName] = item.value != null?item.value:null; |
|
|
this.form[childItem.pformName][childItem.formName] = childItem.value != null ? childItem.value : null; |
|
|
} |
|
|
} |
|
|
if (item.opctionUrl) { |
|
|
|
|
|
|
|
|
if (childItem.opctionUrl) { |
|
|
try { |
|
|
try { |
|
|
item.opction = await this.getDictDataForm(item.opctionUrl, item.opctionParams); |
|
|
childItem.opction = await this.getDictDataForm(childItem.opctionUrl, childItem.opctionParams); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('Error fetching options:', error); |
|
|
console.error('Error fetching options:', error); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return acc; |
|
|
return acc; |
|
|
}, Promise.resolve({})); |
|
|
}, Promise.resolve({})); |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
Promise.all(promises).then((results) => { |
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => { |
|
|
|
|
|
console.error('Error fetching options:', error); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}) |
|
|
return Promise.all(groupPromises); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
await Promise.all(promises); |
|
|
|
|
|
console.log('Form processing complete'); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('Error processing form:', error); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getDictDataForm(url, params) { |
|
|
async getDictDataForm(url, params) { |
|
|
try { |
|
|
try { |
|
|
const { data } = await this.$http.post(url, params); |
|
|
const { data } = await this.$http.post(url, params); |
|
|