Sfoglia il codice sorgente

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

XMLWAN 4 anni fa
parent
commit
8bff7c33a3

+ 23 - 0
src/api/his/his.js Vedi File

43
 }
43
 }
44
 
44
 
45
 
45
 
46
+export function getDoctors() {
47
+  return request({
48
+    url: "/api/admin/get",
49
+    method: "get",
50
+  });
51
+}
52
+
53
+
54
+
55
+export function createHisPrescription(data, params) {
56
+  return request({
57
+    url: "/api/hisprescription/create",
58
+    method: "post",
59
+    data:data,
60
+    params:params,
61
+  });
62
+}
63
+
64
+
65
+
66
+
67
+
68
+
46
 // export function createCaseHistory(params) {
69
 // export function createCaseHistory(params) {
47
 //   return request({
70
 //   return request({
48
 //     url: "/api/doctorworkstation/casehistory/create",
71
 //     url: "/api/doctorworkstation/casehistory/create",

+ 115 - 38
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Vedi File

13
       <div class="centerLeft">
13
       <div class="centerLeft">
14
         <el-form :model="form"  ref="form" label-width="80px">
14
         <el-form :model="form"  ref="form" label-width="80px">
15
           <el-form-item label="姓名:" prop="name">
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
           </el-form-item>
17
           </el-form-item>
18
           <el-form-item label="证件号: " prop="name">
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
           </el-form-item>
20
           </el-form-item>
21
           <el-form-item label="挂号类型: " prop="name">
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
           </el-form-item>
23
           </el-form-item>
24
           <el-form-item label="诊断:" prop="name">
24
           <el-form-item label="诊断:" prop="name">
25
             <el-autocomplete
25
             <el-autocomplete
30
               placeholder="请输入内容"
30
               placeholder="请输入内容"
31
             ></el-autocomplete>
31
             ></el-autocomplete>
32
           </el-form-item>
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
           </el-form-item>
41
           </el-form-item>
46
         </el-form>
42
         </el-form>
47
         <div class="tabsBox">
43
         <div class="tabsBox">
68
           <span>医生:</span>
64
           <span>医生:</span>
69
           <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
65
           <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
70
             <el-option
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
             </el-option>
71
             </el-option>
76
           </el-select>
72
           </el-select>
77
           <span>科室:</span>
73
           <span>科室:</span>
78
           <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
74
           <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
79
             <el-option
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
             </el-option>
80
             </el-option>
85
           </el-select>
81
           </el-select>
86
           <span>总计:</span>
82
           <span>总计:</span>
221
     props: {
217
     props: {
222
       patientInfo: Object,
218
       patientInfo: Object,
223
       hisPatientInfo: Object,
219
       hisPatientInfo: Object,
224
-      prescriptions: Array
220
+      prescriptions: Array,
221
+      record_date:String,
225
     },
222
     },
226
     components: {
223
     components: {
227
       selectTemplate,
224
       selectTemplate,
256
         doctorValue: '',
253
         doctorValue: '',
257
         departmentOptions: [],
254
         departmentOptions: [],
258
         departmentValue: '',
255
         departmentValue: '',
256
+        diagnoses: this.getDictionaryDataConfig('system','diagnose'),
257
+        other_sick:this.getDictionaryDataConfig('system','other_sick_history'),
259
         total: 0,
258
         total: 0,
260
-        showOne:true,
261
-        showTwo:false,
262
         state1:"",
259
         state1:"",
260
+        state2:"",
263
         customTabIndex:1,
261
         customTabIndex:1,
264
         options:[],
262
         options:[],
265
         tabProject:[],
263
         tabProject:[],
269
         tableData:[],
267
         tableData:[],
270
         tabPrjectTeam:[],
268
         tabPrjectTeam:[],
271
         teamList:[],
269
         teamList:[],
270
+        doctors:[],
272
       }
271
       }
273
     },
272
     },
274
     methods: {
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
       changeKind(val){
299
       changeKind(val){
276
         this.drugs = []
300
         this.drugs = []
277
 
301
 
286
         }
310
         }
287
       },
311
       },
