Browse Source

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

28169 1 year ago
parent
commit
f9cd29f8b6
48 changed files with 12590 additions and 4782 deletions
  1. 23 0
      src/api/qcd.js
  2. 2 1
      src/lang/zh.js
  3. 7 3
      src/router/index.js
  4. 107 46
      src/router/modules/Dialysisanalysis.js
  5. 1 1
      src/views/layout/components/Sidebar/index.vue
  6. 334 227
      src/xt_pages/Dialysisanalysis/albumin/albuminall.vue
  7. 627 199
      src/xt_pages/Dialysisanalysis/albumin/albuminalone.vue
  8. 334 227
      src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusall.vue
  9. 627 198
      src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusalone.vue
  10. 333 227
      src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumall.vue
  11. 627 198
      src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumalone.vue
  12. 334 227
      src/xt_pages/Dialysisanalysis/calcium/calciumall.vue
  13. 630 198
      src/xt_pages/Dialysisanalysis/calcium/calciumalone.vue
  14. 125 0
      src/xt_pages/Dialysisanalysis/components/BarChart.vue
  15. 261 0
      src/xt_pages/Dialysisanalysis/components/LineChart.vue
  16. 262 0
      src/xt_pages/Dialysisanalysis/components/LineChart1.vue
  17. 108 0
      src/xt_pages/Dialysisanalysis/components/PieChart.vue
  18. 335 226
      src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinall.vue
  19. 627 198
      src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinalone.vue
  20. 22 35
      src/xt_pages/Dialysisanalysis/otherIndicators/otherall.vue
  21. 630 198
      src/xt_pages/Dialysisanalysis/otherIndicators/otheralone.vue
  22. 334 227
      src/xt_pages/Dialysisanalysis/platelets/plateletsall.vue
  23. 627 198
      src/xt_pages/Dialysisanalysis/platelets/plateletsalone.vue
  24. 212 0
      src/xt_pages/Dialysisanalysis/print/print.vue
  25. 630 224
      src/xt_pages/Dialysisanalysis/qualitycontrol/individual.vue
  26. 419 218
      src/xt_pages/Dialysisanalysis/qualitycontrol/totalSstatistics.vue
  27. 414 415
      src/xt_pages/hospitalStation/batchStatementTemplate/hospitalBatchPrint.vue
  28. 13 13
      src/xt_pages/hospitalStation/components/chargeDialog.vue
  29. 9 8
      src/xt_pages/hospitalStation/components/deskPrescription.vue
  30. 45 3
      src/xt_pages/hospitalStation/components/inquiriesDetail.vue
  31. 419 0
      src/xt_pages/hospitalStation/components/registerDialog9504.vue
  32. 50 151
      src/xt_pages/hospitalStation/hospitalBatchStatementPrint.vue
  33. 2 0
      src/xt_pages/hospitalStation/pastInquiries.vue
  34. 552 0
      src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalAllListPrint.vue
  35. 406 0
      src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalAllListPrintOne.vue
  36. 396 0
      src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalListPrint.vue
  37. 318 0
      src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalListPrintOne.vue
  38. 3 0
      src/xt_pages/hospitalStation/statementPrint.vue
  39. 498 83
      src/xt_pages/outpatientCharges/components/registerDialog9504.vue
  40. 2 2
      src/xt_pages/outpatientCharges/listPrint.vue
  41. 6 6
      src/xt_pages/outpatientCharges/statementPrint.vue
  42. 21 11
      src/xt_pages/outpatientCharges/statementTemplate/printOne.vue
  43. 723 723
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  44. 2 2
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  45. 3 3
      src/xt_pages/outpatientDoctorStation/modeTemplateDetail.vue
  46. 2 2
      src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue
  47. 42 0
      src/xt_pages/outpatientTool/components/detailStatistics.vue
  48. 86 84
      src/xt_pages/outpatientTool/components/settle.vue

+ 23 - 0
src/api/qcd.js View File

@@ -108,3 +108,26 @@ export function GetPersonAdviceData(params) {
108 108
   })
109 109
 }
110 110
 
111
+
112
+export function GetQCStatistisData(params) {
113
+  return request({
114
+    url: '/api/qc/statistiscall/get',
115
+    method: 'get',
116
+    params: params
117
+  })
118
+}
119
+
120
+export function GetPersonQCStatistisData(params) {
121
+  return request({
122
+    url: '/api/qc/statistiscperson/get',
123
+    method: 'get',
124
+    params: params
125
+  })
126
+}
127
+
128
+
129
+
130
+
131
+
132
+
133
+

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

@@ -104,7 +104,7 @@ export default {
104 104
     deviceManage: '院感管理',
105 105
     modemanagement: '型号配置',
106 106
     dialysisMachineManage: '设备管理',
107
-    
107
+
108 108
     workforce: '患者排班',
109 109
     appointment: '排班管理',
110 110
     sign: '治疗签到',
@@ -298,6 +298,7 @@ export default {
298 298
     hospitalhistory: '住院历史',
299 299
     dialysis_index:'信息归档',
300 300
     objectRegistration:"医疗器械登记",
301
+    Dialysisanalysis: '专业质控'
301 302
   },
302 303
   navbar: {
303 304
     logOut: '退出登录',

+ 7 - 3
src/router/index.js View File

@@ -8,7 +8,6 @@ import device from './modules/device'
8 8
 import dialysis from './modules/dialysis'
9 9
 import patient from './modules/patient'
10 10
 import qcd from './modules/qcd'
11
-// import Dialysisanalysis from './modules/Dialysisanalysis'//
12 11
 import role from './modules/role'
13 12
 import stock from './modules/stock'
14 13
 import weight_sign from './modules/weight_sign'
@@ -61,7 +60,11 @@ import bedManagement from './modules/bedManagement'
61 60
 import dictionaryManagement from './modules/dictionaryManagement'
62 61
 import templateManagement from './modules/templateManagement'
63 62
 import DepartManage from './modules/DepartManage'
64
-import basicConfig from './modules/basicConfig' 
63
+import basicConfig from './modules/basicConfig'
64
+import Dialysisanalysis from './modules/Dialysisanalysis'
65
+
66
+
67
+import basicConfig from './modules/basicConfig'
65 68
 import dialysisIndex from './modules/dialysisIndex'
66 69
 Vue.use(Router)
67 70
 
@@ -173,7 +176,7 @@ var _asy_router_map = [
173 176
 
174 177
   otherManagement,
175 178
   qcd,
176
- 
179
+
177 180
   device,
178 181
   org,
179 182
   data_upload,
@@ -204,6 +207,7 @@ var _asy_router_map = [
204 207
   integration,
205 208
   basicConfig,
206 209
   supply,
210
+  Dialysisanalysis,// 新菜单6.1
207 211
   // Dialysisanalysis,// 新菜单6.1
208 212
   dialysisIndex,
209 213
 ]

+ 107 - 46
src/router/modules/Dialysisanalysis.js View File

@@ -3,11 +3,11 @@ import Layout from '@/views/layout/Layout'
3 3
 export default {
4 4
   path: '/Dialysisanalysis',
5 5
   component: Layout,
6
-  redirect: 'noredirect',
6
+  redirect: '/Dialysisanalysis/qualitycontrol/thyroidGland',
7 7
   name: 'Dialysisanalysis',
8 8
   alwaysShow: true,
9 9
   meta: {
10
-    title: '透析分析',
10
+    title: '专业质控',
11 11
     icon: 'statistics'
12 12
   },
13 13
   children: [
@@ -21,87 +21,148 @@ export default {
21 21
       }
22 22
     },
23 23
     {
24
-      path: '/Dialysisanalysis/hemoglobin',
24
+      path: '/Dialysisanalysis/qualitycontrol/hemoglobin',
25 25
       component: () => import('@/xt_pages/Dialysisanalysis/hemoglobin/index'),
26
-      name: 'index',
26
+      name: 'thyroidGland',
27 27
       meta: {
28 28
         title: '血红蛋白',
29 29
         noCache: true
30 30
       }
31 31
     },
32 32
     {
33
-      path: '/Dialysisanalysis/bloodPotassium',
33
+      path: '/Dialysisanalysis/qualitycontrol/bloodPotassium',
34 34
       component: () => import('@/xt_pages/Dialysisanalysis/bloodPotassium/index'),
35
-      name: 'index',
35
+      name: 'thyroidGland',
36 36
       meta: {
37 37
         title: '血钾',
38 38
         noCache: true
39 39
       }
40 40
     },
41 41
     {
42
-      path: '/Dialysisanalysis/albumin',
42
+      path: '/Dialysisanalysis/qualitycontrol/albumin',
43 43
       component: () => import('@/xt_pages/Dialysisanalysis/albumin/index'),
44
-      name: 'index',
44
+      name: 'thyroidGland',
45 45
       meta: {
46 46
         title: '白蛋白',
47 47
         noCache: true
48 48
       }
49 49
     },
50 50
     {
51
-      path: '/Dialysisanalysis/bloodPhosphorus',
51
+      path: '/Dialysisanalysis/qualitycontrol/bloodPhosphorus',
52 52
       component: () => import('@/xt_pages/Dialysisanalysis/bloodPhosphorus/index'),
53
-      name: 'index',
53
+      name: 'thyroidGland',
54 54
       meta: {
55 55
         title: '血磷',
56 56
         noCache: true
57 57
       }
58
-    },
59
-    {
60
-      path: '/Dialysisanalysis/calcium',
58
+    }, {
59
+      path: '/Dialysisanalysis/qualitycontrol/calcium',
61 60
       component: () => import('@/xt_pages/Dialysisanalysis/calcium/index'),
62
-      name: 'index',
61
+      name: 'thyroidGland',
63 62
       meta: {
64 63
         title: '钙',
65 64
         noCache: true
66
-      }
67
-    },
68
-    {
69
-      path: '/Dialysisanalysis/platelets',
65
+      }},{
66
+      path: '/Dialysisanalysis/qualitycontrol/platelets',
70 67
       component: () => import('@/xt_pages/Dialysisanalysis/platelets/index'),
71
-      name: 'index',
68
+      name: 'thyroidGland',
72 69
       meta: {
73 70
         title: '血小板',
74 71
         noCache: true
75 72
       }
76
-    },
77
-    {
78
-      path: '/Dialysisanalysis/otherIndicators',
79
-      component: () => import('@/xt_pages/Dialysisanalysis/otherIndicators/index'),
80
-      name: 'index',
81
-      meta: {
82
-        title: '其他指标',
83
-        noCache: true
84
-      }
85
-    },
86
-    {
87
-      path: '/Dialysisanalysis/nonnumerical',
88
-      component: () => import('@/xt_pages/Dialysisanalysis/nonnumerical'),
89
-      name: 'nonnumerical',
73
+    },{
74
+      path: '/Dialysisanalysis/qualitycontrol/print',
75
+      component: () => import('@/xt_pages/Dialysisanalysis/print/print'),
76
+      name: 'print',
77
+      hidden: true,
78
+      is_menu: false,
90 79
       meta: {
91
-        title: '非数值类的列表展示',
80
+        title: 'print',
92 81
         noCache: true
93 82
       }
94
-    },
95
-    {
96
-      path: '/Dialysisanalysis/dialysis_index',
97
-      component: () => import('@/xt_pages/Dialysisanalysis/dialysis_index'),
98
-      name: 'dialysis_index',
99
-      meta: {
100
-        title: '透析指标详情',
101
-        noCache: true
102
-      }
103
-    },
104
-   
105
-  
83
+    }
84
+    // {
85
+    //   path: '/Dialysisanalysis/hemoglobin',
86
+    //   component: () => import('@/xt_pages/Dialysisanalysis/hemoglobin/index'),
87
+    //   name: 'index',
88
+    //   meta: {
89
+    //     title: '血红蛋白',
90
+    //     noCache: true
91
+    //   }
92
+    // },
93
+    // {
94
+    //   path: '/Dialysisanalysis/bloodPotassium',
95
+    //   component: () => import('@/xt_pages/Dialysisanalysis/bloodPotassium/index'),
96
+    //   name: 'index',
97
+    //   meta: {
98
+    //     title: '血钾',
99
+    //     noCache: true
100
+    //   }
101
+    // },
102
+    // {
103
+    //   path: '/Dialysisanalysis/albumin',
104
+    //   component: () => import('@/xt_pages/Dialysisanalysis/albumin/index'),
105
+    //   name: 'index',
106
+    //   meta: {
107
+    //     title: '白蛋白',
108
+    //     noCache: true
109
+    //   }
110
+    // },
111
+    // {
112
+    //   path: '/Dialysisanalysis/bloodPhosphorus',
113
+    //   component: () => import('@/xt_pages/Dialysisanalysis/bloodPhosphorus/index'),
114
+    //   name: 'index',
115
+    //   meta: {
116
+    //     title: '血磷',
117
+    //     noCache: true
118
+    //   }
119
+    // },
120
+    // {
121
+    //   path: '/Dialysisanalysis/calcium',
122
+    //   component: () => import('@/xt_pages/Dialysisanalysis/calcium/index'),
123
+    //   name: 'index',
124
+    //   meta: {
125
+    //     title: '钙',
126
+    //     noCache: true
127
+    //   }
128
+    // },
129
+    // {
130
+    //   path: '/Dialysisanalysis/platelets',
131
+    //   component: () => import('@/xt_pages/Dialysisanalysis/platelets/index'),
132
+    //   name: 'index',
133
+    //   meta: {
134
+    //     title: '血小板',
135
+    //     noCache: true
136
+    //   }
137
+    // },
138
+    // {
139
+    //   path: '/Dialysisanalysis/otherIndicators',
140
+    //   component: () => import('@/xt_pages/Dialysisanalysis/otherIndicators/index'),
141
+    //   name: 'index',
142
+    //   meta: {
143
+    //     title: '其他指标',
144
+    //     noCache: true
145
+    //   }
146
+    // },
147
+    // {
148
+    //   path: '/Dialysisanalysis/nonnumerical',
149
+    //   component: () => import('@/xt_pages/Dialysisanalysis/nonnumerical'),
150
+    //   name: 'nonnumerical',
151
+    //   meta: {
152
+    //     title: '非数值类的列表展示',
153
+    //     noCache: true
154
+    //   }
155
+    // },
156
+    // {
157
+    //   path: '/Dialysisanalysis/dialysis_index',
158
+    //   component: () => import('@/xt_pages/Dialysisanalysis/dialysis_index'),
159
+    //   name: 'dialysis_index',
160
+    //   meta: {
161
+    //     title: '透析指标详情',
162
+    //     noCache: true
163
+    //   }
164
+    // },
165
+
166
+
106 167
   ]
107 168
 }

+ 1 - 1
src/views/layout/components/Sidebar/index.vue View File

@@ -120,7 +120,7 @@ export default {
120 120
             this.$emit('func',a)
121 121
           }
122 122
         }else if(newVal == '透析管理'){
123
-          let nameArr = ['home','workforce', 'dialysisrecord', 'dialysis', 'medicalScheduling', 'signIndex', 'qcd', 'device', 'quality_control'];
123
+          let nameArr = ['home','workforce', 'dialysisrecord', 'dialysis', 'medicalScheduling', 'signIndex', 'qcd', 'device', 'quality_control','Dialysisanalysis'];
124 124
           // console.log('permission_routers',this.permission_routers)
125 125
           let routerArr = [];
126 126
           this.permission_routers.map(item => {

+ 334 - 227
src/xt_pages/Dialysisanalysis/albumin/albuminall.vue View File

@@ -1,262 +1,369 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        
31
-        <el-row :gutter="20">
32
-        <el-col :span="5"> 
33
-          <div class="block">
34
-            <span>查询时间:</span>
35
-            <el-date-picker
36
-            v-model="time_month"
37
-            type="month"
38
-            placeholder="选择月">
39
-            </el-date-picker>
40
-          </div>
41
-        </el-col>
42
-        <el-col :span="8">
43
-          <div>
44
-            <el-date-picker
45
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
46 26
             type="date"
27
+
47 28
             placeholder="选择日期">
48
-            </el-date-picker>
49
-            <span>-</span>
50
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
51 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
52 36
             type="date"
53 37
             placeholder="选择日期">
54
-            </el-date-picker>
55
-          </div>
56
-        </el-col>
57
-        <el-col :span="3">
58
-          <div style="width: 200px;">
59
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
60
-          </div>
61
-        </el-col>
62
-        <el-col :span="2">
63
-            <el-button type="primary">查询</el-button>
64
-        </el-col>
65
-        </el-row>
66
-        
67
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
69 39
         </div>
70
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-        <div style="width: 80%;margin: auto;">
72
-            <el-table
73
-            :data="tableData"
74
-            :show-summary = true
75
-            border
76
-            style="width: 100%;">
77
-                <el-table-column
78
-                    prop="date"
79
-                    align="center"
80
-                    label="白蛋白"
81
-                    >
82
-                </el-table-column>
83
-                <el-table-column
84
-                    prop="name"
85
-                    
86
-                    label="人数"
87
-                    >
88
-                </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
99
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
100 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="白蛋白"
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          label="人数"
68
+        >
69
+        </el-table-column>
70
+<!--        <el-table-column-->
71
+<!--          prop="address"-->
72
+<!--          align="center"-->
73
+<!--          label="操作">-->
74
+<!--          <template slot-scope="scope">-->
75
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
76
+<!--                       type="text">查看详情-->
77
+<!--            </el-button>-->
78
+<!--          </template>-->
79
+<!--        </el-table-column>-->
80
+      </el-table>
101 81
     </div>
82
+  </div>
102 83
 </template>
103 84
 <script>
104
-import * as echarts from "echarts";
105
-export default{
106
-    props: {
107
-   
85
+import * as echarts from 'echarts'
86
+import { GetQCStatistisData } from '../../../api/qcd'
87
+
88
+const moment = require('moment')
89
+
90
+export default {
91
+  props: {
92
+
108 93
     width: {
109 94
       type: String,
110
-      default: "100%"
95
+      default: '100%'
111 96
     },
112 97
     height: {
113 98
       type: String,
114
-      default: "400px"
115
-    },
116
-    
99
+      default: '400px'
100
+    }
101
+
117 102
   },
118
-    data() {
119
-        return {
120
-            time_month:'',
121
-            stat_time:'',
122
-            end_time:'',
123
-            input:'',
124
-            myChart: {},
125
-            pieData : [
126
-            {
127
-          value: 463,
128
-          name: "不达标值患者"
129
-        },
130
-        {
131
-          value: 395,
132
-          name: "未检查患者"
133
-        },
134
-        {
135
-          value: 157,
136
-          name: "达标值患者"
137
-        },
138
-        // {
139
-        //   value: 149,
140
-        //   name: "广东"
141
-        // },
142
-        // {
143
-        //   value: 147,
144
-        //   name: "湖南"
145
-        // }
146
-            
147
-            ],
148
-            pieName: [],
149
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-            tableData:[],
151
-        }
152
-    },
153
-    mounted() {
154
-    this.initDate(); //数据初始化
155
-    this.initEcharts();
103
+  data() {
104
+    return {
105
+      time_type: 1,
106
+      times: [
107
+        { value: 1, label: '本月' },
108
+        { value: 2, label: '上月' },
109
+        { value: 3, label: '今年' },
110
+        { value: 4, label: '上一年' },
111
+        { value: 5, label: '第一季度' },
112
+        { value: 6, label: '第二季度' },
113
+        { value: 7, label: '第三季度' },
114
+        { value: 8, label: '第四季度' },
115
+        { value: 9, label: '自定义' }
116
+
117
+      ],
118
+      time_month: '',
119
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
121
+      input: '',
122
+      myChart: {},
123
+      pieData: [],
124
+      pieName: [],
125
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
126
+      tableData: [],
127
+      reference:{},
128
+    }
129
+  },
130
+  mounted() {
131
+    this.getData()
156 132
   },
157 133
   methods: {
158
-    initDate() {
159
-      for (let i = 0; i < this.pieData.length; i++) {
160
-        this.pieName[i] = this.pieData[i].name;
134
+    getData() {
135
+      if(this.start_time.length == 0){
136
+        this.$message.error("请选择开始时间")
161 137
       }
162
-    },
163
-    initEcharts() {
164
-      // 饼图
165
-      const option = {
166
-        legend: {
167
-          // 图例
168
-          data: this.pieName,
169
-          left: "10%",
170
-          top: "30%",
171
-          orient: "vertical"
172
-        },
173
-        color:['#ff7f9f','#fff67f','#1e5feb'],
174
-        title: {
175
-          // 设置饼图标题,位置设为顶部居中
176
-        //   text: "国内院士前五省份图示",
177
-          top: "0%",
178
-          left: "center"
179
-        },
180
-        series: [
181
-          {
182
-            type: "pie",
183
-            label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
138
+      if(this.end_time.length == 0){
139
+        this.$message.error("请选择结束时间")
140
+      }
141
+      let params = {
142
+        start_date: this.start_time,
143
+        end_date: this.end_time,
144
+        project_id: 2,
145
+        item_id: 35
146
+      }
147
+      this.pieData = []
148
+      this.tableData = []
149
+      console.log("~~~~~~~~~~")
150
+      GetQCStatistisData(params).then(response => {
151
+        if (response.data.state == 1) {
152
+          this.reference =  response.data.data.reference
153
+
154
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
155
+          let objone = {
156
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
157
+            name: '不达标值患者',
158
+            count:response.data.data.unusual_total,
159
+          }
160
+          this.pieData.push(objone)
161
+          this.tableData.push(objone)
162
+
163
+          let objtwo = {
164
+            value:   response.data.data.normal_total / response.data.data.patient_count,
165
+            name: '达标值患者',
166
+            count:response.data.data.normal_total,
167
+
168
+          }
169
+          this.pieData.push(objtwo)
170
+          this.tableData.push(objtwo)
171
+
172
+          let objthree = {
173
+            value: response.data.data.patient_count / response.data.data.no_check_total,
174
+            name: '未检查患者',
175
+            count:response.data.data.no_check_total,
176
+
177
+          }
178
+          this.pieData.push(objthree)
179
+          this.tableData.push(objthree)
180
+
181
+          let objfour = {
182
+            value: response.data.data.patient_count,
183
+            name: '合计',
184
+            count:response.data.data.patient_count,
185
+          }
186
+          this.tableData.push(objfour)
187
+          for (let i = 0; i < this.pieData.length; i++) {
188
+            this.pieName[i] = this.pieData[i].name
189
+          }
190
+          this.myChart = echarts.init(document.getElementById('mychart'))
191
+          window.addEventListener('resize', () => {
192
+            this.myChart.resize()
193
+          })
194
+          const option = {
195
+            legend: {
196
+              // 图例
197
+              data: this.pieName,
198
+              left: '10%',
199
+              top: '30%',
200
+              orient: 'vertical'
201
+            },
202
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
203
+            title: {
204
+              // 设置饼图标题,位置设为顶部居中
205
+              //   text: "国内院士前五省份图示",
206
+              top: '0%',
207
+              left: 'center'
193 208
             },
194
-            radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                  shadowBlur: 10,
199
-                  shadowOffsetX: 0,
200
-                  shadowColor: 'rgba(0, 0, 0, 0.5)'
209
+            series: [
210
+              {
211
+                type: 'pie',
212
+                label: {
213
+                  show: true,
214
+                  formatter: '{b} : {d}% ({c})'
215
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
216
+                },
217
+                radius: '65%', //饼图半径
218
+                data: this.pieData
201 219
               }
202
-            }
220
+            ]
203 221
           }
204
-        ]
205
-      };
206
-    //   console.log(this.seriesData);
207
-      const optionFree = {
208
-        series: [
209
-          {
210
-            data: this.seriesData,
211
-            type: "line",
212
-            smooth: true
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
229
+              }
230
+            ]
213 231
           }
214
-        ]
215
-      };
216
-      this.myChart = echarts.init(document.getElementById("mychart"));
217
-      this.myChart.setOption(option);
218
-      //随着屏幕大小调节图表
219
-      window.addEventListener("resize", () => {
220
-        this.myChart.resize();
221
-      });
232
+          this.myChart = echarts.init(document.getElementById('mychart'))
233
+          this.myChart.setOption(option)
234
+        } else {
235
+          this.$message.error(response.data.msg)
236
+        }
237
+      })
238
+
239
+    },
240
+    changeItem(val) {
241
+      const currentDate = new Date()
242
+      switch (val) {
243
+        case 1:
244
+
245
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
246
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
247
+
248
+          this.start_time = startOfMonth
249
+          this.end_time = endOfMonth
250
+          this.getData()
251
+
252
+          break
253
+        case 2:
254
+          // 上月的起始日期和结束日期
255
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
256
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
257
+
258
+          this.start_time = startOfLastMonth
259
+          this.end_time = endOfLastMonth
260
+          this.getData()
261
+
262
+          break
263
+        case 3:
264
+          // 今年的起始日期和结束日期
265
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
266
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
267
+
268
+          this.start_time = startOfYear
269
+          this.end_time = endOfYear
270
+          this.getData()
271
+
272
+          break
273
+        case 4:
274
+          // 上一年的起始日期和结束日期
275
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
276
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
277
+
278
+          this.start_time = startOfLastYear
279
+          this.end_time = endOfLastYear
280
+          this.getData()
281
+
282
+          break
283
+        case 5:
284
+          // 第一季度的起始日期和结束日期
285
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
286
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
287
+
288
+          this.start_time = startOfFirstQuarter
289
+          this.end_time = endOfFirstQuarter
290
+          this.getData()
291
+
292
+          break
293
+        case 6:
294
+          // 第二季度的起始日期和结束日期
295
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
296
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
297
+
298
+          this.start_time = startOfSecondQuarter
299
+          this.end_time = endOfSecondQuarter
300
+          this.getData()
301
+
302
+          break
303
+        case 7:
304
+          // 第三季度的起始日期和结束日期
305
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
306
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
307
+
308
+          this.start_time = startOfThirdQuarter
309
+          this.end_time = endOfThirdQuarter
310
+          this.getData()
311
+
312
+          break
313
+        case 8:
314
+          // 第四季度的起始日期和结束日期
315
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
316
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
317
+
318
+          this.start_time = startOfFourthQuarter
319
+          this.end_time = endOfFourthQuarter
320
+          this.getData()
321
+          break
322
+        case 9:
323
+          this.start_time = ''
324
+          this.end_time = ''
325
+          break
326
+      }
222 327
     },
328
+
329
+
223 330
     getSummaries(param) {
224
-        const { columns, data } = param;
225
-        const sums = [];
226
-        columns.forEach((column, index) => {
227
-          if (index === 0) {
228
-            sums[index] = '总价';
229
-            return;
230
-          }
231
-          const values = data.map(item => Number(item[column.property]));
232
-          if (!values.every(value => isNaN(value))) {
233
-            sums[index] = values.reduce((prev, curr) => {
234
-              const value = Number(curr);
235
-              if (!isNaN(value)) {
236
-                return prev + curr;
237
-              } else {
238
-                return prev;
239
-              }
240
-            }, 0);
241
-            sums[index] += ' 元';
242
-          } else {
243
-            sums[index] = 'N/A';
244
-          }
245
-        });
331
+      const { columns, data } = param
332
+      const sums = []
333
+      columns.forEach((column, index) => {
334
+        if (index === 0) {
335
+          sums[index] = '总价'
336
+          return
337
+        }
338
+        const values = data.map(item => Number(item[column.property]))
339
+        if (!values.every(value => isNaN(value))) {
340
+          sums[index] = values.reduce((prev, curr) => {
341
+            const value = Number(curr)
342
+            if (!isNaN(value)) {
343
+              return prev + curr
344
+            } else {
345
+              return prev
346
+            }
347
+          }, 0)
348
+          sums[index] += ' 元'
349
+        } else {
350
+          sums[index] = 'N/A'
351
+        }
352
+      })
246 353
 
247
-        return sums;
354
+      return sums
248 355
     },
249
-    handleClick(id){
250
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
251 358
     }
252 359
   }
253 360
 
254 361
 }
255 362
 </script>
256 363
 <style lang="scss" scoped>
257
-.content_top{
258
-    display: flex;
259
-    justify-content: space-around;
260
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
261 368
 }
262
-</style>
369
+</style>

+ 627 - 199
src/xt_pages/Dialysisanalysis/albumin/albuminalone.vue View File

@@ -1,218 +1,646 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       
52
-       <div >
53
-        <el-row :gutter="20">
54
-            <el-col :span="4">
55
-              <div class="grid-content bg-purple">
56
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
57
-                
58
-                <el-table
59
-                :data="tableData"
60
-                border
61
-                style="width: 100%">
62
-                    <el-table-column
63
-                        align="center"
64
-                        prop="date"
65
-                        label="透析号"
66
-                       >
67
-                    </el-table-column>
68
-                    <el-table-column
69
-                        align="center"
70
-                        prop="name"
71
-                        label="姓名"
72
-                        >
73
-                    </el-table-column>
74
-                </el-table>
75
-              </div>
76
-            </el-col>
77
-            <el-col :span="19">
78
-               <div class="grid-content bg-purple">
79
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
80
-                <el-table
81
-                    :data="tableData"
82
-                    style="width: 100%"
83
-                    border
84
-                    align="center"
85
-                    max-height="250">
86
-                    <el-table-column
87
-                    fixed
88
-                    prop="date"
89
-                    label="姓名"
90
-                   >
91
-                    </el-table-column>
92
-                    <el-table-column
93
-                    prop="name"
94
-                    label="检查日期"
95
-                    >
96
-                    </el-table-column>
97
-                    <el-table-column
98
-                    prop="province"
99
-                    label="白蛋白(g/L)"
100
-                    >
101
-                    </el-table-column>
102
-                    
103
-                </el-table>
104
-               </div>
105
-           </el-col>
106
-        </el-row>
107
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
108 106
 
107
+                <el-table-column width="100" label="白蛋白" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
109 119
     </div>
120
+  </div>
110 121
 </template>
122
+
123
+
111 124
 <script>
112
-  import * as echarts from 'echarts'
113
-export default{
114
-    // props: {
115
-    //     width: {
116
-    //         type: String,
117
-    //         default: "100%"
118
-    //     },
119
-    //     height: {
120
-    //         type: String,
121
-    //         default: "400px"
122
-    //     },
123
-    
124
-    // },
125
-    data() {
126
-        return {
127
-            inputValue:'',
128
-            stat_time:'',
129
-            end_time:'',
130
-            value:'',
131
-            myChart: {},
132
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
133
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
134
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
135
-            tableData:[],
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
136 147
         }
137
-    },
138
-    created(){
139
-        
140
-    },
141
-    mounted() {
142
-        // this.$nextTick(function() {
143
-            this.initEcharts();
144
-		// })  
145
-        // this.myChart = echarts.init(document.getElementById("germychart"));
146
-        //     this.myChart.setOption(option);
147
-            //随着屏幕大小调节图表
148
-            window.addEventListener("resize", () => {
149
-                this.myChart.resize();
150
-            });
151
-    },
152
-    methods:{
153
-        handleSubmit(){
154
-            console.log('asdfa');
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
155 173
         },
156
-        initEcharts() {
157
-            const option = {
158
-                xAxis: {
159
-                    type: 'category',
160
-                        boundaryGap:true,
161
-                        axisTick:{
162
-                            alignWithLabel:true //保证刻度线和标签对齐
163
-                        },
164
-                    data: this.xData,
165
-                    splitNumber:this.xData.length, //纵坐标数
166
-                    interval:this.xData //强制设置坐标轴分割间隔
167
-                },
168
-                yAxis: {
169
-                    type: 'value',
170
-                    boundaryGap: true,
171
-                    splitNumber:4, //纵坐标数
172
-                    interval:10 //强制设置坐标轴分割间隔
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
173 235
                 },
174
-                legend: {
175
-                    show: true,
176
-                    align:'left',//文字在前图标在后
177
-                    left:'15%',
178
-                    top:'5%',
179
-                    data: [{name:'白蛋白g/L'}]
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
180 238
                 },
181
-                series: [
182
-                {
183
-                    data: this.opinionData,
184
-                    name:'白蛋白g/L',
185
-                    type: "line",// 类型设置为折线图
186
-                    symbol: 'circle',
187
-                    itemStyle: {
188
-                        normal: {
189
-                            color: '#409eff', //改变折线点的颜色#a80000
190
-                            lineStyle: {
191
-                                color: '#409eff' //改变折线颜色
192
-                            }
193
-                        }
194
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
195 241
 
196
-                },
197
-                
198
-                ],
199
-                
200
-            };
201
-            this.myChart = echarts.init(document.getElementById("germychart"));
202
-            this.myChart.setOption(option);
203
-            //随着屏幕大小调节图表
204
-            window.addEventListener("resize", () => {
205
-                this.myChart.resize();
206
-            });
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
207 273
         },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
281
+        },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
208 453
     },
209
-    
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+            this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        if (this.patientsData[i].id == val.id){
533
+          this.$refs.table.setCurrentRow(this.patientsData[i])
534
+        }
535
+      }
536
+
537
+
538
+    },
539
+    querySearchAsync(keyword, cb) {
540
+      let key = ''
541
+      if (keyword != undefined) {
542
+        key = keyword
543
+      }
544
+      let searchArray = []
545
+      PostSearch(key).then(response => {
546
+        if (response.data.state == 1) {
547
+          searchArray = response.data.data.patient
548
+          cb(searchArray)
549
+        } else {
550
+          cb([])
551
+        }
552
+      })
553
+    },
554
+    chooseWay(way) {
555
+      this.wayType = way
556
+    }, getCurrentOrgPatients() {
557
+      getCurrentOrgPatients().then(response => {
558
+        if (response.data.state == 1) {
559
+          var patients = response.data.data.patients
560
+          this.patientsData = patients
561
+          this.GetDefaultPatient()
562
+        }
563
+      })
564
+    }, GetDefaultPatient() {
565
+      GetDefaultPatient().then(response => {
566
+        if (response.data.state == 1) {
567
+          var patient = response.data.data.patient
568
+          for (let i = 0;i < this.patientsData.length; i++){
569
+            if (this.patientsData[i].id == patient.id){
570
+              this.patient_name = this.patientsData[i].name
571
+              this.$refs.table.setCurrentRow(this.patientsData[i])
572
+            }
573
+          }
574
+          this.query.patient_id = patient.id
575
+          this.GetPersonQCStatistisData(this.query)
576
+
577
+        }
578
+      })
579
+
580
+    },
581
+    getArrLength(result,type){
582
+      if(type == 1){
583
+        if(result.length > 10){
584
+          var dataZoom_end = (10/result.length)*100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }else{
587
+          var dataZoom_end = 100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }
590
+      }else if(type == 2){
591
+        if(result.length > 10){
592
+          var dataZoom_end = (10/result.length)*100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }else{
595
+          var dataZoom_end = 100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }
598
+      }
599
+
600
+    }
601
+  }, mounted() {
602
+    var date = new Date()
603
+    var year = date.getFullYear() //获取完整的年份(4位)
604
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
605
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
606
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
607
+    this.query.patient_id = 0
608
+    this.query.end_time = year + '-' + month + '-' + day
609
+    this.query.start_time = year + '-' + last_month + '-' + day
610
+    this.query.project_id = 2
611
+    this.query.item_id = 35
612
+    this.getCurrentOrgPatients()
613
+
614
+    // this.GetPersonQCStatistisData()
615
+
616
+
617
+  }
210 618
 }
211 619
 </script>
620
+
212 621
 <style lang="scss" scoped>
213
-.content_top{
214
-    display: flex;
215
-    justify-content: space-around;
216
-    margin-bottom: 20px;
622
+.tableTitle {
623
+  font-size: 16px;
624
+  color: #000;
625
+  font-weight: bold;
626
+  margin-bottom: 10px;
627
+}
628
+</style>
629
+<style lang="scss">
630
+.page_process {
631
+.el-tabs{
632
+  margin-bottom:0 !important;
633
+}
634
+.el-button--medium {
635
+  padding: 10px 8px;
636
+}
637
+
638
+.el-form-item {
639
+  margin-bottom: 0;
640
+}
641
+::-webkit-scrollbar{
642
+  height: 15px !important;
643
+}
644
+
217 645
 }
218
-</style>
646
+</style>

+ 334 - 227
src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusall.vue View File

@@ -1,262 +1,369 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        <el-row :gutter="20">
31
-        <el-col :span="5"> 
32
-          <div class="block">
33
-            <span>查询时间:</span>
34
-            <el-date-picker
35
-            v-model="time_month"
36
-            type="month"
37
-            placeholder="选择月">
38
-            </el-date-picker>
39
-          </div>
40
-        </el-col>
41
-        <el-col :span="8">
42
-          <div>
43
-            <el-date-picker
44
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
45 26
             type="date"
27
+
46 28
             placeholder="选择日期">
47
-            </el-date-picker>
48
-            <span>-</span>
49
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
50 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
51 36
             type="date"
52 37
             placeholder="选择日期">
53
-            </el-date-picker>
54
-          </div>
55
-        </el-col>
56
-        <el-col :span="3">
57
-          <div style="width: 200px;">
58
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
59
-          </div>
60
-        </el-col>
61
-        <el-col :span="2">
62
-            <el-button type="primary">查询</el-button>
63
-        </el-col>
64
-        </el-row>
65
-        
66
-        
67
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
69 39
         </div>
70
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-        <div style="width: 80%;margin: auto;">
72
-            <el-table
73
-            :data="tableData"
74
-            :show-summary = true
75
-            border
76
-            style="width: 100%;">
77
-                <el-table-column
78
-                    prop="date"
79
-                    align="center"
80
-                    label="血磷"
81
-                    >
82
-                </el-table-column>
83
-                <el-table-column
84
-                    prop="name"
85
-                    
86
-                    label="人数"
87
-                    >
88
-                </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
99
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
100 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="血磷"
63
+
64
+        >
65
+        </el-table-column>
66
+        <el-table-column
67
+          prop="count"
68
+          label="人数"
69
+        >
70
+        </el-table-column>
71
+<!--        <el-table-column-->
72
+<!--          prop="address"-->
73
+<!--          align="center"-->
74
+<!--          label="操作">-->
75
+<!--          <template slot-scope="scope">-->
76
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
77
+<!--                       type="text">查看详情-->
78
+<!--            </el-button>-->
79
+<!--          </template>-->
80
+<!--        </el-table-column>-->
81
+      </el-table>
101 82
     </div>
83
+  </div>
102 84
 </template>
103 85
 <script>
104
-import * as echarts from "echarts";
105
-export default{
106
-    props: {
107
-   
86
+import * as echarts from 'echarts'
87
+import { GetQCStatistisData } from '../../../api/qcd'
88
+
89
+const moment = require('moment')
90
+
91
+export default {
92
+  props: {
93
+
108 94
     width: {
109 95
       type: String,
110
-      default: "100%"
96
+      default: '100%'
111 97
     },
112 98
     height: {
113 99
       type: String,
114
-      default: "400px"
115
-    },
116
-    
100
+      default: '400px'
101
+    }
102
+
117 103
   },
118
-    data() {
119
-        return {
120
-            time_month:'',
121
-            stat_time:'',
122
-            end_time:'',
123
-            input:'',
124
-            myChart: {},
125
-            pieData : [
126
-            {
127
-          value: 463,
128
-          name: "不达标值患者"
129
-        },
130
-        {
131
-          value: 395,
132
-          name: "未检查患者"
133
-        },
134
-        {
135
-          value: 157,
136
-          name: "达标值患者"
137
-        },
138
-        // {
139
-        //   value: 149,
140
-        //   name: "广东"
141
-        // },
142
-        // {
143
-        //   value: 147,
144
-        //   name: "湖南"
145
-        // }
146
-            
147
-            ],
148
-            pieName: [],
149
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-            tableData:[],
151
-        }
152
-    },
153
-    mounted() {
154
-    this.initDate(); //数据初始化
155
-    this.initEcharts();
104
+  data() {
105
+    return {
106
+      time_type: 1,
107
+      times: [
108
+        { value: 1, label: '本月' },
109
+        { value: 2, label: '上月' },
110
+        { value: 3, label: '今年' },
111
+        { value: 4, label: '上一年' },
112
+        { value: 5, label: '第一季度' },
113
+        { value: 6, label: '第二季度' },
114
+        { value: 7, label: '第三季度' },
115
+        { value: 8, label: '第四季度' },
116
+        { value: 9, label: '自定义' }
117
+
118
+      ],
119
+      time_month: '',
120
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
121
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
122
+      input: '',
123
+      myChart: {},
124
+      pieData: [],
125
+      pieName: [],
126
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
127
+      tableData: [],
128
+      reference:{},
129
+    }
130
+  },
131
+  mounted() {
132
+    this.getData()
156 133
   },
157 134
   methods: {
158
-    initDate() {
159
-      for (let i = 0; i < this.pieData.length; i++) {
160
-        this.pieName[i] = this.pieData[i].name;
135
+    getData() {
136
+      if(this.start_time.length == 0){
137
+        this.$message.error("请选择开始时间")
161 138
       }
162
-    },
163
-    initEcharts() {
164
-      // 饼图
165
-      const option = {
166
-        legend: {
167
-          // 图例
168
-          data: this.pieName,
169
-          left: "10%",
170
-          top: "30%",
171
-          orient: "vertical"
172
-        },
173
-        color:['#ff7f9f','#fff67f','#1e5feb'],
174
-        title: {
175
-          // 设置饼图标题,位置设为顶部居中
176
-        //   text: "国内院士前五省份图示",
177
-          top: "0%",
178
-          left: "center"
179
-        },
180
-        series: [
181
-          {
182
-            type: "pie",
183
-            label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
139
+      if(this.end_time.length == 0){
140
+        this.$message.error("请选择结束时间")
141
+      }
142
+      let params = {
143
+        start_date: this.start_time,
144
+        end_date: this.end_time,
145
+        project_id: 4,
146
+        item_id: 169
147
+      }
148
+      this.pieData = []
149
+      this.tableData = []
150
+      console.log("~~~~~~~~~~")
151
+      GetQCStatistisData(params).then(response => {
152
+        if (response.data.state == 1) {
153
+          this.reference =  response.data.data.reference
154
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
155
+          let objone = {
156
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
157
+            name: '不达标值患者',
158
+            count:response.data.data.unusual_total,
159
+          }
160
+          this.pieData.push(objone)
161
+          this.tableData.push(objone)
162
+
163
+          let objtwo = {
164
+            value:   response.data.data.normal_total / response.data.data.patient_count,
165
+            name: '达标值患者',
166
+            count:response.data.data.normal_total,
167
+
168
+          }
169
+          this.pieData.push(objtwo)
170
+          this.tableData.push(objtwo)
171
+
172
+          let objthree = {
173
+            value: response.data.data.patient_count / response.data.data.no_check_total,
174
+            name: '未检查患者',
175
+            count:response.data.data.no_check_total,
176
+
177
+          }
178
+          this.pieData.push(objthree)
179
+          this.tableData.push(objthree)
180
+
181
+          let objfour = {
182
+            value: response.data.data.patient_count,
183
+            name: '合计',
184
+            count:response.data.data.patient_count,
185
+          }
186
+          this.tableData.push(objfour)
187
+          for (let i = 0; i < this.pieData.length; i++) {
188
+            this.pieName[i] = this.pieData[i].name
189
+          }
190
+          this.myChart = echarts.init(document.getElementById('mychart'))
191
+          window.addEventListener('resize', () => {
192
+            this.myChart.resize()
193
+          })
194
+          const option = {
195
+            legend: {
196
+              // 图例
197
+              data: this.pieName,
198
+              left: '10%',
199
+              top: '30%',
200
+              orient: 'vertical'
201
+            },
202
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
203
+            title: {
204
+              // 设置饼图标题,位置设为顶部居中
205
+              //   text: "国内院士前五省份图示",
206
+              top: '0%',
207
+              left: 'center'
193 208
             },
194
-            radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                  shadowBlur: 10,
199
-                  shadowOffsetX: 0,
200
-                  shadowColor: 'rgba(0, 0, 0, 0.5)'
209
+            series: [
210
+              {
211
+                type: 'pie',
212
+                label: {
213
+                  show: true,
214
+                  formatter: '{b} : {d}% ({c})'
215
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
216
+                },
217
+                radius: '65%', //饼图半径
218
+                data: this.pieData
201 219
               }
202
-            }
220
+            ]
203 221
           }
204
-        ]
205
-      };
206
-    //   console.log(this.seriesData);
207
-      const optionFree = {
208
-        series: [
209
-          {
210
-            data: this.seriesData,
211
-            type: "line",
212
-            smooth: true
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
229
+              }
230
+            ]
213 231
           }
214
-        ]
215
-      };
216
-      this.myChart = echarts.init(document.getElementById("mychart"));
217
-      this.myChart.setOption(option);
218
-      //随着屏幕大小调节图表
219
-      window.addEventListener("resize", () => {
220
-        this.myChart.resize();
221
-      });
232
+          this.myChart = echarts.init(document.getElementById('mychart'))
233
+          this.myChart.setOption(option)
234
+        } else {
235
+          this.$message.error(response.data.msg)
236
+        }
237
+      })
238
+
239
+    },
240
+    changeItem(val) {
241
+      const currentDate = new Date()
242
+      switch (val) {
243
+        case 1:
244
+
245
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
246
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
247
+
248
+          this.start_time = startOfMonth
249
+          this.end_time = endOfMonth
250
+          this.getData()
251
+
252
+          break
253
+        case 2:
254
+          // 上月的起始日期和结束日期
255
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
256
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
257
+
258
+          this.start_time = startOfLastMonth
259
+          this.end_time = endOfLastMonth
260
+          this.getData()
261
+
262
+          break
263
+        case 3:
264
+          // 今年的起始日期和结束日期
265
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
266
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
267
+
268
+          this.start_time = startOfYear
269
+          this.end_time = endOfYear
270
+          this.getData()
271
+
272
+          break
273
+        case 4:
274
+          // 上一年的起始日期和结束日期
275
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
276
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
277
+
278
+          this.start_time = startOfLastYear
279
+          this.end_time = endOfLastYear
280
+          this.getData()
281
+
282
+          break
283
+        case 5:
284
+          // 第一季度的起始日期和结束日期
285
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
286
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
287
+
288
+          this.start_time = startOfFirstQuarter
289
+          this.end_time = endOfFirstQuarter
290
+          this.getData()
291
+
292
+          break
293
+        case 6:
294
+          // 第二季度的起始日期和结束日期
295
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
296
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
297
+
298
+          this.start_time = startOfSecondQuarter
299
+          this.end_time = endOfSecondQuarter
300
+          this.getData()
301
+
302
+          break
303
+        case 7:
304
+          // 第三季度的起始日期和结束日期
305
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
306
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
307
+
308
+          this.start_time = startOfThirdQuarter
309
+          this.end_time = endOfThirdQuarter
310
+          this.getData()
311
+
312
+          break
313
+        case 8:
314
+          // 第四季度的起始日期和结束日期
315
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
316
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
317
+
318
+          this.start_time = startOfFourthQuarter
319
+          this.end_time = endOfFourthQuarter
320
+          this.getData()
321
+          break
322
+        case 9:
323
+          this.start_time = ''
324
+          this.end_time = ''
325
+          break
326
+      }
222 327
     },
328
+
329
+
223 330
     getSummaries(param) {
224
-        const { columns, data } = param;
225
-        const sums = [];
226
-        columns.forEach((column, index) => {
227
-          if (index === 0) {
228
-            sums[index] = '总价';
229
-            return;
230
-          }
231
-          const values = data.map(item => Number(item[column.property]));
232
-          if (!values.every(value => isNaN(value))) {
233
-            sums[index] = values.reduce((prev, curr) => {
234
-              const value = Number(curr);
235
-              if (!isNaN(value)) {
236
-                return prev + curr;
237
-              } else {
238
-                return prev;
239
-              }
240
-            }, 0);
241
-            sums[index] += ' 元';
242
-          } else {
243
-            sums[index] = 'N/A';
244
-          }
245
-        });
331
+      const { columns, data } = param
332
+      const sums = []
333
+      columns.forEach((column, index) => {
334
+        if (index === 0) {
335
+          sums[index] = '总价'
336
+          return
337
+        }
338
+        const values = data.map(item => Number(item[column.property]))
339
+        if (!values.every(value => isNaN(value))) {
340
+          sums[index] = values.reduce((prev, curr) => {
341
+            const value = Number(curr)
342
+            if (!isNaN(value)) {
343
+              return prev + curr
344
+            } else {
345
+              return prev
346
+            }
347
+          }, 0)
348
+          sums[index] += ' 元'
349
+        } else {
350
+          sums[index] = 'N/A'
351
+        }
352
+      })
246 353
 
247
-        return sums;
354
+      return sums
248 355
     },
249
-    handleClick(id){
250
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
251 358
     }
252 359
   }
253 360
 
254 361
 }
255 362
 </script>
256 363
 <style lang="scss" scoped>
257
-.content_top{
258
-    display: flex;
259
-    justify-content: space-around;
260
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
261 368
 }
262
-</style>
369
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusalone.vue View File

@@ -1,217 +1,646 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="血磷(mmol/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
107 106
 
107
+                <el-table-column width="100" label="血磷" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
108 119
     </div>
120
+  </div>
109 121
 </template>
122
+
123
+
110 124
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
135 147
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
154 173
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
172 235
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'血磷mmol/L'}]
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
179 238
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'血磷mmol/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
194 241
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
206 273
         },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
281
+        },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
207 453
     },
208
-    
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+            this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        if (this.patientsData[i].id == val.id){
533
+          this.$refs.table.setCurrentRow(this.patientsData[i])
534
+        }
535
+      }
536
+
537
+
538
+    },
539
+    querySearchAsync(keyword, cb) {
540
+      let key = ''
541
+      if (keyword != undefined) {
542
+        key = keyword
543
+      }
544
+      let searchArray = []
545
+      PostSearch(key).then(response => {
546
+        if (response.data.state == 1) {
547
+          searchArray = response.data.data.patient
548
+          cb(searchArray)
549
+        } else {
550
+          cb([])
551
+        }
552
+      })
553
+    },
554
+    chooseWay(way) {
555
+      this.wayType = way
556
+    }, getCurrentOrgPatients() {
557
+      getCurrentOrgPatients().then(response => {
558
+        if (response.data.state == 1) {
559
+          var patients = response.data.data.patients
560
+          this.patientsData = patients
561
+          this.GetDefaultPatient()
562
+        }
563
+      })
564
+    }, GetDefaultPatient() {
565
+      GetDefaultPatient().then(response => {
566
+        if (response.data.state == 1) {
567
+          var patient = response.data.data.patient
568
+          for (let i = 0;i < this.patientsData.length; i++){
569
+            if (this.patientsData[i].id == patient.id){
570
+              this.patient_name = this.patientsData[i].name
571
+              this.$refs.table.setCurrentRow(this.patientsData[i])
572
+            }
573
+          }
574
+          this.query.patient_id = patient.id
575
+          this.GetPersonQCStatistisData(this.query)
576
+
577
+        }
578
+      })
579
+
580
+    },
581
+    getArrLength(result,type){
582
+      if(type == 1){
583
+        if(result.length > 10){
584
+          var dataZoom_end = (10/result.length)*100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }else{
587
+          var dataZoom_end = 100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }
590
+      }else if(type == 2){
591
+        if(result.length > 10){
592
+          var dataZoom_end = (10/result.length)*100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }else{
595
+          var dataZoom_end = 100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }
598
+      }
599
+
600
+    }
601
+  }, mounted() {
602
+    var date = new Date()
603
+    var year = date.getFullYear() //获取完整的年份(4位)
604
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
605
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
606
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
607
+    this.query.patient_id = 0
608
+    this.query.end_time = year + '-' + month + '-' + day
609
+    this.query.start_time = year + '-' + last_month + '-' + day
610
+    this.query.project_id = 4
611
+    this.query.item_id = 169
612
+    this.getCurrentOrgPatients()
613
+
614
+    // this.GetPersonQCStatistisData()
615
+
616
+
617
+  }
209 618
 }
210 619
 </script>
620
+
211 621
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
622
+.tableTitle {
623
+  font-size: 16px;
624
+  color: #000;
625
+  font-weight: bold;
626
+  margin-bottom: 10px;
627
+}
628
+</style>
629
+<style lang="scss">
630
+.page_process {
631
+.el-tabs{
632
+  margin-bottom:0 !important;
633
+}
634
+.el-button--medium {
635
+  padding: 10px 8px;
636
+}
637
+
638
+.el-form-item {
639
+  margin-bottom: 0;
640
+}
641
+::-webkit-scrollbar{
642
+  height: 15px !important;
643
+}
644
+
216 645
 }
217
-</style>
646
+</style>

+ 333 - 227
src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumall.vue View File

@@ -1,262 +1,368 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        
31
-        <el-row :gutter="20">
32
-        <el-col :span="5"> 
33
-          <div class="block">
34
-            <span>查询时间:</span>
35
-            <el-date-picker
36
-            v-model="time_month"
37
-            type="month"
38
-            placeholder="选择月">
39
-            </el-date-picker>
40
-          </div>
41
-        </el-col>
42
-        <el-col :span="8">
43
-          <div>
44
-            <el-date-picker
45
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
46 26
             type="date"
27
+
47 28
             placeholder="选择日期">
48
-            </el-date-picker>
49
-            <span>-</span>
50
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
51 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
52 36
             type="date"
53 37
             placeholder="选择日期">
54
-            </el-date-picker>
55
-          </div>
56
-        </el-col>
57
-        <el-col :span="3">
58
-          <div style="width: 200px;">
59
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
60
-          </div>
61
-        </el-col>
62
-        <el-col :span="2">
63
-            <el-button type="primary">查询</el-button>
64
-        </el-col>
65
-        </el-row>
66
-        
67
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
69 39
         </div>
70
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-        <div style="width: 80%;margin: auto;">
72
-            <el-table
73
-            :data="tableData"
74
-            :show-summary = true
75
-            border
76
-            style="width: 100%;">
77
-                <el-table-column
78
-                    prop="date"
79
-                    align="center"
80
-                    label="血钾"
81
-                    >
82
-                </el-table-column>
83
-                <el-table-column
84
-                    prop="name"
85
-                    
86
-                    label="人数"
87
-                    >
88
-                </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
99
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
100 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="血钾"
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          label="人数"
68
+        >
69
+        </el-table-column>
70
+<!--        <el-table-column-->
71
+<!--          prop="address"-->
72
+<!--          align="center"-->
73
+<!--          label="操作">-->
74
+<!--          <template slot-scope="scope">-->
75
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
76
+<!--                       type="text">查看详情-->
77
+<!--            </el-button>-->
78
+<!--          </template>-->
79
+<!--        </el-table-column>-->
80
+      </el-table>
101 81
     </div>
82
+  </div>
102 83
 </template>
103 84
 <script>
104
-import * as echarts from "echarts";
105
-export default{
106
-    props: {
107
-   
85
+import * as echarts from 'echarts'
86
+import { GetQCStatistisData } from '../../../api/qcd'
87
+
88
+const moment = require('moment')
89
+
90
+export default {
91
+  props: {
92
+
108 93
     width: {
109 94
       type: String,
110
-      default: "100%"
95
+      default: '100%'
111 96
     },
112 97
     height: {
113 98
       type: String,
114
-      default: "400px"
115
-    },
116
-    
99
+      default: '400px'
100
+    }
101
+
117 102
   },
118
-    data() {
119
-        return {
120
-            time_month:'',
121
-            stat_time:'',
122
-            end_time:'',
123
-            input:'',
124
-            myChart: {},
125
-            pieData : [
126
-            {
127
-          value: 463,
128
-          name: "不达标值患者"
129
-        },
130
-        {
131
-          value: 395,
132
-          name: "未检查患者"
133
-        },
134
-        {
135
-          value: 157,
136
-          name: "达标值患者"
137
-        },
138
-        // {
139
-        //   value: 149,
140
-        //   name: "广东"
141
-        // },
142
-        // {
143
-        //   value: 147,
144
-        //   name: "湖南"
145
-        // }
146
-            
147
-            ],
148
-            pieName: [],
149
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-            tableData:[],
151
-        }
152
-    },
153
-    mounted() {
154
-    this.initDate(); //数据初始化
155
-    this.initEcharts();
103
+  data() {
104
+    return {
105
+      time_type: 1,
106
+      times: [
107
+        { value: 1, label: '本月' },
108
+        { value: 2, label: '上月' },
109
+        { value: 3, label: '今年' },
110
+        { value: 4, label: '上一年' },
111
+        { value: 5, label: '第一季度' },
112
+        { value: 6, label: '第二季度' },
113
+        { value: 7, label: '第三季度' },
114
+        { value: 8, label: '第四季度' },
115
+        { value: 9, label: '自定义' }
116
+
117
+      ],
118
+      time_month: '',
119
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
121
+      input: '',
122
+      myChart: {},
123
+      pieData: [],
124
+      pieName: [],
125
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
126
+      tableData: [],
127
+      reference:{},
128
+    }
129
+  },
130
+  mounted() {
131
+    this.getData()
156 132
   },
157 133
   methods: {
158
-    initDate() {
159
-      for (let i = 0; i < this.pieData.length; i++) {
160
-        this.pieName[i] = this.pieData[i].name;
134
+    getData() {
135
+      if(this.start_time.length == 0){
136
+        this.$message.error("请选择开始时间")
161 137
       }
162
-    },
163
-    initEcharts() {
164
-      // 饼图
165
-      const option = {
166
-        legend: {
167
-          // 图例
168
-          data: this.pieName,
169
-          left: "10%",
170
-          top: "30%",
171
-          orient: "vertical"
172
-        },
173
-        color:['#ff7f9f','#fff67f','#1e5feb'],
174
-        title: {
175
-          // 设置饼图标题,位置设为顶部居中
176
-        //   text: "国内院士前五省份图示",
177
-          top: "0%",
178
-          left: "center"
179
-        },
180
-        series: [
181
-          {
182
-            type: "pie",
183
-            label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
138
+      if(this.end_time.length == 0){
139
+        this.$message.error("请选择结束时间")
140
+      }
141
+      let params = {
142
+        start_date: this.start_time,
143
+        end_date: this.end_time,
144
+        project_id: 4,
145
+        item_id: 48
146
+      }
147
+      this.pieData = []
148
+      this.tableData = []
149
+      console.log("~~~~~~~~~~")
150
+      GetQCStatistisData(params).then(response => {
151
+        if (response.data.state == 1) {
152
+          this.reference = response.data.data.reference
153
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
154
+          let objone = {
155
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
156
+            name: '不达标值患者',
157
+            count:response.data.data.unusual_total,
158
+          }
159
+          this.pieData.push(objone)
160
+          this.tableData.push(objone)
161
+
162
+          let objtwo = {
163
+            value:   response.data.data.normal_total / response.data.data.patient_count,
164
+            name: '达标值患者',
165
+            count:response.data.data.normal_total,
166
+
167
+          }
168
+          this.pieData.push(objtwo)
169
+          this.tableData.push(objtwo)
170
+
171
+          let objthree = {
172
+            value: response.data.data.patient_count / response.data.data.no_check_total,
173
+            name: '未检查患者',
174
+            count:response.data.data.no_check_total,
175
+
176
+          }
177
+          this.pieData.push(objthree)
178
+          this.tableData.push(objthree)
179
+
180
+          let objfour = {
181
+            value: response.data.data.patient_count,
182
+            name: '合计',
183
+            count:response.data.data.patient_count,
184
+          }
185
+          this.tableData.push(objfour)
186
+          for (let i = 0; i < this.pieData.length; i++) {
187
+            this.pieName[i] = this.pieData[i].name
188
+          }
189
+          this.myChart = echarts.init(document.getElementById('mychart'))
190
+          window.addEventListener('resize', () => {
191
+            this.myChart.resize()
192
+          })
193
+          const option = {
194
+            legend: {
195
+              // 图例
196
+              data: this.pieName,
197
+              left: '10%',
198
+              top: '30%',
199
+              orient: 'vertical'
200
+            },
201
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
202
+            title: {
203
+              // 设置饼图标题,位置设为顶部居中
204
+              //   text: "国内院士前五省份图示",
205
+              top: '0%',
206
+              left: 'center'
193 207
             },
194
-            radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                shadowBlur: 10,
199
-                shadowOffsetX: 0,
200
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
208
+            series: [
209
+              {
210
+                type: 'pie',
211
+                label: {
212
+                  show: true,
213
+                  formatter: '{b} : {d}% ({c})'
214
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
215
+                },
216
+                radius: '65%', //饼图半径
217
+                data: this.pieData
201 218
               }
202
-            }
219
+            ]
203 220
           }
204
-        ]
205
-      };
206
-    //   console.log(this.seriesData);
207
-      const optionFree = {
208
-        series: [
209
-          {
210
-            data: this.seriesData,
211
-            type: "line",
212
-            smooth: true
221
+          //   console.log(this.seriesData);
222
+          const optionFree = {
223
+            series: [
224
+              {
225
+                data: this.seriesData,
226
+                type: 'line',
227
+                smooth: true
228
+              }
229
+            ]
213 230
           }
214
-        ]
215
-      };
216
-      this.myChart = echarts.init(document.getElementById("mychart"));
217
-      this.myChart.setOption(option);
218
-      //随着屏幕大小调节图表
219
-      window.addEventListener("resize", () => {
220
-        this.myChart.resize();
221
-      });
231
+          this.myChart = echarts.init(document.getElementById('mychart'))
232
+          this.myChart.setOption(option)
233
+        } else {
234
+          this.$message.error(response.data.msg)
235
+        }
236
+      })
237
+
238
+    },
239
+    changeItem(val) {
240
+      const currentDate = new Date()
241
+      switch (val) {
242
+        case 1:
243
+
244
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
245
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
246
+
247
+          this.start_time = startOfMonth
248
+          this.end_time = endOfMonth
249
+          this.getData()
250
+
251
+          break
252
+        case 2:
253
+          // 上月的起始日期和结束日期
254
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
255
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
256
+
257
+          this.start_time = startOfLastMonth
258
+          this.end_time = endOfLastMonth
259
+          this.getData()
260
+
261
+          break
262
+        case 3:
263
+          // 今年的起始日期和结束日期
264
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
265
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
266
+
267
+          this.start_time = startOfYear
268
+          this.end_time = endOfYear
269
+          this.getData()
270
+
271
+          break
272
+        case 4:
273
+          // 上一年的起始日期和结束日期
274
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
275
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
276
+
277
+          this.start_time = startOfLastYear
278
+          this.end_time = endOfLastYear
279
+          this.getData()
280
+
281
+          break
282
+        case 5:
283
+          // 第一季度的起始日期和结束日期
284
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
285
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
286
+
287
+          this.start_time = startOfFirstQuarter
288
+          this.end_time = endOfFirstQuarter
289
+          this.getData()
290
+
291
+          break
292
+        case 6:
293
+          // 第二季度的起始日期和结束日期
294
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
295
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
296
+
297
+          this.start_time = startOfSecondQuarter
298
+          this.end_time = endOfSecondQuarter
299
+          this.getData()
300
+
301
+          break
302
+        case 7:
303
+          // 第三季度的起始日期和结束日期
304
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
305
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
306
+
307
+          this.start_time = startOfThirdQuarter
308
+          this.end_time = endOfThirdQuarter
309
+          this.getData()
310
+
311
+          break
312
+        case 8:
313
+          // 第四季度的起始日期和结束日期
314
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
315
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
316
+
317
+          this.start_time = startOfFourthQuarter
318
+          this.end_time = endOfFourthQuarter
319
+          this.getData()
320
+          break
321
+        case 9:
322
+          this.start_time = ''
323
+          this.end_time = ''
324
+          break
325
+      }
222 326
     },
327
+
328
+
223 329
     getSummaries(param) {
224
-        const { columns, data } = param;
225
-        const sums = [];
226
-        columns.forEach((column, index) => {
227
-          if (index === 0) {
228
-            sums[index] = '总价';
229
-            return;
230
-          }
231
-          const values = data.map(item => Number(item[column.property]));
232
-          if (!values.every(value => isNaN(value))) {
233
-            sums[index] = values.reduce((prev, curr) => {
234
-              const value = Number(curr);
235
-              if (!isNaN(value)) {
236
-                return prev + curr;
237
-              } else {
238
-                return prev;
239
-              }
240
-            }, 0);
241
-            sums[index] += ' 元';
242
-          } else {
243
-            sums[index] = 'N/A';
244
-          }
245
-        });
330
+      const { columns, data } = param
331
+      const sums = []
332
+      columns.forEach((column, index) => {
333
+        if (index === 0) {
334
+          sums[index] = '总价'
335
+          return
336
+        }
337
+        const values = data.map(item => Number(item[column.property]))
338
+        if (!values.every(value => isNaN(value))) {
339
+          sums[index] = values.reduce((prev, curr) => {
340
+            const value = Number(curr)
341
+            if (!isNaN(value)) {
342
+              return prev + curr
343
+            } else {
344
+              return prev
345
+            }
346
+          }, 0)
347
+          sums[index] += ' 元'
348
+        } else {
349
+          sums[index] = 'N/A'
350
+        }
351
+      })
246 352
 
247
-        return sums;
353
+      return sums
248 354
     },
249
-    handleClick(id){
250
-        console.log(id);
355
+    handleClick(id) {
356
+      console.log(id)
251 357
     }
252 358
   }
253 359
 
254 360
 }
255 361
 </script>
256 362
 <style lang="scss" scoped>
257
-.content_top{
258
-    display: flex;
259
-    justify-content: space-around;
260
-    color: #1e5feb;
363
+.content_top {
364
+  display: flex;
365
+  justify-content: space-around;
366
+  color: #1e5feb;
261 367
 }
262
-</style>
368
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumalone.vue View File

@@ -1,217 +1,646 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="血钾(mmol/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
107 106
 
107
+                <el-table-column width="100" label="血钾" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
108 119
     </div>
120
+  </div>
109 121
 </template>
122
+
123
+
110 124
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
135 147
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
154 173
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
172 235
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'血钾mmol/L'}]
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
179 238
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'血钾mmol/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
194 241
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
206 273
         },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
281
+        },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
207 453
     },
208
-    
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+            this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        if (this.patientsData[i].id == val.id){
533
+          this.$refs.table.setCurrentRow(this.patientsData[i])
534
+        }
535
+      }
536
+
537
+
538
+    },
539
+    querySearchAsync(keyword, cb) {
540
+      let key = ''
541
+      if (keyword != undefined) {
542
+        key = keyword
543
+      }
544
+      let searchArray = []
545
+      PostSearch(key).then(response => {
546
+        if (response.data.state == 1) {
547
+          searchArray = response.data.data.patient
548
+          cb(searchArray)
549
+        } else {
550
+          cb([])
551
+        }
552
+      })
553
+    },
554
+    chooseWay(way) {
555
+      this.wayType = way
556
+    }, getCurrentOrgPatients() {
557
+      getCurrentOrgPatients().then(response => {
558
+        if (response.data.state == 1) {
559
+          var patients = response.data.data.patients
560
+          this.patientsData = patients
561
+          this.GetDefaultPatient()
562
+        }
563
+      })
564
+    }, GetDefaultPatient() {
565
+      GetDefaultPatient().then(response => {
566
+        if (response.data.state == 1) {
567
+          var patient = response.data.data.patient
568
+          for (let i = 0;i < this.patientsData.length; i++){
569
+            if (this.patientsData[i].id == patient.id){
570
+              this.patient_name = this.patientsData[i].name
571
+              this.$refs.table.setCurrentRow(this.patientsData[i])
572
+            }
573
+          }
574
+          this.query.patient_id = patient.id
575
+          this.GetPersonQCStatistisData(this.query)
576
+
577
+        }
578
+      })
579
+
580
+    },
581
+    getArrLength(result,type){
582
+      if(type == 1){
583
+        if(result.length > 10){
584
+          var dataZoom_end = (10/result.length)*100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }else{
587
+          var dataZoom_end = 100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }
590
+      }else if(type == 2){
591
+        if(result.length > 10){
592
+          var dataZoom_end = (10/result.length)*100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }else{
595
+          var dataZoom_end = 100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }
598
+      }
599
+
600
+    }
601
+  }, mounted() {
602
+    var date = new Date()
603
+    var year = date.getFullYear() //获取完整的年份(4位)
604
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
605
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
606
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
607
+    this.query.patient_id = 0
608
+    this.query.end_time = year + '-' + month + '-' + day
609
+    this.query.start_time = year + '-' + last_month + '-' + day
610
+    this.query.project_id = 4
611
+    this.query.item_id = 48
612
+    this.getCurrentOrgPatients()
613
+
614
+    // this.GetPersonQCStatistisData()
615
+
616
+
617
+  }
209 618
 }
210 619
 </script>
620
+
211 621
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
622
+.tableTitle {
623
+  font-size: 16px;
624
+  color: #000;
625
+  font-weight: bold;
626
+  margin-bottom: 10px;
627
+}
628
+</style>
629
+<style lang="scss">
630
+.page_process {
631
+.el-tabs{
632
+  margin-bottom:0 !important;
633
+}
634
+.el-button--medium {
635
+  padding: 10px 8px;
636
+}
637
+
638
+.el-form-item {
639
+  margin-bottom: 0;
640
+}
641
+::-webkit-scrollbar{
642
+  height: 15px !important;
643
+}
644
+
216 645
 }
217
-</style>
646
+</style>

+ 334 - 227
src/xt_pages/Dialysisanalysis/calcium/calciumall.vue View File

@@ -1,262 +1,369 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        
31
-        <el-row :gutter="20">
32
-        <el-col :span="5"> 
33
-          <div class="block">
34
-            <span>查询时间:</span>
35
-            <el-date-picker
36
-            v-model="time_month"
37
-            type="month"
38
-            placeholder="选择月">
39
-            </el-date-picker>
40
-          </div>
41
-        </el-col>
42
-        <el-col :span="8">
43
-          <div>
44
-            <el-date-picker
45
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
46 26
             type="date"
27
+
47 28
             placeholder="选择日期">
48
-            </el-date-picker>
49
-            <span>-</span>
50
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
51 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
52 36
             type="date"
53 37
             placeholder="选择日期">
54
-            </el-date-picker>
55
-          </div>
56
-        </el-col>
57
-        <el-col :span="3">
58
-          <div style="width: 200px;">
59
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
60
-          </div>
61
-        </el-col>
62
-        <el-col :span="2">
63
-            <el-button type="primary">查询</el-button>
64
-        </el-col>
65
-        </el-row>
66
-
67
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
69 39
         </div>
70
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-        <div style="width: 80%;margin: auto;">
72
-            <el-table
73
-            :data="tableData"
74
-            :show-summary = true
75
-            border
76
-            style="width: 100%;">
77
-                <el-table-column
78
-                    prop="date"
79
-                    align="center"
80
-                    label="钙"
81
-                    >
82
-                </el-table-column>
83
-                <el-table-column
84
-                    prop="name"
85
-                    
86
-                    label="人数"
87
-                    >
88
-                </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
99
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
100 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="钙"
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          label="人数"
68
+        >
69
+        </el-table-column>
70
+<!--        <el-table-column-->
71
+<!--          prop="address"-->
72
+<!--          align="center"-->
73
+<!--          label="操作">-->
74
+<!--          <template slot-scope="scope">-->
75
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
76
+<!--                       type="text">查看详情-->
77
+<!--            </el-button>-->
78
+<!--          </template>-->
79
+<!--        </el-table-column>-->
80
+      </el-table>
101 81
     </div>
82
+  </div>
102 83
 </template>
103 84
 <script>
104
-import * as echarts from "echarts";
105
-export default{
106
-    props: {
107
-   
85
+import * as echarts from 'echarts'
86
+import { GetQCStatistisData } from '../../../api/qcd'
87
+
88
+const moment = require('moment')
89
+
90
+export default {
91
+  props: {
92
+
108 93
     width: {
109 94
       type: String,
110
-      default: "100%"
95
+      default: '100%'
111 96
     },
112 97
     height: {
113 98
       type: String,
114
-      default: "400px"
115
-    },
116
-    
99
+      default: '400px'
100
+    }
101
+
117 102
   },
118
-    data() {
119
-        return {
120
-            time_month:'',
121
-            stat_time:'',
122
-            end_time:'',
123
-            input:'',
124
-            myChart: {},
125
-            pieData : [
126
-            {
127
-          value: 463,
128
-          name: "不达标值患者"
129
-        },
130
-        {
131
-          value: 395,
132
-          name: "未检查患者"
133
-        },
134
-        {
135
-          value: 157,
136
-          name: "达标值患者"
137
-        },
138
-        // {
139
-        //   value: 149,
140
-        //   name: "广东"
141
-        // },
142
-        // {
143
-        //   value: 147,
144
-        //   name: "湖南"
145
-        // }
146
-            
147
-            ],
148
-            pieName: [],
149
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-            tableData:[],
151
-        }
152
-    },
153
-    mounted() {
154
-    this.initDate(); //数据初始化
155
-    this.initEcharts();
103
+  data() {
104
+    return {
105
+      time_type: 1,
106
+      times: [
107
+        { value: 1, label: '本月' },
108
+        { value: 2, label: '上月' },
109
+        { value: 3, label: '今年' },
110
+        { value: 4, label: '上一年' },
111
+        { value: 5, label: '第一季度' },
112
+        { value: 6, label: '第二季度' },
113
+        { value: 7, label: '第三季度' },
114
+        { value: 8, label: '第四季度' },
115
+        { value: 9, label: '自定义' }
116
+
117
+      ],
118
+      time_month: '',
119
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
121
+      input: '',
122
+      myChart: {},
123
+      pieData: [],
124
+      pieName: [],
125
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
126
+      tableData: [],
127
+      reference:{},
128
+    }
129
+  },
130
+  mounted() {
131
+    this.getData()
156 132
   },
157 133
   methods: {
158
-    initDate() {
159
-      for (let i = 0; i < this.pieData.length; i++) {
160
-        this.pieName[i] = this.pieData[i].name;
134
+    getData() {
135
+      if(this.start_time.length == 0){
136
+        this.$message.error("请选择开始时间")
161 137
       }
162
-    },
163
-    initEcharts() {
164
-      // 饼图
165
-      const option = {
166
-        legend: {
167
-          // 图例
168
-          data: this.pieName,
169
-          left: "10%",
170
-          top: "30%",
171
-          orient: "vertical"
172
-        },
173
-        color:['#ff7f9f','#fff67f','#1e5feb'],
174
-        title: {
175
-          // 设置饼图标题,位置设为顶部居中
176
-        //   text: "国内院士前五省份图示",
177
-          top: "0%",
178
-          left: "center"
179
-        },
180
-        series: [
181
-          {
182
-            type: "pie",
183
-            label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
138
+      if(this.end_time.length == 0){
139
+        this.$message.error("请选择结束时间")
140
+      }
141
+      let params = {
142
+        start_date: this.start_time,
143
+        end_date: this.end_time,
144
+        project_id: 4,
145
+        item_id: 289
146
+      }
147
+      this.pieData = []
148
+      this.tableData = []
149
+      console.log("~~~~~~~~~~")
150
+      GetQCStatistisData(params).then(response => {
151
+        if (response.data.state == 1) {
152
+          this.reference = response.data.data.reference
153
+
154
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
155
+          let objone = {
156
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
157
+            name: '不达标值患者',
158
+            count:response.data.data.unusual_total,
159
+          }
160
+          this.pieData.push(objone)
161
+          this.tableData.push(objone)
162
+
163
+          let objtwo = {
164
+            value:   response.data.data.normal_total / response.data.data.patient_count,
165
+            name: '达标值患者',
166
+            count:response.data.data.normal_total,
167
+
168
+          }
169
+          this.pieData.push(objtwo)
170
+          this.tableData.push(objtwo)
171
+
172
+          let objthree = {
173
+            value: response.data.data.patient_count / response.data.data.no_check_total,
174
+            name: '未检查患者',
175
+            count:response.data.data.no_check_total,
176
+
177
+          }
178
+          this.pieData.push(objthree)
179
+          this.tableData.push(objthree)
180
+
181
+          let objfour = {
182
+            value: response.data.data.patient_count,
183
+            name: '合计',
184
+            count:response.data.data.patient_count,
185
+          }
186
+          this.tableData.push(objfour)
187
+          for (let i = 0; i < this.pieData.length; i++) {
188
+            this.pieName[i] = this.pieData[i].name
189
+          }
190
+          this.myChart = echarts.init(document.getElementById('mychart'))
191
+          window.addEventListener('resize', () => {
192
+            this.myChart.resize()
193
+          })
194
+          const option = {
195
+            legend: {
196
+              // 图例
197
+              data: this.pieName,
198
+              left: '10%',
199
+              top: '30%',
200
+              orient: 'vertical'
201
+            },
202
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
203
+            title: {
204
+              // 设置饼图标题,位置设为顶部居中
205
+              //   text: "国内院士前五省份图示",
206
+              top: '0%',
207
+              left: 'center'
193 208
             },
194
-            radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                shadowBlur: 10,
199
-                shadowOffsetX: 0,
200
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
209
+            series: [
210
+              {
211
+                type: 'pie',
212
+                label: {
213
+                  show: true,
214
+                  formatter: '{b} : {d}% ({c})'
215
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
216
+                },
217
+                radius: '65%', //饼图半径
218
+                data: this.pieData
201 219
               }
202
-            }
220
+            ]
203 221
           }
204
-        ]
205
-      };
206
-    //   console.log(this.seriesData);
207
-      const optionFree = {
208
-        series: [
209
-          {
210
-            data: this.seriesData,
211
-            type: "line",
212
-            smooth: true
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
229
+              }
230
+            ]
213 231
           }
214
-        ]
215
-      };
216
-      this.myChart = echarts.init(document.getElementById("mychart"));
217
-      this.myChart.setOption(option);
218
-      //随着屏幕大小调节图表
219
-      window.addEventListener("resize", () => {
220
-        this.myChart.resize();
221
-      });
232
+          this.myChart = echarts.init(document.getElementById('mychart'))
233
+          this.myChart.setOption(option)
234
+        } else {
235
+          this.$message.error(response.data.msg)
236
+        }
237
+      })
238
+
239
+    },
240
+    changeItem(val) {
241
+      const currentDate = new Date()
242
+      switch (val) {
243
+        case 1:
244
+
245
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
246
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
247
+
248
+          this.start_time = startOfMonth
249
+          this.end_time = endOfMonth
250
+          this.getData()
251
+
252
+          break
253
+        case 2:
254
+          // 上月的起始日期和结束日期
255
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
256
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
257
+
258
+          this.start_time = startOfLastMonth
259
+          this.end_time = endOfLastMonth
260
+          this.getData()
261
+
262
+          break
263
+        case 3:
264
+          // 今年的起始日期和结束日期
265
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
266
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
267
+
268
+          this.start_time = startOfYear
269
+          this.end_time = endOfYear
270
+          this.getData()
271
+
272
+          break
273
+        case 4:
274
+          // 上一年的起始日期和结束日期
275
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
276
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
277
+
278
+          this.start_time = startOfLastYear
279
+          this.end_time = endOfLastYear
280
+          this.getData()
281
+
282
+          break
283
+        case 5:
284
+          // 第一季度的起始日期和结束日期
285
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
286
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
287
+
288
+          this.start_time = startOfFirstQuarter
289
+          this.end_time = endOfFirstQuarter
290
+          this.getData()
291
+
292
+          break
293
+        case 6:
294
+          // 第二季度的起始日期和结束日期
295
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
296
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
297
+
298
+          this.start_time = startOfSecondQuarter
299
+          this.end_time = endOfSecondQuarter
300
+          this.getData()
301
+
302
+          break
303
+        case 7:
304
+          // 第三季度的起始日期和结束日期
305
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
306
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
307
+
308
+          this.start_time = startOfThirdQuarter
309
+          this.end_time = endOfThirdQuarter
310
+          this.getData()
311
+
312
+          break
313
+        case 8:
314
+          // 第四季度的起始日期和结束日期
315
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
316
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
317
+
318
+          this.start_time = startOfFourthQuarter
319
+          this.end_time = endOfFourthQuarter
320
+          this.getData()
321
+          break
322
+        case 9:
323
+          this.start_time = ''
324
+          this.end_time = ''
325
+          break
326
+      }
222 327
     },
328
+
329
+
223 330
     getSummaries(param) {
224
-        const { columns, data } = param;
225
-        const sums = [];
226
-        columns.forEach((column, index) => {
227
-          if (index === 0) {
228
-            sums[index] = '总价';
229
-            return;
230
-          }
231
-          const values = data.map(item => Number(item[column.property]));
232
-          if (!values.every(value => isNaN(value))) {
233
-            sums[index] = values.reduce((prev, curr) => {
234
-              const value = Number(curr);
235
-              if (!isNaN(value)) {
236
-                return prev + curr;
237
-              } else {
238
-                return prev;
239
-              }
240
-            }, 0);
241
-            sums[index] += ' 元';
242
-          } else {
243
-            sums[index] = 'N/A';
244
-          }
245
-        });
331
+      const { columns, data } = param
332
+      const sums = []
333
+      columns.forEach((column, index) => {
334
+        if (index === 0) {
335
+          sums[index] = '总价'
336
+          return
337
+        }
338
+        const values = data.map(item => Number(item[column.property]))
339
+        if (!values.every(value => isNaN(value))) {
340
+          sums[index] = values.reduce((prev, curr) => {
341
+            const value = Number(curr)
342
+            if (!isNaN(value)) {
343
+              return prev + curr
344
+            } else {
345
+              return prev
346
+            }
347
+          }, 0)
348
+          sums[index] += ' 元'
349
+        } else {
350
+          sums[index] = 'N/A'
351
+        }
352
+      })
246 353
 
247
-        return sums;
354
+      return sums
248 355
     },
249
-    handleClick(id){
250
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
251 358
     }
252 359
   }
253 360
 
254 361
 }
255 362
 </script>
256 363
 <style lang="scss" scoped>
257
-.content_top{
258
-    display: flex;
259
-    justify-content: space-around;
260
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
261 368
 }
262
-</style>
369
+</style>

+ 630 - 198
src/xt_pages/Dialysisanalysis/calcium/calciumalone.vue View File

@@ -1,217 +1,649 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"
87
+                          v-if="query.statistics_type != 9 && query.statistics_type != 10"></line-chart>
88
+              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="钙(mmol/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                  </template>
97
+                </el-table-column>
98
+
99
+                <el-table-column width="100" label="检查日期" align="center">
100
+                  <template slot-scope="scope">
101
+                  </template>
102
+                </el-table-column>
107 103
 
104
+                <el-table-column width="100" label="钙" align="center">
105
+                  <template slot-scope="scope">
106
+                  </template>
107
+                </el-table-column>
108
+              </el-table>
109
+
110
+              <el-pagination
111
+                align="right"
112
+                @size-change="handleSizeChange"
113
+                @current-change="handleCurrentChange"
114
+                :current-page="query.page"
115
+                :page-sizes="[10, 20, 50, 100]"
116
+                :page-size="10"
117
+                background
118
+                style="margin-top:20px;"
119
+                layout="total, sizes, prev, pager, next, jumper"
120
+                :total="total"
121
+              ></el-pagination>
122
+            </div>
123
+          </div>
124
+        </el-container>
125
+      </div>
108 126
     </div>
127
+  </div>
109 128
 </template>
129
+
130
+
110 131
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
132
+import echarts from 'echarts'
133
+// import LineChart from '../../qcd/components/LineChart'
134
+import {  uParseTime } from '@/utils/tools'
135
+import { getCurrentOrgPatients } from '@/api/common/common'
136
+import {
137
+  GetDefaultPatient,
138
+} from '@/api/common/statistics'
139
+import { PostSearch } from '@/api/patient'
140
+import { getDataConfig } from '@/utils/data'
141
+import { GetPersonQCStatistisData } from '../../../api/qcd'
142
+
143
+export default {
144
+  components: {
145
+  },
146
+  data() {
147
+    return {
148
+      pickerOptions: {
149
+        disabledDate(time) {
150
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
151
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
152
+
135 153
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
154
+      },
155
+      patient_name:'',
156
+      percent:[],
157
+      patientsData: [],
158
+      tableData: [],
159
+      loading: false,
160
+      search_value: '',
161
+      total: 0,
162
+      query: {
163
+        patient_id: '',
164
+        statistics_type: 1,
165
+        start_time: '',
166
+        end_time: '',
167
+        limit: 10,
168
+        page: 1
169
+      },
170
+      crumbs: [
171
+        { path: false, name: '科室质控' },
172
+        { path: false, name: '指标评估统计' },
173
+        { path: false, name: '透析过程指标统计' }
174
+      ],
175
+      tableData1: [],
176
+      chart: {
177
+        title: {
178
+          text: 'ECharts 入门示例'
154 179
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
180
+        tooltip: {},
181
+        legend: {
182
+          data: [],
183
+          left: 0
184
+        },
185
+        xAxis: {
186
+          data: []
187
+        },
188
+        yAxis: {
189
+          axisLabel: {
190
+            formatter: '{value} %'
191
+          },
192
+          show: false
193
+        },
194
+        series: [
195
+          {
196
+            name: '',
197
+            type: 'line',
198
+            data: [],
199
+            barWidth: 30,
200
+            label: {
201
+              normal: {
202
+                show: true,
203
+                position: 'top',
204
+                formatter: (params) => {
205
+                  if(this.percent.length > 0){
206
+                    let str = ''
207
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
208
+                    return str
209
+                  }else{
210
+                    let str = ''
211
+                    str = params.data
212
+                    return str
213
+                  }
214
+                }
215
+              }
216
+            },
217
+            //配置样式
218
+            itemStyle: {
219
+              //通常情况下:
220
+
221
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
222
+              normal: {
223
+                color: function(params) {
224
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
225
+                  var colorList = [
226
+                    ['#A9E0F3', '#9FBDFC'],
227
+
228
+                    ['#FFD7C0', '#FF9994']
229
+                  ]
230
+
231
+                  var index = params.dataIndex
232
+                  if (params.dataIndex >= colorList.length) {
233
+                    index = params.dataIndex % colorList.length
234
+                  }
235
+
236
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
237
+                    { offset: 0, color: colorList[index][0] },
238
+                    // { offset: 0.5, color: colorList[index][1] },
239
+                    { offset: 1, color: colorList[index][1] }
240
+                  ])
172 241
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'钙mmol/L'}]
242
+                lineStyle:{
243
+                  color:'#409eff' //改变折线颜色
179 244
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'钙mmol/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
245
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
246
+              },
194 247
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
248
+              //鼠标悬停时:
249
+              emphasis: {
250
+                shadowBlur: 10,
251
+                shadowOffsetX: 0,
252
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
253
+              }
254
+            }
255
+          }
256
+        ],
257
+        dataZoom: [
258
+          {
259
+            // Y轴固定,让内容滚动
260
+            type: 'slider',
261
+            show: false,
262
+            xAxisIndex: [0],
263
+            start: 1,
264
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
265
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
266
+          },
267
+          {
268
+            type: 'inside',
269
+            xAxisIndex: [0],
270
+            start: 1,
271
+            end: 20,
272
+            zoomLock: true // 锁定区域禁止缩放
273
+          }
274
+        ]
275
+      },
276
+      bar: {
277
+        title: {
278
+          text: 'ECharts 入门示例'
279
+        },
280
+        tooltip: {},
281
+        legend: {
282
+          data: [],
283
+          left: 0
206 284
         },
285
+        xAxis: {
286
+          data: []
287
+        },
288
+        yAxis: {
289
+          axisLabel: {
290
+            formatter: '{value} %'
291
+          },
292
+          show: false
293
+        },
294
+        series: [
295
+          {
296
+            name: '',
297
+            type: 'bar',
298
+            data: [],
299
+            barWidth: 30,
300
+            label: {
301
+              normal: {
302
+                show: true,
303
+                position: 'top',
304
+                formatter: (params) => {
305
+                  if(this.percent.length > 0){
306
+                    let str = ''
307
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
308
+                    return str
309
+                  }else{
310
+                    let str = ''
311
+                    str = params.data
312
+                    return str
313
+                  }
314
+                }
315
+              }
316
+            },
317
+            //配置样式
318
+            itemStyle: {
319
+              //通常情况下:
320
+
321
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
322
+              normal: {
323
+                color: function(params) {
324
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
325
+                  var colorList = [
326
+                    ['#A9E0F3', '#9FBDFC'],
327
+                    ['#FFD7C0', '#FF9994']
328
+                  ]
329
+
330
+                  var index = params.dataIndex
331
+                  if (params.dataIndex >= colorList.length) {
332
+                    index = params.dataIndex % colorList.length
333
+                  }
334
+
335
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
336
+                    { offset: 0, color: colorList[index][0] },
337
+                    // { offset: 0.5, color: colorList[index][1] },
338
+                    { offset: 1, color: colorList[index][1] }
339
+                  ])
340
+                },
341
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
342
+              },
343
+
344
+              //鼠标悬停时:
345
+              emphasis: {
346
+                shadowBlur: 10,
347
+                shadowOffsetX: 0,
348
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
349
+              }
350
+            }
351
+          }
352
+        ]
353
+      }
354
+
355
+    }
356
+  },
357
+  methods: {
358
+    printAction(){
359
+      this.$router.push({
360
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
361
+      });
362
+
363
+    },exportAction(){
364
+      let list = []
365
+      for (let i = 0; i < this.tableData.length; i++) {
366
+        let order = this.tableData[i]
367
+        let name = order.name
368
+        let item_name = order.item_name
369
+        let count = order.count
370
+        let price = order.price.toFixed(2)
371
+        let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
372
+        let total = order.total.toFixed(2)
373
+
374
+        let obj = {
375
+          '患者姓名': name,
376
+          '项目名称': item_name,
377
+          '数量': count,
378
+          '单价': price,
379
+          '费用': pay_sumamt,
380
+          '费用总额': total
381
+        }
382
+        list.push(obj)
383
+      }
384
+      import('@/vendor/Export2Excel').then(excel => {
385
+        const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
386
+        const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
387
+        const data = this.formatJson(filterVal, list)
388
+        excel.export_json_to_excel1({
389
+          header: tHeader,
390
+          data,
391
+          filename: '明细',
392
+          ref: this.$refs['table'].$el
393
+        })
394
+      })
395
+    },
396
+    changeProject(val) {
397
+      this.query.statistics_type = val
398
+      this.query.page = 1
399
+      this.GetPersonQCStatistisData(this.query)
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleChange(val) {
404
+      this.query.patient_id = val.id
405
+      this.query.page = 1
406
+      this.patient_name = val.name
407
+      this.GetPersonQCStatistisData(this.query)
408
+      this.GetInspectionCheckIndexTableData(this.query)
409
+    },
410
+    handleSizeChange(limit) {
411
+      this.query.limit = limit
412
+      this.GetInspectionCheckIndexTableData(this.query)
413
+
207 414
     },
208
-    
415
+    handleCurrentChange(page) {
416
+      this.query.page = page
417
+      this.GetPersonQCStatistisData(this.query)
418
+    },formatJson(filterVal, jsonData) {
419
+      return jsonData.map(v => filterVal.map(j => v[j]))
420
+    },
421
+    changeTime(val) {
422
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
423
+      if (time > 0) {
424
+        this.$message.error('结束时间不能小于开始时间')
425
+        this.query.start_time = ''
426
+      } else {
427
+        // this.getDialysisList()
428
+        this.query.page = 1
429
+        this.GetPersonQCStatistisData(this.query)
430
+        this.GetInspectionCheckIndexTableData(this.query)
431
+
432
+      }
433
+
434
+    },
435
+    changeEndTime(val) {
436
+      var time =
437
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
438
+      if (time < 0) {
439
+        this.$message.error('结束时间不能小于开始时间')
440
+        this.query.end_time = ''
441
+      } else {
442
+        this.query.page = 1
443
+        this.GetPersonQCStatistisData(this.query)
444
+        this.GetInspectionCheckIndexTableData(this.query)
445
+
446
+      }
447
+    },
448
+    getTimestamp(time) {
449
+      // 把时间日期转成时间戳
450
+      return new Date(time).getTime() / 1000
451
+    },
452
+    QueryOperaById: function(val) {
453
+      let vascular_access_desc_name = ''
454
+      let vascular_access_desc = getDataConfig(
455
+        'hemodialysis',
456
+        'vascular_access_desc'
457
+      )
458
+      for (let i = 0; i < vascular_access_desc.length; i++) {
459
+        if (vascular_access_desc[i].id == val) {
460
+          vascular_access_desc_name = vascular_access_desc[i].name
461
+        }
462
+      }
463
+
464
+      return vascular_access_desc_name
465
+    },
466
+    GetAnticoagulantById: function(val) {
467
+      let anticoagulan_name = ''
468
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
469
+      let anticoagulant = anticoagulantsConfitTwo
470
+      for (let keys in anticoagulant) {
471
+        if (anticoagulant[keys].id == val) {
472
+          anticoagulan_name = anticoagulant[keys].name
473
+        }
474
+      }
475
+      return anticoagulan_name
476
+    },
477
+    getModeName(mode_id) {
478
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
479
+    },  getTime(val) {
480
+      if(val == "" || val == undefined){
481
+        return ""
482
+      }else {
483
+        return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
484
+      }
485
+    },
486
+    GetInspectionCheckIndexTableData(params) {
487
+      this.loading = true
488
+      GetPersonQCStatistisData(params)
489
+        .then(rs => {
490
+          var resp = rs.data
491
+          console.log("resp=====",resp)
492
+          if (resp.state == 1) {
493
+            this.loading = false
494
+            this.tableData = []
495
+            for (let i = 0; i < resp.data.inspections.length; i++) {
496
+              this.tableData.push(resp.data.inspections[i])
497
+            }
498
+            this.total = resp.data.total
499
+
500
+          } else {
501
+            this.loading = false
502
+          }
503
+        })
504
+        .catch(error => {
505
+
506
+        })
507
+    },
508
+    GetPersonQCStatistisData(params) {
509
+      this.chart.xAxis.data = []
510
+      this.chart.series[0].data = []
511
+      this.bar.xAxis.data = []
512
+      this.bar.series[0].data = []
513
+      this.percent = []
514
+      GetPersonQCStatistisData(params)
515
+        .then(rs => {
516
+          var resp = rs.data
517
+          if (resp.state == 1) {
518
+            for (let i = 0; i < resp.data.inspections.length; i++) {
519
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
520
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
521
+            }
522
+            this.getArrLength(this.chart.xAxis.data,1)
523
+          } else {
524
+
525
+          }
526
+        })
527
+        .catch(error => {
528
+        })
529
+    },
530
+    handleSelect(val) {
531
+      this.query.patient_id = val.id
532
+      this.query.page = 1
533
+      this.patient_name = val.name
534
+      for (let i = 0;i < this.patientsData.length; i++){
535
+        if (this.patientsData[i].id == val.id){
536
+          this.$refs.table.setCurrentRow(this.patientsData[i])
537
+        }
538
+      }
539
+
540
+
541
+    },
542
+    querySearchAsync(keyword, cb) {
543
+      let key = ''
544
+      if (keyword != undefined) {
545
+        key = keyword
546
+      }
547
+      let searchArray = []
548
+      PostSearch(key).then(response => {
549
+        if (response.data.state == 1) {
550
+          searchArray = response.data.data.patient
551
+          cb(searchArray)
552
+        } else {
553
+          cb([])
554
+        }
555
+      })
556
+    },
557
+    chooseWay(way) {
558
+      this.wayType = way
559
+    }, getCurrentOrgPatients() {
560
+      getCurrentOrgPatients().then(response => {
561
+        if (response.data.state == 1) {
562
+          var patients = response.data.data.patients
563
+          this.patientsData = patients
564
+          this.GetDefaultPatient()
565
+        }
566
+      })
567
+    }, GetDefaultPatient() {
568
+      GetDefaultPatient().then(response => {
569
+        if (response.data.state == 1) {
570
+          var patient = response.data.data.patient
571
+          for (let i = 0;i < this.patientsData.length; i++){
572
+            if (this.patientsData[i].id == patient.id){
573
+              this.patient_name = this.patientsData[i].name
574
+              this.$refs.table.setCurrentRow(this.patientsData[i])
575
+            }
576
+          }
577
+          this.query.patient_id = patient.id
578
+          this.GetPersonQCStatistisData(this.query)
579
+
580
+        }
581
+      })
582
+
583
+    },
584
+    getArrLength(result,type){
585
+      if(type == 1){
586
+        if(result.length > 10){
587
+          var dataZoom_end = (10/result.length)*100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }else{
590
+          var dataZoom_end = 100;
591
+          this.chart.dataZoom[0].end = dataZoom_end
592
+        }
593
+      }else if(type == 2){
594
+        if(result.length > 10){
595
+          var dataZoom_end = (10/result.length)*100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }else{
598
+          var dataZoom_end = 100;
599
+          this.bar.dataZoom[0].end = dataZoom_end
600
+        }
601
+      }
602
+
603
+    }
604
+  }, mounted() {
605
+    var date = new Date()
606
+    var year = date.getFullYear() //获取完整的年份(4位)
607
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
608
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
609
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
610
+    this.query.patient_id = 0
611
+    this.query.end_time = year + '-' + month + '-' + day
612
+    this.query.start_time = year + '-' + last_month + '-' + day
613
+    this.query.project_id = 4
614
+    this.query.item_id = 289
615
+    this.getCurrentOrgPatients()
616
+
617
+    // this.GetPersonQCStatistisData()
618
+
619
+
620
+  }
209 621
 }
210 622
 </script>
623
+
211 624
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
625
+.tableTitle {
626
+  font-size: 16px;
627
+  color: #000;
628
+  font-weight: bold;
629
+  margin-bottom: 10px;
630
+}
631
+</style>
632
+<style lang="scss">
633
+.page_process {
634
+.el-tabs{
635
+  margin-bottom:0 !important;
636
+}
637
+.el-button--medium {
638
+  padding: 10px 8px;
639
+}
640
+
641
+.el-form-item {
642
+  margin-bottom: 0;
643
+}
644
+::-webkit-scrollbar{
645
+  height: 15px !important;
646
+}
647
+
216 648
 }
217
-</style>
649
+</style>

+ 125 - 0
src/xt_pages/Dialysisanalysis/components/BarChart.vue View File

@@ -0,0 +1,125 @@
1
+<template>
2
+  <div :class="className" :style="{height:height,width:width}"></div>
3
+</template>
4
+
5
+<script>
6
+import echarts from "echarts";
7
+require("echarts/theme/macarons"); // echarts theme
8
+import { debounce } from "@/utils";
9
+
10
+const animationDuration = 6000;
11
+
12
+export default {
13
+  props: {
14
+    className: {
15
+      type: String,
16
+      default: "chart"
17
+    },
18
+    width: {
19
+      type: String,
20
+      default: "100%"
21
+    },
22
+    height: {
23
+      type: String,
24
+      default: "380px"
25
+    },
26
+    title: {
27
+      type: String,
28
+      default: "chart"
29
+    },
30
+    options: {
31
+      type: Object,
32
+      default: function() {
33
+        return {};
34
+      }
35
+    }
36
+  },
37
+  data() {
38
+    return {
39
+      chart: null,
40
+      chartOptions: {}
41
+    };
42
+  },
43
+  mounted() {
44
+    this.initChart();
45
+    this.__resizeHanlder = debounce(() => {
46
+      if (this.chart) {
47
+        this.chart.resize();
48
+      }
49
+    }, 100);
50
+    window.addEventListener("resize", this.__resizeHanlder);
51
+  },
52
+  beforeDestroy() {
53
+    if (!this.chart) {
54
+      return;
55
+    }
56
+    window.removeEventListener("resize", this.__resizeHanlder);
57
+    this.chart.dispose();
58
+    this.chart = null;
59
+  },
60
+  created() {},
61
+  watch: {
62
+    options: function() {
63
+      this.chartOptions = this.options;
64
+      this.initChart();
65
+      this.__resizeHanlder = debounce(() => {
66
+        if (this.chart) {
67
+          this.chart.resize();
68
+        }
69
+      }, 100);
70
+      window.addEventListener("resize", this.__resizeHanlder);
71
+    }
72
+  },
73
+  methods: {
74
+    initChart() {
75
+      console.log("this.chartOptions", this.chartOptions);
76
+      this.chart = echarts.init(this.$el, "macarons");
77
+      this.chart.setOption({
78
+        title: {
79
+          text: this.title
80
+        },
81
+        tooltip: {
82
+          trigger: "axis",
83
+          axisPointer: {
84
+            // 坐标轴指示器,坐标轴触发有效
85
+            type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
86
+          }
87
+        },
88
+        grid: {
89
+          left: "2%",
90
+          right: "2%",
91
+          bottom: "3%",
92
+          containLabel: true
93
+        },
94
+        xAxis: [
95
+          {
96
+            type: "category",
97
+            data: this.chartOptions.xAxis,
98
+            axisTick: {
99
+              alignWithLabel: true
100
+            }
101
+          }
102
+        ],
103
+        yAxis: [
104
+          {
105
+            type: "value",
106
+            axisTick: {
107
+              show: false
108
+            }
109
+          }
110
+        ],
111
+        series: [
112
+          {
113
+            name: "",
114
+            type: "bar",
115
+            stack: "vistors",
116
+            barWidth: "60%",
117
+            data: this.chartOptions.series,
118
+            animationDuration
119
+          }
120
+        ]
121
+      });
122
+    }
123
+  }
124
+};
125
+</script>

+ 261 - 0
src/xt_pages/Dialysisanalysis/components/LineChart.vue View File

@@ -0,0 +1,261 @@
1
+<template>
2
+  <div :class="className" :style="{height:height,width:width}"></div>
3
+</template>
4
+
5
+<script>
6
+import echarts from "echarts";
7
+require("echarts/theme/macarons"); // echarts theme
8
+import { debounce } from "@/utils";
9
+
10
+export default {
11
+  props: {
12
+    className: {
13
+      type: String,
14
+      default: "chart"
15
+    },
16
+    width: {
17
+      type: String,
18
+      default: "100%"
19
+    },
20
+    height: {
21
+      type: String,
22
+      default: "230px"
23
+    },
24
+    autoResize: {
25
+      type: Boolean,
26
+      default: true
27
+    },
28
+    chartData: {
29
+      type: Object
30
+    },
31
+    title: {
32
+      type: String,
33
+      default: "chart"
34
+    },
35
+    options: {
36
+      type: Object,
37
+      default: function() {
38
+        return {};
39
+      }
40
+    }
41
+  },
42
+  data() {
43
+    return {
44
+      chart: null,
45
+      chartOptions: {
46
+        xAxis: [],
47
+        legend: [],
48
+        series: []
49
+      }
50
+    };
51
+  },
52
+  mounted() {
53
+    this.initChart();
54
+    if (this.autoResize) {
55
+      this.__resizeHanlder = debounce(() => {
56
+        if (this.chart) {
57
+          this.chart.resize();
58
+        }
59
+      }, 100);
60
+      window.addEventListener("resize", this.__resizeHanlder);
61
+    }
62
+
63
+    // 监听侧边栏的变化
64
+    const sidebarElm = document.getElementsByClassName("sidebar-container")[0];
65
+    sidebarElm.addEventListener("transitionend", this.__resizeHanlder);
66
+  },
67
+  beforeDestroy() {
68
+    if (!this.chart) {
69
+      return;
70
+    }
71
+    if (this.autoResize) {
72
+      window.removeEventListener("resize", this.__resizeHanlder);
73
+    }
74
+
75
+    const sidebarElm = document.getElementsByClassName("sidebar-container")[0];
76
+    sidebarElm.removeEventListener("transitionend", this.__resizeHanlder);
77
+
78
+    this.chart.dispose();
79
+    this.chart = null;
80
+  },
81
+  watch: {
82
+    // options: function(a) {
83
+    //   console.log(a)
84
+    //   this.chartOptions = this.options;
85
+    //   this.initChart();
86
+    //   this.__resizeHanlder = debounce(() => {
87
+    //     if (this.chart) {
88
+    //       this.chart.resize();
89
+    //     }
90
+    //   }, 100);
91
+    //   window.addEventListener("resize", this.__resizeHanlder);
92
+    // },
93
+    options:{
94
+      handler(newValue,oldValue){
95
+        this.getInitChart();
96
+      },
97
+      deep:true
98
+    },
99
+
100
+    chartData: {
101
+      deep: true,
102
+      handler(val) {
103
+        this.setOptions(val);
104
+      }
105
+    }
106
+  },
107
+  created() {
108
+    this.chartOptions = this.options;
109
+    // console.log("this.chartOptions", this.chartOptions, this.options);
110
+  },
111
+  methods: {
112
+    getInitChart() {
113
+      this.chartOptions = this.options;
114
+      this.initChart();
115
+      this.__resizeHanlder = debounce(() => {
116
+        if (this.chart) {
117
+          this.chart.resize();
118
+        }
119
+      }, 100);
120
+      window.addEventListener("resize", this.__resizeHanlder);
121
+    },
122
+    // setOptions({ expectedData, actualData } = {}) {
123
+    //   this.chart.setOption({
124
+    //     title: {
125
+    //         text: this.title,
126
+    //     },
127
+    //     xAxis: {
128
+    //       data: this.chartOptions.xAxis,
129
+    //       boundaryGap: false,
130
+    //       axisTick: {
131
+    //         show: false
132
+    //       }
133
+    //     },
134
+    //     grid: {
135
+    //       left: 50,
136
+    //       right: 50,
137
+    //       bottom: 20,
138
+    //       top: 30,
139
+    //       containLabel: true
140
+    //     },
141
+    //     tooltip: {
142
+    //       trigger: 'axis',
143
+    //       axisPointer: {
144
+    //         type: 'cross'
145
+    //       },
146
+    //       padding: [5, 10]
147
+    //     },
148
+    //     yAxis: {
149
+    //       axisTick: {
150
+    //         show: false
151
+    //       }
152
+    //     },
153
+    //     legend: {
154
+    //       data: this.chartOptions.legend,
155
+    //     },
156
+    //     series: this.chartOptions.series,
157
+    //   })
158
+    // },
159
+    setOptions({ expectedData, actualData } = {}) {
160
+      this.chart.setOption({
161
+        // title: {
162
+        //   text: this.title
163
+        // },
164
+        xAxis: {
165
+          data: this.chartOptions.xAxis.data,
166
+          // boundaryGap: false
167
+          axisTick: {
168
+            show: true
169
+          },
170
+          axisLine: {
171
+            lineStyle: {
172
+              color: "#E5E5E5" //x轴颜色
173
+            }
174
+          },
175
+          axisLabel: {
176
+            interval: 0,
177
+            formatter: function(value) {
178
+              var ret = ""; //拼接加\n返回的类目项
179
+              var maxLength = 10; //每项显示文字个数
180
+              var valLength = value.length; //X轴类目项的文字个数
181
+              var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
182
+              if (rowN > 1) {
183
+                //如果类目项的文字大于3,
184
+                for (var i = 0; i < rowN; i++) {
185
+                  var temp = ""; //每次截取的字符串
186
+                  var start = i * maxLength; //开始截取的位置
187
+                  var end = start + maxLength; //结束截取的位置
188
+                  //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
189
+                  temp = value.substring(start, end) + "\n";
190
+                  ret += temp; //凭借最终的字符串
191
+                }
192
+                return ret;
193
+              } else {
194
+                return value;
195
+              }
196
+            },
197
+            textStyle: {
198
+              color:"#2F3133"
199
+            }
200
+          }
201
+        },
202
+        grid: {
203
+          left: 0,
204
+          right: 50,
205
+          bottom: 10,
206
+          top: 30,
207
+          containLabel: true
208
+        },
209
+        tooltip: {
210
+          trigger: "axis",
211
+          axisPointer: {
212
+            type: "cross"
213
+          },
214
+          padding: [5, 10]
215
+        },
216
+        yAxis: {
217
+          axisTick: {
218
+            show: true
219
+          },
220
+          axisLine: {
221
+            lineStyle: {
222
+              color: "#E5E5E5" //y轴颜色
223
+            },
224
+          },
225
+          axisLabel: {
226
+            textStyle: {
227
+              color:"#2F3133"
228
+            }
229
+          }
230
+        },
231
+        // dataZoom: [
232
+        //   {
233
+        //     //Y轴固定,让内容滚动
234
+        //     type: "slider",
235
+        //     show: false,
236
+        //     xAxisIndex: [0],
237
+        //     start: 1,
238
+        //     end: 80, //设置X轴刻度之间的间隔(根据数据量来调整)
239
+        //     zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
240
+        //   },
241
+        //   {
242
+        //     type: "inside",
243
+        //     xAxisIndex: [0],
244
+        //     start: 1,
245
+        //     end: 80,
246
+        //     zoomLock: true //锁定区域禁止缩放
247
+        //   }
248
+        // ],
249
+        legend: this.chartOptions.legend,
250
+        series: this.chartOptions.series,
251
+        dataZoom: this.chartOptions.dataZoom,
252
+      });
253
+    },
254
+    initChart() {
255
+      this.chart = echarts.init(this.$el, "macarons");
256
+      this.chart.clear();
257
+      this.setOptions(this.chartData);
258
+    }
259
+  }
260
+};
261
+</script>

+ 262 - 0
src/xt_pages/Dialysisanalysis/components/LineChart1.vue View File

@@ -0,0 +1,262 @@
1
+<template>
2
+  <div :class="className" :style="{height:height,width:width}"></div>
3
+</template>
4
+
5
+<script>
6
+import echarts from "echarts";
7
+require("echarts/theme/macarons"); // echarts theme
8
+import { debounce } from "@/utils";
9
+
10
+export default {
11
+  props: {
12
+    className: {
13
+      type: String,
14
+      default: "chart"
15
+    },
16
+    width: {
17
+      type: String,
18
+      default: "100%"
19
+    },
20
+    height: {
21
+      type: String,
22
+      default: "230px"
23
+    },
24
+    autoResize: {
25
+      type: Boolean,
26
+      default: true
27
+    },
28
+    chartData: {
29
+      type: Object
30
+    },
31
+    title: {
32
+      type: String,
33
+      default: "chart"
34
+    },
35
+    options: {
36
+      type: Object,
37
+      default: function() {
38
+        return {};
39
+      }
40
+    }
41
+  },
42
+  data() {
43
+    return {
44
+      chart: null,
45
+      chartOptions: {
46
+        xAxis: [],
47
+        legend: [],
48
+        series: []
49
+      }
50
+    };
51
+  },
52
+  mounted() {
53
+    this.initChart();
54
+    if (this.autoResize) {
55
+      this.__resizeHanlder = debounce(() => {
56
+        if (this.chart) {
57
+          this.chart.resize();
58
+        }
59
+      }, 100);
60
+      window.addEventListener("resize", this.__resizeHanlder);
61
+    }
62
+
63
+    // 监听侧边栏的变化
64
+    const sidebarElm = document.getElementsByClassName("sidebar-container")[0];
65
+    sidebarElm.addEventListener("transitionend", this.__resizeHanlder);
66
+  },
67
+  beforeDestroy() {
68
+    if (!this.chart) {
69
+      return;
70
+    }
71
+    if (this.autoResize) {
72
+      window.removeEventListener("resize", this.__resizeHanlder);
73
+    }
74
+
75
+    const sidebarElm = document.getElementsByClassName("sidebar-container")[0];
76
+    sidebarElm.removeEventListener("transitionend", this.__resizeHanlder);
77
+
78
+    this.chart.dispose();
79
+    this.chart = null;
80
+  },
81
+  watch: {
82
+    // options: function(a) {
83
+    //   console.log(a)
84
+    //   this.chartOptions = this.options;
85
+    //   this.initChart();
86
+    //   this.__resizeHanlder = debounce(() => {
87
+    //     if (this.chart) {
88
+    //       this.chart.resize();
89
+    //     }
90
+    //   }, 100);
91
+    //   window.addEventListener("resize", this.__resizeHanlder);
92
+    // },
93
+    options:{
94
+      handler(newValue,oldValue){
95
+        this.getInitChart();
96
+      },
97
+      deep:true
98
+    },
99
+
100
+    chartData: {
101
+      deep: true,
102
+      handler(val) {
103
+        this.setOptions(val);
104
+      }
105
+    }
106
+  },
107
+  created() {
108
+    this.chartOptions = this.options;
109
+    // console.log("this.chartOptions", this.chartOptions, this.options);
110
+  },
111
+  methods: {
112
+    getInitChart() {
113
+      this.chartOptions = this.options;
114
+      this.initChart();
115
+      this.__resizeHanlder = debounce(() => {
116
+        if (this.chart) {
117
+          this.chart.resize();
118
+        }
119
+      }, 100);
120
+      window.addEventListener("resize", this.__resizeHanlder);
121
+    },
122
+    // setOptions({ expectedData, actualData } = {}) {
123
+    //   this.chart.setOption({
124
+    //     title: {
125
+    //         text: this.title,
126
+    //     },
127
+    //     xAxis: {
128
+    //       data: this.chartOptions.xAxis,
129
+    //       boundaryGap: false,
130
+    //       axisTick: {
131
+    //         show: false
132
+    //       }
133
+    //     },
134
+    //     grid: {
135
+    //       left: 50,
136
+    //       right: 50,
137
+    //       bottom: 20,
138
+    //       top: 30,
139
+    //       containLabel: true
140
+    //     },
141
+    //     tooltip: {
142
+    //       trigger: 'axis',
143
+    //       axisPointer: {
144
+    //         type: 'cross'
145
+    //       },
146
+    //       padding: [5, 10]
147
+    //     },
148
+    //     yAxis: {
149
+    //       axisTick: {
150
+    //         show: false
151
+    //       }
152
+    //     },
153
+    //     legend: {
154
+    //       data: this.chartOptions.legend,
155
+    //     },
156
+    //     series: this.chartOptions.series,
157
+    //   })
158
+    // },
159
+    setOptions({ expectedData, actualData } = {}) {
160
+      this.chart.setOption({
161
+        // title: {
162
+        //   text: this.title
163
+        // },
164
+        xAxis: {
165
+          data: this.chartOptions.xAxis.data,
166
+          // boundaryGap: false
167
+          axisTick: {
168
+            show: true
169
+          },
170
+          axisLine: {
171
+            lineStyle: {
172
+              color: "#E5E5E5" //x轴颜色
173
+            }
174
+          },
175
+          axisLabel: {
176
+            interval: 0,
177
+            formatter: function(value) {
178
+              var ret = ""; //拼接加\n返回的类目项
179
+              var maxLength = 10; //每项显示文字个数
180
+              var valLength = value.length; //X轴类目项的文字个数
181
+              var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
182
+              if (rowN > 1) {
183
+                //如果类目项的文字大于3,
184
+                for (var i = 0; i < rowN; i++) {
185
+                  var temp = ""; //每次截取的字符串
186
+                  var start = i * maxLength; //开始截取的位置
187
+                  var end = start + maxLength; //结束截取的位置
188
+                  //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
189
+                  temp = value.substring(start, end) + "\n";
190
+                  ret += temp; //凭借最终的字符串
191
+                }
192
+                return ret;
193
+              } else {
194
+                return value;
195
+              }
196
+            },
197
+            textStyle: {
198
+              color:"#2F3133"
199
+            }
200
+          }
201
+        },
202
+        grid: {
203
+          left: 0,
204
+          right: 50,
205
+          bottom: 10,
206
+          top: 30,
207
+          containLabel: true
208
+        },
209
+        tooltip: {
210
+          trigger: "axis",
211
+          axisPointer: {
212
+            type: "cross"
213
+          },
214
+          padding: [5, 10]
215
+        },
216
+        yAxis: {
217
+          axisTick: {
218
+            show: true
219
+          },
220
+          axisLine: {
221
+            lineStyle: {
222
+              color: "#E5E5E5" //y轴颜色
223
+            },
224
+          },
225
+          axisLabel: {
226
+            textStyle: {
227
+              color:"#2F3133"
228
+            }
229
+          },
230
+          max:2
231
+        },
232
+        // dataZoom: [
233
+        //   {
234
+        //     //Y轴固定,让内容滚动
235
+        //     type: "slider",
236
+        //     show: false,
237
+        //     xAxisIndex: [0],
238
+        //     start: 1,
239
+        //     end: 80, //设置X轴刻度之间的间隔(根据数据量来调整)
240
+        //     zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
241
+        //   },
242
+        //   {
243
+        //     type: "inside",
244
+        //     xAxisIndex: [0],
245
+        //     start: 1,
246
+        //     end: 80,
247
+        //     zoomLock: true //锁定区域禁止缩放
248
+        //   }
249
+        // ],
250
+        legend: this.chartOptions.legend,
251
+        series: this.chartOptions.series,
252
+        dataZoom: this.chartOptions.dataZoom,
253
+      });
254
+    },
255
+    initChart() {
256
+      this.chart = echarts.init(this.$el, "macarons");
257
+      this.chart.clear();
258
+      this.setOptions(this.chartData);
259
+    }
260
+  }
261
+};
262
+</script>

+ 108 - 0
src/xt_pages/Dialysisanalysis/components/PieChart.vue View File

@@ -0,0 +1,108 @@
1
+<template>
2
+  <div :class="className" :style="{height:height,width:width}"></div>
3
+</template>
4
+
5
+<script>
6
+import echarts from 'echarts'
7
+require('echarts/theme/macarons') // echarts theme
8
+import { debounce } from '@/utils'
9
+
10
+export default {
11
+  props: {
12
+    className: {
13
+      type: String,
14
+      default: 'chart'
15
+    },
16
+    width: {
17
+      type: String,
18
+      default: '100%'
19
+    },
20
+    height: {
21
+      type: String,
22
+      default: '380px'
23
+    },
24
+    title:{
25
+      type: String,
26
+      default: 'chart'
27
+    },
28
+    options:{
29
+      type:Object,
30
+      default:function(){
31
+        return {}
32
+      }
33
+    }
34
+  },
35
+  data() {
36
+    return {
37
+      chart: null,
38
+      chartOptions:{},
39
+    }
40
+  },
41
+  mounted() {
42
+    this.initChart()
43
+    this.__resizeHanlder = debounce(() => {
44
+      if (this.chart) {
45
+        this.chart.resize()
46
+      }
47
+    }, 100)
48
+    window.addEventListener('resize', this.__resizeHanlder)
49
+  },
50
+  beforeDestroy() {
51
+    if (!this.chart) {
52
+      return
53
+    }
54
+    window.removeEventListener('resize', this.__resizeHanlder)
55
+    this.chart.dispose()
56
+    this.chart = null
57
+  },
58
+  created(){
59
+    this.chartOptions = this.options;
60
+  },
61
+  methods: {
62
+    initChart() {
63
+      this.chart = echarts.init(this.$el, 'macarons')
64
+
65
+      this.chart.setOption({
66
+        title: {
67
+            text: this.title,
68
+        },
69
+        tooltip: {
70
+          trigger: 'item',
71
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
72
+        },
73
+        legend: {
74
+          left: 'center',
75
+          bottom: '10',
76
+          data: this.chartOptions.legend,
77
+        },
78
+        calculable: true,
79
+        series: [
80
+          {
81
+            name: '',
82
+            type: 'pie',
83
+            roseType: 'radius',
84
+            radius: [15, 95],
85
+            center: ['50%', '38%'],
86
+            data: this.chartOptions.series,
87
+            animationEasing: 'cubicInOut',
88
+            animationDuration: 2600
89
+          }
90
+        ]
91
+      })
92
+    }
93
+  },
94
+  watch:{
95
+    "options":function(){
96
+      this.chartOptions = this.options;
97
+      this.initChart()
98
+      this.__resizeHanlder = debounce(() => {
99
+        if (this.chart) {
100
+          this.chart.resize() 
101
+        }
102
+      }, 100)
103
+      window.addEventListener('resize', this.__resizeHanlder)
104
+    }
105
+    
106
+  } 
107
+}
108
+</script>

+ 335 - 226
src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinall.vue View File

@@ -1,261 +1,370 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        <el-row :gutter="20">
31
-        <el-col :span="5"> 
32
-          <div class="block">
33
-            <span>查询时间:</span>
34
-            <el-date-picker
35
-            v-model="time_month"
36
-            type="month"
37
-            placeholder="选择月">
38
-            </el-date-picker>
39
-          </div>
40
-        </el-col>
41
-        <el-col :span="8">
42
-          <div>
43
-            <el-date-picker
44
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
45 26
             type="date"
27
+
46 28
             placeholder="选择日期">
47
-            </el-date-picker>
48
-            <span>-</span>
49
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
50 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
51 36
             type="date"
52 37
             placeholder="选择日期">
53
-            </el-date-picker>
54
-          </div>
55
-        </el-col>
56
-        <el-col :span="3">
57
-          <div style="width: 200px;">
58
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
59
-          </div>
60
-        </el-col>
61
-        <el-col :span="2">
62
-            <el-button type="primary">查询</el-button>
63
-        </el-col>
64
-        </el-row>
65
-        
66
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
67
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
68 39
         </div>
69
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
70
-        <div style="width: 80%;margin: auto;">
71
-            <el-table
72
-            :data="tableData"
73
-            :show-summary = true
74
-            border
75
-            style="width: 100%;">
76
-                <el-table-column
77
-                    prop="date"
78
-                    align="center"
79
-                    label="血红蛋白"
80
-                    >
81
-                </el-table-column>
82
-                <el-table-column
83
-                    prop="name"
84
-                    
85
-                    label="人数"
86
-                    >
87
-                </el-table-column>
88
-                <el-table-column
89
-                    prop="address"
90
-                    align="center"
91
-                    label="操作">
92
-                    <template slot-scope="scope">
93
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
94
-                                type="text" >查看详情
95
-                        </el-button>
96
-                    </template>
97
-                </el-table-column>
98
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
99 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="血红蛋白"
63
+
64
+
65
+        >
66
+        </el-table-column>
67
+        <el-table-column
68
+          prop="count"
69
+          label="人数"
70
+        >
71
+        </el-table-column>
72
+<!--        <el-table-column-->
73
+<!--          prop="address"-->
74
+<!--          align="center"-->
75
+<!--          label="操作">-->
76
+<!--          <template slot-scope="scope">-->
77
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
78
+<!--                       type="text">查看详情-->
79
+<!--            </el-button>-->
80
+<!--          </template>-->
81
+<!--        </el-table-column>-->
82
+      </el-table>
100 83
     </div>
84
+  </div>
101 85
 </template>
102 86
 <script>
103
-import * as echarts from "echarts";
104
-export default{
105
-    props: {
106
-   
87
+import * as echarts from 'echarts'
88
+import { GetQCStatistisData } from '../../../api/qcd'
89
+
90
+const moment = require('moment')
91
+
92
+export default {
93
+  props: {
94
+
107 95
     width: {
108 96
       type: String,
109
-      default: "100%"
97
+      default: '100%'
110 98
     },
111 99
     height: {
112 100
       type: String,
113
-      default: "400px"
114
-    },
115
-    
101
+      default: '400px'
102
+    }
103
+
116 104
   },
117
-    data() {
118
-        return {
119
-            time_month:'',
120
-            stat_time:'',
121
-            end_time:'',
122
-            input:'',
123
-            myChart: {},
124
-            pieData : [
125
-            {
126
-          value: 463,
127
-          name: "不达标值患者"
128
-        },
129
-        {
130
-          value: 395,
131
-          name: "未检查患者"
132
-        },
133
-        {
134
-          value: 157,
135
-          name: "达标值患者"
136
-        },
137
-        // {
138
-        //   value: 149,
139
-        //   name: "广东"
140
-        // },
141
-        // {
142
-        //   value: 147,
143
-        //   name: "湖南"
144
-        // }
145
-            
146
-            ],
147
-            pieName: [],
148
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
149
-            tableData:[],
150
-        }
151
-    },
152
-    mounted() {
153
-    this.initDate(); //数据初始化
154
-    this.initEcharts();
105
+  data() {
106
+    return {
107
+      time_type: 1,
108
+      times: [
109
+        { value: 1, label: '本月' },
110
+        { value: 2, label: '上月' },
111
+        { value: 3, label: '今年' },
112
+        { value: 4, label: '上一年' },
113
+        { value: 5, label: '第一季度' },
114
+        { value: 6, label: '第二季度' },
115
+        { value: 7, label: '第三季度' },
116
+        { value: 8, label: '第四季度' },
117
+        { value: 9, label: '自定义' }
118
+
119
+      ],
120
+      reference:{},
121
+      time_month: '',
122
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
123
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
124
+      input: '',
125
+      myChart: {},
126
+      pieData: [],
127
+      pieName: [],
128
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
129
+      tableData: []
130
+    }
131
+  },
132
+  mounted() {
133
+    this.getData()
155 134
   },
156 135
   methods: {
157
-    initDate() {
158
-      for (let i = 0; i < this.pieData.length; i++) {
159
-        this.pieName[i] = this.pieData[i].name;
136
+    getData() {
137
+      if(this.start_time.length == 0){
138
+        this.$message.error("请选择开始时间")
160 139
       }
161
-    },
162
-    initEcharts() {
163
-      // 饼图
164
-      const option = {
165
-        legend: {
166
-          // 图例
167
-          data: this.pieName,
168
-          left: "10%",
169
-          top: "30%",
170
-          orient: "vertical"
171
-        },
172
-        color:['#ff7f9f','#fff67f','#1e5feb'],
173
-        title: {
174
-          // 设置饼图标题,位置设为顶部居中
175
-        //   text: "国内院士前五省份图示",
176
-          top: "0%",
177
-          left: "center"
178
-        },
179
-        series: [
180
-          {
181
-            type: "pie",
182
-            label: {
183
-              normal : {
184
-                formatter: '{b}:{c}: ({d}%)',
185
-                textStyle : {
186
-                    fontWeight : 'normal',
187
-                    fontSize : 15,
188
-                    color : "black"
189
-                }
190
-              }
191
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
140
+      if(this.end_time.length == 0){
141
+        this.$message.error("请选择结束时间")
142
+      }
143
+      let params = {
144
+        start_date: this.start_time,
145
+        end_date: this.end_time,
146
+        project_id: 1,
147
+        item_id: 17
148
+      }
149
+      this.pieData = []
150
+      this.tableData = []
151
+      console.log("~~~~~~~~~~")
152
+      GetQCStatistisData(params).then(response => {
153
+        if (response.data.state == 1) {
154
+          this.reference = response.data.data.reference
155
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
156
+          let objone = {
157
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
158
+            name: '不达标值患者',
159
+            count:response.data.data.unusual_total,
160
+          }
161
+          this.pieData.push(objone)
162
+          this.tableData.push(objone)
163
+
164
+          let objtwo = {
165
+            value:   response.data.data.normal_total / response.data.data.patient_count,
166
+            name: '达标值患者',
167
+            count:response.data.data.normal_total,
168
+
169
+          }
170
+          this.pieData.push(objtwo)
171
+          this.tableData.push(objtwo)
172
+
173
+          let objthree = {
174
+            value: response.data.data.patient_count / response.data.data.no_check_total,
175
+            name: '未检查患者',
176
+            count:response.data.data.no_check_total,
177
+
178
+          }
179
+          this.pieData.push(objthree)
180
+          this.tableData.push(objthree)
181
+
182
+          let objfour = {
183
+            value: response.data.data.patient_count,
184
+            name: '合计',
185
+            count:response.data.data.patient_count,
186
+          }
187
+          this.tableData.push(objfour)
188
+          for (let i = 0; i < this.pieData.length; i++) {
189
+            this.pieName[i] = this.pieData[i].name
190
+          }
191
+          this.myChart = echarts.init(document.getElementById('mychart'))
192
+          window.addEventListener('resize', () => {
193
+            this.myChart.resize()
194
+          })
195
+          const option = {
196
+            legend: {
197
+              // 图例
198
+              data: this.pieName,
199
+              left: '10%',
200
+              top: '30%',
201
+              orient: 'vertical'
192 202
             },
193
-            radius: "65%", //饼图半径
194
-            data: this.pieData,
195
-            itemStyle : {
196
-              emphasis: {
197
-                shadowBlur: 10,
198
-                shadowOffsetX: 0,
199
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
203
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
204
+            title: {
205
+              // 设置饼图标题,位置设为顶部居中
206
+              //   text: "国内院士前五省份图示",
207
+              top: '0%',
208
+              left: 'center'
209
+            },
210
+            series: [
211
+              {
212
+                type: 'pie',
213
+                label: {
214
+                  show: true,
215
+                  formatter: '{b} : {d}% ({c})'
216
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
217
+                },
218
+                radius: '65%', //饼图半径
219
+                data: this.pieData
200 220
               }
201
-            }
221
+            ]
202 222
           }
203
-        ]
204
-      };
205
-    //   console.log(this.seriesData);
206
-      const optionFree = {
207
-        series: [
208
-          {
209
-            data: this.seriesData,
210
-            type: "line",
211
-            smooth: true
223
+          //   console.log(this.seriesData);
224
+          const optionFree = {
225
+            series: [
226
+              {
227
+                data: this.seriesData,
228
+                type: 'line',
229
+                smooth: true
230
+              }
231
+            ]
212 232
           }
213
-        ]
214
-      };
215
-      this.myChart = echarts.init(document.getElementById("mychart"));
216
-      this.myChart.setOption(option);
217
-      //随着屏幕大小调节图表
218
-      window.addEventListener("resize", () => {
219
-        this.myChart.resize();
220
-      });
233
+          this.myChart = echarts.init(document.getElementById('mychart'))
234
+          this.myChart.setOption(option)
235
+        } else {
236
+          this.$message.error(response.data.msg)
237
+        }
238
+      })
239
+
221 240
     },
241
+    changeItem(val) {
242
+      const currentDate = new Date()
243
+      switch (val) {
244
+        case 1:
245
+
246
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
247
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
248
+
249
+          this.start_time = startOfMonth
250
+          this.end_time = endOfMonth
251
+          this.getData()
252
+
253
+          break
254
+        case 2:
255
+          // 上月的起始日期和结束日期
256
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
257
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
258
+
259
+          this.start_time = startOfLastMonth
260
+          this.end_time = endOfLastMonth
261
+          this.getData()
262
+
263
+          break
264
+        case 3:
265
+          // 今年的起始日期和结束日期
266
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
267
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
268
+
269
+          this.start_time = startOfYear
270
+          this.end_time = endOfYear
271
+          this.getData()
272
+
273
+          break
274
+        case 4:
275
+          // 上一年的起始日期和结束日期
276
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
277
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
278
+
279
+          this.start_time = startOfLastYear
280
+          this.end_time = endOfLastYear
281
+          this.getData()
282
+
283
+          break
284
+        case 5:
285
+          // 第一季度的起始日期和结束日期
286
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
287
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
288
+
289
+          this.start_time = startOfFirstQuarter
290
+          this.end_time = endOfFirstQuarter
291
+          this.getData()
292
+
293
+          break
294
+        case 6:
295
+          // 第二季度的起始日期和结束日期
296
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
297
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
298
+
299
+          this.start_time = startOfSecondQuarter
300
+          this.end_time = endOfSecondQuarter
301
+          this.getData()
302
+
303
+          break
304
+        case 7:
305
+          // 第三季度的起始日期和结束日期
306
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
307
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
308
+
309
+          this.start_time = startOfThirdQuarter
310
+          this.end_time = endOfThirdQuarter
311
+          this.getData()
312
+
313
+          break
314
+        case 8:
315
+          // 第四季度的起始日期和结束日期
316
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
317
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
318
+
319
+          this.start_time = startOfFourthQuarter
320
+          this.end_time = endOfFourthQuarter
321
+          this.getData()
322
+          break
323
+        case 9:
324
+          this.start_time = ''
325
+          this.end_time = ''
326
+          break
327
+      }
328
+    },
329
+
330
+
222 331
     getSummaries(param) {
223
-        const { columns, data } = param;
224
-        const sums = [];
225
-        columns.forEach((column, index) => {
226
-          if (index === 0) {
227
-            sums[index] = '总价';
228
-            return;
229
-          }
230
-          const values = data.map(item => Number(item[column.property]));
231
-          if (!values.every(value => isNaN(value))) {
232
-            sums[index] = values.reduce((prev, curr) => {
233
-              const value = Number(curr);
234
-              if (!isNaN(value)) {
235
-                return prev + curr;
236
-              } else {
237
-                return prev;
238
-              }
239
-            }, 0);
240
-            sums[index] += ' 元';
241
-          } else {
242
-            sums[index] = 'N/A';
243
-          }
244
-        });
332
+      const { columns, data } = param
333
+      const sums = []
334
+      columns.forEach((column, index) => {
335
+        if (index === 0) {
336
+          sums[index] = '总价'
337
+          return
338
+        }
339
+        const values = data.map(item => Number(item[column.property]))
340
+        if (!values.every(value => isNaN(value))) {
341
+          sums[index] = values.reduce((prev, curr) => {
342
+            const value = Number(curr)
343
+            if (!isNaN(value)) {
344
+              return prev + curr
345
+            } else {
346
+              return prev
347
+            }
348
+          }, 0)
349
+          sums[index] += ' 元'
350
+        } else {
351
+          sums[index] = 'N/A'
352
+        }
353
+      })
245 354
 
246
-        return sums;
355
+      return sums
247 356
     },
248
-    handleClick(id){
249
-        console.log(id);
357
+    handleClick(id) {
358
+      console.log(id)
250 359
     }
251 360
   }
252 361
 
253 362
 }
254 363
 </script>
255 364
 <style lang="scss" scoped>
256
-.content_top{
257
-    display: flex;
258
-    justify-content: space-around;
259
-    color: #1e5feb;
365
+.content_top {
366
+  display: flex;
367
+  justify-content: space-around;
368
+  color: #1e5feb;
260 369
 }
261
-</style>
370
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinalone.vue View File

@@ -1,217 +1,646 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="血红蛋白(g/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
107 106
 
107
+                <el-table-column width="100" label="血红蛋白" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
108 119
     </div>
120
+  </div>
109 121
 </template>
122
+
123
+
110 124
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
135 147
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
154 173
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
172 235
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'血红蛋白g/L'}]
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
179 238
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'血红蛋白g/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
194 241
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
206 273
         },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
281
+        },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
207 453
     },
208
-    
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+            this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        if (this.patientsData[i].id == val.id){
533
+          this.$refs.table.setCurrentRow(this.patientsData[i])
534
+        }
535
+      }
536
+
537
+
538
+    },
539
+    querySearchAsync(keyword, cb) {
540
+      let key = ''
541
+      if (keyword != undefined) {
542
+        key = keyword
543
+      }
544
+      let searchArray = []
545
+      PostSearch(key).then(response => {
546
+        if (response.data.state == 1) {
547
+          searchArray = response.data.data.patient
548
+          cb(searchArray)
549
+        } else {
550
+          cb([])
551
+        }
552
+      })
553
+    },
554
+    chooseWay(way) {
555
+      this.wayType = way
556
+    }, getCurrentOrgPatients() {
557
+      getCurrentOrgPatients().then(response => {
558
+        if (response.data.state == 1) {
559
+          var patients = response.data.data.patients
560
+          this.patientsData = patients
561
+          this.GetDefaultPatient()
562
+        }
563
+      })
564
+    }, GetDefaultPatient() {
565
+      GetDefaultPatient().then(response => {
566
+        if (response.data.state == 1) {
567
+          var patient = response.data.data.patient
568
+          for (let i = 0;i < this.patientsData.length; i++){
569
+            if (this.patientsData[i].id == patient.id){
570
+              this.patient_name = this.patientsData[i].name
571
+              this.$refs.table.setCurrentRow(this.patientsData[i])
572
+            }
573
+          }
574
+          this.query.patient_id = patient.id
575
+          this.GetPersonQCStatistisData(this.query)
576
+
577
+        }
578
+      })
579
+
580
+    },
581
+    getArrLength(result,type){
582
+      if(type == 1){
583
+        if(result.length > 10){
584
+          var dataZoom_end = (10/result.length)*100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }else{
587
+          var dataZoom_end = 100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }
590
+      }else if(type == 2){
591
+        if(result.length > 10){
592
+          var dataZoom_end = (10/result.length)*100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }else{
595
+          var dataZoom_end = 100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }
598
+      }
599
+
600
+    }
601
+  }, mounted() {
602
+    var date = new Date()
603
+    var year = date.getFullYear() //获取完整的年份(4位)
604
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
605
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
606
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
607
+    this.query.patient_id = 0
608
+    this.query.end_time = year + '-' + month + '-' + day
609
+    this.query.start_time = year + '-' + last_month + '-' + day
610
+    this.query.project_id = 1
611
+    this.query.item_id = 17
612
+    this.getCurrentOrgPatients()
613
+
614
+    // this.GetPersonQCStatistisData()
615
+
616
+
617
+  }
209 618
 }
210 619
 </script>
620
+
211 621
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
622
+.tableTitle {
623
+  font-size: 16px;
624
+  color: #000;
625
+  font-weight: bold;
626
+  margin-bottom: 10px;
627
+}
628
+</style>
629
+<style lang="scss">
630
+.page_process {
631
+.el-tabs{
632
+  margin-bottom:0 !important;
633
+}
634
+.el-button--medium {
635
+  padding: 10px 8px;
636
+}
637
+
638
+.el-form-item {
639
+  margin-bottom: 0;
640
+}
641
+::-webkit-scrollbar{
642
+  height: 15px !important;
643
+}
644
+
216 645
 }
217
-</style>
646
+</style>

+ 22 - 35
src/xt_pages/Dialysisanalysis/otherIndicators/otherall.vue View File

@@ -27,9 +27,9 @@
27 27
             </div>
28 28
             <el-button type="primary">查询</el-button>
29 29
         </div> -->
30
-        
30
+
31 31
         <el-row :gutter="20">
32
-        <el-col :span="5"> 
32
+        <el-col :span="5">
33 33
           <div class="block">
34 34
             <span>查询时间:</span>
35 35
             <el-date-picker
@@ -63,7 +63,7 @@
63 63
             <el-button type="primary">查询</el-button>
64 64
         </el-col>
65 65
         </el-row>
66
-        
66
+
67 67
         <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68 68
           <p class="chartTitle">统计图</p>
69 69
         </div>
@@ -82,20 +82,20 @@
82 82
                 </el-table-column>
83 83
                 <el-table-column
84 84
                     prop="name"
85
-                    
85
+
86 86
                     label="人数"
87 87
                     >
88 88
                 </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
89
+<!--                <el-table-column-->
90
+<!--                    prop="address"-->
91
+<!--                    align="center"-->
92
+<!--                    label="操作">-->
93
+<!--                    <template slot-scope="scope">-->
94
+<!--                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
95
+<!--                                type="text" >查看详情-->
96
+<!--                        </el-button>-->
97
+<!--                    </template>-->
98
+<!--                </el-table-column>-->
99 99
             </el-table>
100 100
         </div>
101 101
     </div>
@@ -104,7 +104,7 @@
104 104
 import * as echarts from "echarts";
105 105
 export default{
106 106
     props: {
107
-   
107
+
108 108
     width: {
109 109
       type: String,
110 110
       default: "100%"
@@ -113,7 +113,7 @@ export default{
113 113
       type: String,
114 114
       default: "400px"
115 115
     },
116
-    
116
+
117 117
   },
118 118
     data() {
119 119
         return {
@@ -143,7 +143,7 @@ export default{
143 143
         //   value: 147,
144 144
         //   name: "湖南"
145 145
         // }
146
-            
146
+
147 147
             ],
148 148
             pieName: [],
149 149
             // myChartStyle:{float: "right", width: "100%", height: "400px"},
@@ -181,25 +181,12 @@ export default{
181 181
           {
182 182
             type: "pie",
183 183
             label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
184
+              show: true,
185
+              formatter:"{b} : {d}% ({c})"
186
+              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
193 187
             },
194 188
             radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                shadowBlur: 10,
199
-                shadowOffsetX: 0,
200
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
201
-              }
202
-            }
189
+            data: this.pieData
203 190
           }
204 191
         ]
205 192
       };
@@ -259,4 +246,4 @@ export default{
259 246
     justify-content: space-around;
260 247
     color: #1e5feb;
261 248
 }
262
-</style>
249
+</style>

+ 630 - 198
src/xt_pages/Dialysisanalysis/otherIndicators/otheralone.vue View File

@@ -1,217 +1,649 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"
87
+                          v-if="query.statistics_type != 9 && query.statistics_type != 10"></line-chart>
88
+              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="白蛋白(g/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                  </template>
97
+                </el-table-column>
98
+
99
+                <el-table-column width="100" label="检查日期" align="center">
100
+                  <template slot-scope="scope">
101
+                  </template>
102
+                </el-table-column>
107 103
 
104
+                <el-table-column width="100" label="甲状旁腺激素分析" align="center">
105
+                  <template slot-scope="scope">
106
+                  </template>
107
+                </el-table-column>
108
+              </el-table>
109
+
110
+              <el-pagination
111
+                align="right"
112
+                @size-change="handleSizeChange"
113
+                @current-change="handleCurrentChange"
114
+                :current-page="query.page"
115
+                :page-sizes="[10, 20, 50, 100]"
116
+                :page-size="10"
117
+                background
118
+                style="margin-top:20px;"
119
+                layout="total, sizes, prev, pager, next, jumper"
120
+                :total="total"
121
+              ></el-pagination>
122
+            </div>
123
+          </div>
124
+        </el-container>
125
+      </div>
108 126
     </div>
127
+  </div>
109 128
 </template>
129
+
130
+
110 131
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
132
+import echarts from 'echarts'
133
+// import LineChart from '../../qcd/components/LineChart'
134
+import {  uParseTime } from '@/utils/tools'
135
+import { getCurrentOrgPatients } from '@/api/common/common'
136
+import {
137
+  GetDefaultPatient,
138
+} from '@/api/common/statistics'
139
+import { PostSearch } from '@/api/patient'
140
+import { getDataConfig } from '@/utils/data'
141
+import { GetPersonQCStatistisData } from '../../../api/qcd'
142
+
143
+export default {
144
+  components: {
145
+  },
146
+  data() {
147
+    return {
148
+      pickerOptions: {
149
+        disabledDate(time) {
150
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
151
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
152
+
135 153
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
154
+      },
155
+      patient_name:'',
156
+      percent:[],
157
+      patientsData: [],
158
+      tableData: [],
159
+      loading: false,
160
+      search_value: '',
161
+      total: 0,
162
+      query: {
163
+        patient_id: '',
164
+        statistics_type: 1,
165
+        start_time: '',
166
+        end_time: '',
167
+        limit: 10,
168
+        page: 1
169
+      },
170
+      crumbs: [
171
+        { path: false, name: '科室质控' },
172
+        { path: false, name: '指标评估统计' },
173
+        { path: false, name: '透析过程指标统计' }
174
+      ],
175
+      tableData1: [],
176
+      chart: {
177
+        title: {
178
+          text: 'ECharts 入门示例'
154 179
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
180
+        tooltip: {},
181
+        legend: {
182
+          data: [],
183
+          left: 0
184
+        },
185
+        xAxis: {
186
+          data: []
187
+        },
188
+        yAxis: {
189
+          axisLabel: {
190
+            formatter: '{value} %'
191
+          },
192
+          show: false
193
+        },
194
+        series: [
195
+          {
196
+            name: '',
197
+            type: 'line',
198
+            data: [],
199
+            barWidth: 30,
200
+            label: {
201
+              normal: {
202
+                show: true,
203
+                position: 'top',
204
+                formatter: (params) => {
205
+                  if(this.percent.length > 0){
206
+                    let str = ''
207
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
208
+                    return str
209
+                  }else{
210
+                    let str = ''
211
+                    str = params.data
212
+                    return str
213
+                  }
214
+                }
215
+              }
216
+            },
217
+            //配置样式
218
+            itemStyle: {
219
+              //通常情况下:
220
+
221
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
222
+              normal: {
223
+                color: function(params) {
224
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
225
+                  var colorList = [
226
+                    ['#A9E0F3', '#9FBDFC'],
227
+
228
+                    ['#FFD7C0', '#FF9994']
229
+                  ]
230
+
231
+                  var index = params.dataIndex
232
+                  if (params.dataIndex >= colorList.length) {
233
+                    index = params.dataIndex % colorList.length
234
+                  }
235
+
236
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
237
+                    { offset: 0, color: colorList[index][0] },
238
+                    // { offset: 0.5, color: colorList[index][1] },
239
+                    { offset: 1, color: colorList[index][1] }
240
+                  ])
172 241
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'白蛋白g/L'}]
242
+                lineStyle:{
243
+                  color:'#409eff' //改变折线颜色
179 244
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'白蛋白g/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
245
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
246
+              },
194 247
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
248
+              //鼠标悬停时:
249
+              emphasis: {
250
+                shadowBlur: 10,
251
+                shadowOffsetX: 0,
252
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
253
+              }
254
+            }
255
+          }
256
+        ],
257
+        dataZoom: [
258
+          {
259
+            // Y轴固定,让内容滚动
260
+            type: 'slider',
261
+            show: false,
262
+            xAxisIndex: [0],
263
+            start: 1,
264
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
265
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
266
+          },
267
+          {
268
+            type: 'inside',
269
+            xAxisIndex: [0],
270
+            start: 1,
271
+            end: 20,
272
+            zoomLock: true // 锁定区域禁止缩放
273
+          }
274
+        ]
275
+      },
276
+      bar: {
277
+        title: {
278
+          text: 'ECharts 入门示例'
279
+        },
280
+        tooltip: {},
281
+        legend: {
282
+          data: [],
283
+          left: 0
206 284
         },
285
+        xAxis: {
286
+          data: []
287
+        },
288
+        yAxis: {
289
+          axisLabel: {
290
+            formatter: '{value} %'
291
+          },
292
+          show: false
293
+        },
294
+        series: [
295
+          {
296
+            name: '',
297
+            type: 'bar',
298
+            data: [],
299
+            barWidth: 30,
300
+            label: {
301
+              normal: {
302
+                show: true,
303
+                position: 'top',
304
+                formatter: (params) => {
305
+                  if(this.percent.length > 0){
306
+                    let str = ''
307
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
308
+                    return str
309
+                  }else{
310
+                    let str = ''
311
+                    str = params.data
312
+                    return str
313
+                  }
314
+                }
315
+              }
316
+            },
317
+            //配置样式
318
+            itemStyle: {
319
+              //通常情况下:
320
+
321
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
322
+              normal: {
323
+                color: function(params) {
324
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
325
+                  var colorList = [
326
+                    ['#A9E0F3', '#9FBDFC'],
327
+                    ['#FFD7C0', '#FF9994']
328
+                  ]
329
+
330
+                  var index = params.dataIndex
331
+                  if (params.dataIndex >= colorList.length) {
332
+                    index = params.dataIndex % colorList.length
333
+                  }
334
+
335
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
336
+                    { offset: 0, color: colorList[index][0] },
337
+                    // { offset: 0.5, color: colorList[index][1] },
338
+                    { offset: 1, color: colorList[index][1] }
339
+                  ])
340
+                },
341
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
342
+              },
343
+
344
+              //鼠标悬停时:
345
+              emphasis: {
346
+                shadowBlur: 10,
347
+                shadowOffsetX: 0,
348
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
349
+              }
350
+            }
351
+          }
352
+        ]
353
+      }
354
+
355
+    }
356
+  },
357
+  methods: {
358
+    printAction(){
359
+      this.$router.push({
360
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
361
+      });
362
+
363
+    },exportAction(){
364
+      let list = []
365
+      for (let i = 0; i < this.tableData.length; i++) {
366
+        let order = this.tableData[i]
367
+        let name = order.name
368
+        let item_name = order.item_name
369
+        let count = order.count
370
+        let price = order.price.toFixed(2)
371
+        let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
372
+        let total = order.total.toFixed(2)
373
+
374
+        let obj = {
375
+          '患者姓名': name,
376
+          '项目名称': item_name,
377
+          '数量': count,
378
+          '单价': price,
379
+          '费用': pay_sumamt,
380
+          '费用总额': total
381
+        }
382
+        list.push(obj)
383
+      }
384
+      import('@/vendor/Export2Excel').then(excel => {
385
+        const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
386
+        const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
387
+        const data = this.formatJson(filterVal, list)
388
+        excel.export_json_to_excel1({
389
+          header: tHeader,
390
+          data,
391
+          filename: '明细',
392
+          ref: this.$refs['table'].$el
393
+        })
394
+      })
395
+    },
396
+    changeProject(val) {
397
+      this.query.statistics_type = val
398
+      this.query.page = 1
399
+      this.GetPersonQCStatistisData(this.query)
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleChange(val) {
404
+      this.query.patient_id = val.id
405
+      this.query.page = 1
406
+      this.patient_name = val.name
407
+      this.GetPersonQCStatistisData(this.query)
408
+      this.GetInspectionCheckIndexTableData(this.query)
409
+    },
410
+    handleSizeChange(limit) {
411
+      this.query.limit = limit
412
+      this.GetInspectionCheckIndexTableData(this.query)
413
+
207 414
     },
208
-    
415
+    handleCurrentChange(page) {
416
+      this.query.page = page
417
+      this.GetPersonQCStatistisData(this.query)
418
+    },formatJson(filterVal, jsonData) {
419
+      return jsonData.map(v => filterVal.map(j => v[j]))
420
+    },
421
+    changeTime(val) {
422
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
423
+      if (time > 0) {
424
+        this.$message.error('结束时间不能小于开始时间')
425
+        this.query.start_time = ''
426
+      } else {
427
+        // this.getDialysisList()
428
+        this.query.page = 1
429
+        this.GetPersonQCStatistisData(this.query)
430
+        this.GetInspectionCheckIndexTableData(this.query)
431
+
432
+      }
433
+
434
+    },
435
+    changeEndTime(val) {
436
+      var time =
437
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
438
+      if (time < 0) {
439
+        this.$message.error('结束时间不能小于开始时间')
440
+        this.query.end_time = ''
441
+      } else {
442
+        this.query.page = 1
443
+        this.GetPersonQCStatistisData(this.query)
444
+        this.GetInspectionCheckIndexTableData(this.query)
445
+
446
+      }
447
+    },
448
+    getTimestamp(time) {
449
+      // 把时间日期转成时间戳
450
+      return new Date(time).getTime() / 1000
451
+    },
452
+    QueryOperaById: function(val) {
453
+      let vascular_access_desc_name = ''
454
+      let vascular_access_desc = getDataConfig(
455
+        'hemodialysis',
456
+        'vascular_access_desc'
457
+      )
458
+      for (let i = 0; i < vascular_access_desc.length; i++) {
459
+        if (vascular_access_desc[i].id == val) {
460
+          vascular_access_desc_name = vascular_access_desc[i].name
461
+        }
462
+      }
463
+
464
+      return vascular_access_desc_name
465
+    },
466
+    GetAnticoagulantById: function(val) {
467
+      let anticoagulan_name = ''
468
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
469
+      let anticoagulant = anticoagulantsConfitTwo
470
+      for (let keys in anticoagulant) {
471
+        if (anticoagulant[keys].id == val) {
472
+          anticoagulan_name = anticoagulant[keys].name
473
+        }
474
+      }
475
+      return anticoagulan_name
476
+    },
477
+    getModeName(mode_id) {
478
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
479
+    },  getTime(val) {
480
+      if(val == "" || val == undefined){
481
+        return ""
482
+      }else {
483
+        return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
484
+      }
485
+    },
486
+    GetInspectionCheckIndexTableData(params) {
487
+      this.loading = true
488
+      GetPersonQCStatistisData(params)
489
+        .then(rs => {
490
+          var resp = rs.data
491
+          console.log("resp=====",resp)
492
+          if (resp.state == 1) {
493
+            this.loading = false
494
+            this.tableData = []
495
+            for (let i = 0; i < resp.data.inspections.length; i++) {
496
+              this.tableData.push(resp.data.inspections[i])
497
+            }
498
+            this.total = resp.data.total
499
+
500
+          } else {
501
+            this.loading = false
502
+          }
503
+        })
504
+        .catch(error => {
505
+
506
+        })
507
+    },
508
+    GetPersonQCStatistisData(params) {
509
+      this.chart.xAxis.data = []
510
+      this.chart.series[0].data = []
511
+      this.bar.xAxis.data = []
512
+      this.bar.series[0].data = []
513
+      this.percent = []
514
+      GetPersonQCStatistisData(params)
515
+        .then(rs => {
516
+          var resp = rs.data
517
+          if (resp.state == 1) {
518
+            for (let i = 0; i < resp.data.inspections.length; i++) {
519
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
520
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
521
+            }
522
+            this.getArrLength(this.chart.xAxis.data,1)
523
+          } else {
524
+
525
+          }
526
+        })
527
+        .catch(error => {
528
+        })
529
+    },
530
+    handleSelect(val) {
531
+      this.query.patient_id = val.id
532
+      this.query.page = 1
533
+      this.patient_name = val.name
534
+      for (let i = 0;i < this.patientsData.length; i++){
535
+        if (this.patientsData[i].id == val.id){
536
+          this.$refs.table.setCurrentRow(this.patientsData[i])
537
+        }
538
+      }
539
+
540
+
541
+    },
542
+    querySearchAsync(keyword, cb) {
543
+      let key = ''
544
+      if (keyword != undefined) {
545
+        key = keyword
546
+      }
547
+      let searchArray = []
548
+      PostSearch(key).then(response => {
549
+        if (response.data.state == 1) {
550
+          searchArray = response.data.data.patient
551
+          cb(searchArray)
552
+        } else {
553
+          cb([])
554
+        }
555
+      })
556
+    },
557
+    chooseWay(way) {
558
+      this.wayType = way
559
+    }, getCurrentOrgPatients() {
560
+      getCurrentOrgPatients().then(response => {
561
+        if (response.data.state == 1) {
562
+          var patients = response.data.data.patients
563
+          this.patientsData = patients
564
+          this.GetDefaultPatient()
565
+        }
566
+      })
567
+    }, GetDefaultPatient() {
568
+      GetDefaultPatient().then(response => {
569
+        if (response.data.state == 1) {
570
+          var patient = response.data.data.patient
571
+          for (let i = 0;i < this.patientsData.length; i++){
572
+            if (this.patientsData[i].id == patient.id){
573
+              this.patient_name = this.patientsData[i].name
574
+              this.$refs.table.setCurrentRow(this.patientsData[i])
575
+            }
576
+          }
577
+          this.query.patient_id = patient.id
578
+          this.GetPersonQCStatistisData(this.query)
579
+
580
+        }
581
+      })
582
+
583
+    },
584
+    getArrLength(result,type){
585
+      if(type == 1){
586
+        if(result.length > 10){
587
+          var dataZoom_end = (10/result.length)*100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }else{
590
+          var dataZoom_end = 100;
591
+          this.chart.dataZoom[0].end = dataZoom_end
592
+        }
593
+      }else if(type == 2){
594
+        if(result.length > 10){
595
+          var dataZoom_end = (10/result.length)*100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }else{
598
+          var dataZoom_end = 100;
599
+          this.bar.dataZoom[0].end = dataZoom_end
600
+        }
601
+      }
602
+
603
+    }
604
+  }, mounted() {
605
+    var date = new Date()
606
+    var year = date.getFullYear() //获取完整的年份(4位)
607
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
608
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
609
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
610
+    this.query.patient_id = 0
611
+    this.query.end_time = year + '-' + month + '-' + day
612
+    this.query.start_time = year + '-' + last_month + '-' + day
613
+    this.query.project_id = 20
614
+    this.query.item_id = 171
615
+    this.getCurrentOrgPatients()
616
+
617
+    // this.GetPersonQCStatistisData()
618
+
619
+
620
+  }
209 621
 }
210 622
 </script>
623
+
211 624
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
625
+.tableTitle {
626
+  font-size: 16px;
627
+  color: #000;
628
+  font-weight: bold;
629
+  margin-bottom: 10px;
630
+}
631
+</style>
632
+<style lang="scss">
633
+.page_process {
634
+.el-tabs{
635
+  margin-bottom:0 !important;
636
+}
637
+.el-button--medium {
638
+  padding: 10px 8px;
639
+}
640
+
641
+.el-form-item {
642
+  margin-bottom: 0;
643
+}
644
+::-webkit-scrollbar{
645
+  height: 15px !important;
646
+}
647
+
216 648
 }
217
-</style>
649
+</style>

+ 334 - 227
src/xt_pages/Dialysisanalysis/platelets/plateletsall.vue View File

@@ -1,262 +1,369 @@
1 1
 <template>
2
-    <div>
3
-        <!-- <div class="content_top">
4
-            <div class="block">
5
-                <span>查询时间:</span>
6
-                <el-date-picker
7
-                v-model="time_month"
8
-                type="month"
9
-                placeholder="选择月">
10
-                </el-date-picker>
11
-            </div>
12
-            <div>
13
-                <el-date-picker
14
-                v-model="stat_time"
15
-                type="date"
16
-                placeholder="选择日期">
17
-                </el-date-picker>
18
-                <span>-</span>
19
-                <el-date-picker
20
-                v-model="end_time"
21
-                type="date"
22
-                placeholder="选择日期">
23
-                </el-date-picker>
24
-            </div>
25
-            <div style="width: 200px;">
26
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
27
-            </div>
28
-            <el-button type="primary">查询</el-button>
29
-        </div> -->
30
-        
31
-        <el-row :gutter="20">
32
-        <el-col :span="5"> 
33
-          <div class="block">
34
-            <span>查询时间:</span>
35
-            <el-date-picker
36
-            v-model="time_month"
37
-            type="month"
38
-            placeholder="选择月">
39
-            </el-date-picker>
40
-          </div>
41
-        </el-col>
42
-        <el-col :span="8">
43
-          <div>
44
-            <el-date-picker
45
-            v-model="stat_time"
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
46 26
             type="date"
27
+
47 28
             placeholder="选择日期">
48
-            </el-date-picker>
49
-            <span>-</span>
50
-            <el-date-picker
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
51 33
             v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
52 36
             type="date"
53 37
             placeholder="选择日期">
54
-            </el-date-picker>
55
-          </div>
56
-        </el-col>
57
-        <el-col :span="3">
58
-          <div style="width: 200px;">
59
-            <el-input v-model="input" placeholder="请输入内容"></el-input>
60
-          </div>
61
-        </el-col>
62
-        <el-col :span="2">
63
-            <el-button type="primary">查询</el-button>
64
-        </el-col>
65
-        </el-row>
66
-        
67
-        <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-          <p class="chartTitle">统计图</p>
38
+          </el-date-picker>
69 39
         </div>
70
-        <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-        <div style="width: 80%;margin: auto;">
72
-            <el-table
73
-            :data="tableData"
74
-            :show-summary = true
75
-            border
76
-            style="width: 100%;">
77
-                <el-table-column
78
-                    prop="date"
79
-                    align="center"
80
-                    label="血小板"
81
-                    >
82
-                </el-table-column>
83
-                <el-table-column
84
-                    prop="name"
85
-                    
86
-                    label="人数"
87
-                    >
88
-                </el-table-column>
89
-                <el-table-column
90
-                    prop="address"
91
-                    align="center"
92
-                    label="操作">
93
-                    <template slot-scope="scope">
94
-                        <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                                type="text" >查看详情
96
-                        </el-button>
97
-                    </template>
98
-                </el-table-column>
99
-            </el-table>
40
+      </el-col>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
100 44
         </div>
45
+      </el-col>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
48
+      </el-col>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="血小板"
63
+
64
+        >
65
+        </el-table-column>
66
+        <el-table-column
67
+          prop="count"
68
+          label="人数"
69
+        >
70
+        </el-table-column>
71
+<!--        <el-table-column-->
72
+<!--          prop="address"-->
73
+<!--          align="center"-->
74
+<!--          label="操作">-->
75
+<!--          <template slot-scope="scope">-->
76
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
77
+<!--                       type="text">查看详情-->
78
+<!--            </el-button>-->
79
+<!--          </template>-->
80
+<!--        </el-table-column>-->
81
+      </el-table>
101 82
     </div>
83
+  </div>
102 84
 </template>
103 85
 <script>
104
-import * as echarts from "echarts";
105
-export default{
106
-    props: {
107
-   
86
+import * as echarts from 'echarts'
87
+import { GetQCStatistisData } from '../../../api/qcd'
88
+
89
+const moment = require('moment')
90
+
91
+export default {
92
+  props: {
93
+
108 94
     width: {
109 95
       type: String,
110
-      default: "100%"
96
+      default: '100%'
111 97
     },
112 98
     height: {
113 99
       type: String,
114
-      default: "400px"
115
-    },
116
-    
100
+      default: '400px'
101
+    }
102
+
117 103
   },
118
-    data() {
119
-        return {
120
-            time_month:'',
121
-            stat_time:'',
122
-            end_time:'',
123
-            input:'',
124
-            myChart: {},
125
-            pieData : [
126
-            {
127
-          value: 463,
128
-          name: "不达标值患者"
129
-        },
130
-        {
131
-          value: 395,
132
-          name: "未检查患者"
133
-        },
134
-        {
135
-          value: 157,
136
-          name: "达标值患者"
137
-        },
138
-        // {
139
-        //   value: 149,
140
-        //   name: "广东"
141
-        // },
142
-        // {
143
-        //   value: 147,
144
-        //   name: "湖南"
145
-        // }
146
-            
147
-            ],
148
-            pieName: [],
149
-            // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-            tableData:[],
151
-        }
152
-    },
153
-    mounted() {
154
-    this.initDate(); //数据初始化
155
-    this.initEcharts();
104
+  data() {
105
+    return {
106
+      time_type: 1,
107
+      times: [
108
+        { value: 1, label: '本月' },
109
+        { value: 2, label: '上月' },
110
+        { value: 3, label: '今年' },
111
+        { value: 4, label: '上一年' },
112
+        { value: 5, label: '第一季度' },
113
+        { value: 6, label: '第二季度' },
114
+        { value: 7, label: '第三季度' },
115
+        { value: 8, label: '第四季度' },
116
+        { value: 9, label: '自定义' }
117
+
118
+      ],
119
+      time_month: '',
120
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
121
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
122
+      input: '',
123
+      myChart: {},
124
+      pieData: [],
125
+      pieName: [],
126
+      reference:{},
127
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
128
+      tableData: []
129
+    }
130
+  },
131
+  mounted() {
132
+    this.getData()
156 133
   },
157 134
   methods: {
158
-    initDate() {
159
-      for (let i = 0; i < this.pieData.length; i++) {
160
-        this.pieName[i] = this.pieData[i].name;
135
+    getData() {
136
+      if(this.start_time.length == 0){
137
+        this.$message.error("请选择开始时间")
161 138
       }
162
-    },
163
-    initEcharts() {
164
-      // 饼图
165
-      const option = {
166
-        legend: {
167
-          // 图例
168
-          data: this.pieName,
169
-          left: "10%",
170
-          top: "30%",
171
-          orient: "vertical"
172
-        },
173
-        color:['#ff7f9f','#fff67f','#1e5feb'],
174
-        title: {
175
-          // 设置饼图标题,位置设为顶部居中
176
-        //   text: "国内院士前五省份图示",
177
-          top: "0%",
178
-          left: "center"
179
-        },
180
-        series: [
181
-          {
182
-            type: "pie",
183
-            label: {
184
-              normal : {
185
-                formatter: '{b}:{c}: ({d}%)',
186
-                textStyle : {
187
-                    fontWeight : 'normal',
188
-                    fontSize : 15,
189
-                    color : "black"
190
-                }
191
-              }
192
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
139
+      if(this.end_time.length == 0){
140
+        this.$message.error("请选择结束时间")
141
+      }
142
+      let params = {
143
+        start_date: this.start_time,
144
+        end_date: this.end_time,
145
+        project_id: 1,
146
+        item_id: 166
147
+      }
148
+      this.pieData = []
149
+      this.tableData = []
150
+      console.log("~~~~~~~~~~")
151
+      GetQCStatistisData(params).then(response => {
152
+        if (response.data.state == 1) {
153
+          this.reference = response.data.data.reference
154
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
155
+          let objone = {
156
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
157
+            name: '不达标值患者',
158
+            count:response.data.data.unusual_total,
159
+          }
160
+          this.pieData.push(objone)
161
+          this.tableData.push(objone)
162
+
163
+          let objtwo = {
164
+            value:   response.data.data.normal_total / response.data.data.patient_count,
165
+            name: '达标值患者',
166
+            count:response.data.data.normal_total,
167
+
168
+          }
169
+          this.pieData.push(objtwo)
170
+          this.tableData.push(objtwo)
171
+
172
+          let objthree = {
173
+            value: response.data.data.patient_count / response.data.data.no_check_total,
174
+            name: '未检查患者',
175
+            count:response.data.data.no_check_total,
176
+
177
+          }
178
+          this.pieData.push(objthree)
179
+          this.tableData.push(objthree)
180
+
181
+          let objfour = {
182
+            value: response.data.data.patient_count,
183
+            name: '合计',
184
+            count:response.data.data.patient_count,
185
+          }
186
+          this.tableData.push(objfour)
187
+          for (let i = 0; i < this.pieData.length; i++) {
188
+            this.pieName[i] = this.pieData[i].name
189
+          }
190
+          this.myChart = echarts.init(document.getElementById('mychart'))
191
+          window.addEventListener('resize', () => {
192
+            this.myChart.resize()
193
+          })
194
+          const option = {
195
+            legend: {
196
+              // 图例
197
+              data: this.pieName,
198
+              left: '10%',
199
+              top: '30%',
200
+              orient: 'vertical'
201
+            },
202
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
203
+            title: {
204
+              // 设置饼图标题,位置设为顶部居中
205
+              //   text: "国内院士前五省份图示",
206
+              top: '0%',
207
+              left: 'center'
193 208
             },
194
-            radius: "65%", //饼图半径
195
-            data: this.pieData,
196
-            itemStyle : {
197
-              emphasis: {
198
-                shadowBlur: 10,
199
-                shadowOffsetX: 0,
200
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
209
+            series: [
210
+              {
211
+                type: 'pie',
212
+                label: {
213
+                  show: true,
214
+                  formatter: '{b} : {d}% ({c})'
215
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
216
+                },
217
+                radius: '65%', //饼图半径
218
+                data: this.pieData
201 219
               }
202
-            }
220
+            ]
203 221
           }
204
-        ]
205
-      };
206
-    //   console.log(this.seriesData);
207
-      const optionFree = {
208
-        series: [
209
-          {
210
-            data: this.seriesData,
211
-            type: "line",
212
-            smooth: true
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
229
+              }
230
+            ]
213 231
           }
214
-        ]
215
-      };
216
-      this.myChart = echarts.init(document.getElementById("mychart"));
217
-      this.myChart.setOption(option);
218
-      //随着屏幕大小调节图表
219
-      window.addEventListener("resize", () => {
220
-        this.myChart.resize();
221
-      });
232
+          this.myChart = echarts.init(document.getElementById('mychart'))
233
+          this.myChart.setOption(option)
234
+        } else {
235
+          this.$message.error(response.data.msg)
236
+        }
237
+      })
238
+
239
+    },
240
+    changeItem(val) {
241
+      const currentDate = new Date()
242
+      switch (val) {
243
+        case 1:
244
+
245
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
246
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
247
+
248
+          this.start_time = startOfMonth
249
+          this.end_time = endOfMonth
250
+          this.getData()
251
+
252
+          break
253
+        case 2:
254
+          // 上月的起始日期和结束日期
255
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
256
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
257
+
258
+          this.start_time = startOfLastMonth
259
+          this.end_time = endOfLastMonth
260
+          this.getData()
261
+
262
+          break
263
+        case 3:
264
+          // 今年的起始日期和结束日期
265
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
266
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
267
+
268
+          this.start_time = startOfYear
269
+          this.end_time = endOfYear
270
+          this.getData()
271
+
272
+          break
273
+        case 4:
274
+          // 上一年的起始日期和结束日期
275
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
276
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
277
+
278
+          this.start_time = startOfLastYear
279
+          this.end_time = endOfLastYear
280
+          this.getData()
281
+
282
+          break
283
+        case 5:
284
+          // 第一季度的起始日期和结束日期
285
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
286
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
287
+
288
+          this.start_time = startOfFirstQuarter
289
+          this.end_time = endOfFirstQuarter
290
+          this.getData()
291
+
292
+          break
293
+        case 6:
294
+          // 第二季度的起始日期和结束日期
295
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
296
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
297
+
298
+          this.start_time = startOfSecondQuarter
299
+          this.end_time = endOfSecondQuarter
300
+          this.getData()
301
+
302
+          break
303
+        case 7:
304
+          // 第三季度的起始日期和结束日期
305
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
306
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
307
+
308
+          this.start_time = startOfThirdQuarter
309
+          this.end_time = endOfThirdQuarter
310
+          this.getData()
311
+
312
+          break
313
+        case 8:
314
+          // 第四季度的起始日期和结束日期
315
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
316
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
317
+
318
+          this.start_time = startOfFourthQuarter
319
+          this.end_time = endOfFourthQuarter
320
+          this.getData()
321
+          break
322
+        case 9:
323
+          this.start_time = ''
324
+          this.end_time = ''
325
+          break
326
+      }
222 327
     },
328
+
329
+
223 330
     getSummaries(param) {
224
-        const { columns, data } = param;
225
-        const sums = [];
226
-        columns.forEach((column, index) => {
227
-          if (index === 0) {
228
-            sums[index] = '总价';
229
-            return;
230
-          }
231
-          const values = data.map(item => Number(item[column.property]));
232
-          if (!values.every(value => isNaN(value))) {
233
-            sums[index] = values.reduce((prev, curr) => {
234
-              const value = Number(curr);
235
-              if (!isNaN(value)) {
236
-                return prev + curr;
237
-              } else {
238
-                return prev;
239
-              }
240
-            }, 0);
241
-            sums[index] += ' 元';
242
-          } else {
243
-            sums[index] = 'N/A';
244
-          }
245
-        });
331
+      const { columns, data } = param
332
+      const sums = []
333
+      columns.forEach((column, index) => {
334
+        if (index === 0) {
335
+          sums[index] = '总价'
336
+          return
337
+        }
338
+        const values = data.map(item => Number(item[column.property]))
339
+        if (!values.every(value => isNaN(value))) {
340
+          sums[index] = values.reduce((prev, curr) => {
341
+            const value = Number(curr)
342
+            if (!isNaN(value)) {
343
+              return prev + curr
344
+            } else {
345
+              return prev
346
+            }
347
+          }, 0)
348
+          sums[index] += ' 元'
349
+        } else {
350
+          sums[index] = 'N/A'
351
+        }
352
+      })
246 353
 
247
-        return sums;
354
+      return sums
248 355
     },
249
-    handleClick(id){
250
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
251 358
     }
252 359
   }
253 360
 
254 361
 }
255 362
 </script>
256 363
 <style lang="scss" scoped>
257
-.content_top{
258
-    display: flex;
259
-    justify-content: space-around;
260
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
261 368
 }
262
-</style>
369
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/platelets/plateletsalone.vue View File

@@ -1,217 +1,646 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="血小板(/L)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
107 106
 
107
+                <el-table-column width="100" label="血小板" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
108 119
     </div>
120
+  </div>
109 121
 </template>
122
+
123
+
110 124
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            myChart: {},
131
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
132
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
133
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
134
-            tableData:[],
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
135 147
         }
136
-    },
137
-    created(){
138
-        
139
-    },
140
-    mounted() {
141
-        // this.$nextTick(function() {
142
-            this.initEcharts();
143
-		// })  
144
-        // this.myChart = echarts.init(document.getElementById("germychart"));
145
-        //     this.myChart.setOption(option);
146
-            //随着屏幕大小调节图表
147
-            window.addEventListener("resize", () => {
148
-                this.myChart.resize();
149
-            });
150
-    },
151
-    methods:{
152
-        handleSubmit(){
153
-            console.log('asdfa');
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
154 173
         },
155
-        initEcharts() {
156
-            const option = {
157
-                xAxis: {
158
-                    type: 'category',
159
-                        boundaryGap:true,
160
-                        axisTick:{
161
-                            alignWithLabel:true //保证刻度线和标签对齐
162
-                        },
163
-                    data: this.xData,
164
-                    splitNumber:this.xData.length, //纵坐标数
165
-                    interval:this.xData //强制设置坐标轴分割间隔
166
-                },
167
-                yAxis: {
168
-                    type: 'value',
169
-                    boundaryGap: true,
170
-                    splitNumber:4, //纵坐标数
171
-                    interval:10 //强制设置坐标轴分割间隔
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
172 235
                 },
173
-                legend: {
174
-                    show: true,
175
-                    align:'left',//文字在前图标在后
176
-                    left:'15%',
177
-                    top:'5%',
178
-                    data: [{name:'血小板/L'}]
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
179 238
                 },
180
-                series: [
181
-                {
182
-                    data: this.opinionData,
183
-                    name:'血小板/L',
184
-                    type: "line",// 类型设置为折线图
185
-                    symbol: 'circle',
186
-                    itemStyle: {
187
-                        normal: {
188
-                            color: '#409eff', //改变折线点的颜色#a80000
189
-                            lineStyle: {
190
-                                color: '#409eff' //改变折线颜色
191
-                            }
192
-                        }
193
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
194 241
 
195
-                },
196
-                
197
-                ],
198
-                
199
-            };
200
-            this.myChart = echarts.init(document.getElementById("germychart"));
201
-            this.myChart.setOption(option);
202
-            //随着屏幕大小调节图表
203
-            window.addEventListener("resize", () => {
204
-                this.myChart.resize();
205
-            });
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
206 273
         },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
281
+        },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
207 453
     },
208
-    
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+            this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        if (this.patientsData[i].id == val.id){
533
+          this.$refs.table.setCurrentRow(this.patientsData[i])
534
+        }
535
+      }
536
+
537
+
538
+    },
539
+    querySearchAsync(keyword, cb) {
540
+      let key = ''
541
+      if (keyword != undefined) {
542
+        key = keyword
543
+      }
544
+      let searchArray = []
545
+      PostSearch(key).then(response => {
546
+        if (response.data.state == 1) {
547
+          searchArray = response.data.data.patient
548
+          cb(searchArray)
549
+        } else {
550
+          cb([])
551
+        }
552
+      })
553
+    },
554
+    chooseWay(way) {
555
+      this.wayType = way
556
+    }, getCurrentOrgPatients() {
557
+      getCurrentOrgPatients().then(response => {
558
+        if (response.data.state == 1) {
559
+          var patients = response.data.data.patients
560
+          this.patientsData = patients
561
+          this.GetDefaultPatient()
562
+        }
563
+      })
564
+    }, GetDefaultPatient() {
565
+      GetDefaultPatient().then(response => {
566
+        if (response.data.state == 1) {
567
+          var patient = response.data.data.patient
568
+          for (let i = 0;i < this.patientsData.length; i++){
569
+            if (this.patientsData[i].id == patient.id){
570
+              this.patient_name = this.patientsData[i].name
571
+              this.$refs.table.setCurrentRow(this.patientsData[i])
572
+            }
573
+          }
574
+          this.query.patient_id = patient.id
575
+          this.GetPersonQCStatistisData(this.query)
576
+
577
+        }
578
+      })
579
+
580
+    },
581
+    getArrLength(result,type){
582
+      if(type == 1){
583
+        if(result.length > 10){
584
+          var dataZoom_end = (10/result.length)*100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }else{
587
+          var dataZoom_end = 100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }
590
+      }else if(type == 2){
591
+        if(result.length > 10){
592
+          var dataZoom_end = (10/result.length)*100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }else{
595
+          var dataZoom_end = 100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }
598
+      }
599
+
600
+    }
601
+  }, mounted() {
602
+    var date = new Date()
603
+    var year = date.getFullYear() //获取完整的年份(4位)
604
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
605
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
606
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
607
+    this.query.patient_id = 0
608
+    this.query.end_time = year + '-' + month + '-' + day
609
+    this.query.start_time = year + '-' + last_month + '-' + day
610
+    this.query.project_id = 1
611
+    this.query.item_id = 166
612
+    this.getCurrentOrgPatients()
613
+
614
+    // this.GetPersonQCStatistisData()
615
+
616
+
617
+  }
209 618
 }
210 619
 </script>
620
+
211 621
 <style lang="scss" scoped>
212
-.content_top{
213
-    display: flex;
214
-    justify-content: space-around;
215
-    margin-bottom: 20px;
622
+.tableTitle {
623
+  font-size: 16px;
624
+  color: #000;
625
+  font-weight: bold;
626
+  margin-bottom: 10px;
627
+}
628
+</style>
629
+<style lang="scss">
630
+.page_process {
631
+.el-tabs{
632
+  margin-bottom:0 !important;
633
+}
634
+.el-button--medium {
635
+  padding: 10px 8px;
636
+}
637
+
638
+.el-form-item {
639
+  margin-bottom: 0;
640
+}
641
+::-webkit-scrollbar{
642
+  height: 15px !important;
643
+}
644
+
216 645
 }
217
-</style>
646
+</style>

+ 212 - 0
src/xt_pages/Dialysisanalysis/print/print.vue View File

@@ -0,0 +1,212 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-row style="float:right;">
6
+        <el-col :span="24">
7
+          <el-button
8
+            size="small"
9
+            icon="el-icon-printer"
10
+            type="primary"
11
+            @click="printAction"
12
+          >打印</el-button
13
+          >
14
+        </el-col>
15
+      </el-row>
16
+    </div>
17
+    <div class="app-container" style="background-color: white;">
18
+      <div id="print_content">
19
+        <div class="print_main_content">
20
+          <div class="order_title_panl">
21
+            <span class="main_title">{{reference.item_name}}详情</span>
22
+          </div>
23
+          <div class="table_panel">
24
+            <table class="table">
25
+              <thead>
26
+              <tr>
27
+                <td width="50">序号</td>
28
+                <td width="100" >透析号</td>
29
+                <td width="70">患者姓名</td>
30
+                <td width="70">检查日期</td>
31
+                <td width="70" >结果</td>
32
+              </tr>
33
+              </thead>
34
+              <tbody>
35
+              <tr v-for="(item, index) in checkData" :key="index">
36
+                <td :width="td_1_width">{{index + 1}}</td>
37
+                <td :width="td_1_width">
38
+                  <span>{{item.dialysis_no}}</span>
39
+                </td>
40
+                <td :width="td_1_width">{{item.name}}</td>
41
+                <td :width="td_1_width">{{getTime(item.check_date)}}</td>
42
+                <td :width="td_1_width">{{item.result}}</td>
43
+              </tr>
44
+              </tbody>
45
+            </table>
46
+          </div>
47
+        </div>
48
+      </div>
49
+    </div>
50
+  </div>
51
+</template>
52
+
53
+<script>
54
+import { GetPersonQCStatistisData } from '@/api/qcd'
55
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
56
+import print from 'print-js'
57
+import { jsGetAge, uParseTime } from '@/utils/tools'
58
+
59
+export default {
60
+  name: 'SchedulePrint',
61
+  data() {
62
+    return {
63
+      checkData:[],
64
+      crumbs: [
65
+        { path: false, name: '专业质控' },
66
+        { path: false, name: '检验详情打印' }
67
+      ],
68
+      scheduleData:[],
69
+      week_type: 0,
70
+      day:'',
71
+      td_1_width: '10%',
72
+      td_2_width: '10%',
73
+      td_3_width: '25%',
74
+      td_4_width: '45%',
75
+      modeOptions: null,
76
+      anticoagulants_confit:null,
77
+      currentDate:'',
78
+      org_id:0,
79
+      printObj:{},
80
+      week_time:0,
81
+      zone:0,
82
+      reference:null,
83
+    }
84
+  },
85
+  components: {
86
+    BreadCrumb
87
+  },
88
+  created() {
89
+    var patient_id = this.$route.query.patient_id
90
+    var project_id  = this.$route.query.project_id
91
+    var item_id  = this.$route.query.item_id
92
+    var start_time  = this.$route.query.start_time
93
+    var end_time  = this.$route.query.end_time
94
+
95
+    const params = {
96
+      patient_id:patient_id,
97
+      project_id:project_id,
98
+      item_id:item_id,
99
+      start_time: start_time,
100
+      end_time: end_time
101
+    }
102
+    GetPersonQCStatistisData(params).then(response=>{
103
+      if(response.data.state ==1){
104
+        let dialysis_no = response.data.data.patient.dialysis_no
105
+        let name = response.data.data.patient.name
106
+        this.checkData = []
107
+        this.reference = response.data.data.reference
108
+        for(let i = 0; i < response.data.data.inspections.length;i++){
109
+          let obj ={
110
+            dialysis_no:dialysis_no,
111
+            name:name,
112
+            check_date:response.data.data.inspections[i].inspect_date,
113
+            result:response.data.data.inspections[i].inspect_value
114
+          }
115
+          this.checkData.push(obj)
116
+
117
+
118
+        }
119
+
120
+
121
+      }
122
+    })
123
+  },
124
+  methods: {
125
+    getTime(val) {
126
+      if(val == "" || val == undefined){
127
+        return ""
128
+      }else {
129
+        return uParseTime(val, '{y}-{m}-{d}')
130
+      }
131
+    },
132
+    printAction: function() {
133
+      const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
134
+      printJS({
135
+        printable: 'print_content',
136
+        type: 'html',
137
+        documentTitle: '  ',
138
+        style: style,
139
+        scanStyles: false
140
+      })
141
+    },
142
+  },
143
+}
144
+</script>
145
+
146
+<style rel="stylesheet/scss" lang="scss" scoped>
147
+.print_main_content {
148
+  background-color: white;
149
+  max-width: 1500px;
150
+  margin: 0 auto;
151
+  padding: 0 0 20px 0;
152
+
153
+.order_title_panl {
154
+  text-align: center;
155
+
156
+.main_title {
157
+  font-size: 18px;
158
+  line-height: 40px;
159
+  font-weight: 500;
160
+}
161
+}
162
+.table_panel {
163
+.table {
164
+  width: 100%;
165
+  border: 1px solid;
166
+  border-collapse: collapse;
167
+  padding: 2px;
168
+
169
+thead {
170
+tr {
171
+td {
172
+  border: 1px solid;
173
+  text-align: center;
174
+  font-size: 20px;
175
+  padding: 15px 5px;
176
+}
177
+}
178
+}
179
+tbody {
180
+tr {
181
+td {
182
+  border: 1px solid;
183
+  text-align: center;
184
+  font-size: 18px;
185
+  padding: 10px 5px;
186
+
187
+.proj {
188
+  padding: 5px 0;
189
+  text-align: left;
190
+
191
+.proj_title {
192
+  font-size: 16px;
193
+  font-weight: 500;
194
+  line-height: 25px;
195
+}
196
+
197
+.proj_item {
198
+  font-size: 15px;
199
+  line-height: 20px;
200
+
201
+.zone_name {
202
+  font-weight: 500;
203
+}
204
+}
205
+}
206
+}
207
+}
208
+}
209
+}
210
+}
211
+}
212
+</style>

+ 630 - 224
src/xt_pages/Dialysisanalysis/qualitycontrol/individual.vue View File

@@ -1,243 +1,649 @@
1 1
 <template>
2
-    <div>
3
-       <div class="content_top">
4
-            <el-autocomplete
5
-            class="inline-input"
6
-            v-model="inputValue"
7
-            :fetch-suggestions="querySearch"
8
-            :trigger-on-focus="false"
9
-            placeholder="请输入患者名字或透析号"
10
-            @select="handleSubmit"
11
-            ></el-autocomplete>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
12 85
             <div>
13
-                <span>查询时间:</span>
14
-                <el-date-picker
15
-                v-model="stat_time"
16
-                type="date"
17
-                placeholder="选择日期">
18
-                </el-date-picker>
19
-                <span>-</span>
20
-                <el-date-picker
21
-                v-model="end_time"
22
-                type="date"
23
-                placeholder="选择日期">
24
-                </el-date-picker>
25
-                <el-select v-model="value" placeholder="请选择">
26
-                    <el-option
27
-                    v-for="item in options"
28
-                    :key="item.value"
29
-                    :label="item.label"
30
-                    :value="item.value">
31
-                    </el-option>
32
-                </el-select>
33
-                <el-select v-model="value" placeholder="请选择">
34
-                    <el-option
35
-                    v-for="item in options"
36
-                    :key="item.value"
37
-                    :label="item.label"
38
-                    :value="item.value">
39
-                    </el-option>
40
-                </el-select>
41
-                <el-button type="primary">查询</el-button>
86
+              <line-chart :options="chart"></line-chart>
87
+<!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+<!--              <line-chart></line-chart>-->
89
+
42 90
             </div>
91
+            <div class="tableTitle">统计表</div>
43 92
             <div>
44
-                <el-button type="primary">打印</el-button>
45
-                <el-button type="primary">导出</el-button>
46
-            </div>
47
-       </div>
48
-       <div style="margin: 20px 0px;">
49
-        <h2 >患者列表</h2>
50
-       </div>
51
-       <div >
52
-        <el-row :gutter="20">
53
-            <el-col :span="4">
54
-              <div class="grid-content bg-purple">
55
-                <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
56
-                <!-- <h2>患者列表</h2> -->
57
-                <el-table
58
-                :data="tableData"
59
-                border
60
-                style="width: 100%">
61
-                    <el-table-column
62
-                        align="center"
63
-                        prop="date"
64
-                        label="透析号"
65
-                       >
66
-                    </el-table-column>
67
-                    <el-table-column
68
-                        align="center"
69
-                        prop="name"
70
-                        label="姓名"
71
-                        >
72
-                    </el-table-column>
73
-                </el-table>
74
-              </div>
75
-            </el-col>
76
-            <el-col :span="19">
77
-               <div class="grid-content bg-purple">
78
-                <div class="echart" id="germychart" style="width:100%;height:400px"></div>
79
-                <el-table
80
-                    :data="tableData"
81
-                    style="width: 100%"
82
-                    border
83
-                    align="center"
84
-                    max-height="250">
85
-                    <el-table-column
86
-                    fixed
87
-                    prop="date"
88
-                    label="姓名"
89
-                   >
90
-                    </el-table-column>
91
-                    <el-table-column
92
-                    prop="name"
93
-                    label="检查日期"
94
-                    >
95
-                    </el-table-column>
96
-                    <el-table-column
97
-                    prop="province"
98
-                    label="甲状旁腺激素(pg/ml)"
99
-                    >
100
-                    </el-table-column>
101
-                    
102
-                </el-table>
103
-               </div>
104
-           </el-col>
105
-        </el-row>
106
-       </div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
107 106
 
107
+                <el-table-column width="100" label="甲状旁腺激素分析" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
108 119
     </div>
120
+  </div>
109 121
 </template>
122
+
123
+
110 124
 <script>
111
-  import * as echarts from 'echarts'
112
-export default{
113
-    // props: {
114
-    //     width: {
115
-    //         type: String,
116
-    //         default: "100%"
117
-    //     },
118
-    //     height: {
119
-    //         type: String,
120
-    //         default: "400px"
121
-    //     },
122
-    
123
-    // },
124
-    data() {
125
-        return {
126
-            inputValue:'',
127
-            stat_time:'',
128
-            end_time:'',
129
-            value:'',
130
-            querySearch:'',
131
-            tableData:[],
132
-            options:[],
133
-            myChartTwo: {},
134
-            xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
135
-            opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
136
-            // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
137
-            
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
138 147
         }
139
-    },
140
-    created(){
141
-        
142
-       
143
-    },
144
-    mounted() {
145
-        // this.$nextTick(function() {
146
-            this.initEcharts();
147
-            // this.myChartTwo = echarts.init(document.getElementById("germychart"));
148
-            // this.myChartTwo.setOption(option);
149
-            // // //随着屏幕大小调节图表
150
-            // window.addEventListener("resize", () => {
151
-            //     console.log('asdfgfdhdgfdghdffgasda');
152
-            //     this.myChartTwo.resize();
153
-            // });
154
-            
155
-            // window.onresize = this.myChartTwo.resize;
156
-		// })  
157
-    },
158
-    // beforeDestroy(){
159
-    //     window.addEventListener("resize", () => {
160
-    //         this.myChartTwo.resize();
161
-    //     });
162
-    //     const quality = document.getElementById("germychart");
163
-    //     quality.addEventListener("transitionend", this.__resizeHanlder);
164
-    // },
165
-    methods:{
166
-        handleSubmit(){
167
-            console.log('asdfa');
168
-            this.querySearch
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1
163
+      },
164
+      crumbs: [
165
+        { path: false, name: '科室质控' },
166
+        { path: false, name: '指标评估统计' },
167
+        { path: false, name: '透析过程指标统计' }
168
+      ],
169
+      tableData1: [],
170
+      chart: {
171
+        title: {
172
+          text: 'ECharts 入门示例'
169 173
         },
170
-        initEcharts() {
171
-            this.myChartTwo = echarts.init(document.getElementById("germychart"));
172
-            console.log('zxczvbbnm,m');
173
-            const option = {
174
-                xAxis: {
175
-                    type: 'category',
176
-                        boundaryGap:true,
177
-                        axisTick:{
178
-                            alignWithLabel:true //保证刻度线和标签对齐
179
-                        },
180
-                    data: this.xData,
181
-                    splitNumber:this.xData.length, //纵坐标数
182
-                    interval:this.xData //强制设置坐标轴分割间隔
183
-                },
184
-                yAxis: {
185
-                    type: 'value',
186
-                    boundaryGap: true,
187
-                    splitNumber:4, //纵坐标数
188
-                    interval:10 //强制设置坐标轴分割间隔
189
-                },
190
-                legend: {
191
-                    // show: true,
192
-                    align:'left',//文字在前图标在后
193
-                    left:'15%',
194
-                    top:'5%',
195
-                    data: [{name:'甲状旁腺激素 pg/ml'}]
174
+        tooltip: {},
175
+        legend: {
176
+          data: [],
177
+          left: 0
178
+        },
179
+        xAxis: {
180
+          data: []
181
+        },
182
+        yAxis: {
183
+          axisLabel: {
184
+            formatter: '{value} %'
185
+          },
186
+          show: false
187
+        },
188
+        series: [
189
+          {
190
+            name: '',
191
+            type: 'line',
192
+            data: [],
193
+            barWidth: 30,
194
+            label: {
195
+              normal: {
196
+                show: true,
197
+                position: 'top',
198
+                formatter: (params) => {
199
+                  if(this.percent.length > 0){
200
+                    let str = ''
201
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
202
+                    return str
203
+                  }else{
204
+                    let str = ''
205
+                    str = params.data
206
+                    return str
207
+                  }
208
+                }
209
+              }
210
+            },
211
+            //配置样式
212
+            itemStyle: {
213
+              //通常情况下:
214
+
215
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
216
+              normal: {
217
+                color: function(params) {
218
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
219
+                  var colorList = [
220
+                    ['#A9E0F3', '#9FBDFC'],
221
+
222
+                    ['#FFD7C0', '#FF9994']
223
+                  ]
224
+
225
+                  var index = params.dataIndex
226
+                  if (params.dataIndex >= colorList.length) {
227
+                    index = params.dataIndex % colorList.length
228
+                  }
229
+
230
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
231
+                    { offset: 0, color: colorList[index][0] },
232
+                    // { offset: 0.5, color: colorList[index][1] },
233
+                    { offset: 1, color: colorList[index][1] }
234
+                  ])
196 235
                 },
197
-                grid:{
198
-                    show:true,
199
-                    left: "5%",
200
-                    right: "5%",
201
-                    bottom: "5%"
236
+                lineStyle:{
237
+                  color:'#409eff' //改变折线颜色
202 238
                 },
203
-                series: [
204
-                {
205
-                    data: this.opinionData,
206
-                    name:'甲状旁腺激素 pg/ml',
207
-                    type: "line",// 类型设置为折线图
208
-                    symbol: 'circle',
209
-                    itemStyle: {
210
-                        normal: {
211
-                            color: '#409eff', //改变折线点的颜色#a80000
212
-                            lineStyle: {
213
-                                color: '#409eff' //改变折线颜色
214
-                            }
215
-                        }
216
-                    },
239
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
240
+              },
217 241
 
218
-                },
219
-                
220
-                ],
221
-                
222
-            };
223
-            
224
-            this.myChartTwo.setOption(option);
225
-            // //随着屏幕大小调节图表
226
-            window.addEventListener("resize", () => {
227
-                console.log('123456788');
228
-                this.myChartTwo.resize();
229
-            });
230
-            
231
-            // window.onresize = this.myChartTwo.resize;
242
+              //鼠标悬停时:
243
+              emphasis: {
244
+                shadowBlur: 10,
245
+                shadowOffsetX: 0,
246
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
247
+              }
248
+            }
249
+          }
250
+        ],
251
+        dataZoom: [
252
+          {
253
+            // Y轴固定,让内容滚动
254
+            type: 'slider',
255
+            show: false,
256
+            xAxisIndex: [0],
257
+            start: 1,
258
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
259
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
260
+          },
261
+          {
262
+            type: 'inside',
263
+            xAxisIndex: [0],
264
+            start: 1,
265
+            end: 20,
266
+            zoomLock: true // 锁定区域禁止缩放
267
+          }
268
+        ]
269
+      },
270
+      bar: {
271
+        title: {
272
+          text: 'ECharts 入门示例'
273
+        },
274
+        tooltip: {},
275
+        legend: {
276
+          data: [],
277
+          left: 0
278
+        },
279
+        xAxis: {
280
+          data: []
232 281
         },
282
+        yAxis: {
283
+          axisLabel: {
284
+            formatter: '{value} %'
285
+          },
286
+          show: false
287
+        },
288
+        series: [
289
+          {
290
+            name: '',
291
+            type: 'bar',
292
+            data: [],
293
+            barWidth: 30,
294
+            label: {
295
+              normal: {
296
+                show: true,
297
+                position: 'top',
298
+                formatter: (params) => {
299
+                  if(this.percent.length > 0){
300
+                    let str = ''
301
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
302
+                    return str
303
+                  }else{
304
+                    let str = ''
305
+                    str = params.data
306
+                    return str
307
+                  }
308
+                }
309
+              }
310
+            },
311
+            //配置样式
312
+            itemStyle: {
313
+              //通常情况下:
314
+
315
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
316
+              normal: {
317
+                color: function(params) {
318
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
319
+                  var colorList = [
320
+                    ['#A9E0F3', '#9FBDFC'],
321
+                    ['#FFD7C0', '#FF9994']
322
+                  ]
323
+
324
+                  var index = params.dataIndex
325
+                  if (params.dataIndex >= colorList.length) {
326
+                    index = params.dataIndex % colorList.length
327
+                  }
328
+
329
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
330
+                    { offset: 0, color: colorList[index][0] },
331
+                    // { offset: 0.5, color: colorList[index][1] },
332
+                    { offset: 1, color: colorList[index][1] }
333
+                  ])
334
+                },
335
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
336
+              },
337
+
338
+              //鼠标悬停时:
339
+              emphasis: {
340
+                shadowBlur: 10,
341
+                shadowOffsetX: 0,
342
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
343
+              }
344
+            }
345
+          }
346
+        ]
347
+      }
348
+
349
+    }
350
+  },
351
+  methods: {
352
+    printAction(){
353
+      this.$router.push({
354
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
355
+      });
356
+
357
+    },exportAction(){
358
+      let list = []
359
+      for (let i = 0; i < this.tableData.length; i++) {
360
+        let order = this.tableData[i]
361
+        let name = order.name
362
+        let value = order.value
363
+        let inspect_date = order.inspect_date
364
+
365
+        let obj = {
366
+          '姓名': name,
367
+          '数值': value,
368
+          '日期': inspect_date,
369
+        }
370
+        list.push(obj)
371
+      }
372
+      import('@/vendor/Export2Excel').then(excel => {
373
+        const tHeader = ['姓名', '数值', '日期']
374
+        const filterVal = ['姓名', '数值', '日期']
375
+        const data = this.formatJson(filterVal, list)
376
+        excel.export_json_to_excel1({
377
+          header: tHeader,
378
+          data,
379
+          filename: '明细',
380
+          ref: this.$refs['table'].$el
381
+        })
382
+      })
383
+    },
384
+    changeProject(val) {
385
+      this.query.statistics_type = val
386
+      this.query.page = 1
387
+      this.GetPersonQCStatistisData(this.query)
388
+      this.GetInspectionCheckIndexTableData(this.query)
389
+
390
+    },
391
+    handleChange(val) {
392
+      this.query.patient_id = val.id
393
+      this.query.page = 1
394
+      this.patient_name = val.name
395
+      this.GetPersonQCStatistisData(this.query)
396
+      this.GetInspectionCheckIndexTableData(this.query)
397
+    },
398
+    handleSizeChange(limit) {
399
+      this.query.limit = limit
400
+      this.GetInspectionCheckIndexTableData(this.query)
401
+
402
+    },
403
+    handleCurrentChange(page) {
404
+      this.query.page = page
405
+      this.GetPersonQCStatistisData(this.query)
406
+    },formatJson(filterVal, jsonData) {
407
+      return jsonData.map(v => filterVal.map(j => v[j]))
408
+    },
409
+    changeTime(val) {
410
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
411
+      if (time > 0) {
412
+        this.$message.error('结束时间不能小于开始时间')
413
+        this.query.start_time = ''
414
+      } else {
415
+        // this.getDialysisList()
416
+        this.query.page = 1
417
+        this.GetPersonQCStatistisData(this.query)
418
+        this.GetInspectionCheckIndexTableData(this.query)
419
+
420
+      }
421
+
422
+    },
423
+    changeEndTime(val) {
424
+      var time =
425
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
426
+      if (time < 0) {
427
+        this.$message.error('结束时间不能小于开始时间')
428
+        this.query.end_time = ''
429
+      } else {
430
+        this.query.page = 1
431
+        this.GetPersonQCStatistisData(this.query)
432
+        this.GetInspectionCheckIndexTableData(this.query)
433
+
434
+      }
435
+    },
436
+    getTimestamp(time) {
437
+      // 把时间日期转成时间戳
438
+      return new Date(time).getTime() / 1000
439
+    },
440
+    QueryOperaById: function(val) {
441
+      let vascular_access_desc_name = ''
442
+      let vascular_access_desc = getDataConfig(
443
+        'hemodialysis',
444
+        'vascular_access_desc'
445
+      )
446
+      for (let i = 0; i < vascular_access_desc.length; i++) {
447
+        if (vascular_access_desc[i].id == val) {
448
+          vascular_access_desc_name = vascular_access_desc[i].name
449
+        }
450
+      }
451
+
452
+      return vascular_access_desc_name
453
+    },
454
+    GetAnticoagulantById: function(val) {
455
+      let anticoagulan_name = ''
456
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
457
+      let anticoagulant = anticoagulantsConfitTwo
458
+      for (let keys in anticoagulant) {
459
+        if (anticoagulant[keys].id == val) {
460
+          anticoagulan_name = anticoagulant[keys].name
461
+        }
462
+      }
463
+      return anticoagulan_name
464
+    },
465
+    getModeName(mode_id) {
466
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
467
+    },  getTime(val) {
468
+      if(val == "" || val == undefined){
469
+        return ""
470
+      }else {
471
+        return uParseTime(val, '{y}-{m}-{d}')
472
+      }
473
+    },
474
+    GetInspectionCheckIndexTableData(params) {
475
+      this.loading = true
476
+      GetPersonQCStatistisData(params)
477
+        .then(rs => {
478
+          var resp = rs.data
479
+          console.log("resp=====",resp)
480
+          if (resp.state == 1) {
481
+            this.loading = false
482
+            this.tableData = []
483
+            for (let i = 0; i < resp.data.inspections.length; i++) {
484
+              let obj = {
485
+                name:resp.data.patient.name,
486
+                value:resp.data.inspections[i].inspect_value,
487
+                inspect_date:resp.data.inspections[i].inspect_date
488
+              }
489
+              this.tableData.push(obj)
490
+            }
491
+            this.total = resp.data.total
492
+
493
+          } else {
494
+            this.loading = false
495
+          }
496
+        })
497
+        .catch(error => {
498
+
499
+        })
500
+    },
501
+    GetPersonQCStatistisData(params) {
502
+      this.chart.xAxis.data = []
503
+      this.chart.series[0].data = []
504
+      this.bar.xAxis.data = []
505
+      this.bar.series[0].data = []
506
+      this.percent = []
507
+      GetPersonQCStatistisData(params)
508
+        .then(rs => {
509
+          var resp = rs.data
510
+          if (resp.state == 1) {
511
+            console.log(resp.data.inspections)
512
+              for (let i = 0; i < resp.data.inspections.length; i++) {
513
+                this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+                this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+              }
516
+              console.log(this.chart.xAxis.data)
517
+            console.log( this.chart.series[0].data)
518
+
519
+              this.getArrLength(this.chart.xAxis.data,1)
520
+          } else {
521
+
522
+          }
523
+        })
524
+        .catch(error => {
525
+        })
526
+    },
527
+    handleSelect(val) {
528
+      this.query.patient_id = val.id
529
+      this.query.page = 1
530
+      this.patient_name = val.name
531
+      for (let i = 0;i < this.patientsData.length; i++){
532
+        console.log(this.patientsData[i].id)
533
+        console.log(val.id)
534
+
535
+        if (this.patientsData[i].id == val.id){
536
+          this.$refs.table.setCurrentRow(this.patientsData[i])
537
+        }
538
+      }
539
+
540
+
541
+    },
542
+    querySearchAsync(keyword, cb) {
543
+      let key = ''
544
+      if (keyword != undefined) {
545
+        key = keyword
546
+      }
547
+      let searchArray = []
548
+      PostSearch(key).then(response => {
549
+        if (response.data.state == 1) {
550
+          searchArray = response.data.data.patient
551
+          cb(searchArray)
552
+        } else {
553
+          cb([])
554
+        }
555
+      })
556
+    },
557
+    chooseWay(way) {
558
+      this.wayType = way
559
+    }, getCurrentOrgPatients() {
560
+      getCurrentOrgPatients().then(response => {
561
+        if (response.data.state == 1) {
562
+          var patients = response.data.data.patients
563
+          this.patientsData = patients
564
+          this.GetDefaultPatient()
565
+        }
566
+      })
567
+    }, GetDefaultPatient() {
568
+      GetDefaultPatient().then(response => {
569
+        if (response.data.state == 1) {
570
+          var patient = response.data.data.patient
571
+          for (let i = 0;i < this.patientsData.length; i++){
572
+            if (this.patientsData[i].id == patient.id){
573
+              this.patient_name = this.patientsData[i].name
574
+              this.$refs.table.setCurrentRow(this.patientsData[i])
575
+            }
576
+          }
577
+          this.query.patient_id = patient.id
578
+          this.GetPersonQCStatistisData(this.query)
579
+
580
+        }
581
+      })
582
+
233 583
     },
234
-    
584
+    getArrLength(result,type){
585
+      if(type == 1){
586
+        if(result.length > 10){
587
+          var dataZoom_end = (10/result.length)*100;
588
+          this.chart.dataZoom[0].end = dataZoom_end
589
+        }else{
590
+          var dataZoom_end = 100;
591
+          this.chart.dataZoom[0].end = dataZoom_end
592
+        }
593
+      }else if(type == 2){
594
+        if(result.length > 10){
595
+          var dataZoom_end = (10/result.length)*100;
596
+          this.bar.dataZoom[0].end = dataZoom_end
597
+        }else{
598
+          var dataZoom_end = 100;
599
+          this.bar.dataZoom[0].end = dataZoom_end
600
+        }
601
+      }
602
+
603
+    }
604
+  }, mounted() {
605
+    var date = new Date()
606
+    var year = date.getFullYear() //获取完整的年份(4位)
607
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
608
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
609
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
610
+    this.query.patient_id = 0
611
+    this.query.end_time = year + '-' + month + '-' + day
612
+    this.query.start_time = year + '-' + last_month + '-' + day
613
+    this.query.project_id = 20
614
+    this.query.item_id = 171
615
+    this.getCurrentOrgPatients()
616
+
617
+    // this.GetPersonQCStatistisData()
618
+
619
+
620
+  }
235 621
 }
236 622
 </script>
623
+
237 624
 <style lang="scss" scoped>
238
-.content_top{
239
-    display: flex;
240
-    justify-content: space-around;
241
-    margin-bottom: 20px;
625
+.tableTitle {
626
+  font-size: 16px;
627
+  color: #000;
628
+  font-weight: bold;
629
+  margin-bottom: 10px;
630
+}
631
+</style>
632
+<style lang="scss">
633
+.page_process {
634
+.el-tabs{
635
+  margin-bottom:0 !important;
636
+}
637
+.el-button--medium {
638
+  padding: 10px 8px;
639
+}
640
+
641
+.el-form-item {
642
+  margin-bottom: 0;
643
+}
644
+::-webkit-scrollbar{
645
+  height: 15px !important;
646
+}
647
+
242 648
 }
243
-</style>
649
+</style>

+ 419 - 218
src/xt_pages/Dialysisanalysis/qualitycontrol/totalSstatistics.vue View File

@@ -1,268 +1,469 @@
1
-
2 1
 <template>
3 2
   <div>
4
-      <!-- <div class="content_top">
5
-          <div class="block">
6
-              <span>查询时间:</span>
7
-              <el-date-picker
8
-              v-model="time_month"
9
-              type="month"
10
-              placeholder="选择月">
11
-              </el-date-picker>
12
-          </div>
13
-          <div>
14
-              <el-date-picker
15
-              v-model="stat_time"
16
-              type="date"
17
-              placeholder="选择日期">
18
-              </el-date-picker>
19
-              <span>-</span>
20
-              <el-date-picker
21
-              v-model="end_time"
22
-              type="date"
23
-              placeholder="选择日期">
24
-              </el-date-picker>
25
-          </div>
26
-          <div style="width: 200px;">
27
-              <el-input v-model="input" placeholder="请输入内容"></el-input>
28
-          </div>
29
-          <el-button type="primary">查询</el-button>
30
-      </div> -->
31
-      <el-row :gutter="20">
32
-      <el-col :span="5"> 
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
33 5
         <div class="block">
34 6
           <span>查询时间:</span>
35
-          <el-date-picker
36
-          v-model="time_month"
37
-          type="month"
38
-          placeholder="选择月">
39
-          </el-date-picker>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
40 16
         </div>
41 17
       </el-col>
42 18
       <el-col :span="8">
43 19
         <div>
44 20
           <el-date-picker
45
-          v-model="stat_time"
46
-          type="date"
47
-          placeholder="选择日期">
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
26
+            type="date"
27
+
28
+            placeholder="选择日期">
48 29
           </el-date-picker>
49 30
           <span>-</span>
50 31
           <el-date-picker
51
-          v-model="end_time"
52
-          type="date"
53
-          placeholder="选择日期">
32
+            style="width: 200px"
33
+            v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
36
+            type="date"
37
+            placeholder="选择日期">
54 38
           </el-date-picker>
55 39
         </div>
56 40
       </el-col>
57
-      <el-col :span="3">
58
-        <div style="width: 200px;">
59
-          <el-input v-model="input" placeholder="请输入内容"></el-input>
41
+      <el-col :span="5">
42
+        <div >
43
+          <el-input disabled v-model="input" placeholder="请输入内容"></el-input>
60 44
         </div>
61 45
       </el-col>
62
-      <el-col :span="2">
63
-          <el-button type="primary">查询</el-button>
46
+      <el-col :span="3">
47
+        <el-button type="primary" @click="getData()">查询</el-button>
64 48
       </el-col>
65
-      </el-row>
66
-      
67
-      <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
68
-        <p class="chartTitle">统计图</p>
69
-      </div>
70
-      <div class="echart" id="mychart" :style={width:width,height:height}></div>
71
-      <div style="width: 80%;margin: auto;">
72
-          <el-table
73
-          :data="tableData"
74
-          :show-summary = true
75
-          border
76
-          style="width: 100%;">
77
-              <el-table-column
78
-                  prop="date"
79
-                  align="center"
80
-                  label="甲状旁腺激素"
81
-                  >
82
-              </el-table-column>
83
-              <el-table-column
84
-                  prop="name"
85
-                  
86
-                  label="人数"
87
-                  >
88
-              </el-table-column>
89
-              <el-table-column
90
-                  prop="address"
91
-                  align="center"
92
-                  label="操作">
93
-                  <template slot-scope="scope">
94
-                      <el-button @click="handleClick(scope.row)" style="font-size:16px;"
95
-                              type="text" >查看详情
96
-                      </el-button>
97
-                  </template>
98
-              </el-table-column>
99
-          </el-table>
100
-      </div>
49
+    </el-row>
50
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
51
+      <p class="chartTitle">统计图</p>
52
+    </div>
53
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
54
+    <div style="width: 80%;margin: auto;">
55
+      <el-table
56
+        :data="tableData"
57
+        border
58
+        style="width: 100%;">
59
+        <el-table-column
60
+          prop="name"
61
+          align="center"
62
+          label="甲状旁腺激素"
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          label="人数"
68
+        >
69
+        </el-table-column>
70
+<!--        <el-table-column-->
71
+<!--          prop="address"-->
72
+<!--          align="center"-->
73
+<!--          label="操作">-->
74
+<!--          <template slot-scope="scope">-->
75
+<!--            <el-button @click="handleClick(scope.row)" style="font-size:16px;"-->
76
+<!--                       type="text">查看详情-->
77
+<!--            </el-button>-->
78
+<!--          </template>-->
79
+<!--        </el-table-column>-->
80
+      </el-table>
81
+    </div>
82
+<!--    <el-dialog class="centerDialog"-->
83
+<!--               title="打印"-->
84
+<!--              >-->
85
+<!--      <el-row :gutter="25">-->
86
+<!--        <el-col :span="5">-->
87
+<!--          <div class="block">-->
88
+<!--            <span>查询时间:</span>-->
89
+<!--            <el-select size="small" v-model="time_type" placeholder="请选择"-->
90
+<!--                       style="width:150px;margin-left:10px;" @change="changeItem">-->
91
+<!--              <el-option-->
92
+<!--                v-for="item,index in times"-->
93
+<!--                :key="index"-->
94
+<!--                :label="item.label"-->
95
+<!--                :value="item.value">-->
96
+<!--              </el-option>-->
97
+<!--            </el-select>-->
98
+<!--          </div>-->
99
+<!--        </el-col>-->
100
+<!--        <el-col :span="8">-->
101
+<!--          <div>-->
102
+<!--            <el-date-picker-->
103
+<!--              style="width: 200px"-->
104
+
105
+<!--              v-model="start_time"-->
106
+<!--              format="yyyy-MM-dd"-->
107
+<!--              value-format="yyyy-MM-dd"-->
108
+<!--              type="date"-->
109
+
110
+<!--              placeholder="选择日期">-->
111
+<!--            </el-date-picker>-->
112
+<!--            <span>-</span>-->
113
+<!--            <el-date-picker-->
114
+<!--              style="width: 200px"-->
115
+<!--              v-model="end_time"-->
116
+<!--              format="yyyy-MM-dd"-->
117
+<!--              value-format="yyyy-MM-dd"-->
118
+<!--              type="date"-->
119
+<!--              placeholder="选择日期">-->
120
+<!--            </el-date-picker>-->
121
+<!--          </div>-->
122
+<!--        </el-col>-->
123
+<!--        <el-col :span="5">-->
124
+<!--          <el-select-->
125
+<!--            placeholder="请选择类型"-->
126
+<!--            style="width:95%"-->
127
+<!--          >-->
128
+<!--            <el-option label="不达标患者" value="1"></el-option>-->
129
+<!--            <el-option label="未检查患者" value="2"></el-option>-->
130
+<!--            <el-option label="达标患者" value="3"></el-option>-->
131
+<!--            <el-option label="不限" value="0"></el-option>-->
132
+<!--          </el-select>-->
133
+<!--        </el-col>-->
134
+<!--        <el-col :span="5">-->
135
+<!--          <el-select-->
136
+<!--            placeholder="请选择排序"-->
137
+<!--            style="width:95%"-->
138
+<!--          >-->
139
+<!--            <el-option label="按时间" value="1"></el-option>-->
140
+<!--            <el-option label="按患者" value="2"></el-option>-->
141
+<!--            <el-option label="不限" value="0"></el-option>-->
142
+<!--          </el-select>-->
143
+<!--        </el-col>-->
144
+<!--        <el-col :span="3">-->
145
+<!--          <el-button type="primary" @click="getData()">查询</el-button>-->
146
+<!--          <el-button type="primary" @click="getData()">打印</el-button>-->
147
+<!--          <el-button type="primary" @click="getData()">导出</el-button>-->
148
+
149
+<!--        </el-col>-->
150
+<!--      </el-row>-->
151
+<!--      <div style="width: 80%;margin: auto;">-->
152
+<!--        <el-table-->
153
+<!--          :data="tableData"-->
154
+<!--          border-->
155
+<!--          style="width: 100%;">-->
156
+<!--          <el-table-column-->
157
+<!--            prop="name"-->
158
+<!--            align="center"-->
159
+<!--            label="透析号"-->
160
+<!--          >-->
161
+<!--          </el-table-column>-->
162
+<!--          <el-table-column-->
163
+<!--            prop="count"-->
164
+<!--            label="姓名"-->
165
+<!--          >-->
166
+<!--          </el-table-column>-->
167
+<!--          <el-table-column-->
168
+<!--            prop="address"-->
169
+<!--            align="center"-->
170
+<!--            label="检查日期">-->
171
+
172
+<!--          </el-table-column>-->
173
+<!--          <el-table-column-->
174
+<!--            prop="address"-->
175
+<!--            align="center"-->
176
+<!--            label="结果">-->
177
+
178
+<!--          </el-table-column>-->
179
+<!--        </el-table>-->
180
+<!--      </div>-->
181
+
182
+<!--    </el-dialog>-->
101 183
   </div>
102 184
 </template>
103 185
 <script>
104
-import * as echarts from "echarts";
105
-export default{
186
+import * as echarts from 'echarts'
187
+import { GetQCStatistisData } from '../../../api/qcd'
188
+
189
+const moment = require('moment')
190
+
191
+export default {
106 192
   props: {
107
- 
108
-  width: {
109
-    type: String,
110
-    default: "100%"
111
-  },
112
-  height: {
113
-    type: String,
114
-    default: "400px"
193
+
194
+    width: {
195
+      type: String,
196
+      default: '100%'
197
+    },
198
+    height: {
199
+      type: String,
200
+      default: '400px'
201
+    }
202
+
115 203
   },
116
-  
117
-},
118 204
   data() {
119
-      return {
120
-          time_month:'',
121
-          stat_time:'',
122
-          end_time:'',
123
-          input:'',
124
-          myChart: {},
125
-          pieData : [
126
-          {
127
-        value: 463,
128
-        name: "不达标值患者"
129
-      },
130
-      {
131
-        value: 395,
132
-        name: "未检查患者"
133
-      },
134
-      {
135
-        value: 157,
136
-        name: "达标值患者"
137
-      },
138
-      // {
139
-      //   value: 149,
140
-      //   name: "广东"
141
-      // },
142
-      // {
143
-      //   value: 147,
144
-      //   name: "湖南"
145
-      // }
146
-          
147
-          ],
148
-          pieName: [],
149
-          // myChartStyle:{float: "right", width: "100%", height: "400px"},
150
-          tableData:[],
151
-      }
205
+    return {
206
+      time_type: 1,
207
+      times: [
208
+        { value: 1, label: '本月' },
209
+        { value: 2, label: '上月' },
210
+        { value: 3, label: '今年' },
211
+        { value: 4, label: '上一年' },
212
+        { value: 5, label: '第一季度' },
213
+        { value: 6, label: '第二季度' },
214
+        { value: 7, label: '第三季度' },
215
+        { value: 8, label: '第四季度' },
216
+        { value: 9, label: '自定义' }
217
+
218
+      ],
219
+      time_month: '',
220
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
221
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
222
+      input: '',
223
+      myChart: {},
224
+      pieData: [],
225
+      pieName: [],
226
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
227
+      tableData: [],
228
+      reference:{},
229
+    }
152 230
   },
153 231
   mounted() {
154
-  this.initDate(); //数据初始化
155
-  this.initEcharts();
156
-},
157
-methods: {
158
-  initDate() {
159
-    for (let i = 0; i < this.pieData.length; i++) {
160
-      this.pieName[i] = this.pieData[i].name;
161
-    }
232
+    this.getData()
162 233
   },
163
-  initEcharts() {
164
-    // 饼图
165
-    this.myChart = echarts.init(document.getElementById("mychart"));
166
-    window.addEventListener("resize", () => {
167
-      console.log('098765adsfghg');
168
-      this.myChart.resize();
169
-    });
170
-    console.log('09876543454676');
171
-    const option = {
172
-      legend: {
173
-        // 图例
174
-        data: this.pieName,
175
-        left: "10%",
176
-        top: "30%",
177
-        orient: "vertical"
178
-      },
179
-      color:['#ff7f9f','#fff67f','#1e5feb'],
180
-      title: {
181
-        // 设置饼图标题,位置设为顶部居中
182
-      //   text: "国内院士前五省份图示",
183
-        top: "0%",
184
-        left: "center"
185
-      },
186
-      series: [
187
-        {
188
-          type: "pie",
189
-          label: {
190
-            normal : {
191
-              formatter: '{b}:{c}: ({d}%)',
192
-              textStyle : {
193
-                  fontWeight : 'normal',
194
-                  fontSize : 15,
195
-                  color : "black"
234
+  methods: {
235
+    getData() {
236
+      if(this.start_time.length == 0){
237
+        this.$message.error("请选择开始时间")
238
+      }
239
+      if(this.end_time.length == 0){
240
+        this.$message.error("请选择结束时间")
241
+      }
242
+      let params = {
243
+        start_date: this.start_time,
244
+        end_date: this.end_time,
245
+        project_id: 20,
246
+        item_id: 171
247
+      }
248
+      this.pieData = []
249
+      this.tableData = []
250
+      console.log("~~~~~~~~~~")
251
+      GetQCStatistisData(params).then(response => {
252
+        if (response.data.state == 1) {
253
+          this.reference = response.data.data.reference
254
+          this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
255
+          let objone = {
256
+            value:  response.data.data.unusual_total / response.data.data.patient_count,
257
+            name: '不达标值患者',
258
+            count:response.data.data.unusual_total,
259
+          }
260
+          this.pieData.push(objone)
261
+          this.tableData.push(objone)
262
+
263
+            let objtwo = {
264
+            value:   response.data.data.normal_total / response.data.data.patient_count,
265
+            name: '达标值患者',
266
+            count:response.data.data.normal_total,
267
+
268
+          }
269
+          this.pieData.push(objtwo)
270
+          this.tableData.push(objtwo)
271
+
272
+          let objthree = {
273
+            value: response.data.data.patient_count / response.data.data.no_check_total,
274
+            name: '未检查患者',
275
+            count:response.data.data.no_check_total,
276
+
277
+          }
278
+          this.pieData.push(objthree)
279
+          this.tableData.push(objthree)
280
+
281
+          let objfour = {
282
+            value: response.data.data.patient_count,
283
+            name: '合计',
284
+            count:response.data.data.patient_count,
285
+          }
286
+          this.tableData.push(objfour)
287
+          for (let i = 0; i < this.pieData.length; i++) {
288
+            this.pieName[i] = this.pieData[i].name
289
+          }
290
+          this.myChart = echarts.init(document.getElementById('mychart'))
291
+          window.addEventListener('resize', () => {
292
+            this.myChart.resize()
293
+          })
294
+          const option = {
295
+            legend: {
296
+              // 图例
297
+              data: this.pieName,
298
+              left: '10%',
299
+              top: '30%',
300
+              orient: 'vertical'
301
+            },
302
+            color: ['#ff7f9f', '#fff67f', '#1e5feb'],
303
+            title: {
304
+              // 设置饼图标题,位置设为顶部居中
305
+              //   text: "国内院士前五省份图示",
306
+              top: '0%',
307
+              left: 'center'
308
+            },
309
+            series: [
310
+              {
311
+                type: 'pie',
312
+                label: {
313
+                  show: true,
314
+                  formatter: '{b} : {d}% ({c})'
315
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
316
+                },
317
+                radius: '65%', //饼图半径
318
+                data: this.pieData
196 319
               }
197
-            }
198
-            // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
199
-          },
200
-          radius: "65%", //饼图半径
201
-          data: this.pieData,
202
-          itemStyle : {
203
-            emphasis: {
204
-              shadowBlur: 10,
205
-              shadowOffsetX: 0,
206
-              shadowColor: 'rgba(0, 0, 0, 0.5)'
207
-            }
320
+            ]
208 321
           }
322
+          //   console.log(this.seriesData);
323
+          const optionFree = {
324
+            series: [
325
+              {
326
+                data: this.seriesData,
327
+                type: 'line',
328
+                smooth: true
329
+              }
330
+            ]
331
+          }
332
+          this.myChart = echarts.init(document.getElementById('mychart'))
333
+          this.myChart.setOption(option)
334
+        } else {
335
+          this.$message.error(response.data.msg)
209 336
         }
210
-      ]
211
-    };
212
-  //   console.log(this.seriesData);
213
-    const optionFree = {
214
-      series: [
215
-        {
216
-          data: this.seriesData,
217
-          type: "line",
218
-          smooth: true
219
-        }
220
-      ]
221
-    };
222
-    this.myChart = echarts.init(document.getElementById("mychart"));
223
-    this.myChart.setOption(option);
224
-    //随着屏幕大小调节图表
225
-  //   window.addEventListener("resize", () => {
226
-  //     this.myChart.resize();
227
-  //   });
228
-  },
229
-  getSummaries(param) {
230
-      const { columns, data } = param;
231
-      const sums = [];
337
+      })
338
+
339
+    },
340
+    changeItem(val) {
341
+      const currentDate = new Date()
342
+      switch (val) {
343
+        case 1:
344
+
345
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
346
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
347
+
348
+          this.start_time = startOfMonth
349
+          this.end_time = endOfMonth
350
+          this.getData()
351
+
352
+          break
353
+        case 2:
354
+          // 上月的起始日期和结束日期
355
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
356
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
357
+
358
+          this.start_time = startOfLastMonth
359
+          this.end_time = endOfLastMonth
360
+          this.getData()
361
+
362
+          break
363
+        case 3:
364
+          // 今年的起始日期和结束日期
365
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
366
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
367
+
368
+          this.start_time = startOfYear
369
+          this.end_time = endOfYear
370
+          this.getData()
371
+
372
+          break
373
+        case 4:
374
+          // 上一年的起始日期和结束日期
375
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
376
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
377
+
378
+          this.start_time = startOfLastYear
379
+          this.end_time = endOfLastYear
380
+          this.getData()
381
+
382
+          break
383
+        case 5:
384
+          // 第一季度的起始日期和结束日期
385
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
386
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
387
+
388
+          this.start_time = startOfFirstQuarter
389
+          this.end_time = endOfFirstQuarter
390
+          this.getData()
391
+
392
+          break
393
+        case 6:
394
+          // 第二季度的起始日期和结束日期
395
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
396
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
397
+
398
+          this.start_time = startOfSecondQuarter
399
+          this.end_time = endOfSecondQuarter
400
+          this.getData()
401
+
402
+          break
403
+        case 7:
404
+          // 第三季度的起始日期和结束日期
405
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
406
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
407
+
408
+          this.start_time = startOfThirdQuarter
409
+          this.end_time = endOfThirdQuarter
410
+          this.getData()
411
+
412
+          break
413
+        case 8:
414
+          // 第四季度的起始日期和结束日期
415
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
416
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
417
+
418
+          this.start_time = startOfFourthQuarter
419
+          this.end_time = endOfFourthQuarter
420
+          this.getData()
421
+          break
422
+        case 9:
423
+          this.start_time = ''
424
+          this.end_time = ''
425
+          break
426
+      }
427
+    },
428
+
429
+
430
+    getSummaries(param) {
431
+      const { columns, data } = param
432
+      const sums = []
232 433
       columns.forEach((column, index) => {
233 434
         if (index === 0) {
234
-          sums[index] = '总价';
235
-          return;
435
+          sums[index] = '总价'
436
+          return
236 437
         }
237
-        const values = data.map(item => Number(item[column.property]));
438
+        const values = data.map(item => Number(item[column.property]))
238 439
         if (!values.every(value => isNaN(value))) {
239 440
           sums[index] = values.reduce((prev, curr) => {
240
-            const value = Number(curr);
441
+            const value = Number(curr)
241 442
             if (!isNaN(value)) {
242
-              return prev + curr;
443
+              return prev + curr
243 444
             } else {
244
-              return prev;
445
+              return prev
245 446
             }
246
-          }, 0);
247
-          sums[index] += ' 元';
447
+          }, 0)
448
+          sums[index] += ' 元'
248 449
         } else {
249
-          sums[index] = 'N/A';
450
+          sums[index] = 'N/A'
250 451
         }
251
-      });
452
+      })
252 453
 
253
-      return sums;
254
-  },
255
-  handleClick(id){
256
-      console.log(id);
454
+      return sums
455
+    },
456
+    handleClick(id) {
457
+      console.log(id)
458
+    }
257 459
   }
258
-}
259 460
 
260 461
 }
261 462
 </script>
262 463
 <style lang="scss" scoped>
263
-.content_top{
464
+.content_top {
264 465
   display: flex;
265 466
   justify-content: space-around;
266 467
   color: #1e5feb;
267 468
 }
268
-</style>
469
+</style>

+ 414 - 415
src/xt_pages/hospitalStation/batchStatementTemplate/hospitalBatchPrint.vue View File

@@ -1,421 +1,420 @@
1 1
 <template>
2
-    <div id="statement-print" class="statement-print">
3
-      <div  v-for="(info,index) in infos">
4
-      <div class="statementTitle">广东省社会医疗保险医疗费用结算单</div>
5
-      <table class="statementTable" border="1">
6
-        <tr>
7
-          <td width="80">机构名称</td>
8
-          <td colspan="4">{{info.fixmedins_name}}</td>
9
-          <td width="80">机构编码</td>
10
-          <td colspan="4">{{info.fixmedins_code}}</td>
11
-          <td width="100">医保结算级别</td>
12
-          <td width="100" v-if="info.hosp_lv == '1'">三级特等</td>
13
-          <td width="100" v-if="info.hosp_lv == '2'">三级甲等</td>
14
-          <td width="100" v-if="info.hosp_lv == '3'">三级乙等</td>
15
-          <td width="100" v-if="info.hosp_lv == '4'">三级丙等</td>
16
-          <td width="100" v-if="info.hosp_lv == '5'">二级甲等</td>
17
-          <td width="100" v-if="info.hosp_lv == '6'">二级乙等</td>
18
-          <td width="100" v-if="info.hosp_lv == '7'">二级丙等</td>
19
-          <td width="100" v-if="info.hosp_lv == '8'">一级甲等</td>
20
-          <td width="100" v-if="info.hosp_lv == '9'">一级乙等</td>
21
-          <td width="100" v-if="info.hosp_lv == '10'">一级丙等</td>
22
-          <td width="100" v-if="info.hosp_lv == '11'">无等级</td>
23
-          <td width="100" v-else></td>
24
-  
25
-        </tr>
26
-        <tr>
27
-          <td width="90">就医登记号</td>
28
-          <td colspan="11">{{info.mdtrt_id}}</td>
29
-        </tr>
30
-        <tr>
31
-          <td width="80">姓名</td>
32
-          <td width="80">{{info.psn_name}}</td>
33
-          <td width="80">性别</td>
34
-          <td width="50" v-if="info.gend == '1'">男</td>
35
-          <td width="50" v-if="info.gend == '2'">女</td>
36
-  
37
-          <td width="80">出生日期</td>
38
-          <td width="100">{{info.brdy}}</td>
39
-          <td width="90">个人电脑号</td>
40
-          <td width="110">{{info.psn_no}}</td>
41
-          <td width="80">人员类别</td>
42
-          <td colspan="3" v-if="info.psn_type == '11'">在职</td>
43
-          <td colspan="3" v-if="info.psn_type == '1101'">职工在职</td>
44
-          <td colspan="3" v-if="info.psn_type == '1102'">公务员在职</td>
45
-          <td colspan="3" v-if="info.psn_type == '1103'">灵活就业人员在职</td>
46
-          <td colspan="3" v-if="info.psn_type == '1160'">地方其他扩展人员</td>
47
-  
48
-  
49
-          <td colspan="3" v-if="info.psn_type == '12'">退休人员</td>
50
-          <td colspan="3" v-if="info.psn_type == '1201'">职工退休</td>
51
-          <td colspan="3" v-if="info.psn_type == '1202'">公务员退休</td>
52
-          <td colspan="3" v-if="info.psn_type == '1203'">灵活就业人员退休</td>
53
-          <td colspan="3" v-if="info.psn_type == '1260'">地方其他扩展人员</td>
54
-  
55
-  
56
-          <td colspan="3" v-if="info.psn_type == '13'">离休</td>
57
-          <td colspan="3" v-if="info.psn_type == '1300'">离休人员</td>
58
-          <td colspan="3" v-if="info.psn_type == '1360'">地方其他扩展人员</td>
59
-  
60
-          <td colspan="3" v-if="info.psn_type == '14'">居民(未成年)</td>
61
-          <td colspan="3" v-if="info.psn_type == '1401'">新生儿</td>
62
-          <td colspan="3" v-if="info.psn_type == '1402'">学龄前儿童</td>
63
-          <td colspan="3" v-if="info.psn_type == '1403'">中小学生</td>
64
-          <td colspan="3" v-if="info.psn_type == '1404'">大学生</td>
65
-          <td colspan="3" v-if="info.psn_type == '1405'">未成年(未入学)</td>
66
-  
67
-  
68
-          <td colspan="3" v-if="info.psn_type == '15'">居民(成年)</td>
69
-          <td colspan="3" v-if="info.psn_type == '1501'">普通居民(成年)</td>
70
-          <td colspan="3" v-if="info.psn_type == '1560'">地方其他扩展身份</td>
71
-  
72
-          <td colspan="3" v-if="info.psn_type == '16'">居民(老年)</td>
73
-  
74
-  
75
-  
76
-        </tr>
77
-        <tr>
78
-          <td>单位名称</td>
79
-          <td colspan="5">{{info.emp_name}}</td>
80
-          <td width="80">联系电话</td>
81
-          <td width="110">{{info.patient.phone}}</td>
82
-          <td width="80">身份证号</td>
83
-          <td colspan="3">{{info.certno}}</td>
84
-        </tr>
85
-        <tr>
86
-          <td>住院号</td>
87
-          <td>{{info.number}}</td>
88
-          <td>科别</td>
89
-          <td width="100"></td>
90
-          <td>床号</td>
91
-          <td></td>
92
-          <td>入院日期</td>
93
-          <td>{{info.begndate}}</td>
94
-          <td>出院日期</td>
95
-          <td width="100">{{info.enddate}}</td>
96
-          <td>住院天数</td>
97
-          <td>{{getDay(info.begndate,info.enddate)}}</td>
98
-  
99
-        </tr>
100
-        <tr>
101
-          <td>险种</td>
102
-          <td colspan="2" v-if="info.insutype == '310'">职工基本医疗保险</td>
103
-          <td colspan="2" v-if="info.insutype == '320'">公务员医疗补助</td>
104
-          <td colspan="2" v-if="info.insutype == '330'">大额医疗费用补助</td>
105
-          <td colspan="2" v-if="info.insutype == '340'">离休人员医疗保障</td>
106
-          <td colspan="2" v-if="info.insutype == '390'">城乡居民基本医疗保险</td>
107
-          <td colspan="2" v-if="info.insutype == '392'">城乡居民大病医疗保险</td>
108
-          <td colspan="2" v-if="info.insutype == '510'">生育保险</td>
109
-          <td>入院第一诊断</td>
110
-          <td colspan="3">{{info.diagnosis}}</td>
111
-          <td>出院第一诊断</td>
112
-          <td colspan="4">{{info.diagnosis}}</td>
113
-  
114
-  
115
-        </tr>
116
-        <tr>
117
-          <td>业务类别</td>
118
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '11'">普通门诊</td>
119
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '12'">门诊挂号</td>
120
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '13'">急诊</td>
121
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '14'">门诊慢性病</td>
122
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '15'">门诊统筹</td>
123
-          <!--        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '16'">门诊慢性病</td>-->
124
-          <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '21'">普通住院</td>
125
-  
126
-          <td>结算时间</td>
127
-          <td colspan="5" style="text-align:left;padding-left:10px;">{{info.setl_time.split(' ')[0]}}</td>
128
-        </tr>
129
-        <tr>
130
-          <td colspan="12" style="text-align:left;padding-left:10px;">
131
-            本次就医:总费用{{info.medfee_sumamt}}元,基金支付{{info.fund_pay_sumamt}}元,个人支付{{info.psn_pay}}元。
132
-            (起付线 {{info.act_pay_dedc}}元, 先自付 {{info.preselfpay_amt}}元, 段内自付 {{(info.psn_pay - info.preselfpay_amt).toFixed(2)}} )
133
-  
134
-          </td>
135
-        </tr>
136
-        <tr>
137
-          <td>费用名称</td>
138
-          <td colspan="2">总费用</td>
139
-          <td>自费</td>
140
-          <td colspan="2">部分项目自付</td>
141
-          <td>费用名称</td>
142
-          <td colspan="2">总费用</td>
143
-          <td>自费</td>
144
-          <td colspan="2">部分项目自付</td>
145
-        </tr>
146
-        <tr>
147
-          <td>床位费</td>
148
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_total}}</td>
149
-          <td style="text-align:right;padding-right:10px;">{{info.bed_cost_self_total}}</td>
150
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_part_self_total}}</td>
151
-          <td>西成药</td>
152
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_total}}</td>
153
-          <td style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_self_total}}</td>
154
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_part_self_total}}</td>
155
-        </tr>
156
-        <tr>
157
-          <td>中药费</td>
158
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
159
-          <td style="text-align:right;padding-right:10px;">0</td>
160
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
161
-          <td>中成药</td>
162
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_total}}
163
-          </td>
164
-          <td style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_self_total}}</td>
165
-          <td colspan="2" style="text-align:right;padding-right:10px;">
166
-            {{info.chinese_traditional_medicine_cost_part_self_total}}
167
-          </td>
168
-        </tr>
169
-        <tr>
170
-          <td>中草药</td>
171
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
172
-          <td style="text-align:right;padding-right:10px;">0</td>
173
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
174
-          <td>检查费</td>
175
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_total}}</td>
176
-          <td style="text-align:right;padding-right:10px;">{{info.check_cost_self_total}}</td>
177
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_part_self_total}}</td>
178
-        </tr>
179
-        <tr>
180
-          <td>治疗费</td>
181
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_total}}</td>
182
-          <td style="text-align:right;padding-right:10px;">{{info.treat_cost_self_total}}</td>
183
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_part_self_total}}</td>
184
-          <td>放射费</td>
185
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
186
-          <td style="text-align:right;padding-right:10px;">0</td>
187
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
188
-        </tr>
189
-        <tr>
190
-          <td>手术费</td>
191
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_total}}</td>
192
-          <td style="text-align:right;padding-right:10px;">{{info.operation_cost_self_total}}</td>
193
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_part_self_total}}</td>
194
-          <td>化验费</td>
195
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_total}}</td>
196
-          <td style="text-align:right;padding-right:10px;">{{info.laboratory_cost_self_total}}</td>
197
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_part_self_total}}</td>
198
-        </tr>
199
-        <tr>
200
-          <td>输血费</td>
201
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
202
-          <td style="text-align:right;padding-right:10px;">0</td>
203
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
204
-          <td>输氧费</td>
205
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
206
-          <td style="text-align:right;padding-right:10px;">0</td>
207
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
208
-        </tr>
209
-        <tr>
210
-          <td>其他</td>
211
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_total}}</td>
212
-          <td style="text-align:right;padding-right:10px;">{{info.other_cost_self_total}}</td>
213
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_part_self_total}}</td>
214
-          <td>麻醉费</td>
215
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
216
-          <td style="text-align:right;padding-right:10px;">0</td>
217
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
218
-        </tr>
219
-        <tr>
220
-          <td>材料费</td>
221
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_total}}</td>
222
-          <td style="text-align:right;padding-right:10px;">{{info.material_cost_self_total}}</td>
223
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_part_self_total}}</td>
224
-          <td>特殊检查费</td>
225
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
226
-          <td style="text-align:right;padding-right:10px;">0</td>
227
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
228
-        </tr>
229
-        <tr>
230
-          <td>特殊治疗费</td>
231
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
232
-          <td style="text-align:right;padding-right:10px;">0</td>
233
-          <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
234
-          <td style="text-align:right;padding-right:10px;"></td>
235
-          <td colspan="2" style="text-align:right;padding-right:10px;"></td>
236
-          <td style="text-align:right;padding-right:10px;"></td>
237
-          <td colspan="2" style="text-align:right;padding-right:10px;"></td>
238
-        </tr>
239
-        <tr>
240
-          <td>合计</td>
241
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_total) +
242
-            parseFloat(info.operation_cost_total) + parseFloat(info.other_cost_total) +
243
-            parseFloat(info.material_cost_total) + parseFloat(info.western_medicine_cost_total) +
244
-            parseFloat(info.chinese_traditional_medicine_cost_total) + parseFloat(info.check_cost_total) +
245
-            parseFloat(info.laboratory_cost_total) + parseFloat(info.treat_cost_total)).toFixed(2) }}
246
-          </td>
247
-          <td style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_self_total )+
248
-            parseFloat(info.operation_cost_self_total) + parseFloat(info.other_cost_self_total) +
249
-            parseFloat(info.material_cost_self_total) + parseFloat(info.western_medicine_cost_self_total) +
250
-            parseFloat(info.chinese_traditional_medicine_cost_self_total) + parseFloat(info.check_cost_self_total) +
251
-            parseFloat(info.laboratory_cost_self_total) + parseFloat(info.treat_cost_self_total)).toFixed(2)}}
252
-          </td>
253
-          <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_part_self_total) +
254
-            parseFloat(info.operation_cost_part_self_total) + parseFloat(info.other_cost_part_self_total) +
255
-            parseFloat(info.material_cost_part_self_total) + parseFloat(info.western_medicine_cost_part_self_total) +
256
-            parseFloat(info.chinese_traditional_medicine_cost_part_self_total) +
257
-            parseFloat(info.check_cost_part_self_total) + parseFloat(info.laboratory_cost_part_self_total) +
258
-            parseFloat(info.treat_cost_part_self_total)).toFixed(2)}}
259
-          </td>
260
-          <td style="text-align:right;padding-right:10px;"></td>
261
-          <td colspan="2" style="text-align:right;padding-right:10px;"></td>
262
-          <td style="text-align:right;padding-right:10px;"></td>
263
-          <td colspan="2" style="text-align:right;padding-right:10px;"></td>
264
-        </tr>
265
-        <tr>
266
-          <td colspan="3" style="text-align:left;padding-left:10px;">基本医疗保险统筹基金支付</td>
267
-          <td colspan="3">{{info.hifp_pay}}</td>
268
-          <td colspan="3" style="text-align:left;padding-left:10px;">大额基金支付</td>
269
-          <td colspan="3">{{info.hifob_pay}}</td>
270
-        </tr>
271
-        <tr>
272
-          <td colspan="3" style="text-align:left;padding-left:10px;">大病基金支付</td>
273
-          <td colspan="3">{{info.hifmi_pay}}</td>
274
-          <td colspan="3" style="text-align:left;padding-left:10px;">补充保险基金支付</td>
275
-          <td colspan="3">{{info.hifes_pay}}</td>
276
-        </tr>
277
-        <tr>
278
-          <td colspan="3" style="text-align:left;padding-left:10px;">医疗救助基金支付</td>
279
-          <td colspan="3">{{info.maf_pay}}</td>
280
-          <td colspan="3" style="text-align:left;padding-left:10px;">公务员基金支付</td>
281
-          <td colspan="3">{{info.cvlserv_pay}}</td>
282
-        </tr>
283
-  
284
-        <tr>
285
-          <td colspan="3" style="text-align:left;padding-left:10px;">其他基金支付</td>
286
-          <td colspan="3">{{info.oth_pay}}</td>
287
-          <td colspan="3" style="text-align:left;padding-left:10px;">个人账户支付</td>
288
-          <td colspan="3">{{info.acct_pay}}</td>
289
-        </tr>
290
-        <tr>
291
-          <td>收款人:</td>
292
-          <td colspan="2">{{info.charge_admin.user_name}}</td>
293
-          <td>审核人:</td>
294
-          <td colspan="2">{{info.p_admin.user_name}}</td>
295
-          <td>制单人:</td>
296
-          <td colspan="2">{{info.p_admin.user_name}}</td>
297
-          <td>打印日期</td>
298
-          <td colspan="2">{{getNowTime()}}</td>
299
-        </tr>
300
-        <tr>
301
-          <td colspan="12" style="text-align:left;padding-left:10px;line-height:20px;">
302
-            注: 1、部分项目自付金额是指基本医疗保险范围内的项目需参保人先按规定比例自付的金额。<br/>
303
-            &ensp;&ensp;&ensp;2、此表由医院打印。<br/>
304
-            &ensp;&ensp;&ensp;3、此表一式两份,医院、参保人各一份。
305
-          </td>
306
-        </tr>
307
-        <tr>
308
-          <td colspan="12" style="text-align:left;padding-left:10px;">
309
-            病人家属签字:
310
-          </td>
311
-        </tr>
312
-      </table>
313
-    </div>
314
-    </div>
315
-  </template>
316
-  <script>
317
-  
318
-  export default {
319
-    name: 'hospitalBatchPrint',
320
-    props: {
321
-      infos:{
322
-        type: Array,
323
-        default: function() {
324
-          return []
325
-        }
326
-      },
327
-      info: {
328
-        type: Object,
329
-        default: function() {
330
-          return {}
331
-        }
332
-      }, p_admin: {
333
-        type: Object,
334
-        default: function() {
335
-          return {}
336
-        }
337
-      }, charge_admin: {
338
-        type: Object,
339
-        default: function() {
340
-          return {}
341
-        },
342
-      },his: {
343
-        type: Object,
344
-        default: function() {
345
-          return {}
346
-        },
347
-      },his_record: {
348
-        type: Object,
349
-        default: function() {
350
-          return {}
351
-        },
352
-      },patient:{
353
-        type: Object,
354
-        default: function() {
355
-          return {}
356
-        },
357
-  
2
+  <div id="statement-print" class="statement-print">
3
+    <div  v-for="(info,index) in infos">
4
+    <div class="statementTitle">广东省社会医疗保险医疗费用结算单</div>
5
+    <table class="statementTable" border="1">
6
+      <tr>
7
+        <td width="80">机构名称</td>
8
+        <td colspan="4">{{info.fixmedins_name}}</td>
9
+        <td width="80">机构编码</td>
10
+        <td colspan="4">{{info.fixmedins_code}}</td>
11
+        <td width="100">医保结算级别</td>
12
+        <td width="100" v-if="info.hosp_lv == '1'">三级特等</td>
13
+        <td width="100" v-if="info.hosp_lv == '2'">三级甲等</td>
14
+        <td width="100" v-if="info.hosp_lv == '3'">三级乙等</td>
15
+        <td width="100" v-if="info.hosp_lv == '4'">三级丙等</td>
16
+        <td width="100" v-if="info.hosp_lv == '5'">二级甲等</td>
17
+        <td width="100" v-if="info.hosp_lv == '6'">二级乙等</td>
18
+        <td width="100" v-if="info.hosp_lv == '7'">二级丙等</td>
19
+        <td width="100" v-if="info.hosp_lv == '8'">一级甲等</td>
20
+        <td width="100" v-if="info.hosp_lv == '9'">一级乙等</td>
21
+        <td width="100" v-if="info.hosp_lv == '10'">一级丙等</td>
22
+        <td width="100" v-if="info.hosp_lv == '11'">无等级</td>
23
+        <td width="100" v-else></td>
24
+
25
+      </tr>
26
+      <tr>
27
+        <td width="90">就医登记号</td>
28
+        <td colspan="11">{{info.mdtrt_id}}</td>
29
+      </tr>
30
+      <tr>
31
+        <td width="80">姓名</td>
32
+        <td width="80">{{info.psn_name}}</td>
33
+        <td width="80">性别</td>
34
+        <td width="50" v-if="info.gend == '1'">男</td>
35
+        <td width="50" v-if="info.gend == '2'">女</td>
36
+
37
+        <td width="80">出生日期</td>
38
+        <td width="100">{{info.brdy}}</td>
39
+        <td width="90">个人电脑号</td>
40
+        <td width="110">{{info.psn_no}}</td>
41
+        <td width="80">人员类别</td>
42
+        <td colspan="3" v-if="info.psn_type == '11'">在职</td>
43
+        <td colspan="3" v-if="info.psn_type == '1101'">职工在职</td>
44
+        <td colspan="3" v-if="info.psn_type == '1102'">公务员在职</td>
45
+        <td colspan="3" v-if="info.psn_type == '1103'">灵活就业人员在职</td>
46
+        <td colspan="3" v-if="info.psn_type == '1160'">地方其他扩展人员</td>
47
+
48
+
49
+        <td colspan="3" v-if="info.psn_type == '12'">退休人员</td>
50
+        <td colspan="3" v-if="info.psn_type == '1201'">职工退休</td>
51
+        <td colspan="3" v-if="info.psn_type == '1202'">公务员退休</td>
52
+        <td colspan="3" v-if="info.psn_type == '1203'">灵活就业人员退休</td>
53
+        <td colspan="3" v-if="info.psn_type == '1260'">地方其他扩展人员</td>
54
+
55
+
56
+        <td colspan="3" v-if="info.psn_type == '13'">离休</td>
57
+        <td colspan="3" v-if="info.psn_type == '1300'">离休人员</td>
58
+        <td colspan="3" v-if="info.psn_type == '1360'">地方其他扩展人员</td>
59
+
60
+        <td colspan="3" v-if="info.psn_type == '14'">居民(未成年)</td>
61
+        <td colspan="3" v-if="info.psn_type == '1401'">新生儿</td>
62
+        <td colspan="3" v-if="info.psn_type == '1402'">学龄前儿童</td>
63
+        <td colspan="3" v-if="info.psn_type == '1403'">中小学生</td>
64
+        <td colspan="3" v-if="info.psn_type == '1404'">大学生</td>
65
+        <td colspan="3" v-if="info.psn_type == '1405'">未成年(未入学)</td>
66
+
67
+
68
+        <td colspan="3" v-if="info.psn_type == '15'">居民(成年)</td>
69
+        <td colspan="3" v-if="info.psn_type == '1501'">普通居民(成年)</td>
70
+        <td colspan="3" v-if="info.psn_type == '1560'">地方其他扩展身份</td>
71
+
72
+        <td colspan="3" v-if="info.psn_type == '16'">居民(老年)</td>
73
+
74
+
75
+
76
+      </tr>
77
+      <tr>
78
+        <td>单位名称</td>
79
+        <td colspan="5">{{info.emp_name}}</td>
80
+        <td width="80">联系电话</td>
81
+        <td width="110">{{info.patient.phone}}</td>
82
+        <td width="80">身份证号</td>
83
+        <td colspan="3">{{info.certno}}</td>
84
+      </tr>
85
+      <tr>
86
+        <td>住院号</td>
87
+        <td>{{info.number}}</td>
88
+        <td>科别</td>
89
+        <td width="100"></td>
90
+        <td>床号</td>
91
+        <td></td>
92
+        <td>入院日期</td>
93
+        <td>{{info.begndate}}</td>
94
+        <td>出院日期</td>
95
+        <td width="100">{{info.enddate}}</td>
96
+        <td>住院天数</td>
97
+        <td>{{getDay(info.begndate,info.enddate)}}</td>
98
+
99
+      </tr>
100
+      <tr>
101
+        <td>险种</td>
102
+        <td colspan="2" v-if="info.insutype == '310'">职工基本医疗保险</td>
103
+        <td colspan="2" v-if="info.insutype == '320'">公务员医疗补助</td>
104
+        <td colspan="2" v-if="info.insutype == '330'">大额医疗费用补助</td>
105
+        <td colspan="2" v-if="info.insutype == '340'">离休人员医疗保障</td>
106
+        <td colspan="2" v-if="info.insutype == '390'">城乡居民基本医疗保险</td>
107
+        <td colspan="2" v-if="info.insutype == '392'">城乡居民大病医疗保险</td>
108
+        <td colspan="2" v-if="info.insutype == '510'">生育保险</td>
109
+        <td>入院第一诊断</td>
110
+        <td colspan="3">{{info.diagnosis}}</td>
111
+        <td>出院第一诊断</td>
112
+        <td colspan="4">{{info.diagnosis}}</td>
113
+
114
+
115
+      </tr>
116
+      <tr>
117
+        <td>业务类别</td>
118
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '11'">普通门诊</td>
119
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '12'">门诊挂号</td>
120
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '13'">急诊</td>
121
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '14'">门诊慢性病</td>
122
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '15'">门诊统筹</td>
123
+        <!--        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '16'">门诊慢性病</td>-->
124
+        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '21'">普通住院</td>
125
+
126
+        <td>结算时间</td>
127
+        <td colspan="5" style="text-align:left;padding-left:10px;">{{info.setl_time.split(' ')[0]}}</td>
128
+      </tr>
129
+      <tr>
130
+        <td colspan="12" style="text-align:left;padding-left:10px;">
131
+          本次就医:总费用{{info.medfee_sumamt}}元,基金支付{{info.fund_pay_sumamt}}元,个人支付{{info.psn_pay}}元。
132
+          (起付线 {{info.act_pay_dedc}}元, 先自付 {{info.preselfpay_amt}}元, 段内自付 {{(info.psn_pay - info.preselfpay_amt).toFixed(2)}} )
133
+
134
+        </td>
135
+      </tr>
136
+      <tr>
137
+        <td>费用名称</td>
138
+        <td colspan="2">总费用</td>
139
+        <td>自费</td>
140
+        <td colspan="2">部分项目自付</td>
141
+        <td>费用名称</td>
142
+        <td colspan="2">总费用</td>
143
+        <td>自费</td>
144
+        <td colspan="2">部分项目自付</td>
145
+      </tr>
146
+      <tr>
147
+        <td>床位费</td>
148
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_total}}</td>
149
+        <td style="text-align:right;padding-right:10px;">{{info.bed_cost_self_total}}</td>
150
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_part_self_total}}</td>
151
+        <td>西成药</td>
152
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_total}}</td>
153
+        <td style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_self_total}}</td>
154
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_part_self_total}}</td>
155
+      </tr>
156
+      <tr>
157
+        <td>中药费</td>
158
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
159
+        <td style="text-align:right;padding-right:10px;">0</td>
160
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
161
+        <td>中成药</td>
162
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_total}}
163
+        </td>
164
+        <td style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_self_total}}</td>
165
+        <td colspan="2" style="text-align:right;padding-right:10px;">
166
+          {{info.chinese_traditional_medicine_cost_part_self_total}}
167
+        </td>
168
+      </tr>
169
+      <tr>
170
+        <td>中草药</td>
171
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
172
+        <td style="text-align:right;padding-right:10px;">0</td>
173
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
174
+        <td>检查费</td>
175
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_total}}</td>
176
+        <td style="text-align:right;padding-right:10px;">{{info.check_cost_self_total}}</td>
177
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_part_self_total}}</td>
178
+      </tr>
179
+      <tr>
180
+        <td>治疗费</td>
181
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_total}}</td>
182
+        <td style="text-align:right;padding-right:10px;">{{info.treat_cost_self_total}}</td>
183
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_part_self_total}}</td>
184
+        <td>放射费</td>
185
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
186
+        <td style="text-align:right;padding-right:10px;">0</td>
187
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
188
+      </tr>
189
+      <tr>
190
+        <td>手术费</td>
191
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_total}}</td>
192
+        <td style="text-align:right;padding-right:10px;">{{info.operation_cost_self_total}}</td>
193
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_part_self_total}}</td>
194
+        <td>化验费</td>
195
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_total}}</td>
196
+        <td style="text-align:right;padding-right:10px;">{{info.laboratory_cost_self_total}}</td>
197
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_part_self_total}}</td>
198
+      </tr>
199
+      <tr>
200
+        <td>输血费</td>
201
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
202
+        <td style="text-align:right;padding-right:10px;">0</td>
203
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
204
+        <td>输氧费</td>
205
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
206
+        <td style="text-align:right;padding-right:10px;">0</td>
207
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
208
+      </tr>
209
+      <tr>
210
+        <td>其他</td>
211
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_total}}</td>
212
+        <td style="text-align:right;padding-right:10px;">{{info.other_cost_self_total}}</td>
213
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_part_self_total}}</td>
214
+        <td>麻醉费</td>
215
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
216
+        <td style="text-align:right;padding-right:10px;">0</td>
217
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
218
+      </tr>
219
+      <tr>
220
+        <td>材料费</td>
221
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_total}}</td>
222
+        <td style="text-align:right;padding-right:10px;">{{info.material_cost_self_total}}</td>
223
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_part_self_total}}</td>
224
+        <td>特殊检查费</td>
225
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
226
+        <td style="text-align:right;padding-right:10px;">0</td>
227
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
228
+      </tr>
229
+      <tr>
230
+        <td>特殊治疗费</td>
231
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
232
+        <td style="text-align:right;padding-right:10px;">0</td>
233
+        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
234
+        <td style="text-align:right;padding-right:10px;"></td>
235
+        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
236
+        <td style="text-align:right;padding-right:10px;"></td>
237
+        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
238
+      </tr>
239
+      <tr>
240
+        <td>合计</td>
241
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_total) +
242
+          parseFloat(info.operation_cost_total) + parseFloat(info.other_cost_total) +
243
+          parseFloat(info.material_cost_total) + parseFloat(info.western_medicine_cost_total) +
244
+          parseFloat(info.chinese_traditional_medicine_cost_total) + parseFloat(info.check_cost_total) +
245
+          parseFloat(info.laboratory_cost_total) + parseFloat(info.treat_cost_total)).toFixed(2) }}
246
+        </td>
247
+        <td style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_self_total )+
248
+          parseFloat(info.operation_cost_self_total) + parseFloat(info.other_cost_self_total) +
249
+          parseFloat(info.material_cost_self_total) + parseFloat(info.western_medicine_cost_self_total) +
250
+          parseFloat(info.chinese_traditional_medicine_cost_self_total) + parseFloat(info.check_cost_self_total) +
251
+          parseFloat(info.laboratory_cost_self_total) + parseFloat(info.treat_cost_self_total)).toFixed(2)}}
252
+        </td>
253
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_part_self_total) +
254
+          parseFloat(info.operation_cost_part_self_total) + parseFloat(info.other_cost_part_self_total) +
255
+          parseFloat(info.material_cost_part_self_total) + parseFloat(info.western_medicine_cost_part_self_total) +
256
+          parseFloat(info.chinese_traditional_medicine_cost_part_self_total) +
257
+          parseFloat(info.check_cost_part_self_total) + parseFloat(info.laboratory_cost_part_self_total) +
258
+          parseFloat(info.treat_cost_part_self_total)).toFixed(2)}}
259
+        </td>
260
+        <td style="text-align:right;padding-right:10px;"></td>
261
+        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
262
+        <td style="text-align:right;padding-right:10px;"></td>
263
+        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
264
+      </tr>
265
+      <tr>
266
+        <td colspan="3" style="text-align:left;padding-left:10px;">基本医疗保险统筹基金支付</td>
267
+        <td colspan="3">{{info.hifp_pay}}</td>
268
+        <td colspan="3" style="text-align:left;padding-left:10px;">大额基金支付</td>
269
+        <td colspan="3">{{info.hifob_pay}}</td>
270
+      </tr>
271
+      <tr>
272
+        <td colspan="3" style="text-align:left;padding-left:10px;">大病基金支付</td>
273
+        <td colspan="3">{{info.hifmi_pay}}</td>
274
+        <td colspan="3" style="text-align:left;padding-left:10px;">补充保险基金支付</td>
275
+        <td colspan="3">{{info.hifes_pay}}</td>
276
+      </tr>
277
+      <tr>
278
+        <td colspan="3" style="text-align:left;padding-left:10px;">医疗救助基金支付</td>
279
+        <td colspan="3">{{info.maf_pay}}</td>
280
+        <td colspan="3" style="text-align:left;padding-left:10px;">公务员基金支付</td>
281
+        <td colspan="3">{{info.cvlserv_pay}}</td>
282
+      </tr>
283
+
284
+      <tr>
285
+        <td colspan="3" style="text-align:left;padding-left:10px;">其他基金支付</td>
286
+        <td colspan="3">{{info.oth_pay}}</td>
287
+        <td colspan="3" style="text-align:left;padding-left:10px;">个人账户支付</td>
288
+        <td colspan="3">{{info.acct_pay}}</td>
289
+      </tr>
290
+      <tr>
291
+        <td>收款人:</td>
292
+        <td colspan="2">{{info.charge_admin.user_name}}</td>
293
+        <td>审核人:</td>
294
+        <td colspan="2">{{info.p_admin.user_name}}</td>
295
+        <td>制单人:</td>
296
+        <td colspan="2">{{info.p_admin.user_name}}</td>
297
+        <td>打印日期</td>
298
+        <td colspan="2">{{getNowTime()}}</td>
299
+      </tr>
300
+      <tr>
301
+        <td colspan="12" style="text-align:left;padding-left:10px;line-height:20px;">
302
+          注: 1、部分项目自付金额是指基本医疗保险范围内的项目需参保人先按规定比例自付的金额。<br/>
303
+          &ensp;&ensp;&ensp;2、此表由医院打印。<br/>
304
+          &ensp;&ensp;&ensp;3、此表一式两份,医院、参保人各一份。
305
+        </td>
306
+      </tr>
307
+      <tr>
308
+        <td colspan="12" style="text-align:left;padding-left:10px;">
309
+          病人家属签字:
310
+        </td>
311
+      </tr>
312
+    </table>
313
+  </div>
314
+  </div>
315
+</template>
316
+<script>
317
+
318
+export default {
319
+  name: 'hospitalBatchPrint',
320
+  props: {
321
+    infos:{
322
+      type: Array,
323
+      default: function() {
324
+        return []
325
+      }
326
+    },
327
+    info: {
328
+      type: Object,
329
+      default: function() {
330
+        return {}
331
+      }
332
+    }, p_admin: {
333
+      type: Object,
334
+      default: function() {
335
+        return {}
358 336
       }
359
-    },methods:{
360
-      getDay(dateString1,dateString2){
361
-        var  startDate = Date.parse(dateString1);
362
-        var  endDate = Date.parse(dateString2);
363
-        if (startDate>endDate){
364
-          return 0;
365
-        }
366
-        if (startDate==endDate){
367
-          return 1;
368
-        }
369
-        var days=(endDate - startDate)/(1*24*60*60*1000);
370
-        return  days+1;
371
-  
337
+    }, charge_admin: {
338
+      type: Object,
339
+      default: function() {
340
+        return {}
341
+      },
342
+    },his: {
343
+      type: Object,
344
+      default: function() {
345
+        return {}
346
+      },
347
+    },his_record: {
348
+      type: Object,
349
+      default: function() {
350
+        return {}
372 351
       },
373
-      getNowTime: function () {
374
-        let dateTime;
375
-        let yy = new Date().getFullYear();
376
-        let mm = new Date().getMonth() + 1;
377
-        let dd = new Date().getDate();
378
-        // let hh = new Date().getHours();
379
-        // let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
380
-        //   :
381
-        //   new Date().getMinutes();
382
-        // let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
383
-        //   :
384
-        //   new Date().getSeconds();
385
-        dateTime = yy + '-' + mm + '-' + dd
386
-        return dateTime
352
+    },patient:{
353
+      type: Object,
354
+      default: function() {
355
+        return {}
387 356
       },
388
-  
357
+
389 358
     }
359
+  },methods:{
360
+    getDay(dateString1,dateString2){
361
+      var  startDate = Date.parse(dateString1);
362
+      var  endDate = Date.parse(dateString2);
363
+      if (startDate>endDate){
364
+        return 0;
365
+      }
366
+      if (startDate==endDate){
367
+        return 1;
368
+      }
369
+      var days=(endDate - startDate)/(1*24*60*60*1000);
370
+      return  days+1;
371
+
372
+    },
373
+    getNowTime: function () {
374
+      let dateTime;
375
+      let yy = new Date().getFullYear();
376
+      let mm = new Date().getMonth() + 1;
377
+      let dd = new Date().getDate();
378
+      // let hh = new Date().getHours();
379
+      // let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
380
+      //   :
381
+      //   new Date().getMinutes();
382
+      // let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
383
+      //   :
384
+      //   new Date().getSeconds();
385
+      dateTime = yy + '-' + mm + '-' + dd
386
+      return dateTime
387
+    },
388
+
390 389
   }
391
-  
392
-  
393
-  </script>
394
-  
395
-  
396
-  <style lang="scss" scoped>
397
-  .statement-print {
398
-    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
399
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
400
-    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
401
-    margin-bottom: 20px;
402
-    padding: 20px 10px;
403
-  }
404
-  
405
-  .statementTitle {
406
-    font-size: 28px;
407
-    text-align: center;
408
-    font-weight: bold;
409
-    margin-bottom: 10px;
410
-  }
411
-  
412
-  .statementTable {
413
-    width: 100%;
414
-    text-align: center;
415
-    border-collapse: collapse;
416
-    line-height: 40px;
417
-    font-size: 14px;
418
-    border-color: #000;
419
-  }
420
-  </style>
421
-  
390
+}
391
+
392
+
393
+</script>
394
+
395
+
396
+<style lang="scss" scoped>
397
+.statement-print {
398
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
399
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
400
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
401
+  margin-bottom: 20px;
402
+  padding: 20px 10px;
403
+}
404
+
405
+.statementTitle {
406
+  font-size: 28px;
407
+  text-align: center;
408
+  font-weight: bold;
409
+  margin-bottom: 10px;
410
+}
411
+
412
+.statementTable {
413
+  width: 100%;
414
+  text-align: center;
415
+  border-collapse: collapse;
416
+  line-height: 40px;
417
+  font-size: 14px;
418
+  border-color: #000;
419
+}
420
+</style>

+ 13 - 13
src/xt_pages/hospitalStation/components/chargeDialog.vue View File

@@ -317,13 +317,13 @@
317 317
             this.form.pay_price = this.tmp_pay
318 318
             return
319 319
           }
320
-          if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
321
-            // alert("押金不得大于自费金额")
322
-            this.$message.error("押金不得大于自费金额");
323
-            this.form.tmp_decimal = ""
324
-            this.form.pay_price = this.tmp_pay
325
-            return
326
-          }
320
+          // if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
321
+          //   // alert("押金不得大于自费金额")
322
+          //   this.$message.error("押金不得大于自费金额");
323
+          //   this.form.tmp_decimal = ""
324
+          //   this.form.pay_price = this.tmp_pay
325
+          //   return
326
+          // }
327 327
           // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
328 328
 
329 329
           this.form.pay_price = ((parseFloat(this.form.private_price) * 10000 - parseFloat(this.form.tmp_decimal) * 10000) / 10000).toFixed(2)
@@ -340,12 +340,12 @@
340 340
           } else {
341 341
             //储存临时付款
342 342
             this.tmp_pay = this.form.pay_price
343
-            if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
344
-              this.form.tmp_decimal = 0
345
-              // alert("押金不得大于自费金额")
346
-              this.$message.error("押金不得大于自费金额");
347
-              return
348
-            }
343
+            // if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
344
+            //   this.form.tmp_decimal = 0
345
+            //   // alert("押金不得大于自费金额")
346
+            //   this.$message.error("押金不得大于自费金额");
347
+            //   return
348
+            // }
349 349
             // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
350 350
             this.tmp_pay = this.form.pay_price
351 351
             this.form.pay_price = ((parseFloat(this.form.private_price) * 10000 - parseFloat(this.form.tmp_decimal) * 10000) / 10000).toFixed(2)

+ 9 - 8
src/xt_pages/hospitalStation/components/deskPrescription.vue View File

@@ -2442,7 +2442,7 @@ export default {
2442 2442
                     if(arr.length > 0){
2443 2443
                       let objInfo = {};
2444 2444
                       arr.forEach((item, index) => {
2445
-                    
2445
+
2446 2446
                       let { id } = item.id;
2447 2447
                       if (!objInfo[id]) {
2448 2448
                           objInfo[id] = {
@@ -2505,7 +2505,7 @@ export default {
2505 2505
                      if(arr_one.length > 0){
2506 2506
                       let objInfo = {};
2507 2507
                       arr_one.forEach((item, index) => {
2508
-                     
2508
+
2509 2509
                       let { id } = item.id;
2510 2510
                       if (!objInfo[id]) {
2511 2511
                           objInfo[id] = {
@@ -3158,14 +3158,14 @@ export default {
3158 3158
       }
3159 3159
 
3160 3160
       if (this.curStatus == 1 && this.rightTab == 2) {
3161
-        this.$message.error('处方是药品,无法添加项目')
3161
+        this.$message.error('处方是药品,无法添加项目')
3162 3162
         this.teamList = []
3163 3163
         this.$refs.tables.clearSelection()
3164 3164
         return
3165 3165
       }
3166 3166
 
3167 3167
       if (this.curStatus == 2 && this.rightTab == 1) {
3168
-        this.$message.error('处方是项目,无法添加药品')
3168
+        this.$message.error('处方是项目,无法添加药品')
3169 3169
         this.curDrugs = []
3170 3170
         this.tempDrugs = []
3171 3171
         this.$refs.multipleTable.clearSelection()
@@ -3295,10 +3295,10 @@ export default {
3295 3295
             for (let b = 0; b < temp2.length; b++) {
3296 3296
               let obj = {
3297 3297
                 id: 0,
3298
+                single_dose: temp2[b].single_dose.toString(),
3298 3299
                 project_id: temp2[b].id,
3299 3300
                 project_name: temp2[b].project_name,
3300 3301
                 statistical_classification: '',
3301
-                single_dose: temp2[b].single_dose.toString(),
3302 3302
                 delivery_way: temp2[b].delivery_way,
3303 3303
                 execution_frequency: temp2[b].execution_frequency,
3304 3304
                 number_days: temp2[b].number_days.toString(),
@@ -3313,6 +3313,7 @@ export default {
3313 3313
                 obj['project'] = temp2[b].project
3314 3314
                 obj['unit'] = temp2[b].project.unit
3315 3315
 
3316
+
3316 3317
               } else if (temp2[b].type == 3) {
3317 3318
                 obj['good_info'] = temp2[b].good_info
3318 3319
                 obj['unit'] = temp2[b].good_info.packing_unit
@@ -3451,7 +3452,7 @@ export default {
3451 3452
               cus_total: 1,
3452 3453
               price: good_info[i].packing_price,
3453 3454
               medical_code: good_info[i].medical_insurance_number,
3454
-              unit: this.getGoodUnit(good_info[i].good_unit),
3455
+              unit: good_info[i].packing_unit,
3455 3456
               type: 3,
3456 3457
               total: good_info[i].total,
3457 3458
               is_special_diseases: good_info[i].is_special_diseases,
@@ -3586,7 +3587,7 @@ export default {
3586 3587
                   id: project[i].project_id,
3587 3588
                   project_name: project[i].good_info.good_name,
3588 3589
                   statistical_classification: '',
3589
-                  single_dose: '',
3590
+                  single_dose: project[i].good_info.default_count,
3590 3591
                   delivery_way: '',
3591 3592
                   execution_frequency: '',
3592 3593
                   number_days: '',
@@ -3594,7 +3595,7 @@ export default {
3594 3595
                   price: project[i].good_info.retail_price,
3595 3596
                   remark: '',
3596 3597
                   medical_code: project[i].good_info.medical_insurance_number,
3597
-                  unit: project[i].good_info.unit,
3598
+                  unit: project[i].good_info.packing_unit,
3598 3599
                   type: project[i].type,
3599 3600
                   is_special_diseases: project[i].good_info.is_special_diseases,
3600 3601
                   team_id: team_id,

+ 45 - 3
src/xt_pages/hospitalStation/components/inquiriesDetail.vue View File

@@ -10,6 +10,10 @@
10 10
     <div style="position: absolute;right:20px;z-index:99">
11 11
       <el-button v-if="activeName == 'first'" @click="open(1)" type="primary">打印</el-button>
12 12
       <el-button v-if="activeName == 'second'" @click="open(2)" type="primary">打印</el-button>
13
+
14
+      <el-button @click="open(3)" type="primary">打印清单</el-button>
15
+      <el-button @click="open(4)" type="primary">打印汇总</el-button>
16
+
13 17
     </div>
14 18
     <el-tabs v-model="activeName">
15 19
 
@@ -113,6 +117,25 @@
113 117
       <print v-if="activeName == 'first'" :paramsObj='paramsObj' :showBtn='true'></print>
114 118
       <recordPrint v-if="activeName == 'second'" :patientid="patientid" :showBtn='true'></recordPrint>
115 119
     </el-dialog>
120
+
121
+    <div >
122
+      <el-dialog
123
+        class="centerDialog"
124
+        width="900px"
125
+        title="打印"
126
+        :visible.sync="listVisible"  append-to-body>
127
+        <hospital-list-print :paramsObj='paramsObjTwo'></hospital-list-print>
128
+      </el-dialog>
129
+    </div>
130
+    <div >
131
+      <el-dialog
132
+        class="centerDialog"
133
+        width="900px"
134
+        title="打印"
135
+        :visible.sync="allListVisible"  append-to-body>
136
+        <hospital-all-list-print :paramsObj='paramsObjTwo'></hospital-all-list-print>
137
+      </el-dialog>
138
+    </div>
116 139
   </el-dialog>
117 140
 </div>
118 141
 </template>
@@ -120,7 +143,6 @@
120 143
 
121 144
 
122 145
 <script>
123
-  import { getDictionaryDataConfig} from "@/utils/data";
124 146
   import { getHisPrescriptionInfo } from '@/api/his/his'
125 147
   import NewPrescriptionTable from './newPrescriptionTable'
126 148
   import { uParseTime } from '@/utils/tools'
@@ -128,14 +150,19 @@
128 150
   import moment from 'moment';
129 151
   import print from '../print'
130 152
   import recordPrint from '../recordPrint'
153
+  import HospitalListPrint from '../pastQuiriesPrint/hospitalListPrint.vue'
154
+  import HospitalAllListPrint from '../pastQuiriesPrint/hospitalAllListPrint.vue'
131 155
 
132 156
   export default {
133
-    components: { NewPrescriptionTable,print,recordPrint },
157
+    components: { HospitalAllListPrint, HospitalListPrint, NewPrescriptionTable,print,recordPrint },
134 158
     data() {
135 159
       return {
160
+        listVisible:false,
161
+        allListVisible:false,
136 162
         visible: false,
137 163
         activeName: 'first',
138 164
         curPrescriptions: {},
165
+        paramsObjTwo:{},
139 166
         prescriptions: [],
140 167
         record_date: '',
141 168
         editableTabsValue: '处方1',
@@ -188,11 +215,26 @@
188 215
            this.innerVisible = true
189 216
           //  this.$router.push("/outpatientDoctorStation/print?record="+record_date+"&prescription_id="+prescription_id+"&ids="+ids+"&patient_id="+this.patientInfo.id)
190 217
 
191
-        }else if(index == 2){
218
+        } else if(index == 2){
192 219
           var record_date = this.format(this.case_history.sick_date);
193 220
           this.patientid = this.patientInfo.id;
194 221
           this.innerVisible = true
195 222
           // this.$router.push("/outpatientDoctorStation/recordPrint?record="+record_date+"&patient_id="+this.case_history.patient_id)
223
+        }else if(index == 3){
224
+          // var record_date = this.format(this.order.record_date);
225
+          this.patientid = this.patientInfo.id;
226
+          this.paramsObjTwo = {
227
+            record_date:this.order.record_date,
228
+            patient_id:this.patientid
229
+          }
230
+          this.listVisible = true
231
+        }else if(index == 4){
232
+          this.patientid = this.patientInfo.id;
233
+          this.paramsObjTwo = {
234
+            record_date:this.order.record_date,
235
+            patient_id:this.patientid
236
+          }
237
+          this.allListVisible = true
196 238
         }
197 239
       },
198 240
       getTimes(time,temp) {

+ 419 - 0
src/xt_pages/hospitalStation/components/registerDialog9504.vue View File

@@ -104,6 +104,28 @@
104 104
             </el-form-item>
105 105
 
106 106
 
107
+          <el-form-item label="参保地:" prop="id_card_type">
108
+            <el-autocomplete
109
+              popper-class="my-autocomplete"
110
+              v-model="form.insuplc_admdvs"
111
+              :fetch-suggestions="querySearch"
112
+              placeholder="请输入内容"
113
+              @select="handleSelectTwo">
114
+              <i
115
+                class="el-icon-edit el-input__icon"
116
+                slot="suffix"
117
+                @click="handleIconClick">
118
+              </i>
119
+              <template slot-scope="{ item }">
120
+                <div class="name">{{ item.value }}</div>
121
+                <span class="addr">{{ item.address }}</span>
122
+              </template>
123
+            </el-autocomplete>
124
+          </el-form-item>
125
+
126
+
127
+
128
+
107 129
             <el-form-item label="读卡类型:" prop="id_card_type">
108 130
                 <el-select v-model="form.id_card_type" placeholder="请选择">
109 131
                     <el-option
@@ -212,6 +234,7 @@
212 234
           id: '',
213 235
           settlement_value: '',
214 236
           medical_insurance_card: '',
237
+          insuplc_admdvs:'',
215 238
           name: '',
216 239
           gender: '',
217 240
           certificates: '',
@@ -238,6 +261,384 @@
238 261
           value: 2,
239 262
           label: '身份证'
240 263
         }],
264
+        area:[
265
+          {id:110000,name:"北京市"},
266
+          {id:120000,name:"天津市"},
267
+          {id:130000,name:"河北省"},
268
+          {id:130100,name:"石家庄市"},
269
+          {id:130200,name:"唐山市"},
270
+          {id:130300,name:"秦皇岛市"},
271
+          {id:130400,name:"邯郸市"},
272
+          {id:130500,name:"邢台市"},
273
+          {id:130600,name:"保定市"},
274
+          {id:130700,name:"张家口市"},
275
+          {id:130800,name:"承德市"},
276
+          {id:130900,name:"沧州市"},
277
+          {id:131000,name:"廊坊市"},
278
+          {id:131100,name:"衡水市"},
279
+          {id:140000,name:"山西省"},
280
+          {id:140100,name:"太原市"},
281
+          {id:140200,name:"大同市"},
282
+          {id:140300,name:"阳泉市"},
283
+          {id:140400,name:"长治市"},
284
+          {id:140500,name:"晋城市"},
285
+          {id:140600,name:"朔州市"},
286
+          {id:140700,name:"晋中市"},
287
+          {id:140800,name:"运城市"},
288
+          {id:140900,name:"忻州市"},
289
+          {id:141000,name:"临汾市"},
290
+          {id:141100,name:"吕梁市"},
291
+          {id:150000,name:"内蒙古自治区"},
292
+          {id:150100,name:"呼和浩特市"},
293
+          {id:150200,name:"包头市"},
294
+          {id:150300,name:"乌海市"},
295
+          {id:150400,name:"赤峰市"},
296
+          {id:150500,name:"通辽市"},
297
+          {id:150600,name:"鄂尔多斯市"},
298
+          {id:150700,name:"呼伦贝尔市"},
299
+          {id:150800,name:"巴彦淖尔市"},
300
+          {id:150900,name:"乌兰察布市"},
301
+          {id:152200,name:"兴安盟"},
302
+          {id:152500,name:"锡林郭勒盟"},
303
+          {id:152900,name:"阿拉善盟"},
304
+          {id:210000,name:"辽宁省"},
305
+          {id:210100,name:"沈阳市"},
306
+          {id:210200,name:"大连市"},
307
+          {id:210300,name:"鞍山市"},
308
+          {id:210400,name:"抚顺市"},
309
+          {id:210500,name:"本溪市"},
310
+          {id:210600,name:"丹东市"},
311
+          {id:210700,name:"锦州市"},
312
+          {id:210800,name:"营口市"},
313
+          {id:210900,name:"阜新市"},
314
+          {id:211000,name:"辽阳市"},
315
+          {id:211100,name:"盘锦市"},
316
+          {id:211200,name:"铁岭市"},
317
+          {id:211300,name:"朝阳市"},
318
+          {id:211400,name:"葫芦岛市"},
319
+          {id:220000,name:"吉林省"},
320
+          {id:220100,name:"长春市"},
321
+          {id:220200,name:"吉林市"},
322
+          {id:220300,name:"四平市"},
323
+          {id:220400,name:"辽源市"},
324
+          {id:220500,name:"通化市"},
325
+          {id:220600,name:"白山市"},
326
+          {id:220700,name:"松原市"},
327
+          {id:220800,name:"白城市"},
328
+          {id:222400,name:"延边朝鲜族自治州"},
329
+          {id:230000,name:"黑龙江省"},
330
+          {id:230100,name:"哈尔滨市"},
331
+          {id:230200,name:"齐齐哈尔市"},
332
+          {id:230300,name:"鸡西市"},
333
+          {id:230400,name:"鹤岗市"},
334
+          {id:230500,name:"双鸭山市"},
335
+          {id:230600,name:"大庆市"},
336
+          {id:230700,name:"伊春市"},
337
+          {id:230800,name:"佳木斯市"},
338
+          {id:230900,name:"七台河市"},
339
+          {id:231000,name:"牡丹江市"},
340
+          {id:231100,name:"黑河市"},
341
+          {id:231200,name:"绥化市"},
342
+          {id:232700,name:"大兴安岭地区"},
343
+          {id:310000,name:"上海市"},
344
+          {id:320000,name:"江苏省"},
345
+          {id:320100,name:"南京市"},
346
+          {id:320200,name:"无锡市"},
347
+          {id:320300,name:"徐州市"},
348
+          {id:320400,name:"常州市"},
349
+          {id:320500,name:"苏州市"},
350
+          {id:320600,name:"南通市"},
351
+          {id:320700,name:"连云港市"},
352
+          {id:320800,name:"淮安市"},
353
+          {id:320900,name:"盐城市"},
354
+          {id:321000,name:"扬州市"},
355
+          {id:321100,name:"镇江市"},
356
+          {id:321200,name:"泰州市"},
357
+          {id:321300,name:"宿迁市"},
358
+          {id:330000,name:"浙江省"},
359
+          {id:330100,name:"杭州市"},
360
+          {id:330200,name:"宁波市"},
361
+          {id:330300,name:"温州市"},
362
+          {id:330400,name:"嘉兴市"},
363
+          {id:330500,name:"湖州市"},
364
+          {id:330600,name:"绍兴市"},
365
+          {id:330700,name:"金华市"},
366
+          {id:330800,name:"衢州市"},
367
+          {id:330900,name:"舟山市"},
368
+          {id:331000,name:"台州市"},
369
+          {id:331100,name:"丽水市"},
370
+          {id:340000,name:"安徽省"},
371
+          {id:340100,name:"合肥市"},
372
+          {id:340200,name:"芜湖市"},
373
+          {id:340300,name:"蚌埠市"},
374
+          {id:340400,name:"淮南市"},
375
+          {id:340500,name:"马鞍山市"},
376
+          {id:340600,name:"淮北市"},
377
+          {id:340700,name:"铜陵市"},
378
+          {id:340800,name:"安庆市"},
379
+          {id:341000,name:"黄山市"},
380
+          {id:341100,name:"滁州市"},
381
+          {id:341200,name:"阜阳市"},
382
+          {id:341300,name:"宿州市"},
383
+          {id:341500,name:"六安市"},
384
+          {id:341600,name:"亳州市"},
385
+          {id:341700,name:"池州市"},
386
+          {id:341800,name:"宣城市"},
387
+          {id:350000,name:"福建省"},
388
+          {id:350100,name:"福州市"},
389
+          {id:350200,name:"厦门市"},
390
+          {id:350300,name:"莆田市"},
391
+          {id:350400,name:"三明市"},
392
+          {id:350500,name:"泉州市"},
393
+          {id:350600,name:"漳州市"},
394
+          {id:350700,name:"南平市"},
395
+          {id:350800,name:"龙岩市"},
396
+          {id:350900,name:"宁德市"},
397
+          {id:360000,name:"江西省"},
398
+          {id:360100,name:"南昌市"},
399
+          {id:360200,name:"景德镇市"},
400
+          {id:360300,name:"萍乡市"},
401
+          {id:360400,name:"九江市"},
402
+          {id:360500,name:"新余市"},
403
+          {id:360600,name:"鹰潭市"},
404
+          {id:360700,name:"赣州市"},
405
+          {id:360800,name:"吉安市"},
406
+          {id:360900,name:"宜春市"},
407
+          {id:361000,name:"抚州市"},
408
+          {id:361100,name:"上饶市"},
409
+          {id:370000,name:"山东省"},
410
+          {id:370100,name:"济南市"},
411
+          {id:370200,name:"青岛市"},
412
+          {id:370300,name:"淄博市"},
413
+          {id:370400,name:"枣庄市"},
414
+          {id:370500,name:"东营市"},
415
+          {id:370600,name:"烟台市"},
416
+          {id:370700,name:"潍坊市"},
417
+          {id:370800,name:"济宁市"},
418
+          {id:370900,name:"泰安市"},
419
+          {id:371000,name:"威海市"},
420
+          {id:371100,name:"日照市"},
421
+          {id:371300,name:"临沂市"},
422
+          {id:371400,name:"德州市"},
423
+          {id:371500,name:"聊城市"},
424
+          {id:371600,name:"滨州市"},
425
+          {id:371700,name:"菏泽市"},
426
+          {id:410000,name:"河南省"},
427
+          {id:410100,name:"郑州市"},
428
+          {id:410200,name:"开封市"},
429
+          {id:410300,name:"洛阳市"},
430
+          {id:410400,name:"平顶山市"},
431
+          {id:410500,name:"安阳市"},
432
+          {id:410600,name:"鹤壁市"},
433
+          {id:410700,name:"新乡市"},
434
+          {id:410800,name:"焦作市"},
435
+          {id:410900,name:"濮阳市"},
436
+          {id:411000,name:"许昌市"},
437
+          {id:411100,name:"漯河市"},
438
+          {id:411200,name:"三门峡市"},
439
+          {id:411300,name:"南阳市"},
440
+          {id:411400,name:"商丘市"},
441
+          {id:411500,name:"信阳市"},
442
+          {id:411600,name:"周口市"},
443
+          {id:411700,name:"驻马店市"},
444
+          {id:420000,name:"湖北省"},
445
+          {id:420100,name:"武汉市"},
446
+          {id:420200,name:"黄石市"},
447
+          {id:420300,name:"十堰市"},
448
+          {id:420500,name:"宜昌市"},
449
+          {id:420600,name:"襄阳市"},
450
+          {id:420700,name:"鄂州市"},
451
+          {id:420800,name:"荆门市"},
452
+          {id:420900,name:"孝感市"},
453
+          {id:421000,name:"荆州市"},
454
+          {id:421100,name:"黄冈市"},
455
+          {id:421200,name:"咸宁市"},
456
+          {id:421300,name:"随州市"},
457
+          {id:422800,name:"恩施土家族苗族自治州"},
458
+          {id:430000,name:"湖南省"},
459
+          {id:430100,name:"长沙市"},
460
+          {id:430200,name:"株洲市"},
461
+          {id:430300,name:"湘潭市"},
462
+          {id:430400,name:"衡阳市"},
463
+          {id:430500,name:"邵阳市"},
464
+          {id:430600,name:"岳阳市"},
465
+          {id:430700,name:"常德市"},
466
+          {id:430800,name:"张家界市"},
467
+          {id:430900,name:"益阳市"},
468
+          {id:431000,name:"郴州市"},
469
+          {id:431100,name:"永州市"},
470
+          {id:431200,name:"怀化市"},
471
+          {id:431300,name:"娄底市"},
472
+          {id:433100,name:"湘西土家族苗族自治州"},
473
+          {id:440000,name:"广东省"},
474
+          {id:440100,name:"广州市"},
475
+          {id:440200,name:"韶关市"},
476
+          {id:440300,name:"深圳市"},
477
+          {id:440400,name:"珠海市"},
478
+          {id:440500,name:"汕头市"},
479
+          {id:440600,name:"佛山市"},
480
+          {id:440700,name:"江门市"},
481
+          {id:440800,name:"湛江市"},
482
+          {id:440900,name:"茂名市"},
483
+          {id:441200,name:"肇庆市"},
484
+          {id:441300,name:"惠州市"},
485
+          {id:441400,name:"梅州市"},
486
+          {id:441500,name:"汕尾市"},
487
+          {id:441600,name:"河源市"},
488
+          {id:441700,name:"阳江市"},
489
+          {id:441800,name:"清远市"},
490
+          {id:441900,name:"东莞市"},
491
+          {id:442000,name:"中山市"},
492
+          {id:445100,name:"潮州市"},
493
+          {id:445200,name:"揭阳市"},
494
+          {id:445300,name:"云浮市"},
495
+          {id:450000,name:"广西壮族自治区"},
496
+          {id:450100,name:"南宁市"},
497
+          {id:450200,name:"柳州市"},
498
+          {id:450300,name:"桂林市"},
499
+          {id:450400,name:"梧州市"},
500
+          {id:450500,name:"北海市"},
501
+          {id:450600,name:"防城港市"},
502
+          {id:450700,name:"钦州市"},
503
+          {id:450800,name:"贵港市"},
504
+          {id:450900,name:"玉林市"},
505
+          {id:451000,name:"百色市"},
506
+          {id:451100,name:"贺州市"},
507
+          {id:451200,name:"河池市"},
508
+          {id:451300,name:"来宾市"},
509
+          {id:451400,name:"崇左市"},
510
+          {id:460000,name:"海南省"},
511
+          {id:460100,name:"海口市"},
512
+          {id:460200,name:"三亚市"},
513
+          {id:460300,name:"三沙市"},
514
+          {id:460400,name:"儋州市"},
515
+          {id:500000,name:"重庆市"},
516
+          {id:510000,name:"四川省"},
517
+          {id:510100,name:"成都市"},
518
+          {id:510300,name:"自贡市"},
519
+          {id:510400,name:"攀枝花市"},
520
+          {id:510500,name:"泸州市"},
521
+          {id:510600,name:"德阳市"},
522
+          {id:510700,name:"绵阳市"},
523
+          {id:510800,name:"广元市"},
524
+          {id:510900,name:"遂宁市"},
525
+          {id:511000,name:"内江市"},
526
+          {id:511100,name:"乐山市"},
527
+          {id:511300,name:"南充市"},
528
+          {id:511400,name:"眉山市"},
529
+          {id:511500,name:"宜宾市"},
530
+          {id:511600,name:"广安市"},
531
+          {id:511700,name:"达州市"},
532
+          {id:511800,name:"雅安市"},
533
+          {id:511900,name:"巴中市"},
534
+          {id:512000,name:"资阳市"},
535
+          {id:513200,name:"阿坝藏族羌族自治州"},
536
+          {id:513300,name:"甘孜藏族自治州"},
537
+          {id:513400,name:"凉山彝族自治州"},
538
+          {id:520000,name:"贵州省"},
539
+          {id:520100,name:"贵阳市"},
540
+          {id:520200,name:"六盘水市"},
541
+          {id:520300,name:"遵义市"},
542
+          {id:520400,name:"安顺市"},
543
+          {id:520500,name:"毕节市"},
544
+          {id:520600,name:"铜仁市"},
545
+          {id:522300,name:"黔西南布依族苗族自治州"},
546
+          {id:522600,name:"黔东南苗族侗族自治州"},
547
+          {id:522700,name:"黔南布依族苗族自治州"},
548
+          {id:530000,name:"云南省"},
549
+          {id:530100,name:"昆明市"},
550
+          {id:530300,name:"曲靖市"},
551
+          {id:530400,name:"玉溪市"},
552
+          {id:530500,name:"保山市"},
553
+          {id:530600,name:"昭通市"},
554
+          {id:530700,name:"丽江市"},
555
+          {id:530800,name:"普洱市"},
556
+          {id:530900,name:"临沧市"},
557
+          {id:532300,name:"楚雄彝族自治州"},
558
+          {id:532500,name:"红河哈尼族彝族自治州"},
559
+          {id:532600,name:"文山壮族苗族自治州"},
560
+          {id:532800,name:"西双版纳傣族自治州"},
561
+          {id:532900,name:"大理白族自治州"},
562
+          {id:533100,name:"德宏傣族景颇族自治州"},
563
+          {id:533300,name:"怒江傈僳族自治州"},
564
+          {id:533400,name:"迪庆藏族自治州"},
565
+          {id:540000,name:"西藏自治区"},
566
+          {id:540100,name:"拉萨市"},
567
+          {id:540200,name:"日喀则市"},
568
+          {id:540300,name:"昌都市"},
569
+          {id:540400,name:"林芝市"},
570
+          {id:540500,name:"山南市"},
571
+          {id:540600,name:"那曲市"},
572
+          {id:542500,name:"阿里地区"},
573
+          {id:610000,name:"陕西省"},
574
+          {id:610100,name:"西安市"},
575
+          {id:610200,name:"铜川市"},
576
+          {id:610300,name:"宝鸡市"},
577
+          {id:610400,name:"咸阳市"},
578
+          {id:610500,name:"渭南市"},
579
+          {id:610600,name:"延安市"},
580
+          {id:610700,name:"汉中市"},
581
+          {id:610800,name:"榆林市"},
582
+          {id:610900,name:"安康市"},
583
+          {id:611000,name:"商洛市"},
584
+          {id:620000,name:"甘肃省"},
585
+          {id:620100,name:"兰州市"},
586
+          {id:620200,name:"嘉峪关市"},
587
+          {id:620300,name:"金昌市"},
588
+          {id:620400,name:"白银市"},
589
+          {id:620500,name:"天水市"},
590
+          {id:620600,name:"武威市"},
591
+          {id:620700,name:"张掖市"},
592
+          {id:620800,name:"平凉市"},
593
+          {id:620900,name:"酒泉市"},
594
+          {id:621000,name:"庆阳市"},
595
+          {id:621100,name:"定西市"},
596
+          {id:621200,name:"陇南市"},
597
+          {id:622900,name:"临夏回族自治州"},
598
+          {id:623000,name:"甘南藏族自治州"},
599
+          {id:630000,name:"青海省"},
600
+          {id:630100,name:"西宁市"},
601
+          {id:630200,name:"海东市"},
602
+          {id:632200,name:"海北藏族自治州"},
603
+          {id:632300,name:"黄南藏族自治州"},
604
+          {id:632500,name:"海南藏族自治州"},
605
+          {id:632600,name:"果洛藏族自治州"},
606
+          {id:632700,name:"玉树藏族自治州"},
607
+          {id:632800,name:"海西蒙古族藏族自治州"},
608
+          {id:640000,name:"宁夏回族自治区"},
609
+          {id:640100,name:"银川市"},
610
+          {id:640200,name:"石嘴山市"},
611
+          {id:640300,name:"吴忠市"},
612
+          {id:640400,name:"固原市"},
613
+          {id:640500,name:"中卫市"},
614
+          {id:650000,name:"新疆维吾尔自治区"},
615
+          {id:650100,name:"乌鲁木齐市"},
616
+          {id:650200,name:"克拉玛依市"},
617
+          {id:650400,name:"吐鲁番市"},
618
+          {id:650500,name:"哈密市"},
619
+          {id:652300,name:"昌吉回族自治州"},
620
+          {id:652700,name:"博尔塔拉蒙古自治州"},
621
+          {id:652800,name:"巴音郭楞蒙古自治州"},
622
+          {id:652900,name:"阿克苏地区"},
623
+          {id:653000,name:"克孜勒苏柯尔克孜自治州"},
624
+          {id:653100,name:"喀什地区"},
625
+          {id:653200,name:"和田地区"},
626
+          {id:654000,name:"伊犁哈萨克自治州"},
627
+          {id:654200,name:"塔城地区"},
628
+          {id:654300,name:"阿勒泰地区"},
629
+          {id:659001,name:"石河子市"},
630
+          {id:659002,name:"阿拉尔市"},
631
+          {id:659003,name:"图木舒克市"},
632
+          {id:659004,name:"五家渠市"},
633
+          {id:659005,name:"北屯市"},
634
+          {id:659006,name:"铁门关市"},
635
+          {id:659007,name:"双河市"},
636
+          {id:659008,name:"可克达拉市"},
637
+          {id:659009,name:"昆玉市"},
638
+          {id:710000,name:"台湾省"},
639
+          {id:810000,name:"香港特别行政区"},
640
+          {id:820000,name:"澳门特别行政区"}
641
+        ],
241 642
         settlement: [
242 643
           {value: 1, label: '医保'},
243 644
           {value: 2, label: '自费'},
@@ -381,6 +782,24 @@
381 782
       diagnoses: Array,
382 783
     },
383 784
     methods: {
785
+      handleIconClick(){
786
+
787
+
788
+      },
789
+      handleSelectTwo(){
790
+
791
+
792
+      },  createFilter(queryString) {
793
+        return (restaurant) => {
794
+          return (restaurant.name.indexOf(queryString) === 0 || restaurant.id.indexOf(queryString) === 0);
795
+        };
796
+      },
797
+      querySearch(queryString, cb) {
798
+        var restaurants = this.area;
799
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
800
+        // 调用 callback 返回建议列表的数据
801
+        cb(results);
802
+      },
384 803
       changeDoctor() {
385 804
         for (let i = 0; i < this.doctors.length; i++) {
386 805
           if (this.doctors[i].admin_user_id == this.form.doctor) {

+ 50 - 151
src/xt_pages/hospitalStation/hospitalBatchStatementPrint.vue View File

@@ -44,7 +44,7 @@ export default {
44 44
       patient_id: 0,
45 45
       prescription_id: 0,
46 46
       ids: '',
47
-      info: {},
47
+      info: null,
48 48
       org_id: '',
49 49
       list:[],
50 50
       infos:[],
@@ -193,159 +193,58 @@ export default {
193 193
       })
194 194
         .then(function(response) {
195 195
           if (response.data.state == 0) {
196
-            that.$message.error(response.data.msg)
196
+            this.$message.error(response.data.msg)
197 197
             return false
198 198
           } else {
199 199
             let infos = []
200
-            for(var i = 0; i < response.data.data.infos.length; i++){
201
-              console.log("~~~~~~~-----")
202
-              var subInfo = response.data.data.infos[i]
203
-              var temp_info = {}
204
-              console.log(infos)
205
-              console.log("11111")
206
-              console.log(infos.patient)
207
-              console.log(that.info)
208
-              temp_info =  subInfo.info
209
-              temp_info['patient'] = subInfo.patient
210
-              console.log("22222")
211
-
212
-              temp_info['diagnosis'] = subInfo.diagnosis
213
-              console.log("333333")
214
-
215
-              temp_info['p_admin'] = subInfo.printor_admin
216
-              console.log("4444444")
217
-
218
-              temp_info['charge_admin'] = subInfo.charge_admin
219
-              console.log("5555555")
220
-
221
-              temp_info['fixmedins_name'] = subInfo.org_name
222
-              console.log("6666666")
223
-
224
-              temp_info['fixmedins_code'] = subInfo.org_code
225
-              console.log("7777777")
226
-
227
-              temp_info['order'] = subInfo.order
228
-              console.log("8888888")
229
-
230
-              temp_info['date'] = subInfo.date
231
-              console.log("9999999")
232
-
233
-              temp_info['number'] = subInfo.number
234
-              console.log("9999999")
235
-
236
-              temp_info['order_infos'] = subInfo.order_infos
237
-              console.log("9999999")
238
-
239
-              temp_info['diagnosis'] = subInfo.diagnosis
240
-              console.log("9999999")
241
-
242
-              temp_info['dia_config'] = subInfo.dia_config
243
-              console.log("9999999")
244
-
245
-              temp_info['doctor_info'] = subInfo.doctor_info
246
-              console.log("9999999")
247
-
248
-              temp_info['bed_cost_total'] = subInfo.bedCostTotal
249
-              console.log("9999999")
250
-
251
-              temp_info['bed_cost_self_total'] = subInfo.bedCostSelfTotal
252
-              console.log("9999999")
253
-
254
-              temp_info['bed_cost_part_self_total'] = subInfo.bedCostPartSelfTotal
255
-              console.log("9999999")
256
-
257
-              temp_info['operation_cost_total'] = subInfo.operationCostTotal
258
-              console.log("9999999")
259
-
260
-              temp_info['operation_cost_self_total'] = subInfo.operationCostSelfTotal
261
-              console.log("9999999")
262
-
263
-              temp_info['operation_cost_part_self_total'] = subInfo.operationCostPartSelfTotal
264
-              console.log("9999999")
265
-
266
-              temp_info['other_cost_total'] = subInfo.otherCostTotal
267
-              console.log("9999999")
268
-
269
-              temp_info['other_cost_self_total'] = subInfo.otherCostSelfTotal
270
-              console.log("9999999")
271
-
272
-              temp_info['other_cost_part_self_total'] = subInfo.otherCostPartSelfTotal
273
-              console.log("9999999")
274
-
275
-              temp_info['material_cost_total'] = subInfo.materialCostTotal
276
-              console.log("9999999")
277
-
278
-              temp_info['material_cost_self_total'] = subInfo.materialCostSelfTotal
279
-              console.log("9999999")
280
-
281
-              temp_info['material_cost_part_self_total'] = subInfo.materialCostPartSelfTotal
282
-              console.log("9999999")
283
-
284
-              temp_info['western_medicine_cost_total'] = subInfo.westernMedicineCostTotal
285
-              console.log("9999999")
286
-
287
-              temp_info['western_medicine_cost_self_total'] = subInfo.westernMedicineCostSelfTotal
288
-              console.log("9999999")
289
-
290
-              temp_info['western_medicine_cost_part_self_total'] = subInfo.westernMedicineCostPartSelfTotal
291
-              console.log("9999999")
292
-
293
-              temp_info['chinese_traditional_medicine_cost_total'] = subInfo.chineseTraditionalMedicineCostTotal
294
-              console.log("9999999")
295
-
296
-              temp_info['chinese_traditional_medicine_cost_self_total'] = subInfo.chineseTraditionalMedicineCostSelfTotal
297
-              console.log("9999999")
298
-
299
-              temp_info['chinese_traditional_medicine_cost_part_self_total'] = subInfo.chineseTraditionalMedicineCostPartSelfTotal
300
-              console.log("9999999")
301
-
302
-              temp_info['check_cost_total'] = subInfo.checkCostTotal
303
-              console.log("9999999")
304
-
305
-              temp_info['check_cost_self_total'] = subInfo.checkCostSelfTotal
306
-              console.log("9999999")
307
-
308
-              temp_info['check_cost_part_self_total'] = subInfo.checkCostPartSelfTotal
309
-              console.log("9999999")
310
-
311
-              temp_info['laboratory_cost_total'] = subInfo.laboratoryCostTotal
312
-              console.log("9999999")
313
-
314
-              temp_info['laboratory_cost_self_total'] = subInfo.laboratoryCostSelfTotal
315
-              console.log("9999999")
316
-
317
-              temp_info['laboratory_cost_part_self_total'] = subInfo.laboratoryCostPartSelfTotal
318
-              console.log("9999999")
319
-
320
-              temp_info['treat_cost_total'] = subInfo.treatCostTotal
321
-              console.log("9999999")
322
-
323
-              temp_info['treat_cost_self_total'] = subInfo.treatCostSelfTotal
324
-              console.log("9999999")
325
-
326
-              temp_info['treat_cost_part_self_total'] = subInfo.treatCostPartSelfTotal
327
-              console.log("9999999")
328
-
329
-              temp_info['date'] = subInfo.date
330
-              console.log("9999999")
331
-
332
-              temp_info['number'] = subInfo.number
333
-              console.log("9999999")
334
-
335
-              temp_info['order_infos'] = subInfo.order_infos
336
-              console.log("9999999")
337
-
338
-              temp_info['diagnosis'] = subInfo.diagnosis
339
-              console.log("9999999")
340
-
341
-              temp_info['his'] = subInfo.his_hospital
342
-              console.log("9999999")
343
-
344
-              infos.push(temp_info)
345
-              console.log("9999999")
346
-
347
-              console.log(infos)
348
-
200
+            for(var i  = 0; i < response.data.data.infos.length; i++){
201
+              var info = response.data.data.infos[i]
202
+              that.info['patient'] = info.patient
203
+              that.info['diagnosis'] = info.diagnosis
204
+              that.info['p_admin'] = info.printor_admin
205
+              that.info['charge_admin'] = info.charge_admin
206
+              that.info['fixmedins_name'] = info.org_name
207
+              that.info['fixmedins_code'] = info.org_code
208
+              that.info['order'] = info.order
209
+              that.info['date'] = info.date
210
+              that.info['number'] = info.number
211
+              that.info['order_infos'] = info.order_infos
212
+              that.info['diagnosis'] = info.diagnosis
213
+              that.info['dia_config'] = info.dia_config
214
+              that.info['doctor_info'] = info.doctor_info
215
+              that.info['bed_cost_total'] = info.bedCostTotal
216
+              that.info['bed_cost_self_total'] = info.bedCostSelfTotal
217
+              that.info['bed_cost_part_self_total'] = info.bedCostPartSelfTotal
218
+              that.info['operation_cost_total'] = info.operationCostTotal
219
+              that.info['operation_cost_self_total'] = info.operationCostSelfTotal
220
+              that.info['operation_cost_part_self_total'] = info.operationCostPartSelfTotal
221
+              that.info['other_cost_total'] = info.otherCostTotal
222
+              that.info['other_cost_self_total'] = info.otherCostSelfTotal
223
+              that.info['other_cost_part_self_total'] = info.otherCostPartSelfTotal
224
+              that.info['material_cost_total'] = info.materialCostTotal
225
+              that.info['material_cost_self_total'] = info.materialCostSelfTotal
226
+              that.info['material_cost_part_self_total'] = info.materialCostPartSelfTotal
227
+              that.info['western_medicine_cost_total'] = info.westernMedicineCostTotal
228
+              that.info['western_medicine_cost_self_total'] = info.westernMedicineCostSelfTotal
229
+              that.info['western_medicine_cost_part_self_total'] = info.westernMedicineCostPartSelfTotal
230
+              that.info['chinese_traditional_medicine_cost_total'] = info.chineseTraditionalMedicineCostTotal
231
+              that.info['chinese_traditional_medicine_cost_self_total'] = info.chineseTraditionalMedicineCostSelfTotal
232
+              that.info['chinese_traditional_medicine_cost_part_self_total'] = info.chineseTraditionalMedicineCostPartSelfTotal
233
+              that.info['check_cost_total'] = info.checkCostTotal
234
+              that.info['check_cost_self_total'] = info.checkCostSelfTotal
235
+              that.info['check_cost_part_self_total'] = info.checkCostPartSelfTotal
236
+              that.info['laboratory_cost_total'] = info.laboratoryCostTotal
237
+              that.info['laboratory_cost_self_total'] = info.laboratoryCostSelfTotal
238
+              that.info['laboratory_cost_part_self_total'] = info.laboratoryCostPartSelfTotal
239
+              that.info['treat_cost_total'] = info.treatCostTotal
240
+              that.info['treat_cost_self_total'] = info.treatCostSelfTotal
241
+              that.info['treat_cost_part_self_total'] = info.treatCostPartSelfTotal
242
+              that.info['date'] = info.date
243
+              that.info['number'] = info.number
244
+              that.info['order_infos'] = info.order_infos
245
+              that.info['diagnosis'] = info.diagnosis
246
+              that.info['his'] = info.his_hospital
247
+              infos.push(that.info)
349 248
             }
350 249
             that.infos = infos
351 250
             console.log(infos)

+ 2 - 0
src/xt_pages/hospitalStation/pastInquiries.vue View File

@@ -63,6 +63,8 @@
63 63
       </el-pagination>
64 64
       <inquiries-detail ref="inquiriesDetail"></inquiries-detail>
65 65
     </div>
66
+
67
+
66 68
   </div>
67 69
 </template>
68 70
 

+ 552 - 0
src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalAllListPrint.vue View File

@@ -0,0 +1,552 @@
1
+<template>
2
+  <div>
3
+    <template>
4
+      <el-button
5
+        style="position:fixed;right:25px;z-index:999"
6
+        :loading="loading"
7
+        size="small"
8
+        icon="el-icon-printer"
9
+        @click="printThisPage"
10
+        type="primary"
11
+      >打印
12
+      </el-button
13
+      >
14
+    </template>
15
+
16
+    <div class='dialysisPage' style="padding-top:40px;">
17
+<!--      <printOne :list="list" :patient="patient" :order="order" :admin="admin"></printOne>-->
18
+      <hospital-all-list-print-one :list="new_list" :patient="patient" :record="record" :admin="admin"></hospital-all-list-print-one>
19
+    </div>
20
+  </div>
21
+</template>
22
+
23
+<script>
24
+import { uParseTime } from '@/utils/tools'
25
+import HospitalAllListPrintOne from './hospitalAllListPrintOne.vue'
26
+import { getHospitalUnChargeSummary } from '../../../api/his/his'
27
+
28
+export default {
29
+  name: 'hospitalAllListPrint',
30
+  components: {
31
+    HospitalAllListPrintOne,
32
+  },
33
+  props: {
34
+    paramsObj: Object
35
+  },
36
+  data() {
37
+    return {
38
+      list: [],
39
+      new_list: [],
40
+
41
+      patient: {},
42
+      record: {},
43
+      admin: {},
44
+    }
45
+  },
46
+
47
+  created() {
48
+    this.getInfo(this.paramsObj.patient_id, this.paramsObj.record_date)
49
+
50
+  },
51
+  methods: {
52
+    getTimes(time) {
53
+      return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
54
+    },
55
+    getInfo(patient_id, record_date) {
56
+      let params = {
57
+        patient_id: patient_id,
58
+        record_date: record_date,
59
+        admin_user_id: this.$store.getters.xt_user.user.id,
60
+        p_type: 1,
61
+      };
62
+      getHospitalUnChargeSummary(params).then(response => {
63
+        if (response.data.state == 0) {
64
+          this.$message.error(response.data.msg);
65
+          return false
66
+        } else {
67
+          this.record = response.data.data.record;
68
+          this.patient = response.data.data.xt_info;
69
+          this.admin = response.data.data.admin_info;
70
+          this.list = []
71
+          this.new_list = []
72
+          for (let i = 0; i < response.data.data.prescription.length; i++) {
73
+            if (response.data.data.prescription[i].type == 1) {
74
+              var infos = response.data.data.prescription[i]
75
+              for (let b = 0; b < infos.advices.length; b++) {
76
+                let obj = {
77
+                  drug_id: infos.advices[b].drug_id,
78
+                  project_id: 0,
79
+                  med_chrgitm_type: this.getType(1),
80
+                  price: parseFloat(infos.advices[b].price),
81
+                  count: parseFloat(infos.advices[b].prescribing_number),
82
+                  p_time: this.getTimes(infos.advices[b].created_time),
83
+                  name: infos.advices[b].advice_name,
84
+                  spec: infos.advices[b].drug.drug_spec,
85
+                  unit: infos.advices[b].prescribing_number_unit,
86
+                  feedetl_sn: infos.advices[b].feedetl_sn,
87
+                  medicine_insurance_kind:this.getMedicineInsuranceKind(infos.advices[b].drug.medical_insurance_level)
88
+                }
89
+                this.list.push(obj)
90
+              }
91
+            }
92
+          }
93
+          for (let i = 0; i < response.data.data.prescription.length; i++) {
94
+            if (response.data.data.prescription[i].type == 2) {
95
+              var infos = response.data.data.prescription[i]
96
+              for (let b = 0; b < infos.project.length; b++) {
97
+                if (infos.project[b].type == 2) {
98
+                  let obj = {
99
+                    drug_id: 0,
100
+                    project_id: infos.project[b].project_id,
101
+                    med_chrgitm_type: this.getType(infos.project[b].project.cost_classify),
102
+                    price: parseFloat(infos.project[b].price),
103
+                    count: parseFloat(infos.project[b].count),
104
+                    p_time: this.getTimes(infos.project[b].ctime),
105
+                    name: infos.project[b].project.project_name,
106
+                    spec: "",
107
+                    unit: infos.project[b].project.unit,
108
+                    feedetl_sn: infos.project[b].feedetl_sn,
109
+                    medicine_insurance_kind:this.getMedicineInsuranceKind(infos.project[b].project.medical_coverage)
110
+
111
+                  }
112
+                  this.list.push(obj)
113
+                } else {
114
+                  let obj = {
115
+                    drug_id: 0,
116
+                    med_chrgitm_type: this.getType(5),
117
+                    project_id: infos.project[b].project_id,
118
+                    price: parseFloat(infos.project[b].price),
119
+                    count: parseFloat(infos.project[b].count),
120
+                    p_time: this.getTimes(infos.project[b].ctime),
121
+                    name: infos.project[b].good_info.good_name,
122
+                    spec: infos.project[b].good_info.specification_name,
123
+                    unit: infos.project[b].good_info.packing_unit,
124
+                    feedetl_sn: infos.project[b].feedetl_sn,
125
+                    medicine_insurance_kind:this.getMedicineInsuranceKind(infos.project[b].good_info.medical_insurance_level)
126
+
127
+                    // medicine_insurance_kind:this.getMedicineInsuranceKind(infos.advices[b].drug.medical_coverage)
128
+
129
+
130
+                  }
131
+                  this.list.push(obj)
132
+                }
133
+              }
134
+            }
135
+
136
+          }
137
+
138
+          //获取所有项目类型进行去重
139
+          let med_chrgitm_types = [];
140
+          for (let i = 0; i < this.list.length; i++) {
141
+            med_chrgitm_types.push(this.list[i].med_chrgitm_type)
142
+          }
143
+          const obj = {};
144
+          med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
145
+            obj[next] ? '' : obj[next] = true && cur.push(next);
146
+            return cur
147
+          }, []); // 设置cur默认类型为数组,并且初始值为空的数组
148
+
149
+          let tempOrderInfo = [];
150
+          for (let i = 0; i < med_chrgitm_types.length; i++) {
151
+            let obj = {
152
+              total: 0,
153
+              details: []
154
+            };
155
+            let tempDetails = [];
156
+            for (let b = 0; b < this.list.length; b++) {
157
+              if (med_chrgitm_types[i] == this.list[b].med_chrgitm_type) {
158
+                tempDetails.push(this.list[b])
159
+              }
160
+            }
161
+
162
+            obj.details = this.setNewData(tempDetails);
163
+            // obj.total = this.getTotal(obj.details);
164
+            // obj.details.push({
165
+            //   // total: obj.total,
166
+            //   // is_total: 1,
167
+            // });
168
+            this.new_list = this.new_list.concat(obj.details)
169
+          }
170
+        }
171
+      })
172
+    },
173
+    getTotal: function(items) {
174
+      let total = 0;
175
+      for (let i = 0; i < items.length; i++) {
176
+        total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
177
+      }
178
+      return total.toFixed(2)
179
+    },
180
+    setNewData(details) {
181
+      let drug_ids = [];
182
+      let project_ids = [];
183
+
184
+      for (let i = 0; i < details.length; i++) {
185
+        if (details[i].drug_id > 0 && details[i].project_id == 0) { //药品
186
+          let obj = {
187
+            id: details[i].drug_id,
188
+            price: details[i].price
189
+          };
190
+          drug_ids.push(obj)
191
+        } else if (details[i].drug_id == 0 && details[i].project_id > 0) { //项目
192
+          let obj = {
193
+            id: details[i].project_id,
194
+            price: details[i].price
195
+          };
196
+          project_ids.push(obj)
197
+        }
198
+      }
199
+
200
+      let new_drug_ids = this.unique(drug_ids);
201
+      let new_project_ids = this.unique(project_ids);
202
+      let list = [];
203
+
204
+      console.log('ids');
205
+      console.log(new_drug_ids);
206
+      console.log(new_project_ids);
207
+      console.log('ids');
208
+
209
+      if (new_drug_ids.length > 0) {
210
+        for (let i = 0; i < new_drug_ids.length; i++) {
211
+          let obj = {};
212
+          let count = 0;
213
+          for (let a = 0; a < details.length; a++) {
214
+            if (new_drug_ids[i].id == details[a].drug_id && new_drug_ids[i].price == details[a].price) {
215
+              obj['name'] = details[a].name;
216
+              obj['spec'] = details[a].spec;
217
+              obj['unit'] = details[a].unit;
218
+              obj['medicine_insurance_kind'] = details[a].medicine_insurance_kind;
219
+
220
+              obj['med_chrgitm_type'] = details[a].med_chrgitm_type;
221
+              obj['price'] = parseFloat(details[a].price);
222
+              count = count + parseFloat(details[a].count)
223
+            }
224
+          }
225
+          obj['count'] = count;
226
+          list.push(obj)
227
+        }
228
+      }
229
+      console.log(list)
230
+
231
+      if (new_project_ids.length > 0) {
232
+        for (let i = 0; i < new_project_ids.length; i++) {
233
+          let obj = {}
234
+          let count = 0
235
+          for (let a = 0; a < details.length; a++) {
236
+            if (new_project_ids[i].id == details[a].project_id && new_project_ids[i].price == details[a].price) {
237
+              obj['name'] = details[a].name
238
+              obj['unit'] = details[a].unit
239
+              obj['spec'] = '1'
240
+              obj['med_chrgitm_type'] = (details[a].med_chrgitm_type)
241
+              obj['price'] = parseFloat(details[a].price)
242
+              count = count + parseFloat(details[a].count)
243
+            }
244
+          }
245
+          obj['count'] = count
246
+          list.push(obj)
247
+        }
248
+      }
249
+      console.log(list)
250
+
251
+      return list
252
+
253
+    },
254
+    unique(array) {
255
+      // res用来存储结果
256
+      var res = [];
257
+      for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
258
+        for (var j = 0, resLen = res.length; j < resLen; j++) {
259
+          if (array[i].id === res[j].id && array[i].price === res[j].price) {
260
+            break
261
+          }
262
+        }
263
+        // 如果array[i]是唯一的,那么执行完循环,j等于resLen
264
+        if (j === resLen) {
265
+          res.push(array[i])
266
+        }
267
+      }
268
+      return res
269
+    },
270
+    getMedicineInsuranceKind(type){
271
+      switch (type) {
272
+        case 1:
273
+          return '甲类';
274
+        case 2:
275
+          return '乙类';
276
+        case 3:
277
+          return '丙类';
278
+          break;
279
+      }
280
+
281
+    },
282
+    getType(med_chrgitm_type) {
283
+      switch (med_chrgitm_type) {
284
+        case 1:
285
+          return '西药费';
286
+        case 2:
287
+          return '治疗费';
288
+        case 3:
289
+          return '检验费';
290
+          break;
291
+        case 4:
292
+          return '心电图费';
293
+          break;
294
+        case 5:
295
+          return '耗材费';
296
+          break;
297
+        case 6:
298
+          return '护理费';
299
+          break;
300
+        case 7:
301
+          return '放射费';
302
+          break;
303
+        case 8:
304
+          return '检查费';
305
+          break;
306
+        case 9:
307
+          return '超声费';
308
+          break;
309
+        case 10:
310
+          return '麻醉费';
311
+          break;
312
+        case 11:
313
+          return '手术费';
314
+          break;
315
+        case 12:
316
+          return '其他费';
317
+          break;
318
+        case 13:
319
+          return '床位费';
320
+          break;
321
+        case 14:
322
+          return '化验费';
323
+          break;
324
+        case 15:
325
+          return '诊察费';
326
+          break;
327
+
328
+      }
329
+
330
+    },
331
+    printThisPage() {
332
+      const style =
333
+        '@media print {.allListTitle{font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.allListInfo{display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;} .allListTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;}.allListTable tr td {padding: 0 5px;}.tableBottom{font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne{margin-right: 40px;}}'
334
+      const style1 =
335
+        '@media print {.allListTitle{font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.allListInfo{display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;} .allListTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;} .allListTable tr td {padding: 0 5px;} .allListTable .allListTable_1{border: none;width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;} .allListTable_1 tr{page-break-inside:avoid;} .allListTable_1 tr td {padding: 0 5px;border: 1px solid #000;} .tableBottom{font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne{margin-right: 40px;}}'
336
+
337
+        printJS({
338
+          printable: 'allList',
339
+          type: 'html',
340
+          style: style1,
341
+          scanStyles: false
342
+        })
343
+      // if (this.org_template_info.template_id == 1) {
344
+      //   printJS({
345
+      //     printable: "dialysis-print-box",
346
+      //     type: "html",
347
+      //     style: style,
348
+      //     scanStyles: false
349
+      //   });
350
+      // }
351
+
352
+    },
353
+  },
354
+  watch: {
355
+    paramsObj: {//深度监听,可监听到对象、数组的变化
356
+      handler(val, oldVal) {
357
+        this.getInfo(val.patient_id, val.record_date)
358
+      },
359
+      deep: true
360
+    }
361
+  }
362
+}
363
+</script>
364
+
365
+<style>
366
+.dialysis-print-order {
367
+  width: 960px;
368
+  margin: 0 auto;
369
+}
370
+
371
+.dialysis-print-order .order-yy-name {
372
+  margin: auto;
373
+  text-align: center;
374
+  font-size: 20px;
375
+  letter-spacing: 5px;
376
+}
377
+
378
+.dialysis-print-order .order-title {
379
+  margin: auto;
380
+  font-weight: 600;
381
+  text-align: center;
382
+  font-size: 22px;
383
+  padding: 10px;
384
+}
385
+
386
+.dialysis-print-order .table-box {
387
+  width: 100%;
388
+  line-height: 23px;
389
+  font-size: 14px;
390
+}
391
+
392
+.dialysis-print-order .print-table {
393
+  width: 100%;
394
+  text-align: center;
395
+  border-collapse: collapse;
396
+  line-height: 40px;
397
+  font-size: 14px;
398
+  border-color: #000;
399
+}
400
+
401
+.dialysis-print-order .print-table-no {
402
+  width: 100%;
403
+  text-align: center;
404
+  border-collapse: collapse;
405
+  font-size: 14px;
406
+}
407
+
408
+.dialysis-print-order .under-line {
409
+  border-bottom: 1px solid #999;
410
+  width: 95%;
411
+  text-align: center;
412
+  margin-left: 2px;
413
+}
414
+
415
+.dialysis-print-order .title-box {
416
+  text-align: center;
417
+  font-size: 16px;
418
+}
419
+
420
+.dialysis-print-order .radio-lebel-box {
421
+  font-weight: 400;
422
+  cursor: pointer;
423
+}
424
+
425
+.dialysis-print-order .radio-no {
426
+  opacity: 0;
427
+  outline: none;
428
+  position: absolute;
429
+  margin: 0;
430
+  width: 0;
431
+  height: 0;
432
+  z-index: -1;
433
+}
434
+
435
+.dialysis-print-order .radio-inner {
436
+  white-space: nowrap;
437
+  cursor: pointer;
438
+  outline: none;
439
+  display: inline-block;
440
+  line-height: 1;
441
+  position: relative;
442
+  vertical-align: middle;
443
+}
444
+
445
+.dialysis-print-order .radio-fang {
446
+  display: inline-block;
447
+  position: relative;
448
+  border: 1px solid #000;
449
+  box-sizing: border-box;
450
+  width: 14px;
451
+  height: 14px;
452
+  background-color: #fff;
453
+  z-index: 1;
454
+  transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
455
+  background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
456
+}
457
+
458
+.dialysis-print-order .is-checked-radio::after {
459
+  content: "√";
460
+  font-size: 15px;
461
+}
462
+
463
+.dialysis-print-order .print-table-no tr td {
464
+  padding: 8px 5px;
465
+  line-height: 25px;
466
+}
467
+
468
+.dialysis-print-order .print-table tr td {
469
+  padding: 1px 1px;
470
+  /*line-height: 25px;*/
471
+}
472
+
473
+.es-img {
474
+  height: 30px;
475
+}
476
+
477
+.advice-name {
478
+  text-align: left;
479
+}
480
+
481
+.advice-children {
482
+  display: flex;
483
+}
484
+
485
+.title-box-pro {
486
+  border: 0 #fff;
487
+  line-height: 25px;
488
+  height: 25px;
489
+  text-align: left;
490
+  padding-left: 10px !important;
491
+}
492
+
493
+.title-box-pro-tr {
494
+  border: 0 #fff;
495
+}
496
+
497
+.text-align-left {
498
+  text-align: left !important;
499
+  padding-left: 10px !important;
500
+  font-size: 14px !important;
501
+  line-height: 25px;
502
+}
503
+
504
+.print-table-tr-new td {
505
+  line-height: 20px !important;
506
+}
507
+
508
+.border-top-solid {
509
+  border: solid 1px #000;
510
+}
511
+
512
+.print-template-two tr {
513
+  line-height: 30px;
514
+}
515
+
516
+.table-box1 {
517
+  border: 1px solid #000;
518
+  width: 100%;
519
+  line-height: 30px;
520
+  font-size: 14px;
521
+  border-collapse: collapse;
522
+}
523
+
524
+.table-box1 tr {
525
+  border-bottom: 1px solid #000;
526
+}
527
+</style>
528
+
529
+<style lang="scss">
530
+
531
+.newContainer {
532
+
533
+.dialysisPage::-webkit-scrollbar {
534
+  height: 15px;
535
+}
536
+
537
+.el-date-editor {
538
+
539
+.el-input__inner {
540
+  padding-right: 0px;
541
+}
542
+
543
+}
544
+.el-table td, .el-table th {
545
+  text-align: center;
546
+}
547
+
548
+}
549
+.newContainer::-webkit-scrollbar {
550
+  height: 15px !important;
551
+}
552
+</style>

+ 406 - 0
src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalAllListPrintOne.vue View File

@@ -0,0 +1,406 @@
1
+<template>
2
+  <div id="allList" class="allList-print">
3
+    <table
4
+      class="allListTable"
5
+      border="0"
6
+      cellspacing="0"
7
+      style="font-size: 14px"
8
+      align="center"
9
+    >
10
+      <THEAD
11
+        style="
12
+          display: table-header-group;
13
+          font-weight: bold;
14
+        "
15
+      >
16
+      <TR style="border-bottom: 1px solid">
17
+        <TD colspan="4" align="center" style="font-size: 20px">
18
+          {{ $store.getters.xt_user.org.org_name }}汇总清单
19
+        </TD>
20
+      </TR>
21
+      <TR>
22
+        <TD colspan="1">科别:门诊</TD>
23
+        <TD width="130">床号:</TD>
24
+        <TD>门诊号:{{ record.number }}</TD>
25
+        <TD>姓名:{{ patient.name }}</TD>
26
+      </TR>
27
+      <TR style="border-bottom: 1px solid">
28
+        <TD colspan="2"> 预交款:</TD>
29
+        <TD>总费用:{{ getTotal(list) }} </TD>
30
+        <TD
31
+        >门诊日期:{{
32
+            record.in_hosptial_time
33
+              ? record.in_hosptial_time.split(" ")[0]
34
+              : ""
35
+          }}</TD
36
+        >
37
+      </TR>
38
+      <TR>
39
+        <TD colspan="2">
40
+          西药:&nbsp;&nbsp;&nbsp;{{
41
+            getWesternMedicineCostTotal()
42
+              ? getWesternMedicineCostTotal()
43
+              : ""
44
+          }}</TD
45
+        >
46
+        <TD
47
+        >中成药:</TD>
48
+        <TD>中草药:</TD>
49
+      </TR>
50
+      <TR>
51
+        <TD colspan="2">
52
+          检查费:{{
53
+            getCheckCostTotal()
54
+              ? getCheckCostTotal()
55
+              : ""
56
+          }}</TD
57
+        >
58
+        <TD>输氧费:</TD>
59
+        <TD
60
+        >手术费:</TD
61
+        >
62
+      </TR>
63
+      <TR>
64
+        <TD colspan="2"
65
+        >化验费:{{
66
+            getHuaYanCostTotal()
67
+              ? getHuaYanCostTotal()
68
+              : ""
69
+          }}</TD
70
+        >
71
+        <TD>输血费:</TD>
72
+        <TD
73
+        >诊察费:{{
74
+            getzhenchanCostTotal()
75
+              ? getzhenchanCostTotal()
76
+              : ""
77
+          }}</TD>
78
+      </TR>
79
+      <TR>
80
+        <TD colspan="2"
81
+        >治疗费:{{
82
+            getzhiliaoCostTotal()
83
+              ?  getzhiliaoCostTotal()
84
+              : ""
85
+          }}</TD
86
+        >
87
+        <TD>护理费:</TD>
88
+        <TD
89
+        >床位费:</TD
90
+        >
91
+      </TR>
92
+      <TR>
93
+        <TD colspan="2">麻醉费:</TD>
94
+        <TD
95
+        >材料费:{{
96
+           getmaterialCostTotal() ? getmaterialCostTotal(): ""
97
+          }}</TD
98
+        >
99
+        <TD
100
+        >其他:{{
101
+           getotherCostTota() ? getotherCostTota() : ""
102
+          }}</TD
103
+        >
104
+      </TR>
105
+      </THEAD>
106
+
107
+      <TBODY style="text-align: center">
108
+      <TR>
109
+        <TD colspan="4">
110
+          <Table class="allListTable_1" border="1">
111
+            <TR>
112
+              <TH width="70"> 费用类别 </TH>
113
+              <TH width="70"> 项目名称 </TH>
114
+              <TH width="70">单位</TH>
115
+              <TH width="70">数量</TH>
116
+              <TH width="70">单价</TH>
117
+              <TH width="70">金额</TH>
118
+              <TH width="70">医保类型</TH>
119
+            </TR>
120
+            <template v-for="(item, index) in list">
121
+              <tr v-if="item.name&&item.name.length > 0">
122
+                <td style="width: 10%">{{ item.med_chrgitm_type }}</td>
123
+                <td
124
+                  style="
125
+                      width: 35%;
126
+                      white-space: nowrap;
127
+                      overflow: hidden;
128
+                      text-overflow: ellipsis;
129
+                    "
130
+                >
131
+                  {{ item.name }}{{ item.spec }}
132
+                </td>
133
+                <td style="width: 5%">{{ item.unit }}</td>
134
+                <td style="width: 10%; text-align: right">
135
+                  {{ item.count }}
136
+                </td>
137
+                <td style="width: 10%; text-align: right">
138
+                  {{ item.price}}
139
+                </td>
140
+                <td style="width: 10%; text-align: right">
141
+                  {{ (item.price * item.count).toFixed(2) }}
142
+                </td>
143
+                <td style="width: 10%">{{ item.medicine_insurance_kind }}</td>
144
+              </tr>
145
+            </template>
146
+              <tr>
147
+              <td style="width: 10%"></td>
148
+              <td
149
+                style="
150
+                      width: 35%;
151
+                      white-space: nowrap;
152
+                      overflow: hidden;
153
+                      text-overflow: ellipsis;
154
+                    "
155
+              >
156
+                合计
157
+              </td>
158
+              <td style="width: 5%"></td>
159
+              <td style="width: 10%; text-align: right"></td>
160
+              <td style="width: 10%; text-align: right"></td>
161
+              <td style="width: 10%; text-align: right">
162
+                {{ getTotal(list) }}
163
+              </td>
164
+              <td style="width: 10%"></td>
165
+            </tr>
166
+          </Table>
167
+        </TD>
168
+      </TR>
169
+      </TBODY>
170
+    </table>
171
+  </div>
172
+</template>
173
+
174
+<script>
175
+import { uParseTime } from "@/utils/tools";
176
+
177
+export default {
178
+  props: {
179
+    list: {
180
+      type: Array,
181
+      default: function () {
182
+        return [];
183
+      },
184
+    },
185
+    patient: {
186
+      type: Object,
187
+      default: function () {
188
+        return {};
189
+      },
190
+    },
191
+    record: {
192
+      type: Object,
193
+      default: function () {
194
+        return {};
195
+      },
196
+    },
197
+    admin: {
198
+      type: Object,
199
+      default: function () {
200
+        return {};
201
+      },
202
+    },
203
+    hospital: {
204
+      type: Object,
205
+      default: function () {
206
+        return {};
207
+      },
208
+    },
209
+  },
210
+  data() {
211
+    return {
212
+      page: 1,
213
+      pageArr: [],
214
+    };
215
+  },
216
+  methods: {
217
+    getWesternMedicineCostTotal(){
218
+      let total = 0
219
+      for(let i = 0;i < this.list.length;i++){
220
+        if(this.list[i].med_chrgitm_type == "西药费"){
221
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
222
+        }
223
+
224
+      }
225
+      return total.toFixed(2)
226
+    },
227
+    getCheckCostTotal(){
228
+      let total = 0
229
+
230
+      for(let i = 0;i < this.list.length;i++){
231
+        if(this.list[i].med_chrgitm_type == "检查费"){
232
+
233
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
234
+
235
+
236
+        }
237
+
238
+      }
239
+      return total.toFixed(2)
240
+
241
+    }, getHuaYanCostTotal(){
242
+      let total = 0
243
+
244
+      for(let i = 0;i < this.list.length;i++){
245
+        if(this.list[i].med_chrgitm_type == "化验费"){
246
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
247
+        }
248
+      }
249
+      return total.toFixed(2)
250
+    },getzhenchanCostTotal(){
251
+      let total = 0
252
+
253
+      for(let i = 0;i < this.list.length;i++){
254
+        if(this.list[i].med_chrgitm_type == "诊察费"){
255
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
256
+        }
257
+
258
+      }
259
+      return total.toFixed(2)
260
+
261
+
262
+    },getzhiliaoCostTotal(){
263
+      let total = 0
264
+      for(let i = 0;i < this.list.length;i++){
265
+        if(this.list[i].med_chrgitm_type == "治疗费"){
266
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
267
+        }
268
+      }
269
+      return total.toFixed(2)
270
+
271
+
272
+    },getmaterialCostTotal(){
273
+      let total = 0
274
+      for(let i = 0;i < this.list.length;i++){
275
+        if(this.list[i].med_chrgitm_type == '耗材费'){
276
+          total = total + (this.list[i].count *parseFloat(this.list[i].price.toFixed(2)))
277
+        }
278
+
279
+      }
280
+      return total.toFixed(2)
281
+
282
+    },getotherCostTota(){
283
+      let total = 0
284
+      for(let i = 0;i < this.list.length;i++){
285
+        if(this.list[i].med_chrgitm_type == "其他费"){
286
+          total = total + (this.list[i].count * parseFloat(this.list[i].price.toFixed(2)))
287
+        }
288
+      }
289
+      return total.toFixed(2)
290
+    },
291
+    getNowTime: function () {
292
+      let dateTime;
293
+      let yy = new Date().getFullYear();
294
+      let mm = new Date().getMonth() + 1;
295
+      let dd = new Date().getDate();
296
+      let hh = new Date().getHours();
297
+      let mf =
298
+        new Date().getMinutes() < 10
299
+          ? "0" + new Date().getMinutes()
300
+          : new Date().getMinutes();
301
+      let ss =
302
+        new Date().getSeconds() < 10
303
+          ? "0" + new Date().getSeconds()
304
+          : new Date().getSeconds();
305
+      dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
306
+      return dateTime;
307
+    },
308
+    getTimes(time) {
309
+      return uParseTime(time, "{y}-{m}-{d}");
310
+    },
311
+    // getTotal: function (items) {
312
+    //   let total = 0;
313
+    //   for (let i = 0; i < items.length; i++) {
314
+    //     total = total + (items[i].count * items[i].price).toFixed(2);
315
+    //   }
316
+    //   return total;
317
+    // },
318
+    getTotal: function (items) {
319
+      console.log(items)
320
+      let total = 0;
321
+      for (let i = 0; i < items.length; i++) {
322
+        total = total + (parseFloat(items[i].count) * parseFloat(items[i].price.toFixed(2)));
323
+      }
324
+      return total.toFixed(2);
325
+    },
326
+
327
+  },
328
+  watch: {
329
+    list: {
330
+      handler(newVal) {
331
+        // this.getPage();
332
+      },
333
+      deep: true,
334
+    },
335
+  },
336
+};
337
+</script>
338
+
339
+<style lang="scss" scoped>
340
+.allList-print {
341
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
342
+  0 0 60px rgba(0, 0, 0, 0.06) inset;
343
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
344
+  0 0 40px rgba(0, 0, 0, 0.06) inset;
345
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
346
+  margin-bottom: 20px;
347
+  padding: 20px 10px;
348
+}
349
+
350
+.allListTitle {
351
+  font-size: 24px;
352
+  text-align: center;
353
+  font-weight: bold;
354
+  margin-bottom: 10px;
355
+}
356
+
357
+.allListInfo {
358
+  display: flex;
359
+  font-size: 16px;
360
+  justify-content: space-between;
361
+  margin: 10px 0;
362
+}
363
+
364
+.allListInfo div {
365
+  min-width: 200px;
366
+}
367
+
368
+.allListTable {
369
+  width: 100%;
370
+  text-align: center;
371
+  border-collapse: collapse;
372
+  line-height: 20px;
373
+  font-size: 14px;
374
+  border-color: #000;
375
+  text-align: left;
376
+}
377
+
378
+.allListTable tr td {
379
+  padding: 0 5px;
380
+}
381
+
382
+.allListTable_1 {
383
+  width: 100%;
384
+  text-align: center;
385
+  border-collapse: collapse;
386
+  line-height: 20px;
387
+  font-size: 14px;
388
+  border-color: #000;
389
+  text-align: left;
390
+}
391
+
392
+.allListTable_1 tr td {
393
+  padding: 0 5px;
394
+}
395
+
396
+.tableBottom {
397
+  font-size: 16px;
398
+  display: flex;
399
+  margin-top: 20px;
400
+}
401
+
402
+.tableBottomOne {
403
+  margin-right: 40px;
404
+}
405
+
406
+</style>

+ 396 - 0
src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalListPrint.vue View File

@@ -0,0 +1,396 @@
1
+<template>
2
+  <div>
3
+    <template>
4
+      <el-button
5
+        style="position:fixed;right:25px;z-index:999"
6
+        size="small"
7
+        icon="el-icon-printer"
8
+        @click="printThisPage"
9
+        type="primary"
10
+      >打印
11
+      </el-button
12
+      >
13
+    </template>
14
+
15
+    <div class='dialysisPage' style="padding-top:40px;">
16
+      <hospital-list-print-one :list="list" :patient="patient" :record="record" :admin="admin"></hospital-list-print-one>
17
+    </div>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+import { getHospitalUnChargeList } from '@/api/his/his'
23
+import { uParseTime } from '@/utils/tools'
24
+import HospitalListPrintOne from './hospitalListPrintOne.vue'
25
+export default {
26
+  name: 'hospitalListPrint',
27
+  components: {
28
+    HospitalListPrintOne
29
+
30
+  },
31
+  props: {
32
+    paramsObj: Object
33
+  },
34
+  data() {
35
+    return {
36
+      list: [],
37
+      patient:{},
38
+      order:{},
39
+      admin:{},
40
+      record:{},
41
+    }
42
+  },
43
+  created() {
44
+    this.getInfo(this.paramsObj.patient_id,this.paramsObj.record_date)
45
+  },
46
+
47
+  methods: {
48
+    getTimes(time) {
49
+      return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
50
+    },
51
+    getInfo(patient_id,record_date) {
52
+      let params = {
53
+        patient_id: patient_id,
54
+        record_date: record_date,
55
+        admin_user_id:this.$store.getters.xt_user.user.id,
56
+        p_type:1,
57
+      }
58
+      getHospitalUnChargeList(params).then(response => {
59
+        if (response.data.state == 0) {
60
+          this.$message.error(response.data.msg)
61
+          return false
62
+        } else {
63
+          this.patient = response.data.data.xt_info
64
+          this.record = response.data.data.record
65
+          this.admin = response.data.data.admin_info
66
+          this.list = []
67
+          for (let i = 0; i < response.data.data.prescription.length; i++) {
68
+            if(response.data.data.prescription[i].type == 1){
69
+              var infos = response.data.data.prescription[i]
70
+              for(let b = 0; b < infos.advices.length; b++){
71
+                let obj = {
72
+                  med_chrgitm_type: this.getType(1),
73
+                  price: infos.advices[b].price,
74
+                  count: infos.advices[b].prescribing_number,
75
+                  p_time:this.getTimes(infos.advices[b].created_time),
76
+                  name: infos.advices[b].advice_name,
77
+                  spec: infos.advices[b].drug.drug_spec,
78
+                  unit: infos.advices[b].prescribing_number_unit,
79
+                  feedetl_sn:infos.advices[b].feedetl_sn
80
+                }
81
+                this.list.push(obj)
82
+              }
83
+            }
84
+          }
85
+          for (let i = 0; i < response.data.data.prescription.length; i++) {
86
+            if(response.data.data.prescription[i].type == 2){
87
+              var infos = response.data.data.prescription[i]
88
+              for(let b = 0; b < infos.project.length; b++){
89
+                if(infos.project[b].type == 2){
90
+                  let obj = {
91
+                    med_chrgitm_type: this.getType(infos.project[b].project.cost_classify),
92
+                    price: infos.project[b].price,
93
+                    count: infos.project[b].count,
94
+                    p_time:this.getTimes(infos.project[b].ctime),
95
+                    name: infos.project[b].project.project_name,
96
+                    spec: "",
97
+                    unit: infos.project[b].project.unit,
98
+                    feedetl_sn:infos.project[b].feedetl_sn
99
+
100
+                  }
101
+                  this.list.push(obj)
102
+                }else{
103
+                  let obj = {
104
+                    med_chrgitm_type: this.getType(5),
105
+                    price: infos.project[b].price,
106
+                    count: infos.project[b].count,
107
+                    p_time:this.getTimes(infos.project[b].ctime),
108
+                    name: infos.project[b].good_info.good_name,
109
+                    spec: infos.project[b].good_info.specification_name,
110
+                    unit: infos.project[b].good_info.packing_unit,
111
+                    feedetl_sn:infos.project[b].feedetl_sn
112
+
113
+                  }
114
+                  this.list.push(obj)
115
+                }
116
+              }
117
+            }
118
+
119
+          }
120
+          this.list.sort(function(a, b) {
121
+            return b.p_time < a.p_time ? 1 : -1
122
+          })
123
+        }
124
+      })
125
+    },
126
+
127
+    getType(med_chrgitm_type) {
128
+      switch (med_chrgitm_type) {
129
+        case 1:
130
+          return '西药费';
131
+        case 2:
132
+          return '治疗费';
133
+        case 3:
134
+          return '检验费';
135
+          break;
136
+        case 4:
137
+          return '心电图费';
138
+          break;
139
+        case 5:
140
+          return '耗材费';
141
+          break;
142
+        case 6:
143
+          return '护理费';
144
+          break;
145
+        case 7:
146
+          return '放射费';
147
+          break;
148
+        case 8:
149
+          return '检查费';
150
+          break;
151
+        case 9:
152
+          return '超声费';
153
+          break;
154
+        case 10:
155
+          return '麻醉费';
156
+          break;
157
+        case 11:
158
+          return '手术费';
159
+          break;
160
+        case 12:
161
+          return '其他费';
162
+          break;
163
+        case 13:
164
+          return '床位费';
165
+          break;
166
+        case 14:
167
+          return '化验费';
168
+          break;
169
+        case 15:
170
+          return '诊察费';
171
+          break;
172
+
173
+      }
174
+
175
+    },
176
+    printThisPage() {
177
+      const style =
178
+        '@media print {.allListTitle{font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.allListInfo{display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;} .listTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;}  .listTable tr td {padding: 0 5px;}.tableBottom{font-size: 16px;display: flex;margin-top: 10px;}.tableBottomOne{margin-right: 40px;} .allListTable{border: none;width: 100%;text-align: center;border-collapse: collapse;line-height: 20px;font-size: 14px;border-color: #000;text-align:left;} .allListTable tr{page-break-inside:avoid;} .allListTable tr td {padding: 0 5px;border: 1px solid #000;}.tableBottom{font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne{margin-right: 40px;}}'
179
+      printJS({
180
+        printable: 'allList-print',
181
+        type: 'html',
182
+        style: style,
183
+        scanStyles: false
184
+      })
185
+
186
+
187
+      // if (this.org_template_info.template_id == 1) {
188
+      //   printJS({
189
+      //     printable: "dialysis-print-box",
190
+      //     type: "html",
191
+      //     style: style,
192
+      //     scanStyles: false
193
+      //   });
194
+      // }
195
+    }
196
+  },
197
+  watch:{
198
+    paramsObj:{//深度监听,可监听到对象、数组的变化
199
+      handler(val, oldVal){
200
+        this.getInfo(val.patient_id,val.record_date)
201
+      },
202
+      deep:true
203
+    }
204
+  }
205
+
206
+}
207
+</script>
208
+
209
+<style>
210
+.dialysis-print-order {
211
+  width: 960px;
212
+  margin: 0 auto;
213
+}
214
+
215
+.dialysis-print-order .order-yy-name {
216
+  margin: auto;
217
+  text-align: center;
218
+  font-size: 20px;
219
+  letter-spacing: 5px;
220
+}
221
+
222
+.dialysis-print-order .order-title {
223
+  margin: auto;
224
+  font-weight: 600;
225
+  text-align: center;
226
+  font-size: 22px;
227
+  padding: 10px;
228
+}
229
+
230
+.dialysis-print-order .table-box {
231
+  width: 100%;
232
+  line-height: 23px;
233
+  font-size: 14px;
234
+}
235
+
236
+.dialysis-print-order .print-table {
237
+  width: 100%;
238
+  text-align: center;
239
+  border-collapse: collapse;
240
+  line-height: 40px;
241
+  font-size: 14px;
242
+  border-color: #000;
243
+}
244
+
245
+.dialysis-print-order .print-table-no {
246
+  width: 100%;
247
+  text-align: center;
248
+  border-collapse: collapse;
249
+  font-size: 14px;
250
+}
251
+
252
+.dialysis-print-order .under-line {
253
+  border-bottom: 1px solid #999;
254
+  width: 95%;
255
+  text-align: center;
256
+  margin-left: 2px;
257
+}
258
+
259
+.dialysis-print-order .title-box {
260
+  text-align: center;
261
+  font-size: 16px;
262
+}
263
+
264
+.dialysis-print-order .radio-lebel-box {
265
+  font-weight: 400;
266
+  cursor: pointer;
267
+}
268
+
269
+.dialysis-print-order .radio-no {
270
+  opacity: 0;
271
+  outline: none;
272
+  position: absolute;
273
+  margin: 0;
274
+  width: 0;
275
+  height: 0;
276
+  z-index: -1;
277
+}
278
+
279
+.dialysis-print-order .radio-inner {
280
+  white-space: nowrap;
281
+  cursor: pointer;
282
+  outline: none;
283
+  display: inline-block;
284
+  line-height: 1;
285
+  position: relative;
286
+  vertical-align: middle;
287
+}
288
+
289
+.dialysis-print-order .radio-fang {
290
+  display: inline-block;
291
+  position: relative;
292
+  border: 1px solid #000;
293
+  box-sizing: border-box;
294
+  width: 14px;
295
+  height: 14px;
296
+  background-color: #fff;
297
+  z-index: 1;
298
+  transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
299
+  background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
300
+}
301
+
302
+.dialysis-print-order .is-checked-radio::after {
303
+  content: "√";
304
+  font-size: 15px;
305
+}
306
+
307
+.dialysis-print-order .print-table-no tr td {
308
+  padding: 8px 5px;
309
+  line-height: 25px;
310
+}
311
+
312
+.dialysis-print-order .print-table tr td {
313
+  padding: 1px 1px;
314
+  /*line-height: 25px;*/
315
+}
316
+
317
+.es-img {
318
+  height: 30px;
319
+}
320
+
321
+.advice-name {
322
+  text-align: left;
323
+}
324
+
325
+.advice-children {
326
+  display: flex;
327
+}
328
+
329
+.title-box-pro {
330
+  border: 0 #fff;
331
+  line-height: 25px;
332
+  height: 25px;
333
+  text-align: left;
334
+  padding-left: 10px !important;
335
+}
336
+
337
+.title-box-pro-tr {
338
+  border: 0 #fff;
339
+}
340
+
341
+.text-align-left {
342
+  text-align: left !important;
343
+  padding-left: 10px !important;
344
+  font-size: 14px !important;
345
+  line-height: 25px;
346
+}
347
+
348
+.print-table-tr-new td {
349
+  line-height: 20px !important;
350
+}
351
+
352
+.border-top-solid {
353
+  border: solid 1px #000;
354
+}
355
+
356
+.print-template-two tr {
357
+  line-height: 30px;
358
+}
359
+
360
+.table-box1 {
361
+  border: 1px solid #000;
362
+  width: 100%;
363
+  line-height: 30px;
364
+  font-size: 14px;
365
+  border-collapse: collapse;
366
+}
367
+
368
+.table-box1 tr {
369
+  border-bottom: 1px solid #000;
370
+}
371
+</style>
372
+
373
+<style lang="scss">
374
+
375
+.newContainer {
376
+
377
+.dialysisPage::-webkit-scrollbar {
378
+  height: 15px;
379
+}
380
+
381
+.el-date-editor {
382
+
383
+.el-input__inner {
384
+  padding-right: 0px;
385
+}
386
+
387
+}
388
+.el-table td, .el-table th {
389
+  text-align: center;
390
+}
391
+
392
+}
393
+.newContainer::-webkit-scrollbar {
394
+  height: 15px !important;
395
+}
396
+</style>

+ 318 - 0
src/xt_pages/hospitalStation/pastQuiriesPrint/hospitalListPrintOne.vue View File

@@ -0,0 +1,318 @@
1
+<template>
2
+  <div id="allList-print" class="allList-print">
3
+    <table
4
+      class="listTable"
5
+      border="0"
6
+      cellspacing="0"
7
+      style="font-size: 14px"
8
+      align="center"
9
+    >
10
+      <THEAD
11
+        style="
12
+          display: table-header-group;
13
+          font-weight: bold;
14
+        "
15
+      >
16
+      <TR>
17
+        <TD colspan="3" align="center" style="font-size: 20px">
18
+          {{ $store.getters.xt_user.org.org_name }}费用清单
19
+        </TD>
20
+      </TR>
21
+      <TR>
22
+        <TD colspan="1">患者姓名:{{ patient.name }}</TD>
23
+        <TD>性别:{{ patient.gender == 1 ? "男" : "女" }}</TD>
24
+        <!--        <TD>年龄:{{ // getAge(patient.id_card_no)?getAge(patient.id_card_no)+'岁':''}}</TD>-->
25
+        <TD
26
+        >结算类型:{{record.balance_accounts_type == 2?'自费':"医保"
27
+          }}</TD
28
+        >
29
+      </TR>
30
+      <TR>
31
+        <TD> 住院/门诊号:{{ record.number }} </TD>
32
+        <TD>科室:血透 </TD>
33
+        <TD>就诊流水号:{{ record.number }}</TD>
34
+      </TR>
35
+      <TR>
36
+        <TD> 总费用:{{ getTotal(list)  }} </TD>
37
+        <TD>个人支付: </TD>
38
+        <TD>基金支付记账:</TD>
39
+      </TR>
40
+      <TR>
41
+        <TD>补充医疗支付记账</TD>
42
+        <TD>救助支付金额:</TD>
43
+        <TD></TD>
44
+      </TR>
45
+      </THEAD>
46
+
47
+      <TBODY style="text-align: center">
48
+      <TR>
49
+        <TD colspan="3">
50
+          <Table class="allListTable" border="1">
51
+            <TR>
52
+              <TD style="width: 5%">序号</TD>
53
+              <TD style="width: 15%">处方日期</TD>
54
+              <TD style="width: 10%">费用编号</TD>
55
+              <TD style="width: 40%">费用名称</TD>
56
+              <TD style="width: 5%">单位</TD>
57
+              <TD style="width: 5%">数量</TD>
58
+              <TD style="width: 10%">单价</TD>
59
+              <TD style="width: 10%">金额</TD>
60
+            </TR>
61
+            <template v-for="(item, index) in list">
62
+              <tr >
63
+                <td style="width: 5%">{{ index + 1 }}</td>
64
+                <td style="width: 15%">{{ item.p_time }}</td>
65
+                <td style="width: 10%">
66
+                  {{ item.feedetl_sn.split("-")[2] }}
67
+                </td>
68
+                <td style="width: 30%; white-space: nowrap; overflow: hidden">
69
+                  {{ item.name }}{{ item.spec }}
70
+                </td>
71
+                <td style="width: 5%">{{ item.unit }}</td>
72
+                <td style="width: 5%; text-align: right">{{ item.count }}</td>
73
+                <td style="width: 10%; text-align: right">
74
+                  {{ item.price }}
75
+                </td>
76
+                <td style="width: 10%; text-align: right">
77
+                  {{ (item.price * item.count).toFixed(2) }}
78
+                </td>
79
+              </tr>
80
+            </template>
81
+            <tr >
82
+              <td style="width: 5%"></td>
83
+              <td style="width: 15%"></td>
84
+              <td style="width: 10%"></td>
85
+              <td style="width: 30%; white-space: nowrap; overflow: hidden">
86
+                {{"合计"}}
87
+              </td>
88
+              <td style="width: 5%"></td>
89
+              <td style="width: 5%"></td>
90
+              <td style="width: 10%; text-align: right"></td>
91
+              <td style="width: 10%; text-align: right">
92
+                {{ getTotal(list) }}
93
+              </td>
94
+            </tr>
95
+
96
+          </Table>
97
+        </TD>
98
+      </TR>
99
+      </TBODY>
100
+    </table>
101
+    <!-- <div class="allListTitle">
102
+
103
+    </div> -->
104
+    <!-- <div class="allListInfo">
105
+      <div style="text-align: left">患者姓名:{{ patient.name }}</div>
106
+      <div style="text-align: left; padding-left: -20px">
107
+        性别:{{ patient.gender == 1 ? "男" : "女" }}
108
+      </div>
109
+      <div style="text-align: left">
110
+        结算类型:{{ order.is_medicine_insurance == 1 ? "医保" : "自费" }}
111
+      </div>
112
+    </div>
113
+
114
+     <div class="allListInfo">
115
+      <div style="text-align: left">住院/门诊号:{{ order.mdtrt_id }}</div>
116
+      <div style="text-align: left">科室:血透</div>
117
+      <div style="text-align: left">就诊流水号:{{ order.mdtrt_id }}</div>
118
+    </div>
119
+
120
+    <div class="allListInfo">
121
+      <div style="text-align: left">总费用:{{ order.medfee_sumamt }}</div>
122
+      <div style="text-align: left">个人支付:{{ order.psn_part_amt }}</div>
123
+      <div style="text-align: left">
124
+        基金支付记账:{{ order.fund_pay_sumamt }}
125
+      </div>
126
+    </div>
127
+
128
+    <div class="allListInfo">
129
+      <div style="text-align: left">补充医疗支付记账:0.00</div>
130
+      <div style="text-align: left">救助支付金额:{{ order.maf_pay }}</div>
131
+      <div></div>
132
+    </div>-->
133
+  </div>
134
+</template>
135
+
136
+<script>
137
+import { uParseTime } from "@/utils/tools";
138
+
139
+export default {
140
+  props: {
141
+    list: {
142
+      type: Array,
143
+      default: function () {
144
+        return [];
145
+      },
146
+    },
147
+    patient: {
148
+      type: Object,
149
+      default: function () {
150
+        return {};
151
+      },
152
+    },
153
+    record: {
154
+      type: Object,
155
+      default: function () {
156
+        return {};
157
+      },
158
+    },
159
+    admin: {
160
+      type: Object,
161
+      default: function () {
162
+        return {};
163
+      },
164
+    },
165
+    hospital: {
166
+      type: Object,
167
+      default: function () {
168
+        return {};
169
+      },
170
+    },
171
+  },
172
+  data() {
173
+    return {
174
+      page: 1,
175
+      pageArr: [],
176
+    };
177
+  },
178
+  methods: {
179
+    getAge(val){
180
+      var thisLen = val.length;
181
+      var birth = "";
182
+      if (thisLen == 15) {
183
+        birth = "19" + val.substr(6, 6);
184
+      } else {
185
+        birth = val.substr(6, 8);
186
+      }
187
+      var birthTwo =
188
+        birth.substr(0, 4) +
189
+        "-" +
190
+        birth.substr(4, 2) +
191
+        "-" +
192
+        birth.substr(6, 2);
193
+      var age = this.jsGetAge(birthTwo, "-");
194
+      return age;
195
+    },
196
+
197
+    getNowTime: function () {
198
+      let dateTime;
199
+      let yy = new Date().getFullYear();
200
+      let mm = new Date().getMonth() + 1;
201
+      let dd = new Date().getDate();
202
+      let hh = new Date().getHours();
203
+      let mf =
204
+        new Date().getMinutes() < 10
205
+          ? "0" + new Date().getMinutes()
206
+          : new Date().getMinutes();
207
+      let ss =
208
+        new Date().getSeconds() < 10
209
+          ? "0" + new Date().getSeconds()
210
+          : new Date().getSeconds();
211
+      dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
212
+      return dateTime;
213
+    },
214
+    getTimes(time) {
215
+      return uParseTime(time, "{y}-{m}-{d}");
216
+    },
217
+    getTotal: function (items) {
218
+      let total = 0;
219
+      for (let i = 0; i < items.length; i++) {
220
+        total = total + (parseFloat(items[i].count) * parseFloat(items[i].price.toFixed(2)));
221
+      }
222
+      return total.toFixed(2);
223
+    },
224
+  },
225
+  watch: {
226
+    list: {
227
+      handler(newVal) {
228
+        // this.getPage()
229
+      },
230
+      deep: true,
231
+    },
232
+  },
233
+};
234
+</script>
235
+
236
+<style lang="scss" scoped>
237
+.allList-print {
238
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
239
+  0 0 60px rgba(0, 0, 0, 0.06) inset;
240
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
241
+  0 0 40px rgba(0, 0, 0, 0.06) inset;
242
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
243
+  margin-bottom: 20px;
244
+  padding: 20px 10px;
245
+}
246
+
247
+.allListTitle {
248
+  font-size: 24px;
249
+  text-align: center;
250
+  font-weight: bold;
251
+  margin-bottom: 10px;
252
+}
253
+
254
+.allListInfo {
255
+  display: flex;
256
+  font-size: 16px;
257
+  justify-content: space-between;
258
+  margin: 10px 0;
259
+}
260
+
261
+.allListInfo div {
262
+  min-width: 200px;
263
+}
264
+
265
+.allListTable {
266
+  width: 100%;
267
+  text-align: center;
268
+  border-collapse: collapse;
269
+  line-height: 20px;
270
+  font-size: 14px;
271
+  border-color: #000;
272
+  text-align: left;
273
+}
274
+
275
+.allListTable tr td {
276
+  padding: 0 5px;
277
+}
278
+
279
+.tableBottom {
280
+  font-size: 16px;
281
+  display: flex;
282
+  margin-top: 20px;
283
+}
284
+
285
+.tableBottomOne {
286
+  margin-right: 40px;
287
+}
288
+
289
+.listTable {
290
+  width: 100%;
291
+  text-align: center;
292
+  border-collapse: collapse;
293
+  line-height: 40px;
294
+  font-size: 14px;
295
+  border-color: #000;
296
+  text-align: left;
297
+}
298
+.listTable thead {
299
+  width: 100%;
300
+  text-align: center;
301
+  border-collapse: collapse;
302
+  line-height: 40px;
303
+  font-size: 14px;
304
+  border-color: #000;
305
+  text-align: left;
306
+}
307
+.listTable thead tr td {
308
+  padding: 0 5px;
309
+}
310
+.tableBottom {
311
+  font-size: 16px;
312
+  display: flex;
313
+  margin-top: 20px;
314
+}
315
+.tableBottomOne {
316
+  margin-right: 40px;
317
+}
318
+</style>

+ 3 - 0
src/xt_pages/hospitalStation/statementPrint.vue View File

@@ -23,6 +23,9 @@
23 23
 <!--      <print-one :info="info" ></print-one>-->
24 24
       <hospital-settle-print :info="info" :list="list"></hospital-settle-print>
25 25
     </div>
26
+    <div class='dialysisPage' style="padding-top:40px;" v-if="this.$store.getters.xt_user.org_id != 10215 && this.paramsObj.balance_accounts_type == 2 && this.$store.getters.xt_user.org_id != 10265">
27
+    <private-charge-print :info="info" ></private-charge-print>
28
+    </div>
26 29
 
27 30
 <!--    <div class='dialysisPage' style="padding-top:40px;" v-else>-->
28 31
 <!--      <private-charge-print :info="info" v-if="this.paramsObj.balance_accounts_type == 2"></private-charge-print>-->

+ 498 - 83
src/xt_pages/outpatientCharges/components/registerDialog9504.vue View File

@@ -102,6 +102,19 @@
102 102
           </el-option>
103 103
         </el-select>
104 104
       </el-form-item>
105
+      <el-form-item label="参保地:">
106
+        <el-autocomplete
107
+          popper-class="my-autocomplete"
108
+          v-model="form.insuplc_admdvs"
109
+          :fetch-suggestions="querySearch"
110
+          placeholder="请输入内容"
111
+          @select="handleSelectTwo">
112
+
113
+          <template slot-scope="{ item }">
114
+            <div class="id">{{ item.id }}{{ item.name }}</div>
115
+          </template>
116
+        </el-autocomplete>
117
+      </el-form-item>
105 118
 
106 119
 
107 120
       <el-form-item label="读卡类型:" prop="id_card_type">
@@ -188,6 +201,385 @@
188 201
     data() {
189 202
 
190 203
       return {
204
+        area:[
205
+          {id:110000,name:"北京市"},
206
+          {id:120000,name:"天津市"},
207
+          {id:130000,name:"河北省"},
208
+          {id:130100,name:"石家庄市"},
209
+          {id:130200,name:"唐山市"},
210
+          {id:130300,name:"秦皇岛市"},
211
+          {id:130400,name:"邯郸市"},
212
+          {id:130500,name:"邢台市"},
213
+          {id:130600,name:"保定市"},
214
+          {id:130700,name:"张家口市"},
215
+          {id:130800,name:"承德市"},
216
+          {id:130900,name:"沧州市"},
217
+          {id:131000,name:"廊坊市"},
218
+          {id:131100,name:"衡水市"},
219
+          {id:140000,name:"山西省"},
220
+          {id:140100,name:"太原市"},
221
+          {id:140200,name:"大同市"},
222
+          {id:140300,name:"阳泉市"},
223
+          {id:140400,name:"长治市"},
224
+          {id:140500,name:"晋城市"},
225
+          {id:140600,name:"朔州市"},
226
+          {id:140700,name:"晋中市"},
227
+          {id:140800,name:"运城市"},
228
+          {id:140900,name:"忻州市"},
229
+          {id:141000,name:"临汾市"},
230
+          {id:141100,name:"吕梁市"},
231
+          {id:150000,name:"内蒙古自治区"},
232
+          {id:150100,name:"呼和浩特市"},
233
+          {id:150200,name:"包头市"},
234
+          {id:150300,name:"乌海市"},
235
+          {id:150400,name:"赤峰市"},
236
+          {id:150500,name:"通辽市"},
237
+          {id:150600,name:"鄂尔多斯市"},
238
+          {id:150700,name:"呼伦贝尔市"},
239
+          {id:150800,name:"巴彦淖尔市"},
240
+          {id:150900,name:"乌兰察布市"},
241
+          {id:152200,name:"兴安盟"},
242
+          {id:152500,name:"锡林郭勒盟"},
243
+          {id:152900,name:"阿拉善盟"},
244
+          {id:210000,name:"辽宁省"},
245
+          {id:210100,name:"沈阳市"},
246
+          {id:210200,name:"大连市"},
247
+          {id:210300,name:"鞍山市"},
248
+          {id:210400,name:"抚顺市"},
249
+          {id:210500,name:"本溪市"},
250
+          {id:210600,name:"丹东市"},
251
+          {id:210700,name:"锦州市"},
252
+          {id:210800,name:"营口市"},
253
+          {id:210900,name:"阜新市"},
254
+          {id:211000,name:"辽阳市"},
255
+          {id:211100,name:"盘锦市"},
256
+          {id:211200,name:"铁岭市"},
257
+          {id:211300,name:"朝阳市"},
258
+          {id:211400,name:"葫芦岛市"},
259
+          {id:220000,name:"吉林省"},
260
+          {id:220100,name:"长春市"},
261
+          {id:220200,name:"吉林市"},
262
+          {id:220300,name:"四平市"},
263
+          {id:220400,name:"辽源市"},
264
+          {id:220500,name:"通化市"},
265
+          {id:220600,name:"白山市"},
266
+          {id:220700,name:"松原市"},
267
+          {id:220800,name:"白城市"},
268
+          {id:222400,name:"延边朝鲜族自治州"},
269
+          {id:230000,name:"黑龙江省"},
270
+          {id:230100,name:"哈尔滨市"},
271
+          {id:230200,name:"齐齐哈尔市"},
272
+          {id:230300,name:"鸡西市"},
273
+          {id:230400,name:"鹤岗市"},
274
+          {id:230500,name:"双鸭山市"},
275
+          {id:230600,name:"大庆市"},
276
+          {id:230700,name:"伊春市"},
277
+          {id:230800,name:"佳木斯市"},
278
+          {id:230900,name:"七台河市"},
279
+          {id:231000,name:"牡丹江市"},
280
+          {id:231100,name:"黑河市"},
281
+          {id:231200,name:"绥化市"},
282
+          {id:232700,name:"大兴安岭地区"},
283
+          {id:310000,name:"上海市"},
284
+          {id:320000,name:"江苏省"},
285
+          {id:320100,name:"南京市"},
286
+          {id:320200,name:"无锡市"},
287
+          {id:320300,name:"徐州市"},
288
+          {id:320400,name:"常州市"},
289
+          {id:320500,name:"苏州市"},
290
+          {id:320600,name:"南通市"},
291
+          {id:320700,name:"连云港市"},
292
+          {id:320800,name:"淮安市"},
293
+          {id:320900,name:"盐城市"},
294
+          {id:321000,name:"扬州市"},
295
+          {id:321100,name:"镇江市"},
296
+          {id:321200,name:"泰州市"},
297
+          {id:321300,name:"宿迁市"},
298
+          {id:330000,name:"浙江省"},
299
+          {id:330100,name:"杭州市"},
300
+          {id:330200,name:"宁波市"},
301
+          {id:330300,name:"温州市"},
302
+          {id:330400,name:"嘉兴市"},
303
+          {id:330500,name:"湖州市"},
304
+          {id:330600,name:"绍兴市"},
305
+          {id:330700,name:"金华市"},
306
+          {id:330800,name:"衢州市"},
307
+          {id:330900,name:"舟山市"},
308
+          {id:331000,name:"台州市"},
309
+          {id:331100,name:"丽水市"},
310
+          {id:340000,name:"安徽省"},
311
+          {id:340100,name:"合肥市"},
312
+          {id:340200,name:"芜湖市"},
313
+          {id:340300,name:"蚌埠市"},
314
+          {id:340400,name:"淮南市"},
315
+          {id:340500,name:"马鞍山市"},
316
+          {id:340600,name:"淮北市"},
317
+          {id:340700,name:"铜陵市"},
318
+          {id:340800,name:"安庆市"},
319
+          {id:341000,name:"黄山市"},
320
+          {id:341100,name:"滁州市"},
321
+          {id:341200,name:"阜阳市"},
322
+          {id:341300,name:"宿州市"},
323
+          {id:341500,name:"六安市"},
324
+          {id:341600,name:"亳州市"},
325
+          {id:341700,name:"池州市"},
326
+          {id:341800,name:"宣城市"},
327
+          {id:350000,name:"福建省"},
328
+          {id:350100,name:"福州市"},
329
+          {id:350200,name:"厦门市"},
330
+          {id:350300,name:"莆田市"},
331
+          {id:350400,name:"三明市"},
332
+          {id:350500,name:"泉州市"},
333
+          {id:350600,name:"漳州市"},
334
+          {id:350700,name:"南平市"},
335
+          {id:350800,name:"龙岩市"},
336
+          {id:350900,name:"宁德市"},
337
+          {id:360000,name:"江西省"},
338
+          {id:360100,name:"南昌市"},
339
+          {id:360200,name:"景德镇市"},
340
+          {id:360300,name:"萍乡市"},
341
+          {id:360400,name:"九江市"},
342
+          {id:360500,name:"新余市"},
343
+          {id:360600,name:"鹰潭市"},
344
+          {id:360700,name:"赣州市"},
345
+          {id:360800,name:"吉安市"},
346
+          {id:360900,name:"宜春市"},
347
+          {id:361000,name:"抚州市"},
348
+          {id:361100,name:"上饶市"},
349
+          {id:370000,name:"山东省"},
350
+          {id:370100,name:"济南市"},
351
+          {id:370200,name:"青岛市"},
352
+          {id:370300,name:"淄博市"},
353
+          {id:370400,name:"枣庄市"},
354
+          {id:370500,name:"东营市"},
355
+          {id:370600,name:"烟台市"},
356
+          {id:370700,name:"潍坊市"},
357
+          {id:370800,name:"济宁市"},
358
+          {id:370900,name:"泰安市"},
359
+          {id:371000,name:"威海市"},
360
+          {id:371100,name:"日照市"},
361
+          {id:371300,name:"临沂市"},
362
+          {id:371400,name:"德州市"},
363
+          {id:371500,name:"聊城市"},
364
+          {id:371600,name:"滨州市"},
365
+          {id:371700,name:"菏泽市"},
366
+          {id:410000,name:"河南省"},
367
+          {id:410100,name:"郑州市"},
368
+          {id:410200,name:"开封市"},
369
+          {id:410300,name:"洛阳市"},
370
+          {id:410400,name:"平顶山市"},
371
+          {id:410500,name:"安阳市"},
372
+          {id:410600,name:"鹤壁市"},
373
+          {id:410700,name:"新乡市"},
374
+          {id:410800,name:"焦作市"},
375
+          {id:410900,name:"濮阳市"},
376
+          {id:411000,name:"许昌市"},
377
+          {id:411100,name:"漯河市"},
378
+          {id:411200,name:"三门峡市"},
379
+          {id:411300,name:"南阳市"},
380
+          {id:411400,name:"商丘市"},
381
+          {id:411500,name:"信阳市"},
382
+          {id:411600,name:"周口市"},
383
+          {id:411700,name:"驻马店市"},
384
+          {id:420000,name:"湖北省"},
385
+          {id:420100,name:"武汉市"},
386
+          {id:420200,name:"黄石市"},
387
+          {id:420300,name:"十堰市"},
388
+          {id:420500,name:"宜昌市"},
389
+          {id:420600,name:"襄阳市"},
390
+          {id:420700,name:"鄂州市"},
391
+          {id:420800,name:"荆门市"},
392
+          {id:420900,name:"孝感市"},
393
+          {id:421000,name:"荆州市"},
394
+          {id:421100,name:"黄冈市"},
395
+          {id:421200,name:"咸宁市"},
396
+          {id:421300,name:"随州市"},
397
+          {id:422800,name:"恩施土家族苗族自治州"},
398
+          {id:430000,name:"湖南省"},
399
+          {id:430100,name:"长沙市"},
400
+          {id:430200,name:"株洲市"},
401
+          {id:430300,name:"湘潭市"},
402
+          {id:430400,name:"衡阳市"},
403
+          {id:430500,name:"邵阳市"},
404
+          {id:430600,name:"岳阳市"},
405
+          {id:430700,name:"常德市"},
406
+          {id:430800,name:"张家界市"},
407
+          {id:430900,name:"益阳市"},
408
+          {id:431000,name:"郴州市"},
409
+          {id:431100,name:"永州市"},
410
+          {id:431200,name:"怀化市"},
411
+          {id:431300,name:"娄底市"},
412
+          {id:433100,name:"湘西土家族苗族自治州"},
413
+          {id:440000,name:"广东省"},
414
+          {id:440100,name:"广州市"},
415
+          {id:440200,name:"韶关市"},
416
+          {id:440300,name:"深圳市"},
417
+          {id:440400,name:"珠海市"},
418
+          {id:440500,name:"汕头市"},
419
+          {id:440600,name:"佛山市"},
420
+          {id:440700,name:"江门市"},
421
+          {id:440800,name:"湛江市"},
422
+          {id:440900,name:"茂名市"},
423
+          {id:441200,name:"肇庆市"},
424
+          {id:441300,name:"惠州市"},
425
+          {id:441400,name:"梅州市"},
426
+          {id:441500,name:"汕尾市"},
427
+          {id:441600,name:"河源市"},
428
+          {id:441700,name:"阳江市"},
429
+          {id:441800,name:"清远市"},
430
+          {id:441900,name:"东莞市"},
431
+          {id:442000,name:"中山市"},
432
+          {id:445100,name:"潮州市"},
433
+          {id:445200,name:"揭阳市"},
434
+          {id:445300,name:"云浮市"},
435
+          {id:450000,name:"广西壮族自治区"},
436
+          {id:450100,name:"南宁市"},
437
+          {id:450200,name:"柳州市"},
438
+          {id:450300,name:"桂林市"},
439
+          {id:450400,name:"梧州市"},
440
+          {id:450500,name:"北海市"},
441
+          {id:450600,name:"防城港市"},
442
+          {id:450700,name:"钦州市"},
443
+          {id:450800,name:"贵港市"},
444
+          {id:450900,name:"玉林市"},
445
+          {id:451000,name:"百色市"},
446
+          {id:451100,name:"贺州市"},
447
+          {id:451200,name:"河池市"},
448
+          {id:451300,name:"来宾市"},
449
+          {id:451400,name:"崇左市"},
450
+          {id:460000,name:"海南省"},
451
+          {id:460100,name:"海口市"},
452
+          {id:460200,name:"三亚市"},
453
+          {id:460300,name:"三沙市"},
454
+          {id:460400,name:"儋州市"},
455
+          {id:500000,name:"重庆市"},
456
+          {id:510000,name:"四川省"},
457
+          {id:510100,name:"成都市"},
458
+          {id:510300,name:"自贡市"},
459
+          {id:510400,name:"攀枝花市"},
460
+          {id:510500,name:"泸州市"},
461
+          {id:510600,name:"德阳市"},
462
+          {id:510700,name:"绵阳市"},
463
+          {id:510800,name:"广元市"},
464
+          {id:510900,name:"遂宁市"},
465
+          {id:511000,name:"内江市"},
466
+          {id:511100,name:"乐山市"},
467
+          {id:511300,name:"南充市"},
468
+          {id:511400,name:"眉山市"},
469
+          {id:511500,name:"宜宾市"},
470
+          {id:511600,name:"广安市"},
471
+          {id:511700,name:"达州市"},
472
+          {id:511800,name:"雅安市"},
473
+          {id:511900,name:"巴中市"},
474
+          {id:512000,name:"资阳市"},
475
+          {id:513200,name:"阿坝藏族羌族自治州"},
476
+          {id:513300,name:"甘孜藏族自治州"},
477
+          {id:513400,name:"凉山彝族自治州"},
478
+          {id:520000,name:"贵州省"},
479
+          {id:520100,name:"贵阳市"},
480
+          {id:520200,name:"六盘水市"},
481
+          {id:520300,name:"遵义市"},
482
+          {id:520400,name:"安顺市"},
483
+          {id:520500,name:"毕节市"},
484
+          {id:520600,name:"铜仁市"},
485
+          {id:522300,name:"黔西南布依族苗族自治州"},
486
+          {id:522600,name:"黔东南苗族侗族自治州"},
487
+          {id:522700,name:"黔南布依族苗族自治州"},
488
+          {id:530000,name:"云南省"},
489
+          {id:530100,name:"昆明市"},
490
+          {id:530300,name:"曲靖市"},
491
+          {id:530400,name:"玉溪市"},
492
+          {id:530500,name:"保山市"},
493
+          {id:530600,name:"昭通市"},
494
+          {id:530700,name:"丽江市"},
495
+          {id:530800,name:"普洱市"},
496
+          {id:530900,name:"临沧市"},
497
+          {id:532300,name:"楚雄彝族自治州"},
498
+          {id:532500,name:"红河哈尼族彝族自治州"},
499
+          {id:532600,name:"文山壮族苗族自治州"},
500
+          {id:532800,name:"西双版纳傣族自治州"},
501
+          {id:532900,name:"大理白族自治州"},
502
+          {id:533100,name:"德宏傣族景颇族自治州"},
503
+          {id:533300,name:"怒江傈僳族自治州"},
504
+          {id:533400,name:"迪庆藏族自治州"},
505
+          {id:540000,name:"西藏自治区"},
506
+          {id:540100,name:"拉萨市"},
507
+          {id:540200,name:"日喀则市"},
508
+          {id:540300,name:"昌都市"},
509
+          {id:540400,name:"林芝市"},
510
+          {id:540500,name:"山南市"},
511
+          {id:540600,name:"那曲市"},
512
+          {id:542500,name:"阿里地区"},
513
+          {id:610000,name:"陕西省"},
514
+          {id:610100,name:"西安市"},
515
+          {id:610200,name:"铜川市"},
516
+          {id:610300,name:"宝鸡市"},
517
+          {id:610400,name:"咸阳市"},
518
+          {id:610500,name:"渭南市"},
519
+          {id:610600,name:"延安市"},
520
+          {id:610700,name:"汉中市"},
521
+          {id:610800,name:"榆林市"},
522
+          {id:610900,name:"安康市"},
523
+          {id:611000,name:"商洛市"},
524
+          {id:620000,name:"甘肃省"},
525
+          {id:620100,name:"兰州市"},
526
+          {id:620200,name:"嘉峪关市"},
527
+          {id:620300,name:"金昌市"},
528
+          {id:620400,name:"白银市"},
529
+          {id:620500,name:"天水市"},
530
+          {id:620600,name:"武威市"},
531
+          {id:620700,name:"张掖市"},
532
+          {id:620800,name:"平凉市"},
533
+          {id:620900,name:"酒泉市"},
534
+          {id:621000,name:"庆阳市"},
535
+          {id:621100,name:"定西市"},
536
+          {id:621200,name:"陇南市"},
537
+          {id:622900,name:"临夏回族自治州"},
538
+          {id:623000,name:"甘南藏族自治州"},
539
+          {id:630000,name:"青海省"},
540
+          {id:630100,name:"西宁市"},
541
+          {id:630200,name:"海东市"},
542
+          {id:632200,name:"海北藏族自治州"},
543
+          {id:632300,name:"黄南藏族自治州"},
544
+          {id:632500,name:"海南藏族自治州"},
545
+          {id:632600,name:"果洛藏族自治州"},
546
+          {id:632700,name:"玉树藏族自治州"},
547
+          {id:632800,name:"海西蒙古族藏族自治州"},
548
+          {id:640000,name:"宁夏回族自治区"},
549
+          {id:640100,name:"银川市"},
550
+          {id:640200,name:"石嘴山市"},
551
+          {id:640300,name:"吴忠市"},
552
+          {id:640400,name:"固原市"},
553
+          {id:640500,name:"中卫市"},
554
+          {id:650000,name:"新疆维吾尔自治区"},
555
+          {id:650100,name:"乌鲁木齐市"},
556
+          {id:650200,name:"克拉玛依市"},
557
+          {id:650400,name:"吐鲁番市"},
558
+          {id:650500,name:"哈密市"},
559
+          {id:652300,name:"昌吉回族自治州"},
560
+          {id:652700,name:"博尔塔拉蒙古自治州"},
561
+          {id:652800,name:"巴音郭楞蒙古自治州"},
562
+          {id:652900,name:"阿克苏地区"},
563
+          {id:653000,name:"克孜勒苏柯尔克孜自治州"},
564
+          {id:653100,name:"喀什地区"},
565
+          {id:653200,name:"和田地区"},
566
+          {id:654000,name:"伊犁哈萨克自治州"},
567
+          {id:654200,name:"塔城地区"},
568
+          {id:654300,name:"阿勒泰地区"},
569
+          {id:659001,name:"石河子市"},
570
+          {id:659002,name:"阿拉尔市"},
571
+          {id:659003,name:"图木舒克市"},
572
+          {id:659004,name:"五家渠市"},
573
+          {id:659005,name:"北屯市"},
574
+          {id:659006,name:"铁门关市"},
575
+          {id:659007,name:"双河市"},
576
+          {id:659008,name:"可克达拉市"},
577
+          {id:659009,name:"昆玉市"},
578
+          {id:710000,name:"台湾省"},
579
+          {id:810000,name:"香港特别行政区"},
580
+          {id:820000,name:"澳门特别行政区"}
581
+        ],
582
+
191 583
         read_loading:false,
192 584
         registers: [
193 585
           {value: 11, label: "普通门诊"},
@@ -215,6 +607,7 @@
215 607
 
216 608
         form: {
217 609
           id: '',
610
+          insuplc_admdvs:"",
218 611
           settlement_value: '',
219 612
           medical_insurance_card: '',
220 613
           name: '',
@@ -437,6 +830,23 @@
437 830
           })
438 831
           .catch(function(error) {
439 832
           })
833
+      },handleIconClick(){
834
+
835
+
836
+      },handleSelectTwo(item){
837
+          this.form.insuplc_admdvs = item.id
838
+
839
+      },  createFilter(queryString) {
840
+        console.log(queryString)
841
+        return (restaurant) => {
842
+          return (restaurant.name.indexOf(queryString) === 0 || restaurant.id.toString().indexOf(queryString) === 0);
843
+        };
844
+      }, querySearch(queryString, cb) {
845
+        var restaurants = this.area;
846
+        console.log(restaurants)
847
+        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
848
+        console.log(results)
849
+        cb(results);
440 850
       },
441 851
       check14(){
442 852
         if(this.form.social_type == 0 || this.form.social_type == ''){
@@ -549,98 +959,103 @@
549 959
 
550 960
         }
551 961
         this.read_loading = true
552
-        axios.get('http://127.0.0.1:9532/api/readcard', {
553
-          params: params
554
-        })
555
-          .then(function (response) {
556
-            if (response.data.state == 0) {
557
-              that.read_loading = false
962
+        {
963
+          axios.get('http://127.0.0.1:9532/api/readcard', {
964
+            params: params
965
+          })
966
+            .then(function (response) {
967
+              if (response.data.state == 0) {
968
+                that.read_loading = false
558 969
 
559
-              that.$message.error(response.data.msg)
560
-              return false
561
-            } else {
562
-              that.read_loading = false
563
-              var patient = response.data.data.patient
564
-              if (that.form.id_card_type == 1) {
565
-                that.form.id = patient.id
566
-                that.form.name = patient.name
567
-                that.form.gender = patient.gender
568
-                that.form.age = patient.age
569
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
570
-                that.form.phone = patient.phone
571
-                that.form.id_card = patient.id_card_no
572
-                that.form.medical_insurance_card = response.data.data.health_card_no
573
-
574
-                var thisLen = that.form.id_card.length
575
-                var birth = ''
576
-                if (thisLen == 15) {
577
-                  birth = '19' + that.form.id_card.substr(6, 6)
578
-                } else {
579
-                  birth = that.form.id_card.substr(6, 8)
580
-                }
581
-                var births =
582
-                  birth.substr(0, 4) +
583
-                  '-' +
584
-                  birth.substr(4, 2) +
585
-                  '-' +
586
-                  birth.substr(6, 2)
587
-                that.form.age = jsGetAge(births, '-')
588
-
589
-
590
-              } else if (that.form.id_card_type == 2) {
591
-                that.form.id = patient.id
592
-                that.form.name = patient.name
593
-                that.form.gender = patient.gender
594
-                that.form.age = patient.age
595
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
596
-                that.form.phone = patient.phone
597
-                that.form.id_card = patient.id_card_no
598
-
599
-                var thisLen = that.form.id_card.length
600
-                var birth = ''
601
-                if (thisLen == 15) {
602
-                  birth = '19' + that.form.id_card.substr(6, 6)
603
-                } else {
604
-                  birth = that.form.id_card.substr(6, 8)
605
-                }
606
-                var births =
607
-                  birth.substr(0, 4) +
608
-                  '-' +
609
-                  birth.substr(4, 2) +
610
-                  '-' +
611
-                  birth.substr(6, 2)
612
-                that.form.age = jsGetAge(births, '-')
613
-              }else  {
614
-                that.form.id = patient.id
615
-                that.form.name = patient.name
616
-                that.form.gender = patient.gender
617
-                that.form.age = patient.age
618
-                that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
619
-                that.form.phone = patient.phone
620
-                that.form.id_card = patient.id_card_no
621
-
622
-                var thisLen = that.form.id_card.length
623
-                var birth = ''
624
-                if (thisLen == 15) {
625
-                  birth = '19' + that.form.id_card.substr(6, 6)
626
-                } else {
627
-                  birth = that.form.id_card.substr(6, 8)
628
-                }
629
-                var births =
970
+                that.$message.error(response.data.msg)
971
+                return false
972
+              } else {
973
+                that.read_loading = false
974
+                var patient = response.data.data.patient
975
+                if (that.form.id_card_type == 1) {
976
+                  that.form.id = patient.id
977
+                  that.form.name = patient.name
978
+                  that.form.gender = patient.gender
979
+                  that.form.age = patient.age
980
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
981
+                  that.form.phone = patient.phone
982
+                  that.form.id_card = patient.id_card_no
983
+                  that.form.medical_insurance_card = response.data.data.health_card_no
984
+
985
+                  var thisLen = that.form.id_card.length
986
+                  var birth = ''
987
+                  if (thisLen == 15) {
988
+                    birth = '19' + that.form.id_card.substr(6, 6)
989
+                  } else {
990
+                    birth = that.form.id_card.substr(6, 8)
991
+                  }
992
+                  var births =
630 993
                     birth.substr(0, 4) +
631 994
                     '-' +
632 995
                     birth.substr(4, 2) +
633 996
                     '-' +
634 997
                     birth.substr(6, 2)
635
-                that.form.age = jsGetAge(births, '-')
998
+                  that.form.age = jsGetAge(births, '-')
999
+
1000
+
1001
+                } else if (that.form.id_card_type == 2) {
1002
+                  that.form.id = patient.id
1003
+                  that.form.name = patient.name
1004
+                  that.form.gender = patient.gender
1005
+                  that.form.age = patient.age
1006
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
1007
+                  that.form.phone = patient.phone
1008
+                  that.form.id_card = patient.id_card_no
1009
+
1010
+                  var thisLen = that.form.id_card.length
1011
+                  var birth = ''
1012
+                  if (thisLen == 15) {
1013
+                    birth = '19' + that.form.id_card.substr(6, 6)
1014
+                  } else {
1015
+                    birth = that.form.id_card.substr(6, 8)
1016
+                  }
1017
+                  var births =
1018
+                    birth.substr(0, 4) +
1019
+                    '-' +
1020
+                    birth.substr(4, 2) +
1021
+                    '-' +
1022
+                    birth.substr(6, 2)
1023
+                  that.form.age = jsGetAge(births, '-')
1024
+                }else  {
1025
+                  that.form.id = patient.id
1026
+                  that.form.name = patient.name
1027
+                  that.form.gender = patient.gender
1028
+                  that.form.age = patient.age
1029
+                  that.form.birthday = uParseTime(patient.birthday, '{y}-{m}-{d}')
1030
+                  that.form.phone = patient.phone
1031
+                  that.form.id_card = patient.id_card_no
1032
+
1033
+                  var thisLen = that.form.id_card.length
1034
+                  var birth = ''
1035
+                  if (thisLen == 15) {
1036
+                    birth = '19' + that.form.id_card.substr(6, 6)
1037
+                  } else {
1038
+                    birth = that.form.id_card.substr(6, 8)
1039
+                  }
1040
+                  var births =
1041
+                    birth.substr(0, 4) +
1042
+                    '-' +
1043
+                    birth.substr(4, 2) +
1044
+                    '-' +
1045
+                    birth.substr(6, 2)
1046
+                  that.form.age = jsGetAge(births, '-')
1047
+                }
1048
+                that.$message({message: '读卡成功', type: 'success'})
1049
+
636 1050
               }
637
-              that.$message({message: '读卡成功', type: 'success'})
1051
+            })
1052
+            .catch(function (error) {
638 1053
 
639
-            }
640
-          })
641
-          .catch(function (error) {
1054
+            });
1055
+
1056
+
1057
+        }
642 1058
 
643
-          });
644 1059
 
645 1060
 
646 1061
       },

+ 2 - 2
src/xt_pages/outpatientCharges/listPrint.vue View File

@@ -146,8 +146,8 @@
146 146
                   }
147 147
                 }
148 148
                 obj.total = this.getTotal(tempDetails)
149
-                obj.jiaTotal = this.getJiaTotal(tempDetails)
150
-                obj.yiTotal = this.getYiTotal(tempDetails)
149
+                obj.jiaTotal = this.getJiaTotal(tempDetails,this.hospital_record.balance_accounts_type)
150
+                obj.yiTotal = this.getYiTotal(tempDetails,this.hospital_record.balance_accounts_type)
151 151
                 obj.noMedicineTotal = this.getNoMedicineTotal(tempDetails)
152 152
                 obj.bingTotal = this.getBingTotal(tempDetails)
153 153
                 obj.otherTotal = this.getOtherTotal(tempDetails)

+ 6 - 6
src/xt_pages/outpatientCharges/statementPrint.vue View File

@@ -40,7 +40,6 @@
40 40
           :paramsObj="paramsObj"
41 41
           :balanceAccounts="balanceAccounts"
42 42
         ></printFour>
43
-        <!--        <privateChargePrint  :info="info" v-if="org_id == 10215 && this.paramsObj.balance_accounts_type == 2"></privateChargePrint>-->
44 43
       </div>
45 44
       <!--      <print-other :info="info" v-if="org_id == 9919"></print-other>-->
46 45
       <!--      <printOne :info=" info" v-if="org_id == 10215 && this.paramsObj.balance_accounts_type == 2"></printOne>-->
@@ -65,8 +64,13 @@
65 64
             org_id != 9504 &&
66 65
             org_id != 10028 &&
67 66
             org_id != 0 &&
68
-            org_id != 10278 && org_id != 10387 && org_id != 0 && org_id != 10191 &&org_id != 10210"></printOne>
67
+            org_id != 10278 && org_id != 10387 && org_id != 0 && org_id != 10191 &&org_id != 10210 && this.paramsObj.balance_accounts_type == 1"></printOne>
69 68
 
69
+      <privateChargePrint  :info="info" v-if="org_id != 9990 &&
70
+            org_id != 10138 &&
71
+            org_id != 9504 &&
72
+            org_id != 10028 &&
73
+            org_id != 10278 && org_id != 10387 && org_id != 10191 &&org_id != 10210 && this.paramsObj.balance_accounts_type == 2"></privateChargePrint>
70 74
     </div>
71 75
   </div>
72 76
 </template>
@@ -75,11 +79,9 @@
75 79
   import {uParseTime} from "@/utils/tools";
76 80
   import axios from "axios";
77 81
   import print from "print-js";
78
-
79 82
   import BreadCrumb from "@/xt_pages/components/bread-crumb";
80 83
   import printOne from "./statementTemplate/printOne";
81 84
   import privateChargePrint from "./statementTemplate/privateChargePrint";
82
-
83 85
   import printTwo from "./statementTemplate/printTwo";
84 86
   import printThree from "./statementTemplate/printThree";
85 87
   import printFour from "./statementTemplate/printFour";
@@ -90,8 +92,6 @@
90 92
   import printSeven from "./statementTemplate/printSeven";
91 93
   import Print10191 from "./statementTemplate/print10191";
92 94
   import printTen from "./statementTemplate/printTen";
93
-
94
-  // import PrintOther from '../hospitalStation/statementTemplate/printOther'
95 95
   export default {
96 96
     name: "dialysisPrintOrder",
97 97
     components: {

+ 21 - 11
src/xt_pages/outpatientCharges/statementTemplate/printOne.vue View File

@@ -42,7 +42,7 @@
42 42
         <td width="50" v-if="info.gend == '2'">女</td>
43 43
 
44 44
         <td width="80">出生日期</td>
45
-        <td width="100">{{info.brdy}}</td>
45
+        <td width="100">{{getBirth(info.certno)}}</td>
46 46
         <td width="90">个人电脑号</td>
47 47
         <td width="110"></td>
48 48
         <td width="80">人员类别</td>
@@ -114,11 +114,14 @@
114 114
         <td colspan="2" v-if="info.insutype == '392'">城乡居民大病医疗保险</td>
115 115
         <td colspan="2" v-if="info.insutype == '510'">生育保险</td>
116 116
 
117
-
118
-        <td>入院第一诊断</td>
119
-        <td colspan="3">{{info.dise_name}}</td>
120
-        <td>出院第一诊断</td>
121
-        <td colspan="6">{{info.dise_name}}</td>
117
+        <td v-if="this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217">入院第一诊断</td>
118
+        <td v-else>病种名称</td>
119
+        <td v-if="this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217" colspan="3">{{info.dise_name}}</td>
120
+        <td v-else colspan="3">{{'慢性肾功能衰竭'}}</td>
121
+        <td v-if="this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217">出院第一诊断</td>
122
+        <td v-else>病种编码</td>
123
+        <td v-if="this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217" colspan="6">{{info.dise_name}}</td>
124
+        <td v-else colspan="6">{{'M07800'}}</td>
122 125
       </tr>
123 126
       <tr>
124 127
         <td>业务类别</td>
@@ -135,9 +138,8 @@
135 138
       </tr>
136 139
       <tr>
137 140
         <td colspan="12" style="text-align:left;padding-left:10px;">
138
-          本次就医:总费用{{info.medfee_sumamt}}元,基金支付{{info.fund_pay_sumamt}}元,个人支付{{info.psn_pay}}元。
139
-          (起付线 {{info.act_pay_dedc}}元, 先自付 {{info.preselfpay_amt}}元, 段内自付 {{(info.psn_pay - info.preselfpay_amt).toFixed(2)}} )
140
-
141
+          本次就医:总费用{{info.medfee_sumamt}}元,基金支付{{info.fund_pay_sumamt}}元,个人支付{{info.new_order.psn_cash_pay}}元。
142
+          (起付线 {{info.act_pay_dedc}}元, 先自付 {{info.preselfpay_amt}}元, 段内自付 {{(info.new_order.psn_cash_pay - info.preselfpay_amt).toFixed(2)}} )
141 143
         </td>
142 144
       </tr>
143 145
       <tr>
@@ -264,11 +266,13 @@
264 266
           parseFloat(info.check_cost_part_self_total) + parseFloat(info.laboratory_cost_part_self_total) +
265 267
           parseFloat(info.treat_cost_part_self_total)).toFixed(2)}}
266 268
         </td>
267
-        <td style="text-align:right;padding-right:10px;"></td>
269
+
270
+        <td>报销比例</td>
271
+        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.new_order.pool_prop_selfpay}}</td>
268 272
         <td colspan="2" style="text-align:right;padding-right:10px;"></td>
269
-        <td style="text-align:right;padding-right:10px;"></td>
270 273
         <td colspan="2" style="text-align:right;padding-right:10px;"></td>
271 274
       </tr>
275
+
272 276
       <tr>
273 277
         <td colspan="3" style="text-align:left;padding-left:10px;">基本医疗保险统筹基金支付</td>
274 278
         <td colspan="3">{{info.hifp_pay}}</td>
@@ -340,6 +344,12 @@
340 344
         }
341 345
       }
342 346
     },methods:{
347
+      getBirth(idNo){
348
+        var year = idNo.substring(6, 10);
349
+        var month = idNo.substring(10, 12);
350
+        var day = idNo.substring(12, 14);
351
+        return  year + '-' + month + '-' + day;
352
+      },
343 353
       getDay(dateString1,dateString2){
344 354
           var  startDate = Date.parse(dateString1);
345 355
           var  endDate = Date.parse(dateString2);

File diff suppressed because it is too large
+ 723 - 723
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue


+ 2 - 2
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

@@ -165,7 +165,7 @@
165 165
                            :org_id="org_id"
166 166
                            ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
167 167
                            v-on:getSunziValue = "getSunziValue"
168
-                           :hisPatientInfo="hisPatientInfo" :patient_diagnoses="patient_diagnoses" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
168
+                           :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
169 169
                            v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
170 170
 
171 171
 
@@ -1470,7 +1470,7 @@ export default {
1470 1470
         'type': this.radio,
1471 1471
         'sch_type': this.schedule_type
1472 1472
       }
1473
-      
1473
+
1474 1474
       this.un_cure_data = []
1475 1475
       this.cure_data = []
1476 1476
       this.all_data = []

+ 3 - 3
src/xt_pages/outpatientDoctorStation/modeTemplateDetail.vue View File

@@ -1374,7 +1374,7 @@
1374 1374
           }
1375 1375
         }
1376 1376
         if (this.curStatus == 1 && this.rightTab == 2) {
1377
-          this.$message.error('处方是药品,无法添加项目')
1377
+          this.$message.error('处方是药品,无法添加项目')
1378 1378
           this.teamList = []
1379 1379
           this.$refs.tables.clearSelection()
1380 1380
 
@@ -1382,7 +1382,7 @@
1382 1382
         }
1383 1383
 
1384 1384
         if (this.curStatus == 2 && this.rightTab == 1) {
1385
-          this.$message.error('处方是项目,无法添加药品')
1385
+          this.$message.error('处方是项目,无法添加药品')
1386 1386
           this.curDrugs = []
1387 1387
           this.tempDrugs = []
1388 1388
           this.$refs.multipleTable.clearSelection()
@@ -1989,7 +1989,7 @@
1989 1989
         display: flex;
1990 1990
         flex-direction: column;
1991 1991
         position: relative;
1992
-        
1992
+
1993 1993
     .el-form-item {
1994 1994
         width: 33%;
1995 1995
         margin-bottom: 14px;

+ 2 - 2
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue View File

@@ -1412,7 +1412,7 @@
1412 1412
           }
1413 1413
         }
1414 1414
         if (this.curStatus == 1 && this.rightTab == 2) {
1415
-          this.$message.error('处方是药品,无法添加项目')
1415
+          this.$message.error('处方是药品,无法添加项目')
1416 1416
           this.teamList = []
1417 1417
           this.$refs.tables.clearSelection()
1418 1418
 
@@ -1420,7 +1420,7 @@
1420 1420
         }
1421 1421
 
1422 1422
         if (this.curStatus == 2 && this.rightTab == 1) {
1423
-          this.$message.error('处方是项目,无法添加药品')
1423
+          this.$message.error('处方是项目,无法添加药品')
1424 1424
           this.curDrugs = []
1425 1425
           this.tempDrugs = []
1426 1426
           this.$refs.multipleTable.clearSelection()

+ 42 - 0
src/xt_pages/outpatientTool/components/detailStatistics.vue View File

@@ -47,6 +47,9 @@
47 47
         >
48 48
         </el-date-picker>
49 49
         <el-button type="primary" size="small" @click="toPrint">打印</el-button>
50
+
51
+        <el-button type="primary" size="small" @click="toExport">导出</el-button>
52
+
50 53
       </div>
51 54
       <div></div>
52 55
     </div>
@@ -55,6 +58,7 @@
55 58
       border
56 59
       :row-style="{ color: '#303133' }"
57 60
       ref="table"
61
+
58 62
       :header-cell-style="{
59 63
         backgroundColor: 'rgb(245, 247, 250)',
60 64
         color: '#606266',
@@ -146,6 +150,25 @@
146 150
           </div>
147 151
         </template>
148 152
       </el-table-column>
153
+
154
+      <el-table-column align="center" label="先行支付" prop="total_price">
155
+        <template slot-scope="scope">
156
+          <div>
157
+            {{ scope.row.preselfpay_amt }}
158
+          </div>
159
+        </template>
160
+      </el-table-column>
161
+      <el-table-column align="center" label="限价金额" prop="total_price">
162
+        <template slot-scope="scope">
163
+          <div>
164
+            {{ scope.row.pric_uplmt_amt }}
165
+          </div>
166
+        </template>
167
+      </el-table-column>
168
+
169
+
170
+
171
+
149 172
       <el-table-column align="center" prop="name" label="备注">
150 173
         <template slot-scope="scope">
151 174
           <div>
@@ -434,6 +457,9 @@ export default {
434 457
             this.tableData = new_arr;
435 458
           }
436 459
         }
460
+        console.log("11111222")
461
+
462
+        console.log( this.tableData)
437 463
       });
438 464
     },
439 465
 
@@ -486,6 +512,22 @@ export default {
486 512
         }
487 513
       }
488 514
       return maf_pay.toFixed(2);
515
+    }, export_detail() {
516
+      console.log("~~~~~~~")
517
+
518
+      let list = []
519
+      import('@/vendor/Export2Excel').then(excel => {
520
+        const tHeader = [ ]
521
+        const filterVal = []
522
+        const data = this.formatJson(filterVal, list)
523
+        excel.export_json_to_excel1({
524
+          header: tHeader,
525
+          data,
526
+          filename: '结算明细',
527
+          ref:this.$refs['report-table'].$el
528
+        })
529
+      })
530
+
489 531
     },
490 532
     toPrint() {
491 533
       this.$router.push({

+ 86 - 84
src/xt_pages/outpatientTool/components/settle.vue View File

@@ -395,92 +395,94 @@ import { uParseTime } from '@/utils/tools'
395 395
         })
396 396
 
397 397
         return sums
398
-      }, export_detail() {
398
+      },
399
+      export_detail() {
400
+        console.log("~~~~~~~")
399 401
 
400 402
         let list = []
401
-        for (let i = 0; i < this.tableData.length; i++) {
402
-          let order = this.tableData[i]
403
-          let name = order.other_name
404
-          let id_card_no = order.id_card_no
405
-
406
-          let time = ''
407
-          let balance_accounts = ""
408
-          let med_type = ""
409
-          let medfee_sumamt = ""
410
-          let fund_pay_sumamt = ""
411
-          let acct_pay = ""
412
-          let psn_cash_pay = ""
413
-          let hifes_pay = ""
414
-          let hifmi_pay = ""
415
-          let hifp_pay = ""
416
-          let hifob_pay = ""
417
-          let maf_pay = ""
418
-          let time2 = ""
419
-          time2 = this.getTimes(order.settle_accounts_date)
420
-
421
-          let total = ""
422
-
423
-          if(order.setl_time.length == 0){
424
-
425
-            time = this.getTimes(order.settle_accounts_date)
426
-
427
-          }else {
428
-
429
-            time = order.setl_time.split(" ")[0]
430
-
431
-          }
432
-
433
-          if (order.is_medicine_insurance == 0) {
434
-            balance_accounts = '自费'
435
-          }
436
-
437
-          if (order.is_medicine_insurance == 1) {
438
-            balance_accounts = '医保'
439
-          }
440
-
441
-          if (order.med_type == '14') {
442
-            med_type = '门诊特殊病'
443
-          }
444
-
445
-          if (order.med_type == '11') {
446
-            med_type = '普通门诊'
447
-          }
448
-
449
-          medfee_sumamt = order.medfee_sumamt
450
-          fund_pay_sumamt = order.fund_pay_sumamt
451
-
452
-          acct_pay = order.acct_pay
453
-
454
-          psn_cash_pay = order.psn_cash_pay
455
-          hifes_pay = order.hifes_pay
456
-          hifmi_pay = order.hifmi_pay
457
-          hifp_pay = order.hifp_pay
458
-          hifob_pay = order.hifob_pay
459
-          maf_pay = order.maf_pay
460
-          total = order.total
461
-
462
-
463
-          let obj = {
464
-            '患者姓名': name,
465
-            '身份证': id_card_no,
466
-            '治疗日期': time2,
467
-            '结算日期': time,
468
-            '结算类型': balance_accounts,
469
-            '处方类型': med_type,
470
-            '医疗费总额': medfee_sumamt,
471
-            '基金支付金额': fund_pay_sumamt,
472
-            '基金统筹金额': hifp_pay,
473
-            '大额基金支付':hifob_pay,
474
-            '医疗救助基金':maf_pay,
475
-            '个人账户支付金额': acct_pay,
476
-            '个人支付基金': psn_cash_pay,
477
-            '企业补充医疗保险基金支出': hifes_pay,
478
-            '居民大病保险资金支出': hifmi_pay,
479
-            '费用总额':total,
480
-
481
-          }
482
-          list.push(obj)
483
-        }
403
+        // for (let i = 0; i < this.tableData.length; i++) {
404
+        //   let order = this.tableData[i]
405
+        //   let name = order.other_name
406
+        //   let id_card_no = order.id_card_no
407
+        //
408
+        //   let time = ''
409
+        //   let balance_accounts = ""
410
+        //   let med_type = ""
411
+        //   let medfee_sumamt = ""
412
+        //   let fund_pay_sumamt = ""
413
+        //   let acct_pay = ""
414
+        //   let psn_cash_pay = ""
415
+        //   let hifes_pay = ""
416
+        //   let hifmi_pay = ""
417
+        //   let hifp_pay = ""
418
+        //   let hifob_pay = ""
419
+        //   let maf_pay = ""
420
+        //   let time2 = ""
421
+        //   time2 = this.getTimes(order.settle_accounts_date)
422
+        //
423
+        //   let total = ""
424
+        //
425
+        //   if(order.setl_time.length == 0){
426
+        //
427
+        //     time = this.getTimes(order.settle_accounts_date)
428
+        //
429
+        //   }else {
430
+        //
431
+        //     time = order.setl_time.split(" ")[0]
432
+        //
433
+        //   }
434
+        //
435
+        //   if (order.is_medicine_insurance == 0) {
436
+        //     balance_accounts = '自费'
437
+        //   }
438
+        //
439
+        //   if (order.is_medicine_insurance == 1) {
440
+        //     balance_accounts = '医保'
441
+        //   }
442
+        //
443
+        //   if (order.med_type == '14') {
444
+        //     med_type = '门诊特殊病'
445
+        //   }
446
+        //
447
+        //   if (order.med_type == '11') {
448
+        //     med_type = '普通门诊'
449
+        //   }
450
+        //
451
+        //   medfee_sumamt = order.medfee_sumamt
452
+        //   fund_pay_sumamt = order.fund_pay_sumamt
453
+        //
454
+        //   acct_pay = order.acct_pay
455
+        //
456
+        //   psn_cash_pay = order.psn_cash_pay
457
+        //   hifes_pay = order.hifes_pay
458
+        //   hifmi_pay = order.hifmi_pay
459
+        //   hifp_pay = order.hifp_pay
460
+        //   hifob_pay = order.hifob_pay
461
+        //   maf_pay = order.maf_pay
462
+        //   total = order.total
463
+        //
464
+        //
465
+        //   let obj = {
466
+        //     '患者姓名': name,
467
+        //     '身份证': id_card_no,
468
+        //     '治疗日期': time2,
469
+        //     '结算日期': time,
470
+        //     '结算类型': balance_accounts,
471
+        //     '处方类型': med_type,
472
+        //     '医疗费总额': medfee_sumamt,
473
+        //     '基金支付金额': fund_pay_sumamt,
474
+        //     '基金统筹金额': hifp_pay,
475
+        //     '大额基金支付':hifob_pay,
476
+        //     '医疗救助基金':maf_pay,
477
+        //     '个人账户支付金额': acct_pay,
478
+        //     '个人支付基金': psn_cash_pay,
479
+        //     '企业补充医疗保险基金支出': hifes_pay,
480
+        //     '居民大病保险资金支出': hifmi_pay,
481
+        //     '费用总额':total,
482
+        //
483
+        //   }
484
+        //   list.push(obj)
485
+        // }
484 486
         import('@/vendor/Export2Excel').then(excel => {
485 487
           const tHeader = [ '患者姓名','身份证', '治疗日期','结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金','企业补充医疗保险基金支出','居民大病保险资金支出', '费用总额']
486 488
           const filterVal = [ '患者姓名','身份证', '治疗日期','结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金','企业补充医疗保险基金支出','居民大病保险资金支出',  '费用总额']