|
@@ -1,147 +1,164 @@
|
1
|
1
|
<template>
|
2
|
|
- <div>
|
3
|
|
- <el-dialog title="透析上机" :visible.sync="visible" width="854px" modal-append-to-body=“false”>
|
4
|
|
- <el-form :model="form" label-width="80px">
|
5
|
|
- <el-form-item label="上机床位">
|
6
|
|
- <el-select v-model="form.bed_id" placeholder="" :disabled="dialysis_order.id != 0">
|
7
|
|
- <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
|
8
|
|
- </el-select>
|
9
|
|
- </el-form-item>
|
10
|
|
- <el-form-item label="上机护士">
|
11
|
|
- <el-select v-model="form.nurse_id" placeholder="" :disabled="dialysis_order.id != 0">
|
12
|
|
- <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
|
13
|
|
- </el-select>
|
14
|
|
- </el-form-item>
|
15
|
|
- <el-form-item label="上机时间 :" style="width:275px">
|
16
|
|
- <el-date-picker
|
17
|
|
- type="datetime"
|
18
|
|
- format="yyyy-MM-dd HH"
|
19
|
|
- value-format="yyyy-MM-dd HH"
|
20
|
|
- placeholder="选择时间"
|
21
|
|
- v-model="start_time"
|
22
|
|
- style="width:100%;"
|
23
|
|
- ></el-date-picker>
|
24
|
|
- </el-form-item>
|
25
|
|
- <el-form-item>
|
26
|
|
- <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
|
27
|
|
- <el-button v-else type="info" :disabled="true">已上机</el-button>
|
28
|
|
- </el-form-item>
|
|
2
|
+ <div>
|
|
3
|
+ <el-dialog title="透析上机" :visible.sync="visible" width="854px" modal-append-to-body=“false”>
|
|
4
|
+ <el-form :model="form" label-width="80px">
|
|
5
|
+ <el-form-item label="上机床位">
|
|
6
|
+ <el-select v-model="form.bed_id" placeholder="" :disabled="dialysis_order.id != 0">
|
|
7
|
+ <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
|
|
8
|
+ </el-select>
|
|
9
|
+ </el-form-item>
|
|
10
|
+ <el-form-item label="上机护士">
|
|
11
|
+ <el-select v-model="form.nurse_id" placeholder="" :disabled="dialysis_order.id != 0">
|
|
12
|
+ <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
|
|
13
|
+ </el-select>
|
|
14
|
+ </el-form-item>
|
|
15
|
+ <el-form-item label="上机时间 :" style="width:300px">
|
|
16
|
+ <el-date-picker
|
|
17
|
+ :disabled="dialysis_order.id != 0"
|
|
18
|
+ type="datetime"
|
|
19
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
20
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
21
|
+ placeholder="选择时间"
|
|
22
|
+ v-model="form.start_time"
|
|
23
|
+ style="width:100%;"
|
|
24
|
+ ></el-date-picker>
|
|
25
|
+ </el-form-item>
|
|
26
|
+ <el-form-item>
|
|
27
|
+ <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
|
|
28
|
+ <el-button v-else type="info" :disabled="true">已上机</el-button>
|
|
29
|
+ </el-form-item>
|
29
|
30
|
|
30
|
31
|
|
31
|
|
-
|
32
|
|
- </el-form>
|
33
|
|
- </el-dialog>
|
34
|
|
- </div>
|
|
32
|
+ </el-form>
|
|
33
|
+ </el-dialog>
|
|
34
|
+ </div>
|
35
|
35
|
</template>
|
36
|
36
|
|
37
|
37
|
<script>
|
38
|
|
-import { startDialysis } from "@/api/dialysis_record"
|
39
|
|
-import { parseTime } from "@/utils"
|
|
38
|
+ import { startDialysis } from '@/api/dialysis_record'
|
|
39
|
+ import { parseTime } from '@/utils'
|
40
|
40
|
|
41
|
|
-export default {
|
42
|
|
- name: "ComputerDialog",
|
|
41
|
+ export default {
|
|
42
|
+ name: 'ComputerDialog',
|
43
|
43
|
data() {
|
44
|
|
- return {
|
45
|
|
- visible: false,
|
46
|
|
- loading: false,
|
|
44
|
+ return {
|
|
45
|
+ visible: false,
|
|
46
|
+ loading: false,
|
47
|
47
|
|
48
|
|
- patient_id: 0,
|
49
|
|
- schedule_date: 0,
|
50
|
|
- start_time: 0,
|
51
|
|
- form: {
|
52
|
|
- bed_id: '',
|
53
|
|
- nurse_id: '',
|
54
|
|
- },
|
|
48
|
+ patient_id: 0,
|
|
49
|
+ schedule_date: 0,
|
|
50
|
+ start_time: 0,
|
|
51
|
+ form: {
|
|
52
|
+ bed_id: '',
|
|
53
|
+ nurse_id: '',
|
|
54
|
+ start_time:'',
|
55
|
55
|
}
|
|
56
|
+ }
|
56
|
57
|
},
|
57
|
58
|
props: {
|
58
|
|
- dialysis_order: {
|
59
|
|
- type: Object,
|
60
|
|
- },
|
61
|
|
- schedule: {
|
62
|
|
- type: Object,
|
63
|
|
- },
|
64
|
|
- admins: {
|
65
|
|
- type: Array,
|
66
|
|
- },
|
67
|
|
- device_numbers: {
|
68
|
|
- type: Array,
|
69
|
|
- },
|
|
59
|
+ dialysis_order: {
|
|
60
|
+ type: Object
|
|
61
|
+ },
|
|
62
|
+ schedule: {
|
|
63
|
+ type: Object
|
|
64
|
+ },
|
|
65
|
+ admins: {
|
|
66
|
+ type: Array
|
|
67
|
+ },
|
|
68
|
+ device_numbers: {
|
|
69
|
+ type: Array
|
|
70
|
+ }
|
70
|
71
|
},
|
71
|
72
|
created() {
|
72
|
|
- this.patient_id = this.$route.query.patient_id
|
73
|
|
- this.schedule_date = this.$route.query.date
|
|
73
|
+ console.log(this.dialysis_order)
|
74
|
74
|
|
75
|
|
- this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
76
|
|
- this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
|
|
75
|
+ this.patient_id = this.$route.query.patient_id
|
|
76
|
+ this.schedule_date = this.$route.query.date
|
|
77
|
+
|
|
78
|
+ this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
|
79
|
+ this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
|
77
|
80
|
|
78
|
81
|
var nowDate = new Date()
|
79
|
82
|
var nowYear = nowDate.getFullYear()
|
80
|
83
|
var nowMonth = nowDate.getMonth() + 1
|
81
|
84
|
var nowDay = nowDate.getDate()
|
82
|
85
|
var nowHours = nowDate.getHours()
|
|
86
|
+ var nowMinutes = nowDate.getMinutes()
|
|
87
|
+ var nowSeconds = nowDate.getSeconds()
|
|
88
|
+ if (this.dialysis_order.id != 0) {
|
|
89
|
+ this.start_time = this.getTime(this.dialysis_order.start_time, 'yyyy-MM-dd HH:mm:ss')
|
83
|
90
|
|
84
|
|
- this.start_time =
|
85
|
|
- nowYear +
|
86
|
|
- '-' +
|
87
|
|
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
|
88
|
|
- '-' +
|
89
|
|
- (nowDay < 10 ? '0' + nowDay : nowDay) + " "+nowHours
|
90
|
|
-
|
|
91
|
+ } else {
|
|
92
|
+ this.start_time =
|
|
93
|
+ nowYear +
|
|
94
|
+ '-' +
|
|
95
|
+ (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
|
|
96
|
+ '-' +
|
|
97
|
+ (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes) + ':' + (nowSeconds < 10 ? '0' + nowSeconds : nowSeconds)
|
|
98
|
+ }
|
91
|
99
|
|
92
|
100
|
},
|
93
|
101
|
watch: {
|
94
|
|
- "schedule.id": function() {
|
95
|
|
- this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
96
|
|
- },
|
97
|
|
- "dialysis_order.id": function() {
|
98
|
|
- this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
99
|
|
- this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
|
100
|
|
- },
|
|
102
|
+ 'schedule.id': function() {
|
|
103
|
+ this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
|
104
|
+ },
|
|
105
|
+ 'dialysis_order.id': function() {
|
|
106
|
+ console.log(this.dialysis_order)
|
|
107
|
+ this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
|
|
108
|
+ this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
|
|
109
|
+ this.form.start_time = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_time
|
|
110
|
+
|
|
111
|
+ }
|
101
|
112
|
},
|
102
|
113
|
computed: {
|
103
|
|
- zone_beds: function() {
|
104
|
|
- var beds = []
|
105
|
|
- for (let index = 0; index < this.device_numbers.length; index++) {
|
106
|
|
- const device_number = this.device_numbers[index];
|
107
|
|
- if (device_number.zone_id == this.schedule.partition_id) {
|
108
|
|
- beds.push(device_number)
|
109
|
|
- }
|
110
|
|
- }
|
111
|
|
- return beds
|
|
114
|
+ zone_beds: function() {
|
|
115
|
+ var beds = []
|
|
116
|
+ for (let index = 0; index < this.device_numbers.length; index++) {
|
|
117
|
+ const device_number = this.device_numbers[index]
|
|
118
|
+ if (device_number.zone_id == this.schedule.partition_id) {
|
|
119
|
+ beds.push(device_number)
|
|
120
|
+ }
|
112
|
121
|
}
|
|
122
|
+ return beds
|
|
123
|
+ }
|
113
|
124
|
},
|
114
|
125
|
methods: {
|
115
|
|
- show: function() {
|
116
|
|
- this.visible = true
|
117
|
|
- },
|
118
|
|
- hide: function() {
|
119
|
|
- this.visible = false
|
120
|
|
- },
|
121
|
|
- submit: function() {
|
122
|
|
- this.loading = true
|
123
|
|
- startDialysis(this.patient_id, parseTime(this.schedule_date, "{y}-{m}-{d}"), this.form.nurse_id, this.form.bed_id).then(rs => {
|
124
|
|
- this.loading = false
|
125
|
|
- var resp = rs.data
|
126
|
|
- if (resp.state == 1) {
|
127
|
|
- var resp_dialysis_order = resp.data.dialysis_order
|
128
|
|
- var this_order = this.dialysis_order
|
129
|
|
- for (const key in resp_dialysis_order) {
|
130
|
|
- this.$set(this_order, key, resp_dialysis_order[key])
|
131
|
|
- }
|
|
126
|
+ getTime(value, temp) {
|
|
127
|
+ if (value != undefined) {
|
|
128
|
+ return parseTime(value, temp)
|
|
129
|
+ }
|
|
130
|
+ return ''
|
|
131
|
+ },
|
|
132
|
+ show: function() {
|
|
133
|
+ this.visible = true
|
|
134
|
+ },
|
|
135
|
+ hide: function() {
|
|
136
|
+ this.visible = false
|
|
137
|
+ },
|
|
138
|
+ submit: function() {
|
|
139
|
+ this.loading = true
|
|
140
|
+ startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id).then(rs => {
|
|
141
|
+ this.loading = false
|
|
142
|
+ var resp = rs.data
|
|
143
|
+ if (resp.state == 1) {
|
|
144
|
+ var resp_dialysis_order = resp.data.dialysis_order
|
|
145
|
+ var this_order = this.dialysis_order
|
|
146
|
+ for (const key in resp_dialysis_order) {
|
|
147
|
+ this.$set(this_order, key, resp_dialysis_order[key])
|
|
148
|
+ }
|
132
|
149
|
|
133
|
|
- } else {
|
134
|
|
- this.$message.error(resp.msg)
|
135
|
|
- }
|
136
|
|
- })
|
137
|
|
- },
|
138
|
|
- },
|
139
|
|
-}
|
|
150
|
+ } else {
|
|
151
|
+ this.$message.error(resp.msg)
|
|
152
|
+ }
|
|
153
|
+ })
|
|
154
|
+ }
|
|
155
|
+ }
|
|
156
|
+ }
|
140
|
157
|
</script>
|
141
|
158
|
|
142
|
159
|
<style scoped>
|
143
|
|
-.txsj{
|
|
160
|
+ .txsj {
|
144
|
161
|
text-align: center;
|
145
|
162
|
margin-bottom: 20px;
|
146
|
|
-}
|
|
163
|
+ }
|
147
|
164
|
</style>
|