yq1 1 year ago
parent
commit
d0f55c62b7
1 changed files with 61 additions and 103 deletions
  1. 61 103
      src/xt_pages/dialysis/details/index.vue

+ 61 - 103
src/xt_pages/dialysis/details/index.vue View File

@@ -1208,10 +1208,10 @@
1208 1208
             <span>已排详情</span>
1209 1209
           </div>
1210 1210
           <div>
1211
-            <!-- <el-calendar v-model="time_value">  
1211
+            <el-calendar v-model="time_value" >  
1212 1212
               <template
1213 1213
                 slot="dateCell"
1214
-                slot-scope="{date, data}">
1214
+                slot-scope="{date, data}" @click="viewDayWork(data)">
1215 1215
                 <P v-if="data.day.split('-').slice(1).join('-')=='03-06'"
1216 1216
                   style="background: red;color: white;text-align: center;">
1217 1217
                   HD
@@ -1222,22 +1222,10 @@
1222 1222
                 </p>
1223 1223
 
1224 1224
               </template>
1225
-            </el-calendar> -->
1226
-            <Calendar class="Calendar"
1227
-              v-on:choseDay="clickDay"
1228
-              v-on:changeMonth="changeDate"
1229
-              v-on:isToday="clickToday"
1230
-              v-model="time_value"
1231
-            >
1232
-            </Calendar>
1225
+            </el-calendar>
1233 1226
           </div>
1234
-          
1235 1227
         </div>
1236 1228
       </div>
1237
-      <!-- <span slot="footer" class="dialog-footer" slot-scope="{date, data}" @click="diajian(data)"> 
1238
-        <el-button @click="historyclick = false">取 消</el-button>
1239
-        <el-button type="primary" @click="historyclick = false">确 定</el-button>
1240
-      </span> -->
1241 1229
     </el-dialog>
1242 1230
   </div>
1243 1231
 </template>
@@ -1419,13 +1407,14 @@ export default {
1419 1407
       norefresh:true,
1420 1408
       historyclick:false,
1421 1409
       time_value:new Date(),
1410
+      
1422 1411
       startTime:'',
1423 1412
       endTime:'',
1424 1413
       
1425 1414
     }
1426 1415
   },
