From ee1d4af7e569a723afc88ab8ac1939cb2667b072 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 03 三月 2025 18:06:13 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/QuestionnaireTask.vue | 1287 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 1,053 insertions(+), 234 deletions(-)

diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index 7259f01..5ecc2b2 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -70,17 +70,37 @@
                   />
                 </el-form-item>
                 <el-form-item label="鏈嶅姟褰㈠紡">
-                  <el-checkbox-group v-model="checkList">
-                    <el-checkbox
+                  <el-radio-group v-model="checkList">
+                    <el-radio
                       v-for="(item, index) in checkboxlist"
                       :key="index"
                       :label="item.value"
                     >
-                      {{ item.label }}</el-checkbox
+                      {{ item.label }}</el-radio
                     >
-                  </el-checkbox-group>
+                  </el-radio-group>
                 </el-form-item>
-                <el-form-item label="鎵ц璁剧疆" prop="sendType">
+                <el-form-item label="鎵ц鍛ㄦ湡" prop="longTask">
+                  <el-radio-group v-model="form.longTask">
+                    <el-radio :label="0">鑷畾涔夊懆鏈�</el-radio>
+                    <el-radio :label="1">闀挎湡浠诲姟</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+                <el-row :gutter="20" v-if="form.longTask">
+                  <el-col :span="8">
+                    <el-form-item label="鍛ㄦ湡鏃堕棿" prop="name">
+                      <el-input
+                        v-model="form.sendDay"
+                        placeholder="榛樿5澶╁悗"
+                      ></el-input>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-form-item
+                  label="鎵ц璁剧疆"
+                  prop="sendType"
+                  v-if="!form.longTask"
+                >
                   <el-radio-group v-model="form.sendType">
                     <el-radio :label="1">鏃堕棿娈垫墽琛�</el-radio>
                     <el-radio :label="3">鏃堕棿鐐规墽琛�</el-radio>
@@ -89,7 +109,7 @@
                 </el-form-item>
                 <el-form-item
                   label="鎵ц鏃ユ湡"
-                  v-if="form.sendType == 1"
+                  v-if="form.sendType == 1 && !form.longTask"
                   prop="daytime"
                 >
                   <el-date-picker
@@ -106,7 +126,7 @@
 
                 <el-form-item
                   label="鎵ц鏃堕棿鐐�"
-                  v-if="form.sendType == 3"
+                  v-if="form.sendType == 3 && !form.longTask"
                   prop="daytime"
                 >
                   <div style="display: flex">
@@ -125,7 +145,7 @@
 
                 <el-form-item
                   label="鎵ц鏃堕棿娈�"
-                  v-if="form.sendType == 1"
+                  v-if="form.sendType == 1 && !form.longTask"
                   prop="daytime"
                 >
                   <div style="display: flex">
@@ -176,6 +196,162 @@
                     </div>
                   </div>
                 </el-form-item>
+                <el-form-item label="浠诲姟鍏宠仈" prop="longTask">
+                  <el-radio-group v-model="form.appltype">
+                    <el-radio label="1">绉戝鍏宠仈</el-radio>
+                    <el-radio label="2">鐥呭尯鍏宠仈</el-radio>
+                    <el-radio label="3">鐤剧梾鍏宠仈</el-radio>
+                    <el-radio label="4">鎵嬫湳鍏宠仈</el-radio>
+                  </el-radio-group>
+                </el-form-item>
+                <el-row v-if="form.appltype == 1">
+                  <el-col :span="20"
+                    ><el-form-item label="閫傜敤绉戝" prop="region">
+                      <el-select
+                        v-model="deptcodesWards"
+                        @remove-tag="removetag"
+                        style="width: 400px"
+                        size="medium"
+                        multiple
+                        filterable
+                        placeholder="璇烽�夋嫨绉戝"
+                      >
+                        <el-option
+                          class="ruleFormaa"
+                          v-for="item in belongDepts"
+                          :key="item.deptCode"
+                          :label="item.deptName"
+                          :value="item.deptCode"
+                        >
+                        </el-option>
+                      </el-select> </el-form-item
+                  ></el-col>
+                </el-row>
+                <el-row v-if="form.appltype == 2">
+                  <el-col :span="20"
+                    ><el-form-item label="閫傜敤鐥呭尯" prop="region">
+                      <el-select
+                        v-model="leavehospitaldistrictcodes"
+                        style="width: 400px"
+                        @remove-tag="removehpsp"
+                        size="medium"
+                        multiple
+                        filterable
+                        placeholder="璇烽�夋嫨鐥呭尯"
+                      >
+                        <el-option
+                          class="ruleFormaa"
+                          v-for="item in belongWards"
+                          :key="item.districtCode"
+                          :label="item.districtName"
+                          :value="item.districtCode"
+                        >
+                        </el-option>
+                      </el-select> </el-form-item
+                  ></el-col>
+                </el-row>
+                <el-row v-if="form.appltype == 3">
+                  <!-- <el-col :span="20"
+                    ><el-form-item label="閫傜敤鐤剧梾" prop="region">
+                      <el-select
+                        v-model="illnesscodes"
+                        style="width: 400px"
+                        @remove-tag="removediagg"
+                        size="medium"
+                        :remote-method="remotedonor"
+                        multiple
+                        filterable
+                        remote
+                        placeholder="璇烽�夋嫨鐥呭尯"
+                      >
+                        <el-option
+                          class="ruleFormaa"
+                          v-for="item in donorchargeList"
+                          :key="item.icdcode"
+                          :label="item.icdname"
+                          :value="item.icdcode"
+                        >
+                        </el-option>
+                      </el-select> </el-form-item
+                  ></el-col> -->
+                  <div class="xinz-infs">
+                    <el-form-item>
+                      <template #label>
+                        <el-tooltip
+                          class="item"
+                          effect="light"
+                          content="閫夋嫨濂介�傜敤鐤剧梾鍚庯紝鍙互鏂逛究鎮ㄩ�氳繃鐤剧梾璇婃柇鏌ユ壘鍒板搴旂殑鐥呬汉!"
+                          placement="top-start"
+                        >
+                          <i class="el-icon-warning-outline"></i>
+                        </el-tooltip>
+                      </template>
+                      <div style="margin-bottom: 10px">
+                        <el-button
+                          type="warning"
+                          @click="$refs.child.handleAddpatient()"
+                          >娣诲姞鐤剧梾璇婃柇</el-button
+                        >
+                      </div>
+                      <el-tag
+                        v-for="tag in diagglist"
+                        :key="tag.icdcode"
+                        @close="removediagg(tag.icd10code)"
+                        type="warning"
+                        closable
+                        :disable-transitions="false"
+                      >
+                        {{ tag.icdname }}
+                      </el-tag>
+                      <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
+                    </el-form-item>
+                  </div>
+                </el-row>
+                <el-row v-if="form.appltype == 4">
+                  <el-col :span="20"
+                    ><el-form-item label="閫傜敤鎵嬫湳" prop="region">
+                      <el-select
+                        v-model="operationcodes"
+                        style="width: 400px"
+                        @remove-tag="removeopera"
+                        size="medium"
+                        :remote-method="remoteopcode"
+                        multiple
+                        filterable
+                        remote
+                        placeholder="璇烽�夋嫨鎵嬫湳"
+                      >
+                        <el-option
+                          class="ruleFormaa"
+                          v-for="item in baseoperaList"
+                          :key="item.opcode"
+                          :label="item.opdesc"
+                          :value="item.opcode"
+                        >
+                        </el-option>
+                      </el-select> </el-form-item
+                  ></el-col>
+                </el-row>
+                <el-row>
+                  <el-col :span="12"
+                    ><el-form-item label="寮�鍦虹櫧" prop="kcb">
+                      <el-input
+                        type="textarea"
+                        :rows="3"
+                        v-model="form.kcb"
+                        placeholder="璇疯緭鍏ュ紑鍦虹櫧"
+                      /> </el-form-item
+                  ></el-col>
+                  <el-col :span="12"
+                    ><el-form-item label="缁撴潫璇�" prop="jsy">
+                      <el-input
+                        type="textarea"
+                        :rows="3"
+                        v-model="form.jsy"
+                        placeholder="璇疯緭鍏ョ粨鏉熻"
+                      /> </el-form-item
+                  ></el-col>
+                </el-row>
               </el-form>
             </div>
           </div>
