浏览代码

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 10 个月前
父节点
当前提交
6e48f19dc5
共有 1 个文件被更改,包括 71 次插入38 次删除
  1. 71 38
      src/xt_pages/medicalScheduling/index.vue

+ 71 - 38
src/xt_pages/medicalScheduling/index.vue 查看文件

@@ -42,7 +42,11 @@
42 42
             </div>
43 43
             <div class="schedulingTable" style="display:flex;justify-content: space-between;">
44 44
                 <div style="width: 70%">
45
-                    <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }"  @cell-click="clickThis" :cell-style="tableCellStyle">
45
+                    <el-table :data="tableData" border
46
+                    :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}"
47
+                    :row-style="{ color: '#303133' }"  @cell-click="clickThis" :cell-style="tableCellStyle"
48
+                    @cell-mouse-enter="hoverMouse" @cell-mouse-leave="leavemouse">
49
+                    <!-- @cell-mouse-enter="hoverMouse" @cell-mouse-leave="leavemouse" -->
46 50
                         <el-table-column prop="name" label="医护姓名" style="width:16%" align="center">
47 51
                             <template slot-scope="scope">
48 52
                                 <span>{{scope.row.user_name}}</span>
@@ -50,11 +54,17 @@
50 54
                         </el-table-column>
51 55
                         <el-table-column :label="'周一\n(' + weekDayArr[0] + ')'" style="width:200px" align="center">
52 56
                             <template slot-scope="scope">
57
+                                <div v-if="name==scope.row.user_name&&column_lie =='周一' ? true:false">
58
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true" >
59
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
60
+                                      circle @click.stop=""
61
+                                    ></el-button>
62
+                                  </div>
53 63
                                 <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
54 64
                                   <el-button type="danger" size="mini" icon="el-icon-close" circle @click.stop="toClick(scope.row,scope.$index)"></el-button>
55 65
                                 </div>
56 66
                                 <div @click="hangdleClick(scope.row,scope.$index,0)">
57
-                                    <el-dropdown trigger="click" @command="changeSchedule">
67
+                                    <el-dropdown trigger="click" @command="changeSchedule" >
58 68
                                         <span class="el-dropdown-link" v-if='getClassAttributes(scope.row.user_name,1) == 2' style="color:red">
59 69
                                             <span>{{ getClass(scope.row.user_name,1) }}</span><i v-if="getTimestamp(weekDayArr[0])>=timeNow && scope.row.admin_user_id!=1000000?true:false" class="el-icon-arrow-down el-icon--right"></i>
60 70
                                         </span>
@@ -70,11 +80,14 @@
70 80
                         </el-table-column>
71 81
                         <el-table-column prop="name" :label="'周二\n(' + weekDayArr[1] + ')'" style="width:14%" align="center">
72 82
                              <template slot-scope="scope">
73
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
74
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
75
-                                    circle @click.stop=""   
83
+                              <div v-if="name==scope.row.user_name&&column_lie =='周二' ? true:false">
84
+                                <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
85
+                                  <el-button type="danger" size="mini" icon="el-icon-close"
86
+                                    circle @click.stop=""
76 87
                                   ></el-button>
77 88
                                 </div>
89
+                              </div>
90
+
78 91
                                 <div @click="hangdleClick(scope.row,scope.$index,1)">
79 92
                                     <el-dropdown trigger="click" @command="changeSchedule">
80 93
                                         <span class="el-dropdown-link" v-if='getClassAttributes(scope.row.user_name,2) == 2' style="color:red">
@@ -92,10 +105,12 @@
92 105
                         </el-table-column>
93 106
                         <el-table-column prop="name" :label="'周三\n(' + weekDayArr[2] + ')'" style="width:14%" align="center">
94 107
                              <template slot-scope="scope">
95
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
96
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
97
-                                    circle @click.stop=""   
98
-                                  ></el-button>
108
+                                <div v-if="name==scope.row.user_name&&column_lie =='周三' ? true:false">
109
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
110
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
111
+                                      circle @click.stop=""
112
+                                    ></el-button>
113
+                                  </div>
99 114
                                 </div>
