Browse Source

518合并代码

XMLWAN 3 years ago
parent
commit
2cbc131134

+ 79 - 12
src/xt_pages/outpatientTool/components/detailStatistics.vue View File

111
     </el-table>
111
     </el-table>
112
     <div style="display:flex;justify-content: space-around;">
112
     <div style="display:flex;justify-content: space-around;">
113
       <div>总费用:{{getAllPice()}}</div>
113
       <div>总费用:{{getAllPice()}}</div>
114
-     <div>个人支付:{{getActPay()}}</div>
114
+     <div>个人支付:
115
+        <span v-if="his_patient.balance_accounts_type == 2"></span> {{getAllPice()}}
116
+        <span v-if="his_patient.balance_accounts_type != 2"></span> {{getActPay()}}
117
+    </div>
115
      <div>基金支付记账:{{getFundPaySumamt()}}</div>
118
      <div>基金支付记账:{{getFundPaySumamt()}}</div>
116
      <div>补充医疗支付记账:{{getHifesPay()}}</div>
119
      <div>补充医疗支付记账:{{getHifesPay()}}</div>
117
     <div>救助支付金额:{{getMafPay()}}</div>
120
     <div>救助支付金额:{{getMafPay()}}</div>
155
       item_type: '0',
158
       item_type: '0',
156
       items: [
159
       items: [
157
         { id: 1, name: '药品' },
160
         { id: 1, name: '药品' },
161
+        { id: 2, name: '项目' },
158
         { id: 3, name: '耗材' },
162
         { id: 3, name: '耗材' },
159
-        { id: 2, name: '项目' }
160
 
163
 
161
       ],
164
       ],
162
       list:[],
165
       list:[],
163
-      
164
-
166
+      his_patient:{},
167
+      id:0,
165
     }
168
     }
166
   },
169
   },
167
   methods: {
170
   methods: {
181
     changeDate() {
184
     changeDate() {
182
       this.getHisSummaryDetailList()
185
       this.getHisSummaryDetailList()
183
     },
186
     },
184
-    changeItem() {
187
+    changeItem(id) {
188
+      this.id = id
185
       this.getHisSummaryDetailList()
189
       this.getHisSummaryDetailList()
190
+ 
186
     },
191
     },
187
     getHisSummaryDetailList() {
192
     getHisSummaryDetailList() {
188
       let start_time = this.chargeDate[0]
193
       let start_time = this.chargeDate[0]
197
      getHisSummaryDetailList(params).then(response=>{
202
      getHisSummaryDetailList(params).then(response=>{
198
        if(response.data.state == 1){
203
        if(response.data.state == 1){
199
           var list =  response.data.data.list
204
           var list =  response.data.data.list
200
-         
205
+          this.his_patient = response.data.data.his_patient
201
           this.list = list
206
           this.list = list
202
           this.tableData = []
207
           this.tableData = []
203
           for(let i=0;i<list.length;i++){
208
           for(let i=0;i<list.length;i++){
218
           }
223
           }
219
           obj.total_price = (obj.total_price).toFixed(2)
224
           obj.total_price = (obj.total_price).toFixed(2)
220
           this.tableData.push(obj)
225
           this.tableData.push(obj)
221
-         
226
+          console.log("tabledata23233232233232",this.tableData)
222
           var new_arr = []
227
           var new_arr = []
223
        
228
        
224
           if(this.keywords!=""){
229
           if(this.keywords!=""){
243
                 }
248
                 }
244
               }
249
               }
245
             }
250
             }
246
-            if(this.keywords!=""){
247
-              this.tableData.push(obj)
248
-            }
251
+            var objs = {index:"合计",total_price:0,record_date:"0"}
252
+            objs.total_price = this.getPrice(new_arr)
253
+            new_arr.push(objs)
254
+            
249
             this.tableData = new_arr
255
             this.tableData = new_arr
250
           }
256
           }
257
+           if(this.id == 1){
258
+              var obj = {index:"合计",total_price:0,record_date:"0"}
259
+              var new_arr = []
260
+              for(let i=0;i<this.tableData.length;i++){
261
+                if(this.tableData[i].index!="合计"){
262
+                  if(this.tableData[i].advice_id > 0){
263
+                    new_arr.push(this.tableData[i])
264
+                  }
265
+                } 
266
+              }
267
+              this.tableData = []
268
+              obj.total_price = this.getPrice(new_arr)
269
+              new_arr.push(obj)
270
+              this.tableData = new_arr
271
+           }
272
+          if(this.id == 2){
273
+            var obj = {index:"合计",total_price:0,record_date:"0"}
274
+            var new_arr = []
275
+            for(let i=0;i<this.tableData.length;i++){
276
+              if(this.tableData[i].index!="合计"){
277
+                if(this.tableData[i].project_id > 0){
278
+                  if(this.tableData[i].project.type ==2){
279
+                    new_arr.push(this.tableData[i])
280
+                  }
281
+                }
282
+              } 
283
+            }
284
+            console.log("项目new_arr",new_arr)
285
+            this.tableData = []
286
+            obj.total_price = this.getPrice(new_arr)
287
+            console.log("ar3233223232",new_arr)
288
+            new_arr.push(obj)
289
+            this.tableData = new_arr
290
+            }
291
+
292
+          if(this.id == 3){
293
+            var new_arr = []
294
+            var obj = {index:"合计",total_price:0,record_date:"0"}
295
+            for(let i=0;i<this.tableData.length;i++){
296
+              if(this.tableData[i].index!="合计"){
297
+                if(this.tableData[i].project_id > 0){
298
+                  if(this.tableData[i].project.type == 3){
299
+                    new_arr.push(this.tableData[i])
300
+                  }
301
+                }
302
+              } 
303
+            }
304
+            this.tableData = []
305
+            obj.total_price = this.getPrice(new_arr)
306
+            new_arr.push(obj)
307
+            console.log("new_arr2332323232",new_arr)
308
+            this.tableData = new_arr
309
+          }          
251
        }
310
        }
252
      })
