test_user 2 years ago
parent
commit
fc435972db

+ 9 - 0
src/api/schedule.js View File

@@ -269,3 +269,12 @@ export function getSolutionSchedule(params) {
269 269
     params: params
270 270
   })
271 271
 }
272
+
273
+
274
+export function CancelScheduleTwo(id) {
275
+  return request({
276
+    url: '/api/schedule/delete_two?id=' + id,
277
+    method: 'Delete'
278
+  })
279
+}
280
+

+ 2 - 9
src/xt_pages/outpatientCharges/summary.vue View File

@@ -5,11 +5,7 @@
5 5
     </div>
6 6
     <div class="app-container">
7 7
       <div
8
-          style="
9
-          display: flex;
10
-          justify-content: space-between;
11
-          margin-bottom: 10px;
12
-        "
8
+          style="display: flex; justify-content: space-between;margin-bottom: 10px;"
13 9
       >
14 10
         <div>
15 11
           <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
@@ -109,8 +105,7 @@
109 105
           </el-button
110 106
           >
111 107
           <el-button v-if="$store.getters.xt_user.org_id == 10106 || $store.getters.xt_user.org_id == 0" size="small" type="primary" @click="export_detail_ten">报表下载2</el-button>
112
-          <el-button v-if="$store.getters.xt_user.org_id == 10318 || $store.getters.xt_user.org_id == 0" size="small" type="primary" @click="export_detail_ten_two">报表下载3</el-button>
113
-
108
+          <el-button v-if="$store.getters.xt_user.org_id == 10318 || $store.getters.xt_user.org_id == 0" size="small" type="primary" @click="export_detail_ten_two">报表下载2</el-button>
114 109
           <!--          <el-button size="small" type="primary" @click="export_detail_two"-->
115 110
           <!--          >报表下载2-->
116 111
           <!--          </el-button-->
@@ -121,8 +116,6 @@
121 116
           <!--          <el-button size="small" type="primary" @click="export_detail_five">报表下载3</el-button>-->
122 117
 <!--                    <el-button size="small" type="primary" @click="export_detail_six">报表下载9</el-button>-->
123 118
           <!--          <el-button size="small" type="primary" @click="export_detail_seven">报表下载4</el-button>-->
124
-
125
-
126 119
         </div>
127 120
       </div>
128 121
       <el-table

+ 0 - 9
src/xt_pages/workforce/components/ScheduleItem.vue View File

@@ -1,20 +1,11 @@
1 1
 <template>
2 2
     <div >
3
-        <el-tooltip placement="right" :disabled="scheduleDetail.patient.length>0?false:true" >
4
-            <div slot="content">
5
-                {{scheduleDetail.patient}}
6
-                <br/>
7
-                <span v-if="scheduleDetail.mode_name.length>0">({{scheduleDetail.mode_name}})</span>
8
-              <span >{{scheduleDetail.dialysis_machine_name}}</span>
9
-
10
-            </div>
11 3
             <div>
12 4
                 <span :class='modeColor(scheduleDetail.mode_name)'>{{scheduleDetail.patient}}</span><br/>
13 5
                 <span v-if="scheduleDetail.mode_name.length>0" :class='modeColor(scheduleDetail.mode_name)'>({{scheduleDetail.mode_name}})</span>
14 6
               <span >{{scheduleDetail.dialysis_machine_name}}</span>
15 7
 
16 8
             </div>
17
-        </el-tooltip>
18 9
     </div>
19 10
 </template>
20 11
 

+ 114 - 62
src/xt_pages/workforce/components/editTableData.vue View File

@@ -1827,17 +1827,53 @@
1827 1827
       </div>
1828 1828
       <span slot="footer" class="dialog-footer">
1829 1829
          <el-button
1830
-           type="primary"
1831
-           @click="coverSch()"
1830
+           type="danger"
1831
+           @click="tipDialogVisibleTwo = true"
1832 1832
          >替换</el-button>
1833 1833
             <el-button
1834 1834
               type="primary"
1835
-              @click="changeSchTwo()"
1835
+              @click="tipDialogVisibleThree = true"
1836 1836
             >交换</el-button>
