Pārlūkot izejas kodu

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

see999 3 gadus atpakaļ
vecāks
revīzija
0a63620f13

+ 4 - 4
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue Parādīt failu

@@ -306,7 +306,7 @@
306 306
             align="center"
307 307
             label="置换量(ml)"
308 308
             width="100"
309
-            v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919) || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)" >
309
+            v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919 && org_id!=10191) || org_id == 9779 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)" >
310 310
             <template slot-scope="scope">
311 311
               {{ scope.row.displacement_quantity ? scope.row.displacement_quantity : "" }}
312 312
             </template>
@@ -317,7 +317,7 @@
317 317
             align="center"
318 318
             label="置换量(L)"
319 319
             width="100"
320
-            v-if=" isShow('置换量') &&  ((template_id != 6 || org_id == 9919) && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)" >
320
+            v-if=" isShow('置换量') &&  ((template_id != 6 || org_id == 9919 || org_id == 10191) && template_id != 9779 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)" >
321 321
             <template slot-scope="scope">
322 322
               {{ scope.row.displacement_quantity ? scope.row.displacement_quantity : "" }}
323 323
             </template>
@@ -694,12 +694,12 @@
694 694
               <el-input v-model="form.replacement_rate"></el-input>
695 695
             </el-form-item>
696 696
           </el-col>
697
-          <el-col :span="8" v-if=" isShow('置换量') &&  ((template_id != 6 || org_id == 9919) && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)">
697
+          <el-col :span="8" v-if=" isShow('置换量') &&  ((template_id != 6 || org_id == 9919 || org_id == 10191) && org_id != 9779 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)">
698 698
             <el-form-item label="置换量(L):">
699 699
               <el-input v-model="form.displacement_quantity"></el-input>
700 700
             </el-form-item>
701 701
           </el-col>
702
-          <el-col :span="8" v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919) || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)">
702
+          <el-col :span="8" v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919 && org_id!=10191) || org_id == 9779 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)">
703 703
             <el-form-item label="置换量(ml):">
704 704
               <el-input v-model="form.displacement_quantity"></el-input>
705 705
             </el-form-item>

+ 2 - 2
src/xt_pages/dialysis/details/dialysisMonitoring.vue Parādīt failu

@@ -22,8 +22,8 @@
22 22
           <th v-if="isShow('透析液温度')" width="92px">透析液温度(℃)</th>
23 23
           <th v-if=" isShow('置换率') && (template_id == 6 || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29) " width="92px" > 置换率(ml/min) </th>
24 24
           <th v-if=" isShow('置换率') && template_id != 6 && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29" width="92px" > 置换率(L/h)  </th>
25
-          <th v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919) || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)" width="92px"  > 置换量(ml)  </th>
26
-          <th v-if=" isShow('置换量') && ((template_id != 6 || org_id == 9919) && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)" width="92px" > 置换量(L) </th>
25
+          <th v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919 && org_id !=10191) || org_id == 9779 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29)" width="92px"  > 置换量(ml)  </th>
26
+          <th v-if=" isShow('置换量') && ((template_id != 6 || org_id == 9919 || org_id == 10191) && org_id != 9779 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29)" width="92px" > 置换量(L) </th>
27 27
           <th v-if=" isShow('SpO₂') && template_id != 6 && template_id != 10 && template_id != 11  " width="92px" > SpO₂(%) </th>
28 28
           <th v-if="isShow('电导度')" width="92px">电导度(mS/m)</th>
29 29
           <th v-if="isShow('置换液流量') && template_id != 27" width="92px">置换液流量(ml/h)</th>

+ 6 - 6
src/xt_pages/dialysis/template/DialysisPrintOrderFortyOne.vue Parādīt failu

@@ -51,7 +51,7 @@
51 51
             {{ dialysisOrder && dialysisOrder.DeviceNumber && dialysisOrder.DeviceNumber.number.length > 0 ? dialysisOrder.DeviceNumber.number : patientInfo.DialysisSchedule.device_number.number }}
52 52
           </div>
53 53
         </div>
54
-        
54
+
55 55
         <div class="inline_block">
56 56
           透析次数:
57 57
           <div class="under_line" style="width: 50px;text-align: left">
@@ -73,7 +73,7 @@
73 73
             {{ patientInfo.DialysisSchedule.device_zone.name ? patientInfo.DialysisSchedule.device_zone.name : '' }}
74 74
           </div>
75 75
         </div>
76
-        
76
+
77 77
       </div> -->
78 78
 
79 79
       <div class="row">
@@ -570,7 +570,7 @@
570 570
                         <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{ getAdminUser(advice.advice_doctor) }}</span>
571 571
                         <img style="height:30px" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else />
572 572
                       </td>
573
-                      
573
+
574 574
                       <td height="30px" style="padding:4px 5px;">
575 575
                         <span v-if="advice.execution_time">{{ getTime(advice.execution_time, "{h}:{i}") }}</span>
576 576
                       </td>
@@ -588,7 +588,7 @@
588 588
                 </table>
589 589
               </td>
590 590
             </tr>
591
-            
591
+
592 592
             <tr>
593 593
               <td style="padding: 0; position: relative;" colspan="2">
594 594
                 <table class="inside_table">
@@ -637,7 +637,7 @@
637 637
                         <div style="min-height:20px;line-height:20px; overflow:hidden;">
638 638
                           <span v-if="getTime(monitor.operate_time, '{h}:{i}')" style="word-break: break-all;margin:0;line-height:16px;-webkit-line-clamp:3;overflow:visible;display:inline-block;vertical-align:middle;height:auto;">
639 639
                             <template v-if="(dialysisOrder && monitor.operate_time == dialysisOrder.start_time)">【开始透析】引血100ml/min</template>
640
-                            <span v-if="dialysisOrder && monitor.operate_time == dialysisOrder.end_time">{{ monitor.end }}</span> 
640
+                            <span v-if="dialysisOrder && monitor.operate_time == dialysisOrder.end_time">{{ monitor.end }}</span>
641 641
                             {{ monitor.symptom }} &nbsp;{{ monitor.dispose }} &nbsp;{{ monitor.result }}
642 642
                           </span>
643 643
                         </div>
@@ -1059,7 +1059,7 @@ export default {
1059 1059
         this.check = response.data.data.check
1060 1060
         this.xtdate = response.data.data.xtdate
1061 1061
         this.predialysis = response.data.data.PredialysisEvaluation
1062
-        console.log("透前评估",this.predialysis)
1062
+        // console.log("透前评估",this.predialysis)
1063 1063
         this.predialysis.blood_access_part_opera_name = this.bloodAccessParOperaName(
1064 1064
           this.predialysis.blood_access_part_opera_id
1065 1065
         )

+ 2 - 2
src/xt_pages/outpatientCharges/statementTemplate/printFour.vue Parādīt failu

@@ -233,7 +233,7 @@
233 233
               </div>
234 234
               <div class="actionBar">
235 235
                   <div>收费员:{{balanceAccounts.current_admin.user_name}}</div>
236
-                  <div>日期:{{getTime(new Date(),"{y}-{m}-{d}")?getTime(new Date(),"{y}-{m}-{d}"):""}}</div>
236
+                  <div>日期:{{getTime(balanceAccounts.order.settle_accounts_date,"{y}-{m}-{d}")?getTime(balanceAccounts.order.settle_accounts_date,"{y}-{m}-{d}"):""}}</div>
237 237
               </div>
238 238
           </div>
239 239
 
@@ -421,7 +421,7 @@
421 421
               }
422 422
           }
423 423
         }
424
-        
424
+
425 425
       },