311
      })
253
     },
312
     },
254
     getAllPice(){
313
     getAllPice(){
314
+     console.log("表哥233323232323223",this.tableData)
255
       var total_price = 0
315
       var total_price = 0
256
       for(let i=0;i<this.tableData.length;i++){
316
       for(let i=0;i<this.tableData.length;i++){
257
         if(this.tableData[i].index =="合计"){
317
         if(this.tableData[i].index =="合计"){
261
       return total_price
321
       return total_price
262
     },
322
     },
263
     getActPay(){
323
     getActPay(){
264
-      
324
+      console.log("list2332323232323232",this.list)
265
       var act_pay = 0
325
       var act_pay = 0
266
       for(let i=0;i<this.list.length;i++){
326
       for(let i=0;i<this.list.length;i++){
267
         for(let j=0;j<this.list[i].orders.length;j++){
327
         for(let j=0;j<this.list[i].orders.length;j++){
298
       return maf_pay
358
       return maf_pay
299
     },
359
     },
300
     toPrint(){
360
     toPrint(){
301
-      this.$router.push({path:"/hisTool/detailPrint?patient_id="+this.patient_id+"&start_time="+this.chargeDate[0]+"&end_time="+this.chargeDate[1]+"&type="+this.item_type +"&keyword="+this.keywords})
361
+      this.$router.push({path:"/hisTool/detailPrint?patient_id="+this.patient_id+"&start_time="+this.chargeDate[0]+"&end_time="+this.chargeDate[1]+"&type="+this.item_type +"&keyword="+this.keywords+"&id="+this.id+"&balance_accounts_type="+this.his_patient.balance_accounts_type})
362
+    },
363
+    getPrice(val){
364
+      var total_price = 0
365
+      for(let i=0;i<val.length;i++){
366
+         total_price += val[i].cnt * val[i].pric
367
+      }
368
+      return total_price.toFixed(2)
302
     }
369
     }
303
 
370
 
304
   },
371
   },

+ 3 - 0
src/xt_pages/outpatientTool/components/gatherStatistics.vue View File

240
         this.tableList = []
240
         this.tableList = []
241
         this.getGatherDetailList()
241
         this.getGatherDetailList()
242
       }
242
       }
243
+      
243
       if(id == 1){
244
       if(id == 1){
244
        var new_arr = []
245
        var new_arr = []
245
        for(let i=0;i<this.tableList.length;i++){
246
        for(let i=0;i<this.tableList.length;i++){
1161
 
1162
 
1162
   },
1163
   },
1163
   created() {
1164
   created() {
1165
+    this.tableList = []
1164
     this.getGatherDetailList()
1166
     this.getGatherDetailList()
1165
 
1167
 
1166
   },
1168
   },
1167
   watch:{
1169
   watch:{
1168
     "patient_id":function(){
1170
     "patient_id":function(){
1169
       this.patient_id = this.patient_id
1171
       this.patient_id = this.patient_id
1172
+      this.tableList = []
1170
       this.getGatherDetailList()
1173
       this.getGatherDetailList()
1171
     }
1174
     }
1172
   }
1175
   }

+ 99 - 14
src/xt_pages/outpatientTool/detailPrint.vue View File

11
         <div>患者姓名:{{ patient.name }}</div>
11
         <div>患者姓名:{{ patient.name }}</div>
12
         <div>性别:{{ patient.gender == 1 ? "男" : "女" }}</div>
12
         <div>性别:{{ patient.gender == 1 ? "男" : "女" }}</div>
13
         <div>结算类别:{{ getType(his_patient.balance_accounts_type) }}</div>
13
         <div>结算类别:{{ getType(his_patient.balance_accounts_type) }}</div>
14
-        <div style="min-width:300px;">发票号码:</div>
14
+        <div style="min-width:300px;">发票号码:{{order.fa_piao_number}}</div>
15
       </div>
15
       </div>
16
       <div class="listInfo">
16
       <div class="listInfo">
17
-        <div>住院/门诊号:</div>
17
+        <div>住院/门诊号:{{his_patient.number}}</div>
18
         <div>科室:{{ getDepartment(his_patient.departments) }}</div>
18
         <div>科室:{{ getDepartment(his_patient.departments) }}</div>
19
         <div style="min-width:350px;">就诊流水号:{{ his_patient.number }}</div>
19
         <div style="min-width:350px;">就诊流水号:{{ his_patient.number }}</div>
20
       </div>
20
       </div>
21
       <div class="listInfo">
21
       <div class="listInfo">
22
         <div>总费用:{{ getAllPice() }}</div>
22
         <div>总费用:{{ getAllPice() }}</div>
23
-        <div>个人支付:{{ getActPay() }}</div>
23
+        <div>个人支付:
24
+          <span v-if="this.$route.query.balance_accounts_type == 2">{{ getAllPice() }}</span> 
25
+          <span v-if="this.$route.query.balance_accounts_type != 2">{{ getActPay() }}</span> 
26
+          
27
+        </div>
24
         <div>基金支付记账:{{ getFundPaySumamt() }}</div>
28
         <div>基金支付记账:{{ getFundPaySumamt() }}</div>
25
         <div style="min-width:300px;">补充医疗支付记账:{{ getHifesPay() }}</div>
29
         <div style="min-width:300px;">补充医疗支付记账:{{ getHifesPay() }}</div>
26
       </div>
30
       </div>
40
           <td style="width: 10%; text-align: center">金额</td>
44
           <td style="width: 10%; text-align: center">金额</td>
41
         </tr>
45
         </tr>
42
         <tr v-for="(item, index) in tableData" :key="index">
46
         <tr v-for="(item, index) in tableData" :key="index">
43
-          <td style="width: 19%; text-align: center">{{ index + 1 }}</td>
47
+          <td style="width: 19%; text-align: center">
48
+            <span v-if="item.is_total == 1">{{ index + 1 }}</span> 
49
+            <span v-if="item.is_total == 2">合计</span> 
50
+          </td>
44
           <td style="width: 10%; text-align: center">
51
           <td style="width: 10%; text-align: center">
45
             <span v-if="item.record_date > 0">{{
52
             <span v-if="item.record_date > 0">{{
46
               getTimes(item.record_date)
53
               getTimes(item.record_date)
54
                 item.project.project.project_name
61
                 item.project.project.project_name
55
               }}</span>
62
               }}</span>
56
               <span v-if="item.project.type == 3"
63
               <span v-if="item.project.type == 3"
57
-                >{item.project.good_info.good_name}}</span
64
+                >{{item.project.good_info.good_name}}</span
58
               >
65
               >
59
             </span>
66
             </span>
60
           </td>
67
           </td>
119
         { value: 7, label: "合同" },
126
         { value: 7, label: "合同" },
120
         { value: 8, label: "医保自费" },
127
         { value: 8, label: "医保自费" },
121
       ],
128
       ],
129
+      order:{},
122
     };
130
     };
123
   },
