瀏覽代碼

添加上机时间和下机时间

csx 5 年之前
父節點
當前提交
ae4a92c154

+ 44 - 1
src/pages/main/dialog/ComputerDialog.vue 查看文件

1
 <template>
1
 <template>
2
  <div>
2
  <div>
3
+
3
     <div class="Dialog" v-show="!selecting">
4
     <div class="Dialog" v-show="!selecting">
4
         <div class="DialogTit">
5
         <div class="DialogTit">
5
             <span @click="close()" class="iconfont">&#xe6e9;</span>
6
             <span @click="close()" class="iconfont">&#xe6e9;</span>
22
               <span class="iconfont">&#xe6f9;</span>
23
               <span class="iconfont">&#xe6f9;</span>
23
             </div>
24
             </div>
24
           </div>
25
           </div>
26
+
27
+
28
+          <div class="item">
29
+            <h2 class="name">上机时间</h2>
30
+            <div class="content">
31
+              <span class="text" style="width: 100px"  @click="selectStartTimeAction">{{ start_time_str }}</span>
32
+              <span class="iconfont">&#xe6f9;</span>
33
+            </div>
34
+          </div>
35
+
36
+
25
           <div class="perform">
37
           <div class="perform">
26
               <!-- <p class="crew">上机人员 : <span>黄海燕 护士</span></p> -->
38
               <!-- <p class="crew">上机人员 : <span>黄海燕 护士</span></p> -->
27
               <!-- <button>执行上机</button> -->
39
               <!-- <button>执行上机</button> -->
32
     </div>
44
     </div>
33
 
45
 
34
     <two-menu ref="selector"></two-menu>
46
     <two-menu ref="selector"></two-menu>
47
+   <mt-datetime-picker
48
+     ref="start_time_picker"
49
+     type="datetime"
50
+     @confirm="didSelectStartTime"
51
+     v-model="start_time"
52
+   ></mt-datetime-picker>
35
   </div>
53
   </div>
36
 </template>
54
 </template>
37
 
55
 
38
 <script>
56
 <script>
39
 import { startDialysis } from "@/api/dialysis";
57
 import { startDialysis } from "@/api/dialysis";
40
 import { Toast } from 'vant';
58
 import { Toast } from 'vant';
59
+import { parseTime } from "@/utils";
60
+
41
 import TwoMenu from './TwoMenu'
61
 import TwoMenu from './TwoMenu'
42
 
62
 
43
 export default {
63
 export default {
47
   },
67
   },
