Browse Source

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

28169 1 year ago
parent
commit
10b7d50176
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>
@@ -1420,13 +1408,14 @@ export default {
1420 1408
       norefresh:true,
1421 1409
       historyclick:false,
1422 1410
       time_value:new Date(),
1411
+      
1423 1412
       startTime:'',
1424 1413
       endTime:'',
1425 1414
       
1426 1415
     }
1427 1416
   },
1428 1417
   created() {
1429
-    console.log('bbbbb',this.time_value);
1418
+    
1430 1419
    this.blood_access_part_opera = getDataConfig('hemodialysis', 'vascular_access_desc')
1431 1420
    this.org_id = this.$store.getters.xt_user.org.id,
1432 1421
    this.printDate = moment().format("YYYY-MM-DD HH:mm:ss")
@@ -1475,47 +1464,6 @@ export default {
1475 1464
 
1476 1465
     this.anticoagulants_confit = this.$store.getters.anticoagulants_confit
1477 1466
   },
1478
-  beforeMount() {
1479
-    if (this.websocket) {
1480
-      if (this.websocket.readyState == 1) {
1481
-        console.log('执行1')
1482
-        this.websocketMess();
1483
-      } else {
1484
-        setTimeout(() => {
1485
-          console.log('执行2')
1486
-          this.websocketMess();
1487
-        }, 1000);
1488
-      }
1489
-    } else {
1490
-      setTimeout(() => {
1491
-        if (this.websocket) {
1492
-          console.log('执行3')
1493
-          this.websocketMess();
1494
-        } else {
1495
-          setTimeout(() => {
1496
-            console.log('执行4')
1497
-            this.websocketMess();
1498
-          }, 1000);
1499
-        }
1500
-      }, 1000);
1501
-    }
1502
-  },
1503
-  mounted() {
1504
-    const timer = setInterval(() => {
1505
-      // this.getInitData();
1506
-      this.requestDialysisSchedules()
1507
-    }, 1000 * 30)
1508
-    // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
1509
-    this.$once('hook:beforeDestroy', () => {
1510
-      clearInterval(timer)
1511
-    })
1512
-
1513
-    let obj = {
1514
-      cmd: "queue/join",
1515
-      data: {type:3,page:0,size:0},
1516
-    };
1517
-    this.websocketSend(obj)
1518
-  },
1519 1467
   computed: {
1520 1468
     websocket() {
1521 1469
       return this.$store.state.user.websocket;
@@ -1629,6 +1577,50 @@ export default {
1629 1577
       // return schedules
1630 1578
     }
1631 1579
   },
1580
+  beforeMount() {
1581
+    if (this.websocket) {
1582
+      if (this.websocket.readyState == 1) {
1583
+        console.log('执行1')
1584
+        this.websocketMess();
1585
+      } else {
1586
+        setTimeout(() => {
1587
+          console.log('执行2')
1588
+          this.websocketMess();
1589
+        }, 1000);
1590
+      }
1591
+    } else {
1592
+      setTimeout(() => {
1593
+        if (this.websocket) {
1594
+          console.log('执行3')
1595
+          this.websocketMess();
1596
+        } else {
1597
+          setTimeout(() => {
1598
+            console.log('执行4')
1599
+            this.websocketMess();
1600
+          }, 1000);
1601
+        }
1602
+      }, 1000);
1603
+    }
1604
+  },
1605
+  mounted() {
1606
+    const timer = setInterval(() => {
1607
+      // this.getInitData();
1608
+      this.requestDialysisSchedules()
1609
+    }, 1000 * 30)
1610
+    // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
1611
+    this.$once('hook:beforeDestroy', () => {
1612
+      clearInterval(timer)
1613
+    })
1614
+
1615
+    let obj = {
1616
+      cmd: "queue/join",
1617
+      data: {type:3,page:0,size:0},
1618
+    };
1619
+    this.websocketSend(obj)
1620
+    // this.getmonth(this.time_value)
1621
+    // this.handlePick(this.time_value)
1622
+  },
1623
+ 
1632 1624
   beforeDestroy(){
1633 1625
 
1634 1626
     let unObj = {
@@ -1638,9 +1630,6 @@ export default {
1638 1630
     this.websocketSend(unObj)
1639 1631
   },
1640 1632
   methods: {
1641
-    diajian(value){
1642
-      console.log('zzzzz',value);
1643
-    },
1644 1633
     // 透析次数
1645 1634
     chishuclick(row){
1646 1635
       this.cishu_dialogVisible=true
@@ -2934,23 +2923,8 @@ export default {
2934 2923
     // 透析历史
2935 2924
     history_click(){
2936 2925
       this.historyclick =true
2937
-      this.getmonth(this.time_value)
2938
-      // console.log('time_value',);
2939
-    },
2940
-    // //选中某天
2941
-    clickDay(data) {
2942
-      this.time_value = data
2943
-      console.log('33333',this.time_value); 
2944
-      // this.getmonth(data)
2945
-    },
2946
-    // //左右点击切换月份
2947
-    changeDate(data) {
2948
-      this.getmonth(data)
2949
-      console.log('999999',data); 
2950
-    },
2951
-    // 跳到了本月
2952
-    clickToday(data) {
2953
-      console.log('444444',data); 
2926
+      // this.getmonth(this.time_value2)
2927
+      // console.log('time_value',moment(this.time_value2).format('YYYY-MM-DD'));
2954 2928
     },
2955 2929
     // 获取每个月的第一天和最后一天
2956 2930
     getmonth(val){
@@ -2962,32 +2936,16 @@ export default {
2962 2936
       this.startTime = startTime
2963 2937
       this.endTime = endTime
2964 2938
       console.log('time_value333333',this.startTime,this.endTime);
2965
-      // var date =new Date(val) 
2966
-      // console.log('66666',date);
2967
-      // var new_year = date.getFullYear() // 取当前的年份
2968
-      // var month = date.getMonth()
2969
-      
2970
-      // var new_month = month + 1 
2971
-      // // console.log('22222',month,new_month,new_year);// 取当前的月份
2972
-      // if (month > 12) {
2973
-      //   console.log('111');
2974
-      //   new_month -= 12 // 月份减
2975
-      //   new_year++ // 年份增
2976
-      // }
2977
-      // console.log('new_month',new_month);
2978
-      // var firstDay = new Date(new_year, new_month, 1) // 取当年当月中的第一天
2979
-      // console.log('qqqqq',moment(firstDay).format("YYYY-MM-DD HH:mm:ss"));
2980
-      // var lastDay = new Date(firstDay.getTime() - 1000 * 60 * 60 * 24).getDate() // 获取当月最后一天日期
2981
-      // if (firstDay.getMonth() < 10) {
2982
-        
2983
-      //   var mon = "0" + firstDay.getMonth()
2984
-      //   console.log('wwww',moment(firstDay).format("YYYY-MM-DD HH:mm:ss"));
2985
-      // } else {
2986
-      //   var mon = firstDay.getMonth()
2987
-      // }
2988
-      // var startDate = firstDay.getFullYear() + '-' + mon + '-' + "0" + firstDay.getDate();
2989
-      // var endDate = firstDay.getFullYear() + '-' + mon + '-' + lastDay;
2990
-
2939
+    }
2940
+  },
2941
+  watch:{
2942
+    time_value:{
2943
+      handler(newValue,oldValue){
2944
+        // this.initData()
2945
+        this.time_value = newValue
2946
+        this.getmonth(this.time_value)
2947
+        console.log('yyyyyyyyyyy',moment(this.time_value).format('YYYY-MM-DD'),moment(oldValue).format('YYYY-MM-DD'))
2948
+      }
2991 2949
     }
2992 2950
   }
2993 2951
 }