Browse Source

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

XMLWAN 4 years ago
parent
commit
8bff7c33a3

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

@@ -43,6 +43,29 @@ export function getInitData(params) {
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 69
 // export function createCaseHistory(params) {
47 70
 //   return request({
48 71
 //     url: "/api/doctorworkstation/casehistory/create",

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

@@ -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>
@@ -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.project.length > 0){
316
-               
343
+
317 344
                 this.customTabIndex = 2
318 345
               }
319 346
 
@@ -340,6 +367,40 @@
340 367
       },
341 368
       open(index) {
342 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 404
           localStorage.setItem('drugs', JSON.stringify(this.preDrugs))
344 405
           // this.$message({ message: '保存成功', type: 'success' })
345 406
         } else if (index == 2) {
@@ -359,7 +420,7 @@
359 420
           advices: [],
360 421
           project:[],
361 422
           projects:[]
362
-         
423
+
363 424
         })
364 425
         this.editableTabsValue = newTabName
365 426
         this.curPrescriptions = this.prescriptions[this.prescriptions.length-1]
@@ -405,11 +466,11 @@
405 466
 
406 467
         //用来区分处方属于项目还是药品
407 468
         if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
408
-        
469
+
409 470
           this.customTabIndex = 1
410 471
         }
411 472
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
412
-         
473
+
413 474
           this.customTabIndex = 2
414 475
         }
415 476
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0){
@@ -429,13 +490,16 @@
429 490
       },
430 491
       comfirm() {
431 492
         this.preDrugs = this.curDrugs
432
-        
493
+
433 494
         for (let i = 0; i < this.prescriptions.length; i++){
434 495
           console.log("名称",this.prescriptions[i].name)
435 496
           console.log("名称2",this.editableTabsValue)
436 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 503
             this.curPrescriptions = this.prescriptions[i]
440 504
             // this.$refs.prescription_tables.setNewData(this.prescriptions[i])
441 505
           }
@@ -456,6 +520,19 @@
456 520
       },
457 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 537
       getAllProjectTeam(){
461 538
         getAllProjectTeam().then(response=>{
@@ -464,7 +541,7 @@
464 541
             console.log("team",team)
465 542
             this.tabPrjectTeam = team
466 543
           }
467
-        })  
544
+        })
468 545
       },
469 546
       selectTeam(row){
470 547
           var arr = []
@@ -475,10 +552,10 @@
475 552
         console.log("ids",ids)
476 553
         var strArr = ids.split(",")
477 554
         var res = [];//接收不重复的数据
478
-      
555
+
479 556
         for (var i = 0; i<strArr.length; i++){
480 557
         var flag = true;
481
-       
558
+
482 559
         for (var j = 0; j<i; j++){
483 560
           if(strArr[i]===strArr[j]){
484 561
             flag = false;
@@ -490,7 +567,7 @@
490 567
          }
491 568
         }
492 569
         console.log("res",res)
493
-      
570
+
494 571
         var idstr =  res.join(",")
495 572
         console.log("idstr",idstr)
496 573
         const params = {
@@ -513,7 +590,7 @@
513 590
       //获取所以项目组套
514 591
       this.getAllProjectTeam()
515 592
 
516
-   
593
+
517 594
     }
518 595
   }
519 596
 </script>

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

@@ -1,10 +1,7 @@
1 1
 <template>
2 2
   <div class="prescriptionTable">
3
-    <div>{{prescription.name}}</div>
4 3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
5 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 5
       <el-table-column align="center" prop="name" label="名称">
9 6
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
10 7
       </el-table-column>
@@ -146,7 +143,6 @@
146 143
             name:"",
147 144
             advices:[],
148 145
             project:[],
149
-            projects:[],
150 146
             drugways:[],
151 147
             efs:[],
152 148
           };

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

@@ -45,8 +45,10 @@
45 45
             <el-radio-button label="病历"></el-radio-button>
46 46
           </el-radio-group>
47 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 52
         <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
51 53
                      :hisPatientInfo="hisPatientInfo" v-if="titleType == '病历'"></desk-record>
52 54
       </div>