288
       getDictionaryDataConfig(module, filed_name) {
312
       getDictionaryDataConfig(module, filed_name) {
313
+        console.log(getDictionaryDataConfig(module, filed_name))
289
         return getDictionaryDataConfig(module, filed_name)
314
         return getDictionaryDataConfig(module, filed_name)
290
 
315
 
291
       },
316
       },
298
             this.drugs = response.data.data.drugs
323
             this.drugs = response.data.data.drugs
299
             this.allDrugs = response.data.data.drugs
324
             this.allDrugs = response.data.data.drugs
300
             this.advices_template = response.data.data.advices_template
325
             this.advices_template = response.data.data.advices_template
326
+            this.doctors = response.data.data.doctors
327
+
301
           }
328
           }
302
         })
329
         })
303
 
330
 
313
                 this.customTabIndex = 1
340
                 this.customTabIndex = 1
314
               }
341
               }
315
               if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
342
               if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
316
-               
343
+
317
                 this.customTabIndex = 2
344
                 this.customTabIndex = 2
318
               }
345
               }
319
 
346
 
340
       },
367
       },
341
       open(index) {
368
       open(index) {
342
         if (index == 1) {
369
         if (index == 1) {
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
+          })
343
           localStorage.setItem('drugs', JSON.stringify(this.preDrugs))
404
           localStorage.setItem('drugs', JSON.stringify(this.preDrugs))
344
           // this.$message({ message: '保存成功', type: 'success' })
405
           // this.$message({ message: '保存成功', type: 'success' })
345
         } else if (index == 2) {
406
         } else if (index == 2) {
359
           advices: [],
420
           advices: [],
360
           project:[],
421
           project:[],
361
           projects:[]
422
           projects:[]
362
-         
423
+
363
         })
424
         })
364
         this.editableTabsValue = newTabName
425
         this.editableTabsValue = newTabName
365
         this.curPrescriptions = this.prescriptions[this.prescriptions.length-1]
426
         this.curPrescriptions = this.prescriptions[this.prescriptions.length-1]
405
 
466
 
406
         //用来区分处方属于项目还是药品
467
         //用来区分处方属于项目还是药品
407
         if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
468
         if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
408
-        
469
+
409
           this.customTabIndex = 1
470
           this.customTabIndex = 1
410
         }
471
         }
411
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
472
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
412
-         
473
+
413
           this.customTabIndex = 2
474
           this.customTabIndex = 2
414
         }
475
         }
415
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0){
476
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0){
429
       },
490
       },
430
       comfirm() {
491
       comfirm() {
431
         this.preDrugs = this.curDrugs
492
         this.preDrugs = this.curDrugs
432
-        
493
+
433
         for (let i = 0; i < this.prescriptions.length; i++){
494
         for (let i = 0; i < this.prescriptions.length; i++){
434
           console.log("名称",this.prescriptions[i].name)
495
           console.log("名称",this.prescriptions[i].name)
435
           console.log("名称2",this.editableTabsValue)
496
           console.log("名称2",this.editableTabsValue)
436
           if(this.prescriptions[i].name == this.editableTabsValue){
497
           if(this.prescriptions[i].name == this.editableTabsValue){
437
-            this.prescriptions[i].advices = this.preDrugs
438
-            this.prescriptions[i].project = this.teamList
498
+           var temp =  this.deepClone(this.preDrugs)
499
+            var temp2 =  this.deepClone(this.teamList)
500
+
501
+            this.prescriptions[i].advices = temp
502
+            this.prescriptions[i].project = temp2
439
             this.curPrescriptions = this.prescriptions[i]
503
             this.curPrescriptions = this.prescriptions[i]
440
             // this.$refs.prescription_tables.setNewData(this.prescriptions[i])
504
             // this.$refs.prescription_tables.setNewData(this.prescriptions[i])
441
           }
505
           }
456
       },
520
       },
457
       querySearch(){
521
       querySearch(){
458
 
522
 
523
+      },deepClone(source) {
524
+        if (!source && typeof source !== 'object') {
525
+          throw new Error('error arguments', 'shallowClone')
526
+        }
527
+        const targetObj = source.constructor === Array ? [] : {}
528
+        Object.keys(source).forEach((keys) => {
529
+          if (source[keys] && typeof source[keys] === 'object') {
530
+            targetObj[keys] = this.deepClone(source[keys])
531
+          } else {
532
+            targetObj[keys] = source[keys]
533
+          }
534
+        })
535
+        return targetObj
459
       },
536
       },
460
       getAllProjectTeam(){
537
       getAllProjectTeam(){
461
         getAllProjectTeam().then(response=>{
538
         getAllProjectTeam().then(response=>{
464
             console.log("team",team)
541
             console.log("team",team)
465
             this.tabPrjectTeam = team
542
             this.tabPrjectTeam = team
466
           }
543
           }
467
-        })  
544
+        })
468
       },
545
       },
