From 8a8cbdb9366873aac26ef565f797100dd289d51e Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 28 八月 2025 13:55:45 +0800
Subject: [PATCH] 满意度
---
src/views/knowledge/questionnaire/compilequer/index.vue | 225 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 158 insertions(+), 67 deletions(-)
diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue
index a2e96e7..bc81908 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>
@@ -280,14 +280,14 @@
size="medium"
multiple
filterable
- placeholder="璇烽�夋嫨绉戝"
+ placeholder="璇烽�夋嫨鐥呭尯"
>
<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
@@ -310,7 +310,7 @@
>涓嬩竴姝�</el-button
>
<el-button type="info" @click="closeFm('ruleForm')">鍏抽棴</el-button>
- <el-button @click="Departmenttreatment('ruleForm')"
+ <el-button @click="toExamine('ruleForm')"
>淇濆瓨闂嵎鍩虹淇℃伅</el-button
>
</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,17 +630,17 @@
</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">
- <el-radio label="A">A</el-radio>
- <el-radio label="B">B</el-radio>
- <el-radio label="C">C</el-radio>
+ <el-radio :label="1">A</el-radio>
+ <el-radio :label="2">B</el-radio>
+ <el-radio :label="3">C</el-radio>
</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">
@@ -692,7 +691,9 @@
<el-image
style="width: 100px; height: 100px"
:src="item.picturePath"
- :preview-src-list="[...item.picturePath]"
+ :preview-src-list="
+ item.picturePath ? [item.picturePath] : []
+ "
>
</el-image>
</div>
@@ -748,7 +749,7 @@
>
<el-button type="primary" @click="laststep()">涓婁竴姝�</el-button>
<el-button type="info" @click="closeFm('ruleForm')">鍏抽棴</el-button>
- <el-button @click="Departmenttreatment('ruleForm')"
+ <el-button @click="toExamine('ruleForm')"
>淇濆瓨闂鏁版嵁</el-button
>
</div>
@@ -982,7 +983,7 @@
<el-col :span="12">
<el-form-item label="璇勪环绫诲瀷">
<el-select
- v-model="indexform.scoretype"
+ v-model="indexform.scoreType"
placeholder="璇烽�夋嫨鍒嗙被"
>
<el-option
@@ -1131,7 +1132,7 @@
></el-col>
<el-col :span="11">
<el-form-item
- v-if="indexform.scoretype == 1"
+ v-if="indexform.scoreType == 1"
label="鍒嗗��"
>
<el-input
@@ -1143,17 +1144,17 @@
</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">
- <el-radio label="A">A</el-radio>
- <el-radio label="B">B</el-radio>
- <el-radio label="C">C</el-radio>
+ <el-radio :label="1">A</el-radio>
+ <el-radio :label="2">B</el-radio>
+ <el-radio :label="3">C</el-radio>
</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 +1167,7 @@
<el-col
:span="2"
- :offsset="indexform.scoretype == 4 ? 11 : 0"
+ :offsset="indexform.scoreType == 4 ? 11 : 0"
>
<el-button
type="danger"
@@ -1213,7 +1214,9 @@
<el-image
style="width: 100px; height: 100px"
:src="item.picturePath"
- :preview-src-list="[...item.picturePath]"
+ :preview-src-list="
+ item.picturePath ? [item.picturePath] : []
+ "
>
</el-image>
</div>
@@ -1263,6 +1266,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 +1387,7 @@
illnessVisible: false, //鎸囨爣鐤剧梾寮规
Operateit: true,
deptOptions: [],
+ flatArray: [],
optionsillness: [],
delScriptVOList: [],
illnesslistapi: [],
@@ -1435,6 +1440,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 +1451,7 @@
created() {
this.getissueinfo();
this.gettabList();
+ this.getDeptTree();
this.mode = store.getters.Askmode;
this.languagelist = store.getters.languagelist;
this.usable = store.getters.usable;
@@ -1455,8 +1462,6 @@
this.appraiselist = store.getters.appraiselist;
this.belongWards = store.getters.belongWards;
this.belongDepts = store.getters.belongDepts;
- console.log(this.belongWards, "belongWards");
- console.log(this.belongDepts, "belongDepts");
// this.test();
},
@@ -1518,7 +1523,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;
@@ -1536,21 +1543,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湪淇淇濆瓨鏁版嵁锛岃绋嶅��...");
@@ -1560,6 +1595,25 @@
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;
@@ -1568,7 +1622,8 @@
this.confirmillness();
this.putbelongDepts();
this.$modal.closeLoading();
- this.$router.go(-1);
+ // this.$router.go(-1);
+ window.location.reload();
});
} else {
this.ruleForm.isoperation = 1;
@@ -1585,11 +1640,46 @@
});
}
},
+ // 棰樼洰鏍¢獙
+ toExamine() {
+ // 閬嶅巻棰樼洰闆嗗悎
+ for (let i = 0; i < this.ruleForm.svyTemplateLibScripts.length; i++) {
+ const question = this.ruleForm.svyTemplateLibScripts[i];
+
+ // 濡傛灉 scriptType 涓� 4锛屽垯璺宠繃褰撳墠棰樼洰
+ if (question.scriptType === 4) {
+ continue;
+ }
+ // 鑾峰彇褰撳墠棰樼洰鐨勯�夐」闆嗗悎
+ const options = question.svyLibTemplateTargetoptions;
+
+ // 鍒涘缓涓�涓� Set 鏉ュ瓨鍌ㄩ�夐」鍚嶇О锛岀敤浜庢娴嬮噸澶�
+ const optionNames = new Set();
+
+ // 閬嶅巻閫夐」闆嗗悎
+ for (let j = 0; j < options.length; j++) {
+ const option = options[j];
+ const optionContent = option.optioncontent;
+
+ // 濡傛灉閫夐」鍚嶇О宸茬粡瀛樺湪浜� Set 涓紝璇存槑閲嶅
+ if (optionNames.has(optionContent)) {
+ this.$message.error(
+ `棰樼洰 ${question.id} 鐨勯�夐」鍚嶇О "${optionContent}" 閲嶅`
+ );
+ return false; // 杩斿洖 false 琛ㄧず鏍¢獙澶辫触
+ }
+ // 灏嗛�夐」鍚嶇О娣诲姞鍒� Set 涓�
+ optionNames.add(optionContent);
+ }
+ }
+
+ // 濡傛灉鎵�鏈夐鐩兘鏍¢獙閫氳繃锛岃繑鍥� true
+ console.log("鎵�鏈夐鐩牎楠岄�氳繃锛岄�夐」鍚嶇О鏃犻噸澶�");
+ this.Departmenttreatment();
+ },
+
// 绉戝/闄㈠尯澶勭悊
Departmenttreatment() {
- console.log(this.tempDetpRelevanceslist, "tempDetpRelevanceslist");
- console.log(this.deptlist, "deptlist");
- console.log(this.hosplist, "deptlist");
this.tempDetpRelevanceslist.forEach((item) => {
console.log(item);
let result = this.deptlist.some((obj) => obj.deptCode == item);
@@ -1607,9 +1697,6 @@
});
this.tempbelongWards.forEach((item) => {
let result = this.hosplist.some((obj) => obj.deptCode == item);
-
- console.log(this.result, "resulthhh");
-
if (!result) {
this.tempbelongWardsform.push({
deptType: 2,
@@ -1620,11 +1707,6 @@
});
}
});
- console.log(this.tempbelongWardsform, "tempbelongWardsform");
- console.log(
- this.tempDetpRelevanceslistform,
- "tempDetpRelevanceslistform"
- );
// return
setTimeout(() => {
@@ -1649,12 +1731,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() {
@@ -1686,7 +1768,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;
@@ -1875,6 +1957,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) {
@@ -2300,7 +2388,10 @@
display: flex;
.presentation-left {
width: 45%;
- // height: 500px;
+ max-height: 80vh;
+ padding: 0 20px;
+ font-size: 18px;
+ overflow: auto;
.button-textxg {
color: #024df0;
}
@@ -2320,7 +2411,7 @@
}
.presentation-right {
width: 55%;
- max-height: 688px;
+ max-height: 80vh;
padding: 0 20px;
font-size: 18px;
overflow: auto;
--
Gitblit v1.9.3