Browse Source

省满意度添加了组织机构的选择

V1.0
duanliangtao 2 years ago
parent
commit
2012946255
  1. 62
      src/views/modules/satisfaction/satisfactionProvince/formList.vue

62
src/views/modules/satisfaction/satisfactionProvince/formList.vue

@ -1,6 +1,13 @@
<template>
<div style="margin-top:10px">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'">
<el-form-item prop="gridId" label="所属组织">
<div class="resi-cell-value">
<el-cascader class="customer_cascader" ref="myCascader" clearable v-model="agencyIdArray"
:options="orgOptions" :props="orgOptionProps" :show-all-levels="false"
@change="handleChangeAgency"></el-cascader>
</div>
</el-form-item>
<el-form-item label="不满意类目" prop="startTime" >
<el-select v-model="formData.scopeId" placeholder="请输入" size="small" class="u-item-width-normal" @change="getTableData" clearable>
<el-option v-for="item in dicts.satisfaction_category" :key="item.value" :label="item.label"
@ -61,6 +68,9 @@ export default {
formData: {
periodStart: '',
scopeId: '',
agencyId: "",
orgIdPath: "",
gridId: "",
},
pageNo: 0,
pageSize: 20,
@ -71,6 +81,15 @@ export default {
satisfaction_level: []
},
completeList,
orgOptions: [],
orgOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
agencyIdArray: [],
};
},
//
@ -80,6 +99,7 @@ export default {
this.formData.scopeId = this.satisfactionCategoryStr
this.formData.periodStart = this.periodStart
}
await this.loadAgency();
await this.getDicts()
await this.getTableData()
},
@ -110,6 +130,48 @@ export default {
}
},
//
async loadAgency() {
const { user } = this.$store.state
this.$http.post('/gov/org/customeragency/agencygridtree', {}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.orgOptions = []
this.orgOptions.push(res.data)
}
}).catch(() => {
return this.$message.error('网络错误')
})
},
handleChangeAgency(val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
if (obj) {
if (obj.level === 'grid') {
this.formData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.agencyId = ''
} else {
this.formData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.gridId = ''
}
this.formData.orgIdPath = this.agencyIdArray.toString();
} else {
this.formData.agencyId = ''
this.formData.gridId = ''
}
this.getTableData();
},
handleChangeGrid(val) {
this.formData.villageId = "";
this.formData.buildId = "";
this.formData.unitId = "";
this.formData.homeId = "";
this.getValiheList();
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageSize = val;

Loading…
Cancel
Save