469
       selectTeam(row){
546
       selectTeam(row){
470
           var arr = []
547
           var arr = []
475
         console.log("ids",ids)
552
         console.log("ids",ids)
476
         var strArr = ids.split(",")
553
         var strArr = ids.split(",")
477
         var res = [];//接收不重复的数据
554
         var res = [];//接收不重复的数据
478
-      
555
+
479
         for (var i = 0; i<strArr.length; i++){
556
         for (var i = 0; i<strArr.length; i++){
480
         var flag = true;
557
         var flag = true;
481
-       
558
+
482
         for (var j = 0; j<i; j++){
559
         for (var j = 0; j<i; j++){
483
           if(strArr[i]===strArr[j]){
560
           if(strArr[i]===strArr[j]){
484
             flag = false;
561
             flag = false;
490
          }
567
          }
491
         }
568
         }
492
         console.log("res",res)
569
         console.log("res",res)
493
-      
570
+
494
         var idstr =  res.join(",")
571
         var idstr =  res.join(",")
495
         console.log("idstr",idstr)
572
         console.log("idstr",idstr)
496
         const params = {
573
         const params = {
513
       //获取所以项目组套
590
       //获取所以项目组套
514
       this.getAllProjectTeam()
591
       this.getAllProjectTeam()
515
 
592
 
516
-   
593
+
517
     }
594
     }
518
   }
595
   }
519
 </script>
596
 </script>

+ 0 - 4
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue Vedi File

1
 <template>
1
 <template>
2
   <div class="prescriptionTable">
2
   <div class="prescriptionTable">
3
-    <div>{{prescription.name}}</div>
4
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
5
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
6
-      <el-table-column align="center" type="selection" width="40"></el-table-column>
7
-      <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
8
       <el-table-column align="center" prop="name" label="名称">
5
       <el-table-column align="center" prop="name" label="名称">
9
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
6
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
10
       </el-table-column>
7
       </el-table-column>
146
             name:"",
143
             name:"",
147
             advices:[],
144
             advices:[],
148
             project:[],
145
             project:[],
149
-            projects:[],
150
             drugways:[],
146
             drugways:[],
151
             efs:[],
147
             efs:[],
152
           };
148
           };

+ 4 - 2
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Vedi File

45
             <el-radio-button label="病历"></el-radio-button>
45
             <el-radio-button label="病历"></el-radio-button>
46
           </el-radio-group>
46
           </el-radio-group>
47
         </div>
47
         </div>
48
-        <desk-prescription ref="prescriptions"   :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"
49
-                   v-if="titleType == '处方'" style="flex:1;"></desk-prescription>
48
+        <!--<desk-prescription ref="prescriptions"   :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"-->
49
+                   <!--v-if="titleType == '处方'" style="flex:1;"></desk-prescription>-->
50
+        <desk-prescription :record_date="record_date" ref="prescriptions"  :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"
51
+                           v-if="titleType == '处方'" style="flex:1;"></desk-prescription>
50
         <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
52
         <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
51
                      :hisPatientInfo="hisPatientInfo" v-if="titleType == '病历'"></desk-record>
53
                      :hisPatientInfo="hisPatientInfo" v-if="titleType == '病历'"></desk-record>
52
       </div>
54
       </div>