From b10795e18a07b9beb72f25406f26f42491828be5 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 22 十月 2024 09:20:19 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/Missioncreation.vue |  323 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 267 insertions(+), 56 deletions(-)

diff --git a/src/views/patient/propaganda/Missioncreation.vue b/src/views/patient/propaganda/Missioncreation.vue
index 3aaec8c..edbe31c 100644
--- a/src/views/patient/propaganda/Missioncreation.vue
+++ b/src/views/patient/propaganda/Missioncreation.vue
@@ -383,6 +383,17 @@
                         >鍒犻櫎</el-button
                       >
                     </el-col>
+                    <el-col :span="1.5">
+                      <el-button
+                        type="info"
+                        plain
+                        icon="el-icon-upload2"
+                        size="medium"
+                        @click="handleImport"
+
+                        >瀵煎叆</el-button
+                      >
+                    </el-col>
 
                     <!-- <el-col :span="1.5"> </el-col> -->
                   </el-row>
@@ -437,30 +448,24 @@
               v-show="showSearch"
               label-width="98px"
             >
-              <el-form-item label="鎮h�呭悕绉帮細">
-                <el-input v-model="patientqueryParams.name"></el-input>
+              <el-form-item label="鎮h�咃細">
+                <el-input
+                  v-model="patientqueryParams.name"
+                  @keyup.enter.native="handleQuery"
+                ></el-input>
               </el-form-item>
-
-              <!-- <el-form-item label="灏辫瘖绉戝" prop="status">
-                <el-select
-                  v-model="patientqueryParams.topic"
-                  placeholder="璇烽�夋嫨"
+              <el-select
+                v-model="patientqueryParams.searchscope"
+                placeholder="璇烽�夋嫨鎮h�呰寖鍥�"
+              >
+                <el-option
+                  v-for="item in source"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 >
-                  <el-option-group
-                    v-for="group in topicoptions[0].children"
-                    :key="group.deptName"
-                    :label="group.deptName"
-                  >
-                    <el-option
-                      v-for="item in group.children"
-                      :key="item.deptId"
-                      :label="item.deptName"
-                      :value="item.deptId"
-                    >
-                    </el-option>
-                  </el-option-group>
-                </el-select>
-              </el-form-item> -->
+                </el-option>
+              </el-select>
 
               <el-form-item>
                 <el-button
@@ -506,6 +511,7 @@
         >
       </span>
     </el-dialog>
+    <!-- 妯℃澘棰勮 -->
     <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="60%">
       <div class="preview-left">
         <!-- 鍗曢�� -->
@@ -515,6 +521,98 @@
         <!-- <el-button @click="previewGo">鍓嶅線妯℃澘璇︽儏淇敼</el-button> -->
         <el-button type="primary" @click="previewFn">纭浣跨敤</el-button>
       </span>
