From 41b1f5280255ac539e40d4cd794532ae1829ce17 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 01 八月 2024 18:25:36 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/QuestionnaireTask.vue |  490 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 254 insertions(+), 236 deletions(-)

diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index f250966..189b1fe 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -54,6 +54,7 @@
                     <el-button
                       type="primary"
                       icon="el-icon-edit"
+                      @click="drawermb = true"
                       circle
                     ></el-button>
                   </el-col>
@@ -170,208 +171,6 @@
           </div>
           <div class="examine-jic">
             <div class="headline">
-              <div>{{ title }}</div>
-            </div>
-            <div class="examine-jic">
-              <div class="jic-value">
-                <el-row :gutter="20">
-                  <!--鐢ㄦ埛鏁版嵁-->
-
-                  <el-form
-                    :model="topqueryParams"
-                    ref="queryForm"
-                    size="small"
-                    :inline="true"
-                    v-show="showSearch"
-                    label-width="98px"
-                  >
-                    <el-form-item
-                      label="瀹f暀涓婚"
-                      v-if="currenttype == 1 || currenttype == 8"
-                    >
-                      <el-input v-model="topqueryParams.name"></el-input>
-                    </el-form-item>
-                    <el-form-item
-                      label="闅忚鍚嶇О"
-                      v-if="
-                        currenttype == 2 || currenttype == 3 || currenttype == 7
-                      "
-                    >
-                      <el-input
-                        v-model="topqueryParams.name"
-                      ></el-input> </el-form-item
-                    ><el-form-item
-                      label="閫氱煡鍚嶇О"
-                      v-if="currenttype == 4 || currenttype == 5"
-                    >
-                      <el-input
-                        v-model="topqueryParams.name"
-                      ></el-input> </el-form-item
-                    ><el-form-item label="浣撴濂楅" v-if="currenttype == 5">
-                      <el-input v-model="topqueryParams.name"></el-input>
-                    </el-form-item>
-                    <el-form-item label="闂嵎涓婚" v-if="currenttype == 6">
-                      <el-input v-model="topqueryParams.name"></el-input>
-                    </el-form-item>
-                    <el-form-item label="閫傜敤鐤剧梾" v-if="currenttype != 5">
-                      <el-input v-model="topqueryParams.name"></el-input>
-                    </el-form-item>
-
-                    <el-form-item
-                      label="瀹f暀绫诲瀷"
-                      prop="status"
-                      v-if="currenttype == 1 || currenttype == 8"
-                    >
-                      <el-select
-                        v-model="topqueryParams.topic"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item
-                      label="閫氱煡绫诲瀷"
-                      prop="status"
-                      v-if="currenttype == 4 || currenttype == 5"
-                    >
-                      <el-select
-                        v-model="topqueryParams.topic"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item
-                      label="闅忚绫诲瀷"
-                      prop="status"
-                      v-if="
-                        currenttype == 2 || currenttype == 3 || currenttype == 7
-                      "
-                    >
-                      <el-select
-                        v-model="topqueryParams.topic"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item
-                      label="闂嵎绫诲瀷"
-                      prop="status"
-                      v-if="currenttype == 6"
-                    >
-                      <el-select
-                        v-model="topqueryParams.topic"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item label="閫傜敤褰㈠紡" prop="status">
-                      <el-select
-                        v-model="topqueryParams.topica"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-
-                    <el-form-item label="閫傜敤绉戝" prop="status">
-                      <el-select
-                        v-model="topqueryParams.topicd"
-                        placeholder="璇烽�夋嫨"
-                      >
-                        <el-option
-                          v-for="item in topicoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item>
-                      <el-button
-                        type="primary"
-                        icon="el-icon-search"
-                        size="medium"
-                        @click="handleQuery"
-                        >鎼滅储</el-button
-                      >
-                      <el-button
-                        icon="el-icon-refresh"
-                        size="medium"
-                        @click="resetQuery"
-                        >閲嶇疆</el-button
-                      >
-                    </el-form-item>
-                  </el-form>
-                  <el-divider></el-divider>
-                  <!-- 閫夋嫨妯$増鍒楄〃 -->
-                  <SFtable
-                    @selectfn="selectfn"
-                    :currentList="userList"
-                    :tableLabel="tableLabel"
-                    :serialnumber="false"
-                    :controlsc="false"
-                    :multiplechoice="false"
-                    :typeinfo="1"
-                  />
-                  <pagination
-                    v-show="total > 0"
-                    :total="total"
-                    :page.sync="topqueryParams.pageNum"
-                    :limit.sync="topqueryParams.pageSize"
-                    @pagination="Acquisitiontype"
-                  />
-                </el-row>
-              </div>
-            </div>
-          </div>
-        </div>
-        <el-button type="success" @click="nextstep('ruleForm')">{{
-          quote ? "绔嬪嵆鍒涘缓" : "浠诲姟璇︽儏閰嶇疆"
-        }}</el-button>
-        <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button>
-      </div>
-
-      <!-- 浠诲姟璇︽儏 -->
-      <div v-if="Editprogress == 2">
-        <el-alert title="鍦ㄦ湰闃舵閫夋嫨瀹f暀鐥呬汉" type="success" effect="dark">
-        </el-alert>
-        <div class="leftvlue-jbxx">
-          <div class="examine-jic">
-            <div class="headline">
               <div>鍙橀噺鍖归厤閲忓弬</div>
             </div>
             <div class="examine-jic">