426 426
       getTime(value, temp) {
427 427
         if (value != undefined) {

+ 437 - 5
src/xt_pages/outpatientTool/components/detail.vue Parādīt failu

@@ -1,13 +1,445 @@
1 1
 <template>
2
+    <div class="main-contain outpatientChargesManagement">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+        </div>
6
+        <div class="app-container">
7
+            <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
+                <div>
9
+                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
+                    <!--@click="Action">-->
11
+                    <!--导出-->
12
+                    <!--</el-button>-->
13
+                    <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
+                              @keyup.enter.native='searchAction'
15
+                              class="filter-item"/>
16
+                    <el-select size="small" v-model="item_type" placeholder="请选择"
17
+                               style="width:150px;margin-left:10px;" @change="changeItem">
18
+                        <el-option
19
+                                label="全部"
20
+                                value="0">
21
+                        </el-option>
22
+                        <el-option
23
+                                v-for="item,index in items"
24
+                                :key="index"
25
+                                :label="item.name"
26
+                                :value="item.id">
27
+                        </el-option>
28
+                    </el-select>
29
+                    <el-date-picker
30
+                            v-model="chargeDate"
31
+                            type="daterange"
32
+                            value-format="yyyy-MM-dd"
33
+                            range-separator="至"
34
+                            start-placeholder="开始日期"
35
+                            @change="changeDate"
36
+                            end-placeholder="结束日期">
37
+                    </el-date-picker>
38
+                    <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
39
+                    <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
40
+                </div>
41
+                <div>
42
+                    <!-- <el-popover
43
+                      placement="bottom"
44
+                      width="210"
45
+                      trigger="click">
46
+                      <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
47
+                      <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
48
+                      <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
2 49
 
50
+                    </el-popover> -->
51
+                    <!--<el-button size="small" type="primary" @click="export_detail">报表下载</el-button>-->
52
+                </div>
53
+            </div>
54
+            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56
+                      :span-method="merge"
57
+                      highlight-current-row>
3 58
 
59
+                <el-table-column align="center" prop="name" label="患者名字">
60
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
61
+                </el-table-column>
62
+                <!--<el-table-column align="center" prop="name" label="患者类型">-->
63
+                <!--<template slot-scope="scope"></template>-->
64
+                <!--</el-table-column>-->
65
+
66
+                <el-table-column align="center" prop="name" label="项目名称">
67
+                    <template slot-scope="scope">{{scope.row.item_name}}</template>
68
+                </el-table-column>
69
+                <el-table-column align="center" prop="name" label="数量">
70
+                    <template slot-scope="scope">{{scope.row.count}}</template>
71
+                </el-table-column>
72
+                <el-table-column align="center" prop="name" label="单价">
73
+                    <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
74
+                </el-table-column>
75
+                <el-table-column align="center" prop="name" label="费用">
76
+                    <template slot-scope="scope">
77
+                        <div>{{(scope.row.price.toFixed(2)*scope.row.count).toFixed(2)}}</div>
78
+                    </template>
79
+                </el-table-column>
80
+
81
+                <el-table-column align="center" prop="name" label="费用总额">
82
+                    <template slot-scope="scope">
83
+                        <div>{{scope.row.total.toFixed(2)}}</div>
84
+                    </template>
85
+                </el-table-column>
86
+
87
+            </el-table>
88
+        </div>
89
+
90
+    </div>
4 91
 </template>
92
+
93
+
5 94
 <script>
95
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
96
+  import { GetSummaryDetail } from '@/api/his/his'
97
+  import { uParseTime } from '@/utils/tools'
98
+  // import NewStatementPrint from './newStatementPrint'
99
+  const moment = require('moment')
6 100
   export default {
7
-    name: 'summaryDetail'
8
-  }
9
-</script>
101
+    components: {
102
+      BreadCrumb
103
+
104
+    },
105
+    data() {
106
+      return {
107
+        tempArr: [],
108
+        sameRowArr: [],
109
+        keywords: '',
110
+        tableData: [],
111
+        chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
112
+        item_type: '0',
113
+        items: [
114
+          { id: 1, name: '药品' },
115
+          { id: 2, name: '项目' },
116
+          { id: 3, name: '耗材' },
117
+
118
+        ]
119
+
120
+      }
121
+    },
122
+    methods: {
123
+      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
124
+        if (columnIndex === 0) {
125
+          if (rowIndex % 2 === 0) {
126
+            return {
127
+              rowspan: 2,
128
+              colspan: 1
129
+            }
130
+          } else {
131
+            return {
132
+              rowspan: 0,
133
+              colspan: 0
134
+            }
135
+          }
136
+        }
137
+      },
138
+      unique(arr) {
139
+        const res = new Map()
140
+        return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
141
+      },
142
+      changeDate() {
143
+        this.getSummaryDetailList()
144
+      },
145
+      changeItem() {
146
+        this.getSummaryDetailList()
147
+      },
148
+      searchAction() {
149
+        this.item_type = '0'
150
+        this.getSummaryDetailList()
151
+
152
+      },
153
+      getSummaryDetailList() {
154
+        let start_time = this.chargeDate[0]
155
+        let end_time = this.chargeDate[1]
156
+        let params = {
157
+          start_time: start_time,
158
+          end_time: end_time,
159
+          type: this.item_type,
160
+          keyword: this.keywords
161
+        }
162
+        GetSummaryDetail(params).then(response => {
163
+          if (response.data.state == 0) {
164
+            this.$message.error(response.data.msg)
165
+            return false
166
+          } else {
167
+            this.tableData = []
168
+            let tempPatients = []
169
+            let tempPatientsTwo = []
170
+
171
+            let tempData = response.data.data.patients
172
+            let data = response.data.data.patients
173
+            let orders = this.unique(tempData)
174
+            for (let i = 0; i < orders.length; i++) {
175
+              let obj = {
176
+                patient_id: orders[i].id,
177
+                name: orders[i].name,
178
+                orders: []
179
+              }
180
+              for (let b = 0; b < data.length; b++) {
181
+                if (orders[i].id == data[b].id) {
182
+                  obj.orders = obj.orders.concat(data[b].orders)
183
+                }
184
+              }
185
+              tempPatients.push(obj)
186
+            }
187
+
188
+            for (let i = 0; i < tempPatients.length; i++) {
189
+              let obj = {
190
+                patient_id: tempPatients[i].patient_id,
191
+                name: tempPatients[i].name,
192
+                order_info: []
193
+              }
194
+              let orders = tempPatients[i].orders
195
+              for (let b = 0; b < orders.length; b++) {
196
+                for (let c = 0; c < orders[b].order_info.length; c++) {
197
+                  let newObj = {}
198
+
199
+                  newObj['count'] = orders[b].order_info[c].cnt
200
+                  newObj['price'] = orders[b].order_info[c].pric
201
+                  if (orders[b].order_info[c].advice_id > 0 && orders[b].order_info[c].project_id == 0) {
202
+                    newObj['type'] = 1
203
+                    newObj['item_name'] = orders[b].order_info[c].advice.advice_name
204
+                    newObj['item_id'] = orders[b].order_info[c].advice.drug_id
205
+
206
+                  }
207
+                  if (orders[b].order_info[c].advice_id == 0 && orders[b].order_info[c].project_id > 0) {
208
+                    newObj['type'] = 2
209
+                    newObj['item_id'] = orders[b].order_info[c].project.project_id
10 210
 
11
-<style scoped>
211
+                    if (orders[b].order_info[c].project.type == 2) {
212
+                      newObj['item_name'] = orders[b].order_info[c].project.project.project_name
213
+                    } else if (orders[b].order_info[c].project.type == 3) {
214
+                      newObj['item_name'] = orders[b].order_info[c].project.good_info.good_name + "( "+ orders[b].order_info[c].project.good_info.specification_name+" )"
215
+                    }
216
+                  }
217
+                  obj.order_info.push(newObj)
218
+                }
219
+              }
220
+              tempPatientsTwo.push(obj)
221
+            }
222
+            console.log(tempPatientsTwo)
12 223
 
13
-</style>
224
+            for (let d = 0; d < tempPatientsTwo.length; d++) {
225
+              tempPatientsTwo[d]['new_order_info'] = []
226
+              let project = []
227
+              let advice = []
228
+              for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
229
+                if (tempPatientsTwo[d].order_info[b].type == 1) {
230
+                  advice.push(tempPatientsTwo[d].order_info[b])
231
+                } else {
232
+                  project.push(tempPatientsTwo[d].order_info[b])
233
+                }
234
+              }
235
+              project = this.uniqueProjectAndAdvice(project)
236
+              advice = this.uniqueProjectAndAdvice(advice)
237
+
238
+              for (let i = 0; i < project.length; i++) {
239
+                let obj = {}
240
+                let count = 0
241
+                for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
242
+                  if (project[i].item_id == tempPatientsTwo[d].order_info[a].item_id && project[i].price == tempPatientsTwo[d].order_info[a].price) {
243
+                    count = count + tempPatientsTwo[d].order_info[a].count
244
+                  }
245
+                }
246
+                obj['price'] = project[i].price
247
+                obj['type'] = project[i].type
248
+                obj['item_name'] = project[i].item_name
249
+                obj['item_id'] = project[i].item_id
250
+                obj['name'] = tempPatientsTwo[d].name
251
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
252
+                obj['count'] = count
253
+                tempPatientsTwo[d].new_order_info.push(obj)
254
+              }
255
+
256
+              for (let i = 0; i < advice.length; i++) {
257
+                let obj = {}
258
+                let count = 0
259
+                for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
260
+                  if (advice[i].item_id == tempPatientsTwo[d].order_info[a].item_id && advice[i].price == tempPatientsTwo[d].order_info[a].price) {
261
+                    count = count + tempPatientsTwo[d].order_info[a].count
262
+                  }
263
+                }
264
+                obj['price'] = advice[i].price
265
+                obj['type'] = advice[i].type
266
+                obj['item_name'] = advice[i].item_name
267
+                obj['item_id'] = advice[i].item_id
268
+                obj['name'] = tempPatientsTwo[d].name
269
+                obj['patient_id'] = tempPatientsTwo[d].patient_id
270
+                obj['count'] = count
271
+                tempPatientsTwo[d].new_order_info.push(obj)
272
+              }
273
+
274
+            }
275
+
276
+            for (let i = 0; i < tempPatientsTwo.length; i++) {
277
+              let total = 0
278
+              for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
279
+                if (tempPatientsTwo[i].new_order_info[b].item_name.length != 0) {
280
+                  total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count.toString()) * parseFloat(tempPatientsTwo[i].new_order_info[b].price.toString().toString())).toFixed(2))
281
+                }
282
+              }
283
+              tempPatientsTwo[i]['total'] = total
284
+            }
285
+
286
+            for (let i = 0; i < tempPatientsTwo.length; i++) {
287
+              console.log(tempPatientsTwo[i].total)
288
+              for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
289
+                if (tempPatientsTwo[i].new_order_info[b].item_name.length != 0) {
290
+                  let obj = {
291
+                    name: tempPatientsTwo[i].name,
292
+                    patient_id: tempPatientsTwo[i].patient_id,
293
+                    price: tempPatientsTwo[i].new_order_info[b].price,
294
+                    type: tempPatientsTwo[i].new_order_info[b].type,
295
+                    item_name: tempPatientsTwo[i].new_order_info[b].item_name,
296
+                    item_id: tempPatientsTwo[i].new_order_info[b].item_id,
297
+                    count: tempPatientsTwo[i].new_order_info[b].count,
298
+                    total: tempPatientsTwo[i].total
299
+                  }
300
+                  this.tableData.push(obj)
301
+                }
302
+
303
+              }
304
+            }
305
+            this.handleSpanTempArr()
306
+            // this.tableData = tempPatientsTwo
307
+
308
+            // console.log(tempPatientsTwo.length)
309
+            //
310
+
311
+          }
312
+          //
313
+          // console.log('去重前')
314
+          // console.log(advice)
315
+          // console.log(project)
316
+          // //
317
+          // //
318
+
319
+          // //
320
+          // console.log('去重后')
321
+          //
322
+          // console.log(advice.length)
323
+          // console.log(project.length)
324
+          //
325
+          // for (let i = 0; i < project.length; i++) {
326
+          //   let obj = {}
327
+          //   let count = 0
328
+          //   for (let a = 0; a < tempPatientsTwo.length; a++) {
329
+          //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
330
+          //       count = count + tempPatientsTwo[a].count
331
+          //       obj['count'] = count
332
+          //
333
+          //     }
334
+          //     obj['price'] = project[i].price
335
+          //     obj['type'] = project[i].type
336
+          //     obj['item_name'] = project[i].item_name
337
+          //     obj['item_id'] = project[i].item_id
338
+          //     obj['name'] = project[i].name
339
+          //     obj['patient_id'] = project[i].patient_id
340
+          //     obj['count'] = count
341
+          //     this.tableData.push(obj)
342
+          //   }
343
+          // }
344
+          //
345
+          //
346
+          // for (let i = 0; i < advice.length; i++) {
347
+          //   let obj = {}
348
+          //   let count = 0
349
+          //   for (let a = 0; a < tempPatientsTwo.length; a++) {
350
+          //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
351
+          //       count = count + tempPatientsTwo[a].count
352
+          //       obj['count'] = count
353
+          //
354
+          //     }
355
+          //     obj['price'] = advice[i].price
356
+          //     obj['type'] = advice[i].type
357
+          //     obj['item_name'] = advice[i].item_name
358
+          //     obj['item_id'] = advice[i].item_id
359
+          //     obj['name'] = advice[i].name
360
+          //     obj['patient_id'] = advice[i].patient_id
361
+          //     this.tableData.push(obj)
362
+          //   }
363
+          // }
364
+          // console.log(this.tableData.length)
365
+          // this.tableData = this.sort(this.tableData)
366
+
367
+        })
368
+      }, uniqueProjectAndAdvice(array) {
369
+        // res用来存储结果
370
+        var res = []
371
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
372
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
373
+            if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
374
+              break
375
+            }
376
+          }
377
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
378
+          if (j === resLen) {
379
+            res.push(array[i])
380
+          }
381
+        }
382
+        return res
383
+      }, sort(arr) {
384
+        for (var i = 0; i < arr.length - 1; i++) {
385
+          for (var j = 0; j < arr.length - i - 1; j++) {
386
+            if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
387
+              var hand = arr[j]
388
+              arr[j] = arr[j + 1]
389
+              arr[j + 1] = hand
390
+
391
+            }
392
+          }
393
+        }
394
+        return arr
395
+      }, handleSpanTempArr() {
396
+        this.tempArr = []
397
+
398
+        for (let i = 0; i < this.tableData.length; i++) {
399
+          if (i === 0) {
400
+            this.tempArr.push(1)
401
+            this.pos = 0
402
+          } else {
403
+            // 判断当前元素与上一个元素是否相同
404
+            if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
405
+              this.tempArr[this.pos] += 1
406
+              this.tempArr.push(0)
407
+            } else {
408
+              this.tempArr.push(1)
409
+              this.pos = i
410
+            }
411
+          }
412
+        }
413
+
414
+        let sameRowArr = [], sIdx = 0
415
+        this.tableData.forEach((item, index) => {
416
+          item.index = index
417
+          if (index === 0) {
418
+            sameRowArr.push([index])
419
+          } else {
420
+            if (item.patient_id === this.tableData[index - 1].patient_id) {
421
+              sameRowArr[sIdx].push(index)
422
+            } else {
423
+              sIdx = sIdx + 1
424
+              sameRowArr.push([index])
425
+            }
426
+          }
427
+        })
428
+        this.sameRowArr = sameRowArr
429
+      }, merge({ row, column, rowIndex, columnIndex }) {
430
+        if (columnIndex === 0 || columnIndex === 5) {
431
+          const _row = this.tempArr[rowIndex]
432
+          const _col = _row > 0 ? 1 : 0
433
+          return {
434
+            rowspan: _row,
435
+            colspan: _col
436
+          }
437
+        }
438
+      }
439
+    },
440
+    created() {
441
+      this.getSummaryDetailList()
442
+
443
+    }
444
+  }
445
+</script>