1427 1416
   created() {
1428
-    console.log('bbbbb',this.time_value);
1417
+    
1429 1418
    this.blood_access_part_opera = getDataConfig('hemodialysis', 'vascular_access_desc')
1430 1419
    this.org_id = this.$store.getters.xt_user.org.id,
1431 1420
    this.printDate = moment().format("YYYY-MM-DD HH:mm:ss")
@@ -1474,47 +1463,6 @@ export default {
1474 1463
 
1475 1464
     this.anticoagulants_confit = this.$store.getters.anticoagulants_confit
1476 1465
   },
1477
-  beforeMount() {
1478
-    if (this.websocket) {
1479
-      if (this.websocket.readyState == 1) {
1480
-        console.log('执行1')
1481
-        this.websocketMess();
1482
-      } else {
1483
-        setTimeout(() => {
1484
-          console.log('执行2')
1485
-          this.websocketMess();
1486
-        }, 1000);
1487
-      }
1488
-    } else {
1489
-      setTimeout(() => {
1490
-        if (this.websocket) {
1491
-          console.log('执行3')
1492
-          this.websocketMess();
1493
-        } else {
1494
-          setTimeout(() => {
1495
-            console.log('执行4')
1496
-            this.websocketMess();
1497
-          }, 1000);
1498
-        }
1499
-      }, 1000);
1500
-    }
1501
-  },
1502
-  mounted() {
1503
-    const timer = setInterval(() => {
1504
-      // this.getInitData();
1505
-      this.requestDialysisSchedules()
1506
-    }, 1000 * 30)
1507
-    // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
1508
-    this.$once('hook:beforeDestroy', () => {
1509
-      clearInterval(timer)
1510
-    })
1511
-
1512
-    let obj = {
1513
-      cmd: "queue/join",
1514
-      data: {type:3,page:0,size:0},
1515
-    };
1516
-    this.websocketSend(obj)
1517
-  },
1518 1466
   computed: {
1519 1467
     websocket() {
1520 1468
       return this.$store.state.user.websocket;
@@ -1628,6 +1576,50 @@ export default {
1628 1576
       // return schedules
1629 1577
     }
1630 1578
   },
1579
+  beforeMount() {
1580
+    if (this.websocket) {
1581
+      if (this.websocket.readyState == 1) {
1582
+        console.log('执行1')
1583
+        this.websocketMess();
1584
+      } else {
1585
+        setTimeout(() => {
1586
+          console.log('执行2')
1587
+          this.websocketMess();
1588
+        }, 1000);
1589
+      }
1590
+    } else {
1591
+      setTimeout(() => {
1592
+        if (this.websocket) {
1593
+          console.log('执行3')
1594
+          this.websocketMess();
1595
+        } else {
1596
+          setTimeout(() => {
1597
+            console.log('执行4')
1598
+            this.websocketMess();
1599
+          }, 1000);
1600
+        }
1601
+      }, 1000);
1602
+    }
1603
+  },
1604
+  mounted() {
1605
+    const timer = setInterval(() => {
1606
+      // this.getInitData();
1607
+      this.requestDialysisSchedules()
1608
+    }, 1000 * 30)
1609
+    // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
1610
+    this.$once('hook:beforeDestroy', () => {
1611
+      clearInterval(timer)
1612
+    })
1613
+
1614
+    let obj = {
1615
+      cmd: "queue/join",
1616
+      data: {type:3,page:0,size:0},
1617
+    };
1618
+    this.websocketSend(obj)
1619
+    // this.getmonth(this.time_value)
1620
+    // this.handlePick(this.time_value)
1621
+  },
1622
+ 
1631 1623
   beforeDestroy(){
1632 1624
 
1633 1625
     let unObj = {
@@ -1637,9 +1629,6 @@ export default {
1637 1629
     this.websocketSend(unObj)
1638 1630
   },
1639 1631
   methods: {
1640
-    diajian(value){
1641
-      console.log('zzzzz',value);
1642
-    },
1643 1632
     // 透析次数
1644 1633
     chishuclick(row){
1645 1634
       this.cishu_dialogVisible=true
@@ -2933,23 +2922,8 @@ export default {
2933 2922
     // 透析历史
2934 2923
     history_click(){
2935 2924
       this.historyclick =true
2936
-      this.getmonth(this.time_value)
2937
-      // console.log('time_value',);
2938
-    },
2939
-    // //选中某天
2940
-    clickDay(data) {
2941
-      this.time_value = data
2942
-      console.log('33333',this.time_value); 
2943
-      // this.getmonth(data)
2944
-    },
2945
-    // //左右点击切换月份
2946
-    changeDate(data) {
2947
-      this.getmonth(data)
2948
-      console.log('999999',data); 
2949
-    },
2950
-    // 跳到了本月
2951
-    clickToday(data) {
2952
-      console.log('444444',data); 
2925
+      // this.getmonth(this.time_value2)
2926
+      // console.log('time_value',moment(this.time_value2).format('YYYY-MM-DD'));
2953 2927
     },
2954 2928
     // 获取每个月的第一天和最后一天
2955 2929
     getmonth(val){
@@ -2961,32 +2935,16 @@ export default {
2961 2935
       this.startTime = startTime
2962 2936
       this.endTime = endTime
2963 2937
       console.log('time_value333333',this.startTime,this.endTime);
2964
-      // var date =new Date(val) 
2965
-      // console.log('66666',date);
2966
-      // var new_year = date.getFullYear() // 取当前的年份
2967
-      // var month = date.getMonth()
2968
-      
2969
-      // var new_month = month + 1 
2970
-      // // console.log('22222',month,new_month,new_year);// 取当前的月份
2971
-      // if (month > 12) {
2972
-      //   console.log('111');
2973
-      //   new_month -= 12 // 月份减
2974
-      //   new_year++ // 年份增
2975
-      // }
2976
-      // console.log('new_month',new_month);
2977
-      // var firstDay = new Date(new_year, new_month, 1) // 取当年当月中的第一天
2978
-      // console.log('qqqqq',moment(firstDay).format("YYYY-MM-DD HH:mm:ss"));
2979
-      // var lastDay = new Date(firstDay.getTime() - 1000 * 60 * 60 * 24).getDate() // 获取当月最后一天日期
2980
-      // if (firstDay.getMonth() < 10) {
2981
-        
2982
-      //   var mon = "0" + firstDay.getMonth()
2983
-      //   console.log('wwww',moment(firstDay).format("YYYY-MM-DD HH:mm:ss"));
2984
-      // } else {
2985
-      //   var mon = firstDay.getMonth()
2986
-      // }
2987
-      // var startDate = firstDay.getFullYear() + '-' + mon + '-' + "0" + firstDay.getDate();
2988
-      // var endDate = firstDay.getFullYear() + '-' + mon + '-' + lastDay;
2989
-
2938
+    }
2939
+  },
2940
+  watch:{
2941
+    time_value:{
2942
+      handler(newValue,oldValue){
2943
+        // this.initData()
2944
+        this.time_value = newValue
2945
+        this.getmonth(this.time_value)
2946
+        console.log('yyyyyyyyyyy',moment(this.time_value).format('YYYY-MM-DD'),moment(oldValue).format('YYYY-MM-DD'))
2947
+      }
2990 2948
     }
2991 2949
   }
2992 2950
 }