1837 1837
         <el-button @click="tipDialogVisible = false">取 消</el-button>
1838 1838
       </span>
1839 1839
     </el-dialog>
1840 1840
 
1841
+    <el-dialog
1842
+      title="提示"
1843
+      :visible.sync="tipDialogVisibleTwo"
1844
+      width="300px"
1845
+    >
1846
+      <div>
1847
+        是否将此位置排班替换
1848
+      </div>
1849
+      <span slot="footer" class="dialog-footer">
1850
+         <el-button
1851
+           type="primary"
1852
+           @click="coverSch()"
1853
+         >确定</el-button>
1854
+
1855
+        <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
1856
+      </span>
1857
+    </el-dialog>
1858
+
1859
+
1860
+    <el-dialog
1861
+      title="提示"
1862
+      :visible.sync="tipDialogVisibleThree"
1863
+      width="300px"
1864
+    >
1865
+      <div>
1866
+        是否将此位置排班互换
1867
+      </div>
1868
+      <span slot="footer" class="dialog-footer">
1869
+         <el-button
1870
+           type="primary"
1871
+           @click="changeSchTwo()"
1872
+         >确定</el-button>
1873
+        <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
1874
+      </span>
1875
+    </el-dialog>
1876
+
1841 1877
 
1842 1878
   </div>
1843 1879
 </template>
@@ -1857,6 +1893,7 @@ import {
1857 1893
   BatchSmartSch,
1858 1894
 } from "@/api/schedule_template/sch_template";
