From 83d83221778cf0213a979ebfcb4d75884038d9c1 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 04 三月 2025 14:34:45 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/QuestionnaireTask.vue |  800 ++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 482 insertions(+), 318 deletions(-)

diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index 888c794..5c07433 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -70,23 +70,32 @@
                   />
                 </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"
-                      :disabled="!item.disabled"
                     >
-                      {{ item.label }}</el-checkbox
+                      {{ item.label }}</el-radio
                     >
-                  </el-checkbox-group>
+                  </el-radio-group>
                 </el-form-item>
-                <el-form-item label="鏄惁闀挎湡" prop="longTask">
+                <el-form-item label="鎵ц鍛ㄦ湡" prop="longTask">
                   <el-radio-group v-model="form.longTask">
-                    <el-radio :label="0">鏅�氫换鍔�</el-radio>
+                    <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"
@@ -187,13 +196,23 @@
                     </div>
                   </div>
                 </el-form-item>
-                <el-row>
+                <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="form.deptcode"
+                        v-model="deptcodesWards"
+                        @remove-tag="removetag"
                         style="width: 400px"
                         size="medium"
+                        multiple
                         filterable
                         placeholder="璇烽�夋嫨绉戝"
                       >
@@ -208,28 +227,15 @@
                       </el-select> </el-form-item
                   ></el-col>
                 </el-row>
-                <el-row>
+                <el-row v-if="form.appltype == 2">
                   <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"
+                        v-model="leavehospitaldistrictcodes"
                         style="width: 400px"
+                        @remove-tag="removehpsp"
                         size="medium"
+                        multiple
                         filterable
                         placeholder="璇烽�夋嫨鐥呭尯"
                       >
@@ -239,6 +245,88 @@
                           :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
@@ -414,13 +502,13 @@
                     :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>
@@ -491,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>
@@ -590,116 +676,7 @@
                   <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-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"
@@ -866,6 +843,13 @@
         </div>
       </div>
     </el-drawer>
+    <Optional-Form
+      ref="child"
+      :dialogVisiblepatient="dialogVisiblepatientjb"
+      :overallCase="diagglist"
+      @addoption="dialogVisiblepatientjb = false"
+      @kkoption="dialogVisiblepatientjb = true"
+    />
   </div>
 </template>
 
@@ -873,9 +857,12 @@
 import { messagelistpatient } from "@/api/patient/homepage";
 import store from "@/store";
 import {
-  getTaskpatient,
-  getlibrarylist,
-  getFollowuplist,
+  getTaskpatientQC,
+  taskoperhospgetsondel,
+  taskdiaghospgetsondel,
+  getillnesslist,
+  getbaseopera,
+  Externallist,
   getQtemplatelist,
   getQtemplateobj,
   TaskQuestioncomit,
@@ -886,10 +873,14 @@
   getillness,
   Editsingletask,
   getQtemplateclassify,
-  depthospgetsonlist,
+  taskdepthospgetsondel,
+  taskdepthospgetsonlist,
+  taskdiaggetlist,
+  taskopergetlist,
 } from "@/api/AiCentre/index";
-
+import OptionalForm from "@/components/OptionalForm"; //姝e垯缁勪欢
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
+import { MessageBox } from "element-ui";
 
 export default {
   name: "ServiceDetails",
@@ -900,6 +891,7 @@
       id: "", //
       previewid: "", //浠诲姟妯℃澘浼犻�抜d
       libName: "",
+      templateor: false,
       objyl: {},
       overallCase: [], //閫夋嫨鎮h�呮��
       allpids: [],
@@ -914,10 +906,17 @@
       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: "鍋滅敤" },
@@ -969,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 },
@@ -990,7 +989,7 @@
         pageNum: 1, //
         pageSize: 10,
       },
-      checkList: [],
+      checkList: "",
       deliverytopqueryParams: {
         pageNum: 1, //
         pageSize: 10,
@@ -999,8 +998,8 @@
         pageNum: 1, //
         pageSize: 10,
         topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
-        leavehospitaldistrictcodes:[],
-        leaveldeptcodes:[],
+        leavehospitaldistrictcodes: [],
+        leaveldeptcodes: [],
       },
       topicoptions: [{ children: [{ children: [] }] }],
       showSearch: true, //
@@ -1020,7 +1019,7 @@
       sonuserList: [], //閫変腑鎮h�呭垪琛�
       delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
       longtype: [
-        { value: 0, label: "鏅�氫换鍔�" },
+        { value: 0, label: "鑷畾涔夊懆鏈�" },
         { value: 1, label: "闀挎湡浠诲姟" },
       ],
       variableList: [
@@ -1037,7 +1036,7 @@
           default: true,
         },
         {
-          name: "鐢佃瘽",
+          name: "鏅鸿兘璇煶",
           value: "${dhh}",
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
@@ -1057,7 +1056,7 @@
           default: true,
         },
         {
-          name: "鐢佃瘽",
+          name: "鏅鸿兘璇煶",
           value: "${dhh}",
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
@@ -1093,6 +1092,14 @@
           value: "3",
           label: "浣撴鐥呬汉",
         },
