Browse Source

提交代码

陈少旭 1 year ago
parent
commit
d0dc1761d0

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

@@ -125,6 +125,15 @@ export function GetPersonQCStatistisData(params) {
125 125
   })
126 126
 }
127 127
 
128
+export function GetAllQCStatistisData(params) {
129
+  return request({
130
+    url: '/api/qc/patientstatistiscall/get',
131
+    method: 'get',
132
+    params: params
133
+  })
134
+}
135
+
136
+
128 137
 
129 138
 
130 139
 

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

@@ -100,10 +100,10 @@
100 100
             </el-select>
101 101
           </div>
102 102
         </el-col>
103
-        <el-col :span="9">
103
+        <el-col :span="10">
104 104
           <div>
105 105
             <el-date-picker
106
-              style="width: 150px"
106
+              style="width: 120px"
107 107
               v-model="start_time_one"
108 108
               format="yyyy-MM-dd"
109 109
               value-format="yyyy-MM-dd"
@@ -113,7 +113,7 @@
113 113
             </el-date-picker>
114 114
             <span>-</span>
115 115
             <el-date-picker
116
-              style="width: 150px"
116
+              style="width: 120px"
117 117
               v-model="end_time_one"
118 118
               format="yyyy-MM-dd"
119 119
               value-format="yyyy-MM-dd"
@@ -167,15 +167,15 @@
167 167
 
168 168
         <el-col :span="2">
169 169
           <div>
170
-            <el-button @click="getDataTwo()">导出</el-button>
170
+            <el-button @click="exportAction()">导出</el-button>
171 171
           </div>
172 172
         </el-col>
173 173
 
174
-        <el-col :span="2">
175
-          <div>
176
-            <el-button @click="getDataTwo()">打印</el-button>
177
-          </div>
178
-        </el-col>
174
+<!--        <el-col :span="2">-->
175
+<!--          <div>-->
176
+<!--            <el-button @click="getDataTwo()">打印</el-button>-->
177
+<!--          </div>-->
178
+<!--        </el-col>-->
179 179
 
180 180
 
181 181
 
