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>
</template>
</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">
<!--v-model="scope.row.bindedHouses"-->
<el-cascader :options="bindingHouseOptions"
clearable
ref="houseTreeRef"
style="width: 300px"
style="width: 400px"
placeholder="请选择"
v-if="scope.row.isEdit"
@change=""
v-model="scope.row.allPathIdsOfPartyMember"
v-model="scope.row.bindedHouses"
:props="bindingProps">
</el-cascader>
<div v-else>{{ scope.row.bindedHousesStr }}</div>
</template>
</el-table-column>
<el-table-column label="联系家庭" align="center">
<el-table-column label="操作" align="center" :width="'200px'">
<template slot-scope="scope">
<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">取消
@ -74,7 +74,6 @@ export default {
bindingDatas: [], //
centerMemberSelectorOptions: [], //
bindingHouseOptions: [], //
rowInEdit: null, //
bindingProps: {
lazy: true,
lazyLoad: ((node, resolve) => {
@ -141,9 +140,7 @@ export default {
* @returns {Promise<void>}
*/
async handleTreeNodeClick (node, resolve) {
debugger
console.log('要编辑的数据:', this.rowInEdit)
console.log('发生了级联树的选中操作');
if (node.root) {
this.loadHousesTree4Select(this.partyOrgId)
} else {
@ -173,6 +170,9 @@ export default {
}
this.bindingHouseOptions = data
}).parse(rst)
// let rootNodes = this.loadNextBindingHouseTreeLevel('root', null)
// this.this.bindingHouseOptions = rootNodes;
},
/**
@ -184,6 +184,27 @@ export default {
let param
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') {
url = '/actual/base/communityBuilding/buildingoption'
nextNodeType = 'building'
@ -206,8 +227,6 @@ export default {
return []
}
console.log('节点数据:', currNodeType, nodeValue)
let rst = await requestPost(url, param)
let childrenNodes
@ -247,8 +266,7 @@ export default {
*/
handleSaveBtnClicked (row) {
let bindedHouseIds = row.bindedHouses.map(h => h[h.length - 1])
this.saveCenterMemberbindingHome(row.partyMemberId, bindedHouseIds)
this.saveCenterMemberbindingHome(row.persisted, row.partyMemberId, bindedHouseIds)
},
/**
@ -258,7 +276,7 @@ export default {
console.log(row)
if (row.isNew) {
//
this.bindingDatas.pop()
this.bindingDatas.splice(row.$index, 1);
} else {
//
row.isEdit = false
@ -284,76 +302,273 @@ export default {
*/
async handleEditBtnClicked (row) {
this.bindingHouseOptions = [
{
label: 'a',
value: 'a',
children: [
{
label: 'aa',
value: 'aa',
children: [
{
label: 'aaa',
value: 'aaa',
leaf: true
},
{
label: 'aab',
value: 'aab',
leaf: true
}
]
},
{
label: 'ab',
value: 'ab',
}
]
}
]
row.allPathIdsOfPartyMember = [
['a', 'aa', 'aaa'],
['a', 'aa', 'aab']
]
// this.bindingHouseOptions = [
// {
// "label": "",
// "code": null,
// "value": "1526844339424051202",
// "sysDictDataId": null,
// "children": [
// {
// "label": "1",
// "code": null,
// "value": "1526844417257750530",
// "sysDictDataId": null,
// "children": [
// {
// "label": "1",
// "code": "1",
// "value": "1526844417278722049",
// "sysDictDataId": null,
// "children": [
// {
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "houseId": "1526842714899566593",
// "doorName": "101",
// "buildingId": "1526844417257750530",
// "houseName": "1-1-101",
// "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": "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.loadCenterMember4Selector(this.partyOrgId, 'edit')//
row.isEdit = true
this.rowInEdit = row
//
await this.loadHousesTree4Select(this.partyOrgId);
//
let allPathIdsOfPartyMember = []
debugger
for (let house of row.bindedHouses) {
console.log(house)
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) {
// let objectId = pathIds[currDepth];
// let currNodeType;
// if (currDepth === 0) {
// currNodeType = 'quarters';
// } else if (currDepth === 1) {
// currNodeType = 'building';
// } else if (currDepth === 2) {
// currNodeType = 'unit';
// } else if (currDepth === 3) {
// currNodeType = 'house';
// }
//
// let childrenNodes = this.loadNextBindingHouseTreeLevel(currNodeType, objectId);
//
// },
async rescureLoadTree(pathIds, currDepth, treeArr2Fill) {
if (currDepth === 4) {
//
return;
}
let objectId = pathIds[currDepth];
let currNodeType;
if (currDepth === 0) {
currNodeType = 'quarters';
} else if (currDepth === 1) {
currNodeType = 'building';
} else if (currDepth === 2) {
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.isEdit = false
row.isNew = false
row.persisted = true //
}
this.bindingDatas = data
@ -411,8 +627,14 @@ export default {
* @param partyMemberId
* @param bindedHouseIds
*/
async saveCenterMemberbindingHome (partyMemberId, bindedHouseIds) {
let url = '/actual/base/party/member/centerMember/createCenterMemberBindingHome'
async saveCenterMemberbindingHome (persisted, partyMemberId, bindedHouseIds) {
let url
if (!persisted) {
url = '/actual/base/party/member/centerMember/createCenterMemberBindingHome'
} else {
url = '/actual/base/party/member/centerMember/updateCenterMemberBindingHome'
}
let rst = await requestPost(url, {
partyMemberId: partyMemberId,
partyOrgId: this.partyOrgId,

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

@ -24,7 +24,6 @@
<!--负责人对话框-->
<SelectPrincipal ref="SelectPrincipal"
:visible.sync="selectPrincipalDlgShow"
@refreshTree="handleLoadTreeRoot"
v-if="selectPrincipalDlgShow">
</SelectPrincipal>
@ -166,7 +165,6 @@ export default {
handlePrincipalBtnClick(row) {
this.selectPrincipalDlgShow = true;
this.$nextTick(() => {
this.$refs['SelectPrincipal'].visible = true;
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) {
this.visible = true;
this.dataForm.partyOrgId = partyOrgId;
await this.loadPrincipals(orgId, partyOrgLevel)
@ -79,11 +81,10 @@ export default {
//
this.principals.forEach(e => {
if (e.principalId === pringipalId) {
this.dataForm.partyOrgId = partyOrgId;
this.dataForm.principalId = pringipalId;
this.dataForm.principalMobile = e.principalMobile;
console.log(this.dataForm);
console.log('初始化form表单', this.dataForm);
}
});
})
@ -99,10 +100,7 @@ export default {
* 提交
*/
handleSubmit() {
debugger
this.$refs.dataForm.validate((success) => {
debugger
console.log(this.dataForm.principalId);
if (success) {
this.submitChangePrincipal();
}
@ -121,6 +119,8 @@ export default {
this.dataForm.principalMobile = p.principalMobile;
}
}
console.log('变更负责人之后的form表单:', this.dataForm);
},
/**

Loading…
Cancel
Save