+ 470 - 5
src/xt_pages/outpatientTool/components/gather.vue Parādīt failu

@@ -1,13 +1,478 @@
1 1
 <template>
2
+    <div class="main-contain outpatientChargesManagement">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+        </div>
6
+        <div class="app-container">
7
+            <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
+                <div>
9
+                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
+                    <!--@click="Action">-->
11
+                    <!--导出-->
12
+                    <!--</el-button>-->
13
+                    <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
+                              @keyup.enter.native='searchAction'
15
+                              class="filter-item"/>
16
+                    <el-select size="small" v-model="item_type" placeholder="请选择"
17
+                               style="width:150px;margin-left:10px;" @change="changeItem">
18
+                        <el-option
19
+                                label="全部"
20
+                                value="0">
21
+                        </el-option>
22
+                        <el-option
23
+                                v-for="item,index in items"
24
+                                :key="index"
25
+                                :label="item.name"
26
+                                :value="item.id">
27
+                        </el-option>
28
+                    </el-select>
29
+                    <el-date-picker
30
+                            v-model="chargeDate"
31
+                            type="daterange"
32
+                            value-format="yyyy-MM-dd"
33
+                            range-separator="至"
34
+                            start-placeholder="开始日期"
35
+                            @change="changeDate"
36
+                            end-placeholder="结束日期">
37
+                    </el-date-picker>
38
+                    <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
39
+                    <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
40
+                </div>
41
+                <div>
42
+                    <!-- <el-popover
43
+                      placement="bottom"
44
+                      width="210"
45
+                      trigger="click">
46
+                      <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
47
+                      <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
48
+                      <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
2 49
 
