From d0594c96b1905f461ebf4dbdcc49a5c6230f1102 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期二, 26 十二月 2023 15:33:00 +0800
Subject: [PATCH] su

---
 src/views/doctor/check/index.vue |  104 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 73 insertions(+), 31 deletions(-)

diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index 60241f2..0af36fa 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -230,7 +230,7 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-            <el-form-item label="鐢宠浜�" prop="hzDoctorId">
+            <el-form-item label="鐢宠浜�" prop="hzDoctorId" style="margin-top:22px">
               <el-select
                 v-model="form.hzDoctorId"
                 placeholder="璇烽�夋嫨"
@@ -853,7 +853,7 @@
         name: null,
       },
       rules: {
-        hzType: [{ required: true, message: "", trigger: "change" }],
+        hzType: [{ required: true, message: "浼氳瘖绉戝涓哄繀濉」", trigger: "change" }],
       },
     };
   },
@@ -1170,12 +1170,22 @@
     },
 
     hadleedit(row) {
+      console.log(row, 111);
       this.form.hzType = row.hzType;
       this.form.id = row.id;
+      this.form.hzDeptId = row.hzDeptNameList;
+      // row.hzDeptIdList.forEach(item=>{
+      //   console.log(item,222);
+      //   this.deptList.forEach(items=>{
+      //      console.log(item,333);
+      //      if(item == items.deptId){
+      //       this.form.hzDeptNameList = 
+      //      }
+      //   })
+      // })
     },
 
     submitFormapply() {
-      console.log(this.form);
       let data = {};
       this.userList.forEach((item1) => {
         if (this.form.hzDoctorId == item1.userId) {
@@ -1183,36 +1193,49 @@
         }
       });
       if (this.form.hzType != undefined) {
-        if (this.form.hzDeptId && this.form.id) {
-          // let hzDeptId = ""
-          // this.form.hzDeptId.forEach(item => {
-          //   hzDeptId += item + ','
-          // })
-          data = {
-            tjNumber: this.form.tjNumber,
-            userId: this.form.cusId,
-            userName: this.form.cusName,
-            hzDeptIdList: this.form.hzDeptId,
-            hzDoctorId: this.form.hzDoctorId,
-            hzType: this.form.hzType,
-            orderId: this.form.orderId,
-            hzDoctorName: this.form.hzDoctorName,
-            id: this.form.id,
-          };
-        } else {
-          data = {
-            tjNumber: this.form.tjNumber,
-            userId: this.form.cusId,
-            userName: this.form.cusName,
-            hzDoctorId: this.form.hzDoctorId,
-            hzType: this.form.hzType,
-            orderId: this.form.orderId,
-            hzDoctorName: this.form.hzDoctorName,
-          };
-        }
+        // if (this.form.hzDeptId && this.form.id) {
+        //   console.log(111);
+        //   // let hzDeptId = ""
+        //   // this.form.hzDeptId.forEach(item => {
+        //   //   hzDeptId += item + ','
+        //   // })
+        //   data = {
+        //     tjNumber: this.form.tjNumber,
+        //     userId: this.form.cusId,
+        //     userName: this.form.cusName,
+        //     hzDeptIdList: this.form.hzDeptId,
+        //     hzDoctorId: this.form.hzDoctorId,
+        //     hzType: this.form.hzType,
+        //     orderId: this.form.orderId,
+        //     hzDoctorName: this.form.hzDoctorName,
+        //     id: this.form.id,
+        //   };
+        // } else {
+        //   console.log(222);
+        //   data = {
+        //     tjNumber: this.form.tjNumber,
+        //     userId: this.form.cusId,
+        //     userName: this.form.cusName,
+        //     hzDoctorId: this.form.hzDoctorId,
+        //     hzType: this.form.hzType,
+        //     orderId: this.form.orderId,
+        //     hzDoctorName: this.form.hzDoctorName,
+        //   };
+        // }
         this.$refs["form"].validate((valid) => {
           if (valid) {
             if (this.form.id != null) {
+              data = {
+                tjNumber: this.form.tjNumber,
+                userId: this.form.cusId,
+                userName: this.form.cusName,
+                hzDeptIdList: this.form.hzDeptId,
+                hzDoctorId: this.form.hzDoctorId,
+                hzType: this.form.hzType,
+                orderId: this.form.orderId,
+                hzDoctorName: this.form.hzDoctorName,
+                id: this.form.id,
+              };
               updateHzlog(data).then((res) => {
                 if (res.code == 200) {
                   this.$modal.msgSuccess("淇敼鎴愬姛");
@@ -1222,7 +1245,19 @@
                 }
               });
             } else {
-              addHzlog(data).then((res) => {
+              data = {
+                tjNumber: this.form.tjNumber,
+                userId: this.form.cusId,
+                userName: this.form.cusName,
+                hzDeptIdList: this.form.hzDeptId,
+                hzDoctorId: this.form.hzDoctorId,
+                hzType: this.form.hzType,
+                orderId: this.form.orderId,
+                hzDoctorName: this.form.hzDoctorName,
+                id: this.form.id,
+              };
+              if(this.form.hzDeptId.length != 0){
+                addHzlog(data).then((res) => {
                 if (res.code == 200) {
                   this.$modal.msgSuccess("鐢宠鎴愬姛");
                   this.form = {};
@@ -1231,6 +1266,10 @@
                 }
               });
               this.open = false;
+              }else{
+                this.$modal.msgError("璇烽�夋嫨浼氳瘖绉戝");
+              }
+              
             }
           }
         });
@@ -1351,6 +1390,9 @@
       if (this.tableAll.cusSex === 1) {
         this.tableAll.cusSex = "濂�";
       }
+      if (this.tableAll.cusSex === 2) {
+        this.tableAll.cusSex = "鏈煡";
+      }
       this.tjNumber = row.tjNumber;
       let num = 0;
       getParentList(this.tjNumber).then((response) => {

--
Gitblit v1.8.0