Bläddra i källkod

518合并代码

XMLWAN 3 år sedan
förälder
incheckning
bc10b766d2

+ 6 - 8
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue Visa fil

1372
       }
1372
       }
1373
       ,
1373
       ,
1374
       submitAdvice() {
1374
       submitAdvice() {
1375
-        console.log("保存111111111111111111111")
1376
         if (this.form.advice_name.length == 0) {
1375
         if (this.form.advice_name.length == 0) {
1377
           this.$message.error('请填写医嘱名称')
1376
           this.$message.error('请填写医嘱名称')
1378
           return
1377
           return
1387
         }
1386
         }
1388
         let mode = '1'
1387
         let mode = '1'
1389
 
1388
 
1390
-        console.log("==this.form==",this.form)
1391
-        console.log("==this.src_type==",this.src_type)
1392
-
1393
        if(this.src_type == ""){
1389
        if(this.src_type == ""){
1394
           this.form.way = 1
1390
           this.form.way = 1
1395
        }
1391
        }
1398
           var arr = this.form.advice_name.split("(自备药)")
1394
           var arr = this.form.advice_name.split("(自备药)")
1399
           this.form.advice_name = arr[0]
1395
           this.form.advice_name = arr[0]
1400
        }
1396
        }
1401
-
1397
+        console.log("保存重要23233232322332",this.form.parent_id)
1402
         CreateDoctorAdvice(this.patient.id, this.form, mode).then(response => {
1398
         CreateDoctorAdvice(this.patient.id, this.form, mode).then(response => {
1403
-          console("保存!!!!!!!!!!!!!!!this.form")
1404
             this.loading = false
1399
             this.loading = false
1405
             if (response.data.state == 0) {
1400
             if (response.data.state == 0) {
1406
               this.$message.error(response.data.msg)
1401
               this.$message.error(response.data.msg)
1417
               this.currentRow = null
1412
               this.currentRow = null
1418
               this.setCurrent()
1413
               this.setCurrent()
1419
               this.hideForm()
1414
               this.hideForm()
1420
-              console.log("保存",this.form.parent_id)
1415
+              console.log("parnet_i233232233223",this.form.parent_id)
1421
               if (this.form.parent_id > 0) {
1416
               if (this.form.parent_id > 0) {
1417
+                
1422
                 var spliceIndex = -1
1418
                 var spliceIndex = -1
1419
+                console.log("splicinde2332323232323223",spliceIndex)
1423
                 for (let index = this.doctor_advices.length - 1; ; index--) {
1420
                 for (let index = this.doctor_advices.length - 1; ; index--) {
1424
-                  console.log("====this.doctor_advices[index].origin====",this.doctor_advices[index].origin)
1425
                   if (this.doctor_advices[index].parent_id === this.form.parent_id) {
1421
                   if (this.doctor_advices[index].parent_id === this.form.parent_id) {
1426
                     spliceIndex = index
1422
                     spliceIndex = index
1427
                     break
1423
                     break
1430
                     break
1426
                     break
1431
                   }
1427
                   }
1432
                 }
1428
                 }
1429
+               console.log("splicinde2332323232323223",spliceIndex)
1433
                 if (spliceIndex > -1) {
1430
                 if (spliceIndex > -1) {
1434
                   spliceIndex += 1
1431
                   spliceIndex += 1
1435
                   if (spliceIndex === this.doctor_advices.length) {
1432
                   if (spliceIndex === this.doctor_advices.length) {
1442
                     }
1439
                     }
1443
                   }
1440
                   }
1444
                 }
1441
                 }
1442
+               
1445
               } else {
1443
               } else {
1446
                 this.doctor_advices.unshift(response.data.data.advice)
1444
                 this.doctor_advices.unshift(response.data.data.advice)
1447
               }
1445
               }

+ 2 - 2
src/xt_pages/outpatientTool/components/detailStatistics.vue Visa fil

297
                 }
297
                 }
298
               } 
298
               } 
299
             }
299
             }
300
-            console.log("项目new_arr",new_arr)
300
+            // console.log("项目new_arr",new_arr)
301
             this.tableData = []
301
             this.tableData = []
302
             obj.total_price = this.getPrice(new_arr)
302
             obj.total_price = this.getPrice(new_arr)
303
             // console.log("ar3233223232",new_arr)
303
             // console.log("ar3233223232",new_arr)
322
             this.tableData = new_arr
322
             this.tableData = new_arr
323
           }      
323
           }      
324
           
324
           
325
-          console.log("hh233223233232323232322332",this.tableData)
325
+          // console.log("hh233223233232323232322332",this.tableData)
326
        }
326
        }
327
      })
327
      })
328
     },
328
     },

Filskillnaden har hållits tillbaka eftersom den är för stor
+ 477 - 410
src/xt_pages/outpatientTool/components/gatherStatistics.vue


+ 320 - 373
src/xt_pages/outpatientTool/gatherPrint.vue Visa fil

9
             <div>医疗机构名称:{{$store.getters.xt_user.org.org_name}}</div>
9
             <div>医疗机构名称:{{$store.getters.xt_user.org.org_name}}</div>
10
         </div>
10
         </div>
11
         <div class="listInfo">
11
         <div class="listInfo">
12
-            <div>科别:{{getDepartment(his_patient.departments)}}</div>
12
+            <div>科别:{{getDepartment(his_patient.departments)}}
13
+              {{getDepartment(his_record_patient.departments)}}
14
+            </div>
13
             <div>床号:<span v-if="schedule.length > 0">{{getBedName(schedule[0].bed_id)}}</span></div>
15
             <div>床号:<span v-if="schedule.length > 0">{{getBedName(schedule[0].bed_id)}}</span></div>
