瀏覽代碼

提交代码

陈少旭 1 年之前
父節點
當前提交
cdc1a48b3a
共有 27 個文件被更改,包括 8545 次插入3138 次删除
  1. 23 0
      src/api/qcd.js
  2. 3 2
      src/lang/zh.js
  3. 64 3
      src/router/modules/Dialysisanalysis.js
  4. 2 2
      src/views/layout/components/Sidebar/index.vue
  5. 335 215
      src/xt_pages/Dialysisanalysis/albumin/albuminall.vue
  6. 627 199
      src/xt_pages/Dialysisanalysis/albumin/albuminalone.vue
  7. 335 215
      src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusall.vue
  8. 627 198
      src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusalone.vue
  9. 334 215
      src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumall.vue
  10. 627 198
      src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumalone.vue
  11. 335 215
      src/xt_pages/Dialysisanalysis/calcium/calciumall.vue
  12. 630 198
      src/xt_pages/Dialysisanalysis/calcium/calciumalone.vue
  13. 125 0
      src/xt_pages/Dialysisanalysis/components/BarChart.vue
  14. 261 0
      src/xt_pages/Dialysisanalysis/components/LineChart.vue
  15. 262 0
      src/xt_pages/Dialysisanalysis/components/LineChart1.vue
  16. 108 0
      src/xt_pages/Dialysisanalysis/components/PieChart.vue
  17. 336 214
      src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinall.vue
  18. 627 198
      src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinalone.vue
  19. 19 19
      src/xt_pages/Dialysisanalysis/otherIndicators/otherall.vue
  20. 630 198
      src/xt_pages/Dialysisanalysis/otherIndicators/otheralone.vue
  21. 335 215
      src/xt_pages/Dialysisanalysis/platelets/plateletsall.vue
  22. 627 198
      src/xt_pages/Dialysisanalysis/platelets/plateletsalone.vue
  23. 212 0
      src/xt_pages/Dialysisanalysis/print/print.vue
  24. 630 224
      src/xt_pages/Dialysisanalysis/qualitycontrol/individual.vue
  25. 421 207
      src/xt_pages/Dialysisanalysis/qualitycontrol/totalSstatistics.vue
  26. 4 1
      src/xt_pages/hospitalStation/hospitalBatchStatementPrint.vue
  27. 6 4
      src/xt_pages/outpatientCharges/outpatientChargesManagement.vue

+ 23 - 0
src/api/qcd.js 查看文件

@@ -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
+

+ 3 - 2
src/lang/zh.js 查看文件

@@ -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: '治疗签到',
@@ -295,7 +295,8 @@ export default {
295 295
     chargeDetailManagement: '收费明细',
296 296
     yidiClear: '异地清分',
297 297
     zeroSummary: '零用明细汇总',
298
-    hospitalhistory: '住院历史'
298
+    hospitalhistory: '住院历史',
299
+    Dialysisanalysis: '专业质控'
299 300
   },