+    </el-dialog>
+    <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
+    <el-dialog
+      :title="upload.title"
+      :visible.sync="upload.open"
+      width="70%"
+      append-to-body
+    >
+      <el-steps :active="dractive" simple>
+        <el-step title="涓婁紶瀵煎叆鏂囦欢" icon="el-icon-upload"></el-step>
+        <el-step title="瀵煎叆妫�鏌�" icon="el-icon-picture"></el-step>
+      </el-steps>
+      <!-- 涓婁紶瀵煎叆鏂囦欢 -->
+      <div class="download" v-if="dractive == 1">
+        <el-upload
+          class="upload-demo"
+          ref="upload"
+          :limit="1"
+          accept=".xlsx, .xls"
+          :headers="upload.headers"
+          :action="upload.url"
+          :disabled="upload.isUploading"
+          :on-progress="handleFileUploadProgress"
+          :on-success="handleFileSuccess"
+          drag
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+          <div class="el-upload__tip text-center" slot="tip">
+            <!-- <div class="el-upload__tip" slot="tip">
+              <el-checkbox v-model="upload.updateSupport" />
+              鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+            </div> -->
+            <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+            <el-link
+              type="primary"
+              :underline="false"
+              style="font-size: 24px; vertical-align: baseline"
+              @click="importTemplate"
+              >涓嬭浇妯℃澘
+            </el-link>
+            <!-- <el-link
+              type="success"
+              :underline="false"
+              style="font-size: 24px; vertical-align: baseline"
+              href="http://m.qpic.cn/psc?/V50ZTolo1AIhq00dqrJP2169QM2VHGTU/ruAMsa53pVQWN7FLK88i5qfmCJclyMduqqL6kjE4h7TXDAjimVtmLmTyGVfF4qlkyOISsYQ4Mxx705X2tkXEIUPrfCS4L4yK.f11SmO8Tq0!/b&bo=twb0AgAAAAADB2U!&rf=viewer_4"
+              target="_blank"
+            >
+              鏌ョ湅妯℃澘</el-link
+            > -->
+          </div>
+        </el-upload>
+      </div>
+
+      <!-- 瀹屾垚 -->
+      <div class="drexamine" v-else-if="dractive == 2">
+        <div style="display: flex">
+          <img src="@/assets/images/瀵煎叆.png" />
+          <p>瀵煎叆鎮h�呮垚鍔燂紒</p>
+          <p>
+            鏈鎴愬姛瀵煎叆<span style="color: #72d3a9; font-size: 20px">{{
+              uploadingData.length
+            }}</span
+            >浣嶆偅鑰�
+          </p>
+        </div>
+
+        <el-table :data="uploadingData" style="width: 100%">
+          <el-table-column prop="serial" label="鎮h�卛d"> </el-table-column>
+          <el-table-column prop="name" label="濮撳悕"> </el-table-column>
+          <el-table-column prop="sex" label="鎬у埆"> </el-table-column>
+          <el-table-column prop="idcardno" width="300" label="璇佷欢鍙风爜"> </el-table-column>
+          <el-table-column prop="goday" label="鍑虹敓鏃ユ湡"> </el-table-column>
+          <el-table-column prop="telcode" width="200" label="鑱旂郴鏂瑰紡"> </el-table-column>
+          <el-table-column prop="createTime"  width="200" label="鍒涘缓鏃ユ湡">
+          </el-table-column>
+        </el-table>
+        <!-- <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="geterryList"
+        /> -->
+      </div>
+
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">{{
+          dractive == 1 ? "涓嬩竴姝�" : "鍔犲叆浠诲姟"
+        }}</el-button>
+        <el-button @click="submitclose">鍙� 娑�</el-button>
+      </div>
     </el-dialog>
     <el-drawer
       title="瀹f暀鍐呭鍒楄〃"
@@ -643,7 +741,7 @@
   getheLibraryAssort,
 } from "@/api/AiCentre/index";
 import { listDept } from "@/api/system/dept";
-
+import { getToken } from "@/utils/auth";
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
 
 export default {
@@ -671,6 +769,7 @@
       belongWards: [],
       tableLabel: [],
       questionList: [],
+      uploadingData: [],
       htmlRichText: "<p>Hello, <strong>world</strong>!</p>",
       // 鎮h�呰〃鍗�
       tableLabelhz: [
@@ -720,6 +819,22 @@
         { label: "閽夐拤", value: 6 },
         { label: "鏅鸿兘鏈哄櫒浜�", value: 7 },
       ],
+      upload: {
+        // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛�
+        open: false,
+        // 寮瑰嚭灞傛爣棰橈紙鐢ㄦ埛瀵煎叆锛�
+        title: "",
+        // 鏄惁绂佺敤涓婁紶
+        isUploading: false,
+        // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+        updateSupport: 0,
+        // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+        headers: { Authorization: "Bearer " + getToken() },
+        // 涓婁紶鐨勫湴鍧�
+        url: process.env.VUE_APP_BASE_API + "/smartor/import/importPatInfo",
+      },
+      //瀵煎叆杩涘害
+      dractive: 1,
       // 鏃堕棿澶勭悊
       daytime: [], //鏃ユ湡
       applydaytime: [], //璁$畻鏃ユ湡
@@ -815,12 +930,30 @@
           label: "鍑洪櫌鐥呬汉",
         },
         {
+          value: "4",
+          label: "鍦ㄩ櫌鐥呬汉",
+        },
+        {
           value: "2",
           label: "闂ㄨ瘖鐥呬汉",
         },
         {
           value: "3",
           label: "浣撴鐥呬汉",
+        },
+      ],
+      source: [
+        {
+          value: 0,
+          label: "鎵�灞炴偅鑰�",
+        },
+        {
+          value: 1,
+          label: "绉戝鎮h��",
+        },
+        {
+          value: 2,
+          label: "鐥呭尯鎮h��",
         },
       ],
       quote: false,
@@ -971,6 +1104,7 @@
         this.form.isoperation = 2;
       } else {
         this.form.isoperation = 1;
+        this.form.sendState=1;
       }
       if (!this.form.type) {
         this.form.type = this.$route.query.type;
@@ -1048,35 +1182,7 @@
         '<img$1style="width:100%;height:auto;"$3>'
       );
     },
