From 2c8fdfb476bb42a96ad9720c89b5352aa8790e5e Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Tue, 21 Nov 2023 10:11:10 +0800
Subject: [PATCH] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D=E8=81=94?=
=?UTF-8?q?=E5=BB=BA=E6=B4=BB=E5=8A=A8=E7=AD=9B=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../regionalParty/activitys.vue | 72 +++++++++++++------
.../communityParty/regionalParty/units.vue | 67 ++++++++++++-----
2 files changed, 102 insertions(+), 37 deletions(-)
diff --git a/src/views/modules/communityParty/regionalParty/activitys.vue b/src/views/modules/communityParty/regionalParty/activitys.vue
index bbd1009ae..75c2db368 100644
--- a/src/views/modules/communityParty/regionalParty/activitys.vue
+++ b/src/views/modules/communityParty/regionalParty/activitys.vue
@@ -23,22 +23,17 @@
-
-
-
-
-
-
-
-
+
+
+
{
+ 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 () {
this.loadTable()
},
diff --git a/src/views/modules/communityParty/regionalParty/units.vue b/src/views/modules/communityParty/regionalParty/units.vue
index a84106e31..852205cd4 100644
--- a/src/views/modules/communityParty/regionalParty/units.vue
+++ b/src/views/modules/communityParty/regionalParty/units.vue
@@ -18,21 +18,15 @@
-
-
-
-
+
@@ -413,7 +407,9 @@ export default {
unitId: "",
formData: {
unitName: "",
- serviceMatter: "",
+ // categoryCode:"",
+ // parentCategoryCode:"",
+ serviceMatter:'',
type: "",
contact: "",
contactMobile: "",
@@ -436,6 +432,7 @@ export default {
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG["apiURL"] + "/gov/org/neighborhood/import",
+ searchdemandOptions:[]
};
},
components: {
@@ -447,7 +444,7 @@ export default {
async created() {},
async mounted() {
//获取服务事项
- await this.loadService();
+ await this.getDemandOptions()
//获取分类
await this.loadType();
@@ -459,6 +456,42 @@ export default {
},
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() {
this.loadTable();
},