300 301
   navbar: {
301 302
     logOut: '退出登录',

+ 64 - 3
src/router/modules/Dialysisanalysis.js 查看文件

@@ -7,7 +7,7 @@ export default {
7 7
   name: 'Dialysisanalysis',
8 8
   alwaysShow: true,
9 9
   meta: {
10
-    title: '透析分析',
10
+    title: '专业质控',
11 11
     icon: 'statistics'
12 12
   },
13 13
   children: [
@@ -20,6 +20,67 @@ export default {
20 20
         noCache: true
21 21
       }
22 22
     },
23
+    {
24
+      path: '/Dialysisanalysis/qualitycontrol/hemoglobin',
25
+      component: () => import('@/xt_pages/Dialysisanalysis/hemoglobin/index'),
26
+      name: 'thyroidGland',
27
+      meta: {
28
+        title: '血红蛋白',
29
+        noCache: true
30
+      }
31
+    },
32
+    {
33
+      path: '/Dialysisanalysis/qualitycontrol/bloodPotassium',
34
+      component: () => import('@/xt_pages/Dialysisanalysis/bloodPotassium/index'),
35
+      name: 'thyroidGland',
36
+      meta: {
37
+        title: '血钾',
38
+        noCache: true
39
+      }
40
+    },
41
+    {
42
+      path: '/Dialysisanalysis/qualitycontrol/albumin',
43
+      component: () => import('@/xt_pages/Dialysisanalysis/albumin/index'),
44
+      name: 'thyroidGland',
45
+      meta: {
46
+        title: '白蛋白',
47
+        noCache: true
48
+      }
49
+    },
50
+    {
51
+      path: '/Dialysisanalysis/qualitycontrol/bloodPhosphorus',
52
+      component: () => import('@/xt_pages/Dialysisanalysis/bloodPhosphorus/index'),
53
+      name: 'thyroidGland',
54
+      meta: {
55
+        title: '血磷',
56
+        noCache: true
57
+      }
58
+    }, {
59
+      path: '/Dialysisanalysis/qualitycontrol/calcium',
60
+      component: () => import('@/xt_pages/Dialysisanalysis/calcium/index'),
61
+      name: 'thyroidGland',
62
+      meta: {
63
+        title: '钙',
64
+        noCache: true
65
+      }},{
66
+      path: '/Dialysisanalysis/qualitycontrol/platelets',
67
+      component: () => import('@/xt_pages/Dialysisanalysis/platelets/index'),
68
+      name: 'thyroidGland',
69
+      meta: {
70
+        title: '血小板',
71
+        noCache: true
72
+      }
73
+    },{
74
+      path: '/Dialysisanalysis/qualitycontrol/print',
75
+      component: () => import('@/xt_pages/Dialysisanalysis/print/print'),
76
+      name: 'print',
77
+      hidden: true,
78
+      is_menu: false,
79
+      meta: {
80
+        title: 'print',
81
+        noCache: true
82
+      }
83
+    }
23 84
     // {
24 85
     //   path: '/Dialysisanalysis/hemoglobin',
25 86
     //   component: () => import('@/xt_pages/Dialysisanalysis/hemoglobin/index'),
@@ -101,7 +162,7 @@ export default {
101 162
     //     noCache: true
102 163
     //   }
103 164
     // },
104
-   
105
-  
165
+
166
+
106 167
   ]
107 168
 }

+ 2 - 2
src/views/layout/components/Sidebar/index.vue 查看文件

@@ -48,7 +48,7 @@ export default {
48 48
   },
49 49
   created(){
50 50
     if(this.navTitle == '透析管理'){
51
-      let nameArr = ['home','workforce', 'dialysisrecord', 'dialysis', 'medicalScheduling', 'signIndex', 'qcd', 'device', 'quality_control'];
51
+      let nameArr = ['home','workforce', 'dialysisrecord', 'dialysis', 'medicalScheduling', 'signIndex', 'qcd', 'device', 'quality_control','Dialysisanalysis'];
52 52
       // console.log('permission_routers',this.permission_routers)
53 53
       let routerArr = [];
54 54
       this.permission_routers.map(item => {
@@ -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 => {

+ 335 - 215
src/xt_pages/Dialysisanalysis/albumin/albuminall.vue 查看文件

@@ -1,249 +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
-              show: true,
185
-              formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
187
-            },
188
-            radius: "65%", //饼图半径
189
-            data: this.pieData
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,
190 159
           }
191
-        ]
192
-      };
193
-    //   console.log(this.seriesData);
194
-      const optionFree = {
195
-        series: [
196
-          {
197
-            data: this.seriesData,
198
-            type: "line",
199
-            smooth: true
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
+
200 168
           }
201
-        ]
202
-      };
203
-      this.myChart = echarts.init(document.getElementById("mychart"));
204
-      this.myChart.setOption(option);
205
-      //随着屏幕大小调节图表
206
-      window.addEventListener("resize", () => {
207
-        this.myChart.resize();
208
-      });
209
-    },
210
-    getSummaries(param) {
211
-        const { columns, data } = param;
212
-        const sums = [];
213
-        columns.forEach((column, index) => {
214
-          if (index === 0) {
215
-            sums[index] = '总价';
216
-            return;
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
+
217 177
           }
218
-          const values = data.map(item => Number(item[column.property]));
219
-          if (!values.every(value => isNaN(value))) {
220
-            sums[index] = values.reduce((prev, curr) => {
221
-              const value = Number(curr);
222
-              if (!isNaN(value)) {
223
-                return prev + curr;
224
-              } else {
225
-                return prev;
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'
208
+            },
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
219
+              }
220
+            ]
221
+          }
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
226 229
               }
227
-            }, 0);
228
-            sums[index] += ' 元';
229
-          } else {
230
-            sums[index] = 'N/A';
230
+            ]
231 231
           }