14
-            <div>门诊号:{{his_patient.number}}</div>
16
+            <div>门诊号:{{his_patient.number}}
17
+               {{his_record_patient.ipt_otp_no}}
18
+            </div>
15
             <div>姓名:{{patient.name}}</div>
19
             <div>姓名:{{patient.name}}</div>
16
         </div>
20
         </div>
17
          <div class="listInfo" style="border-bottom: 2px solid;margin-bottom: 20px;padding-bottom: 20px;">
21
          <div class="listInfo" style="border-bottom: 2px solid;margin-bottom: 20px;padding-bottom: 20px;">
53
                 <td style="text-align:center">单价</td>
57
                 <td style="text-align:center">单价</td>
54
                 <td style="text-align:center" >数量</td>
58
                 <td style="text-align:center" >数量</td>
55
                 <td style="text-align:center">金额</td>
59
                 <td style="text-align:center">金额</td>
56
-                <td style="text-align:center" >医保类</td>
60
+                <td style="text-align:center" >医保类</td>
57
             </tr>
61
             </tr>
58
             <tr v-for="(item, index) in tableList" :key="index">
62
             <tr v-for="(item, index) in tableList" :key="index">
59
                 <td style="text-align:center" >
63
                 <td style="text-align:center" >
62
                 </td>
66
                 </td>
63
                 <td style="text-align:center" >
67
                 <td style="text-align:center" >
64
                   <span v-if="item.type == 1">
68
                   <span v-if="item.type == 1">
65
-                    {{getAdviceMedChrgintmType(item.name)}}
69
+                   {{item.cost_type}}
70
+                 </span>
71
+                  <span v-if="item.type == 2">
72
+                    {{item.cost_type}} 
66
                   </span>
73
                   </span>
67
-                   <span v-if="item.type == 2">
68
-                    {{getProjectMedChrgintmType(item.project_id)}}
69
-                   </span>
70
-                    <span v-if="item.type == 3">
71
-                        {{getProjectMedChrgintmType(item.project_id)}}
72
-                    </span>
74
+                  <span v-if="item.type == 3">
75
+                    材料费
76
+                  </span> 
73
                 </td>
77
                 </td>
74
                 <td style="text-align:center" >
78
                 <td style="text-align:center" >
75
                   <span>{{item.name}}</span>  
79
                   <span>{{item.name}}</span>  
78
                   {{ item.spec }}
82
                   {{ item.spec }}
79
                 </td>
83
                 </td>
80
                 <td style="text-align:center" >
84
                 <td style="text-align:center" >
81
-                  {{item.price}}  
85
+                  {{item.pric}}  
82
                 </td>
86
                 </td>
83
                 <td style="text-align:center" >
87
                 <td style="text-align:center" >
84
-                   {{item.count }}{{item.unit }}
88
+                   {{item.count_number }}{{item.unit }}
85
                 </td>
89
                 </td>
86
                 <td style="text-align:center" >
90
                 <td style="text-align:center" >
87
                    <span v-if="item.is_total == 1">{{ item.total }}</span>  
91
                    <span v-if="item.is_total == 1">{{ item.total }}</span>  
88
-                   <span v-if="item.is_total == 2">{{ (item.price * item.count).toFixed(2) }}</span> 
92
+                   <span v-if="item.is_total == 2">{{ (item.pric * item.count_number).toFixed(2) }}</span> 
89
                 </td>
93
                 </td>
90
                 <td style="text-align:center" >
94
                 <td style="text-align:center" >
91
-                     <span v-if="balanceAccountsType == 2">{{getChrgitmLv(item.chrgitm_lv)}}</span>
92
-                      <span v-if="balanceAccountsType != 2">
93
-                        <span v-if="item.type == 1">
94
-                            {{getAdviceMedChrgintmLv(item.advice_id)}}
95
-                        </span>
96
-                        <span v-if="item.type == 2">
97
-                          {{getProjectMedChrgintmLv(item.project_id)}}
98
-                        </span>
99
-                        <span v-if="item.type == 3">
100
-                            {{getProjectMedChrgintmLv(item.project_id)}}
101
-                        </span>
102
-                      </span>
95
+                  {{getChrgitmLv(item.medical_insurance_level)}}
103
                 </td>
96
                 </td>
104
             </tr>
97
             </tr>
105
         </table>
98
         </table>
134
           medicalInsuranceLevelList:[],
127
           medicalInsuranceLevelList:[],
135
           schedule:[],
128
           schedule:[],
136
           bedNumber:[],
129
           bedNumber:[],
130
+          tableList:[],
131
+          order_info_list:[],
132
+          balanceAccountsType:0,
133
+          medicalInsuranceLevelList:[],
134
+          drugTypeList:[],
135
+          costClassifyList:[],
136
+          id:0,
137
+          start_time:"",
138
+          end_time:"",
139
+          his_record_patient:{},
137
         }
140
         }
138
     },
141
     },
