Browse Source

修改华侨问题

csx 5 years ago
parent
commit
cc3c61c9c1
3 changed files with 376 additions and 363 deletions
  1. 1 1
      config/prod.env.js
  2. 2 2
      src/pages/main/DetailsPage.vue
  3. 373 360
      src/pages/main/add_urgent_schedule.vue

+ 1 - 1
config/prod.env.js View File

@@ -1,6 +1,6 @@
1 1
 'use strict'
2 2
 module.exports = {
3 3
   NODE_ENV: '"production"',
4
-  BASE_API: '"http://api.xt.kuyicloud.com"'
4
+  BASE_API: '"http://api.xt.test.sgjyun.com"'
5 5
   // '"http://api.xt.kuyicloud.com"', //'"http://api.xt.kuyicloud.com"','"http://api.xt.test.sgjyun.com"'
6 6
 }

+ 2 - 2
src/pages/main/DetailsPage.vue View File

@@ -24,7 +24,7 @@
24 24
                   <span class="iconfont">2018-01-01&#xe74a;</span>
25 25
                 </div> -->
26 26
 
27
-              <div class="print" style="float: right">
27
+              <div class="print" style="float: right;visibility: hidden">
28 28
                 <el-button size="mini" type="primary" @click="print" icon="el-icon-printer">打印</el-button>
29 29
               </div>
30 30
 