+        {
+          value: "6",
+          label: "闄㈠鎮h��",
+        },
+        {
+          value: "5",
+          label: "鎵嬫湳鐥呬汉",
+        },
       ],
       source: [
         {
@@ -1112,7 +1119,7 @@
       tasktypes: [
         {
           value: 1,
-          label: "鐩戞祴璇勪及",
+          label: "蹇冪數闅忚",
         },
         {
           value: 2,
@@ -1120,7 +1127,7 @@
         },
         {
           value: 3,
-          label: "闂ㄨ瘖闅忚",
+          label: "褰卞儚闅忚",
         },
         {
           value: 4,
@@ -1128,27 +1135,23 @@
         },
         {
           value: 5,
-          label: "澶嶈瘖绠$悊",
+          label: "浣撴闅忚",
         },
         {
-          value: 6,
-          label: "婊℃剰搴﹁皟鏌�",
+          value: 11,
+          label: "鍖绘妧闅忚",
         },
         {
-          value: 7,
-          label: "鎮h�呮姤鍛�",
-        },
-
-        {
-          value: 8,
-          label: "鍏朵粬閫氱煡",
+          value: 10,
+          label: "涓撶闅忚",
         },
       ],
       // 绉戝/鐥呭尯
       belongWards: [],
-      belongWards: [],
       deptlist: [],
       hosplist: [],
+      diagglist: [],
+      operlist: [],
       tempDetpRelevanceslist: [], //绉戝鏁版嵁
       tempDetpRelevanceslistform: [], //绉戝鏁版嵁
       tempbelongWards: [], //鐥呭尯鏁版嵁
@@ -1173,16 +1176,14 @@
         //   { required: true, message: "閫傜敤鐥呭尯涓嶈兘涓虹┖", trigger: "blur" },
         // ],
       },
+      belongDepts: [],
       // 绉戝闄㈠尯鏌ヨ鍏ュ弬
-      queryParamsdept: {
-        tempid: "",
-        type: 11,
-      },
+      queryParamsdept: {},
       quote: false,
       serviceType: null,
     };
   },
-  components: { SFtable },
+  components: { SFtable, OptionalForm },
 
   created() {
     this.appraiselist = store.getters.appraiselist;
@@ -1196,6 +1197,7 @@
     this.serviceType = Number(this.$route.query.serviceType);
     this.form.serviceType = Number(this.$route.query.serviceType);
     this.Acquisitiontype();
+    this.getillnesslist();
     this.Getdetails();
     this.getQtemplateclassify();
   },
@@ -1206,13 +1208,21 @@
       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 = [];
@@ -1260,7 +1270,6 @@
           {
             value: "4",
             label: "鐭俊",
-
           },
           {
             value: "5",
@@ -1272,12 +1281,11 @@
         this.checkboxlist = [
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
             label: "鐭俊",
-
           },
           {
             value: "5",
@@ -1288,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",
@@ -1305,12 +1318,11 @@
           },
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
             label: "鐭俊",
-
           },
           {
             value: "5",
@@ -1320,8 +1332,17 @@
             value: "6",
             label: "寰俊灏忕▼搴�",
           },
+          {
+            value: "7",
+            label: "鏈悗闅忚",
+          },
         ];
-      } else if (this.form.serviceType == 2 || this.form.serviceType == 3|| this.form.serviceType == 5|| this.form.serviceType == 4) {
+      } else if (
+        this.form.serviceType == 2 ||
+        this.form.serviceType == 3 ||
+        this.form.serviceType == 5 ||
+        this.form.serviceType == 4
+      ) {
         this.checkboxlist = [
           {
             value: "1",
@@ -1329,12 +1350,11 @@
           },
           {
             value: "3",
-            label: "鐢佃瘽",
+            label: "鏅鸿兘璇煶",
           },
           {
             value: "4",
             label: "鐭俊",
-
           },
           {
             value: "5",
@@ -1345,10 +1365,10 @@
             label: "寰俊灏忕▼搴�",
           },
 
-          {
-            value: "8",
-            label: "鏅鸿兘鏈哄櫒浜�",
-          },
+          // {
+          //   value: "8",
+          //   label: "鏅鸿兘鏈哄櫒浜�",
+          // },
         ];
       }
       getQtemplatelist(this.topqueryParams).then((response) => {
@@ -1378,21 +1398,53 @@
           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;
       }
+      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) ||
@@ -1415,24 +1467,18 @@
         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;
-      }
+      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.puttaskid(res.data);
             this.$modal.msgSuccess("鏂板鎴愬姛");
           }
           this.$router.push({
@@ -1442,33 +1488,8 @@
         }
       });
     },
-    // 缁欎换鍔℃ā鏉胯祴鍊间换鍔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) {
       // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
@@ -1482,10 +1503,9 @@
             if (this.form.longTask) {
               this.objyl.longTemp = 1;
             }
-            this.queryParamsdept.type = 1;
-            this.queryParamsdept.tempid = row.svyid;
-            this.listDept();
 
