|
@@ -13,13 +13,13 @@
|
13
|
13
|
<div class="centerLeft">
|
14
|
14
|
<el-form :model="form" ref="form" label-width="80px">
|
15
|
15
|
<el-form-item label="姓名:" prop="name">
|
16
|
|
- <el-input v-model="patientInfo.name" placeholder=""></el-input>
|
|
16
|
+ <el-input v-model="patientInfo.name" placeholder="" readonly></el-input>
|
17
|
17
|
</el-form-item>
|
18
|
18
|
<el-form-item label="证件号: " prop="name">
|
19
|
|
- <el-input v-model="patientInfo.id_card_no" placeholder=""></el-input>
|
|
19
|
+ <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
|
20
|
20
|
</el-form-item>
|
21
|
21
|
<el-form-item label="挂号类型: " prop="name">
|
22
|
|
- <el-input v-model="hisPatientInfo.register_type" placeholder=""></el-input>
|
|
22
|
+ <el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>
|
23
|
23
|
</el-form-item>
|
24
|
24
|
<el-form-item label="诊断:" prop="name">
|
25
|
25
|
<el-autocomplete
|
|
@@ -30,18 +30,14 @@
|
30
|
30
|
placeholder="请输入内容"
|
31
|
31
|
></el-autocomplete>
|
32
|
32
|
</el-form-item>
|
33
|
|
- <el-form-item label="大病类别: " prop="name">
|
34
|
|
- <el-input v-model="form.name" placeholder=""></el-input>
|
35
|
|
- </el-form-item>
|
36
|
|
- <el-form-item label="处方类型: " prop="name">
|
37
|
|
- <el-select v-model="value" placeholder="请选择" style="width:100%;">
|
38
|
|
- <el-option
|
39
|
|
- v-for="item in options"
|
40
|
|
- :key="item.value"
|
41
|
|
- :label="item.label"
|
42
|
|
- :value="item.value">
|
43
|
|
- </el-option>
|
44
|
|
- </el-select>
|
|
33
|
+ <el-form-item label="过敏及特殊病史: " prop="name">
|
|
34
|
+ <el-autocomplete
|
|
35
|
+ style="width:100%;"
|
|
36
|
+ class="inline-input"
|
|
37
|
+ v-model="state2"
|
|
38
|
+ :fetch-suggestions="querySearch2"
|
|
39
|
+ placeholder="请输入内容"
|
|
40
|
+ ></el-autocomplete>
|
45
|
41
|
</el-form-item>
|
46
|
42
|
</el-form>
|
47
|
43
|
<div class="tabsBox">
|
|
@@ -68,19 +64,19 @@
|
68
|
64
|
<span>医生:</span>
|
69
|
65
|
<el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
|
70
|
66
|
<el-option
|
71
|
|
- v-for="item in doctorOptions"
|
72
|
|
- :key="item.value"
|
73
|
|
- :label="item.label"
|
74
|
|
- :value="item.value">
|
|
67
|
+ v-for="item,index in doctors"
|
|
68
|
+ :key="index"
|
|
69
|
+ :label="item.user_name"
|
|
70
|
+ :value="item.id">
|
75
|
71
|
</el-option>
|
76
|
72
|
</el-select>
|
77
|
73
|
<span>科室:</span>
|
78
|
74
|
<el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
|
79
|
75
|
<el-option
|
80
|
|
- v-for="item in departmentOptions"
|
81
|
|
- :key="item.value"
|
82
|
|
- :label="item.label"
|
83
|
|
- :value="item.value">
|
|
76
|
+ v-for="(item,index) in getDictionaryDataConfig('system','department')"
|
|
77
|
+ :key="index"
|
|
78
|
+ :label="item.name"
|
|
79
|
+ :value="item.id">
|
84
|
80
|
</el-option>
|
85
|
81
|
</el-select>
|
86
|
82
|
<span>总计:</span>
|
|
@@ -208,7 +204,7 @@
|
208
|
204
|
|
209
|
205
|
|
210
|
206
|
<script>
|
211
|
|
- import { getPatientInfo, getSchedulePatientList, getInitData } from '@/api/his/his'
|
|
207
|
+ import { getPatientInfo, getSchedulePatientList, getInitData,getDoctors,createHisPrescription } from '@/api/his/his'
|
212
|
208
|
import { getDictionaryDataConfig} from "@/utils/data";
|
213
|
209
|
import prescriptionTable from './prescriptionTable'
|
214
|
210
|
import selectTemplate from './selectTemplate'
|
|
@@ -221,7 +217,8 @@
|
221
|
217
|
props: {
|
222
|
218
|
patientInfo: Object,
|
223
|
219
|
hisPatientInfo: Object,
|
224
|
|
- prescriptions: Array
|
|
220
|
+ prescriptions: Array,
|
|
221
|
+ record_date:String,
|
225
|
222
|
},
|
226
|
223
|
components: {
|
227
|
224
|
selectTemplate,
|
|
@@ -256,10 +253,11 @@
|
256
|
253
|
doctorValue: '',
|
257
|
254
|
departmentOptions: [],
|
258
|
255
|
departmentValue: '',
|
|
256
|
+ diagnoses: this.getDictionaryDataConfig('system','diagnose'),
|
|
257
|
+ other_sick:this.getDictionaryDataConfig('system','other_sick_history'),
|
259
|
258
|
total: 0,
|
260
|
|
- showOne:true,
|
261
|
|
- showTwo:false,
|
262
|
259
|
state1:"",
|
|
260
|
+ state2:"",
|
263
|
261
|
customTabIndex:1,
|
264
|
262
|
options:[],
|
265
|
263
|
tabProject:[],
|
|
@@ -269,9 +267,35 @@
|
269
|
267
|
tableData:[],
|
270
|
268
|
tabPrjectTeam:[],
|
271
|
269
|
teamList:[],
|
|
270
|
+ doctors:[],
|
272
|
271
|
}
|
273
|
272
|
},
|
274
|
273
|
methods: {
|
|
274
|
+ createFilter (queryString) {
|
|
275
|
+ return (restaurant) => {
|
|
276
|
+ return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
|
277
|
+ }
|
|
278
|
+ },
|
|
279
|
+
|
|
280
|
+ querySearch (queryString, cb) {
|
|
281
|
+ var restaurants = this.diagnoses
|
|
282
|
+ console.log(restaurants)
|
|
283
|
+ restaurants.map(item => {
|
|
284
|
+ item.value = item.name
|
|
285
|
+ })
|
|
286
|
+ var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
|
|
287
|
+ // 调用 callback 返回建议列表的数据
|
|
288
|
+ cb(results)
|
|
289
|
+ },
|
|
290
|
+ querySearch2 (queryString, cb) {
|
|
291
|
+ var restaurants = this.other_sick
|
|
292
|
+ restaurants.map(item => {
|
|
293
|
+ item.value = item.name
|
|
294
|
+ })
|
|
295
|
+ var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
|
|
296
|
+ // 调用 callback 返回建议列表的数据
|
|
297
|
+ cb(results)
|
|
298
|
+ },
|
275
|
299
|
changeKind(val){
|
276
|
300
|
this.drugs = []
|
277
|
301
|
|
|
@@ -286,6 +310,7 @@
|
286
|
310
|
}
|
287
|
311
|
},
|
288
|
312
|
getDictionaryDataConfig(module, filed_name) {
|
|
313
|
+ console.log(getDictionaryDataConfig(module, filed_name))
|
289
|
314
|
return getDictionaryDataConfig(module, filed_name)
|
290
|
315
|
|
291
|
316
|
},
|
|
@@ -298,6 +323,8 @@
|
298
|
323
|
this.drugs = response.data.data.drugs
|
299
|
324
|
this.allDrugs = response.data.data.drugs
|
300
|
325
|
this.advices_template = response.data.data.advices_template
|
|
326
|
+ this.doctors = response.data.data.doctors
|
|
327
|
+
|
301
|
328
|
}
|
302
|
329
|
})
|
303
|
330
|
|
|
@@ -313,7 +340,7 @@
|
313
|
340
|
this.customTabIndex = 1
|
314
|
341
|
}
|
315
|
342
|
if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length > 0){
|
316
|
|
-
|
|
343
|
+
|
317
|
344
|
this.customTabIndex = 2
|
318
|
345
|
}
|
319
|
346
|
|
|
@@ -340,8 +367,40 @@
|
340
|
367
|
},
|
341
|
368
|
open(index) {
|
342
|
369
|
if (index == 1) {
|
343
|
|
- localStorage.setItem('drugs', JSON.stringify(this.preDrugs))
|
344
|
|
- this.$message({ message: '保存成功', type: 'success' })
|
|
370
|
+ let params ={
|
|
371
|
+ patient_id: this.patientInfo.id,
|
|
372
|
+ diagnose: this.state1,
|
|
373
|
+ sick_history: this.state2,
|
|
374
|
+ doctor: this.doctorValue,
|
|
375
|
+ department: this.departmentValue,
|
|
376
|
+ record_date: this.record_date
|
|
377
|
+ }
|
|
378
|
+
|
|
379
|
+ for (let i = 0; i < this.prescriptions.length; i++){
|
|
380
|
+ if(this.prescriptions[i].advices.length > 0 && this.prescriptions[i].projects.length == 0){
|
|
381
|
+ this.prescriptions[i]['type'] = 1
|
|
382
|
+ }
|
|
383
|
+ if(this.prescriptions[i].advices.length == 0 && this.prescriptions[i].projects.length > 0){
|
|
384
|
+ this.prescriptions[i]['type'] = 2
|
|
385
|
+ }
|
|
386
|
+ for (let b = 0; b < this.prescriptions[i].advices.length; b++){
|
|
387
|
+ this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
|
|
388
|
+ this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
|
|
389
|
+ this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
|
|
390
|
+
|
|
391
|
+ }
|
|
392
|
+ }
|
|
393
|
+ let data={
|
|
394
|
+ "prescriptions":this.prescriptions
|
|
395
|
+ }
|
|
396
|
+
|
|
397
|
+ createHisPrescription(data,params).then(response=>{
|
|
398
|
+ if(response.data.state == 1){
|
|
399
|
+ this.prescriptions = []
|
|
400
|
+ this.
|
|
401
|
+
|
|
402
|
+ }
|
|
403
|
+ })
|
345
|
404
|
} else if (index == 2) {
|
346
|
405
|
this.$router.push('/outpatientDoctorStation/print')
|
347
|
406
|
} else if (index == 4) {
|
|
@@ -404,11 +463,11 @@
|
404
|
463
|
|
405
|
464
|
//用来区分处方属于项目还是药品
|
406
|
465
|
if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.projects.length == 0){
|
407
|
|
-
|
|
466
|
+
|
408
|
467
|
this.customTabIndex = 1
|
409
|
468
|
}
|
410
|
469
|
if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length > 0){
|
411
|
|
-
|
|
470
|
+
|
412
|
471
|
this.customTabIndex = 2
|
413
|
472
|
}
|
414
|
473
|
if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.projects.length == 0){
|
|
@@ -428,13 +487,16 @@
|
428
|
487
|
},
|
429
|
488
|
comfirm() {
|
430
|
489
|
this.preDrugs = this.curDrugs
|
431
|
|
-
|
|
490
|
+
|
432
|
491
|
for (let i = 0; i < this.prescriptions.length; i++){
|
433
|
492
|
console.log("名称",this.prescriptions[i].name)
|
434
|
493
|
console.log("名称2",this.editableTabsValue)
|
435
|
494
|
if(this.prescriptions[i].name == this.editableTabsValue){
|
436
|
|
- this.prescriptions[i].advices = this.preDrugs
|
437
|
|
- this.prescriptions[i].project = this.teamList
|
|
495
|
+ var temp = this.deepClone(this.preDrugs)
|
|
496
|
+ var temp2 = this.deepClone(this.teamList)
|
|
497
|
+
|
|
498
|
+ this.prescriptions[i].advices = temp
|
|
499
|
+ this.prescriptions[i].project = temp2
|
438
|
500
|
this.curPrescriptions = this.prescriptions[i]
|
439
|
501
|
// this.$refs.prescription_tables.setNewData(this.prescriptions[i])
|
440
|
502
|
}
|
|
@@ -455,6 +517,19 @@
|
455
|
517
|
},
|
456
|
518
|
querySearch(){
|
457
|
519
|
|
|
520
|
+ },deepClone(source) {
|
|
521
|
+ if (!source && typeof source !== 'object') {
|
|
522
|
+ throw new Error('error arguments', 'shallowClone')
|
|
523
|
+ }
|
|
524
|
+ const targetObj = source.constructor === Array ? [] : {}
|
|
525
|
+ Object.keys(source).forEach((keys) => {
|
|
526
|
+ if (source[keys] && typeof source[keys] === 'object') {
|
|
527
|
+ targetObj[keys] = this.deepClone(source[keys])
|
|
528
|
+ } else {
|
|
529
|
+ targetObj[keys] = source[keys]
|
|
530
|
+ }
|
|
531
|
+ })
|
|
532
|
+ return targetObj
|
458
|
533
|
},
|
459
|
534
|
getAllProjectTeam(){
|
460
|
535
|
getAllProjectTeam().then(response=>{
|
|
@@ -463,7 +538,7 @@
|
463
|
538
|
console.log("team",team)
|
464
|
539
|
this.tabPrjectTeam = team
|
465
|
540
|
}
|
466
|
|
- })
|
|
541
|
+ })
|
467
|
542
|
},
|
468
|
543
|
selectTeam(row){
|
469
|
544
|
var arr = []
|
|
@@ -474,10 +549,10 @@
|
474
|
549
|
console.log("ids",ids)
|
475
|
550
|
var strArr = ids.split(",")
|
476
|
551
|
var res = [];//接收不重复的数据
|
477
|
|
-
|
|
552
|
+
|
478
|
553
|
for (var i = 0; i<strArr.length; i++){
|
479
|
554
|
var flag = true;
|
480
|
|
-
|
|
555
|
+
|
481
|
556
|
for (var j = 0; j<i; j++){
|
482
|
557
|
if(strArr[i]===strArr[j]){
|
483
|
558
|
flag = false;
|
|
@@ -489,7 +564,7 @@
|
489
|
564
|
}
|
490
|
565
|
}
|
491
|
566
|
console.log("res",res)
|
492
|
|
-
|
|
567
|
+
|
493
|
568
|
var idstr = res.join(",")
|
494
|
569
|
console.log("idstr",idstr)
|
495
|
570
|
const params = {
|
|
@@ -512,7 +587,7 @@
|
512
|
587
|
//获取所以项目组套
|
513
|
588
|
this.getAllProjectTeam()
|
514
|
589
|
|
515
|
|
-
|
|
590
|
+
|
516
|
591
|
}
|
517
|
592
|
}
|
518
|
593
|
</script>
|