@@ -415,6 +214,18 @@
               </div>
             </div>
           </div>
+        </div>
+        <el-button type="success" @click="nextstep('ruleForm')">{{
+          quote ? "绔嬪嵆鍒涘缓" : "浠诲姟璇︽儏閰嶇疆"
+        }}</el-button>
+        <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button>
+      </div>
+
+      <!-- 浠诲姟璇︽儏 -->
+      <div v-if="Editprogress == 2">
+        <el-alert title="鍦ㄦ湰闃舵閫夋嫨瀹f暀鐥呬汉" type="success" effect="dark">
+        </el-alert>
+        <div class="leftvlue-jbxx">
           <div class="examine-jic">
             <div class="headline">
               <div>鎮h�呭垪琛�</div>
@@ -423,7 +234,7 @@
               <div class="jic-value">
                 <el-row :gutter="20">
                   <!--鐢ㄦ埛鏁版嵁-->
-                  <el-form
+                  <!-- <el-form
                     :model="topqueryParams"
                     ref="queryForm"
                     size="small"
@@ -464,7 +275,7 @@
                         </el-option>
                       </el-select>
                     </el-form-item>
-                    <el-form-item label="闅忚缁撴灉" prop="status">
+                    <el-form-item label="闂嵎缁撴灉" prop="status">
                       <el-select
                         v-model="topqueryParams.topic"
                         placeholder="璇烽�夋嫨"
@@ -503,7 +314,7 @@
                       >
                     </el-form-item>
                   </el-form>
-                  <el-divider></el-divider>
+                  <el-divider></el-divider> -->
                   <el-row :gutter="10" class="mb8">
                     <el-col :span="1.5">
                       <el-select
@@ -552,6 +363,7 @@
                     :currentList="overallCase"
                     :tableLabel="tableLabelhz"
                     :serialnumber="false"
+                    :searchTrue="true"
                     :multiplechoice="false"
                     :controlxz="false"
                     :typeinfo="2"
@@ -668,31 +480,59 @@
       <div class="preview-left">
         <!-- 鍗曢�� -->
         <div
-          class="topic-dev"
-          v-for="(item, index) in questionList"
-          :key="item.id"
+          class="scriptTopic-dev"
+          v-for="item in questionList"
+          :key="item.sort"
+          v-if="item.scriptType == 1"
         >
           <div class="dev-text">
