From 9a1a82e442721ce04a743381b278482487d6a60b Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 11 十二月 2024 15:20:35 +0800
Subject: [PATCH] 测试完成
---
src/views/knowledge/questionnaire/compilequer/index.vue | 95 +++++++++++++++++++++++++++++++++++++----------
1 files changed, 75 insertions(+), 20 deletions(-)
diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue
index 8fa6512..ce30b40 100644
--- a/src/views/knowledge/questionnaire/compilequer/index.vue
+++ b/src/views/knowledge/questionnaire/compilequer/index.vue
@@ -259,11 +259,11 @@
filterable
placeholder="璇烽�夋嫨绉戝"
>
- <el-option
+ <el-option
class="ruleFormaa"
- v-for="item in belongDepts"
+ v-for="item in flatArray"
:key="item.deptCode"
- :label="item.deptName"
+ :label="item.label"
:value="item.deptCode"
>
</el-option>
@@ -282,12 +282,12 @@
filterable
placeholder="璇烽�夋嫨鐥呭尯"
>
- <el-option
+ <el-option
class="ruleFormaa"
- v-for="item in belongWards"
- :key="item.districtCode"
- :label="item.districtName"
- :value="item.districtCode"
+ v-for="item in flatArray"
+ :key="item.deptCode"
+ :label="item.label"
+ :value="item.deptCode"
>
</el-option>
</el-select> </el-form-item
@@ -435,7 +435,6 @@
align="center"
key="nextScriptno"
prop="nextScriptno"
- :show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span>{{
@@ -1263,6 +1262,8 @@
} from "@/api/AiCentre/index";
import OptionalForm from "@/components/OptionalForm"; //姝e垯缁勪欢
import { getToken } from "@/utils/auth";
+import { deptTreeSelect } from "@/api/system/user";
+
export default {
name: "Questionnaireinfo",
@@ -1383,6 +1384,7 @@
illnessVisible: false, //鎸囨爣鐤剧梾寮规
Operateit: true,
deptOptions: [],
+ flatArray:[],
optionsillness: [],
delScriptVOList: [],
illnesslistapi: [],
@@ -1435,6 +1437,7 @@
this.ruleForm.svyLibTemplateTagList.filter(
(item) => item.isoperation != 3
);
+ if (this.ruleForm.suitway)
this.ruleForm.suitway = this.ruleForm.suitway.split(",");
this.delScriptVOList = [];
this.tempDetpRelevanceslistform = [];
@@ -1445,6 +1448,7 @@
created() {
this.getissueinfo();
this.gettabList();
+ this.getDeptTree();
this.mode = store.getters.Askmode;
this.languagelist = store.getters.languagelist;
this.usable = store.getters.usable;
@@ -1455,7 +1459,6 @@
this.appraiselist = store.getters.appraiselist;
this.belongWards = store.getters.belongWards;
this.belongDepts = store.getters.belongDepts;
-
// this.test();
},
@@ -1517,7 +1520,9 @@
this.dynamicTags = this.ruleForm.svyLibTemplateTagList.map(
this.processElement
);
- this.ruleForm.suitway = this.ruleForm.suitway.split(",");
+ console.log(this.dynamicTags, "this.dynamicTags");
+ if (this.ruleForm.suitway)
+ this.ruleForm.suitway = this.ruleForm.suitway.split(",");
});
getillness({ outid: this.id, type: 5 }).then((res) => {
this.illnesslist = res.rows;
@@ -1551,6 +1556,33 @@
}
});
},
+ // 鑾峰彇绉戝鏍�
+ getDeptTree() {
+ // 绉戝鍒楄〃
+ deptTreeSelect().then((response) => {
+ this.deptOptions = response.data;
+ this.flatArray = this.flattenArray(response.data);
+ });
+ },
+ flattenArray(multiArray) {
+ let result = [];
+
+ // 閫掑綊鍑芥暟锛岀敤浜庡皢澶氱骇鏁扮粍杞崲涓轰竴缁存暟缁勶紝鍙寘鍚渶搴曞眰鐨勫厓绱�
+ function flatten(element) {
+ // 濡傛灉褰撳墠鍏冪礌鏈夊瓙鍏冪礌锛岀户缁�掑綊
+ if (element.children && element.children.length > 0) {
+ element.children.forEach((child) => flatten(child));
+ } else {
+ // 鍏嬮殕鍏冪礌浠ラ伩鍏嶄慨鏀瑰師濮嬫暟鎹�
+ let item = JSON.parse(JSON.stringify(element));
+ result.push(item); // 灏嗘渶搴曞眰鐨勫厓绱犳坊鍔犲埌缁撴灉鏁扮粍
+ }
+ }
+
+ // 浠庨《灞傚厓绱犲紑濮嬮�掑綊
+ multiArray.forEach((element) => flatten(element));
+ return result; // 杩斿洖鍙寘鍚渶搴曞眰鍏冪礌鐨勪竴缁存暟缁�
+ },
submitForm(formName) {
this.$modal.loading("姝e湪淇淇濆瓨鏁版嵁锛岃绋嶅��...");
if (Array.isArray(this.ruleForm.suitway)) {
@@ -1559,6 +1591,24 @@
if (!this.ruleForm.categoryid) {
this.ruleForm.categoryid = -1;
}
+ // 棰樼洰淇濆瓨澶勭悊
+ // 鎻愪氦
+ this.ruleForm.svyTemplateLibScripts.forEach((res) => {
+ if (!res.isoperation) {
+ res.isoperation = 2;
+ }
+ res.ivrLibaScriptTargetoptionList =
+ res.svyLibTemplateTargetoptions.map((item) => {
+ if (!item.isoperation) {
+ item.isoperation = 2;
+ item.templateID = this.ruleForm.id;
+ }
+ return item;
+ });
+ });
+ this.delScriptVOList.forEach((item)=>{
+ this.ruleForm.svyTemplateLibScripts.push(item)
+ })
if (this.id) {
this.ruleForm.isoperation = 2;
this.ruleForm.tempDetpRelevances = null;
@@ -1567,7 +1617,8 @@
this.confirmillness();
this.putbelongDepts();
this.$modal.closeLoading();
- this.$router.go(-1);
+ // this.$router.go(-1);
+ window.location.reload();
});
} else {
this.ruleForm.isoperation = 1;
@@ -1586,7 +1637,6 @@
},
// 绉戝/闄㈠尯澶勭悊
Departmenttreatment() {
-
this.tempDetpRelevanceslist.forEach((item) => {
console.log(item);
let result = this.deptlist.some((obj) => obj.deptCode == item);
@@ -1615,7 +1665,6 @@
}
});
-
// return
setTimeout(() => {
this.submitForm();
@@ -1639,12 +1688,12 @@
let result = this.hosplist
.filter((item) => item.deptCode == row)
.map((item) => item.id);
- if (result.length) {
- depthospgetsondel(result).then((res) => {
- if (res.code) {
- }
- });
- }
+ if (result.length) {
+ depthospgetsondel(result).then((res) => {
+ if (res.code) {
+ }
+ });
+ }
},
// 涓嬩竴姝�
nextstep() {
@@ -1865,6 +1914,12 @@
},
// 淇濆瓨绉戝/鐥呭尯
putbelongDepts(id) {
+ this.tempDetpRelevanceslistform.forEach(item=>{
+ if (!item.tempid) item.tempid=id;
+ })
+ this.tempbelongWardsform.forEach(item=>{
+ if (!item.tempid) item.tempid=id;
+ })
if (this.tempDetpRelevanceslistform.length > 0) {
depthospgetson(this.tempDetpRelevanceslistform).then((res) => {
if (res.code == 200) {
--
Gitblit v1.9.3