232
-        });
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
+      }
327
+    },
328
+
329
+
330
+    getSummaries(param) {
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
+      })
233 353
 
234
-        return sums;
354
+      return sums
235 355
     },
236
-    handleClick(id){
237
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
238 358
     }
239 359
   }
240 360
 
241 361
 }
242 362
 </script>
243 363
 <style lang="scss" scoped>
244
-.content_top{
245
-    display: flex;
246
-    justify-content: space-around;
247
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
248 368
 }
249
-</style>
369
+</style>

+ 627 - 199
src/xt_pages/Dialysisanalysis/albumin/albuminalone.vue 查看文件

@@ -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>

+ 335 - 215
src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusall.vue 查看文件

@@ -1,249 +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
-              show: true,
185
-              formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
187
-            },
188
-            radius: "65%", //饼图半径
189
-            data: this.pieData
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,
190 159
           }
191
-        ]
192
-      };
193
-    //   console.log(this.seriesData);
194
-      const optionFree = {
195
-        series: [
196
-          {
197
-            data: this.seriesData,
198
-            type: "line",
199
-            smooth: true
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
+
200 168
           }
201
-        ]
202
-      };
203
-      this.myChart = echarts.init(document.getElementById("mychart"));
204
-      this.myChart.setOption(option);
205
-      //随着屏幕大小调节图表
206
-      window.addEventListener("resize", () => {
207
-        this.myChart.resize();
208
-      });
209
-    },
210
-    getSummaries(param) {
211
-        const { columns, data } = param;
212
-        const sums = [];
213
-        columns.forEach((column, index) => {
214
-          if (index === 0) {
215
-            sums[index] = '总价';
216
-            return;
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
+
217 177
           }
218
-          const values = data.map(item => Number(item[column.property]));
219
-          if (!values.every(value => isNaN(value))) {
220
-            sums[index] = values.reduce((prev, curr) => {
221
-              const value = Number(curr);
222
-              if (!isNaN(value)) {
223
-                return prev + curr;
224
-              } else {
225
-                return prev;
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'
208
+            },
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
219
+              }
220
+            ]
221
+          }
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
226 229
               }
227
-            }, 0);
228
-            sums[index] += ' 元';
229
-          } else {
230
-            sums[index] = 'N/A';
230
+            ]
231 231
           }
232
-        });
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
+      }
327
+    },
328
+
329
+
330
+    getSummaries(param) {
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
+      })
233 353
 
234
-        return sums;
354
+      return sums
235 355
     },
236
-    handleClick(id){
237
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
238 358
     }
239 359
   }
240 360
 
241 361
 }
242 362
 </script>
243 363
 <style lang="scss" scoped>
244
-.content_top{
245
-    display: flex;
246
-    justify-content: space-around;
247
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
248 368
 }
249
-</style>
369
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusalone.vue 查看文件

@@ -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>

+ 334 - 215
src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumall.vue 查看文件

@@ -1,249 +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
-              show: true,
185
-              formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
187
-            },
188
-            radius: "65%", //饼图半径
189
-            data: this.pieData
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,
190 158
           }
