Browse Source

联建单位联建活动筛选

feature
mk 2 years ago
parent
commit
2c8fdfb476
  1. 72
      src/views/modules/communityParty/regionalParty/activitys.vue
  2. 67
      src/views/modules/communityParty/regionalParty/units.vue

72
src/views/modules/communityParty/regionalParty/activitys.vue

@ -23,22 +23,17 @@
</el-form-item> </el-form-item>
<el-form-item label="服务事项" <el-form-item label="服务事项" prop="serviceMatter">
prop="serviceMatter"> <el-cascader
<el-select class="item_width_2" v-model="formData.serviceMatter"
v-model="formData.serviceMatter" class="u-item-width-daterange2"
size="small" size="small"
placeholder="请选择" :options="searchdemandOptions"
clearable> :props="{ checkStrictly: true,label: 'categoryName',value: 'categoryCode',children: 'childCateList'}"
<el-option v-for="item in serviceList" clearable
:key="item.value" @change="handleCateCHange"
:label="item.label" ></el-cascader>
:value="item.value"> </el-form-item>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属网格" <el-form-item label="所属网格"
prop="gridId"> prop="gridId">
<el-select class="item_width_1" <el-select class="item_width_1"
@ -302,7 +297,7 @@ export default {
formData: { formData: {
unitId: '', unitId: '',
title: '', title: '',
serviceMatter: '', serviceMatter:"",
startTime: '', startTime: '',
endTime: '', endTime: '',
gridId: '' gridId: ''
@ -318,8 +313,8 @@ export default {
files: "", files: "",
fileName: "", fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import' uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import',
searchdemandOptions:[]
} }
}, },
components: { components: {
@ -330,7 +325,7 @@ export default {
}, },
async mounted () { async mounted () {
// //
await this.loadService() await this.getDemandOptions()
const { user } = this.$store.state const { user } = this.$store.state
this.agencyId = user.agencyId this.agencyId = user.agencyId
@ -340,9 +335,46 @@ export default {
this.loadGrid() this.loadGrid()
// //
this.loadTable() this.loadTable()
}, },
methods: { methods: {
handleCateCHange(val) {
if (val.length === 1) {
this.formData.serviceMatter = val[1];
} else {
this.formData.serviceMatter = val[0];
}
},
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.searchdemandOptions = this.getTreeData(res.data);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.childCateList) {
if (item.childCateList.length === 0)
_item = { ...item, childCateList: undefined };
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
handleSearch () { handleSearch () {
this.loadTable() this.loadTable()
}, },

67
src/views/modules/communityParty/regionalParty/units.vue

@ -18,21 +18,15 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="服务事项" prop="serviceMatter"> <el-form-item label="服务事项" prop="serviceMatter">
<el-select <el-cascader
class="u-item-width-normal" v-model="formData.serviceMatter"
v-model="formData.serviceMatter" class="u-item-width-daterange2"
placeholder="请选择" size="small"
size="small" :options="searchdemandOptions"
clearable :props="{ checkStrictly: true,label: 'categoryName',value: 'categoryCode',children: 'childCateList'}"
> clearable
<el-option @change="handleCateCHange"
v-for="item in serviceList" ></el-cascader>
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="分类" prop="type"> <el-form-item label="分类" prop="type">
@ -413,7 +407,9 @@ export default {
unitId: "", unitId: "",
formData: { formData: {
unitName: "", unitName: "",
serviceMatter: "", // categoryCode:"",
// parentCategoryCode:"",
serviceMatter:'',
type: "", type: "",
contact: "", contact: "",
contactMobile: "", contactMobile: "",
@ -436,6 +432,7 @@ export default {
files: "", files: "",
fileName: "", fileName: "",
uploadUlr: window.SITE_CONFIG["apiURL"] + "/gov/org/neighborhood/import", uploadUlr: window.SITE_CONFIG["apiURL"] + "/gov/org/neighborhood/import",
searchdemandOptions:[]
}; };
}, },
components: { components: {
@ -447,7 +444,7 @@ export default {
async created() {}, async created() {},
async mounted() { async mounted() {
// //
await this.loadService(); await this.getDemandOptions()
// //
await this.loadType(); await this.loadType();
@ -459,6 +456,42 @@ export default {
}, },
methods: { methods: {
handleCateCHange(val) {
if (val.length === 1) {
this.formData.serviceMatter = val[1];
} else {
this.formData.serviceMatter = val[0];
}
},
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.searchdemandOptions = this.getTreeData(res.data);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.childCateList) {
if (item.childCateList.length === 0)
_item = { ...item, childCateList: undefined };
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
handleSearch() { handleSearch() {
this.loadTable(); this.loadTable();
}, },

Loading…
Cancel
Save