Browse Source

提交代码

陈少旭 1 year ago
parent
commit
b5c57b2099

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

@@ -67,23 +67,165 @@
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
+
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="9">
104
+          <div>
105
+            <el-date-picker
106
+              style="width: 150px"
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: 150px"
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="getDataTwo()">导出</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
+
223
+
82 224
   </div>
83 225
 </template>
84 226
 <script>
85 227
 import * as echarts from 'echarts'
86
-import { GetQCStatistisData } from '../../../api/qcd'
228
+import { GetQCStatistisData,GetAllQCStatistisData } from '../../../api/qcd'
87 229
 
88 230
 const moment = require('moment')
89 231
 
@@ -102,7 +244,19 @@ export default {
102 244
   },
103 245
   data() {
104 246
     return {
247
+      statistics_types:[
248
+        { value: 1, label: '不达标患者' },
249
+        { value: 2, label: '未检查患者' },
250
+        { value: 3, label: '达标患者' },
251
+      ],
252
+      sort_types:[
253
+        { value: 1, label: '时间' },
254
+        { value: 2, label: '患者' },
255
+      ],
256
+      detailVisibility:false,
257
+      isClose:true,
105 258
       time_type: 1,
259
+      time_type_two:1,
106 260
       times: [
107 261
         { value: 1, label: '本月' },
108 262
         { value: 2, label: '上月' },
@@ -118,6 +272,10 @@ export default {
118 272
       time_month: '',
119 273
       start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
120 274
       end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
275
+
276
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
277
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
278
+
121 279
       input: '',
122 280
       myChart: {},
123 281
       pieData: [],
@@ -125,12 +283,71 @@ export default {
125 283
       // myChartStyle:{float: "right", width: "100%", height: "400px"},
126 284
       tableData: [],
127 285
       reference:{},
286
+      statistics_type:1,
287
+      sort_type:"",
288
+      keyword:"",
289
+      patientTableData:[],
128 290
     }
129 291
   },
130 292
   mounted() {
131 293
     this.getData()
132 294
   },
133 295
   methods: {
296
+    exportAction(){
297
+      let list = []
298
+      for (let i = 0; i < this.tableData.length; i++) {
299
+        let order = this.tableData[i]
300
+        let name = order.name
301
+        let value = order.value
302
+        let inspect_date = order.inspect_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
+
324
+    getDataTwo() {
325
+      if(this.start_time_one.length == 0){
326
+        this.$message.error("请选择开始时间")
327
+      }
328
+      if(this.end_time_one.length == 0){
329
+        this.$message.error("请选择结束时间")
330
+      }
331
+      let params = {
332
+        start_date: this.start_time_one,
333
+        end_date: this.end_time_one,
334
+        project_id: 2,
335
+        item_id: 35,
336
+        item_type:this.statistics_type,
337
+        order_type:this.sort_type,
338
+        keyword: this.keyword,
339
+      }
340
+      this.patientTableData = []
341
+      GetAllQCStatistisData(params).then(response => {
342
+        if (response.data.state == 1) {
343
+          this.detailVisibility = true
344
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
345
+        } else {
346
+          this.$message.error(response.data.msg)
347
+        }
348
+      })
349
+
350
+    },
134 351
     getData() {
135 352
       if(this.start_time.length == 0){
136 353
         this.$message.error("请选择开始时间")
@@ -325,6 +542,86 @@ 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
+    },
624
+
328 625
 
329 626
 
330 627
     getSummaries(param) {
@@ -353,8 +650,17 @@ export default {
353 650
 
354 651
       return sums
355 652
     },
356
-    handleClick(id) {
357
-      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()
663
+      // console.log(id)
358 664
     }
359 665
   }
360 666
 

+ 2 - 1
src/xt_pages/Dialysisanalysis/albumin/albuminalone.vue View File

@@ -354,7 +354,8 @@ export default {
354 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 355
       });
356 356
 
357
-    },exportAction(){
357
+    },
358
+    exportAction(){
358 359
       let list = []
359 360
       for (let i = 0; i < this.tableData.length; i++) {
360 361
         let order = this.tableData[i]