-            {{ index + 1 }}銆�<span>{{ item.script }}</span>
+            {{ item.sort }}銆乕鍗曢�塢<span>{{ item.scriptContent }}</span>
           </div>
-
-          <div class="dev-xx" v-if="item.scripttype != 3">
-            <el-radio-group v-model="item.radio">
+          <div class="dev-xx">
+            <el-radio-group v-model="item.remark">
               <el-radio
                 v-for="(items, index) in item.svyLibTemplateTargetoptions"
-                :key="items.id"
-                :label="items.id"
-                >{{ items.optioncontent }}
-              </el-radio>
+                :key="index"
+                :label="index"
+                >{{ items.optioncontent }}</el-radio
+              >
             </el-radio-group>
           </div>
-          <div v-else>
-            <el-input
-              type="textarea"
-              placeholder="鏈幏鍙栧埌淇℃伅"
-              v-model.sync="item.questionResult"
-              :rows="2"
-            />
+        </div>
+        <!-- 澶氶�� -->
+        <div
+          class="scriptTopic-dev"
+          v-for="item in questionList"
+          v-if="item.scriptType == 2"
+        >
+          <div class="dev-text">
+            {{ item.sort }}銆乕澶氶�塢<span>{{ item.scriptContent }}</span>
+          </div>
+          <div class="dev-xx">
+            <el-checkbox-group v-model="multiplechoice">
+              <el-checkbox
+                v-for="items in item.svyLibTemplateTargetoptions"
+                :key="items.optioncontent"
+                :label="items.optioncontent"
+              >
+                {{ items.optioncontent }}
+              </el-checkbox>
+            </el-checkbox-group>
+          </div>
+        </div>
+        <!-- 濉┖ -->
+        <div
+          class="scriptTopic-dev"
+          v-for="item in questionList"
+          :key="item.sort"
+          v-if="item.scriptType == 3"
+        >
+          <div class="dev-text">
+            {{ item.sort }}銆乕濉┖]<span>{{ item.scriptContent }}</span>
+          </div>
+          <div class="dev-xx">
+            <el-input placeholder="璇疯緭鍏ョ瓟妗�" v-model="item.radioas" clearable>
+            </el-input>
           </div>
         </div>
       </div>
@@ -701,6 +541,177 @@
         <el-button type="primary" @click="previewFn">纭浣跨敤</el-button>
       </span>
     </el-dialog>
