From 7f95ba9ac493c69d7bf913d7b925c087fb3a0490 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期四, 07 十二月 2023 18:04:57 +0800
Subject: [PATCH] qxtj

---
 src/views/hosp/history/index.vue |   60 ++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/src/views/hosp/history/index.vue b/src/views/hosp/history/index.vue
index 9645e50..f8d2b97 100644
--- a/src/views/hosp/history/index.vue
+++ b/src/views/hosp/history/index.vue
@@ -255,12 +255,12 @@
                       <el-input size="mini" v-model="scope.row.workType" placeholder="璇疯緭鍏ュ伐绉�" />
                     </template>
                   </el-table-column>
-                  <el-table-column label="鏈夊鍥犵礌" prop="workLogs">
+                  <el-table-column label="鏈夊鍥犵礌" prop="harmTypeLogs">
                     <template slot-scope="scope">
                       <!-- <el-input v-model="scope.row.isOk" placeholder="璇疯緭鍏ユ槸鍚︾棅鎰�" /> -->
-                      <el-select filterable size="mini" v-model="scope.row.workLogs" placeholder="璇烽�夋嫨鏈夊鍥犵礌" clearable>
-                        <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
-                          :value="dict.value" />
+                      <el-select filterable size="mini" v-model="scope.row.harmTypeLogs" multiple placeholder="璇烽�夋嫨鏈夊鍥犵礌" clearable>
+                        <el-option v-for="dict in harmTypeList" :key="dict.aid" :label="dict.harmtype"
+                          :value="dict.aid" />
                       </el-select>
                     </template>
                   </el-table-column>
@@ -293,13 +293,16 @@
 } from "@/api/hosp/history";
 import { Message } from "element-ui";
 import { getOrderList } from "@/api/hosp/order";
-
+import {
+  listHarmType,
+} from "@/api/hosp/harmType";
 export default {
   name: "History",
   dicts: ["tj_smoking_pinlv", "sys_yes_no", "tj_work_status", "tj_work", "dict_ageunit", "dict_job"],
   data() {
     return {
       selectList: [],
+      dataList:[],
       pickerOptions: {
         disabledDate(time) {
           return time.getTime() > Date.now();
@@ -362,6 +365,7 @@
         pageSize: 20,
         cusName: null,
       },
+      harmTypeList:[],
       // 琛ㄥ崟鍙傛暟
       form: {},
       chageall: [],
@@ -401,6 +405,10 @@
     /** 鏌ヨ浣撴璁板綍鍒楄〃 */
     getList() {
       this.loading = true;
+      listHarmType().then(response => {
+        this.harmTypeList = response.rows;
+        this.loading = false;
+      });
       getOrderList(this.queryParams).then((response) => {
         this.orderList = response.data.list;
         if (this.orderList) {
@@ -417,7 +425,9 @@
                   this.orderList[0],
                   true
                 );
+                
               });
+              this.dataList =  this.orderList[0]
             } else {
               this.$refs.multipleTable.clearSelection();
             }
@@ -480,6 +490,7 @@
     },
     // 鍗曢�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
+      this.dataList = []
       this.selectList = selection;
       // this.ids = selection.map((item) => item.askId);
       // this.single = selection.length !== 1;
@@ -501,8 +512,8 @@
           this.sex = false;
         }
       })
-      let userId = selection.map((item) => item.userId);
-      getInfoById(userId).then((response) => {
+      let tjNumber = selection.map((item) => item.tjNumber);
+      getInfoById(tjNumber).then((response) => {
         this.form = response.data;
         if (this.form.xiyan == null) {
           this.form.xiyan = "1"
@@ -570,18 +581,18 @@
     },
 
     delemembers() {
-      this.form.tjAskHistorysList.forEach((item, index) => {
-        this.bingshiall.forEach((item1, index1) => {
-          if (item.id == item1.id) {
-            if (this.bingshiall.length == 1) {
-              this.form.tjAskHistorysList.splice(index, 1)
-            } else {
-              this.form.tjAskHistorysList.splice(index, index1)
+      let that = this
+      if (that.form.tjAskHistorysList.length == that.bingshiall.length) {
+        that.form.tjAskHistorysList = []
+      } else {
+        that.bingshiall.forEach((item1, index1) => {
+          that.form.tjAskHistorysList.forEach((item, index) => {
+            if (item == item1) {
+              that.form.tjAskHistorysList.splice(index, 1)
             }
-
-          }
+          })
         })
-      })
+      }
     },
 
 
@@ -590,30 +601,29 @@
         if (!this.form.workLogs) {
           this.form.workLogs = [];
           this.form.workLogs.push({
-            id: parseInt(this.form.workLogs.length + 1),
+            id: parseInt(length),
             beginTime: "",
             endTime: "",
             workCompany: "",
             workDept: "",
             workType: "",
-            workLogs: "",
+            harmTypeLogs: "",
             fangHu: "",
             Selection,
           });
         } else {
           this.form.workLogs.push({
-            id: parseInt(this.form.workLogs.length + 1),
+            id: parseInt(length),
             beginTime: "",
             endTime: "",
             workCompany: "",
             workDept: "",
             workType: "",
-            workLogs: "",
+            harmTypeLogs: "",
             fangHu: "",
             Selection,
           });
         }
-        console.log(that.form.workLogs)
       } else {
         Message.warning("璇峰厛濉啓瀹㈡埛鍚�");
       }
@@ -628,15 +638,12 @@
 
     delememberss() {
       let that = this
-      console.log(that.chageall)
-     
       if (that.form.workLogs.length == that.chageall.length) {
         that.form.workLogs = []
       } else {
         that.chageall.forEach((item1, index1) => {
           that.form.workLogs.forEach((item, index) => {
-            if (item.id == item1.id) {
-              console.log(111111)
+            if (item == item1) {
               that.form.workLogs.splice(index, 1)
             }
           })
@@ -646,6 +653,7 @@
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
+      this.form.tjNum = this.dataList[0].tjNumber
       updateHistory(this.form).then((response) => {
         this.$modal.msgSuccess("淇敼鎴愬姛");
       });

--
Gitblit v1.8.0