100 115
                                 <div @click="hangdleClick(scope.row,scope.$index,2)">
101 116
                                     <el-dropdown trigger="click" @command="changeSchedule">
@@ -114,10 +129,12 @@
114 129
                         </el-table-column>
115 130
                         <el-table-column prop="name" :label="'周四\n(' + weekDayArr[3] + ')'" style="width:14%" align="center">
116 131
                              <template slot-scope="scope">
117
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
118
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
119
-                                    circle @click.stop=""   
120
-                                  ></el-button>
132
+                                <div v-if="name==scope.row.user_name&&column_lie =='周四' ? true:false">
133
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
134
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
135
+                                      circle @click.stop=""
136
+                                    ></el-button>
137
+                                  </div>
121 138
                                 </div>
122 139
                                 <div @click="hangdleClick(scope.row,scope.$index,3)">
123 140
                                     <el-dropdown trigger="click" @command="changeSchedule">
@@ -136,10 +153,12 @@
136 153
                         </el-table-column>
137 154
                         <el-table-column prop="name" :label="'周五\n(' + weekDayArr[4] + ')'" style="width:14%" align="center">
138 155
                              <template slot-scope="scope">
139
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
140
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
141
-                                    circle @click.stop=""   
142
-                                  ></el-button>
156
+                                <div v-if="name==scope.row.user_name&&column_lie =='周五' ? true:false">
157
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
158
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
159
+                                      circle @click.stop=""
160
+                                    ></el-button>
161
+                                  </div>
143 162
                                 </div>
144 163
                                 <div @click="hangdleClick(scope.row,scope.$index,4)">
145 164
                                     <el-dropdown trigger="click" @command="changeSchedule">
@@ -158,10 +177,12 @@
158 177
                         </el-table-column>
159 178
                         <el-table-column prop="name" :label="'周六\n(' + weekDayArr[5] + ')'" style="width:14%" align="center">
160 179
                              <template slot-scope="scope">
161
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
162
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
163
-                                    circle @click.stop=""   
164
-                                  ></el-button>
180
+                                <div v-if="name==scope.row.user_name&&column_lie =='周六' ? true:false">
181
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
182
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
183
+                                      circle @click.stop=""
184
+                                    ></el-button>
185
+                                  </div>
165 186
                                 </div>
166 187
                                 <div @click="hangdleClick(scope.row,scope.$index,5)">
167 188
                                     <el-dropdown trigger="click" @command="changeSchedule">
@@ -180,10 +201,12 @@
180 201
                         </el-table-column>
181 202
                         <el-table-column prop="name" :label="'周日\n(' + weekDayArr[6] + ')'" style="width:14%" align="center">
182 203
                              <template slot-scope="scope">
183
-                                <div class="del_table_btn" v-show="scope.row.user_name=='合计'? false : true">
184
-                                  <el-button type="danger" size="mini" icon="el-icon-close" 
185
-                                    circle @click.stop=""   
186
-                                  ></el-button>
204
+                                <div v-if="name==scope.row.user_name&&column_lie =='周日' ? true:false">
205
+                                  <div class="del_table_btns" v-show="scope.row.user_name=='合计'? false : true">
206
+                                    <el-button type="danger" size="mini" icon="el-icon-close"
207
+                                      circle @click.stop=""
208
+                                    ></el-button>
209
+                                  </div>
187 210
                                 </div>
188 211
                                 <div @click="hangdleClick(scope.row,scope.$index,6)">
189 212
                                     <el-dropdown trigger="click" @command="changeSchedule">
@@ -444,7 +467,9 @@ export default {
444 467
            nurseTableData:[],
445 468
            doctorTableData:[],
446 469
            exportDialogVisible:false,
447
-           month_time:""
470
+           month_time:"",
471
+           name:'',
472
+           column_lie:''
448 473
         }
449 474
     },