139
     methods:{
142
     methods:{
166
       getTimes(time) {
169
       getTimes(time) {
167
         return uParseTime(time, '{y}-{m}-{d}')
170
         return uParseTime(time, '{y}-{m}-{d}')
168
       },
171
       },
169
-     getGatherDetailList() {
170
-      
172
+    getGatherDetailList() {
173
+      let start_time = this.$route.query.start_time
174
+      let end_time =  this.$route.query.end_time
171
       let params = {
175
       let params = {
172
         patient_id:this.$route.query.patient_id,
176
         patient_id:this.$route.query.patient_id,
173
-        start_time: this.$route.query.start_time,
174
-        end_time: this.$route.query.end_time,
175
-        type:this.$route.query.type,
177
+        start_time: start_time,
178
+        end_time: end_time,
179
+        type: this.$route.query.type,
176
         keyword: this.$route.query.keyword
180
         keyword: this.$route.query.keyword
177
       }
181
       }
178
      getGatherDetailList(params).then(response=>{
182
      getGatherDetailList(params).then(response=>{
180
             this.$message.error(response.data.msg)
184
             this.$message.error(response.data.msg)
181
             return false
185
             return false
182
           } else {
186
           } else {
183
-            this.order = response.data.data.order
184
-            this.patient = response.data.data.patient
185
-            this.admin = response.data.data.admin_info
186
-            this.his_hospital = response.data.data.his_hospital
187
+          this.drugTypeList =response.data.data.drugTypeList
188
+          this.costClassifyList = response.data.data.costClassifyList 
189
+          var list = response.data.data.list
190
+          console.log("listw3232323223",list)
187
 
191
 
188
-            var order_info = response.data.data.order_info
189
-           
190
-            for(let i=0;i<order_info.length;i++){
191
-              order_info[i].med_chrgitm_type = this.getType(order_info[i].med_chrgitm_type)
192
-              order_info[i].chrgitm_lv  = this.getMedicineInsuranceType(order_info[i].chrgitm_lv)
193
-            }
194
-           
195
-            this.order_info_list = order_info
196
-            var prescription = response.data.data.prescription
197
-           
198
-            this.setMonthPrescription(prescription)
199
-            this.balanceAccountsType = response.data.data.balanceAccountsType
192
+          var new_arr = []
200
 
193
 
201
-            this.medicalInsuranceLevelList = response.data.data.medicalInsuranceLevelList
194
+          for(let i=0;i<list.length;i++){
195
+            for(let j=0;j<list[i].orders.length;j++){
196
+               new_arr.push(list[i].orders[j])
197
+            }
198
+          }
199
+          console.log("new_arr2332323232",new_arr)
202
 
200
 
203
-            this.schedule = response.data.data.schedule
201
+          var order_info = []
202
+          for(let i=0;i<new_arr.length;i++){
203
+            for(let j=0;j<new_arr[i].order_info.length;j++){
204
+                order_info.push(new_arr[i].order_info[j])
205
+            }
206
+          }
204
 
207
 
205
-            this.bedNumber = response.data.data.bedNumber
206
-            if(order_info!=undefined&&order_info ==null){
207
-               this.list = []
208
-               return
208
+           for(let i=0;i<order_info.length;i++){
209
+            if(order_info[i].advice_id > 0){
210
+              order_info[i].item_id = order_info[i].advice.drug.id +"_" + order_info[i].pric
209
             }
211
             }
210
-            this.his_patient = response.data.data.his_patient
211
-            this.hisDepatment = response.data.data.hisDepatment
212
-            this.list = []
213
-            this.westernMedicineCostTotal = response.data.data.westernMedicineCostTotal
214
-            this.chineseTraditionalMedicineCostTotal = response.data.data.chineseTraditionalMedicineCostTotal
215
-            this.checkCostTotal = response.data.data.checkCostTotal
216
-            this.laboratoryCostTotal = response.data.data.laboratoryCostTotal
217
-            this.zhenChaCostTotal = response.data.data.zhenChaCostTotal
218
-            this.bedCostTotal = response.data.data.bedCostTotal
219
-            this.otherCostTotal = response.data.data.otherCostTotal
220
-            this.materialCostTotal = response.data.data.materialCostTotal
221
-            if(this.$store.getters.xt_user.org_id == 10215 || this.$store.getters.xt_user.org_id == 0){
222
-              //获取所有项目类型进行去重
223
-              let med_chrgitm_types = []
224
-              for (let i = 0; i < order_info.length; i++) {
225
-                med_chrgitm_types.push(order_info[i].med_chrgitm_type)
212
+            if(order_info[i].project_id > 0){
213
+              if(order_info[i].project.type == 2){
214
+                order_info[i].item_id = order_info[i].project.project.id + "_"+order_info[i].pric
215
+              }
216
+              if(order_info[i].project.type == 3){
217
+                order_info[i].item_id = order_info[i].project.good_info.id + "_"+order_info[i].pric
226
               }
218
               }
227
-              const obj = {}
228
-              med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
229
-                obj[next] ? '' : obj[next] = true && cur.push(next)
230
-                return cur
231
-              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
219
+            }
220
+          }
221
+          console.log("order_info222222222222",order_info)
222
+          
223
+          //合并,相同的合并在一起
232
 
224
 
233
-              let tempOrderInfo = []
234
-            
235
-              for (let i = 0; i < med_chrgitm_types.length; i++) {
236
-                let obj = {
237
-                  total: 0,
238
-                  details: [],
239
-                  is_total:0,
240
-                }
241
-                let tempDetails = []
242
-                for (let b = 0; b < order_info.length; b++) {
243
-                  if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
244
-                    tempDetails.push(order_info[b])
245
-                  }
246
-                }
247
-                obj.details = this.setNewData(tempDetails)
248
-                this.list = []
249
-                this.list =  this.list.concat(obj.details)
250
-                for(let i=0;i<this.list.length;i++){
251
-                  if(this.list[i].is_total == 1){
252
-                     this.list[i].index = "合计"
253
-                  }else{
254
-                    this.list[i].index = i+1
255
-                  }
256
-                 
257
-                }
225
+          let dataInfo = {}
226
+          order_info.forEach((item, index) => {
227
+            let { item_id } = item
228
+            if (!dataInfo[item_id]) {
229
+              dataInfo[item_id] = {
230
+                item_id,
231
+                child: [],
232
+                count_number:0,
233
+                record_date:"",
234
+                cost_type:"",
235
+                name:"",
236
+                pric:item.pric,
237
+                chrgitm_lv:"",
238
+                advice_id:item.advice_id,
239
+                project_id:item.project_id,
240
+                type:0,
241
+                spec:"",
242
+                unit:"",
243
+                medical_insurance_level:"",
244
+                cost_type:"",
245
+                is_total:2,
258
               }
246
               }
259
-              let newobj = {}
260
-              newobj['total'] = this.order.medfee_sumamt
261
-              newobj['is_total'] = 1
262
-              this.list = []
263
-              this.list.push(newobj)
264
-            }else{
265
-              //获取所有项目类型进行去重
266
-              let med_chrgitm_types = []
267
-              if(order_info!=undefined && order_info.length > 0){
268
-                for (let i = 0; i < order_info.length; i++) {
269
-                 med_chrgitm_types.push(order_info[i].med_chrgitm_type)
247
+            }
248
+            dataInfo[item_id].child.push(item)
249
+          })
250
+          let arr = Object.values(dataInfo) 
251
+          
252
+          for(let i=0;i<arr.length;i++){
253
+            for(let j=0;j<arr[i].child.length;j++){
254
+               if(arr[i].advice_id >0){
255
+                  arr[i].record_date = arr[i].child[0].advice.advice_date
256
+                  arr[i].type = 1
257
+                  arr[i].name = arr[i].child[0].advice.advice_name
258
+                  arr[i].spec = arr[i].child[0].advice.drug.dose + arr[i].child[0].advice.drug.dose_unit + "*"+arr[i].child[0].advice.drug.min_number + arr[i].child[0].advice.drug.min_unit+"/"+arr[i].child[0].advice.drug.max_unit
259
+                  arr[i].unit = arr[i].child[0].advice.prescribing_number_unit
260
+                  arr[i].cost_type = arr[i].child[0].advice.drug.drug_type
261
+                  arr[i].medical_insurance_level = arr[i].child[0].advice.drug.medical_insurance_level
262
+                 
263
+                 
270
                }
264
                }
271
-              }
272
-             
273
-              const obj = {}
274
-              med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
275
-                obj[next] ? '' : obj[next] = true && cur.push(next)
276
-                return cur
277
-              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
278
-              let tempOrderInfo = []
279
-             
280
-              for (let i = 0; i < med_chrgitm_types.length; i++) {
281
-                let obj = {
282
-                  total: 0,
283
-                  details: []
284
-                }
285
-                let tempDetails = []
286
-                for (let b = 0; b < order_info.length; b++) {
287
-                  if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
288
-                    tempDetails.push(order_info[b])
265
+               if(arr[i].project_id > 0){
266
+                  arr[i].record_date = arr[i].child[0].project.record_date
267
+                  arr[i].type = arr[i].child[0].project.type
268
+                  if(arr[i].child[0].project.type == 2){
269
+                    arr[i].name = arr[i].child[0].project.project.project_name
270
+                    arr[i].spec = arr[i].child[0].project.project.project_name
271
+                    arr[i].unit = arr[i].child[0].project.project.unit
272
+                    arr[i].medical_insurance_level = arr[i].child[0].project.project.medical_coverage
273
+                    arr[i].cost_type = arr[i].child[0].project.project.cost_classify
289
                   }
274
                   }
290
-                }
291
-                
292
-                obj.details = this.setNewData(tempDetails)
293
-               
294
-                obj.total = this.getTotal(obj.details)
295
-
296
-                obj.details.push({
297
-                  total: obj.total,
298
-                  is_total: 1,
299
-                })
300
-                this.list = []
301
-                this.list =  this.list.concat(obj.details)
302
-                for(let i=0;i<this.list.length;i++){
303
-                  if(this.list[i].is_total == 1){
304
-                     this.list[i].index = "合计"
305
-                  }else{
306
-                    this.list[i].index = i+1
275
+                  if(arr[i].child[0].project.type == 3){
276
+                    arr[i].name = arr[i].child[0].project.good_info.good_name
277
+                    arr[i].spec = arr[i].child[0].project.good_info.specification_name
278
+                    arr[i].unit = arr[i].child[0].project.good_info.packing_unit
279
+                    arr[i].medical_insurance_level = arr[i].child[0].project.good_info.medical_insurance_level
280
+                    arr[i].cost_type = "材料费"
307
                   }
281
                   }
308
-                 
309
-                }
310
-               
311
-             }
312
-          }
313
-        }
314
-
315
-        if(this.$route.query.id == 1){
316
-          var new_arr = []
317
-          var objOne = {index:"合计",is_total:1,total:0}
318
-          objOne.total = this.getTotalPriceTwo(this.tableList)
319
-          for(let i=0;i<this.tableList.length;i++){
320
-          if(this.tableList[i].is_total != 1){
321
-            if(this.tableList[i].type == 1){
322
-              new_arr.push(this.tableList[i])
323
-            }  
324
-           }
325
-          }
326
-          new_arr.push(objOne)
327
-          this.tableList = []
328
-          this.tableList = new_arr
329
-        }
330
-        if(this.$route.query.id == 2){
331
-          var new_arr = []
332
-          var objOne = {index:"合计",is_total:1,total:0}
333
-          objOne.total = this.getTotalPriceTwo(this.tableList)
334
-          for(let i=0;i<this.tableList.length;i++){
335
-          if(this.tableList[i].is_total != 1){
336
-            if(this.tableList[i].project_type == 2){
337
-              new_arr.push(this.tableList[i])
338
-            }  
339
-          }
282
+               }
283
+               arr[i].count_number +=arr[i].child[j].cnt
284
+            }
340
           }
285
           }
341
-          this.tableList = []
342
-          new_arr.push(objOne)
343
-          this.tableList = new_arr
344
-        }
345
-        if(this.$route.query.id == 3){
346
-          console.log("2323232332233232322332",this.tableList)
347
-          var new_arr = []
348
-          var objOne = {index:"合计",is_total:1,total:0}
349
-          objOne.total = this.getTotalPriceTwo(this.tableList)
350
-          for(let i=0;i<this.tableList.length;i++){
351
-          if(this.tableList[i].is_total != 1){
352
-            if(this.tableList[i].project_type == 3){
353
-              new_arr.push(this.tableList[i])
354
-            }  
355
-           }
286
+          console.log("arr2323233232322332",arr)
287
+          var obj = {is_total:1,total:0}
288
+          obj.total = this.getAllPiceTwo(arr)
289
+          for(let i=0;i<arr.length;i++){
290
+            if(arr[i].advice_id >0){
291
+               arr[i].cost_type = this.getDrugType(arr[i].cost_type)
292
+            }
293
+            if(arr[i].type ==2){
294
+              arr[i].cost_type = this.getCostType(arr[i].cost_type)
295
+            }
356
           }
296
           }
357
-          new_arr.push(objOne)
358
-          this.tableList = []
359
-          this.tableList = new_arr
360
-        }
361
-        console.log("keyworde23232322332323232233232",this.$route.query.keyword)
362
-        
363
-        if(this.$route.query.keyword!=""){
364
-          var new_arr = []
365
-          for(let i=0;i<this.tableList.length;i++){
366
-            if(this.tableList[i].is_total!=1){
367
-              if(this.tableList[i].name.indexOf(this.$route.query.keyword) >-1){
297
+          arr.push(obj)
298
+
299
+          this.tableList = arr
300
+          console.log("打印",this.tableList)
301
+          this.patient = response.data.data.patient
302
+          console.log("patinet",this.patient)
303
+          this.his_patient = response.data.data.his_patient
304
+          this.hisDepatment =  response.data.data.hisDepatment
305
+          this.order =  response.data.data.order
306
+          this.his_record_patient = response.data.data.his_record_patient
307
+          this.medicalInsuranceLevelList = response.data.data.medicalInsuranceLevelList  
308
+          this.schedule = response.data.data.schedule
309
+          this.bedNumber = response.data.data.bedNumber
310
+          if(this.$route.query.keyword !=""){
311
+            console.log("金拉风3322323232323",this.$route.query.keyword)
312
+            console.log("Ar23233232323223",this.tableList)
313
+            var new_arr = []
314
+            for(let i=0;i<this.tableList.length;i++){
315
+              if(this.tableList[i].is_total!=1){
316
+                if(this.tableList[i].name.indexOf(this.$route.query.keyword) >-1){
368
                   new_arr.push(this.tableList[i])
317
                   new_arr.push(this.tableList[i])
369
                 }
318
                 }
370
               }
319
               }
320
+             
321
+             }
322
+              var obj ={index:"合计",is_total:1,total:0}
323
+              obj.total = this.getAllPiceTwo(new_arr)
324
+              new_arr.push(obj)
325
+              this.tableList = []
326
+              this.tableList = new_arr
371
           }
327
           }
372
-          var obj ={index:"合计",is_total:1,total:0}
373
-          obj.total = this.getTotalPriceTwo(new_arr)
374
-          new_arr.push(obj)
375
-          this.tableList = []
376
-          this.tableList = new_arr
377
-        }
378
 
328
 
379
-      
380
-        var new_arr_two = []
381
-        for(let i=0;i<this.tableList.length;i++){
382
-            if(this.tableList[i].advice_id > 0){
383
-              this.tableList[i].const_type = this.getAdviceMedChrgintmType(this.tableList[i].name)
329
+          if(this.$route.query.id == 1){
330
+             var new_arr = []
331
+             for(let i=0;i<this.tableList.length;i++){
332
+                if(this.tableList[i].is_total!=1){
333
+                  if(this.tableList[i].type == 1){
334
+                   new_arr.push(this.tableList[i])
335
+                }  
336
+              }
337
+                
338
+             }
339
+             this.tableList = []
340
+             this.tableList = new_arr
384
             }
341
             }
385
-            if(this.tableList[i].project_id > 0){
386
-              this.tableList[i].const_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
342
+            if(this.$route.query.id  == 2){
343
+             var new_arr = []
344
+             for(let i=0;i<this.tableList.length;i++){
345
+               if(this.tableList[i].is_total!=1){
346
+                  if(this.tableList[i].type == 2){
347
+                
348
+                  new_arr.push(this.tableList[i])
349
+                }  
350
+              }
351
+             }
352
+             this.tableList = []
353
+             this.tableList = new_arr
387
             }
354
             }
388
-            
389
-            if(this.tableList[i].const_type!=''){
390
-              new_arr_two.push(this.tableList[i])
355
+            if(this.$route.query.id  == 3){
356
+             var new_arr = []
357
+             for(let i=0;i<this.tableList.length;i++){
358
+                if(this.tableList[i].is_total!=1){
359
+                  if(this.tableList[i].type == 3){
360
+                    new_arr.push(this.tableList[i])
361
+                }  
362
+              }
363
+             }
364
+             this.tableList = []
365
+             this.tableList = new_arr
391
             }
366
             }
392
-
393
-          }
394
-          this.tableList = []
395
-          this.tableList = new_arr_two
367
+        }
396
      })
368
      })
