|
@@ -1,326 +1,428 @@
|
1
|
1
|
<template>
|
2
|
|
-<!-- <div class="main-contain">
|
3
|
|
- <div class="position">
|
4
|
|
- <bread-crumb></bread-crumb>
|
5
|
|
- </div> -->
|
6
|
|
- <div class="patient-container">
|
7
|
|
- <patient-sidebar :id="patient_id" defaultActive="1-2"></patient-sidebar>
|
8
|
|
- <!-- <div class="app-container"> -->
|
9
|
|
- <div v-loading="loading">
|
10
|
|
- <div class="patient-app-container advice-container app-container">
|
11
|
|
-
|
12
|
|
- <div>
|
|
2
|
+ <!-- <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb></bread-crumb>
|
|
5
|
+ </div> -->
|
|
6
|
+ <div class="patient-container">
|
|
7
|
+ <patient-sidebar :id="patient_id" defaultActive="1-2"></patient-sidebar>
|
|
8
|
+ <!-- <div class="app-container"> -->
|
|
9
|
+ <div v-loading="loading">
|
|
10
|
+ <div class="patient-app-container advice-container app-container">
|
|
11
|
+
|
|
12
|
+ <div>
|
13
|
13
|
<span style="margin-left: 10px;float:right;">
|
14
|
|
- <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="show_dialog = true">新增</el-button>
|
15
|
|
- <el-button size="small" v-show="selectingRows.length > 0" type="danger" @click="deleteAction">删除</el-button>
|
|
14
|
+ <el-button type="primary" icon="el-icon-circle-plus-outline" size="small"
|
|
15
|
+ @click="show_dialog = true">新增</el-button>
|
|
16
|
+ <el-button type="primary" icon="el-icon-edit-outline" size="small"
|
|
17
|
+ @click="showEdit">修改</el-button>
|
|
18
|
+ <el-button size="small" v-show="selectingRows.length > 0" type="danger"
|
|
19
|
+ @click="deleteAction">删除</el-button>
|
16
|
20
|
</span>
|
17
|
|
- <!--<span class="filter_title">日期查询</span>-->
|
18
|
|
- <!--<el-date-picker size="small" v-model="date" type="daterange" range-separator="至" start-placeholde="开始日期" end-placeholde="结束日期" value-format="timestamp" :clearable="false" @change="requestCourseRecords()"></el-date-picker>-->
|
|
21
|
+ <!--<span class="filter_title">日期查询</span>-->
|
|
22
|
+ <!--<el-date-picker size="small" v-model="date" type="daterange" range-separator="至" start-placeholde="开始日期" end-placeholde="结束日期" value-format="timestamp" :clearable="false" @change="requestCourseRecords()"></el-date-picker>-->
|
|
23
|
+ </div>
|
|
24
|
+ <!--<div></div>-->
|
|
25
|
+ <div class="cell clearfix">
|
|
26
|
+ <label class="title"><span class="name">日期查询</span> : </label>
|
|
27
|
+ <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
|
|
28
|
+ type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
|
29
|
+ value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
|
|
30
|
+ <span class="">-</span>
|
|
31
|
+ <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
|
|
32
|
+ type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
|
33
|
+ value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
|
|
34
|
+ </div>
|
|
35
|
+ <div class="record">
|
|
36
|
+ <el-row :gutter="15">
|
|
37
|
+ <el-col :span="10">
|
|
38
|
+ <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="record_table" :data="records"
|
|
39
|
+ border highlight-current-row @current-change="didChangeCurrentRecord"
|
|
40
|
+ @selection-change="didSelectionChange"
|
|
41
|
+ :row-class-name="tableRow"
|
|
42
|
+ @row-click="onRowClick"
|
|
43
|
+ >
|
|
44
|
+ <el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
45
|
+ <el-table-column label="记录时间" align="center">
|
|
46
|
+ <template slot-scope="scope">
|
|
47
|
+ {{ recordTime(scope.row.record_time) }}
|
|
48
|
+ </template>
|
|
49
|
+ </el-table-column>
|
|
50
|
+ <el-table-column label="记录医生" align="center">
|
|
51
|
+ <template slot-scope="scope">
|
|
52
|
+ {{ doctorName(scope.row.recorder) }}
|
|
53
|
+ </template>
|
|
54
|
+ </el-table-column>
|
|
55
|
+ </el-table>
|
|
56
|
+ </el-col>
|
|
57
|
+ <el-col :span="14">
|
|
58
|
+ <div class="record_content_panel">
|
|
59
|
+ <div style="background-color:rgb(245, 247, 250)" class="title">病程内容</div>
|
|
60
|
+ <div class="content">
|
|
61
|
+ {{ current_select_record == null ? '' : current_select_record.content }}
|
19
|
62
|
</div>
|
20
|
|
- <!--<div></div>-->
|
21
|
|
- <div class="cell clearfix">
|
22
|
|
- <label class="title"><span class="name">日期查询</span> : </label>
|
23
|
|
- <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
|
24
|
|
- type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
25
|
|
- value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
|
26
|
|
- <span class="">-</span>
|
27
|
|
- <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
|
28
|
|
- type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
29
|
|
- value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
|
30
|
63
|
</div>
|
31
|
|
- <div class="record">
|
32
|
|
- <el-row :gutter="15">
|
33
|
|
- <el-col :span="10">
|
34
|
|
- <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="record_table" :data="records" border highlight-current-row @current-change="didChangeCurrentRecord" @selection-change="didSelectionChange">
|
35
|
|
- <el-table-column type="selection" width="40" align="center"></el-table-column>
|
36
|
|
- <el-table-column label="记录时间" align="center">
|
37
|
|
- <template slot-scope="scope">
|
38
|
|
- {{ recordTime(scope.row.record_time) }}
|
39
|
|
- </template>
|
40
|
|
- </el-table-column>
|
41
|
|
- <el-table-column label="记录医生" align="center">
|
42
|
|
- <template slot-scope="scope">
|
43
|
|
- {{ doctorName(scope.row.recorder) }}
|
44
|
|
- </template>
|
45
|
|
- </el-table-column>
|
46
|
|
- </el-table>
|
47
|
|
- </el-col>
|
48
|
|
- <el-col :span="14">
|
49
|
|
- <div class="record_content_panel">
|
50
|
|
- <div style="background-color:rgb(245, 247, 250)" class="title">病程内容</div>
|
51
|
|
- <div class="content">
|
52
|
|
- {{ current_select_record == null ? "" : current_select_record.content }}
|
53
|
|
- </div>
|
54
|
|
- </div>
|
55
|
|
- </el-col>
|
56
|
|
- </el-row>
|
57
|
|
- </div>
|
|
64
|
+ </el-col>
|
|
65
|
+ </el-row>
|
|
66
|
+ </div>
|
|
67
|
+ </div>
|
|
68
|
+ <!-- </div> -->
|
|
69
|
+ <el-dialog title="新增病程记录" width="40%" top="5vh" :visible.sync="show_dialog">
|
|
70
|
+ <div>
|
|
71
|
+ <div class="new_record_form">
|
|
72
|
+ <div class="cell clearfix">
|
|
73
|
+ <label class="title"><span class="name">病程日期</span> : </label>
|
|
74
|
+ <el-date-picker v-model="course_of_disease_time" prefix-icon="el-icon-date" :editable="false"
|
|
75
|
+ style="width: 150px;"
|
|
76
|
+ type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
|
77
|
+ value-format="yyyy-MM-dd"></el-date-picker>
|
|
78
|
+
|
|
79
|
+ <label class="title"><span class="name">日常病程</span> : </label>
|
|
80
|
+ <el-select v-model="select_template" placeholder="可选择病程模板" @change="didSelectTemplate">
|
|
81
|
+ <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
|
|
82
|
+ :value="option.content"></el-option>
|
|
83
|
+ </el-select>
|
58
|
84
|
</div>
|
59
|
|
- <!-- </div> -->
|
60
|
|
- <el-dialog title="新增病程记录" width="40%" top="5vh" :visible.sync="show_dialog">
|
61
|
|
- <div>
|
62
|
|
- <div class="new_record_form">
|
63
|
|
- <div class="cell clearfix">
|
64
|
|
- <label class="title"><span class="name">病程日期</span> : </label>
|
65
|
|
- <el-date-picker v-model="course_of_disease_time" prefix-icon="el-icon-date" :editable="false" style="width: 150px;"
|
66
|
|
- type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
67
|
|
- value-format="yyyy-MM-dd"></el-date-picker>
|
68
|
|
-
|
69
|
|
- <label class="title"><span class="name">日常病程</span> : </label>
|
70
|
|
- <el-select v-model="select_template" placeholder="可选择病程模板" @change="didSelectTemplate" >
|
71
|
|
- <el-option v-for="(option, index) in templates" :key="index" :label="option.title" :value="option.content"></el-option>
|
72
|
|
- </el-select>
|
73
|
|
- </div>
|
74
|
|
-
|
75
|
|
-
|
76
|
|
- <div class="textarea_panel">
|
77
|
|
- <el-input v-model="new_content" type="textarea" rows="6" resize="none"></el-input>
|
78
|
|
- </div>
|
79
|
|
-
|
80
|
|
- <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
|
81
|
|
- <el-button @click="show_dialog = false">取消</el-button>
|
82
|
|
- <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="createAction" :loading="uploading_new_record">保存</el-button>
|
83
|
|
- </div>
|
84
|
|
- </div>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+ <div class="textarea_panel">
|
|
88
|
+ <el-input v-model="new_content" type="textarea" rows="6" resize="none"></el-input>
|
85
|
89
|
</div>
|
86
|
|
- </el-dialog>
|
87
|
|
- </div>
|
|
90
|
+
|
|
91
|
+ <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
|
|
92
|
+ <el-button @click="show_dialog = false">取消</el-button>
|
|
93
|
+ <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
|
|
94
|
+ @click="createAction" :loading="uploading_new_record">保存
|
|
95
|
+ </el-button>
|
|
96
|
+ </div>
|
|
97
|
+ </div>
|
|
98
|
+ </div>
|
|
99
|
+ </el-dialog>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+ <el-dialog title="修改病程记录" width="40%" top="5vh" :visible.sync="show_edit_dialog">
|
|
103
|
+ <div>
|
|
104
|
+ <div class="new_record_form">
|
|
105
|
+ <div class="cell clearfix">
|
|
106
|
+ <label class="title"><span class="name">病程日期</span> : </label>
|
|
107
|
+ <el-date-picker v-model="edit_course_of_disease_time" prefix-icon="el-icon-date" :editable="false"
|
|
108
|
+ style="width: 150px;"
|
|
109
|
+ type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
|
|
110
|
+ value-format="yyyy-MM-dd"></el-date-picker>
|
|
111
|
+
|
|
112
|
+ <label class="title"><span class="name">日常病程</span> : </label>
|
|
113
|
+ <el-select v-model="select_template" placeholder="可选择病程模板" @change="didEditSelectTemplate">
|
|
114
|
+ <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
|
|
115
|
+ :value="option.content"></el-option>
|
|
116
|
+ </el-select>
|
|
117
|
+ </div>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+ <div class="textarea_panel">
|
|
121
|
+ <el-input v-model="edit_new_content" type="textarea" rows="6" resize="none"></el-input>
|
|
122
|
+ </div>
|
|
123
|
+
|
|
124
|
+ <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
|
|
125
|
+ <el-button @click="show_edit_dialog = false">取消</el-button>
|
|
126
|
+ <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
|
|
127
|
+ @click="modifyAction" :loading="uploading_new_record">保存
|
|
128
|
+ </el-button>
|
|
129
|
+ </div>
|
|
130
|
+ </div>
|
|
131
|
+ </div>
|
|
132
|
+ </el-dialog>
|
88
|
133
|
</div>
|
|
134
|
+ </div>
|
89
|
135
|
|
90
|
136
|
<!-- </div> -->
|
91
|
137
|
</template>
|
92
|
138
|
|
93
|
139
|
<script>
|
94
|
|
-import PatientSidebar from "./components/PatientSidebar"
|
95
|
|
-import { getCourseOfDiseaseRecords, createCourseOfDiseaseRecord, deleteCourseOfDiseaseRecords } from "@/api/patient"
|
96
|
|
-import { parseTime } from "@/utils"
|
97
|
|
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
98
|
|
-
|
99
|
|
-export default {
|
100
|
|
- name: "CourseOfDisease",
|
|
140
|
+ import PatientSidebar from './components/PatientSidebar'
|
|
141
|
+ import {
|
|
142
|
+ createCourseOfDiseaseRecord,
|
|
143
|
+ deleteCourseOfDiseaseRecords,
|
|
144
|
+ getCourseOfDiseaseRecords,
|
|
145
|
+ modifyCourseOfDiseaseRecord
|
|
146
|
+ } from '@/api/patient'
|
|
147
|
+ import { parseTime } from '@/utils'
|
|
148
|
+ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
149
|
+
|
|
150
|
+ export default {
|
|
151
|
+ name: 'CourseOfDisease',
|
101
|
152
|
components: {
|
102
|
|
- PatientSidebar,
|
103
|
|
- BreadCrumb
|
|
153
|
+ PatientSidebar,
|
|
154
|
+ BreadCrumb
|
104
|
155
|
},
|
105
|
156
|
data() {
|
106
|
|
- return {
|
107
|
|
- loading: false,
|
108
|
|
-
|
109
|
|
- patient_id: 0,
|
110
|
|
- date: [],
|
111
|
|
- start_time: '',
|
112
|
|
- end_time: '',
|
113
|
|
- course_of_disease_time:'',
|
114
|
|
- records: [],
|
115
|
|
- doctors: [],
|
116
|
|
- current_select_record: null,
|
117
|
|
- show_dialog: false,
|
118
|
|
- uploading_new_record: false,
|
119
|
|
- templates: this.$store.getters.configlist.course_disease,
|
120
|
|
- select_template: '',
|
121
|
|
- new_content: "",
|
122
|
|
-
|
123
|
|
- selectingRows: [],
|
124
|
|
- }
|
|
157
|
+ return {
|
|
158
|
+ loading: false,
|
|
159
|
+
|
|
160
|
+ patient_id: 0,
|
|
161
|
+ date: [],
|
|
162
|
+ start_time: '',
|
|
163
|
+ end_time: '',
|
|
164
|
+ course_of_disease_time: '',
|
|
165
|
+ records: [],
|
|
166
|
+ doctors: [],
|
|
167
|
+ current_select_record: null,
|
|
168
|
+ show_dialog: false,
|
|
169
|
+ show_edit_dialog: false,
|
|
170
|
+ uploading_new_record: false,
|
|
171
|
+ templates: this.$store.getters.configlist.course_disease,
|
|
172
|
+ select_template: '',
|
|
173
|
+ new_content: '',
|
|
174
|
+ edit_new_content: '',
|
|
175
|
+ edit_course_of_disease_time: '',
|
|
176
|
+ selectingRows: [],
|
|
177
|
+ table_current_index: -1,
|
|
178
|
+ edit_current_id:0
|
|
179
|
+ }
|
125
|
180
|
},
|
126
|
181
|
created() {
|
127
|
|
- this.patient_id = parseInt(this.$route.query.id)
|
128
|
|
- if (isNaN(this.patient_id) || this.patient_id <= 0) {
|
129
|
|
- this.$notify.error({
|
130
|
|
- title: "错误",
|
131
|
|
- message: "无效的id"
|
132
|
|
- })
|
133
|
|
- this.$router.push("/patients/patients")
|
134
|
|
- return
|
135
|
|
- }
|
136
|
|
- var now = new Date()
|
137
|
|
- this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
|
138
|
|
-
|
139
|
|
-
|
|
182
|
+ this.patient_id = parseInt(this.$route.query.id)
|
|
183
|
+ if (isNaN(this.patient_id) || this.patient_id <= 0) {
|
|
184
|
+ this.$notify.error({
|
|
185
|
+ title: '错误',
|
|
186
|
+ message: '无效的id'
|
|
187
|
+ })
|
|
188
|
+ this.$router.push('/patients/patients')
|
|
189
|
+ return
|
|
190
|
+ }
|
|
191
|
+ var now = new Date()
|
|
192
|
+ this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
|
140
|
193
|
|
141
|
|
- var nowDate = new Date();
|
142
|
|
- var nowYear = nowDate.getFullYear();
|
143
|
|
- var nowMonth = nowDate.getMonth() + 1;
|
144
|
|
- var nowDay = nowDate.getDate();
|
|
194
|
+ var nowDate = new Date()
|
|
195
|
+ var nowYear = nowDate.getFullYear()
|
|
196
|
+ var nowMonth = nowDate.getMonth() + 1
|
|
197
|
+ var nowDay = nowDate.getDate()
|
145
|
198
|
this.end_time =
|
146
|
199
|
nowYear +
|
147
|
|
- "-" +
|
148
|
|
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
149
|
|
- "-" +
|
150
|
|
- (nowDay < 10 ? "0" + nowDay : nowDay);
|
151
|
|
- nowDate.setMonth(nowDate.getMonth() - 1);
|
152
|
|
- nowYear = nowDate.getFullYear();
|
153
|
|
- nowMonth = nowDate.getMonth() + 1;
|
154
|
|
- nowDay = nowDate.getDate();
|
|
200
|
+ '-' +
|
|
201
|
+ (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
|
|
202
|
+ '-' +
|
|
203
|
+ (nowDay < 10 ? '0' + nowDay : nowDay)
|
|
204
|
+ nowDate.setMonth(nowDate.getMonth() - 1)
|
|
205
|
+ nowYear = nowDate.getFullYear()
|
|
206
|
+ nowMonth = nowDate.getMonth() + 1
|
|
207
|
+ nowDay = nowDate.getDate()
|
155
|
208
|
this.start_time =
|
156
|
209
|
nowYear +
|
157
|
|
- "-" +
|
158
|
|
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
159
|
|
- "-" +
|
160
|
|
- (nowDay < 10 ? "0" + nowDay : nowDay);
|
161
|
|
-
|
|
210
|
+ '-' +
|
|
211
|
+ (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
|
|
212
|
+ '-' +
|
|
213
|
+ (nowDay < 10 ? '0' + nowDay : nowDay)
|
162
|
214
|
|
163
|
215
|
this.requestCourseRecords()
|
164
|
216
|
|
165
|
|
-
|
166
|
|
-
|
167
|
217
|
},
|
168
|
218
|
methods: {
|
169
|
|
- requestCourseRecords: function() {
|
170
|
|
- this.loading = true
|
171
|
|
- getCourseOfDiseaseRecords(this.patient_id, this.start_time,this.end_time).then(rs => {
|
172
|
|
- this.loading = false
|
173
|
|
- var resp = rs.data
|
174
|
|
- if (resp.state == 1) {
|
175
|
|
- this.current_select_record = null
|
176
|
|
- this.records = resp.data.records
|
177
|
|
- this.doctors = resp.data.doctors
|
178
|
|
-
|
179
|
|
- } else {
|
180
|
|
- this.$message.error(resp.msg)
|
181
|
|
- }
|
182
|
|
- }).catch(error => {
|
183
|
|
- this.loading = false
|
184
|
|
- this.$message.error(error)
|
185
|
|
- })
|
186
|
|
- },
|
187
|
|
-
|
188
|
|
- didChangeCurrentRecord: function(record) {
|
189
|
|
- this.current_select_record = record
|
190
|
|
- },
|
191
|
|
- recordTime: function(timestamp) {
|
192
|
|
- var time = new Date(timestamp * 1000)
|
193
|
|
- return parseTime(time, "{y}-{m}-{d}")
|
194
|
|
- },
|
195
|
|
- doctorName: function(doctor_id) {
|
196
|
|
- for (let index = 0; index < this.doctors.length; index++) {
|
197
|
|
- const doctor = this.doctors[index];
|
198
|
|
- if (doctor.id == doctor_id) {
|
199
|
|
- return doctor.name
|
200
|
|
- }
|
201
|
|
- }
|
202
|
|
- return ""
|
203
|
|
- },
|
204
|
|
-
|
205
|
|
-
|
206
|
|
- createAction: function() {
|
207
|
|
- if (this.new_content.length == 0) {
|
208
|
|
- this.$message.error("请填写病程内容")
|
209
|
|
- return
|
210
|
|
- }
|
211
|
|
- this.uploading_new_record = true
|
212
|
|
- createCourseOfDiseaseRecord(this.patient_id, this.new_content,this.course_of_disease_time).then(rs => {
|
213
|
|
- this.uploading_new_record = false
|
214
|
|
- var resp = rs.data
|
215
|
|
- if (resp.state == 1) {
|
216
|
|
- this.records.unshift(resp.data.record)
|
217
|
|
- // this.$refs.record_table.setCurrentRow()
|
218
|
|
- this.$refs.record_table.setCurrentRow(this.records[0])
|
219
|
|
- // this.current_select_record = this.records[0]
|
220
|
|
- this.show_dialog = false
|
221
|
|
- this.new_content = ""
|
222
|
|
-
|
223
|
|
- } else {
|
224
|
|
- this.$message.error(resp.msg)
|
|
219
|
+ requestCourseRecords: function() {
|
|
220
|
+ this.loading = true
|
|
221
|
+ getCourseOfDiseaseRecords(this.patient_id, this.start_time, this.end_time).then(rs => {
|
|
222
|
+ this.loading = false
|
|
223
|
+ var resp = rs.data
|
|
224
|
+ if (resp.state == 1) {
|
|
225
|
+ this.current_select_record = null
|
|
226
|
+ this.records = resp.data.records
|
|
227
|
+ this.doctors = resp.data.doctors
|
|
228
|
+
|
|
229
|
+ } else {
|
|
230
|
+ this.$message.error(resp.msg)
|
|
231
|
+ }
|
|
232
|
+ }).catch(error => {
|
|
233
|
+ this.loading = false
|
|
234
|
+ this.$message.error(error)
|
|
235
|
+ })
|
|
236
|
+ },
|
|
237
|
+
|
|
238
|
+ didChangeCurrentRecord: function(record) {
|
|
239
|
+ this.current_select_record = record
|
|
240
|
+ },
|
|
241
|
+ recordTime: function(timestamp) {
|
|
242
|
+ var time = new Date(timestamp * 1000)
|
|
243
|
+ return parseTime(time, '{y}-{m}-{d}')
|
|
244
|
+ },
|
|
245
|
+ doctorName: function(doctor_id) {
|
|
246
|
+ for (let index = 0; index < this.doctors.length; index++) {
|
|
247
|
+ const doctor = this.doctors[index]
|
|
248
|
+ if (doctor.id == doctor_id) {
|
|
249
|
+ return doctor.name
|
|
250
|
+ }
|
|
251
|
+ }
|
|
252
|
+ return ''
|
|
253
|
+ },
|
|
254
|
+ modifyAction: function() {
|
|
255
|
+ if (this.edit_new_content.length == 0) {
|
|
256
|
+ this.$message.error('请填写病程内容')
|
|
257
|
+ return
|
|
258
|
+ }
|
|
259
|
+ this.uploading_new_record = true
|
|
260
|
+ modifyCourseOfDiseaseRecord(this.patient_id, this.edit_new_content, this.edit_course_of_disease_time,this.edit_current_id).then(rs => {
|
|
261
|
+ this.uploading_new_record = false
|
|
262
|
+ var resp = rs.data
|
|
263
|
+ if (resp.state == 1) {
|
|
264
|
+ this.records[this.table_current_index].content = resp.data.record.content
|
|
265
|
+ this.records[this.table_current_index].record_time = resp.data.record.record_time
|
|
266
|
+ this.records[this.table_current_index].recorder = resp.data.record.recorder
|
|
267
|
+
|
|
268
|
+ this.show_edit_dialog = false
|
|
269
|
+ this.edit_new_content = ''
|
|
270
|
+ this.table_current_index = -1
|
|
271
|
+
|
|
272
|
+ } else {
|
|
273
|
+ this.table_current_index = -1
|
|
274
|
+ this.$message.error(resp.msg)
|
|
275
|
+ }
|
|
276
|
+
|
|
277
|
+ }).catch(error => {
|
|
278
|
+ this.table_current_index = -1
|
|
279
|
+ this.uploading_new_record = false
|
|
280
|
+ this.$message.error(error)
|
|
281
|
+ })
|
|
282
|
+
|
|
283
|
+ },
|
|
284
|
+
|
|
285
|
+ createAction: function() {
|
|
286
|
+ if (this.new_content.length == 0) {
|
|
287
|
+ this.$message.error('请填写病程内容')
|
|
288
|
+ return
|
|
289
|
+ }
|
|
290
|
+ this.uploading_new_record = true
|
|
291
|
+ createCourseOfDiseaseRecord(this.patient_id, this.new_content, this.course_of_disease_time).then(rs => {
|
|
292
|
+ this.uploading_new_record = false
|
|
293
|
+ var resp = rs.data
|
|
294
|
+ if (resp.state == 1) {
|
|
295
|
+ this.records.unshift(resp.data.record)
|
|
296
|
+ // this.$refs.record_table.setCurrentRow()
|
|
297
|
+ this.$refs.record_table.setCurrentRow(this.records[0])
|
|
298
|
+ // this.current_select_record = this.records[0]
|
|
299
|
+ this.show_dialog = false
|
|
300
|
+ this.new_content = ''
|
|
301
|
+
|
|
302
|
+ } else {
|
|
303
|
+ this.$message.error(resp.msg)
|
|
304
|
+ }
|
|
305
|
+
|
|
306
|
+ }).catch(error => {
|
|
307
|
+ this.uploading_new_record = false
|
|
308
|
+ this.$message.error(error)
|
|
309
|
+ })
|
|
310
|
+ },
|
|
311
|
+ didSelectTemplate: function(templateContent) {
|
|
312
|
+ this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+ },didEditSelectTemplate:function(templateContent){
|
|
316
|
+ this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
|
|
317
|
+ },
|
|
318
|
+
|
|
319
|
+ didSelectionChange: function(selectRows) {
|
|
320
|
+ this.selectingRows = selectRows
|
|
321
|
+ },
|
|
322
|
+ deleteAction: function() {
|
|
323
|
+ if (this.selectingRows.length == 0) {
|
|
324
|
+ return
|
|
325
|
+ }
|
|
326
|
+ var ids = []
|
|
327
|
+ for (let index = 0; index < this.selectingRows.length; index++) {
|
|
328
|
+ const row = this.selectingRows[index]
|
|
329
|
+ ids.push(row.id)
|
|
330
|
+ }
|
|
331
|
+ var ids_str = ids.join(',')
|
|
332
|
+ this.loading = true
|
|
333
|
+ deleteCourseOfDiseaseRecords(this.patient_id, ids_str).then(rs => {
|
|
334
|
+ var resp = rs.data
|
|
335
|
+ if (resp.state == 1) {
|
|
336
|
+ for (let id_index = 0; id_index < ids.length; id_index++) {
|
|
337
|
+ for (let record_index = 0; record_index < this.records.length; record_index++) {
|
|
338
|
+ if (ids[id_index] == this.records[record_index].id) {
|
|
339
|
+ this.records.splice(record_index, 1)
|
|
340
|
+ break
|
225
|
341
|
}
|
226
|
|
-
|
227
|
|
- }).catch(error => {
|
228
|
|
- this.uploading_new_record = false
|
229
|
|
- this.$message.error(error)
|
230
|
|
- })
|
231
|
|
- },
|
232
|
|
- didSelectTemplate: function(templateContent) {
|
233
|
|
- this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
|
234
|
|
-
|
235
|
|
- },
|
236
|
|
-
|
237
|
|
- didSelectionChange: function(selectRows) {
|
238
|
|
- this.selectingRows = selectRows
|
239
|
|
- },
|
240
|
|
- deleteAction: function() {
|
241
|
|
- if (this.selectingRows.length == 0) {
|
242
|
|
- return
|
243
|
|
- }
|
244
|
|
- var ids = []
|
245
|
|
- for (let index = 0; index < this.selectingRows.length; index++) {
|
246
|
|
- const row = this.selectingRows[index];
|
247
|
|
- ids.push(row.id)
|
|
342
|
+ }
|
248
|
343
|
}
|
249
|
|
- var ids_str = ids.join(",")
|
250
|
|
- this.loading = true
|
251
|
|
- deleteCourseOfDiseaseRecords(this.patient_id, ids_str).then(rs => {
|
252
|
|
- var resp = rs.data
|
253
|
|
- if (resp.state == 1) {
|
254
|
|
- for (let id_index = 0; id_index < ids.length; id_index++) {
|
255
|
|
- for (let record_index = 0; record_index < this.records.length; record_index++) {
|
256
|
|
- if (ids[id_index] == this.records[record_index].id) {
|
257
|
|
- this.records.splice(record_index, 1)
|
258
|
|
- break
|
259
|
|
- }
|
260
|
|
- }
|
261
|
|
- }
|
262
|
|
- this.selectingRows = []
|
263
|
|
- this.$message.success("已删除")
|
264
|
|
-
|
265
|
|
- } else {
|
266
|
|
- this.$message.error(resp.msg)
|
267
|
|
- }
|
268
|
|
- this.loading = false
|
269
|
|
- }).catch(err => {
|
270
|
|
- this.loading = false
|
271
|
|
- this.$message.error(err)
|
272
|
|
- })
|
273
|
|
- },startTimeChange(val) {
|
|
344
|
+ this.selectingRows = []
|
|
345
|
+ this.$message.success('已删除')
|
|
346
|
+
|
|
347
|
+ } else {
|
|
348
|
+ this.$message.error(resp.msg)
|
|
349
|
+ }
|
|
350
|
+ this.loading = false
|
|
351
|
+ }).catch(err => {
|
|
352
|
+ this.loading = false
|
|
353
|
+ this.$message.error(err)
|
|
354
|
+ })
|
|
355
|
+ }, startTimeChange(val) {
|
274
|
356
|
this.requestCourseRecords()
|
275
|
357
|
}, endTimeChange(val) {
|
276
|
358
|
this.requestCourseRecords()
|
|
359
|
+ }, showEdit() {
|
|
360
|
+ if (this.table_current_index == -1) {
|
|
361
|
+ this.$message.error('请选择要修改的病情内容')
|
|
362
|
+ return
|
|
363
|
+ }
|
|
364
|
+ this.show_edit_dialog = true
|
|
365
|
+ this.edit_course_of_disease_time = this.recordTime(this.records[this.table_current_index].record_time)
|
|
366
|
+ this.edit_new_content = this.records[this.table_current_index].content
|
|
367
|
+ this.edit_current_id = this.records[this.table_current_index].id
|
|
368
|
+ this.$refs.record_table.setCurrentRow(null)
|
|
369
|
+
|
|
370
|
+ }, tableRow({ row, rowIndex }) {
|
|
371
|
+ // 把每一行的索引放进row
|
|
372
|
+ row.index = rowIndex
|
|
373
|
+ }, onRowClick(row, event, column) {
|
|
374
|
+ this.table_current_index = row.index
|
277
|
375
|
}
|
278
|
|
- },
|
279
|
|
-}
|
|
376
|
+ }
|
|
377
|
+ }
|
280
|
378
|
</script>
|
281
|
379
|
|
282
|
380
|
<style rel="stylesheet/css" lang="scss" scoped>
|
283
|
|
-.container {
|
|
381
|
+ .container {
|
284
|
382
|
margin-left: 180px;
|
285
|
383
|
padding: 20px;
|
286
|
384
|
background: #fff;
|
287
|
385
|
min-height: calc(100vh - 173px);
|
288
|
386
|
margin-bottom: 15px;
|
289
|
387
|
|
290
|
|
- .record {
|
291
|
|
- padding-top: 20px;
|
292
|
|
- }
|
293
|
|
-}
|
294
|
|
-.record_content_panel {
|
|
388
|
+ .record {
|
|
389
|
+ padding-top: 20px;
|
|
390
|
+ }
|
|
391
|
+
|
|
392
|
+ }
|
|
393
|
+ .record_content_panel {
|
295
|
394
|
border-width: 1px;
|
296
|
395
|
border-style: solid;
|
297
|
396
|
border-color: #ebeef5;
|
298
|
397
|
min-height: 200px;
|
299
|
398
|
|
300
|
|
- .title {
|
301
|
|
- font-size: 14px;
|
302
|
|
- font-weight: 500;
|
303
|
|
- color: #909399;
|
304
|
|
- line-height: 44px;
|
305
|
|
- height: 44px;
|
306
|
|
- text-align: center;
|
307
|
|
- border-bottom-width: 1px;
|
308
|
|
- border-bottom-style: solid;
|
309
|
|
- border-bottom-color: #ebeef5;
|
310
|
|
- }
|
311
|
|
- .content {
|
312
|
|
- padding: 12px 15px;
|
313
|
|
- font-size: 15px;
|
314
|
|
- color: gray;
|
315
|
|
- line-height: 22px;
|
316
|
|
- }
|
317
|
|
-}
|
318
|
|
-
|
319
|
|
-.new_record_form {
|
320
|
|
- // padding: 10px, 25px;
|
321
|
|
-
|
322
|
|
- .textarea_panel {
|
323
|
|
- margin-top: 10px;
|
324
|
|
- }
|
325
|
|
-}
|
|
399
|
+ .title {
|
|
400
|
+ font-size: 14px;
|
|
401
|
+ font-weight: 500;
|
|
402
|
+ color: #909399;
|
|
403
|
+ line-height: 44px;
|
|
404
|
+ height: 44px;
|
|
405
|
+ text-align: center;
|
|
406
|
+ border-bottom-width: 1px;
|
|
407
|
+ border-bottom-style: solid;
|
|
408
|
+ border-bottom-color: #ebeef5;
|
|
409
|
+ }
|
|
410
|
+
|
|
411
|
+ .content {
|
|
412
|
+ padding: 12px 15px;
|
|
413
|
+ font-size: 15px;
|
|
414
|
+ color: gray;
|
|
415
|
+ line-height: 22px;
|
|
416
|
+ }
|
|
417
|
+
|
|
418
|
+ }
|
|
419
|
+
|
|
420
|
+ .new_record_form {
|
|
421
|
+ /*/ / padding: 10 px, 25 px;*/
|
|
422
|
+
|
|
423
|
+ .textarea_panel {
|
|
424
|
+ margin-top: 10px;
|
|
425
|
+ }
|
|
426
|
+
|
|
427
|
+ }
|
326
|
428
|
</style>
|