From 94c40e717c313d91bde25bff7c6938dfc21d9aaf Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期五, 24 五月 2024 18:14:14 +0800
Subject: [PATCH] qxtj

---
 src/views/hosp/order/index.vue |  167 ++++++++++++++++++++++++++++++-------------------------
 1 files changed, 91 insertions(+), 76 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 20ea617..e48c0cf 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -96,6 +96,16 @@
           >瀵煎嚭</el-button
         >
       </el-col>
+     
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          size="mini"
+          @click="handleRevoke"
+          :disabled="single"
+          >鎾ら攢绛惧埌</el-button
+        >
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -106,6 +116,7 @@
           >琛ュ綍椤圭洰</el-button
         >
       </el-col>
+      
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -412,7 +423,7 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen"
-      width="1500px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
@@ -426,7 +437,7 @@
           <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
           </el-input>
           <div class="tab3">
-            <div class="outside1">
+           
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -434,23 +445,22 @@
                 :props="defaultProps"
                 show-checkbox
                 node-key="proId"
-                @check-change="handleCurrentChecked"
+                @check="handleCurrentChecked"
                 :default-checked-keys="checkedkey"
                 :filter-node-method="filterNode"
                 ref="tree"
               >
               </el-tree>
-            </div>
+           
           </div>
         </el-col>
-        <el-col :span="4">
+        <el-col :span="5">
           <div
             style="text-align: center; margin-bottom: 10px; margin-top: 10px"
           >
-            椤圭洰鍒楄〃
+            鏄庣粏椤圭洰鍒楄〃
           </div>
           <div class="tab3">
-            <div class="outside1">
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -463,33 +473,24 @@
                 :default-checked-keys="checkedListkey"
               >
               </el-tree>
-            </div>
           </div>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="11">
           <div class="grid-content bg-purple">
-            <div style="text-align: center; margin-bottom: 10px">
+            <div style="text-align: center; margin-bottom: 10px;margin-top: 10px">
               宸查�夐」鐩垪琛�
             </div>
-            <div
-              style="
-                padding: 0px 6px;
-                border: 1px solid #e6ebf5;
-                max-height: 420px;
-                overflow: auto;
-              "
-            >
               <el-table
                 :data="DataList"
                 border
                 style="width: 100%"
-                height="250"
+                height="400"  :span-method="objectSpanMethod"
               >
-                <el-table-column prop="propinName" label="鐖堕」">
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" >
                 </el-table-column>
-                <el-table-column prop="proName" label="椤圭洰" width="180">
+                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
                 </el-table-column>
-                <el-table-column prop="proPrice" label="鍘熶环">
+                <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                 </el-table-column>
 
                 <el-table-column
@@ -497,7 +498,7 @@
                   align="center"
                   fixed="right"
                   class-name="small-padding fixed-width"
-                  width="80px"
+                  width="50px"
                 >
                   <template slot-scope="scope">
                     <el-button
@@ -505,7 +506,8 @@
                       type="text"
                       icon="el-icon-delete"
                       @click="handleDelete(scope.row)"
-                      >鍒犻櫎</el-button
+                      title="鍒犻櫎"
+                      ></el-button
                     >
                   </template>
                 </el-table-column>
@@ -522,7 +524,6 @@
                   </el-collapse-item>
                 </div>
               </el-collapse>
-            </div>
             <template>
               <el-form :model="form">
                 <el-form-item label="浣撴绫诲瀷" prop="tjType">
@@ -593,7 +594,7 @@
     <el-dialog
       :title="title"
       :visible.sync="Projectopen1"
-      width="1500px"
+      width="1100px"
       style="height: 860px"
       append-to-body
     >
@@ -607,7 +608,7 @@
           <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
           </el-input>
           <div class="tab3">
-            <div class="outside1">
+           
               <el-tree
                 class="filter-tree"
                 v-loading="loading"
