Browse Source

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

csx 3 years ago
parent
commit
3fa2109cd8

+ 1 - 0
src/xt_pages/hospitalStation/components/deskPrescription.vue View File

@@ -2463,6 +2463,7 @@
2463 2463
                 if (obj.type == 3) {
2464 2464
                   obj.single_dose = 1
2465 2465
                 }
2466
+                console.log(obj)
2466 2467
                 this.prescriptions[i].project.push(obj)
2467 2468
               }
2468 2469
               this.curStatus = 2

+ 27 - 21
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -711,6 +711,7 @@
711 711
               obj['id'] = drug_month_prescriptions.advices[a].drug_id
712 712
               // obj['retail_price'] = obj['retail_price'] +  drug_month_prescriptions.advices[a].drug.retail_price
713 713
               obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
714
+              obj['drug'] = drug_month_prescriptions.advices[a].drug
714 715
               count = count + drug_month_prescriptions.advices[a].prescribing_number
715 716
 
716 717
             }
@@ -776,9 +777,6 @@
776 777
           }
777 778
         }
778 779
 
779
-        console.log(drugs)
780
-        console.log(projects)
781
-        console.log(additions)
782 780
 
783 781
         let p1 = {
784 782
           name: '处方' + 1,
@@ -786,7 +784,7 @@
786 784
           project: [],
787 785
           type: 1,
788 786
           addition: additions
789
-        }
787
+        };
790 788
         let p2 = {
791 789
           name: '处方' + 2,
792 790
           type: 2,
@@ -794,12 +792,12 @@
794 792
           advices: [],
795 793
           addition: []
796 794
 
797
-        }
798
-        console.log(this.month_prescriptions)
799
-        console.log(this.curMonthPrescriptions)
795
+        };
796
+        console.log(this.month_prescriptions);
797
+        console.log(this.curMonthPrescriptions);
800 798
 
801
-        this.month_prescriptions.push(p1)
802
-        this.month_prescriptions.push(p2)
799
+        this.month_prescriptions.push(p1);
800
+        this.month_prescriptions.push(p2);
803 801
 
804 802
         this.curMonthPrescriptions = this.month_prescriptions[0]
805 803
 
@@ -1035,7 +1033,8 @@
1035 1033
                       single_dose_unit: prescription.advices[b].single_dose_unit,
1036 1034
                       prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1037 1035
                       medical_insurance_number: prescription.advices[b].med_list_codg,
1038
-                      id: prescription.advices[b].drug_id
1036
+                      id: prescription.advices[b].drug_id,
1037
+                      drug:prescription.advices[b].drug,
1039 1038
                     }
1040 1039
                     tempAdvice.push(obj)
1041 1040
                   }
@@ -1153,7 +1152,8 @@
1153 1152
                       single_dose_unit: prescription.advices[b].single_dose_unit,
1154 1153
                       prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1155 1154
                       medical_insurance_number: prescription.advices[b].med_list_codg,
1156
-                      id: prescription.advices[b].drug_id
1155
+                      id: prescription.advices[b].drug_id,
1156
+                      drug:prescription.advices[b].drug,
1157 1157
                     }
1158 1158
                     tempAdvice.push(obj)
1159 1159
                   }
@@ -1968,31 +1968,34 @@
1968 1968
         if (this.dayorMonth == 'day') {
1969 1969
 
1970 1970
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
1971
-            this.$message.error('请先开处方')
1971
+            this.$message.error('请先开处方');
1972 1972
             return
1973 1973
           }
1974 1974
         }
1975 1975
 