131
   },
124
   methods: {
132
   methods: {
174
          
182
          
175
 
183
 
176
           this.hisDepatment = response.data.data.hisDepatment;
184
           this.hisDepatment = response.data.data.hisDepatment;
177
-
185
+           
186
+          this.order = response.data.data.order
178
           this.tableData = [];
187
           this.tableData = [];
179
           for (let i = 0; i < list.length; i++) {
188
           for (let i = 0; i < list.length; i++) {
180
             for (let j = 0; j < list[i].orders.length; j++) {
189
             for (let j = 0; j < list[i].orders.length; j++) {
181
               for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
190
               for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
182
                 list[i].orders[j].order_info[z].record_date =
191
                 list[i].orders[j].order_info[z].record_date =
183
-                  list[i].orders[j].settle_accounts_date;
192
+                list[i].orders[j].settle_accounts_date;
184
                 list[i].orders[j].order_info[z].number =
193
                 list[i].orders[j].order_info[z].number =
185
-                  list[i].orders[j].number;
194
+                list[i].orders[j].number;
186
                 this.tableData.push(list[i].orders[j].order_info[z]);
195
                 this.tableData.push(list[i].orders[j].order_info[z]);
187
               }
196
               }
188
             }
197
             }
189
           }
198
           }
190
-          var obj = { index: "合计", total_price: 0, record_date: "0" };
199
+          var obj = { index: "合计", total_price: 0, record_date: "0",is_total:2 };
191
           for (let i = 0; i < this.tableData.length; i++) {
200
           for (let i = 0; i < this.tableData.length; i++) {
192
             this.tableData[i].index = i + 1;
201
             this.tableData[i].index = i + 1;
193
             this.tableData[i].total_price = 0;
202
             this.tableData[i].total_price = 0;
203
+            this.tableData[i].is_total = 1
194
             this.tableData[i].total_price = (
204
             this.tableData[i].total_price = (
195
-              this.tableData[i].cnt * this.tableData[i].pric
196
-            ).toFixed(2);
205
+            this.tableData[i].cnt * this.tableData[i].pric).toFixed(2);
197
             obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
206
             obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
198
           }
207
           }
