소스 검색

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

csx 5 년 전
부모
커밋
5142f840dc
43개의 변경된 파일8867개의 추가작업 그리고 3283개의 파일을 삭제
  1. 203 0
      src/api/common/common.js
  2. 0 1
      src/api/qcd.js
  3. 13 1
      src/router/modules/dialysis.js
  4. 58 58
      src/router/modules/qcd.js
  5. 83 87
      src/store/modules/xt_user.js
  6. 6 1
      src/xt_pages/data/components/dialysisSummary.vue
  7. 1 1
      src/xt_pages/data/showConfig.vue
  8. 1 0
      src/xt_pages/dialysis/batch_print/batch_print_order_eight.vue
  9. 1486 0
      src/xt_pages/dialysis/batch_print/batch_print_order_thirteen.vue
  10. 12 0
      src/xt_pages/dialysis/bloodPresssWatch.vue
  11. 3 0
      src/xt_pages/dialysis/details/dialog/acceptsTreatmentDialog.vue
  12. 1190 1255
      src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue
  13. 23 0
      src/xt_pages/dialysis/dialysisPrintOrder.vue
  14. 1516 0
      src/xt_pages/dialysis/template/DialysisPrintOrderFifteen.vue
  15. 1 1
      src/xt_pages/dialysis/template/DialysisPrintOrderThirteen.vue
  16. 2 2
      src/xt_pages/integration/his/patientHisConfig.vue
  17. 288 74
      src/xt_pages/qcd/basicInformationAnalysis.vue
  18. 19 6
      src/xt_pages/qcd/checkStatistical.vue
  19. 37 12
      src/xt_pages/qcd/components/LineChart.vue
  20. 2 2
      src/xt_pages/qcd/dialysisTotal.vue
  21. 1 1
      src/xt_pages/qcd/indicatorControlAnalysis/analysisDetails.vue
  22. 453 260
      src/xt_pages/qcd/indicatorControlAnalysis/bloodPressure.vue
  23. 4 4
      src/xt_pages/qcd/indicatorControlAnalysis/bloodPressureDetails.vue
  24. 1 1
      src/xt_pages/qcd/indicatorControlAnalysis/components/office.vue
  25. 1 1
      src/xt_pages/qcd/indicatorControlAnalysis/components/personal.vue
  26. 503 247
      src/xt_pages/qcd/indicatorControlAnalysis/monitor.vue
  27. 282 19
      src/xt_pages/qcd/indicatorControlAnalysis/process.vue
  28. 463 257
      src/xt_pages/qcd/indicatorControlAnalysis/weight.vue
  29. 2 2
      src/xt_pages/qcd/indicatorControlAnalysis/weightDetails.vue
  30. 573 47
      src/xt_pages/qcd/officesControlAnalysis/project.vue
  31. 241 40
      src/xt_pages/qcd/officesControlAnalysis/time.vue
  32. 3 0
      src/xt_pages/qcd/patientAnalysis/dialysisAge.vue
  33. 13 1
      src/xt_pages/qcd/patientComplianceDetails.vue
  34. 1 1
      src/xt_pages/qcd/patientControlAnalysis.vue
  35. 24 11
      src/xt_pages/qcd/statisticalConfiguration.vue
  36. 286 175
      src/xt_pages/qcd/treatmentControlAnalysis/components/CheckAll.vue
  37. 232 105
      src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue
  38. 225 130
      src/xt_pages/qcd/treatmentControlAnalysis/components/TimeAll.vue
  39. 359 174
      src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue
  40. 1 1
      src/xt_pages/qcd/workAnalysis/doctor.vue
  41. 1 1
      src/xt_pages/qcd/workAnalysis/nurse.vue
  42. 252 302
      src/xt_pages/user/inspection.vue
  43. 2 2
      src/xt_pages/user/patients.vue

+ 203 - 0
src/api/common/common.js 파일 보기

@@ -203,3 +203,206 @@ export function getTotalDialysisCount(startime, endtime) {
203 203
     params: params
204 204
   })
205 205
 }
206
+
207
+export function getCurrentOrgPatients(params) {
208
+  return request({
209
+    url: '/com/api/getcurentorgpatients',
210
+    method: 'get',
211
+    params: params
212
+  })
213
+}
214
+
215
+export function getDialysisList(startime, endtime, page, limit) {
216
+  const params = {
217
+    startime: startime,
218
+    endtime: endtime,
219
+    page: page,
220
+    limit: limit
221
+  }
222
+  return request({
223
+    url: '/com/api/getdialysislist',
224
+    method: 'get',
225
+    params: params
226
+  })
227
+}
228
+
229
+export function getLastSort(params) {
230
+  return request({
231
+    url: '/com/api/getlastsort',
232
+    method: 'get',
233
+    params: params
234
+  })
235
+}
236
+
237
+export function getLastCheckList(params) {
238
+  return request({
239
+    url: '/com/api/getlastchecklist',
240
+    method: 'Get',
241
+    params: params
242
+  })
243
+}
244
+
245
+export function getDialysisDetailById(id, startime, endtime, limit, page) {
246
+  const params = {
247
+    id: id,
248
+    startime: startime,
249
+    endtime: endtime,
250
+    limit: limit,
251
+    page: page
252
+  }
253
+  return request({
254
+    url: '/com/api/getdialysisdetailbyid',
255
+    method: 'get',
256
+    params: params
257
+  })
258
+}
259
+
260
+export function getPrescriptionByName(keyword, startime, endtime, limit, page) {
261
+  const params = {
262
+    keyword: keyword,
263
+    startime: startime,
264
+    endtime: endtime,
265
+    limit: limit,
266
+    page: page
267
+  }
268
+  return request({
269
+    url: '/com/api/getprescriptionbyname',
270
+    method: 'Get',
271
+    params: params
272
+  })
273
+}
274
+
275
+export function geStatistics(params) {
276
+  return request({
277
+    url: '/com/api/getstatistics',
278
+    method: 'Get',
279
+    params: params
280
+  })
281
+}
282
+
283
+export function getInspectionTotalCount(startime, endtime) {
284
+  const params = {
285
+    startime: startime,
286
+    endtime: endtime
287
+  }
288
+  return request({
289
+    url: '/com/api/getinspectiontotalcount',
290
+    method: 'get',
291
+    params: params
292
+  })
293
+}
294
+
295
+export function getInspectionDetailById(id, startime, endtime) {
296
+  const params = {
297
+    id: id,
298
+    startime: startime,
299
+    endtime: endtime
300
+  }
301
+  console.log('startime', params)
302
+  return request({
303
+    url: '/com/api/getinspectionDetailById',
304
+    method: 'get',
305
+    params: params
306
+  })
307
+}
308
+
309
+export function getSearchPatientInfo(keyword, startime, endtime) {
310
+  const params = {
311
+    keyword: keyword,
312
+    startime: startime,
313
+    endtime: endtime
314
+  }
315
+  return request({
316
+    url: '/com/api/getsearchpatientinfo',
317
+    method: 'get',
318
+    params: params
319
+  })
320
+}
321
+
322
+export function getAllMajorInspection(params) {
323
+  return request({
324
+    url: '/com/api/getallmajorInspection',
325
+    method: 'Get',
326
+    params: params
327
+  })
328
+}
329
+
330
+export function getPatientList(startime, endtime, limit, page) {
331
+  const params = {
332
+    startime: startime,
333
+    endtime: endtime,
334
+    limit: limit,
335
+    page: page
336
+  }
337
+  return request({
338
+    url: '/com/api/getpatientlist',
339
+    method: 'Get',
340
+    params: params
341
+  })
342
+}
343
+
344
+export function getPatientDetailCheck(id, startime, endtime) {
345
+  const params = {
346
+    id: id,
347
+    startime: startime,
348
+    endtime: endtime
349
+  }
350
+  return request({
351
+    url: '/com/api/getPatientDetailCheck',
352
+    method: 'get',
353
+    params: params
354
+  })
355
+}
356
+
357
+export function SearchDetailCheck(keyword, startime, endtime) {
358
+  const params = {
359
+    keyword: keyword,
360
+    startime: startime,
361
+    endtime: endtime
362
+  }
363
+
364
+  return request({
365
+    url: '/com/api/searchdetailcheck',
366
+    method: 'get',
367
+    params: params
368
+  })
369
+}
370
+
371
+export function getNormData(params) {
372
+  return request({
373
+    url: '/com/api/getnormdata',
374
+    method: 'Get',
375
+    params: params
376
+  })
377
+}
378
+
379
+export function getFirstQuarter(lapseto, startime, endtime) {
380
+  const params = {
381
+    lapseto: lapseto,
382
+    startime: startime,
383
+    endtime: endtime
384
+  }
385
+  console.log('params', params)
386
+  return request({
387
+    url: '/com/api/getfirstquarter',
388
+    method: 'get',
389
+    params: params
390
+  })
391
+}
392
+
393
+export function getProjectList(params) {
394
+  console.log('params', params)
395
+  return request({
396
+    url: '/com/api/getprojectlist',
397
+    method: 'get',
398
+    params: params
399
+  })
400
+}
401
+
402
+export function getMonthProjectList(params) {
403
+  return request({
404
+    url: '/com/api/getmonthprojectlist',
405
+    method: 'get',
406
+    params: params
407
+  })
408
+}

+ 0 - 1
src/api/qcd.js 파일 보기

@@ -100,7 +100,6 @@ export function GetPersonICData(params) {
100 100
   })
101 101
 }
102 102
 