191
-        ]
192
-      };
193
-    //   console.log(this.seriesData);
194
-      const optionFree = {
195
-        series: [
196
-          {
197
-            data: this.seriesData,
198
-            type: "line",
199
-            smooth: true
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
+
200 167
           }
201
-        ]
202
-      };
203
-      this.myChart = echarts.init(document.getElementById("mychart"));
204
-      this.myChart.setOption(option);
205
-      //随着屏幕大小调节图表
206
-      window.addEventListener("resize", () => {
207
-        this.myChart.resize();
208
-      });
209
-    },
210
-    getSummaries(param) {
211
-        const { columns, data } = param;
212
-        const sums = [];
213
-        columns.forEach((column, index) => {
214
-          if (index === 0) {
215
-            sums[index] = '总价';
216
-            return;
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'
207
+            },
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
218
+              }
219
+            ]
217 220
           }
218
-          const values = data.map(item => Number(item[column.property]));
219
-          if (!values.every(value => isNaN(value))) {
220
-            sums[index] = values.reduce((prev, curr) => {
221
-              const value = Number(curr);
222
-              if (!isNaN(value)) {
223
-                return prev + curr;
224
-              } else {
225
-                return prev;
221
+          //   console.log(this.seriesData);
222
+          const optionFree = {
223
+            series: [
224
+              {
225
+                data: this.seriesData,
226
+                type: 'line',
227
+                smooth: true
226 228
               }
227
-            }, 0);
228
-            sums[index] += ' 元';
229
-          } else {
230
-            sums[index] = 'N/A';
229
+            ]
231 230
           }
232
-        });
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
+      }
326
+    },
327
+
328
+
329
+    getSummaries(param) {
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
+      })
233 352
 
234
-        return sums;
353
+      return sums
235 354
     },
236
-    handleClick(id){
237
-        console.log(id);
355
+    handleClick(id) {
356
+      console.log(id)
238 357
     }
239 358
   }
240 359
 
241 360
 }
242 361
 </script>
243 362
 <style lang="scss" scoped>
244
-.content_top{
245
-    display: flex;
246
-    justify-content: space-around;
247
-    color: #1e5feb;
363
+.content_top {
364
+  display: flex;
365
+  justify-content: space-around;
366
+  color: #1e5feb;
248 367
 }
249
-</style>
368
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumalone.vue 查看文件

@@ -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>

+ 335 - 215
src/xt_pages/Dialysisanalysis/calcium/calciumall.vue 查看文件

@@ -1,249 +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
-              show: true,
185
-              formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
187
-            },
188
-            radius: "65%", //饼图半径
189
-            data: this.pieData
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,
190 159
           }
191
-        ]
192
-      };
193
-    //   console.log(this.seriesData);
194
-      const optionFree = {
195
-        series: [
196
-          {
197
-            data: this.seriesData,
198
-            type: "line",
199
-            smooth: true
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
+
200 168
           }
201
-        ]
202
-      };
203
-      this.myChart = echarts.init(document.getElementById("mychart"));
204
-      this.myChart.setOption(option);
205
-      //随着屏幕大小调节图表
206
-      window.addEventListener("resize", () => {
207
-        this.myChart.resize();
208
-      });
209
-    },
210
-    getSummaries(param) {
211
-        const { columns, data } = param;
212
-        const sums = [];
213
-        columns.forEach((column, index) => {
214
-          if (index === 0) {
215
-            sums[index] = '总价';
216
-            return;
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
+
217 177
           }
218
-          const values = data.map(item => Number(item[column.property]));
219
-          if (!values.every(value => isNaN(value))) {
220
-            sums[index] = values.reduce((prev, curr) => {
221
-              const value = Number(curr);
222
-              if (!isNaN(value)) {
223
-                return prev + curr;
224
-              } else {
225
-                return prev;
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'
208
+            },
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
219
+              }
220
+            ]
221
+          }
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
226 229
               }
227
-            }, 0);
228
-            sums[index] += ' 元';
229
-          } else {
230
-            sums[index] = 'N/A';
230
+            ]
231 231
           }
232
-        });
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
+      }
327
+    },
328
+
329
+
330
+    getSummaries(param) {
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
+      })
233 353
 
234
-        return sums;
354
+      return sums
235 355
     },
236
-    handleClick(id){
237
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
238 358
     }
239 359
   }
240 360
 
241 361
 }
242 362
 </script>
243 363
 <style lang="scss" scoped>
