From 1cb1fbf80c955986385377b5f84e8915d1e655d6 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 15 一月 2025 15:04:00 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/QuestionnaireTask.vue |  932 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 747 insertions(+), 185 deletions(-)

diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index c9a50bf..78551f2 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -80,7 +80,17 @@
                     >
                   </el-checkbox-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-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 +99,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 +116,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 +135,7 @@
 
                 <el-form-item
                   label="鎵ц鏃堕棿娈�"
-                  v-if="form.sendType == 1"
+                  v-if="form.sendType == 1 && !form.longTask"
                   prop="daytime"
                 >
                   <div style="display: flex">
@@ -177,11 +187,68 @@
                   </div>
                 </el-form-item>
                 <el-row>
+                  <el-col :span="20"
+                    ><el-form-item label="閫傜敤绉戝" prop="region">
+                      <el-select
+                        v-model="form.deptcode"
+                        style="width: 400px"
+                        size="medium"
+                        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>
+                  <el-col :span="20"
+                    ><el-form-item label="閫傜敤鐥呭尯" prop="region">
+                      <!-- <el-cascader
+                      style="width: 400px"
+                      v-model="form.leavehospitaldistrictcode"
+                      :options="topicoptions"
+                      :props="propstask"
+                      :show-all-levels="false"
+                      clearable
+                    >
+                      <template slot-scope="{ node, data }">
+                        <span>{{ data.deptName }}</span>
+                        <span v-if="!node.isLeaf">
+                          ({{ data.children.length }})
+                        </span>
+                      </template>
+                    </el-cascader> -->
+                      <el-select
+                        v-model="form.leavehospitaldistrictcode"
+                        style="width: 400px"
+                        size="medium"
+                        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>
                   <el-col :span="12"
                     ><el-form-item label="寮�鍦虹櫧" prop="kcb">
                       <el-input
                         type="textarea"
-                          :rows="3"
+                        :rows="3"
                         v-model="form.kcb"
                         placeholder="璇疯緭鍏ュ紑鍦虹櫧"
                       /> </el-form-item
@@ -212,6 +279,7 @@
                       placeholder="璇风偣鍑诲彸渚ч�夋嫨"
                     />
                     <el-button
+                      style="margin-left: 10px"
                       type="primary"
                       icon="el-icon-edit"
                       @click="drawermb = true"
@@ -219,7 +287,7 @@
                     ></el-button>
 
                     <el-button
-                      v-if="form.libtemplateid"
+                      v-if="form.templatename"
                       type="success"
                       icon="el-icon-search"
                       @click="previewfnmb"
@@ -319,7 +387,7 @@
                       >
                     </el-col>
 
-                    <el-col :span="1.5">
+                    <!-- <el-col :span="1.5">
                       <el-button
                         type="danger"
                         plain
@@ -329,7 +397,7 @@
                         @click="handleDelete"
                         >鍒犻櫎</el-button
                       >
-                    </el-col>
+                    </el-col> -->
 
                     <!-- <el-col :span="1.5"> </el-col> -->
                   </el-row>
@@ -391,8 +459,8 @@
                 ></el-input>
               </el-form-item>
               <el-select
-                v-model="patientqueryParams.topica"
-                placeholder="璇烽�夋嫨鎮h�呮潵婧�"
+                v-model="patientqueryParams.searchscope"
+                placeholder="璇烽�夋嫨鎮h�呰寖鍥�"
               >
                 <el-option
                   v-for="item in source"
@@ -447,69 +515,282 @@
         >
       </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="suitway">
+                <el-select
+                  style="width: 400px"
+                  v-model="objyl.suitway"
+                  size="medium"
+                  multiple
+                  filterable
+                  placeholder="璇烽�夋嫨鍒嗙被"
                 >
-              </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-option
+                    class="ruleFormaa"
+                    v-for="item in mode"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-row :gutter="20" v-if="form.longTask">
+                <el-col :span="14">
+                  <el-form-item label="闀挎湡浠诲姟" prop="longTemp">
+                    <el-radio-group v-model="objyl.longTemp">
+                      <el-radio
+                        v-for="(item, index) in longtype"
+                        :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.sendDay"
+                      placeholder="榛樿5澶╁悗"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="20"
+                  ><el-form-item label="閫傜敤绉戝" prop="region">
+                    <el-select
+                      style="width: 400px"
+                      v-model="tempDetpRelevanceslist"
+                      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>
+                <el-col :span="20"
+                  ><el-form-item label="閫傜敤鐥呭尯" prop="region">
+                    <el-select
+                      v-model="tempbelongWards"
+                      style="width: 400px"
+                      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> -->
+
+              <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>
+
+                  <el-tag
+                    v-for="tag in illnesslist"
+                    :key="tag.icdid"
+                    type="warning"
+                    :disable-transitions="false"
+                  >
+                    {{ tag.icdname }}
+                  </el-tag>
+                  <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
+                </el-form-item>
+              </div>
+              <el-form-item label="闂嵎鎻忚堪" prop="description">
+                <el-input
+                  type="textarea"
+                  :rows="2"
+                  placeholder="璇疯緭鍏ュ唴瀹�"
+                  v-model="objyl.description"
                 >