@@ -295,11 +295,11 @@ export default {
295 295
   methods: {
296 296
     exportAction(){
297 297
       let list = []
298
-      for (let i = 0; i < this.tableData.length; i++) {
299
-        let order = this.tableData[i]
298
+      for (let i = 0; i < this.patientTableData.length; i++) {
299
+        let order = this.patientTableData[i]
300 300
         let name = order.name
301
-        let value = order.value
302
-        let inspect_date = order.inspect_date
301
+        let value = order.inspect_value
302
+        let inspect_date = order.date
303 303
 
304 304
         let obj = {
305 305
           '姓名': name,
@@ -320,7 +320,9 @@ export default {
320 320
         })
321 321
       })
322 322
     },
323
-
323
+    formatJson(filterVal, jsonData) {
324
+    return jsonData.map(v => filterVal.map(j => v[j]))
325
+  },
324 326
     getDataTwo() {
325 327
       if(this.start_time_one.length == 0){
326 328
         this.$message.error("请选择开始时间")
@@ -622,8 +624,6 @@ export default {
622 624
       }
623 625
     },
624 626
 
625
-
626
-
627 627
     getSummaries(param) {
628 628
       const { columns, data } = param
629 629
       const sums = []

+ 319 - 13
src/xt_pages/Dialysisanalysis/bloodPhosphorus/phosphorusall.vue View File

@@ -68,23 +68,163 @@
68 68
           label="人数"
69 69
         >
70 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>-->
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 81
       </el-table>
82 82
     </div>
83
+    <el-dialog
84
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
85
+      :close-on-click-modal="isClose"
86
+      :close-on-press-escape="isClose"
87
+    >
88
+      <el-row :gutter="25">
89
+        <el-col :span="5">
90
+          <div class="block">
91
+            <span>查询时间:</span>
92
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
93
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
94
+              <el-option
95
+                v-for="item,index in times"
96
+                :key="index"
97
+                :label="item.label"
98
+                :value="item.value">
99
+              </el-option>
100
+            </el-select>
101
+          </div>
102
+        </el-col>
103
+        <el-col :span="10">
104
+          <div>
105
+            <el-date-picker
106
+              style="width: 120px"
107
+              v-model="start_time_one"
108
+              format="yyyy-MM-dd"
109
+              value-format="yyyy-MM-dd"
110
+              type="date"
111
+
112
+              placeholder="选择日期">
113
+            </el-date-picker>
114
+            <span>-</span>
115
+            <el-date-picker
116
+              style="width: 120px"
117
+              v-model="end_time_one"
118
+              format="yyyy-MM-dd"
119
+              value-format="yyyy-MM-dd"
120
+              type="date"
121
+              placeholder="选择日期">
122
+            </el-date-picker>
123
+          </div>
124
+        </el-col>
125
+
126
+        <el-col :span="4">
127
+          <div>
128
+
129
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
130
+                       style="width:100px;margin-left:5px;">
131
+              <el-option
132
+                v-for="item,index in statistics_types"
133
+                :key="index"
134
+                :label="item.label"
135
+                :value="item.value">
136
+              </el-option>
137
+            </el-select>
138
+
139
+          </div>
140
+        </el-col>
141
+
142
+        <!--        <el-col :span="4">-->
143
+        <!--          <div>-->
144
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
145
+        <!--                       style="width:100px;margin-left:5px;">-->
146
+        <!--              <el-option-->
147
+        <!--                v-for="item,index in sort_types"-->
148
+        <!--                :key="index"-->
149
+        <!--                :label="item.label"-->
150
+        <!--                :value="item.value">-->
151
+        <!--              </el-option>-->
152
+        <!--            </el-select>-->
153
+        <!--          </div>-->
154
+        <!--        </el-col>-->
155
+
156
+        <el-col :span="4">
157
+          <div >
158
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
159
+          </div>
160
+        </el-col>
161
+
162
+        <el-col :span="2">
163
+          <div>
164
+            <el-button @click="getDataTwo()">查询</el-button>
165
+          </div>
166
+        </el-col>
167
+
168
+        <el-col :span="2">
169
+          <div>
170
+            <el-button @click="exportAction()">导出</el-button>
171
+          </div>
172
+        </el-col>
173
+
174
+        <!--        <el-col :span="2">-->
175
+        <!--          <div>-->
176
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
177
+        <!--          </div>-->
178
+        <!--        </el-col>-->
179
+
180
+
181
+
182
+
183
+
184
+      </el-row>
185
+
186
+      <el-table
187
+        :data="patientTableData"
188
+        border
189
+        ref="table"
190
+        max-height="500px"
191
+        style="width: 100%">
192
+        <el-table-column
193
+          prop="dialysis_no"
194
+          align="center"
195
+          label="透析号"
196
+        >
197
+        </el-table-column>
198
+        <el-table-column
199
+          prop="name"
200
+          label="患者姓名"
201
+        >
202
+        </el-table-column>
203
+        <el-table-column
204
+          prop="date"
205
+          label="检查日期"
206
+        >
207
+        </el-table-column>
208
+
209
+        <el-table-column
210
+          prop="inspect_value"
211
+          label="结果"
212
+        >
213
+        </el-table-column>
214
+
215
+      </el-table>
216
+
217
+      <div slot="footer" class="dialog-footer">
218
+        <el-button @click="detailVisibility = false">取消</el-button>
219
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
220
+      </div>
221
+    </el-dialog>
222
+
83 223
   </div>
84 224
 </template>
85 225
 <script>
86 226
 import * as echarts from 'echarts'
87
-import { GetQCStatistisData } from '../../../api/qcd'
227
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
88 228
 
89 229
 const moment = require('moment')
90 230
 
@@ -103,6 +243,18 @@ export default {
103 243
   },
104 244
   data() {
105 245
     return {
246
+      statistics_types:[
247
+        { value: 1, label: '不达标患者' },
248
+        { value: 2, label: '未检查患者' },
249
+        { value: 3, label: '达标患者' },
250
+      ],
251
+      sort_types:[
252
+        { value: 1, label: '时间' },
253
+        { value: 2, label: '患者' },
254
+      ],
255
+      detailVisibility:false,
256
+      isClose:true,
257
+      time_type_two:1,
106 258
       time_type: 1,
107 259
       times: [
108 260
         { value: 1, label: '本月' },
@@ -119,6 +271,11 @@ export default {
119 271
       time_month: '',
120 272
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
121 273
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
274
+
275
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
276
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
277
+
278
+
122 279
       input: '',
123 280
       myChart: {},
124 281
       pieData: [],
@@ -126,12 +283,153 @@ export default {
126 283
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
127 284
       tableData: [],
128 285
       reference:{},
286
+      statistics_type:1,
287
+      sort_type:"",
288
+      keyword:"",
289
+      patientTableData:[],
129 290
     }
130 291
   },
131 292
   mounted() {
132 293
     this.getData()
133 294
   },
134 295
   methods: {
296
+    exportAction(){
297
+      let list = []
298
+      for (let i = 0; i < this.patientTableData.length; i++) {
299
+        let order = this.patientTableData[i]
300
+        let name = order.name
301
+        let value = order.inspect_value
302
+        let inspect_date = order.date
303
+
304
+        let obj = {
305
+          '姓名': name,
306
+          '数值': value,
307
+          '日期': inspect_date,
308
+        }
309
+        list.push(obj)
310
+      }
311
+      import('@/vendor/Export2Excel').then(excel => {
312
+        const tHeader = ['姓名', '数值', '日期']
313
+        const filterVal = ['姓名', '数值', '日期']
314
+        const data = this.formatJson(filterVal, list)
315
+        excel.export_json_to_excel1({
316
+          header: tHeader,
317
+          data,
318
+          filename: '明细',
319
+          ref: this.$refs['table'].$el
320
+        })
321
+      })
322
+    },
323
+    formatJson(filterVal, jsonData) {
324
+      return jsonData.map(v => filterVal.map(j => v[j]))
325
+    },
326
+    getDataTwo() {
327
+      if(this.start_time_one.length == 0){
328
+        this.$message.error("请选择开始时间")
329
+      }
330
+      if(this.end_time_one.length == 0){
331
+        this.$message.error("请选择结束时间")
332
+      }
333
+      let params = {
334
+        start_date: this.start_time_one,
335
+        end_date: this.end_time_one,
336
+        project_id: 4,
337
+        item_id: 169,
338
+        item_type:this.statistics_type,
339
+        order_type:this.sort_type,
340
+        keyword: this.keyword,
341
+      }
342
+      this.patientTableData = []
343
+      GetAllQCStatistisData(params).then(response => {
344
+        if (response.data.state == 1) {
345
+          this.detailVisibility = true
346
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
347
+        } else {
348
+          this.$message.error(response.data.msg)
349
+        }
350
+      })
351
+
352
+    },
353
+    changeItemTwo(val) {
354
+      const currentDate = new Date()
355
+      switch (val) {
356
+        case 1:
357
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
358
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
359
+          this.start_time_one = startOfMonth
360
+          this.end_time_one = endOfMonth
361
+          // this.getDataTwo()
362
+          break
363
+        case 2:
364
+          // 上月的起始日期和结束日期
365
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
366
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
367
+          this.start_time_one = startOfLastMonth
368
+          this.end_time_one = endOfLastMonth
369
+          // this.getDataTwo()
370
+          break
371
+        case 3:
372
+          // 今年的起始日期和结束日期
373
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
374
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
375
+
376
+          this.start_time_one = startOfYear
377
+          this.end_time_one = endOfYear
378
+          // this.getDataTwo()
379
+
380
+          break
381
+        case 4:
382
+          // 上一年的起始日期和结束日期
383
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
384
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
385
+
386
+          this.start_time_one = startOfLastYear
387
+          this.end_time_one = endOfLastYear
388
+          // this.getDataTwo()
389
+
390
+          break
391
+        case 5:
392
+          // 第一季度的起始日期和结束日期
393
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
394
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
395
+          this.start_time_one = startOfFirstQuarter
396
+          this.end_time_one = endOfFirstQuarter
397
+          // this.getDataTwo()
398
+          break
399
+        case 6:
400
+          // 第二季度的起始日期和结束日期
401
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
402
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
403
+          this.start_time_one = startOfSecondQuarter
404
+          this.end_time_one = endOfSecondQuarter
405
+          // this.getDataTwo()
406
+          break
407
+        case 7:
408
+          // 第三季度的起始日期和结束日期
409
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
410
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
411
+
412
+          this.start_time_one = startOfThirdQuarter
413
+          this.end_time_one = endOfThirdQuarter
414
+          // this.getDataTwo()
415
+
416
+          break
417
+        case 8:
418
+          // 第四季度的起始日期和结束日期
419
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
420
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
421
+
422
+          this.start_time_one = startOfFourthQuarter
423
+          this.end_time_one = endOfFourthQuarter
424
+          // this.getDataTwo()
425
+          break
426
+        case 9:
427
+          this.start_time_one = ''
428
+          this.end_time_one = ''
429
+          break
430
+      }
431
+    },
432
+
135 433
     getData() {
136 434
       if(this.start_time.length == 0){
137 435
         this.$message.error("请选择开始时间")
@@ -353,8 +651,16 @@ export default {
353 651
 
354 652
       return sums
355 653
     },
356
-    handleClick(id) {
357
-      console.log(id)
654
+    handleClick(row) {
655
+      console.log(row)
656
+      if(row.name == "不达标值患者"){
657
+        this.statistics_type = 1
658
+      }else if(row.name == "达标值患者"){
659
+        this.statistics_type = 3
660
+      }else {
661
+        this.statistics_type = 2
662
+      }
663
+      this.getDataTwo()
358 664
     }
359 665
   }
360 666
 

+ 320 - 14
src/xt_pages/Dialysisanalysis/bloodPotassium/potassiumall.vue View File

@@ -67,23 +67,163 @@
67 67
           label="人数"
68 68
         >
69 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>-->
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 80
       </el-table>
81 81
     </div>
82
+    <el-dialog
83
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
84
+      :close-on-click-modal="isClose"
85
+      :close-on-press-escape="isClose"
86
+    >
87
+      <el-row :gutter="25">
88
+        <el-col :span="5">
89
+          <div class="block">
90
+            <span>查询时间:</span>
91
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
92
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
93
+              <el-option
94
+                v-for="item,index in times"
95
+                :key="index"
96
+                :label="item.label"
97
+                :value="item.value">
98
+              </el-option>
99
+            </el-select>
100
+          </div>
101
+        </el-col>
102
+        <el-col :span="10">
103
+          <div>
104
+            <el-date-picker
105
+              style="width: 120px"
106
+              v-model="start_time_one"
107
+              format="yyyy-MM-dd"
108
+              value-format="yyyy-MM-dd"
109
+              type="date"
110
+
111
+              placeholder="选择日期">
112
+            </el-date-picker>
113
+            <span>-</span>
114
+            <el-date-picker
115
+              style="width: 120px"
116
+              v-model="end_time_one"
117
+              format="yyyy-MM-dd"
118
+              value-format="yyyy-MM-dd"
119
+              type="date"
120
+              placeholder="选择日期">
121
+            </el-date-picker>
122
+          </div>
123
+        </el-col>
124
+
125
+        <el-col :span="4">
126
+          <div>
127
+
128
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
129
+                       style="width:100px;margin-left:5px;">
130
+              <el-option
131
+                v-for="item,index in statistics_types"
132
+                :key="index"
133
+                :label="item.label"
134
+                :value="item.value">
135
+              </el-option>
136
+            </el-select>
137
+
138
+          </div>
139
+        </el-col>
140
+
141
+        <!--        <el-col :span="4">-->
142
+        <!--          <div>-->
143
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
144
+        <!--                       style="width:100px;margin-left:5px;">-->
145
+        <!--              <el-option-->
146
+        <!--                v-for="item,index in sort_types"-->
147
+        <!--                :key="index"-->
148
+        <!--                :label="item.label"-->
149
+        <!--                :value="item.value">-->
150
+        <!--              </el-option>-->
151
+        <!--            </el-select>-->
152
+        <!--          </div>-->
153
+        <!--        </el-col>-->
154
+
155
+        <el-col :span="4">
156
+          <div >
157
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
158
+          </div>
159
+        </el-col>
160
+
161
+        <el-col :span="2">
162
+          <div>
163
+            <el-button @click="getDataTwo()">查询</el-button>
164
+          </div>
165
+        </el-col>
166
+
167
+        <el-col :span="2">
168
+          <div>
169
+            <el-button @click="exportAction()">导出</el-button>
170
+          </div>
171
+        </el-col>
172
+
173
+        <!--        <el-col :span="2">-->
174
+        <!--          <div>-->
175
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
176
+        <!--          </div>-->
177
+        <!--        </el-col>-->
178
+
179
+
180
+
181
+
182
+
183
+      </el-row>
184
+
185
+      <el-table
186
+        :data="patientTableData"
187
+        border
188
+        ref="table"
189
+        max-height="500px"
190
+        style="width: 100%">
191
+        <el-table-column
192
+          prop="dialysis_no"
193
+          align="center"
194
+          label="透析号"
195
+        >
196
+        </el-table-column>
197
+        <el-table-column
198
+          prop="name"
199
+          label="患者姓名"
200
+        >
201
+        </el-table-column>
202
+        <el-table-column
203
+          prop="date"
204
+          label="检查日期"
205
+        >
206
+        </el-table-column>
207
+
208
+        <el-table-column
209
+          prop="inspect_value"
210
+          label="结果"
211
+        >
212
+        </el-table-column>
213
+
214
+      </el-table>
215
+
216
+      <div slot="footer" class="dialog-footer">
217
+        <el-button @click="detailVisibility = false">取消</el-button>
218
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
219
+      </div>
220
+    </el-dialog>
221
+
82 222
   </div>
83 223
 </template>
84 224
 <script>
85 225
 import * as echarts from 'echarts'
86
-import { GetQCStatistisData } from '../../../api/qcd'
226
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
87 227
 
88 228
 const moment = require('moment')
89 229
 
@@ -102,7 +242,19 @@ export default {
102 242
   },
103 243
   data() {
104 244
     return {
245
+      statistics_types:[
246
+        { value: 1, label: '不达标患者' },
247
+        { value: 2, label: '未检查患者' },
248
+        { value: 3, label: '达标患者' },
249
+      ],
250
+      sort_types:[
251
+        { value: 1, label: '时间' },
252
+        { value: 2, label: '患者' },
253
+      ],
254
+      detailVisibility:false,
255
+      isClose:true,
105 256
       time_type: 1,
257
+      time_type_two:1,
106 258
       times: [
107 259
         { value: 1, label: '本月' },
108 260
         { value: 2, label: '上月' },
@@ -118,6 +270,11 @@ export default {
118 270
       time_month: '',
119 271
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120 272
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
273
+
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
277
+
121 278
       input: '',
122 279
       myChart: {},
123 280
       pieData: [],
@@ -125,12 +282,74 @@ export default {
125 282
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
126 283
       tableData: [],
127 284
       reference:{},
285
+      statistics_type:1,
286
+      sort_type:"",
287
+      keyword:"",
288
+      patientTableData:[],
128 289
     }
129 290
   },
130 291
   mounted() {
131 292
     this.getData()
132 293
   },
133 294
   methods: {
295
+    exportAction(){
296
+      let list = []
297
+      for (let i = 0; i < this.patientTableData.length; i++) {
298
+        let order = this.patientTableData[i]
299
+        let name = order.name
300
+        let value = order.inspect_value
301
+        let inspect_date = order.date
302
+
303
+        let obj = {
304
+          '姓名': name,
305
+          '数值': value,
306
+          '日期': inspect_date,
307
+        }
308
+        list.push(obj)
309
+      }
310
+      import('@/vendor/Export2Excel').then(excel => {
311
+        const tHeader = ['姓名', '数值', '日期']
312
+        const filterVal = ['姓名', '数值', '日期']
313
+        const data = this.formatJson(filterVal, list)
314
+        excel.export_json_to_excel1({
315
+          header: tHeader,
316
+          data,
317
+          filename: '明细',
318
+          ref: this.$refs['table'].$el
319
+        })
320
+      })
321
+    },
322
+
323
+    formatJson(filterVal, jsonData) {
324
+      return jsonData.map(v => filterVal.map(j => v[j]))
325
+    },
326
+    getDataTwo() {
327
+      if(this.start_time_one.length == 0){
328
+        this.$message.error("请选择开始时间")
329
+      }
330
+      if(this.end_time_one.length == 0){
331
+        this.$message.error("请选择结束时间")
332
+      }
333
+      let params = {
334
+        start_date: this.start_time_one,
335
+        end_date: this.end_time_one,
336
+        project_id: 4,
337
+        item_id: 48,
338
+        item_type:this.statistics_type,
339
+        order_type:this.sort_type,
340
+        keyword: this.keyword,
341
+      }
342
+      this.patientTableData = []
343
+      GetAllQCStatistisData(params).then(response => {
344
+        if (response.data.state == 1) {
345
+          this.detailVisibility = true
346
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
347
+        } else {
348
+          this.$message.error(response.data.msg)
349
+        }
350
+      })
351
+
352
+    },
134 353
     getData() {
135 354
       if(this.start_time.length == 0){
136 355
         this.$message.error("请选择开始时间")
@@ -142,7 +361,7 @@ export default {
142 361
         start_date: this.start_time,
143 362
         end_date: this.end_time,
144 363
         project_id: 4,
145
-        item_id: 48
364
+        item_id: 48,
146 365
       }
147 366
       this.pieData = []
148 367
       this.tableData = []
@@ -324,6 +543,85 @@ export default {
324 543
           break
325 544
       }
326 545
     },
546
+    changeItemTwo(val) {
547
+      const currentDate = new Date()
548
+      switch (val) {
549
+        case 1:
550
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
551
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
552
+          this.start_time_one = startOfMonth
553
+          this.end_time_one = endOfMonth
554
+          // this.getDataTwo()
555
+          break
556
+        case 2:
557
+          // 上月的起始日期和结束日期
558
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
559
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
560
+          this.start_time_one = startOfLastMonth
561
+          this.end_time_one = endOfLastMonth
562
+          // this.getDataTwo()
563
+          break
564
+        case 3:
565
+          // 今年的起始日期和结束日期
566
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
567
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
568
+
569
+          this.start_time_one = startOfYear
570
+          this.end_time_one = endOfYear
571
+          // this.getDataTwo()
572
+
573
+          break
574
+        case 4:
575
+          // 上一年的起始日期和结束日期
576
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
577
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
578
+
579
+          this.start_time_one = startOfLastYear
580
+          this.end_time_one = endOfLastYear
581
+          // this.getDataTwo()
582
+
583
+          break
584
+        case 5:
585
+          // 第一季度的起始日期和结束日期
586
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
587
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
588
+          this.start_time_one = startOfFirstQuarter
589
+          this.end_time_one = endOfFirstQuarter
590
+          // this.getDataTwo()
591
+          break
592
+        case 6:
593
+          // 第二季度的起始日期和结束日期
594
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
595
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
596
+          this.start_time_one = startOfSecondQuarter
597
+          this.end_time_one = endOfSecondQuarter
598
+          // this.getDataTwo()
599
+          break
600
+        case 7:
601
+          // 第三季度的起始日期和结束日期
602
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
603
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
604
+
605
+          this.start_time_one = startOfThirdQuarter
606
+          this.end_time_one = endOfThirdQuarter
607
+          // this.getDataTwo()
608
+
609
+          break
610
+        case 8:
611
+          // 第四季度的起始日期和结束日期
612
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
613
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
614
+
615
+          this.start_time_one = startOfFourthQuarter
616
+          this.end_time_one = endOfFourthQuarter
617
+          // this.getDataTwo()
618
+          break
619
+        case 9:
620
+          this.start_time_one = ''
621
+          this.end_time_one = ''
622
+          break
623
+      }
624
+    },
327 625
 
328 626
 
329 627
     getSummaries(param) {
@@ -352,8 +650,16 @@ export default {
352 650
 
353 651
       return sums
354 652
     },
355
-    handleClick(id) {
356
-      console.log(id)
653
+    handleClick(row) {
654
+      console.log(row)
655
+      if(row.name == "不达标值患者"){
656
+        this.statistics_type = 1
657
+      }else if(row.name == "达标值患者"){
658
+        this.statistics_type = 3
659
+      }else {
660
+        this.statistics_type = 2
661
+      }
662
+      this.getDataTwo()
357 663
     }
358 664
   }
359 665
 

+ 320 - 13
src/xt_pages/Dialysisanalysis/calcium/calciumall.vue View File

@@ -67,23 +67,163 @@
67 67
           label="人数"
68 68
         >
69 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>-->
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 80
       </el-table>
81 81
     </div>
82
+    <el-dialog
83
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
84
+      :close-on-click-modal="isClose"
85
+      :close-on-press-escape="isClose"
86
+    >
87
+      <el-row :gutter="25">
88
+        <el-col :span="5">
89
+          <div class="block">
90
+            <span>查询时间:</span>
91
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
92
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
93
+              <el-option
94
+                v-for="item,index in times"
95
+                :key="index"
96
+                :label="item.label"
97
+                :value="item.value">
98
+              </el-option>
99
+            </el-select>
100
+          </div>
101
+        </el-col>
102
+        <el-col :span="10">
103
+          <div>
104
+            <el-date-picker
105
+              style="width: 120px"
106
+              v-model="start_time_one"
107
+              format="yyyy-MM-dd"
108
+              value-format="yyyy-MM-dd"
109
+              type="date"
110
+
111
+              placeholder="选择日期">
112
+            </el-date-picker>
113
+            <span>-</span>
114
+            <el-date-picker
115
+              style="width: 120px"
116
+              v-model="end_time_one"
117
+              format="yyyy-MM-dd"
118
+              value-format="yyyy-MM-dd"
119
+              type="date"
120
+              placeholder="选择日期">
121
+            </el-date-picker>
122
+          </div>
123
+        </el-col>
124
+
125
+        <el-col :span="4">
126
+          <div>
127
+
128
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
129
+                       style="width:100px;margin-left:5px;">
130
+              <el-option
131
+                v-for="item,index in statistics_types"
132
+                :key="index"
133
+                :label="item.label"
134
+                :value="item.value">
135
+              </el-option>
136
+            </el-select>
137
+
138
+          </div>
139
+        </el-col>
140
+
141
+        <!--        <el-col :span="4">-->
142
+        <!--          <div>-->
143
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
144
+        <!--                       style="width:100px;margin-left:5px;">-->
145
+        <!--              <el-option-->
146
+        <!--                v-for="item,index in sort_types"-->
147
+        <!--                :key="index"-->
148
+        <!--                :label="item.label"-->
149
+        <!--                :value="item.value">-->
150
+        <!--              </el-option>-->
151
+        <!--            </el-select>-->
152
+        <!--          </div>-->
153
+        <!--        </el-col>-->
154
+
155
+        <el-col :span="4">
156
+          <div >
157
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
158
+          </div>
159
+        </el-col>
160
+
161
+        <el-col :span="2">
162
+          <div>
163
+            <el-button @click="getDataTwo()">查询</el-button>
164
+          </div>
165
+        </el-col>
166
+
167
+        <el-col :span="2">
168
+          <div>
169
+            <el-button @click="exportAction()">导出</el-button>
170
+          </div>
171
+        </el-col>
172
+
173
+        <!--        <el-col :span="2">-->
174
+        <!--          <div>-->
175
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
176
+        <!--          </div>-->
177
+        <!--        </el-col>-->
178
+
179
+
180
+
181
+
182
+
183
+      </el-row>
184
+
185
+      <el-table
186
+        :data="patientTableData"
187
+        border
188
+        ref="table"
189
+        max-height="500px"
190
+        style="width: 100%">
191
+        <el-table-column
192
+          prop="dialysis_no"
193
+          align="center"
194
+          label="透析号"
195
+        >
196
+        </el-table-column>
197
+        <el-table-column
198
+          prop="name"
199
+          label="患者姓名"
200
+        >
201
+        </el-table-column>
202
+        <el-table-column
203
+          prop="date"
204
+          label="检查日期"
205
+        >
206
+        </el-table-column>
207
+
208
+        <el-table-column
209
+          prop="inspect_value"
210
+          label="结果"
211
+        >
212
+        </el-table-column>
213
+
214
+      </el-table>
215
+
216
+      <div slot="footer" class="dialog-footer">
217
+        <el-button @click="detailVisibility = false">取消</el-button>
218
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
219
+      </div>
220
+    </el-dialog>
221
+
82 222
   </div>
83 223
 </template>
84 224
 <script>
85 225
 import * as echarts from 'echarts'
86
-import { GetQCStatistisData } from '../../../api/qcd'
226
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
87 227
 
88 228
 const moment = require('moment')
89 229
 
@@ -102,7 +242,19 @@ export default {
102 242
   },
103 243
   data() {
104 244
     return {
245
+      statistics_types:[
246
+        { value: 1, label: '不达标患者' },
247
+        { value: 2, label: '未检查患者' },
248
+        { value: 3, label: '达标患者' },
249
+      ],
250
+      sort_types:[
251
+        { value: 1, label: '时间' },
252
+        { value: 2, label: '患者' },
253
+      ],
254
+      detailVisibility:false,
255
+      isClose:true,
105 256
       time_type: 1,
257
+      time_type_two:1,
106 258
       times: [
107 259
         { value: 1, label: '本月' },
108 260
         { value: 2, label: '上月' },
@@ -118,6 +270,11 @@ export default {
118 270
       time_month: '',
119 271
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120 272
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
273
+
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
277
+
121 278
       input: '',
122 279
       myChart: {},
123 280
       pieData: [],
@@ -125,12 +282,74 @@ export default {
125 282
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
126 283
       tableData: [],
127 284
       reference:{},
285
+      statistics_type:1,
286
+      sort_type:"",
287
+      keyword:"",
288
+      patientTableData:[],
128 289
     }
129 290
   },
130 291
   mounted() {
131 292
     this.getData()
132 293
   },
133 294
   methods: {
295
+    exportAction(){
296
+      let list = []
297
+      for (let i = 0; i < this.patientTableData.length; i++) {
298
+        let order = this.patientTableData[i]
299
+        let name = order.name
300
+        let value = order.inspect_value
301
+        let inspect_date = order.date
302
+
303
+        let obj = {
304
+          '姓名': name,
305
+          '数值': value,
306
+          '日期': inspect_date,
307
+        }
308
+        list.push(obj)
309
+      }
310
+      import('@/vendor/Export2Excel').then(excel => {
311
+        const tHeader = ['姓名', '数值', '日期']
312
+        const filterVal = ['姓名', '数值', '日期']
313
+        const data = this.formatJson(filterVal, list)
314
+        excel.export_json_to_excel1({
315
+          header: tHeader,
316
+          data,
317
+          filename: '明细',
318
+          ref: this.$refs['table'].$el
319
+        })
320
+      })
321
+    },
322
+
323
+    formatJson(filterVal, jsonData) {
324
+      return jsonData.map(v => filterVal.map(j => v[j]))
325
+    },
326
+    getDataTwo() {
327
+      if(this.start_time_one.length == 0){
328
+        this.$message.error("请选择开始时间")
329
+      }
330
+      if(this.end_time_one.length == 0){
331
+        this.$message.error("请选择结束时间")
332
+      }
333
+      let params = {
334
+        start_date: this.start_time_one,
335
+        end_date: this.end_time_one,
336
+        project_id: 4,
337
+        item_id: 289,
338
+        item_type:this.statistics_type,
339
+        order_type:this.sort_type,
340
+        keyword: this.keyword,
341
+      }
342
+      this.patientTableData = []
343
+      GetAllQCStatistisData(params).then(response => {
344
+        if (response.data.state == 1) {
345
+          this.detailVisibility = true
346
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
347
+        } else {
348
+          this.$message.error(response.data.msg)
349
+        }
350
+      })
351
+
352
+    },
134 353
     getData() {
135 354
       if(this.start_time.length == 0){
136 355
         this.$message.error("请选择开始时间")
@@ -325,6 +544,86 @@ export default {
325 544
           break
326 545
       }
327 546
     },
547
+    changeItemTwo(val) {
548
+      const currentDate = new Date()
549
+      switch (val) {
550
+        case 1:
551
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
552
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
553
+          this.start_time_one = startOfMonth
554
+          this.end_time_one = endOfMonth
555
+          // this.getDataTwo()
556
+          break
557
+        case 2:
558
+          // 上月的起始日期和结束日期
559
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
560
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
561
+          this.start_time_one = startOfLastMonth
562
+          this.end_time_one = endOfLastMonth
563
+          // this.getDataTwo()
564
+          break
565
+        case 3:
566
+          // 今年的起始日期和结束日期
567
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
568
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
569
+
570
+          this.start_time_one = startOfYear
571
+          this.end_time_one = endOfYear
572
+          // this.getDataTwo()
573
+
574
+          break
575
+        case 4:
576
+          // 上一年的起始日期和结束日期
577
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
578
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
579
+
580
+          this.start_time_one = startOfLastYear
581
+          this.end_time_one = endOfLastYear
582
+          // this.getDataTwo()
583
+
584
+          break
585
+        case 5:
586
+          // 第一季度的起始日期和结束日期
587
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
588
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
589
+          this.start_time_one = startOfFirstQuarter
590
+          this.end_time_one = endOfFirstQuarter
591
+          // this.getDataTwo()
592
+          break
593
+        case 6:
594
+          // 第二季度的起始日期和结束日期
595
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
596
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
597
+          this.start_time_one = startOfSecondQuarter
598
+          this.end_time_one = endOfSecondQuarter
599
+          // this.getDataTwo()
600
+          break
601
+        case 7:
602
+          // 第三季度的起始日期和结束日期
603
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
604
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
605
+
606
+          this.start_time_one = startOfThirdQuarter
607
+          this.end_time_one = endOfThirdQuarter
608
+          // this.getDataTwo()
609
+
610
+          break
611
+        case 8:
612
+          // 第四季度的起始日期和结束日期
613
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
614
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
615
+
616
+          this.start_time_one = startOfFourthQuarter
617
+          this.end_time_one = endOfFourthQuarter
618
+          // this.getDataTwo()
619
+          break
620
+        case 9:
621
+          this.start_time_one = ''
622
+          this.end_time_one = ''
623
+          break
624
+      }
625
+    },
626
+
328 627
 
329 628
 
330 629
     getSummaries(param) {
@@ -353,8 +652,16 @@ export default {
353 652
 
354 653
       return sums
355 654
     },
356
-    handleClick(id) {
357
-      console.log(id)
655
+    handleClick(row) {
656
+      console.log(row)
657
+      if(row.name == "不达标值患者"){
658
+        this.statistics_type = 1
659
+      }else if(row.name == "达标值患者"){
660
+        this.statistics_type = 3
661
+      }else {
662
+        this.statistics_type = 2
663
+      }
664
+      this.getDataTwo()
358 665
     }
359 666
   }
360 667
 

+ 179 - 14
src/xt_pages/Dialysisanalysis/hemoglobin/hemoglobinall.vue View File

@@ -69,23 +69,23 @@
69 69
           label="人数"
70 70
         >
71 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>-->
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 82
       </el-table>
83 83
     </div>
84 84
   </div>
85 85
 </template>
86 86
 <script>
87 87
 import * as echarts from 'echarts'
88
-import { GetQCStatistisData } from '../../../api/qcd'
88
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
89 89
 
90 90
 const moment = require('moment')
91 91
 
@@ -104,7 +104,19 @@ export default {
104 104
   },
105 105
   data() {
106 106
     return {
107
+      statistics_types:[
108
+        { value: 1, label: '不达标患者' },
109
+        { value: 2, label: '未检查患者' },
110
+        { value: 3, label: '达标患者' },
111
+      ],
112
+      sort_types:[
113
+        { value: 1, label: '时间' },
114
+        { value: 2, label: '患者' },
115
+      ],
116
+      detailVisibility:false,
117
+      isClose:true,
107 118
       time_type: 1,
119
+      time_type_two:1,
108 120
       times: [
109 121
         { value: 1, label: '本月' },
110 122
         { value: 2, label: '上月' },
@@ -121,18 +133,163 @@ export default {
121 133
       time_month: '',
122 134
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
123 135
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
136
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
137
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
138
+
124 139
       input: '',
125 140
       myChart: {},
126 141
       pieData: [],
127 142
       pieName: [],
128 143
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
129
-      tableData: []
144
+      tableData: [],
145
+      statistics_type:1,
146
+      sort_type:"",
147
+      keyword:"",
148
+      patientTableData:[],
130 149
     }
131 150
   },
132 151
   mounted() {
133 152
     this.getData()
134 153
   },
135 154
   methods: {
155
+    exportAction(){
156
+      let list = []
157
+      for (let i = 0; i < this.patientTableData.length; i++) {
158
+        let order = this.patientTableData[i]
159
+        let name = order.name
160
+        let value = order.inspect_value
161
+        let inspect_date = order.date
162
+
163
+        let obj = {
164
+          '姓名': name,
165
+          '数值': value,
166
+          '日期': inspect_date,
167
+        }
168
+        list.push(obj)
169
+      }
170
+      import('@/vendor/Export2Excel').then(excel => {
171
+        const tHeader = ['姓名', '数值', '日期']
172
+        const filterVal = ['姓名', '数值', '日期']
173
+        const data = this.formatJson(filterVal, list)
174
+        excel.export_json_to_excel1({
175
+          header: tHeader,
176
+          data,
177
+          filename: '明细',
178
+          ref: this.$refs['table'].$el
179
+        })
180
+      })
181
+    },
182
+
183
+    formatJson(filterVal, jsonData) {
184
+      return jsonData.map(v => filterVal.map(j => v[j]))
185
+    },
186
+    changeItemTwo(val) {
187
+      const currentDate = new Date()
188
+      switch (val) {
189
+        case 1:
190
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
191
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
192
+          this.start_time_one = startOfMonth
193
+          this.end_time_one = endOfMonth
194
+          // this.getDataTwo()
195
+          break
196
+        case 2:
197
+          // 上月的起始日期和结束日期
198
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
199
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
200
+          this.start_time_one = startOfLastMonth
201
+          this.end_time_one = endOfLastMonth
202
+          // this.getDataTwo()
203
+          break
204
+        case 3:
205
+          // 今年的起始日期和结束日期
206
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
207
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
208
+
209
+          this.start_time_one = startOfYear
210
+          this.end_time_one = endOfYear
211
+          // this.getDataTwo()
212
+
213
+          break
214
+        case 4:
215
+          // 上一年的起始日期和结束日期
216
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
217
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
218
+
219
+          this.start_time_one = startOfLastYear
220
+          this.end_time_one = endOfLastYear
221
+          // this.getDataTwo()
222
+
223
+          break
224
+        case 5:
225
+          // 第一季度的起始日期和结束日期
226
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
227
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
228
+          this.start_time_one = startOfFirstQuarter
229
+          this.end_time_one = endOfFirstQuarter
230
+          // this.getDataTwo()
231
+          break
232
+        case 6:
233
+          // 第二季度的起始日期和结束日期
234
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
235
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
236
+          this.start_time_one = startOfSecondQuarter
237
+          this.end_time_one = endOfSecondQuarter
238
+          // this.getDataTwo()
239
+          break
240
+        case 7:
241
+          // 第三季度的起始日期和结束日期
242
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
243
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
244
+
245
+          this.start_time_one = startOfThirdQuarter
246
+          this.end_time_one = endOfThirdQuarter
247
+          // this.getDataTwo()
248
+
249
+          break
250
+        case 8:
251
+          // 第四季度的起始日期和结束日期
252
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
253
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
254
+
255
+          this.start_time_one = startOfFourthQuarter
256
+          this.end_time_one = endOfFourthQuarter
257
+          // this.getDataTwo()
258
+          break
259
+        case 9:
260
+          this.start_time_one = ''
261
+          this.end_time_one = ''
262
+          break
263
+      }
264
+    },
265
+
266
+    getDataTwo() {
267
+      if(this.start_time_one.length == 0){
268
+        this.$message.error("请选择开始时间")
269
+      }
270
+      if(this.end_time_one.length == 0){
271
+        this.$message.error("请选择结束时间")
272
+      }
273
+      let params = {
274
+        start_date: this.start_time_one,
275
+        end_date: this.end_time_one,
276
+        project_id: 1,
277
+        item_id: 17,
278
+        item_type:this.statistics_type,
279
+        order_type:this.sort_type,
280
+        keyword: this.keyword,
281
+      }
282
+      this.patientTableData = []
283
+      GetAllQCStatistisData(params).then(response => {
284
+        if (response.data.state == 1) {
285
+          this.detailVisibility = true
286
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
287
+        } else {
288
+          this.$message.error(response.data.msg)
289
+        }
290
+      })
291
+
292
+    },
136 293
     getData() {
137 294
       if(this.start_time.length == 0){
138 295
         this.$message.error("请选择开始时间")
@@ -354,8 +511,16 @@ export default {
354 511
 
355 512
       return sums
356 513
     },
357
-    handleClick(id) {
358
-      console.log(id)
514
+    handleClick(row) {
515
+      console.log(row)
516
+      if(row.name == "不达标值患者"){
517
+        this.statistics_type = 1
518
+      }else if(row.name == "达标值患者"){
519
+        this.statistics_type = 3
520
+      }else {
521
+        this.statistics_type = 2
522
+      }
523
+      this.getDataTwo()
359 524
     }
360 525
   }
361 526
 

+ 318 - 14
src/xt_pages/Dialysisanalysis/platelets/plateletsall.vue View File

@@ -68,23 +68,163 @@
68 68
           label="人数"
69 69
         >
70 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>-->
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 81
       </el-table>
82 82
     </div>
83
+    <el-dialog
84
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
85
+      :close-on-click-modal="isClose"
86
+      :close-on-press-escape="isClose"
87
+    >
88
+      <el-row :gutter="25">
89
+        <el-col :span="5">
90
+          <div class="block">
91
+            <span>查询时间:</span>
92
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
93
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
94
+              <el-option
95
+                v-for="item,index in times"
96
+                :key="index"
97
+                :label="item.label"
98
+                :value="item.value">
99
+              </el-option>
100
+            </el-select>
101
+          </div>
102
+        </el-col>
103
+        <el-col :span="10">
104
+          <div>
105
+            <el-date-picker
106
+              style="width: 120px"
107
+              v-model="start_time_one"
108
+              format="yyyy-MM-dd"
109
+              value-format="yyyy-MM-dd"
110
+              type="date"
111
+
112
+              placeholder="选择日期">
113
+            </el-date-picker>
114
+            <span>-</span>
115
+            <el-date-picker
116
+              style="width: 120px"
117
+              v-model="end_time_one"
118
+              format="yyyy-MM-dd"
119
+              value-format="yyyy-MM-dd"
120
+              type="date"
121
+              placeholder="选择日期">
122
+            </el-date-picker>
123
+          </div>
124
+        </el-col>
125
+
126
+        <el-col :span="4">
127
+          <div>
128
+
129
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
130
+                       style="width:100px;margin-left:5px;">
131
+              <el-option
132
+                v-for="item,index in statistics_types"
133
+                :key="index"
134
+                :label="item.label"
135
+                :value="item.value">
136
+              </el-option>
137
+            </el-select>
138
+
139
+          </div>
140
+        </el-col>
141
+
142
+        <!--        <el-col :span="4">-->
143
+        <!--          <div>-->
144
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
145
+        <!--                       style="width:100px;margin-left:5px;">-->
146
+        <!--              <el-option-->
147
+        <!--                v-for="item,index in sort_types"-->
148
+        <!--                :key="index"-->
149
+        <!--                :label="item.label"-->
150
+        <!--                :value="item.value">-->
151
+        <!--              </el-option>-->
152
+        <!--            </el-select>-->
153
+        <!--          </div>-->
154
+        <!--        </el-col>-->
155
+
156
+        <el-col :span="4">
157
+          <div >
158
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
159
+          </div>
160
+        </el-col>
161
+
162
+        <el-col :span="2">
163
+          <div>
164
+            <el-button @click="getDataTwo()">查询</el-button>
165
+          </div>
166
+        </el-col>
167
+
168
+        <el-col :span="2">
169
+          <div>
170
+            <el-button @click="exportAction()">导出</el-button>
171
+          </div>
172
+        </el-col>
173
+
174
+        <!--        <el-col :span="2">-->
175
+        <!--          <div>-->
176
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
177
+        <!--          </div>-->
178
+        <!--        </el-col>-->
179
+
180
+
181
+
182
+
183
+
184
+      </el-row>
185
+
186
+      <el-table
187
+        :data="patientTableData"
188
+        border
189
+        ref="table"
190
+        max-height="500px"
191
+        style="width: 100%">
192
+        <el-table-column
193
+          prop="dialysis_no"
194
+          align="center"
195
+          label="透析号"
196
+        >
197
+        </el-table-column>
198
+        <el-table-column
199
+          prop="name"
200
+          label="患者姓名"
201
+        >
202
+        </el-table-column>
203
+        <el-table-column
204
+          prop="date"
205
+          label="检查日期"
206
+        >
207
+        </el-table-column>
208
+
209
+        <el-table-column
210
+          prop="inspect_value"
211
+          label="结果"
212
+        >
213
+        </el-table-column>
214
+
215
+      </el-table>
216
+
217
+      <div slot="footer" class="dialog-footer">
218
+        <el-button @click="detailVisibility = false">取消</el-button>
219
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
220
+      </div>
221
+    </el-dialog>
222
+
83 223
   </div>
84 224
 </template>
85 225
 <script>
86 226
 import * as echarts from 'echarts'
87
-import { GetQCStatistisData } from '../../../api/qcd'
227
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
88 228
 
89 229
 const moment = require('moment')
90 230
 
@@ -103,7 +243,19 @@ export default {
103 243
   },
104 244
   data() {
105 245
     return {
246
+      statistics_types:[
247
+        { value: 1, label: '不达标患者' },
248
+        { value: 2, label: '未检查患者' },
249
+        { value: 3, label: '达标患者' },
250
+      ],
251
+      sort_types:[
252
+        { value: 1, label: '时间' },
253
+        { value: 2, label: '患者' },
254
+      ],
255
+      detailVisibility:false,
256
+      isClose:true,
106 257
       time_type: 1,
258
+      time_type_two:1,
107 259
       times: [
108 260
         { value: 1, label: '本月' },
109 261
         { value: 2, label: '上月' },
@@ -119,19 +271,84 @@ export default {
119 271
       time_month: '',
120 272
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
121 273
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
122 277
       input: '',
123 278
       myChart: {},
124 279
       pieData: [],
125 280
       pieName: [],
126 281
       reference:{},
127 282
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
128
-      tableData: []
283
+      tableData: [],
284
+      statistics_type:1,
285
+      sort_type:"",
286
+      keyword:"",
287
+      patientTableData:[],
129 288
     }
130 289
   },
131 290
   mounted() {
132 291
     this.getData()
133 292
   },
134 293
   methods: {
294
+    exportAction(){
295
+      let list = []
296
+      for (let i = 0; i < this.patientTableData.length; i++) {
297
+        let order = this.patientTableData[i]
298
+        let name = order.name
299
+        let value = order.inspect_value
300
+        let inspect_date = order.date
301
+
302
+        let obj = {
303
+          '姓名': name,
304
+          '数值': value,
305
+          '日期': inspect_date,
306
+        }
307
+        list.push(obj)
308
+      }
309
+      import('@/vendor/Export2Excel').then(excel => {
310
+        const tHeader = ['姓名', '数值', '日期']
311
+        const filterVal = ['姓名', '数值', '日期']
312
+        const data = this.formatJson(filterVal, list)
313
+        excel.export_json_to_excel1({
314
+          header: tHeader,
315
+          data,
316
+          filename: '明细',
317
+          ref: this.$refs['table'].$el
318
+        })
319
+      })
320
+    },
321
+
322
+    formatJson(filterVal, jsonData) {
323
+      return jsonData.map(v => filterVal.map(j => v[j]))
324
+    },
325
+    getDataTwo() {
326
+      if(this.start_time_one.length == 0){
327
+        this.$message.error("请选择开始时间")
328
+      }
329
+      if(this.end_time_one.length == 0){
330
+        this.$message.error("请选择结束时间")
331
+      }
332
+      let params = {
333
+        start_date: this.start_time_one,
334
+        end_date: this.end_time_one,
335
+        project_id: 1,
336
+        item_id: 166,
337
+        item_type:this.statistics_type,
338
+        order_type:this.sort_type,
339
+        keyword: this.keyword,
340
+      }
341
+      this.patientTableData = []
342
+      GetAllQCStatistisData(params).then(response => {
343
+        if (response.data.state == 1) {
344
+          this.detailVisibility = true
345
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
346
+        } else {
347
+          this.$message.error(response.data.msg)
348
+        }
349
+      })
350
+
351
+    },
135 352
     getData() {
136 353
       if(this.start_time.length == 0){
137 354
         this.$message.error("请选择开始时间")
@@ -325,6 +542,85 @@ export default {
325 542
           break
326 543
       }
327 544
     },
545
+    changeItemTwo(val) {
546
+      const currentDate = new Date()
547
+      switch (val) {
548
+        case 1:
549
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
550
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
551
+          this.start_time_one = startOfMonth
552
+          this.end_time_one = endOfMonth
553
+          // this.getDataTwo()
554
+          break
555
+        case 2:
556
+          // 上月的起始日期和结束日期
557
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
558
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
559
+          this.start_time_one = startOfLastMonth
560
+          this.end_time_one = endOfLastMonth
561
+          // this.getDataTwo()
562
+          break
563
+        case 3:
564
+          // 今年的起始日期和结束日期
565
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
566
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
567
+
568
+          this.start_time_one = startOfYear
569
+          this.end_time_one = endOfYear
570
+          // this.getDataTwo()
571
+
572
+          break
573
+        case 4:
574
+          // 上一年的起始日期和结束日期
575
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
576
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
577
+
578
+          this.start_time_one = startOfLastYear
579
+          this.end_time_one = endOfLastYear
580
+          // this.getDataTwo()
581
+
582
+          break
583
+        case 5:
584
+          // 第一季度的起始日期和结束日期
585
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
586
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
587
+          this.start_time_one = startOfFirstQuarter
588
+          this.end_time_one = endOfFirstQuarter
589
+          // this.getDataTwo()
590
+          break
591
+        case 6:
592
+          // 第二季度的起始日期和结束日期
593
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
594
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
595
+          this.start_time_one = startOfSecondQuarter
596
+          this.end_time_one = endOfSecondQuarter
597
+          // this.getDataTwo()
598
+          break
599
+        case 7:
600
+          // 第三季度的起始日期和结束日期
601
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
602
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
603
+
604
+          this.start_time_one = startOfThirdQuarter
605
+          this.end_time_one = endOfThirdQuarter
606
+          // this.getDataTwo()
607
+
608
+          break
609
+        case 8:
610
+          // 第四季度的起始日期和结束日期
611
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
612
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
613
+
614
+          this.start_time_one = startOfFourthQuarter
615
+          this.end_time_one = endOfFourthQuarter
616
+          // this.getDataTwo()
617
+          break
618
+        case 9:
619
+          this.start_time_one = ''
620
+          this.end_time_one = ''
621
+          break
622
+      }
623
+    },
328 624
 
329 625
 
330 626
     getSummaries(param) {
@@ -353,8 +649,16 @@ export default {
353 649
 
354 650
       return sums
355 651
     },
356
-    handleClick(id) {
357
-      console.log(id)
652
+    handleClick(row) {
653
+      console.log(row)
654
+      if(row.name == "不达标值患者"){
655
+        this.statistics_type = 1
656
+      }else if(row.name == "达标值患者"){
657
+        this.statistics_type = 3
658
+      }else {
659
+        this.statistics_type = 2
660
+      }
661
+      this.getDataTwo()
358 662
     }
359 663
   }
360 664
 

+ 318 - 114
src/xt_pages/Dialysisanalysis/qualitycontrol/totalSstatistics.vue View File

@@ -67,124 +67,163 @@
67 67
           label="人数"
68 68
         >
69 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>-->
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 80
       </el-table>
81 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>-->
82
+    <el-dialog
83
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
84
+      :close-on-click-modal="isClose"
85
+      :close-on-press-escape="isClose"
86
+    >
87
+      <el-row :gutter="25">
88
+        <el-col :span="5">
89
+          <div class="block">
90
+            <span>查询时间:</span>
91
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
92
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
93
+              <el-option
94
+                v-for="item,index in times"
95
+                :key="index"
96
+                :label="item.label"
97
+                :value="item.value">
98
+              </el-option>
99
+            </el-select>
100
+          </div>
101
+        </el-col>
102
+        <el-col :span="10">
103
+          <div>
104
+            <el-date-picker
105
+              style="width: 120px"
106
+              v-model="start_time_one"
107
+              format="yyyy-MM-dd"
108
+              value-format="yyyy-MM-dd"
109
+              type="date"
110
+
111
+              placeholder="选择日期">
112
+            </el-date-picker>
113
+            <span>-</span>
114
+            <el-date-picker
115
+              style="width: 120px"
116
+              v-model="end_time_one"
117
+              format="yyyy-MM-dd"
118
+              value-format="yyyy-MM-dd"
119
+              type="date"
120
+              placeholder="选择日期">
121
+            </el-date-picker>
122
+          </div>
123
+        </el-col>
124
+
125
+        <el-col :span="4">
126
+          <div>
127
+
128
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
129
+                       style="width:100px;margin-left:5px;">
130
+              <el-option
131
+                v-for="item,index in statistics_types"
132
+                :key="index"
133
+                :label="item.label"
134
+                :value="item.value">
135
+              </el-option>
136
+            </el-select>
137
+
138
+          </div>
139
+        </el-col>
140
+
141
+        <!--        <el-col :span="4">-->
142
+        <!--          <div>-->
143
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
144
+        <!--                       style="width:100px;margin-left:5px;">-->
145
+        <!--              <el-option-->
146
+        <!--                v-for="item,index in sort_types"-->
147
+        <!--                :key="index"-->
148
+        <!--                :label="item.label"-->
149
+        <!--                :value="item.value">-->
150
+        <!--              </el-option>-->
151
+        <!--            </el-select>-->
152
+        <!--          </div>-->
153
+        <!--        </el-col>-->
154
+
155
+        <el-col :span="4">
156
+          <div >
157
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
158
+          </div>
159
+        </el-col>
160
+
161
+        <el-col :span="2">
162
+          <div>
163
+            <el-button @click="getDataTwo()">查询</el-button>
164
+          </div>
165
+        </el-col>
166
+
167
+        <el-col :span="2">
168
+          <div>
169
+            <el-button @click="exportAction()">导出</el-button>
170
+          </div>
171
+        </el-col>
172
+
173
+        <!--        <el-col :span="2">-->
174
+        <!--          <div>-->
175
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
176
+        <!--          </div>-->
177
+        <!--        </el-col>-->
178
+
179
+
180
+
181
+
182
+
183
+      </el-row>
184
+
185
+      <el-table
186
+        :data="patientTableData"
187
+        border
188
+        ref="table"
189
+        max-height="500px"
190
+        style="width: 100%">
191
+        <el-table-column
192
+          prop="dialysis_no"
193
+          align="center"
194
+          label="透析号"
195
+        >
196
+        </el-table-column>
197
+        <el-table-column
198
+          prop="name"
199
+          label="患者姓名"
200
+        >
201
+        </el-table-column>
202
+        <el-table-column
203
+          prop="date"
204
+          label="检查日期"
205
+        >
206
+        </el-table-column>
207
+
208
+        <el-table-column
209
+          prop="inspect_value"
210
+          label="结果"
211
+        >
212
+        </el-table-column>
213
+
214
+      </el-table>
215
+
216
+      <div slot="footer" class="dialog-footer">
217
+        <el-button @click="detailVisibility = false">取消</el-button>
218
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
219
+      </div>
220
+    </el-dialog>
221
+
183 222
   </div>
184 223
 </template>
185 224
 <script>
186 225
 import * as echarts from 'echarts'
187
-import { GetQCStatistisData } from '../../../api/qcd'
226
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
188 227
 
189 228
 const moment = require('moment')
190 229
 
@@ -203,7 +242,19 @@ export default {
203 242
   },
204 243
   data() {
205 244
     return {
245
+      statistics_types:[
246
+        { value: 1, label: '不达标患者' },
247
+        { value: 2, label: '未检查患者' },
248
+        { value: 3, label: '达标患者' },
249
+      ],
250
+      sort_types:[
251
+        { value: 1, label: '时间' },
252
+        { value: 2, label: '患者' },
253
+      ],
254
+      detailVisibility:false,
255
+      isClose:true,
206 256
       time_type: 1,
257
+      time_type_two:1,
207 258
       times: [
208 259
         { value: 1, label: '本月' },
209 260
         { value: 2, label: '上月' },
@@ -219,6 +270,11 @@ export default {
219 270
       time_month: '',
220 271
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
221 272
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
273
+
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
277
+
222 278
       input: '',
223 279
       myChart: {},
224 280
       pieData: [],
@@ -226,12 +282,74 @@ export default {
226 282
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
227 283
       tableData: [],
228 284
       reference:{},
285
+      statistics_type:1,
286
+      sort_type:"",
287
+      keyword:"",
288
+      patientTableData:[],
229 289
     }
230 290
   },
231 291
   mounted() {
232 292
     this.getData()
233 293
   },
234 294
   methods: {
295
+    exportAction(){
296
+      let list = []
297
+      for (let i = 0; i < this.patientTableData.length; i++) {
298
+        let order = this.patientTableData[i]
299
+        let name = order.name
300
+        let value = order.inspect_value
301
+        let inspect_date = order.date
302
+
303
+        let obj = {
304
+          '姓名': name,
305
+          '数值': value,
306
+          '日期': inspect_date,
307
+        }
308
+        list.push(obj)
309
+      }
310
+      import('@/vendor/Export2Excel').then(excel => {
311
+        const tHeader = ['姓名', '数值', '日期']
312
+        const filterVal = ['姓名', '数值', '日期']
313
+        const data = this.formatJson(filterVal, list)
314
+        excel.export_json_to_excel1({
315
+          header: tHeader,
316
+          data,
317
+          filename: '明细',
318
+          ref: this.$refs['table'].$el
319
+        })
320
+      })
321
+    },
322
+
323
+    formatJson(filterVal, jsonData) {
324
+      return jsonData.map(v => filterVal.map(j => v[j]))
325
+    },
326
+    getDataTwo() {
327
+      if(this.start_time_one.length == 0){
328
+        this.$message.error("请选择开始时间")
329
+      }
330
+      if(this.end_time_one.length == 0){
331
+        this.$message.error("请选择结束时间")
332
+      }
333
+      let params = {
334
+        start_date: this.start_time_one,
335
+        end_date: this.end_time_one,
336
+        project_id: 20,
337
+        item_id: 171,
338
+        item_type:this.statistics_type,
339
+        order_type:this.sort_type,
340
+        keyword: this.keyword,
341
+      }
342
+      this.patientTableData = []
343
+      GetAllQCStatistisData(params).then(response => {
344
+        if (response.data.state == 1) {
345
+          this.detailVisibility = true
346
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
347
+        } else {
348
+          this.$message.error(response.data.msg)
349
+        }
350
+      })
351
+
352
+    },
235 353
     getData() {
236 354
       if(this.start_time.length == 0){
237 355
         this.$message.error("请选择开始时间")
@@ -425,6 +543,85 @@ export default {
425 543
           break
426 544
       }
427 545
     },
546
+    changeItemTwo(val) {
547
+      const currentDate = new Date()
548
+      switch (val) {
549
+        case 1:
550
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
551
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
552
+          this.start_time_one = startOfMonth
553
+          this.end_time_one = endOfMonth
554
+          // this.getDataTwo()
555
+          break
556
+        case 2:
557
+          // 上月的起始日期和结束日期
558
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
559
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
560
+          this.start_time_one = startOfLastMonth
561
+          this.end_time_one = endOfLastMonth
562
+          // this.getDataTwo()
563
+          break
564
+        case 3:
565
+          // 今年的起始日期和结束日期
566
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
567
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
568
+
569
+          this.start_time_one = startOfYear
570
+          this.end_time_one = endOfYear
571
+          // this.getDataTwo()
572
+
573
+          break
574
+        case 4:
575
+          // 上一年的起始日期和结束日期
576
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
577
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
578
+
579
+          this.start_time_one = startOfLastYear
580
+          this.end_time_one = endOfLastYear
581
+          // this.getDataTwo()
582
+
583
+          break
584
+        case 5:
585
+          // 第一季度的起始日期和结束日期
586
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
587
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
588
+          this.start_time_one = startOfFirstQuarter
589
+          this.end_time_one = endOfFirstQuarter
590
+          // this.getDataTwo()
591
+          break
592
+        case 6:
593
+          // 第二季度的起始日期和结束日期
594
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
595
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
596
+          this.start_time_one = startOfSecondQuarter
597
+          this.end_time_one = endOfSecondQuarter
598
+          // this.getDataTwo()
599
+          break
600
+        case 7:
601
+          // 第三季度的起始日期和结束日期
602
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
603
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
604
+
605
+          this.start_time_one = startOfThirdQuarter
606
+          this.end_time_one = endOfThirdQuarter
607
+          // this.getDataTwo()
608
+
609
+          break
610
+        case 8:
611
+          // 第四季度的起始日期和结束日期
612
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
613
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
614
+
615
+          this.start_time_one = startOfFourthQuarter
616
+          this.end_time_one = endOfFourthQuarter
617
+          // this.getDataTwo()
618
+          break
619
+        case 9:
620
+          this.start_time_one = ''
621
+          this.end_time_one = ''
622
+          break
623
+      }
624
+    },
428 625
 
429 626
 
430 627
     getSummaries(param) {
@@ -453,8 +650,15 @@ export default {
453 650
 
454 651
       return sums
455 652
     },
456
-    handleClick(id) {
457
-      console.log(id)
653
+    handleClick(row) {
654
+      if(row.name == "不达标值患者"){
655
+        this.statistics_type = 1
656
+      }else if(row.name == "达标值患者"){
657
+        this.statistics_type = 3
658
+      }else {
659
+        this.statistics_type = 2
660
+      }
661
+      this.getDataTwo()
458 662
     }
459 663
   }
460 664