244
-.content_top{
245
-    display: flex;
246
-    justify-content: space-around;
247
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
248 368
 }
249
-</style>
369
+</style>

+ 630 - 198
src/xt_pages/Dialysisanalysis/calcium/calciumalone.vue 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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>

+ 336 - 214
src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinall.vue 查看文件

@@ -1,248 +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
-              show: true,
184
-              formatter:"{b} : {d}% ({c})"
185
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
186
-            },
187
-            radius: "65%", //饼图半径
188
-            data: this.pieData
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,
189 160
           }
190
-        ]
191
-      };
192
-    //   console.log(this.seriesData);
193
-      const optionFree = {
194
-        series: [
195
-          {
196
-            data: this.seriesData,
197
-            type: "line",
198
-            smooth: true
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
+
199 169
           }
200
-        ]
201
-      };
202
-      this.myChart = echarts.init(document.getElementById("mychart"));
203
-      this.myChart.setOption(option);
204
-      //随着屏幕大小调节图表
205
-      window.addEventListener("resize", () => {
206
-        this.myChart.resize();
207
-      });
208
-    },
209
-    getSummaries(param) {
210
-        const { columns, data } = param;
211
-        const sums = [];
212
-        columns.forEach((column, index) => {
213
-          if (index === 0) {
214
-            sums[index] = '总价';
215
-            return;
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
216 190
           }
217
-          const values = data.map(item => Number(item[column.property]));
218
-          if (!values.every(value => isNaN(value))) {
219
-            sums[index] = values.reduce((prev, curr) => {
220
-              const value = Number(curr);
221
-              if (!isNaN(value)) {
222
-                return prev + curr;
223
-              } else {
224
-                return prev;
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'
202
+            },
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
220
+              }
221
+            ]
222
+          }
223
+          //   console.log(this.seriesData);
224
+          const optionFree = {
225
+            series: [
226
+              {
227
+                data: this.seriesData,
228
+                type: 'line',
229
+                smooth: true
225 230
               }
226
-            }, 0);
227
-            sums[index] += ' 元';
228
-          } else {
229
-            sums[index] = 'N/A';
231
+            ]
230 232
           }
231
-        });
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
+
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
+
331
+    getSummaries(param) {
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
+      })
232 354
 
233
-        return sums;
355
+      return sums
234 356
     },
235
-    handleClick(id){
236
-        console.log(id);
357
+    handleClick(id) {
358
+      console.log(id)
237 359
     }
238 360
   }
239 361
 
240 362
 }
241 363
 </script>
242 364
 <style lang="scss" scoped>
243
-.content_top{
244
-    display: flex;
245
-    justify-content: space-around;
246
-    color: #1e5feb;
365
+.content_top {
366
+  display: flex;
367
+  justify-content: space-around;
368
+  color: #1e5feb;
247 369
 }
248
-</style>
370
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinalone.vue 查看文件

@@ -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>

+ 19 - 19
src/xt_pages/Dialysisanalysis/otherIndicators/otherall.vue 查看文件

@@ -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"},
@@ -183,7 +183,7 @@ export default{
183 183
             label: {
184 184
               show: true,
185 185
               formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
186
+              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
187 187
             },
188 188
             radius: "65%", //饼图半径
189 189
             data: this.pieData
@@ -246,4 +246,4 @@ export default{
246 246
     justify-content: space-around;
247 247
     color: #1e5feb;
248 248
 }
249
-</style>
249
+</style>

+ 630 - 198
src/xt_pages/Dialysisanalysis/otherIndicators/otheralone.vue 查看文件

@@ -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>

+ 335 - 215
src/xt_pages/Dialysisanalysis/platelets/plateletsall.vue 查看文件

@@ -1,249 +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
-              show: true,
185
-              formatter:"{b} : {d}% ({c})"
186
-              // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
187
-            },
188
-            radius: "65%", //饼图半径
189
-            data: this.pieData
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,
190 159
           }
