|
@@ -243,18 +243,19 @@
|
|
|
v-if="items.choice == 1 ? true : flase"
|
|
|
>
|
|
|
<el-cascader
|
|
|
+ :ref="`getCheckeds`+indexs"
|
|
|
:props="{emitPath:false}"
|
|
|
:options="options"
|
|
|
class="width100"
|
|
|
placeholder="请选择区域"
|
|
|
- @change="shareScopeChange1"
|
|
|
+ @change="shareScopeChange1(indexs)"
|
|
|
v-model="items.region"
|
|
|
clearable
|
|
|
></el-cascader>
|
|
|
</div>
|
|
|
<div
|
|
|
style="width: 50%;float: left;"
|
|
|
- v-if="items.choice == 2 ? true : flase"
|
|
|
+ v-if="items.choice == 2 ? true : flase && this.isAdd"
|
|
|
>
|
|
|
<el-cascader
|
|
|
:ref="`getChecked`+indexs"
|
|
@@ -282,12 +283,14 @@
|
|
|
v-model="houseInformation[indexs].billingRules"
|
|
|
clearable
|
|
|
class="width100"
|
|
|
+ @click.native="houseCommunityRules(indexs)"
|
|
|
>
|
|
|
+
|
|
|
<el-option
|
|
|
- v-for="(item, index) in billing"
|
|
|
+ v-for="(item, index) in houseInformation[indexs].billing"
|
|
|
:key="index"
|
|
|
:label="item.name"
|
|
|
- :value="item.id"
|
|
|
+ :value="item.value"
|
|
|
>{{item.name}}</el-option>
|
|
|
</el-select>
|
|
|
|
|
@@ -410,9 +413,15 @@ export default {
|
|
|
choice: 1,
|
|
|
billingArea: '',
|
|
|
billingRules: '',
|
|
|
- region: []
|
|
|
+ region: [],
|
|
|
+ billing: []//计费规则
|
|
|
},
|
|
|
],
|
|
|
+ // houseCommunity: [
|
|
|
+ // {
|
|
|
+ // billing: []
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
options: [{
|
|
|
value: 'zhinan',
|
|
|
label: '指南',
|
|
@@ -621,21 +630,25 @@ export default {
|
|
|
optionTree: [],
|
|
|
shareScope: [],
|
|
|
shareScopeID: [],
|
|
|
+ communityIdTree: [],
|
|
|
+ communityId: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
shareScopeChange (index) {
|
|
|
- debugger
|
|
|
+
|
|
|
var data = this.$refs[`getChecked${index}`][0].getCheckedNodes();
|
|
|
|
|
|
- console.log(data)
|
|
|
+
|
|
|
this.shareScope = [];
|
|
|
+ this.communityIdTree = [];
|
|
|
for (let a = 0; a < data.length; a++) {
|
|
|
if (data[a].children.length != 0) {
|
|
|
if (data[0].path[0] == data[data.length - 1].path[0]) {
|
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
this.shareScope.push(data[i].path[1]);
|
|
|
+ this.communityIdTree.push(data[i].path[0]);
|
|
|
}
|
|
|
|
|
|
// this.houseInformation[index].region = [];
|
|
@@ -659,12 +672,14 @@ export default {
|
|
|
this.houseInformation[index].region = [];
|
|
|
var houseInformation = [];
|
|
|
this.shareScope = [];
|
|
|
- debugger
|
|
|
+ this.communityIdTree = [];
|
|
|
+
|
|
|
for (let k = 0; k < data.length; k++) {
|
|
|
if (data[k].path[0] == data[data.length - 1].path[0]) {
|
|
|
if (data[k].path[3] != undefined) {
|
|
|
houseInformation.push(data[k].path)
|
|
|
this.shareScope.push(data[k].path[1])
|
|
|
+ this.communityIdTree.push(data[k].path[0]);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -680,20 +695,24 @@ export default {
|
|
|
})
|
|
|
|
|
|
|
|
|
- console.log('不同个单元', this.houseInformation[index].region)
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
this.shareScope = [];
|
|
|
+ this.communityIdTree = [];
|
|
|
if (data[0].path[0] == data[data.length - 1].path[0]) {
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
this.shareScope.push(data[i].path[1])
|
|
|
+ this.communityIdTree.push(data[i].path[0]);
|
|
|
}
|
|
|
} else {
|
|
|
this.shareScope = [];
|
|
|
+ this.communityIdTree = [];
|
|
|
for (let k = 0; k < data.length; k++) {
|
|
|
this.shareScope.push(data[k].path[1])
|
|
|
+ this.communityIdTree.push(data[k].path[0]);
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
// this.$forceUpdate();
|
|
@@ -751,18 +770,53 @@ export default {
|
|
|
|
|
|
}
|
|
|
this.shareScope = Array.from(new Set(this.shareScope))
|
|
|
+ this.communityIdTree = Array.from(new Set(this.communityIdTree))
|
|
|
this.shareScopeID[index] = this.shareScope;
|
|
|
- console.log('shareScope', this.shareScope);
|
|
|
- console.log('7777', this.shareScopeID)
|
|
|
-
|
|
|
- // this.$forceUpdate();
|
|
|
+ this.communityId[index] = this.communityIdTree
|
|
|
|
|
|
|
|
|
// 判断点击是否为单元
|
|
|
|
|
|
|
|
|
},
|
|
|
- shareScopeChange1 (e) {
|
|
|
+ houseCommunityRules (index) {
|
|
|
+ this.communityRules(index);
|
|
|
+ },
|
|
|
+ // 获取对应社区的规则
|
|
|
+ communityRules (index) {
|
|
|
+ this.$http.get('/czc-charge/scChargeStrategy/list', { communityId: this.communityId[index][0] }).then(({ status, data, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ data.map((item, indexs) => {
|
|
|
+ this.houseInformation[index].billing.push({
|
|
|
+ name: item.chargeName,
|
|
|
+ value: item.id
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 回填规则
|
|
|
+ RescommunityRules (index, communityId) {
|
|
|
+ this.$http.get('/czc-charge/scChargeStrategy/list', { communityId: communityId }).then(({ status, data, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ data.map((item, indexs) => {
|
|
|
+ this.houseInformation[index].billing.push({
|
|
|
+ name: item.chargeName,
|
|
|
+ value: item.id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log('this.houseInformation[index]', this.houseInformation[index])
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ shareScopeChange1 (index) {
|
|
|
+
|
|
|
+ var data = this.$refs[`getCheckeds${index}`][0].getCheckedNodes();
|
|
|
+ var id = data[0].path[0];
|
|
|
+ this.RescommunityRules(index, id);
|
|
|
+
|
|
|
},
|
|
|
closes () {
|
|
|
this.$emit('clerOwnerStatus');
|
|
@@ -770,9 +824,6 @@ export default {
|
|
|
addEdit () {
|
|
|
this.$refs['ruleForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log('formData', this.formData)
|
|
|
- console.log('effectiveDate', this.effectiveDate);
|
|
|
- console.log('houseInformation', this.houseInformation[0].region.length)
|
|
|
var url = '/czc-community/landlord/add';
|
|
|
var params = {
|
|
|
name: this.formData.name,
|
|
@@ -793,6 +844,30 @@ export default {
|
|
|
nativePlace: this.formData.nativePlace,
|
|
|
buildingList: []
|
|
|
};
|
|
|
+ if (!this.isAdd) {
|
|
|
+ var url = '/czc-community/landlord/update'
|
|
|
+ var params = {
|
|
|
+ id: this.params,
|
|
|
+ name: this.formData.name,
|
|
|
+ phone: this.formData.phone,
|
|
|
+ personnelNumber: this.formData.personnelNumber,
|
|
|
+ sex: this.formData.sex,
|
|
|
+ remarks: this.formData.remark,
|
|
|
+ facePictureUrl: this.formData.facePictureUrl,
|
|
|
+ idType: this.formData.idType,
|
|
|
+ idNumber: this.formData.idNumber,
|
|
|
+ permanentAddress: this.formData.permanentAddress,
|
|
|
+ issuingAuthority: this.formData.issuingAuthority,
|
|
|
+ effectiveDateStart: this.effectiveDate[0],
|
|
|
+ effectiveDateEnd: this.effectiveDate[1],
|
|
|
+ nationality: this.formData.nationality,
|
|
|
+ nation: this.formData.nation,
|
|
|
+ birthDate: this.formData.birthDate,
|
|
|
+ nativePlace: this.formData.nativePlace,
|
|
|
+ buildingList: []
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
for (let i = 0; i < this.houseInformation.length; i++) {
|
|
|
if (this.houseInformation[i].choice == 1) {
|
|
|
params.buildingList.push({
|
|
@@ -803,17 +878,16 @@ export default {
|
|
|
houseList: []
|
|
|
})
|
|
|
} else if (this.houseInformation[i].choice == 2) {
|
|
|
- debugger
|
|
|
+ console.log('777', this.shareScopeID[i][0] || this.shareScopeID[i][1])
|
|
|
params.buildingList.push({
|
|
|
type: this.houseInformation[i].choice,
|
|
|
- buildingId: this.shareScopeID[i],
|
|
|
+ buildingId: this.shareScopeID[i][0] || this.shareScopeID[i][1],
|
|
|
strategyId: this.houseInformation[i].billingRules,
|
|
|
area: this.houseInformation[i].billingArea,
|
|
|
houseList: []
|
|
|
})
|
|
|
for (let j = 0; j < this.houseInformation[i].region.length; j++) {
|
|
|
- debugger
|
|
|
- console.log(this.houseInformation[i].region[j][2])
|
|
|
+
|
|
|
params.buildingList[i].houseList.push({
|
|
|
houseId: this.houseInformation[i].region[j][3] || this.houseInformation[i].region[j][2]
|
|
|
})
|
|
@@ -831,7 +905,7 @@ export default {
|
|
|
}
|
|
|
}).catch(() => { });
|
|
|
} else {
|
|
|
- console.log('111', this.$valid)
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
@@ -842,13 +916,19 @@ export default {
|
|
|
choice: 1,
|
|
|
billingArea: '',
|
|
|
billingRules: '',
|
|
|
- region: ''
|
|
|
+ region: [],
|
|
|
+ billing: []
|
|
|
})
|
|
|
},
|
|
|
closeshouseInformation (id) {
|
|
|
+
|
|
|
if (this.houseInformation.length > 1) {
|
|
|
this.houseInformation.splice(id, 1);
|
|
|
}
|
|
|
+
|
|
|
+ if (this.shareScopeID.length > 1 && this.shareScopeID[id] != undefined) {
|
|
|
+ this.shareScopeID.splice(id, 1);
|
|
|
+ }
|
|
|
},
|
|
|
getOrgTreeList () {
|
|
|
this.$http
|
|
@@ -857,7 +937,7 @@ export default {
|
|
|
if (status === 0 && data) {
|
|
|
this.optionTree = data;
|
|
|
this.scopeList = data;
|
|
|
- console.log('44', this.houseInformation)
|
|
|
+
|
|
|
this.TreeList();
|
|
|
}
|
|
|
});
|
|
@@ -878,10 +958,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (!this.isAdd) {
|
|
|
- console.log('id', this.params)
|
|
|
+
|
|
|
this.getDetails();
|
|
|
}
|
|
|
- console.log('55555', this.options);
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
@@ -890,7 +970,7 @@ export default {
|
|
|
this.$http.get(url).then(({ data, status, msg }) => {
|
|
|
if (status == 0) {
|
|
|
this.effectiveDate = [];
|
|
|
- console.log('data', data);
|
|
|
+
|
|
|
this.formData.name = data.name;
|
|
|
this.formData.phone = data.phone;
|
|
|
this.formData.personnelNumber = data.personnelNumber;
|
|
@@ -907,25 +987,51 @@ export default {
|
|
|
this.formData.birthDate = data.birthDate;
|
|
|
this.formData.nativePlace = data.nativePlace
|
|
|
|
|
|
- this.houseInformation = [];
|
|
|
+
|
|
|
+ let newHouse = [];
|
|
|
for (let i = 0; i < data.buildingList.length; i++) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (data.buildingList[i].type == 1) {
|
|
|
- this.houseInformation.push({
|
|
|
+
|
|
|
+ newHouse.push({
|
|
|
choice: data.buildingList[i].type,
|
|
|
region: data.buildingList[i].buildingId + '',
|
|
|
billingRules: data.buildingList[i].strategyId,
|
|
|
billingArea: data.buildingList[i].area,
|
|
|
+ billing: [],
|
|
|
})
|
|
|
+ this.RescommunityRules(i, data.buildingList[i].communityId);
|
|
|
+
|
|
|
} else if (data.buildingList[i].type == 2) {
|
|
|
- this.houseInformation.push({
|
|
|
+ this.shareScopeID[i] = [data.buildingList[i].buildingId + ''];
|
|
|
+ var communityId = data.buildingList[i].communityId + '';
|
|
|
+ var buildingId = data.buildingList[i].buildingId + '';
|
|
|
+
|
|
|
+ var resDateRegion = []
|
|
|
+ var houseId = [];
|
|
|
+ var unitName = [];
|
|
|
+ for (let k = 0; k < data.buildingList[i].houseList.length; k++) {
|
|
|
+ houseId.push(data.buildingList[i].houseList[k].houseId);
|
|
|
+ unitName.push(data.buildingList[i].houseList[k].unitName)
|
|
|
+ if (unitName.length != 0) {
|
|
|
+ resDateRegion[k] = [communityId, buildingId, unitName[k], houseId[k]];
|
|
|
+ } else {
|
|
|
+ resDateRegion[k] = [communityId, buildingId, houseId[k]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newHouse.push({
|
|
|
choice: data.buildingList[i].type,
|
|
|
- region: data.buildingList[i].houseIds,
|
|
|
+ region: resDateRegion,
|
|
|
billingRules: data.buildingList[i].strategyId,
|
|
|
billingArea: data.buildingList[i].area,
|
|
|
+ billing: [],
|
|
|
})
|
|
|
}
|
|
|
+ this.RescommunityRules(i, data.buildingList[i].communityId);
|
|
|
}
|
|
|
-
|
|
|
+ this.houseInformation = newHouse;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -933,7 +1039,7 @@ export default {
|
|
|
created () {
|
|
|
this.getOrgTreeList();
|
|
|
if (!this.isAdd) {
|
|
|
- console.log('id', this.params)
|
|
|
+ // this.params 用户的id
|
|
|
this.getDetails();
|
|
|
}
|
|
|
|