Browse Source

3月25日杨青

杨青 2 years ago
parent
commit
03cd9ccedc

+ 12 - 1
src/router/modules/workforce.js View File

@@ -166,6 +166,17 @@ export default {
166 166
       title: 'scheduleTablePrintTwo',
167 167
       noCache: true
168 168
     }
169
-  }
169
+  },
170
+  // {
171
+  //   path: '/historyWeekTable',
172
+  //   component: () => import('@/xt_pages/workforce/historyWeekTable'),
173
+  //   name: 'historyWeekTable',
174
+  //   hidden: true,
175
+  //   is_menu: false,
176
+  //   meta: {
177
+  //     title: 'historyWeekTable',
178
+  //     noCache: true
179
+  //   }
180
+  // }
170 181
   ]
171 182
 }

+ 50 - 20
src/xt_pages/workforce/appointment.vue View File

@@ -102,7 +102,10 @@
102 102
         >
103 103
         </el-date-picker>
104 104
       </div>
105
-      <el-tabs v-model="activeName" :tab-position="tabPosition" ref="elTabs">
105
+      <el-tabs v-model="activeName" :tab-position="tabPosition" ref="elTabs" @tab-click="handleClick">
106
+        <el-tab-pane name="historyWeek">
107
+          <span slot="label"><i class="el-icon-date"></i> 历史周期 ({{ theWeek.historyWeek }}) </span>
108
+        </el-tab-pane>
106 109
         <el-tab-pane name="lastWeek">
107 110
           <span slot="label"><i class="el-icon-date"></i> 上周 ({{ theWeek.lastWeek }})</span>
108 111
         </el-tab-pane>
@@ -116,14 +119,14 @@
116 119
           <span slot="label"><i class="el-icon-date"></i> 下下周 ({{ theWeek.nextTwoWeek }})</span>
117 120
         </el-tab-pane>
118 121
       </el-tabs>
119
-
120
-      <table-data ref="tableData"  :week-time="activeName" :partitions-prop="partitions"
121
-                  :schedule-zone-row-prop="scheduleZoneRow"
122
-                  :schedule-zone-prop="scheduleZone" title="" @event1="changePartition"
123
-                  @event2="changeSchedule" v-if="!is_edit" @event3="changeWeekDay">
124
-      </table-data>
125
-
126
-      <edit-table-data ref="edittableData"  :week-time="activeName" :partitions-prop="partitions"
122
+      <div v-if="!is_edit">
123
+        <table-data ref="tableData"  :week-time="activeName" :partitions-prop="partitions"
124
+                    :schedule-zone-row-prop="scheduleZoneRow"
125
+                    :schedule-zone-prop="scheduleZone" title="" @event1="changePartition"
126
+                    @event2="changeSchedule"  @event3="changeWeekDay" v-show="showtableOne">
127
+        </table-data>
128
+      </div>
129
+       <edit-table-data ref="edittableData"  :week-time="activeName" :partitions-prop="partitions"
127 130
                         :schedule-zone-row-prop="scheduleZoneRow" :schedule-zone-prop="scheduleZone"
128 131
                          title="" @event1="changePartition"
129 132
                          @event2="changeSchedule" v-if="is_edit" @event3="changeWeekDay">
@@ -169,7 +172,12 @@
169 172
         </div>
170 173
       </div>
171 174
         </edit-table-data>
172
-
175
+       
176
+        <HistoryWeekTable v-show="showtable" ref="tableDataZero"  :week-time="activeName" partitions-prop="partitions"
177
+                  :schedule-zone-row-prop="scheduleZoneRow"
178
+                  :schedule-zone-prop="scheduleZone" title="" @event1="changePartition"
179
+                  @event2="changeSchedule"  @event3="changeWeekDay">
180
+          </HistoryWeekTable>
173 181
       <el-dialog title="复制排班" width="600px" :visible.sync="newVisible">
174 182
         <el-form :model="form" ref="form" label-width="90px" :rules="rules">
175 183
           <el-form-item label="周次:">