50
+                    </el-popover> -->
51
+                    <!--<el-button size="small" type="primary" @click="export_detail">报表下载</el-button>-->
52
+                </div>
53
+            </div>
54
+            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56
+                      show-summary
57
+                      max-height="600"
58
+                      :span-method="merge"
59
+                      :summary-method="getTotal"
60
+                      highlight-current-row>
61
+
62
+                <el-table-column align="center" prop="name" label="患者名字">
63
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
64
+                </el-table-column>
65
+                <!--<el-table-column align="center" prop="name" label="患者类型">-->
66
+                <!--<template slot-scope="scope"></template>-->
67
+                <!--</el-table-column>-->
68
+
69
+                <el-table-column align="center" prop="item_name" label="项目类别">
70
+                    <template slot-scope="scope">{{scope.row.item_name}}</template>
71
+                </el-table-column>
72
+                <el-table-column align="center" prop="price" label="费用">
73
+                    <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
74
+                </el-table-column>
75
+                <el-table-column align="center" prop="sum" label="费用总额">
76
+                    <template slot-scope="scope">
77
+                        <div>{{scope.row.sum.toFixed(2)}}</div>
78
+                    </template>
79
+                </el-table-column>
80
+
81
+            </el-table>
82
+        </div>
83
+
84
+    </div>
3 85
 </template>
4 86
 
87
+
5 88
 <script>
