From 007d3884ad259883d7a5db6714876e46525ae717 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 26 十一月 2024 14:49:38 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/particty.vue |  141 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 104 insertions(+), 37 deletions(-)

diff --git a/src/views/patient/propaganda/particty.vue b/src/views/patient/propaganda/particty.vue
index a6a2788..a7618ae 100644
--- a/src/views/patient/propaganda/particty.vue
+++ b/src/views/patient/propaganda/particty.vue
@@ -78,7 +78,7 @@
                       v-for="(item, index) in checkboxlist"
                       :key="index"
                       :label="item.value"
-                       @change="checkboxChange($event, item.value)"
+                      @change="checkboxChange($event, item.value)"
                     >
                       {{ item.label }}</el-checkbox
                     >
@@ -94,7 +94,7 @@
                       :disable-transitions="false"
                       @close="handleClosetag(tag)"
                     >
-                      ({{index+1}}){{ tag.label }}
+                      ({{ index + 1 }}){{ tag.label }}
                     </el-tag>
                   </el-form-item>
                 </div>
@@ -253,9 +253,9 @@
                         <el-option
                           class="ruleFormaa"
                           v-for="item in belongWards"
-                          :key="item.districtCode"
-                          :label="item.districtName"
-                          :value="item.districtCode"
+                          :key="item.deptCode"
+                          :label="item.label"
+                          :value="item.deptCode"
                         >
                         </el-option>
                       </el-select> </el-form-item
@@ -394,15 +394,36 @@
                     </el-col>
 
                     <el-col :span="1.5">
-                      <el-button
-                        type="primary"
-                        plain
-                        icon="el-icon-plus"
-                        size="medium"
-                        :disabled="!patientqueryParams.allhosp"
-                        @click="handleQuery"
-                        >鏂板</el-button
-                      >
+                      <div v-if="form.longTask">
+                        <el-tooltip
+
+                          class="item"
+                          effect="dark"
+                          content="闀挎湡浠诲姟涓嶆敮鎸佹墜鍔ㄦ坊鍔犳偅鑰咃紒"
+                          placement="top-start"
+                        >
+                          <el-button
+                            type="primary"
+                            plain
+                            disabled
+                            icon="el-icon-plus"
+                            size="medium"
+                            @click="handleQuery"
+                            >鏂板</el-button
+                          >
+                        </el-tooltip>
+                      </div>
+                      <div v-else>
+                        <el-button
+                          type="primary"
+                          plain
+                          icon="el-icon-plus"
+                          size="medium"
+                          :disabled="!patientqueryParams.allhosp"
+                          @click="handleQuery"
+                          >鏂板</el-button
+                        >
+                      </div>
                     </el-col>
 
                     <!-- <el-col :span="1.5">
@@ -568,7 +589,7 @@
               <el-row :gutter="20">
                 <el-col :span="14">
                   <el-form-item label="鍙敤鐘舵��" prop="isenable">
-                    <el-radio-group v-model="objyl.usestate">
+                    <el-radio-group v-model="objyl.isenable">
                       <el-radio
                         v-for="(item, index) in usable"
                         :label="item.value"
@@ -646,7 +667,7 @@
                         class="ruleFormaa"
                         v-for="item in belongDepts"
                         :key="item.deptCode"
-                        :label="item.deptName"
+                        :label="item.label"
                         :value="item.deptCode"
                       >
                       </el-option>
@@ -667,9 +688,9 @@
                       <el-option
                         class="ruleFormaa"
                         v-for="item in belongWards"
-                        :key="item.districtCode"
-                        :label="item.districtName"
-                        :value="item.districtCode"
+                        :key="item.deptCode"
+                        :label="item.label"
+                        :value="item.deptCode"
                       >
                       </el-option>
                     </el-select> </el-form-item
@@ -892,6 +913,8 @@
   getFollowupclassify,
   depthospgetsonlist,
 } from "@/api/AiCentre/index";
+import { deptTreeSelect } from "@/api/system/user";
+
 
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
 
@@ -904,6 +927,7 @@
       id: "", //
       previewid: "", //浠诲姟妯℃澘浼犻�抜d
       libName: "",