+    <el-drawer
+      title="闂嵎鍐呭鍒楄〃"
+      :visible.sync="drawermb"
+      direction="rtl"
+      size="50%"
+    >
+      <div class="headline"></div>
+      <div class="examine-jic">
+        <div class="jic-value">
+          <el-row :gutter="20">
+            <!--鐢ㄦ埛鏁版嵁-->
+
+            <el-form
+              :model="topqueryParams"
+              ref="queryForm"
+              size="small"
+              :inline="true"
+              v-show="showSearch"
+              label-width="98px"
+            >
+              <el-form-item
+                label="瀹f暀涓婚"
+                v-if="currenttype == 1 || currenttype == 8"
+              >
+                <el-input v-model="topqueryParams.name"></el-input>
+              </el-form-item>
+              <el-form-item
+                label="闂嵎鍚嶇О"
+                v-if="currenttype == 2 || currenttype == 3 || currenttype == 7"
+              >
+                <el-input
+                  v-model="topqueryParams.name"
+                ></el-input> </el-form-item
+              ><el-form-item
+                label="閫氱煡鍚嶇О"
+                v-if="currenttype == 4 || currenttype == 5"
+              >
+                <el-input
+                  v-model="topqueryParams.name"
+                ></el-input> </el-form-item
+              ><el-form-item label="浣撴濂楅" v-if="currenttype == 5">
+                <el-input v-model="topqueryParams.name"></el-input>
+              </el-form-item>
+              <el-form-item label="闂嵎涓婚" v-if="currenttype == 6">
+                <el-input v-model="topqueryParams.name"></el-input>
+              </el-form-item>
+              <el-form-item label="閫傜敤鐤剧梾" v-if="currenttype != 5">
+                <el-input v-model="topqueryParams.name"></el-input>
+              </el-form-item>
+
+              <el-form-item
+                label="瀹f暀绫诲瀷"
+                prop="status"
+                v-if="currenttype == 1 || currenttype == 8"
+              >
+                <el-select v-model="topqueryParams.topic" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in taskoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item
+                label="閫氱煡绫诲瀷"
+                prop="status"
+                v-if="currenttype == 4 || currenttype == 5"
+              >
+                <el-select v-model="topqueryParams.topic" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in taskoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item
+                label="闂嵎绫诲瀷"
+                prop="status"
+                v-if="currenttype == 2 || currenttype == 3 || currenttype == 7"
+              >
+                <el-select v-model="topqueryParams.topic" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in taskoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item
+                label="闂嵎绫诲瀷"
+                prop="status"
+                v-if="currenttype == 6"
+              >
+                <el-select v-model="topqueryParams.topic" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in taskoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="閫傜敤褰㈠紡" prop="status">
+                <el-select v-model="topqueryParams.topica" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in taskoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+
+              <el-form-item label="閫傜敤绉戝" prop="status">
+                <el-select v-model="topqueryParams.topicd" placeholder="璇烽�夋嫨">
+                  <el-option
+                    v-for="item in topicoptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item>
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  size="medium"
+                  @click="handleQuery"
+                  >鎼滅储</el-button
+                >
+                <el-button
+                  icon="el-icon-refresh"
+                  size="medium"
+                  @click="resetQuery"
+                  >閲嶇疆</el-button
+                >
+              </el-form-item>
+            </el-form>
+            <el-divider></el-divider>
+            <!-- 閫夋嫨妯$増鍒楄〃 -->
+            <SFtable
+              @selectfn="selectfn"
+              :currentList="userList"
+              :tableLabel="tableLabel"
+              :serialnumber="false"
+              :controlsc="false"
+              :multiplechoice="false"
+              :typeinfo="1"
+            />
+            <pagination
+              v-show="total > 0"
+              :total="total"
+              :page.sync="topqueryParams.pageNum"
+              :limit.sync="topqueryParams.pageSize"
+              @pagination="Acquisitiontype"
+            />
+          </el-row>
+        </div>
+      </div>
+    </el-drawer>
   </div>
 </template>
 
@@ -716,7 +727,7 @@
   Questionnairetaskget,
   gethetaskinfo,
   delhetaskinfo,
-  Questionnairetaskdetails,
+  Editsingletask,
 } from "@/api/AiCentre/index";
 import { listDept } from "@/api/system/dept";
 
@@ -735,6 +746,7 @@
       allpids: [],
       libId: null, //妯℃澘搴撴ā鐗坕d
       Editprogress: 1, //缂栬緫杩涘害
+      drawermb: false, //閫夋嫨妯$増寮圭獥
       previewtf: false, //棰勮
       loading: false, // 閬僵灞�
       patientloading: false, // 閬僵灞�
@@ -813,6 +825,7 @@
       multiple: true,
       // 鐢ㄦ埛琛ㄦ牸鏁版嵁
       userList: [], //妯$増鍒楄〃
+      multiplechoice: [], //澶氶�夌粨鏋�
       patientuserList: [], //閫夋嫨鎮h�呭垪琛�
       sonuserList: [], //閫変腑鎮h�呭垪琛�
       delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