89
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
90
+  import { GetSummaryDetail } from '@/api/his/his'
91
+  import { uParseTime } from '@/utils/tools'
92
+  // import NewStatementPrint from './newStatementPrint'
93
+  const moment = require('moment')
6 94
   export default {
7
-    name: 'gather'
8
-  }
9
-</script>
95
+    components: {
96
+      BreadCrumb
97
+
98
+    },
99
+    data() {
100
+      return {
101
+        crumbs: [],
102
+        tempArr: [],
103
+        sameRowArr: [],
104
+        keywords: '',
105
+
106
+        tableData: [],
107
+        chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
108
+        item_type: '0',
109
+        items: [
110
+          { id: 1, name: '药品' },
111
+          { id: 2, name: '项目' },
112
+          { id: 3, name: '耗材' },
113
+
114
+        ]
115
+
116
+      }
117
+    },
118
+    methods: {
119
+
120
+      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
121
+        if (columnIndex === 0) {
122
+          if (rowIndex % 2 === 0) {
123
+            return {
124
+              rowspan: 2,
125
+              colspan: 1
126
+            }
127
+          } else {
128
+            return {
129
+              rowspan: 0,
130
+              colspan: 0
131
+            }
132
+          }
133
+        }
134
+      },
135
+      unique(arr) {
136
+        const res = new Map()
137
+        return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
138
+      },
139
+      changeDate() {
140
+        // console.log(this.chargeDate)
141
+        this.getSummaryDetailList()
142
+      },
143
+      changeItem() {
144
+        this.getSummaryDetailList()
145
+      },
146
+      searchAction() {
147
+        this.item_type = '0'
148
+        this.getSummaryDetailList()
149
+      },
150
+      getSummaryDetailList() {
151
+        let start_time = this.chargeDate[0]
152
+        let end_time = this.chargeDate[1]
153
+        let params = {
154
+          start_time: start_time,
155
+          end_time: end_time,
156
+          type: this.item_type,
157
+          keyword: this.keywords
158
+        }
159
+        GetSummaryDetail(params).then(response => {
160
+          if (response.data.state == 0) {
161
+            this.$message.error(response.data.msg)
162
+            return false
163
+          } else {
164
+            let tempPatients = []
165
+            let tempPatientsTwo = []
166
+            this.tableData = []
167
+            let tempData = response.data.data.patients
168
+            let data = response.data.data.patients
169
+            let orders = this.unique(tempData)
170
+            for (let i = 0; i < orders.length; i++) {
171
+              let obj = {
172
+                patient_id: orders[i].id,
173
+                name: orders[i].name,
174
+                orders: []
175
+              }
176
+              for (let b = 0; b < data.length; b++) {
177
+                if (orders[i].id == data[b].id) {
178
+                  obj.orders = obj.orders.concat(data[b].orders)
179
+                }
180
+              }
181
+              tempPatients.push(obj)
182
+            }
183
+
184
+            for (let i = 0; i < tempPatients.length; i++) {
185
+              let obj = {
186
+                patient_id: tempPatients[i].patient_id,
187
+                name: tempPatients[i].name,
188
+                order_info: []
189
+              }
190
+              let orders = tempPatients[i].orders
191
+              for (let b = 0; b < orders.length; b++) {
192
+                for (let c = 0; c < orders[b].order_info.length; c++) {
193
+                  let newObj = {}
194
+
195
+                  newObj['count'] = orders[b].order_info[c].cnt
196
+                  newObj['price'] = orders[b].order_info[c].pric
197
+                  if (orders[b].order_info[c].advice_id > 0 && orders[b].order_info[c].project_id == 0) {
198
+                    newObj['type'] = 1
199
+                    newObj['item_name'] = orders[b].order_info[c].advice.advice_name
200
+                    newObj['item_id'] = orders[b].order_info[c].advice.drug_id
201
+
202
+                  }
203
+                  if (orders[b].order_info[c].advice_id == 0 && orders[b].order_info[c].project_id > 0) {
204
+                    newObj['item_id'] = orders[b].order_info[c].project.project_id
205
+                    if (orders[b].order_info[c].project.type == 2) {
206
+                      newObj['type'] = 2
207
+                      newObj['item_name'] = orders[b].order_info[c].project.project.project_name
208
+                    } else if (orders[b].order_info[c].project.type == 3) {
209
+                      newObj['type'] = 3
210
+                      newObj['item_name'] = orders[b].order_info[c].project.good_info.good_name
211
+                    }
212
+                  }
213
+                  obj.order_info.push(newObj)
214
+                }
215
+              }
216
+              tempPatientsTwo.push(obj)
217
+            }
218
+            console.log(tempPatientsTwo)
219
+
220
+            for (let d = 0; d < tempPatientsTwo.length; d++) {
221
+              tempPatientsTwo[d]['new_order_info'] = []
222
+              let project = []
223
+              let advice = []
224
+              for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
225
+                if (tempPatientsTwo[d].order_info[b].type == 1) {
226
+                  advice.push(tempPatientsTwo[d].order_info[b])
227
+                } else {
228
+                  project.push(tempPatientsTwo[d].order_info[b])
229
+                }
230
+              }
231
+              // project = this.uniqueProjectAndAdvice(project)
232
+              // advice = this.uniqueProjectAndAdvice(advice)
233
+
234
+              let obj = {}
235
+              let price = 0
236
+
237
+              let obj2 = {}
238
+              let price2 = 0
239
+
240
+              let obj3 = {}
241
+              let price3 = 0
242
+
243
+              for (let i = 0; i < project.length; i++) {
244
+                if (project[i].type == 2) {
245
+                  price = parseFloat(price.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
246
+                } else if (project[i].type == 3) {
247
+                  price3 = parseFloat(price3.toString()) + parseFloat((parseFloat(project[i].count.toString()) * parseFloat(project[i].price.toString()).toFixed(2)).toString())
248
+                }
249
+              }
250
+
10 251
 
11
-<style scoped>
252
+              for (let i = 0; i < advice.length; i++) {
253
+                price2 = parseFloat(price2.toString()) + parseFloat((parseFloat(advice[i].count.toString()) * parseFloat(advice[i].price.toString()).toFixed(2)).toString())
254
+              }
12 255
 
13
-</style>
256
+
257
+              switch (parseInt(this.item_type)) {
258
+                case 0:
259
+
260
+                  obj['sum'] = price + price2 + price3
261
+                  obj['price'] = price
262
+                  obj['item_name'] = '项目'
263
+                  obj['name'] = tempPatientsTwo[d].name
264
+                  obj['patient_id'] = tempPatientsTwo[d].patient_id
265
+                  this.tableData.push(obj)
266
+
267
+                  obj2['sum'] = price + price2 + price3
268
+                  obj2['price'] = price2
269
+                  obj2['item_name'] = '药品'
270
+                  obj2['name'] = tempPatientsTwo[d].name
271
+                  obj2['patient_id'] = tempPatientsTwo[d].patient_id
272
+                  this.tableData.push(obj2)
273
+
274
+                  obj3['sum'] = price + price2 + price3
275
+                  obj3['price'] = price3
276
+                  obj3['item_name'] = '耗材'
277
+                  obj3['name'] = tempPatientsTwo[d].name
278
+                  obj3['patient_id'] = tempPatientsTwo[d].patient_id
279
+                  this.tableData.push(obj3)
280
+                  break
281
+                case 1:
282
+                  obj2['sum'] = price2
283
+                  obj2['price'] = price2
284
+                  obj2['item_name'] = '药品'
285
+                  obj2['name'] = tempPatientsTwo[d].name
286
+                  obj2['patient_id'] = tempPatientsTwo[d].patient_id
287
+                  this.tableData.push(obj2)
288
+                  break
289
+                case 2:
290
+
291
+                  obj['sum'] = price
292
+                  obj['price'] = price
293
+                  obj['item_name'] = '项目'
294
+                  obj['name'] = tempPatientsTwo[d].name
295
+                  obj['patient_id'] = tempPatientsTwo[d].patient_id
296
+                  this.tableData.push(obj)
297
+                  break
298
+                case 3:
299
+                  obj3['sum'] = price3
300
+                  obj3['price'] = price3
301
+                  obj3['item_name'] = '耗材'
302
+                  obj3['name'] = tempPatientsTwo[d].name
303
+                  obj3['patient_id'] = tempPatientsTwo[d].patient_id
304
+                  this.tableData.push(obj3)
305
+                  break
306
+
307
+              }
308
+
309
+
310
+
311
+            }
312
+
313
+            this.handleSpanTempArr()
314
+            // this.tableData = tempPatientsTwo
315
+
316
+            // console.log(tempPatientsTwo.length)
317
+            //
318
+
319
+          }
320
+          //
321
+          // console.log('去重前')
322
+          // console.log(advice)
323
+          // console.log(project)
324
+          // //
325
+          // //
326
+
327
+          // //
328
+          // console.log('去重后')
329
+          //
330
+          // console.log(advice.length)
331
+          // console.log(project.length)
332
+          //
333
+          // for (let i = 0; i < project.length; i++) {
334
+          //   let obj = {}
335
+          //   let count = 0
336
+          //   for (let a = 0; a < tempPatientsTwo.length; a++) {
337
+          //     if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
338
+          //       count = count + tempPatientsTwo[a].count
339
+          //       obj['count'] = count
340
+          //
341
+          //     }
342
+          //     obj['price'] = project[i].price
343
+          //     obj['type'] = project[i].type
344
+          //     obj['item_name'] = project[i].item_name
345
+          //     obj['item_id'] = project[i].item_id
346
+          //     obj['name'] = project[i].name
347
+          //     obj['patient_id'] = project[i].patient_id
348
+          //     obj['count'] = count
349
+          //     this.tableData.push(obj)
350
+          //   }
351
+          // }
352
+          //
353
+          //
354
+          // for (let i = 0; i < advice.length; i++) {
355
+          //   let obj = {}
356
+          //   let count = 0
357
+          //   for (let a = 0; a < tempPatientsTwo.length; a++) {
358
+          //     if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
359
+          //       count = count + tempPatientsTwo[a].count
360
+          //       obj['count'] = count
361
+          //
362
+          //     }
363
+          //     obj['price'] = advice[i].price
364
+          //     obj['type'] = advice[i].type
365
+          //     obj['item_name'] = advice[i].item_name
366
+          //     obj['item_id'] = advice[i].item_id
367
+          //     obj['name'] = advice[i].name
368
+          //     obj['patient_id'] = advice[i].patient_id
369
+          //     this.tableData.push(obj)
370
+          //   }
371
+          // }
372
+          // console.log(this.tableData.length)
373
+          // this.tableData = this.sort(this.tableData)
374
+
375
+        })
376
+      }, uniqueProjectAndAdvice(array) {
377
+        // res用来存储结果
378
+        var res = []
379
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
380
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
381
+            if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
382
+              break
383
+            }
384
+          }
385
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
386
+          if (j === resLen) {
387
+            res.push(array[i])
388
+          }
389
+        }
390
+        return res
391
+      }, sort(arr) {
392
+        for (var i = 0; i < arr.length - 1; i++) {
393
+          for (var j = 0; j < arr.length - i - 1; j++) {
394
+            if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
395
+              var hand = arr[j]
396
+              arr[j] = arr[j + 1]
397
+              arr[j + 1] = hand
398
+
399
+            }
400
+          }
401
+        }
402
+        return arr
403
+      }, handleSpanTempArr() {
404
+        this.tempArr = []
405
+
406
+        for (let i = 0; i < this.tableData.length; i++) {
407
+          if (i === 0) {
408
+            this.tempArr.push(1)
409
+            this.pos = 0
410
+          } else {
411
+            // 判断当前元素与上一个元素是否相同
412
+            if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
413
+              this.tempArr[this.pos] += 1
414
+              this.tempArr.push(0)
415
+            } else {
416
+              this.tempArr.push(1)
417
+              this.pos = i
418
+            }
419
+          }
420
+        }
421
+
422
+        let sameRowArr = [], sIdx = 0
423
+        this.tableData.forEach((item, index) => {
424
+          item.index = index
425
+          if (index === 0) {
426
+            sameRowArr.push([index])
427
+          } else {
428
+            if (item.patient_id === this.tableData[index - 1].patient_id) {
429
+              sameRowArr[sIdx].push(index)
430
+            } else {
431
+              sIdx = sIdx + 1
432
+              sameRowArr.push([index])
433
+            }
434
+          }
435
+        })
436
+        this.sameRowArr = sameRowArr
437
+      }, merge({ row, column, rowIndex, columnIndex }) {
438
+        if (columnIndex === 0 || columnIndex === 3) {
439
+          const _row = this.tempArr[rowIndex]
440
+          const _col = _row > 0 ? 1 : 0
441
+          return {
442
+            rowspan: _row,
443
+            colspan: _col
444
+          }
445
+        }
446
+      }, getTotal(param) {
447
+        const { columns, data } = param
448
+        const sums = []
449
+        columns.forEach((column, index) => {
450
+          if (index === 0) {
451
+            sums[index] = '合计'
452
+            return
453
+          }
454
+          const values = data.map(item => Number(item[column.property]))
455
+          if (column.property === 'sum') {
456
+            sums[index] = values.reduce((prev, curr) => {
457
+              const value = Number(curr)
458
+              if (!isNaN(value)) {
459
+                return prev+ curr
460
+              } else {
461
+                return prev
462
+              }
463
+            }, 0)
464
+            sums[index] = sums[index].toFixed(2)
465
+          } else {
466
+            sums[index] = '--'
467
+          }
468
+        })
469
+
470
+        return sums
471
+      }
472
+    },
473
+    created() {
474
+      this.getSummaryDetailList()
475
+
476
+    }
477
+  }
478
+</script>