1976 1976
         if (this.dayorMonth == 'day') {
1977
-
1977
+          if (this.curPrescriptions.order_status == 2) {
1978
+            this.$message.error('当前处方已经结算,无法保存');
1979
+            return
1980
+          }
1978 1981
           if (this.doctorValue.length <= 0) {
1979
-            this.$message.error('医生不能为空')
1982
+            this.$message.error('医生不能为空');
1980 1983
             return
1981 1984
           }
1982 1985
 
1983 1986
           if (this.departmentValue.length <= 0) {
1984
-            this.$message.error('科室不能为空')
1987
+            this.$message.error('科室不能为空');
1985 1988
             return
1986 1989
           }
1987 1990
 
1988
-          if (this.state1 <= 0) {
1989
-            this.$message.error('疾病类型不能为空')
1991
+          if (this.state1  <= 0) {
1992
+            this.$message.error('疾病类型不能为空');
1990 1993
             return
1991 1994
           }
1992 1995
 
1993 1996
           if (index == 1) {
1994 1997
             let params = {
1995
-              p_type: 2,
1998
+              p_type:2,
1996 1999
               patient_id: this.patientInfo.id,
1997 2000
               diagnose: this.diagnose,
1998 2001
               sick_type: this.state1,
@@ -2491,9 +2494,9 @@
2491 2494
                   prescribing_number: temp[b].prescribing_number,
2492 2495
                   single_dose_unit: temp[b].min_unit,
2493 2496
                   prescribing_number_unit: temp[b].max_unit,
2494
-                  medical_insurance_number: temp[b].medical_insurance_number
2495
-
2496
-                }
2497
+                  medical_insurance_number: temp[b].medical_insurance_number,
2498
+                  drug: temp[b],
2499
+                };
2497 2500
 
2498 2501
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2499 2502
                   obj.prescribing_number = 1
@@ -2540,6 +2543,7 @@
2540 2543
                   obj.single_dose = 1
2541 2544
                 }
2542 2545
 
2546
+                console.log(obj)
2543 2547
                 this.prescriptions[i].project.push(obj)
2544 2548
               }
2545 2549
               this.curStatus = 2
@@ -2607,6 +2611,7 @@
2607 2611
 
2608 2612
           }
2609 2613
         })
2614
+
2610 2615
       }, deepClone(source) {
2611 2616
         if (!source && typeof source !== 'object') {
2612 2617
           throw new Error('error arguments', 'shallowClone')
@@ -2720,6 +2725,7 @@
2720 2725
 
2721 2726
           }
2722 2727
         })