450 475
     methods:{
@@ -476,7 +501,7 @@ export default {
476 501
                     this.getStaffScheduleList()
477 502
 
478 503
                     var doctorlist =  response.data.data.doctorlist
479
-                  
504
+
480 505
                     for(let i=0;i<doctorlist.length;i++){
481 506
                         if(doctorlist[i].sort == 0){
482 507
                           doctorlist[i].sort = ""
@@ -724,7 +749,7 @@ export default {
724 749
                         })
725 750
                         sevenStr = zeroStr
726 751
                     }
727
-                    
752
+
728 753
                     if(staffList[i].schedule_week == 1){
729 754
                         staffList[i].class_index = 1
730 755
                         var arr = []
@@ -836,7 +861,7 @@ export default {
836 861
                         fourStr = strFour
837 862
                     }
838 863
 
839
-                    
864
+
840 865
                     if(staffList[i].schedule_week == 5){
841 866
                         staffList[i].class_index = 5
842 867
 
@@ -894,7 +919,7 @@ export default {
894 919
                         sixStr = strSix
895 920
                      }
896 921
                     }
897
-                   
922
+
898 923
                     let tempArr = [], newArr = []
899 924
                     for (let i = 0; i < staffList.length; i++) {
900 925
                         if (tempArr.indexOf(staffList[i].user_name) == -1) {
@@ -917,7 +942,7 @@ export default {
917 942
                             }
918 943
                         }
919 944
                     }
920
-                    
945
+
921 946
                     let arrTen = [...newArr]
922 947
                     console.log("newArr22o2o2o2o2wo",arrTen)
923 948
                     let newNurse = []
@@ -949,7 +974,7 @@ export default {
949 974
                         }
950 975
                     })
951 976
                     newNurse.sort(this.compare('sort'))
952
-                  
977
+
953 978
                     // //医生
954 979
                     newDoctor.sort(this.compare('admin_user_id'))
955 980
                     let newDoctorTableData = []
@@ -970,7 +995,7 @@ export default {
970 995
 
971 996
 
972 997
                     let arr2 = []
973
-                    
998
+
974 999
                     arr2.push({class_name:oneStr,schedule_week:1})
975 1000
                     arr2.push({class_name:twoStr,schedule_week:2})
976 1001
                     arr2.push({class_name:threeStr,schedule_week:3})
@@ -986,12 +1011,12 @@ export default {
986 1011
                     arr.push(obj)
987 1012
 
988 1013
                     let data = []
989
-                  
1014
+
990 1015
                     data.push(...newNurse)
991 1016
                     data.push(...newDoctor)
992 1017
                     data.push(obj)
993 1018
                     console.log("data2o2oo2o2o2o22o",data)
994
-                    
1019
+
995 1020
                     // this.tableData = this.distinct(data)
996 1021
                     this.tableData = data
997 1022
 
@@ -2040,19 +2065,27 @@ export default {
2040 2065
                 type: 'warning'
2041 2066
             }
2042 2067
             ).then(()=>{
2043
-             
2068
+
2044 2069
             DeleteStaffScheduleById(row.id).then(response=>{
2045 2070
                 if(response.data.state == 1){
2046 2071
                     var msg =  response.data.data.msg
2047 2072
                     this.$message.success("清除成功")
2048 2073
                     this.getStaffScheduleList()
2049
-                   
2074
+
2050 2075
                 }
2051 2076
             })
2052 2077
          })
2053 2078
        }
2054 2079
 
2055 2080
 
2081
+       hoverMouse(row,column, cell, event){
2082
+        this.name=row.user_name
2083
+        this.column_lie= column.label.split('\n')[0]
2084
+
2085
+       },
2086
+       leavemouse(row, column, cell, event){
2087
+        this.name=''
2088
+       }
2056 2089
     },
2057 2090
     created(){
2058 2091
         //获取医护人员
@@ -2145,7 +2178,7 @@ export default {
2145 2178
     max-height:96%;
2146 2179
     overflow-y: auto;
2147 2180
 }
2148
-.del_table_btn {
2181
+.del_table_btns {
2149 2182
     position: absolute;
2150 2183
     right: 0px;
2151 2184
     top: -3px;