+ 470 - 5
src/xt_pages/outpatientTool/components/settle.vue Parādīt failu

@@ -1,13 +1,478 @@
1 1
 <template>
2
+    <div class="main-contain outpatientChargesManagement">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+        </div>
6
+        <div class="app-container">
7
+            <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
+                <div>
9
+                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
+                    <!--@click="Action">-->
11
+                    <!--导出-->
12
+                    <!--</el-button>-->
13
+                    <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
+                              @keyup.enter.native='searchAction'
15
+                              class="filter-item"/>
16
+                    <el-select size="small" v-model="item_type" placeholder="请选择"
17
+                               style="width:150px;margin-left:10px;" @change="changeItem">
18
+                        <el-option
19
+                                label="全部"
20
+                                value="0">
21
+                        </el-option>
22
+                        <el-option
23
+                                v-for="item,index in items"
24
+                                :key="index"
25
+                                :label="item.name"
26
+                                :value="item.id">
27
+                        </el-option>
28
+                    </el-select>
29
+                    <el-date-picker
30
+                            v-model="chargeDate"
31
+                            type="daterange"
32
+                            value-format="yyyy-MM-dd"
33
+                            range-separator="至"
34
+                            start-placeholder="开始日期"
35
+                            @change="changeDate"
36
+                            end-placeholder="结束日期">
37
+                    </el-date-picker>
38
+                    <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
39
+                    <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
40
+                </div>
41
+                <div>
42
+                    <!-- <el-popover
43
+                      placement="bottom"
44
+                      width="210"
45
+                      trigger="click">
46
+                      <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
47
+                      <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
48
+                      <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
2 49
 
50
+                    </el-popover> -->
51
+                    <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
52
+                </div>
53
+            </div>
54
+            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56
+                      show-summary
57
+                      max-height="600"
58
+                      :span-method="merge"
59
+                      :summary-method="getTotal"
60
+                      highlight-current-row>
61
+
62
+                <el-table-column align="center" prop="name" label="患者名字">
63
+                    <template slot-scope="scope">{{ scope.row.other_name }}</template>
64
+                </el-table-column>
65
+                <el-table-column align="center" prop="item_name" label="结算日期">
66
+                    <template slot-scope="scope">
67
+                        {{scope.row.setl_time?scope.row.setl_time:getTimes(scope.row.settle_accounts_date)}}
68
+                    </template>
69
+                </el-table-column>
70
+
71
+                <el-table-column align="center" prop="item_name" label="结算类型">
72
+                    <template slot-scope="scope">
73
+                        <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
74
+                        <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
75
+                    </template>
76
+                </el-table-column>
77
+                <el-table-column align="center" prop="item_name" label="处方类型">
78
+                    <template slot-scope="scope">
79
+                        <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
80
+                        <div v-if="scope.row.med_type == '11'">普通门诊</div>
81
+                    </template>
82
+                </el-table-column>
83
+                <el-table-column align="center" prop="item_name" label="医疗费总额">
84
+                    <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
85
+                </el-table-column>
86
+                <el-table-column align="center" prop="item_name" label="基金支付金额">
87
+                    <template slot-scope="scope">{{scope.row.fund_pay_sumamt}}</template>
88
+                </el-table-column>
89
+                <el-table-column align="center" prop="item_name" label="个人账户支付金额">
90
+                    <template slot-scope="scope">{{scope.row.acct_pay}}</template>
91
+                </el-table-column>
92
+                <el-table-column align="center" prop="item_name" label="个人支付金额">
93
+                    <template slot-scope="scope">{{scope.row.psn_cash_pay}}</template>
94
+                </el-table-column>
95
+                <el-table-column align="center" prop="total" label="费用总额">
96
+                    <template slot-scope="scope">
97
+                        <div>{{scope.row.total.toFixed(2)}}</div>
98
+                    </template>
99
+                </el-table-column>
100
+
101
+            </el-table>
102
+        </div>
103
+
104
+    </div>
3 105
 </template>
4 106
 
107
+
5 108
 <script>
