From 5eccdc5914a888c83ce933355fb436d71f22145e Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Thu, 19 May 2022 15:24:07 +0800 Subject: [PATCH] 6666 --- .../shequzhili/xiangmu/cpts/project-info.vue | 99 ++++++++++++++++++- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue b/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue index 55fdcb2a..a1a5d114 100644 --- a/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue +++ b/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue @@ -51,15 +51,46 @@ > -
+
分类:
{{ item.name }}
+ +
+

更改分类

+ + 确定 +
+
+ 更改 +
+
-
+
标签:
@@ -275,9 +306,11 @@
- +

处理进展

@@ -485,6 +518,10 @@ function iniData() { }, projectCate: [], + cateOptions: [], + visibleCatePanel: false, + selectedCateData: [], + projectTag: [], }; } @@ -585,6 +622,20 @@ export default { )["departmentName"]; } }, + selectedCateData(val) { + const { cateOptions } = this; + console.log(cateOptions) + this.projectCate = val + .filter((arr) => arr.length > 0) + .map((arr) => { + let ele1 = cateOptions.find((item) => item.id == arr[0]); + let ele2 = ele1.subCategory.find((item) => item.id == arr[1]); + return { + id: ele2.id, + name: ele1.name + '-' + ele2.name + }; + }); + }, }, mounted() { @@ -797,6 +848,7 @@ export default { async getApiData() { await this.getProjectInfo(); this.getProjectCate(); + this.getCateOptions(); this.getProjectProcess(); }, @@ -972,6 +1024,43 @@ export default { } }, + async getCateOptions() { + const url = "/gov/issue/issueprojectcategorydict/list"; + + const { data, code, msg } = await requestPost(url, {}); + + if (code === 0) { + this.cateOptions = data.map((item) => { + item.subCategory.forEach((subitem) => { + delete subitem.subCategory; + }); + return item; + }); + } else { + this.$message.error(msg); + } + }, + + async updateProjectCate() { + const url = "/gov/project/projectcategory/save"; + const { projectCate } = this; + if (projectCate.length == 0) { + return this.$message.error("分类不能为空"); + } + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + categoryList: projectCate, + }); + + if (code === 0) { + this.$message.success("更改成功"); + this.visibleCatePanel = false; + } else { + this.$message.error(msg); + } + }, + toUserInfo(item) { this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${item.icResiUserId}`,