jiangyuying 2 years ago
parent
commit
637d8acbc6
  1. 92
      src/views/components/resiForm.vue

92
src/views/components/resiForm.vue

@ -373,13 +373,14 @@
</el-date-picker> </el-date-picker>
</template> </template>
<template v-else-if="itemk.itemType == 'cascader1'"> <template v-else-if="itemk.itemType == 'cascader1'">
<el-cascader :props="{ emitPath: false }" <el-cascader v-model="form.parymemberInfoDto.partyOrgId"
:options="itemk.opction" :props="casProps"
class="u-item-width-normal" :options="itemk.opction"
clearable class="u-item-width-normal"
size="small" clearable
:label="itemk.opction.label" size="small"
:value="itemk.opction.value"></el-cascader> @change="handlePartyOrgCascadarChange"
></el-cascader>
</template> </template>
<template v-else-if="itemk.itemType == 'number'"> <template v-else-if="itemk.itemType == 'number'">
<el-input-number class="u-item-width-normal" <el-input-number class="u-item-width-normal"
@ -403,7 +404,7 @@
import { isCard, isPassport, isMobile, isPhone } from '@/utils/validate' import { isCard, isPassport, isMobile, isPhone } from '@/utils/validate'
import { computedCard } from '@/utils/index' import { computedCard } from '@/utils/index'
import { idTypeList } from "@/js/columns/constants"; import { idTypeList } from "@/js/columns/constants";
import {requestGet} from "@/js/dai/request";
export default { export default {
name: 'resiForm', name: 'resiForm',
props: { props: {
@ -424,6 +425,16 @@ export default {
optionsH: [], optionsH: [],
optionsD: [], optionsD: [],
optionsG: [], optionsG: [],
casProps:{
value: 'id',
label: 'partyOrgName',
lazy:true,
lazyLoad: (node, resolve) => {
this.handleNextOrgTreeClick(node, resolve)
},
checkStrictly: true,
multiple: false
},
activeName: 'groupeduInfoDto', activeName: 'groupeduInfoDto',
validateFlag: null, validateFlag: null,
disabilityCategoryCode: [], disabilityCategoryCode: [],
@ -1658,6 +1669,9 @@ export default {
await this.getHouseList() await this.getHouseList()
await this.residentEduInfo(this.form.resiId) await this.residentEduInfo(this.form.resiId)
}, },
handlePartyOrgCascadarChange(selectedNode) {
this.form.parymemberInfoDto.partyOrgId = selectedNode[selectedNode.length - 1];
},
async getAllDict () { async getAllDict () {
try { try {
await Promise.all([ await Promise.all([
@ -1682,7 +1696,8 @@ export default {
this.gethobbyDict(), this.gethobbyDict(),
this.getWelfareDict(), this.getWelfareDict(),
this.getUnemployment(), this.getUnemployment(),
this.getCareer() this.getCareer(),
this.getListPartyOrgTreeRoot4Select()
]); ]);
} catch (error) { } catch (error) {
console.error("Error fetching dictionaries: ", error); console.error("Error fetching dictionaries: ", error);
@ -1703,11 +1718,25 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
// handelminzu (val) { async handleNextOrgTreeClick (node,resolve) {
// this.newForm.nation = val console.log(node,resolve);
// }, await this.getTreeChildenList(node,resolve)
},
async getTreeChildenList (node, resolve) {
console.log(node,resolve);
const url = "/actual/base/party/org/listNextLevelPartyOrgTreeNodesByPid"
console.log('级联', node.value)
let params = {
partyOrgPid: node.data.id
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
resolve(data)
} else {
this.$message.error(msg)
}
},
// //
async getGuojiDictList () { async getGuojiDictList () {
await this.getDictDataBasic('nationality', 'nationality') await this.getDictDataBasic('nationality', 'nationality')
@ -2100,7 +2129,37 @@ export default {
} }
}, },
//
async getOrgTree(){
try {
const { data } = await requestGet('/actual/base/party/org/listPartyOrgTreeRoot4Select',{ depth: 8 })
this.footerInputList.forEach(c => {
for (let i of c.children) {
if (i.formName == 'partyOrgId') {
i.opction = [data];
}
}
})
} catch (error) {
console.log(error);
}
},
async getListPartyOrgTreeRoot4Select(){
try {
const { data } = await this.$http.get('actual/base/party/org/listPartyOrgTreeRoot4Select')
console.log(data,'data懒加载');
this.footerInputList.forEach(c => {
for (let i of c.children) {
if (i.formName == 'partyOrgId') {
i.opction = [data.data];
console.log(i.opction,'option懒加载');
}
}
})
} catch (error) {
}
},
// //
async getRelationship () { async getRelationship () {
try { try {
@ -2446,9 +2505,12 @@ export default {
}) })
}, },
// //
residentPartyMemberInfo (id) { async residentPartyMemberInfo (id) {
if (this.newForm.parymemberInfoDto) return if (this.newForm.parymemberInfoDto) return
this.$http.get(`/actual/base/residentPartyMemberInfo/detail/${id}`).then(({ data: res }) => { if(this.formId == 'resiForm'){
await this.getOrgTree()
}
await this.$http.get(`/actual/base/residentPartyMemberInfo/detail/${id}`).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);
} else { } else {

Loading…
Cancel
Save