-                  {{ 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-item label="闂嵎缁撴潫璇�" prop="conclusion">
+                <el-input
+                  type="textarea"
+                  :rows="2"
+                  placeholder="璇疯緭鍏ュ唴瀹�"
+                  v-model="objyl.conclusion"
+                >
+                </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
@@ -535,7 +816,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"
@@ -545,7 +826,7 @@
                   >
                   </el-option>
                 </el-select>
-              </el-form-item>
+              </el-form-item> -->
               <el-form-item>
                 <el-button
                   type="primary"
@@ -597,12 +878,15 @@
   getQtemplatelist,
   getQtemplateobj,
   TaskQuestioncomit,
+  deleteTaskQuestioncomit,
   Questionnairetaskgetson,
-  gethetaskinfo,
-  delhetaskinfo,
+  getTaskQuestioncomit,
+  depthospgetson,
+  getillness,
   Editsingletask,
+  getQtemplateclassify,
+  depthospgetsonlist,
 } from "@/api/AiCentre/index";
-import { listDept } from "@/api/system/dept";
 
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
 
@@ -615,8 +899,13 @@
       id: "", //
       previewid: "", //浠诲姟妯℃澘浼犻�抜d
       libName: "",
+      objyl: {},
       overallCase: [], //閫夋嫨鎮h�呮��
       allpids: [],
+      appraiselist: [],
+      optionsclass: [],
+      illnesslist: [],
+      mode: [],
       libId: null, //妯℃澘搴撴ā鏉縤d
       Editprogress: 1, //缂栬緫杩涘害
       drawermb: false, //閫夋嫨妯℃澘寮圭獥
@@ -628,33 +917,45 @@
       checkboxlist: [],
       tableLabel: [],
       questionList: [],
+      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: "240", prop: "deptname" },
-          { label: "鐥呭尯", width: "240", prop: "leavehospitaldistrictname" },
+        { label: "鎮h��", width: "", prop: "name" },
+        { label: "韬唤璇�", width: "200", prop: "idcardno" },
+        { label: "鎬у埆", width: "", prop: "sex" },
+        { label: "骞撮緞", width: "", prop: "age" },
+        { 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: "inhosptime" },
-          { label: "鎮h��", width: "", prop: "name" },
-          { label: "韬唤璇�", width: "200", prop: "sfzh" },
-          { label: "鎬у埆", width: "", prop: "sex" },
-          { label: "骞撮緞", width: "", prop: "age" },
-          { label: "鍖荤敓", width: "", prop: "drname" },
-          { label: "绉戝", width: "180", prop: "deptName" },
-          { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
+        { 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" },
       ],
@@ -696,7 +997,9 @@
       patientqueryParams: {
         pageNum: 1, //
         pageSize: 10,
-        topica:0,//0鍏ㄩ儴1绉戝2鐥呭尯
+        topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
+        leavehospitaldistrictcodes:[],
+        leaveldeptcodes:[],
       },
       topicoptions: [{ children: [{ children: [] }] }],
       showSearch: true, //
@@ -715,6 +1018,10 @@
       patientuserList: [], //閫夋嫨鎮h�呭垪琛�
       sonuserList: [], //閫変腑鎮h�呭垪琛�
       delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
+      longtype: [
+        { value: 0, label: "鏅�氫换鍔�" },
+        { value: 1, label: "闀挎湡浠诲姟" },
+      ],
       variableList: [
         {
           name: "濮撳悕",
@@ -761,16 +1068,21 @@
       form: {
         patTaskRelevances: [],
         sendType: 1,
+        longTask: 0,
         templatename: "",
         templateid: null,
         libtemplateid: null,
-        kcb:'浜茬埍鐨勬偅鑰�-瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�',
-        jsy:'璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒',
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瑙傜湅杩欎唤瀹f暀璧勮銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       },
       taskoptions: [
         {
           value: "1",
           label: "鍑洪櫌鐥呬汉",
+        },
+        {
+          value: "4",
+          label: "鍦ㄩ櫌鐥呬汉",
         },
         {
           value: "2",
@@ -784,7 +1096,7 @@
       source: [
         {
           value: 0,
-          label: "鎵�鏈夋偅鑰�",
+          label: "鎵�灞炴偅鑰�",
         },
         {
           value: 1,
@@ -831,6 +1143,15 @@
           label: "鍏朵粬閫氱煡",
         },
       ],
+      // 绉戝/鐥呭尯
+      belongWards: [],
+      belongWards: [],
+      deptlist: [],
+      hosplist: [],
+      tempDetpRelevanceslist: [], //绉戝鏁版嵁
+      tempDetpRelevanceslistform: [], //绉戝鏁版嵁
+      tempbelongWards: [], //鐥呭尯鏁版嵁
+      tempbelongWardsform: [], //鐥呭尯鏁版嵁
       rules: {
         taskName: [
           { required: true, message: "浠诲姟鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
@@ -841,12 +1162,20 @@
             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" },
+        // ],
+      },
+      // 绉戝闄㈠尯鏌ヨ鍏ュ弬
+      queryParamsdept: {
+        tempid: "",
+        type: 11,
       },
       quote: false,
       serviceType: null,
@@ -855,20 +1184,25 @@
   components: { SFtable },
 
   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.Getdetails();
+    this.getQtemplateclassify();
   },
   activated() {
     if (this.id != this.$route.query.id) {
-      this.listDept();
       this.Acquisitiontype();
       this.Getdetails();
+      this.getQtemplateclassify();
     }
   },
 
@@ -906,7 +1240,7 @@
       let queryParams = {
         pageNum: this.topqueryParams.pageNum,
         pageSize: this.topqueryParams.pageSize,
-        isavailable: "",
+        isenable: "",
       };
       this.currenttype = this.$route.query.type;
       this.title = "闂嵎鍐呭鍒楄〃";
@@ -923,9 +1257,14 @@
             label: "绾歌川",
           },
           {
+            value: "4",
+            label: "鐭俊",
+          },
+          {
             value: "5",
             label: "寰俊鍏紬鍙�",
           },
+          { label: "寰俊灏忕▼搴�", value: 6 },
         ];
       } else if (this.form.serviceType == 6) {
         this.checkboxlist = [
@@ -936,6 +1275,7 @@
           {
             value: "4",
             label: "鐭俊",
+
           },
           {
             value: "5",
@@ -968,6 +1308,7 @@
           {
             value: "4",
             label: "鐭俊",
+
           },
           {
             value: "5",
@@ -978,7 +1319,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",
@@ -991,6 +1332,7 @@
           {
             value: "4",
             label: "鐭俊",
+
           },
           {
             value: "5",
@@ -1025,8 +1367,6 @@
     },
     // 淇濆瓨
     submitForm(formName) {
-      console.log(this.form.patTaskRelevances,'1.patTaskRelevances');
-      console.log(this.overallCase,'this.form.overallCase');
       if (this.time4 && this.form.sendType == 3)
         this.form.showTimeMorn = this.time4;
       this.form.sendTimeslot = [
@@ -1036,13 +1376,14 @@
           xh: 1,
         },
       ];
+
       if (this.checkList[0]) {
         this.form.preachform = this.checkList.join(",");
       } else {
         this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
         return;
       }
-      if (!this.form.patTaskRelevances[0]) {
+      if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
         this.$modal.msgError("璇烽�夋嫨鐥呬汉");
         return;
       }
@@ -1051,11 +1392,13 @@
         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("鏃堕棿淇℃伅缂哄け");
       }
-      console.log(this.form.patTaskRelevances,'2.patTaskRelevances');
       const filteredArray = this.variableList.filter(
         (item) =>
           item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
@@ -1070,12 +1413,25 @@
         this.form.type = this.$route.query.type;
       }
       this.form.serviceType = this.serviceType;
+      this.form.leaveldeptcodes = store.getters.belongDepts.map(
+        (obj) => obj.deptCode
+      );
+      this.form.leavehospitaldistrictcodes = store.getters.belongWards.map(
+        (obj) => obj.districtCode
+      );
+      console.log(this.form.longTask);
+      console.log(this.form.preachform);
+
+      if (this.form.longTask && this.form.preachform == 6) {
+        this.form.patCycle = 1;
+      }
       Editsingletask(this.form).then((res) => {
         if (res.code == 200) {
           if (this.form.taskid) {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-          } else {
             this.$modal.msgSuccess("淇敼鎴愬姛");
+          } else {
+            this.puttaskid(res.data);
+            this.$modal.msgSuccess("鏂板鎴愬姛");
           }
           this.$router.push({
             path: "/followvisit/tasklist",
@@ -1084,19 +1440,53 @@
         }
       });
     },
+    // 缁欎换鍔℃ā鏉胯祴鍊间换鍔d
+    puttaskid(data) {
+      getTaskQuestioncomit(this.form.templateid).then((res) => {
+        if (res.code == 200) {
+          this.objyl = res.data;
+          if (this.objyl.taskid == data.taskId) {
+            this.objyl.isoperation = 2;
+          } else {
+            this.objyl.isoperation = 1;
+          }
+          this.objyl.taskid = data.taskId;
+          if (!this.objyl.sendDay) {
+        this.objyl.sendDay='5';
+      }
+          TaskQuestioncomit(this.objyl).then((response) => {
+            this.previewtf = false;
+            this.form.libtemplateid = this.objyl.svyid;
+            this.form.templateid = response.data;
+            // this.putbelongDepts(response.data);
+            this.form.templatename = this.objyl.svyname;
+            this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
+          });
+        }
+      });
+    },
     // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
 
-    // 纭閫夋嫨妯℃澘鏀惧叆浠诲姟妯℃澘
+    // 閫夋嫨棰勮
     selectfn(row, type) {
       // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
       if (type == 1) {
         this.libName = row.svyname;
         this.libId = row.svyid;
-        this.Tasktemplate = row;
         this.questionList = 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.queryParamsdept.type = 1;
+            this.queryParamsdept.tempid = row.svyid;
+            this.listDept();
+
+            this.objyl.suitway = this.objyl.suitway.split(",");
             this.questionList = res.rows[0].svyTemplateLibScripts;
+            this.getillness(row.svyid);
             this.previewtf = true;
           }
         });
@@ -1109,14 +1499,37 @@
     },
     // 棰勮
     previewfnmb() {
-      console.log(this.form);
-
-      getQtemplateobj({ svyid: this.form.libtemplateid }).then((res) => {
+      getTaskQuestioncomit(this.form.templateid).then((res) => {
         if (res.code == 200) {
-          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.queryParamsdept.tempid = this.form.templateid;
+          this.queryParamsdept.type = 11;
+          this.getillness(this.form.libtemplateid);
+          // 鎵ц鑾峰彇璇ヤ换鍔℃ā鏉縤d
+          this.listDept();
           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;
+          });
+        });
+      }
     },
     // 澶勭悊闂灞傚彉閲�
     Variablehandling(arr, type) {
@@ -1135,7 +1548,6 @@
             }
           });
         });
-        console.log(Variablist, "Variablist");
         const Aarr = Variablist.filter(
           (obj, index, self) =>
             index ===
@@ -1148,44 +1560,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: "150", prop: "inhosptime" },
+          // { 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: "180", prop: "deptname" },
+          { 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: "leavehospitaldistrictname" },
-          { 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";
+      }
+      // 鏉ユ簮鍒ゆ柇
 
+      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);
+      }
       getTaskpatient(this.patientqueryParams).then((response) => {
-        console.log(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();
@@ -1197,7 +1644,6 @@
     handleExport() {},
     // 閫夋嫨鎮h�呰〃鏁版嵁
     handleSelectionChange(selection) {
-      console.log("澶氶�夋偅鑰�",selection);
       this.SelectPatientslist = structuredClone(selection);
       this.multiple = !selection.length;
 
@@ -1210,27 +1656,22 @@
           item.hospType = this.patientqueryParams.allhosp;
           item.sfzh = item.idcardno;
           item.deptCode = item.deptcode;
-          item.deptName = item.deptname;
+          item.deptName = item.dept;
           item.admindate = item.inhosptime;
           item.sfzh = item.idcardno;
-          console.log(item);
           this.overallCase.push(item);
           this.form.patTaskRelevances.push(item);
-          console.log(this.form.patTaskRelevances,'patTaskRelevances');
         }
       });
     },
     // 鍒囨崲椤靛悗鎭㈠閫変腑
     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);
     },
     // 鎸傝浇閫夋嫨鐘舵��
@@ -1243,7 +1684,6 @@
           });
           this.decision = false;
         });
-        console.log(123);
       } else {
         this.$refs.multipleTable.clearSelection();
       }
@@ -1256,24 +1696,35 @@
           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() {
-      // 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.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;
+      }
+      console.log(this.patientqueryParams.leavehospitaldistrictcodes);
+      console.log(this.patientqueryParams.leaveldeptcodes);
+
+      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();
     },
     resetQuery() {},
@@ -1307,9 +1758,10 @@
         templatename: "",
         templateid: null,
         libtemplateid: null,
-        kcb:'浜茬埍鐨勬偅鑰�-瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�',
-        jsy:'鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒',
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       };
+
       this.questionList = [];
       if (this.id) {
         Questionnairetaskgetson({ taskid: this.id }).then((res) => {
@@ -1322,13 +1774,17 @@
               : [];
             this.overallCase = this.form.patTaskRelevances.concat();
             this.checkList = this.form.preachform.split(",");
-            console.log(this.form, "this.form");
+
+            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(",");
               }
@@ -1337,20 +1793,54 @@
               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.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);
+            }
+          });
+        }
+      });
+    },
+    getQtemplateclassify() {
+      getQtemplateclassify({}).then((res) => {
+        this.optionsclass = res.rows;
       });
     },
     // 鏂板娲鹃�佹偅鑰�
@@ -1367,18 +1857,14 @@
       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]);
@@ -1447,30 +1933,71 @@
         query: { id: this.previewid, task: true, data: this.form },
       });
     },
+    // 淇濆瓨/鏇存柊浠诲姟妯℃澘
     previewFn() {
-      let id = this.Tasktemplate.id;
-      this.Tasktemplate.id = null;
-      console.log(this.Tasktemplate);
-
-      this.Tasktemplate.svyTemplateLibScripts.forEach((item) => {
+      if (Array.isArray(this.objyl.suitway)) {
+        this.objyl.suitway = this.objyl.suitway.join(",");
+      }
+      this.objyl.svyTemplateLibScripts.forEach((item) => {
         item.svyTaskTemplateTargetoptions = item.svyLibTemplateTargetoptions;
       });
-      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.objyl.svyTaskTemplateScriptVOS = this.objyl.svyTemplateLibScripts;
+      this.objyl.templateid = this.objyl.svyid;
+
+      this.objyl.isoperation = 1;
+      console.log(this.objyl.id);
+      if (!this.objyl.sendDay) {
+        this.objyl.sendDay='5';
+      }
+
+      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.putbelongDepts(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.putbelongDepts(response.data);
+          this.form.templatename = this.objyl.svyname;
+          this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
+        });
+      }
+    },
+    // 淇濆瓨绉戝/鐥呭尯
+    putbelongDepts(id) {
+      this.tempDetpRelevanceslistform.forEach((item) => {
+        item.tempid = id;
+      });
+      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) {
@@ -1496,6 +2023,33 @@
         });
         this.checkList = list;
       }