48
   data() {
68
   data() {
49
     return {
69
     return {
70
+      start_time: new Date(),
50
       selecting: false,
71
       selecting: false,
51
-
72
+      start_time_str: "",
52
       bed_id: 0,
73
       bed_id: 0,
53
       nurse_id: 0,
74
       nurse_id: 0,
54
       zone_beds: [], // 该排班的区里的床位
75
       zone_beds: [], // 该排班的区里的床位
76
     device_number_map: {
97
     device_number_map: {
77
       type: Object,
98
       type: Object,
78
     },
99
     },
100
+  }, mounted() {
101
+
102
+    if(this.record.id == 0){
103
+      this.start_time_str = parseTime(this.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
104
+    }else{
105
+      if(this.record.start_time == 0){
106
+        this.start_time_str = parseTime(this.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
107
+
108
+      }else{
109
+        this.start_time_str = parseTime(this.record.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
110
+      }
111
+    }
79
   },
112
   },
80
   created(){
113
   created(){
81
     var date = this.$route.query && this.$route.query.date;
114
     var date = this.$route.query && this.$route.query.date;
105
     this.zone_beds = beds
138
     this.zone_beds = beds
106
   },
139
   },
107
   methods: {
140
   methods: {
141
+    didSelectStartTime: function(time) {
142
+      this.start_time_str = parseTime(time, "{y}-{m}-{d} {h}:{i}") + ":00";
143
+    },
144
+    selectStartTimeAction: function() {
145
+      if (this.record.id != 0) {
146
+        return
147
+      }
148
+      this.$refs.start_time_picker.open();
149
+    },
108
     commitInfo: function () {
150
     commitInfo: function () {
109
       Toast.loading({forbidClick: true, duration: 0})
151
       Toast.loading({forbidClick: true, duration: 0})
110
       let ParamsQuery = {}
152
       let ParamsQuery = {}
112
       ParamsQuery['record_date'] = this.record_date
154
       ParamsQuery['record_date'] = this.record_date
113
       ParamsQuery["nurse"] = this.nurse_id
155
       ParamsQuery["nurse"] = this.nurse_id
114
       ParamsQuery["bed"] = this.bed_id
156
       ParamsQuery["bed"] = this.bed_id
157
+      ParamsQuery["start_time"] = this.start_time_str
115
 
158
 
116
 
159
 
117
       startDialysis(ParamsQuery).then(response => {
160
       startDialysis(ParamsQuery).then(response => {

+ 47 - 3
src/pages/main/dialog/PlaneDialog.vue 查看文件

16
             </div>
16
             </div>
17
           </div>
17
           </div>
18
 
18
 
19
+
20
+          <div class="item">
21
+            <h2 class="name">下机时间</h2>
22
+            <div class="content">
23
+              <span class="text" style="width: 100px"  @click="selectStartTimeAction">{{ end_time_str }}</span>
24
+              <span class="iconfont">&#xe6f9;</span>
25
+            </div>
26
+          </div>
27
+
19
           <div class="perform">
28
           <div class="perform">
20
             <button @click="commitInfo" v-show="(record != null && record.id != '' && record.stage == 1)">执行下机</button>
29
             <button @click="commitInfo" v-show="(record != null && record.id != '' && record.stage == 1)">执行下机</button>
21
             <button :disabled="true" style="background-color:lightgray;" v-show="(record != null && record.id != '' && record.stage == 2)">已下机</button>
30
             <button :disabled="true" style="background-color:lightgray;" v-show="(record != null && record.id != '' && record.stage == 2)">已下机</button>
24
         </div>
33
         </div>
25
     </div>
34
     </div>
26
     <two-menu ref="selector"></two-menu>
35
     <two-menu ref="selector"></two-menu>
36
+   <mt-datetime-picker
37
+     ref="start_time_picker"
38
+     type="datetime"
39
+     @confirm="didSelectStartTime"
40
+     v-model="end_time"
41
+   ></mt-datetime-picker>
27
   </div>
42
   </div>
28
 </template>
43
 </template>
29
 
44
 
33
   } from "@/api/dialysis";
48
   } from "@/api/dialysis";
34
   import { Toast } from 'vant';
49
   import { Toast } from 'vant';
35
   import TwoMenu from './TwoMenu'
50
   import TwoMenu from './TwoMenu'
36
-export default {
51
+  import { parseTime } from "@/utils";
52
+
53
+  export default {
37
   name: "PlaneDialog",
54
   name: "PlaneDialog",
38
   components: {
55
   components: {
39
     TwoMenu
56
     TwoMenu
41
   data() {
58
   data() {
42
     return {
59
     return {
43
       selecting: false,
60
       selecting: false,
44
-
61
+      end_time_str: "",
62
+      end_time:new Date(),
45
       nurse_id: 0,
63
       nurse_id: 0,
46
     }
64
     }
47
   },
65
   },
58
     admin_map: {
76
     admin_map: {
59
       type: Object,
77
       type: Object,
60
     },
78
     },
61
-  },
79
+  },mounted() {
80
+      if(this.record.id == 0){
81
+        this.end_time_str = parseTime(this.end_time, "{y}-{m}-{d} {h}:{i}") + ":00";
82
+      }else{
83
+        if(this.record.end_time == 0){
84
+          this.end_time_str = parseTime(this.end_time, "{y}-{m}-{d} {h}:{i}") + ":00";
85
+        }else{
86
+          this.end_time_str = parseTime(this.record.end_time, "{y}-{m}-{d} {h}:{i}") + ":00";
87
+        }
88
+      }
89
+    },
62
   created(){
90
   created(){
63
     var date = this.$route.query && this.$route.query.date;
91
     var date = this.$route.query && this.$route.query.date;
64
     date *= 1000;
92
     date *= 1000;
83
     }
111
     }
84
   },
112
   },
85
   methods: {
113
   methods: {
114
+    didSelectStartTime: function(time) {
115
+      this.end_time_str = parseTime(time, "{y}-{m}-{d} {h}:{i}") + ":00";
116
+    },
117
+    selectStartTimeAction: function() {
118
+      if (this.record.id != 0) {
119
+        if(this.record.end_time > 0){
120
+          return
121
+        }else{
122
+          this.$refs.start_time_picker.open();
123
+        }
124
+      }else{
125
+        this.$refs.start_time_picker.open();
126
+      }
127
+
128
+    },
86
     commitInfo: function () {
129
     commitInfo: function () {
87
       Toast.loading({forbidClick: true, duration: 0})
130
       Toast.loading({forbidClick: true, duration: 0})
88
       let ParamsQuery = {}
131
       let ParamsQuery = {}
89
       ParamsQuery['patient'] = this.patient_prop.id
132
       ParamsQuery['patient'] = this.patient_prop.id
90
       ParamsQuery['record_date'] = this.record_date
133
       ParamsQuery['record_date'] = this.record_date
91
       ParamsQuery["nurse"] = this.nurse_id
134
       ParamsQuery["nurse"] = this.nurse_id
135
+      ParamsQuery["end_time"] = this.end_time_str
92
 
136
 
93
       finish(ParamsQuery).then(response => {
137
       finish(ParamsQuery).then(response => {
94
         if (response.data.state == 0) {
138
         if (response.data.state == 0) {

+ 18 - 5
src/pages/main/today/dialysisComputer.vue 查看文件

1
 <template>
1
 <template>
2
    <div class="plate-box">
2
    <div class="plate-box">
3
-    <h2 class="title"><span class="line"></span><p>{{title}}</p><span class="line"></span> </h2> 
4
-    <div class="plate " >   
3
+    <h2 class="title"><span class="line"></span><p>{{title}}</p><span class="line"></span> </h2>
4
+    <div class="plate " >
5
         <ul>
5
         <ul>
6
              <li>
6
              <li>
7
                 <label>上机床位 : </label>
7
                 <label>上机床位 : </label>
15
                 <label>状态 : </label>
15
                 <label>状态 : </label>
16
                 <span class="content">{{stage}}</span>
16
                 <span class="content">{{stage}}</span>
17
             </li>
17
             </li>
18
+          <li>
19
+            <label>上机时间 : </label>
20
+            <span class="content">{{start_time}}</span>
21
+          </li>
18
         </ul>
22
         </ul>
19
     </div>
23
     </div>
20
     <!-- <div class="note">处方医生 : {{doctor}}</div> -->
24
     <!-- <div class="note">处方医生 : {{doctor}}</div> -->
21
-  </div>    
25
+  </div>
22
 </template>
26
 </template>
23
 
27
 
24
 <script>
28
 <script>
25
-export default {
29
+  import { parseTime } from "@/utils";
30
+
31
+  export default {
26
   name: "DialysisComputer",
32
   name: "DialysisComputer",
27
   data() {
33
   data() {
28
     return {
34
     return {
58
         return "未上机"
64
         return "未上机"
59
       }
65
       }
60
       return this.record.stage == 1 ? "已上机" : "已下机"
66
       return this.record.stage == 1 ? "已上机" : "已下机"
67
+    },start_time:function () {
68
+      if (this.record == null || this.record.id == '') {
69
+        return "-"
70
+      }
71
+      return parseTime(this.record.start_time, "{y}年{m}月{d}日 {h}时");
72
+
73
+
61
     },
74
     },
62
   },
75
   },
63
   methods: {
76
   methods: {
64
-    
77
+
65
   }
78
   }
66
 };
79
 };
67
 </script>
80
 </script>

+ 20 - 5
src/pages/main/today/dialysisOff.vue 查看文件

1
 <template>
1
 <template>
2
    <div class="plate-box">
2
    <div class="plate-box">
3
-    <h2 class="title"><span class="line"></span><p>{{title}}</p><span class="line"></span> </h2> 
4
-    <div class="plate">   
3
+    <h2 class="title"><span class="line"></span><p>{{title}}</p><span class="line"></span> </h2>
4
+    <div class="plate">
5
       <ul>
5
       <ul>
6
         <li>
6
         <li>
7
           <label>下机护士 : </label>
7
           <label>下机护士 : </label>
11
           <label>状态 : </label>
11
           <label>状态 : </label>
12
           <span class="content">{{stage}}</span>
12
           <span class="content">{{stage}}</span>
13
         </li>
13
         </li>
14
+        <li>
15
+          <label>下机时间 : </label>
16
+          <span class="content">{{end_time}}</span>
17
+        </li>
14
       </ul>
18
       </ul>
15
     </div>
19
     </div>
16
-  </div>    
20
+  </div>
17
 </template>
21
 </template>
18
 
22
 
19
 <script>
23
 <script>
20
-export default {
24
+  import { parseTime } from "@/utils";
25
+
26
+  export default {
21
   name: "DialysisComputer",
27
   name: "DialysisComputer",
22
   data() {
28
   data() {
23
     return {
29
     return {
47
       } else {
53
       } else {
48
         return this.admin_map[this.record.finish_nurse] == null ? "" : this.admin_map[this.record.finish_nurse].name
54
         return this.admin_map[this.record.finish_nurse] == null ? "" : this.admin_map[this.record.finish_nurse].name
49
       }
55
       }
56
+    },end_time:function () {
57
+      if (this.record == null || this.record.id == '') {
58
+        return "-"
59
+      } else if (this.record.stage == 1) {
60
+        return "-"
61
+      } else {
62
+        return parseTime(this.record.end_time, "{y}年{m}月{d}日 {h}时");
63
+
64
+      }
50
     },
65
     },
51
   },
66
   },
52
   methods: {
67
   methods: {
53
-    
68
+
54
   }
69
   }
55
 };
70
 };
56
 </script>
71
 </script>