1859 1895
 import {
1896
+  CancelScheduleTwo,
1860 1897
   CancelSchedule,
1861 1898
   ChangeSchedule,
1862 1899
   CreateSchedule,
@@ -1930,6 +1967,8 @@ export default {
1930 1967
 
1931 1968
   data() {
1932 1969
     return {
1970
+      tipDialogVisibleTwo:false,
1971
+      tipDialogVisibleThree:false,
1933 1972
       cur_date:"",
1934 1973
       dataloading:false,
1935 1974
       current_patient_data:[],
@@ -1938,6 +1977,7 @@ export default {
1938 1977
       saveloading: false,
1939 1978
       zones: [],
1940 1979
       weeks: weekOptions,
1980
+      first_weeks:[],
1941 1981
       smart_keyword: "",
1942 1982
       cur_smart_patient_id: 0,
1943 1983
       cur_smart_patient_name: "",
@@ -2352,6 +2392,11 @@ export default {
2352 2392
     },
2353 2393
     handleClick() {
2354 2394
       if (this.editableTabsValue == "1") {
2395
+
2396
+        console.log(this.first_weeks)
2397
+        console.log(this.weeks)
2398
+
2399
+
2355 2400
         for (let i = 0; i < this.weeks.length; i++) {
2356 2401
           var tempDate = new Date();
2357 2402
           var day = tempDate.getDay();
@@ -2364,6 +2409,22 @@ export default {
2364 2409
             this.weeks[i].is_edit = false;
2365 2410
           }
2366 2411
         }
2412
+
2413
+        for(let i = 0; i < this.weeks.length; i++){
2414
+          for(let b = 0; b < this.first_weeks.length; b++){
2415
+            if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
2416
+              console.log(this.weeks[i].week_type)
2417
+              console.log(this.first_weeks[b].week_type)
2418
+              console.log(this.first_weeks[b].order_id)
2419
+
2420
+              this.weeks[i].is_edit = false
2421
+            }
2422
+
2423
+          }
2424
+        }
2425
+
2426
+
2427
+
2367 2428
       } else {
2368 2429
         for (let i = 0; i < this.weeks.length; i++) {
2369 2430
           this.weeks[i].is_edit = true;
@@ -2531,16 +2592,16 @@ export default {
2531 2592
       console.log(delTempData)
2532 2593
 
2533 2594
 
2534
-
2535
-      for (let i = 0; i < delTempData.length; i++) {
2536
-        for (let  b = 0; b < saveOrEditTempData.length; b++) {
2537
-          if(delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
2538
-            delTempData.splice(i,1)
2595
+      if(saveOrEditTempData.length > 0 ){
2596
+        for (let i = 0; i < delTempData.length; i++) {
2597
+          for (let  b = 0; b < saveOrEditTempData.length; b++) {
2598
+            if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
2599
+              delTempData.splice(i,1)
2600
+            }
2539 2601
           }
2540 2602
         }
2541
-      }
2542
-      console.log(delTempData)
2543 2603
 
2604
+      }
2544 2605
       for (let i = 0; i < saveOrEditTempData.length; i++) {
2545 2606
         if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
2546 2607
           this.$message.error("分区或者床位不能空");
@@ -2549,8 +2610,7 @@ export default {
2549 2610
       }
2550 2611
 
2551 2612
 
2552
-      if (saveOrEditTempData.length > 0 ) {
2553
-
2613
+      if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
2554 2614
 
2555 2615
         let obj = {
2556 2616
           smart_schs: saveOrEditTempData,
@@ -2624,7 +2684,8 @@ export default {
2624 2684
       return "";
2625 2685
     },
2626 2686
     handleSelect(val) {
2627
-      this.dataloading = true
2687
+      this.first_weeks = []
2688
+        this.dataloading = true
2628 2689
       getSmartSchByPatient(val.id).then((response) => {
2629 2690
         this.dataloading = false
2630 2691
         var sch = response.data.data.sch
@@ -2685,6 +2746,11 @@ export default {
2685 2746
                   ) {
2686 2747
                     this.weeks[b].is_edit = true;
2687 2748
                   } else {
2749
+                    let obj = {
2750
+                      week_type:this.weeks[b].week_type,
2751
+                      order_id:schedules[i].order.id,
2752
+                    }
2753
+                    this.first_weeks.push(obj)
2688 2754
                     this.weeks[b].is_edit = false;
2689 2755
                   }
2690 2756
                   this.editableTabs[0].checkedWeek.push(this.weeks[b]);
@@ -2946,7 +3012,7 @@ export default {
2946 3012
           tableWeekArrage: [],
2947 3013
         },
2948 3014
       ];
2949
-
3015
+      this.first_weeks = []
2950 3016
       getPatientSmartSch(params).then((response) => {
2951 3017
         if (response.data.state == 0) {
2952 3018
           return false;
@@ -2998,7 +3064,9 @@ export default {
2998 3064
                 is_edit = true;
2999 3065
               }
3000 3066
               obj.is_edit = is_edit;
3067
+              console.log("schedules[i].order.id")
3001 3068
 
3069
+              console.log(schedules[i].order.id)
3002 3070
 
3003 3071
               for (let b = 0; b < this.weeks.length; b++) {
3004 3072
                 if (schedules[i].schedule_week == this.weeks[b].week_type) {
@@ -3006,9 +3074,13 @@ export default {
3006 3074
                       this.weeks[b].week_type >= day &&
3007 3075
                       schedules[i].order.id == 0
3008 3076
                   ) {
3009
-
3010 3077
                     this.weeks[b].is_edit = true;
3011 3078
                   } else {
3079
+                    let obj = {
3080
+                      week_type:this.weeks[b].week_type,
3081
+                      order_id:schedules[i].order.id,
3082
+                    }
3083
+                    this.first_weeks.push(obj)
3012 3084
                     this.weeks[b].is_edit = false;
3013 3085
                   }
3014 3086
 
@@ -3273,9 +3345,6 @@ export default {
3273 3345
     dragendTwo(event) {},
3274 3346
     isEditForDate(day){
3275 3347
       var week = this.weekDay(day);
3276
-      console.log(this.weekDays[week[0] - 1].valueOf())
3277
-      console.log( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 )
3278
-      console.log(this.weekDays[week[0] - 1] >= this.cur_date)
3279 3348
       if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
3280 3349
         return true
3281 3350
       }else{
@@ -3285,15 +3354,12 @@ export default {
3285 3354
     },
3286 3355
     drag(e, day, index, name, row) {
3287 3356
       e.preventDefault();
3288
-      console.log("拖动前")
3289
-      console.log(row)
3290 3357
       for (var key in row) {
3291 3358
         if (key == day) {
3292 3359
           console.log(row[key].patient_id)
3293 3360
 
3294 3361
           if(row[key].patient_id > 0 ) {
3295 3362
             this.cur_drag_obj = 2
3296
-            console.log(row)
3297 3363
             var week = this.weekDay(day);
3298 3364
             this.cur_drag_info.schedule_date = this.weekDays[week[0] - 1];
3299 3365
             this.cur_drag_info.schedule_type = week[1];
@@ -3316,37 +3382,24 @@ export default {
3316 3382
     allowDrop(e) {
3317 3383
       e.preventDefault();
3318 3384
     },coverSch(){
3319
-      this.$confirm('是否将此位置排班替换?', '替换', {
3320
-        confirmButtonText: '确 定',
3321
-        cancelButtonText: '取 消',
3322
-        type: 'warning'
3323
-      }).then(() => {
3324
-        let params={
3325
-          id_one:this.cur_drag_info.id,
3326
-          id_two:this.currentData.id
3327
-
3328
-        }
3329
-        CoverSch(params).then((response) => {
3330
-          if (response.data.state == 0) {
3331
-            this.$message.error(response.data.msg);
3332
-          } else {
3333
-            this.$message.success("替换成功");
3334
-            this.tipDialogVisible = false
3335
-            this.getSchedules();
3385
+      let params={
3386
+        id_one:this.cur_drag_info.id,
3387
+        id_two:this.currentData.id
3336 3388
 
3337
-          }
3338
-        });
3339
-
3340
-      })
3341
-        .catch(() => {
3342
-        })
3389
+      }
3390
+      CoverSch(params).then((response) => {
3391
+        if (response.data.state == 0) {
3392
+          this.$message.error(response.data.msg);
3393
+          this.tipDialogVisibleTwo = false
3343 3394
 
3395
+        } else {
3396
+          this.$message.success("替换成功");
3397
+          this.tipDialogVisible = false
3398
+          this.tipDialogVisibleTwo = false
3399
+          this.getSchedules();
3400
+        }
3401
+      });
3344 3402
     },changeSchTwo(){
3345
-      this.$confirm('是否将此位置排班互换?', '交换', {
3346
-        confirmButtonText: '确 定',
3347
-        cancelButtonText: '取 消',
3348
-        type: 'warning'
3349
-      }).then(() => {
3350 3403
         let params={
3351 3404
           id_one:this.cur_drag_info.id,
3352 3405
           id_two:this.currentData.id
@@ -3355,17 +3408,15 @@ export default {
3355 3408
         ExchangeSch(params).then((response) => {
3356 3409
           if (response.data.state == 0) {
3357 3410
             this.$message.error(response.data.msg);
3411
+            this.tipDialogVisibleThree = false
3358 3412
           } else {
3359 3413
             this.$message.success("交换成功");
3360 3414
             this.tipDialogVisible = false
3415
+            this.tipDialogVisibleThree = false
3361 3416
             this.getSchedules();
3362 3417
 
3363 3418
           }
3364 3419
         });
3365
-      })
3366
-        .catch(() => {
3367
-        })
3368
-
3369 3420
     },
3370 3421
     //        ----------------------------------
3371 3422
     //        | !在html里面的chedule-item里绑定的|
@@ -3407,7 +3458,7 @@ export default {
3407 3458
             if(this.cur_drag_obj == 2 ){
3408 3459
               if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
3409 3460
                 if(row[key].patient_id == 0) { //空床位
3410
-                  CancelSchedule(this.cur_drag_info.id).then((response) => {
3461
+                  CancelScheduleTwo(this.cur_drag_info.id).then((response) => {
3411 3462
                     if (response.data.state == 0) {
3412 3463
                       this.$message.error(response.data.msg);
3413 3464
                     } else {
@@ -3437,15 +3488,16 @@ export default {
3437 3488
                           }
3438 3489
                         }
3439 3490
                       });
3491
+                      //接口提交排班数据
3492
+                      that.currentData.mode_id = that.cur_drag_info.mode_id;
3493
+                      that.currentData.id = 0;
3494
+                      that.currentData.contagions = [];
3495
+                      that.currentData.patient_id = that.cur_drag_info.patient_id;
3496
+                      that.currentData.patient = that.cur_drag_info.patient_name;
3497
+                      that.setSchedule();
3440 3498
                     }
3441 3499
                   });
3442
-                  //接口提交排班数据
3443
-                  this.currentData.mode_id = this.cur_drag_info.mode_id;
3444
-                  this.currentData.id = 0;
3445
-                  this.currentData.contagions = [];
3446
-                  this.currentData.patient_id = this.cur_drag_info.patient_id;
3447
-                  this.currentData.patient = this.cur_drag_info.patient_name;
3448
-                  this.setSchedule();
3500
+
3449 3501
                 }else{  //非空,替換或者交換位置
3450 3502
                   this.tipDialogVisible = true
3451 3503
                 }
@@ -4343,7 +4395,7 @@ export default {
4343 4395
 
4344 4396
     // 删除某一单元格内的患者透析排班
4345 4397
     deletePatientMode(row) {
4346
-
4398
+      console.log(row)
4347 4399
       if (row.schedule_id > 0) {
4348 4400
         this.CancelSchedule(row.schedule_id);
4349 4401
       }

+ 36 - 37
src/xt_pages/workforce/components/template_table.vue View File

@@ -1594,8 +1594,8 @@ export default {
1594 1594
 
1595 1595
       this.smartVisible = true;
1596 1596
     },
1597
-    SetSmartSch(tempData,delData) {
1598
-        this.saveActionThree(tempData,delData);
1597
+    SetSmartSch(tempData) {
1598
+        this.saveActionThree(tempData);
1599 1599
     },
1600 1600
     check(tempData) {
1601 1601
       let isJiXu = true;
@@ -1647,7 +1647,7 @@ export default {
1647 1647
     batchSetSch() {
1648 1648
       this.smartSaveLoading = true;
1649 1649
       var tempData = [];
1650
-      var delData = [];
1650
+      // var delData = [];
1651 1651
       for (let b = 0; b < this.editableTabs.length; b++) {
1652 1652
         for (let c = 0; c < this.editableTabs[b].tableWeekArrage.length; c++) {
1653 1653
           let obj = {
@@ -1667,36 +1667,35 @@ export default {
1667 1667
         }
1668 1668
       }
1669 1669
 
1670
-      for (let b = 0; b < this.current_patient_data.length; b++) {
1671
-        for (let c = 0; c < this.current_patient_data[b].tableWeekArrage.length; c++) {
1672
-          let obj = {
1673
-            time_type: this.current_patient_data[b].tableWeekArrage[c].time_type,
1674
-            jihao_id: this.current_patient_data[b].tableWeekArrage[c].device_number_id,
1675
-            schedule_week: this.getWeekByzhongwen(
1676
-              this.current_patient_data[b].tableWeekArrage[c].week
1677
-            ),
1678
-            mode_id: this.current_patient_data[b].tableWeekArrage[c].treat_mode,
1679
-            sch_id: this.current_patient_data[b].tableWeekArrage[c].id,
1680
-            zone_id: this.current_patient_data[b].tableWeekArrage[c].zone_id,
1681
-            t_id: this.current_patient_data[b].name,
1682
-            title:this.current_patient_data[b].title,
1683
-            patient_id: this.cur_smart_patient_id,
1684
-          };
1685
-          delData.push(obj);
1686
-        }
1687
-      }
1688
-      console.log(tempData)
1689
-      console.log(delData)
1670
+      // for (let b = 0; b < this.current_patient_data.length; b++) {
1671
+      //   for (let c = 0; c < this.current_patient_data[b].tableWeekArrage.length; c++) {
1672
+      //     let obj = {
1673
+      //       time_type: this.current_patient_data[b].tableWeekArrage[c].time_type,
1674
+      //       jihao_id: this.current_patient_data[b].tableWeekArrage[c].device_number_id,
1675
+      //       schedule_week: this.getWeekByzhongwen(
1676
+      //         this.current_patient_data[b].tableWeekArrage[c].week
1677
+      //       ),
1678
+      //       mode_id: this.current_patient_data[b].tableWeekArrage[c].treat_mode,
1679
+      //       sch_id: this.current_patient_data[b].tableWeekArrage[c].id,
1680
+      //       zone_id: this.current_patient_data[b].tableWeekArrage[c].zone_id,
1681
+      //       t_id: this.current_patient_data[b].name,
1682
+      //       title:this.current_patient_data[b].title,
1683
+      //       patient_id: this.cur_smart_patient_id,
1684
+      //     };
1685
+      //     delData.push(obj);
1686
+      //   }
1687
+      // }
1688
+      // console.log(tempData)
1689
+      // console.log(delData)
1690 1690
 
1691
-      for (let i = 0; i < delData.length; i++) {
1692
-        for (let  b = 0; b < tempData.length; b++) {
1693
-          if(delData[i].sch_id == tempData[b].sch_id){
1694
-            delData.splice(i,1)
1695
-          }
1696
-        }
1697
-      }
1691
+      // for (let i = 0; i < delData.length; i++) {
1692
+      //   for (let  b = 0; b < tempData.length; b++) {
1693
+      //     if(delData[i].sch_id == tempData[b].sch_id){
1694
+      //       delData.splice(i,1)
1695
+      //     }
1696
+      //   }
1697
+      // }
1698 1698
 
1699
-      console.log(delData)
1700 1699
       for (let i = 0; i < tempData.length; i++) {
1701 1700
         if (tempData[i].jihao_id == "" || tempData[i].zone_id == "") {
1702 1701
           this.$message.error("分区或者床位不能空");
@@ -1706,11 +1705,11 @@ export default {
1706 1705
         }
1707 1706
       }
1708 1707
       this.isEdit = true
1709
-      this.$emit("saveData", tempData,delData);
1708
+      console.log("saveData")
1709
+      console.log(tempData)
1710
+      this.$emit("saveData", tempData);
1710 1711
     },changeJihao(){
1711
-
1712 1712
       this.$forceUpdate()
1713
-
1714 1713
     },
1715 1714
     changeSch(row) {
1716 1715
 
@@ -2711,7 +2710,7 @@ export default {
2711 2710
         if (device_number.id == device_number_id) {
2712 2711
           var item = device_number[weekday + "_" + time_type];
2713 2712
           item.pid = 0;
2714
-          item.name = "";
2713
+          item.name = "";saveOrEdditTempData
2715 2714
           item.treat_mode_id = 0;
2716 2715
           item.treat_mode = "";
2717 2716
         }
@@ -2940,10 +2939,10 @@ export default {
2940 2939
         });
2941 2940
       }
2942 2941
     },
2943
-    saveActionThree: function (val,delData) {
2942
+    saveActionThree: function (val) {
2944 2943
       updateEditSchedules(
2945 2944
         JSON.stringify(val),
2946
-        JSON.stringify(delData),
2945
+        JSON.stringify([]),
2947 2946
       ).then((rs) => {
2948 2947
         var resp = rs.data;
2949 2948
         if (resp.state == 1) {

+ 2 - 4
src/xt_pages/workforce/template.vue View File

@@ -3188,14 +3188,12 @@ export default {
3188 3188
       })
3189 3189
 
3190 3190
 
3191
-    },saveData(val,del_data){
3191
+    },saveData(val){
3192 3192
       var tempDataOne = []
3193 3193
       for(let i = 0; i < val.length; i++){
3194 3194
           tempDataOne.push(val[i])
3195 3195
       }
3196
-      if(tempDataOne.length > 0){
3197
-        this.$refs.table.SetSmartSch(tempDataOne,del_data)
3198
-      }
3196
+      this.$refs.table.SetSmartSch(tempDataOne)
3199 3197
     },
3200 3198
     getWeekPanels(val) {
3201 3199
       getWeekPanels(1,val).then(response => {