+      username: "",
       objyl: {},
       overallCase: [], //閫夋嫨鎮h�呮��
       allpids: [],
@@ -961,10 +985,10 @@
       ],
 
       tableLabelwj: [
+      { label: "鍒涘缓浜�", width: "", prop: "createBy" },
         { label: "妯℃澘鏍囬", width: "", prop: "templateName" },
         { label: "闅忚鎻忚堪", width: "", prop: "note" },
         { label: "淇敼鏃ユ湡", width: "", prop: "updateTime" },
-        { label: "鍒涘缓浜�", width: "", prop: "createBy" },
       ],
       // 鍙橀噺
       tableLabelvariable: [
@@ -1083,8 +1107,8 @@
         templatename: "",
         templateid: null,
         libtemplateid: null,
-        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瑙傜湅杩欎唤瀹f暀璧勮銆�",
-        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝杩涜鏈鍥炶鏈嶅姟銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       },
       taskoptions: [
         {
@@ -1180,7 +1204,7 @@
       // 绉戝闄㈠尯鏌ヨ鍏ュ弬
       queryParamsdept: {
         tempid: "",
-        type: 11,
+        type: 2,
       },
       quote: false,
       serviceType: null,
@@ -1190,8 +1214,9 @@
 
   created() {
     this.appraiselist = store.getters.appraiselist;
-    this.belongWards = store.getters.belongWards;
-    this.belongDepts = store.getters.belongDepts;
+    // this.belongWards = store.getters.belongWards;
+    // this.belongDepts = store.getters.belongDepts;
+    this.username = store.getters.name;
     this.mode = store.getters.Askmode;
     this.id = this.$route.query.id;
     this.newadd = this.$route.query.newadd;
@@ -1201,12 +1226,14 @@
     this.form.serviceType = Number(this.$route.query.serviceType);
     this.Acquisitiontype();
     this.Getdetails();
+    this.getDeptTree();
     this.getFollowupclassify();
   },
   activated() {
     if (this.id != this.$route.query.id) {
       this.Acquisitiontype();
       this.Getdetails();
+      this.getDeptTree();
       this.getFollowupclassify();
     }
   },
@@ -1239,6 +1266,33 @@
         result[item.name] = innerObj;
       });
       return result;
+    },
+    getDeptTree() {
+      // 绉戝鍒楄〃
+      deptTreeSelect().then((response) => {
+        let flatArray = this.flattenArray(response.data);
+        this.belongWards = flatArray;
+        this.belongDepts = flatArray;
+      });
+    },
+    flattenArray(multiArray) {
+      let result = [];
+
+      // 閫掑綊鍑芥暟锛岀敤浜庡皢澶氱骇鏁扮粍杞崲涓轰竴缁存暟缁勶紝鍙寘鍚渶搴曞眰鐨勫厓绱�
+      function flatten(element) {
+        // 濡傛灉褰撳墠鍏冪礌鏈夊瓙鍏冪礌锛岀户缁�掑綊
+        if (element.children && element.children.length > 0) {
+          element.children.forEach((child) => flatten(child));
+        } else {
+          // 鍏嬮殕鍏冪礌浠ラ伩鍏嶄慨鏀瑰師濮嬫暟鎹�
+          let item = JSON.parse(JSON.stringify(element));
+          result.push(item); // 灏嗘渶搴曞眰鐨勫厓绱犳坊鍔犲埌缁撴灉鏁扮粍
+        }
+      }
+
+      // 浠庨《灞傚厓绱犲紑濮嬮�掑綊
+      multiArray.forEach((element) => flatten(element));
+      return result; // 杩斿洖鍙寘鍚渶搴曞眰鍏冪礌鐨勪竴缁存暟缁�
     },
     // 鑾峰彇褰撳墠绫诲瀷
     Acquisitiontype() {
@@ -1372,6 +1426,16 @@
           xh: 1,
         },
       ];