@@ -220,7 +228,7 @@ import ScheduleUploadExcel from './components/scheduleUploadExcel/index'
220 228
 import {generateLog} from '@/api/config'
221 229
 import {uParseTime} from '@/utils/tools'
222 230
 import EditTableData from "./components/editTableData";
223
-
231
+import HistoryWeekTable from './components/historyWeekTable'
224 232
 export default {
225 233
   name: 'appointment',
226 234
   data() {
@@ -259,6 +267,8 @@ export default {
259 267
       scheduleZone: [],
260 268
       days: [],
261 269
       logs: [],
270
+      showtable:false,
271
+      showtableOne:true,
262 272
       is_edit: false,
263 273
       schedulingTableVisible:false,//全屏
264 274
       scheduleZoneRow: [],
@@ -268,12 +278,15 @@ export default {
268 278
       isExistRepeatVisible: false,
269 279
       exportVisible: false,
270 280
       exportLogVisible: false,
281
+      // 周期
271 282
       theWeek: {
283
+        historyWeek:0,
272 284
         lastWeek: 0,
273 285
         thisWeek: 0,
274 286
         nextWeek: 0,
275 287
         nextTwoWeek: 0
276 288
       },
289
+      
277 290
       tableList: [],
278 291
       weekTime: "",
279 292
       schedule_type: 0,
@@ -313,9 +326,27 @@ export default {
313 326
     tableData,
314 327
     BreadCrumb,
315 328
     UploadExcel,
316
-
329
+    HistoryWeekTable
317 330
   },
318 331
   methods: {
332
+    handleClick(e,tab){
333
+      if(e.name == 'historyWeek'){
334
+        this.showtable=true
335
+        this.showtableOne=false
336
+        this.$nextTick(() => {
337
+          this.$refs.tableDataZero.getgetSchedules()
338
+        })
339
+        console.log('12343545',this.$refs.tableDataZero);
340
+      }else{
341
+        this.showtable=false
342
+        this.showtableOne=true
343
+      }
344
+
345
+      // if(e.name == 'thisWeek'){
346
+      //    this.$refs.tableData.getWeekPanels()
347
+      // }
348
+      // console.log(getgetSchedules);
349
+    },
319 350
     dragstart(event, item) {
320 351
       // console.log('start的索引',item.moveIndex)
321 352
       // 开始移动的时候将移动的索引值+图片的url存储下来
@@ -404,11 +435,12 @@ export default {
404 435
           return false
405 436
         }
406 437
         var partitions = response.data.data.partitions
407
-        // console.log("分区",partitions)
438
+        console.log("分区",response.data.data)
408 439
         this.theWeek.thisWeek = response.data.data.theWeek
409 440
         this.theWeek.lastWeek = response.data.data.theLastWeek
410 441
         this.theWeek.nextWeek = response.data.data.theNextWeek
411 442
         this.theWeek.nextTwoWeek = response.data.data.theNextSecWeek
443
+        // this.theWeek.historyWeek = response.data.data.theWeek - 2
412 444
         // 在控制变量改变的时候进行 强制渲染更新
413 445
         let childrenRefs = this.$refs.elTabs.$children
414 446
         this.$nextTick(() => {
@@ -679,7 +711,7 @@ export default {
679 711
 
680 712
         }
681 713
         // console.log("111111111")
682
-        // console.log(that.scheduleZone)
714
+         console.log(that.scheduleZone)
683 715
       })
684 716
     },
685 717
     changeSch(val){
@@ -870,8 +902,7 @@ export default {
870 902
       } else if (this.activeName == 'nextTwoWeek') {
871 903
         date = date + 14 * 24 * 60 * 60 * 1000
872 904
       }
873
-
874
-      if (this.templateObj.template_id == 0 || this.templateObj.template_id == 1) {
905
+      if (this.templateObj.template_id == 1) {
875 906
         this.$router.push({path: '/workforce/schedule/print', query: {date: date}})
876 907
       }
877 908
       if (this.templateObj.template_id == 2) {
@@ -880,7 +911,6 @@ export default {
880 911
       if (this.templateObj.template_id == 3) {
881 912
         this.$router.push({path: '/scheduleTablePrintOne?partition_id=' + this.partition_id + "&weekTime=" + this.activeName+"&week_date="+this.week_date})
882 913
       }
883
-
884 914
       if(this.templateObj.template_id == 4){
885 915
         this.$router.push({path: '/scheduleTablePrintTwo?partition_id=' + this.partition_id + "&weekTime=" + this.activeName+"&week_date="+this.week_date})
886 916
       }
@@ -2335,7 +2365,7 @@ export default {
2335 2365
 
2336 2366
       return next_monday
2337 2367
     },
2338
-
2368
+    // 
2339 2369
     getThreeWeekList() {
2340 2370
       var params = {
2341 2371
         start_time: this.start_time,
@@ -2862,7 +2892,6 @@ export default {
2862 2892
     },
2863 2893
 
2864 2894
     changeWeek(val) {
2865
-
2866 2895
       this.start_time = ""
2867 2896
       this.end_time = ""
2868 2897
       this.newDay = []
@@ -3041,9 +3070,10 @@ export default {
3041 3070
     },
3042 3071
     getlist() {
3043 3072
       getScheduleTemplate().then(response => {
3073
+        
3044 3074
         if (response.data.state == 1) {
3045 3075
           var template = response.data.data.template
3046
-
3076
+          console.log('12243254',response.data.data);
3047 3077
           this.templateObj = template
3048 3078
         }
3049 3079
       })

+ 14 - 4
src/xt_pages/workforce/components/ScheduleItem.vue View File

@@ -3,9 +3,15 @@
3 3
     <div >
4 4
 
5 5
             <div>
6
-                <span :class='modeColor(scheduleDetail.mode_name)'>{{scheduleDetail.patient}}</span><br/>
7
-                <span v-if="scheduleDetail.mode_name.length>0" :class='modeColor(scheduleDetail.mode_name)'>({{scheduleDetail.mode_name}})</span>
8
-                <br/><span v-if="schedulFlag">{{scheduleDetail.dialysis_machine_name}}</span>
6
+                <span :class='modeColor(scheduleDetail.mode_name)'>{{scheduleDetail.patient}}</span>
7
+                <template v-if="schedulMode">
8
+                  <br/>
9
+                  <span v-if="scheduleDetail.mode_name.length>0"  :class='modeColor(scheduleDetail.mode_name)' >{{'('+scheduleDetail.mode_name+')'}}</span>
10
+                </template>
11
+                <template v-if="schedulFlag">
12
+                  <br/><span >{{scheduleDetail.dialysis_machine_name}}</span>
13
+                </template>
14
+                
9 15
             </div>
10 16
     </div>
11 17
 </template>
@@ -29,11 +35,15 @@ export default {
29 35
       schedulFlag:{
30 36
         type:Boolean,
31 37
         default:false
38
+      },
39
+      schedulMode:{
40
+        type:Boolean,
41
+        default:true
32 42
       }
33 43
   },
34 44
   data() {
35 45
     return {
36
-
46
+      
37 47
     }
38 48
   },
39 49
 

File diff suppressed because it is too large
+ 1329 - 1386
src/xt_pages/workforce/components/tableData.vue


+ 53 - 30
src/xt_pages/workforce/components/template_table.vue View File

@@ -143,8 +143,8 @@
143 143
                       icon="el-icon-close"
144 144
                       circle
145 145
                       @click.stop="
146
-                        deletePatientMode(scope.row['1_1'], '1_1', scope.row)
147
-                      "
146
+                        deletePatientMode(scope.row['1_1'], '1_1', scope.row)"
147
+                        v-show="cur_drag_info.patient_id== 0 ? false : true"
148 148
                     ></el-button>
149 149
                   </div>
150 150
                   <div
@@ -182,6 +182,7 @@
182 182
                       @click.stop="
183 183
                         deletePatientMode(scope.row['1_2'], '1_2', scope.row)
184 184
                       "
185
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
185 186
                     ></el-button>
186 187
                   </div>
187 188
                   <div
@@ -219,6 +220,7 @@
219 220
                       @click.stop="
220 221
                         deletePatientMode(scope.row['1_3'], '1_3', scope.row)
221 222
                       "
223
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
222 224
                     ></el-button>
223 225
                   </div>
224 226
                   <div
@@ -259,6 +261,7 @@
259 261
                       @click.stop="
260 262
                         deletePatientMode(scope.row['2_1'], '2_1', scope.row)
261 263
                       "
264
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
262 265
                     ></el-button>
263 266
                   </div>
264 267
                   <div
@@ -295,6 +298,7 @@
295 298
                       @click.stop="
296 299
                         deletePatientMode(scope.row['2_2'], '2_2', scope.row)
297 300
                       "
301
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
298 302
                     ></el-button>
299 303
                   </div>
300 304
                   <div
@@ -332,6 +336,7 @@
332 336
                       @click.stop="
333 337
                         deletePatientMode(scope.row['2_3'], '2_3', scope.row)
334 338
                       "
339
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
335 340
                     ></el-button>
336 341
                   </div>
337 342
                   <div
@@ -372,6 +377,7 @@
372 377
                       @click.stop="
373 378
                         deletePatientMode(scope.row['3_1'], '3_1', scope.row)
374 379
                       "
380
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
375 381
                     ></el-button>
376 382
                   </div>
377 383
                   <div
@@ -409,6 +415,7 @@
409 415
                       @click.stop="
410 416
                         deletePatientMode(scope.row['3_2'], '3_2', scope.row)
411 417
                       "
418
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
412 419
                     ></el-button>
413 420
                   </div>
414 421
                   <div
@@ -446,6 +453,7 @@
446 453
                       @click.stop="
447 454
                         deletePatientMode(scope.row['3_3'], '3_3', scope.row)
448 455
                       "
456
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
449 457
                     ></el-button>
450 458
                   </div>
451 459
                   <div
@@ -486,6 +494,7 @@
486 494
                       @click.stop="
487 495
                         deletePatientMode(scope.row['4_1'], '4_1', scope.row)
488 496
                       "
497
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
489 498
                     ></el-button>
490 499
                   </div>
491 500
                   <div
@@ -523,6 +532,7 @@
523 532
                       @click.stop="
524 533
                         deletePatientMode(scope.row['4_2'], '4_2', scope.row)
525 534
                       "
535
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
526 536
                     ></el-button>
527 537
                   </div>
528 538
                   <div
@@ -560,6 +570,7 @@
560 570
                       @click.stop="
561 571
                         deletePatientMode(scope.row['4_3'], '4_3', scope.row)
562 572
                       "
573
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
563 574
                     ></el-button>
564 575
                   </div>
565 576
                   <div
@@ -600,6 +611,7 @@
600 611
                       @click.stop="
601 612
                         deletePatientMode(scope.row['5_1'], '5_1', scope.row)
602 613
                       "
614
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
603 615
                     ></el-button>
604 616
                   </div>
605 617
                   <div
@@ -637,6 +649,7 @@
637 649
                       @click.stop="
638 650
                         deletePatientMode(scope.row['5_2'], '5_2', scope.row)
639 651
                       "
652
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
640 653
                     ></el-button>
641 654
                   </div>
642 655
                   <div
@@ -674,6 +687,7 @@
674 687
                       @click.stop="
675 688
                         deletePatientMode(scope.row['5_3'], '5_3', scope.row)
676 689
                       "
690
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
677 691
                     ></el-button>
678 692
                   </div>
679 693
                   <div
@@ -714,6 +728,7 @@
714 728
                       @click.stop="
715 729
                         deletePatientMode(scope.row['6_1'], '6_1', scope.row)
716 730
                       "
731
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
717 732
                     ></el-button>
718 733
                   </div>
719 734
                   <div
@@ -751,6 +766,7 @@
751 766
                       @click.stop="
752 767
                         deletePatientMode(scope.row['6_2'], '6_2', scope.row)
753 768
                       "
769
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
754 770
                     ></el-button>
755 771
                   </div>
756 772
                   <div
@@ -788,6 +804,7 @@
788 804
                       @click.stop="
789 805
                         deletePatientMode(scope.row['6_3'], '6_3', scope.row)
790 806
                       "
807
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
791 808
                     ></el-button>
792 809
                   </div>
793 810
                   <div
@@ -831,8 +848,8 @@
831 848
                       icon="el-icon-close"
832 849
                       circle
833 850
                       @click.stop="
834
-                        deletePatientMode(scope.row['7_1'], '7_1', scope.row)
835
-                      "
851
+                        deletePatientMode(scope.row['7_1'], '7_1', scope.row) "
852
+                        v-show="cur_drag_info.patient_id== 0 ? false : true"
836 853
                     ></el-button>
837 854
                   </div>
838 855
                   <div
@@ -873,8 +890,8 @@
873 890
                       icon="el-icon-close"
874 891
                       circle
875 892
                       @click.stop="
876
-                        deletePatientMode(scope.row['7_2'], '7_2', scope.row)
877
-                      "
893
+                        deletePatientMode(scope.row['7_2'], '7_2', scope.row) "
894
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
878 895
                     ></el-button>
879 896
                   </div>
880 897
                   <div
@@ -915,8 +932,8 @@
915 932
                       icon="el-icon-close"
916 933
                       circle
917 934
                       @click.stop="
918
-                        deletePatientMode(scope.row['7_3'], '7_3', scope.row)
919
-                      "
935
+                        deletePatientMode(scope.row['7_3'], '7_3', scope.row)"
936
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
920 937
                     ></el-button>
921 938
                   </div>
922 939
                   <div
@@ -1756,8 +1773,7 @@ export default {
1756 1773
     // 拖拽
1757 1774
     drop(e, day, index, name, row) {
1758 1775
       e.preventDefault();
1759
-      console.log(row)
1760
-
1776
+      console.log('11111111',row)
1761 1777
       for (var key in row) {
1762 1778
         if (key == day) {
1763 1779
           let info = {};
@@ -1772,17 +1788,19 @@ export default {
1772 1788
           var weekday = weekday_timetype[0];
1773 1789
           var time_type = weekday_timetype[1];
1774 1790
 
1775
-
1776 1791
           this.cur_temp_info.schedule_week = weekday
1777 1792
           this.cur_temp_info.schedule_type = time_type
1778 1793
           this.cur_temp_info.patient_id = info.pid
1779 1794
           this.cur_temp_info.id = row.id
1780 1795
 
1781
-
1782 1796
           if (info.pid > 0 || info.treat_mode_id > 0 ) {
1783 1797
             if (this.cur_drag_obj == 2){
1784
-              console.log("1111222222")
1785
-              this.tipDialogVisible = true
1798
+             
1799
+              if(info.pid != this.cur_drag_info.patient_id){
1800
+                console.log('1234132412',info.pid,this.cur_drag_info.patient_id);
1801
+                this.tipDialogVisible = true
1802
+              }
1803
+                // this.tipDialogVisible = false
1786 1804
             }else{
1787 1805
               this.$message.error("当前机号已有排班2");
1788 1806
               return;
@@ -1791,10 +1809,8 @@ export default {
1791 1809
           } else {
1792 1810
             //當前類型是表格内的拖拽,如果是同一天内的表格拖拽到空床位則先刪除原先排版,后在將排班弄到空床位
1793 1811
             if(this.cur_drag_obj == 2){
1794
-
1795 1812
               if (this.cur_drag_info.schedule_week == weekday){
1796 1813
                 //删除原来的排班,新增一个新的排班
1797
-
1798 1814
                 let params={
1799 1815
                   template_id:this.template.id,
1800 1816
                   week_type_one:this.cur_drag_info.schedule_week,
@@ -2611,9 +2627,21 @@ export default {
2611 2627
         this.cur_drag_info.patient_name = info.name;
2612 2628
         this.cur_drag_info.patient_id = info.pid;
2613 2629
         this.cur_drag_info.id = row.id;
2614
-      }
2630
+      }else{
2631
+        this.cur_drag_obj = 2
2632
+        this.cur_drag_info.schedule_type ='';
2633
+        this.cur_drag_info.partition_id = '';
2634
+        this.cur_drag_info.schedule_week = '';
2635
+        this.cur_drag_info.mode_id = '';
2636
+        this.cur_drag_info.mode_name = '';
2637
+        this.cur_drag_info.patient_name = '';
2638
+        this.cur_drag_info.patient_id = 0;
2639
+        this.cur_drag_info.id = 0;
2615 2640
 
2616
-    },
2641
+      }
2642
+        
2643
+        console.log('this.cur_drag_info的数据',this.cur_drag_info);
2644
+      },
2617 2645
     allowDrop(e) {
2618 2646
       e.preventDefault();
2619 2647
     },
@@ -2732,15 +2760,7 @@ export default {
2732 2760
       }
2733 2761
       return "";
2734 2762
     },
2735
-    // handleScroll: function() {
2736
-    //     var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
2737
-    //     console.log(scrollTop)
2738
-    //     if (scrollTop >= 150) {
2739
-    //         this.fixed_style = "background-color: red; position: fixed; top: 0px; left: 190px; right: 150px; z-index: 99;"
2740
-    //     } else {
2741
-    //         this.fixed_style = ""
2742
-    //     }
2743
-    // },
2763
+    
2744 2764
     makeDeviceNumbers: function (device_numbers) {
2745 2765
       this.all_zones = [];
2746 2766
       this.devices = [];
@@ -2827,6 +2847,7 @@ export default {
2827 2847
 
2828 2848
           // this.getSchedules();
2829 2849
           this.all_template = response.data.data.items
2850
+          console.log('替换数据',response.data.data);
2830 2851
           this.$emit("setTemplate",response.data.data.items)
2831 2852
           if(this.active_name == 'first'){
2832 2853
             this.GetTemplate(response.data.data.items[0])
@@ -3762,7 +3783,7 @@ export default {
3762 3783
       this.$nextTick(() => {
3763 3784
         this.$refs.table.doLayout();
3764 3785
       });
3765
-      if(this.$store.getters.xt_user.template_info.org_id == 9671 || this.$store.getters.xt_user.template_info.org_id == 0 || this.$store.getters.xt_user.template_info.org_id == 3877 || this.$store.getters.xt_user.template_info.org_id == 10340){
3786
+      // if(this.$store.getters.xt_user.template_info.org_id == 9671 || this.$store.getters.xt_user.template_info.org_id == 0 || this.$store.getters.xt_user.template_info.org_id == 3877 || this.$store.getters.xt_user.template_info.org_id == 10340){
3766 3787
           //表格某列全部数据
3767 3788
         var Mon_M = []
3768 3789
         var Mon_A = []
@@ -4373,11 +4394,11 @@ export default {
4373 4394
           result.push(str);
4374 4395
       }
4375 4396
       sums[22]="总人数:"+ sums[22] +"\n"+result
4376
-      }
4397
+      // }
4377 4398
 
4378 4399
       return sums;
4379 4400
     },
4380
-    // 右侧表格的回调
4401
+    // 右侧表格的回调
4381 4402
     cellClass({row,column, rowIndex, columnIndex}){
4382 4403
       // console.log('cellClass数据',row);
4383 4404
       if(columnIndex==1&&row.zone.type==2){
@@ -4393,6 +4414,7 @@ export default {
4393 4414
           }
4394 4415
       }
4395 4416
     },
4417
+    // 右侧表格的行回调
4396 4418
     rowClass({row,column, rowIndex, columnIndex}){
4397 4419
       if (row.zone.type == 1) {
4398 4420
         return "table-row-new-class schedule-table-row ";
@@ -4406,6 +4428,7 @@ export default {
4406 4428
         return 'highlight';
4407 4429
       }
4408 4430
     },
4431
+    // 左侧表格的透析回调
4409 4432
     modeclass({row,column, rowIndex, columnIndex}){
4410 4433
       if(this.cur_info.mode_id == row.id){
4411 4434
         return 'highlight';