109
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
110
+  import { GetSummarySettle } from '@/api/his/his'
111
+  import { uParseTime } from '@/utils/tools'
112
+  // import NewStatementPrint from './newStatementPrint'
113
+  const moment = require('moment')
6 114
   export default {
7
-    name: 'settle'
8
-  }
9
-</script>
115
+    components: {
116
+      BreadCrumb
117
+
118
+    },
119
+    data() {
120
+      return {
121
+        crumbs: [],
122
+        tempArr: [],
123
+        sameRowArr: [],
124
+        tableData: [],
125
+        chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
126
+        item_type: '0',
127
+        items: [
128
+          { id: 1, name: '医保' },
129
+          { id: 2, name: '自费' },
130
+          { id: 3, name: '门诊特殊病' },
131
+          { id: 4, name: '普通门诊' }
132
+
133
+        ]
134
+
135
+      }
136
+    },
137
+    methods: {
138
+      getTimes(time) {
139
+        return uParseTime(time, '{y}-{m}-{d}')
140
+      },
141
+      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
142
+        if (columnIndex === 0) {
143
+          if (rowIndex % 2 === 0) {
144
+            return {
145
+              rowspan: 2,
146
+              colspan: 1
147
+            }
148
+          } else {
149
+            return {
150
+              rowspan: 0,
151
+              colspan: 0
152
+            }
153
+          }
154
+        }
155
+      },
156
+      unique(arr) {
157
+        const res = new Map()
158
+        return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
159
+      },
160
+      changeDate() {
161
+        // console.log(this.chargeDate)
162
+        this.getSummarySettleList()
163
+      },
164
+      changeItem() {
165
+        this.getSummarySettleList()
166
+
167
+      },
168
+      searchAction() {
169
+        this.item_type = '0'
170
+        this.getSummarySettleList()
171
+
172
+      },
173
+      getSummarySettleList() {
174
+        let start_time = this.chargeDate[0]
175
+        let end_time = this.chargeDate[1]
176
+        let params = {
177
+          start_time: start_time,
178
+          end_time: end_time,
179
+          type: this.item_type,
180
+          keyword: this.keywords
181
+        }
182
+        GetSummarySettle(params).then(response => {
183
+          if (response.data.state == 0) {
184
+            this.$message.error(response.data.msg)
185
+            return false
186
+          } else {
187
+            this.tableData = []
188
+            let data = response.data.data.patients
189
+
190
+            for (let i = 0; i < data.length; i++) {
191
+              let total = 0
192
+              for (let b = 0; b < data[i].orders.length; b++) {
193
+                let order = data[i].orders[b]
194
+                order['other_name'] = data[i].name
195
+                total = parseFloat((parseFloat(total.toString()) + parseFloat(data[i].orders[b].medfee_sumamt.toString())).toFixed(2).toString())
196
+              }
197
+
198
+              data[i]['total'] = total
199
+            }
200
+            console.log(data)
201
+
202
+            for (let i = 0; i < data.length; i++) {
203
+              for (let b = 0; b < data[i].orders.length; b++) {
204
+                let order = data[i].orders[b]
205
+                order['total'] = data[i].total
206
+                this.tableData.push(order)
207
+
208
+              }
209
+            }
210
+            console.log(this.tableData)
211
+
212
+            this.handleSpanTempArr()
213
+          }
214
+        })
215
+      }, uniqueProjectAndAdvice(array) {
216
+        // res用来存储结果
217
+        var res = []
218
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
219
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
220
+            if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
221
+              break
222
+            }
223
+          }
224
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
225
+          if (j === resLen) {
226
+            res.push(array[i])
227
+          }
228
+        }
229
+        return res
230
+      }, sort(arr) {
231
+        for (var i = 0; i < arr.length - 1; i++) {
232
+          for (var j = 0; j < arr.length - i - 1; j++) {
233
+            if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
234
+              var hand = arr[j]
235
+              arr[j] = arr[j + 1]
236
+              arr[j + 1] = hand
237
+
238
+            }
239
+          }
240
+        }
241
+        return arr
242
+      }, handleSpanTempArr() {
243
+        this.tempArr = []
244
+
245
+        for (let i = 0; i < this.tableData.length; i++) {
246
+          if (i === 0) {
247
+            this.tempArr.push(1)
248
+            this.pos = 0
249
+          } else {
250
+            // 判断当前元素与上一个元素是否相同
251
+            if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
252
+              this.tempArr[this.pos] += 1
253
+              this.tempArr.push(0)
254
+            } else {
255
+              this.tempArr.push(1)
256
+              this.pos = i
257
+            }
258
+          }
259
+        }
260
+
261
+        let sameRowArr = [], sIdx = 0
262
+        this.tableData.forEach((item, index) => {
263
+          item.index = index
264
+          if (index === 0) {
265
+            sameRowArr.push([index])
266
+          } else {
267
+            if (item.patient_id === this.tableData[index - 1].patient_id) {
268
+              sameRowArr[sIdx].push(index)
269
+            } else {
270
+              sIdx = sIdx + 1
271
+              sameRowArr.push([index])
272
+            }
273
+          }
274
+        })
275
+        this.sameRowArr = sameRowArr
276
+      }, merge({ row, column, rowIndex, columnIndex }) {
277
+        if (columnIndex === 0 || columnIndex === 8) {
278
+          const _row = this.tempArr[rowIndex]
279
+          const _col = _row > 0 ? 1 : 0
280
+          return {
281
+            rowspan: _row,
282
+            colspan: _col
283
+          }
284
+        }
285
+      }, getTotal(param) {
286
+        const { columns, data } = param
287
+        const sums = []
288
+        columns.forEach((column, index) => {
289
+          if (index === 0) {
290
+            sums[index] = '合计'
291
+            return
292
+          }
293
+          const values = data.map(item => Number(item[column.property]))
294
+          if (column.property === 'total') {
295
+            sums[index] = values.reduce((prev, curr) => {
296
+              const value = Number(curr)
297
+              if (!isNaN(value)) {
298
+                return prev + curr
299
+              } else {
300
+                return prev
301
+              }
302
+            }, 0)
303
+            sums[index] = sums[index].toFixed(2)
304
+          } else {
305
+            sums[index] = '--'
306
+          }
307
+        })
308
+
309
+        return sums
310
+      }, export_detail() {
311
+
312
+        let list = []
313
+        for (let i = 0; i < this.tableData.length; i++) {
314
+          let order = this.tableData[i]
315
+          let name = ''
316
+          let time = ''
317
+          let balance_accounts = ""
318
+          let med_type = ""
319
+
320
+          if (order.is_medicine_insurance == 0) {
321
+            balance_accounts = '自费'
322
+          }
323
+
324
+          if (order.is_medicine_insurance == 1) {
325
+            balance_accounts = '医保'
326
+          }
327
+
328
+          if (order.med_type == '14') {
329
+            med_type = '门诊特殊病'
330
+          }
331
+
332
+          if (order.med_type == '11') {
333
+            med_type = '普通门诊'
334
+          }
10 335
 
11
-<style scoped>
336
+          let number = ''
12 337
 
13
-</style>
338
+          let department = ''
339
+          let doctor_name = ''
340
+          let order_status = ''
341
+          let charge_name = ''
342
+          let insutypeName = ''
343
+
344
+
345
+
346
+
347
+
348
+          if (order.patient != null && order.patient.name.length > 0) {
349
+            name = order.patient.name
350
+
351
+          }
352
+
353
+          if (order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0) {
354
+            department = order.p_info.department.name
355
+
356
+          }
357
+
358
+          if (order.p_info != null && order.p_info.doctor.length > 0) {
359
+            doctor_name = order.p_info.doctor
360
+          }
361
+
362
+          if (order.creator != null) {
363
+            charge_name = this.getName(order.creator)
364
+          }
365
+          if (order.insutype == '390') {
366
+
367
+            insutypeName = '城乡居民基本医疗保险'
368
+          } else if (order.insutype == '310') {
369
+            insutypeName = '职工基本医疗保险'
370
+
371
+          }
372
+
373
+          if (order.order_status == 1) {
374
+            order_status = '待结算'
375
+          }
376
+
377
+          if (order.order_status == 2) {
378
+            order_status = '已结算'
379
+          }
380
+
381
+          if (order.order_status == 3) {
382
+            order_status = '已退费'
383
+          }
384
+
385
+          if (order.settle_type == 2) {
386
+            time = this.getTimes(order.settle_start_time)
387
+          } else {
388
+            time = this.getTimes(order.settle_accounts_date)
389
+          }
390
+
391
+          var hifmi_pay = 0.00
392
+
393
+          if (order.setl_detail.length > 0) {
394
+            var jsonObj = JSON.parse(order.setl_detail)
395
+            for (let i = 0; i < jsonObj.length; i++) {
396
+              if (order.insutype == '310') {
397
+                if (jsonObj[i].fund_pay_type == '310300') {
398
+                  hifmi_pay = jsonObj[i].fund_payamt
399
+                }
400
+
401
+              } else if (order.insutype == '390') {
402
+                if (order.fund_pay_type == '390200') {
403
+                  hifmi_pay = jsonObj[i].fund_payamt
404
+                }
405
+              }
406
+            }
407
+          }
408
+          var hifmi_pay = 0.00
409
+
410
+          if (order.setl_detail.length > 0) {
411
+            var jsonObj = JSON.parse(order.setl_detail)
412
+            for (let i = 0; i < jsonObj.length; i++) {
413
+              if (order.insutype == '310') {
414
+                if (jsonObj[i].fund_pay_type == '310300') {
415
+                  hifmi_pay = jsonObj[i].fund_payamt
416
+                }
417
+              }
418
+              if (order.insutype == '390') {
419
+                if (jsonObj[i].fund_pay_type == '390200') {
420
+                  hifmi_pay = jsonObj[i].fund_payamt
421
+                }
422
+              }
423
+            }
424
+          }
425
+
426
+          let obj = {
427
+            '就诊号': order.mdtrt_id,
428
+            '患者姓名': name,
429
+            '开处时间': time,
430
+            '险种类型': insutypeName,
431
+            '应收金额': order.medfee_sumamt,
432
+            '实收金额': order.medfee_sumamt,
433
+            '医保统筹金额': order.hifp_pay,
434
+            '大额基金金额': order.hifob_pay,
435
+            '大病基金金额': hifmi_pay,
436
+            '补充保险基金金额': order.hifes_pay,
437
+            '医疗救助基金金额': order.maf_pay,
438
+            '公务员基金': order.cvlserv_pay,
439
+            '个人支付基金': order.psn_cash_pay,
440
+            '个人账户支付金额': order.acct_pay,
441
+            '科室': department,
442
+            '医生姓名': doctor_name,
443
+            '收费类别': balance_accounts,
444
+            '收费者姓名': charge_name,
445
+            '总金额': order.medfee_sumamt,
446
+            '现金支付': '',
447
+            '账户支付': '',
448
+            '支付宝支付': '',
449
+            '微信支付': '',
450
+            '其他支付': '',
451
+            '收费时间': order.setl_time,
452
+            '收费状态': order_status,
453
+            '退费日期': ''
454
+          }
455
+
456
+          list.push(obj)
457
+        }
458
+        import('@/vendor/Export2Excel').then(excel => {
459
+          const tHeader = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
460
+          const filterVal = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
461
+          const data = this.formatJson(filterVal, list)
462
+          excel.export_json_to_excel({
463
+            header: tHeader,
464
+            data,
465
+            filename: '消费明细'
466
+          })
467
+        })
468
+
469
+      }, formatJson(filterVal, jsonData) {
470
+        return jsonData.map(v => filterVal.map(j => v[j]))
471
+      }
472
+    },
473
+    created() {
474
+      this.getSummarySettleList()
475
+
476
+    }
477
+  }
478
+</script>