103
-
104 103
 export function GetPersonAdviceData(params) {
105 104
   return request({
106 105
     url: '/api/qcd/papersonadvicedata',

+ 13 - 1
src/router/modules/dialysis.js 파일 보기

@@ -189,7 +189,19 @@ export default {
189 189
         import("@/xt_pages/dialysis/batch_print/batch_print_order_twelve"),
190 190
       hidden: true,
191 191
       is_menu: false,
192
-      name: "dialysis_batch_nine",
192
+      name: "dialysis_batch_twelve",
193
+      meta: {
194
+        title: "批量打印",
195
+        noCache: true
196
+      }
197
+    },
198
+    {
199
+      path: "/dialysis/print/batch/thirteen",
200
+      component: () =>
201
+        import("@/xt_pages/dialysis/batch_print/batch_print_order_thirteen"),
202
+      hidden: true,
203
+      is_menu: false,
204
+      name: "dialysis_batch_thirteen",
193 205
       meta: {
194 206
         title: "批量打印",
195 207
         noCache: true

+ 58 - 58
src/router/modules/qcd.js 파일 보기

@@ -7,66 +7,66 @@ export default {
7 7
   name: "qcd",
8 8
   alwaysShow: true,
9 9
   meta: {
10
-    title: "科室质控",
10
+    title: "质控管理",
11 11
     icon: "statistics"
12 12
   },
13 13
   children: [
14
-    {
15
-      path: "/statistics/index",
16
-      component: () => import("@/xt_pages/statistics/index"),
17
-      name: "statistics",
18
-      meta: {
19
-        title: "statistics",
20
-        noCache: true
21
-      }
22
-    },
23
-    {
24
-      path: "/qcd/dialysistotal",
25
-      component: () => import("@/xt_pages/qcd/dialysisTotal"),
26
-      name: "dialysistotal",
27
-      meta: {
28
-        title: "透析总量",
29
-        noCache: true
30
-      }
31
-    },
32
-    {
33
-      path: "/qcd/processindicators",
34
-      component: () => import("@/xt_pages/qcd/processIndicators"),
35
-      name: "processIndicators",
36
-      meta: {
37
-        title: "过程指标",
38
-        noCache: true
39
-      }
40
-    },
41
-    {
42
-      path: "/qcd/outcomeIndicators/control",
43
-      component: () => import("@/xt_pages/qcd/outcomeIndicators/control"),
44
-      name: "outcomeIndicatorsControl",
45
-      meta: {
46
-        title: "结果指标",
47
-        noCache: true
48
-      }
49
-    },
50
-    {
51
-      path: "/qcd/outcomeIndicators/query",
52
-      hidden: true,
53
-      is_menu: false,
54
-      component: () => import("@/xt_pages/qcd/outcomeIndicators/query"),
55
-      name: "outcomeIndicatorsQuery",
56
-      meta: {
57
-        title: "指标查询",
58
-        noCache: true
59
-      }
60
-    },
61
-    {
62
-      path: "/qcd/patientanalysis/total",
63
-      component: () => import("@/xt_pages/qcd/patientAnalysis/total"),
64
-      name: "patientAnalysisTotal",
65
-      meta: {
66
-        title: "患者分析",
67
-        noCache: true
68
-      }
69
-    },
14
+    // {
15
+    //   path: "/statistics/index",
16
+    //   component: () => import("@/xt_pages/statistics/index"),
17
+    //   name: "statistics",
18
+    //   meta: {
19
+    //     title: "statistics",
20
+    //     noCache: true
21
+    //   }
22
+    // },
23
+    // {
24
+    //   path: "/qcd/dialysistotal",
25
+    //   component: () => import("@/xt_pages/qcd/dialysisTotal"),
26
+    //   name: "dialysistotal",
27
+    //   meta: {
28
+    //     title: "透析总量",
29
+    //     noCache: true
30
+    //   }
31
+    // },
32
+    // {
33
+    //   path: "/qcd/processindicators",
34
+    //   component: () => import("@/xt_pages/qcd/processIndicators"),
35
+    //   name: "processIndicators",
36
+    //   meta: {
37
+    //     title: "过程指标",
38
+    //     noCache: true
39
+    //   }
40
+    // },
41
+    // {
42
+    //   path: "/qcd/outcomeIndicators/control",
43
+    //   component: () => import("@/xt_pages/qcd/outcomeIndicators/control"),
44
+    //   name: "outcomeIndicatorsControl",
45
+    //   meta: {
46
+    //     title: "结果指标",
47
+    //     noCache: true
48
+    //   }
49
+    // },
50
+    // {
51
+    //   path: "/qcd/outcomeIndicators/query",
52
+    //   hidden: true,
53
+    //   is_menu: false,
54
+    //   component: () => import("@/xt_pages/qcd/outcomeIndicators/query"),
55
+    //   name: "outcomeIndicatorsQuery",
56
+    //   meta: {
57
+    //     title: "指标查询",
58
+    //     noCache: true
59
+    //   }
60
+    // },
61
+    // {
62
+    //   path: "/qcd/patientanalysis/total",
63
+    //   component: () => import("@/xt_pages/qcd/patientAnalysis/total"),
64
+    //   name: "patientAnalysisTotal",
65
+    //   meta: {
66
+    //     title: "患者分析",
67
+    //     noCache: true
68
+    //   }
69
+    // },
70 70
     {
71 71
       path: "/qcd/patientanalysis/statisticalConfig",
72 72
       component: () => import("@/xt_pages/qcd/statisticalConfiguration"),
@@ -244,7 +244,7 @@ export default {
244 244
       component: () => import("@/xt_pages/qcd/workAnalysis/doctor"),
245 245
       name: "workAnalysisDoctor",
246 246
       meta: {
247
-        title: "工作量分析统计医生",
247
+        title: "工作量分析统计",
248 248
         noCache: true
249 249
       }
250 250
     },

+ 83 - 87
src/store/modules/xt_user.js 파일 보기

@@ -98,7 +98,6 @@ const xt_user = {
98 98
       state.template_info.id = cur_info.template_info.id
99 99
       state.template_info.org_id = cur_info.template_info.org_id
100 100
       state.template_info.template_id = cur_info.template_info.template_id
101
-
102 101
     },
103 102
 
104 103
     SET_FILEDS: (state, payload) => {
@@ -159,7 +158,6 @@ const xt_user = {
159 158
 
160 159
       state.urlfors = []
161 160
       state.fileds = []
162
-
163 161
     }
164 162
   },
165 163
 
@@ -177,17 +175,16 @@ const xt_user = {
177 175
       commit('SET_ZONE_SELECTED', zone_selected)
178 176
     },
179 177
     SetSubscibePatients({
180
-                          commit,
181
-                          state
182
-                        }) {
178
+      commit,
179
+      state
180
+    }) {
183 181
       commit('SET_SUBSCIBE_PATIENT')
184 182
     },
185 183
 
186 184
     VerifyToken({
187
-                  commit,
188
-                  state
189
-                }, token) {
190
-
185
+      commit,
186
+      state
187
+    }, token) {
191 188
       // console.log('验证 token 之前:token = ' + token)
192 189
       return new Promise((resolve, reject) => {
193 190
         var cacheInfo = getAdminUserInfoCache()
@@ -200,85 +197,84 @@ const xt_user = {
200 197
 
201 198
         // console.log('登录信息缓存:', cacheInfo)
202 199
 
203
-          verifyToken(token).then(response => {
204
-            if (response.data.state === 1) {
205
-              // alert('验证通过')
206
-              // console.log('验证通过')
207
-              var data = response.data.data
208
-              this.commit('SET_CURRENT_INFO', {
209
-                user: data.user,
210
-                cur_org_id: data.current_org_id,
211
-                cur_app_id: data.current_app_id,
212
-                org: data.org,
213
-                subscibe: data.subscibe,
214
-                template_info: data.template_info,
215
-                scrm_role_exist: data.scrm_role_exist,
216
-                cdm_role_exist: data.cdm_role_exist,
217
-                mall_role_exist: data.mall_role_exist
200
+        verifyToken(token).then(response => {
201
+          if (response.data.state === 1) {
202
+            // alert('验证通过')
203
+            // console.log('验证通过')
204
+            var data = response.data.data
205
+            this.commit('SET_CURRENT_INFO', {
206
+              user: data.user,
207
+              cur_org_id: data.current_org_id,
208
+              cur_app_id: data.current_app_id,
209
+              org: data.org,
210
+              subscibe: data.subscibe,
211
+              template_info: data.template_info,
212
+              scrm_role_exist: data.scrm_role_exist,
213
+              cdm_role_exist: data.cdm_role_exist,
214
+              mall_role_exist: data.mall_role_exist
215
+            })
216
+
217
+            const urlfors = data.urlfors
218
+            if (data.cdm_role_exist == true) {
219
+              console.log('有')
220
+              urlfors.push('/slow')
221
+              this.commit('SET_URLFORS', {
222
+                urlfors: urlfors
218 223
               })
224
+            } else {
225
+              this.commit('SET_URLFORS', {
226
+                urlfors: data.urlfors
227
+              })
228
+            }
219 229
 
220
-              let urlfors = data.urlfors
221
-              if(data.cdm_role_exist == true){
222
-                console.log("有")
223
-                urlfors.push("/slow")
224
-                this.commit('SET_URLFORS', {
225
-                  urlfors: urlfors
226
-                })
227
-              }else{
228
-                this.commit('SET_URLFORS', {
229
-                  urlfors: data.urlfors
230
-                })
231
-              }
232
-
233
-              if(data.scrm_role_exist == true){
234
-                urlfors.push("/scrm")
235
-                this.commit('SET_URLFORS', {
236
-                  urlfors: urlfors
237
-                })
238
-              }else{
239
-                this.commit('SET_URLFORS', {
240
-                  urlfors: data.urlfors
241
-                })
242
-              }
243
-
244
-              if(data.mall_role_exist == true){
245
-                console.log("有")
246
-                urlfors.push("/shop")
247
-                this.commit('SET_URLFORS', {
248
-                  urlfors: urlfors
249
-                })
250
-              }else{
251
-                this.commit('SET_URLFORS', {
252
-                  urlfors: data.urlfors
253
-                })
254
-              }
255
-
256
-
257
-              // this.commit('SET_URLFORS', {
258
-              //   urlfors: data.urlfors
259
-              // })
260
-
261
-              commit('SET_FILEDS', {
262
-                fileds: data.fileds
230
+            if (data.scrm_role_exist == true) {
231
+              urlfors.push('/scrm')
232
+              this.commit('SET_URLFORS', {
233
+                urlfors: urlfors
234
+              })
235
+            } else {
236
+              this.commit('SET_URLFORS', {
237
+                urlfors: data.urlfors
263 238
               })
264
-              setFiledConfigList(JSON.stringify(data.fileds))
265
-              cacheAdminUserInfo(JSON.stringify(data))
239
+            }
266 240
 
267
-              resolve(data.user.id)
241
+            if (data.mall_role_exist == true) {
242
+              console.log('有')
243
+              urlfors.push('/shop')
244
+              this.commit('SET_URLFORS', {
245
+                urlfors: urlfors
246
+              })
268 247
             } else {
269
-              alert('请求失败:' + response.data.msg)
270
-              reject({
271
-                msg: response.data.msg,
272
-                code: response.data.code
248
+              this.commit('SET_URLFORS', {
249
+                urlfors: data.urlfors
273 250
               })
274 251
             }
275
-          })
252
+
253
+            // this.commit('SET_URLFORS', {
254
+            //   urlfors: data.urlfors
255
+            // })
256
+
257
+            commit('SET_FILEDS', {
258
+              fileds: data.fileds
259
+            })
260
+            setFiledConfigList(JSON.stringify(data.fileds))
261
+            cacheAdminUserInfo(JSON.stringify(data))
262
+
263
+            resolve(data.user.id)
264
+          } else {
265
+            alert('请求失败:' + response.data.msg)
266
+            reject({
267
+              msg: response.data.msg,
268
+              code: response.data.code
269
+            })
270
+          }
271
+        })
276 272
       })
277 273
     },
278 274
     ModifyAdminUserInfo({
279
-                          commit,
280
-                          state
281
-                        }, params) {
275
+      commit,
276
+      state
277
+    }, params) {
282 278
       commit('MODIFY_USER_INFO', {
283 279
         user_name: params.user_name,
284 280
         avatar: params.avatar
@@ -299,9 +295,9 @@ const xt_user = {
299 295
       )
300 296
     },
301 297
     ModifyOrgInfo({
302
-                    commit,
303
-                    state
304
-                  }, params) {
298
+      commit,
299
+      state
300
+    }, params) {
305 301
       commit('MODIFY_ORG_INFO', {
306 302
         org_name: params.org_name,
307 303
         org_short_name: params.org_short_name
@@ -342,13 +338,13 @@ const xt_user = {
342 338
     // }
343 339
     // 登出
344 340
     FrontendLogout({
345
-                     commit
346
-                   }) {
341
+      commit
342
+    }) {
347 343
       commit('CLEAR_USER_INFO')
348 344
       removeAdminUserInfoCache()
349 345
     }, updateFiledConfigList({ commit }, object) {
350
-
351 346
       var oldFiledList = getFiledConfigList()
347
+      console.log('oldFiledList', oldFiledList)
352 348
       var infoJSON = JSON.parse(oldFiledList)
353 349
       console.log(object)
354 350
       return new Promise((resolve, reject) => {
@@ -377,10 +373,10 @@ const xt_user = {
377 373
         resolve()
378 374
       })
379 375
     }, ModifyAdminUserOrgInfo({ commit, state }, obj) {
380
-        this.commit('SET_CURRENT_INFO',obj)
381
-    },ModifyUrlInfo({ commit, state }, obj) {
376
+      this.commit('SET_CURRENT_INFO', obj)
377
+    }, ModifyUrlInfo({ commit, state }, obj) {
382 378
       this.commit('SET_URLFORS', obj)
383
-    },ModifyFiled({ commit, state }, obj) {
379
+    }, ModifyFiled({ commit, state }, obj) {
384 380
       commit('SET_FILEDS', obj)
385 381
     }
386 382
   }

+ 6 - 1
src/xt_pages/data/components/dialysisSummary.vue 파일 보기

@@ -130,7 +130,12 @@ export default {
130 130
         })
131 131
         .catch(() => {});
132 132
     }
133
-  }
133
+  },
134
+    watch: {
135
+    'dialysis_summary_data':function(){
136
+        console.log("透析小结----",this.dialysis_summary_data)
137
+      }
138
+    },
134 139
 };
135 140
 </script>
136 141
 

+ 1 - 1
src/xt_pages/data/showConfig.vue 파일 보기

@@ -134,7 +134,7 @@ export default {
134 134
   },
135 135
   created() {
136 136
     var filedList = store.getters.xt_user.fileds;
137
-    console.log("filedList", filedList);
137
+    console.log("filedList",filedList)
138 138
     var arr = [];
139 139
     for (let i = 0; i < filedList.length; i++) {
140 140
       if (filedList[i].module == 6) {

+ 1 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_eight.vue 파일 보기

@@ -1719,6 +1719,7 @@ export default {
1719 1719
       })
1720 1720
     },
1721 1721
     getPartName(id) {
1722
+      console.log("id",id)
1722 1723
       for (let i = 0; i < this.bloodAccess.length; i++) {
1723 1724
         if ((this.bloodAccess[i].id = id)) {
1724 1725
           return this.bloodAccess[i].name;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1486 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_thirteen.vue


+ 12 - 0
src/xt_pages/dialysis/bloodPresssWatch.vue 파일 보기

@@ -140,6 +140,16 @@
140 140
           >批量打印</el-button
141 141
         >
142 142
       </template>
143
+      <template v-if="this.template_id == 13">
144
+        <el-button
145
+          size="small"
146
+          icon="el-icon-printer"
147
+          :disabled="selecting_schs.length == 0"
148
+          @click="batchPrintAction"
149
+          type="primary"
150
+          >批量打印</el-button
151
+        >
152
+      </template>
143 153
     </div>
144 154
     <div class="app-container">
145 155
       <!-- <div class="filter-container">
@@ -643,6 +653,8 @@ export default {
643 653
         this.$router.push({ path: "/dialysis/print/batch/nine" });
644 654
       } else if (this.template_id == 12) {
645 655
         this.$router.push({ path: "/dialysis/print/batch/twelve" });
656
+      } else if (this.template_id == 13) {
657
+        this.$router.push({ path: "/dialysis/print/batch/thirteen" });
646 658
       }
647 659
     },
648 660
     batchPrintActionOne: function() {

+ 3 - 0
src/xt_pages/dialysis/details/dialog/acceptsTreatmentDialog.vue 파일 보기

@@ -60,6 +60,9 @@
60 60
         <el-radio v-model="receiveTreatmentAsses.condition" label="3"
61 61
           >手术期</el-radio
62 62
         >
63
+        <el-radio v-model="receiveTreatmentAsses.condition" label="4"
64
+          >急诊</el-radio
65
+        >
63 66
       </el-form-item>
64 67
 
65 68
       <el-form-item

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1190 - 1255
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue


+ 23 - 0
src/xt_pages/dialysis/dialysisPrintOrder.vue 파일 보기

@@ -160,6 +160,16 @@
160 160
           >打印</el-button
161 161
         >
162 162
       </template>
163
+      <template v-if="org_template_info.template_id == 15">
164
+        <el-button
165
+          :loading="loading"
166
+          size="small"
167
+          icon="el-icon-printer"
168
+          @click="printThisPage"
169
+          type="primary"
170
+          >打印</el-button
171
+        >
172
+      </template>
163 173
     </div>
164 174
     <div class="app-container ">
165 175
       <!--<div class="order-print-btn"-->
@@ -245,6 +255,10 @@
245 255
         v-bind:childResponse="childResponse"
246 256
         v-if="org_template_info.template_id == 13"
247 257
       ></DialysisPrintOrderThirteen>
258
+      <DialysisPrintOrderFifteen
259
+        v-bind:childResponse="childResponse"
260
+        v-if="org_template_info.template_id == 15"
261
+      ></DialysisPrintOrderFifteen>
248 262
     </div>
249 263
   </div>
250 264
 </template>
@@ -269,10 +283,12 @@ import DialysisPrintOrderTen from "./template/DialysisPrintOrderTen";
269 283
 import DialysisPrintOrderEleven from "./template/DialysisPrintOrderEleven";
270 284
 import DialysisPrintOrderTwelve from "./template/DialysisPrintOrderTwelve";
271 285
 import DialysisPrintOrderThirteen from "./template/DialysisPrintOrderThirteen";
286
+import DialysisPrintOrderFifteen from "./template/DialysisPrintOrderFifteen";
272 287
 
273 288
 export default {
274 289
   name: "dialysisPrintOrder",
275 290
   components: {
291
+  DialysisPrintOrderFifteen,
276 292
     DialysisPrintOrderThirteen,
277 293
     DialysisPrintOrderTwelve,
278 294
     DialysisPrintOrderEleven,
@@ -508,6 +524,13 @@ export default {
508 524
           style: style3,
509 525
           scanStyles: false
510 526
         });
527
+      } else if (this.org_template_info.template_id == 15){
528
+        printJS({
529
+          printable: "dialysis-print-box",
530
+          type: "html",
531
+          style: style,
532
+          scanStyles: false
533
+        });
511 534
       }
512 535
     },
513 536
     printThisOnePage() {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1516 - 0
src/xt_pages/dialysis/template/DialysisPrintOrderFifteen.vue


+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderThirteen.vue 파일 보기

@@ -340,7 +340,7 @@
340 340
             <td width="50" style="text-align:left;border:none;">
341 341
               <div>
342 342
                 <span class="under_line" style="width:50px;display:inline-block">
343
-                  {{ predialysis.pulse_frequency ? predialysis.pulse_frequency : "" }}
343
+                  {{ afterdialysis.pulse_frequency ? afterdialysis.pulse_frequency : "" }}
344 344
                 </span>次/分
345 345
               </div>
346 346
             </td>

+ 2 - 2
src/xt_pages/integration/his/patientHisConfig.vue 파일 보기

@@ -264,8 +264,8 @@
264 264
         }
265 265
         this.form.other_age = this.getAge(row)
266 266
         this.form.infectious = this.getInfectiousName(row)
267
-        console.log('111111')
268
-        console.log(this.getInfectiousName(row))
267
+       // console.log('111111')
268
+       // console.log(this.getInfectiousName(row))
269 269
 
270 270
         if (row.his_patient.id > 0) {
271 271
           this.his_record_id = row.his_patient.id

+ 288 - 74
src/xt_pages/qcd/basicInformationAnalysis.vue 파일 보기

@@ -55,11 +55,69 @@
55 55
                 <span class="point"></span>
56 56
                 <p class="infoTitle">透析总量({{total}}次)</p>
57 57
               </div>
58
-            
58
+
59 59
               <div class="borderBox">
60 60
                <div v-for="(item,index) in modetype" :key="index">
61
-                <p>{{item.mode_id}}:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
62
-                <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
61
+                 <span v-if="item.mode_id == 1">
62
+                    <p>HD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
63
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
64
+                  </span>
65
+                  <span v-if="item.mode_id == 2">
66
+                    <p>HDF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
67
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
68
+                  </span>
69
+                  <span v-if="item.mode_id == 3">
70
+                    <p>HD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
71
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
72
+                  </span>
73
+                  <span v-if="item.mode_id == 4">
74
+                    <p>HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
75
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
76
+                  </span>
77
+                  <span v-if="item.mode_id == 5">
78
+                    <p>HF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
79
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
80
+                  </span>
81
+                  <span v-if="item.mode_id == 6">
82
+                    <p>SCUF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
83
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
84
+                  </span>
85
+                  <span v-if="item.mode_id == 7">
86
+                    <p>IUF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
87
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
88
+                  </span>
89
+                  <span v-if="item.mode_id == 8">
90
+                    <p>HFHD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
91
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
92
+                  </span>
93
+                  <span v-if="item.mode_id == 9">
94
+                    <p>HFHD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
95
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
96
+                  </span>
97
+                  <span v-if="item.mode_id == 10">
98
+                    <p>PHF:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
99
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
100
+                  </span>
101
+                   <span v-if="item.mode_id == 11">
102
+                    <p>HFR:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
103
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
104
+                  </span>
105
+                  <span v-if="item.mode_id == 12">
106
+                    <p>HDF+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
107
+                    <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
108
+                  </span>
109
+                  <span v-if="item.mode_id == 13">
110
+                      <p>HFHD+HP:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
111
+                      <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
112
+                  </span>
113
+                   <span v-if="item.mode_id == 14">
114
+                      <p>腹水回输:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
115
+                      <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
116
+                  </span>
117
+                   <span v-if="item.mode_id == 19">
118
+                      <p>IUF+HD:{{item.count}}次({{(item.count/total*100).toFixed(1)}}%)</p>
119
+                      <el-progress :percentage="(item.count/total*100).toFixed(1)"></el-progress>
120
+                  </span>
63 121
                </div>
64 122
               </div>
65 123
             </div>
@@ -161,14 +219,14 @@
161 219
                 <p class="infoTitle">透龄统计</p>
162 220
               </div>
163 221
               <div class="borderBox1">
164
-                <p>透析龄≤12:64人(64%)</p>
165
-                <el-progress :percentage="70"></el-progress>
166
-                <p>12&lt;透析龄≤36:64人(64%)</p>
167
-                <el-progress :percentage="70"></el-progress>
168
-                <p>36≤透析龄≤60:64人(64%)</p>
169
-                <el-progress :percentage="70"></el-progress>
170
-                <p>透析龄 ≥60:64人(64%)</p>
171
-                <el-progress :percentage="70"></el-progress>
222
+                <p>透析龄≤12:{{totalone}}人({{(totalone/patientCount*100).toFixed(1)}}%)</p>
223
+                <el-progress :percentage="(totalone/patientCount*100).toFixed(1)"></el-progress>
224
+                <p>12&lt;透析龄≤36:{{totaltwo}}人({{(totaltwo/patientCount*100).toFixed(1)}}%)</p>
225
+                <el-progress :percentage="(totaltwo/patientCount*100).toFixed(1)"></el-progress>
226
+                <p>36≤透析龄≤60:{{totalthree}}/人({{(totalthree/patientCount*100).toFixed(1)}}%)</p>
227
+                <el-progress :percentage="(totalthree/patientCount*100).toFixed(1)"></el-progress>
228
+                <p>透析龄 ≥60:{{patientCount-totalone-totaltwo-totalthree}}人({{((patientCount-totalone-totaltwo-totalthree)/patientCount*100).toFixed(1)}}%)</p>
229
+                <el-progress :percentage="((patientCount-totalone-totaltwo-totalthree)/patientCount*100).toFixed(1)"></el-progress>
172 230
               </div>
173 231
             </div>
174 232
           </div>
@@ -225,6 +283,9 @@ export default {
225 283
       ageCount:[],
226 284
       ageTotal:0,
227 285
       otherTotal:0,
286
+      totalone:0,
287
+      totaltwo:0,
288
+      totalthree:0,
228 289
     };
229 290
   },
230 291
   methods: {
@@ -232,19 +293,157 @@ export default {
232 293
       // 把时间日期转成时间戳
233 294
       return new Date(time).getTime() / 1000;
234 295
     },
235
-    changeTime() {},
296
+    changeTime(val) {
297
+       var timeStar=Date.parse(val)/1000
298
+       var timeEnd =Date.parse(this.listQuery.end_time)/1000
299
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
300
+      if (time > 0) {
301
+        this.$message.error("结束时间不能小于开始时间");
302
+        this.start_time = "";
303
+      } else {
304
+         //统计透析总量
305
+        this.getDialysisModeType(val,this.listQuery.end_time)
306
+        //统计转归状态
307
+        this.getTotalLapseCount(timeStar,timeEnd)
308
+        //统计男女比例
309
+        this.getTotalSexCount(timeStar,timeEnd)
310
+        //统计传染病
311
+        this.getTotalInfectiousCount(timeStar,timeEnd)
312
+        //统计年龄
313
+        this.getTotalAgeCount(timeStar,timeEnd)
314
+        //统计透析年龄
315
+        this.getTotalDialysisCount(timeStar,timeEnd)
316
+      }
317
+    },
236 318
     changeEndTime(val) {
319
+       var timeEnd=Date.parse(val)/1000
320
+       var timeStar =Date.parse(this.listQuery.start_time)/1000
237 321
       var time =
238 322
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
239 323
       if (time < 0) {
240 324
         this.$message.error("结束时间不能小于开始时间");
241 325
         this.listQuery.end_time = "";
242 326
       } else {
327
+          //统计透析总量
328
+        this.getDialysisModeType(this.listQuery.start_time,val)
329
+        //统计转归状态
330
+        this.getTotalLapseCount(timeStar,timeEnd)
331
+        //统计男女比例
332
+        this.getTotalSexCount(timeStar,timeEnd)
333
+        //统计传染病
334
+        this.getTotalInfectiousCount(timeStar,timeEnd)
335
+        //统计年龄
336
+        this.getTotalAgeCount(timeStar,timeEnd)
337
+        //统计透析年龄
338
+        this.getTotalDialysisCount(timeStar,timeEnd)
243 339
       }
244 340
     },
245 341
     selectLapseTo(state) {
246 342
       this.stateType = state;
247 343
       this.listQuery.state = state;
344
+      //获取本月当前机构的透析模式
345
+      const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
346
+      console.log("开始时间",startDate)
347
+      const endDate = moment(new Date()).format('YYYY-MM-DD')
348
+     // console.log("结束时间",endDate)
349
+      var now = new Date()
350
+      var nowMonth = now.getMonth(); //当前月
351
+      var nowYear = now.getFullYear(); //当前年
352
+      //本月的开始时间
353
+      var monthStartDate = new Date(nowYear, nowMonth, 1);
354
+      var timeStar=Date.parse(monthStartDate)/1000;//s
355
+     // console.log("本月第一天",timeStar)
356
+      //本月的结束时间
357
+      var monthEndDate = new Date(nowYear, nowMonth+1, 0);
358
+      var timeEnd=Date.parse(monthEndDate)/1000-1;//s
359
+     // console.log("本月最后一天",timeEnd)
360
+      //本月
361
+      if(state == 0){
362
+       //统计透析总量
363
+        this.getDialysisModeType(startDate,endDate)
364
+        //统计转归状态
365
+        this.getTotalLapseCount(timeStar,timeEnd)
366
+        //统计男女比例
367
+        this.getTotalSexCount(timeStar,timeEnd)
368
+        //统计传染病
369
+        this.getTotalInfectiousCount(timeStar,timeEnd)
370
+        //统计年龄
371
+        this.getTotalAgeCount(timeStar,timeEnd)
372
+        //统计透析年龄
373
+        this.getTotalDialysisCount(timeStar,timeEnd)
374
+      }
375
+      //近三月
376
+      if(state == 1){
377
+        const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
378
+        console.log("三月前",startDate)
379
+        var startunitx = Date.parse(startDate)/1000
380
+        console.log("开始时间搓",startunitx)
381
+        const endDate = moment(new Date()).format('YYYY-MM-DD')
382
+        console.log("结束时间",endDate)
383
+         var endunitx = Date.parse(endDate)/1000
384
+        console.log("日期时间搓",endunitx)
385
+         //统计透析总量
386
+        this.getDialysisModeType(startDate,endDate)
387
+         //统计转归状态
388
+        this.getTotalLapseCount(startunitx,endunitx)
389
+        //统计男女比例
390
+        this.getTotalSexCount(startunitx,endunitx)
391
+        //统计传染病
392
+        this.getTotalInfectiousCount(startunitx,endunitx)
393
+        //统计年龄
394
+        this.getTotalAgeCount(startunitx,endunitx)
395
+        //统计透析年龄
396
+        this.getTotalDialysisCount(startunitx,endunitx)
397
+      }
398
+
399
+     //近半年
400
+     if(state == 2){
401
+        const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
402
+        console.log("6月前",startDate)
403
+        var startunitx = Date.parse(startDate)/1000
404
+        console.log("开始时间搓",startunitx)
405
+        const endDate = moment(new Date()).format('YYYY-MM-DD')
406
+        console.log("结束时间",endDate)
407
+         var endunitx = Date.parse(endDate)/1000
408
+        console.log("日期时间搓",endunitx)
409
+         //统计透析总量
410
+        this.getDialysisModeType(startDate,endDate)
411
+         //统计转归状态
412
+        this.getTotalLapseCount(startunitx,endunitx)
413
+        //统计男女比例
414
+        this.getTotalSexCount(startunitx,endunitx)
415
+        //统计传染病
416
+        this.getTotalInfectiousCount(startunitx,endunitx)
417
+        //统计年龄
418
+        this.getTotalAgeCount(startunitx,endunitx)
419
+        //统计透析年龄
420
+        this.getTotalDialysisCount(startunitx,endunitx)
421
+     }
422
+
423
+     //近一年
424
+     if(state == 3){
425
+        const startDate = moment().subtract('month', 12).format('YYYY-MM-DD')
426
+        console.log("6月前",startDate)
427
+        var startunitx = Date.parse(startDate)/1000
428
+        console.log("开始时间搓",startunitx)
429
+        const endDate = moment(new Date()).format('YYYY-MM-DD')
430
+        console.log("结束时间",endDate)
431
+         var endunitx = Date.parse(endDate)/1000
432
+        console.log("日期时间搓",endunitx)
433
+         //统计透析总量
434
+        this.getDialysisModeType(startDate,endDate)
435
+         //统计转归状态
436
+        this.getTotalLapseCount(startunitx,endunitx)
437
+        //统计男女比例
438
+        this.getTotalSexCount(startunitx,endunitx)
439
+        //统计传染病
440
+        this.getTotalInfectiousCount(startunitx,endunitx)
441
+        //统计年龄
442
+        this.getTotalAgeCount(startunitx,endunitx)
443
+        //统计透析年龄
444
+        this.getTotalDialysisCount(startunitx,endunitx)
445
+     }
446
+
248 447
     },
249 448
     getDialysisModeType(startDate,endDate){
250 449
       getDialysisModeType(startDate,endDate).then(response=>{
@@ -254,56 +453,56 @@ export default {
254 453
             var total =  response.data.data.total
255 454
             console.log("total",total)
256 455
             this.total = total
257
-           for(let i=0;i<modetype.length;i++){
258
-             if(modetype[i].mode_id == 1){
259
-               modetype[i].mode_id = "HD"
260
-             }
261
-             if(modetype[i].mode_id == 2){
262
-               modetype[i].mode_id = "HDF"
263
-             }
264
-             if(modetype[i].mode_id == 3){
265
-               modetype[i].mode_id = "HD+HP"
266
-             }
267
-              if(modetype[i].mode_id == 4){
268
-               modetype[i].mode_id = "HP"
269
-             }
270
-              if(modetype[i].mode_id == 5){
271
-               modetype[i].mode_id = "HF"
272
-             }
273
-             if(modetype[i].mode_id == 6){
274
-               modetype[i].mode_id = "SCUF"
275
-             }
276
-             if(modetype[i].mode_id == 7){
277
-               modetype[i].mode_id = "IUF"
278
-             }
279
-              if(modetype[i].mode_id == 8){
280
-               modetype[i].mode_id = "HFHD"
281
-             }
282
-             if(modetype[i].mode_id == 9){
283
-               modetype[i].mode_id = "HFHD+HP"
284
-             }
285
-             if(modetype[i].mode_id == 10){
286
-               modetype[i].mode_id = "PHF"
287
-             }
288
-             if(modetype[i].mode_id == 11){
289
-               modetype[i].mode_id = "HFR"
290
-             }
291
-            if(modetype[i].mode_id == 12){
292
-               modetype[i].mode_id = "HDF+HP"
293
-             }
294
-              if(modetype[i].mode_id == 13){
295
-               modetype[i].mode_id = "HFHD+HP"
296
-             }
297
-              if(modetype[i].mode_id == 14){
298
-               modetype[i].mode_id = "腹水回输"
299
-             }
300
-            if(modetype[i].mode_id == 19){
301
-               modetype[i].mode_id = "IUF+HD"
302
-             }
303
-           }
456
+           // for(let i=0;i<modetype.length;i++){
457
+           //   if(modetype[i].mode_id == 1){
458
+           //     modetype[i].mode_id = "HD"
459
+           //   }
460
+           //   if(modetype[i].mode_id == 2){
461
+           //     modetype[i].mode_id = "HDF"
462
+           //   }
463
+           //   if(modetype[i].mode_id == 3){
464
+           //     modetype[i].mode_id = "HD+HP"
465
+           //   }
466
+           //    if(modetype[i].mode_id == 4){
467
+           //     modetype[i].mode_id = "HP"
468
+           //   }
469
+           //    if(modetype[i].mode_id == 5){
470
+           //     modetype[i].mode_id = "HF"
471
+           //   }
472
+           //   if(modetype[i].mode_id == 6){
473
+           //     modetype[i].mode_id = "SCUF"
474
+           //   }
475
+           //   if(modetype[i].mode_id == 7){
476
+           //     modetype[i].mode_id = "IUF"
477
+           //   }
478
+           //    if(modetype[i].mode_id == 8){
479
+           //     modetype[i].mode_id = "HFHD"
480
+           //   }
481
+           //   if(modetype[i].mode_id == 9){
482
+           //     modetype[i].mode_id = "HFHD+HP"
483
+           //   }
484
+           //   if(modetype[i].mode_id == 10){
485
+           //     modetype[i].mode_id = "PHF"
486
+           //   }
487
+           //   if(modetype[i].mode_id == 11){
488
+           //     modetype[i].mode_id = "HFR"
489
+           //   }
490
+           //  if(modetype[i].mode_id == 12){
491
+           //     modetype[i].mode_id = "HDF+HP"
492
+           //   }
493
+           //    if(modetype[i].mode_id == 13){
494
+           //     modetype[i].mode_id = "HFHD+HP"
495
+           //   }
496
+           //    if(modetype[i].mode_id == 14){
497
+           //     modetype[i].mode_id = "腹水回输"
498
+           //   }
499
+           //  if(modetype[i].mode_id == 19){
500
+           //     modetype[i].mode_id = "IUF+HD"
501
+           //   }
502
+           //}
304 503
            this.modetype = modetype
305 504
            console.log("modetype",modetype)
306
-         
505
+
307 506
          }
308 507
       })
309 508
     },
@@ -361,7 +560,7 @@ export default {
361 560
             //   if(infectious[i].disease_id == 6){
362 561
             //     infectious[i].disease_id = "梅毒"
363 562
             //   }
364
-               
563
+
365 564
             // }
366 565
              var otherTotal = response.data.data.otherTotal
367 566
              this.otherTotal = otherTotal
@@ -378,7 +577,7 @@ export default {
378 577
           this.ageTotal =  response.data.data.total
379 578
          // var two = response.data.data.two
380 579
         //  console.log("two",two)
381
-       
580
+
382 581
          }
383 582
       })
384 583
     },
@@ -386,21 +585,36 @@ export default {
386 585
     getTotalDialysisCount(timeStar,timeEnd){
387 586
       getTotalDialysisCount(timeStar,timeEnd).then(response=>{
388 587
          if(response.data.state == 1){
588
+           var dataage =  response.data.data.dataage
589
+           console.log("dataage",dataage)
590
+           var nowtime =  response.data.data.nowtime
591
+           console.log("nowtime",nowtime)
389 592
            var patients = response.data.data.patients
390
-           var now = new Date()
391
-           var nowMonth = now.getMonth(); //当前月 
392
-           var nowYear = now.getFullYear(); //当前年 
393
-           var notime =  moment(new Date()).format('YYYY-MM-DD')
394
-           var nowdataunix =  Date.parse(notime)/1000
395
-           console.log("档期是---------------",nowdataunix)
593
+           var arr =[]
594
+           var arrtwo = []
595
+           var arrthree = []
396 596
            for(let i=0;i<patients.length;i++){
397
-             if(patients[i].first_dialysis_date){
597
+             if(nowtime - patients[i].first_dialysis_date <= 378691200){
598
+                arr.push(patients[i].first_dialysis_date)
599
+             }
600
+             if((nowtime-patients[i].first_dialysis_date)>378691200 && (nowtime-patients[i].first_dialysis_date)<=1136073600){
601
+               arrtwo.push(patients[i].first_dialysis_date)
602
+             }
603
+             if((nowtime-patients[i].first_dialysis_date)>1136073600 && (nowtime-patients[i].first_dialysis_date)<=1893456000){
604
+               arrthree.push(patients[i].first_dialysis_date)
398 605
              }
399 606
            }
607
+           this.totalone = arr.length
608
+           this.totaltwo = arrtwo.length
609
+           this.totalthree = arrthree.length
610
+           console.log("长度",arr.length)
611
+           console.log("长度2",arrtwo.length)
612
+           console.log("长度3",arrthree.length)
400 613
            console.log("patients",patients)
614
+
401 615
             var date =  new Date(1212508800)
402 616
           console.log("date",date)
403
-          
617
+
404 618
          }
405 619
       })
406 620
     }
@@ -410,12 +624,12 @@ export default {
410 624
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
411 625
       console.log("开始时间",startDate)
412 626
       const endDate = moment(new Date()).format('YYYY-MM-DD')
413
-     // console.log("结束时间",endDate) 
627
+     // console.log("结束时间",endDate)
414 628
       var now = new Date()
415
-      var nowMonth = now.getMonth(); //当前月 
416
-      var nowYear = now.getFullYear(); //当前年 
629
+      var nowMonth = now.getMonth(); //当前月
630
+      var nowYear = now.getFullYear(); //当前年
417 631
       //本月的开始时间
418
-      var monthStartDate = new Date(nowYear, nowMonth, 1); 
632
+      var monthStartDate = new Date(nowYear, nowMonth, 1);
419 633
       var timeStar=Date.parse(monthStartDate)/1000;//s
420 634
      // console.log("本月第一天",timeStar)
421 635
       //本月的结束时间

+ 19 - 6
src/xt_pages/qcd/checkStatistical.vue 파일 보기

@@ -108,7 +108,7 @@ import { GetOICData } from "@/api/qcd";
108 108
 import PieChart from "../qcd/components/BarChart";
109 109
 import { uParseTime } from "@/utils/tools";
110 110
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
111
-import {getAllInspectionData,SaveCheckConfiguration,getAllCheckList,getCheckDetail,UpdateCheck,DeleteCheck} from "@/api/common/common"
111
+import {getAllInspectionData,SaveCheckConfiguration,getAllCheckList,getCheckDetail,UpdateCheck,DeleteCheck,getLastCheckList} from "@/api/common/common"
112 112
 export default {
113 113
   name: "dialysisTotal",
114 114
   data() {
@@ -147,7 +147,9 @@ export default {
147 147
   created() {
148 148
     //获取大项
149 149
     this.getAllInspectionData(),
150
-    this.getAllCheckList()
150
+    this.getAllCheckList(),
151
+    //获取排序
152
+    this.getLastCheckList()
151 153
   },
152 154
   methods: {
153 155
     handleTabClick(tab, event) {
@@ -160,7 +162,7 @@ export default {
160 162
        getCheckDetail(id).then(response=>{
161 163
          if(response.data.state == 1){
162 164
            var checkdetail = response.data.data.checkdetail
163
-           console.log("checkdetail",checkdetail)
165
+          // console.log("checkdetail",checkdetail)
164 166
            this.editform.id = checkdetail.id
165 167
            this.editform.inspectionMajor = checkdetail.inspection_major
166 168
            this.editform.frequency = checkdetail.inspection_frequency
@@ -193,9 +195,12 @@ export default {
193 195
                 this.form.inspectionMajor = ""
194 196
                 this.form.frequency = ""
195 197
                 this.form.sort = ""
198
+                this.getAllCheckList()
199
+                this.getLastCheckList()
196 200
               }else{
197 201
                 this.$message.error("检验检查项已存在,不能重复添加")
198 202
               }
203
+              
199 204
            })
200 205
          }
201 206
        })
@@ -217,10 +222,10 @@ export default {
217 222
               checklist[i].sort = ""
218 223
             }
219 224
           }
220
-          console.log("列表",checklist)
225
+         // console.log("列表",checklist)
221 226
           this.checkList = checklist
222 227
           this.total = response.data.data.total
223
-          console.log("total",this.total)
228
+          //console.log("total",this.total)
224 229
         }
225 230
       })
226 231
     },
@@ -264,11 +269,19 @@ export default {
264 269
         DeleteCheck(id,index).then(response => {
265 270
           if (response.data.state === 1) {
266 271
            var msg =  response.data.data.msg
267
-           console.log("msg",msg)
272
+           //console.log("msg",msg)
268 273
            this.checkList.splice(index,1)
269 274
           }
270 275
         });
271 276
       });
277
+    },
278
+    getLastCheckList(){
279
+      getLastCheckList().then(response=>{
280
+         if(response.data.state === 1){
281
+          var checklist =  response.data.data.checkList
282
+          this.form.sort = checklist.sort+1+""
283
+         }
284
+      })
272 285
     }
273 286
   },
274 287
   components: {

+ 37 - 12
src/xt_pages/qcd/components/LineChart.vue 파일 보기

@@ -79,15 +79,22 @@ export default {
79 79
     this.chart = null;
80 80
   },
81 81
   watch: {
82
-    options: function() {
83
-      this.chartOptions = this.options;
84
-      this.initChart();
85
-      this.__resizeHanlder = debounce(() => {
86
-        if (this.chart) {
87
-          this.chart.resize();
88
-        }
89
-      }, 100);
90
-      window.addEventListener("resize", this.__resizeHanlder);
82
+    // options: function(a) {
83
+    //   console.log(a)
84
+    //   this.chartOptions = this.options;
85
+    //   this.initChart();
86
+    //   this.__resizeHanlder = debounce(() => {
87
+    //     if (this.chart) {
88
+    //       this.chart.resize();
89
+    //     }
90
+    //   }, 100);
91
+    //   window.addEventListener("resize", this.__resizeHanlder);
92
+    // },
93
+    options:{
94
+      handler(newValue,oldValue){
95
+        this.getInitChart();
96
+      },
97
+      deep:true
91 98
     },
92 99
 
93 100
     chartData: {
@@ -99,9 +106,19 @@ export default {
99 106
   },
100 107
   created() {
101 108
     this.chartOptions = this.options;
102
-    console.log("this.chartOptions", this.chartOptions, this.options);
109
+    // console.log("this.chartOptions", this.chartOptions, this.options);
103 110
   },
104 111
   methods: {
112
+    getInitChart() {
113
+      this.chartOptions = this.options;
114
+      this.initChart();
115
+      this.__resizeHanlder = debounce(() => {
116
+        if (this.chart) {
117
+          this.chart.resize();
118
+        }
119
+      }, 100);
120
+      window.addEventListener("resize", this.__resizeHanlder);
121
+    },
105 122
     // setOptions({ expectedData, actualData } = {}) {
106 123
     //   this.chart.setOption({
107 124
     //     title: {
@@ -152,7 +169,7 @@ export default {
152 169
           },
153 170
           axisLine: {
154 171
             lineStyle: {
155
-              color: "pink" //x轴颜色
172
+              color: "#E5E5E5" //x轴颜色
156 173
             }
157 174
           },
158 175
           axisLabel: {
@@ -176,6 +193,9 @@ export default {
176 193
               } else {
177 194
                 return value;
178 195
               }
196
+            },
197
+            textStyle: {
198
+              color:"#2F3133"
179 199
             }
180 200
           }
181 201
         },
@@ -199,7 +219,12 @@ export default {
199 219
           },
200 220
           axisLine: {
201 221
             lineStyle: {
202
-              color: "pink" //y轴颜色
222
+              color: "#E5E5E5" //y轴颜色
223
+            },
224
+          },
225
+          axisLabel: {
226
+            textStyle: {
227
+              color:"#2F3133"
203 228
             }
204 229
           }
205 230
         },

+ 2 - 2
src/xt_pages/qcd/dialysisTotal.vue 파일 보기

@@ -146,8 +146,8 @@
146 146
         align="right"
147 147
         @size-change="handleSizeChange"
148 148
         @current-change="handleCurrentChange"
149
-        :current-page="listQuery.pate"
150
-        :page-sizes="[10, 20, 50, 100]"
149
+        :current-page="listQuery.page"
150
+        :page-sizes="[20, 40, 60,80, 100]"
151 151
         :page-size="10"
152 152
         background
153 153
         style="margin-top:20px;"

+ 1 - 1
src/xt_pages/qcd/indicatorControlAnalysis/analysisDetails.vue 파일 보기

@@ -16,7 +16,7 @@
16 16
         <el-container>
17 17
           <div style="width:150px">
18 18
             <div class="tableTitle">患者列表</div>
19
-            <el-table :data="tableData" border style="width: 100%;" height="500">
19
+            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
20 20
               <el-table-column prop="date" label="日期" width="70"></el-table-column>
21 21
               <el-table-column prop="name" label="姓名" width="80"></el-table-column>
22 22
             </el-table>

+ 453 - 260
src/xt_pages/qcd/indicatorControlAnalysis/bloodPressure.vue 파일 보기

@@ -4,33 +4,48 @@
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
     </div>
6 6
     <div class="app-container">
7
-      <div class="page_bloodPressure">
7
+      <div class="page_process">
8 8
         <new-nav activeName="bloodPressure"></new-nav>
9 9
         <div class="cell clearfix">
10
-          <el-form :inline="true" :model="listQuery">
10
+          <el-form :inline="true">
11 11
             <el-form-item label>
12
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:110px"></el-input>
13
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
12
+              <el-autocomplete
13
+                class="checkSearch"
14
+                popper-class="my-autocomplete"
15
+                v-model="search_value"
16
+                :fetch-suggestions="querySearchAsync"
17
+                :trigger-on-focus="false"
18
+                placeholder="请输入病人名字"
19
+                @select="handleSelect"
20
+              >
21
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
22
+                <template slot-scope="{ item }">
23
+                  <div class="name">{{ item.name }}</div>
24
+                </template>
25
+              </el-autocomplete>
26
+
14 27
             </el-form-item>
15 28
           </el-form>
16
-          <el-select v-model="value" placeholder="请选择" style="width:110px;margin-right:10px">
29
+          <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
17 30
             <el-option
18 31
               v-for="item in options"
19 32
               :key="item.value"
20
-              :label="item.label"
33
+              :label="item.name"
21 34
               :value="item.value"
35
+
22 36
             ></el-option>
23 37
           </el-select>
24 38
           <label class="title">
25 39
             <span class="name">日期查询</span> :
26 40
           </label>
27 41
           <el-date-picker
28
-            v-model="listQuery.start_time"
42
+            v-model="query.start_time"
29 43
             prefix-icon="el-icon-date"
30 44
             @change="changeTime"
31 45
             :editable="false"
32 46
             style="width: 150px;"
33 47
             type="date"
48
+            :picker-options="pickerOptions"
34 49
             placeholder="选择日期时间"
35 50
             align="right"
36 51
             format="yyyy-MM-dd"
@@ -38,10 +53,11 @@
38 53
           ></el-date-picker>
39 54
           <span class>-</span>
40 55
           <el-date-picker
41
-            v-model="listQuery.end_time"
56
+            v-model="query.end_time"
42 57
             prefix-icon="el-icon-date"
43 58
             @change="changeEndTime"
44 59
             :editable="false"
60
+            :picker-options="pickerOptions"
45 61
             style="width: 150px;"
46 62
             type="date"
47 63
             placeholder="选择日期时间"
@@ -53,39 +69,88 @@
53 69
         <el-container>
54 70
           <div style="width:150px">
55 71
             <div class="tableTitle">患者列表</div>
56
-            <el-table :data="tableData" border style="width: 100%;" height="500">
57
-              <el-table-column prop="date" label="日期" width="70"></el-table-column>
58
-              <el-table-column prop="name" label="姓名" width="80"></el-table-column>
72
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
73
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
74
+                      highlight-current-row
75
+                      @current-change="handleChange">
76
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
77
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
78
+              </el-table-column>
79
+              <el-table-column prop="name" label="姓名" width="80">
80
+                <template slot-scope="scope">{{ scope.row.name }}</template>
81
+              </el-table-column>
59 82
             </el-table>
60 83
           </div>
61 84
           <div style="padding-left:10px;flex:1">
62 85
             <div class="tableTitle">指标趋势</div>
63 86
             <div>
64
-              <line-chart :options="chart"></line-chart>
65
-            </div>
66
-            <div class="cell clearfix" style="margin:0;margin-bottom:10px">
67
-              <div class="tableTitle">统计表</div>
87
+              <line-chart :options="bar"></line-chart>
88
+
68 89
             </div>
90
+            <div class="tableTitle">统计表</div>
69 91
             <div>
70
-              <el-table :data="tableData1" style="width: 100%" border>
71
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
72
-                <el-table-column prop="name" label="姓名"></el-table-column>
73
-                <el-table-column prop="province" label="省份"></el-table-column>
74
-                <el-table-column prop="city" label="市区"></el-table-column>
75
-                <el-table-column prop="address" label="地址"></el-table-column>
76
-                <el-table-column prop="zip" label="邮编"></el-table-column>
77
-                <el-table-column label="操作" width="100">
92
+              <el-table :data="tableData" style="width: 100%" :height="tableHeight" >
93
+                <el-table-column fixed label="日期" align="center">
94
+                  <template slot-scope="scope">
95
+                    {{scope.row.schedule_date | parseTime("{y}-{m}-{d}") }}
96
+                  </template>
97
+                </el-table-column>
98
+
99
+                <el-table-column label="姓名" align="center">
100
+                  <template slot-scope="scope">
101
+                    {{scope.row.patient.name}}
102
+                  </template>
103
+                </el-table-column>
104
+
105
+                <el-table-column label="状态" align="center">
78 106
                   <template slot-scope="scope">
79
-                    <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
107
+                    {{scope.row.patient.lapseto == 1 ? '留治':'转出'}}
80 108
                   </template>
81 109
                 </el-table-column>
110
+
111
+                <el-table-column label="透前血压" align="center">
112
+                  <template slot-scope="scope">
113
+                    <div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>
114
+                  </template>
115
+                </el-table-column>
116
+
117
+                <el-table-column label="透析中最低血压" align="center">
118
+                  <template slot-scope="scope">
119
+                    <div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>
120
+                  </template>
121
+                </el-table-column>
122
+
123
+                <el-table-column label="透析中最高血压" align="center">
124
+                  <template slot-scope="scope">
125
+                    <div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>
126
+
127
+
128
+                  </template>
129
+                </el-table-column>
130
+
131
+                <el-table-column label="透后血压" align="center">
132
+                  <template slot-scope="scope">
133
+                    <div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>
134
+                  </template>
135
+                </el-table-column>
136
+
137
+                <el-table-column fixed="right" label="趋势" align="center">
138
+                  <template slot-scope="scope">
139
+                    <el-button
140
+                      @click.native.prevent="jumpDetail(scope.row.patient.id)"
141
+                      type="text"
142
+                      size="small"
143
+                    >详情</el-button>
144
+                  </template>
145
+                </el-table-column>
146
+
82 147
               </el-table>
83 148
 
84 149
               <el-pagination
85 150
                 align="right"
86 151
                 @size-change="handleSizeChange"
87 152
                 @current-change="handleCurrentChange"
88
-                :current-page="listQuery.page"
153
+                :current-page="query.page"
89 154
                 :page-sizes="[10, 20, 50, 100]"
90 155
                 :page-size="10"
91 156
                 background
@@ -103,264 +168,392 @@
103 168
 
104 169
 
105 170
 <script>
106
-import echarts from "echarts";
107
-import NewNav from "../indicatorControlAnalysis/components/NewNav";
108
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
109
-import LineChart from "../../qcd/components/LineChart";
110
-export default {
111
-  components: {
112
-    LineChart,
113
-    BreadCrumb,
114
-    NewNav
115
-  },
116
-  data() {
117
-    return {
118
-      crumbs: [
119
-        { path: false, name: "科室质控" },
120
-        { path: false, name: "指标评估统计" },
121
-        { path: false, name: "患者血压统计" }
122
-      ],
123
-      listQuery: {
124
-        start_time: "",
125
-        end_time: "",
126
-        page: 1,
127
-        limit: 10
128
-      },
129
-      tableData: [
130
-        {
131
-          date: "2016",
132
-          name: "王小虎"
133
-        },
134
-        {
135
-          date: "2016",
136
-          name: "王小虎"
137
-        },
138
-        {
139
-          date: "2016",
140
-          name: "王小虎"
141
-        },
142
-        {
143
-          date: "2016",
144
-          name: "王小虎"
145
-        },
146
-        {
147
-          date: "2016",
148
-          name: "王小虎"
149
-        },
150
-        {
151
-          date: "2016",
152
-          name: "王小虎"
153
-        },
154
-        {
155
-          date: "2016",
156
-          name: "王小虎"
157
-        },
158
-        {
159
-          date: "2016",
160
-          name: "王小虎"
161
-        },
162
-        {
163
-          date: "2016",
164
-          name: "王小虎"
165
-        },
166
-        {
167
-          date: "2016",
168
-          name: "王小虎"
169
-        },
170
-        {
171
-          date: "2016",
172
-          name: "王小虎"
173
-        },
174
-        {
175
-          date: "2016",
176
-          name: "王小虎"
177
-        }
178
-      ],
179
-      tableData1: [
180
-        {
181
-          date: "2016-05-03",
182
-          name: "王小虎",
183
-          province: "上海",
184
-          city: "普陀区",
185
-          address: "上海市普陀区金沙江路 1518 弄",
186
-          zip: 200333
187
-        },
188
-        {
189
-          date: "2016-05-02",
190
-          name: "王小虎",
191
-          province: "上海",
192
-          city: "普陀区",
193
-          address: "上海市普陀区金沙江路 1518 弄",
194
-          zip: 200333
195
-        },
196
-        {
197
-          date: "2016-05-04",
198
-          name: "王小虎",
199
-          province: "上海",
200
-          city: "普陀区",
201
-          address: "上海市普陀区金沙江路 1518 弄",
202
-          zip: 200333
203
-        },
204
-        {
205
-          date: "2016-05-01",
206
-          name: "王小虎",
207
-          province: "上海",
208
-          city: "普陀区",
209
-          address: "上海市普陀区金沙江路 1518 弄",
210
-          zip: 200333
211
-        },
212
-        {
213
-          date: "2016-05-08",
214
-          name: "王小虎",
215
-          province: "上海",
216
-          city: "普陀区",
217
-          address: "上海市普陀区金沙江路 1518 弄",
218
-          zip: 200333
219
-        },
220
-        {
221
-          date: "2016-05-06",
222
-          name: "王小虎",
223
-          province: "上海",
224
-          city: "普陀区",
225
-          address: "上海市普陀区金沙江路 1518 弄",
226
-          zip: 200333
227
-        },
228
-        {
229
-          date: "2016-05-07",
230
-          name: "王小虎",
231
-          province: "上海",
232
-          city: "普陀区",
233
-          address: "上海市普陀区金沙江路 1518 弄",
234
-          zip: 200333
235
-        },
236
-        {
237
-          date: "2016-05-08",
238
-          name: "王小虎",
239
-          province: "上海",
240
-          city: "普陀区",
241
-          address: "上海市普陀区金沙江路 1518 弄",
242
-          zip: 200333
243
-        },
244
-        {
245
-          date: "2016-05-06",
246
-          name: "王小虎",
247
-          province: "上海",
248
-          city: "普陀区",
249
-          address: "上海市普陀区金沙江路 1518 弄",
250
-          zip: 200333
251
-        },
252
-        {
253
-          date: "2016-05-07",
254
-          name: "王小虎",
255
-          province: "上海",
256
-          city: "普陀区",
257
-          address: "上海市普陀区金沙江路 1518 弄",
258
-          zip: 200333
259
-        }
260
-      ],
261
-      chart: {
262
-        title: {
263
-          text: "ECharts 入门示例"
264
-        },
265
-        tooltip: {},
266
-        legend: {
267
-          data: ["次数"],
268
-          left: 0
171
+  import echarts from 'echarts'
172
+  import NewNav from '../indicatorControlAnalysis/components/NewNav'
173
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
174
+  import LineChart from '../../qcd/components/LineChart'
175
+  import { getCurrentOrgPatients } from "@/api/common/common";
176
+
177
+
178
+  import {GetDialysisBloodPressureChartData,GetDialysisBloodPressureTableData} from "@/api/common/statistics"
179
+
180
+  import {
181
+    PostSearch
182
+  } from '@/api/patient'
183
+
184
+  import { uParseTime } from "@/utils/tools";
185
+  import { getDataConfig } from "@/utils/data";
186
+
187
+  export default {
188
+    components: {
189
+      LineChart,
190
+      BreadCrumb,
191
+      NewNav
192
+    },
193
+    data() {
194
+      return {
195
+        pickerOptions: {
196
+          disabledDate(time) {
197
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
198
+            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
199
+          }
269 200
         },
270
-        xAxis: {
271
-          data: ["达标", "未达标"]
201
+        patientsData:[],
202
+        tableData: [
203
+        ],
204
+        loading: false,
205
+        search_value: '',
206
+        total: '',
207
+        query: {
208
+          patient_id: '',
209
+          statistics_type: 1,
210
+          start_time: '',
211
+          end_time: '',
212
+          limit: 10,
213
+          page: 1
272 214
         },
273
-        yAxis: {
274
-          axisLabel: {
275
-            formatter: "{value} %"
215
+        options: [
216
+          { value: 1, name: '不限' },
217
+          { value: 2, name: '透前血压' },
218
+          { value: 3, name: '透后血压' },
219
+        ],
220
+        crumbs: [
221
+          { path: false, name: '科室质控' },
222
+          { path: false, name: '指标评估统计' },
223
+          { path: false, name: '透析过程指标统计' }
224
+        ],
225
+        tableData1: [],
226
+        chart: {
227
+          title: {
228
+            text: 'ECharts 入门示例'
276 229
           },
277
-          show: false
278
-        },
279
-        series: [
280
-          {
281
-            name: "次数",
282
-            type: "bar",
283
-            data: ["78.57", "50"],
284
-            barWidth: 30,
285
-            label: {
286
-              normal: {
287
-                show: true,
288
-                position: "top",
289
-                formatter: "{c}次"
290
-              }
230
+          tooltip: {},
231
+          legend: {
232
+            data: [],
233
+            left: 0
234
+          },
235
+          xAxis: {
236
+            data: []
237
+          },
238
+          yAxis: {
239
+            axisLabel: {
240
+              formatter: '{value} %'
291 241
             },
292
-            //配置样式
293
-            itemStyle: {
294
-              //通常情况下:
295
-
296
-              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
297
-              normal: {
298
-                color: function(params) {
299
-                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
300
-                  var colorList = [
301
-                    ["#A9E0F3", "#9FBDFC"],
302
-
303
-                    ["#FFD7C0", "#FF9994"]
304
-                  ];
305
-
306
-                  var index = params.dataIndex;
307
-                  if (params.dataIndex >= colorList.length) {
308
-                    index = params.dataIndex % colorList.length;
309
-                  }
310
-
311
-                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
312
-                    { offset: 0, color: colorList[index][0] },
313
-                    // { offset: 0.5, color: colorList[index][1] },
314
-                    { offset: 1, color: colorList[index][1] }
315
-                  ]);
242
+            show: false
243
+          },
244
+          series: [
245
+            {
246
+              name: '',
247
+              type: 'line',
248
+              data: [],
249
+              barWidth: 30,
250
+              label: {
251
+                normal: {
252
+                  show: true,
253
+                  position: 'top',
254
+                  formatter: '{c}'
255
+                }
256
+              },
257
+              //配置样式
258
+              itemStyle: {
259
+                //通常情况下:
260
+
261
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
262
+                normal: {
263
+                  color: function(params) {
264
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
265
+                    var colorList = [
266
+                      ['#A9E0F3', '#9FBDFC'],
267
+
268
+                      ['#FFD7C0', '#FF9994']
269
+                    ]
270
+
271
+                    var index = params.dataIndex
272
+                    if (params.dataIndex >= colorList.length) {
273
+                      index = params.dataIndex % colorList.length
274
+                    }
275
+
276
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
277
+                      { offset: 0, color: colorList[index][0] },
278
+                      // { offset: 0.5, color: colorList[index][1] },
279
+                      { offset: 1, color: colorList[index][1] }
280
+                    ])
281
+                  },
282
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
316 283
                 },
317
-                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
284
+
285
+                //鼠标悬停时:
286
+                emphasis: {
287
+                  shadowBlur: 10,
288
+                  shadowOffsetX: 0,
289
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
290
+                }
291
+              }
292
+            }
293
+          ]
294
+        },
295
+        bar: {
296
+          title: {
297
+            text: 'ECharts 入门示例'
298
+          },
299
+          tooltip: {},
300
+          legend: {
301
+            data: [],
302
+            left: 0
303
+          },
304
+          xAxis: {
305
+            data: []
306
+          },
307
+          yAxis: {
308
+            axisLabel: {
309
+              formatter: '{value} %'
310
+            },
311
+            show: false
312
+          },
313
+          series: [
314
+            {
315
+              name: '',
316
+              type: 'bar',
317
+              data: [],
318
+              barWidth: 30,
319
+              label: {
320
+                normal: {
321
+                  show: true,
322
+                  position: 'top',
323
+                  formatter: '{c}次'
324
+                }
318 325
               },
326
+              //配置样式
327
+              itemStyle: {
328
+                //通常情况下:
329
+
330
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
331
+                normal: {
332
+                  color: function(params) {
333
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
334
+                    var colorList = [
335
+                      ['#A9E0F3', '#9FBDFC'],
336
+                      ['#FFD7C0', '#FF9994']
337
+                    ]
319 338
 
320
-              //鼠标悬停时:
321
-              emphasis: {
322
-                shadowBlur: 10,
323
-                shadowOffsetX: 0,
324
-                shadowColor: "rgba(0, 0, 0, 0.5)"
339
+                    var index = params.dataIndex
340
+                    if (params.dataIndex >= colorList.length) {
341
+                      index = params.dataIndex % colorList.length
342
+                    }
343
+
344
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
345
+                      { offset: 0, color: colorList[index][0] },
346
+                      // { offset: 0.5, color: colorList[index][1] },
347
+                      { offset: 1, color: colorList[index][1] }
348
+                    ])
349
+                  },
350
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
351
+                },
352
+
353
+                //鼠标悬停时:
354
+                emphasis: {
355
+                  shadowBlur: 10,
356
+                  shadowOffsetX: 0,
357
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
358
+                }
325 359
               }
326 360
             }
327
-          }
328
-        ]
361
+          ]
362
+        }
363
+
329 364
       }
330
-    };
331
-  },
332
-  methods: {
333
-    chooseWay(way) {
334
-      this.wayType = way;
335 365
     },
336
-    handleClick(row) {
337
-      console.log(row);
338
-      this.$router.push({
339
-        path: "/qcd/indicatorControlAnalysis/bloodPressureDetails"
340
-      });
366
+    methods: {
367
+      changeProject(val){
368
+        this.query.statistics_type = val
369
+        this.query.page = 1
370
+        this.GetDialysisBloodPressureChartData(this.query)
371
+
372
+      },
373
+      handleChange(val){
374
+        this.query.patient_id = val.id
375
+        this.query.page = 1
376
+        this.GetDialysisBloodPressureTableData(this.query)
377
+        this.GetDialysisBloodPressureChartData(this.query)
378
+      },
379
+      handleSizeChange(limit) {
380
+        this.query.limit = limit;
381
+
382
+      },
383
+      handleCurrentChange(page) {
384
+        this.query.page = page;
385
+
386
+      },
387
+      changeTime(val) {
388
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
389
+        if (time > 0) {
390
+          this.$message.error("结束时间不能小于开始时间");
391
+          this.query.start_time = "";
392
+        } else {
393
+          // this.getDialysisList()
394
+          this.query.page = 1;
395
+          this.GetDialysisBloodPressureChartData(this.query)
396
+          this.GetDialysisBloodPressureTableData(this.query)
397
+
398
+        }
399
+
400
+      },
401
+      changeEndTime(val) {
402
+        var time =
403
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
404
+        if (time < 0) {
405
+          this.$message.error("结束时间不能小于开始时间");
406
+          this.query.end_time = "";
407
+        } else {
408
+          this.query.page = 1;
409
+          this.GetDialysisBloodPressureChartData(this.query)
410
+          this.GetDialysisBloodPressureTableData(this.query)
411
+
412
+        }
413
+      },
414
+      getTimestamp(time) {
415
+        // 把时间日期转成时间戳
416
+        return new Date(time).getTime() / 1000;
417
+      },
418
+      QueryOperaById: function(val) {
419
+        let vascular_access_desc_name = "";
420
+        let vascular_access_desc = getDataConfig(
421
+          "hemodialysis",
422
+          "vascular_access_desc"
423
+        );
424
+        for (let i = 0; i < vascular_access_desc.length; i++) {
425
+          if (vascular_access_desc[i].id == val) {
426
+            vascular_access_desc_name = vascular_access_desc[i].name;
427
+          }
428
+        }
429
+
430
+        return vascular_access_desc_name;
431
+      },
432
+      GetAnticoagulantById: function (val) {
433
+        let anticoagulan_name = ''
434
+        var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
435
+        let anticoagulant = anticoagulantsConfitTwo
436
+        for (let keys in anticoagulant) {
437
+          if (anticoagulant[keys].id == val) {
438
+            anticoagulan_name = anticoagulant[keys].name
439
+          }
440
+        }
441
+        return anticoagulan_name
442
+      },
443
+      getModeName(mode_id){
444
+        return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
445
+      },
446
+      changeTime() {
447
+
448
+      }, changeEndTime() {
449
+
450
+
451
+      }, GetDialysisBloodPressureTableData(params) {
452
+        this.loading = true
453
+        this.tableData = []
454
+        GetDialysisBloodPressureTableData(params)
455
+          .then(rs => {
456
+            var resp = rs.data
457
+            if (resp.state == 1) {
458
+              this.loading = false
459
+
460
+              for (let i = 0; i < resp.data.data.length; i++) {
461
+                this.tableData.push(resp.data.data[i])
462
+              }
463
+            } else {
464
+              this.loading = false
465
+            }
466
+          })
467
+          .catch(error => {
468
+
469
+          })
470
+      },
471
+      GetDialysisBloodPressureChartData(params) {
472
+        this.bar.xAxis.data = []
473
+        this.bar.series[0].data = []
474
+        GetDialysisBloodPressureChartData(params)
475
+          .then(rs => {
476
+            var resp = rs.data
477
+            if (resp.state == 1) {
478
+                for (let i = 0; i < resp.data.data.length; i++) {
479
+                  this.bar.xAxis.data.push(resp.data.data[i].name)
480
+                  this.bar.series[0].data.push(resp.data.data[i].total)
481
+              }
482
+            } else {
483
+            }
484
+          })
485
+          .catch(error => {
486
+          })
487
+      },
488
+      handleSelect(val) {
489
+        this.query.patient_id = val.id
490
+        this.query.page = 1
491
+        this.GetDialysisBloodPressureChartData(this.query)
492
+        this.GetDialysisBloodPressureTableData(this.query)
493
+
494
+      },
495
+      querySearchAsync(keyword, cb) {
496
+        let key = ''
497
+        if (keyword != undefined) {
498
+          key = keyword
499
+        }
500
+        let searchArray = []
501
+        PostSearch(key).then(response => {
502
+          if (response.data.state == 1) {
503
+            searchArray = response.data.data.patient
504
+            cb(searchArray)
505
+          } else {
506
+            cb([])
507
+          }
508
+        })
509
+      },
510
+      chooseWay(way) {
511
+        this.wayType = way
512
+      }, getCurrentOrgPatients(){
513
+        getCurrentOrgPatients().then(response=>{
514
+          if(response.data.state == 1){
515
+            var patients = response.data.data.patients
516
+            this.patientsData = patients
517
+          }
518
+        })
519
+      },
520
+    }, created() {
521
+      var date = new Date()
522
+      var year = date.getFullYear() //获取完整的年份(4位)
523
+      var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
524
+      var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
525
+      var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
526
+      this.query.patient_id = 0
527
+      this.query.end_time = year + '-' + month + '-' + day
528
+      this.query.start_time = year + '-' + last_month + '-' + day
529
+      this.query.statistics_type = 1
530
+      this.GetDialysisBloodPressureChartData(this.query)
531
+      this.GetDialysisBloodPressureTableData(this.query)
532
+      this.getCurrentOrgPatients()
533
+
534
+
341 535
     }
342 536
   }
343
-};
344 537
 </script>
345 538
 
346 539
 <style lang="scss" scoped>
347
-.tableTitle {
348
-  font-size: 16px;
349
-  color: #000;
350
-  font-weight: bold;
351
-  margin-bottom: 10px;
352
-}
540
+  .tableTitle {
541
+    font-size: 16px;
542
+    color: #000;
543
+    font-weight: bold;
544
+    margin-bottom: 10px;
545
+  }
353 546
 </style>
354 547
 <style lang="scss">
355
-.page_bloodPressure {
548
+  .page_process {
549
+
356 550
   .el-button--medium {
357 551
     padding: 10px 8px;
358 552
   }
553
+
359 554
   .el-form-item {
360 555
     margin-bottom: 0;
361 556
   }
362
-  .cell {
363
-    text-align: center;
557
+
364 558
   }
365
-}
366 559
 </style>

+ 4 - 4
src/xt_pages/qcd/indicatorControlAnalysis/bloodPressureDetails.vue 파일 보기

@@ -16,7 +16,7 @@
16 16
         <el-container>
17 17
           <div style="width:150px">
18 18
             <div class="tableTitle">患者列表</div>
19
-            <el-table :data="tableData" border style="width: 100%;" height="500">
19
+            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
20 20
               <el-table-column prop="date" label="日期" width="70"></el-table-column>
21 21
               <el-table-column prop="name" label="姓名" width="80"></el-table-column>
22 22
             </el-table>
@@ -74,7 +74,7 @@
74 74
             </div>
75 75
             <div class="tableTitle">统计表</div>
76 76
             <div>
77
-              <el-table :data="tableData1" style="width: 100%" border>
77
+              <el-table :data="tableData1" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
78 78
                 <el-table-column fixed prop="date" label="日期"></el-table-column>
79 79
                 <el-table-column prop="name" label="姓名"></el-table-column>
80 80
                 <el-table-column prop="province" label="省份"></el-table-column>
@@ -238,9 +238,9 @@ export default {
238 238
             //配置样式
239 239
             itemStyle: {
240 240
               normal: {
241
-                color: "#dd7383", //折点颜色
241
+                color: "#f56c6c", //折点颜色
242 242
                 lineStyle: {
243
-                  color: "#dd7383" //折线颜色
243
+                  color: "#f56c6c" //折线颜色
244 244
                 }
245 245
               }
246 246
             }

+ 1 - 1
src/xt_pages/qcd/indicatorControlAnalysis/components/office.vue 파일 보기

@@ -78,7 +78,7 @@
78 78
     </div>
79 79
     <div class="tableTitle">统计表</div>
80 80
     <div>
81
-      <el-table :data="tableData" style="width: 100%" border>
81
+      <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
82 82
         <el-table-column fixed prop="date" label="日期"></el-table-column>
83 83
         <el-table-column prop="name" label="姓名"></el-table-column>
84 84
         <el-table-column prop="province" label="省份"></el-table-column>

+ 1 - 1
src/xt_pages/qcd/indicatorControlAnalysis/components/personal.vue 파일 보기

@@ -81,7 +81,7 @@
81 81
     <el-container>
82 82
       <div style="width:150px">
83 83
         <div class="tableTitle">患者列表</div>
84
-        <el-table :data="tableData" border style="width: 100%;" height="500">
84
+        <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
85 85
           <el-table-column prop="date" label="日期" width="70"></el-table-column>
86 86
           <el-table-column prop="name" label="姓名" width="80"></el-table-column>
87 87
         </el-table>

+ 503 - 247
src/xt_pages/qcd/indicatorControlAnalysis/monitor.vue 파일 보기

@@ -4,33 +4,48 @@
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
     </div>
6 6
     <div class="app-container">
7
-      <div class="page_monitor">
7
+      <div class="page_process">
8 8
         <new-nav activeName="monitor"></new-nav>
9 9
         <div class="cell clearfix">
10
-          <el-form :inline="true" :model="listQuery">
10
+          <el-form :inline="true">
11 11
             <el-form-item label>
12
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:110px"></el-input>
13
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
12
+              <el-autocomplete
13
+                class="checkSearch"
14
+                popper-class="my-autocomplete"
15
+                v-model="search_value"
16
+                :fetch-suggestions="querySearchAsync"
17
+                :trigger-on-focus="false"
18
+                placeholder="请输入病人名字"
19
+                @select="handleSelect"
20
+              >
21
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
22
+                <template slot-scope="{ item }">
23
+                  <div class="name">{{ item.name }}</div>
24
+                </template>
25
+              </el-autocomplete>
26
+
14 27
             </el-form-item>
15 28
           </el-form>
16
-          <el-select v-model="value" placeholder="请选择" style="width:110px;margin-right:10px">
29
+          <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
17 30
             <el-option
18 31
               v-for="item in options"
19 32
               :key="item.value"
20
-              :label="item.label"
33
+              :label="item.name"
21 34
               :value="item.value"
35
+
22 36
             ></el-option>
23 37
           </el-select>
24 38
           <label class="title">
25 39
             <span class="name">日期查询</span> :
26 40
           </label>
27 41
           <el-date-picker
28
-            v-model="listQuery.start_time"
42
+            v-model="query.start_time"
29 43
             prefix-icon="el-icon-date"
30 44
             @change="changeTime"
31 45
             :editable="false"
32 46
             style="width: 150px;"
33 47
             type="date"
48
+            :picker-options="pickerOptions"
34 49
             placeholder="选择日期时间"
35 50
             align="right"
36 51
             format="yyyy-MM-dd"
@@ -38,10 +53,11 @@
38 53
           ></el-date-picker>
39 54
           <span class>-</span>
40 55
           <el-date-picker
41
-            v-model="listQuery.end_time"
56
+            v-model="query.end_time"
42 57
             prefix-icon="el-icon-date"
43 58
             @change="changeEndTime"
44 59
             :editable="false"
60
+            :picker-options="pickerOptions"
45 61
             style="width: 150px;"
46 62
             type="date"
47 63
             placeholder="选择日期时间"
@@ -53,9 +69,16 @@
53 69
         <el-container>
54 70
           <div style="width:150px">
55 71
             <div class="tableTitle">患者列表</div>
56
-            <el-table :data="tableData" border style="width: 100%;" height="500">
57
-              <el-table-column prop="date" label="日期" width="70"></el-table-column>
58
-              <el-table-column prop="name" label="姓名" width="80"></el-table-column>
72
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
73
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
74
+                      highlight-current-row
75
+                      @current-change="handleChange">
76
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
77
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
78
+              </el-table-column>
79
+              <el-table-column prop="name" label="姓名" width="80">
80
+                <template slot-scope="scope">{{ scope.row.name }}</template>
81
+              </el-table-column>
59 82
             </el-table>
60 83
           </div>
61 84
           <div style="padding-left:10px;flex:1">
@@ -65,20 +88,96 @@
65 88
             </div>
66 89
             <div class="tableTitle">统计表</div>
67 90
             <div>
68
-              <el-table :data="tableData1" style="width: 100%" border>
69
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
70
-                <el-table-column prop="name" label="姓名"></el-table-column>
71
-                <el-table-column prop="province" label="省份"></el-table-column>
72
-                <el-table-column prop="city" label="市区"></el-table-column>
73
-                <el-table-column prop="address" label="地址"></el-table-column>
74
-                <el-table-column prop="zip" label="邮编"></el-table-column>
91
+              <el-table :data="tableData" style="width: 100%" :height="tableHeight" v-loading="loading">
92
+                <el-table-column fixed label="监测时间" align="center">
93
+                  <template slot-scope="scope">
94
+                    <!--{{getTime(scope.row.operate_time)}}-->
95
+                    {{scope.row.operate_time | parseTime("{y}-{m}-{d} {h}:{i}") }}
96
+
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column label="收缩压" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{scope.row.systolic_blood_pressure?scope.row.systolic_blood_pressure:''}}
103
+                  </template>
104
+                </el-table-column>
105
+
106
+                <el-table-column label="舒张压" align="center">
107
+                  <template slot-scope="scope">
108
+                    {{scope.row.diastolic_blood_pressure?scope.row.diastolic_blood_pressure:''}}
109
+                  </template>
110
+                </el-table-column>
111
+
112
+                <el-table-column label="脉搏" align="center">
113
+                  <template slot-scope="scope">
114
+                    {{scope.row.pulse_frequency?scope.row.pulse_frequency:''}}
115
+                  </template>
116
+                </el-table-column>
117
+
118
+                <el-table-column label="呼吸" align="center">
119
+                  <template slot-scope="scope">
120
+                    {{scope.row.breathing_rate?scope.row.breathing_rate:''}}
121
+                  </template>
122
+                </el-table-column>
123
+
124
+                <el-table-column label="体温" align="center">
125
+                  <template slot-scope="scope">
126
+                    {{ scope.row.temperature?scope.row.temperature:''}}
127
+                  </template>
128
+                </el-table-column>
129
+
130
+                <el-table-column label="血流量" align="center">
131
+                  <template slot-scope="scope">
132
+                    {{ scope.row.blood_flow_volume?scope.row.blood_flow_volume:''}}
133
+                  </template>
134
+                </el-table-column>
135
+
136
+                <el-table-column label="静脉压" align="center">
137
+                  <template slot-scope="scope">
138
+                    {{ scope.row.venous_pressure?scope.row.venous_pressure:''}}
139
+                  </template>
140
+                </el-table-column>
141
+
142
+
143
+                <el-table-column label="动脉压" align="center">
144
+                  <template slot-scope="scope">
145
+                    {{ scope.row.arterial_pressure?scope.row.arterial_pressure:''}}
146
+
147
+                  </template>
148
+                </el-table-column>
149
+
150
+                <el-table-column label="跨膜压" align="center">
151
+                  <template slot-scope="scope">
152
+                    {{ scope.row.transmembrane_pressure?scope.row.transmembrane_pressure:''}}
153
+                  </template>
154
+                </el-table-column>
155
+
156
+
157
+                <el-table-column label="透析液温度" align="center">
158
+                  <template slot-scope="scope">
159
+                    {{ scope.row.dialysate_temperature?scope.row.dialysate_temperature:''}}
160
+                  </template>
161
+                </el-table-column>
162
+
163
+                <el-table-column label="超滤率" align="center">
164
+                  <template slot-scope="scope">
165
+                    {{ scope.row.ultrafiltration_rate?scope.row.ultrafiltration_rate:''}}
166
+                  </template>
167
+                </el-table-column>
168
+
169
+                <el-table-column label="超滤量" align="center">
170
+                  <template slot-scope="scope">
171
+                    {{ scope.row.ultrafiltration_volume?scope.row.ultrafiltration_volume:''}}
172
+                  </template>
173
+                </el-table-column>
75 174
               </el-table>
76 175
 
77 176
               <el-pagination
78 177
                 align="right"
79 178
                 @size-change="handleSizeChange"
80 179
                 @current-change="handleCurrentChange"
81
-                :current-page="listQuery.page"
180
+                :current-page="query.page"
82 181
                 :page-sizes="[10, 20, 50, 100]"
83 182
                 :page-size="10"
84 183
                 background
@@ -96,255 +195,412 @@
96 195
 
97 196
 
98 197
 <script>
99
-import echarts from "echarts";
100
-import NewNav from "../indicatorControlAnalysis/components/NewNav";
101
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
102
-import LineChart from "../../qcd/components/LineChart";
103
-export default {
104
-  components: {
105
-    LineChart,
106
-    BreadCrumb,
107
-    NewNav
108
-  },
109
-  data() {
110
-    return {
111
-      crumbs: [
112
-        { path: false, name: "科室质控" },
113
-        { path: false, name: "指标评估统计" },
114
-        { path: false, name: "透析监测信息统计" }
115
-      ],
116
-      listQuery: {
117
-        start_time: "",
118
-        end_time: "",
119
-        page: 1,
120
-        limit: 10
121
-      },
122
-      tableData: [
123
-        {
124
-          date: "2016",
125
-          name: "王小虎"
126
-        },
127
-        {
128
-          date: "2016",
129
-          name: "王小虎"
130
-        },
131
-        {
132
-          date: "2016",
133
-          name: "王小虎"
134
-        },
135
-        {
136
-          date: "2016",
137
-          name: "王小虎"
138
-        },
139
-        {
140
-          date: "2016",
141
-          name: "王小虎"
142
-        },
143
-        {
144
-          date: "2016",
145
-          name: "王小虎"
146
-        },
147
-        {
148
-          date: "2016",
149
-          name: "王小虎"
150
-        },
151
-        {
152
-          date: "2016",
153
-          name: "王小虎"
154
-        },
155
-        {
156
-          date: "2016",
157
-          name: "王小虎"
158
-        },
159
-        {
160
-          date: "2016",
161
-          name: "王小虎"
162
-        },
163
-        {
164
-          date: "2016",
165
-          name: "王小虎"
166
-        },
167
-        {
168
-          date: "2016",
169
-          name: "王小虎"
170
-        }
171
-      ],
172
-      tableData1: [
173
-        {
174
-          date: "2016-05-03",
175
-          name: "王小虎",
176
-          province: "上海",
177
-          city: "普陀区",
178
-          address: "上海市普陀区金沙江路 1518 弄",
179
-          zip: 200333
180
-        },
181
-        {
182
-          date: "2016-05-02",
183
-          name: "王小虎",
184
-          province: "上海",
185
-          city: "普陀区",
186
-          address: "上海市普陀区金沙江路 1518 弄",
187
-          zip: 200333
188
-        },
189
-        {
190
-          date: "2016-05-04",
191
-          name: "王小虎",
192
-          province: "上海",
193
-          city: "普陀区",
194
-          address: "上海市普陀区金沙江路 1518 弄",
195
-          zip: 200333
196
-        },
197
-        {
198
-          date: "2016-05-01",
199
-          name: "王小虎",
200
-          province: "上海",
201
-          city: "普陀区",
202
-          address: "上海市普陀区金沙江路 1518 弄",
203
-          zip: 200333
204
-        },
205
-        {
206
-          date: "2016-05-08",
207
-          name: "王小虎",
208
-          province: "上海",
209
-          city: "普陀区",
210
-          address: "上海市普陀区金沙江路 1518 弄",
211
-          zip: 200333
212
-        },
213
-        {
214
-          date: "2016-05-06",
215
-          name: "王小虎",
216
-          province: "上海",
217
-          city: "普陀区",
218
-          address: "上海市普陀区金沙江路 1518 弄",
219
-          zip: 200333
220
-        },
221
-        {
222
-          date: "2016-05-07",
223
-          name: "王小虎",
224
-          province: "上海",
225
-          city: "普陀区",
226
-          address: "上海市普陀区金沙江路 1518 弄",
227
-          zip: 200333
228
-        },
229
-        {
230
-          date: "2016-05-08",
231
-          name: "王小虎",
232
-          province: "上海",
233
-          city: "普陀区",
234
-          address: "上海市普陀区金沙江路 1518 弄",
235
-          zip: 200333
236
-        },
237
-        {
238
-          date: "2016-05-06",
239
-          name: "王小虎",
240
-          province: "上海",
241
-          city: "普陀区",
242
-          address: "上海市普陀区金沙江路 1518 弄",
243
-          zip: 200333
244
-        },
245
-        {
246
-          date: "2016-05-07",
247
-          name: "王小虎",
248
-          province: "上海",
249
-          city: "普陀区",
250
-          address: "上海市普陀区金沙江路 1518 弄",
251
-          zip: 200333
252
-        }
253
-      ],
254
-      chart: {
255
-        title: {
256
-          text: "ECharts 入门示例"
257
-        },
258
-        tooltip: {},
259
-        legend: {
260
-          data: ["次数"],
261
-          left: 0
198
+  import echarts from 'echarts'
199
+  import NewNav from '../indicatorControlAnalysis/components/NewNav'
200
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
201
+  import LineChart from '../../qcd/components/LineChart'
202
+  import { getCurrentOrgPatients } from "@/api/common/common";
203
+  import {
204
+    GetDefalutPatient,
205
+    GetDialysisWatchChartData,
206
+    GetDialysisWatchTableData
207
+  } from '@/api/common/statistics'
208
+
209
+
210
+  import {
211
+    PostSearch
212
+  } from '@/api/patient'
213
+
214
+  import { uParseTime } from "@/utils/tools";
215
+  import { getDataConfig } from "@/utils/data";
216
+
217
+  export default {
218
+    components: {
219
+      LineChart,
220
+      BreadCrumb,
221
+      NewNav
222
+    },
223
+    data() {
224
+      return {
225
+        pickerOptions: {
226
+          disabledDate(time) {
227
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
228
+            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
229
+          }
262 230
         },
263
-        xAxis: {
264
-          data: ["达标", "未达标"]
231
+        patientsData:[],
232
+        tableData: [
233
+        ],
234
+        loading: false,
235
+        search_value: '',
236
+        total: '',
237
+        query: {
238
+          patient_id: '',
239
+          statistics_type: 1,
240
+          start_time: '',
241
+          end_time: '',
242
+          limit: 10,
243
+          page: 1
265 244
         },
266
-        yAxis: {
267
-          axisLabel: {
268
-            formatter: "{value} %"
245
+        options: [
246
+          { value: 1, name: '收缩压' },
247
+          { value: 2, name: '舒张压' },
248
+          { value: 3, name: '脉搏' },
249
+          { value: 4, name: '呼吸' },
250
+          { value: 5, name: '体温' },
251
+          { value: 6, name: '血流量' },
252
+          { value: 7, name: '静脉压' },
253
+          { value: 8, name: '动脉压' },
254
+          { value: 9, name: '跨膜压' },
255
+          { value: 10, name: '透析液温度' },
256
+          { value: 11, name: '超滤率' },
257
+          { value: 12, name: '超滤量' },
258
+        ],
259
+        crumbs: [
260
+          { path: false, name: '科室质控' },
261
+          { path: false, name: '指标评估统计' },
262
+          { path: false, name: '透析过程指标统计' }
263
+        ],
264
+        tableData: [],
265
+        tableData1: [],
266
+        chart: {
267
+          title: {
268
+            text: 'ECharts 入门示例'
269 269
           },
270
-          show: false
271
-        },
272
-        series: [
273
-          {
274
-            name: "次数",
275
-            type: "line",
276
-            data: ["78.57", "50"],
277
-            barWidth: 30,
278
-            label: {
279
-              normal: {
280
-                show: true,
281
-                position: "top",
282
-                formatter: "{c}次"
283
-              }
270
+          tooltip: {},
271
+          legend: {
272
+            data: [],
273
+            left: 0
274
+          },
275
+          xAxis: {
276
+            data: []
277
+          },
278
+          yAxis: {
279
+            axisLabel: {
280
+              formatter: '{value} %'
284 281
             },
285
-            //配置样式
286
-            itemStyle: {
287
-              //通常情况下:
288
-
289
-              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
290
-              normal: {
291
-                color: function(params) {
292
-                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
293
-                  var colorList = [
294
-                    ["#A9E0F3", "#9FBDFC"],
295
-
296
-                    ["#FFD7C0", "#FF9994"]
297
-                  ];
298
-
299
-                  var index = params.dataIndex;
300
-                  if (params.dataIndex >= colorList.length) {
301
-                    index = params.dataIndex % colorList.length;
302
-                  }
303
-
304
-                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
305
-                    { offset: 0, color: colorList[index][0] },
306
-                    // { offset: 0.5, color: colorList[index][1] },
307
-                    { offset: 1, color: colorList[index][1] }
308
-                  ]);
282
+            show: false
283
+          },
284
+          series: [
285
+            {
286
+              name: '',
287
+              type: 'line',
288
+              data: [],
289
+              barWidth: 30,
290
+              label: {
291
+                normal: {
292
+                  show: true,
293
+                  position: 'top',
294
+                  formatter: '{c}'
295
+                }
296
+              },
297
+              //配置样式
298
+              itemStyle: {
299
+                //通常情况下:
300
+
301
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
302
+                normal: {
303
+                  color: function(params) {
304
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
305
+                    var colorList = [
306
+                      ['#A9E0F3', '#9FBDFC'],
307
+
308
+                      ['#FFD7C0', '#FF9994']
309
+                    ]
310
+
311
+                    var index = params.dataIndex
312
+                    if (params.dataIndex >= colorList.length) {
313
+                      index = params.dataIndex % colorList.length
314
+                    }
315
+
316
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
317
+                      { offset: 0, color: colorList[index][0] },
318
+                      // { offset: 0.5, color: colorList[index][1] },
319
+                      { offset: 1, color: colorList[index][1] }
320
+                    ])
321
+                  },
322
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
309 323
                 },
310
-                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
324
+
325
+                //鼠标悬停时:
326
+                emphasis: {
327
+                  shadowBlur: 10,
328
+                  shadowOffsetX: 0,
329
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
330
+                }
331
+              }
332
+            }
333
+          ]
334
+        },
335
+        bar: {
336
+          title: {
337
+            text: 'ECharts 入门示例'
338
+          },
339
+          tooltip: {},
340
+          legend: {
341
+            data: [],
342
+            left: 0
343
+          },
344
+          xAxis: {
345
+            data: []
346
+          },
347
+          yAxis: {
348
+            axisLabel: {
349
+              formatter: '{value} %'
350
+            },
351
+            show: false
352
+          },
353
+          series: [
354
+            {
355
+              name: '',
356
+              type: 'bar',
357
+              data: [],
358
+              barWidth: 30,
359
+              label: {
360
+                normal: {
361
+                  show: true,
362
+                  position: 'top',
363
+                  formatter: '{c}次'
364
+                }
311 365
               },
366
+              //配置样式
367
+              itemStyle: {
368
+                //通常情况下:
369
+
370
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
371
+                normal: {
372
+                  color: function(params) {
373
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
374
+                    var colorList = [
375
+                      ['#A9E0F3', '#9FBDFC'],
376
+                      ['#FFD7C0', '#FF9994']
377
+                    ]
378
+
379
+                    var index = params.dataIndex
380
+                    if (params.dataIndex >= colorList.length) {
381
+                      index = params.dataIndex % colorList.length
382
+                    }
312 383
 
313
-              //鼠标悬停时:
314
-              emphasis: {
315
-                shadowBlur: 10,
316
-                shadowOffsetX: 0,
317
-                shadowColor: "rgba(0, 0, 0, 0.5)"
384
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
385
+                      { offset: 0, color: colorList[index][0] },
386
+                      // { offset: 0.5, color: colorList[index][1] },
387
+                      { offset: 1, color: colorList[index][1] }
388
+                    ])
389
+                  },
390
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
391
+                },
392
+
393
+                //鼠标悬停时:
394
+                emphasis: {
395
+                  shadowBlur: 10,
396
+                  shadowOffsetX: 0,
397
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
398
+                }
318 399
               }
319 400
             }
320
-          }
321
-        ]
401
+          ]
402
+        }
403
+
322 404
       }
323
-    };
324
-  },
325
-  methods: {
326
-    chooseWay(way) {
327
-      this.wayType = way;
405
+    },
406
+    methods: {
407
+      changeProject(val){
408
+        this.query.statistics_type = val
409
+        this.query.page = 1
410
+        this.GetDialysisWatchChartData(this.query)
411
+
412
+      },
413
+      handleChange(val){
414
+        this.query.patient_id = val.id
415
+        this.query.page = 1
416
+        this.GetDialysisWatchTableData(this.query)
417
+        this.GetDialysisWatchChartData(this.query)
418
+      },
419
+      handleSizeChange(limit) {
420
+        this.query.limit = limit;
421
+
422
+      },
423
+      handleCurrentChange(page) {
424
+        this.query.page = page;
425
+
426
+      },
427
+      changeTime(val) {
428
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
429
+        if (time > 0) {
430
+          this.$message.error("结束时间不能小于开始时间");
431
+          this.query.start_time = "";
432
+        } else {
433
+          // this.getDialysisList()
434
+          this.query.page = 1;
435
+          this.GetDialysisWatchChartData(this.query)
436
+          this.GetDialysisWatchTableData(this.query)
437
+
438
+        }
439
+
440
+      },
441
+      changeEndTime(val) {
442
+        var time =
443
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
444
+        if (time < 0) {
445
+          this.$message.error("结束时间不能小于开始时间");
446
+          this.query.end_time = "";
447
+        } else {
448
+          this.query.page = 1;
449
+          this.GetDialysisWatchChartData(this.query)
450
+          this.GetDialysisWatchTableData(this.query)
451
+
452
+        }
453
+      },
454
+      getTimestamp(time) {
455
+        // 把时间日期转成时间戳
456
+        return new Date(time).getTime() / 1000;
457
+      },
458
+      QueryOperaById: function(val) {
459
+        let vascular_access_desc_name = "";
460
+        let vascular_access_desc = getDataConfig(
461
+          "hemodialysis",
462
+          "vascular_access_desc"
463
+        );
464
+        for (let i = 0; i < vascular_access_desc.length; i++) {
465
+          if (vascular_access_desc[i].id == val) {
466
+            vascular_access_desc_name = vascular_access_desc[i].name;
467
+          }
468
+        }
469
+
470
+        return vascular_access_desc_name;
471
+      },
472
+      GetAnticoagulantById: function (val) {
473
+        let anticoagulan_name = ''
474
+        var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
475
+        let anticoagulant = anticoagulantsConfitTwo
476
+        for (let keys in anticoagulant) {
477
+          if (anticoagulant[keys].id == val) {
478
+            anticoagulan_name = anticoagulant[keys].name
479
+          }
480
+        }
481
+        return anticoagulan_name
482
+      },
483
+      getModeName(mode_id){
484
+        return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
485
+      },
486
+      changeTime() {
487
+
488
+      }, changeEndTime() {
489
+
490
+
491
+      }, GetDialysisWatchTableData(params) {
492
+        this.loading = true
493
+        this.tableData = []
494
+        GetDialysisWatchTableData(params)
495
+          .then(rs => {
496
+            var resp = rs.data
497
+            if (resp.state == 1) {
498
+              this.loading = false
499
+              for (let i = 0; i < resp.data.data.length; i++) {
500
+                this.tableData.push(resp.data.data[i])
501
+              }
502
+            } else {
503
+              this.loading = false
504
+            }
505
+          })
506
+          .catch(error => {
507
+          })
508
+      },
509
+      GetDialysisWatchChartData(params) {
510
+        this.chart.xAxis.data = []
511
+        this.chart.series[0].data = []
512
+        this.bar.xAxis.data = []
513
+        this.bar.series[0].data = []
514
+        GetDialysisWatchChartData(params)
515
+          .then(rs => {
516
+            var resp = rs.data
517
+            if (resp.state == 1) {
518
+              if (this.query.statistics_type != 9 && this.query.statistics_type != 10) {
519
+                for (let i = 0; i < resp.data.data.length; i++) {
520
+                  this.chart.xAxis.data.push(resp.data.data[i].date)
521
+                  this.chart.series[0].data.push(resp.data.data[i].value)
522
+                }
523
+              } else {
524
+                for (let i = 0; i < resp.data.data.length; i++) {
525
+                  this.bar.xAxis.data.push(resp.data.data[i].name)
526
+                  this.bar.series[0].data.push(resp.data.data[i].total)
527
+                }
528
+              }
529
+            } else {
530
+            }
531
+          })
532
+          .catch(error => {
533
+          })
534
+      },
535
+      handleSelect(val) {
536
+        this.query.patient_id = val.id
537
+        this.query.page = 1
538
+        this.GetDialysisWatchTableData(this.query)
539
+        this.GetDialysisWatchChartData(this.query)
540
+
541
+      },
542
+      querySearchAsync(keyword, cb) {
543
+        let key = ''
544
+        if (keyword != undefined) {
545
+          key = keyword
546
+        }
547
+        let searchArray = []
548
+        PostSearch(key).then(response => {
549
+          if (response.data.state == 1) {
550
+            searchArray = response.data.data.patient
551
+            cb(searchArray)
552
+          } else {
553
+            cb([])
554
+          }
555
+        })
556
+      },
557
+      chooseWay(way) {
558
+        this.wayType = way
559
+      }, getCurrentOrgPatients(){
560
+        getCurrentOrgPatients().then(response=>{
561
+          if(response.data.state == 1){
562
+            var patients = response.data.data.patients
563
+            this.patientsData = patients
564
+          }
565
+        })
566
+      },
567
+    }, created() {
568
+      var date = new Date()
569
+      var year = date.getFullYear() //获取完整的年份(4位)
570
+      var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
571
+      var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
572
+      var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
573
+      this.query.patient_id = 0
574
+      this.query.end_time = year + '-' + month + '-' + day
575
+      this.query.start_time = year + '-' + last_month + '-' + day
576
+      this.query.statistics_type = 1
577
+      this.GetDialysisWatchChartData(this.query)
578
+      this.GetDialysisWatchTableData(this.query)
579
+      this.getCurrentOrgPatients()
580
+
581
+
328 582
     }
329 583
   }
330
-};
331 584
 </script>
332 585
 
333 586
 <style lang="scss" scoped>
334
-.tableTitle {
335
-  font-size: 16px;
336
-  color: #000;
337
-  font-weight: bold;
338
-  margin-bottom: 10px;
339
-}
587
+  .tableTitle {
588
+    font-size: 16px;
589
+    color: #000;
590
+    font-weight: bold;
591
+    margin-bottom: 10px;
592
+  }
340 593
 </style>
341 594
 <style lang="scss">
342
-.page_monitor {
595
+  .page_process {
596
+
343 597
   .el-button--medium {
344 598
     padding: 10px 8px;
345 599
   }
600
+
346 601
   .el-form-item {
347 602
     margin-bottom: 0;
348 603
   }
349
-}
604
+
605
+  }
350 606
 </style>

+ 282 - 19
src/xt_pages/qcd/indicatorControlAnalysis/process.vue 파일 보기

@@ -7,7 +7,7 @@
7 7
       <div class="page_process">
8 8
         <new-nav activeName="process"></new-nav>
9 9
         <div class="cell clearfix">
10
-          <el-form :inline="true" :model="listQuery">
10
+          <el-form :inline="true">
11 11
             <el-form-item label>
12 12
               <el-autocomplete
13 13
                 class="checkSearch"
@@ -26,12 +26,13 @@
26 26
 
27 27
             </el-form-item>
28 28
           </el-form>
29
-          <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px">
29
+          <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
30 30
             <el-option
31 31
               v-for="item in options"
32 32
               :key="item.value"
33 33
               :label="item.name"
34 34
               :value="item.value"
35
+
35 36
             ></el-option>
36 37
           </el-select>
37 38
           <label class="title">
@@ -44,6 +45,7 @@
44 45
             :editable="false"
45 46
             style="width: 150px;"
46 47
             type="date"
48
+            :picker-options="pickerOptions"
47 49
             placeholder="选择日期时间"
48 50
             align="right"
49 51
             format="yyyy-MM-dd"
@@ -55,6 +57,7 @@
55 57
             prefix-icon="el-icon-date"
56 58
             @change="changeEndTime"
57 59
             :editable="false"
60
+            :picker-options="pickerOptions"
58 61
             style="width: 150px;"
59 62
             type="date"
60 63
             placeholder="选择日期时间"
@@ -66,31 +69,174 @@
66 69
         <el-container>
67 70
           <div style="width:150px">
68 71
             <div class="tableTitle">患者列表</div>
69
-            <el-table :data="tableData" border style="width: 100%;" height="500">
70
-              <el-table-column prop="date" label="日期" width="100">
71
-
72
-
72
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
73
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
74
+                      highlight-current-row
75
+                      @current-change="handleChange">
76
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
77
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
73 78
               </el-table-column>
74
-              <el-table-column prop="name" label="姓名" width="100">
75
-
76
-
79
+              <el-table-column prop="name" label="姓名" width="80">
80
+                <template slot-scope="scope">{{ scope.row.name }}</template>
77 81
               </el-table-column>
78 82
             </el-table>
79 83
           </div>
80 84
           <div style="padding-left:10px;flex:1">
81 85
             <div class="tableTitle">指标趋势</div>
82 86
             <div>
83
-              <line-chart :options="chart"></line-chart>
87
+              <line-chart :options="chart" v-if="query.statistics_type != 9 && query.statistics_type != 10"></line-chart>
88
+              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>
89
+
84 90
             </div>
85 91
             <div class="tableTitle">统计表</div>
86 92
             <div>
87
-              <el-table :data="tableData1" style="width: 100%" border v-loading="loading">
88
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
89
-                <el-table-column prop="name" label="姓名"></el-table-column>
90
-                <el-table-column prop="province" label="省份"></el-table-column>
91
-                <el-table-column prop="city" label="市区"></el-table-column>
92
-                <el-table-column prop="address" label="地址"></el-table-column>
93
-                <el-table-column prop="zip" label="邮编"></el-table-column>
93
+              <el-table :data="tableData"  :height="tableHeight"   v-loading="loading">
94
+                <el-table-column  fixed label="透析日期" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.schedule_date | parseTime("{y}-{m}-{d}") }}
97
+                    <!--{{getTime(scope.row.schedule_date)}}-->
98
+                  </template>
99
+                </el-table-column>
100
+
101
+                <el-table-column label="姓名" align="center">
102
+                  <template slot-scope="scope">
103
+                    {{scope.row.patient.name}}
104
+                  </template>
105
+                </el-table-column>
106
+
107
+                <el-table-column label="透析机号" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.device_number.number}}
110
+                  </template>
111
+                </el-table-column>
112
+
113
+                <el-table-column label="干体重" align="center">
114
+                  <template slot-scope="scope">
115
+                    {{scope.row.predialysis_evaluation.dry_weight?scope.row.predialysis_evaluation.dry_weight:''}}
116
+                  </template>
117
+                </el-table-column>
118
+
119
+                <el-table-column label="透前体重" align="center">
120
+                  <template slot-scope="scope">
121
+                    {{ scope.row.predialysis_evaluation.weight_before?scope.row.predialysis_evaluation.weight_before:''}}
122
+
123
+                  </template>
124
+                </el-table-column>
125
+
126
+                <el-table-column label="透后体重" align="center">
127
+                  <template slot-scope="scope">
128
+                    {{ scope.row.assessment_after_dislysis.weight_after ? scope.row.assessment_after_dislysis.weight_after :''}}
129
+
130
+                  </template>
131
+                </el-table-column>
132
+
133
+                <el-table-column label="目标超滤量" align="center">
134
+                  <template slot-scope="scope">
135
+                    {{ scope.row.prescription.target_ultrafiltration ? scope.row.prescription.target_ultrafiltration : ''}}
136
+
137
+                  </template>
138
+                </el-table-column>
139
+
140
+                <el-table-column label="实际超滤量" align="center">
141
+                  <template slot-scope="scope">
142
+                    {{ scope.row.assessment_after_dislysis.actual_ultrafiltration ?  scope.row.assessment_after_dislysis.actual_ultrafiltration :''}}
143
+
144
+                  </template>
145
+                </el-table-column>
146
+
147
+
148
+                <el-table-column label="透前血压" align="center">
149
+                  <template slot-scope="scope">
150
+                    <div v-if="scope.row.predialysis_evaluation.systolic_blood_pressure && scope.row.predialysis_evaluation.diastolic_blood_pressure">{{ scope.row.predialysis_evaluation.systolic_blood_pressure}} / {{ scope.row.predialysis_evaluation.diastolic_blood_pressure}}</div>
151
+
152
+
153
+                  </template>
154
+                </el-table-column>
155
+
156
+                <el-table-column label="透后血压" align="center">
157
+                  <template slot-scope="scope">
158
+                    <div v-if="scope.row.assessment_after_dislysis.systolic_blood_pressure&&scope.row.assessment_after_dislysis.diastolic_blood_pressure">{{ scope.row.assessment_after_dislysis.systolic_blood_pressure}} / {{ scope.row.assessment_after_dislysis.diastolic_blood_pressure}}</div>
159
+
160
+
161
+                  </template>
162
+                </el-table-column>
163
+
164
+
165
+                <el-table-column label="透前脉率" align="center">
166
+                  <template slot-scope="scope">
167
+                    {{ scope.row.predialysis_evaluation.pulse_frequency?scope.row.predialysis_evaluation.pulse_frequency:''}}
168
+
169
+                  </template>
170
+                </el-table-column>
171
+
172
+                <el-table-column label="透后脉率" align="center">
173
+                  <template slot-scope="scope">
174
+                    {{ scope.row.assessment_after_dislysis.pulse_frequency?scope.row.assessment_after_dislysis.pulse_frequency:''}}
175
+
176
+                  </template>
177
+                </el-table-column>
178
+
179
+
180
+                <el-table-column label="透析模式" align="center">
181
+                  <template slot-scope="scope">
182
+                    {{ getModeName(scope.row.prescription.mode_id)}}
183
+                  </template>
184
+                </el-table-column>
185
+
186
+
187
+                <el-table-column label="透析器" align="center">
188
+                  <template slot-scope="scope">
189
+                    {{ scope.row.prescription.dialyzer_perfusion_apparatus}}
190
+                  </template>
191
+                </el-table-column>
192
+
193
+
194
+                <el-table-column label="钾" align="center">
195
+                  <template slot-scope="scope">
196
+                    {{ scope.row.prescription.kalium?scope.row.prescription.kalium:""}}
197
+
198
+                  </template>
199
+                </el-table-column>
200
+
201
+
202
+
203
+                <el-table-column label="钠" align="center">
204
+                  <template slot-scope="scope">
205
+                    {{ scope.row.prescription.sodium?scope.row.prescription.sodium:""}}
206
+
207
+                  </template>
208
+                </el-table-column>
209
+
210
+
211
+                <el-table-column label="钙" align="center">
212
+                  <template slot-scope="scope">
213
+                    {{ scope.row.prescription.calcium?scope.row.prescription.calcium:""}}
214
+
215
+                  </template>
216
+                </el-table-column>
217
+
218
+
219
+                <el-table-column label="透析时长" align="center">
220
+                  <template slot-scope="scope">
221
+                    {{ scope.row.prescription.dialysis_duration_hour?scope.row.prescription.dialysis_duration_hour+'小时':""}}
222
+                    {{ scope.row.prescription.dialysis_duration_minute?scope.row.prescription.dialysis_duration_minute+'分钟':''}}
223
+                  </template>
224
+
225
+                </el-table-column>
226
+
227
+                <el-table-column label="血管通路" align="center">
228
+                  <template slot-scope="scope">
229
+                    {{ QueryOperaById(scope.row.predialysis_evaluation.blood_access_part_opera_id)}}
230
+                  </template>
231
+                </el-table-column>
232
+
233
+
234
+                <el-table-column label="抗凝剂" align="center">
235
+                  <template slot-scope="scope">
236
+                    {{GetAnticoagulantById( scope.row.prescription.anticoagulant)}}
237
+                  </template>
238
+                </el-table-column>
239
+
94 240
               </el-table>
95 241
 
96 242
               <el-pagination
@@ -119,12 +265,22 @@
119 265
   import NewNav from '../indicatorControlAnalysis/components/NewNav'
120 266
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
121 267
   import LineChart from '../../qcd/components/LineChart'
268
+  import { getCurrentOrgPatients } from "@/api/common/common";
122 269
   import {
123 270
     GetDefalutPatient,
124 271
     GetDialysisProcessIndexChartData,
125 272
     GetDialysisProcessIndexTableData
126 273
   } from '@/api/common/statistics'
127 274
 
275
+
276
+
277
+  import {
278
+    PostSearch
279
+  } from '@/api/patient'
280
+
281
+  import { uParseTime } from "@/utils/tools";
282
+  import { getDataConfig } from "@/utils/data";
283
+
128 284
   export default {
129 285
     components: {
130 286
       LineChart,
@@ -133,6 +289,15 @@
133 289
     },
134 290
     data() {
135 291
       return {
292
+        pickerOptions: {
293
+          disabledDate(time) {
294
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
295
+            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
296
+          }
297
+        },
298
+        patientsData:[],
299
+        tableData: [
300
+        ],
136 301
         loading: false,
137 302
         search_value: '',
138 303
         total: '',
@@ -191,7 +356,7 @@
191 356
                 normal: {
192 357
                   show: true,
193 358
                   position: 'top',
194
-                  formatter: '{c}'
359
+                  formatter: '{c}'
195 360
                 }
196 361
               },
197 362
               //配置样式
@@ -304,10 +469,95 @@
304 469
       }
305 470
     },
306 471
     methods: {
472
+      jumpDetail(patient_id){
473
+        this.$router.push("/dqc/bloodpressure/detail?id="+patient_id)
474
+
475
+      },
476
+      changeProject(val){
477
+        this.query.statistics_type = val
478
+        this.query.page = 1
479
+        this.GetDialysisProcessIndexChartData(this.query)
480
+        // this.GetDialysisProcessIndexTableData(this.query)
481
+
482
+      },
483
+      handleChange(val){
484
+        this.query.patient_id = val.id
485
+        this.query.page = 1
486
+        this.GetDialysisProcessIndexTableData(this.query)
487
+        this.GetDialysisProcessIndexChartData(this.query)
488
+      },
489
+      handleSizeChange(limit) {
490
+        this.query.limit = limit;
491
+
492
+      },
493
+      handleCurrentChange(page) {
494
+        this.query.page = page;
495
+
496
+      },
497
+      changeTime(val) {
498
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
499
+        if (time > 0) {
500
+          this.$message.error("结束时间不能小于开始时间");
501
+          this.query.start_time = "";
502
+        } else {
503
+          // this.getDialysisList()
504
+          this.query.page = 1;
505
+          this.GetDialysisProcessIndexChartData(this.query)
506
+          this.GetDialysisProcessIndexTableData(this.query)
507
+
508
+        }
509
+
510
+      },
511
+      changeEndTime(val) {
512
+        var time =
513
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
514
+        if (time < 0) {
515
+          this.$message.error("结束时间不能小于开始时间");
516
+          this.query.end_time = "";
517
+        } else {
518
+          this.query.page = 1;
519
+          this.GetDialysisProcessIndexChartData(this.query)
520
+          this.GetDialysisProcessIndexTableData(this.query)
521
+
522
+        }
523
+      },
524
+      getTimestamp(time) {
525
+        // 把时间日期转成时间戳
526
+        return new Date(time).getTime() / 1000;
527
+      },
528
+      QueryOperaById: function(val) {
529
+        let vascular_access_desc_name = "";
530
+        let vascular_access_desc = getDataConfig(
531
+          "hemodialysis",
532
+          "vascular_access_desc"
533
+        );
534
+        for (let i = 0; i < vascular_access_desc.length; i++) {
535
+          if (vascular_access_desc[i].id == val) {
536
+            vascular_access_desc_name = vascular_access_desc[i].name;
537
+          }
538
+        }
539
+
540
+        return vascular_access_desc_name;
541
+      },
542
+      GetAnticoagulantById: function (val) {
543
+        let anticoagulan_name = ''
544
+        var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
545
+        let anticoagulant = anticoagulantsConfitTwo
546
+        for (let keys in anticoagulant) {
547
+          if (anticoagulant[keys].id == val) {
548
+            anticoagulan_name = anticoagulant[keys].name
549
+          }
550
+        }
551
+        return anticoagulan_name
552
+      },
553
+      getModeName(mode_id){
554
+        return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
555
+      },
307 556
       changeTime() {
308 557
 
309 558
       }, changeEndTime() {
310 559
 
560
+
311 561
       }, GetDialysisProcessIndexTableData(params) {
312 562
         this.loading = true
313 563
         this.tableData = []
@@ -343,6 +593,9 @@
343 593
                   this.chart.series[0].data.push(resp.data.data[i].value)
344 594
                 }
345 595
               } else {
596
+                console.log("1111111")
597
+                console.log(this.query.statistics_type)
598
+
346 599
                 for (let i = 0; i < resp.data.data.length; i++) {
347 600
                   this.bar.xAxis.data.push(resp.data.data[i].name)
348 601
                   this.bar.series[0].data.push(resp.data.data[i].total)
@@ -359,6 +612,7 @@
359 612
         this.query.page = 1
360 613
         this.GetDialysisProcessIndexChartData(this.query)
361 614
         this.GetDialysisProcessIndexTableData(this.query)
615
+
362 616
       },
363 617
       querySearchAsync(keyword, cb) {
364 618
         let key = ''
@@ -377,7 +631,14 @@
377 631
       },
378 632
       chooseWay(way) {
379 633
         this.wayType = way
380
-      }
634
+      }, getCurrentOrgPatients(){
635
+        getCurrentOrgPatients().then(response=>{
636
+          if(response.data.state == 1){
637
+            var patients = response.data.data.patients
638
+            this.patientsData = patients
639
+          }
640
+        })
641
+      },
381 642
     }, created() {
382 643
       var date = new Date()
383 644
       var year = date.getFullYear() //获取完整的年份(4位)
@@ -390,6 +651,8 @@
390 651
       this.query.statistics_type = 1
391 652
       this.GetDialysisProcessIndexChartData(this.query)
392 653
       this.GetDialysisProcessIndexTableData(this.query)
654
+      this.getCurrentOrgPatients()
655
+
393 656
 
394 657
     }
395 658
   }

+ 463 - 257
src/xt_pages/qcd/indicatorControlAnalysis/weight.vue 파일 보기

@@ -4,33 +4,48 @@
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
     </div>
6 6
     <div class="app-container">
7
-      <div class="page_weight">
7
+      <div class="page_process">
8 8
         <new-nav activeName="weight"></new-nav>
9 9
         <div class="cell clearfix">
10
-          <el-form :inline="true" :model="listQuery">
10
+          <el-form :inline="true">
11 11
             <el-form-item label>
12
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:110px"></el-input>
13
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
12
+              <el-autocomplete
13
+                class="checkSearch"
14
+                popper-class="my-autocomplete"
15
+                v-model="search_value"
16
+                :fetch-suggestions="querySearchAsync"
17
+                :trigger-on-focus="false"
18
+                placeholder="请输入病人名字"
19
+                @select="handleSelect"
20
+              >
21
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
22
+                <template slot-scope="{ item }">
23
+                  <div class="name">{{ item.name }}</div>
24
+                </template>
25
+              </el-autocomplete>
26
+
14 27
             </el-form-item>
15 28
           </el-form>
16
-          <el-select v-model="value" placeholder="请选择" style="width:110px;margin-right:10px">
29
+          <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
17 30
             <el-option
18 31
               v-for="item in options"
19 32
               :key="item.value"
20
-              :label="item.label"
33
+              :label="item.name"
21 34
               :value="item.value"
35
+
22 36
             ></el-option>
23 37
           </el-select>
24 38
           <label class="title">
25 39
             <span class="name">日期查询</span> :
26 40
           </label>
27 41
           <el-date-picker
28
-            v-model="listQuery.start_time"
42
+            v-model="query.start_time"
29 43
             prefix-icon="el-icon-date"
30 44
             @change="changeTime"
31 45
             :editable="false"
32 46
             style="width: 150px;"
33 47
             type="date"
48
+            :picker-options="pickerOptions"
34 49
             placeholder="选择日期时间"
35 50
             align="right"
36 51
             format="yyyy-MM-dd"
@@ -38,10 +53,11 @@
38 53
           ></el-date-picker>
39 54
           <span class>-</span>
40 55
           <el-date-picker
41
-            v-model="listQuery.end_time"
56
+            v-model="query.end_time"
42 57
             prefix-icon="el-icon-date"
43 58
             @change="changeEndTime"
44 59
             :editable="false"
60
+            :picker-options="pickerOptions"
45 61
             style="width: 150px;"
46 62
             type="date"
47 63
             placeholder="选择日期时间"
@@ -53,37 +69,99 @@
53 69
         <el-container>
54 70
           <div style="width:150px">
55 71
             <div class="tableTitle">患者列表</div>
56
-            <el-table :data="tableData" border style="width: 100%;" height="500">
57
-              <el-table-column prop="date" label="日期" width="70"></el-table-column>
58
-              <el-table-column prop="name" label="姓名" width="80"></el-table-column>
72
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
73
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
74
+                      highlight-current-row
75
+                      @current-change="handleChange">
76
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
77
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
78
+              </el-table-column>
79
+              <el-table-column prop="name" label="姓名" width="80">
80
+                <template slot-scope="scope">{{ scope.row.name }}</template>
81
+              </el-table-column>
59 82
             </el-table>
60 83
           </div>
61 84
           <div style="padding-left:10px;flex:1">
62 85
             <div class="tableTitle">指标趋势</div>
63 86
             <div>
64
-              <line-chart :options="chart"></line-chart>
87
+              <line-chart :options="bar"></line-chart>
88
+
65 89
             </div>
66 90
             <div class="tableTitle">统计表</div>
67 91
             <div>
68
-              <el-table :data="tableData1" style="width: 100%" border>
69
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
70
-                <el-table-column prop="name" label="姓名"></el-table-column>
71
-                <el-table-column prop="province" label="省份"></el-table-column>
72
-                <el-table-column prop="city" label="市区"></el-table-column>
73
-                <el-table-column prop="address" label="地址"></el-table-column>
74
-                <el-table-column prop="zip" label="邮编"></el-table-column>
75
-                <el-table-column label="操作" width="100">
92
+
93
+              <el-table :data="tableData" style="width: 100%" :height="tableHeight" >
94
+                <el-table-column fixed label="日期" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.assessment_date | parseTime("{y}-{m}-{d}") }}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column label="姓名" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{scope.row.patient.name}}
103
+                  </template>
104
+                </el-table-column>
105
+
106
+                <el-table-column label="干体重" align="center">
107
+                  <template slot-scope="scope">
108
+                    {{scope.row.dry_weight?scope.row.dry_weight:''}}
109
+
110
+                    <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
111
+                  </template>
112
+                </el-table-column>
113
+
114
+                <el-table-column label="前次透后体重" align="center">
115
+                  <template slot-scope="scope">
116
+                    {{scope.row.last_after_weight?scope.row.last_after_weight:''}}
117
+
118
+                    <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
119
+                  </template>
120
+                </el-table-column>
121
+
122
+                <el-table-column label="透前体重" align="center">
123
+                  <template slot-scope="scope">
124
+                    {{scope.row.weight_before?scope.row.weight_before:''}}
125
+
126
+                    <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
127
+                  </template>
128
+                </el-table-column>
129
+
130
+                <el-table-column label="透后体重" align="center">
76 131
                   <template slot-scope="scope">
77
-                    <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
132
+                    <!--<div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>-->
133
+                    {{scope.row.after.weight_after?scope.row.after.weight_after:''}}
134
+
135
+
78 136
                   </template>
79 137
                 </el-table-column>
138
+
139
+                <el-table-column label="体重增加" align="center">
140
+                  <template slot-scope="scope">
141
+                    <div v-if="scope.row.weight_before && scope.row.last_after_weight">{{scope.row.weight_before - scope.row.last_after_weight}}</div>
142
+
143
+                    <!--{{scope.row.weight_before - scope.row.last_after_weight}}-->
144
+                    <!--<div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>-->
145
+                  </template>
146
+                </el-table-column>
147
+
148
+                <el-table-column fixed="right" label="趋势" align="center">
149
+                  <template slot-scope="scope">
150
+                    <el-button
151
+                      @click.native.prevent="jumpDetail(scope.row.patient_id)"
152
+                      type="text"
153
+                      size="small"
154
+                    >详情</el-button>
155
+                  </template>
156
+                </el-table-column>
157
+
80 158
               </el-table>
81 159
 
82 160
               <el-pagination
83 161
                 align="right"
84 162
                 @size-change="handleSizeChange"
85 163
                 @current-change="handleCurrentChange"
86
-                :current-page="listQuery.page"
164
+                :current-page="query.page"
87 165
                 :page-sizes="[10, 20, 50, 100]"
88 166
                 :page-size="10"
89 167
                 background
@@ -101,264 +179,392 @@
101 179
 
102 180
 
103 181
 <script>
104
-import echarts from "echarts";
105
-import NewNav from "../indicatorControlAnalysis/components/NewNav";
106
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
107
-import LineChart from "../../qcd/components/LineChart";
108
-export default {
109
-  components: {
110
-    LineChart,
111
-    BreadCrumb,
112
-    NewNav
113
-  },
114
-  data() {
115
-    return {
116
-      crumbs: [
117
-        { path: false, name: "科室质控" },
118
-        { path: false, name: "指标评估统计" },
119
-        { path: false, name: "患者血压统计" }
120
-      ],
121
-      listQuery: {
122
-        start_time: "",
123
-        end_time: "",
124
-        page: 1,
125
-        limit: 10
126
-      },
127
-      tableData: [
128
-        {
129
-          date: "2016",
130
-          name: "王小虎"
131
-        },
132
-        {
133
-          date: "2016",
134
-          name: "王小虎"
135
-        },
136
-        {
137
-          date: "2016",
138
-          name: "王小虎"
139
-        },
140
-        {
141
-          date: "2016",
142
-          name: "王小虎"
143
-        },
144
-        {
145
-          date: "2016",
146
-          name: "王小虎"
147
-        },
148
-        {
149
-          date: "2016",
150
-          name: "王小虎"
151
-        },
152
-        {
153
-          date: "2016",
154
-          name: "王小虎"
155
-        },
156
-        {
157
-          date: "2016",
158
-          name: "王小虎"
159
-        },
160
-        {
161
-          date: "2016",
162
-          name: "王小虎"
163
-        },
164
-        {
165
-          date: "2016",
166
-          name: "王小虎"
167
-        },
168
-        {
169
-          date: "2016",
170
-          name: "王小虎"
171
-        },
172
-        {
173
-          date: "2016",
174
-          name: "王小虎"
175
-        }
176
-      ],
177
-      tableData1: [
178
-        {
179
-          date: "2016-05-03",
180
-          name: "王小虎",
181
-          province: "上海",
182
-          city: "普陀区",
183
-          address: "上海市普陀区金沙江路 1518 弄",
184
-          zip: 200333
185
-        },
186
-        {
187
-          date: "2016-05-02",
188
-          name: "王小虎",
189
-          province: "上海",
190
-          city: "普陀区",
191
-          address: "上海市普陀区金沙江路 1518 弄",
192
-          zip: 200333
193
-        },
194
-        {
195
-          date: "2016-05-04",
196
-          name: "王小虎",
197
-          province: "上海",
198
-          city: "普陀区",
199
-          address: "上海市普陀区金沙江路 1518 弄",
200
-          zip: 200333
201
-        },
202
-        {
203
-          date: "2016-05-01",
204
-          name: "王小虎",
205
-          province: "上海",
206
-          city: "普陀区",
207
-          address: "上海市普陀区金沙江路 1518 弄",
208
-          zip: 200333
209
-        },
210
-        {
211
-          date: "2016-05-08",
212
-          name: "王小虎",
213
-          province: "上海",
214
-          city: "普陀区",
215
-          address: "上海市普陀区金沙江路 1518 弄",
216
-          zip: 200333
217
-        },
218
-        {
219
-          date: "2016-05-06",
220
-          name: "王小虎",
221
-          province: "上海",
222
-          city: "普陀区",
223
-          address: "上海市普陀区金沙江路 1518 弄",
224
-          zip: 200333
225
-        },
226
-        {
227
-          date: "2016-05-07",
228
-          name: "王小虎",
229
-          province: "上海",
230
-          city: "普陀区",
231
-          address: "上海市普陀区金沙江路 1518 弄",
232
-          zip: 200333
233
-        },
234
-        {
235
-          date: "2016-05-08",
236
-          name: "王小虎",
237
-          province: "上海",
238
-          city: "普陀区",
239
-          address: "上海市普陀区金沙江路 1518 弄",
240
-          zip: 200333
241
-        },
242
-        {
243
-          date: "2016-05-06",
244
-          name: "王小虎",
245
-          province: "上海",
246
-          city: "普陀区",
247
-          address: "上海市普陀区金沙江路 1518 弄",
248
-          zip: 200333
249
-        },
250
-        {
251
-          date: "2016-05-07",
252
-          name: "王小虎",
253
-          province: "上海",
254
-          city: "普陀区",
255
-          address: "上海市普陀区金沙江路 1518 弄",
256
-          zip: 200333
257
-        }
258
-      ],
259
-      chart: {
260
-        title: {
261
-          text: "ECharts 入门示例"
262
-        },
263
-        tooltip: {},
264
-        legend: {
265
-          data: ["次数"],
266
-          left: 0
182
+  import echarts from 'echarts'
183
+  import NewNav from '../indicatorControlAnalysis/components/NewNav'
184
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
185
+  import LineChart from '../../qcd/components/LineChart'
186
+  import { getCurrentOrgPatients } from "@/api/common/common";
187
+  import {GetDialysisWeightChartData,GetDialysisWeightTableData} from "@/api/common/statistics"
188
+
189
+  import {
190
+    PostSearch
191
+  } from '@/api/patient'
192
+
193
+  import { uParseTime } from "@/utils/tools";
194
+  import { getDataConfig } from "@/utils/data";
195
+
196
+  export default {
197
+    components: {
198
+      LineChart,
199
+      BreadCrumb,
200
+      NewNav
201
+    },
202
+    data() {
203
+      return {
204
+        pickerOptions: {
205
+          disabledDate(time) {
206
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
207
+            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
208
+          }
267 209
         },
268
-        xAxis: {
269
-          data: ["达标", "未达标"]
210
+        patientsData:[],
211
+        tableData: [
212
+        ],
213
+        loading: false,
214
+        search_value: '',
215
+        total: '',
216
+        query: {
217
+          patient_id: '',
218
+          statistics_type: 1,
219
+          start_time: '',
220
+          end_time: '',
221
+          limit: 10,
222
+          page: 1
270 223
         },
271
-        yAxis: {
272
-          axisLabel: {
273
-            formatter: "{value} %"
224
+        options: [
225
+          { value: 1, name: '干体重' },
226
+          { value: 2, name: '透前体重' },
227
+          { value: 3, name: '体重增加' },
228
+          { value: 4, name: '透后体重' },
229
+        ],
230
+        crumbs: [
231
+          { path: false, name: '科室质控' },
232
+          { path: false, name: '指标评估统计' },
233
+          { path: false, name: '透析过程指标统计' }
234
+        ],
235
+        tableData1: [],
236
+        chart: {
237
+          title: {
238
+            text: 'ECharts 入门示例'
274 239
           },
275
-          show: false
276
-        },
277
-        series: [
278
-          {
279
-            name: "次数",
280
-            type: "bar",
281
-            data: ["78.57", "50"],
282
-            barWidth: 30,
283
-            label: {
284
-              normal: {
285
-                show: true,
286
-                position: "top",
287
-                formatter: "{c}次"
288
-              }
240
+          tooltip: {},
241
+          legend: {
242
+            data: [],
243
+            left: 0
244
+          },
245
+          xAxis: {
246
+            data: []
247
+          },
248
+          yAxis: {
249
+            axisLabel: {
250
+              formatter: '{value} %'
289 251
             },
290
-            //配置样式
291
-            itemStyle: {
292
-              //通常情况下:
293
-
294
-              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
295
-              normal: {
296
-                color: function(params) {
297
-                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
298
-                  var colorList = [
299
-                    ["#A9E0F3", "#9FBDFC"],
300
-
301
-                    ["#FFD7C0", "#FF9994"]
302
-                  ];
303
-
304
-                  var index = params.dataIndex;
305
-                  if (params.dataIndex >= colorList.length) {
306
-                    index = params.dataIndex % colorList.length;
307
-                  }
308
-
309
-                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
310
-                    { offset: 0, color: colorList[index][0] },
311
-                    // { offset: 0.5, color: colorList[index][1] },
312
-                    { offset: 1, color: colorList[index][1] }
313
-                  ]);
252
+            show: false
253
+          },
254
+          series: [
255
+            {
256
+              name: '',
257
+              type: 'line',
258
+              data: [],
259
+              barWidth: 30,
260
+              label: {
261
+                normal: {
262
+                  show: true,
263
+                  position: 'top',
264
+                  formatter: '{c}'
265
+                }
266
+              },
267
+              //配置样式
268
+              itemStyle: {
269
+                //通常情况下:
270
+
271
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
272
+                normal: {
273
+                  color: function(params) {
274
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
275
+                    var colorList = [
276
+                      ['#A9E0F3', '#9FBDFC'],
277
+
278
+                      ['#FFD7C0', '#FF9994']
279
+                    ]
280
+
281
+                    var index = params.dataIndex
282
+                    if (params.dataIndex >= colorList.length) {
283
+                      index = params.dataIndex % colorList.length
284
+                    }
285
+
286
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
287
+                      { offset: 0, color: colorList[index][0] },
288
+                      // { offset: 0.5, color: colorList[index][1] },
289
+                      { offset: 1, color: colorList[index][1] }
290
+                    ])
291
+                  },
292
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
314 293
                 },
315
-                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
294
+
295
+                //鼠标悬停时:
296
+                emphasis: {
297
+                  shadowBlur: 10,
298
+                  shadowOffsetX: 0,
299
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
300
+                }
301
+              }
302
+            }
303
+          ]
304
+        },
305
+        bar: {
306
+          title: {
307
+            text: 'ECharts 入门示例'
308
+          },
309
+          tooltip: {},
310
+          legend: {
311
+            data: [],
312
+            left: 0
313
+          },
314
+          xAxis: {
315
+            data: []
316
+          },
317
+          yAxis: {
318
+            axisLabel: {
319
+              formatter: '{value} %'
320
+            },
321
+            show: false
322
+          },
323
+          series: [
324
+            {
325
+              name: '',
326
+              type: 'bar',
327
+              data: [],
328
+              barWidth: 30,
329
+              label: {
330
+                normal: {
331
+                  show: true,
332
+                  position: 'top',
333
+                  formatter: '{c}次'
334
+                }
316 335
               },
336
+              //配置样式
337
+              itemStyle: {
338
+                //通常情况下:
339
+
340
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
341
+                normal: {
342
+                  color: function(params) {
343
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
344
+                    var colorList = [
345
+                      ['#A9E0F3', '#9FBDFC'],
346
+                      ['#FFD7C0', '#FF9994']
347
+                    ]
348
+
349
+                    var index = params.dataIndex
350
+                    if (params.dataIndex >= colorList.length) {
351
+                      index = params.dataIndex % colorList.length
352
+                    }
317 353
 
318
-              //鼠标悬停时:
319
-              emphasis: {
320
-                shadowBlur: 10,
321
-                shadowOffsetX: 0,
322
-                shadowColor: "rgba(0, 0, 0, 0.5)"
354
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
355
+                      { offset: 0, color: colorList[index][0] },
356
+                      // { offset: 0.5, color: colorList[index][1] },
357
+                      { offset: 1, color: colorList[index][1] }
358
+                    ])
359
+                  },
360
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
361
+                },
362
+
363
+                //鼠标悬停时:
364
+                emphasis: {
365
+
366
+                  shadowBlur: 10,
367
+                  shadowOffsetX: 0,
368
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
369
+                }
323 370
               }
324 371
             }
325
-          }
326
-        ]
372
+          ]
373
+        }
374
+
327 375
       }
328
-    };
329
-  },
330
-  methods: {
331
-    chooseWay(way) {
332
-      this.wayType = way;
333 376
     },
334
-    handleClick(row) {
335
-      console.log(row);
336
-      this.$router.push({
337
-        path: "/qcd/indicatorControlAnalysis/weightDetails"
338
-      });
377
+    methods: {
378
+      changeProject(val){
379
+        this.query.statistics_type = val
380
+        this.query.page = 1
381
+        this.GetDialysisWeightChartData(this.query)
382
+
383
+      },
384
+      handleChange(val){
385
+        this.query.patient_id = val.id
386
+        this.query.page = 1
387
+        this.GetDialysisWeightTableData(this.query)
388
+        this.GetDialysisWeightChartData(this.query)
389
+      },
390
+      handleSizeChange(limit) {
391
+        this.query.limit = limit;
392
+
393
+      },
394
+      handleCurrentChange(page) {
395
+        this.query.page = page;
396
+
397
+      },
398
+      changeTime(val) {
399
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
400
+        if (time > 0) {
401
+          this.$message.error("结束时间不能小于开始时间");
402
+          this.query.start_time = "";
403
+        } else {
404
+          // this.getDialysisList()
405
+          this.query.page = 1;
406
+          this.GetDialysisWeightChartData(this.query)
407
+          this.GetDialysisWeightTableData(this.query)
408
+
409
+        }
410
+
411
+      },
412
+      changeEndTime(val) {
413
+        var time =
414
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
415
+        if (time < 0) {
416
+          this.$message.error("结束时间不能小于开始时间");
417
+          this.query.end_time = "";
418
+        } else {
419
+          this.query.page = 1;
420
+          this.GetDialysisWeightChartData(this.query)
421
+          this.GetDialysisWeightTableData(this.query)
422
+
423
+        }
424
+      },
425
+      getTimestamp(time) {
426
+        // 把时间日期转成时间戳
427
+        return new Date(time).getTime() / 1000;
428
+      },
429
+      QueryOperaById: function(val) {
430
+        let vascular_access_desc_name = "";
431
+        let vascular_access_desc = getDataConfig(
432
+          "hemodialysis",
433
+          "vascular_access_desc"
434
+        );
435
+        for (let i = 0; i < vascular_access_desc.length; i++) {
436
+          if (vascular_access_desc[i].id == val) {
437
+            vascular_access_desc_name = vascular_access_desc[i].name;
438
+          }
439
+        }
440
+
441
+        return vascular_access_desc_name;
442
+      },
443
+      GetAnticoagulantById: function (val) {
444
+        let anticoagulan_name = ''
445
+        var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
446
+        let anticoagulant = anticoagulantsConfitTwo
447
+        for (let keys in anticoagulant) {
448
+          if (anticoagulant[keys].id == val) {
449
+            anticoagulan_name = anticoagulant[keys].name
450
+          }
451
+        }
452
+        return anticoagulan_name
453
+      },
454
+      getModeName(mode_id){
455
+        return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
456
+      },
457
+      changeTime() {
458
+
459
+      }, changeEndTime() {
460
+
461
+
462
+      }, GetDialysisWeightTableData(params) {
463
+        this.loading = true
464
+        this.tableData = []
465
+        GetDialysisWeightTableData(params)
466
+          .then(rs => {
467
+            var resp = rs.data
468
+            if (resp.state == 1) {
469
+              this.loading = false
470
+
471
+              for (let i = 0; i < resp.data.data.length; i++) {
472
+                this.tableData.push(resp.data.data[i])
473
+              }
474
+            } else {
475
+              this.loading = false
476
+            }
477
+          })
478
+          .catch(error => {
479
+
480
+          })
481
+      },
482
+      GetDialysisWeightChartData(params) {
483
+        this.bar.xAxis.data = []
484
+        this.bar.series[0].data = []
485
+        GetDialysisWeightChartData(params)
486
+          .then(rs => {
487
+            var resp = rs.data
488
+            if (resp.state == 1) {
489
+              for (let i = 0; i < resp.data.data.length; i++) {
490
+                this.bar.xAxis.data.push(resp.data.data[i].name)
491
+                this.bar.series[0].data.push(resp.data.data[i].total)
492
+              }
493
+            } else {
494
+            }
495
+          })
496
+          .catch(error => {
497
+          })
498
+      },
499
+      handleSelect(val) {
500
+        this.query.patient_id = val.id
501
+        this.query.page = 1
502
+        this.GetDialysisWeightChartData(this.query)
503
+        this.GetDialysisWeightTableData(this.query)
504
+
505
+      },
506
+      querySearchAsync(keyword, cb) {
507
+        let key = ''
508
+        if (keyword != undefined) {
509
+          key = keyword
510
+        }
511
+        let searchArray = []
512
+        PostSearch(key).then(response => {
513
+          if (response.data.state == 1) {
514
+            searchArray = response.data.data.patient
515
+            cb(searchArray)
516
+          } else {
517
+            cb([])
518
+          }
519
+        })
520
+      },
521
+      chooseWay(way) {
522
+        this.wayType = way
523
+      }, getCurrentOrgPatients(){
524
+        getCurrentOrgPatients().then(response=>{
525
+          if(response.data.state == 1){
526
+            var patients = response.data.data.patients
527
+            this.patientsData = patients
528
+          }
529
+        })
530
+      },
531
+    }, created() {
532
+      var date = new Date()
533
+      var year = date.getFullYear() //获取完整的年份(4位)
534
+      var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
535
+      var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
536
+      var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
537
+      this.query.patient_id = 0
538
+      this.query.end_time = year + '-' + month + '-' + day
539
+      this.query.start_time = year + '-' + last_month + '-' + day
540
+      this.query.statistics_type = 1
541
+      this.GetDialysisWeightChartData(this.query)
542
+      this.GetDialysisWeightTableData(this.query)
543
+      this.getCurrentOrgPatients()
544
+
545
+
339 546
     }
340 547
   }
341
-};
342 548
 </script>
343 549
 
344 550
 <style lang="scss" scoped>
345
-.tableTitle {
346
-  font-size: 16px;
347
-  color: #000;
348
-  font-weight: bold;
349
-  margin-bottom: 10px;
350
-}
551
+  .tableTitle {
552
+    font-size: 16px;
553
+    color: #000;
554
+    font-weight: bold;
555
+    margin-bottom: 10px;
556
+  }
351 557
 </style>
352 558
 <style lang="scss">
353
-.page_weight {
559
+  .page_process {
560
+
354 561
   .el-button--medium {
355 562
     padding: 10px 8px;
356 563
   }
564
+
357 565
   .el-form-item {
358 566
     margin-bottom: 0;
359 567
   }
360
-  .cell {
361
-    text-align: center;
568
+
362 569
   }
363
-}
364 570
 </style>

+ 2 - 2
src/xt_pages/qcd/indicatorControlAnalysis/weightDetails.vue 파일 보기

@@ -16,7 +16,7 @@
16 16
         <el-container>
17 17
           <div style="width:150px">
18 18
             <div class="tableTitle">患者列表</div>
19
-            <el-table :data="tableData" border style="width: 100%;" height="500">
19
+            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
20 20
               <el-table-column prop="date" label="日期" width="70"></el-table-column>
21 21
               <el-table-column prop="name" label="姓名" width="80"></el-table-column>
22 22
             </el-table>
@@ -74,7 +74,7 @@
74 74
             </div>
75 75
             <div class="tableTitle">统计表</div>
76 76
             <div>
77
-              <el-table :data="tableData1" style="width: 100%" border>
77
+              <el-table :data="tableData1" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
78 78
                 <el-table-column fixed prop="date" label="日期"></el-table-column>
79 79
                 <el-table-column prop="name" label="姓名"></el-table-column>
80 80
                 <el-table-column prop="province" label="省份"></el-table-column>

+ 573 - 47
src/xt_pages/qcd/officesControlAnalysis/project.vue 파일 보기

@@ -9,7 +9,7 @@
9 9
         <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
10 10
       </el-tabs>
11 11
       <div class="cell clearfix">
12
-        <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
12
+        <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:20px" @change="changeOptions">
13 13
           <el-option
14 14
             v-for="item in options"
15 15
             :key="item.value"
@@ -25,12 +25,12 @@
25 25
             :value="item.value"
26 26
           ></el-option>
27 27
         </el-select>
28
-        <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
28
+        <el-select v-model="mode_type" placeholder="请选择" style="width:120px;margin-right:20px" @change="handleModeType">
29 29
           <el-option
30
-            v-for="item in options"
31
-            :key="item.value"
32
-            :label="item.label"
33
-            :value="item.value"
30
+            v-for="item in normdata"
31
+            :key="item.inspection_minor"
32
+            :label="item.item_name"
33
+            :value="item.inspection_minor"
34 34
           ></el-option>
35 35
         </el-select>
36 36
       </div>
@@ -46,35 +46,20 @@
46 46
         <p class="pointTitle">指标正常范围值</p>
47 47
       </div>
48 48
       <div class="cell clearfix newDisplay">
49
-        <span class="index">钙(2.25-2.75)</span>
50
-        <span class="index">钙(2.25-2.75)</span>
51
-        <span class="index">钙(2.25-2.75)</span>
52
-        <span class="index">钙(2.25-2.75)</span>
53
-        <span class="index">钙(2.25-2.75)</span>
54
-        <span class="index">钙(2.25-2.75)</span>
55
-        <span class="index">钙(2.25-2.75)</span>
56
-        <span class="index">钙(2.25-2.75)</span>
57
-        <span class="index">钙(2.25-2.75)</span>
58
-        <span class="index">钙(2.25-2.75)</span>
59
-        <span class="index">钙(2.25-2.75)</span>
60
-        <span class="index">钙(2.25-2.75)</span>
61
-        <span class="index">钙(2.25-2.75)</span>
62
-        <span class="index">钙(2.25-2.75)</span>
63
-        <span class="index">钙(2.25-2.75)</span>
64
-        <span class="index">钙(2.25-2.75)</span>
65
-        <span class="index">钙(2.25-2.75)</span>
66
-        <span class="index">钙(2.25-2.75)</span>
49
+        <span class="index" v-for="(item,index) in normdata" :key="index ">{{item.item_name}}({{item.min_range}}-{{item.large_range}})</span>
67 50
       </div>
68 51
     </div>
69 52
   </div>
70 53
 </template>
71 54
 
72 55
 <script>
56
+const moment = require('moment')
73 57
 import echarts from "echarts";
74 58
 import { GetOICData } from "@/api/qcd";
75 59
 import LineChart from "../../qcd/components/LineChart";
76 60
 import { uParseTime } from "@/utils/tools";
77 61
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
62
+import {getNormData,getProjectList,getMonthProjectList } from "@/api/common/common"
78 63
 export default {
79 64
   components: {
80 65
     LineChart,
@@ -83,6 +68,11 @@ export default {
83 68
   data() {
84 69
     return {
85 70
       activeName: "second",
71
+      normdata:[],
72
+      modesData: {
73
+        xAxis: [],
74
+        series: []
75
+      },
86 76
       crumbs: [
87 77
         { path: false, name: "科室质控" },
88 78
         { path: false, name: "科室质控达标统计" },
@@ -90,38 +80,32 @@ export default {
90 80
       ],
91 81
       options: [
92 82
         {
93
-          value: "选项1",
94
-          label: "黄金糕"
95
-        },
96
-        {
97
-          value: "选项2",
98
-          label: "双皮奶"
83
+          value:0,
84
+          label:"全部",
99 85
         },
100 86
         {
101
-          value: "选项3",
102
-          label: "蚵仔煎"
87
+          value: 1,
88
+          label: "留治",
103 89
         },
104 90
         {
105
-          value: "选项4",
106
-          label: "龙须面"
91
+          value:2,
92
+          label: "转归"
107 93
         },
108
-        {
109
-          value: "选项5",
110
-          label: "北京烤鸭"
111
-        }
112 94
       ],
113
-      value: "请选项",
114 95
       options1: [
115 96
         {
116
-          value: "按季度对比统计",
97
+          value: 1,
117 98
           label: "按季度对比统计"
118 99
         },
119 100
         {
120
-          value: "按月份对比统计",
101
+          value: 2,
121 102
           label: "按月份对比统计"
122
-        }
103
+        },
123 104
       ],
124
-      type: "按季度对比统计",
105
+      value: "请选项",
106
+      lapseto:0,
107
+      type:1,
108
+      mode_type:"",
125 109
       chart: {
126 110
         title: {
127 111
           text: "ECharts 入门示例"
@@ -143,7 +127,7 @@ export default {
143 127
         series: [
144 128
           {
145 129
             name: "次数",
146
-            type: "line",
130
+            type: "bar",
147 131
             data: [
148 132
               "78.57",
149 133
               "50",
@@ -160,7 +144,7 @@ export default {
160 144
               normal: {
161 145
                 show: true,
162 146
                 position: "top",
163
-                formatter: "{c}"
147
+                formatter: "{c}%"
164 148
               }
165 149
             },
166 150
             //配置样式
@@ -217,10 +201,552 @@ export default {
217 201
       }
218 202
     },
219 203
     chooseType(val) {
220
-      console.log(val);
221 204
       this.type = val;
205
+      console.log("val",val)
206
+      //按季度
207
+      if(val == 1){
208
+        this.getlist()
209
+      }
210
+      //按月份
211
+      if(val == 2){
212
+        this.getMonthList()
213
+      }
214
+     
215
+    },
216
+    changeOptions(val){
217
+     if(this.type == 2){
218
+        this.getMonthList()
219
+        return false
220
+      }
221
+      this.lapseto = val
222
+      this.getlist()
223
+       
224
+    },
225
+    getNormData(){
226
+        getNormData().then(response=>{
227
+            var normdata = response.data.data.normdata
228
+            console.log("normdata",normdata)
229
+            for(let i=0;i<normdata.length;i++){
230
+             this.mode_type = normdata[0].inspection_minor
231
+            }
232
+            this.normdata = normdata
233
+            this.getlist()
234
+           // this.getMonthList()
235
+        })
236
+    },
237
+    handleModeType(val){
238
+       console.log("触发了额",this.type)
239
+       if(this.type == 2){
240
+        this.getMonthList()
241
+        return false
242
+      }
243
+      this.mode_type = val
244
+      this.getlist()
245
+     
246
+    },
247
+
248
+    //季度
249
+    getlist(){
250
+         this.modesData.series = []
251
+         this.modesData.xAxis = []
252
+        const firstQuarterStart =  moment().startOf('year').format('YYYY-MM-DD')
253
+       // console.log("本月开始时间",firstQuarterStart)
254
+        const firstQuarterEnd = moment().month(11).endOf('month').format("YYYY-MM-DD")
255
+       // console.log("本月结束时间",firstQuarterEnd)
256
+
257
+        //第一季度
258
+        const first_quarter_start =  moment().startOf('year').format('YYYY-MM-DD')
259
+       // console.log("第一季度",first_quarter_start)
260
+        const first_qurter_end = moment().month(2).endOf('month').format("YYYY-MM-DD")
261
+      // console.log("第一季度",first_qurter_end)
262
+        //第二季度
263
+        const second_qurter_start = moment().month(3).startOf('month').format("YYYY-MM-DD")
264
+      //  console.log("第二季度",second_qurter_start)
265
+        const second_qurter_end = moment().month(5).endOf('month').format("YYYY-MM-DD")
266
+      //  console.log("第二季度",second_qurter_end)
267
+        //第三季度
268
+        const three_qurter_start = moment().month(6).startOf('month').format("YYYY-MM-DD")
269
+      //  console.log("第三季度",three_qurter_start)
270
+        const three_qurter_end = moment().month(8).endOf('month').format("YYYY-MM-DD")
271
+      //  console.log("第三季度",three_qurter_end)
272
+        //第四季度
273
+         const four_qurter_start = moment().month(9).startOf('month').format("YYYY-MM-DD")
274
+      //  console.log("第四季度",four_qurter_start)
275
+        const four_qurter_end = moment().month(11).endOf('month').format("YYYY-MM-DD")
276
+      //  console.log("第四季度",four_qurter_end)
277
+     
278
+         const params = {
279
+           lapseto:this.lapseto,
280
+           itemtype:this.type,
281
+           modetype:this.mode_type,
282
+           startime:firstQuarterStart,
283
+           endtime:firstQuarterEnd,
284
+           first_quarter_start:first_quarter_start,
285
+           first_qurter_end:first_qurter_end,
286
+           second_qurter_start:second_qurter_start,
287
+           second_qurter_end:second_qurter_end,
288
+           three_qurter_start:three_qurter_start,
289
+           three_qurter_end:three_qurter_end,
290
+           four_qurter_start:four_qurter_start,
291
+           four_qurter_end:four_qurter_end,
292
+         }
293
+         console.log("params",params)
294
+      getProjectList(params).then(response=>{
295
+        if(response.data.state === 1){
296
+          var list = response.data.data.list
297
+         // console.log("数据源",list)
298
+          var standList =  response.data.data.standList
299
+         // console.log("standList",standList)
300
+          var newArr = [
301
+            {Total:"第一季度",Count:1,NoCount: 0},
302
+            {Total:"第二季度",Count:1,NoCount: 0},
303
+            {Total:"第三季度",Count:1,NoCount: 0},
304
+            {Total:"第四季度",Count:1,NoCount: 0},
305
+          ]
306
+    
307
+
308
+        //获取2个数组不同的部分
309
+        var arrTwo = this.arrayDate(list,newArr)
310
+        arrTwo.map(item => {
311
+              list.push(item)
312
+           })
313
+        //  console.log("list",list)
314
+         
315
+         for(let i=0;i<list.length;i++){
316
+            if(list[i].Total == "第一季度"){
317
+               list[i].Total = 1
318
+            }
319
+          if(list[i].Total == "第二季度"){
320
+               list[i].Total = 2
321
+           }
322
+         if(list[i].Total == "第三季度"){
323
+               list[i].Total = 3
324
+           }
325
+          if(list[i].Total == "第四季度"){
326
+               list[i].Total = 4
327
+           }
328
+         }
329
+          //排序
330
+          list.sort(this.compare('Total'))
331
+          for(let i=0;i<list.length;i++){
332
+            if(list[i].Total == 1){
333
+               list[i].Total = "第一季度"
334
+            }
335
+            if(list[i].Total == 2){
336
+               list[i].Total = "第二季度"
337
+            }
338
+            if(list[i].Total == 3){
339
+               list[i].Total = "第三季度"
340
+            }
341
+            if(list[i].Total == 4){
342
+               list[i].Total = "第四季度"
343
+            }
344
+          }
345
+
346
+           var newArrThree = [
347
+            {Total:"第一季度",Count:0},
348
+            {Total:"第二季度",Count:0},
349
+            {Total:"第三季度",Count:0},
350
+            {Total:"第四季度",Count:0},
351
+          ]
352
+
353
+           //获取2个数组不同的部分
354
+          var standArr = this.arrayDateTwo(standList,newArrThree)  
355
+          standArr.map(item=>{
356
+            standList.push(item)
357
+          })
358
+         //  console.log("standList",standList)
359
+
360
+        
361
+       //  console.log("list-----",list)
362
+         var arrFive = []
363
+          for(let i=0;i<list.length;i++){
364
+             for(let j=0;j<standList.length;j++){
365
+                if(list[i].Total == standList[j].Total){
366
+                    list[i].NoCount = standList[j].Count
367
+                    arrFive.push(list[i])
368
+                }
369
+             }
370
+          }
371
+        
372
+       // console.log("arrFive",arrFive)
373
+        
374
+        for(const key in arrFive){
375
+            this.modesData.xAxis.push(arrFive[key].Total);
376
+            this.modesData.series.push(((arrFive[key].NoCount/arrFive[key].Count)*100).toFixed(1));
377
+          }
378
+         
379
+
380
+          this.chart.series[0].data = this.modesData.series
381
+          this.chart.xAxis.data = this.modesData.xAxis
382
+        //  console.log("222000",this.modesData)
383
+        }
384
+      })
385
+    },
386
+     arrayDate(array1,array2){
387
+      //  console.log("array1",array1)
388
+      //  console.log("array2",array2)
389
+        var array1 = array1;
390
+        var array2 = array2;
391
+        var result = [];
392
+        for(var i = 0; i < array2.length; i++){
393
+            var obj = array2[i];
394
+            var num = obj.Total;   //staff_id   就是要对比的key
395
+            var isExist = false;
396
+            for(var j = 0; j < array1.length; j++){
397
+                var aj = array1[j];
398
+                var n = aj.Total;
399
+                if(n == num){
400
+                    isExist = true;
401
+                    break;
402
+             }
403
+            }
404
+            if(!isExist){
405
+                result.push(obj);
406
+            }
407
+        }
408
+      //  console.log("result",result)
409
+        return result;
410
+    },
411
+    arrayDateTwo(array1,array2){
412
+      //   console.log("array1",array1)
413
+      //   console.log("array2",array2)
414
+        var array1 = array1;
415
+        var array2 = array2;
416
+        var result = [];
417
+        for(var i = 0; i < array2.length; i++){
418
+            var obj = array2[i];
419
+            var num = obj.Total;   //staff_id   就是要对比的key
420
+            var isExist = false;
421
+            for(var j = 0; j < array1.length; j++){
422
+                var aj = array1[j];
423
+                var n = aj.Total;
424
+                if(n == num){
425
+                    isExist = true;
426
+                    break;
427
+             }
428
+            }
429
+            if(!isExist){
430
+                result.push(obj);
431
+            }
432
+        }
433
+      //  console.log("resultTwo",result)
434
+        return result;
435
+    },
436
+     arrayDateThree(array1,array2){
437
+        // console.log("array1",array1)
438
+        // console.log("array2",array2)
439
+        var array1 = array1;
440
+        var array2 = array2;
441
+        var result = [];
442
+        for(var i = 0; i < array2.length; i++){
443
+            var obj = array2[i];
444
+            var num = obj.Total;   //staff_id   就是要对比的key
445
+            var isExist = false;
446
+            for(var j = 0; j < array1.length; j++){
447
+                var aj = array1[j];
448
+                var n = aj.Total;
449
+                if(n == num){
450
+                    isExist = true;
451
+                    break;
452
+             }
453
+            }
454
+            if(!isExist){
455
+                result.push(obj);
456
+            }
457
+        }
458
+       console.log("resultThree",result)
459
+        return result;
460
+    },
461
+    arrayDateFour(array1,array2){
462
+      //   console.log("array1",array1)
463
+      //   console.log("array2",array2)
464
+        var array1 = array1;
465
+        var array2 = array2;
466
+        var result = [];
467
+        for(var i = 0; i < array2.length; i++){
468
+            var obj = array2[i];
469
+            var num = obj.Total;   //staff_id   就是要对比的key
470
+            var isExist = false;
471
+            for(var j = 0; j < array1.length; j++){
472
+                var aj = array1[j];
473
+                var n = aj.Total;
474
+                if(n == num){
475
+                    isExist = true;
476
+                    break;
477
+             }
478
+            }
479
+            if(!isExist){
480
+                result.push(obj);
481
+            }
482
+        }
483
+      //  console.log("resultTwo",result)
484
+        return result;
485
+    },
486
+     compare(property){
487
+       return function(a,b){
488
+          var value1 = a[property];
489
+          var value2 = b[property];
490
+          return value1 - value2;
491
+        }
492
+    },
493
+    
494
+    //按月份统计
495
+    getMonthList(){
496
+         this.modesData.series = []
497
+         this.modesData.xAxis = []
498
+        const januaryStart = moment().month(0).startOf('month').format("YYYY-MM-DD")
499
+        console.log("一月始",januaryStart)
500
+        const januaryEnd = moment().month(0).endOf('month').format("YYYY-MM-DD")
501
+        console.log("一月末",januaryEnd)
502
+
503
+        const  febStart = moment().month(1).startOf('month').format("YYYY-MM-DD")
504
+        console.log("二月始",febStart)
505
+        const febEnd = moment().month(1).endOf('month').format("YYYY-MM-DD")
506
+        console.log("二月末",febEnd)
507
+
508
+        const  marchStart = moment().month(2).startOf('month').format("YYYY-MM-DD")
509
+        console.log("三月始",marchStart)
510
+        const marchEnd = moment().month(2).endOf('month').format("YYYY-MM-DD")
511
+        console.log("三月末",marchEnd)
512
+
513
+        const  aprStart = moment().month(3).startOf('month').format("YYYY-MM-DD")
514
+        console.log("四月始",aprStart)
515
+        const aprEnd = moment().month(3).endOf('month').format("YYYY-MM-DD")
516
+        console.log("四月末",aprEnd)
517
+
518
+        const  mayStart = moment().month(4).startOf('month').format("YYYY-MM-DD")
519
+        console.log("五月始",mayStart)
520
+        const mayEnd = moment().month(4).endOf('month').format("YYYY-MM-DD")
521
+        console.log("五月末",mayEnd)
522
+
523
+        const  junStart = moment().month(5).startOf('month').format("YYYY-MM-DD")
524
+        console.log("六月始",junStart)
525
+        const junEnd = moment().month(5).endOf('month').format("YYYY-MM-DD")
526
+        console.log("六月末",junEnd)
527
+
528
+        const  julStart = moment().month(6).startOf('month').format("YYYY-MM-DD")
529
+        console.log("7月始",julStart)
530
+        const julEnd = moment().month(6).endOf('month').format("YYYY-MM-DD")
531
+        console.log("7月末",julEnd)
532
+
533
+        const  augStart = moment().month(7).startOf('month').format("YYYY-MM-DD")
534
+        console.log("8月始",augStart)
535
+        const augEnd = moment().month(7).endOf('month').format("YYYY-MM-DD")
536
+        console.log("8月末",augEnd)
537
+
538
+        const  sepStart = moment().month(8).startOf('month').format("YYYY-MM-DD")
539
+        console.log("9月始",sepStart)
540
+        const sepEnd = moment().month(8).endOf('month').format("YYYY-MM-DD")
541
+        console.log("9月末",sepEnd)
542
+
543
+        const  octStart = moment().month(9).startOf('month').format("YYYY-MM-DD")
544
+        console.log("10月始",octStart)
545
+        const octEnd = moment().month(9).endOf('month').format("YYYY-MM-DD")
546
+        console.log("10月末",octEnd)
547
+
548
+        const  novStart = moment().month(10).startOf('month').format("YYYY-MM-DD")
549
+        console.log("11月始",novStart)
550
+        const novEnd = moment().month(10).endOf('month').format("YYYY-MM-DD")
551
+        console.log("11月末",novEnd)
552
+        
553
+        const  decStart = moment().month(11).startOf('month').format("YYYY-MM-DD")
554
+        console.log("12月始",decStart)
555
+        const decEnd = moment().month(11).endOf('month').format("YYYY-MM-DD")
556
+        console.log("12月末",decEnd)
557
+        
558
+        const params = {
559
+          lapseto:this.lapseto,
560
+          itemtype:this.type,
561
+          modetype:this.mode_type,
562
+          januaryStart:januaryStart,
563
+          januaryEnd:januaryEnd,
564
+          febStart:febStart,
565
+          febEnd:febEnd,
566
+          marchStart:marchStart,
567
+          marchEnd:marchEnd,
568
+          aprStart:aprStart,
569
+          aprEnd:aprEnd,
570
+          mayStart:mayStart,
571
+          mayEnd:mayEnd,
572
+          junStart:junStart,
573
+          junEnd:junEnd,
574
+          julStart:julStart,
575
+          julEnd:julEnd,
576
+          augStart:augStart,
577
+          augEnd:augEnd,
578
+          sepStart:sepStart,
579
+          sepEnd:sepEnd,
580
+          octStart:octStart,
581
+          octEnd:octEnd,
582
+          novStart:novStart,
583
+          novEnd:novEnd,
584
+          decStart:decStart,
585
+          decEnd:decEnd,    
586
+        }
587
+       console.log("params222222",params)
588
+       getMonthProjectList(params).then(response=>{
589
+        if(response.data.state === 1){
590
+            var monthlist = response.data.data.monthlist
591
+            console.log("monthlist++++++",monthlist)
592
+            var newArr = [
593
+              {Total:"一月",Count:1,NoCount: 0},
594
+              {Total:"二月",Count:1,NoCount: 0},
595
+              {Total:"三月",Count:1,NoCount: 0},
596
+              {Total:"四月",Count:1,NoCount: 0},
597
+              {Total:"五月",Count:1,NoCount: 0},
598
+              {Total:"六月",Count:1,NoCount: 0},
599
+              {Total:"七月",Count:1,NoCount: 0},
600
+              {Total:"八月",Count:1,NoCount: 0},
601
+              {Total:"九月",Count:1,NoCount: 0},
602
+              {Total:"十月",Count:1,NoCount: 0},
603
+              {Total:"十一月",Count:1,NoCount: 0},
604
+              {Total:"十二月",Count:1,NoCount: 0},
605
+            ]
606
+
607
+            var newArrTwo = [
608
+              {Total:"一月",Count:0},
609
+              {Total:"二月",Count:0},
610
+              {Total:"三月",Count:0},
611
+              {Total:"四月",Count:0},
612
+              {Total:"五月",Count:0},
613
+              {Total:"六月",Count:0},
614
+              {Total:"七月",Count:0},
615
+              {Total:"八月",Count:0},
616
+              {Total:"九月",Count:0},
617
+              {Total:"十月",Count:0},
618
+              {Total:"十一月",Count:0},
619
+              {Total:"十二月",Count:0},
620
+            ]
621
+           
622
+             //获取2个数组不同的部分
623
+            var standArr = this.arrayDateThree(monthlist,newArr)  
624
+            console.log("standArr",standArr)
625
+            standArr.map(item=>{
626
+                monthlist.push(item)
627
+              }) 
628
+            
629
+
630
+             //排序
631
+             for(let i=0;i<monthlist.length;i++){
632
+                if(monthlist[i].Total == "一月"){
633
+                   monthlist[i].Total = 1
634
+                }
635
+                if(monthlist[i].Total == "二月"){
636
+                   monthlist[i].Total = 2
637
+                }
638
+                if(monthlist[i].Total == "三月"){
639
+                   monthlist[i].Total = 3
640
+                }
641
+                if(monthlist[i].Total == "四月"){
642
+                   monthlist[i].Total = 4
643
+                }
644
+                if(monthlist[i].Total == "五月"){
645
+                   monthlist[i].Total = 5
646
+                }
647
+                if(monthlist[i].Total == "六月"){
648
+                   monthlist[i].Total = 6
649
+                }
650
+                if(monthlist[i].Total == "七月"){
651
+                   monthlist[i].Total = 7
652
+                }
653
+                if(monthlist[i].Total == "八月"){
654
+                   monthlist[i].Total = 8
655
+                }
656
+                if(monthlist[i].Total == "九月"){
657
+                   monthlist[i].Total = 9
658
+                }
659
+                if(monthlist[i].Total == "十月"){
660
+                   monthlist[i].Total = 10
661
+                }
662
+                if(monthlist[i].Total == "十一月"){
663
+                   monthlist[i].Total = 11
664
+                }
665
+                 if(monthlist[i].Total == "十二月"){
666
+                   monthlist[i].Total = 12
667
+                }
668
+             }
669
+            
670
+              //排序
671
+             monthlist.sort(this.compare('Total'))
672
+             for(let i=0;i<monthlist.length;i++){
673
+                if(monthlist[i].Total == 1){
674
+                  monthlist[i].Total = "一月"
675
+                }
676
+                if(monthlist[i].Total == 2){
677
+                  monthlist[i].Total = "二月"
678
+                }
679
+                 if(monthlist[i].Total == 3){
680
+                  monthlist[i].Total = "三月"
681
+                }
682
+                 if(monthlist[i].Total == 4){
683
+                  monthlist[i].Total = "四月"
684
+                }
685
+                 if(monthlist[i].Total == 5){
686
+                  monthlist[i].Total = "五月"
687
+                }
688
+                 if(monthlist[i].Total == 6){
689
+                  monthlist[i].Total = "六月"
690
+                }
691
+                 if(monthlist[i].Total == 7){
692
+                  monthlist[i].Total = "七月"
693
+                }
694
+                 if(monthlist[i].Total == 8){
695
+                  monthlist[i].Total = "八月"
696
+                }
697
+                 if(monthlist[i].Total == 9){
698
+                  monthlist[i].Total = "九月"
699
+                }
700
+                 if(monthlist[i].Total == 10){
701
+                  monthlist[i].Total = "十月"
702
+                }
703
+                 if(monthlist[i].Total == 11){
704
+                  monthlist[i].Total = "十一月"
705
+                }
706
+                 if(monthlist[i].Total == 12){
707
+                  monthlist[i].Total = "十二月"
708
+                }
709
+             }
710
+              console.log("monthlist-------------------------",monthlist)
711
+             var monthNolist = response.data.data.monthNolist
712
+             console.log("monthNolist",monthNolist)
713
+             
714
+            var standArrTwo = this.arrayDateThree(monthNolist,newArrTwo)  
715
+             console.log("standArrTwo",standArrTwo)
716
+
717
+             standArrTwo.map(item=>{
718
+                monthNolist.push(item)
719
+              }) 
720
+
721
+
722
+
723
+             var arrOne = []
724
+             for(let i=0;i<monthlist.length;i++){
725
+               for(let j=0;j<monthNolist.length;j++){
726
+                 if(monthlist[i].Total == monthNolist[j].Total){
727
+                     monthlist[i].NoCount = monthNolist[j].Count
728
+                     arrOne.push(monthlist[i])
729
+                 }
730
+               }
731
+             }
732
+             console.log("arrOne",arrOne)
733
+              
734
+            for(const key in arrOne){
735
+              this.modesData.xAxis.push(arrOne[key].Total);
736
+              this.modesData.series.push(((arrOne[key].NoCount/arrOne[key].Count)*100).toFixed(1));
737
+            }
738
+          
739
+
740
+            this.chart.series[0].data = this.modesData.series
741
+            this.chart.xAxis.data = this.modesData.xAxis
742
+           }
743
+       })
222 744
     }
223
-  }
745
+  },
746
+  created(){
747
+       //获取指标正常范围值
748
+     this.getNormData()
749
+  },
224 750
 };
225 751
 </script>
226 752
 

+ 241 - 40
src/xt_pages/qcd/officesControlAnalysis/time.vue 파일 보기

@@ -9,7 +9,7 @@
9 9
         <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
10 10
       </el-tabs>
11 11
       <div class="cell clearfix">
12
-        <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
12
+        <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:20px" @change="changeLapseto">
13 13
           <el-option
14 14
             v-for="item in options"
15 15
             :key="item.value"
@@ -89,35 +89,20 @@
89 89
         <p class="pointTitle">指标正常范围值</p>
90 90
       </div>
91 91
       <div class="cell clearfix newDisplay">
92
-        <span class="index">钙(2.25-2.75)</span>
93
-        <span class="index">钙(2.25-2.75)</span>
94
-        <span class="index">钙(2.25-2.75)</span>
95
-        <span class="index">钙(2.25-2.75)</span>
96
-        <span class="index">钙(2.25-2.75)</span>
97
-        <span class="index">钙(2.25-2.75)</span>
98
-        <span class="index">钙(2.25-2.75)</span>
99
-        <span class="index">钙(2.25-2.75)</span>
100
-        <span class="index">钙(2.25-2.75)</span>
101
-        <span class="index">钙(2.25-2.75)</span>
102
-        <span class="index">钙(2.25-2.75)</span>
103
-        <span class="index">钙(2.25-2.75)</span>
104
-        <span class="index">钙(2.25-2.75)</span>
105
-        <span class="index">钙(2.25-2.75)</span>
106
-        <span class="index">钙(2.25-2.75)</span>
107
-        <span class="index">钙(2.25-2.75)</span>
108
-        <span class="index">钙(2.25-2.75)</span>
109
-        <span class="index">钙(2.25-2.75)</span>
92
+         <span v-for="(item,index) in normData" :key="index" class="index">{{item.item_name}}({{item.min_range}}-{{item.large_range}})</span> 
110 93
       </div>
111 94
     </div>
112 95
   </div>
113 96
 </template>
114 97
 
115 98
 <script>
99
+const moment = require('moment')
116 100
 import echarts from "echarts";
117 101
 import { GetOICData } from "@/api/qcd";
118 102
 import LineChart from "../../qcd/components/LineChart";
119 103
 import { uParseTime } from "@/utils/tools";
120 104
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
105
+import {getNormData,getFirstQuarter}from "@/api/common/common"
121 106
 export default {
122 107
   components: {
123 108
     LineChart,
@@ -126,38 +111,36 @@ export default {
126 111
   data() {
127 112
     return {
128 113
       activeName: "first",
114
+      modesData: {
115
+        xAxis: [],
116
+        series: []
117
+       },
129 118
       crumbs: [
130 119
         { path: false, name: "科室质控" },
131 120
         { path: false, name: "科室质控达标统计" },
132 121
         { path: false, name: "按时间分组" }
133 122
       ],
123
+      normData:[],
134 124
       listQuery: {
135 125
         start_time: "",
136 126
         end_time: "",
137 127
         page: 1,
138 128
         limit: 10
139 129
       },
130
+      lapseto:0,
140 131
       options: [
141 132
         {
142
-          value: "选项1",
143
-          label: "黄金糕"
144
-        },
145
-        {
146
-          value: "选项2",
147
-          label: "双皮奶"
148
-        },
133
+          value: 0,
134
+          label: "全部"
135
+        }, 
149 136
         {
150
-          value: "选项3",
151
-          label: "蚵仔煎"
152
-        },
153
-        {
154
-          value: "选项4",
155
-          label: "龙须面"
156
-        },
137
+          value: 1,
138
+          label: "留治"
139
+        }, 
157 140
         {
158
-          value: "选项5",
159
-          label: "北京烤鸭"
160
-        }
141
+          value: 2,
142
+          label: "转出"
143
+        }, 
161 144
       ],
162 145
       value: "请选项",
163 146
       options1: [
@@ -211,7 +194,7 @@ export default {
211 194
         },
212 195
         yAxis: {
213 196
           axisLabel: {
214
-            formatter: "{value} %"
197
+            formatter: "{value}%"
215 198
           },
216 199
           show: false
217 200
         },
@@ -235,7 +218,7 @@ export default {
235 218
               normal: {
236 219
                 show: true,
237 220
                 position: "top",
238
-                formatter: "{c}"
221
+                formatter: "{c}%"
239 222
               }
240 223
             },
241 224
             //配置样式
@@ -281,7 +264,7 @@ export default {
281 264
               }
282 265
             }
283 266
           }
284
-        ]
267
+        ],
285 268
       }
286 269
     };
287 270
   },
@@ -292,6 +275,14 @@ export default {
292 275
       }
293 276
     },
294 277
     changeTime() {},
278
+    changeLapseto(val){
279
+      console.log("val",val)
280
+      this.lapseto = val
281
+      const firstQuarterStart =  moment().startOf('year').format('YYYY-MM-DD')
282
+      const firstQuarterEnd = moment().month(2).endOf('month').format("YYYY-MM-DD")
283
+      this.getFirstQuarter(val,firstQuarterStart,firstQuarterEnd)
284
+    },
285
+     
295 286
     changeEndTime(val) {
296 287
       var time =
297 288
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -311,10 +302,220 @@ export default {
311 302
     },
312 303
     chooseQuarter(quarter) {
313 304
       this.quarterType = quarter;
305
+      //第一季度
306
+      if(quarter === 0){
307
+        //本月的开始时间
308
+        const firstQuarterStart =  moment().startOf('year').format('YYYY-MM-DD')
309
+        const firstQuarterEnd = moment().month(2).endOf('month').format("YYYY-MM-DD")
310
+        this.getFirstQuarter(this.lapseto,firstQuarterStart,firstQuarterEnd)
311
+      }
312
+
313
+      //第二季度
314
+      if(quarter === 1){
315
+        const febQuarterStart = moment().month(3).startOf('month').format("YYYY-MM-DD")
316
+        const fedQuarterEnd = moment().month(5).endOf('month').format("YYYY-MM-DD")
317
+        this.getFirstQuarter(this.lapseto,febQuarterStart,fedQuarterEnd)
318
+      }
319
+
320
+      //第三季度
321
+      if(quarter === 2){
322
+        const threeQuarterStart = moment().month(6).startOf('month').format("YYYY-MM-DD")
323
+        const threeQuarterEnd = moment().month(8).endOf('month').format("YYYY-MM-DD")
324
+        this.getFirstQuarter(this.lapseto,threeQuarterStart,threeQuarterEnd)
325
+      }
326
+
327
+      //第四季度
328
+      if(quarter === 3){
329
+        const fourQuarterStart = moment().month(8).startOf('month').format("YYYY-MM-DD")
330
+        const fourQuarterEnd = moment().month(11).endOf('month').format("YYYY-MM-DD")
331
+        this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
332
+      }
333
+
334
+      
314 335
     },
315 336
     chooseMonth(month) {
316 337
       this.monthType = month;
317
-    }
338
+    
339
+      //1月
340
+      if(month == 0){
341
+          const fourQuarterStart = moment().month(0).startOf('month').format("YYYY-MM-DD")
342
+          console.log("fourQuarterStart",fourQuarterStart)
343
+          const fourQuarterEnd = moment().month(0).endOf('month').format("YYYY-MM-DD")
344
+           this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
345
+
346
+      }
347
+      //2月
348
+      if(month == 1){
349
+         const fourQuarterStart = moment().month(1).startOf('month').format("YYYY-MM-DD")
350
+         console.log("fourQuarterStart",fourQuarterStart)
351
+         const fourQuarterEnd = moment().month(1).endOf('month').format("YYYY-MM-DD")
352
+        this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
353
+      }
354
+      //
355
+     //3月
356
+      if(month == 2){
357
+         const fourQuarterStart = moment().month(2).startOf('month').format("YYYY-MM-DD")
358
+         console.log("fourQuarterStart",fourQuarterStart)
359
+         const fourQuarterEnd = moment().month(2).endOf('month').format("YYYY-MM-DD")
360
+         this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
361
+      }
362
+      //4月
363
+       if(month == 3){
364
+         const fourQuarterStart = moment().month(3).startOf('month').format("YYYY-MM-DD")
365
+         console.log("fourQuarterStart",fourQuarterStart)
366
+         const fourQuarterEnd = moment().month(3).endOf('month').format("YYYY-MM-DD")
367
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
368
+      }
369
+      //5月
370
+       if(month == 4){
371
+         const fourQuarterStart = moment().month(4).startOf('month').format("YYYY-MM-DD")
372
+         console.log("fourQuarterStart",fourQuarterStart)
373
+         const fourQuarterEnd = moment().month(4).endOf('month').format("YYYY-MM-DD")
374
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
375
+      }
376
+      //6月
377
+       if(month == 5){
378
+         const fourQuarterStart = moment().month(5).startOf('month').format("YYYY-MM-DD")
379
+         console.log("fourQuarterStart",fourQuarterStart)
380
+         const fourQuarterEnd = moment().month(5).endOf('month').format("YYYY-MM-DD")
381
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
382
+      }
383
+      //7月
384
+       if(month == 6){
385
+         const fourQuarterStart = moment().month(6).startOf('month').format("YYYY-MM-DD")
386
+         console.log("fourQuarterStart",fourQuarterStart)
387
+         const fourQuarterEnd = moment().month(6).endOf('month').format("YYYY-MM-DD")
388
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
389
+      }
390
+      //8月
391
+       if(month == 7){
392
+         const fourQuarterStart = moment().month(7).startOf('month').format("YYYY-MM-DD")
393
+         console.log("fourQuarterStart",fourQuarterStart)
394
+         const fourQuarterEnd = moment().month(7).endOf('month').format("YYYY-MM-DD")
395
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
396
+      }
397
+      //9月
398
+       if(month == 8){
399
+         const fourQuarterStart = moment().month(8).startOf('month').format("YYYY-MM-DD")
400
+         console.log("fourQuarterStart",fourQuarterStart)
401
+         const fourQuarterEnd = moment().month(8).endOf('month').format("YYYY-MM-DD")
402
+         this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
403
+      }
404
+      //10月
405
+       if(month == 9){
406
+         const fourQuarterStart = moment().month(9).startOf('month').format("YYYY-MM-DD")
407
+         console.log("fourQuarterStart",fourQuarterStart)
408
+         const fourQuarterEnd = moment().month(9).endOf('month').format("YYYY-MM-DD")
409
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
410
+      }
411
+      //11月
412
+       if(month == 10){
413
+         const fourQuarterStart = moment().month(10).startOf('month').format("YYYY-MM-DD")
414
+         console.log("fourQuarterStart",fourQuarterStart)
415
+         const fourQuarterEnd = moment().month(10).endOf('month').format("YYYY-MM-DD")
416
+         this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
417
+      }
418
+       //12月
419
+       if(month == 11){
420
+         const fourQuarterStart = moment().month(11).startOf('month').format("YYYY-MM-DD")
421
+         console.log("fourQuarterStart",fourQuarterStart)
422
+         const fourQuarterEnd = moment().month(11).endOf('month').format("YYYY-MM-DD")
423
+          this.getFirstQuarter(this.lapseto,fourQuarterStart,fourQuarterEnd)
424
+      }
425
+    },
426
+    getNormData(){
427
+      getNormData().then(response=>{
428
+         if(response.data.state === 1){
429
+           var normdata = response.data.data.normdata
430
+           console.log("normdata",normdata)
431
+           this.normData = normdata
432
+         }
433
+      })
434
+    },
435
+    //第一季度
436
+    getFirstQuarter(val,startime,endtime){
437
+       this.modesData.series = []
438
+       this.modesData.xAxis = []
439
+      getFirstQuarter(val,startime,endtime).then(response=>{
440
+         if(response.data.state === 1){
441
+            var count =  response.data.data.count
442
+            console.log("count",count)
443
+            var arr=[]
444
+            for(let i=0;i<count.length;i++){  
445
+               for(let j=0;j<this.normData.length;j++){
446
+                if(count[i].item_id == this.normData[j].inspection_minor){
447
+                     arr.push(count[i])
448
+                }
449
+              }
450
+            }
451
+            console.log("arr",arr)
452
+            var arrtwo =  this.arrayDate(count,this.normData)
453
+            for(let i=0;i<arrtwo.length;i++){
454
+                this.$set(arrtwo[i], 'Count', 0)
455
+              }
456
+           for(let i=0;i<arrtwo.length;i++){
457
+                this.$set(arrtwo[i], 'Total', 1)
458
+              }
459
+            arrtwo.map(item => {
460
+              arr.push(item)
461
+            })
462
+            arr.sort(this.compare('sort'))    
463
+            for(const key in this.normData ){
464
+               this.modesData.xAxis.push(this.normData[key].item_name);
465
+                if(key in arr){
466
+                    this.modesData.series.push(((parseInt(arr[key].Count)/parseInt(arr[key].Total))*100).toFixed(1));
467
+                } else {
468
+                 this.modesData.series.push(0);
469
+              }
470
+            }
471
+            this.chart.series[0].data = this.modesData.series
472
+            this.chart.xAxis.data = this.modesData.xAxis
473
+            console.log(2222,this.modesData)
474
+
475
+          
476
+         }
477
+      })
478
+    },
479
+   compare(property){
480
+        return function(a,b){
481
+            var value1 = a[property];
482
+            var value2 = b[property];
483
+            return value1 - value2;
484
+        }
485
+    },
486
+    arrayDate(array1,array2){
487
+        var array1 = array1;
488
+        var array2 = this.normData;
489
+        var result = [];
490
+        for(var i = 0; i < array2.length; i++){
491
+            var obj = array2[i];
492
+            var num = obj.inspection_minor;   //staff_id   就是要对比的key
493
+            var isExist = false;
494
+            for(var j = 0; j < array1.length; j++){
495
+                var aj = array1[j];
496
+                var n = aj.item_id;
497
+                if(n == num){
498
+                    isExist = true;
499
+                    break;
500
+             }
501
+            }
502
+            if(!isExist){
503
+                result.push(obj);
504
+            }
505
+        }
506
+        console.log("result",result)
507
+        return result;
508
+    },
509
+  },
510
+  created(){
511
+       //本月的开始时间
512
+      const firstQuarterStart =  moment().startOf('year').format('YYYY-MM-DD')
513
+    
514
+      const firstQuarterEnd = moment().month(2).endOf('month').format("YYYY-MM-DD")
515
+     
516
+     //获取指标正常范围值
517
+     this.getNormData()
518
+     this.getFirstQuarter(this.lapseto,firstQuarterStart,firstQuarterEnd)
318 519
   }
319 520
 };
320 521
 </script>

+ 3 - 0
src/xt_pages/qcd/patientAnalysis/dialysisAge.vue 파일 보기

@@ -246,9 +246,11 @@ export default {
246 246
           this.$message.error(response.data.msg);
247 247
           return false;
248 248
         } else {
249
+           
249 250
             this.tableData = [];
250 251
             this.total = response.data.data.total;
251 252
             var patients = response.data.data.patients;
253
+            console.log("patients---",patients)
252 254
             for (const index in patients) {
253 255
                 this.tableData.push(patients[index]);
254 256
             }
@@ -257,6 +259,7 @@ export default {
257 259
                 series:[],
258 260
             };
259 261
             var counts = response.data.data.counts;
262
+            console.log("counts",counts)
260 263
             var otherCount = 0;
261 264
             for (const index in counts) {
262 265
               if (counts[index].age in this.dialysisAgeMap) {

+ 13 - 1
src/xt_pages/qcd/patientComplianceDetails.vue 파일 보기

@@ -96,6 +96,7 @@
96 96
 import echarts from "echarts";
97 97
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
98 98
 import LineChart from "../qcd/components/LineChart";
99
+import { uParseTime } from "@/utils/tools";
99 100
 export default {
100 101
   components: {
101 102
     LineChart,
@@ -266,7 +267,18 @@ export default {
266 267
     },
267 268
     clickQuality(index) {
268 269
       this.quality = index;
269
-    }
270
+    },
271
+    handleSizeChange(limit) {
272
+      //this.limit = limit;
273
+      //this.getConfigurationList();
274
+    },
275
+    handleCurrentChange(page) {
276
+      //this.page = page;
277
+      //this.getConfigurationList();
278
+    },
279
+    getTime(time) {
280
+      return uParseTime(time, "{y}-{m}-{d}");
281
+    },
270 282
   }
271 283
 };
272 284
 </script>

+ 1 - 1
src/xt_pages/qcd/patientControlAnalysis.vue 파일 보기

@@ -59,7 +59,7 @@
59 59
           <p class="chartTitle">统计表</p>
60 60
         </div>
61 61
         <div>
62
-          <el-table :data="tableData" border style="width: 100%">
62
+          <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
63 63
             <el-table-column fixed prop="date" label="日期" width="150"></el-table-column>
64 64
             <el-table-column prop="name" label="姓名" width="120"></el-table-column>
65 65
             <el-table-column prop="province" label="省份" width="120"></el-table-column>

+ 24 - 11
src/xt_pages/qcd/statisticalConfiguration.vue 파일 보기

@@ -140,7 +140,7 @@ import { GetOICData } from "@/api/qcd";
140 140
 import PieChart from "../qcd/components/BarChart";
141 141
 import { uParseTime } from "@/utils/tools";
142 142
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
143
-import { getInspectionMajor,getInspectionMinor,getInspectionRange,saveConfiguration,getConfigurationList,getConfigurationDetail,getAllInspectionMinor,UpdateConfiguration,DeleteConfiguration }from "@/api/common/common";
143
+import { getInspectionMajor,getInspectionMinor,getInspectionRange,saveConfiguration,getConfigurationList,getConfigurationDetail,getAllInspectionMinor,UpdateConfiguration,DeleteConfiguration,getLastSort }from "@/api/common/common";
144 144
 export default {
145 145
   name: "dialysisTotal",
146 146
   data() {
@@ -196,7 +196,7 @@ export default {
196 196
       getConfigurationDetail(id).then(response=>{
197 197
          if(response.data.state == 1){
198 198
            var configurationdetail = response.data.data.configurationdetail
199
-           console.log("详情",configurationdetail)
199
+          // console.log("详情",configurationdetail)
200 200
            this.editform.id = configurationdetail.id
201 201
            this.editform.inspectionMajor = configurationdetail.inspection_major
202 202
            this.editform.inspectionMinor = configurationdetail.inspection_minor
@@ -216,7 +216,7 @@ export default {
216 216
       getInspectionMajor().then(response=>{
217 217
         if(response.data.state == 1){
218 218
           var inspection =  response.data.data.inspection
219
-          console.log("大项",inspection)
219
+          //console.log("大项",inspection)
220 220
           this.InspectionMajor = inspection
221 221
          
222 222
         }
@@ -227,7 +227,7 @@ export default {
227 227
       getInspectionMinor(id).then(response=>{
228 228
         if(response.data.state == 1){
229 229
          var inspection =  response.data.data.inspection
230
-         console.log("小项",inspection)
230
+        // console.log("小项",inspection)
231 231
          this.InspectionMinor = inspection
232 232
         }
233 233
       })
@@ -237,7 +237,7 @@ export default {
237 237
        getInspectionMinor(id).then(response=>{
238 238
         if(response.data.state == 1){
239 239
          var inspection =  response.data.data.inspection
240
-         console.log("小项",inspection)
240
+        // console.log("小项",inspection)
241 241
          this.InspectionMinorTwo = inspection
242 242
         }
243 243
       })
@@ -247,13 +247,14 @@ export default {
247 247
        getInspectionRange(id).then(response=>{
248 248
          if(response.data.state == 1){
249 249
            var inspectionRange =  response.data.data.inspectionRange
250
-           console.log("inspectionRange",inspectionRange)
250
+          // console.log("inspectionRange",inspectionRange)
251 251
            this.form.min_range = inspectionRange.range_min
252 252
            this.form.large_range = inspectionRange.range_max
253 253
          }
254 254
       })
255 255
     },
256 256
     saveInspection(formName){
257
+      
257 258
       this.$refs[formName].validate(valid=>{
258 259
         if(valid){
259 260
           saveConfiguration(this.form).then(response=>{
@@ -267,6 +268,7 @@ export default {
267 268
              this.form.min_range = ""
268 269
              this.form.sort = ""
269 270
              this.getConfigurationList()
271
+             this.getLastSort()
270 272
             }else{
271 273
              this.$message.error("检查小项已存在")
272 274
             }
@@ -291,10 +293,10 @@ export default {
291 293
               configurationlist[i].sort = ""
292 294
             }
293 295
           }
294
-          console.log("列表",configurationlist)
296
+          //console.log("列表",configurationlist)
295 297
           this.configuraData = configurationlist
296 298
           var total = response.data.data.total
297
-          console.log("total",total)
299
+         // console.log("total",total)
298 300
           this.total = total
299 301
         }
300 302
       })
@@ -305,7 +307,7 @@ export default {
305 307
         if(response.data.state == 1){
306 308
           var minor =  response.data.data.minor
307 309
           this.InspectionMinorTwo = minor
308
-          console.log("minor",minor)
310
+          //console.log("minor",minor)
309 311
         }
310 312
       })
311 313
     },
@@ -322,7 +324,7 @@ export default {
322 324
       UpdateConfiguration(this.editform.id,this.editform).then(response=>{
323 325
         if(response.data.state == 1){
324 326
          var standard =  response.data.data.standard
325
-         console.log("standard",standard)
327
+        // console.log("standard",standard)
326 328
          this.$message.success("保存成功")
327 329
          this.editDialog = false
328 330
          this.getConfigurationList()
@@ -345,12 +347,21 @@ export default {
345 347
         DeleteConfiguration(id,index).then(response => {
346 348
           if (response.data.state === 1) {
347 349
            var msg =  response.data.data.msg
348
-           console.log("msg",msg)
350
+          // console.log("msg",msg)
349 351
            this.configuraData.splice(index,1)
350 352
           }
351 353
         });
352 354
       });
353 355
     },
356
+    getLastSort(){
357
+      getLastSort().then(response=>{
358
+        if(response.data.state === 1){
359
+          var standard = response.data.data.standard
360
+         // console.log("standard",standard)
361
+          this.form.sort = standard.sort + 1+''
362
+        }
363
+      })
364
+    },
354 365
   },
355 366
   components: {
356 367
     PieChart,
@@ -363,6 +374,8 @@ export default {
363 374
     this.getConfigurationList()
364 375
     //获取所有小项的数据
365 376
     this.getAllInspectionMinor()
377
+    //获取排序值
378
+    this.getLastSort()
366 379
    },
367 380
 
368 381
 };

+ 286 - 175
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckAll.vue 파일 보기

@@ -7,14 +7,6 @@
7 7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
8 8
         </el-form-item>
9 9
       </el-form>
10
-      <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
11
-        <el-option
12
-          v-for="item in options"
13
-          :key="item.value"
14
-          :label="item.label"
15
-          :value="item.value"
16
-        ></el-option>
17
-      </el-select>
18 10
       <label class="title">
19 11
         <span class="name">日期查询</span> :
20 12
       </label>
@@ -47,20 +39,36 @@
47 39
     <el-container>
48 40
       <div style="width:150px">
49 41
         <div class="tableTitle">患者列表</div>
50
-        <el-table :data="tableData" border style="width: 100%;" height="500">
51
-          <el-table-column prop="date" label="日期" width="70"></el-table-column>
52
-          <el-table-column prop="name" label="姓名" width="80"></el-table-column>
42
+        <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
43
+        :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
44
+         highlight-current-row
45
+         @current-change="handleChange">
46
+           <el-table-column prop="dialysis_no" label="透析号" width="80">
47
+            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
48
+          </el-table-column>
49
+          <el-table-column prop="name" label="姓名" width="80">
50
+            <template slot-scope="scope">{{ scope.row.name }}</template>
51
+          </el-table-column>
53 52
         </el-table>
54 53
       </div>
55 54
       <div style="padding-left:10px;flex:1">
56 55
         <div class="tableTitle">统计表</div>
57
-        <el-table :data="tableData1" style="width: 100%" border>
58
-          <el-table-column fixed prop="date" label="日期"></el-table-column>
59
-          <el-table-column prop="name" label="姓名"></el-table-column>
60
-          <el-table-column prop="province" label="省份"></el-table-column>
61
-          <el-table-column prop="city" label="市区"></el-table-column>
62
-          <el-table-column prop="address" label="地址"></el-table-column>
63
-          <el-table-column prop="zip" label="邮编"></el-table-column>
56
+        <el-table :data="tableData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
57
+          <el-table-column prop="name" label="姓名" fixed>
58
+            <template slot-scope="scope">{{ scope.row.name}}</template>
59
+         </el-table-column>
60
+         <el-table-column
61
+          :label="modeItem.project_name"
62
+          property="number"
63
+          align="center"
64
+          min-width="100"
65
+          v-for="(modeItem, index) in tableName"
66
+          :key="index"
67
+        >
68
+          <template slot-scope="scope">
69
+              {{ scope.row.data[index].Count}}
70
+          </template>
71
+        </el-table-column>
64 72
         </el-table>
65 73
 
66 74
         <el-pagination
@@ -68,7 +76,7 @@
68 76
           @size-change="handleSizeChange"
69 77
           @current-change="handleCurrentChange"
70 78
           :current-page="listQuery.page"
71
-          :page-sizes="[10, 20, 50, 100]"
79
+          :page-sizes="[20, 40, 60, 80,100]"
72 80
           :page-size="10"
73 81
           background
74 82
           style="margin-top:20px;"
@@ -82,6 +90,7 @@
82 90
 
83 91
 
84 92
 <script>
93
+  import {getCurrentOrgPatients,getAllMajorInspection,getPatientList,getPatientDetailCheck,SearchDetailCheck } from "@/api/common/common"
85 94
 export default {
86 95
   data() {
87 96
     return {
@@ -89,167 +98,68 @@ export default {
89 98
         start_time: "",
90 99
         end_time: "",
91 100
         page: 1,
92
-        limit: 10
101
+        limit: 20
93 102
       },
94
-      options: [
95
-        {
96
-          value: "选项1",
97
-          label: "黄金糕"
98
-        },
99
-        {
100
-          value: "选项2",
101
-          label: "双皮奶"
102
-        },
103
-        {
104
-          value: "选项3",
105
-          label: "蚵仔煎"
106
-        },
107
-        {
108
-          value: "选项4",
109
-          label: "龙须面"
110
-        },
111
-        {
112
-          value: "选项5",
113
-          label: "北京烤鸭"
114
-        }
115
-      ],
116 103
       value: "请选项",
117
-      tableData: [
118
-        {
119
-          date: "2016",
120
-          name: "王小虎"
121
-        },
122
-        {
123
-          date: "2016",
124
-          name: "王小虎"
125
-        },
126
-        {
127
-          date: "2016",
128
-          name: "王小虎"
129
-        },
130
-        {
131
-          date: "2016",
132
-          name: "王小虎"
133
-        },
134
-        {
135
-          date: "2016",
136
-          name: "王小虎"
137
-        },
138
-        {
139
-          date: "2016",
140
-          name: "王小虎"
141
-        },
142
-        {
143
-          date: "2016",
144
-          name: "王小虎"
145
-        },
146
-        {
147
-          date: "2016",
148
-          name: "王小虎"
149
-        },
150
-        {
151
-          date: "2016",
152
-          name: "王小虎"
153
-        },
154
-        {
155
-          date: "2016",
156
-          name: "王小虎"
157
-        },
158
-        {
159
-          date: "2016",
160
-          name: "王小虎"
161
-        },
162
-        {
163
-          date: "2016",
164
-          name: "王小虎"
165
-        }
166
-      ],
167
-      tableData1: [
168
-        {
169
-          date: "2016-05-03",
170
-          name: "王小虎",
171
-          province: "上海",
172
-          city: "普陀区",
173
-          address: "上海市普陀区金沙江路 1518 弄",
174
-          zip: 200333
175
-        },
176
-        {
177
-          date: "2016-05-02",
178
-          name: "王小虎",
179
-          province: "上海",
180
-          city: "普陀区",
181
-          address: "上海市普陀区金沙江路 1518 弄",
182
-          zip: 200333
183
-        },
184
-        {
185
-          date: "2016-05-04",
186
-          name: "王小虎",
187
-          province: "上海",
188
-          city: "普陀区",
189
-          address: "上海市普陀区金沙江路 1518 弄",
190
-          zip: 200333
191
-        },
192
-        {
193
-          date: "2016-05-01",
194
-          name: "王小虎",
195
-          province: "上海",
196
-          city: "普陀区",
197
-          address: "上海市普陀区金沙江路 1518 弄",
198
-          zip: 200333
199
-        },
200
-        {
201
-          date: "2016-05-08",
202
-          name: "王小虎",
203
-          province: "上海",
204
-          city: "普陀区",
205
-          address: "上海市普陀区金沙江路 1518 弄",
206
-          zip: 200333
207
-        },
208
-        {
209
-          date: "2016-05-06",
210
-          name: "王小虎",
211
-          province: "上海",
212
-          city: "普陀区",
213
-          address: "上海市普陀区金沙江路 1518 弄",
214
-          zip: 200333
215
-        },
216
-        {
217
-          date: "2016-05-07",
218
-          name: "王小虎",
219
-          province: "上海",
220
-          city: "普陀区",
221
-          address: "上海市普陀区金沙江路 1518 弄",
222
-          zip: 200333
223
-        },
224
-        {
225
-          date: "2016-05-08",
226
-          name: "王小虎",
227
-          province: "上海",
228
-          city: "普陀区",
229
-          address: "上海市普陀区金沙江路 1518 弄",
230
-          zip: 200333
231
-        },
232
-        {
233
-          date: "2016-05-06",
234
-          name: "王小虎",
235
-          province: "上海",
236
-          city: "普陀区",
237
-          address: "上海市普陀区金沙江路 1518 弄",
238
-          zip: 200333
239
-        },
240
-        {
241
-          date: "2016-05-07",
242
-          name: "王小虎",
243
-          province: "上海",
244
-          city: "普陀区",
245
-          address: "上海市普陀区金沙江路 1518 弄",
246
-          zip: 200333
247
-        }
248
-      ]
104
+      tableData: [],
105
+      patientsData:[],
106
+      total:0,
107
+      tableName:[],
108
+      ObjectData:{},
249 109
     };
250 110
   },
251 111
   methods: {
252
-    changeTime() {},
112
+    handleDelete(index, row) {
113
+        console.log(index, row);
114
+      },
115
+    changeTime(val) {
116
+      var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
117
+      if (time > 0) {
118
+        this.$message.error("结束时间不能小于开始时间");
119
+        this.listQuery.start_time = "";
120
+      } else {
121
+        this.getPatientList()
122
+      }
123
+    },
124
+    onSearch(){
125
+      SearchDetailCheck(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
126
+          if(response.data.state === 1){
127
+           var  checkDetail =  response.data.data.checkDetail
128
+             var arr = []
129
+            for(let i=0;i<checkDetail.length;i++){
130
+              for(let j=0;j<this.tableName.length;j++){
131
+                 if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
132
+                   arr.push(checkDetail[i])
133
+                 }
134
+              }
135
+            }
136
+            // let projectArr = []
137
+            // this.newArr.map(item => {
138
+            //   projectArr.push(item.project_name)
139
+            // })
140
+            // console.log("projectArr",projectArr)
141
+            // projectArr.forEach((item,index) => {
142
+            //   if(!(arr[index] && item == arr[index].ProjectName)){
143
+            //     arr.splice(index,0,{Count:0, ProjectName: item,name: val.name})
144
+            //   }
145
+            // })
146
+            // this.tableData = []
147
+            // let obj = {}
148
+            // obj.name = val.name
149
+            // obj.data = arr
150
+            // this.tableData.push(obj)
151
+            console.log("arr",arr)
152
+          }
153
+      })
154
+    },
155
+     handleSizeChange(limit) {
156
+      this.listQuery.limit = limit;
157
+       this.getPatientList()
158
+    },
159
+    handleCurrentChange(page) {
160
+      this.listQuery.page = page;
161
+       this.getPatientList()
162
+    },
253 163
     changeEndTime(val) {
254 164
       var time =
255 165
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -257,8 +167,209 @@ export default {
257 167
         this.$message.error("结束时间不能小于开始时间");
258 168
         this.listQuery.end_time = "";
259 169
       } else {
170
+        this.getPatientList()
260 171
       }
172
+    },
173
+    //获取病人列表
174
+    getCurrentOrgPatients(){
175
+      getCurrentOrgPatients().then(response=>{
176
+         if(response.data.state === 1){
177
+            var patients = response.data.data.patients
178
+            this.patientsData = patients
179
+         }
180
+      })
181
+    },
182
+    //获取检验检查项目
183
+    getAllMajorInspection(){
184
+      getAllMajorInspection().then(response=>{
185
+        if(response.data.state === 1){
186
+           var inspection = response.data.data.inspection
187
+           console.log("inspection",inspection)
188
+           var a=[];
189
+           for(let i=0;i<inspection.length;i++){
190
+             a.push(inspection[i])
191
+           }
192
+           console.log("a",a)
193
+           this.newArr = a
194
+           var arr = this.arrayToObj(a)
195
+           
196
+           console.log("arr",arr)
197
+           this.ObjectData = arr
198
+           this.tableName = inspection
199
+        }
200
+      })
201
+    },
202
+    getPatientList(){
203
+      getPatientList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.limit,this.listQuery.page).then(response=>{
204
+         if(response.data.state === 1){
205
+           var patientInfo = response.data.data.patientInfo
206
+           console.log("列表数据2",patientInfo)
207
+
208
+           var total = response.data.data.total
209
+           console.log("total",total)
210
+           this.total = total
211
+          //  var arrlist = response.data.data.list
212
+          //   console.log("list",arrlist)
213
+          //   let listInfo = []
214
+          //  for(let i=0;i<arrlist.length;i++){
215
+          //    for(let j=0;j<this.tableName.length;j++){
216
+          //       if(arrlist[i].ProjectId == this.tableName[j].inspection_major){
217
+          //          listInfo.push(arrlist[i])
218
+          //       }
219
+          //    }
220
+          //  }
221
+          //   let dataInfo = {}
222
+          //   listInfo.forEach((item, index) => {
223
+          //     let { PatientId } = item
224
+          //     if (!dataInfo[PatientId]) {
225
+          //       dataInfo[PatientId] = {
226
+          //         PatientId,
227
+          //         name:item.name,
228
+          //         child: []
229
+          //       }
230
+          //     }
231
+          //   })
232
+          //   console.log("dataInfo",dataInfo)
233
+          //   let list = Object.values(dataInfo)
234
+          //   list.map(item => {
235
+          //     for (let i = 0; i < listInfo.length; i++) {
236
+          //       if (
237
+          //         item.PatientId === listInfo[i].PatientId
238
+          //       ) {
239
+          //         item.child.push(listInfo[i])
240
+          //       }
241
+          //     }
242
+          //   })
243
+          // var arrpatient = []
244
+          //  console.log("arr",list)
245
+          //    list.map(item => {
246
+          //     for (let i = 0; i < patientInfo.length; i++) {
247
+          //       if (
248
+          //         item.PatientId === patientInfo[i].patient_id
249
+          //       ) {
250
+          //          arrpatient.push(item)
251
+          //       }
252
+          //     }
253
+          //   })
254
+          // console.log("arrpatient",arrpatient)
255
+          //
256
+          // this.tableData = patientInfo
257
+
258
+
259
+
260
+          var list = response.data.data.list
261
+          console.log("list",list)
262
+          var dtd = []
263
+          for(let i=0;i<list.length;i++){
264
+              for(let j=0;j<this.tableName.length;j++){
265
+                  if(list[i].ProjectId == this.tableName[j].inspection_major){
266
+                    dtd.push(list[i])
267
+                  }
268
+              }
269
+          }
270
+          console.log("dtd",dtd)
271
+          var dd = {};
272
+           for (const index in dtd) {
273
+            if (!(dtd[index].name in dd)) {
274
+               dd[dtd[index].name] = {};
275
+            }
276
+            if (!(dtd[index].ProjectId in dd[dtd[index].name]) && dtd[index].ProjectId != 0) {
277
+              dd[dtd[index].name][dtd[index].ProjectName] = dtd[index];
278
+            }
279
+          }
280
+          console.log("ddd",dd)
281
+            for(const key in dd){
282
+              for(const mkey in this.ObjectData){
283
+                if (!(this.ObjectData[mkey].project_name in dd[key])) {
284
+                  dd[key][this.ObjectData[mkey].project_name] = {
285
+                    ProjectName: this.ObjectData[mkey].project_name,
286
+                    name: mkey,
287
+                    Count: 0
288
+                  };
289
+                }
290
+              }
291
+              this.tableData.push({ name: key, data: dd[key]});
292
+            }
293
+            console.log("表",this.tableData)
294
+            let projectArr = []
295
+            this.newArr.map(item => {
296
+              projectArr.push(item.project_name)
297
+            })
298
+            this.tableData.map(item => {
299
+              let arr = Object.values(item.data);
300
+              arr.sort((a,b)=>{
301
+                return projectArr.indexOf(a.ProjectName)-projectArr.indexOf(b.ProjectName);
302
+              });
303
+              item.data = arr
304
+            })
305
+         }
306
+      })
307
+    },
308
+    handleChange(val){
309
+      console.log(1111111111,val)
310
+      getPatientDetailCheck(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
311
+          if(response.data.state === 1){
312
+            var checkDetail =  response.data.data.checkDetail
313
+            console.log("checkDetail",checkDetail)
314
+            var arr = []
315
+            for(let i=0;i<checkDetail.length;i++){
316
+              for(let j=0;j<this.tableName.length;j++){
317
+                 if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
318
+                   arr.push(checkDetail[i])
319
+                 }
320
+              }
321
+            }
322
+            let projectArr = []
323
+            this.newArr.map(item => {
324
+              projectArr.push(item.project_name)
325
+            })
326
+            console.log("projectArr",projectArr)
327
+            projectArr.forEach((item,index) => {
328
+              if(!(arr[index] && item == arr[index].ProjectName)){
329
+                arr.splice(index,0,{Count:0, ProjectName: item,name: val.name})
330
+              }
331
+            })
332
+            this.tableData = []
333
+            let obj = {}
334
+            obj.name = val.name
335
+            obj.data = arr
336
+            this.tableData.push(obj)
337
+            this.total = 1
338
+            console.log("arr",this.tableData)
339
+          }
340
+      })
341
+    },
342
+   arrayToObj(arr){
343
+      return Object.assign({},arr);
261 344
     }
345
+  },
346
+  created(){
347
+     var nowDate = new Date();
348
+    var nowYear = nowDate.getFullYear();
349
+    var nowMonth = nowDate.getMonth() + 1;
350
+    var nowDay = nowDate.getDate();
351
+    this.listQuery.end_time =
352
+      nowYear +
353
+      "-" +
354
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
355
+      "-" +
356
+      (nowDay < 10 ? "0" + nowDay : nowDay);
357
+    nowDate.setMonth(nowDate.getMonth() - 3);
358
+    nowYear = nowDate.getFullYear();
359
+    nowMonth = nowDate.getMonth() + 1;
360
+    nowDay = nowDate.getDate();
361
+    this.listQuery.start_time =
362
+      nowYear +
363
+      "-" +
364
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
365
+      "-" +
366
+      (nowDay < 10 ? "0" + nowDay : nowDay);
367
+       //获取该机构下的所有患者
368
+     this.getCurrentOrgPatients()
369
+     //获取检验检查项目
370
+     this.getAllMajorInspection()
371
+     //获取列表数据
372
+     this.getPatientList()
262 373
   }
263 374
 };
264 375
 </script>

+ 232 - 105
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue 파일 보기

@@ -7,14 +7,6 @@
7 7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
8 8
         </el-form-item>
9 9
       </el-form>
10
-      <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
11
-        <el-option
12
-          v-for="item in options"
13
-          :key="item.value"
14
-          :label="item.label"
15
-          :value="item.value"
16
-        ></el-option>
17
-      </el-select>
18 10
       <label class="title">
19 11
         <span class="name">日期查询</span> :
20 12
       </label>
@@ -29,6 +21,7 @@
29 21
         align="right"
30 22
         format="yyyy-MM-dd"
31 23
         value-format="yyyy-MM-dd"
24
+        :picker-options="pickerOptions"
32 25
       ></el-date-picker>
33 26
       <span class>-</span>
34 27
       <el-date-picker
@@ -42,14 +35,24 @@
42 35
         align="right"
43 36
         format="yyyy-MM-dd"
44 37
         value-format="yyyy-MM-dd"
38
+        :picker-options="pickerOptions"
45 39
       ></el-date-picker>
46 40
     </div>
47 41
     <el-container>
48 42
       <div style="width:150px">
49 43
         <div class="tableTitle">患者列表</div>
50
-        <el-table :data="tableData" border style="width: 100%;" height="500">
51
-          <el-table-column prop="date" label="日期" width="70"></el-table-column>
52
-          <el-table-column prop="name" label="姓名" width="80"></el-table-column>
44
+        <el-table :data="patientsData" border style="width: 100%;" 
45
+          height="500" :row-style="{ color: '#303133' }" 
46
+          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
47
+          highlight-current-row
48
+          @current-change="handleChange"
49
+          >
50
+           <el-table-column prop="dialysis_no" label="透析号" width="80">
51
+            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
52
+          </el-table-column>
53
+          <el-table-column prop="name" label="姓名" width="80">
54
+            <template slot-scope="scope">{{ scope.row.name }}</template>
55
+          </el-table-column>
53 56
         </el-table>
54 57
       </div>
55 58
       <div style="padding-left:10px;flex:1">
@@ -66,6 +69,7 @@
66 69
 <script>
67 70
 import echarts from "echarts";
68 71
 import LineChart from "../../components/LineChart";
72
+import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
69 73
 export default {
70 74
   components: {
71 75
     LineChart
@@ -78,90 +82,17 @@ export default {
78 82
         page: 1,
79 83
         limit: 10
80 84
       },
81
-      options: [
82
-        {
83
-          value: "选项1",
84
-          label: "黄金糕"
85
-        },
86
-        {
87
-          value: "选项2",
88
-          label: "双皮奶"
89
-        },
90
-        {
91
-          value: "选项3",
92
-          label: "蚵仔煎"
93
-        },
94
-        {
95
-          value: "选项4",
96
-          label: "龙须面"
97
-        },
98
-        {
99
-          value: "选项5",
100
-          label: "北京烤鸭"
101
-        }
102
-      ],
103 85
       value: "请选项",
104
-      tableData: [
105
-        {
106
-          date: "2016",
107
-          name: "王小虎"
108
-        },
109
-        {
110
-          date: "2016",
111
-          name: "王小虎"
112
-        },
113
-        {
114
-          date: "2016",
115
-          name: "王小虎"
116
-        },
117
-        {
118
-          date: "2016",
119
-          name: "王小虎"
120
-        },
121
-        {
122
-          date: "2016",
123
-          name: "王小虎"
124
-        },
125
-        {
126
-          date: "2016",
127
-          name: "王小虎"
128
-        },
129
-        {
130
-          date: "2016",
131
-          name: "王小虎"
132
-        },
133
-        {
134
-          date: "2016",
135
-          name: "王小虎"
136
-        },
137
-        {
138
-          date: "2016",
139
-          name: "王小虎"
140
-        },
141
-        {
142
-          date: "2016",
143
-          name: "王小虎"
144
-        },
145
-        {
146
-          date: "2016",
147
-          name: "王小虎"
148
-        },
149
-        {
150
-          date: "2016",
151
-          name: "王小虎"
152
-        }
153
-      ],
86
+      patientsData:[],
87
+      tableData:[],
154 88
       chart: {
155
-        title: {
156
-          text: "ECharts 入门示例"
157
-        },
158 89
         tooltip: {},
159
-        legend: {
160
-          data: ["次数"],
161
-          left: 0
162
-        },
90
+        // legend: {
91
+        //   data: ["次数"],
92
+        //   left: 0
93
+        // },
163 94
         xAxis: {
164
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
95
+          data: []
165 96
         },
166 97
         yAxis: {
167 98
           axisLabel: {
@@ -173,23 +104,23 @@ export default {
173 104
           {
174 105
             name: "次数",
175 106
             type: "bar",
176
-            data: [
177
-              "78.57",
178
-              "50",
179
-              "80",
180
-              "93.33",
181
-              "92.86",
182
-              "100",
183
-              "12",
184
-              "77",
185
-              "37"
186
-            ],
107
+            data: [],
187 108
             barWidth: 30,
188 109
             label: {
189 110
               normal: {
190 111
                 show: true,
191 112
                 position: "top",
192
-                formatter: "{c}次"
113
+                formatter: (params) => {
114
+                  if(this.obj.length > 0){
115
+                      let str = ''
116
+                      str = params.data +'次' + '\n(参考值'+ this.obj[params.dataIndex] +'次)'
117
+                    return str
118
+                  }else{
119
+                    let str = ''
120
+                    str = params.data+'次'
121
+                    return str
122
+                  }
123
+                }
193 124
               }
194 125
             },
195 126
             //配置样式
@@ -236,7 +167,18 @@ export default {
236 167
             }
237 168
           }
238 169
         ]
239
-      }
170
+      },
171
+      pickerOptions: {
172
+        disabledDate(time) {
173
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
174
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
175
+        }
176
+      }, 
177
+      modesData: {
178
+        xAxis: [],
179
+        series: []
180
+      },
181
+      obj:[]
240 182
     };
241 183
   },
242 184
   methods: {
@@ -249,7 +191,192 @@ export default {
249 191
         this.listQuery.end_time = "";
250 192
       } else {
251 193
       }
252
-    }
194
+    },
195
+    getCurrentOrgPatients(){
196
+      getCurrentOrgPatients().then(response=>{
197
+         var patients = response.data.data.patients
198
+         this.patientsData = patients
199
+      })
200
+    },
201
+    getInspectionTotalCount(){
202
+          this.modesData.series = []
203
+          this.modesData.xAxis = []
204
+      getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time).then(response=>{
205
+          if(response.data.state === 1){
206
+            var Inspection = response.data.data.Inspection
207
+            console.log("Inspection",Inspection)
208
+            this.tableData = Inspection
209
+          
210
+            var counts = response.data.data.counts
211
+            console.log("counts",counts)
212
+            var arr = []
213
+            for(let i=0;i<Inspection.length;i++){
214
+               for(let j=0;j<counts.length;j++){
215
+                 if(Inspection[i].inspection_major == counts[j].ProjectId){
216
+                   arr.push(counts[j])
217
+                 }
218
+               }
219
+            }
220
+             console.log("arr",arr)
221
+             var arrtwo =  this.arrayDate(counts,this.normData)
222
+             console.log("arrtwo",arrtwo)
223
+            var hash = {};
224
+            var i = 0;
225
+            var res = [];
226
+            arr.forEach(function(item) {
227
+             var ProjectName = item.ProjectName;
228
+             hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
229
+                 Count: [item.Count],
230
+                 ProjectName: ProjectName,
231
+                 ProjectId: item.ProjectId,
232
+                 Sort:item.Sort,
233
+             })
234
+            });
235
+            
236
+            res.map(item => {
237
+             item.Count = eval(item.Count.join('+'))
238
+            })
239
+            console.log(11111,res)
240
+            let arr1 = []
241
+            this.tableData.map(it => {
242
+              arr1.push(it.project_name)
243
+            })
244
+
245
+            arr1.forEach((item,index)=>{
246
+              if(!(res[index] && item ==res[index].ProjectName)){
247
+                res.splice(index,0,{Count:0, ProjectName: item, Sort: index+1})
248
+              }
249
+            })
250
+            res.map(item => {
251
+              this.modesData.series.push(parseInt(item.Count));
252
+            })
253
+
254
+
255
+            for (const key in this.tableData) {
256
+              this.modesData.xAxis.push(this.tableData[key].project_name);
257
+              // if (key in res) {
258
+                
259
+              //   this.modesData.series.push(parseInt(res[key].Count));
260
+              //   // batotal += parseInt(res[key].Count);
261
+              // } else {
262
+              //   this.modesData.series.push(0);
263
+              // }
264
+            }
265
+
266
+
267
+            
268
+            this.chart.series[0].data = this.modesData.series
269
+            this.chart.xAxis.data = this.modesData.xAxis
270
+            console.log(2222,this.modesData)
271
+          }
272
+      })
273
+    },
274
+
275
+    //获取单个病人数据
276
+    handleChange(val){
277
+      this.modesData.series = []
278
+      this.modesData.xAxis = []
279
+       getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
280
+          if(response.data.state === 1){
281
+            var patientdetail = response.data.data.patientdetail
282
+            console.log("patientdetail",patientdetail)
283
+            var arr=[]
284
+            for(let i=0;i<this.tableData.length;i++){
285
+              for(let j=0;j<patientdetail.length;j++){
286
+                 if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
287
+                    arr.push(patientdetail[j])
288
+                 }
289
+              }
290
+            }
291
+            console.log("arr",arr)
292
+           let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
293
+           let day = parseInt(time / (1000 * 60 * 60 * 24))
294
+           console.log("time",parseInt(time / (1000 * 60 * 60 * 24)))
295
+            for (const key in this.tableData) {
296
+              this.modesData.xAxis.push(this.tableData[key].project_name);
297
+              if (key in arr) {
298
+                this.modesData.series.push(parseInt(arr[key].Count));
299
+                this.obj.push(Math.round(day / arr[key].InspectionFrequency))
300
+                // batotal += parseInt(res[key].Count);
301
+              } else {
302
+                this.modesData.series.push(0);
303
+                this.obj.push(0)
304
+              }
305
+            }
306
+            this.chart.series[0].data = this.modesData.series
307
+            this.chart.xAxis.data = this.modesData.xAxis
308
+          }
309
+       })
310
+    },
311
+
312
+    //搜索功能
313
+    onSearch(){
314
+      getSearchPatientInfo(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
315
+         if(response.data.state  === 1){
316
+           var PatientsInfo = response.data.data.PatientsInfo
317
+           console.log("PatientsInfo",PatientsInfo)
318
+           var arr = []
319
+           for(let i=0;i<this.tableData.length;i++){
320
+             for(let j=0;j<PatientsInfo.length;j++){
321
+                 if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
322
+                    arr.push(PatientsInfo[j])
323
+                 }
324
+             }
325
+           }
326
+           console.log("arr",arr)
327
+         }
328
+      })
329
+    },
330
+    arrayDate(array1,array2){
331
+        var array1 = array1;
332
+        var array2 = this.tableData;
333
+        var result = [];
334
+        for(var i = 0; i < array2.length; i++){
335
+            var obj = array2[i];
336
+            var num = obj.inspection_major;   //staff_id   就是要对比的key
337
+            var isExist = false;
338
+            for(var j = 0; j < array1.length; j++){
339
+                var aj = array1[j];
340
+                var n = aj.ProjectId;
341
+                if(n == num){
342
+                    isExist = true;
343
+                    break;
344
+             }
345
+            }
346
+            if(!isExist){
347
+                result.push(obj);
348
+            }
349
+        }
350
+        console.log("result",result)
351
+        return result;
352
+    },
353
+  },
354
+  created(){
355
+    var nowDate = new Date();
356
+    var nowYear = nowDate.getFullYear();
357
+    var nowMonth = nowDate.getMonth() + 1;
358
+    var nowDay = nowDate.getDate();
359
+    this.listQuery.end_time =
360
+      nowYear +
361
+      "-" +
362
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
363
+      "-" +
364
+      (nowDay < 10 ? "0" + nowDay : nowDay);
365
+    nowDate.setMonth(nowDate.getMonth() - 3);
366
+    nowYear = nowDate.getFullYear();
367
+    nowMonth = nowDate.getMonth() + 1;
368
+    nowDay = nowDate.getDate();
369
+    this.listQuery.start_time =
370
+      nowYear +
371
+      "-" +
372
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
373
+      "-" +
374
+      (nowDay < 10 ? "0" + nowDay : nowDay);
375
+
376
+   //获取该机构下的所有患者
377
+     this.getCurrentOrgPatients()
378
+   //获取检验检查项目
379
+    this.getInspectionTotalCount()
253 380
   }
254 381
 };
255 382
 </script>

+ 225 - 130
src/xt_pages/qcd/treatmentControlAnalysis/components/TimeAll.vue 파일 보기

@@ -2,10 +2,10 @@
2 2
   <div class="page_timeAll">
3 3
     <div class="cell clearfix">
4 4
       <el-select
5
-        v-model="value"
5
+        v-model="listQuery.value"
6 6
         placeholder="请选择"
7
-        @change="chooseType"
8 7
         style="width:120px;margin-right:20px"
8
+        @change="selectChange"
9 9
       >
10 10
         <el-option
11 11
           v-for="item in options"
@@ -28,6 +28,7 @@
28 28
         align="right"
29 29
         format="yyyy-MM-dd"
30 30
         value-format="yyyy-MM-dd"
31
+        :picker-options="pickerOptions"
31 32
       ></el-date-picker>
32 33
       <span class>-</span>
33 34
       <el-date-picker
@@ -41,6 +42,7 @@
41 42
         align="right"
42 43
         format="yyyy-MM-dd"
43 44
         value-format="yyyy-MM-dd"
45
+        :picker-options="pickerOptions"
44 46
       ></el-date-picker>
45 47
     </div>
46 48
     <div class="tableTitle">统计图</div>
@@ -49,13 +51,35 @@
49 51
     </div>
50 52
     <div class="tableTitle">统计表</div>
51 53
     <div>
52
-      <el-table :data="tableData" style="width: 100%" border>
53
-        <el-table-column fixed prop="date" label="日期"></el-table-column>
54
-        <el-table-column prop="name" label="姓名"></el-table-column>
55
-        <el-table-column prop="province" label="省份"></el-table-column>
56
-        <el-table-column prop="city" label="市区"></el-table-column>
57
-        <el-table-column prop="address" label="地址"></el-table-column>
58
-        <el-table-column prop="zip" label="邮编"></el-table-column>
54
+      <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
55
+        <el-table-column
56
+          fixed
57
+          label="日期"
58
+          width="100"
59
+          property="date"
60
+          align="center"
61
+        ></el-table-column>
62
+
63
+        <el-table-column
64
+          :label="modeItem.name"
65
+          property="number"
66
+          align="center"
67
+          min-width="100"
68
+          v-for="(modeItem, index) in activeModes"
69
+          :key="index"
70
+        >
71
+          <template slot-scope="scope">
72
+            {{ scope.row.data[modeItem.id].number ? scope.row.data[modeItem.id].number : "" }}
73
+          </template>
74
+        </el-table-column>
75
+
76
+        <el-table-column
77
+          fixed="right"
78
+          label="总次数"
79
+          width="80"
80
+          property="total"
81
+          align="center"
82
+        ></el-table-column>
59 83
       </el-table>
60 84
 
61 85
       <el-pagination
@@ -63,7 +87,7 @@
63 87
         @size-change="handleSizeChange"
64 88
         @current-change="handleCurrentChange"
65 89
         :current-page="listQuery.page"
66
-        :page-sizes="[10, 20, 50, 100]"
90
+        :page-sizes="[20, 40, 60, 80,100]"
67 91
         :page-size="10"
68 92
         background
69 93
         style="margin-top:20px;"
@@ -77,134 +101,35 @@
77 101
 <script>
78 102
 import echarts from "echarts";
79 103
 import LineChart from "../../components/LineChart";
104
+import {geStatistics} from "@/api/common/common"
80 105
 export default {
81 106
   components: {
82 107
     LineChart
83 108
   },
84 109
   data() {
85 110
     return {
86
-      listQuery: {
87
-        start_time: "",
88
-        end_time: "",
89
-        page: 1,
90
-        limit: 10
91
-      },
92 111
       options: [
93 112
         {
94
-          value: "选项1",
95
-          label: "黄金糕"
96
-        },
97
-        {
98
-          value: "选项2",
99
-          label: "双皮奶"
100
-        },
101
-        {
102
-          value: "选项3",
103
-          label: "蚵仔煎"
104
-        },
105
-        {
106
-          value: "选项4",
107
-          label: "龙须面"
108
-        },
109
-        {
110
-          value: "选项5",
111
-          label: "北京烤鸭"
112
-        }
113
-      ],
114
-      value: "请选项",
115
-      tableData: [
116
-        {
117
-          date: "2016-05-03",
118
-          name: "王小虎",
119
-          province: "上海",
120
-          city: "普陀区",
121
-          address: "上海市普陀区金沙江路 1518 弄",
122
-          zip: 200333
123
-        },
124
-        {
125
-          date: "2016-05-02",
126
-          name: "王小虎",
127
-          province: "上海",
128
-          city: "普陀区",
129
-          address: "上海市普陀区金沙江路 1518 弄",
130
-          zip: 200333
131
-        },
132
-        {
133
-          date: "2016-05-04",
134
-          name: "王小虎",
135
-          province: "上海",
136
-          city: "普陀区",
137
-          address: "上海市普陀区金沙江路 1518 弄",
138
-          zip: 200333
139
-        },
140
-        {
141
-          date: "2016-05-01",
142
-          name: "王小虎",
143
-          province: "上海",
144
-          city: "普陀区",
145
-          address: "上海市普陀区金沙江路 1518 弄",
146
-          zip: 200333
113
+          value: 0,
114
+          label: "全部"
147 115
         },
148 116
         {
149
-          date: "2016-05-08",
150
-          name: "王小虎",
151
-          province: "上海",
152
-          city: "普陀区",
153
-          address: "上海市普陀区金沙江路 1518 弄",
154
-          zip: 200333
117
+          value: 1,
118
+          label: "留治"
155 119
         },
156 120
         {
157
-          date: "2016-05-06",
158
-          name: "王小虎",
159
-          province: "上海",
160
-          city: "普陀区",
161
-          address: "上海市普陀区金沙江路 1518 弄",
162
-          zip: 200333
121
+          value: 2,
122
+          label: "转出"
163 123
         },
164
-        {
165
-          date: "2016-05-07",
166
-          name: "王小虎",
167
-          province: "上海",
168
-          city: "普陀区",
169
-          address: "上海市普陀区金沙江路 1518 弄",
170
-          zip: 200333
171
-        },
172
-        {
173
-          date: "2016-05-08",
174
-          name: "王小虎",
175
-          province: "上海",
176
-          city: "普陀区",
177
-          address: "上海市普陀区金沙江路 1518 弄",
178
-          zip: 200333
179
-        },
180
-        {
181
-          date: "2016-05-06",
182
-          name: "王小虎",
183
-          province: "上海",
184
-          city: "普陀区",
185
-          address: "上海市普陀区金沙江路 1518 弄",
186
-          zip: 200333
187
-        },
188
-        {
189
-          date: "2016-05-07",
190
-          name: "王小虎",
191
-          province: "上海",
192
-          city: "普陀区",
193
-          address: "上海市普陀区金沙江路 1518 弄",
194
-          zip: 200333
195
-        }
196 124
       ],
197 125
       chart: {
198
-        title: {
199
-          text: "ECharts 入门示例"
200
-        },
201 126
         tooltip: {},
202 127
         legend: {
203
-          data: ["次"],
128
+          data: ["次"],
204 129
           left: 0
205 130
         },
206 131
         xAxis: {
207
-          data: ["达标", "未达标"]
132
+          data: []
208 133
         },
209 134
         yAxis: {
210 135
           axisLabel: {
@@ -214,9 +139,9 @@ export default {
214 139
         },
215 140
         series: [
216 141
           {
217
-            name: "次",
142
+            name: "次",
218 143
             type: "bar",
219
-            data: ["78.57", "50"],
144
+            data: [],
220 145
             barWidth: 30,
221 146
             label: {
222 147
               normal: {
@@ -235,8 +160,14 @@ export default {
235 160
                   //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
236 161
                   var colorList = [
237 162
                     ["#A9E0F3", "#9FBDFC"],
238
-
239
-                    ["#FFD7C0", "#FF9994"]
163
+                    ["#A9E0F3", "#9FBDFC"],
164
+                    ["#A9E0F3", "#9FBDFC"],
165
+                    ["#FFD7C0", "#FF9994"],
166
+                    ["#FFD7C0", "#FF9994"],
167
+                    ["#FFD7C0", "#FF9994"],
168
+                    ["#D7C3FD", "#B3A8F7"],
169
+                    ["#D7C3FD", "#B3A8F7"],
170
+                    ["#D7C3FD", "#B3A8F7"]
240 171
                   ];
241 172
 
242 173
                   var index = params.dataIndex;
@@ -254,19 +185,49 @@ export default {
254 185
               },
255 186
 
256 187
               //鼠标悬停时:
257
-              emphasis: {
258
-                shadowBlur: 10,
259
-                shadowOffsetX: 0,
260
-                shadowColor: "rgba(0, 0, 0, 0.5)"
261
-              }
188
+              // emphasis: {
189
+              //   shadowBlur: 10,
190
+              //   shadowOffsetX: 0,
191
+              //   shadowColor: "rgba(0, 0, 0, 0.5)"
192
+              // }
262 193
             }
263 194
           }
264 195
         ]
265
-      }
196
+      },
197
+      modeOptions:[],
198
+      total:0,
199
+      listQuery: {
200
+        start_time: "",
201
+        end_time: "",
202
+        page: 1,
203
+        limit: 20,
204
+        value: 0,
205
+        mode_id:"",
206
+      },
207
+      tableData:[],
208
+      modesData: {
209
+        xAxis: [],
210
+        series: []
211
+      },
212
+      pickerOptions: {
213
+        disabledDate(time) {
214
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
215
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
216
+        }
217
+      },
266 218
     };
267 219
   },
268 220
   methods: {
269
-    changeTime() {},
221
+    changeTime(val) {
222
+      var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
223
+      if (time > 0) {
224
+        this.$message.error("结束时间不能小于开始时间");
225
+        this.listQuery.start_time = "";
226
+      } else {
227
+        this.geStatistics()
228
+      }
229
+
230
+    },
270 231
     changeEndTime(val) {
271 232
       var time =
272 233
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -274,9 +235,138 @@ export default {
274 235
         this.$message.error("结束时间不能小于开始时间");
275 236
         this.listQuery.end_time = "";
276 237
       } else {
238
+        this.geStatistics()
277 239
       }
240
+    },
241
+    getTimestamp(time) {
242
+      // 把时间日期转成时间戳
243
+      return new Date(time).getTime() / 1000;
244
+    },
245
+    handleSizeChange(limit) {
246
+      this.listQuery.limit = limit;
247
+      this.geStatistics();
248
+    },
249
+    handleCurrentChange(page) {
250
+      this.listQuery.page = page;
251
+      this.geStatistics();
252
+    },
253
+   selectChange(val){
254
+     this.listQuery.value =val
255
+     this.geStatistics()
256
+   },
257
+    geStatistics(){
258
+      this.modesData.series = []
259
+      this.modesData.xAxis = []
260
+      geStatistics(this.listQuery).then(response=>{
261
+        if(response.data.state === 1){
262
+          var dtd =  response.data.data.statistics
263
+        //  console.log("dtd",dtd)
264
+          var dd = {};
265
+          for (const index in dtd) {
266
+            if (!(dtd[index].date in dd)) {
267
+               dd[dtd[index].date] = {};
268
+            }
269
+            if (!(dtd[index].mode_id in dd[dtd[index].date]) && dtd[index].mode_id != "0") {
270
+              dd[dtd[index].date][dtd[index].mode_id] = dtd[index];
271
+            }
272
+          }
273
+          console.log("ddd",dd)
274
+          for (const key in dd) {
275
+            var total = 0;
276
+            for (const mkey in this.modeOptions) {
277
+              if (mkey in dd[key]) {
278
+                dd[key][mkey].mode = this.modeOptions[mkey].name;
279
+                var number = parseInt(dd[key][mkey].number);
280
+                if (isNaN(number) || number == 0) {
281
+                  dd[key][mkey].number = "";
282
+                  number = 0;
283
+                }
284
+                total += number;
285
+              } else {
286
+                dd[key][mkey] = {
287
+                  mode: this.modeOptions[mkey].name,
288
+                  mode_id: mkey,
289
+                  number: 0
290
+                };
291
+              }
292
+            }
293
+            this.tableData.push({ date: key, data: dd[key], total: total });
294
+          }
295
+          console.log("tabledata",this.tableData)
296
+          var ttd = response.data.data.ttd
297
+         // console.log("ttd",ttd)
298
+          var modeMap = {};
299
+          var batotal = 0;
300
+          for (const index in ttd) {
301
+            if (ttd[index].mode_id == "0") {
302
+              continue;
303
+            }
304
+            modeMap[ttd[index].mode_id] = ttd[index];
305
+          }
306
+         // console.log(111,modeMap)
307
+          for (const key in this.modeOptions) {
308
+            this.modesData.xAxis.push(this.modeOptions[key].name);
309
+            if (key in modeMap) {
310
+              this.modesData.series.push(parseInt(modeMap[key].number));
311
+              batotal += parseInt(modeMap[key].number);
312
+            } else {
313
+              this.modesData.series.push(0);
314
+            }
315
+          }
316
+
317
+          this.chart.series[0].data = this.modesData.series
318
+          this.chart.xAxis.data = this.modesData.xAxis
319
+         // console.log(this.chart.series[0].data)
320
+         // console.log(this.chart.xAxis.data)
321
+
322
+          this.total =  response.data.data.total
323
+         // console.log("total",this.total)
324
+
325
+        }
326
+      })
327
+    },
328
+ 
329
+  },
330
+  created(){
331
+    this.modeOptions = this.$store.getters.treatment_mode;
332
+    console.log("-----",this.modeOptions)
333
+    var nowDate = new Date();
334
+    var nowYear = nowDate.getFullYear();
335
+    var nowMonth = nowDate.getMonth() + 1;
336
+    var nowDay = nowDate.getDate();
337
+    this.listQuery.end_time =
338
+      nowYear +
339
+      "-" +
340
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
341
+      "-" +
342
+      (nowDay < 10 ? "0" + nowDay : nowDay);
343
+    nowDate.setMonth(nowDate.getMonth() - 3);
344
+    nowYear = nowDate.getFullYear();
345
+    nowMonth = nowDate.getMonth() + 1;
346
+    nowDay = nowDate.getDate();
347
+    this.listQuery.start_time =
348
+      nowYear +
349
+      "-" +
350
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
351
+      "-" +
352
+      (nowDay < 10 ? "0" + nowDay : nowDay);
353
+      //获取统计列表数据
354
+      this.geStatistics()
355
+      console.log("activeModes",this.activeModes)
356
+  },
357
+  computed: {
358
+    activeModes: function() {
359
+      var modes = [];
360
+      for (const key in this.modeOptions) {
361
+        if (this.listQuery.mode_id == key || this.listQuery.mode_id == "") {
362
+          modes.push(this.modeOptions[key]);
363
+        }
364
+      }
365
+
366
+      return modes;
367
+
278 368
     }
279
-  }
369
+  },
280 370
 };
281 371
 </script>
282 372
 
@@ -294,5 +384,10 @@ export default {
294 384
   .cell {
295 385
     text-align: center;
296 386
   }
387
+  .el-table{
388
+    ::-webkit-scrollbar{
389
+      height: 15px;
390
+    }
391
+  }
297 392
 }
298 393
 </style>

+ 359 - 174
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue 파일 보기

@@ -7,14 +7,6 @@
7 7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
8 8
         </el-form-item>
9 9
       </el-form>
10
-      <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
11
-        <el-option
12
-          v-for="item in options"
13
-          :key="item.value"
14
-          :label="item.label"
15
-          :value="item.value"
16
-        ></el-option>
17
-      </el-select>
18 10
       <label class="title">
19 11
         <span class="name">日期查询</span> :
20 12
       </label>
@@ -29,6 +21,7 @@
29 21
         align="right"
30 22
         format="yyyy-MM-dd"
31 23
         value-format="yyyy-MM-dd"
24
+        :picker-options="pickerOptions"
32 25
       ></el-date-picker>
33 26
       <span class>-</span>
34 27
       <el-date-picker
@@ -42,25 +35,48 @@
42 35
         align="right"
43 36
         format="yyyy-MM-dd"
44 37
         value-format="yyyy-MM-dd"
38
+        :picker-options="pickerOptions"
45 39
       ></el-date-picker>
46 40
     </div>
47 41
     <el-container>
48 42
       <div style="width:150px">
49 43
         <div class="tableTitle">患者列表</div>
50
-        <el-table :data="tableData" border style="width: 100%;" height="500">
51
-          <el-table-column prop="date" label="日期" width="70"></el-table-column>
52
-          <el-table-column prop="name" label="姓名" width="80"></el-table-column>
44
+        <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
45
+         :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
46
+          highlight-current-row
47
+          @current-change="handleChange">
48
+          <el-table-column prop="dialysis_no" label="透析号" width="80">
49
+            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
50
+          </el-table-column>
51
+          <el-table-column prop="name" label="姓名" width="80">
52
+            <template slot-scope="scope">{{ scope.row.name }}</template>
53
+          </el-table-column>
53 54
         </el-table>
54 55
       </div>
55 56
       <div style="padding-left:10px;flex:1">
56 57
         <div class="tableTitle">统计表</div>
57
-        <el-table :data="tableData1" style="width: 100%" border>
58
-          <el-table-column fixed prop="date" label="日期"></el-table-column>
59
-          <el-table-column prop="name" label="姓名"></el-table-column>
60
-          <el-table-column prop="province" label="省份"></el-table-column>
61
-          <el-table-column prop="city" label="市区"></el-table-column>
62
-          <el-table-column prop="address" label="地址"></el-table-column>
63
-          <el-table-column prop="zip" label="邮编"></el-table-column>
58
+        <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }" 
59
+        :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
60
+        >
61
+          <el-table-column prop="name" label="姓名" width="140">
62
+            <!-- <template slot-scope="scope">{{ scope.row.name }}</template> -->
63
+          </el-table-column>
64
+          <el-table-column  label="年龄" width="140">
65
+             <template slot-scope="scope">{{ getAge(scope.row.id_card_no) }}</template>
66
+          </el-table-column>
67
+          <el-table-column prop="dialysis_no" label="透析号" width="140">
68
+              <!-- <template slot-scope="scope">{{ scope.row.dialysis_no }}</template> -->
69
+          </el-table-column>
70
+          <el-table-column prop="mode_id" label="透析模式">
71
+              <template slot-scope="scope">
72
+                <span>{{ scope.row.mode_id.join("、") }}</span>
73
+              </template>
74
+           </el-table-column>
75
+          <el-table-column prop="address" label="透析总次数" width="140">
76
+            <template slot-scope="scope">
77
+                <span>{{ scope.row.total_dialysis + scope.row.user_sys_before_count }}</span>
78
+              </template>
79
+          </el-table-column>
64 80
         </el-table>
65 81
 
66 82
         <el-pagination
@@ -68,7 +84,7 @@
68 84
           @size-change="handleSizeChange"
69 85
           @current-change="handleCurrentChange"
70 86
           :current-page="listQuery.page"
71
-          :page-sizes="[10, 20, 50, 100]"
87
+          :page-sizes="[20, 40, 60, 80, 100]"
72 88
           :page-size="10"
73 89
           background
74 90
           style="margin-top:20px;"
@@ -82,6 +98,8 @@
82 98
 
83 99
 
84 100
 <script>
101
+ import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById,getPrescriptionByName } from "@/api/common/common";
102
+ import { uParseTime } from "@/utils/tools";
85 103
 export default {
86 104
   data() {
87 105
     return {
@@ -89,167 +107,36 @@ export default {
89 107
         start_time: "",
90 108
         end_time: "",
91 109
         page: 1,
92
-        limit: 10
110
+        limit: 20
93 111
       },
94
-      options: [
95
-        {
96
-          value: "选项1",
97
-          label: "黄金糕"
98
-        },
99
-        {
100
-          value: "选项2",
101
-          label: "双皮奶"
102
-        },
103
-        {
104
-          value: "选项3",
105
-          label: "蚵仔煎"
106
-        },
107
-        {
108
-          value: "选项4",
109
-          label: "龙须面"
110
-        },
111
-        {
112
-          value: "选项5",
113
-          label: "北京烤鸭"
114
-        }
115
-      ],
112
+      total:0,
113
+      options: [],
116 114
       value: "请选项",
117
-      tableData: [
118
-        {
119
-          date: "2016",
120
-          name: "王小虎"
121
-        },
122
-        {
123
-          date: "2016",
124
-          name: "王小虎"
125
-        },
126
-        {
127
-          date: "2016",
128
-          name: "王小虎"
129
-        },
130
-        {
131
-          date: "2016",
132
-          name: "王小虎"
133
-        },
134
-        {
135
-          date: "2016",
136
-          name: "王小虎"
137
-        },
138
-        {
139
-          date: "2016",
140
-          name: "王小虎"
141
-        },
142
-        {
143
-          date: "2016",
144
-          name: "王小虎"
145
-        },
146
-        {
147
-          date: "2016",
148
-          name: "王小虎"
149
-        },
150
-        {
151
-          date: "2016",
152
-          name: "王小虎"
153
-        },
154
-        {
155
-          date: "2016",
156
-          name: "王小虎"
157
-        },
158
-        {
159
-          date: "2016",
160
-          name: "王小虎"
161
-        },
162
-        {
163
-          date: "2016",
164
-          name: "王小虎"
165
-        }
166
-      ],
167
-      tableData1: [
168
-        {
169
-          date: "2016-05-03",
170
-          name: "王小虎",
171
-          province: "上海",
172
-          city: "普陀区",
173
-          address: "上海市普陀区金沙江路 1518 弄",
174
-          zip: 200333
175
-        },
176
-        {
177
-          date: "2016-05-02",
178
-          name: "王小虎",
179
-          province: "上海",
180
-          city: "普陀区",
181
-          address: "上海市普陀区金沙江路 1518 弄",
182
-          zip: 200333
183
-        },
184
-        {
185
-          date: "2016-05-04",
186
-          name: "王小虎",
187
-          province: "上海",
188
-          city: "普陀区",
189
-          address: "上海市普陀区金沙江路 1518 弄",
190
-          zip: 200333
191
-        },
192
-        {
193
-          date: "2016-05-01",
194
-          name: "王小虎",
195
-          province: "上海",
196
-          city: "普陀区",
197
-          address: "上海市普陀区金沙江路 1518 弄",
198
-          zip: 200333
199
-        },
200
-        {
201
-          date: "2016-05-08",
202
-          name: "王小虎",
203
-          province: "上海",
204
-          city: "普陀区",
205
-          address: "上海市普陀区金沙江路 1518 弄",
206
-          zip: 200333
207
-        },
208
-        {
209
-          date: "2016-05-06",
210
-          name: "王小虎",
211
-          province: "上海",
212
-          city: "普陀区",
213
-          address: "上海市普陀区金沙江路 1518 弄",
214
-          zip: 200333
215
-        },
216
-        {
217
-          date: "2016-05-07",
218
-          name: "王小虎",
219
-          province: "上海",
220
-          city: "普陀区",
221
-          address: "上海市普陀区金沙江路 1518 弄",
222
-          zip: 200333
223
-        },
224
-        {
225
-          date: "2016-05-08",
226
-          name: "王小虎",
227
-          province: "上海",
228
-          city: "普陀区",
229
-          address: "上海市普陀区金沙江路 1518 弄",
230
-          zip: 200333
231
-        },
232
-        {
233
-          date: "2016-05-06",
234
-          name: "王小虎",
235
-          province: "上海",
236
-          city: "普陀区",
237
-          address: "上海市普陀区金沙江路 1518 弄",
238
-          zip: 200333
239
-        },
240
-        {
241
-          date: "2016-05-07",
242
-          name: "王小虎",
243
-          province: "上海",
244
-          city: "普陀区",
245
-          address: "上海市普陀区金沙江路 1518 弄",
246
-          zip: 200333
115
+      tableData: [],
116
+      DialysisData: [],
117
+      patientsData:[],
118
+      prescriptionList:[],
119
+      limit:1000,
120
+      page:1,
121
+      pickerOptions: {
122
+        disabledDate(time) {
123
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
124
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
247 125
         }
248
-      ]
126
+      }, 
249 127
     };
250 128
   },
251 129
   methods: {
252
-    changeTime() {},
130
+    changeTime(val) {
131
+       var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
132
+      if (time > 0) {
133
+        this.$message.error("结束时间不能小于开始时间");
134
+        this.listQuery.start_time = "";
135
+      } else {
136
+        this.getDialysisList()
137
+      }
138
+      
139
+    },
253 140
     changeEndTime(val) {
254 141
       var time =
255 142
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -257,8 +144,306 @@ export default {
257 144
         this.$message.error("结束时间不能小于开始时间");
258 145
         this.listQuery.end_time = "";
259 146
       } else {
147
+        this.getDialysisList()
148
+      }
149
+    },
150
+   getTimestamp(time) {
151
+      // 把时间日期转成时间戳
152
+      return new Date(time).getTime() / 1000;
153
+    },
154
+    getCurrentOrgPatients(){
155
+      getCurrentOrgPatients().then(response=>{
156
+         if(response.data.state == 1){
157
+           var patients = response.data.data.patients
158
+           this.patientsData = patients
159
+         }
160
+      })
161
+    },
162
+    getTime(time) {
163
+      return uParseTime(time, "{y}-{m}-{d}");
164
+    },
165
+    handleSizeChange(limit) {
166
+      this.listQuery.limit = limit;
167
+      this.getDialysisList();
168
+    },
169
+    handleCurrentChange(page) {
170
+      this.listQuery.page = page;
171
+      this.getDialysisList();
172
+    },
173
+    getDialysisList(){
174
+      getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
175
+         if(response.data.state === 1){
176
+          //  var  dialysislist =  response.data.data.dialysislist
177
+          //  for(let i=0;i<dialysislist.length;i++){
178
+          //     if(dialysislist[i].mode_id == 1){
179
+          //       dialysislist[i].mode_id = "HD"
180
+          //     }
181
+          //      if(dialysislist[i].mode_id == 2){
182
+          //       dialysislist[i].mode_id = "HDF"
183
+          //     }
184
+          //      if(dialysislist[i].mode_id == 3){
185
+          //       dialysislist[i].mode_id = "HD+HP"
186
+          //     }
187
+          //      if(dialysislist[i].mode_id == 4){
188
+          //       dialysislist[i].mode_id = "HP"
189
+          //     }
190
+          //      if(dialysislist[i].mode_id == 5){
191
+          //       dialysislist[i].mode_id = "HF"
192
+          //     }
193
+          //      if(dialysislist[i].mode_id == 6){
194
+          //       dialysislist[i].mode_id = "SCUF"
195
+          //     }
196
+          //      if(dialysislist[i].mode_id == 7){
197
+          //       dialysislist[i].mode_id = "IUF"
198
+          //     }
199
+          //      if(dialysislist[i].mode_id == 8){
200
+          //       dialysislist[i].mode_id = "HFHD"
201
+          //     }
202
+          //      if(dialysislist[i].mode_id == 9){
203
+          //       dialysislist[i].mode_id = "HFHD+HP"
204
+          //     }
205
+          //      if(dialysislist[i].mode_id == 10){
206
+          //       dialysislist[i].mode_id = "PHF"
207
+          //     }
208
+          //      if(dialysislist[i].mode_id == 11){
209
+          //       dialysislist[i].mode_id = "HFR"
210
+          //     }
211
+          //     if(dialysislist[i].mode_id == 12){
212
+          //       dialysislist[i].mode_id = "HDF+HP"
213
+          //     }
214
+          //     if(dialysislist[i].mode_id == 13){
215
+          //       dialysislist[i].mode_id = "CRRT"
216
+          //     }
217
+          //    if(dialysislist[i].mode_id == 14){
218
+          //       dialysislist[i].mode_id = "腹水回输"
219
+          //     }
220
+          //     if(dialysislist[i].mode_id == 19){
221
+          //       dialysislist[i].mode_id = "IUF+HD"
222
+          //     }
223
+          //  }
224
+          //  console.log("dialysislist",dialysislist)
225
+          //  var hash = {};
226
+          //  var i = 0;
227
+          //  var res = [];
228
+          //  dialysislist.forEach(function(item) {
229
+          //   var patient_id = item.patient_id;
230
+          //   hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
231
+          //       mode_id: [item.mode_id],
232
+          //       patient_id: patient_id,
233
+          //       dialysis_no: item.dialysis_no,
234
+          //       name:item.name,
235
+          //       age:item.id_card_no,
236
+          //       total_dialysis:item.total_dialysis,
237
+          //       user_sys_before_count:item.user_sys_before_count,
238
+          //   })
239
+          //  });
240
+          //  res.map(item => {
241
+          //    item.age = this.getAge(item.age)
242
+          //  })
243
+          //  console.log(res)
244
+          //  //this.DialysisData = res
245
+ 
246
+          //   var total = response.data.data.total
247
+          //   console.log("total",total) 
248
+          //  // this.total = total
249
+
250
+            
251
+          var list = response.data.data.list
252
+          //console.log("list",list)
253
+          var totallist  =  response.data.data.totallist
254
+         // console.log("totallist",totallist)
255
+          this.total = totallist  
256
+          var prescriptionList = response.data.data.prescriptionList
257
+          this.getModeId(prescriptionList)
258
+          
259
+         // console.log("prescriptionList",prescriptionList)
260
+          // for(let i=0;i<this.prescriptionList.length;i++){
261
+          //   for(let j=0;j<list.length;j++){
262
+          //     if(this.prescriptionList[i].patient_id == list[j].patient_id){
263
+          //       arr.push(this.prescriptionList[i])
264
+          //     }
265
+          //   }
266
+          // }
267
+          let dataInfo = {}
268
+          list.forEach((item, index) => {
269
+            let { patient_id } = item
270
+            if (!dataInfo[patient_id]) {
271
+              dataInfo[patient_id] = {
272
+                patient_id,
273
+                name:item.name,
274
+                id_card_no:item.id_card_no,
275
+                dialysis_no:item.dialysis_no,
276
+                total_dialysis:item.total_dialysis,
277
+                user_sys_before_count:item.user_sys_before_count,
278
+                mode_id: []
279
+              }
280
+            }
281
+          })
282
+          let list = Object.values(dataInfo)
283
+          //console.log("arr",list)    
284
+          list.map(item => {
285
+            for (let i = 0; i < prescriptionList.length; i++) {
286
+              if (item.patient_id === prescriptionList[i].patient_id) {
287
+                item.mode_id.push(prescriptionList[i].mode_id)
288
+              }
289
+            }
290
+          })
291
+        //  console.log("list---",list)
292
+          this.DialysisData = list
293
+         }
294
+      })
295
+    },
296
+    getAge(UUserCard) {
297
+			if (UUserCard != null && UUserCard != '') {
298
+				//获取年龄
299
+				var myDate = new Date();
300
+				var month = myDate.getMonth() + 1;
301
+				var day = myDate.getDate();
302
+				var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
303
+				if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
304
+					age++;
305
+				}
306
+				return age;
307
+			}
308
+    },
309
+    onSearch(){
310
+      if(this.listQuery.search == "" || this.listQuery.search == null){
311
+         this.getDialysisList()
312
+         return false
313
+      }else{
314
+       getPrescriptionByName(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
315
+         if(response.data.state === 1){
316
+           var patients =  response.data.data.patient
317
+           this.getModeId(patients)
318
+           //console.log("patient",patients)
319
+           var hash = {};
320
+           var i = 0;
321
+           var res = [];
322
+           patients.forEach(function(item) {
323
+            var patient_id = item.patient_id;
324
+            hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
325
+                mode_id: [item.mode_id],
326
+                patient_id: patient_id,
327
+                dialysis_no: item.dialysis_no,
328
+                name:item.name,
329
+                id_card_no:item.id_card_no,
330
+                total_dialysis:item.total_dialysis,
331
+                user_sys_before_count:item.user_sys_before_count,
332
+            })
333
+           });
334
+           this.DialysisData = res
335
+           var total =  response.data.data.total
336
+           this.total = res.length
337
+          // console.log("total",total)
338
+         }
339
+       })
340
+      }
341
+    
342
+    },
343
+    unique(arr) {
344
+        const res = new Map();
345
+        return arr.filter((arr) => !res.has(arr.mode_id) && res.set(arr.mode_id, 1));
346
+      },
347
+    handleChange(val){
348
+       getDialysisDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
349
+          if(response.data.state === 1){
350
+            var patients =  response.data.data.patients
351
+            this.getModeId(patients)
352
+            // console.log("patients",patients)
353
+            var hash = {};
354
+            var i = 0;
355
+            var res = [];
356
+            patients.forEach(function(item) {
357
+              var patient_id = item.patient_id;
358
+              hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
359
+                  mode_id: [item.mode_id],
360
+                  patient_id: patient_id,
361
+                  dialysis_no: item.dialysis_no,
362
+                  name:item.name,
363
+                  id_card_no:item.id_card_no,
364
+                  total_dialysis:item.total_dialysis,
365
+                  user_sys_before_count:item.user_sys_before_count,
366
+              })
367
+            });
368
+            this.DialysisData = res
369
+           // console.log(res)
370
+            var total =  response.data.data.total
371
+            this.total = res.length
372
+            // console.log("total",total)
373
+          }
374
+       })
375
+     
376
+    },
377
+    getModeId(patients){
378
+      for(let i=0;i<patients.length;i++){
379
+        if(patients[i].mode_id == 1){
380
+          patients[i].mode_id = "HD"
381
+        }else if(patients[i].mode_id == 2){
382
+          patients[i].mode_id = "HDF"
383
+        }else if(patients[i].mode_id == 3){
384
+          patients[i].mode_id = "HD+HP"
385
+        }else if(patients[i].mode_id == 4){
386
+          patients[i].mode_id = "HP"
387
+        }else if(patients[i].mode_id == 5){
388
+          patients[i].mode_id = "HF"
389
+        }else if(patients[i].mode_id == 6){
390
+          patients[i].mode_id = "SCUF"
391
+        }else if(patients[i].mode_id == 7){
392
+          patients[i].mode_id = "IUF"
393
+        }else if(patients[i].mode_id == 8){
394
+          patients[i].mode_id = "HFHD"
395
+        }else if(patients[i].mode_id == 9){
396
+          patients[i].mode_id = "HFHD+HP"
397
+        }else if(patients[i].mode_id == 10){
398
+          patients[i].mode_id = "PHF"
399
+        }else if(patients[i].mode_id == 11){
400
+          patients[i].mode_id = "HFR"
401
+        }else if(patients[i].mode_id == 12){
402
+          patients[i].mode_id = "HDF+HP"
403
+        }else if(patients[i].mode_id == 13){
404
+          patients[i].mode_id = "CRRT"
405
+        }else if(patients[i].mode_id == 14){
406
+          patients[i].mode_id = "腹水回输"
407
+        }else if(patients[i].mode_id == 15){
408
+            patients[i].mode_id = "HD前置换"
409
+        }else if(patients[i].mode_id == 16){
410
+            patients[i].mode_id = "HD后置换"
411
+        }else if(patients[i].mode_id == 17){
412
+            patients[i].mode_id = "HDF前置换"
413
+        }else if(patients[i].mode_id == 18){
414
+            patients[i].mode_id = "HDF后置换"
415
+        }else if(patients[i].mode_id == 19){
416
+          patients[i].mode_id = "IUF+HD"
417
+        }
260 418
       }
261 419
     }
420
+  },
421
+  created(){
422
+    var nowDate = new Date();
423
+    var nowYear = nowDate.getFullYear();
424
+    var nowMonth = nowDate.getMonth() + 1;
425
+    var nowDay = nowDate.getDate();
426
+    this.listQuery.end_time =
427
+      nowYear +
428
+      "-" +
429
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
430
+      "-" +
431
+      (nowDay < 10 ? "0" + nowDay : nowDay);
432
+    nowDate.setMonth(nowDate.getMonth() - 3);
433
+    nowYear = nowDate.getFullYear();
434
+    nowMonth = nowDate.getMonth() + 1;
435
+    nowDay = nowDate.getDate();
436
+    this.listQuery.start_time =
437
+      nowYear +
438
+      "-" +
439
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
440
+      "-" +
441
+      (nowDay < 10 ? "0" + nowDay : nowDay);
442
+    
443
+     //获取该机构下的所有患者
444
+     this.getCurrentOrgPatients()
445
+     //统计列表
446
+     this.getDialysisList()
262 447
   }
263 448
 };
264 449
 </script>

+ 1 - 1
src/xt_pages/qcd/workAnalysis/doctor.vue 파일 보기

@@ -66,7 +66,7 @@
66 66
         </div>
67 67
         <div class="tableTitle">统计表</div>
68 68
         <div>
69
-          <el-table :data="tableData" style="width: 100%" border show-summary>
69
+          <el-table :data="tableData" style="width: 100%" border show-summary :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
70 70
             <el-table-column fixed prop="date" label="日期"></el-table-column>
71 71
             <el-table-column prop="name" label="姓名"></el-table-column>
72 72
             <el-table-column prop="province" label="省份"></el-table-column>

+ 1 - 1
src/xt_pages/qcd/workAnalysis/nurse.vue 파일 보기

@@ -66,7 +66,7 @@
66 66
         </div>
67 67
         <div class="tableTitle">统计表</div>
68 68
         <div>
69
-          <el-table :data="tableData" style="width: 100%" border show-summary>
69
+          <el-table :data="tableData" style="width: 100%" border show-summary :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
70 70
             <el-table-column fixed prop="date" label="日期"></el-table-column>
71 71
             <el-table-column prop="name" label="姓名"></el-table-column>
72 72
             <el-table-column prop="province" label="省份"></el-table-column>

+ 252 - 302
src/xt_pages/user/inspection.vue 파일 보기

@@ -178,11 +178,10 @@
178 178
               <el-date-picker
179 179
                 style="width:95%"
180 180
                 v-model="form.inspect_date"
181
-                type="date"
182
-                value-format="yyyy-MM-dd"
183
-                format="yyyy-MM-dd"
181
+                type="datetime"
182
+                value-format="yyyy-MM-dd HH:mm"
183
+                format="yyyy-MM-dd HH:mm"
184 184
                 placeholder="选择日期"
185
-                :readonly="form.method == 'add' ? false : true"
186 185
               >
187 186
               </el-date-picker>
188 187
             </el-form-item>
@@ -248,18 +247,18 @@
248 247
 </template>
249 248
 
250 249
 <script>
251
-import PatientSidebar from "./components/PatientSidebar";
250
+import PatientSidebar from './components/PatientSidebar'
252 251
 import {
253 252
   fetchInspectionReference,
254 253
   CreatePatientInspection,
255 254
   fetchPatientInspections,
256 255
   EditPatientInspection,
257 256
   DeletePatientInspection
258
-} from "@/api/inspection";
259
-import { uParseTime, isPositiveNumber } from "@/utils/tools";
257
+} from '@/api/inspection'
258
+import { uParseTime, isPositiveNumber } from '@/utils/tools'
260 259
 
261 260
 export default {
262
-  name: "Inspection",
261
+  name: 'Inspection',
263 262
   components: { PatientSidebar },
264 263
   data() {
265 264
     return {
@@ -267,22 +266,23 @@ export default {
267 266
       pageLoading: true,
268 267
       itemLoading: false,
269 268
       formLoading: false,
270
-      itemDate: "",
269
+      itemDate: '',
271 270
       patientID: 0,
272
-      panelClass: "patient-app-container",
271
+      panelClass: 'patient-app-container',
273 272
       patientInfo: {
274 273
         id: 0
275 274
       },
276
-      itemName: "请选择项目",
277
-      formTitle: "",
275
+      itemName: '请选择项目',
276
+      formTitle: '',
278 277
       dialogFormVisible: false,
279 278
       patient_info: null,
280 279
       form: {
281
-        remind_cycle: "",
282
-        method: "add",
280
+        remind_cycle: '',
281
+        method: 'add',
283 282
         project_id: 0,
284
-        inspect_date: "",
285
-        formItem: [{ id: 0, value: "" }]
283
+        inspect_date: '',
284
+        old_inspect_date: '',
285
+        formItem: [{ id: 0, value: '' }]
286 286
       },
287 287
       formItem: [],
288 288
       items: [],
@@ -295,112 +295,100 @@ export default {
295 295
         project_id: 0,
296 296
         page: 1
297 297
       }
298
-    };
298
+    }
299 299
   },
300 300
   methods: {
301 301
     deleteInspection() {
302
-      if (this.project == null || this.itemDate == "") {
303
-        this.$message.error("请先选择删除删除的记录");
304
-        return false;
302
+      if (this.project == null || this.itemDate == '') {
303
+        this.$message.error('请先选择删除删除的记录')
304
+        return false
305 305
       }
306 306
 
307
-      this.$confirm("确认删除此记录?", "删除", {
308
-        confirmButtonText: "确定",
309
-        cancelButtonText: "取消",
310
-        type: "warning"
307
+      this.$confirm('确认删除此记录?', '删除', {
308
+        confirmButtonText: '确定',
309
+        cancelButtonText: '取消',
310
+        type: 'warning'
311 311
       })
312 312
         .then(() => {
313 313
           var params = {
314 314
             patient: this.patientID,
315 315
             date: this.itemDate,
316 316
             project_id: this.project.project_id
317
-          };
317
+          }
318 318
           DeletePatientInspection(params).then(response => {
319 319
             if (response.data.state == 0) {
320
-              this.$message.error(response.data.msg);
321
-              return false;
320
+              this.$message.error(response.data.msg)
321
+              return false
322 322
             } else {
323 323
               this.$notify({
324
-                title: "成功",
325
-                message: "删除成功",
326
-                type: "success",
324
+                title: '成功',
325
+                message: '删除成功',
326
+                type: 'success',
327 327
                 duration: 2000
328
-              });
328
+              })
329 329
 
330 330
               for (var index in this.projects) {
331 331
                 if (this.projects[index].project_id == params.project_id) {
332
-                  this.projects[index].count--;
333
-                  break;
332
+                  this.projects[index].count--
333
+                  break
334 334
                 }
335 335
               }
336
-              this.total -= 1;
337
-              this.itemDate = "";
338
-              this.items = [];
336
+              this.total -= 1
337
+              this.itemDate = ''
338
+              this.items = []
339 339
               if (this.total > 0) {
340
-                this.queryParams.page = 1;
341
-                this.fetchPatientInspections(this.queryParams);
340
+                this.queryParams.page = 1
341
+                this.fetchPatientInspections(this.queryParams)
342 342
               }
343 343
             }
344
-          });
344
+          })
345 345
         })
346
-        .catch(() => {});
346
+        .catch(() => {})
347 347
     },
348 348
     openEdit() {
349 349
       if (this.project == null) {
350
-        this.$message.error("请先选择项目");
351
-        return false;
350
+        this.$message.error('请先选择项目')
351
+        return false
352 352
       }
353 353
 
354
-      this.form.method = "edit";
355
-      this.formTitle = "修改" + this.project.project_name;
356
-      this.form.project_id = this.project.project_id;
357
-      this.form.inspect_date = this.itemDate;
358
-      this.form.remind_cycle = this.patient_info.remind_cycle;
359
-      console.log(this.form.remind_cycle);
354
+      this.form.method = 'edit'
355
+      this.formTitle = '修改' + this.project.project_name
356
+      this.form.project_id = this.project.project_id
357
+      this.form.inspect_date = this.itemDate
358
+      this.form.old_inspect_date = this.itemDate
359
+      this.form.remind_cycle = this.patient_info.remind_cycle
360
+      console.log(this.form.remind_cycle)
360 361
 
361
-      this.form.formItem = [];
362
+      this.form.formItem = []
362 363
       for (var index in this.project.inspection_reference) {
363 364
         this.form.formItem.push({
364
-          id:
365
-            this.project.inspection_reference[index].id in this.inspectionsMap
366
-              ? this.inspectionsMap[this.project.inspection_reference[index].id]
367
-                  .id
368
-              : 0,
365
+          id: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].id : 0,
369 366
           project_id: this.project.inspection_reference[index].project_id,
370 367
           project_name: this.project.inspection_reference[index].project_name,
371 368
           item_id: this.project.inspection_reference[index].id,
372 369
           item: this.project.inspection_reference[index].item,
373 370
           item_name: this.project.inspection_reference[index].item_name,
374 371
           range_type: this.project.inspection_reference[index].range_type,
375
-          value:
376
-            this.project.inspection_reference[index].id in this.inspectionsMap
377
-              ? this.inspectionsMap[this.project.inspection_reference[index].id]
378
-                  .inspect_value
379
-              : "",
380
-          select_options: this.project.inspection_reference[
381
-            index
382
-          ].range_options.split(","),
372
+          value: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value : '',
373
+          select_options: this.project.inspection_reference[index].range_options.split(','),
383 374
           unit: this.project.inspection_reference[index].unit
384
-        });
375
+        })
385 376
       }
386
-
387
-      console.log(this.form.formItem);
388
-
389
-      this.dialogFormVisible = true;
377
+      console.log(this.form.formItem)
378
+      this.dialogFormVisible = true
390 379
     },
391 380
     openNew() {
392 381
       if (this.project == null) {
393
-        this.$message.error("请先选择项目");
394
-        return false;
382
+        this.$message.error('请先选择项目')
383
+        return false
395 384
       }
396
-      this.form.method = "add";
397
-      this.formTitle = "新增" + this.project.project_name;
398
-      this.form.project_id = this.project.project_id;
399
-      this.form.remind_cycle = this.patient_info.remind_cycle;
400
-
401
-      var today = new Date();
402
-      this.form.inspect_date = uParseTime(today, "{y}-{m}-{d}");
403
-      this.form.formItem = [];
385
+      this.form.method = 'add'
386
+      this.formTitle = '新增' + this.project.project_name
387
+      this.form.project_id = this.project.project_id
388
+      this.form.remind_cycle = this.patient_info.remind_cycle
389
+      var today = new Date()
390
+      this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
391
+      this.form.formItem = []
404 392
       for (var index in this.project.inspection_reference) {
405 393
         // var formItem = this.project.inspection_reference[index];
406 394
         // formItem["value"] = '';
@@ -415,114 +403,106 @@ export default {
415 403
           item: this.project.inspection_reference[index].item,
416 404
           item_name: this.project.inspection_reference[index].item_name,
417 405
           range_type: this.project.inspection_reference[index].range_type,
418
-          value: "",
406
+          value: '',
419 407
           select_options: this.project.inspection_reference[
420 408
             index
421
-          ].range_options.split(","),
409
+          ].range_options.split(','),
422 410
           unit: this.project.inspection_reference[index].unit
423
-        });
411
+        })
424 412
       }
425 413
 
426
-      this.dialogFormVisible = true;
414
+      this.dialogFormVisible = true
427 415
     },
428 416
     submitEdit(formName) {
429 417
       this.$refs[formName].validate(valid => {
430 418
         if (valid) {
431
-          this.formLoading = true;
419
+          this.formLoading = true
432 420
           if (this.form.formItem.length == 0) {
433
-            this.$message.error("未填写项目");
434
-            return false;
421
+            this.$message.error('未填写项目')
422
+            return false
435 423
           }
436 424
           for (var index in this.form.formItem) {
437
-            this.form.formItem[index].value =
438
-              "" + this.form.formItem[index].value;
425
+            this.form.formItem[index].value = '' + this.form.formItem[index].value
439 426
           }
440 427
 
441
-          EditPatientInspection(
442
-            this.patientID,
443
-            this.form,
444
-            this.form.remind_cycle,
445
-            this.form.inspect_date,
446
-            this.form.project_id
447
-          )
448
-            .then(response => {
449
-              if (response.data.state == 1) {
450
-                this.$notify({
451
-                  title: "成功",
452
-                  message: "修改成功",
453
-                  type: "success",
454
-                  duration: 2000
455
-                });
456
-                this.patient_info.remind_cycle =
457
-                  response.data.data.remind_cycle;
458
-                this.itemDate = this.form.inspect_date;
459
-                this.items = [];
460
-                var inspections = response.data.data.inspections;
461
-                this.inspections = response.data.data.inspections;
462
-                if (inspections == null) {
463
-                  this.inspections = [];
464
-                  return false;
465
-                }
466
-                var inspectionsMap = {};
467
-                this.inspectionsMap = {};
468
-                for (var index in inspections) {
469
-                  inspectionsMap[inspections[index].item_id] =
470
-                    inspections[index];
471
-                  this.inspectionsMap[inspections[index].item_id] =
472
-                    inspections[index];
473
-                }
474
-                var items = this.project.inspection_reference;
475
-                for (var index in items) {
476
-                  if (items[index].id in inspectionsMap) {
477
-                    var item = {};
478
-                    for (var key in items[index]) {
479
-                      item[key] = items[index][key];
480
-                    }
481
-                    item.value = inspectionsMap[items[index].id].inspect_value;
482
-                    item.value_direction = "";
483
-                    if (item.range_type == 1) {
484
-                      var value = parseFloat(item.value);
485
-                      var range_min = parseFloat(item.range_min);
486
-                      var range_max = parseFloat(item.range_max);
487
-                      if (value < range_min) {
488
-                        item.value_direction = "↓";
489
-                      } else if (value > range_max) {
490
-                        item.value_direction = "↑";
491
-                      }
428
+          EditPatientInspection(this.patientID, this.form, this.form.remind_cycle, this.form.inspect_date, this.form.project_id).then(response => {
429
+            if (response.data.state == 1) {
430
+              this.$notify({
431
+                title: '成功',
432
+                message: '修改成功',
433
+                type: 'success',
434
+                duration: 2000
435
+              })
436
+              this.patient_info.remind_cycle =
437
+                  response.data.data.remind_cycle
438
+              this.itemDate = this.form.inspect_date
439
+              this.items = []
440
+              var inspections = response.data.data.inspections
441
+              this.inspections = response.data.data.inspections
442
+              if (inspections == null) {
443
+                this.inspections = []
444
+                return false
445
+              }
446
+              var inspectionsMap = {}
447
+              this.inspectionsMap = {}
448
+              for (var index in inspections) {
449
+                inspectionsMap[inspections[index].item_id] =
450
+                    inspections[index]
451
+                this.inspectionsMap[inspections[index].item_id] =
452
+                    inspections[index]
453
+              }
454
+              var items = this.project.inspection_reference
455
+              for (var index in items) {
456
+                if (items[index].id in inspectionsMap) {
457
+                  var item = {}
458
+                  for (var key in items[index]) {
459
+                    item[key] = items[index][key]
460
+                  }
461
+                  item.value = inspectionsMap[items[index].id].inspect_value
462
+                  item.value_direction = ''
463
+                  if (item.range_type == 1) {
464
+                    var value = parseFloat(item.value)
465
+                    var range_min = parseFloat(item.range_min)
466
+                    var range_max = parseFloat(item.range_max)
467
+                    if (value < range_min) {
468
+                      item.value_direction = '↓'
469
+                    } else if (value > range_max) {
470
+                      item.value_direction = '↑'
492 471
                     }
493
-                    this.items.push(item);
494 472
                   }
473
+                  this.items.push(item)
495 474
                 }
496
-
497
-                this.resetForm(formName);
498
-                this.dialogFormVisible = false;
499
-              } else {
500
-                this.$message.error(response.data.msg);
501
-                return false;
502 475
               }
503
-            })
476
+
477
+              this.resetForm(formName)
478
+              this.dialogFormVisible = false
479
+            } else {
480
+              this.$message.error(response.data.msg)
481
+              return false
482
+            }
483
+          })
504 484
             .catch(v => {
505
-              this.$message.error(v);
506
-              return false;
507
-            });
508
-          this.formLoading = false;
509
-          return false;
485
+              this.$message.error(v)
486
+              return false
487
+            })
488
+          this.formLoading = false
489
+          return false
510 490
         } else {
511
-          return false;
491
+          return false
512 492
         }
513
-      });
493
+      })
514 494
     },
515 495
     submitNew(formName) {
516 496
       this.$refs[formName].validate(valid => {
517 497
         if (valid) {
518
-          this.formLoading = true;
498
+          this.formLoading = true
519 499
           if (this.form.formItem.length == 0) {
520
-            this.$message.error("未填写项目");
521
-            return false;
500
+            this.$message.error('未填写项目')
501
+            return false
522 502
           }
523 503
           for (var index in this.form.formItem) {
524 504
             this.form.formItem[index].value =
525
-              "" + this.form.formItem[index].value;
505
+              '' + this.form.formItem[index].value
526 506
           }
527 507
           CreatePatientInspection(
528 508
             this.patientID,
@@ -532,237 +512,207 @@ export default {
532 512
             .then(response => {
533 513
               if (response.data.state == 1) {
534 514
                 this.$notify({
535
-                  title: "成功",
536
-                  message: "新增成功",
537
-                  type: "success",
515
+                  title: '成功',
516
+                  message: '新增成功',
517
+                  type: 'success',
538 518
                   duration: 2000
539
-                });
519
+                })
540 520
                 // this.form.remind_reycle = response.data.data.remind_reycc
541 521
                 this.patient_info.remind_cycle =
542
-                  response.data.data.remind_cycle;
543
-                console.log(this.patient_info.remind_cycle);
522
+                  response.data.data.remind_cycle
523
+                console.log(this.patient_info.remind_cycle)
544 524
 
545
-                this.itemDate = this.form.inspect_date;
546
-                console.log(this.itemDate);
547
-
548
-                this.items = [];
525
+                this.itemDate = this.form.inspect_date
526
+                this.items = []
549 527
                 for (var index in this.projects) {
550 528
                   if (this.projects[index].project_id == this.form.project_id) {
551
-                    this.projects[index].count++;
552
-                    break;
529
+                    this.projects[index].count++
530
+                    break
553 531
                   }
554 532
                 }
555
-                this.total += 1;
556
-                var inspections = response.data.data.inspections;
557
-                this.inspections = response.data.data.inspections;
533
+                this.total += 1
534
+                var inspections = response.data.data.inspections
535
+                this.inspections = response.data.data.inspections
558 536
                 if (inspections == null) {
559
-                  this.inspections = [];
560
-                  return false;
537
+                  this.inspections = []
538
+                  return false
561 539
                 }
562
-                var inspectionsMap = {};
563
-                this.inspectionsMap = {};
540
+                var inspectionsMap = {}
541
+                this.inspectionsMap = {}
564 542
                 for (var index in inspections) {
565 543
                   inspectionsMap[inspections[index].item_id] =
566
-                    inspections[index];
544
+                    inspections[index]
567 545
                   this.inspectionsMap[inspections[index].item_id] =
568
-                    inspections[index];
546
+                    inspections[index]
569 547
                 }
570
-                var items = this.project.inspection_reference;
548
+                var items = this.project.inspection_reference
571 549
                 for (var index in items) {
572 550
                   if (items[index].id in inspectionsMap) {
573
-                    var item = {};
551
+                    var item = {}
574 552
                     for (var key in items[index]) {
575
-                      item[key] = items[index][key];
553
+                      item[key] = items[index][key]
576 554
                     }
577
-                    item.value = inspectionsMap[items[index].id].inspect_value;
578
-                    item.value_direction = "";
555
+                    item.value = inspectionsMap[items[index].id].inspect_value
556
+                    item.value_direction = ''
579 557
                     if (item.range_type == 1) {
580
-                      var value = parseFloat(item.value);
581
-                      var range_min = parseFloat(item.range_min);
582
-                      var range_max = parseFloat(item.range_max);
558
+                      var value = parseFloat(item.value)
559
+                      var range_min = parseFloat(item.range_min)
560
+                      var range_max = parseFloat(item.range_max)
583 561
                       if (value < range_min) {
584
-                        item.value_direction = "↓";
562
+                        item.value_direction = '↓'
585 563
                       } else if (value > range_max) {
586
-                        item.value_direction = "↑";
564
+                        item.value_direction = '↑'
587 565
                       }
588 566
                     }
589
-                    this.items.push(item);
567
+                    this.items.push(item)
590 568
                   }
591 569
                 }
592 570
 
593
-                this.resetForm(formName);
594
-                this.dialogFormVisible = false;
571
+                this.resetForm(formName)
572
+                this.dialogFormVisible = false
595 573
 
596
-                this.queryParams.patient = this.patientID;
597
-                this.queryParams.project_id = this.project.project_id;
598
-                this.queryParams.page = 1;
599
-                this.total = 0;
600
-                this.fetchPatientInspections(this.queryParams);
574
+                this.queryParams.patient = this.patientID
575
+                this.queryParams.project_id = this.project.project_id
576
+                this.queryParams.page = 1
577
+                this.total = 0
578
+                this.fetchPatientInspections(this.queryParams)
601 579
               } else {
602
-                this.$message.error(response.data.msg);
603
-                return false;
580
+                this.$message.error(response.data.msg)
581
+                return false
604 582
               }
605 583
             })
606 584
             .catch(v => {
607
-              this.$message.error(v);
608
-              return false;
609
-            });
610
-          this.formLoading = false;
611
-          return false;
585
+              this.$message.error(v)
586
+              return false
587
+            })
588
+          this.formLoading = false
589
+          return false
612 590
         } else {
613
-          return false;
591
+          return false
614 592
         }
615
-      });
593
+      })
616 594
     },
617 595
     fetchInspectionReference() {
618 596
       fetchInspectionReference(this.patientID)
619 597
         .then(response => {
620 598
           if (response.data.state == 1) {
621
-            var reference = response.data.data.reference;
622
-            var patient_info = response.data.data.patient_info;
623
-            this.projects = reference;
624
-            this.patient_info = patient_info;
625
-            this.pageLoading = false;
626
-            this.form.remind_cycle = this.patient_info.remind_cycle;
599
+            var reference = response.data.data.reference
600
+            var patient_info = response.data.data.patient_info
601
+            this.projects = reference
602
+            this.patient_info = patient_info
603
+            this.pageLoading = false
604
+            this.form.remind_cycle = this.patient_info.remind_cycle
627 605
           } else {
628
-            this.$message.error(response.data.msg);
629
-            return false;
606
+            this.$message.error(response.data.msg)
607
+            return false
630 608
           }
631 609
         })
632
-        .catch(v => {});
610
+        .catch(v => {})
633 611
     },
634 612
     setCurrent(row) {
635
-      this.$refs.singleTable.setCurrentRow(row);
613
+      this.$refs.singleTable.setCurrentRow(row)
636 614
     },
637 615
     resetForm(formName) {
638
-      this.$refs[formName].resetFields();
616
+      this.$refs[formName].resetFields()
639 617
     },
640 618
     handleCurrentChange(row) {
641
-      this.itemDate = "";
642
-      this.form.method = "add";
643
-      if (typeof row === "undefined" || row == null) {
644
-        this.project = null;
645
-        this.items = [];
646
-        this.itemName = "请选择项目";
619
+      this.itemDate = ''
620
+      this.form.method = 'add'
621
+      if (typeof row === 'undefined' || row == null) {
622
+        this.project = null
623
+        this.items = []
624
+        this.itemName = '请选择项目'
647 625
       } else {
648
-        this.itemLoading = true;
649
-        this.project = row;
650
-        this.items = row.inspection_reference;
651
-        this.itemName = row.project_name;
652
-
653
-        this.queryParams.patient = this.patientID;
654
-        this.queryParams.project_id = this.project.project_id;
655
-        this.queryParams.page = 1;
656
-        this.total = 0;
657
-        this.fetchPatientInspections(this.queryParams);
626
+        this.itemLoading = true
627
+        this.project = row
628
+        this.items = row.inspection_reference
629
+        this.itemName = row.project_name
630
+
631
+        this.queryParams.patient = this.patientID
632
+        this.queryParams.project_id = this.project.project_id
633
+        this.queryParams.page = 1
634
+        this.total = 0
635
+        this.fetchPatientInspections(this.queryParams)
658 636
       }
659 637
     },
660 638
 
661 639
     handleCurrentChangePage(val) {
662
-      this.itemLoading = true;
663
-      this.queryParams.page = val;
664
-      this.fetchPatientInspections(this.queryParams);
640
+      this.itemLoading = true
641
+      this.queryParams.page = val
642
+      this.fetchPatientInspections(this.queryParams)
665 643
     },
666 644
     fetchPatientInspections(params) {
667
-      this.items = [];
645
+      this.items = []
668 646
       fetchPatientInspections(params)
669 647
         .then(response => {
670 648
           if (response.data.state == 1) {
671
-            var inspections = response.data.data.inspections;
672
-            this.total = response.data.data.total;
673
-            this.itemDate = response.data.data.date.split(" ")[0];
674
-            this.inspections = response.data.data.inspections;
649
+            var inspections = response.data.data.inspections
650
+            this.total = response.data.data.total
651
+            this.itemDate = response.data.data.date
652
+            this.inspections = response.data.data.inspections
675 653
             if (inspections == null) {
676
-              this.inspections = [];
677
-              return false;
654
+              this.inspections = []
655
+              return false
678 656
             }
679
-            var inspectionsMap = {};
680
-            this.inspectionsMap = {};
657
+            var inspectionsMap = {}
658
+            this.inspectionsMap = {}
681 659
             for (var index in inspections) {
682
-              console.log(inspections[index])
683
-              inspectionsMap[inspections[index].item_id] = inspections[index];
684
-
685
-              this.inspectionsMap[inspections[index].item_id] =
686
-                inspections[index];
660
+              inspectionsMap[inspections[index].item_id] = inspections[index]
661
+              this.inspectionsMap[inspections[index].item_id] = inspections[index]
687 662
             }
688
-            var items = this.project.inspection_reference;
689
-
690
-            console.log(items)
691
-            console.log(inspectionsMap)
692
-
693
-
694
-
663
+            var items = this.project.inspection_reference
695 664
             for (var index in items) {
696
-
697
-              if (
698
-                items[index].id in inspectionsMap ||
699
-                items[index].item_id in inspectionsMap
700
-              ) {
701
-
702
-
703
-                var item = {};
665
+              if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {
666
+                var item = {}
704 667
                 for (var key in items[index]) {
705
-                  item[key] = items[index][key];
668
+                  item[key] = items[index][key]
706 669
                 }
707
-                console.log(item.item_id);
708
-
709 670
                 if (item.item_id > 0) {
710
-                  console.log(item)
711
-                  console.log(items[index].item_id)
712
-                  console.log(inspectionsMap)
713
-
714
-                  console.log(inspectionsMap[parseInt(items[index].item_id)].inspect_value)
715
-
716
-                  item.value =
717
-                    inspectionsMap[items[index].item_id].inspect_value;
718
-
719
-
671
+                  if (inspectionsMap[items[index].item_id] == undefined) {
672
+                    item.value = inspectionsMap[items[index].id].inspect_value
673
+                  } else {
674
+                    item.value = inspectionsMap[items[index].item_id].inspect_value
675
+                  }
720 676
                 } else {
721
-
722
-                  item.value = inspectionsMap[items[index].id].inspect_value;
677
+                  item.value = inspectionsMap[items[index].id].inspect_value
723 678
                 }
724
-
725
-                item.value_direction = "";
679
+                item.value_direction = ''
726 680
                 if (item.range_type == 1) {
727
-
728
-                  var value = parseFloat(item.value);
729
-                  var range_min = parseFloat(item.range_min);
730
-                  var range_max = parseFloat(item.range_max);
681
+                  var value = parseFloat(item.value)
682
+                  var range_min = parseFloat(item.range_min)
683
+                  var range_max = parseFloat(item.range_max)
731 684
                   if (value < range_min) {
732
-                    item.value_direction = "↓";
685
+                    item.value_direction = '↓'
733 686
                   } else if (value > range_max) {
734
-                    item.value_direction = "↑";
687
+                    item.value_direction = '↑'
735 688
                   }
736 689
                 }
737
-                this.items.push(item);
738
-
690
+                this.items.push(item)
739 691
               }
740
-
741 692
             }
742
-
743
-
693
+            console.log(this.items)
744 694
           }
745 695
         })
746
-        .catch(v => {});
696
+        .catch(v => {})
747 697
       setTimeout(() => {
748
-        this.itemLoading = false;
749
-      }, 1000);
698
+        this.itemLoading = false
699
+      }, 1000)
750 700
     }
751 701
   },
752 702
   created() {
753
-    const id = this.$route.query && this.$route.query.id;
754
-    this.patientID = parseInt(id);
703
+    const id = this.$route.query && this.$route.query.id
704
+    this.patientID = parseInt(id)
755 705
     if (isNaN(this.patientID) || this.patientID <= 0) {
756 706
       this.$notify.error({
757
-        title: "错误",
758
-        message: "无效的id"
759
-      });
760
-      this.$router.push("/patients/patients");
707
+        title: '错误',
708
+        message: '无效的id'
709
+      })
710
+      this.$router.push('/patients/patients')
761 711
     }
762 712
 
763
-    this.fetchInspectionReference();
713
+    this.fetchInspectionReference()
764 714
   }
765
-};
715
+}
766 716
 </script>
767 717
 
768 718
 <style>

+ 2 - 2
src/xt_pages/user/patients.vue 파일 보기

@@ -1102,7 +1102,7 @@
1102 1102
 
1103 1103
       },
1104 1104
       getCount(row) {
1105
-        console.log(row)
1105
+        
1106 1106
         return row.total_dialysis + row.user_sys_before_count
1107 1107
       },
1108 1108
       EditLapseto() {
@@ -1239,7 +1239,7 @@
1239 1239
             return false
1240 1240
           } else {
1241 1241
             this.tableData = response.data.data.patients
1242
-            // console.log('病人是', this.tableData)
1242
+             console.log('病人是', this.tableData)
1243 1243
             this.pageTotal = this.tableData.length
1244 1244
             this.total = response.data.data.total
1245 1245
           }