+    },
+    // 绉戝澶勭悊
+    Departmenttreatment() {
+      this.tempDetpRelevanceslist.forEach((item) => {
+        this.tempDetpRelevanceslistform.push({
+          deptType: 1,
+          longTemp: this.form.longTask,
+          deptCode: item,
+          tempid: null,
+          type: 11,
+        });
+      });
+
+      this.tempbelongWards.forEach((item) => {
+        this.tempbelongWardsform.push({
+          deptType: 2,
+          longTemp: this.form.longTask,
+          deptCode: item,
+          tempid: null,
+          type: 11,
+        });
+      });
+      console.log(33);
+
+      setTimeout(() => {
+        this.previewFn();
+      }, 1000);
     },
   },
 };
@@ -1574,6 +2128,14 @@
     }
   }
 }
+.xinz-infs {
+  font-size: 18px;
+  line-height: 48px;
+
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+}
 // .leftvlue-jbxx {
 //   margin-bottom: 50px;
 //   font-size: 20px;
@@ -1596,9 +2158,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;
@@ -1668,7 +2230,7 @@
 // }
 ::v-deep.el-radio-group {
   span {
-    font-size: 24px;
+    font-size: 18px;
   }
 }
 ::v-deep.el-input.is-disabled .el-input__inner {
@@ -1679,7 +2241,7 @@
 }
 ::v-deep.el-checkbox-group {
   span {
-    font-size: 24px;
+    font-size: 18px;
   }
 }
 </style>

--
Gitblit v1.9.3