191
-        ]
192
-      };
193
-    //   console.log(this.seriesData);
194
-      const optionFree = {
195
-        series: [
196
-          {
197
-            data: this.seriesData,
198
-            type: "line",
199
-            smooth: true
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
+
200 168
           }
201
-        ]
202
-      };
203
-      this.myChart = echarts.init(document.getElementById("mychart"));
204
-      this.myChart.setOption(option);
205
-      //随着屏幕大小调节图表
206
-      window.addEventListener("resize", () => {
207
-        this.myChart.resize();
208
-      });
209
-    },
210
-    getSummaries(param) {
211
-        const { columns, data } = param;
212
-        const sums = [];
213
-        columns.forEach((column, index) => {
214
-          if (index === 0) {
215
-            sums[index] = '总价';
216
-            return;
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
+
217 177
           }
218
-          const values = data.map(item => Number(item[column.property]));
219
-          if (!values.every(value => isNaN(value))) {
220
-            sums[index] = values.reduce((prev, curr) => {
221
-              const value = Number(curr);
222
-              if (!isNaN(value)) {
223
-                return prev + curr;
224
-              } else {
225
-                return prev;
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'
208
+            },
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
219
+              }
220
+            ]
221
+          }
222
+          //   console.log(this.seriesData);
223
+          const optionFree = {
224
+            series: [
225
+              {
226
+                data: this.seriesData,
227
+                type: 'line',
228
+                smooth: true
226 229
               }
227
-            }, 0);
228
-            sums[index] += ' 元';
229
-          } else {
230
-            sums[index] = 'N/A';
230
+            ]
231 231
           }
232
-        });
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
+      }
327
+    },
328
+
329
+
330
+    getSummaries(param) {
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
+      })
233 353
 
234
-        return sums;
354
+      return sums
235 355
     },
236
-    handleClick(id){
237
-        console.log(id);
356
+    handleClick(id) {
357
+      console.log(id)
238 358
     }
239 359
   }
240 360
 
241 361
 }
242 362
 </script>
243 363
 <style lang="scss" scoped>
244
-.content_top{
245
-    display: flex;
246
-    justify-content: space-around;
247
-    color: #1e5feb;
364
+.content_top {
365
+  display: flex;
366
+  justify-content: space-around;
367
+  color: #1e5feb;
248 368
 }
249
-</style>
369
+</style>

+ 627 - 198
src/xt_pages/Dialysisanalysis/platelets/plateletsalone.vue 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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>

+ 421 - 207
src/xt_pages/Dialysisanalysis/qualitycontrol/totalSstatistics.vue 查看文件

@@ -1,255 +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
-            show: true,
191
-            formatter:"{b} : {d}% ({c})"
192
-            // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})" 
193
-          },
194
-          radius: "65%", //饼图半径
195
-          data: this.pieData
196
-        }
197
-      ]
198
-    };
199
-  //   console.log(this.seriesData);
200
-    const optionFree = {
201
-      series: [
202
-        {
203
-          data: this.seriesData,
204
-          type: "line",
205
-          smooth: true
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
319
+              }
320
+            ]
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)
206 336
         }
207
-      ]
208
-    };
209
-    this.myChart = echarts.init(document.getElementById("mychart"));
210
-    this.myChart.setOption(option);
211
-    //随着屏幕大小调节图表
212
-  //   window.addEventListener("resize", () => {
213
-  //     this.myChart.resize();
214
-  //   });
215
-  },
216
-  getSummaries(param) {
217
-      const { columns, data } = param;
218
-      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 = []
219 433
       columns.forEach((column, index) => {
220 434
         if (index === 0) {
221
-          sums[index] = '总价';
222
-          return;
435
+          sums[index] = '总价'
436
+          return
223 437
         }
224
-        const values = data.map(item => Number(item[column.property]));
438
+        const values = data.map(item => Number(item[column.property]))
225 439
         if (!values.every(value => isNaN(value))) {
226 440
           sums[index] = values.reduce((prev, curr) => {
227
-            const value = Number(curr);
441
+            const value = Number(curr)
228 442
             if (!isNaN(value)) {
229
-              return prev + curr;
443
+              return prev + curr
230 444
             } else {
231
-              return prev;
445
+              return prev
232 446
             }
233
-          }, 0);
234
-          sums[index] += ' 元';
447
+          }, 0)
448
+          sums[index] += ' 元'
235 449
         } else {
236
-          sums[index] = 'N/A';
450
+          sums[index] = 'N/A'
237 451
         }
238
-      });
452
+      })
239 453
 
