From 91dc8cc51473aecb246d39e1ec5a63896a53dcae Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 21 四月 2025 15:08:22 +0800
Subject: [PATCH] 测试完成
---
src/views/knowledge/questionnaire/compilequer/index.vue | 136 +++++++++++++++++++++++++++-----------------
1 files changed, 83 insertions(+), 53 deletions(-)
diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue
index 6e47417..7eba035 100644
--- a/src/views/knowledge/questionnaire/compilequer/index.vue
+++ b/src/views/knowledge/questionnaire/compilequer/index.vue
@@ -261,9 +261,9 @@
>
<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>
@@ -284,10 +284,10 @@
>
<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>{{
@@ -544,7 +543,7 @@
<el-col :span="12">
<el-form-item
label="闂鍒嗗��"
- v-if="topicobj.scoretype == 1"
+ v-if="ruleForm.scoreType == 1"
>
<el-input
v-model="topicobj.score"
@@ -606,7 +605,7 @@
v-for="item in topicobj.svyLibTemplateTargetoptions"
>
<el-row :gutter="5">
- <el-col :span="16"
+ <el-col :span="12"
><el-form-item label="閫夐」鍚嶇О">
<el-input
type="text"
@@ -616,9 +615,9 @@
>
</el-input> </el-form-item
></el-col>
- <el-col :span="8">
+ <el-col :span="12">
<el-form-item
- v-if="topicobj.scoretype == 1"
+ v-if="ruleForm.scoreType == 1"
label="閫夐」鍒嗗��"
>
<el-input
@@ -631,7 +630,7 @@
</el-input>
</el-form-item>
<el-form-item
- v-else-if="topicobj.scoretype == 2"
+ v-else-if="ruleForm.scoreType == 2"
label="ABC绛夌骇"
>
<el-radio-group v-model="item.score">
@@ -641,7 +640,7 @@
</el-radio-group>
</el-form-item>
<el-form-item
- v-else-if="topicobj.scoretype == 3"
+ v-else-if="ruleForm.scoreType == 3"
label="浼樿壇绛夌骇"
>
<el-radio-group v-model="item.score">
@@ -982,7 +981,7 @@
<el-col :span="12">
<el-form-item label="璇勪环绫诲瀷">
<el-select
- v-model="indexform.scoretype"
+ v-model="indexform.scoreType"
placeholder="璇烽�夋嫨鍒嗙被"
>
<el-option
@@ -1131,7 +1130,7 @@
></el-col>
<el-col :span="11">
<el-form-item
- v-if="indexform.scoretype == 1"
+ v-if="indexform.scoreType == 1"
label="鍒嗗��"
>
<el-input
@@ -1143,7 +1142,7 @@
</el-input>
</el-form-item>
<el-form-item
- v-else-if="indexform.scoretype == 2"
+ v-else-if="indexform.scoreType == 2"
label="ABC绛夌骇"
>
<el-radio-group v-model="item.score">
@@ -1153,7 +1152,7 @@
</el-radio-group>
</el-form-item>
<el-form-item
- v-else-if="indexform.scoretype == 3"
+ v-else-if="indexform.scoreType == 3"
label="浼樿壇绛夌骇"
>
<el-radio-group v-model="item.score">
@@ -1166,7 +1165,7 @@
<el-col
:span="2"
- :offsset="indexform.scoretype == 4 ? 11 : 0"
+ :offsset="indexform.scoreType == 4 ? 11 : 0"
>
<el-button
type="danger"
@@ -1263,6 +1262,7 @@
} 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 +1383,7 @@
illnessVisible: false, //鎸囨爣鐤剧梾寮规
Operateit: true,
deptOptions: [],
+ flatArray: [],
optionsillness: [],
delScriptVOList: [],
illnesslistapi: [],
@@ -1395,7 +1396,6 @@
valuetype: [],
qremark: [],
hosplist: [],
- deptlist: [],
usable: [
{ value: "0", label: "鍙敤" },
{ value: "1", label: "鍋滅敤" },
@@ -1446,6 +1446,7 @@
created() {
this.getissueinfo();
this.gettabList();
+ this.getDeptTree();
this.mode = store.getters.Askmode;
this.languagelist = store.getters.languagelist;
this.usable = store.getters.usable;
@@ -1537,21 +1538,49 @@
});
this.tempDetpRelevanceslist = [];
this.tempbelongWards = [];
-
- depthospgetsonlist(this.queryParamsdept).then((res) => {
- if (res.code == 200) {
- let arr = res.rows;
- arr.forEach((item) => {
- if (item.deptType == 1) {
- this.deptlist.push(item);
- this.tempDetpRelevanceslist.push(item.deptCode);
- } else if (item.deptType == 2) {
- this.hosplist.push(item);
- this.tempbelongWards.push(item.deptCode);
- }
- });
- }
+ if (this.queryParamsdept.tempid) {
+ depthospgetsonlist(this.queryParamsdept).then((res) => {
+ if (res.code == 200) {
+ let arr = res.rows;
+ arr.forEach((item) => {
+ if (item.deptType == 1) {
+ this.deptlist.push(item);
+ this.tempDetpRelevanceslist.push(item.deptCode);
+ } else if (item.deptType == 2) {
+ this.hosplist.push(item);
+ this.tempbelongWards.push(item.deptCode);
+ }
+ });
+ }
+ });
+ }
+ },
+ // 鑾峰彇绉戝鏍�
+ 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湪淇淇濆瓨鏁版嵁锛岃绋嶅��...");
@@ -1562,23 +1591,24 @@
this.ruleForm.categoryid = -1;
}
// 棰樼洰淇濆瓨澶勭悊
- // 鎻愪氦
- this.ruleForm.svyTemplateLibScripts.forEach((res) => {
+ // 鎻愪氦
+ this.ruleForm.svyTemplateLibScripts.forEach((res) => {
if (!res.isoperation) {
res.isoperation = 2;
}
- res.ivrLibaScriptTargetoptionList =
- res.svyLibTemplateTargetoptions.map((item) => {
+ 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)
- })
+ this.delScriptVOList.forEach((item) => {
+ this.ruleForm.svyTemplateLibScripts.push(item);
+ });
if (this.id) {
this.ruleForm.isoperation = 2;
this.ruleForm.tempDetpRelevances = null;
@@ -1645,22 +1675,23 @@
let result = this.deptlist
.filter((item) => item.deptCode == row)
.map((item) => item.id);
- console.log(result.length);
if (result.length) {
depthospgetsondel(result).then((res) => {
- if (res.code) {
+ if (res.code == 200) {
+ this.$modal.msgSuccess("鍒犻櫎绉戝鎴愬姛");
}
});
}
},
- // 鍒犻櫎鍒犻櫎瑙﹀彂
+ // 鍒犻櫎鐥呭尯瑙﹀彂
removehpsp(row) {
let result = this.hosplist
.filter((item) => item.deptCode == row)
.map((item) => item.id);
if (result.length) {
depthospgetsondel(result).then((res) => {
- if (res.code) {
+ if (res.code == 200) {
+ this.$modal.msgSuccess("鍒犻櫎鐥呭尯鎴愬姛");
}
});
}
@@ -1695,7 +1726,7 @@
// 鑾峰彇闂鍒楄〃
getaddtopiclist() {
this.drawer = true;
- this.queryParams.scoretype = this.ruleForm.scoreType;
+ this.queryParams.scoreType = this.ruleForm.scoreType;
getissuelist(this.queryParams).then((res) => {
this.loading = false;
this.userList = res.rows;
@@ -1884,13 +1915,12 @@
},
// 淇濆瓨绉戝/鐥呭尯
putbelongDepts(id) {
- this.tempDetpRelevanceslistform.forEach(item=>{
- if (!item.tempid) item.tempid=id;
- })
-
- this.tempbelongWardsform.forEach(item=>{
- if (!item.tempid) item.tempid=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