|
|
@ -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, |
|
|
|