@@ -621,14 +622,14 @@
                 ref="tree"
               >
               </el-tree>
-            </div>
+           
           </div>
         </el-col>
-        <el-col :span="4">
+        <el-col :span="5">
           <div
             style="text-align: center; margin-bottom: 10px; margin-top: 10px"
           >
-            椤圭洰鍒楄〃
+          鏄庣粏椤圭洰鍒楄〃
           </div>
           <div class="tab3">
             <div class="outside1">
@@ -647,30 +648,23 @@
             </div>
           </div>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="11">
           <div class="grid-content bg-purple">
-            <div style="text-align: center; margin-bottom: 10px">
+            <div style="text-align: center; margin-bottom: 10px;margin-top: 10px">
               宸查�夐」鐩垪琛�
             </div>
-            <div
-              style="
-                padding: 0px 6px;
-                border: 1px solid #e6ebf5;
-                max-height: 420px;
-                overflow: auto;
-              "
-            >
+            
               <el-table
                 :data="DataList"
                 border
                 style="width: 100%"
-                height="250"
+                height="400"  :span-method="objectSpanMethod"
               >
-                <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
+              <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" >
                 </el-table-column>
-                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="180">
+                <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
                 </el-table-column>
-                <el-table-column prop="proPrice" label="鍘熶环">
+                <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                 </el-table-column>
 
                 <el-table-column
@@ -678,7 +672,7 @@
                   align="center"
                   fixed="right"
                   class-name="small-padding fixed-width"
-                  width="80px"
+                  width="50px"
                 >
                   <template slot-scope="scope">
                     <el-button
@@ -694,7 +688,7 @@
               <el-collapse v-model="activeName" accordion v-if="list1">
                 <div>
                   <el-collapse-item title="璇烽�夋嫨椤圭洰">
-                    <el-table :data="DataList" border style="width: 100%">
+                    <el-table :data="DataList" border style="width: 100%" height="400"  :span-method="objectSpanMethod">
                       <el-table-column prop="proName" label="椤圭洰" width="180">
                       </el-table-column>
                       <el-table-column prop="ordPrice" label="鍘熶环">
@@ -703,7 +697,7 @@
                   </el-collapse-item>
                 </div>
               </el-collapse>
-            </div>
+            
             <template>
               <el-form :model="form">
                 <el-form-item label="浣撴绫诲瀷" prop="tjType">
@@ -818,7 +812,7 @@
   hasReport,
   getPdf,
   getOrderList,
-  getNewDateList,
+  getNewDateList,revokeTjOrderByTjNum,
 } from "@/api/hosp/order";
 import moment from "moment";
 import { getwater } from "@/api/hosp/customer";
@@ -880,6 +874,7 @@
       loading: true,
       // 閫変腑鏁扮粍
       ids: [],
+      dataObj:{},
       // 闈炲崟涓鐢�
       single: true,
       // 闈炲涓鐢�
@@ -1074,6 +1069,13 @@
           this.$message.error("璇ョ敤鎴锋殏鏃犻」鐩紒");
         }
       });
+    },
+
+    handleRevoke(){
+      revokeTjOrderByTjNum(this.tjnumbers).then(res => {
+        this.$modal.msgSuccess("鎾ら攢鎴愬姛")
+        this.getList();
+      })
     },
     /** 鐐瑰嚮鏄剧ず浣撴鎶ュ憡鎶ヨ〃*/
     // viewReport(row) {
@@ -1287,20 +1289,15 @@
         cusPhone: this.cusPhone,
         cusSex: this.cusSex,
       };
-      // if (row.tjType) {
-      //   this.form.tjType = parseInt(row.tjType);
-      // } else {
-      //   this.form.tjType = 0;
-      // }
       /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
       this.getDataList();
       this.Projectopen1 = true;
       this.title = "琛ュ綍椤圭洰";
     },