240
-      return sums;
241
-  },
242
-  handleClick(id){
243
-      console.log(id);
454
+      return sums
455
+    },
456
+    handleClick(id) {
457
+      console.log(id)
458
+    }
244 459
   }
245
-}
246 460
 
247 461
 }
248 462
 </script>
249 463
 <style lang="scss" scoped>
250
-.content_top{
464
+.content_top {
251 465
   display: flex;
252 466
   justify-content: space-around;
253 467
   color: #1e5feb;
254 468
 }
255
-</style>
469
+</style>

+ 4 - 1
src/xt_pages/hospitalStation/hospitalBatchStatementPrint.vue 查看文件

@@ -197,7 +197,7 @@ export default {
197 197
             return false
198 198
           } else {
199 199
             let infos = []
200
-            for(var i  = 0; i < response.data.data.infos; i++){
200
+            for(var i  = 0; i < response.data.data.infos.length; i++){
201 201
               var info = response.data.data.infos[i]
202 202
               that.info['patient'] = info.patient
203 203
               that.info['diagnosis'] = info.diagnosis
@@ -247,6 +247,9 @@ export default {
247 247
               infos.push(that.info)
248 248
             }
249 249
             that.infos = infos
250
+            console.log(infos)
251
+            console.log(that.infos)
252
+
250 253
 
251 254
           }
252 255
         })

+ 6 - 4
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue 查看文件

@@ -3658,7 +3658,7 @@ export default {
3658 3658
           "admin_user_id":this.$store.getters.xt_user.user.id,
3659 3659
           'his_patient_id': this.hisPatientInfo.id,
3660 3660
         }
3661
-        if ((this.$store.getters.xt_user.org_id == 10387) || (this.$store.getters.xt_user.org_id == 10318)){
3661
+        if ((this.$store.getters.xt_user.org_id == 10387)){
3662 3662
           try {
3663 3663
             //检测当前浏览器是否支持websocket模式
3664 3664
             window.WebSocket = window.WebSocket || window.MozWebSocket;
@@ -3671,9 +3671,11 @@ export default {
3671 3671
             this.ws.onopen = function(event){
3672 3672
               if (that.$store.getters.xt_user.org_id == 10387){
3673 3673
                 that.ws.send("{\"url\":\"http://10.93.33.243:20001/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01301\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"罗佳菊\",\"orgId\":\"H43082200408\"},\"orgId\":\"H43082200408\",\"transType\":\"ec.query\"}}");
3674
-              }else if(that.$store.getters.xt_user.org_id == 10318){
3675
-                that.ws.send("{\"url\":\"http://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01301\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"邹刘阳\",\"orgId\":\"H44011701749\"},\"orgId\":\"H44011701749\",\"transType\":\"ec.query\"}}");
3676
-              }else if(that.$store.getters.xt_user.org_id == 4){
3674
+              }
3675
+              // else if(that.$store.getters.xt_user.org_id == 10318){
3676
+              //   that.ws.send("{\"url\":\"http://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01301\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"邹刘阳\",\"orgId\":\"H44011701749\"},\"orgId\":\"H44011701749\",\"transType\":\"ec.query\"}}");
3677
+              // }
3678
+              else if(that.$store.getters.xt_user.org_id == 4){
3677 3679
                 that.ws.send("{\"url\":\"http://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery\",\"indata\":{\"data\":{\"businessType\":\"01301\",\"deviceType\":\"\",\"officeId\":\"32760\",\"officeName\":\"肾内科\",\"operatorId\":\"admin\",\"operatorName\":\"邹刘阳\",\"orgId\":\"H44011701749\"},\"orgId\":\"H44011701749\",\"transType\":\"ec.query\"}}");
3678 3680
               }
3679 3681
             };