@@ -192,6 +368,7 @@
                       placeholder="璇风偣鍑诲彸渚ч�夋嫨"
                     />
                     <el-button
+                      style="margin-left: 10px"
                       type="primary"
                       icon="el-icon-edit"
                       @click="drawermb = true"
@@ -199,7 +376,7 @@
                     ></el-button>
 
                     <el-button
-                      v-if="form.libtemplateid"
+                      v-if="form.templatename"
                       type="success"
                       icon="el-icon-search"
                       @click="previewfnmb"
@@ -286,6 +463,7 @@
                         </el-option>
                       </el-select>
                     </el-col>
+
                     <el-col :span="1.5">
                       <el-button
                         type="primary"
@@ -293,12 +471,12 @@
                         icon="el-icon-plus"
                         size="medium"
                         :disabled="!patientqueryParams.allhosp"
-                        @click="handleAddpatient"
+                        @click="handleQuery"
                         >鏂板</el-button
                       >
                     </el-col>
 
-                    <el-col :span="1.5">
+                    <!-- <el-col :span="1.5">
                       <el-button
                         type="danger"
                         plain
@@ -308,7 +486,7 @@
                         @click="handleDelete"
                         >鍒犻櫎</el-button
                       >
-                    </el-col>
+                    </el-col> -->
 
                     <!-- <el-col :span="1.5"> </el-col> -->
                   </el-row>
@@ -317,20 +495,20 @@
                     @details="detailhz"
                     @handleUpdate="handleUpdate"
                     :currentList="overallCase"
-                    :tableLabel="tableLabelhz"
+                    :tableLabel="tableLabelhzwb"
                     :serialnumber="false"
                     :searchTrue="true"
                     :multiplechoice="false"
                     :controlxz="false"
                     :typeinfo="2"
                   />
-                  <pagination
+                  <!-- <pagination
                     v-show="total > 0"
                     :total="total"
                     :page.sync="topqueryParams.pageNum"
                     :limit.sync="topqueryParams.pageSize"
                     @pagination="getList"
-                  />
+                  /> -->
                 </el-row>
               </div>
             </div>
@@ -369,6 +547,18 @@
                   @keyup.enter.native="handleQuery"
                 ></el-input>
               </el-form-item>
+              <el-select
+                v-model="patientqueryParams.searchscope"
+                placeholder="璇烽�夋嫨鎮h�呰寖鍥�"
+              >
+                <el-option
+                  v-for="item in source"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
 
               <el-form-item>
                 <el-button
@@ -389,20 +579,18 @@
             <!-- 閫夋嫨鎮h�呭垪琛� -->
             <SFtable
               ref="multipleTable"
-              @handleUpdate="handleUpdate"
               @handleSelectionChange="handleSelectionChange"
               :currentList="patientuserList"
               :tableLabel="tableLabelhz"
+              :heights="600"
               :serialnumber="false"
               :center="false"
               :typeinfo="3"
             />
           </el-row>
           <pagination
-            v-show="patienttotal > 0"
+            v-show="patienttotal > 0 && this.patientqueryParams.allhosp != 6"
             :total="patienttotal"
-            :page.sync="patientqueryParams.pageNum"
-            :limit.sync="patientqueryParams.pageSize"
             @pagination="handleAddpatient"
           />
         </div>
@@ -414,69 +602,173 @@
         >
       </span>
     </el-dialog>
-    <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="60%">
-      <div class="preview-left">
-        <div v-for="item in questionList">
-          <!-- 鍗曢�� -->
-          <div
-            class="scriptTopic-dev"
-            :key="item.sort"
-            v-if="item.scriptType == 1"
-          >
-            <div class="dev-text">
-              {{ item.sort }}銆乕鍗曢�塢<span>{{ item.scriptContent }}</span>
-            </div>
-            <div class="dev-xx">
-              <el-radio-group v-model="item.remark">
-                <el-radio
-                  v-for="(items, index) in item.svyLibTemplateTargetoptions"
-                  :key="index"
-                  :label="index"
-                  >{{ items.optioncontent }}</el-radio
+    <!-- 妯℃澘棰勮 -->
+    <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="70%">
+      <el-tabs type="border-card">
+        <el-tab-pane label="妯℃澘鍩虹鏁版嵁"
+          ><div class="preview-left">
+            <el-form :model="objyl" label-width="100px" class="demo-objyl">
+              <el-row :gutter="10">
+                <el-col :span="14">
+                  <el-form-item label="闂嵎鍒嗙被" prop="categoryid">
+                    <el-select
+                      v-model="objyl.categoryid"
+                      size="medium"
+                      filterable
+                      placeholder="璇烽�夋嫨鍒嗙被"
+                    >
+                      <el-option-group
+                        v-for="group in optionsclass"
+                        :key="group.id"
+                        :label="group.name"
+                      >
+                        <el-option
+                          v-for="item in group.svyLibTemplateCategoryList"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="item.id"
+                        >
+                        </el-option>
+                      </el-option-group>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="10">
+                  <el-form-item label="璇勪环绫诲瀷" prop="scoreType">
+                    <el-select
+                      v-model="objyl.scoreType"
+                      placeholder="璇烽�夋嫨鍒嗙被"
+                    >
+                      <el-option
+                        v-for="group in appraiselist"
+                        :key="group.value"
+                        :label="group.label"
+                        :value="group.value"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row :gutter="20">
+                <el-col :span="14">
+                  <el-form-item label="鍙敤鐘舵��" prop="isenable">
+                    <el-radio-group v-model="objyl.isenable">
+                      <el-radio
+                        v-for="(item, index) in usable"
+                        :label="item.value"
+                        >{{ item.label }}</el-radio
+                      >
+                    </el-radio-group>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="鐗堟湰鍙�" prop="name">
+                    <el-input
+                      v-model="objyl.version"
+                      placeholder="榛樿1.0"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-form-item label="闂嵎鏍囬" prop="svyname">
+                <div style="width: 400px">
+                  <el-input v-model="objyl.svyname"></el-input>
+                </div>
+              </el-form-item>
+
+              <el-form-item label="闂嵎鎻忚堪" prop="description">
+                <el-input
+                  type="textarea"
+                  :rows="2"
+                  placeholder="璇疯緭鍏ュ唴瀹�"
+                  v-model="objyl.description"
                 >
-              </el-radio-group>
-            </div>
-          </div>
-          <!-- 澶氶�� -->
-          <div
-            class="scriptTopic-dev"
-            :key="item.sort"
-            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="qremark">
-                <el-checkbox
-                  v-for="(items, index) in item.svyLibTemplateTargetoptions"
-                  :key="index"
-                  :label="index"
+                </el-input
+              ></el-form-item>
+
+              <el-form-item label="闂嵎缁撴潫璇�" prop="conclusion">
+                <el-input
+                  type="textarea"
+                  :rows="2"
+                  placeholder="璇疯緭鍏ュ唴瀹�"
+                  v-model="objyl.conclusion"
                 >