+   
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
     handleCurrentChecked(data, checked, checkedNodes) {
-      console.log(data, checked, checkedNodes);
-      console.log(this.DataList,22222);
+      this.dataObj = data
       if (checked.checkedNodes.length != 0) {
         this.$refs.tree.setCheckedKeys([data.proId]);
         let proId = data.proId;
@@ -1309,13 +1306,13 @@
           this.TreedataList.forEach((item) => {
             this.checkedListkey.push(item.proId);
             this.DataList.push(item);
+            this.spliceData();
             this.DataList.forEach((item1) => {
               if (item1.proParentId == data.proId) {
                 item1.propinName = data.proName;
               }
             });
           });
-          this.spliceData(this.DataList);
           this.TotalPrice1 = 0;
           if (this.DataList.length != 0) {
             this.list1 = false;
@@ -1328,34 +1325,23 @@
         let proId = data.proId;
         getProSonDxList(proId).then((res) => {
           this.TreedataList = res.data.list;
-          this.DataList.forEach((item, index) => {
-            this.TreedataList.forEach((item1) => {
-              if (item.proId == item1.proId) {
-                this.DataList.splice(index, this.TreedataList.length);
-                this.TotalPrice1 = 0;
-                this.DataList.forEach((item1) => {
-                  this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
-                });
-              }
-            });
-          });
+          this.checkedListkey = [];
         });
-        this.checkedListkey = [];
-        console.log(this.DataList,1111)
+        
       }
     },
 
-    spliceData(row) {
-      for (var i = 0; i < row.length; i++) {
-        for (var j = i + 1; j < row.length; j++) {
-          if (row[i].proId == row[j].proId) {
+    spliceData() {
+      for (var i = 0; i < this.DataList.length; i++) {
+        for (var j = i + 1; j < this.DataList.length; j++) {
+          if (this.DataList[i].proId == this.DataList[j].proId) {
             //濡傛灉绗竴涓瓑浜庣浜屼釜锛宻plice鏂规硶鍒犻櫎绗簩涓�
-            row.splice(j, 1);
+            this.DataList.splice(j, 1);
             j--;
           }
         }
       }
-      return row;
+      return this.DataList;
     },
 
     // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐�
@@ -1372,6 +1358,12 @@
         });
       } else if (checked == true) {
         this.DataList.push(data);
+        this.DataList.forEach((item1) => {
+              if (item1.proParentId == this.dataObj.proId) {
+                item1.propinName = this.dataObj.proName;
+              }
+            });
+        this.spliceData()
         this.TotalPrice1 = 0;
         this.DataList.forEach((item1) => {
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
@@ -1390,6 +1382,28 @@
           });
         }
       });
+    },
+
+     //  // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
+     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      console.log(row, column, rowIndex, columnIndex)
+      let fields = ["propinName"];
+      let cellValue = row[column.property];
+      if (cellValue && fields.includes(column.property)) {
+        let prevRow = this.DataList[rowIndex - 1];
+        let nextRow = this.DataList[rowIndex + 1];
+        if (prevRow && prevRow[column.property] === cellValue) {
+          return { rowspan: 0, colspan: 0 };
+        } else {
+          let countRowspan = 1;
+          while (nextRow && nextRow[column.property] === cellValue) {
+            nextRow = this.DataList[++countRowspan + rowIndex];
+          }
+          if (countRowspan > 1) {
+            return { rowspan: countRowspan, colspan: 1 };
+          }
+        }
+      }
     },
 
     // 鏀惰垂鎸夐挳
@@ -1562,7 +1576,7 @@
 // }
 
 .outside {
-  width: 700px;
+  width: 500px;
   display: flex;
   margin-top: 8px;
 }
@@ -1570,6 +1584,7 @@
 .tab3 {
   max-height: 500px;
   overflow-y: auto;
+  border: 1px solid #d9d9d9;
 }
 
 .outside1 {

--
Gitblit v1.8.0