|
@@ -40,6 +40,15 @@
|
40
|
40
|
</el-col>
|
41
|
41
|
<el-col :span="17" v-loading="itemLoading">
|
42
|
42
|
<div class="filter-container" style="float:right">
|
|
43
|
+ <el-button
|
|
44
|
+ size="small"
|
|
45
|
+ class="filter-item"
|
|
46
|
+ type="primary"
|
|
47
|
+ @click="openPic()"
|
|
48
|
+ icon="el-icon-circle-plus-outline"
|
|
49
|
+ :disabled="project ? false : true"
|
|
50
|
+ >上传图片
|
|
51
|
+ </el-button>
|
43
|
52
|
<el-button
|
44
|
53
|
size="small"
|
45
|
54
|
class="filter-item"
|
|
@@ -47,7 +56,8 @@
|
47
|
56
|
@click="openNew()"
|
48
|
57
|
icon="el-icon-circle-plus-outline"
|
49
|
58
|
:disabled="project ? false : true"
|
50
|
|
- >新增</el-button
|
|
59
|
+ >新增
|
|
60
|
+ </el-button
|
51
|
61
|
>
|
52
|
62
|
<el-button
|
53
|
63
|
size="small"
|
|
@@ -56,7 +66,8 @@
|
56
|
66
|
icon="el-icon-edit-outline"
|
57
|
67
|
@click="openEdit()"
|
58
|
68
|
:disabled="itemDate ? false : true"
|
59
|
|
- >修改</el-button
|
|
69
|
+ >修改
|
|
70
|
+ </el-button
|
60
|
71
|
>
|
61
|
72
|
<el-button
|
62
|
73
|
size="small"
|
|
@@ -65,73 +76,111 @@
|
65
|
76
|
icon="el-icon-delete"
|
66
|
77
|
@click="deleteInspection()"
|
67
|
78
|
:disabled="itemDate ? false : true"
|
68
|
|
- >删除</el-button
|
|
79
|
+ >删除
|
|
80
|
+ </el-button
|
69
|
81
|
>
|
70
|
82
|
</div>
|
71
|
83
|
<div class="filter-container">
|
72
|
84
|
<el-button class="filter-item" type="text" style="color:#000"
|
73
|
|
- >{{ itemName }}
|
|
85
|
+ >{{ itemName }}
|
74
|
86
|
<span v-if="itemDate"
|
75
|
|
- >(检查日期:{{ itemDate }})</span
|
|
87
|
+ >(检查日期:{{ itemDate }})</span
|
76
|
88
|
></el-button
|
77
|
89
|
>
|
78
|
90
|
</div>
|
79
|
|
- <el-table
|
80
|
|
- :header-cell-style="{
|
|
91
|
+ <div v-if="!isPic">
|
|
92
|
+ <el-table
|
|
93
|
+ :header-cell-style="{
|
81
|
94
|
backgroundColor: 'rgb(245, 247, 250)',
|
82
|
95
|
color: '#606266'
|
83
|
96
|
}"
|
84
|
|
- :row-style="{ color: '#303133' }"
|
85
|
|
- :data="items"
|
86
|
|
- border
|
87
|
|
- style="width: 100%"
|
88
|
|
- id="user-inspection-order"
|
89
|
|
- >
|
90
|
|
- <el-table-column
|
91
|
|
- prop="item_name"
|
92
|
|
- label="检验项目"
|
93
|
|
- align="center"
|
94
|
|
- min-width="180"
|
95
|
|
- >
|
96
|
|
- <template slot-scope="scope">
|
97
|
|
- {{ scope.row.item_name }} {{ scope.row.item_name_addition }}
|
98
|
|
- </template>
|
99
|
|
- </el-table-column>
|
100
|
|
- <el-table-column
|
101
|
|
- prop="name"
|
102
|
|
- label="结果"
|
103
|
|
- align="center"
|
104
|
|
- min-width="80"
|
|
97
|
+ :row-style="{ color: '#303133' }"
|
|
98
|
+ :data="items"
|
|
99
|
+ border
|
|
100
|
+ style="width: 100%"
|
|
101
|
+ id="user-inspection-order"
|
|
102
|
+
|
105
|
103
|
>
|
106
|
|
- <template slot-scope="scope">
|
107
|
|
- <span v-if="scope.row.value =='阳性'" style="color:red">{{ scope.row.value }}</span>
|
108
|
|
- <span v-else>{{ scope.row.value }}</span>
|
109
|
|
- <span v-if="scope.row.range_type == 1">
|
110
|
|
- {{scope.row.value_direction}}
|
|
104
|
+ <el-table-column
|
|
105
|
+ prop="item_name"
|
|
106
|
+ label="检验项目"
|
|
107
|
+ align="center"
|
|
108
|
+ min-width="180"
|
|
109
|
+ >
|
|
110
|
+ <template slot-scope="scope">
|
|
111
|
+ {{ scope.row.item_name }} {{ scope.row.item_name_addition }}
|
|
112
|
+ </template>
|
|
113
|
+ </el-table-column>
|
|
114
|
+
|
|
115
|
+ <el-table-column
|
|
116
|
+ prop="name"
|
|
117
|
+ label="结果"
|
|
118
|
+ align="center"
|
|
119
|
+ min-width="80"
|
|
120
|
+ >
|
|
121
|
+ <template slot-scope="scope">
|
|
122
|
+ <div v-if="items[0].value.indexOf('http') < 0">
|
|
123
|
+ <span v-if="scope.row.value =='阳性'" style="color:red">{{ scope.row.value }}</span>
|
|
124
|
+ <span v-else>{{ scope.row.value }}</span>
|
|
125
|
+ <span v-if="scope.row.range_type == 1">
|
|
126
|
+ {{ scope.row.value_direction }}
|
111
|
127
|
</span>
|
|
128
|
+ </div>
|
|
129
|
+ <div v-else>
|
|
130
|
+ <img :src="scope.row.value">
|
|
131
|
+ </div>
|
|
132
|
+ </template>
|
|
133
|
+ </el-table-column>
|
|
134
|
+
|
|
135
|
+ <el-table-column
|
|
136
|
+ prop="address"
|
|
137
|
+ label="参考值"
|
|
138
|
+ align="center"
|
|
139
|
+ min-width="120"
|
|
140
|
+ >
|
|
141
|
+ <template slot-scope="scope">
|
|
142
|
+ <div v-if="items[0].value.indexOf('http') < 0">
|
|
143
|
+ <span v-if="scope.row.range_type == 1"
|
|
144
|
+ >{{ scope.row.range_min }}~{{ scope.row.range_max }}</span
|
|
145
|
+ >
|
|
146
|
+ <span v-else>{{ scope.row.range_value }}</span>
|
|
147
|
+ </div>
|
|
148
|
+ </template>
|
|
149
|
+
|
|
150
|
+ </el-table-column>
|
|
151
|
+
|
|
152
|
+ <el-table-column
|
|
153
|
+ prop="111"
|
|
154
|
+ label="单位"
|
|
155
|
+ align="center"
|
|
156
|
+ min-width="80"
|
|
157
|
+ >
|
|
158
|
+ <template slot-scope="scope">
|
|
159
|
+ <div v-if="items[0].value.indexOf('http') < 0">
|
|
160
|
+ <span>{{ scope.row.unit }}</span>
|
|
161
|
+ </div>
|
|
162
|
+ </template>
|
|
163
|
+ </el-table-column>
|
|
164
|
+ </el-table>
|
|
165
|
+ </div>
|
|
166
|
+ <div v-else>
|
|
167
|
+ <el-row>
|
|
168
|
+ <template v-for="(item, index) in items">
|
|
169
|
+ <el-col :span="7" :key="index">
|
|
170
|
+ <div style="width: 400px">
|
|
171
|
+ <el-row>
|
|
172
|
+ <img :src="item.value" alt="">
|
|
173
|
+ </el-row>
|
|
174
|
+ <el-row>
|
|
175
|
+ <div>{{item.item_name}}</div>
|
|
176
|
+ </el-row>
|
|
177
|
+ </div>
|
|
178
|
+ </el-col>
|
112
|
179
|
</template>
|
113
|
|
- </el-table-column>
|
114
|
|
- <el-table-column
|
115
|
|
- prop="address"
|
116
|
|
- label="参考值"
|
117
|
|
- align="center"
|
118
|
|
- min-width="120"
|
119
|
|
- >
|
120
|
|
- <template slot-scope="scope">
|
121
|
|
- <span v-if="scope.row.range_type == 1"
|
122
|
|
- >{{ scope.row.range_min }}~{{ scope.row.range_max }}</span
|
123
|
|
- >
|
124
|
|
- <span v-else>{{ scope.row.range_value }}</span>
|
125
|
|
- </template>
|
126
|
|
- </el-table-column>
|
127
|
|
- <el-table-column
|
128
|
|
- prop="unit"
|
129
|
|
- label="单位"
|
130
|
|
- align="center"
|
131
|
|
- min-width="80"
|
132
|
|
- >
|
133
|
|
- </el-table-column>
|
134
|
|
- </el-table>
|
|
180
|
+ </el-row>
|
|
181
|
+
|
|
182
|
+ </div>
|
|
183
|
+
|
135
|
184
|
<el-pagination
|
136
|
185
|
align="right"
|
137
|
186
|
@current-change="handleCurrentChangePage"
|
|
@@ -238,26 +287,112 @@
|
238
|
287
|
type="primary"
|
239
|
288
|
v-if="form.method == 'add'"
|
240
|
289
|
@click="submitNew('form')"
|
241
|
|
- >保 存</el-button
|
|
290
|
+ >保 存
|
|
291
|
+ </el-button
|
242
|
292
|
>
|
243
|
293
|
<el-button type="primary" v-else @click="submitEdit('form')"
|
244
|
|
- >保 存</el-button
|
|
294
|
+ >保 存
|
|
295
|
+ </el-button
|
245
|
296
|
>
|
246
|
297
|
</div>
|
247
|
298
|
</el-dialog>
|
|
299
|
+
|
|
300
|
+ <el-dialog
|
|
301
|
+ :title="formTitle"
|
|
302
|
+ :visible.sync="dialogPicFormVisible"
|
|
303
|
+ width="1000px"
|
|
304
|
+ id="user-inspection-form"
|
|
305
|
+ >
|
|
306
|
+ <el-form :model="form" ref="form" label-position="top">
|
|
307
|
+ <el-row>
|
|
308
|
+ <el-col :span="7">
|
|
309
|
+ <el-form-item
|
|
310
|
+ label="检验日期"
|
|
311
|
+ prop="inspect_date"
|
|
312
|
+ :rules="[
|
|
313
|
+ { required: true, message: '请输入检验日期', trigger: 'blur' }
|
|
314
|
+ ]"
|
|
315
|
+ >
|
|
316
|
+ <el-date-picker
|
|
317
|
+ style="width:95%"
|
|
318
|
+ v-model="form.inspect_date"
|
|
319
|
+ type="datetime"
|
|
320
|
+ value-format="yyyy-MM-dd HH:mm"
|
|
321
|
+ format="yyyy-MM-dd HH:mm"
|
|
322
|
+ placeholder="选择日期"
|
|
323
|
+ >
|
|
324
|
+ </el-date-picker>
|
|
325
|
+ </el-form-item>
|
|
326
|
+ </el-col>
|
|
327
|
+ </el-row>
|
|
328
|
+ <el-row>
|
|
329
|
+ <template v-for="(item, index) in form.imgs">
|
|
330
|
+ <el-col :span="5" :key="index">
|
|
331
|
+ <div>
|
|
332
|
+ <el-row>
|
|
333
|
+ <img width="100px" :src="item.img_url" alt="">
|
|
334
|
+ </el-row>
|
|
335
|
+ <el-row>
|
|
336
|
+ <el-input v-model="item.desc" style="width: 100px"></el-input>
|
|
337
|
+ </el-row>
|
|
338
|
+ <el-row>
|
|
339
|
+ <el-button
|
|
340
|
+ type="danger"
|
|
341
|
+ @click="deletePic(item,index)"
|
|
342
|
+ >删除
|
|
343
|
+ </el-button>
|
|
344
|
+ </el-row>
|
|
345
|
+ </div>
|
|
346
|
+ </el-col>
|
|
347
|
+ <el-col :span="1" :key="'form-col' + index"> </el-col>
|
|
348
|
+ </template>
|
|
349
|
+ </el-row>
|
|
350
|
+ </el-form>
|
|
351
|
+ <div slot="footer" class="dialog-footer">
|
|
352
|
+ <el-upload
|
|
353
|
+ :data="uploadData"
|
|
354
|
+ :multiple="false"
|
|
355
|
+ action="https://upload.qiniup.com"
|
|
356
|
+ :show-file-list="false"
|
|
357
|
+ :on-error="handleAvatarError"
|
|
358
|
+ :on-success="handleAvatarSuccess"
|
|
359
|
+ :before-upload="beforeAvatarUpload">
|
|
360
|
+ <el-button type="primary">选择文件</el-button>
|
|
361
|
+ </el-upload>
|
|
362
|
+ <el-button @click="dialogPicFormVisible = false">取 消</el-button>
|
|
363
|
+ <el-button
|
|
364
|
+ type="primary"
|
|
365
|
+ v-if="this.form.pic_method== 'add'"
|
|
366
|
+ @click="submitPicNew()"
|
|
367
|
+ >保 存
|
|
368
|
+ </el-button>
|
|
369
|
+
|
|
370
|
+ <el-button
|
|
371
|
+ type="primary"
|
|
372
|
+ v-if="this.form.pic_method == 'edit'"
|
|
373
|
+ @click="submitEditPicNew()"
|
|
374
|
+ >修 改
|
|
375
|
+ </el-button>
|
|
376
|
+ </div>
|
|
377
|
+ </el-dialog>
|
248
|
378
|
</div>
|
|
379
|
+
|
249
|
380
|
</template>
|
250
|
381
|
|
251
|
382
|
<script>
|
252
|
383
|
import PatientSidebar from './components/PatientSidebar'
|
|
384
|
+import { getToken } from '@/api/qiniu'
|
|
385
|
+
|
253
|
386
|
import {
|
254
|
|
- fetchInspectionReference,
|
255
|
387
|
CreatePatientInspection,
|
256
|
|
- fetchPatientInspections,
|
|
388
|
+ CreatePatientPICInspection,
|
|
389
|
+ editPatientPICInspection,
|
|
390
|
+ DeletePatientInspection,
|
257
|
391
|
EditPatientInspection,
|
258
|
|
- DeletePatientInspection
|
|
392
|
+ fetchInspectionReference,
|
|
393
|
+ fetchPatientInspections
|
259
|
394
|
} from '@/api/inspection'
|
260
|
|
-import { uParseTime, isPositiveNumber } from '@/utils/tools'
|
|
395
|
+import { getFileExtension, uParseTime } from '@/utils/tools'
|
261
|
396
|
|
262
|
397
|
export default {
|
263
|
398
|
name: 'Inspection',
|
|
@@ -265,6 +400,9 @@ export default {
|
265
|
400
|
data() {
|
266
|
401
|
return {
|
267
|
402
|
total: 0,
|
|
403
|
+ qiniuDomain: 'https://images.shengws.com/',
|
|
404
|
+ isPic:false,
|
|
405
|
+ uploadData: { token: '', key: '' },
|
268
|
406
|
pageLoading: true,
|
269
|
407
|
itemLoading: false,
|
270
|
408
|
formLoading: false,
|
|
@@ -276,15 +414,20 @@ export default {
|
276
|
414
|
},
|
277
|
415
|
itemName: '请选择项目',
|
278
|
416
|
formTitle: '',
|
|
417
|
+ dialogPicFormVisible: false,
|
279
|
418
|
dialogFormVisible: false,
|
280
|
419
|
patient_info: null,
|
|
420
|
+
|
281
|
421
|
form: {
|
282
|
422
|
remind_cycle: '',
|
283
|
423
|
method: 'add',
|
|
424
|
+ pic_method:'add',
|
284
|
425
|
project_id: 0,
|
285
|
426
|
inspect_date: '',
|
286
|
427
|
old_inspect_date: '',
|
287
|
|
- formItem: [{ id: 0, value: '' }]
|
|
428
|
+ formItem: [{ id: 0, value: '' }],
|
|
429
|
+ imgs: [],
|
|
430
|
+ delete_imgs:[],
|
288
|
431
|
},
|
289
|
432
|
formItem: [],
|
290
|
433
|
items: [],
|
|
@@ -300,19 +443,90 @@ export default {
|
300
|
443
|
}
|
301
|
444
|
},
|
302
|
445
|
methods: {
|
303
|
|
- changeInput(item){
|
304
|
|
-
|
305
|
|
- if(item.item_name == '血清铁' || item.item_name == '总铁结合力'){
|
|
446
|
+ beforeAvatarUpload(file) {
|
|
447
|
+ // const isJPG = file.type === "image/jpeg";
|
|
448
|
+ var fileType = file.type
|
|
449
|
+ const isJPG = fileType.indexOf('image') > -1
|
|
450
|
+ const isLt2M = file.size / 1024 / 1024 < 5
|
|
451
|
+
|
|
452
|
+ if (!isJPG) {
|
|
453
|
+ this.$message.error('只能上传图片')
|
|
454
|
+ return false
|
|
455
|
+ }
|
|
456
|
+ if (!isLt2M) {
|
|
457
|
+ this.$message.error('上传头像图片大小不能超过 5MB!')
|
|
458
|
+ return false
|
|
459
|
+ }
|
|
460
|
+
|
|
461
|
+ var date = new Date()
|
|
462
|
+ var ext = getFileExtension(file.name)
|
|
463
|
+ var key =
|
|
464
|
+ date.getFullYear() +
|
|
465
|
+ '/' +
|
|
466
|
+ (date.getMonth() + 1) +
|
|
467
|
+ '/' +
|
|
468
|
+ date.getDate() +
|
|
469
|
+ '/' +
|
|
470
|
+ date.getHours() +
|
|
471
|
+ '/' +
|
|
472
|
+ date.getMinutes() +
|
|
473
|
+ '/' +
|
|
474
|
+ date.getSeconds() +
|
|
475
|
+ '/' +
|
|
476
|
+ '_s_' +
|
|
477
|
+ file.uid +
|
|
478
|
+ '.' +
|
|
479
|
+ ext
|
|
480
|
+ this.loading = this.$loading({
|
|
481
|
+ lock: true,
|
|
482
|
+ text: '上传中...',
|
|
483
|
+ spinner: 'el-icon-loading',
|
|
484
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
485
|
+ })
|
|
486
|
+
|
|
487
|
+ const _self = this
|
|
488
|
+ return new Promise((resolve, reject) => {
|
|
489
|
+ getToken()
|
|
490
|
+ .then(response => {
|
|
491
|
+ const token = response.data.data.uptoken
|
|
492
|
+ _self._data.uploadData.token = token
|
|
493
|
+ _self._data.uploadData.key = key
|
|
494
|
+ resolve(true)
|
|
495
|
+ })
|
|
496
|
+ .catch(err => {
|
|
497
|
+ console.log(err)
|
|
498
|
+ reject(false)
|
|
499
|
+ this.loading.close()
|
|
500
|
+ })
|
|
501
|
+ })
|
|
502
|
+ },
|
|
503
|
+
|
|
504
|
+ handleAvatarError(err, file, fileList) {
|
|
505
|
+ this.$message.error(err)
|
|
506
|
+ this.loading.close()
|
|
507
|
+ return false
|
|
508
|
+ },
|
|
509
|
+ handleAvatarSuccess(res, file) {
|
|
510
|
+ this.form.imgs.push({
|
|
511
|
+ img_url: this.qiniuDomain + res.url + '?imageView2/2/w/500/h/500/q/90',
|
|
512
|
+ desc: '',
|
|
513
|
+ id: 0
|
|
514
|
+ })
|
|
515
|
+ this.loading.close()
|
|
516
|
+ },
|
|
517
|
+ changeInput(item) {
|
|
518
|
+
|
|
519
|
+ if (item.item_name == '血清铁' || item.item_name == '总铁结合力') {
|
306
|
520
|
let index1 = ''
|
307
|
521
|
let index2 = ''
|
308
|
|
- this.form.formItem.map((it,index) => {
|
309
|
|
- if(this.form.formItem[index].item_name == '血清铁'){
|
|
522
|
+ this.form.formItem.map((it, index) => {
|
|
523
|
+ if (this.form.formItem[index].item_name == '血清铁') {
|
310
|
524
|
index1 = index
|
311
|
525
|
}
|
312
|
|
- if(this.form.formItem[index].item_name == '总铁结合力'){
|
|
526
|
+ if (this.form.formItem[index].item_name == '总铁结合力') {
|
313
|
527
|
index2 = index
|
314
|
528
|
}
|
315
|
|
- if(it.item_name == '转铁蛋白饱和度(计算)'){
|
|
529
|
+ if (it.item_name == '转铁蛋白饱和度(计算)') {
|
316
|
530
|
it.value = (parseFloat(this.form.formItem[index1].value) / parseFloat(this.form.formItem[index2].value)) * 100
|
317
|
531
|
}
|
318
|
532
|
})
|
|
@@ -363,39 +577,101 @@ export default {
|
363
|
577
|
}
|
364
|
578
|
})
|
365
|
579
|
})
|
366
|
|
- .catch(() => {})
|
|
580
|
+ .catch(() => {
|
|
581
|
+ })
|
367
|
582
|
},
|
368
|
583
|
openEdit() {
|
|
584
|
+
|
|
585
|
+ if (this.project == null) {
|
|
586
|
+ this.$message.error('请先选择项目')
|
|
587
|
+ return false
|
|
588
|
+ }
|
|
589
|
+ if(this.isPic){
|
|
590
|
+ this.form.pic_method = 'edit'
|
|
591
|
+ this.formTitle = '修改' + this.project.project_name
|
|
592
|
+ this.form.project_id = this.project.project_id
|
|
593
|
+ this.form.inspect_date = this.itemDate
|
|
594
|
+ this.form.old_inspect_date = this.itemDate
|
|
595
|
+ this.form.imgs = []
|
|
596
|
+ this.form.delete_imgs = []
|
|
597
|
+ for(var index in this.inspections){
|
|
598
|
+ this.form.imgs.push({
|
|
599
|
+ id: this.inspections[index].id,
|
|
600
|
+ img_url: this.inspections[index].inspect_value,
|
|
601
|
+ desc: this.inspections[index].item_name
|
|
602
|
+ })
|
|
603
|
+ }
|
|
604
|
+ console.log(this.form.imgs)
|
|
605
|
+ this.dialogPicFormVisible = true
|
|
606
|
+ }else{
|
|
607
|
+ console.log("22222")
|
|
608
|
+ this.form.method = 'edit'
|
|
609
|
+ this.formTitle = '修改' + this.project.project_name
|
|
610
|
+ this.form.project_id = this.project.project_id
|
|
611
|
+ this.form.inspect_date = this.itemDate
|
|
612
|
+ this.form.old_inspect_date = this.itemDate
|
|
613
|
+ this.form.remind_cycle = this.patient_info.remind_cycle
|
|
614
|
+ console.log(this.form.remind_cycle)
|
|
615
|
+
|
|
616
|
+ this.form.formItem = []
|
|
617
|
+ for (var index in this.project.inspection_reference) {
|
|
618
|
+ this.form.formItem.push({
|
|
619
|
+ id: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].id : 0,
|
|
620
|
+ project_id: this.project.inspection_reference[index].project_id,
|
|
621
|
+ project_name: this.project.inspection_reference[index].project_name,
|
|
622
|
+ item_id: this.project.inspection_reference[index].id,
|
|
623
|
+ item: this.project.inspection_reference[index].item,
|
|
624
|
+ item_name: this.project.inspection_reference[index].item_name,
|
|
625
|
+ range_type: this.project.inspection_reference[index].range_type,
|
|
626
|
+ value: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value : '',
|
|
627
|
+ select_options: this.project.inspection_reference[index].range_options.split(','),
|
|
628
|
+ unit: this.project.inspection_reference[index].unit
|
|
629
|
+ })
|
|
630
|
+ }
|
|
631
|
+ console.log(this.form.formItem)
|
|
632
|
+ this.dialogFormVisible = true
|
|
633
|
+
|
|
634
|
+ }
|
|
635
|
+
|
|
636
|
+ }, openPic() {
|
369
|
637
|
if (this.project == null) {
|
370
|
638
|
this.$message.error('请先选择项目')
|
371
|
639
|
return false
|
372
|
640
|
}
|
373
|
641
|
|
374
|
|
- this.form.method = 'edit'
|
375
|
|
- this.formTitle = '修改' + this.project.project_name
|
|
642
|
+ this.form.pic_method = 'add'
|
|
643
|
+ this.formTitle = '新增' + this.project.project_name
|
376
|
644
|
this.form.project_id = this.project.project_id
|
377
|
|
- this.form.inspect_date = this.itemDate
|
378
|
|
- this.form.old_inspect_date = this.itemDate
|
|
645
|
+ this.form.imgs=[]
|
|
646
|
+ this.form.delete_imgs=[]
|
379
|
647
|
this.form.remind_cycle = this.patient_info.remind_cycle
|
380
|
|
- console.log(this.form.remind_cycle)
|
381
|
|
-
|
|
648
|
+ var today = new Date()
|
|
649
|
+ this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
|
382
|
650
|
this.form.formItem = []
|
383
|
651
|
for (var index in this.project.inspection_reference) {
|
|
652
|
+ // var formItem = this.project.inspection_reference[index];
|
|
653
|
+ // formItem["value"] = '';
|
|
654
|
+ // if (formItem.range_type==2) {
|
|
655
|
+ // formItem["select_options"] = formItem.range_options.split(",");
|
|
656
|
+ // }
|
384
|
657
|
this.form.formItem.push({
|
385
|
|
- id: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].id : 0,
|
|
658
|
+ id: 0,
|
386
|
659
|
project_id: this.project.inspection_reference[index].project_id,
|
387
|
660
|
project_name: this.project.inspection_reference[index].project_name,
|
388
|
661
|
item_id: this.project.inspection_reference[index].id,
|
389
|
662
|
item: this.project.inspection_reference[index].item,
|
390
|
663
|
item_name: this.project.inspection_reference[index].item_name,
|
391
|
664
|
range_type: this.project.inspection_reference[index].range_type,
|
392
|
|
- value: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value : '',
|
393
|
|
- select_options: this.project.inspection_reference[index].range_options.split(','),
|
|
665
|
+ value: '',
|
|
666
|
+ select_options: this.project.inspection_reference[
|
|
667
|
+ index
|
|
668
|
+ ].range_options.split(','),
|
394
|
669
|
unit: this.project.inspection_reference[index].unit
|
395
|
670
|
})
|
396
|
671
|
}
|
397
|
|
- console.log(this.form.formItem)
|
398
|
|
- this.dialogFormVisible = true
|
|
672
|
+ console.log('form.formItem', this.form.formItem)
|
|
673
|
+ this.dialogPicFormVisible = true
|
|
674
|
+
|
399
|
675
|
},
|
400
|
676
|
openNew() {
|
401
|
677
|
if (this.project == null) {
|
|
@@ -426,11 +702,11 @@ export default {
|
426
|
702
|
value: '',
|
427
|
703
|
select_options: this.project.inspection_reference[
|
428
|
704
|
index
|
429
|
|
- ].range_options.split(','),
|
|
705
|
+ ].range_options.split(','),
|
430
|
706
|
unit: this.project.inspection_reference[index].unit
|
431
|
707
|
})
|
432
|
708
|
}
|
433
|
|
- console.log('form.formItem',this.form.formItem)
|
|
709
|
+ console.log('form.formItem', this.form.formItem)
|
434
|
710
|
this.dialogFormVisible = true
|
435
|
711
|
},
|
436
|
712
|
submitEdit(formName) {
|
|
@@ -454,7 +730,7 @@ export default {
|
454
|
730
|
duration: 2000
|
455
|
731
|
})
|
456
|
732
|
this.patient_info.remind_cycle =
|
457
|
|
- response.data.data.remind_cycle
|
|
733
|
+ response.data.data.remind_cycle
|
458
|
734
|
this.itemDate = this.form.inspect_date
|
459
|
735
|
this.items = []
|
460
|
736
|
var inspections = response.data.data.inspections
|
|
@@ -467,12 +743,12 @@ export default {
|
467
|
743
|
this.inspectionsMap = {}
|
468
|
744
|
for (var index in inspections) {
|
469
|
745
|
inspectionsMap[inspections[index].item_id] =
|
470
|
|
- inspections[index]
|
|
746
|
+ inspections[index]
|
471
|
747
|
this.inspectionsMap[inspections[index].item_id] =
|
472
|
|
- inspections[index]
|
|
748
|
+ inspections[index]
|
473
|
749
|
}
|
474
|
750
|
var items = this.project.inspection_reference
|
475
|
|
- console.log("itmes",items)
|
|
751
|
+ console.log('itmes', items)
|
476
|
752
|
for (var index in items) {
|
477
|
753
|
if (items[index].id in inspectionsMap) {
|
478
|
754
|
var item = {}
|
|
@@ -612,6 +888,123 @@ export default {
|
612
|
888
|
return false
|
613
|
889
|
}
|
614
|
890
|
})
|
|
891
|
+ }, submitEditPicNew() {
|
|
892
|
+ if (this.form.imgs.length == 0) {
|
|
893
|
+ this.$message.error('未上传图片')
|
|
894
|
+ return false
|
|
895
|
+ }
|
|
896
|
+ this.formLoading = true
|
|
897
|
+ editPatientPICInspection(
|
|
898
|
+ this.patientID,
|
|
899
|
+ this.form
|
|
900
|
+ )
|
|
901
|
+ .then(response => {
|
|
902
|
+ if (response.data.state === 1) {
|
|
903
|
+ this.$notify({
|
|
904
|
+ title: '成功',
|
|
905
|
+ message: '修改成功',
|
|
906
|
+ type: 'success',
|
|
907
|
+ duration: 2000
|
|
908
|
+ })
|
|
909
|
+ this.itemDate = this.form.inspect_date
|
|
910
|
+ this.items = []
|
|
911
|
+ this.dialogPicFormVisible = false
|
|
912
|
+ this.queryParams.patient = this.patientID
|
|
913
|
+ this.queryParams.project_id = this.project.project_id
|
|
914
|
+ this.queryParams.page = 1
|
|
915
|
+ this.total = 0
|
|
916
|
+ this.fetchPatientInspections(this.queryParams)
|
|
917
|
+ } else {
|
|
918
|
+ this.$message.error(response.data.msg)
|
|
919
|
+ return false
|
|
920
|
+ }
|
|
921
|
+ })
|
|
922
|
+ .catch(v => {
|
|
923
|
+ this.$message.error(v)
|
|
924
|
+ return false
|
|
925
|
+ })
|
|
926
|
+ this.formLoading = false
|
|
927
|
+
|
|
928
|
+ },deletePic(item,index){
|
|
929
|
+ if(item.id == 0){
|
|
930
|
+ this.form.imgs.splice(index,1)
|
|
931
|
+ }else{
|
|
932
|
+ for(let index in this.form.imgs){
|
|
933
|
+ if(item.id == this.form.imgs[index].id){
|
|
934
|
+ this.form.imgs.splice(index,1)
|
|
935
|
+ this.form.delete_imgs.push({
|
|
936
|
+ id:item.id,
|
|
937
|
+ })
|
|
938
|
+ }
|
|
939
|
+ }
|
|
940
|
+
|
|
941
|
+ }
|
|
942
|
+ },
|
|
943
|
+ submitPicNew() {
|
|
944
|
+ this.formLoading = true
|
|
945
|
+ if (this.form.imgs.length == 0) {
|
|
946
|
+ this.$message.error('未上传图片')
|
|
947
|
+ return false
|
|
948
|
+ }
|
|
949
|
+ CreatePatientPICInspection(
|
|
950
|
+ this.patientID,
|
|
951
|
+ this.form
|
|
952
|
+ )
|
|
953
|
+ .then(response => {
|
|
954
|
+ if (response.data.state === 1) {
|
|
955
|
+ this.$notify({
|
|
956
|
+ title: '成功',
|
|
957
|
+ message: '新增成功',
|
|
958
|
+ type: 'success',
|
|
959
|
+ duration: 2000
|
|
960
|
+ })
|
|
961
|
+ this.itemDate = this.form.inspect_date
|
|
962
|
+ this.items = []
|
|
963
|
+ for (var index in this.projects) {
|
|
964
|
+ if (this.projects[index].project_id == this.form.project_id) {
|
|
965
|
+ this.projects[index].count++
|
|
966
|
+ break
|
|
967
|
+ }
|
|
968
|
+ }
|
|
969
|
+ this.total += 1
|
|
970
|
+ // var inspections = response.data.data.inspections
|
|
971
|
+ // this.inspections = response.data.data.inspections
|
|
972
|
+ // if (inspections == null) {
|
|
973
|
+ // this.inspections = []
|
|
974
|
+ // return false
|
|
975
|
+ // }
|
|
976
|
+ // var inspectionsMap = {}
|
|
977
|
+ // this.inspectionsMap = {}
|
|
978
|
+ //
|
|
979
|
+ // var items = this.project.inspection_reference
|
|
980
|
+ // for (var index in items) {
|
|
981
|
+ // if (items[index].id in inspectionsMap) {
|
|
982
|
+ // var item = {}
|
|
983
|
+ // for (var key in items[index]) {
|
|
984
|
+ // item[key] = items[index][key]
|
|
985
|
+ // }
|
|
986
|
+ // item.value = inspectionsMap[items[index].id].inspect_value
|
|
987
|
+ // item.value_direction = ''
|
|
988
|
+ // this.items.push(item)
|
|
989
|
+ // }
|
|
990
|
+ // }
|
|
991
|
+ this.dialogPicFormVisible = false
|
|
992
|
+ this.queryParams.patient = this.patientID
|
|
993
|
+ this.queryParams.project_id = this.project.project_id
|
|
994
|
+ this.queryParams.page = 1
|
|
995
|
+ this.total = 0
|
|
996
|
+ this.fetchPatientInspections(this.queryParams)
|
|
997
|
+ } else {
|
|
998
|
+ this.$message.error(response.data.msg)
|
|
999
|
+ return false
|
|
1000
|
+ }
|
|
1001
|
+ })
|
|
1002
|
+ .catch(v => {
|
|
1003
|
+ this.$message.error(v)
|
|
1004
|
+ return false
|
|
1005
|
+ })
|
|
1006
|
+ this.formLoading = false
|
|
1007
|
+
|
615
|
1008
|
},
|
616
|
1009
|
fetchInspectionReference() {
|
617
|
1010
|
fetchInspectionReference(this.patientID)
|
|
@@ -628,7 +1021,8 @@ export default {
|
628
|
1021
|
return false
|
629
|
1022
|
}
|
630
|
1023
|
})
|
631
|
|
- .catch(v => {})
|
|
1024
|
+ .catch(v => {
|
|
1025
|
+ })
|
632
|
1026
|
},
|
633
|
1027
|
setCurrent(row) {
|
634
|
1028
|
this.$refs.singleTable.setCurrentRow(row)
|
|
@@ -664,6 +1058,7 @@ export default {
|
664
|
1058
|
},
|
665
|
1059
|
fetchPatientInspections(params) {
|
666
|
1060
|
this.items = []
|
|
1061
|
+ this.isPic = false
|
667
|
1062
|
fetchPatientInspections(params)
|
668
|
1063
|
.then(response => {
|
669
|
1064
|
if (response.data.state == 1) {
|
|
@@ -681,40 +1076,52 @@ export default {
|
681
|
1076
|
inspectionsMap[inspections[index].item_id] = inspections[index]
|
682
|
1077
|
this.inspectionsMap[inspections[index].item_id] = inspections[index]
|
683
|
1078
|
}
|
|
1079
|
+
|
684
|
1080
|
var items = this.project.inspection_reference
|
685
|
1081
|
for (var index in items) {
|
686
|
|
- if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {
|
687
|
|
- var item = {}
|
688
|
|
- for (var key in items[index]) {
|
689
|
|
- item[key] = items[index][key]
|
690
|
|
- }
|
691
|
|
- if (item.item_id > 0) {
|
692
|
|
- if (inspectionsMap[items[index].item_id] == undefined) {
|
693
|
|
- item.value = inspectionsMap[items[index].id].inspect_value
|
694
|
|
- } else {
|
695
|
|
- item.value = inspectionsMap[items[index].item_id].inspect_value
|
696
|
|
- }
|
697
|
|
- } else {
|
|
1082
|
+ var item = {}
|
|
1083
|
+ for (var key in items[index]) {
|
|
1084
|
+ item[key] = items[index][key]
|
|
1085
|
+ }
|
|
1086
|
+ if (item.item_id > 0) {
|
|
1087
|
+ if (inspectionsMap[items[index].item_id] == undefined) {
|
698
|
1088
|
item.value = inspectionsMap[items[index].id].inspect_value
|
|
1089
|
+ item.item_name = inspectionsMap[items[index].id].item_name
|
|
1090
|
+
|
|
1091
|
+ } else {
|
|
1092
|
+ item.value = inspectionsMap[items[index].item_id].inspect_value
|
|
1093
|
+ item.item_name = inspectionsMap[items[index].item_id].item_name
|
|
1094
|
+
|
699
|
1095
|
}
|
700
|
|
- item.value_direction = ''
|
701
|
|
- if (item.range_type == 1) {
|
702
|
|
- var value = parseFloat(item.value)
|
703
|
|
- var range_min = parseFloat(item.range_min)
|
704
|
|
- var range_max = parseFloat(item.range_max)
|
705
|
|
- if (value < range_min) {
|
706
|
|
- item.value_direction = '↓'
|
707
|
|
- } else if (value > range_max) {
|
708
|
|
- item.value_direction = '↑'
|
709
|
|
- }
|
|
1096
|
+ } else {
|
|
1097
|
+ item.value = inspectionsMap[items[index].id].inspect_value
|
|
1098
|
+ item.item_name = inspectionsMap[items[index].id].item_name
|
|
1099
|
+
|
|
1100
|
+ }
|
|
1101
|
+ // item["inspect_desc"] = inspectionsMap[items[index].id].inspect_desc
|
|
1102
|
+ // item["inspect_type"] = inspectionsMap[items[index].id].inspect_type
|
|
1103
|
+ item.value_direction = ''
|
|
1104
|
+ if (item.range_type == 1) {
|
|
1105
|
+ var value = parseFloat(item.value)
|
|
1106
|
+ var range_min = parseFloat(item.range_min)
|
|
1107
|
+ var range_max = parseFloat(item.range_max)
|
|
1108
|
+ if (value < range_min) {
|
|
1109
|
+ item.value_direction = '↓'
|
|
1110
|
+ } else if (value > range_max) {
|
|
1111
|
+ item.value_direction = '↑'
|
710
|
1112
|
}
|
711
|
|
- this.items.push(item)
|
|
1113
|
+ }
|
|
1114
|
+ this.items.push(item)
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+ if(item.value.indexOf("http") >= 0){
|
|
1118
|
+ this.isPic = true
|
712
|
1119
|
}
|
713
|
1120
|
}
|
714
|
|
- console.log(this.items)
|
715
|
1121
|
}
|
716
|
1122
|
})
|
717
|
|
- .catch(v => {})
|
|
1123
|
+ .catch(v => {
|
|
1124
|
+ })
|
718
|
1125
|
setTimeout(() => {
|
719
|
1126
|
this.itemLoading = false
|
720
|
1127
|
}, 1000)
|
|
@@ -747,18 +1154,22 @@ export default {
|
747
|
1154
|
border-bottom: 0px !important;
|
748
|
1155
|
border-right: 0px !important;
|
749
|
1156
|
}
|
|
1157
|
+
|
750
|
1158
|
#user-inspection-order th {
|
751
|
1159
|
border-right: 0px !important;
|
752
|
1160
|
}
|
|
1161
|
+
|
753
|
1162
|
#user-inspection-form .el-form-item__content {
|
754
|
1163
|
line-height: 0 !important;
|
755
|
1164
|
}
|
|
1165
|
+
|
756
|
1166
|
.el-table td,
|
757
|
1167
|
.el-table th.is-leaf,
|
758
|
1168
|
.el-table--border,
|
759
|
1169
|
.el-table--group {
|
760
|
1170
|
border-color: #d0d3da;
|
761
|
1171
|
}
|
|
1172
|
+
|
762
|
1173
|
.el-table--border::after,
|
763
|
1174
|
.el-table--group::after,
|
764
|
1175
|
.el-table::before {
|