+ 2 - 2
src/xt_pages/outpatientTool/summary.vue Parādīt failu

@@ -16,8 +16,8 @@
16 16
 
17 17
                 </div>
18 18
                 <detail v-if="titleType == '明细'"></detail>
19
-                <settle v-if="titleType == '汇总'"></settle>
20
-                <gather v-if="titleType == '结算'"></gather>
19
+                <gather v-if="titleType == '汇总'"></gather>
20
+                <settle v-if="titleType == '结算'"></settle>
21 21
             </div>
22 22
         </div>
23 23
     </div>

+ 1 - 1
src/xt_pages/workforce/components/nextTableWeeks.vue Parādīt failu

@@ -149,7 +149,7 @@
149 149
              <span v-if="scope.row.dialysissolution.dialyzer_perfusion_apparatus!=''">
150 150
                 <span v-if="org_id!=10131&& org_id !=10215">{{ scope.row.dialysissolution.dialyzer_perfusion_apparatus }}</span>
151 151
                 <span v-if="org_id==10131 || org_id == 10215">{{ scope.row.dialysissolution.dialyzer_perfusion_apparatus }}</span>
152
-                <!-- <span v-if="org_id ==10131">{{getDialysisDialyszerPerfusionOne(scope.row.patient_id)}}</span> -->
152
+              
153 153
               </span>
154 154
              <span v-if="scope.row.dialysissolution.dialyzer_perfusion_apparatus =='' && scope.row.dialysissolution.length>0 ">{{ getDialysisDialyszerPerfusion(scope.row.patient_id) }}</span>
155 155
           </span>

+ 1 - 3
src/xt_pages/workforce/components/tableWeeks.vue Parādīt failu

@@ -978,9 +978,9 @@
978 978
         getScheduleList(params).then(response => {
979 979
           if (response.data.state == 1) {
980 980
             this.isloading = false
981
-
982 981
             console.log('22333333333', this.pre_status)
983 982
             var list = response.data.data.list
983
+            console.log("list33333333333333333333",list)
984 984
             if (this.pre_status == 0) {
985 985
 
986 986
               for (let i = 0; i < list.length; i++) {
@@ -1537,8 +1537,6 @@
1537 1537
         this.week_type = 7
1538 1538
       }
1539 1539
       this.org_id = this.$store.getters.xt_user.org.id
1540
-     
1541
-     
1542 1540
     }
1543 1541
   }
1544 1542
 </script>

+ 1 - 2
src/xt_pages/workforce/next_remind_print.vue Parādīt failu

@@ -63,8 +63,7 @@
63 63
                 <td :width="td_1_width" v-if="printObj.dialyzers == 1 && printObj.perfusion_apparatus == 1">
64 64
                  <span v-if="org_id!=9987">
65 65
                      <span v-if="main_collection.prescription.dialyzer_perfusion_apparatus!=''">
66
-                        <span v-if="org_id!=10131">{{main_collection.prescription.dialyzer_perfusion_apparatus}}</span>
67
-                        <!-- <span v-if="org_id==10131">{{getDialysisDialyszerPerfusionOne(main_collection.prescription.patient_id)}}</span>  -->
66
+                        <span v-if="org_id!=10131 && org_id!=10215">{{main_collection.prescription.dialyzer_perfusion_apparatus}}</span>
68 67
                          <span v-if="org_id==10131 || org_id==9671 || org_id == 10215">{{main_collection.dialysissolution.dialyzer_perfusion_apparatus}}</span>
69 68
                      </span>
70 69
                      <span v-if="main_collection.prescription.dialyzer_perfusion_apparatus ==''&& main_collection.dialysissolution.length>0">{{getDialysisDialyszerPerfusion(main_collection.patient_id)}}</span>

+ 3 - 3
src/xt_pages/workforce/remind_print.vue Parādīt failu

@@ -59,12 +59,12 @@
59 59
                 <td :width="td_1_width" v-if="printObj.mode == 1">
60 60
                   {{modeOptions[main_collection.mode_id].name}}
61 61
                 </td>
62
-                
62
+
63 63
                 <td :width="td_1_width" v-if="printObj.dialyzers == 1 && printObj.perfusion_apparatus ==1">
64 64
                   <span v-if="org_id!=9987">
65 65
                      <span > 
66
-                       <span v-if="org_id!=10131 && main_collection.prescription.dialyzer_perfusion_apparatus!=''">{{main_collection.prescription.dialyzer_perfusion_apparatus}}</span> 
67
-                       <!-- <span v-if="org_id==10131 || org_id==9671 || org_id == 10215">{{getDialysisDialyszerPerfusionOne(main_collection.prescription.patient_id)}}</span>  -->
66
+                       <span v-if="org_id!=10131 && org_id!=10215 && main_collection.prescription.dialyzer_perfusion_apparatus!=''">{{main_collection.prescription.dialyzer_perfusion_apparatus}}</span> 
67
+                     
68 68
                        <span v-if="org_id==10131 || org_id==9671 || org_id == 10215">{{main_collection.dialysissolution.dialyzer_perfusion_apparatus}}</span>
69 69
                       </span>
70 70
                      <span v-if="main_collection.prescription.dialyzer_perfusion_apparatus ==''&& main_collection.dialysissolution.length>0">{{getDialysisDialyszerPerfusion(main_collection.patient_id)}}</span>