-                  {{ items.optioncontent }}
-                </el-checkbox>
-              </el-checkbox-group>
-            </div>
-          </div>
-          <!-- 濉┖ -->
-          <div
-            class="scriptTopic-dev"
-            :key="item.sort"
-            v-if="item.scriptType == 4"
-          >
-            <div class="dev-text">
-              {{ item.sort }}銆乕闂瓟]<span>{{ item.scriptContent }}</span>
-            </div>
-            <div class="dev-xx">
-              <el-input placeholder="璇疯緭鍏ョ瓟妗�" v-model="radioas" clearable>
-              </el-input>
-            </div>
-          </div>
-        </div>
-      </div>
+                </el-input
+              ></el-form-item>
+            </el-form></div
+        ></el-tab-pane>
+        <el-tab-pane label="闂灞曠ず"
+          ><div class="preview-left">
+            <div v-for="item in questionList">
+              <!-- 鍗曢�� -->
+              <div
+                class="scriptTopic-dev"
+                :key="item.sort"
+                v-if="item.scriptType == 1"
+              >
+                <div class="dev-text">
+                  {{ item.sort }}銆乕鍗曢�塢<span>{{ item.scriptContent }}</span>
+                </div>
+                <div class="dev-xx">
+                  <el-radio-group v-model="item.remark">
+                    <el-radio
+                      v-for="(items, index) in item.svyLibTemplateTargetoptions"
+                      :key="index"
+                      :label="index"
+                      >{{ items.optioncontent }}</el-radio
+                    >
+                  </el-radio-group>
+                </div>
+              </div>
+              <!-- 澶氶�� -->
+              <div
+                class="scriptTopic-dev"
+                :key="item.sort"
+                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="qremark">
+                    <el-checkbox
+                      v-for="(items, index) in item.svyLibTemplateTargetoptions"
+                      :key="index"
+                      :label="index"
+                    >
+                      {{ items.optioncontent }}
+                    </el-checkbox>
+                  </el-checkbox-group>
+                </div>
+              </div>
+              <!-- 濉┖ -->
+              <div
+                class="scriptTopic-dev"
+                :key="item.sort"
+                v-if="item.scriptType == 4"
+              >
+                <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></div
+        ></el-tab-pane>
+      </el-tabs>
+
       <span slot="footer" class="dialog-footer">
-        <!-- <el-button @click="previewGo">鍓嶅線妯℃澘璇︽儏淇敼</el-button> -->
-        <el-button type="primary" @click="previewFn">纭浣跨敤</el-button>
+        <!-- <el-button @click="previewGo">淇濆瓨妯℃澘璇︽儏淇敼</el-button> -->
+        <el-button type="primary" @click="Departmenttreatment"
+          >淇濆瓨浣跨敤</el-button
+        >
       </span>
     </el-dialog>
     <el-drawer
@@ -502,7 +794,7 @@
               <el-form-item label="闂嵎鍚嶇О">
                 <el-input v-model="topqueryParams.svyname"></el-input>
               </el-form-item>
-              <el-form-item label="閫傜敤褰㈠紡" prop="status">
+              <!-- <el-form-item label="閫傜敤褰㈠紡" prop="status">
                 <el-select v-model="topqueryParams.topica" placeholder="璇烽�夋嫨">
                   <el-option
                     v-for="item in taskoptions"
@@ -512,7 +804,7 @@
                   >
                   </el-option>
                 </el-select>
-              </el-form-item>
+              </el-form-item> -->
               <el-form-item>
                 <el-button
                   type="primary"
@@ -551,6 +843,13 @@
         </div>
       </div>
     </el-drawer>
+    <Optional-Form
+      ref="child"
+      :dialogVisiblepatient="dialogVisiblepatientjb"
+      :overallCase="diagglist"
+      @addoption="dialogVisiblepatientjb = false"
+      @kkoption="dialogVisiblepatientjb = true"
+    />
   </div>
 </template>
 
@@ -558,19 +857,30 @@
 import { messagelistpatient } from "@/api/patient/homepage";
 import store from "@/store";
 import {
-  getTaskpatient,
-  getlibrarylist,
-  getFollowuplist,
+  getTaskpatientQC,
+  taskoperhospgetsondel,
+  taskdiaghospgetsondel,
+  getillnesslist,
+  getbaseopera,
+  Externallist,
   getQtemplatelist,
+  getQtemplateobj,
   TaskQuestioncomit,
-  Questionnairetaskget,
-  gethetaskinfo,
-  delhetaskinfo,
+  deleteTaskQuestioncomit,
+  Questionnairetaskgetson,
+  getTaskQuestioncomit,
+  depthospgetson,
+  getillness,
   Editsingletask,
+  getQtemplateclassify,
+  taskdepthospgetsondel,
+  taskdepthospgetsonlist,
+  taskdiaggetlist,
+  taskopergetlist,
 } from "@/api/AiCentre/index";