@@ -887,7 +900,8 @@
 
   created() {
     this.id = this.$route.query.id;
-    this.form.Type = this.$route.query.type;
+    this.form.type = this.$route.query.type;
+    this.form.typename = this.$route.query.typename;
     this.listDept();
     this.Acquisitiontype();
     this.Getdetails();
@@ -932,7 +946,7 @@
       this.currenttype = this.$route.query.type;
       this.title = "闂嵎鍐呭鍒楄〃";
       this.tableLabel = this.tableLabelwj;
-      this.checkboxlist = ["绾夸笅锛堢焊璐級", "绾夸笂锛堢煭淇�/閽夐拤鐨勬枃鏈�侀棶鍗烽摼鎺ワ級"];
+      this.checkboxlist = ["鐭俊", "寰俊", "浜哄伐鐢佃瘽", "鏅鸿兘鏈哄櫒浜�"];
       getQtemplatelist(queryParams).then((response) => {
         this.userList = response.rows;
         this.total = response.total;
@@ -947,6 +961,10 @@
     submitForm(formName) {
       // this.form.preachform = this.checkList.join(",");
       this.formatFn(1);
+      if (!this.form.patTaskRelevances[0]) {
+        this.$modal.msgError("璇烽�夋嫨鐥呬汉");
+        return;
+      }
       this.form.hospType = this.currenttype;
       const filteredArray = this.variableList.filter(
         (item) =>
@@ -962,7 +980,7 @@
       if (!this.form.type) {
         this.form.type = this.$route.query.type;
       }
-      Questionnairetaskdetails(this.form).then((res) => {
+      Editsingletask(this.form).then((res) => {
         if (res.code == 200) {
           if (this.form.taskid) {
             this.$modal.msgSuccess("鏂板鎴愬姛");
@@ -985,11 +1003,10 @@
         this.libId = row.svyid;
         console.log(row, "row");
         this.Tasktemplate = row;
-        this.questionList = row.svyLibScripts;
+        this.questionList = row.svyTemplateLibScripts;
         this.previewtf = true;
         this.previewid = row.svyid;
-        console.log(this.questionList, "questionList");
-        this.Variablehandling(row.svyLibScripts, 1);
+        this.Variablehandling(row.svyTemplateLibScripts, 1);
       } else if (type == 2) {
       } else if (type == 3) {
       }
@@ -998,10 +1015,8 @@
     Variablehandling(arr, type) {
       let Variablist = [];
       if (type == 1) {
-        console.log(arr);
         // 寰幆闂
         arr.forEach((res) => {
-          console.log(JSON.parse(res.otherdata), "ss");
           // 寰幆閫夐」
           JSON.parse(res.otherdata).forEach((item) => {
             if (item.default != 1) {
@@ -1019,6 +1034,7 @@
             index ===
             self.findIndex((t) => t.name === obj.name && t.value === obj.value)
         );
+
         this.variableList = this.transitionList.concat(Aarr);
         // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
       }
@@ -1269,10 +1285,11 @@
     previewFn() {
       let id = this.Tasktemplate.id;
       this.Tasktemplate.id = null;
-      this.Tasktemplate.svyLibScripts.svyTaskTemplateTargetoptions =
-        this.Tasktemplate.svyLibScripts.svyLibTemplateTargetoptions;
+      console.log(this.Tasktemplate);
+      this.Tasktemplate.svyTemplateLibScripts.svyTaskTemplateTargetoptions =
+        this.Tasktemplate.svyTemplateLibScripts.svyLibTemplateTargetoptions;
       this.Tasktemplate.svyTaskTemplateScriptVOS =
-        this.Tasktemplate.svyLibScripts;
+        this.Tasktemplate.svyTemplateLibScripts;
       this.Tasktemplate.templateid = id;
       this.Tasktemplate.isoperation = 1;
       TaskQuestioncomit(this.Tasktemplate).then((response) => {
@@ -1348,6 +1365,7 @@
     0 0 6px 0 rgba(0, 0, 0, 0.04);
 }
 .examine-jic {
+  margin: 20px;
   .headline {
     font-size: 24px;
     border-left: 5px solid #41a1be;
@@ -1414,7 +1432,7 @@
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
     0 0 6px 0 rgba(0, 0, 0, 0.04);
-  .topic-dev {
+  .scriptTopic-dev {
     margin-bottom: 25px;
     font-size: 20px !important;
     .dev-text {

--
Gitblit v1.9.3