See999 4 years ago
parent
commit
c3256bd74a

+ 1 - 0
src/lang/zh.js View File

@@ -204,6 +204,7 @@ export default {
204 204
     scrm: 'SCRM',
205 205
     shop: '分销商城',
206 206
 
207
+    incomeStatistics:'收入统计',
207 208
     outpatientRegistration:'门诊挂号',
208 209
     outpatientRegistrationIndex:'门诊挂号',
209 210
     outpatientRegistrationRegistrationHistory:'挂号历史',

+ 6 - 0
src/router/modules/outpatientCharges.js View File

@@ -42,6 +42,12 @@ export default {
42 42
         name: 'summary',
43 43
         meta: { title: 'summary', noCache: true }
44 44
     },
45
+    {
46
+        path: '/outpatientCharges/incomeStatistics',
47
+        component: () => import('@/xt_pages/outpatientCharges/incomeStatistics'),
48
+        name: 'incomeStatistics',
49
+        meta: { title: 'incomeStatistics', noCache: true }
50
+    },
45 51
     {
46 52
         path: '/outpatientCharges/summaryDetail',
47 53
         component: () => import('@/xt_pages/outpatientCharges/summaryDetail'),

+ 320 - 0
src/xt_pages/outpatientCharges/incomeStatistics.vue View File

@@ -0,0 +1,320 @@
1
+<template>
2
+  <div class="main-contain incomeStatistics">
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-input size="small" style="width:150px;"  v-model="keywords"
10
+                    class="filter-item"/>
11
+          <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary" @click="searchAction">
12
+            搜索
13
+          </el-button>
14
+          <el-select size="small" v-model="admin_user_id" placeholder="请选择" style="width:150px;margin-left:10px;" @change="changeDoctor">
15
+            <el-option
16
+              label="全部"
17
+              value="0">
18
+            </el-option>
19
+            <el-option
20
+              v-for="(item,index) in type"
21
+              :key="index"
22
+              :label="item.user_name"
23
+              :value="item.admin_user_id">
24
+            </el-option>
25
+          </el-select>
26
+          <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date"
27
+                          @change="handleStartTimeChange" :editable="false" :clearable="false"
28
+                          style="width: 196px;margin-right:10px;" type="date" placeholder="选择开始日期"
29
+                          format="yyyy-MM-dd"
30
+                          value-format="yyyy-MM-dd"
31
+                          align="right"></el-date-picker>
32
+
33
+          <el-date-picker size="small" v-model="end_time" prefix-icon="el-icon-date"
34
+                          @change="handleEndTimeChange" :editable="false" :clearable="false"
35
+                          style="width: 196px;margin-right:10px;" type="date" placeholder="选择结束日期"
36
+                          format="yyyy-MM-dd"
37
+                          value-format="yyyy-MM-dd"
38
+                          align="right"></el-date-picker>
39
+          <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
40
+          <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
41
+        </div>
42
+        <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
43
+      </div>
44
+      <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }"
45
+                :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
46
+        <el-table-column
47
+          prop="date"
48
+          label="序号"
49
+          width="60"
50
+          align="center"
51
+          type="index"
52
+        >
53
+        </el-table-column>
54
+        <el-table-column align="center" prop="name" label="就诊号">
55
+          <template slot-scope="scope">{{ scope.row.his_patient.number }}</template>
56
+        </el-table-column>
57
+        <el-table-column align="center" prop="name" label="患者名字">
58
+          <template slot-scope="scope">{{ scope.row.patient.name }}</template>
59
+        </el-table-column>
60
+        <!--<el-table-column align="center" prop="name" label="患者类型">-->
61
+          <!--<template slot-scope="scope"></template>-->
62
+        <!--</el-table-column>-->
63
+        <el-table-column align="center" prop="name" label="应收金额">
64
+          <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
65
+        </el-table-column>
66
+        <el-table-column align="center" prop="name" label="实收金额">
67
+          <template slot-scope="scope">{{scope.row.reality_price}}</template>
68
+        </el-table-column>
69
+        <el-table-column align="center" prop="name" label="科室">
70
+          <template slot-scope="scope">{{scope.row.p_info.department.name}}</template>
71
+        </el-table-column>
72
+        <el-table-column align="center" prop="name" label="收费日期">
73
+          <template slot-scope="scope">  {{getTimes(scope.row.settle_accounts_date)}}</template>
74
+        </el-table-column>
75
+        <el-table-column align="center" prop="name" label="收费员">
76
+          <template slot-scope="scope">{{ scope.row.p_info.doctor }}</template>
77
+        </el-table-column>
78
+        <el-table-column align="center" prop="name" label="状态">
79
+          <template slot-scope="scope">
80
+            <div v-if="scope.row.order_status == 1">待结算</div>
81
+            <div v-if="scope.row.order_status == 2">已结算</div>
82
+            <div v-if="scope.row.order_status == 3">已退费</div>
83
+          </template>
84
+        </el-table-column>
85
+        <el-table-column align="center" prop="name" label="操作">
86
+          <template slot-scope="scope">
87
+            <el-button size="mini" type="primary" @click="toDetail(scope.row)">详情</el-button>
88
+          </template>
89
+        </el-table-column>
90
+      </el-table>
91
+      <el-pagination
92
+        @size-change="handleSizeChange"
93
+        @current-change="handleCurrentChange"
94
+        :page-sizes="[10, 50, 100]"
95
+        :page-size="10"
96
+        background
97
+        style="margin-top:20px;float: right"
98
+        layout="total, sizes, prev, pager, next, jumper"
99
+        :total="total"
100
+
101
+      >
102
+      </el-pagination>
103
+    </div>
104
+
105
+
106
+  </div>
107
+</template>
108
+
109
+
110
+<script>
111
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
112
+  import { getHisOrderList,getDoctorList,getExportConsumeDetailList } from '@/api/his/his'
113
+  import { uParseTime } from '@/utils/tools'
114
+
115
+  export default {
116
+    components: {
117
+      BreadCrumb
118
+    },
119
+    data() {
120
+      return {
121
+        crumbs: [
122
+          { path: false, name: '门诊收费' },
123
+          { path: false, name: '项目消费明细汇总' }
124
+        ],
125
+        tableData: [],
126
+        limit:10,
127
+        page:1,
128
+        keywords:"",
129
+        start_time:"",
130
+        end_time:"",
131
+        total:"",
132
+        doctors:[],
133
+        admin_user_id:"",
134
+
135
+      }
136
+    },
137
+    methods: {
138
+      export_detail(){
139
+        let params= {
140
+          start_time:this.start_time,
141
+          end_time: this.end_time,
142
+        }
143
+        getExportConsumeDetailList(params).then(response => {
144
+          if (response.data.state == 0) {
145
+            this.$message.error(response.data.msg)
146
+            return false
147
+          } else {
148
+
149
+            let list = []
150
+            for (let i =0; i < response.data.data.order.length; i++){
151
+            let order =   response.data.data.order[i]
152
+              let number = ""
153
+              let name = ""
154
+              let department = ""
155
+              let doctor_name = ""
156
+              let balance_accounts = ""
157
+
158
+              let order_status = ""
159
+
160
+
161
+
162
+              if(order.his_patient != null && order.his_patient.number.length > 0){
163
+                number = order.his_patient.number
164
+
165
+              }
166
+
167
+              if(order.his_patient != null ){
168
+                if(order.his_patient.balance_accounts_type == 1){
169
+                  balance_accounts = "自费"
170
+                }
171
+
172
+                if(order.his_patient.balance_accounts_type == 2){
173
+                  balance_accounts = "医保"
174
+                }
175
+              }
176
+
177
+              if(order.patient != null && order.patient.name.length > 0){
178
+                name = order.patient.name
179
+
180
+              }
181
+
182
+              if(order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0){
183
+                department = order.p_info.department.name
184
+
185
+              }
186
+
187
+              if(order.p_info != null && order.p_info.doctor.length > 0){
188
+                doctor_name = order.p_info.doctor
189
+              }
190
+
191
+              if(order.order_status == 1){
192
+                order_status = "待结算"
193
+              }
194
+
195
+              if(order.order_status == 2){
196
+                order_status = "已结算"
197
+              }
198
+
199
+              if(order.order_status == 3){
200
+                order_status = "已退费"
201
+              }
202
+
203
+
204
+              let obj = {
205
+                "就诊号":number,
206
+                "患者姓名":name,
207
+                "应收金额":order.medfee_sumamt,
208
+                "实收金额":order.medfee_sumamt,
209
+                "科室":department,
210
+                "医生姓名":doctor_name,
211
+                "收费类别":balance_accounts,
212
+                "收费者姓名":doctor_name,
213
+                "总金额":order.medfee_sumamt,
214
+                "现金支付":"",
215
+                "账户支付":"",
216
+                "支付宝支付":"",
217
+                "微信支付":"",
218
+                "其他支付":"",
219
+                "收费日期":"",
220
+                "收费状态":order_status,
221
+                "退费日期":"",
222
+              }
223
+              list.push(obj)
224
+            }
225
+            import('@/vendor/Export2Excel').then(excel => {
226
+              const tHeader = ['就诊号', '患者姓名', '应收金额', '实收金额', '科室',"医生姓名","收费类别","收费者姓名","总金额","现金支付","账户支付","支付宝支付","微信支付","其他支付","收费日期","收费状态","退费日期"]
227
+              const filterVal = ['就诊号', '患者姓名', '应收金额', '实收金额', '科室',"医生姓名","收费类别","收费者姓名","总金额","现金支付","账户支付","支付宝支付","微信支付","其他支付","收费日期","收费状态","退费日期"]
228
+              const data = this.formatJson(filterVal, list)
229
+              excel.export_json_to_excel({
230
+                header: tHeader,
231
+                data,
232
+                filename: "消费明细"
233
+              })
234
+            })
235
+
236
+          }
237
+        })
238
+
239
+      },  formatJson(filterVal, jsonData) {
240
+        return jsonData.map(v => filterVal.map(j => v[j]))
241
+      },
242
+      changeDoctor(){
243
+        this.page = 1
244
+        this.keywords=""
245
+        this.getHisOrderList()
246
+      },
247
+      handleSizeChange(limit){
248
+        this.limit = limit;
249
+        this.getHisOrderList()
250
+
251
+      },handleCurrentChange(page){
252
+        this.page = page;
253
+        this.getHisOrderList()
254
+
255
+
256
+      },
257
+      handleStartTimeChange(){
258
+        this.page = 1
259
+        this.keywords=""
260
+        this.getHisOrderList()
261
+      },handleEndTimeChange(){
262
+        this.page = 1
263
+        this.keywords=""
264
+        this.getHisOrderList()
265
+      },
266
+      searchAction(){
267
+        this.page = 1
268
+        this.getHisOrderList()
269
+
270
+
271
+      },
272
+      getTimes(time) {
273
+        return uParseTime(time, "{y}-{m}-{d}");
274
+      },
275
+      toDetail(row) {
276
+        this.$router.push('/outpatientCharges/summaryDetail?patient_id='+row.patient.id+"&number="+row.number)
277
+      }, getTime(value, temp) {
278
+        if (value != undefined) {
279
+          return uParseTime(value, temp)
280
+        }
281
+        return ''
282
+      },getHisOrderList(){
283
+        let params= {
284
+          page : this.page,
285
+          limit: this.limit,
286
+          keywords:this.keywords,
287
+          start_time:this.start_time,
288
+          end_time: this.end_time,
289
+          type: this.admin_user_id
290
+        }
291
+        getHisOrderList(params).then(response => {
292
+          if (response.data.state == 0) {
293
+            this.$message.error(response.data.msg)
294
+            return false
295
+          } else {
296
+            this.tableData = response.data.data.order
297
+            this.total = response.data.data.total
298
+          }
299
+        })
300
+
301
+      },getDoctorList(){
302
+        getDoctorList().then(response => {
303
+          if (response.data.state == 0) {
304
+            this.$message.error(response.data.msg)
305
+            return false
306
+          } else {
307
+            this.doctors = response.data.data.doctors
308
+          }
309
+        })
310
+
311
+
312
+      }
313
+    }, created() {
314
+     this.getDoctorList()
315
+     this.getHisOrderList()
316
+
317
+
318
+    }
319
+  }
320
+</script>