Просмотр исходного кода

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

XMLWAN 4 лет назад
Родитель
Сommit
e45c1756ac

+ 12 - 25
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyFour.vue Просмотреть файл

@@ -242,16 +242,14 @@
242 242
                   </td> -->
243 243
                       <!-- <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td> -->
244 244
                       <td height="32px">
245
-                        <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{ getAdminUser(advice.advice_doctor) }}</span>
246
-                        <img style="height:30px;" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else />
245
+                        <span>{{ getAdminUser(advice.advice_doctor) }}</span>
247 246
                       </td>
248 247
                       <!-- <td height="35px">
249 248
                     <span v-if="setAdminUserES(advice.checker) == ''">{{getAdminUser(advice.checker)}}</span>
250 249
                     <img style="height:20px;" :src="setAdminUserES(advice.checker)" alt="" srcset="" v-else>
251 250
                   </td> -->
252 251
                       <td height="32px">
253
-                        <span v-if="setAdminUserES(advice.execution_staff) == ''">{{ getAdminUser(advice.execution_staff) }}</span>
254
-                        <img style="height:30px;" :src="setAdminUserES(advice.execution_staff)" alt="" srcset="" v-else />
252
+                        <span>{{ getAdminUser(advice.execution_staff) }}</span>
255 253
                       </td>
256 254
                       <td height="32px">
257 255
                         <span v-if="advice.execution_time">{{ getTime(advice.execution_time, "{h}:{i}") }}</span>
@@ -311,12 +309,9 @@
311 309
                             </div>
312 310
                         </td>
313 311
                         <td>
314
-                            <span v-if="setAdminUserES(monitor.monitoring_nurse) == ''">
312
+                            <span>
315 313
                                 {{ getAdminUser(monitor.monitoring_nurse) }}
316 314
                             </span>
317
-                            <span v-else style="display:flex;align-items:center;justify-content:space-around;height:36px;">
318
-                                <img style="height:30px;" :src="setAdminUserES(monitor.monitoring_nurse)" alt srcset />
319
-                            </span>
320 315
                         </td>
321 316
                     </tr>
322 317
                   </tbody>
@@ -364,48 +359,41 @@
364 359
                         <div class="inline_block">
365 360
                             预冲者
366 361
                             <div class="under_line" style="width: 70px;text-align: center">
367
-                                <span v-if="setAdminUserES(dialysisOrder==null?0:dialysisOrder.washpipe_nurse) == ''">{{getAdminUser(dialysisOrder==null?0:dialysisOrder.washpipe_nurse)}}</span>
368
-                                <img class="es-img" style="height:30px" :src="setAdminUserES(dialysisOrder==null?0:dialysisOrder.washpipe_nurse)" alt="" srcset="" v-else>
362
+                                <span>{{getAdminUser(dialysisOrder==null?0:dialysisOrder.washpipe_nurse)}}</span>
369 363
                             </div>
370 364
                         </div>
371 365
                         <div class="inline_block" style="margin-left:20px;">
372 366
                             穿刺者/换药者
373 367
                             <div class="under_line" style="width: 70px;text-align: center">
374
-                                <span v-if="setAdminUserES(dialysisOrder==null?0:dialysisOrder.puncture_nurse) == ''">{{getAdminUser(dialysisOrder==null?0:dialysisOrder.puncture_nurse)}}</span>
375
-                                <img class="es-img" style="height:30px" :src="setAdminUserES(dialysisOrder==null?0:dialysisOrder.puncture_nurse)" alt="" srcset="" v-else>
368
+                                <span>{{getAdminUser(dialysisOrder==null?0:dialysisOrder.puncture_nurse)}}</span>
376 369
                             </div>
377 370
                         </div>
378 371
                         <div class="inline_block" style="margin-left:20px;">
379 372
                             责任护士
380 373
                             <div class="under_line" style="width: 70px;text-align: center">
381
-                                <span v-if="setAdminUserES(dialysisOrder==null?0:dialysisOrder.start_nurse) == ''">{{getAdminUser(dialysisOrder==null?0:dialysisOrder.start_nurse)}}</span>
382
-                                <img class="es-img" style="height:30px" :src="setAdminUserES(dialysisOrder==null?0:dialysisOrder.start_nurse)" alt="" srcset="" v-else>
374
+                                <span>{{getAdminUser(dialysisOrder==null?0:dialysisOrder.start_nurse)}}</span>
383 375
                             </div>
384 376
                         </div>
385 377
                         <div class="inline_block" style="margin-left:20px;">
386 378
                             查对者
387 379
                             <div class="under_line" style="width: 70px;text-align: center">
388
-                                <span v-if="setAdminUserES(check == null ? 0 : check.creater) == ''">
380
+                                <span>
389 381
                                     {{ getAdminUser(check == null ? 0 : check.creater) }}
390 382
                                 </span>
391
-                                <img style="height:30px;" :src="setAdminUserES(check == null ? 0 : check.creater)" alt srcset v-else />
392 383
                             </div>
393 384
                         </div>
394 385
                         <div class="inline_block" style="margin-left:20px;">
395 386
                             交叉核对者
396 387
                             <div class="under_line" style="width: 70px;text-align: center">
397
-                                <span v-if="setAdminUserES(check == null ? 0 : check.modifier) == ''">
388
+                                <span>
398 389
                                 {{ getAdminUser(check == null ? 0 : check.modifier) }}
399 390
                                 </span>
400
-                                <img style="height:30px;" :src="setAdminUserES(check == null ? 0 : check.modifier)" alt srcset v-else />
401 391
                             </div>
402 392
                         </div>
403 393
                         <div class="inline_block" style="margin-left:20px;">
404 394
                             下机护士
405 395
                             <div class="under_line" style="width: 70px;text-align: center">
406
-                                <span v-if="setAdminUserES(dialysisOrder == null ? 0 : dialysisOrder.finish_nurse) == ''">
407
-                                    {{ getAdminUser(dialysisOrder == null ? 0 : dialysisOrder.finish_nurse) }}</span>
408
-                                <img class="es-img" style="height:30px" :src="setAdminUserES(dialysisOrder == null ? 0 : dialysisOrder.finish_nurse)" alt="" srcset="" v-else />
396
+                                <span>{{ getAdminUser(dialysisOrder == null ? 0 : dialysisOrder.finish_nurse) }}</span>
409 397
                             </div>
410 398
                         </div>
411 399
                         
@@ -424,10 +412,9 @@
424 412
         <div class="row" style="padding: 2px 0;line-height:30px; display:flex;">
425 413
             <div class="inline_block">
426 414
                 医生签字
427
-                <!-- <div class="under_line" style="width: 70px;text-align: center">
428
-                    <span v-if="setAdminUserES(prescription==null?0:(prescription.prescription_doctor?prescription.prescription_doctor:'')) == ''"> {{ getAdminUser(prescription==null?0:(prescription.prescription_doctor?prescription.prescription_doctor:'')) }} </span>
429
-                    <img style="height:30px;" :src="setAdminUserES(prescription==null?0:(prescription.prescription_doctor?prescription.prescription_doctor:''))" alt="" srcset="" v-else />
430
-                </div> -->
415
+                <div class="under_line" style="width: 70px;text-align: center">
416
+                    <span> {{ getAdminUser(prescription==null?0:(prescription.prescription_doctor?prescription.prescription_doctor:'')) }} </span>
417
+                </div>
431 418
             </div>
432 419
         </div>
433 420
       </div>

+ 2 - 1
src/xt_pages/outpatientCharges/components/registerDialog.vue Просмотреть файл

@@ -455,6 +455,7 @@
455 455
         return getDictionaryDataConfig(module, filed_name)
456 456
       },
457 457
       show: function () {
458
+        this.form = Object.assign({}, this.resetForm)
458 459
         // this.form.name = patientInfo.name
459 460
         // this.form.gender = patientInfo.gender
460 461
         // this.form.age = patientInfo.age
@@ -472,6 +473,7 @@
472 473
 
473 474
       }, hide: function () {
474 475
         this.visibility = false
476
+        this.$refs['formValue'].resetFields()
475 477
       }, cancel: function (formName) {
476 478
         this.$emit('cancel', this.getValue())
477 479
         this.$refs['formValue'].resetFields()
@@ -482,7 +484,6 @@
482 484
             let value = {}
483 485
             value = this.getValue()
484 486
             this.$emit('confirm', value)
485
-            this.form = Object.assign({}, this.resetForm)
486 487
           }
487 488
         })
488 489
       },

+ 21 - 0
src/xt_pages/outpatientCharges/summary.vue Просмотреть файл

@@ -85,6 +85,7 @@
85 85
         <el-table-column align="center" prop="name" label="操作">
86 86
           <template slot-scope="scope">
87 87
             <el-button size="mini" type="primary" @click="toDetail(scope.row)">详情</el-button>
88
+            <el-button size="mini" type="primary" @click="toPrint(scope.row)" v-if="$store.getters.xt_user.org_id == 9919 && scope.row.order_status == 2">结算单</el-button>
88 89
           </template>
89 90
         </el-table-column>
90 91
       </el-table>
@@ -102,6 +103,14 @@
102 103
       </el-pagination>
103 104
     </div>
104 105
 
106
+    <el-dialog
107
+      class="centerDialog"
108
+      width="1200px"
109
+      title="打印"
110
+      :visible.sync="statementVisible">
111
+      <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
112
+    </el-dialog>
113
+
105 114
 
106 115
   </div>
107 116
 </template>
@@ -111,6 +120,8 @@
111 120
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
112 121
   import { getHisOrderList,getDoctorList,getExportConsumeDetailList } from '@/api/his/his'
113 122
   import { uParseTime } from '@/utils/tools'
123
+  import statementPrint from './statementPrint'
124
+
114 125
 
115 126
   export default {
116 127
     components: {
@@ -118,6 +129,8 @@
118 129
     },
119 130
     data() {
120 131
       return {
132
+        orderObj: {},
133
+        statementVisible: false,
121 134
         crumbs: [
122 135
           { path: false, name: '门诊收费' },
123 136
           { path: false, name: '项目消费明细汇总' }
@@ -135,6 +148,14 @@
135 148
       }
136 149
     },
137 150
     methods: {
151
+      toPrint(row){
152
+        this.statementVisible = true
153
+        let obj = {
154
+          order_id: row.id
155
+        }
156
+        this.orderObj = obj
157
+
158
+      },
138 159
       export_detail(){
139 160
         let params= {
140 161
           start_time:this.start_time,

+ 226 - 45
src/xt_pages/outpatientCharges/summaryDetail.vue Просмотреть файл

@@ -78,7 +78,7 @@
78 78
 
79 79
                     </div>
80 80
                     <div class="costBox">
81
-                      <span>当前处方总费用:<span style="color:red;">{{ order.medfee_sumamt }}元</span></span>
81
+                      <span>当前处方总费用:<span style="color:red;">{{ order.medfee_sumamt}}元</span></span>
82 82
                       <span v-if="order.order_status == 1">待结算</span>
83 83
                       <span v-if="order.order_status == 2">已结算</span>
84 84
                       <span v-if="order.order_status == 3">已退费</span>
@@ -165,6 +165,33 @@ export default {
165 165
     },created(){
166 166
       this.GetOrderDetail()
167 167
   },methods:{
168
+    // getTotal() {
169
+    //   var total = 0
170
+    //   for (let i = 0; i < this.prescriptions.length; i++) {
171
+    //     if (this.prescriptions[i].advices != null) {
172
+    //       for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
173
+    //         console.log(this.prescriptions[i].advices[a].price )
174
+    //         console.log(this.prescriptions[i].advices[a].prescribing_number)
175
+    //
176
+    //         total = parseFloat(total) + parseFloat(this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number)
177
+    //       }
178
+    //     }
179
+    //     if (this.prescriptions[i].project != null) {
180
+    //       for (let a = 0; a < this.prescriptions[i].project.length; a++) {
181
+    //
182
+    //         total = parseFloat(total) + parseFloat(this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count)
183
+    //       }
184
+    //     }
185
+    //
186
+    //     if (this.prescriptions[i].addition != null) {
187
+    //       for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
188
+    //         total = parseFloat(total) + parseFloat(this.prescriptions[i].addition[a].price * this.prescriptions[i].addition[b].count)
189
+    //       }
190
+    //     }
191
+    //   }
192
+    //   return total.toFixed(2)
193
+    //
194
+    // },
168 195
     getDictionaryDataConfig(module, filed_name) {
169 196
       return getDictionaryDataConfig(module, filed_name)
170 197
     },
@@ -221,7 +248,155 @@ export default {
221 248
       if (tab == 'more') {
222 249
         return false
223 250
       }
251
+    },   setMonthPrescription(month_prescriptions) {
252
+      console.log(month_prescriptions)
253
+      let drug_month_prescriptions = {
254
+        advices: []
255
+      }
256
+      let drug_ids = []
257
+      let project_month_prescriptions = {
258
+        project: []
259
+
260
+      }
261
+      let project_ids = []
262
+
263
+      let addition_month_prescriptions = {
264
+        addition: []
265
+
266
+      }
267
+      let additions_ids = []
268
+
269
+      for (let i = 0; i < month_prescriptions.length; i++) {
270
+        if (month_prescriptions[i].type == 1) { //药品
271
+          for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
272
+            let obj = {
273
+              id: month_prescriptions[i].advices[a].drug_id,
274
+              price: month_prescriptions[i].advices[a].price
275
+
276
+            }
277
+            drug_ids.push(obj)
278
+            drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
279
+          }
280
+
281
+        } else if (month_prescriptions[i].type == 2) { //项目
282
+          for (let a = 0; a < month_prescriptions[i].project.length; a++) {
283
+            let obj = {
284
+              id: month_prescriptions[i].project[a].project_id,
285
+              price: month_prescriptions[i].project[a].price
286
+
287
+            }
288
+            project_ids.push(obj)
289
+            project_month_prescriptions.project.push(month_prescriptions[i].project[a])
290
+          }
291
+        }
292
+        //附加收费
293
+        for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
294
+          let obj = {
295
+            id: month_prescriptions[i].addition[a].item_id,
296
+            price: month_prescriptions[i].addition[a].price
297
+
298
+          }
299
+          additions_ids.push(obj)
300
+          addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
301
+
302
+        }
303
+
304
+      }
305
+      console.log(drug_ids)
306
+      console.log(project_ids)
307
+      console.log(additions_ids)
308
+
309
+
310
+
311
+      const obj = {}
312
+      const obj1 = {}
313
+      const obj2 = {}
314
+
315
+      drug_ids = drug_ids.reduce((cur, next) => {
316
+        obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
317
+        return cur
318
+      }, []) // 设置cur默认类型为数组,并且初始值为空的数组
319
+      project_ids = project_ids.reduce((cur, next) => {
320
+        obj1[next.price] ? '' : obj1[next.price] = true && cur.push(next)
321
+        return cur
322
+      }, []) // 设置cur默认类型为数组,并且初始值为空的数组
323
+      additions_ids = additions_ids.reduce((cur, next) => {
324
+        obj2[next.price] ? '' : obj2[next.price] = true && cur.push(next)
325
+        return cur
326
+      }, []) // 设置cur默认类型为数组,并且初始值为空的数组
327
+
328
+
329
+
330
+
331
+      for (let i = 0; i < drug_ids.length; i++) {
332
+        let obj = {}
333
+        let count = 0
334
+        for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
335
+          if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
336
+            obj['name'] = drug_month_prescriptions.advices[a].advice_name
337
+            obj['statistical_classification'] = ''
338
+            obj['type'] = 1
339
+            obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
340
+            obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
341
+            obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
342
+            obj['day'] = drug_month_prescriptions.advices[a].day
343
+            obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
344
+            obj['remark'] = drug_month_prescriptions.advices[a].remark
345
+            obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
346
+            count = count + drug_month_prescriptions.advices[a].prescribing_number
347
+
348
+          }
349
+        }
350
+        obj['count'] = count
351
+        this.tableData.push(obj)
352
+      }
353
+
354
+      for (let i = 0; i < project_ids.length; i++) {
355
+        let obj = {}
356
+        let count = 0
357
+        for (let a = 0; a < project_month_prescriptions.project.length; a++) {
358
+          if (project_ids[i].price == project_month_prescriptions.project[a].price) {
359
+            obj['name'] = project_month_prescriptions.project[a].project.project_name
360
+            obj['statistical_classification'] = ''
361
+            obj['single_dose'] = project_month_prescriptions.project[a].single_dose
362
+            obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
363
+            obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
364
+            obj['day'] = project_month_prescriptions.project[a].day
365
+            obj['single_dose_unit'] = project_month_prescriptions.project[a].unit
366
+            obj['prescribing_number_unit'] = project_month_prescriptions.project[a].unit
367
+            count = count + project_month_prescriptions.project[a].count
368
+            obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
369
+            obj['remark'] = project_month_prescriptions.project[a].remark
370
+            obj['type'] = 2
371
+
372
+
373
+          }
374
+        }
375
+        obj['count'] = count
376
+        this.tableData.push(obj)
377
+
378
+      }
379
+
380
+      for (let i = 0; i < additions_ids.length; i++) {
381
+        let obj = {}
382
+        let count = 0
383
+        console.log(addition_month_prescriptions.addition)
384
+        if (addition_month_prescriptions.addition) {
385
+          for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
386
+            if (additions_ids[i].price == addition_month_prescriptions.addition[a].price) {
387
+              obj['item_name'] = addition_month_prescriptions.addition[a].item_name
388
+              count = count + addition_month_prescriptions.addition[a].count
389
+              obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
390
+            }
391
+          }
392
+          obj['count'] = count
393
+          this.additions.push(obj)
394
+
395
+        }
396
+      }
397
+
224 398
     },
399
+
225 400
     GetOrderDetail(){
226 401
       let params={
227 402
         number:this.$route.query.number,
@@ -240,50 +415,56 @@ export default {
240 415
           this.prescriptions = []
241 416
           this.tableData = []
242 417
 
243
-          for (let i = 0; i < response.data.data.prescription.length; i++) {
244
-            var prescription = response.data.data.prescription[i]
245
-
246
-
247
-            for (let b = 0; b < prescription.advices.length; b++) {
248
-              let obj = {
249
-                name: prescription.advices[b].advice_name,
250
-                statistical_classification:"",
251
-                type:1,
252
-                single_dose: prescription.advices[b].single_dose,
253
-                delivery_way: prescription.advices[b].delivery_way,
254
-                execution_frequency: prescription.advices[b].execution_frequency,
255
-                price: prescription.advices[b].price.toString(),
256
-                day: prescription.advices[b].day,
257
-                count:prescription.advices[b].prescribing_number.toString(),
258
-                remark: prescription.advices[b].remark,
259
-                single_dose_unit: prescription.advices[b].single_dose_unit,
260
-                prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
261
-
262
-              }
263
-              this.tableData.push(obj)
264
-            }
265
-
266
-            for (let b = 0; b < prescription.project.length; b++) {
267
-              let obj = {
268
-                name: prescription.project[b].project.project_name,
269
-                statistical_classification: prescription.project[b].project.statistical_classification,
270
-                single_dose: prescription.project[b].single_dose,
271
-                delivery_way: prescription.project[b].delivery_way,
272
-                execution_frequency: prescription.project[b].execution_frequency,
273
-                price: prescription.project[b].price,
274
-                day: prescription.project[b].day,
275
-                count: prescription.project[b].count.toString(),
276
-                remark: prescription.project[b].remark,
277
-                single_dose_unit:prescription.project[b].project.unit,
278
-                prescribing_number_unit:prescription.project[b].project.unit,
279
-                type:2,
280
-              }
281
-              this.tableData.push(obj)
282
-            }
283 418
 
284
-            for (let b = 0; b < prescription.addition.length; b++) {
285
-                this.additions.push( prescription.addition[b])
286
-            }
419
+          var prescription = response.data.data.prescription
420
+          this.prescriptions = prescription
421
+          this.setMonthPrescription(prescription)
422
+
423
+
424
+          // for (let i = 0; i < response.data.data.prescription.length; i++) {
425
+          //   var prescription = response.data.data.prescription[i]
426
+
427
+
428
+            // for (let b = 0; b < prescription.advices.length; b++) {
429
+            //   let obj = {
430
+            //     name: prescription.advices[b].advice_name,
431
+            //     statistical_classification:"",
432
+            //     type:1,
433
+            //     single_dose: prescription.advices[b].single_dose,
434
+            //     delivery_way: prescription.advices[b].delivery_way,
435
+            //     execution_frequency: prescription.advices[b].execution_frequency,
436
+            //     price: prescription.advices[b].price.toString(),
437
+            //     day: prescription.advices[b].day,
438
+            //     count:prescription.advices[b].prescribing_number.toString(),
439
+            //     remark: prescription.advices[b].remark,
440
+            //     single_dose_unit: prescription.advices[b].single_dose_unit,
441
+            //     prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
442
+            //
443
+            //   }
444
+            //   this.tableData.push(obj)
445
+            // }
446
+            //
447
+            // for (let b = 0; b < prescription.project.length; b++) {
448
+            //   let obj = {
449
+            //     name: prescription.project[b].project.project_name,
450
+            //     statistical_classification: prescription.project[b].project.statistical_classification,
451
+            //     single_dose: prescription.project[b].single_dose,
452
+            //     delivery_way: prescription.project[b].delivery_way,
453
+            //     execution_frequency: prescription.project[b].execution_frequency,
454
+            //     price: prescription.project[b].price,
455
+            //     day: prescription.project[b].day,
456
+            //     count: prescription.project[b].count.toString(),
457
+            //     remark: prescription.project[b].remark,
458
+            //     single_dose_unit:prescription.project[b].project.unit,
459
+            //     prescribing_number_unit:prescription.project[b].project.unit,
460
+            //     type:2,
461
+            //   }
462
+            //   this.tableData.push(obj)
463
+            // }
464
+            //
465
+            // for (let b = 0; b < prescription.addition.length; b++) {
466
+            //     this.additions.push( prescription.addition[b])
467
+            // }
287 468
 
288 469
 
289 470
 
@@ -298,7 +479,7 @@ export default {
298 479
             // this.prescriptions.push(obj)
299 480
             // this.curPrescriptions = this.prescriptions[0]
300 481
 
301
-          }
482
+          // }
302 483
           // this.tableData = response.data.data.order
303 484
 
304 485
         }

Разница между файлами не показана из-за своего большого размера
+ 336 - 182
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue


+ 253 - 70
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Просмотреть файл

@@ -325,46 +325,70 @@
325 325
           }
326 326
         })
327 327
       },
328
-      setMonthPrescription(month_prescriptions){
328
+      setMonthPrescription(month_prescriptions) {
329
+        console.log("11111111")
330
+        console.log(month_prescriptions)
331
+
332
+
333
+        this.month_prescriptions = []
334
+
329 335
         let drug_month_prescriptions = {
330
-          advices:[],
336
+          advices: []
331 337
         }
332
-        let drug_ids=[]
333
-        let project_month_prescriptions ={
334
-          project:[],
338
+        let drug_ids = []
339
+        let project_month_prescriptions = {
340
+          project: []
335 341
 
336 342
         }
337
-        let project_ids=[]
343
+        let project_ids = []
338 344
 
339
-        let addition_month_prescriptions ={
340
-          addtions:[],
345
+        let addition_month_prescriptions = {
346
+          addition: []
341 347
 
342 348
         }
343
-        let additions_ids=[]
349
+        let additions_ids = []
344 350
 
351
+        for (let i = 0; i < month_prescriptions.length; i++) {
352
+          if (month_prescriptions[i].type == 1) { //药品
353
+            for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
354
+              let obj = {
355
+                id: month_prescriptions[i].advices[a].drug_id,
356
+                price:month_prescriptions[i].advices[a].price,
345 357
 
346
-        for (let i = 0; i < month_prescriptions.length; i++){
347
-          if(month_prescriptions[i].type == 1){ //药品
348
-            for (let a = 0; a < month_prescriptions[i].advices.length; a++){
349
-              drug_ids.push(month_prescriptions[i].advices[a].drug_id)
358
+              }
359
+              drug_ids.push(obj)
350 360
               drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
351 361
             }
352 362
 
353
-          }else if(month_prescriptions[i].type == 2){ //项目
354
-            for (let a = 0; a < month_prescriptions[i].project.length; a++){
355
-              project_ids.push(month_prescriptions[i].project[a].project_id)
363
+          } else if (month_prescriptions[i].type == 2) { //项目
364
+            for (let a = 0; a < month_prescriptions[i].project.length; a++) {
365
+              let obj = {
366
+                id: month_prescriptions[i].project[a].project_id,
367
+                price:month_prescriptions[i].project[a].price,
368
+
369
+              }
370
+              project_ids.push(obj)
356 371
               project_month_prescriptions.project.push(month_prescriptions[i].project[a])
357 372
             }
358 373
           }
359 374
           //附加收费
360 375
           for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
361
-            additions_ids.push(month_prescriptions[i].addition[a].item_id)
362
-            addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
363
-          }
376
+            let obj = {
377
+              id: month_prescriptions[i].addition[a].item_id,
378
+              price:month_prescriptions[i].addition[a].price,
364 379
 
365
-        }
380
+            }
381
+            additions_ids.push(obj)
382
+            addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
366 383
 
384
+          }
367 385
 
386
+        }
387
+        console.log("00000000000000")
388
+        console.log(drug_ids)
389
+        console.log(project_ids)
390
+        console.log(additions_ids)
391
+        console.log("00000000000000")
368 392
 
369 393
 
370 394
         const obj = {}
@@ -372,119 +396,278 @@
372 396
         const obj2 = {}
373 397
 
374 398
         drug_ids = drug_ids.reduce((cur, next) => {
375
-          obj[next] ? '' : obj[next] = true && cur.push(next)
399
+          obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
376 400
           return cur
377 401
         }, []) // 设置cur默认类型为数组,并且初始值为空的数组
378 402
         project_ids = project_ids.reduce((cur, next) => {
379
-          obj1[next] ? '' : obj1[next] = true && cur.push(next)
403
+            obj[next.price] ? '' : obj[next.price] = true &&  cur.push(next)
380 404
           return cur
381 405
         }, []) // 设置cur默认类型为数组,并且初始值为空的数组
382 406
         additions_ids = additions_ids.reduce((cur, next) => {
383
-          obj2[next] ? '' : obj2[next] = true && cur.push(next)
407
+          obj[next.price] ? '' : obj[next.price] = true  && cur.push(next)
384 408
           return cur
385 409
         }, []) // 设置cur默认类型为数组,并且初始值为空的数组
386 410
 
387 411
 
388 412
 
413
+        let drugs = []
414
+        let projects = []
415
+        let additions = []
389 416
 
390
-
391
-        let drugs =[]
392
-        let projects =[]
393
-        let additions =[]
394
-
395
-
396
-        for (let i = 0; i < drug_ids.length; i++){
417
+        for (let i = 0; i < drug_ids.length; i++) {
397 418
           let obj = {}
398
-          let price = 0
399 419
           let count = 0
400
-          for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
401
-            if(drug_ids[i] ==  drug_month_prescriptions.advices[a].drug_id){
420
+          for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
421
+            if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
402 422
               obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
403 423
               obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
404 424
               obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
405 425
               obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
406 426
               obj['day'] = drug_month_prescriptions.advices[a].day
407 427
               // obj['prescribing_number'] =  obj['prescribing_number']  + drug_month_prescriptions.advices[a].prescribing_number
408
-              obj['prescribing_number_unit'] =  drug_month_prescriptions.advices[a].prescribing_number_unit
409
-              obj['medical_insurance_number'] =  drug_month_prescriptions.advices[a].drug.medical_insurance_number
410
-              obj['id'] =  drug_month_prescriptions.advices[a].drug_id
428
+              obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
429
+              obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
430
+              obj['id'] = drug_month_prescriptions.advices[a].drug_id
411 431
               // obj['retail_price'] = obj['retail_price'] +  drug_month_prescriptions.advices[a].drug.retail_price
412
-
413
-
414
-              count = count +  drug_month_prescriptions.advices[a].prescribing_number
415
-              price = price +   drug_month_prescriptions.advices[a].price
432
+              obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
433
+              count = count + drug_month_prescriptions.advices[a].prescribing_number
416 434
 
417 435
             }
418 436
           }
419
-          obj['retail_price'] = price
420 437
           obj['prescribing_number'] = count
421 438
           drugs.push(obj)
422 439
         }
423 440
 
424
-
425
-
426
-
427
-        for (let i = 0; i < project_ids.length; i++){
441
+        for (let i = 0; i < project_ids.length; i++) {
428 442
           let obj = {}
429
-          let price = 0
430 443
           let count = 0
431
-          for (let a = 0; a < project_month_prescriptions.project.length; a++){
432
-            if(project_ids[i] ==  project_month_prescriptions.project[a].project_id){
444
+          for (let a = 0; a < project_month_prescriptions.project.length; a++) {
445
+            if (project_ids[i].price == project_month_prescriptions.project[a].price) {
433 446
               obj['project_name'] = project_month_prescriptions.project[a].project.project_name
434 447
               obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
435 448
               obj['single_dose'] = project_month_prescriptions.project[a].single_dose
436 449
               obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
437 450
               obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
438 451
               obj['number_days'] = project_month_prescriptions.project[a].day
439
-              obj['medical_code'] =  project_month_prescriptions.project[a].project.medical_code
440
-              obj['unit'] =  project_month_prescriptions.project[a].unit
441
-              obj['project_id'] =  project_month_prescriptions.project[a].project_id
442
-              count = count +  project_month_prescriptions.project[a].count
443
-              price = price +   project_month_prescriptions.project[a].price
452
+              obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
453
+              obj['unit'] = project_month_prescriptions.project[a].unit
454
+              obj['project_id'] = project_month_prescriptions.project[a].project_id
455
+              count = count + project_month_prescriptions.project[a].count
456
+              // price = price + project_month_prescriptions.project[a].price
457
+              obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
458
+
444 459
             }
445 460
           }
446
-          obj['price'] = price
447 461
           obj['total'] = count
448 462
           projects.push(obj)
449 463
         }
450 464
 
451
-
452
-        for (let i = 0; i < additions_ids.length; i++){
465
+        for (let i = 0; i < additions_ids.length; i++) {
453 466
           let obj = {}
454
-          let price = 0
455 467
           let count = 0
456
-          for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
457
-            if(project_ids[i] ==  addition_month_prescriptions.addition[a].item_id){
458
-              obj['item_name'] = addition_month_prescriptions.addition[a].item_name
459
-              obj['id'] = addition_month_prescriptions.addition[a].id
460
-              obj['item_id'] =  addition_month_prescriptions.addition[a].item_id
461
-              count = count +  addition_month_prescriptions.addition[a].count
462
-              price = price +   addition_month_prescriptions.addition[a].price
468
+          console.log(addition_month_prescriptions.addition)
469
+          if (addition_month_prescriptions.addition) {
470
+            for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
471
+              if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
472
+                obj['item_name'] = addition_month_prescriptions.addition[a].item_name
473
+                obj['id'] = addition_month_prescriptions.addition[a].id
474
+                obj['item_id'] = addition_month_prescriptions.addition[a].item_id
475
+                count = count + addition_month_prescriptions.addition[a].count
476
+                obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
477
+              }
463 478
             }
479
+            obj['count'] = count
480
+            additions.push(obj)
464 481
           }
465
-          obj['price'] = price
466
-          obj['count'] = count
467
-          additions.push(obj)
468 482
         }
469 483
 
484
+        console.log(drugs)
485
+        console.log(projects)
486
+        console.log(additions)
470 487
 
471 488
         let p1 = {
472 489
           name: '处方' + 1,
473 490
           advices: drugs,
474 491
           project: [],
475
-          type:1,
476
-          addition: additions,
492
+          type: 1,
493
+          addition: additions
477 494
         }
478 495
         let p2 = {
479 496
           name: '处方' + 2,
480
-          type:2,
497
+          type: 2,
481 498
           project: projects,
482 499
           advices: [],
500
+          addition: []
501
+
483 502
         }
503
+
484 504
         this.month_prescriptions.push(p1)
485 505
         this.month_prescriptions.push(p2)
486 506
 
507
+        this.curMonthPrescriptions = this.month_prescriptions[0]
508
+
487 509
       },
510
+
511
+      // setMonthPrescription(month_prescriptions){
512
+      //   let drug_month_prescriptions = {
513
+      //     advices:[],
514
+      //   }
515
+      //   let drug_ids=[]
516
+      //   let project_month_prescriptions ={
517
+      //     project:[],
518
+      //
519
+      //   }
520
+      //   let project_ids=[]
521
+      //
522
+      //   let addition_month_prescriptions ={
523
+      //     addtions:[],
524
+      //
525
+      //   }
526
+      //   let additions_ids=[]
527
+      //
528
+      //
529
+      //   for (let i = 0; i < month_prescriptions.length; i++){
530
+      //     if(month_prescriptions[i].type == 1){ //药品
531
+      //       for (let a = 0; a < month_prescriptions[i].advices.length; a++){
532
+      //         drug_ids.push(month_prescriptions[i].advices[a].drug_id)
533
+      //         drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
534
+      //       }
535
+      //
536
+      //     }else if(month_prescriptions[i].type == 2){ //项目
537
+      //       for (let a = 0; a < month_prescriptions[i].project.length; a++){
538
+      //         project_ids.push(month_prescriptions[i].project[a].project_id)
539
+      //         project_month_prescriptions.project.push(month_prescriptions[i].project[a])
540
+      //       }
541
+      //     }
542
+      //     //附加收费
543
+      //     for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
544
+      //       additions_ids.push(month_prescriptions[i].addition[a].item_id)
545
+      //       addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
546
+      //     }
547
+      //
548
+      //   }
549
+      //
550
+      //
551
+      //
552
+      //
553
+      //   const obj = {}
554
+      //   const obj1 = {}
555
+      //   const obj2 = {}
556
+      //
557
+      //   drug_ids = drug_ids.reduce((cur, next) => {
558
+      //     obj[next] ? '' : obj[next] = true && cur.push(next)
559
+      //     return cur
560
+      //   }, []) // 设置cur默认类型为数组,并且初始值为空的数组
561
+      //   project_ids = project_ids.reduce((cur, next) => {
562
+      //     obj1[next] ? '' : obj1[next] = true && cur.push(next)
563
+      //     return cur
564
+      //   }, []) // 设置cur默认类型为数组,并且初始值为空的数组
565
+      //   additions_ids = additions_ids.reduce((cur, next) => {
566
+      //     obj2[next] ? '' : obj2[next] = true && cur.push(next)
567
+      //     return cur
568
+      //   }, []) // 设置cur默认类型为数组,并且初始值为空的数组
569
+      //
570
+      //
571
+      //
572
+      //
573
+      //
574
+      //   let drugs =[]
575
+      //   let projects =[]
576
+      //   let additions =[]
577
+      //
578
+      //
579
+      //   for (let i = 0; i < drug_ids.length; i++){
580
+      //     let obj = {}
581
+      //     let price = 0
582
+      //     let count = 0
583
+      //     for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
584
+      //       if(drug_ids[i] ==  drug_month_prescriptions.advices[a].drug_id){
585
+      //         obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
586
+      //         obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
587
+      //         obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
588
+      //         obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
589
+      //         obj['day'] = drug_month_prescriptions.advices[a].day
590
+      //         // obj['prescribing_number'] =  obj['prescribing_number']  + drug_month_prescriptions.advices[a].prescribing_number
591
+      //         obj['prescribing_number_unit'] =  drug_month_prescriptions.advices[a].prescribing_number_unit
592
+      //         obj['medical_insurance_number'] =  drug_month_prescriptions.advices[a].drug.medical_insurance_number
593
+      //         obj['id'] =  drug_month_prescriptions.advices[a].drug_id
594
+      //         // obj['retail_price'] = obj['retail_price'] +  drug_month_prescriptions.advices[a].drug.retail_price
595
+      //
596
+      //
597
+      //         count = count +  drug_month_prescriptions.advices[a].prescribing_number
598
+      //         price = price +   drug_month_prescriptions.advices[a].price
599
+      //
600
+      //       }
601
+      //     }
602
+      //     obj['retail_price'] = price
603
+      //     obj['prescribing_number'] = count
604
+      //     drugs.push(obj)
605
+      //   }
606
+      //
607
+      //
608
+      //
609
+      //
610
+      //   for (let i = 0; i < project_ids.length; i++){
611
+      //     let obj = {}
612
+      //     let price = 0
613
+      //     let count = 0
614
+      //     for (let a = 0; a < project_month_prescriptions.project.length; a++){
615
+      //       if(project_ids[i] ==  project_month_prescriptions.project[a].project_id){
616
+      //         obj['project_name'] = project_month_prescriptions.project[a].project.project_name
617
+      //         obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
618
+      //         obj['single_dose'] = project_month_prescriptions.project[a].single_dose
619
+      //         obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
620
+      //         obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
621
+      //         obj['number_days'] = project_month_prescriptions.project[a].day
622
+      //         obj['medical_code'] =  project_month_prescriptions.project[a].project.medical_code
623
+      //         obj['unit'] =  project_month_prescriptions.project[a].unit
624
+      //         obj['project_id'] =  project_month_prescriptions.project[a].project_id
625
+      //         count = count +  project_month_prescriptions.project[a].count
626
+      //         price = price +   project_month_prescriptions.project[a].price
627
+      //       }
628
+      //     }
629
+      //     obj['price'] = price
630
+      //     obj['total'] = count
631
+      //     projects.push(obj)
632
+      //   }
633
+      //
634
+      //
635
+      //   for (let i = 0; i < additions_ids.length; i++){
636
+      //     let obj = {}
637
+      //     let price = 0
638
+      //     let count = 0
639
+      //     for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
640
+      //       if(project_ids[i] ==  addition_month_prescriptions.addition[a].item_id){
641
+      //         obj['item_name'] = addition_month_prescriptions.addition[a].item_name
642
+      //         obj['id'] = addition_month_prescriptions.addition[a].id
643
+      //         obj['item_id'] =  addition_month_prescriptions.addition[a].item_id
644
+      //         count = count +  addition_month_prescriptions.addition[a].count
645
+      //         price = price +   addition_month_prescriptions.addition[a].price
646
+      //       }
647
+      //     }
648
+      //     obj['price'] = price
649
+      //     obj['count'] = count
650
+      //     additions.push(obj)
651
+      //   }
652
+      //
653
+      //
654
+      //   let p1 = {
655
+      //     name: '处方' + 1,
656
+      //     advices: drugs,
657
+      //     project: [],
658
+      //     type:1,
659
+      //     addition: additions,
660
+      //   }
661
+      //   let p2 = {
662
+      //     name: '处方' + 2,
663
+      //     type:2,
664
+      //     project: projects,
665
+      //     advices: [],
666
+      //   }
667
+      //   this.month_prescriptions.push(p1)
668
+      //   this.month_prescriptions.push(p2)
669
+      //
670
+      // },
488 671
       getList() {
489 672
         let params = {
490 673
           'record_date': this.record_date,