199
           obj.total_price = obj.total_price.toFixed(2);
208
           obj.total_price = obj.total_price.toFixed(2);
200
           this.tableData.push(obj);
209
           this.tableData.push(obj);
210
+          console.log("表哥233232323232233232322323",this.tableData)
201
           if (this.$route.query.keyword != "") {
211
           if (this.$route.query.keyword != "") {
212
+            var new_arr = []
202
             for (let i = 0; i < this.tableData.length; i++) {
213
             for (let i = 0; i < this.tableData.length; i++) {
203
               if (this.tableData[i].index != "合计") {
214
               if (this.tableData[i].index != "合计") {
204
                 if (this.tableData[i].advice_id > 0) {
215
                 if (this.tableData[i].advice_id > 0) {
232
                 }
243
                 }
233
               }
244
               }
234
             }
245
             }
235
-            if (this.$route.query.keyword != "") {
236
-              this.tableData.push(obj);
246
+            var objs = {index:"合计",total_price:0,record_date:"0",is_total:2}
247
+            for(let i=0;i<new_arr.length;i++){
248
+               new_arr[i].is_total = 1
237
             }
249
             }
250
+            objs.total_price = this.getPrice(new_arr)
251
+            new_arr.push(objs)
238
             this.tableData = new_arr;
252
             this.tableData = new_arr;
253
+            console.log("表哥2333333333333333333333333333",this.tableData)
239
           }
254
           }