+            this.tempDetpRelevanceslist = [];
+            this.tempbelongWards = [];
             this.objyl.suitway = this.objyl.suitway.split(",");
             this.questionList = res.rows[0].svyTemplateLibScripts;
             this.getillness(row.svyid);
@@ -1507,11 +1527,9 @@
           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) {
@@ -1530,6 +1548,44 @@
           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,
+          opdesc: name,
+        }).then((res) => {
+          this.donorchargeList = res.rows;
+        });
+      }
+    },
+    // 鐤剧梾鏌ヨ
+    remotedonor(name) {
+      if (name) {
+        getbaseopera({
+          pageNum: 1,
+          pageSize: 1000,
+          opdesc: name,
+        }).then((res) => {
+          this.baseoperaList = res.rows;
         });
       }
     },
@@ -1628,7 +1684,7 @@
         this.patientqueryParams.leavehospitaldistrictcodes =
           store.getters.belongWards.map((obj) => obj.districtCode);
       }
-      getTaskpatient(this.patientqueryParams).then((response) => {
+      getTaskpatientQC(this.patientqueryParams).then((response) => {
         this.patientuserList = response.rows;
         this.patientuserList.forEach((item) => {
           if (item.endtime) {
@@ -1661,6 +1717,9 @@
           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);
         }
@@ -1708,6 +1767,15 @@
     },
     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;
@@ -1720,15 +1788,43 @@
           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])
+      if (
+        !this.patientqueryParams.leavehospitaldistrictcodes ||
+        !this.patientqueryParams.leavehospitaldistrictcodes[0]
+      )
         this.patientqueryParams.leavehospitaldistrictcodes = null;
-      if (!this.patientqueryParams.leaveldeptcodes||!this.patientqueryParams.leaveldeptcodes[0])
+      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) => {
@@ -1757,6 +1853,7 @@
       this.form = {
         patTaskRelevances: [],
         sendType: 1,
+        sendDay: 5,
         templatename: "",
         templateid: null,
         libtemplateid: null,
@@ -1775,7 +1872,7 @@
               ? this.form.patTaskRelevances
               : [];
             this.overallCase = this.form.patTaskRelevances.concat();
-            this.checkList = this.form.preachform.split(",");
+            this.checkList = this.form.preachform;
 
             this.overallCase.forEach((item) => {
               if (item.endtime) {
@@ -1790,6 +1887,10 @@
               } else {
                 this.time1 = this.form.showTimeMorn.split(",");
               }
+            }
+            // 鑾峰彇浠诲姟绉戝
+            if (this.form.taskid) {
+              this.listDept();
             }
             if (this.form.showTimeNoon)
               this.time2 = this.form.showTimeNoon.split(",");
@@ -1821,25 +1922,104 @@
       this.time3 = ""; //鏅氫笂鏃堕棿娈�
       this.time4 = ""; //鏅氫笂鏃堕棿娈�
     },
-    // 鑾峰彇绉戝鍒楄〃
+    // 鑾峰彇鍚勭被
     listDept() {
-      this.tempDetpRelevanceslist = [];
-      this.tempbelongWards = [];
-      depthospgetsonlist(this.queryParamsdept).then((res) => {
+      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.tempDetpRelevanceslist.push(item.deptCode);
+              this.deptcodesWards.push(item.deptCode);
             } else if (item.deptType == 2) {
               this.hosplist.push(item);
-              this.tempbelongWards.push(item.deptCode);
+              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;
@@ -1860,6 +2040,7 @@
       row.isoperation = 3;
       this.delvariableList.push(row);
     },
+
     // 鏃堕棿----------
     changeTime(row) {
       this.processingTime();
@@ -1940,17 +2121,10 @@
       if (Array.isArray(this.objyl.suitway)) {
         this.objyl.suitway = this.objyl.suitway.join(",");
       }
-      this.objyl.svyTemplateLibScripts.forEach((item) => {
-        item.svyTaskTemplateTargetoptions = item.svyLibTemplateTargetoptions;
-      });
-      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';
-      }
+      this.objyl.taskid = this.form.taskid;
 
       if (this.objyl.id) {
         deleteTaskQuestioncomit(this.objyl.id).then((res) => {
@@ -1960,7 +2134,6 @@
                 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("閫夋嫨妯℃澘鎴愬姛");
               });
@@ -1971,7 +2144,6 @@
           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("閫夋嫨妯℃澘鎴愬姛");
         });
@@ -1998,60 +2170,52 @@
         }
       });
     },
-    // 澶勭悊鏈嶅姟褰㈠紡
-    formatFn(type) {
-      let list = [];
-      let formlist = [];
-      if (type == 1) {
-        this.preachform.forEach((item) => {
-          this.checkList.forEach((obj) => {
-            if (item.label == obj) {
-              list.push(item.value);
-            }
-          });
-        });
-        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;
-      }
-    },
+
     // 绉戝澶勭悊
     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);
+      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;
+          });
+      } else {
+        setTimeout(() => {
+          this.previewFn();
+        }, 1000);
+      }
     },
   },
 };

--
Gitblit v1.9.3