diff --git a/src/views/modules/communityParty/partyOrg/centerMember.vue b/src/views/modules/communityParty/partyOrg/centerMember.vue
index 48786fddf..72d1dc603 100644
--- a/src/views/modules/communityParty/partyOrg/centerMember.vue
+++ b/src/views/modules/communityParty/partyOrg/centerMember.vue
@@ -25,24 +25,24 @@
{{ scope.row.partyMemberName }}
-
+
{{ scope.row.bindedHousesStr }}
-
+
保存
取消
@@ -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}
*/
async handleTreeNodeClick (node, resolve) {
- debugger
- console.log('要编辑的数据:', this.rowInEdit)
-
+ console.log('发生了级联树的选中操作');
if (node.root) {
this.loadHousesTree4Select(this.partyOrgId)
} else {
@@ -173,17 +170,41 @@ export default {
}
this.bindingHouseOptions = data
}).parse(rst)
+
+ // let rootNodes = this.loadNextBindingHouseTreeLevel('root', null)
+ // this.this.bindingHouseOptions = rootNodes;
},
/**
* 加载关联家庭列表
*/
async loadNextBindingHouseTreeLevel (currNodeType, nodeValue) {
-
+
let url
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,
diff --git a/src/views/modules/communityParty/partyOrg/orgTree.vue b/src/views/modules/communityParty/partyOrg/orgTree.vue
index 9df78253d..d3c307c7c 100644
--- a/src/views/modules/communityParty/partyOrg/orgTree.vue
+++ b/src/views/modules/communityParty/partyOrg/orgTree.vue
@@ -24,7 +24,6 @@
@@ -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);
});
},
diff --git a/src/views/modules/communityParty/partyOrg/select_principal.vue b/src/views/modules/communityParty/partyOrg/select_principal.vue
index 6696e83b5..f4ed6d98d 100644
--- a/src/views/modules/communityParty/partyOrg/select_principal.vue
+++ b/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);
},
/**