-    // 澶勭悊闂灞傚彉閲�
-    // Variablehandling(arr, type) {
-    //   let Variablist = [];
-    //   if (type == 1) {
-    //     console.log(arr);
-    //     // 寰幆闂
-    //     arr.forEach((res) => {
-    //       console.log(JSON.parse(res.otherdata), "ss");
-    //       // 寰幆閫夐」
-    //       JSON.parse(res.otherdata).forEach((item) => {
-    //         if (item.default != 1) {
-    //           Variablist.push({
-    //             value: item.variate,
-    //             fill: "",
-    //             name: item.variatename,
-    //           });
-    //         }
-    //       });
-    //     });
-    //     console.log(Variablist, "Variablist");
-    //     const Aarr = Variablist.filter(
-    //       (obj, index, self) =>
-    //         index ===
-    //         self.findIndex((t) => t.name === obj.name && t.value === obj.value)
-    //     );
-    //     this.variableList = this.transitionList.concat(Aarr);
-    //     // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
-    //   }
-    // },
+
     // 瀛愪换鍔′簩绾у脊妗�
     handleAddpatient(row) {
       this.allpids = [];
@@ -1109,9 +1215,31 @@
       }
       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) => {
@@ -1128,7 +1256,7 @@
     handleExport() {},
 
     // 閫夋嫨鎮h�呰〃鏁版嵁
-    handleSelectionChange(selection) {
+    handleSelectionChange(selection,type) {
       console.log("澶氶�夋偅鑰�");
       this.SelectPatientslist = selection;
       this.multiple = !selection.length;
@@ -1139,7 +1267,14 @@
         if (!isExist) {
           item.isoperation = 1;
           item.patid = item.id;
-          item.hospType = this.patientqueryParams.allhosp;
+          if (item.idcardno) {
+            item.sfzh = item.idcardno;
+          }
+          if (type) {
+            item.hospType=type
+          }else{
+            item.hospType = this.patientqueryParams.allhosp;
+          }
           this.overallCase.push(item);
           this.form.patTaskRelevances.push(item);
         }
@@ -1232,7 +1367,7 @@
             this.overallCase = this.form.patTaskRelevances.concat();
             this.checkList = this.form.preachform.split(",");
             console.log(this.form.showDate, "this.form");
-            if (this.form.daytime)this.daytime = this.form.showDate.split(",");
+            if (this.form.daytime) this.daytime = this.form.showDate.split(",");
             console.log(this.newadd, "渚濈収");
 
             if (this.form.showTimeMorn) {
@@ -1426,6 +1561,47 @@
         this.checkList = list;
       }
     },
+    /** 瀵煎叆鎸夐挳鎿嶄綔 */
+    handleImport() {
+      this.upload.title = "鐢ㄦ埛瀵煎叆";
+      this.upload.open = true;
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 鏂囦欢涓婁紶鎴愬姛澶勭悊
+    handleFileSuccess(response, file, fileList) {
+      this.upload.isUploading = false;
+      this.uploadingData = response.rows;
+      console.log(response, "鏂囦欢");
+
+      this.$refs.upload.clearFiles();
+    },
+    // 鎻愪氦涓婁紶鏂囦欢
+    submitFileForm() {
+      // 涓婁紶
+      if (this.dractive == 1) {
+        this.$refs.upload.submit();
+        this.dractive++;
+      } else if (this.dractive == 2) {
+        this.handleSelectionChange(this.uploadingData,4);
+        this.upload.open = false;
+        this.dractive = 1
+      }
+    },
+
+    /** 涓嬭浇妯℃澘鎿嶄綔 */
+    importTemplate() {
+      this.download(
+        "smartor/import/getImportPatTemplate",
+        {},
+        `user_template_${new Date().getTime()}.xlsx`
+      );
+    },
+    submitclose() {
+      this.upload.open = false;
+      this.dractive = 1;
+    },
   },
 };
 </script>
@@ -1561,6 +1737,41 @@
     }
   }
 }
+.download {
+  text-align: center;
+  .el-upload__tip {
+    font-size: 23px;
+  }
+  .el-upload__text {
+    font-size: 23px;
+  }
+}
+.uploading {
+  margin-top: 20px;
+  margin: 20px;
+  padding: 30px;
+  background: #ffffff;
+  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);
+}
+.drexamine {
+  // display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 20px;
+  background: #daeaf5;
+  img {
+    width: 50px;
+    height: 50px;
+  }
+}
+.button-textsc {
+  color: #28cfe6;
+}
+.button-textxg {
+  color: #de7897;
+}
 ::v-deep .addtopic-input {
   input {
     background: #02a7f0;

--
Gitblit v1.9.3