+      if (
+        (this.belongWards[0] || this.belongWards[0]) &&
+        this.username == "andmin"
+      ) {
+        if (this.tempbelongWards[0] || this.tempbelongWards[0]) {
+        } else {
+          this.$modal.msgError("璇烽�夋嫨绉戝鎴栫梾鍖�");
+          return;
+        }
+      }
       if (this.checkList[0]) {
         this.form.preachform = this.checkList.join(",");
       } else {
@@ -1462,7 +1526,7 @@
             if (this.form.longTask) {
               this.objyl.longTemp = 1;
             }
-            this.queryParamsdept.type = 1;
+            this.queryParamsdept.type = 2;
             this.queryParamsdept.tempid = row.id;
             this.listDept();
 
@@ -1486,7 +1550,7 @@
           if (this.objyl.suitway)
             this.objyl.suitway = this.objyl.suitway.split(",");
           this.queryParamsdept.tempid = this.form.templateid;
-          this.queryParamsdept.type = 11;
+          this.queryParamsdept.type = 21;
           this.getillness(this.form.libtemplateid);
           // 鎵ц鑾峰彇璇ヤ换鍔℃ā鏉縤d
           this.listDept();
@@ -1551,7 +1615,7 @@
           { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
           { label: "鎮h��", width: "", prop: "name" },
           { label: "韬唤璇�", width: "200", prop: "idcardno" },
-        { label: "鐢佃瘽鍙风爜", width: "180", prop: "telcode" },
+          { label: "鐢佃瘽鍙风爜", width: "180", prop: "telcode" },
           { label: "鎬у埆", width: "", prop: "sex" },
           { label: "骞撮緞", width: "", prop: "age" },
           { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
@@ -1565,7 +1629,7 @@
           { label: "鍏ラ櫌鏃ユ湡", width: "150", prop: "starttime" },
           { label: "鎮h��", width: "", prop: "name" },
           { label: "韬唤璇�", width: "200", prop: "idcardno" },
-        { label: "鐢佃瘽鍙风爜", width: "180", prop: "telcode" },
+          { label: "鐢佃瘽鍙风爜", width: "180", prop: "telcode" },
           { label: "鎬у埆", width: "", prop: "sex" },
           { label: "骞撮緞", width: "", prop: "age" },
           { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
@@ -1585,6 +1649,7 @@
         this.patientqueryParams.cry = 1;
       } else if (this.patientqueryParams.allhosp == 4) {
         this.patientqueryParams.cry = 0;
+        this.patientqueryParams.allhosp = "1";
       }
       // 鏉ユ簮鍒ゆ柇
 
@@ -1725,7 +1790,7 @@
         templatename: "",
         templateid: null,
         libtemplateid: null,
-        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闅忚銆�",
+        kcb: "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄禉涓尰澶т簩闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚銆�",
         jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
       };
 
@@ -1905,6 +1970,9 @@
       this.objyl.ivrTaskTemplateScriptVOList =
         this.objyl.ivrLibaTemplateScriptVOList;
       this.objyl.isoperation = 1;
+      if (this.form.id) {
+        this.objyl.taskid=this.form.id
+      }
       if (this.form.templateid) {
         deleteTaskparticty(this.form.templateid).then((res) => {
           if (res.code == 200) {
@@ -1950,9 +2018,7 @@
         }
       });
     },
-    checkboxChange(checked, value){
-
-    },
+    checkboxChange(checked, value) {},
     // 鏈嶅姟褰㈠紡閫夊彇
     handleCheckedCitiesChange(row) {
       console.log(row, "鏈嶅姟");
@@ -1965,9 +2031,10 @@
       console.log(tag, "tag");
       console.log(this.foncheckList, "foncheckList");
       this.checkList = this.checkList.filter((item) => item != tag.value);
-      this.foncheckList = this.foncheckList.filter(obj => obj.value !== tag.value);
+      this.foncheckList = this.foncheckList.filter(
+        (obj) => obj.value !== tag.value
+      );
       console.log(this.checkList, "checkList");
-
     },
     // 绉戝澶勭悊
     Departmenttreatment() {
@@ -1977,7 +2044,7 @@
           longTemp: this.form.longTask,
           deptCode: item,
           tempid: null,
-          type: 11,
+          type: 21,
         });
       });
 
@@ -1987,7 +2054,7 @@
           longTemp: this.form.longTask,
           deptCode: item,
           tempid: null,
-          type: 11,
+          type: 21,
         });
       });
       console.log(33);

--
Gitblit v1.9.3