240
-          console.log("tabledata32233223323232", this.tableData);
255
+
256
+          if(this.$route.query.id == 1){
257
+              var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
258
+              var new_arr = []
259
+              for(let i=0;i<this.tableData.length;i++){
260
+                if(this.tableData[i].index!="合计"){
261
+                  if(this.tableData[i].advice_id > 0){
262
+                    new_arr.push(this.tableData[i])
263
+                  }
264
+                } 
265
+              }
266
+              this.tableData = []
267
+              obj.total_price = this.getPrice(new_arr)
268
+              for(let i=0;i<new_arr.length;i++){
269
+                new_arr[i].is_total = 1
270
+              }
271
+              new_arr.push(obj)
272
+              this.tableData = new_arr
273
+           }
274
+          if(this.$route.query.id == 2){
275
+            var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
276
+            var new_arr = []
277
+            for(let i=0;i<this.tableData.length;i++){
278
+              if(this.tableData[i].index!="合计"){
279
+                if(this.tableData[i].project_id > 0){
280
+                  if(this.tableData[i].project.type ==2){
281
+                    new_arr.push(this.tableData[i])
282
+                  }
283
+                }
284
+              } 
285
+            }
286
+            console.log("项目new_arr",new_arr)
287
+            this.tableData = []
288
+            obj.total_price = this.getPrice(new_arr)
289
+            console.log("ar3233223232",new_arr)
290
+            for(let i=0;i<new_arr.length;i++){
291
+              new_arr[i].is_total = 1
292
+            }
293
+            new_arr.push(obj)
294
+            this.tableData = new_arr
295
+            }
296
+
297
+          if(this.$route.query.id == 3){
298
+            var new_arr = []
299
+            var obj = {index:"合计",total_price:0,record_date:"0",is_total:2}
300
+            for(let i=0;i<this.tableData.length;i++){
301
+              if(this.tableData[i].index!="合计"){
302
+                if(this.tableData[i].project_id > 0){
303
+                  if(this.tableData[i].project.type == 3){
304
+                    new_arr.push(this.tableData[i])
305
+                  }
306
+                }
307
+              } 
308
+            }
309
+            this.tableData = []
310
+            obj.total_price = this.getPrice(new_arr)
311
+            for(let i=0;i<new_arr.length;i++){
312
+              new_arr[i].is_total = 1
313
+            }
314
+            new_arr.push(obj)
315
+            console.log("new_arr2332323232",new_arr)
316
+            this.tableData = new_arr
317
+          } 
318
+         
241
         }
319
         }
242
       });
320
       });
243
     },
321
     },
305
       }
383
       }
306
       return name;
384
       return name;
307
     },
385
     },
386
+    getPrice(val){
387
+      var total_price = 0
388
+      for(let i=0;i<val.length;i++){
389
+         total_price += val[i].cnt * val[i].pric
390
+      }
391
+      return total_price.toFixed(2)
392
+    }
308
   },
393
   },
309
   created() {
394
   created() {
310
     this.getHisSummaryDetailList();
395
     this.getHisSummaryDetailList();