2728
+
2723 2729
       }, changeDoctor(val) {
2724 2730
         for (let i = 0; i < this.doctors.length; i++) {
2725 2731
           if (this.doctors[i].admin_user_id == this.doctorValue) {

+ 468 - 0
src/xt_pages/outpatientDoctorStation/components/prescriptionTemplateTable.vue View File

@@ -0,0 +1,468 @@
1
+<template>
2
+    <div class="prescriptionTable">
3
+        <el-table v-if="prescription.advices && prescription.advices.length > 0" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
4
+                  :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
+            <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
6
+            <el-table-column align="center" prop="drug_name" label="名称">
7
+                <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
8
+            </el-table-column>
9
+
10
+            <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
11
+                <template slot-scope="scope">
12
+                    <div style="display:flex;align-items:center;">
13
+                        <el-input v-model="scope.row.single_dose" @input="getSingleDose(scope)" style="width:65%;"></el-input>
14
+                        <div>{{scope.row.single_dose_unit}}</div>
15
+                    </div>
16
+                </template>
17
+            </el-table-column>
18
+            <el-table-column align="center" prop="delivery_way" width="100" label="用法">
19
+                <template slot-scope="scope">
20
+                    <el-select v-model="scope.row.delivery_way" placeholder="请选择">
21
+                        <el-option
22
+                                v-for="(item,index) in drugways"
23
+                                :key="index"
24
+                                :label="item.name"
25
+                                :value="item.name">
26
+                        </el-option>
27
+                    </el-select>
28
+                </template>
29
+            </el-table-column>
30
+            <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
31
+                <template slot-scope="scope">
32
+                    <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
33
+                        <el-option
34
+                                v-for="item,index in efs"
35
+                                :key="index"
36
+                                :label="item.name"
37
+                                :value="item.name">
38
+                        </el-option>
39
+                    </el-select>
40
+                </template>
41
+            </el-table-column>
42
+
43
+
44
+            <el-table-column align="center" prop="day" width="70" label="天数">
45
+                <template slot-scope="scope">
46
+                    <div style="display:flex;align-items:center;">
47
+                        <el-input v-model="scope.row.day" @input="getDay(scope)" placeholder=""></el-input>{{'天'}}
48
+                    </div>
49
+                </template>
50
+            </el-table-column>
51
+
52
+            <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
53
+                <template slot-scope="scope">
54
+                    <div style="display:flex;align-items:center;">
55
+                        <el-input v-model="scope.row.prescribing_number" style="width:60%" placeholder=""></el-input>
56
+                        <div> {{scope.row.prescribing_number_unit}}</div>
57
+                    </div>
58
+                </template>
59
+            </el-table-column>
60
+            <el-table-column align="center" prop="retail_price" width="80" label="单价">
61
+                <template slot-scope="scope">
62
+                    <div style="display:flex;align-items:center;">
63
+                        <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
64
+                        <div>{{'元'}}</div>
65
+                    </div>
66
+
67
+                </template>
68
+            </el-table-column>
69
+            <el-table-column align="center" prop="remark" width="50" label="备注">
70
+                <template slot-scope="scope">
71
+                    <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
72
+                </template>
73
+            </el-table-column>
74
+            <el-table-column align="center" width="40" prop="name" label="操作">
75
+                <template slot-scope="scope">
76
+                    <i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>
77
+                </template>
78
+            </el-table-column>
79
+        </el-table>
80
+
81
+        <el-table v-if="prescription.project &&prescription.project.length > 0" :data="prescription.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
82
+                  :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
83
+            <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
84
+            <el-table-column align="center" prop="project_name" label="名称">
85
+                <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span></template>
86
+            </el-table-column>
87
+            <el-table-column align="center" prop="statistical_classification" width="100" label="组">
88
+                <template slot-scope="scope">{{scope.row.type == 2?getGroup(scope.row.statistical_classification):"耗材"}}</template>
89
+            </el-table-column>
90
+            <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
91
+                <template slot-scope="scope">
92
+                    <el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)" placeholder=""></el-input>
93
+                    <div>{{scope.row.unit}}</div>
94
+
95
+                </template>
96
+            </el-table-column>
97
+            <el-table-column align="center" prop="delivery_way" width="80" label="用法">
98
+                <template slot-scope="scope">
99
+                    <el-autocomplete
100
+                            style="width:100%;"
101
+                            class="inline-input"
102
+                            v-model="scope.row.delivery_way"
103
+                            :fetch-suggestions="querySearch2"
104
+                            placeholder="请输入内容"
105
+                    ></el-autocomplete>
106
+                </template>
107
+            </el-table-column>
108
+            <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
109
+                <template slot-scope="scope">
110
+                    <el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>
111
+                </template>
112
+            </el-table-column>
113
+            <el-table-column align="center" prop="number_days" width="70" label="天数">
114
+                <template slot-scope="scope">
115
+                    <div style="display:flex;align-items:center;">
116
+                        <el-input v-model="scope.row.number_days" @input="getProjectDay(scope)" placeholder=""></el-input>
117
+                        <div>{{'天'}}</div>
118
+                    </div>
119
+                </template>
120
+            </el-table-column>
121
+            <el-table-column align="center" prop="total" width="70" label="总量">
122
+                <template slot-scope="scope">
123
+                    <div style="display:flex;align-items:center;">
124
+                        <el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>
125
+                        <div>{{scope.row.unit}}</div>
126
+
127
+                    </div>
128
+                </template>
129
+            </el-table-column>
130
+            <el-table-column align="center" prop="name" width="50" label="单价">
131
+                <template slot-scope="scope">
132
+                    <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
133
+                    <div>{{'元'}}</div>
134
+
135
+                </template>
136
+            </el-table-column>
137
+            <el-table-column align="center" prop="name" width="50" label="备注">
138
+                <template slot-scope="scope">
139
+                    <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
140
+                </template>
141
+            </el-table-column>
142
+            <el-table-column align="center" width="40" prop="name" label="操作">
143
+                <template slot-scope="scope">
144
+                    <i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>
145
+                </template>
146
+            </el-table-column>
147
+        </el-table>
148
+
149
+        <div class="additionalBox">
150
+            <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
151
+                <span :title="item.item_name">{{item.item_name}}</span>
152
+                <el-input v-model="item.price" placeholder="" style="width:50px;"></el-input>
153
+                共
154
+                <el-input v-model="item.count" placeholder="" style="width:50px;"></el-input>
155
+                次
156
+                <i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>
157
+            </div>
158
+        </div>
159
+
160
+
161
+
162
+    </div>
163
+</template>
164
+
165
+<script>
166
+  import { getDictionaryDataConfig} from "@/utils/data";
167
+  import { getInitData,delHisAdvice,delHisProject,delHisAddition } from '@/api/his/his'
168
+  import { delHisPrescriptionAdviceTemplate,delHisPrescriptionProjectTemplate } from '@/api/his/his_config'
169
+
170
+  export default {
171
+    props: {
172
+      preDrugs: Array,
173
+      activeType: Number,
174
+      addtions_charge:Array,
175
+      prescription:{
176
+        type:Object,
177
+        default: function () {
178
+          return {
179
+            name:"",
180
+            advices:[],
181
+            project:[],
182
+            drugways:[],
183
+            efs:[],
184
+          };
185
+        }
186
+      },
187
+    },
188
+    data() {
189
+      return {
190
+        advices:[],
191
+        tableData: [],
192
+        newoptions: [{
193
+          value: '1',
194
+          label: '1'
195
+        }, {
196
+          value: '2',
197
+          label: '2'
198
+        }, {
199
+          value: '3',
200
+          label: '3'
201
+        }, {
202
+          value: '4',
203
+          label: '4'
204
+        }, {
205
+          value: '5',
206
+          label: '5'
207
+        }],
208
+        value: '1',
209
+        input: 1,
210
+      }
211
+    },
212
+
213
+    methods:{
214
+      createFilter(queryString) {
215
+        return (restaurant) => {
216
+          return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
217
+        }
218
+      },
219
+      querySearch2(queryString, cb) {
220
+        var restaurants = this.getDictionaryDataConfig("system","project_use")
221
+        restaurants.map(item => {
222
+          item.value = item.name
223
+        })
224
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
225
+        // 调用 callback 返回建议列表的数据
226
+        cb(results)
227
+      },
228
+      delAddition(index, addition){
229
+        this.$confirm("附加费删除后不可恢复,是否确认删除", "删除", {
230
+          confirmButtonText: "确 定",
231
+          cancelButtonText: "取 消",
232
+          type: "warning"
233
+        }).then(() => {
234
+          this.$nextTick(function(){
235
+            if(addition.id == 0){
236
+              this.prescription.addition.splice(index, 1)
237
+            }else{
238
+              let params = {
239
+                'id': addition.id,
240
+              }
241
+              delHisAddition(params).then(response => {
242
+                if (response.data.state == 0) {
243
+                  this.$message.error(response.data.msg)
244
+                  return false
245
+                } else {
246
+                  var temp2 = this.deepClone(this.prescription.addition)
247
+                  temp2.splice(index, 1)
248
+                  this.prescription.addition = temp2
249
+                  this.$message.success(response.data.data.msg)
250
+                }
251
+              })
252
+            }
253
+          });
254
+
255
+        })
256
+          .catch(() => {});
257
+
258
+      },
259
+      getInitData(){
260
+        getInitData().then(response => {
261
+          if (response.data.state == 0) {
262
+            this.$message.error(response.data.msg)
263
+            return false
264
+          } else {
265
+            this.drugways = response.data.data.drugways
266
+            this.efs = response.data.data.efs
267
+          }
268
+        })
269
+
270
+      },deleteDrug:function(index, row){
271
+
272
+        this.$confirm("药品删除后不可恢复,是否确认删除", "删除", {
273
+          confirmButtonText: "确 定",
274
+          cancelButtonText: "取 消",
275
+          type: "warning"
276
+        }).then(() => {
277
+          this.$nextTick(function(){
278
+            if(row.advice_id == 0){
279
+              this.prescription.advices.splice(index, 1)
280
+            }else{
281
+              let params = {
282
+                'id': row.advice_id,
283
+              }
284
+              delHisPrescriptionAdviceTemplate(params).then(response => {
285
+                if (response.data.state == 0) {
286
+                  this.$message.error(response.data.msg)
287
+                  return false
288
+                } else {
289
+                  var temp2 = this.deepClone(this.prescription.advices)
290
+                  temp2.splice(index, 1)
291
+                  this.prescription.advices = temp2
292
+                  this.$message.success(response.data.data.msg)
293
+                }
294
+              })
295
+
296
+
297
+            }
298
+
299
+          });
300
+
301
+
302
+        })
303
+          .catch(() => {});
304
+
305
+
306
+
307
+
308
+
309
+      },deepClone(source) {
310
+        if (!source && typeof source !== 'object') {
311
+          throw new Error('error arguments', 'shallowClone')
312
+        }
313
+        const targetObj = source.constructor === Array ? [] : {}
314
+        Object.keys(source).forEach((keys) => {
315
+          if (source[keys] && typeof source[keys] === 'object') {
316
+            targetObj[keys] = this.deepClone(source[keys])
317
+          } else {
318
+            targetObj[keys] = source[keys]
319
+          }
320
+        })
321
+        return targetObj
322
+      },
323
+
324
+      setNewData:function(data){
325
+        this.prescription = data
326
+
327
+        // this.prescription.advices = data.advices
328
+      },
329
+      getDictionaryDataConfig(module, filed_name) {
330
+        return getDictionaryDataConfig(module, filed_name)
331
+      },
332
+      getGroup(id){
333
+        var name = ""
334
+        var statistics_category =  getDictionaryDataConfig('system','statistics_category')
335
+        console.log("2235",statistics_category)
336
+        for(let i=0;i<statistics_category.length;i++){
337
+          if(id == statistics_category[i].id){
338
+            name = statistics_category[i].name
339
+          }
340
+        }
341
+        return name
342
+      },
343
+      deleteProject(row,i){
344
+        if(this.prescription.order_status == 2){
345
+          this.$message.error('该处方已经结算,无法删除')
346
+          return
347
+        }
348
+        this.$confirm("项目删除后不可恢复,是否确认删除", "删除", {
349
+          confirmButtonText: "确 定",
350
+          cancelButtonText: "取 消",
351
+          type: "warning"
352
+        }).then(() => {
353
+          if(row.id == 0){
354
+            this.prescription.project.splice(i, 1)
355
+
356
+          }else{
357
+            let params = {
358
+              'id': row.id,
359
+            }
360
+            delHisPrescriptionProjectTemplate(params).then(response => {
361
+              if (response.data.state == 0) {
362
+                this.$message.error(response.data.msg)
363
+                return false
364
+              } else {
365
+                for (let i = 0; i < this.prescription.project.length; i++){
366
+                  if(this.prescription.project[i].id == row.id){
367
+                    this.prescription.project.splice(i, 1)
368
+                  }
369
+                }
370
+                this.$message.success(response.data.data.msg)
371
+              }
372
+            })
373
+          }
374
+        })
375
+          .catch(() => {});
376
+
377
+      },
378
+      getSingleDose(scope){
379
+        this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
380
+      },
381
+      getDay(scope){
382
+        this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
383
+      },
384
+      getProjectSingleDose(scope){
385
+        this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
386
+        if(this.prescription.project[scope.$index].total == 0){
387
+          this.prescription.project[scope.$index].total = 1
388
+        }
389
+      },
390
+      getProjectDay(scope){
391
+        this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
392
+        if(this.prescription.project[scope.$index].total == 0){
393
+          this.prescription.project[scope.$index].total = 1
394
+        }
395
+      }
396
+    },mounted(){
397
+      this.getInitData()
398
+
399
+    },
400
+    watch:{
401
+      // "prescription.advices":{
402
+      //   handler(newVal,oldVal){
403
+      //     newVal.map(item => {
404
+      //       item.prescribing_number = item.single_dose * item.day
405
+      //       if(item.single_dose != oldVal[index].single_dose || item.number_days != oldVal[index].number_days){
406
+      //         item.total = item.single_dose * item.number_days
407
+      //       }
408
+
409
+
410
+      //     })
411
+      //   },
412
+      //   deep:true
413
+      // },
414
+      // "prescription.project":{
415
+      //   handler(newVal,oldVal){
416
+      //     newVal.map((item,index) => {
417
+      //       if(item.single_dose != oldVal[index].single_dose || item.number_days != oldVal[index].number_days){
418
+      //         item.total = item.single_dose * item.number_days
419
+      //       }
420
+
421
+      //     })
422
+      //   },
423
+      //   deep:true
424
+      // }
425
+    }
426
+
427
+  }
428
+</script>
429
+
430
+<style lang="scss">
431
+    .prescriptionTable {
432
+    .el-input__inner{
433
+        padding: 0 5px;
434
+    }
435
+    .additionalBox{
436
+        margin-top: 20px;
437
+        display: flex;
438
+        flex-wrap: wrap;
439
+    .additionalOne{
440
+        margin-right:20px;
441
+        margin-bottom:10px;
442
+        display: flex;
443
+        align-items: center;
444
+    >span{
445
+        white-space: nowrap;
446
+        overflow: hidden;
447
+        text-overflow: ellipsis;
448
+        width:80px;
449
+        display: inline-block;
450
+        font-size: 14px;
451
+    }
452
+    }
453
+    .deleteIcon{
454
+        color:red;
455
+        margin-left:5px;
456
+    }
457
+    }
458
+    .el-table th .cell, .el-table td .cell {
459
+        padding: 0 2px;
460
+        white-space: pre-line;
461
+    }
462
+
463
+    .el-icon-delete {
464
+        color: red;
465
+    }
466
+
467
+    }
468
+</style>

+ 488 - 0
src/xt_pages/outpatientDoctorStation/prescriptionTemplate.vue View File

@@ -0,0 +1,488 @@
1
+<template>
2
+    <div class="main-contain new-main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+            <el-button type="primary" @click="add">新增</el-button>
6
+
7
+        </div>
8
+        <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
9
+            <div class="mainLeft">
10
+                <!--<div class="mainCell" style="margin-bottom:10px;">-->
11
+                    <!--<el-input size="small" placeholder="请输入姓名" @input="searchAction"-->
12
+                              <!--@keyup.enter.native='searchAction'-->
13
+                              <!--v-model="search_input" class="filter-item"/>-->
14
+                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
15
+                               <!--@click="searchAction">-->
16
+                        <!--搜索-->
17
+                    <!--</el-button>-->
18
+                <!--</div>-->
19
+                <div>
20
+                    <el-table :data="data" :height="tableHeight" @row-click='choosePatient'
21
+                               border style="width: 100%;"
22
+                              :row-style="{ color: '#303133' }"
23
+                              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
24
+                              highlight-current-row
25
+                              ref="tab">
26
+                        <el-table-column prop="name" label="姓名">
27
+                            <template slot-scope="scope">{{scope.row.name}}</template>
28
+                        </el-table-column>
29
+                    </el-table>
30
+                </div>
31
+            </div>
32
+            <div class="mainRight">
33
+                <el-table :data="templates" :height="tableHeight"
34
+                           border style="width: 100%;"
35
+                          :row-style="{ color: '#303133' }"
36
+                          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
37
+                          highlight-current-row
38
+                          ref="tab"
39
+                >
40
+                    <el-table-column prop="name" label="模版名称">
41
+                        <template slot-scope="scope">{{scope.row.name}}</template>
42
+                    </el-table-column>
43
+                    <el-table-column prop="name" label="透析模式">
44
+                        <template slot-scope="scope">{{getMode(scope.row.mode)}}</template>
45
+                    </el-table-column>
46
+                    <el-table-column prop="name" label="操作">
47
+                        <template slot-scope="scope">
48
+                            <el-button size="mini" type="primary" @click="jumpDetail(scope.row)">编辑</el-button>
49
+                            <el-button size="mini" type="danger" @click="deleteTemplate(scope.row)">删除</el-button>
50
+                        </template>
51
+                    </el-table-column>
52
+                </el-table>
53
+
54
+
55
+                <el-pagination
56
+                        @size-change="handleSizeChange"
57
+                        @current-change="handleCurrentChange"
58
+                        :page-sizes="[10, 50, 100]"
59
+                        :page-size="10"
60
+                        background
61
+                        align="right"
62
+                        style="margin-top:20px;"
63
+                        layout="total, sizes, prev, pager, next, jumper"
64
+                        :total="total"
65
+                >
66
+                </el-pagination>
67
+            </div>
68
+        </div>
69
+    </div>
70
+</template>
71
+
72
+<script>
73
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
74
+  import { delHisPrescriptionTemplate, getPatientList, getPrescriptionTemplateList } from '@/api/his/his_config'
75
+  import { uParseTime } from '@/utils/tools'
76
+
77
+  const moment = require('moment')
78
+  export default {
79
+    components: {
80
+      BreadCrumb
81
+    },
82
+    data() {
83
+      return {
84
+        crumbs: [
85
+          { path: false, name: '门诊医生站' },
86
+          { path: false, name: '处方模版' }
87
+        ],
88
+        search_input:'',
89
+        templates: [],
90
+        tableHeight: '',
91
+        fullHeight: document.documentElement.clientHeight,
92
+        isloading: false,
93
+        data: [],
94
+        page: 1,
95
+        limit: 10,
96
+        patient_id: 0,
97
+        total:0
98
+      }
99
+    },
100
+    methods: {
101
+      deleteTemplate(row) {
102
+        this.$confirm('处方模版删除后不可恢复,是否确认删除', '删除', {
103
+          confirmButtonText: '确 定',
104
+          cancelButtonText: '取 消',
105
+          type: 'warning'
106
+        }).then(() => {
107
+          let params = {
108
+            id: row.id
109
+          }
110
+          delHisPrescriptionTemplate(params).then(response => {
111
+            if (response.data.state == 1) {
112
+              this.GetPrescriptionTemplateList()
113
+            }
114
+          })
115
+
116
+        }).catch(() => {
117
+
118
+        })
119
+      },
120
+      jumpDetail(row) {
121
+        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + row.id + '&patient_id=' + this.patient_id)
122
+      },
123
+      getMode(id) {
124
+        let name = ''
125
+        this.treatment_mode = Object.values(this.$store.getters.treatment_mode)
126
+        this.treatment_mode.map(item => {
127
+          if (item.id == id) {
128
+            name = item.name
129
+          }
130
+        })
131
+        return name
132
+      },
133
+      handleSizeChange(val) {
134
+        this.limit = val
135
+        this.GetPrescriptionTemplateList()
136
+      },
137
+      handleCurrentChange(val) {
138
+        this.page = val
139
+        this.GetPrescriptionTemplateList()
140
+      },
141
+      GetPrescriptionTemplateList() {
142
+        let params = {
143
+          patient_id: this.patient_id,
144
+          page: this.page,
145
+          limit: this.limit
146
+        }
147
+        getPrescriptionTemplateList(params).then(response => {
148
+          if (response.data.state == 1) {
149
+            this.templates = response.data.data.list
150
+            this.total = response.data.data.total
151
+          }
152
+        })
153
+
154
+      },
155
+      choosePatient(val) {
156
+        this.page = 1
157
+        this.limit = 10
158
+        this.patient_id = val.id
159
+        let params = {
160
+          patient_id: val.id,
161
+          page: this.page,
162
+          limit: this.limit
163
+        }
164
+        getPrescriptionTemplateList(params).then(response => {
165
+          if (response.data.state == 1) {
166
+            this.templates = response.data.data.list
167
+            this.total = response.data.data.total
168
+          }
169
+        })
170
+      },
171
+      getList(id) {
172
+        getPatientList().then(response => {
173
+          if (response.data.state == 1) {
174
+            this.data = response.data.data.list
175
+            this.$refs.tab.setCurrentRow(this.data[0])
176
+            // this.patient_id = this.data[0].id
177
+            // this.GetPrescriptionTemplateList()
178
+
179
+          }
180
+        })
181
+      },
182
+      getTime(val, temp) {
183
+        if (val != 0) {
184
+          return uParseTime(val, temp)
185
+        } else {
186
+          return ''
187
+        }
188
+      },
189
+      add() {
190
+        if (this.patient_id == 0) {
191
+          this.$message.error('请选择病人')
192
+          return
193
+        }
194
+        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + 0 + '&patient_id=' + this.patient_id)
195
+
196
+      }
197
+    },
198
+    created() {
199
+      var nowDate = new Date()
200
+      var nowYear = nowDate.getFullYear()
201
+      var nowMonth = nowDate.getMonth() + 1
202
+      var nowDay = nowDate.getDate()
203
+      this.record_date =
204
+        nowYear +
205
+        '-' +
206
+        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
207
+        '-' +
208
+        (nowDay < 10 ? '0' + nowDay : nowDay)
209
+      this.getList()
210
+      let tableHeight = document.body.clientHeight - 263
211
+      this.tableHeight = tableHeight
212
+
213
+    },
214
+    mounted() {
215
+      const that = this
216
+      window.onresize = () => {
217
+        return (() => {
218
+          window.fullHeight = document.documentElement.clientHeight
219
+          that.fullHeight = window.fullHeight
220
+        })()
221
+      }
222
+    },
223
+    watch: {
224
+      fullHeight(val) {
225
+        if (!this.timer) {
226
+          this.fullHeight = val
227
+          let tableHeight = val - 263
228
+          this.tableHeight = tableHeight
229
+          this.timer = true
230
+          let that = this
231
+          setTimeout(function() {
232
+            that.timer = false
233
+          }, 400)
234
+        }
235
+      }
236
+
237
+    }
238
+  }
239
+</script>
240
+
241
+<style lang="scss" scoped>
242
+    .new-main-contain {
243
+        height: 100%;
244
+        display: flex;
245
+        flex-direction: column;
246
+    }
247
+
248
+    .app-container {
249
+        height: 100%;
250
+    }
251
+
252
+    .mainCell {
253
+        height: 36px;
254
+        display: flex;
255
+        align-items: center;
256
+    }
257
+
258
+    .mainLeft {
259
+        width: 200px;
260
+        height: 100%;
261
+        display: flex;
262
+        flex-direction: column;
263
+
264
+    .el-radio {
265
+        margin-right: 5px;
266
+    }
267
+
268
+    }
269
+    .mainRight {
270
+        margin-left: 10px;
271
+        flex: 1;
272
+        height: 100%;
273
+        display: flex;
274
+        flex-direction: column;
275
+        overflow-y: auto;
276
+
277
+    .cellSpan {
278
+        min-width: 80px;
279
+        display: inline-block;
280
+        margin-right: 10px;
281
+    }
282
+
283
+    }
284
+    .mainCenter {
285
+        display: flex;
286
+        flex: 1;
287
+    }
288
+
289
+    .centerLeft {
290
+        flex: 1;
291
+        display: flex;
292
+        flex-direction: column;
293
+        position: relative;
294
+
295
+    .el-form-item {
296
+        width: 32%;
297
+        margin-right: 1%;
298
+        float: left;
299
+    }
300
+
301
+    .el-form-item__label {
302
+        text-align: left;
303
+    }
304
+
305
+    }
306
+    .backColor {
307
+        background: #f6f8f9;
308
+        height: 5px;
309
+        margin-bottom: 5px;
310
+    }
311
+
312
+    .tabsBox {
313
+        position: relative;
314
+        height: 76%;
315
+        overflow-y: auto;
316
+        margin-bottom: 60px;
317
+
318
+    .el-tabs__item {
319
+        padding: 0 10px;
320
+    }
321
+
322
+    }
323
+    .preTabs {
324
+        height: 100%;
325
+        display: flex;
326
+        flex-direction: column;
327
+
328
+    .el-tabs__content {
329
+        flex: 1;
330
+        overflow-y: auto;
331
+    }
332
+
333
+    }
334
+
335
+    .costBox {
336
+        width: 100%;
337
+        height: 60px;
338
+        background: #fff;
339
+        position: absolute;
340
+        bottom: 0;
341
+        display: flex;
342
+        align-items: center;
343
+    }
344
+
345
+    .addTab {
346
+        position: absolute;
347
+        right: 0;
348
+        top: 14px;
349
+        z-index: 20;
350
+    }
351
+
352
+    .centerRight {
353
+        width: 300px;
354
+        margin-left: 10px;
355
+        display: flex;
356
+        flex-direction: column;
357
+        position: relative;
358
+    }
359
+
360
+    .rightTab {
361
+        height: 40px;
362
+        width: 100%;
363
+        border: 1px solid #d2d2d2;
364
+        box-sizing: border-box;
365
+
366
+    p {
367
+        width: 50%;
368
+        height: 40px;
369
+        line-height: 40px;
370
+        text-align: center;
371
+        background: #eee;
372
+        float: left;
373
+    }
374
+
375
+    > p:last-child {
376
+        border-left: 1px solid #d2d2d2;
377
+        float: right;
378
+    }
379
+
380
+    .activeP {
381
+        background: #409EFF;
382
+        color: #fff;
383
+    }
384
+
385
+    }
386
+    .comfirmBox {
387
+        width: 100%;
388
+        height: 60px;
389
+        background: #fff;
390
+        position: absolute;
391
+        bottom: 0;
392
+        display: flex;
393
+        align-items: center;
394
+        justify-content: space-between;
395
+    }
396
+
397
+    .mainHeader {
398
+        width: 100%;
399
+        background: #fff;
400
+        position: fixed;
401
+        z-index: 100;
402
+        height: 36px;
403
+    }
404
+
405
+    .titleBox {
406
+        position: fixed;
407
+        z-index: 99;
408
+        background: #fff;
409
+    }
410
+
411
+    .fixedCell {
412
+        position: fixed;
413
+        z-index: 99;
414
+        right: 30px;
415
+        background: #fff;
416
+        width: 300px;
417
+        display: flex;
418
+        justify-content: space-between;
419
+    }
420
+</style>
421
+
422
+<style lang="scss">
423
+    .centerLeft {
424
+
425
+    .el-form-item__label {
426
+        text-align: left;
427
+    }
428
+
429
+    }
430
+    .tabsBox {
431
+
432
+    .el-tabs__item {
433
+        padding: 0 10px;
434
+    }
435
+
436
+    .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
437
+        padding: 0 10px;
438
+    }
439
+
440
+    .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
441
+        padding: 0 10px;
442
+    }
443
+
444
+    .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
445
+        padding: 0 10px;
446
+    }
447
+
448
+    }
449
+    .centerRight {
450
+
451
+    .el-tabs__nav-scroll {
452
+        display: flex;
453
+    }
454
+
455
+    .el-tabs__nav {
456
+        margin: 0 auto;
457
+    }
458
+
459
+    .el-table th .cell, .el-table td .cell {
460
+        padding: 0 2px;
461
+    }
462
+
463
+    }
464
+    .preTabs {
465
+
466
+    .el-tabs__content {
467
+
468
+    }
469
+
470
+    }
471
+    .rightTabs {
472
+        height: 100%;
473
+
474
+
475
+    .el-tabs__content {
476
+
477
+    }
478
+
479
+    }
480
+    .centerDialog {
481
+
482
+    .el-dialog__body {
483
+        max-height: calc(100vh - 100px) !important;
484
+        padding: 0 20px;
485
+    }
486
+
487
+    }
488
+</style>

File diff suppressed because it is too large
+ 1997 - 0
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue