|
@@ -12,7 +12,7 @@
|
12
|
12
|
<el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
|
13
|
13
|
</el-form-item>
|
14
|
14
|
</el-form>
|
15
|
|
- <el-select v-model="value" placeholder="请选择" style="margin-right:20px;width:100px">
|
|
15
|
+ <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
|
16
|
16
|
<el-option
|
17
|
17
|
v-for="item in options"
|
18
|
18
|
:key="item.value"
|
|
@@ -34,6 +34,7 @@
|
34
|
34
|
align="right"
|
35
|
35
|
format="yyyy-MM-dd"
|
36
|
36
|
value-format="yyyy-MM-dd"
|
|
37
|
+ :picker-options="pickerOptions"
|
37
|
38
|
></el-date-picker>
|
38
|
39
|
<span class>-</span>
|
39
|
40
|
<el-date-picker
|
|
@@ -47,6 +48,7 @@
|
47
|
48
|
align="right"
|
48
|
49
|
format="yyyy-MM-dd"
|
49
|
50
|
value-format="yyyy-MM-dd"
|
|
51
|
+ :picker-options="pickerOptions"
|
50
|
52
|
></el-date-picker>
|
51
|
53
|
</div>
|
52
|
54
|
<div class="cell clearfix">
|
|
@@ -60,12 +62,20 @@
|
60
|
62
|
</div>
|
61
|
63
|
<div>
|
62
|
64
|
<el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
|
63
|
|
- <el-table-column fixed prop="date" label="日期" width="150"></el-table-column>
|
64
|
|
- <el-table-column prop="name" label="姓名" width="120"></el-table-column>
|
65
|
|
- <el-table-column prop="province" label="省份" width="120"></el-table-column>
|
66
|
|
- <el-table-column prop="city" label="市区" width="120"></el-table-column>
|
67
|
|
- <el-table-column prop="address" label="地址" width="300"></el-table-column>
|
68
|
|
- <el-table-column prop="zip" label="邮编" width="120"></el-table-column>
|
|
65
|
+ <el-table-column fixed prop="name" label="姓名" width="120"></el-table-column>
|
|
66
|
+ <el-table-column prop="dialysis_no" label="透析号" width="150"></el-table-column>
|
|
67
|
+ <el-table-column
|
|
68
|
+ :label="modeItem.item_name"
|
|
69
|
+ property="number"
|
|
70
|
+ align="center"
|
|
71
|
+ min-width="100"
|
|
72
|
+ v-for="(modeItem, index) in normData"
|
|
73
|
+ :key="index"
|
|
74
|
+ >
|
|
75
|
+ <template slot-scope="scope">
|
|
76
|
+ {{ scope.row.data[index].Count}}
|
|
77
|
+ </template>
|
|
78
|
+ </el-table-column>
|
69
|
79
|
<el-table-column fixed="right" label="操作" width="100">
|
70
|
80
|
<template slot-scope="scope">
|
71
|
81
|
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
|
|
@@ -95,6 +105,7 @@
|
95
|
105
|
import echarts from "echarts";
|
96
|
106
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
97
|
107
|
import LineChart from "../qcd/components/LineChart";
|
|
108
|
+import { getNormData,getPatientsControl } from "@/api/common/common"
|
98
|
109
|
export default {
|
99
|
110
|
components: {
|
100
|
111
|
LineChart,
|
|
@@ -102,6 +113,12 @@ export default {
|
102
|
113
|
},
|
103
|
114
|
data() {
|
104
|
115
|
return {
|
|
116
|
+ pickerOptions: {
|
|
117
|
+ disabledDate(time) {
|
|
118
|
+ let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
|
|
119
|
+ return time.getTime() > Date.now() || time.getTime() < threeMonths;;
|
|
120
|
+ }
|
|
121
|
+ },
|
105
|
122
|
crumbs: [
|
106
|
123
|
{ path: false, name: "科室质控" },
|
107
|
124
|
{ path: false, name: "患者质控达标统计" }
|
|
@@ -112,27 +129,21 @@ export default {
|
112
|
129
|
page: 1,
|
113
|
130
|
limit: 10
|
114
|
131
|
},
|
|
132
|
+ total:0,
|
|
133
|
+ lapstor:0,
|
115
|
134
|
options: [
|
116
|
135
|
{
|
117
|
|
- value: "选项1",
|
118
|
|
- label: "黄金糕"
|
119
|
|
- },
|
120
|
|
- {
|
121
|
|
- value: "选项2",
|
122
|
|
- label: "双皮奶"
|
|
136
|
+ value: 0,
|
|
137
|
+ label: "全部"
|
123
|
138
|
},
|
124
|
139
|
{
|
125
|
|
- value: "选项3",
|
126
|
|
- label: "蚵仔煎"
|
|
140
|
+ value: 1,
|
|
141
|
+ label: "留治"
|
127
|
142
|
},
|
128
|
143
|
{
|
129
|
|
- value: "选项4",
|
130
|
|
- label: "龙须面"
|
|
144
|
+ value: "2",
|
|
145
|
+ label: "转出"
|
131
|
146
|
},
|
132
|
|
- {
|
133
|
|
- value: "选项5",
|
134
|
|
- label: "北京烤鸭"
|
135
|
|
- }
|
136
|
147
|
],
|
137
|
148
|
value: "",
|
138
|
149
|
chart: {
|
|
@@ -204,44 +215,33 @@ export default {
|
204
|
215
|
}
|
205
|
216
|
]
|
206
|
217
|
},
|
207
|
|
- tableData: [
|
208
|
|
- {
|
209
|
|
- date: "2016-05-02",
|
210
|
|
- name: "王小虎",
|
211
|
|
- province: "上海",
|
212
|
|
- city: "普陀区",
|
213
|
|
- address: "上海市普陀区金沙江路 1518 弄",
|
214
|
|
- zip: 200333
|
215
|
|
- },
|
216
|
|
- {
|
217
|
|
- date: "2016-05-04",
|
218
|
|
- name: "王小虎",
|
219
|
|
- province: "上海",
|
220
|
|
- city: "普陀区",
|
221
|
|
- address: "上海市普陀区金沙江路 1517 弄",
|
222
|
|
- zip: 200333
|
223
|
|
- },
|
224
|
|
- {
|
225
|
|
- date: "2016-05-01",
|
226
|
|
- name: "王小虎",
|
227
|
|
- province: "上海",
|
228
|
|
- city: "普陀区",
|
229
|
|
- address: "上海市普陀区金沙江路 1519 弄",
|
230
|
|
- zip: 200333
|
231
|
|
- },
|
232
|
|
- {
|
233
|
|
- date: "2016-05-03",
|
234
|
|
- name: "王小虎",
|
235
|
|
- province: "上海",
|
236
|
|
- city: "普陀区",
|
237
|
|
- address: "上海市普陀区金沙江路 1516 弄",
|
238
|
|
- zip: 200333
|
239
|
|
- }
|
240
|
|
- ]
|
|
218
|
+ tableData: [],
|
|
219
|
+ normData:[],
|
|
220
|
+ paitents:[],
|
|
221
|
+ tableName:[],
|
|
222
|
+ total:0,
|
|
223
|
+ ObjectData:{},
|
241
|
224
|
};
|
242
|
225
|
},
|
243
|
226
|
methods: {
|
244
|
|
- changeTime() {},
|
|
227
|
+ handleSizeChange(limit){
|
|
228
|
+ this.listQuery.limit = limit
|
|
229
|
+ this.getlist()
|
|
230
|
+ },
|
|
231
|
+ handleCurrentChange(page){
|
|
232
|
+ this.listQuery.page = page
|
|
233
|
+ this.getlist()
|
|
234
|
+ },
|
|
235
|
+ changeTime() {
|
|
236
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
|
|
237
|
+ if (time > 0) {
|
|
238
|
+ this.$message.error("结束时间不能小于开始时间");
|
|
239
|
+ this.listQuery.start_time = "";
|
|
240
|
+ } else {
|
|
241
|
+
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ },
|
245
|
245
|
changeEndTime(val) {
|
246
|
246
|
var time =
|
247
|
247
|
this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
|
|
@@ -251,10 +251,160 @@ export default {
|
251
|
251
|
} else {
|
252
|
252
|
}
|
253
|
253
|
},
|
|
254
|
+ getTimestamp(time) {
|
|
255
|
+ // 把时间日期转成时间戳
|
|
256
|
+ return new Date(time).getTime() / 1000;
|
|
257
|
+ },
|
254
|
258
|
handleClick(row) {
|
255
|
259
|
console.log(row);
|
256
|
260
|
this.$router.push({ path: "/qcd/patientComplianceDetails" });
|
|
261
|
+ },
|
|
262
|
+ getNormData(){
|
|
263
|
+ getNormData().then(response=>{
|
|
264
|
+ if(response.data.state == 1){
|
|
265
|
+ var normdata = response.data.data.normdata
|
|
266
|
+ console.log("normdata",normdata)
|
|
267
|
+
|
|
268
|
+ var a=[];
|
|
269
|
+ for(let i=0;i<normdata.length;i++){
|
|
270
|
+ a.push(normdata[i])
|
|
271
|
+ }
|
|
272
|
+ console.log("a",a)
|
|
273
|
+ this.newArr = a
|
|
274
|
+ var arr = this.arrayToObj(a)
|
|
275
|
+
|
|
276
|
+ console.log("娃哈哈",arr)
|
|
277
|
+ this.ObjectData = arr
|
|
278
|
+
|
|
279
|
+ this.normData = normdata
|
|
280
|
+ }
|
|
281
|
+ })
|
|
282
|
+ },
|
|
283
|
+ onSearch(){
|
|
284
|
+ },
|
|
285
|
+ getlist(){
|
|
286
|
+ getPatientsControl(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
|
|
287
|
+ if(response.data.state == 1){
|
|
288
|
+ var patients = response.data.data.patients
|
|
289
|
+ console.log("paitents",patients)
|
|
290
|
+ // this.tableData = patients;
|
|
291
|
+ var total = response.data.data.total
|
|
292
|
+ console.log("total",total)
|
|
293
|
+ this.total = total
|
|
294
|
+ var control = response.data.data.control
|
|
295
|
+ console.log("control",control)
|
|
296
|
+
|
|
297
|
+ var arr = []
|
|
298
|
+ for(let i=0;i<control.length;i++){
|
|
299
|
+ for(let j=0;j<this.normData.length;j++){
|
|
300
|
+ if(control[i].item_id == this.normData[j].inspection_minor){
|
|
301
|
+ arr.push(control[i])
|
|
302
|
+ }
|
|
303
|
+ }
|
|
304
|
+ }
|
|
305
|
+ console.log("arr",arr)
|
|
306
|
+ let dataInfo = {}
|
|
307
|
+ arr.forEach((item, index) => {
|
|
308
|
+ let { patient_id } = item
|
|
309
|
+ if (!dataInfo[patient_id]) {
|
|
310
|
+ dataInfo[patient_id] = {
|
|
311
|
+ patient_id,
|
|
312
|
+ name:item.name,
|
|
313
|
+ child: [],
|
|
314
|
+ inspect_date:item.inspect_date
|
|
315
|
+ }
|
|
316
|
+ }
|
|
317
|
+ })
|
|
318
|
+ console.log("arr",arr)
|
|
319
|
+ let list = Object.values(dataInfo)
|
|
320
|
+ list.map(item => {
|
|
321
|
+ for (let i = 0; i < arr.length; i++) {
|
|
322
|
+ if (item.inspect_date == arr[i].inspect_date && item.patient_id == arr[i].patient_id) {
|
|
323
|
+ item.child.push(arr[i])
|
|
324
|
+ }
|
|
325
|
+ }
|
|
326
|
+ })
|
|
327
|
+ console.log("list",list)
|
|
328
|
+ var arrtwo = []
|
|
329
|
+ list.map(item =>{
|
|
330
|
+ item.child.map(item=>{
|
|
331
|
+ arrtwo.push(item)
|
|
332
|
+ })
|
|
333
|
+ })
|
|
334
|
+
|
|
335
|
+ console.log("arrtwo",arrtwo)
|
|
336
|
+
|
|
337
|
+ var dd = {};
|
|
338
|
+ for (const index in arrtwo) {
|
|
339
|
+ if (!(arrtwo[index].name in dd)) {
|
|
340
|
+ dd[arrtwo[index].name] = {};
|
|
341
|
+ }
|
|
342
|
+ if (!(arrtwo[index].item_name in dd[arrtwo[index].name]) && arrtwo[index].item_name != 0) {
|
|
343
|
+ dd[arrtwo[index].name][arrtwo[index].item_name] = arrtwo[index];
|
|
344
|
+
|
|
345
|
+ }
|
|
346
|
+ }
|
|
347
|
+ console.log("ddd",dd)
|
|
348
|
+ console.log("obj",this.ObjectData)
|
|
349
|
+ for(const key in dd){
|
|
350
|
+ for(const mkey in this.ObjectData){
|
|
351
|
+ if (!(this.ObjectData[mkey].item_name in dd[key])) {
|
|
352
|
+ dd[key][this.ObjectData[mkey].item_name] = {
|
|
353
|
+ ItemName: this.ObjectData[mkey].item_name,
|
|
354
|
+ name: mkey,
|
|
355
|
+ Count: 0
|
|
356
|
+ };
|
|
357
|
+ }
|
|
358
|
+ }
|
|
359
|
+ this.tableData.push({ name: key, data: dd[key]});
|
|
360
|
+ }
|
|
361
|
+ console.log("表",this.tableData)
|
|
362
|
+ let projectArr = []
|
|
363
|
+ this.newArr.map(item => {
|
|
364
|
+ projectArr.push(item.item_name)
|
|
365
|
+ })
|
|
366
|
+ this.tableData.map(item => {
|
|
367
|
+ // console.log("item---",item.data)
|
|
368
|
+ let arr = Object.values(item.data);
|
|
369
|
+
|
|
370
|
+ arr.sort((a,b)=>{
|
|
371
|
+ return projectArr.indexOf(a.item_name)-projectArr.indexOf(b.item_name);
|
|
372
|
+ });
|
|
373
|
+ item.data = arr
|
|
374
|
+ })
|
|
375
|
+ }
|
|
376
|
+ })
|
|
377
|
+ },
|
|
378
|
+ arrayToObj(arr){
|
|
379
|
+ return Object.assign({},arr);
|
257
|
380
|
}
|
|
381
|
+ },
|
|
382
|
+ created(){
|
|
383
|
+ var nowDate = new Date();
|
|
384
|
+ var nowYear = nowDate.getFullYear();
|
|
385
|
+ var nowMonth = nowDate.getMonth() + 1;
|
|
386
|
+ var nowDay = nowDate.getDate();
|
|
387
|
+ this.listQuery.end_time =
|
|
388
|
+ nowYear +
|
|
389
|
+ "-" +
|
|
390
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
391
|
+ "-" +
|
|
392
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
393
|
+ nowDate.setMonth(nowDate.getMonth() - 3);
|
|
394
|
+ nowYear = nowDate.getFullYear();
|
|
395
|
+ nowMonth = nowDate.getMonth() + 1;
|
|
396
|
+ nowDay = nowDate.getDate();
|
|
397
|
+ this.listQuery.start_time =
|
|
398
|
+ nowYear +
|
|
399
|
+ "-" +
|
|
400
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
401
|
+ "-" +
|
|
402
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
403
|
+
|
|
404
|
+ //获取系统指标
|
|
405
|
+ this.getNormData()
|
|
406
|
+ //获取列表数据
|
|
407
|
+ this.getlist()
|
258
|
408
|
}
|
259
|
409
|
};
|
260
|
410
|
</script>
|