Kaynağa Gözat

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

csx 4 yıl önce
ebeveyn
işleme
d67cb13912

+ 12 - 0
src/api/his/his.js Dosyayı Görüntüle

@@ -269,6 +269,18 @@ export function getNextOrLastHisPrescription (params) {
269 269
 
270 270
 
271 271
 
272
+export function getCallHisPrescription (params) {
273
+  return request({
274
+    url: '/api/callhisprescription/get',
275
+    method: 'get',
276
+    params:params,
277
+  })
278
+}
279
+
280
+
281
+
282
+
283
+
272 284
 
273 285
 
274 286
 

+ 354 - 0
src/xt_pages/outpatientDoctorStation/components/callPrescription.vue Dosyayı Görüntüle

@@ -0,0 +1,354 @@
1
+<template>
2
+  <el-dialog
3
+    :title="name"
4
+    :visible.sync="isLastOrNextVisible"
5
+    @close="hide"
6
+    width="1010px"
7
+    :modal-append-to-body="false"
8
+  >
9
+    <el-date-picker
10
+      v-model="start_time"
11
+      prefix-icon="el-icon-date"
12
+      @change="changeTime"
13
+      :editable="false"
14
+      style="width: 150px;"
15
+      type="date"
16
+      :picker-options="pickerOptions"
17
+      placeholder="选择日期时间"
18
+      align="right"
19
+      format="yyyy-MM-dd"
20
+      value-format="yyyy-MM-dd"
21
+    ></el-date-picker>
22
+    <span class>-</span>
23
+    <el-date-picker
24
+      v-model="end_time"
25
+      prefix-icon="el-icon-date"
26
+      @change="changeEndTime"
27
+      :editable="false"
28
+      :picker-options="pickerOptions"
29
+      style="width: 150px;"
30
+      type="date"
31
+      placeholder="选择日期时间"
32
+      align="right"
33
+      format="yyyy-MM-dd"
34
+      value-format="yyyy-MM-dd"
35
+    ></el-date-picker>
36
+
37
+
38
+    <div v-for="(item,index) in allPrescription" :key="index">
39
+      <div>引用 {{getTime(item.record_date, '{y}年{m}月{d}日')}} 的处方</div>
40
+      <el-checkbox-group v-model="item.check_group">
41
+        <div v-for="(subItem,index2) in item.prescriptions" :key="index2">
42
+          <el-checkbox :label="subItem.id">{{'处方' + (index2+ 1)}}</el-checkbox>
43
+          <el-table v-if="subItem.type  == 1" :data="subItem.doctor_advice" border style="width: 99%;"
44
+                    :row-style="{ color: '#303133' }"
45
+                    :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
46
+            <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
47
+            <el-table-column align="center" prop="drug_name"  width="100" label="名称">
48
+              <template slot-scope="scope">
49
+                <span>{{ scope.row.advice_name }}</span>
50
+              </template>
51
+            </el-table-column>
52
+
53
+            <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
54
+              <template slot-scope="scope">
55
+                <div style="display:flex;align-items:center;">
56
+                  <div>{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</div>
57
+                </div>
58
+              </template>
59
+            </el-table-column>
60
+            <el-table-column align="center" prop="delivery_way" width="100" label="用法">
61
+              <template slot-scope="scope">
62
+                {{scope.row.delivery_way}}
63
+              </template>
64
+            </el-table-column>
65
+            <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
66
+              <template slot-scope="scope">
67
+                {{scope.row.execution_frequency}}
68
+              </template>
69
+            </el-table-column>
70
+
71
+            <el-table-column align="center" prop="day" width="50" label="天数">
72
+              <template slot-scope="scope">
73
+                {{scope.row.day}}
74
+              </template>
75
+            </el-table-column>
76
+
77
+            <el-table-column align="center" prop="prescribing_number" width="100" label="总量">
78
+              <template slot-scope="scope">
79
+                <div style="display:flex;align-items:center;">
80
+                  <div>{{scope.row.prescribing_number}} {{scope.row.prescribing_number_unit}}</div>
81
+                </div>
82
+              </template>
83
+            </el-table-column>
84
+            <el-table-column align="center" prop="retail_price" width="80" label="单价">
85
+              <template slot-scope="scope">
86
+                <div>{{scope.row.retail_price}}</div>
87
+              </template>
88
+            </el-table-column>
89
+            <el-table-column align="center" prop="remark" width="200" label="备注">
90
+              <template slot-scope="scope">
91
+                <div>{{scope.row.remark}}</div>
92
+              </template>
93
+            </el-table-column>
94
+          </el-table>
95
+          <el-table v-if="subItem.type == 2" :data="subItem.project" border style="width: 99%;"
96
+                    :row-style="{ color: '#303133' }"
97
+                    :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
98
+            <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
99
+            <el-table-column align="center" prop="project_name" width="100" label="名称">
100
+              <template slot-scope="scope">
101
+                <span>{{ scope.row.project.project_name }}</span>
102
+              </template>
103
+            </el-table-column>
104
+            <el-table-column align="center" prop="statistical_classification" width="100" label="组">
105
+              <template slot-scope="scope">{{getGroup(scope.row.statistical_classification)}}</template>
106
+            </el-table-column>
107
+            <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
108
+              <template slot-scope="scope">
109
+                <!--<el-input v-model="scope.row.single_dose" placeholder=""></el-input>-->
110
+                <span>{{ scope.row.single_dose }}</span>
111
+
112
+              </template>
113
+            </el-table-column>
114
+            <el-table-column align="center" prop="delivery_way" width="100" label="用法">
115
+              <template slot-scope="scope">
116
+                <!--<el-input v-model="scope.row.delivery_way" placeholder=""></el-input>-->
117
+                <span>{{ scope.row.delivery_way }}</span>
118
+
119
+              </template>
120
+            </el-table-column>
121
+            <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
122
+              <template slot-scope="scope">
123
+                <!--<el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>-->
124
+                <span>{{ scope.row.execution_frequency }}</span>
125
+
126
+              </template>
127
+            </el-table-column>
128
+            <el-table-column align="center" prop="number_days" width="70" label="天数">
129
+              <template slot-scope="scope">
130
+                <!--<el-input v-model="scope.row.number_days" placeholder=""></el-input>-->
131
+                <span>{{ scope.row.number_days }}</span>
132
+
133
+              </template>
134
+            </el-table-column>
135
+            <el-table-column align="center" prop="total" width="70" label="总量">
136
+              <template slot-scope="scope">
137
+                <div style="display:flex;align-items:center;">
138
+                  <!--<el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>-->
139
+                  <div>{{ scope.row.total }}{{scope.row.unit}}</div>
140
+                </div>
141
+              </template>
142
+            </el-table-column>
143
+            <el-table-column align="center" prop="name" width="50" label="单价">
144
+              <template slot-scope="scope">
145
+                <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
146
+                <span>{{ scope.row.price }}</span>
147
+
148
+              </template>
149
+            </el-table-column>
150
+            <el-table-column align="center" prop="name" width="100" label="备注">
151
+              <template slot-scope="scope">
152
+                <!--<el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>-->
153
+                <span>{{ scope.row.remark }}</span>
154
+
155
+              </template>
156
+            </el-table-column>
157
+          </el-table>
158
+        </div>
159
+      </el-checkbox-group>
160
+
161
+    </div>
162
+
163
+
164
+    <div slot="footer" class="dialog-footer">
165
+      <el-button @click="isLastOrNextVisible = false">取 消</el-button>
166
+      <el-button type="primary" @click="save">保存</el-button>
167
+    </div>
168
+  </el-dialog>
169
+
170
+
171
+</template>
172
+
173
+<script>
174
+  import { uParseTime } from '@/utils/tools'
175
+  import { getDictionaryDataConfig} from "@/utils/data";
176
+
177
+  import {
178
+    getCallHisPrescription
179
+  } from '@/api/his/his'
180
+  export default {
181
+    name: "callPrescription",
182
+    data() {
183
+      return {
184
+        start_time:"",
185
+        end_time:"",
186
+        srcPrescriptions:[],
187
+        name:"",
188
+        request_record_date:'',
189
+        patient_id:0,
190
+        allPrescription: [],
191
+        isLastOrNextVisible: false,
192
+
193
+      }
194
+    }, methods: {
195
+      changeTime(){
196
+        let params={
197
+          patient_id:this.patient_id,
198
+          start_time: this.start_time,
199
+          end_time:this.end_time
200
+        }
201
+        this.GetCallHisPrescription(params)
202
+      },changeEndTime(){
203
+        let params={
204
+          patient_id:this.patient_id,
205
+          start_time: this.start_time,
206
+          end_time:this.end_time
207
+        }
208
+        this.GetCallHisPrescription(params)
209
+      },
210
+      GetCallHisPrescription(params){
211
+        getCallHisPrescription(params).then(response => {
212
+          if (response.data.state == 1) {
213
+            this.allPrescription = response.data.data.prescriptions
214
+            for (let i = 0; i < this.allPrescription.length; i++){
215
+              this.allPrescription[i].check_group = []
216
+            }
217
+            this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
218
+          } else {
219
+            this.$message.error(response.data.msg)
220
+
221
+          }
222
+        })
223
+      },
224
+      save() {
225
+        let replace_one = []
226
+        let replace_two = []
227
+
228
+        let checkGroup = []
229
+        let allPrescriptions = []
230
+        let targetPrescriptions = []
231
+        let prescriptions = []
232
+        for (let i = 0; i < this.allPrescription.length; i++) {
233
+          for (let a = 0; a < this.allPrescription[i].check_group.length; a++) {
234
+            checkGroup.push(this.allPrescription[i].check_group[a])
235
+          }
236
+          for (let a = 0; a < this.allPrescription[i].prescriptions.length; a++) {
237
+            allPrescriptions.push(this.allPrescription[i].prescriptions[a])
238
+          }
239
+        }
240
+        for (let i = 0; i < allPrescriptions.length; i++){
241
+          for (let a = 0; a < checkGroup.length; a++){
242
+            if(allPrescriptions[i].id == checkGroup[a]){
243
+              targetPrescriptions.push(allPrescriptions[i])
244
+            }
245
+          }
246
+        }
247
+
248
+        if (targetPrescriptions.length > 0) {
249
+          for (let i = 0; i < targetPrescriptions.length; i++) {
250
+            var prescription = targetPrescriptions[i]
251
+            let tempAdvice = []
252
+            let tempProject = []
253
+            let tempAddition = []
254
+            for (let b = 0; b < prescription.doctor_advice.length; b++) {
255
+              let obj = {
256
+                advice_id: prescription.doctor_advice[b].id,
257
+                drug_name: prescription.doctor_advice[b].advice_name,
258
+                single_dose: prescription.doctor_advice[b].single_dose,
259
+                delivery_way: prescription.doctor_advice[b].delivery_way,
260
+                execution_frequency: prescription.doctor_advice[b].execution_frequency,
261
+                retail_price: prescription.doctor_advice[b].price.toString(),
262
+                remark: prescription.doctor_advice[b].remark,
263
+                day:prescription.doctor_advice[b].day,
264
+                prescribing_number:prescription.doctor_advice[b].prescribing_number.toString(),
265
+                single_dose_unit:prescription.doctor_advice[b].single_dose_unit,
266
+                prescribing_number_unit:prescription.doctor_advice[b].prescribing_number_unit,
267
+                medical_insurance_number:prescription.doctor_advice[b].med_list_codg,
268
+                id:prescription.doctor_advice[b].drug_id
269
+              }
270
+              tempAdvice.push(obj)
271
+
272
+            }
273
+
274
+
275
+            for (let b = 0; b < prescription.project.length; b++) {
276
+              let obj = {
277
+                id: prescription.project[b].id,
278
+                project_id: prescription.project[b].project_id,
279
+                project_name: prescription.project[b].project.project_name,
280
+                statistical_classification: prescription.project[b].project.statistical_classification,
281
+                single_dose: prescription.project[b].single_dose,
282
+                delivery_way: prescription.project[b].delivery_way,
283
+                execution_frequency: prescription.project[b].execution_frequency,
284
+                number_days: prescription.project[b].day,
285
+                total:prescription.project[b].count.toString(),
286
+                price:prescription.project[b].price,
287
+                remark:prescription.project[b].remark,
288
+                medical_code:prescription.project[b].project.medical_code,
289
+              }
290
+              tempProject.push(obj)
291
+            }
292
+            let obj = {
293
+              id: 0,
294
+              advices: tempAdvice,
295
+              project: tempProject,
296
+              addition:tempAddition,
297
+              order_status:0,
298
+            }
299
+            prescriptions.push(obj)
300
+          }
301
+        }
302
+
303
+        if(this.srcPrescriptions.length == 1){
304
+          if(this.srcPrescriptions[0].advices.length == 0 && this.srcPrescriptions[0].project.length == 0){
305
+            this.srcPrescriptions = []
306
+            this.srcPrescriptions = prescriptions
307
+            this.$emit('call', this.srcPrescriptions)
308
+          }else{
309
+
310
+            this.srcPrescriptions =  this.srcPrescriptions.concat(prescriptions)
311
+            this.$emit('call', this.srcPrescriptions)
312
+          }
313
+        }else{
314
+          this.srcPrescriptions =  this.srcPrescriptions.concat(prescriptions)
315
+          this.$emit('call', this.srcPrescriptions)
316
+        }
317
+      },show(name,id,end_time, start_time,srcPrescriptions,prescriptions){
318
+        this.srcPrescriptions = srcPrescriptions
319
+        this.start_time  = start_time
320
+        this.end_time = end_time
321
+        this.patient_id = id
322
+        this.name = '处方调用' + '('+name +')'
323
+        this.allPrescription = prescriptions
324
+        for (let i = 0; i < this.allPrescription.length; i++){
325
+          this.allPrescription[i].check_group = []
326
+        }
327
+        this.isLastOrNextVisible = true
328
+      },close(){
329
+        this.isLastOrNextVisible = false
330
+      },hide(){
331
+        this.$emit('callCancel')
332
+
333
+      },getTime(time, template){
334
+        return uParseTime(time,template)
335
+
336
+      }, getGroup(id){
337
+        var name = ""
338
+        var statistics_category =  getDictionaryDataConfig('system','statistics_category')
339
+        for(let i=0;i<statistics_category.length;i++){
340
+          if(id == statistics_category[i].id){
341
+            name = statistics_category[i].name
342
+          }
343
+        }
344
+        return name
345
+      },   getDictionaryDataConfig(module, filed_name) {
346
+        return getDictionaryDataConfig(module, filed_name)
347
+      },
348
+    }
349
+  }
350
+</script>
351
+
352
+<style scoped>
353
+
354
+</style>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 364 - 253
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue


+ 265 - 83
src/xt_pages/outpatientDoctorStation/components/nextOrLastPrescription.vue Dosyayı Görüntüle

@@ -1,42 +1,45 @@
1 1
 <template>
2 2
   <el-dialog
3
-    title="1111"
3
+    :title="name"
4 4
     :visible.sync="isLastOrNextVisible"
5
+    @close="hide"
5 6
     width="1010px"
6
-    @close="resetDialog"
7 7
     :modal-append-to-body="false"
8 8
   >
9 9
     <div class="txsj">
10 10
       <el-button
11 11
         round
12 12
 
13
-        @click="openLast(1)"
13
+        @click="openLast(3)"
14 14
       >上一方
15 15
       </el-button>
16 16
 
17 17
       <el-button
18 18
         round
19
-        @click="openNext(2)"
19
+        @click="openNext(4)"
20 20
       >下一方
21 21
       </el-button>
22 22
     </div>
23 23
 
24
-    <div  v-for="(item,index) in allPrescription" :key="index">
25
-      <div>{{item.title}}</div>
24
+    <div v-for="(item,index) in allPrescription" :key="index">
25
+      <div>引用 {{getTime(item.record_date, '{y}年{m}月{d}日')}} 的处方</div>
26 26
       <el-checkbox-group v-model="item.check_group">
27
-        <el-checkbox label="复选框 A" v-for="(subItem,index2) in item.prescriptions" :key="index2" :label="subItem.id" >
28
-          <el-table v-if="subItem.type  == 1" :data="subItem.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
27
+        <div v-for="(subItem,index2) in item.prescriptions" :key="index2">
28
+          <el-checkbox :label="subItem.id">{{'处方' + (index2+ 1)}}</el-checkbox>
29
+          <el-table v-if="subItem.type  == 1" :data="subItem.doctor_advice" border style="width: 99%;"
30
+                    :row-style="{ color: '#303133' }"
29 31
                     :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
30 32
             <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
31
-            <el-table-column align="center" prop="drug_name" label="名称">
32
-              <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
33
+            <el-table-column align="center" prop="drug_name"  width="100" label="名称">
34
+              <template slot-scope="scope">
35
+                <span>{{ scope.row.advice_name }}</span>
36
+              </template>
33 37
             </el-table-column>
34 38
 
35 39
             <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
36 40
               <template slot-scope="scope">
37 41
                 <div style="display:flex;align-items:center;">
38
-                  <el-input v-model="scope.row.single_dose" style="width:65%;"></el-input>
39
-                  <div>{{scope.row.single_dose_unit}}</div>
42
+                  <div>{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</div>
40 43
                 </div>
41 44
               </template>
42 45
             </el-table-column>
@@ -51,83 +54,94 @@
51 54
               </template>
52 55
             </el-table-column>
53 56
 
54
-
55 57
             <el-table-column align="center" prop="day" width="50" label="天数">
56 58
               <template slot-scope="scope">
57
-                <el-input v-model="scope.row.day" placeholder=""></el-input>
59
+                {{scope.row.day}}
58 60
               </template>
59 61
             </el-table-column>
60 62
 
61
-            <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
63
+            <el-table-column align="center" prop="prescribing_number" width="100" label="总量">
62 64
               <template slot-scope="scope">
63 65
                 <div style="display:flex;align-items:center;">
64
-                  <el-input v-model="scope.row.prescribing_number" style="width:60%" placeholder=""></el-input>
65
-                  <div> {{scope.row.prescribing_number_unit}}</div>
66
+                  <div>{{scope.row.prescribing_number}} {{scope.row.prescribing_number_unit}}</div>
66 67
                 </div>
67 68
               </template>
68 69
             </el-table-column>
69
-            <el-table-column align="center" prop="retail_price" width="60" label="单价">
70
+            <el-table-column align="center" prop="retail_price" width="80" label="单价">
70 71
               <template slot-scope="scope">
71
-                <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
72
+                <div>{{scope.row.retail_price}}</div>
72 73
               </template>
73 74
             </el-table-column>
74
-            <el-table-column align="center" prop="remark" width="50" label="备注">
75
+            <el-table-column align="center" prop="remark" width="200" label="备注">
75 76
               <template slot-scope="scope">
76
-                <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
77
+                <div>{{scope.row.remark}}</div>
77 78
               </template>
78 79
             </el-table-column>
79 80
           </el-table>
80
-
81
-          <el-table v-if="subItem.type == 2" :data="subItem.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
81
+          <el-table v-if="subItem.type == 2" :data="subItem.project" border style="width: 99%;"
82
+                    :row-style="{ color: '#303133' }"
82 83
                     :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
83 84
             <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>
85
+            <el-table-column align="center" prop="project_name" width="100" label="名称">
86
+              <template slot-scope="scope">
87
+                <span>{{ scope.row.project.project_name }}</span>
88
+              </template>
86 89
             </el-table-column>
87 90
             <el-table-column align="center" prop="statistical_classification" width="100" label="组">
88 91
               <template slot-scope="scope">{{getGroup(scope.row.statistical_classification)}}</template>
89 92
             </el-table-column>
90 93
             <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
91 94
               <template slot-scope="scope">
92
-                <el-input v-model="scope.row.single_dose" placeholder=""></el-input>
95
+                <!--<el-input v-model="scope.row.single_dose" placeholder=""></el-input>-->
96
+                <span>{{ scope.row.single_dose }}</span>
97
+
93 98
               </template>
94 99
             </el-table-column>
95
-            <el-table-column align="center" prop="delivery_way" width="80" label="用法">
100
+            <el-table-column align="center" prop="delivery_way" width="100" label="用法">
96 101
               <template slot-scope="scope">
97
-                <el-input v-model="scope.row.delivery_way" placeholder=""></el-input>
102
+                <!--<el-input v-model="scope.row.delivery_way" placeholder=""></el-input>-->
103
+                <span>{{ scope.row.delivery_way }}</span>
104
+
98 105
               </template>
99 106
             </el-table-column>
100
-            <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
107
+            <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
101 108
               <template slot-scope="scope">
102
-                <el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>
109
+                <!--<el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>-->
110
+                <span>{{ scope.row.execution_frequency }}</span>
111
+
103 112
               </template>
104 113
             </el-table-column>
105
-            <el-table-column align="center" prop="number_days" width="50" label="天数">
114
+            <el-table-column align="center" prop="number_days" width="70" label="天数">
106 115
               <template slot-scope="scope">
107
-                <el-input v-model="scope.row.number_days" placeholder=""></el-input>
116
+                <!--<el-input v-model="scope.row.number_days" placeholder=""></el-input>-->
117
+                <span>{{ scope.row.number_days }}</span>
118
+
108 119
               </template>
109 120
             </el-table-column>
110 121
             <el-table-column align="center" prop="total" width="70" label="总量">
111 122
               <template slot-scope="scope">
112 123
                 <div style="display:flex;align-items:center;">
113
-                  <el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>
114
-                  <div>{{scope.row.unit}}</div>
124
+                  <!--<el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>-->
125
+                  <div>{{ scope.row.total }}{{scope.row.unit}}</div>
115 126
                 </div>
116 127
               </template>
117 128
             </el-table-column>
118 129
             <el-table-column align="center" prop="name" width="50" label="单价">
119 130
               <template slot-scope="scope">
120
-                <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
131
+                <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
132
+                <span>{{ scope.row.price }}</span>
133
+
121 134
               </template>
122 135
             </el-table-column>
123
-            <el-table-column align="center" prop="name" width="50" label="备注">
136
+            <el-table-column align="center" prop="name" width="100" label="备注">
124 137
               <template slot-scope="scope">
125
-                <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
138
+                <!--<el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>-->
139
+                <span>{{ scope.row.remark }}</span>
140
+
126 141
               </template>
127 142
             </el-table-column>
128 143
           </el-table>
129
-
130
-        </el-checkbox>
144
+        </div>
131 145
       </el-checkbox-group>
132 146
 
133 147
     </div>
@@ -143,87 +157,255 @@
143 157
 </template>
144 158
 
145 159
 <script>
160
+  import { uParseTime } from '@/utils/tools'
161
+  import { getDictionaryDataConfig} from "@/utils/data";
162
+
163
+  import {
164
+    getNextOrLastHisPrescription
165
+  } from '@/api/his/his'
146 166
   export default {
147 167
     name: "nextOrLastPrescription",
148 168
     data() {
149 169
       return {
150
-        allPrescription:[
170
+        srcPrescriptions:[],
171
+        name:"",
172
+        request_record_date:'',
173
+        patient_id:0,
174
+         allPrescription: [
151 175
           {
152
-            title:"12333",
153
-            check_group:[],
154
-            prescriptions:[
176
+            check_group: [],
177
+            prescriptions: [
155 178
               {
156
-                id:5,
179
+                id: 5,
157 180
 
158
-                type:1,
159
-                doctor_advice:[],
160
-                project:[],
181
+                type: 1,
182
+                doctor_advice: [],
183
+                project: [],
161 184
               },
162 185
               {
163
-                id:8,
164
-                type:1,
165
-                doctor_advice:[],
166
-                project:[],
186
+                id: 8,
187
+                type: 1,
188
+                doctor_advice: [],
189
+                project: [],
167 190
               },
168 191
               {
169
-                id:6,
192
+                id: 6,
170 193
 
171
-                type:2,
172
-                doctor_advice:[],
173
-                project:[],
194
+                type: 2,
195
+                doctor_advice: [],
196
+                project: [],
174 197
               },
175 198
               {
176
-                id:7,
177
-                type:2,
178
-                doctor_advice:[],
179
-                project:[],
199
+                id: 7,
200
+                type: 2,
201
+                doctor_advice: [],
202
+                project: [],
180 203
               },
181 204
             ],
182 205
           }, {
183
-            title:"4567",
184
-            check_group:[],
185
-            prescriptions:[
206
+            check_group: [],
207
+            prescriptions: [
186 208
               {
187
-                id:1,
188
-                type:2,
189
-                doctor_advice:[],
190
-                project:[],
209
+                id: 1,
210
+                type: 2,
211
+                doctor_advice: [],
212
+                project: [],
191 213
               },
192 214
               {
193 215
 
194
-                id:2,
195
-                type:2,
196
-                doctor_advice:[],
197
-                project:[],
216
+                id: 2,
217
+                type: 2,
218
+                doctor_advice: [],
219
+                project: [],
198 220
               },
199 221
               {
200
-                id:3,
222
+                id: 3,
201 223
 
202
-                type:1,
203
-                doctor_advice:[],
204
-                project:[],
224
+                type: 1,
225
+                doctor_advice: [],
226
+                project: [],
205 227
               },
206 228
               {
207
-                id:4,
229
+                id: 4,
208 230
 
209
-                type:1,
210
-                doctor_advice:[],
211
-                project:[],
231
+                type: 1,
232
+                doctor_advice: [],
233
+                project: [],
212 234
               },
213 235
             ],
214 236
           }
215 237
         ],
216 238
 
217
-        isLastOrNextVisible: true,
239
+        isLastOrNextVisible: false,
218 240
 
219 241
       }
220
-    },methods:{
221
-      save(){
222
-        console.log(this.allPrescription)
223
-      }
242
+    }, methods: {
243
+      openLast(val) {
244
+       if (val == 3) {
245
+          let params = {
246
+            patient_id: this.patient_id,
247
+            record_time: this.request_record_date,
248
+            type: 1
249
+          }
224 250
 
251
+          this.GetNextOrLastHisPrescription(params)
225 252
 
253
+        }
254
+      },
255
+      openNext(val) {
256
+        if (val == 4) {
257
+          let params = {
258
+            patient_id: this.patient_id,
259
+            record_time: this.request_record_date,
260
+            type: 2
261
+          }
262
+          this.GetNextOrLastHisPrescription(params)
263
+        }
264
+      },
265
+      GetNextOrLastHisPrescription(params){
266
+        getNextOrLastHisPrescription(params).then(response => {
267
+          if (response.data.state == 1) {
268
+            this.allPrescription = response.data.data.prescriptions
269
+            for (let i = 0; i < this.allPrescription.length; i++){
270
+              this.allPrescription[i].check_group = []
271
+            }
272
+            this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
273
+          } else {
274
+            this.$message.error(response.data.msg)
226 275
 
276
+          }
277
+        })
278
+      },
279
+      save() {
280
+        let replace_one = []
281
+        let replace_two = []
282
+
283
+        let checkGroup = []
284
+        let allPrescriptions = []
285
+        let targetPrescriptions = []
286
+        let prescriptions = []
287
+        for (let i = 0; i < this.allPrescription.length; i++) {
288
+          for (let a = 0; a < this.allPrescription[i].check_group.length; a++) {
289
+            checkGroup.push(this.allPrescription[i].check_group[a])
290
+          }
291
+          for (let a = 0; a < this.allPrescription[i].prescriptions.length; a++) {
292
+            allPrescriptions.push(this.allPrescription[i].prescriptions[a])
293
+          }
294
+        }
295
+        for (let i = 0; i < allPrescriptions.length; i++){
296
+          for (let a = 0; a < checkGroup.length; a++){
297
+            if(allPrescriptions[i].id == checkGroup[a]){
298
+              targetPrescriptions.push(allPrescriptions[i])
299
+            }
300
+          }
301
+        }
302
+
303
+        if (targetPrescriptions.length > 0) {
304
+          for (let i = 0; i < targetPrescriptions.length; i++) {
305
+            var prescription = targetPrescriptions[i]
306
+            let tempAdvice = []
307
+            let tempProject = []
308
+            let tempAddition = []
309
+            for (let b = 0; b < prescription.doctor_advice.length; b++) {
310
+              let obj = {
311
+                advice_id: prescription.doctor_advice[b].id,
312
+                drug_name: prescription.doctor_advice[b].advice_name,
313
+                single_dose: prescription.doctor_advice[b].single_dose,
314
+                delivery_way: prescription.doctor_advice[b].delivery_way,
315
+                execution_frequency: prescription.doctor_advice[b].execution_frequency,
316
+                retail_price: prescription.doctor_advice[b].price.toString(),
317
+                remark: prescription.doctor_advice[b].remark,
318
+                day:prescription.doctor_advice[b].day,
319
+                prescribing_number:prescription.doctor_advice[b].prescribing_number.toString(),
320
+                single_dose_unit:prescription.doctor_advice[b].single_dose_unit,
321
+                prescribing_number_unit:prescription.doctor_advice[b].prescribing_number_unit,
322
+                medical_insurance_number:prescription.doctor_advice[b].med_list_codg,
323
+                id:prescription.doctor_advice[b].drug_id
324
+              }
325
+              tempAdvice.push(obj)
326
+
327
+            }
328
+
329
+
330
+            for (let b = 0; b < prescription.project.length; b++) {
331
+              let obj = {
332
+                id: prescription.project[b].id,
333
+                project_id: prescription.project[b].project_id,
334
+                project_name: prescription.project[b].project.project_name,
335
+                statistical_classification: prescription.project[b].project.statistical_classification,
336
+                single_dose: prescription.project[b].single_dose,
337
+                delivery_way: prescription.project[b].delivery_way,
338
+                execution_frequency: prescription.project[b].execution_frequency,
339
+                number_days: prescription.project[b].day,
340
+                total:prescription.project[b].count.toString(),
341
+                price:prescription.project[b].price,
342
+                remark:prescription.project[b].remark,
343
+                medical_code:prescription.project[b].project.medical_code,
344
+              }
345
+              tempProject.push(obj)
346
+            }
347
+            let obj = {
348
+              id: 0,
349
+              advices: tempAdvice,
350
+              project: tempProject,
351
+              addition:tempAddition,
352
+              order_status:0,
353
+              // type: type,
354
+            }
355
+            prescriptions.push(obj)
356
+          }
357
+        }
358
+
359
+        console.log(this.srcPrescriptions)
360
+
361
+        if(this.srcPrescriptions.length == 1){
362
+          if(this.srcPrescriptions[0].advices.length == 0 && this.srcPrescriptions[0].project.length == 0){
363
+            this.srcPrescriptions = []
364
+            this.srcPrescriptions = prescriptions
365
+            this.$emit('save', this.srcPrescriptions)
366
+          }else{
367
+
368
+            this.srcPrescriptions =  this.srcPrescriptions.concat(prescriptions)
369
+            this.$emit('save', this.srcPrescriptions)
370
+          }
371
+        }else{
372
+          this.srcPrescriptions =  this.srcPrescriptions.concat(prescriptions)
373
+          this.$emit('save', this.srcPrescriptions)
374
+        }
375
+
376
+
377
+
378
+      },show(prescriptions,name,id,srcPrescriptions){
379
+        this.srcPrescriptions = srcPrescriptions
380
+        this.patient_id = id
381
+        this.request_record_date = uParseTime(prescriptions[0].record_date, '{y}-{m}-{d}')
382
+        this.name = name
383
+        this.allPrescription = prescriptions
384
+        for (let i = 0; i < this.allPrescription.length; i++){
385
+          this.allPrescription[i].check_group = []
386
+        }
387
+        console.log(this.allPrescription)
388
+        this.isLastOrNextVisible = true
389
+      },close(){
390
+        this.isLastOrNextVisible = false
391
+      },hide(){
392
+        this.$emit('cancel')
393
+
394
+      },getTime(time, template){
395
+        return uParseTime(time,template)
396
+
397
+      }, getGroup(id){
398
+        var name = ""
399
+        var statistics_category =  getDictionaryDataConfig('system','statistics_category')
400
+        for(let i=0;i<statistics_category.length;i++){
401
+          if(id == statistics_category[i].id){
402
+            name = statistics_category[i].name
403
+          }
404
+        }
405
+        return name
406
+      },   getDictionaryDataConfig(module, filed_name) {
407
+        return getDictionaryDataConfig(module, filed_name)
408
+      },
227 409
     }
228 410
   }
229 411
 </script>

+ 8 - 5
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Dosyayı Görüntüle

@@ -46,6 +46,7 @@
46 46
           </el-tabs>
47 47
           <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子处方'">
48 48
             <el-button size="small" ref="button_one" @click="open(1)" type="primary" v-loading="saveLoading">保存</el-button>
49
+            <el-button size="small" ref="button_three" @click="open_two()" type="primary">处方调用</el-button>
49 50
             <el-popover
50 51
               placement="bottom"
51 52
               width="200"
@@ -53,8 +54,8 @@
53 54
               <el-button size="small" ref="button_two"   @click="open(2)">处方单</el-button>
54 55
               <el-button size="small" ref="button_six"   @click="open(6)">治疗单</el-button>
55 56
               <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
57
+
56 58
             </el-popover>
57
-            <!-- <el-button size="small" ref="button_three" @click="open(4)" type="primary">选择模板</el-button>-->
58 59
             <!--<el-button size="small" ref="button_four"  @click="open(5)" type="primary" :disabled='prescriptions && prescriptions[0].advices && prescriptions[0].project ? prescriptions[0].advices.length == 0 && prescriptions[0].project.length == 0 : false'>存模板</el-button> -->
59 60
           </div>
60 61
           <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子病历'">
@@ -508,7 +509,7 @@
508 509
                 this.case_history = response.data.data.case_history
509 510
                 var case_history = response.data.data.case_history
510 511
                 console.log("切换患者查询病历",case_history)
511
-               
512
+
512 513
                 this.case_history = case_history
513 514
                 this.info = response.data.data.info
514 515
                 this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
@@ -655,7 +656,7 @@
655 656
               this.case_history = response.data.data.case_history
656 657
               var case_history = response.data.data.case_history
657 658
               console.log("case_history22222222",case_history)
658
-             
659
+
659 660
               this.case_history = case_history
660 661
               this.info = response.data.data.info
661 662
               this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
@@ -787,7 +788,7 @@
787 788
 
788 789
       },
789 790
       currentChange(currentRow, oldCurrentRow){
790
-       
791
+
791 792
         let isShowDailog = false
792 793
         for (let i = 0; i < this.prescriptions.length; i++){
793 794
           if((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)){
@@ -800,6 +801,8 @@
800 801
         }
801 802
 
802 803
 
804
+      },open_two() {
805
+        this.$refs.prescriptions.open_two()
803 806
       },
804 807
       open(index) {
805 808
          if(this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0){
@@ -885,7 +888,7 @@
885 888
        // console.log("99999",this.selecting_schs)
886 889
       },
887 890
       handleClick(){
888
-       
891
+
889 892
       },
890 893
       savePrint(){
891 894
         var arr = []