397
     },
369
     },
398
      getAdviceName(id){
370
      getAdviceName(id){
672
     getAllPice(){
644
     getAllPice(){
673
 
645
 
674
       var total_price = 0
646
       var total_price = 0
675
-      for(let i=0;i<this.list.length;i++){
676
-        if(this.list[i].is_total ==2){
677
-          total_price += (this.list[i].price * parseInt(this.list[i].count))
647
+      for(let i=0;i<this.tableList.length;i++){
648
+        if(this.tableList[i].is_total ==2){
649
+          total_price += (this.tableList[i].pric * parseInt(this.tableList[i].count_number))
650
+        }
651
+      }
652
+      if(total_price > 0){
653
+        return total_price.toFixed(2)
654
+      }else{
655
+        return total_price
656
+      }
657
+     
658
+    },
659
+    getAllPiceTwo(arr){
660
+
661
+      var total_price = 0
662
+      for(let i=0;i<arr.length;i++){
663
+        if(arr[i].is_total ==2){
664
+          total_price += (arr[i].pric * parseInt(arr[i].count_number))
678
         }
665
         }
679
       }
666
       }
680
       if(total_price > 0){
667
       if(total_price > 0){
863
       }
850
       }
864
       return chrgitm_lv
851
       return chrgitm_lv
865
     },
852
     },
853
+    getAdviceMedChrgintmType(name){
854
+      var med_chrgitm_type = ""
855
+      for(let i=0;i<this.order_info_list.length;i++){
856
+        if(name == this.order_info_list[i].advice.advice_name){
857
+          med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
858
+        }
859
+      }
860
+      return med_chrgitm_type
861
+    },
862
+    getProjectMedChrgintmType(project_id){
863
+      var med_chrgitm_type = ""
864
+      for(let i=0;i<this.order_info_list.length;i++){
865
+        if(project_id == this.order_info_list[i].project_id){
866
+          med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
867
+        }
868
+      }
869
+      return med_chrgitm_type
870
+    },
871
+    getChrgitmLv(value){
872
+      var name = ""
873
+      for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
874
+        if(value == this.medicalInsuranceLevelList[i].value){
875
+           name = this.medicalInsuranceLevelList[i].name
876
+        }
877
+      }
878
+      return name
879
+    },
880
+    getAdviceMedChrgintmLv(advice_id){
881
+     var chrgitm_lv = ""
882
+      for(let i=0;i<this.order_info_list.length;i++){
883
+        if(advice_id == this.order_info_list[i].advice_id){
884
+          chrgitm_lv = this.order_info_list[i].chrgitm_lv
885
+        }
886
+      }
887
+      return chrgitm_lv
888
+    },
889
+    getProjectMedChrgintmLv(advice_id){
890
+     var chrgitm_lv = ""
891
+      for(let i=0;i<this.order_info_list.length;i++){
892
+        if(advice_id == this.order_info_list[i].advice_id){
893
+          chrgitm_lv = this.order_info_list[i].chrgitm_lv
894
+        }
895
+      }
896
+      return chrgitm_lv
897
+    },
866
     getWesternMedicineCostTotal(){
898
     getWesternMedicineCostTotal(){
867
       var total_price = 0
899
       var total_price = 0
868
       for(let i=0;i<this.tableList.length;i++){
900
       for(let i=0;i<this.tableList.length;i++){
869
-         if(this.tableList[i].advice_id > 0){
870
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].name)
871
-         }
872
-         if(this.tableList[i].project_id > 0){
873
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
874
-         }
875
-         if(this.tableList[i].drug_type == "西药费"){
876
-            total_price += this.tableList[i].count * this.tableList[i].price
901
+         if(this.tableList[i].cost_type == "西药"){
902
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
877
          }
903
          }
878
       }
904
       }
879
       
905
       
882
     getChineseTraditionalMedicineCostTotal(){
908
     getChineseTraditionalMedicineCostTotal(){
883
       var total_price = 0
909
       var total_price = 0
884
       for(let i=0;i<this.tableList.length;i++){
910
       for(let i=0;i<this.tableList.length;i++){
885
-         if(this.tableList[i].advice_id > 0){
886
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
887
-         }
888
-        if(this.tableList[i].project_id > 0){
889
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
890
-         }
891
-         if(this.tableList[i].drug_type == "中成药费"){
892
-            total_price += this.tableList[i].count * this.tableList[i].price
911
+         if(this.tableList[i].cost_type == "中成药"){
912
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
893
          }
913
          }
894
       }
914
       }
895
-      
896
       return total_price.toFixed(2)
915
       return total_price.toFixed(2)
897
     },
916
     },
898
     getChineseTotal(){
917
     getChineseTotal(){
899
       var total_price = 0
918
       var total_price = 0
900
       for(let i=0;i<this.tableList.length;i++){
919
       for(let i=0;i<this.tableList.length;i++){
901
-         if(this.tableList[i].advice_id > 0){
902
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
903
-         }
904
-        if(this.tableList[i].project_id > 0){
905
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
906
-         }
907
-         if(this.tableList[i].drug_type == "中草药"){
908
-            total_price += this.tableList[i].count * this.tableList[i].price
920
+         if(this.tableList[i].cost_type == "中草药"){
921
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
909
          }
922
          }
910
       }
923
       }
911
-      
912
       return total_price.toFixed(2)
924
       return total_price.toFixed(2)
913
     },
925
     },
914
     getCheckCostTotal(){
926
     getCheckCostTotal(){
915
       var total_price = 0
927
       var total_price = 0
916
       for(let i=0;i<this.tableList.length;i++){
928
       for(let i=0;i<this.tableList.length;i++){
917
-         if(this.tableList[i].advice_id > 0){
918
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
919
-         }
920
-        if(this.tableList.project_id > 0){
921
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
922
-         }
923
-         if(this.tableList[i].drug_type == "检查费"){
924
-            total_price += this.tableList[i].count * this.tableList[i].price
929
+         if(this.tableList[i].cost_type == "检验费"){
930
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
925
          }
931
          }
926
       }
932
       }
927
-      
928
       return total_price.toFixed(2)
933
       return total_price.toFixed(2)
929
     },
934
     },
930
     getOxygen(){
935
     getOxygen(){
931
-      var total_price = 0
936
+     var total_price = 0
932
       for(let i=0;i<this.tableList.length;i++){
937
       for(let i=0;i<this.tableList.length;i++){
933
-         if(this.tableList[i].advice_id > 0){
934
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
935
-         }
936
-        if(this.tableList[i].project_id > 0){
937
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
938
-         }
939
-         if(this.tableList[i].drug_type == "输氧费"){
940
-            total_price += this.tableList[i].count * this.tableList[i].price
938
+         if(this.tableList[i].cost_type == "输氧费"){
939
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
941
          }
940
          }
942
       }
941
       }
943
-      
944
       return total_price.toFixed(2)
942
       return total_price.toFixed(2)
945
     },
943
     },
946
     getOperation(){
944
     getOperation(){
947
       var total_price = 0
945
       var total_price = 0
948
       for(let i=0;i<this.tableList.length;i++){
946
       for(let i=0;i<this.tableList.length;i++){
949
-         if(this.tableList[i].advice_id > 0){
950
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
951
-         }
952
-        if(this.tableList.project_id > 0){
953
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
954
-         }
955
-         if(this.tableList[i].drug_type == "手术费"){
956
-            total_price += this.tableList[i].count * this.tableList[i].price
947
+         if(this.tableList[i].cost_type == "手术费"){
948
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
957
          }
949
          }
958
       }
950
       }
959
-      
960
       return total_price.toFixed(2)
951
       return total_price.toFixed(2)
961
     },
952
     },
962
     getLaboratoryCostTotal(){
953
     getLaboratoryCostTotal(){
963
-       var total_price = 0
954
+      var total_price = 0
964
       for(let i=0;i<this.tableList.length;i++){
955
       for(let i=0;i<this.tableList.length;i++){
965
-         if(this.tableList[i].advice_id > 0){
966
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
967
-         }
968
-        if(this.tableList[i].project_id > 0){
969
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
970
-         }
971
-         if(this.tableList[i].drug_type == "化验费"){
972
-            total_price += this.tableList[i].count * this.tableList[i].price
956
+         if(this.tableList[i].cost_type == "化验费"){
957
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
973
          }
958
          }
974
       }
959
       }
975
-      
976
       return total_price.toFixed(2)
960
       return total_price.toFixed(2)
977
     },
961
     },
978
     getBlood(){
962
     getBlood(){
979
-      var total_price = 0
963
+     var total_price = 0
980
       for(let i=0;i<this.tableList.length;i++){
964
       for(let i=0;i<this.tableList.length;i++){
981
-         if(this.tableList[i].advice_id > 0){
982
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
983
-         }
984
-        if(this.tableList[i].project_id > 0){
985
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
986
-         }
987
-         if(this.tableList[i].drug_type == "输血费"){
988
-            total_price += this.tableList[i].count * this.tableList[i].price
965
+         if(this.tableList[i].cost_type == "输血费"){
966
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
989
          }
967
          }
990
       }
968
       }
991
-      
992
       return total_price.toFixed(2)
969
       return total_price.toFixed(2)
993
     },
970
     },
994
     getZhenChaCostTotal(){
971
     getZhenChaCostTotal(){
995
       var total_price = 0
972
       var total_price = 0
996
       for(let i=0;i<this.tableList.length;i++){
973
       for(let i=0;i<this.tableList.length;i++){
997
-         if(this.tableList[i].advice_id > 0){
998
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
999
-         }
1000
-        if(this.tableList[i].project_id > 0){
1001
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1002
-         }
1003
-         if(this.tableList[i].drug_type == "诊察费"){
1004
-            total_price += this.tableList[i].count * this.tableList[i].price
974
+         if(this.tableList[i].cost_type == "诊断费"){
975
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1005
          }
976
          }
1006
       }
977
       }
1007
-      
1008
-      return total_price.toFixed(2) 
978
+      return total_price.toFixed(2)
1009
     },
979
     },
1010
     getTreatement(){
980
     getTreatement(){
1011
-      var total_price = 0
981
+     var total_price = 0
1012
       for(let i=0;i<this.tableList.length;i++){
982
       for(let i=0;i<this.tableList.length;i++){
1013
-         if(this.tableList[i].advice_id > 0){
1014
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1015
-         }
1016
-        if(this.tableList[i].project_id > 0){
1017
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1018
-         }
1019
-         
1020
-         if(this.tableList[i].drug_type == "治疗费"){
1021
-            total_price += this.tableList[i].count * this.tableList[i].price
983
+         if(this.tableList[i].cost_type == "治疗费"){
984
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1022
          }
985
          }
1023
       }
986
       }
1024
-      
1025
-      return total_price.toFixed(2) 
987
+      return total_price.toFixed(2)
1026
     },
988
     },
1027
     getNursing(){
989
     getNursing(){
1028
       var total_price = 0
990
       var total_price = 0
1029
       for(let i=0;i<this.tableList.length;i++){
991
       for(let i=0;i<this.tableList.length;i++){
1030
-         if(this.tableList[i].advice_id > 0){
1031
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1032
-         }
1033
-        if(this.tableList[i].project_id > 0){
1034
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1035
-         }
1036
-         if(this.tableList[i].drug_type == "护理费"){
1037
-            total_price += this.tableList[i].count * this.tableList[i].price
992
+         if(this.tableList[i].cost_type == "护理费"){
993
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1038
          }
994
          }
1039
       }
995
       }
1040
-      
1041
-      return total_price.toFixed(2) 
996
+      return total_price.toFixed(2)
1042
     },
997
     },
1043
     getBedCostTotal(){
998
     getBedCostTotal(){
1044
       var total_price = 0
999
       var total_price = 0
1045
       for(let i=0;i<this.tableList.length;i++){
1000
       for(let i=0;i<this.tableList.length;i++){
1046
-         if(this.tableList[i].advice_id > 0){
1047
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1048
-         }
1049
-        if(this.tableList[i].project_id > 0){
1050
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1051
-         }
1052
-         if(this.tableList[i].drug_type == "床位费"){
1053
-            total_price += this.tableList[i].count * this.tableList[i].price
1001
+         if(this.tableList[i].cost_type == "床位费"){
1002
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1054
          }
1003
          }
1055
       }
1004
       }
1056
-      
1057
-      return total_price.toFixed(2)  
1005
+      return total_price.toFixed(2)
1058
     },
1006
     },
1059
     getAnesthesia(){
1007
     getAnesthesia(){
1060
       var total_price = 0
1008
       var total_price = 0
1061
       for(let i=0;i<this.tableList.length;i++){
1009
       for(let i=0;i<this.tableList.length;i++){
1062
-         if(this.tableList[i].advice_id > 0){
1063
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1064
-         }
1065
-        if(this.tableList[i].project_id > 0){
1066
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1067
-         }
1068
-         if(this.tableList[i].drug_type == "麻醉费"){
1069
-            total_price += this.tableList[i].count * this.tableList[i].price
1010
+         if(this.tableList[i].cost_type == "麻醉费"){
1011
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1070
          }
1012
          }
1071
       }
1013
       }
1072
-      
1073
-      return total_price.toFixed(2)  
1014
+      return total_price.toFixed(2)
1074
     },
1015
     },
1075
     getMaterialCostTotal(){
1016
     getMaterialCostTotal(){
1076
       var total_price = 0
1017
       var total_price = 0
1077
       for(let i=0;i<this.tableList.length;i++){
1018
       for(let i=0;i<this.tableList.length;i++){
1078
-         if(this.tableList[i].advice_id > 0){
1079
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1080
-         }
1081
-        if(this.tableList[i].project_id > 0){
1082
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1083
-         }
1084
-         if(this.tableList[i].drug_type == "材料费"){
1085
-            total_price += this.tableList[i].count * this.tableList[i].price
1019
+         if(this.tableList[i].cost_type == "材料费"){
1020
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1086
          }
1021
          }
1087
       }
1022
       }
1088
-      
1089
-      return total_price.toFixed(2)  
1023
+      return total_price.toFixed(2)
1090
     },
1024
     },
1091
     getOtherCostTotal(){
1025
     getOtherCostTotal(){
1092
       var total_price = 0
1026
       var total_price = 0
1093
       for(let i=0;i<this.tableList.length;i++){
1027
       for(let i=0;i<this.tableList.length;i++){
1094
-         if(this.tableList[i].advice_id > 0){
1095
-           this.tableList[i].drug_type = this.getAdviceMedChrgintmType(this.tableList[i].advice_id)
1028
+         if(this.tableList[i].cost_type == "其他"){
1029
+            total_price += this.tableList[i].count_number * this.tableList[i].pric
1096
          }
1030
          }
1097
-        if(this.tableList[i].project_id > 0){
1098
-           this.tableList[i].drug_type = this.getProjectMedChrgintmType(this.tableList[i].project_id)
1099
-         }
1100
-         if(this.tableList[i].drug_type == "其他费"){
1101
-            total_price += this.tableList[i].count * this.tableList[i].price
1031
+      }
1032
+      return total_price.toFixed(2)
1033
+    },
1034
+    getDrugType(id){
1035
+      console.log("id2332323232233232232323",id)
1036
+      var name = ""
1037
+      for(let i=0;i<this.drugTypeList.length;i++){
1038
+         if(id == this.drugTypeList[i].value){
1039
+          name = this.drugTypeList[i].name
1102
          }
1040
          }
1103
       }
1041
       }
1104
-      
1105
-      return total_price.toFixed(2)  
1042
+      return name
1043
+    },
1044
+    getCostType(id){
1045
+     var name = ""
1046
+     for(let i=0;i<this.costClassifyList.length;i++){
1047
+       if(id == this.costClassifyList[i].value){
1048
+         name = this.costClassifyList[i].name
1049
+       }
1050
+     }
1051
+     return name
1106
     },
1052
     },
1107
     getBedName(id){
1053
     getBedName(id){
1108
-      var bed_number = ""
1054
+      var number = ""
1109
       for(let i=0;i<this.bedNumber.length;i++){
1055
       for(let i=0;i<this.bedNumber.length;i++){
1110
         if(id == this.bedNumber[i].id){
1056
         if(id == this.bedNumber[i].id){
1111
-           bed_number = this.bedNumber[i].number
1057
+          number = this.bedNumber[i].number
1112
         }
1058
         }
1113
       }
1059
       }
1114
-      return bed_number
1060
+      return number
1115
     }
1061
     }
1062
+
1116
     },
1063
     },
1117
     created(){
1064
     created(){
1118
       this.getGatherDetailList()   
1065
       this.getGatherDetailList()   

Filskillnaden har hållits tillbaka eftersom den är för stor
+ 275 - 691
src/xt_pages/outpatientTool/gatherPrintInvoice.vue