@@ -143,7 +143,7 @@ export default {
143 143
     right: 0;
144 144
     z-index: 100;
145 145
     background: #fff;
146
-   
146
+
147 147
     .nav {
148 148
       ul {
149 149
         li {

+ 373 - 360
src/pages/main/add_urgent_schedule.vue View File

@@ -1,404 +1,417 @@
1 1
 <template>
2
-    <div class="mainBox">
3
-        <side-bar :active_index="0"></side-bar>
4
-        <div class="mainContent">
5
-            <div class="navigation">
6
-                <div class="goBack">
7
-                    <span class="back" @click="$router.back(-1)"><span class="iconfont">&#xe720;</span>返回</span>
8
-                </div>
9
-                <div class="nav">
10
-                    <span>临时排班</span>
11
-                </div>
12
-                <div class="goBack"></div>
13
-            </div>
14
-
15
-            <div class="form" v-loading="loading">
16
-                <van-row class="row">
17
-                    <van-col :span="24" class="danger_hint">
18
-                        本次临时排班会覆盖已有排班中的同班次、同床位的排班,请仔细检查后再提交
19
-                    </van-col>
20
-                </van-row>  
21
-                <van-row class="row">
22
-                    <van-col :span="9">
23
-                        <span class="title">日期:</span>
24
-                        <div class="field_panel">
25
-                            <van-field v-model="date"  class="field"></van-field>
26
-                        </div>
27
-                    </van-col>
28
-                </van-row>
29
-                <van-row class="row">
30
-                    <van-col :span="9">
31
-                        <span class="title">患者:</span>
32
-                        <div class="field_panel">
33
-                            <van-field ref="patient_field" @focus="selectPatientAction" :value="patient_name" class="field" left-icon="arrow-down"></van-field>
34
-                        </div>
35
-                    </van-col>
36
-                    <van-col :span="9">
37
-                        <span class="title">班次:</span>
38
-                        <div class="field_panel">
39
-                            <van-field ref="sch_type_field" @focus="selectSchTypeAction" :value="schedule_type_title" class="field" left-icon="arrow-down"></van-field>
40
-                        </div>
41
-                    </van-col>
42
-                </van-row>
43
-                <van-row class="row">
44
-                    <van-col :span="9">
45
-                        <span class="title">治疗模式:</span>
46
-                        <div class="field_panel">
47
-                            <van-field ref="mode_field" @focus="selectModeAction" :value="mode_name" class="field" left-icon="arrow-down"></van-field>
48
-                        </div>
49
-                    </van-col>
50
-                    <van-col :span="9">
51
-                        <span class="title">床位:</span>
52
-                        <div class="field_panel">
53
-                            <van-field ref="bed_field" @focus="selectBedAction" :value="bed_name" class="field" left-icon="arrow-down"></van-field>
54
-                        </div>
55
-                    </van-col>
56
-                </van-row>
57
-                <van-row class="row">
58
-                    <van-col :span="24">
59
-                        <span class="title">&nbsp;</span>
60
-                        <div class="field_panel">
61
-                            <van-button type="info" size="normal" @click="submitAction">立即排班</van-button>
62
-                        </div>
63
-                    </van-col>
64
-                </van-row>
65
-            </div>
2
+  <div class="mainBox">
3
+    <side-bar :active_index="0"></side-bar>
4
+    <div class="mainContent">
5
+      <div class="navigation">
6
+        <div class="goBack">
7
+          <span class="back" @click="$router.back(-1)"><span class="iconfont">&#xe720;</span>返回</span>
8
+        </div>
9
+        <div class="nav">
10
+          <span>临时排班</span>
66 11
         </div>
12
+        <div class="goBack"></div>
13
+      </div>
67 14
 
68
-        <van-popup v-model="show_patient_picker" position="bottom" class="popup">
69
-            <van-picker :columns="patients" value-key="name" @change="didChangePatient"></van-picker>
70
-        </van-popup>
71
-        <van-popup v-model="show_mode_picker" position="bottom" class="popup">
72
-            <van-picker :columns="modes" value-key="name" @change="didChangeMode"></van-picker>
73
-        </van-popup>
74
-        <van-popup v-model="show_bed_picker" position="bottom" class="popup">
75
-            <van-picker :columns="zone_device_options" value-key="number" @change="didChangeBed"></van-picker>
76
-        </van-popup>
77
-        <van-popup v-model="show_sch_type_picker" position="bottom" class="popup">
78
-            <van-picker :columns="schedule_types" value-key="text" @change="didChangeSchType" ></van-picker>
79
-        </van-popup>
15
+      <div class="form" v-loading="loading">
16
+        <van-row class="row">
17
+          <van-col :span="24" class="danger_hint">
18
+            本次临时排班会覆盖已有排班中的同班次、同床位的排班,请仔细检查后再提交
19
+          </van-col>
20
+        </van-row>
21
+        <van-row class="row">
22
+          <van-col :span="9">
23
+            <span class="title">日期:</span>
24
+            <div class="field_panel">
25
+              <van-field v-model="date" class="field"></van-field>
26
+            </div>
27
+          </van-col>
28
+        </van-row>
29
+        <van-row class="row">
30
+          <van-col :span="9">
31
+            <span class="title">患者:</span>
32
+            <div class="field_panel">
33
+              <van-field ref="patient_field" @focus="selectPatientAction" :value="patient_name" class="field"
34
+                         left-icon="arrow-down"></van-field>
35
+            </div>
36
+          </van-col>
37
+          <van-col :span="9">
38
+            <span class="title">班次:</span>
39
+            <div class="field_panel">
40
+              <van-field ref="sch_type_field" @focus="selectSchTypeAction" :value="schedule_type_title" class="field"
41
+                         left-icon="arrow-down"></van-field>
42
+            </div>
43
+          </van-col>
44
+        </van-row>
45
+        <van-row class="row">
46
+          <van-col :span="9">
47
+            <span class="title">治疗模式:</span>
48
+            <div class="field_panel">
49
+              <van-field ref="mode_field" @focus="selectModeAction" :value="mode_name" class="field"
50
+                         left-icon="arrow-down"></van-field>
51
+            </div>
52
+          </van-col>
53
+          <van-col :span="9">
54
+            <span class="title">床位:</span>
55
+            <div class="field_panel">
56
+              <van-field ref="bed_field" @focus="selectBedAction" :value="bed_name" class="field"
57
+                         left-icon="arrow-down"></van-field>
58
+            </div>
59
+          </van-col>
60
+        </van-row>
61
+        <van-row class="row">
62
+          <van-col :span="24">
63
+            <span class="title">&nbsp;</span>
64
+            <div class="field_panel">
65
+              <van-button type="info" size="normal" @click="submitAction">立即排班</van-button>
66
+            </div>
67
+          </van-col>
68
+        </van-row>
69
+      </div>
80 70
     </div>
71
+
72
+    <van-popup v-model="show_patient_picker" position="bottom" class="popup">
73
+      <van-picker :columns="patients" value-key="name" @change="didChangePatient"></van-picker>
74
+    </van-popup>
75
+    <van-popup v-model="show_mode_picker" position="bottom" class="popup">
76
+      <van-picker :columns="modes" value-key="name" @change="didChangeMode"></van-picker>
77
+    </van-popup>
78
+    <van-popup v-model="show_bed_picker" position="bottom" class="popup">
79
+      <van-picker :columns="zone_device_options" value-key="number" @change="didChangeBed"></van-picker>
80
+    </van-popup>
81
+    <van-popup v-model="show_sch_type_picker" position="bottom" class="popup">
82
+      <van-picker :columns="schedule_types" value-key="text" @change="didChangeSchType"></van-picker>
83
+    </van-popup>
84
+  </div>
81 85
 </template>
82 86
 
83 87
 <script>
84
-import SideBar from "@/pages/layout/SideBar";
85
-import { parseTime } from "@/utils"
86
-import { getUrgentScheduleInitData, postUrgentSchedule } from "@/api/dialysis"
87
-import { Toast, Dialog } from 'vant';
88
+  import SideBar from '@/pages/layout/SideBar'
89
+  import {parseTime} from '@/utils'
90
+  import {getUrgentScheduleInitData, postUrgentSchedule} from '@/api/dialysis'
91
+  import {Dialog, Toast} from 'vant'
88 92
 
89
-export default {
90
-    name: "AddUrgentSchedule",
93
+  export default {
94
+    name: 'AddUrgentSchedule',
91 95
     components: {
92
-        SideBar,
96
+      SideBar,
93 97
     },
94
-    data() {
95
-        return {
96
-            loading: false,
98
+    data () {
99
+      return {
100
+        loading: false,
97 101
 
98
-            date: "2019-09-09",
99
-            patient_id: 0,
100
-            mode_id: 0,
101
-            device_id: 0,
102
-            schedule_type: 1,
103
-            zone_name: "",
102
+        date: '2019-09-09',
103
+        patient_id: 0,
104
+        mode_id: 0,
105
+        device_id: 0,
106
+        schedule_type: 1,
107
+        zone_name: '',
104 108
 
105
-            show_patient_picker: false,
106
-            show_mode_picker: false,
107
-            show_bed_picker: false,
108
-            show_sch_type_picker: false,
109
+        show_patient_picker: false,
110
+        show_mode_picker: false,
111
+        show_bed_picker: false,
112
+        show_sch_type_picker: false,
109 113
 
110
-            patients: [],
111
-            modes: [],
112
-            schedule_types: [
113
-                { value: 1, text: "上午" },
114
-                { value: 2, text: "下午" },
115
-                { value: 3, text: "晚上" },
116
-            ],
114
+        patients: [],
115
+        modes: [],
116
+        schedule_types: [
117
+          {value: 1, text: '上午'},
118
+          {value: 2, text: '下午'},
119
+          {value: 3, text: '晚上'},
120
+        ],
117 121
 
118
-            origin_device_numbers: [],
119
-            zone_device_map: {},
120
-            zone_names: [],
121
-            current_devices: [],
122
-            zone_device_options: [],
122
+        origin_device_numbers: [],
123
+        zone_device_map: {},
124
+        zone_names: [],
125
+        current_devices: [],
126
+        zone_device_options: [],
123 127
 
124
-            origin_schedules: [],
125
-        }
128
+        origin_schedules: [],
129
+      }
126 130
     },
127 131
     computed: {
128
-        patient_name: function() {
129
-            for (let index = 0; index < this.patients.length; index++) {
130
-                const patient = this.patients[index];
131
-                if (patient.id == this.patient_id) {
132
-                    return patient.name
133
-                }
134
-            }
135
-            return ""
136
-        },
137
-        mode_name: function() {
138
-            for (let index = 0; index < this.modes.length; index++) {
139
-                const mode = this.modes[index];
140
-                if (mode.id == this.mode_id) {
141
-                    return mode.name
142
-                }
143
-            }
144
-            return ""
145
-        },
146
-        bed_name: function() {
147
-            if (this.zone_name.length > 0 && this.device_id != 0) {
148
-                for (let index = 0; index < this.current_devices.length; index++) {
149
-                    const device_number = this.current_devices[index];
150
-                    if (device_number.id == this.device_id) {
151
-                        return device_number.zone.name + " - " + device_number.number
152
-                    }
153
-                }
154
-            }
155
-            return ""
156
-        },
157
-        schedule_type_title: function() {
158
-            for (let index = 0; index < this.schedule_types.length; index++) {
159
-                const type = this.schedule_types[index];
160
-                if (type.value == this.schedule_type) {
161
-                    return type.text
162
-                }
132
+      patient_name: function () {
133
+        for (let index = 0; index < this.patients.length; index++) {
134
+          const patient = this.patients[index]
135
+          if (patient.id == this.patient_id) {
136
+            return patient.name
137
+          }
138
+        }
139
+        return ''
140
+      },
141
+      mode_name: function () {
142
+        for (let index = 0; index < this.modes.length; index++) {
143
+          const mode = this.modes[index]
144
+          if (mode.id == this.mode_id) {
145
+            return mode.name
146
+          }
147
+        }
148
+        return ''
149
+      },
150
+      bed_name: function () {
151
+        if (this.zone_name.length > 0 && this.device_id != 0) {
152
+          for (let index = 0; index < this.current_devices.length; index++) {
153
+            const device_number = this.current_devices[index]
154
+            if (device_number.id == this.device_id) {
155
+              return device_number.zone.name + ' - ' + device_number.number
163 156
             }
164
-            return ""
165
-        },
166
-    },
167
-    mounted() {
168
-        var today = new Date()
169
-        this.date = parseTime(today, "{y}-{m}-{d}")
170
-
171
-        var hour = today.getHours()
172
-        if (hour > 3 && hour < 11) {
173
-            this.schedule_type = 1
174
-        } else if (hour >= 11 && hour < 18) {
175
-            this.schedule_type = 2
176
-        } else {
177
-            this.schedule_type = 3
157
+          }
158
+        }
159
+        return ''
160
+      },
161
+      schedule_type_title: function () {
162
+        for (let index = 0; index < this.schedule_types.length; index++) {
163
+          const type = this.schedule_types[index]
164
+          if (type.value == this.schedule_type) {
165
+            return type.text
166
+          }
178 167
         }
168
+        return ''
169
+      },
170
+    },
171
+    mounted () {
172
+      var today = new Date()
173
+      this.date = parseTime(today, '{y}-{m}-{d}')
179 174
 
180
-        this.loading = true
181
-        getUrgentScheduleInitData().then(rs => {
182
-            this.loading = false
183
-            // console.log(rs.data.data)
184
-            if (rs.data.state == 1) {
185
-                this.origin_schedules = rs.data.data.schedules
186
-                this.patients = rs.data.data.patients
187
-                this.modes = rs.data.data.modes
188
-                this.origin_device_numbers = rs.data.data.device_numbers
175
+      var hour = today.getHours()
176
+      if (hour > 3 && hour < 11) {
177
+        this.schedule_type = 1
178
+      } else if (hour >= 11 && hour < 18) {
179
+        this.schedule_type = 2
180
+      } else {
181
+        this.schedule_type = 3
182
+      }
189 183
 
190
-                if (this.patients.length > 0) {
191
-                    this.patient_id = this.patients[0].id
192
-                }
193
-                if (this.modes.length > 0) {
194
-                    this.mode_id = this.modes[0].id
195
-                }
184
+      this.loading = true
185
+      getUrgentScheduleInitData().then(rs => {
186
+        this.loading = false
187
+        // console.log(rs.data.data)
188
+        if (rs.data.state == 1) {
189
+          this.origin_schedules = rs.data.data.schedules
190
+          this.patients = rs.data.data.patients
191
+          this.modes = rs.data.data.modes
192
+          this.origin_device_numbers = rs.data.data.device_numbers
196 193
 
197
-                var zone_device_map = {}
198
-                for (let index = 0; index < this.origin_device_numbers.length; index++) {
199
-                    const device_number = this.origin_device_numbers[index];
200
-                    if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
201
-                        zone_device_map[device_number.zone.name] = []
202
-                    }
203
-                    zone_device_map[device_number.zone.name].push(device_number)
204
-                }
205
-                this.zone_device_map = zone_device_map
194
+          for (let i = this.origin_schedules.length-1; i >= 0 ; i--) {
195
+            for (let y = this.origin_device_numbers.length-1; y >=0 ; y--){
196
+              if(this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id){
197
+                this.origin_device_numbers.splice(y,1)
198
+              }
199
+            }
200
+          }
206 201
 
207
-                this.zone_names = Object.keys(this.zone_device_map)
208
-                if (this.zone_names.length > 0) {
209
-                    this.zone_name = this.zone_names[0]
210
-                    this.current_devices = this.zone_device_map[this.zone_name]
211
-                    this.device_id = this.current_devices[0].id
212
-                }
213
-                this.zone_device_options = [
214
-                    { values: this.zone_names },
215
-                    // { values: this.getDeviceNumberNames(this.current_devices) },
216
-                    { values: this.current_devices },
217
-                ]
202
+          if (this.patients.length > 0) {
203
+            this.patient_id = this.patients[0].id
204
+          }
205
+          if (this.modes.length > 0) {
206
+            this.mode_id = this.modes[0].id
207
+          }
218 208
 
219
-            } else {
220
-                Toast.fail(rs.data.msg)
209
+          var zone_device_map = {}
210
+          for (let index = 0; index < this.origin_device_numbers.length; index++) {
211
+            const device_number = this.origin_device_numbers[index]
212
+            if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
213
+              zone_device_map[device_number.zone.name] = []
221 214
             }
222
-            
215
+            zone_device_map[device_number.zone.name].push(device_number)
216
+          }
217
+          this.zone_device_map = zone_device_map
223 218
 
224
-        }).catch(err => {
225
-            this.loading = false
226
-            Toast.fail(err)
227
-        })
219
+          this.zone_names = Object.keys(this.zone_device_map)
220
+          if (this.zone_names.length > 0) {
221
+            this.zone_name = this.zone_names[0]
222
+            this.current_devices = this.zone_device_map[this.zone_name]
223
+            this.device_id = this.current_devices[0].id
224
+          }
225
+          this.zone_device_options = [
226
+            {values: this.zone_names},
227
+            // { values: this.getDeviceNumberNames(this.current_devices) },
228
+            {values: this.current_devices},
229
+          ]
230
+        } else {
231
+          Toast.fail(rs.data.msg)
232
+        }
233
+
234
+      }).catch(err => {
235
+        this.loading = false
236
+        Toast.fail(err)
237
+      })
228 238
     },
229 239
     methods: {
230
-        // getDeviceNumberNames: function(device_numbers) {
231
-        //     var names = []
232
-        //     for (let index = 0; index < device_numbers.length; index++) {
233
-        //         const device_number = device_numbers[index];
234
-        //         names.push(device_number.number)
235
-        //     }
236
-        //     return names
237
-        // },
240
+      // getDeviceNumberNames: function(device_numbers) {
241
+      //     var names = []
242
+      //     for (let index = 0; index < device_numbers.length; index++) {
243
+      //         const device_number = device_numbers[index];
244
+      //         names.push(device_number.number)
245
+      //     }
246
+      //     return names
247
+      // },
238 248
 
239
-        selectPatientAction: function() {
240
-            this.$refs.patient_field.blur()
241
-            this.show_patient_picker = true
242
-        },
243
-        selectModeAction: function() {
244
-            this.$refs.mode_field.blur()
245
-            this.show_mode_picker = true
246
-        },
247
-        selectBedAction: function() {
248
-            this.$refs.bed_field.blur()
249
-            this.show_bed_picker = true
250
-        },
251
-        selectSchTypeAction: function() {
252
-            this.$refs.sch_type_field.blur()
253
-            this.show_sch_type_picker = true
254
-        },
249
+      selectPatientAction: function () {
250
+        this.$refs.patient_field.blur()
251
+        this.show_patient_picker = true
252
+      },
253
+      selectModeAction: function () {
254
+        this.$refs.mode_field.blur()
255
+        this.show_mode_picker = true
256
+      },
257
+      selectBedAction: function () {
258
+        this.$refs.bed_field.blur()
259
+        this.show_bed_picker = true
260
+      },
261
+      selectSchTypeAction: function () {
262
+        this.$refs.sch_type_field.blur()
263
+        this.show_sch_type_picker = true
264
+      },
255 265
 
256
-        didChangePatient: function(picker, patient, index) {
257
-            this.patient_id = patient.id
258
-        },
259
-        didChangeMode: function(picker, mode, index) {
260
-            this.mode_id = mode.id
261
-        },
262
-        didChangeBed: function(picker, values, col_index) {
263
-            if (col_index == 0) {
264
-                this.zone_name = values[0]
265
-                this.current_devices = this.zone_device_map[this.zone_name]
266
-                this.device_id = this.current_devices[0].id
266
+      didChangePatient: function (picker, patient, index) {
267
+        this.patient_id = patient.id
268
+      },
269
+      didChangeMode: function (picker, mode, index) {
270
+        this.mode_id = mode.id
271
+      },
272
+      didChangeBed: function (picker, values, col_index) {
273
+        if (col_index == 0) {
274
+          this.zone_name = values[0]
275
+          this.current_devices = this.zone_device_map[this.zone_name]
276
+          this.device_id = this.current_devices[0].id
267 277
 
268
-                picker.setColumnValues(1, this.current_devices)
278
+          picker.setColumnValues(1, this.current_devices)
269 279
 
270
-            } else if (col_index == 1) {
271
-                this.device_id = values[1].id
272
-            }
273
-        },
274
-        didChangeSchType: function(picker, sch_type, index) {
275
-            this.schedule_type = sch_type.value
276
-        },
280
+        } else if (col_index == 1) {
281
+          this.device_id = values[1].id
282
+        }
283
+      },
284
+      didChangeSchType: function (picker, sch_type, index) {
285
+        this.schedule_type = sch_type.value
286
+      },
277 287
 
278
-        submitAction: function() {
279
-            if (this.patient_id == 0 || this.mode_id == 0 || this.device_id == 0) {
280
-                Toast.fail("请选择班次、床位等")
281
-                return
282
-            }
288
+      submitAction: function () {
289
+        if (this.patient_id == 0 || this.mode_id == 0 || this.device_id == 0) {
290
+          Toast.fail('请选择班次、床位等')
291
+          return
292
+        }
283 293
 
284
-            var repeated = false
285
-            for (let index = 0; index < this.origin_schedules.length; index++) {
286
-                const schedule = this.origin_schedules[index];
287
-                if (schedule.bed_id == this.device_id && this.schedule_type == schedule.schedule_type) {
288
-                    repeated = true
289
-                    break
290
-                }
291
-            }
292
-            if (repeated) {
293
-                Dialog.confirm({
294
-                    title: '提醒',
295
-                    message: '你选择的床位已经被排班,确认要替换吗?'
296
-                }).then(() => {
297
-                    // on confirm
298
-                    this.submit()
299
-                }).catch(() => {
300
-                    // on cancel
301
-                });
302
-            } else {
303
-                this.submit()
304
-            }
305
-        },
306
-        submit: function() {
307
-            var params = {
308
-                patient_id: this.patient_id,
309
-                mode: this.mode_id,
310
-                schedule_type: this.schedule_type,
311
-                bed: this.device_id,
312
-            }
313
-            this.loading = true
314
-            postUrgentSchedule(params).then(rs => {
315
-                this.loading = false
316
-                var resp = rs.data
317
-                if (resp.state == 1) {
318
-                    console.log(resp.data)
319
-                    var patient = resp.data.patient
320
-                    var schedule = resp.data.schedule
321
-                    this.$router.push({ path: "/details", query: {patient_id: patient.id, date: schedule.schedule_date, patient_name: patient.name}})
294
+        var repeated = false
295
+        for (let index = 0; index < this.origin_schedules.length; index++) {
296
+          const schedule = this.origin_schedules[index]
297
+          if (schedule.bed_id == this.device_id && this.schedule_type == schedule.schedule_type) {
298
+            repeated = true
299
+            break
300
+          }
301
+        }
302
+        if (repeated) {
303
+          Dialog.confirm({
304
+            title: '提醒',
305
+            message: '你选择的床位已经被排班,确认要替换吗?'
306
+          }).then(() => {
307
+            // on confirm
308
+            this.submit()
309
+          }).catch(() => {
310
+            // on cancel
311
+          })
312
+        } else {
313
+          this.submit()
314
+        }
315
+      },
316
+      submit: function () {
317
+        var params = {
318
+          patient_id: this.patient_id,
319
+          mode: this.mode_id,
320
+          schedule_type: this.schedule_type,
321
+          bed: this.device_id,
322
+        }
323
+        this.loading = true
324
+        postUrgentSchedule(params).then(rs => {
325
+          this.loading = false
326
+          var resp = rs.data
327
+          if (resp.state == 1) {
328
+            console.log(resp.data)
329
+            var patient = resp.data.patient
330
+            var schedule = resp.data.schedule
331
+            this.$router.push({
332
+              path: '/details',
333
+              query: {patient_id: patient.id, date: schedule.schedule_date, patient_name: patient.name}
334
+            })
322 335
 
323
-                } else {
324
-                    Toast.fail(resp.msg)
325
-                }
336
+          } else {
337
+            Toast.fail(resp.msg)
338
+          }
326 339
 
327
-            }).catch(err => {
328
-                this.loading = false
329
-                Toast.fail("err")
330
-            })
331
-        }
340
+        }).catch(err => {
341
+          this.loading = false
342
+          Toast.fail('err')
343
+        })
344
+      }
332 345
     }
333
-}
346
+  }
334 347
 </script>
335 348
 
336 349
 <style style="stylesheet/scss" lang="scss" scoped>
337
-.mainContent {
338
-    position: relative;
339
-    .navigation {
340
-        padding: 0.3rem 0.36rem;
341
-        border-bottom: 1px #e5e5e5 solid;
342
-        position: fixed;
343
-        top: 0;
344
-        left:1.58rem;
345
-        right: 0;
346
-        z-index: 100;
347
-        background: #fff;
348
-        .goBack {
349
-            float: left;
350
-            .back {
351
-                color: $main-color;
352
-                margin-right: 0.87rem;
353
-                .iconfont {
354
-                    color: $main-color;
355
-                }
356
-            }
357
-        }
358
-        .nav {
359
-            text-align: center;
360
-            font-size: 0.36rem;
361
-        }
362
-    }
350
+  .mainContent {
351
+  position: relative;
352
+  .navigation {
353
+  padding: 0.3rem 0.36rem;
354
+  border-bottom: 1px #e5e5e5 solid;
355
+  position: fixed;
356
+  top: 0;
357
+  left:1.58rem;
358
+  right: 0;
359
+  z-index: 100;
360
+  background: #fff;
361
+  .goBack {
362
+  float: left;
363
+  .back {
364
+  color: $main-color;
365
+  margin-right: 0.87rem;
366
+  .iconfont {
367
+  color: $main-color;
368
+  }
369
+  }
370
+  }
371
+  .nav {
372
+  text-align: center;
373
+  font-size: 0.36rem;
374
+  }
375
+  }
363 376
 
364
-    .form {
365
-        background: #fff;
366
-        min-height: calc(100vh - 2px);
367
-        padding-top:55px; 
368
-        padding-left: 20px;
369
-        .row {
370
-            padding: 5px 0;
371
-            .title {
372
-                color: #8f8f8f;
373
-                margin-right: 5px;
374
-                text-align: right;
375
-                font-size: 16px;
376
-                line-height: 45px;
377
-                width: 80px;
378
-                float: left;
379
-            }
380
-            .field_panel {
381
-                display: inline-block;
382
-                .field {
383
-                    padding: 0 0; 
384
-                    font-size: 18px; 
385
-                    line-height: 45px;
386
-                    width: 180px;
387
-                }
388
-            }
377
+  .form {
378
+  background: #fff;
379
+  min-height: calc(100vh - 2px);
380
+  padding-top:55px;
381
+  padding-left: 20px;
382
+  .row {
383
+  padding: 5px 0;
384
+  .title {
385
+  color: #8f8f8f;
386
+  margin-right: 5px;
387
+  text-align: right;
388
+  font-size: 16px;
389
+  line-height: 45px;
390
+  width: 80px;
391
+  float: left;
392
+  }
393
+  .field_panel {
394
+  display: inline-block;
395
+  .field {
396
+  padding: 0 0;
397
+  font-size: 18px;
398
+  line-height: 45px;
399
+  width: 180px;
400
+  }
401
+  }
389 402
 
390
-            .danger_hint {
391
-                font-size: 0.34rem;
392
-                line-height: 40px;
393
-                text-align: center;
394
-                color: red;
395
-            }
396
-        }
397
-    }
398
-}
399
-.popup {
400
-    border-radius: 0 !important;
401
-    top: initial !important;
402
-}
403
+  .danger_hint {
404
+  font-size: 0.34rem;
405
+  line-height: 40px;
406
+  text-align: center;
407
+  color: red;
408
+  }
409
+  }
410
+  }
411
+  }
412
+  .popup {
413
+  border-radius: 0 !important;
414
+  top: initial !important;
415
+  }
403 416
 </style>
404 417