Browse Source

【党员中心户】完成

feature
wxz 2 years ago
parent
commit
c6c04def9d
  1. 358
      src/views/modules/communityParty/partyOrg/centerMember.vue
  2. 2
      src/views/modules/communityParty/partyOrg/orgTree.vue
  3. 10
      src/views/modules/communityParty/partyOrg/select_principal.vue

358
src/views/modules/communityParty/partyOrg/centerMember.vue

@ -25,24 +25,24 @@
<div v-else>{{ scope.row.partyMemberName }}</div> <div v-else>{{ scope.row.partyMemberName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="联系家庭" align="center" prop="partyMemberName"> <el-table-column label="联系家庭" align="center" prop="partyMemberName" :width="'500px'">
<template slot-scope="scope"> <template slot-scope="scope">
<!--v-model="scope.row.bindedHouses"--> <!--v-model="scope.row.bindedHouses"-->
<el-cascader :options="bindingHouseOptions" <el-cascader :options="bindingHouseOptions"
clearable clearable
ref="houseTreeRef" ref="houseTreeRef"
style="width: 300px" style="width: 400px"
placeholder="请选择" placeholder="请选择"
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@change="" @change=""
v-model="scope.row.allPathIdsOfPartyMember" v-model="scope.row.bindedHouses"
:props="bindingProps"> :props="bindingProps">
</el-cascader> </el-cascader>
<div v-else>{{ scope.row.bindedHousesStr }}</div> <div v-else>{{ scope.row.bindedHousesStr }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="联系家庭" align="center"> <el-table-column label="操作" align="center" :width="'200px'">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="handleSaveBtnClicked(scope.row)" v-if="scope.row.isEdit">保存</el-button> <el-button type="primary" @click="handleSaveBtnClicked(scope.row)" v-if="scope.row.isEdit">保存</el-button>
<el-button type="primary" @click="handleCancelBtnClicked(scope.row)" v-if="scope.row.isEdit">取消 <el-button type="primary" @click="handleCancelBtnClicked(scope.row)" v-if="scope.row.isEdit">取消
@ -74,7 +74,6 @@ export default {
bindingDatas: [], // bindingDatas: [], //
centerMemberSelectorOptions: [], // centerMemberSelectorOptions: [], //
bindingHouseOptions: [], // bindingHouseOptions: [], //
rowInEdit: null, //
bindingProps: { bindingProps: {
lazy: true, lazy: true,
lazyLoad: ((node, resolve) => { lazyLoad: ((node, resolve) => {
@ -141,9 +140,7 @@ export default {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async handleTreeNodeClick (node, resolve) { async handleTreeNodeClick (node, resolve) {
debugger console.log('发生了级联树的选中操作');
console.log('要编辑的数据:', this.rowInEdit)
if (node.root) { if (node.root) {
this.loadHousesTree4Select(this.partyOrgId) this.loadHousesTree4Select(this.partyOrgId)
} else { } else {
@ -173,6 +170,9 @@ export default {
} }
this.bindingHouseOptions = data this.bindingHouseOptions = data
}).parse(rst) }).parse(rst)
// let rootNodes = this.loadNextBindingHouseTreeLevel('root', null)
// this.this.bindingHouseOptions = rootNodes;
}, },
/** /**
@ -184,6 +184,27 @@ export default {
let param let param
let nextNodeType let nextNodeType
// if (currNodeType === 'root') {
// //
// let url = '/actual/base/party/org/centerMember/listQuarterOptionsByPartyOrgId'
//
// let rst = await requestGet(url, {
// partyOrgId: partyOrgId
// })
//
// let childrenNodes;
//
// this.epmetResultResolver.success((data) => {
// for (let e of data) {
// //
// e.nodeType = 'quarters'
// }
// childrenNodes = data;
// }).parse(rst)
//
// return childrenNodes;
// } else
if (currNodeType === 'quarters') { if (currNodeType === 'quarters') {
url = '/actual/base/communityBuilding/buildingoption' url = '/actual/base/communityBuilding/buildingoption'
nextNodeType = 'building' nextNodeType = 'building'
@ -206,8 +227,6 @@ export default {
return [] return []
} }
console.log('节点数据:', currNodeType, nodeValue)
let rst = await requestPost(url, param) let rst = await requestPost(url, param)
let childrenNodes let childrenNodes
@ -247,8 +266,7 @@ export default {
*/ */
handleSaveBtnClicked (row) { handleSaveBtnClicked (row) {
let bindedHouseIds = row.bindedHouses.map(h => h[h.length - 1]) let bindedHouseIds = row.bindedHouses.map(h => h[h.length - 1])
this.saveCenterMemberbindingHome(row.persisted, row.partyMemberId, bindedHouseIds)
this.saveCenterMemberbindingHome(row.partyMemberId, bindedHouseIds)
}, },
/** /**
@ -258,7 +276,7 @@ export default {
console.log(row) console.log(row)
if (row.isNew) { if (row.isNew) {
// //
this.bindingDatas.pop() this.bindingDatas.splice(row.$index, 1);
} else { } else {
// //
row.isEdit = false row.isEdit = false
@ -284,76 +302,273 @@ export default {
*/ */
async handleEditBtnClicked (row) { async handleEditBtnClicked (row) {
this.bindingHouseOptions = [ // this.bindingHouseOptions = [
{ // {
label: 'a', // "label": "",
value: 'a', // "code": null,
children: [ // "value": "1526844339424051202",
{ // "sysDictDataId": null,
label: 'aa', // "children": [
value: 'aa', // {
children: [ // "label": "1",
{ // "code": null,
label: 'aaa', // "value": "1526844417257750530",
value: 'aaa', // "sysDictDataId": null,
leaf: true // "children": [
}, // {
{ // "label": "1",
label: 'aab', // "code": "1",
value: 'aab', // "value": "1526844417278722049",
leaf: true // "sysDictDataId": null,
} // "children": [
] // {
}, // "customerId": "45687aa479955f9d06204d415238f7cc",
{ // "houseId": "1526842714899566593",
label: 'ab', // "doorName": "101",
value: 'ab', // "buildingId": "1526844417257750530",
} // "houseName": "1-1-101",
] // "rentFlag": "",
} // "neighborHoodId": "1526844339424051202",
] // "purposeKey": "1",
// "unitNumKey": "1526844417278722049",
row.allPathIdsOfPartyMember = [ // "agencyName": "",
['a', 'aa', 'aaa'], // "agencyId": "d167076e825e75edda6540c5b9717c79",
['a', 'aa', 'aab'] // "gridName": "",
] // "gridId": "1489db92900a34838b371137087b36fd",
// "neighborHoodName": "",
// "buildingName": "1",
// "unitNum": "1",
// "houseType": "",
// "houseTypeKey": "1",
// "purpose": "",
// "rentFlagKey": 0,
// "ownerName": "",
// "ownerPhone": "157****9697",
// "ownerIdCard": "3713251993******29",
// "remark": "",
// "sort": 0,
// "houseCode": "3702030150000000200001",
// "nodeType": "house",
// "label": "1-1-101",
// "value": "1526842714899566593",
// "leaf": true
// },
// {
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "houseId": "1630738452589871106",
// "doorName": "102",
// "buildingId": "1526844417257750530",
// "houseName": "1-1-102",
// "rentFlag": "",
// "neighborHoodId": "1526844339424051202",
// "purposeKey": "1",
// "unitNumKey": "1526844417278722049",
// "agencyName": "",
// "agencyId": "d167076e825e75edda6540c5b9717c79",
// "gridName": "",
// "gridId": "1489db92900a34838b371137087b36fd",
// "neighborHoodName": "",
// "buildingName": "1",
// "unitNum": "1",
// "houseType": "",
// "houseTypeKey": "1",
// "purpose": "",
// "rentFlagKey": 0,
// "ownerName": "",
// "ownerPhone": "",
// "ownerIdCard": "",
// "remark": "",
// "sort": 0,
// "houseCode": null,
// "nodeType": "house",
// "label": "1-1-102",
// "value": "1630738452589871106",
// "leaf": true
// },
// {
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "houseId": "1630745405168844801",
// "doorName": "103",
// "buildingId": "1526844417257750530",
// "houseName": "1-1-103",
// "rentFlag": "",
// "neighborHoodId": "1526844339424051202",
// "purposeKey": "1",
// "unitNumKey": "1526844417278722049",
// "agencyName": "",
// "agencyId": "d167076e825e75edda6540c5b9717c79",
// "gridName": "",
// "gridId": "1489db92900a34838b371137087b36fd",
// "neighborHoodName": "",
// "buildingName": "1",
// "unitNum": "1",
// "houseType": "",
// "houseTypeKey": "1",
// "purpose": "",
// "rentFlagKey": 0,
// "ownerName": "",
// "ownerPhone": "",
// "ownerIdCard": "",
// "remark": "",
// "sort": 0,
// "houseCode": null,
// "nodeType": "house",
// "label": "1-1-103",
// "value": "1630745405168844801",
// "leaf": true
// },
// {
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "houseId": "1630506964648755202",
// "doorName": "104",
// "buildingId": "1526844417257750530",
// "houseName": "1-1-104",
// "rentFlag": "",
// "neighborHoodId": "1526844339424051202",
// "purposeKey": "1",
// "unitNumKey": "1526844417278722049",
// "agencyName": "",
// "agencyId": "d167076e825e75edda6540c5b9717c79",
// "gridName": "",
// "gridId": "1489db92900a34838b371137087b36fd",
// "neighborHoodName": "",
// "buildingName": "1",
// "unitNum": "1",
// "houseType": "",
// "houseTypeKey": "1",
// "purpose": "",
// "rentFlagKey": 0,
// "ownerName": "",
// "ownerPhone": "",
// "ownerIdCard": "",
// "remark": "",
// "sort": 0,
// "houseCode": null,
// "nodeType": "house",
// "label": "1-1-104",
// "value": "1630506964648755202",
// "leaf": true
// }
// ],
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "unit"
// }
// ],
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "building"
// },
// {
// "label": "2",
// "code": null,
// "value": "1632674811918290945",
// "sysDictDataId": null,
// "children": null,
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "building"
// }
// ],
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "quarters"
// },
// {
// "label": "",
// "code": null,
// "value": "1541252207317544962",
// "sysDictDataId": null,
// "children": null,
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "quarters"
// },
// {
// "label": "",
// "code": null,
// "value": "1630822418384191489",
// "sysDictDataId": null,
// "children": null,
// "usableFlag": null,
// "type": null,
// "pid": null,
// "pvalue": null,
// "nodeType": "quarters"
// }
// ]
// await this.loadHousesTree4Select(this.partyOrgId) // await this.loadHousesTree4Select(this.partyOrgId)
await this.loadCenterMember4Selector(this.partyOrgId, 'edit')// await this.loadCenterMember4Selector(this.partyOrgId, 'edit')//
row.isEdit = true row.isEdit = true
this.rowInEdit = row //
await this.loadHousesTree4Select(this.partyOrgId);
//
let allPathIdsOfPartyMember = [] let allPathIdsOfPartyMember = []
debugger
for (let house of row.bindedHouses) { for (let house of row.bindedHouses) {
console.log(house) console.log(house)
allPathIdsOfPartyMember.push(house.pathIds) allPathIdsOfPartyMember.push(house.pathIds)
// this.rescureLoadTree(pathIds, 0);
//
await this.rescureLoadTree(house.pathIds, 0, this.bindingHouseOptions);
} }
// row.allPathIdsOfPartyMember = allPathIdsOfPartyMember; row.bindedHouses = allPathIdsOfPartyMember;
}, },
/** /**
* 递归加载 * 递归加载
*/ */
// rescureLoadTree(pathIds, currDepth) { async rescureLoadTree(pathIds, currDepth, treeArr2Fill) {
// let objectId = pathIds[currDepth]; if (currDepth === 4) {
// let currNodeType; //
// if (currDepth === 0) { return;
// currNodeType = 'quarters'; }
// } else if (currDepth === 1) {
// currNodeType = 'building'; let objectId = pathIds[currDepth];
// } else if (currDepth === 2) { let currNodeType;
// currNodeType = 'unit'; if (currDepth === 0) {
// } else if (currDepth === 3) { currNodeType = 'quarters';
// currNodeType = 'house'; } else if (currDepth === 1) {
// } currNodeType = 'building';
// } else if (currDepth === 2) {
// let childrenNodes = this.loadNextBindingHouseTreeLevel(currNodeType, objectId); currNodeType = 'unit';
// } else if (currDepth === 3) {
// }, currNodeType = 'house';
}
let childrenNodes = await this.loadNextBindingHouseTreeLevel(currNodeType, objectId);
if (!childrenNodes || childrenNodes.length === 0) {
//
return;
}
for (let node of treeArr2Fill) {
if (node.value === objectId) {
node.children = childrenNodes;
break;
}
}
await this.rescureLoadTree(pathIds, ++currDepth, childrenNodes);
// for (let child of childrenNodes) {
// this.rescureLoadTree(pathIds, ++currDepth, childrenNodes);
// }
},
/** /**
* 打扫战场 * 打扫战场
@ -400,6 +615,7 @@ export default {
row.bindedHousesStr = houseNames.join(',') row.bindedHousesStr = houseNames.join(',')
row.isEdit = false row.isEdit = false
row.isNew = false row.isNew = false
row.persisted = true //
} }
this.bindingDatas = data this.bindingDatas = data
@ -411,8 +627,14 @@ export default {
* @param partyMemberId * @param partyMemberId
* @param bindedHouseIds * @param bindedHouseIds
*/ */
async saveCenterMemberbindingHome (partyMemberId, bindedHouseIds) { async saveCenterMemberbindingHome (persisted, partyMemberId, bindedHouseIds) {
let url = '/actual/base/party/member/centerMember/createCenterMemberBindingHome' let url
if (!persisted) {
url = '/actual/base/party/member/centerMember/createCenterMemberBindingHome'
} else {
url = '/actual/base/party/member/centerMember/updateCenterMemberBindingHome'
}
let rst = await requestPost(url, { let rst = await requestPost(url, {
partyMemberId: partyMemberId, partyMemberId: partyMemberId,
partyOrgId: this.partyOrgId, partyOrgId: this.partyOrgId,

2
src/views/modules/communityParty/partyOrg/orgTree.vue

@ -24,7 +24,6 @@
<!--负责人对话框--> <!--负责人对话框-->
<SelectPrincipal ref="SelectPrincipal" <SelectPrincipal ref="SelectPrincipal"
:visible.sync="selectPrincipalDlgShow"
@refreshTree="handleLoadTreeRoot" @refreshTree="handleLoadTreeRoot"
v-if="selectPrincipalDlgShow"> v-if="selectPrincipalDlgShow">
</SelectPrincipal> </SelectPrincipal>
@ -166,7 +165,6 @@ export default {
handlePrincipalBtnClick(row) { handlePrincipalBtnClick(row) {
this.selectPrincipalDlgShow = true; this.selectPrincipalDlgShow = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['SelectPrincipal'].visible = true;
this.$refs['SelectPrincipal'].init(row.id, row.principalId, row.partyOrgLevel, row.orgId, row.principalPositionName); this.$refs['SelectPrincipal'].init(row.id, row.principalId, row.partyOrgLevel, row.orgId, row.principalPositionName);
}); });
}, },

10
src/views/modules/communityParty/partyOrg/select_principal.vue

@ -71,6 +71,8 @@ export default {
// //
async init (partyOrgId, pringipalId, partyOrgLevel, orgId, principalPositionName) { async init (partyOrgId, pringipalId, partyOrgLevel, orgId, principalPositionName) {
this.visible = true;
this.dataForm.partyOrgId = partyOrgId;
await this.loadPrincipals(orgId, partyOrgLevel) await this.loadPrincipals(orgId, partyOrgLevel)
@ -79,11 +81,10 @@ export default {
// //
this.principals.forEach(e => { this.principals.forEach(e => {
if (e.principalId === pringipalId) { if (e.principalId === pringipalId) {
this.dataForm.partyOrgId = partyOrgId;
this.dataForm.principalId = pringipalId; this.dataForm.principalId = pringipalId;
this.dataForm.principalMobile = e.principalMobile; this.dataForm.principalMobile = e.principalMobile;
console.log(this.dataForm); console.log('初始化form表单', this.dataForm);
} }
}); });
}) })
@ -99,10 +100,7 @@ export default {
* 提交 * 提交
*/ */
handleSubmit() { handleSubmit() {
debugger
this.$refs.dataForm.validate((success) => { this.$refs.dataForm.validate((success) => {
debugger
console.log(this.dataForm.principalId);
if (success) { if (success) {
this.submitChangePrincipal(); this.submitChangePrincipal();
} }
@ -121,6 +119,8 @@ export default {
this.dataForm.principalMobile = p.principalMobile; this.dataForm.principalMobile = p.principalMobile;
} }
} }
console.log('变更负责人之后的form表单:', this.dataForm);
}, },
/** /**

Loading…
Cancel
Save