-import { listDept } from "@/api/system/dept";
-
+import OptionalForm from "@/components/OptionalForm"; //姝e垯缁勪欢
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
+import { MessageBox } from "element-ui";
 
 export default {
   name: "ServiceDetails",
@@ -581,8 +891,14 @@
       id: "", //
       previewid: "", //浠诲姟妯℃澘浼犻�抜d
       libName: "",
+      templateor: false,
+      objyl: {},
       overallCase: [], //閫夋嫨鎮h�呮��
       allpids: [],
+      appraiselist: [],
+      optionsclass: [],
+      illnesslist: [],
+      mode: [],
       libId: null, //妯℃澘搴撴ā鏉縤d
       Editprogress: 1, //缂栬緫杩涘害
       drawermb: false, //閫夋嫨妯℃澘寮圭獥
@@ -590,25 +906,56 @@
       loading: false, // 閬僵灞�
       patientloading: false, // 閬僵灞�
       dialogVisiblepatient: false, //娣诲姞鎮h�呭脊妗�
+      dialogVisiblepatientjb: false, //娣诲姞鐤剧梾寮规
+      deptcodesWards: [], //绉戝鏁版嵁
+      leavehospitaldistrictcodes: [], //鐥呭尯鏁版嵁
+      operationcodes: [], //鎵嬫湳鏁版嵁
+      illnesscodes: [], //鐤剧梾鏁版嵁
       radio: 1,
       checkboxlist: [],
       tableLabel: [],
       questionList: [],
+      donorchargeList: [],
+      baseoperaList: [],
+      usable: [
+        { value: "0", label: "鍙敤" },
+        { value: "1", label: "鍋滅敤" },
+      ],
+      required: [
+        { value: "1", label: "蹇呭~" },
+        { value: "2", label: "涓嶅繀濉�" },
+      ],
+      props: { multiple: true, value: "deptCode", label: "deptName" },
+      propstask: { value: "deptCode", label: "deptName" },
       // 鎮h�呰〃鍗�
       tableLabelhz: [
+        { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "inhosptime" },
         { label: "鎮h��", width: "", prop: "name" },
         { label: "韬唤璇�", width: "200", prop: "idcardno" },
         { label: "鎬у埆", width: "", prop: "sex" },
         { label: "骞撮緞", width: "", prop: "age" },
-        { label: "鍖荤敓", width: "", prop: "drname" },
-        { label: "绉戝", width: "", prop: "deptName" },
-        { label: "灏辫瘖/鍑洪櫌鏃ユ湡", width: "280", prop: "inhosptime" },
+        { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" },
+        { label: "涓绘不鍖荤敓", width: "", prop: "drname" },
+        { label: "绉戝", width: "240", prop: "dept" },
+        { label: "鐥呭尯", width: "240", prop: "leavehospitaldistrictname" },
+      ],
+      // 鎮h�呰〃鍗�
+      tableLabelhzwb: [
+        { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
+        { label: "鎮h��", width: "", prop: "name" },
+        { label: "韬唤璇�", width: "200", prop: "sfzh" },
+        { label: "鎬у埆", width: "", prop: "sex" },
+        { label: "骞撮緞", width: "", prop: "age" },
+        { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
+        { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" },
+        { label: "涓绘不鍖荤敓", width: "", prop: "drname" },
+        { label: "绉戝", width: "180", prop: "deptName" },
+        { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
       ],
 
       tableLabelwj: [
-        { label: "搴忓彿", width: "", prop: "svyid" },
-        { label: "闂嵎鍚嶇О", width: "", prop: "svyname" },
-        { label: "闂嵎姒傝堪", width: "", prop: "description" },
+        { label: "闂嵎鏍囬", width: "", prop: "svyname" },
+        { label: "闂嵎鎻忚堪", width: "", prop: "description" },
         { label: "淇敼鏃ユ湡", width: "", prop: "updateTime" },
         { label: "鍒涘缓浜�", width: "", prop: "createBy" },
       ],
@@ -621,7 +968,7 @@
       preachform: [
         { label: "澶氬獟浣�", value: 1 },
         { label: "绾歌川", value: 2 },
-        { label: "鐢佃瘽", value: 3 },
+        { label: "鏅鸿兘璇煶", value: 3 },
         { label: "鐭俊", value: 4 },
         { label: "寰俊鍏紬鍙�", value: 5 },
         { label: "寰俊灏忕▼搴�", value: 6 },
@@ -642,7 +989,7 @@
         pageNum: 1, //
         pageSize: 10,
       },
-      checkList: [],
+      checkList: "",
       deliverytopqueryParams: {
         pageNum: 1, //
         pageSize: 10,
@@ -650,6 +997,9 @@
       patientqueryParams: {
         pageNum: 1, //
         pageSize: 10,
+        topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
+        leavehospitaldistrictcodes: [],
+        leaveldeptcodes: [],
       },
       topicoptions: [{ children: [{ children: [] }] }],
       showSearch: true, //
@@ -668,6 +1018,10 @@
       patientuserList: [], //閫夋嫨鎮h�呭垪琛�
       sonuserList: [], //閫変腑鎮h�呭垪琛�
       delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
+      longtype: [
+        { value: 0, label: "鑷畾涔夊懆鏈�" },
+        { value: 1, label: "闀挎湡浠诲姟" },
+      ],
       variableList: [
         {
           name: "濮撳悕",
@@ -682,7 +1036,7 @@
           default: true,
         },
         {
-          name: "鐢佃瘽",
+          name: "鏅鸿兘璇煶",
           value: "${dhh}",
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
@@ -702,7 +1056,7 @@
           default: true,
         },
         {
-          name: "鐢佃瘽",
+          name: "鏅鸿兘璇煶",
           value: "${dhh}",
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
@@ -714,14 +1068,21 @@
       form: {
         patTaskRelevances: [],
         sendType: 1,
+        longTask: 0,
         templatename: "",
         templateid: null,
         libtemplateid: null,
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄櫙瀹佷汉姘戝尰闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瑙傜湅杩欎唤瀹f暀璧勮銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       },
       taskoptions: [
         {
           value: "1",
           label: "鍑洪櫌鐥呬汉",
+        },
+        {
+          value: "4",
+          label: "鍦ㄩ櫌鐥呬汉",
         },
         {
           value: "2",
@@ -731,11 +1092,34 @@
           value: "3",
           label: "浣撴鐥呬汉",
         },
+        {
+          value: "6",
+          label: "闄㈠鎮h��",
+        },
+        {
+          value: "5",
+          label: "鎵嬫湳鐥呬汉",
+        },
       ],
+      source: [
+        {
+          value: 0,
+          label: "鎵�灞炴偅鑰�",
+        },
+        {
+          value: 1,
+          label: "绉戝鎮h��",
+        },
+        {
+          value: 2,
+          label: "鐥呭尯鎮h��",
+        },
+      ],
+
       tasktypes: [
         {
           value: 1,
-          label: "鐩戞祴璇勪及",
+          label: "蹇冪數闅忚",
         },
         {
           value: 2,
@@ -743,7 +1127,7 @@
         },
         {
           value: 3,
-          label: "闂ㄨ瘖闅忚",
+          label: "褰卞儚闅忚",
         },
         {
           value: 4,
@@ -751,22 +1135,27 @@
         },
         {
           value: 5,
-          label: "澶嶈瘖绠$悊",
+          label: "浣撴闅忚",
         },
         {
-          value: 6,
-          label: "婊℃剰搴﹁皟鏌�",
+          value: 11,
+          label: "鍖绘妧闅忚",
         },
         {
-          value: 7,
-          label: "鎮h�呮姤鍛�",
-        },
-
-        {
-          value: 8,
-          label: "鍏朵粬閫氱煡",
+          value: 10,
+          label: "涓撶闅忚",
         },
       ],
+      // 绉戝/鐥呭尯
+      belongWards: [],
+      deptlist: [],
+      hosplist: [],
+      diagglist: [],
+      operlist: [],
+      tempDetpRelevanceslist: [], //绉戝鏁版嵁
+      tempDetpRelevanceslistform: [], //绉戝鏁版嵁
+      tempbelongWards: [], //鐥呭尯鏁版嵁
+      tempbelongWardsform: [], //鐥呭尯鏁版嵁
       rules: {
         taskName: [
           { required: true, message: "浠诲姟鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
@@ -777,43 +1166,63 @@
             trigger: "blur",
           },
         ],
-        taskDesc: [
-          { required: true, message: "浠诲姟鎻忚堪涓嶈兘涓虹┖", trigger: "blur" },
-        ],
         sendType: [
           { required: true, message: "鍙戦�佽缃笉鑳戒负绌�", trigger: "blur" },
         ],
+        deptcode: [
+          { required: true, message: "閫傜敤绉戝涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        // leavehospitaldistrictcode: [
+        //   { required: true, message: "閫傜敤鐥呭尯涓嶈兘涓虹┖", trigger: "blur" },
+        // ],
       },
+      belongDepts: [],
+      // 绉戝闄㈠尯鏌ヨ鍏ュ弬
+      queryParamsdept: {},
       quote: false,
       serviceType: null,
     };
   },
-  components: { SFtable },
+  components: { SFtable, OptionalForm },
 
   created() {
+    this.appraiselist = store.getters.appraiselist;
+    this.belongWards = store.getters.belongWards;
+    this.belongDepts = store.getters.belongDepts;
+    this.mode = store.getters.Askmode;
     this.id = this.$route.query.id;
+    this.newadd = this.$route.query.newadd;
     this.form.type = this.$route.query.type;
     this.form.typename = this.$route.query.typename;
     this.serviceType = Number(this.$route.query.serviceType);
     this.form.serviceType = Number(this.$route.query.serviceType);
-    this.listDept();
     this.Acquisitiontype();
+    this.getillnesslist();
     this.Getdetails();
+    this.getQtemplateclassify();
   },
   activated() {
     if (this.id != this.$route.query.id) {
-      this.listDept();
       this.Acquisitiontype();
       this.Getdetails();
+      this.getQtemplateclassify();
     }
   },
-
+  computed: {
+    displayedTags() {
+      // 杩斿洖鍓�10涓猼ag
+      return this.illnesslist.slice(0, 10);
+    },
+    hasMore() {
+      // 鍒ゆ柇鏄惁鏈夋洿澶氱殑tag
+      return this.illnesslist.length > 10;
+    },
+    remaining() {
+      // 璁$畻鍓╀綑鐨則ag鏁伴噺
+      return this.illnesslist.length - 10;
+    },
+  },
   methods: {
-    // {
-    //   濮撳悕: { "${name}": "榫欏偛澶�" },
-    //   鍦板潃: { "${dzz}": "榫欏" },
-    //   鐢佃瘽: { "${dhh}": "鍏釜鍏�" },
-    // }
     // 鍙橀噺杞崲瀵硅薄杞暟缁�
     convertFormat1ToFormat2(data) {
       let result = [];
@@ -842,7 +1251,7 @@
       let queryParams = {
         pageNum: this.topqueryParams.pageNum,
         pageSize: this.topqueryParams.pageSize,
-        isavailable: "",
+        isenable: "",
       };
       this.currenttype = this.$route.query.type;
       this.title = "闂嵎鍐呭鍒楄〃";
@@ -859,15 +1268,20 @@
             label: "绾歌川",
           },
           {
+            value: "4",
+            label: "鐭俊",
+          },
+          {
             value: "5",
             label: "寰俊鍏紬鍙�",
           },
+          { label: "寰俊灏忕▼搴�", value: 6 },
         ];
       } else if (this.form.serviceType == 6) {
         this.checkboxlist = [
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
@@ -882,12 +1296,17 @@
             label: "寰俊灏忕▼搴�",
           },
 
-          {
-            value: "8",
-            label: "鏅鸿兘鏈哄櫒浜�",
-          },
+          // {
+          //   value: "8",
+          //   label: "鏅鸿兘鏈哄櫒浜�",
+          // },
         ];
-      } else if (this.form.serviceType == 7) {
+      } else if (
+        this.form.serviceType == 7 ||
+        this.form.serviceType == 10 ||
+        this.form.serviceType == 11 ||
+        this.form.serviceType == 9
+      ) {
         this.checkboxlist = [
           {
             value: "1",
@@ -899,7 +1318,7 @@
           },
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
@@ -913,8 +1332,17 @@
             value: "6",
             label: "寰俊灏忕▼搴�",
           },
+          {
+            value: "7",
+            label: "鏈悗闅忚",
+          },
         ];
-      } else if (this.form.serviceType == 2 || this.form.serviceType == 3) {
+      } else if (
+        this.form.serviceType == 2 ||
+        this.form.serviceType == 3 ||
+        this.form.serviceType == 5 ||
+        this.form.serviceType == 4
+      ) {
         this.checkboxlist = [
           {
             value: "1",
@@ -922,7 +1350,7 @@
           },
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
@@ -937,10 +1365,10 @@
             label: "寰俊灏忕▼搴�",
           },
 
-          {
-            value: "8",
-            label: "鏅鸿兘鏈哄櫒浜�",
-          },
+          // {
+          //   value: "8",
+          //   label: "鏅鸿兘鏈哄櫒浜�",
+          // },
         ];
       }
       getQtemplatelist(this.topqueryParams).then((response) => {
@@ -970,26 +1398,61 @@
           xh: 1,
         },
       ];
-      if (this.checkList[0]) {
-        this.form.preachform = this.checkList.join(",");
+      if (this.form.appltype == 1) {
+        this.leavehospitaldistrictcodes = [];
+        this.operationcodes = [];
+        this.illnesscodes = [];
+      } else if (this.form.appltype == 2) {
+        this.deptcodesWards = [];
+        this.operationcodes = [];
+        this.illnesscodes = [];
+      } else if (this.form.appltype == 3) {
+        this.deptcodesWards = [];
+        this.leavehospitaldistrictcodes = [];
+        this.operationcodes = [];
+      } else if (this.form.appltype == 4) {
+        this.deptcodesWards = [];
+        this.illnesscodes = [];
+        this.leavehospitaldistrictcodes = [];
+      }
+      if (this.checkList) {
+        this.form.preachform = this.checkList;
       } else {
         this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
         return;
       }
-      if (!this.form.patTaskRelevances[0]) {
+      console.log(this.operationcodes[0]);
+      console.log(this.operationcodes);
+
+      if (
+        this.deptcodesWards[0] ||
+        this.leavehospitaldistrictcodes[0] ||
+        this.diagglist[0] ||
+        this.operationcodes[0]
+      ) {
+      } else {
+        this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
+        return;
+      }
+
+      if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
         this.$modal.msgError("璇烽�夋嫨鐥呬汉");
         return;
       }
-      if (!this.form.templatename) {
+
+      if (!this.form.templatename && !this.templateor) {
         this.$modal.msgError("鏈�夋嫨妯℃澘");
         return;
       }
+
       if ((this.form.sendType == 1 && this.time1) || this.form.sendType == 2) {
-      } else if (this.form.sendType == 3 && this.time4) {
+      } else if (
+        (this.form.sendType == 3 && this.time4) ||
+        this.form.longTask
+      ) {
       } else {
         return this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
       }
-
       const filteredArray = this.variableList.filter(
         (item) =>
           item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
@@ -1004,12 +1467,19 @@
         this.form.type = this.$route.query.type;
       }
       this.form.serviceType = this.serviceType;
+      this.form.deptcode = this.deptcodesWards.join(",");
+      this.form.leavehospitaldistrictcode =
+        this.leavehospitaldistrictcodes.join(",");
+      this.form.opcode = this.operationcodes.join(",");
+      this.form.icd10code = this.diagglist
+        .map((item) => item.icdcode)
+        .join(",");
       Editsingletask(this.form).then((res) => {
         if (res.code == 200) {
           if (this.form.taskid) {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-          } else {
             this.$modal.msgSuccess("淇敼鎴愬姛");
+          } else {
+            this.$modal.msgSuccess("鏂板鎴愬姛");
           }
           this.$router.push({
             path: "/followvisit/tasklist",
@@ -1018,19 +1488,31 @@
         }
       });
     },
-    // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
 
-    // 纭閫夋嫨妯℃澘鏀惧叆浠诲姟妯℃澘
+    // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
+    // 閫夋嫨棰勮
     selectfn(row, type) {
       // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
       if (type == 1) {
         this.libName = row.svyname;
         this.libId = row.svyid;
-        this.Tasktemplate = row;
         this.questionList = row.svyTemplateLibScripts;
-        console.log(row.svyTemplateLibScripts);
+        getQtemplateobj({ svyid: row.svyid }).then((res) => {
+          if (res.code == 200) {
+            this.objyl = res.rows[0];
+            if (this.form.longTask) {
+              this.objyl.longTemp = 1;
+            }
 
-        this.previewtf = true;
+            this.tempDetpRelevanceslist = [];
+            this.tempbelongWards = [];
+            this.objyl.suitway = this.objyl.suitway.split(",");
+            this.questionList = res.rows[0].svyTemplateLibScripts;
+            this.getillness(row.svyid);
+            this.previewtf = true;
+          }
+        });
+        console.log(row.svyTemplateLibScripts);
         this.previewid = row.svyid;
         this.Variablehandling(row.svyTemplateLibScripts, 1);
       } else if (type == 2) {
@@ -1039,15 +1521,73 @@
     },
     // 棰勮
     previewfnmb() {
-      console.log(this.form);
-
-      getQtemplatelist({ svyid: this.form.libtemplateid }).then((res) => {
+      getTaskQuestioncomit(this.form.templateid).then((res) => {
         if (res.code == 200) {
-          console.log();
-          this.questionList = res.rows[0].svyTemplateLibScripts;
+          console.log(res, "棰勮鏁版嵁");
+          this.objyl = res.data;
+          if (this.objyl.suitway)
+            this.objyl.suitway = this.objyl.suitway.split(",");
+
+          this.getillness(this.form.libtemplateid);
+
           this.previewtf = true;
+          getQtemplateobj({ svyid: this.form.libtemplateid }).then((res) => {
+            if (res.code == 200) {
+              this.questionList = res.rows[0].svyTemplateLibScripts;
+              this.objyl.svyTemplateLibScripts =
+                res.rows[0].svyTemplateLibScripts;
+            }
+          });
         }
       });
+    },
+    getillness(id) {
+      if (id) {
+        getillness({ outid: id, type: 5 }).then((res) => {
+          this.illnesslist = res.rows;
+          this.illnesslist.forEach((item) => {
+            item.icdname = item.icd10name;
+          });
+        });
+      }
+    },
+    getillnesslist() {
+      getillnesslist({
+        pageNum: 1,
+        pageSize: 1000,
+      }).then((res) => {
+        this.donorchargeList = res.rows;
+      });
+      getbaseopera({
+        pageNum: 1,
+        pageSize: 1000,
+      }).then((res) => {
+        this.baseoperaList = res.rows;
+      });
+    },
+    // 鎵嬫湳鏌ヨ
+    remoteopcode(name) {
+      if (name) {
+        getillnesslist({
+          pageNum: 1,
+          pageSize: 1000,
+          icdname: name,
+        }).then((res) => {
+          this.donorchargeList = res.rows;
+        });
+      }
+    },
+    // 鐤剧梾鏌ヨ
+    remotedonor(name) {
+      if (name) {
+        getbaseopera({
+          pageNum: 1,
+          pageSize: 1000,
+          opdesc: name,
+        }).then((res) => {
+          this.baseoperaList = res.rows;
+        });
+      }
     },
     // 澶勭悊闂灞傚彉閲�
     Variablehandling(arr, type) {
@@ -1066,7 +1606,6 @@
             }
           });
         });
-        console.log(Variablist, "Variablist");
         const Aarr = Variablist.filter(
           (obj, index, self) =>
             index ===
@@ -1079,42 +1618,79 @@
     },
     // 瀛愪换鍔′簩绾у脊妗�
     handleAddpatient(row) {
-      console.log(this.overallCase, "ssaaa");
       this.allpids = [];
       this.overallCase.forEach((item) => {
         this.allpids.push(item.patid);
       });
-      if (this.patientqueryParams.allhosp == 1) {
+      if (
+        this.patientqueryParams.allhosp == 1 ||
+        (this.patientqueryParams.allhosp == 1 &&
+          this.patientqueryParams.cry == 1)
+      ) {
         this.tableLabelhz = [
+          // { label: "鍏ラ櫌鏃ユ湡", width: "170", prop: "starttime" },
+          { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
           { label: "鎮h��", width: "", prop: "name" },
           { label: "韬唤璇�", width: "200", prop: "idcardno" },
           { label: "鎬у埆", width: "", prop: "sex" },
           { label: "骞撮緞", width: "", prop: "age" },
+          { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
+          { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" },
           { label: "鍖荤敓", width: "", prop: "drname" },
-          { label: "绉戝", width: "", prop: "deptName" },
-          { label: "灏辫瘖/鍑洪櫌鏃ユ湡", width: "280", prop: "inhosptime" },
+          { label: "绉戝", width: "180", prop: "dept" },
+          { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
         ];
-      } else if (this.patientqueryParams.allhosp == 2) {
+      } else if (this.patientqueryParams.allhosp == 4) {
         this.tableLabelhz = [
+          { label: "鍏ラ櫌鏃ユ湡", width: "150", prop: "starttime" },
           { label: "鎮h��", width: "", prop: "name" },
+          { label: "韬唤璇�", width: "200", prop: "idcardno" },
           { label: "鎬у埆", width: "", prop: "sex" },
           { label: "骞撮緞", width: "", prop: "age" },
-          { label: "璇婃柇", width: "", prop: "diagname" },
-          { label: "灏辫瘖绉戝", width: "", prop: "deptName" },
-          { label: "鍏ラ櫌鏃ユ湡", width: "", prop: "inhosptime" },
-          { label: "鍒涘缓浜�", width: "", prop: "createBy" },
+          { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
+          { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" },
+          { label: "鍖荤敓", width: "", prop: "drname" },
+          { label: "绉戝", width: "180", prop: "dept" },
+          { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
         ];
       }
       if (this.allpids[0]) {
         this.patientqueryParams.pids = this.allpids;
-        console.log(this.patientqueryParams.pids);
       } else {
         this.patientqueryParams.pids = null;
       }
+      // 绫诲瀷鍒ゆ柇
+      if (this.patientqueryParams.allhosp == 1) {
+        this.patientqueryParams.cry = 1;
+      } else if (this.patientqueryParams.allhosp == 4) {
+        this.patientqueryParams.cry = 0;
+        this.patientqueryParams.allhosp = "1";
+      }
+      // 鏉ユ簮鍒ゆ柇
 
-      getTaskpatient(this.patientqueryParams).then((response) => {
-        console.log(response);
+      if (this.patientqueryParams.searchscope == 1) {
+        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
+          (obj) => obj.deptCode
+        );
+        this.patientqueryParams.leavehospitaldistrictcodes = [];
+      } else if (this.patientqueryParams.searchscope == 2) {
+        this.patientqueryParams.leavehospitaldistrictcodes =
+          store.getters.belongWards.map((obj) => obj.districtCode);
+        this.patientqueryParams.leaveldeptcodes = [];
+      } else {
+        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
+          (obj) => obj.deptCode
+        );
+        this.patientqueryParams.leavehospitaldistrictcodes =
+          store.getters.belongWards.map((obj) => obj.districtCode);
+      }
+      getTaskpatientQC(this.patientqueryParams).then((response) => {
         this.patientuserList = response.rows;
+        this.patientuserList.forEach((item) => {
+          if (item.endtime) {
+            item.endDay = this.daysBetween(item.endtime);
+          }
+        });
         this.patienttotal = response.total;
         this.loading = false;
         this.Restorecheck();
@@ -1124,11 +1700,9 @@
     handleUpdate() {},
     handleDelete() {},
     handleExport() {},
-
     // 閫夋嫨鎮h�呰〃鏁版嵁
     handleSelectionChange(selection) {
-      console.log("澶氶�夋偅鑰�");
-      this.SelectPatientslist = selection;
+      this.SelectPatientslist = structuredClone(selection);
       this.multiple = !selection.length;
 
       // 璧嬪�肩粰鏁翠綋閫変腑鏁扮粍
@@ -1138,6 +1712,14 @@
           item.isoperation = 1;
           item.patid = item.id;
           item.hospType = this.patientqueryParams.allhosp;
+          item.sfzh = item.idcardno;
+          item.deptCode = item.deptcode;
+          item.deptName = item.dept;
+          item.admindate = item.inhosptime;
+          item.sfzh = item.idcardno;
+          if (this.patientqueryParams.allhosp == 6) {
+            item.patfrom = 1;
+          }
           this.overallCase.push(item);
           this.form.patTaskRelevances.push(item);
         }
@@ -1145,15 +1727,12 @@
     },
     // 鍒囨崲椤靛悗鎭㈠閫変腑
     Restorecheck() {
-      console.log(this.overallCase, "this.overallCase");
       const allid = this.overallCase.map((item) => item.patid);
       const overlap = this.patientuserList.filter((value) => {
         return allid.includes(value.patid);
       });
       // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬�
       this.SelectPatientslist = overlap;
-      console.log(this.SelectPatientslist, "杩涘叆鍒嗛〉SelectPatientslist");
-
       this.toggleSelection(overlap);
     },
     // 鎸傝浇閫夋嫨鐘舵��
@@ -1166,7 +1745,6 @@
           });
           this.decision = false;
         });
-        console.log(123);
       } else {
         this.$refs.multipleTable.clearSelection();
       }
@@ -1179,14 +1757,74 @@
           let indexa = this.overallCase.indexOf(row);
           let indexb = this.form.patTaskRelevances.indexOf(row);
           this.overallCase.splice(indexa, 1);
-          this.form.patTaskRelevances[indexb].isoperation = 3;
+          if (!this.form.taskid) {
+            this.form.patTaskRelevances.splice(indexa, 1);
+          } else {
+            this.form.patTaskRelevances[indexb].isoperation = 3;
+          }
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         });
     },
     getList() {},
     handleQuery() {
+      // 鑾峰彇澶栭儴鎮h��
+      console.log(this.patientqueryParams.allhosp, "aaalll");
+
+      if (this.patientqueryParams.allhosp == 6) {
+        this.Externallist();
+        console.log();
+
+        return;
+      }
+      if (this.patientqueryParams.topica == 0) {
+        this.patientqueryParams.leavehospitaldistrictcodes =
+          store.getters.leavehospitaldistrictcodes;
+        this.patientqueryParams.leaveldeptcodes = store.getters.leaveldeptcodes;
+      } else if (this.patientqueryParams.topica == 1) {
+        this.patientqueryParams.leavehospitaldistrictcodes = null;
+        this.patientqueryParams.leaveldeptcodes = store.getters.leaveldeptcodes;
+      } else if (this.patientqueryParams.topica == 2) {
+        this.patientqueryParams.leavehospitaldistrictcodes =
+          store.getters.leavehospitaldistrictcodes;
+        this.patientqueryParams.leaveldeptcodes = null;
+      }
+
+      if (
+        !this.patientqueryParams.leavehospitaldistrictcodes ||
+        !this.patientqueryParams.leavehospitaldistrictcodes[0]
+      )
+        this.patientqueryParams.leavehospitaldistrictcodes = null;
+      if (
+        !this.patientqueryParams.leaveldeptcodes ||
+        !this.patientqueryParams.leaveldeptcodes[0]
+      )
+        this.patientqueryParams.leaveldeptcodes = null;
       this.handleAddpatient();
     },
+    // 鑾峰彇澶栭儴鎮h�呭鍏ュ垪琛�
+    Externallist() {
+      this.tableLabelhz = [
+        { label: "鎮h��", width: "", prop: "name" },
+        { label: "韬唤璇�", width: "200", prop: "idcardno" },
+        { label: "鎬у埆", width: "", prop: "sex" },
+        { label: "骞撮緞", width: "", prop: "age" },
+        { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
+      ];
+      this.patientqueryParams.pageSize = 1000;
+
+      Externallist(this.patientqueryParams).then((response) => {
+        this.patientuserList = response.rows;
+        this.patientuserList.forEach((item) => {
+          if (item.endtime) {
+            item.endDay = this.daysBetween(item.endtime);
+          }
+        });
+        this.dialogVisiblepatient = true;
+        this.patienttotal = response.total;
+        this.loading = false;
+      });
+    },
+
     resetQuery() {},
     handleQuerymb() {
       getQtemplatelist(this.topqueryParams).then((response) => {
@@ -1215,13 +1853,17 @@
       this.form = {
         patTaskRelevances: [],
         sendType: 1,
+        sendDay: 5,
         templatename: "",
         templateid: null,
         libtemplateid: null,
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄櫙瀹佷汉姘戝尰闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       };
+
       this.questionList = [];
       if (this.id) {
-        Questionnairetaskget({ taskid: this.id }).then((res) => {
+        Questionnairetaskgetson({ taskid: this.id }).then((res) => {
           let filteredArray = "";
           if (res.code == 200) {
             this.form = res.data;
@@ -1230,36 +1872,157 @@
               ? this.form.patTaskRelevances
               : [];
             this.overallCase = this.form.patTaskRelevances.concat();
-            this.checkList = this.form.preachform.split(",");
-            console.log(this.form, "this.form");
+            this.checkList = this.form.preachform;
+
+            this.overallCase.forEach((item) => {
+              if (item.endtime) {
+                item.endDay = this.daysBetween(item.endtime);
+              }
+            });
             if (this.form.showDate)
               this.daytime = this.form.showDate.split(",");
             if (this.form.showTimeMorn) {
               if (this.form.sendType == 3) {
                 this.time4 = this.form.showTimeMorn;
-                console.log(1122);
               } else {
                 this.time1 = this.form.showTimeMorn.split(",");
               }
+            }
+            // 鑾峰彇浠诲姟绉戝
+            if (this.form.taskid) {
+              this.listDept();
             }
             if (this.form.showTimeNoon)
               this.time2 = this.form.showTimeNoon.split(",");
             if (this.form.showTimeNight)
               this.time3 = this.form.showTimeNight.split(",");
-            console.log(1122);
             filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
             this.variableList = this.transitionList.concat(filteredArray);
           } else {
             this.$modal.msgError(res.code);
           }
+
+          if (this.newadd) {
+            this.neWaddfn();
+          }
         });
       }
     },
-    // 鑾峰彇绉戝鍒楄〃
+    // 渚濈収鏂板鏃跺鐞�
+    neWaddfn() {
+      this.id = null;
+      this.form.taskName = "";
+      this.form.taskid = null;
+      this.overallCase = [];
+      this.form.patTaskRelevances = [];
+      this.daytime = []; //鏃ユ湡
+      this.applydaytime = []; //璁$畻鏃ユ湡
+      this.time1 = ""; //涓婂崍鏃堕棿娈�
+      this.time2 = ""; //涓嬪崍鏃堕棿娈�
+      this.time3 = ""; //鏅氫笂鏃堕棿娈�
+      this.time4 = ""; //鏅氫笂鏃堕棿娈�
+    },
+    // 鑾峰彇鍚勭被
     listDept() {
-      listDept().then((res) => {
-        this.topicoptions = this.handleTree(res.data, "deptId");
-        console.log(this.topicoptions, "topicoptions");
+      this.leavehospitaldistrictcodes = [];
+      this.deptcodesWards = [];
+      this.queryParamsdept.taskId = this.form.taskid;
+      taskdepthospgetsonlist(this.queryParamsdept).then((res) => {
+        if (res.code == 200) {
+          let arr = res.rows;
+          arr.forEach((item) => {
+            if (item.deptType == 1) {
+              this.deptlist.push(item);
+              this.deptcodesWards.push(item.deptCode);
+            } else if (item.deptType == 2) {
+              this.hosplist.push(item);
+              this.leavehospitaldistrictcodes.push(item.deptCode);
+            }
+          });
+        }
+      });
+      taskdiaggetlist(this.queryParamsdept).then((res) => {
+        if (res.code == 200) {
+          let arr = res.rows;
+          arr.forEach((item) => {
+            getillnesslist({
+              icdcode: item.icd10code,
+            }).then((res) => {
+              item.icdname = res.rows[0].icdname;
+            this.diagglist.push(item);
+            });
+            this.illnesscodes.push(item.icd10code);
+          });
+        }
+      });
+      taskopergetlist(this.queryParamsdept).then((res) => {
+        if (res.code == 200) {
+          let arr = res.rows;
+          arr.forEach((item) => {
+            this.operlist.push(item);
+            this.operationcodes.push(item.opcode);
+          });
+        }
+      });
+    },
+    // 浠诲姟绉戝鍒犻櫎瑙﹀彂
+    removetag(row) {
+      let result = this.deptlist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+    // 闄㈠尯鍒犻櫎鍒犻櫎瑙﹀彂
+    removehpsp(row) {
+      let result = this.hosplist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+    // 鎵嬫湳鍒犻櫎瑙﹀彂
+    removeopera(row) {
+      let result = this.operlist
+        .filter((item) => item.opcode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskoperhospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+    // 鐤剧梾鍒犻櫎瑙﹀彂
+    removediagg(row) {
+      let result = this.diagglist
+        .filter((item) => item.icd10code == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdiaghospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.diagglist=this.diagglist.filter(item => item.icd10code != row);
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+
+    getQtemplateclassify() {
+      getQtemplateclassify({}).then((res) => {
+        this.optionsclass = res.rows;
       });
     },
     // 鏂板娲鹃�佹偅鑰�
@@ -1276,18 +2039,15 @@
       this.variableList.splice(index, 1);
       row.isoperation = 3;
       this.delvariableList.push(row);
-      console.log(index, row);
     },
+
     // 鏃堕棿----------
     changeTime(row) {
-      console.log(row, "鏃堕棿");
       this.processingTime();
     },
     Totaldate(row) {
-      console.log(row, "鏃堕棿");
       this.form.sendTimeslot = [{ begantime: row, endtime: row, xh: 1 }];
       this.form.showTimeMorn = row;
-      console.log(this.form.sendTimeslot, "鏃堕棿");
     },
     changeTimeday(row) {
       const startDate = new Date(row[0]);
@@ -1356,54 +2116,105 @@
         query: { id: this.previewid, task: true, data: this.form },
       });
     },
+    // 淇濆瓨/鏇存柊浠诲姟妯℃澘
     previewFn() {
-      let id = this.Tasktemplate.id;
-      this.Tasktemplate.id = null;
-      console.log(this.Tasktemplate);
+      if (Array.isArray(this.objyl.suitway)) {
+        this.objyl.suitway = this.objyl.suitway.join(",");
+      }
+      this.objyl.templateid = this.objyl.svyid;
 
-      this.Tasktemplate.svyTemplateLibScripts.forEach((item) => {
-        item.svyTaskTemplateTargetoptions = item.svyLibTemplateTargetoptions;
+      this.objyl.isoperation = 1;
+      this.objyl.taskid = this.form.taskid;
+
+      if (this.objyl.id) {
+        deleteTaskQuestioncomit(this.objyl.id).then((res) => {
+          if (res.code == 200) {
+            (this.objyl.id = null),
+              TaskQuestioncomit(this.objyl).then((response) => {
+                this.previewtf = false;
+                this.form.libtemplateid = this.objyl.svyid;
+                this.form.templateid = response.data;
+                this.form.templatename = this.objyl.svyname;
+                this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
+              });
+          }
+        });
+      } else {
+        TaskQuestioncomit(this.objyl).then((response) => {
+          this.previewtf = false;
+          this.form.libtemplateid = this.objyl.svyid;
+          this.form.templateid = response.data;
+          this.form.templatename = this.objyl.svyname;
+          this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
+        });
+      }
+    },
+    // 淇濆瓨绉戝/鐥呭尯
+    putbelongDepts(id) {
+      this.tempDetpRelevanceslistform.forEach((item) => {
+        item.tempid = id;
       });
-      this.Tasktemplate.svyTaskTemplateScriptVOS =
-        this.Tasktemplate.svyTemplateLibScripts;
-      this.Tasktemplate.templateid = id;
-      this.Tasktemplate.isoperation = 1;
-      TaskQuestioncomit(this.Tasktemplate).then((response) => {
-        this.previewtf = false;
-        this.form.templateid = response.data;
-        this.form.libtemplateid = this.libId;
-        this.form.templatename = this.libName;
-        this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
+      this.tempbelongWardsform.forEach((item) => {
+        item.tempid = id;
+      });
+      depthospgetson(this.tempDetpRelevanceslistform).then((res) => {
+        if (res.code == 200) {
+          this.$modal.msgSuccess("绉戝鏇存柊鎴愬姛");
+          this.tempDetpRelevanceslistform = [];
+        }
+      });
+      depthospgetson(this.tempbelongWardsform).then((res) => {
+        if (res.code == 200) {
+          this.$modal.msgSuccess("鐥呭尯鏇存柊鎴愬姛");
+          this.tempbelongWardsform = [];
+        }
       });
     },
-    // 澶勭悊鏈嶅姟褰㈠紡
-    formatFn(type) {
-      console.log(this.preachform, "preachform");
-      console.log(this.checkList, "checklist");
-      let list = [];
-      let formlist = [];
-      if (type == 1) {
-        this.preachform.forEach((item) => {
-          this.checkList.forEach((obj) => {
-            if (item.label == obj) {
-              list.push(item.value);
+
+    // 绉戝澶勭悊
+    Departmenttreatment() {
+      if (!this.form.taskid) {
+        this.templateor = true;
+        MessageBox.confirm(
+          "褰撳墠涓烘柊澧炰换鍔℃湭淇濆瓨涓嶅彲鍏宠仈妯℃澘锛屾槸鍚﹀厛淇濆瓨浠诲姟锛�",
+          "鍔熻兘鎻愮ず",
+          {
+            confirmButtonText: "淇濆瓨浠诲姟",
+            cancelButtonText: "鏆傚瓨妯℃澘",
+            type: "warning",
+          }
+        )
+          .then(() => {
+            if (Array.isArray(this.objyl.suitway)) {
+              this.objyl.suitway = this.objyl.suitway.join(",");
             }
+            this.objyl.templateid = this.objyl.svyid;
+            this.form.libtemplateid = this.objyl.svyid;
+            this.objyl.isoperation = 1;
+            this.objyl.svyTaskTemplateScriptVOS =
+              this.objyl.svyTemplateLibScripts;
+            this.form.svyTaskTemplateVO = this.objyl;
+            this.submitForm();
+          })
+          .catch(() => {
+            if (Array.isArray(this.objyl.suitway)) {
+              this.objyl.suitway = this.objyl.suitway.join(",");
+            }
+            this.objyl.templateid = this.objyl.svyid;
+            this.form.libtemplateid = this.objyl.svyid;
+            this.objyl.isoperation = 1;
+            this.objyl.svyTaskTemplateScriptVOS =
+              this.objyl.svyTemplateLibScripts;
+            this.form.svyTaskTemplateVO = this.objyl;
+            this.form.templatename = this.objyl.svyname;
+            this.$modal.msgSuccess("鏆傚瓨鎴愬姛淇濆瓨浠诲姟鍚庢ā鏉垮け鏁�");
+            this.drawermb = false;
+            this.previewtf = false;
           });
-        });
-        console.log(list, "list");
-        this.form.preachform = list.join(",");
       } else {
-        console.log(this.form.preachform, "this.form.preachform");
-        formlist = this.form.preachform.split(",");
-        console.log(11);
-        this.preachform.forEach((item) => {
-          formlist.forEach((obj) => {
-            if (item.value == obj) {
-              list.push(item.label);
-            }
-          });
-        });
-        this.checkList = list;
+        setTimeout(() => {
+          this.previewFn();
+        }, 1000);
       }
     },
   },
@@ -1483,6 +2294,14 @@
     }
   }
 }
+.xinz-infs {
+  font-size: 18px;
+  line-height: 48px;
+
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+}
 // .leftvlue-jbxx {
 //   margin-bottom: 50px;
 //   font-size: 20px;
@@ -1505,9 +2324,9 @@
   //   margin: 20px;
   padding: 30px;
   background: #ffff;
-  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);
+  // 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);
   .scriptTopic-dev {
     margin-bottom: 25px;
     font-size: 20px !important;
@@ -1577,7 +2396,7 @@
 // }
 ::v-deep.el-radio-group {
   span {
-    font-size: 24px;
+    font-size: 18px;
   }
 }
 ::v-deep.el-input.is-disabled .el-input__inner {
@@ -1588,7 +2407,7 @@
 }
 ::v-deep.el-checkbox-group {
   span {
-    font-size: 24px;
+    font-size: 18px;
   }
 }
 </style>

--
Gitblit v1.9.3