@@ -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}`,