From a5dbe915e9cdcbb687c84ffe2d76827e784bf198 Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Mon, 20 Nov 2023 19:17:13 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=96=B9=E8=BF=87=E6=BB=A4,b?=
=?UTF-8?q?ugs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../regionalParty/activitysForm.vue | 3 +-
.../regionalParty/unitsForm.vue | 3 +-
.../communityService/fuwuzhaoren/addForm.vue | 2 +-
.../gangweizhaoren/addForm.vue | 2 +-
.../modules/communityService/gxxq/addForm.vue | 95 +++++++++++--------
.../modules/communityService/gxxq/index.vue | 1 +
.../jinengzhaoren/addForm.vue | 2 +-
.../communityService/policy/addPolicy.vue | 29 +++++-
.../wennuanzhaoren/addForm.vue | 2 +-
.../tuceng/yingji/zizuzhi/addForm.vue | 1 +
10 files changed, 94 insertions(+), 46 deletions(-)
diff --git a/src/views/modules/communityParty/regionalParty/activitysForm.vue b/src/views/modules/communityParty/regionalParty/activitysForm.vue
index 58d508716..04a6c0c8c 100644
--- a/src/views/modules/communityParty/regionalParty/activitysForm.vue
+++ b/src/views/modules/communityParty/regionalParty/activitysForm.vue
@@ -28,8 +28,9 @@
diff --git a/src/views/modules/communityParty/regionalParty/unitsForm.vue b/src/views/modules/communityParty/regionalParty/unitsForm.vue
index e00dc980d..7b9fb09cf 100644
--- a/src/views/modules/communityParty/regionalParty/unitsForm.vue
+++ b/src/views/modules/communityParty/regionalParty/unitsForm.vue
@@ -69,8 +69,9 @@
diff --git a/src/views/modules/communityService/fuwuzhaoren/addForm.vue b/src/views/modules/communityService/fuwuzhaoren/addForm.vue
index 6cb5f03fb..706475b44 100644
--- a/src/views/modules/communityService/fuwuzhaoren/addForm.vue
+++ b/src/views/modules/communityService/fuwuzhaoren/addForm.vue
@@ -585,7 +585,7 @@ export default {
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
- );
+ ).filter((item) => item.categoryCode == '1038' ||item.categoryCode == '1039'||item.categoryCode == '1041');
}
})
.catch(() => {
diff --git a/src/views/modules/communityService/gangweizhaoren/addForm.vue b/src/views/modules/communityService/gangweizhaoren/addForm.vue
index c20cbc722..774ee25a6 100644
--- a/src/views/modules/communityService/gangweizhaoren/addForm.vue
+++ b/src/views/modules/communityService/gangweizhaoren/addForm.vue
@@ -575,7 +575,7 @@ export default {
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
- );
+ ).filter((item) => item.categoryCode == '1044');
}
})
.catch(() => {
diff --git a/src/views/modules/communityService/gxxq/addForm.vue b/src/views/modules/communityService/gxxq/addForm.vue
index 48488ade5..889086bae 100644
--- a/src/views/modules/communityService/gxxq/addForm.vue
+++ b/src/views/modules/communityService/gxxq/addForm.vue
@@ -12,7 +12,6 @@
class="div_form"
>
-
@@ -364,6 +363,15 @@ export default {
policyList: [],
showLabelForm: false,
+ codeFilters: {
+ '1038': ['party_unit', 'community_org'],
+ '1039': ['party_unit', 'community_org'],
+ '1040': ['party_unit', 'community_org'],
+ '1041': ['party_unit', 'community_org', 'publicWelfare'],
+ '1042': ['party_unit', 'community_org', 'publicWelfare'],
+ '1043': ['party_unit', 'community_org', 'publicWelfare'],
+ '1044': ['party_unit', 'community_org'],
+ },
};
},
@@ -386,7 +394,6 @@ export default {
created() {},
async mounted() {
this.startLoading();
- // this.getCategrayList();
await this.getPolicyList();
await this.loadScopeTree();
await this.getDictOptions();
@@ -396,17 +403,17 @@ export default {
},
methods: {
- async initForm(type, row) {
+ initForm(type, row) {
this.formType = type;
this.scopeId = row.id;
- await this.getDetail(row.id);
+ this.$nextTick(()=>{
+ this.getDetail(row.id);
+ })
},
async getDetail(id) {
const url = `/governance/commonDemand/detail/${id}`;
const { data, code, msg } = await requestGet(url);
-
if (code === 0) {
- this.formData.serviceTypeLevel1Id = data.servicePid;
this.formData.commonServiceTypeId = data.commonServiceTypeId;
this.formData.title = data.title;
this.formData.content = data.content;
@@ -417,6 +424,7 @@ export default {
} else {
this.formData.categoryCode = [data.parentCategoryCode];
}
+
if (data.assignInfo) {
this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart;
this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd;
@@ -486,21 +494,16 @@ export default {
this.formData.resiSearchTagName = "";
},
handelChangeCategoryCode() {
- this.serviceOptions = [...this.originalServiceOptions];
- const parentMappings = {
- '公益事业类': ['party_unit', 'community_org'],
- '技能培训类': ['party_unit', 'publicWelfare', 'community_org'],
- '教育讲座类': ['party_unit', 'community_org'],
- '社会治理类': ['party_unit', 'community_org'],
- '公共服务类': ['party_unit', 'community_org', 'publicWelfare'],
- '岗位提供类': ['party_unit', 'community_org'],
- };
- const checkedParent = this.$refs['categoryCode'].getCheckedNodes()[0].parent.label;
- if (parentMappings[checkedParent] && Array.isArray(parentMappings[checkedParent])) {
- this.serviceOptions = this.serviceOptions.filter(item => parentMappings[checkedParent].includes(item.value));
- } else {
- this.serviceOptions = this.originalServiceOptions
- }
+ this.serviceOptions = [...this.originalServiceOptions];
+ const codeFilters = this.codeFilters;
+ console.log(this.serviceOptions);
+ const checkedCode = this.$refs['myCategoryCode'].getCheckedNodes()[0].parent.value;
+ console.log(checkedCode);
+ if (codeFilters[checkedCode] && Array.isArray(codeFilters[checkedCode])) {
+ this.serviceOptions = this.serviceOptions.filter(item => codeFilters[checkedCode].includes(item.value));
+ } else {
+ this.serviceOptions = this.originalServiceOptions;
+ }
},
async iniDefaultData() {
const { defaultData } = this;
@@ -535,22 +538,37 @@ export default {
}
},
async getDictOptions() {
- this.$http
- .post("/sys/dict/data/dictlist", {
- dictType: "user_demand_service_type",
- })
- .then(({ data: res }) => {
- if (res.code !== 0) {
- return this.$message.error(res.msg);
- } else {
- this.serviceOptions = res.data;
- this.originalServiceOptions = [...this.serviceOptions];
- }
- })
- .catch(() => {
- return this.$message.error("网络错误");
- });
- },
+ this.$http
+ .post("/sys/dict/data/dictlist", {
+ dictType: "user_demand_service_type",
+ })
+ .then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg);
+ } else {
+ this.originalServiceOptions = [...res.data];
+ console.log(this.originalServiceOptions);
+ if (this.formType == 'edit') {
+ this.$nextTick(() => {
+ const code = this.$refs['myCategoryCode'].checkedValue[0];
+ const filterOptions = (filterCodes) => {
+ this.serviceOptions = res.data.filter(item => filterCodes.includes(item.value));
+ };
+
+ if (code && this.codeFilters[code]) {
+ filterOptions(this.codeFilters[code]);
+ }
+ });
+ }else{
+ this.serviceOptions = res.data;
+ }
+
+ }
+ })
+ .catch(() => {
+ return this.$message.error("网络错误");
+ });
+ },
async getDemandOptions() {
this.$http
.post("/actual/base/serviceitem/listAllCategory")
@@ -810,6 +828,7 @@ export default {
}
},
},
+ computed:{}
};
diff --git a/src/views/modules/communityService/gxxq/index.vue b/src/views/modules/communityService/gxxq/index.vue
index 6d33185bd..df28e6cae 100644
--- a/src/views/modules/communityService/gxxq/index.vue
+++ b/src/views/modules/communityService/gxxq/index.vue
@@ -253,6 +253,7 @@ import { mapGetters } from "vuex";
import addForm from "./addForm.vue";
import detailForm from "./detailForm.vue";
import axios from "axios";
+import nextTick from "dai-js/tools/nextTick";
export default {
data() {
let endDisabledDate = (time) => {
diff --git a/src/views/modules/communityService/jinengzhaoren/addForm.vue b/src/views/modules/communityService/jinengzhaoren/addForm.vue
index c18836f91..399c19e3c 100644
--- a/src/views/modules/communityService/jinengzhaoren/addForm.vue
+++ b/src/views/modules/communityService/jinengzhaoren/addForm.vue
@@ -574,7 +574,7 @@ export default {
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
- );
+ ).filter((item) => item.categoryCode == '1043');
}
})
.catch(() => {
diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue
index b25369ec7..8c777e722 100644
--- a/src/views/modules/communityService/policy/addPolicy.vue
+++ b/src/views/modules/communityService/policy/addPolicy.vue
@@ -12,12 +12,14 @@
parentMappings[checkedParent].includes(item.value));
+ } else {
+ this.serviceOptions = this.originalServiceOptions
+ }
+ console.log(this.serviceOptions);
+ },
//点击标签触发事件
handleClickLabel() {
this.showLabelForm = true;
@@ -593,7 +617,9 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
- this.serviceOptions = res.data.filter(item=>item.value == 'party_unit'||item.value == 'community_org'||item.value == 'publicWelfare');
+ this.serviceOptions = res.data;
+ this.originalServiceOptions = [...this.serviceOptions];
+
}
})
.catch(() => {
@@ -601,7 +627,6 @@ export default {
});
},
getDictOptions() {
- // 政策级别下拉
this.$http
.post("/sys/dict/data/dictlist", {
dictType: "policy_level",
diff --git a/src/views/modules/communityService/wennuanzhaoren/addForm.vue b/src/views/modules/communityService/wennuanzhaoren/addForm.vue
index 0b1188879..34ac34703 100644
--- a/src/views/modules/communityService/wennuanzhaoren/addForm.vue
+++ b/src/views/modules/communityService/wennuanzhaoren/addForm.vue
@@ -785,7 +785,7 @@ export default {
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
- );
+ ).filter((item) => item.categoryCode == '1040');
}
})
.catch(() => {
diff --git a/src/views/modules/shequzhili/tuceng/yingji/zizuzhi/addForm.vue b/src/views/modules/shequzhili/tuceng/yingji/zizuzhi/addForm.vue
index 04d55b6f8..cce8a375e 100644
--- a/src/views/modules/shequzhili/tuceng/yingji/zizuzhi/addForm.vue
+++ b/src/views/modules/shequzhili/tuceng/yingji/zizuzhi/addForm.vue
@@ -93,6 +93,7 @@
:options="demandOptions"
:props="{label: 'categoryName',value: 'categoryCode',children: 'childCateList',multiple:true,emitPath:false}"
clearable
+ collspse-tags
size="small"
class="u-item-width-normal"
>