Browse Source

统计配置开发

XMLWAN 4 years ago
parent
commit
7acff140eb

+ 24 - 0
src/api/common/common.js View File

203
     params: params
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
+  console.log('startime', startime)
217
+  console.log('endtime', endtime)
218
+  const params = {
219
+    startime: startime,
220
+    endtime: endtime,
221
+    page: page,
222
+    limit: limit
223
+  }
224
+  return request({
225
+    url: '/com/api/getdialysislist',
226
+    method: 'get',
227
+    params: params
228
+  })
229
+}

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

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

+ 83 - 87
src/store/modules/xt_user.js View File

98
       state.template_info.id = cur_info.template_info.id
98
       state.template_info.id = cur_info.template_info.id
99
       state.template_info.org_id = cur_info.template_info.org_id
99
       state.template_info.org_id = cur_info.template_info.org_id
100
       state.template_info.template_id = cur_info.template_info.template_id
100
       state.template_info.template_id = cur_info.template_info.template_id
101
-
102
     },
101
     },
103
 
102
 
104
     SET_FILEDS: (state, payload) => {
103
     SET_FILEDS: (state, payload) => {
159
 
158
 
160
       state.urlfors = []
159
       state.urlfors = []
161
       state.fileds = []
160
       state.fileds = []
162
-
163
     }
161
     }
164
   },
162
   },
165
 
163
 
177
       commit('SET_ZONE_SELECTED', zone_selected)
175
       commit('SET_ZONE_SELECTED', zone_selected)
178
     },
176
     },
179
     SetSubscibePatients({
177
     SetSubscibePatients({
180
-                          commit,
181
-                          state
182
-                        }) {
178
+      commit,
179
+      state
180
+    }) {
183
       commit('SET_SUBSCIBE_PATIENT')
181
       commit('SET_SUBSCIBE_PATIENT')
184
     },
182
     },
185
 
183
 
186
     VerifyToken({
184
     VerifyToken({
187
-                  commit,
188
-                  state
189
-                }, token) {
190
-
185
+      commit,
186
+      state
187
+    }, token) {
191
       // console.log('验证 token 之前:token = ' + token)
188
       // console.log('验证 token 之前:token = ' + token)
192
       return new Promise((resolve, reject) => {
189
       return new Promise((resolve, reject) => {
193
         var cacheInfo = getAdminUserInfoCache()
190
         var cacheInfo = getAdminUserInfoCache()
200
 
197
 
201
         // console.log('登录信息缓存:', cacheInfo)
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
             } else {
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
     ModifyAdminUserInfo({
274
     ModifyAdminUserInfo({
279
-                          commit,
280
-                          state
281
-                        }, params) {
275
+      commit,
276
+      state
277
+    }, params) {
282
       commit('MODIFY_USER_INFO', {
278
       commit('MODIFY_USER_INFO', {
283
         user_name: params.user_name,
279
         user_name: params.user_name,
284
         avatar: params.avatar
280
         avatar: params.avatar
299
       )
295
       )
300
     },
296
     },
301
     ModifyOrgInfo({
297
     ModifyOrgInfo({
302
-                    commit,
303
-                    state
304
-                  }, params) {
298
+      commit,
299
+      state
300
+    }, params) {
305
       commit('MODIFY_ORG_INFO', {
301
       commit('MODIFY_ORG_INFO', {
306
         org_name: params.org_name,
302
         org_name: params.org_name,
307
         org_short_name: params.org_short_name
303
         org_short_name: params.org_short_name
342
     // }
338
     // }
343
     // 登出
339
     // 登出
344
     FrontendLogout({
340
     FrontendLogout({
345
-                     commit
346
-                   }) {
341
+      commit
342
+    }) {
347
       commit('CLEAR_USER_INFO')
343
       commit('CLEAR_USER_INFO')
348
       removeAdminUserInfoCache()
344
       removeAdminUserInfoCache()
349
     }, updateFiledConfigList({ commit }, object) {
345
     }, updateFiledConfigList({ commit }, object) {
350
-
351
       var oldFiledList = getFiledConfigList()
346
       var oldFiledList = getFiledConfigList()
347
+      console.log('oldFiledList', oldFiledList)
352
       var infoJSON = JSON.parse(oldFiledList)
348
       var infoJSON = JSON.parse(oldFiledList)
353
       console.log(object)
349
       console.log(object)
354
       return new Promise((resolve, reject) => {
350
       return new Promise((resolve, reject) => {
377
         resolve()
373
         resolve()
378
       })
374
       })
379
     }, ModifyAdminUserOrgInfo({ commit, state }, obj) {
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
       this.commit('SET_URLFORS', obj)
378
       this.commit('SET_URLFORS', obj)
383
-    },ModifyFiled({ commit, state }, obj) {
379
+    }, ModifyFiled({ commit, state }, obj) {
384
       commit('SET_FILEDS', obj)
380
       commit('SET_FILEDS', obj)
385
     }
381
     }
386
   }
382
   }

+ 6 - 1
src/xt_pages/data/components/dialysisSummary.vue View File

130
         })
130
         })
131
         .catch(() => {});
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
 </script>
140
 </script>
136
 
141
 

+ 1 - 1
src/xt_pages/data/showConfig.vue View File

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

+ 261 - 85
src/xt_pages/qcd/basicInformationAnalysis.vue View File

55
                 <span class="point"></span>
55
                 <span class="point"></span>
56
                 <p class="infoTitle">透析总量({{total}}次)</p>
56
                 <p class="infoTitle">透析总量({{total}}次)</p>
57
               </div>
57
               </div>
58
-            
58
+
59
               <div class="borderBox">
59
               <div class="borderBox">
60
                <div v-for="(item,index) in modetype" :key="index">
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
                </div>
121
                </div>
64
               </div>
122
               </div>
65
             </div>
123
             </div>
161
                 <p class="infoTitle">透龄统计</p>
219
                 <p class="infoTitle">透龄统计</p>
162
               </div>
220
               </div>
163
               <div class="borderBox1">
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
               </div>
230
               </div>
173
             </div>
231
             </div>
174
           </div>
232
           </div>
225
       ageCount:[],
283
       ageCount:[],
226
       ageTotal:0,
284
       ageTotal:0,
227
       otherTotal:0,
285
       otherTotal:0,
286
+      totalone:0,
287
+      totaltwo:0,
288
+      totalthree:0,
228
     };
289
     };
229
   },
290
   },
230
   methods: {
291
   methods: {
232
       // 把时间日期转成时间戳
293
       // 把时间日期转成时间戳
233
       return new Date(time).getTime() / 1000;
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
     changeEndTime(val) {
318
     changeEndTime(val) {
319
+       var timeEnd=Date.parse(val)/1000
320
+       var timeStar =Date.parse(this.listQuery.start_time)/1000
237
       var time =
321
       var time =
238
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
322
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
239
       if (time < 0) {
323
       if (time < 0) {
240
         this.$message.error("结束时间不能小于开始时间");
324
         this.$message.error("结束时间不能小于开始时间");
241
         this.listQuery.end_time = "";
325
         this.listQuery.end_time = "";
242
       } else {
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
     selectLapseTo(state) {
341
     selectLapseTo(state) {
342
+      this.stateType = state;
343
+      this.listQuery.state = state;
246
       //获取本月当前机构的透析模式
344
       //获取本月当前机构的透析模式
247
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
345
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
248
       console.log("开始时间",startDate)
346
       console.log("开始时间",startDate)
249
       const endDate = moment(new Date()).format('YYYY-MM-DD')
347
       const endDate = moment(new Date()).format('YYYY-MM-DD')
250
-     // console.log("结束时间",endDate) 
348
+     // console.log("结束时间",endDate)
251
       var now = new Date()
349
       var now = new Date()
252
-      var nowMonth = now.getMonth(); //当前月 
253
-      var nowYear = now.getFullYear(); //当前年 
350
+      var nowMonth = now.getMonth(); //当前月
351
+      var nowYear = now.getFullYear(); //当前年
254
       //本月的开始时间
352
       //本月的开始时间
255
-      var monthStartDate = new Date(nowYear, nowMonth, 1); 
353
+      var monthStartDate = new Date(nowYear, nowMonth, 1);
256
       var timeStar=Date.parse(monthStartDate)/1000;//s
354
       var timeStar=Date.parse(monthStartDate)/1000;//s
257
      // console.log("本月第一天",timeStar)
355
      // console.log("本月第一天",timeStar)
258
       //本月的结束时间
356
       //本月的结束时间
261
      // console.log("本月最后一天",timeEnd)
359
      // console.log("本月最后一天",timeEnd)
262
       //本月
360
       //本月
263
       if(state == 0){
361
       if(state == 0){
264
-         this.stateType = state;
265
-         this.listQuery.state = state;
266
        //统计透析总量
362
        //统计透析总量
267
         this.getDialysisModeType(startDate,endDate)
363
         this.getDialysisModeType(startDate,endDate)
268
         //统计转归状态
364
         //统计转归状态
276
         //统计透析年龄
372
         //统计透析年龄
277
         this.getTotalDialysisCount(timeStar,timeEnd)
373
         this.getTotalDialysisCount(timeStar,timeEnd)
278
       }
374
       }
375
+      //近三月
279
       if(state == 1){
376
       if(state == 1){
280
-      
281
-       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
282
-        console.log("三月前",nowMonth)
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)
283
       }
397
       }
284
-      this.stateType = state;
285
-      this.listQuery.state = state;
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
+
286
     },
447
     },
287
     getDialysisModeType(startDate,endDate){
448
     getDialysisModeType(startDate,endDate){
288
       getDialysisModeType(startDate,endDate).then(response=>{
449
       getDialysisModeType(startDate,endDate).then(response=>{
292
             var total =  response.data.data.total
453
             var total =  response.data.data.total
293
             console.log("total",total)
454
             console.log("total",total)
294
             this.total = total
455
             this.total = total
295
-           for(let i=0;i<modetype.length;i++){
296
-             if(modetype[i].mode_id == 1){
297
-               modetype[i].mode_id = "HD"
298
-             }
299
-             if(modetype[i].mode_id == 2){
300
-               modetype[i].mode_id = "HDF"
301
-             }
302
-             if(modetype[i].mode_id == 3){
303
-               modetype[i].mode_id = "HD+HP"
304
-             }
305
-              if(modetype[i].mode_id == 4){
306
-               modetype[i].mode_id = "HP"
307
-             }
308
-              if(modetype[i].mode_id == 5){
309
-               modetype[i].mode_id = "HF"
310
-             }
311
-             if(modetype[i].mode_id == 6){
312
-               modetype[i].mode_id = "SCUF"
313
-             }
314
-             if(modetype[i].mode_id == 7){
315
-               modetype[i].mode_id = "IUF"
316
-             }
317
-              if(modetype[i].mode_id == 8){
318
-               modetype[i].mode_id = "HFHD"
319
-             }
320
-             if(modetype[i].mode_id == 9){
321
-               modetype[i].mode_id = "HFHD+HP"
322
-             }
323
-             if(modetype[i].mode_id == 10){
324
-               modetype[i].mode_id = "PHF"
325
-             }
326
-             if(modetype[i].mode_id == 11){
327
-               modetype[i].mode_id = "HFR"
328
-             }
329
-            if(modetype[i].mode_id == 12){
330
-               modetype[i].mode_id = "HDF+HP"
331
-             }
332
-              if(modetype[i].mode_id == 13){
333
-               modetype[i].mode_id = "HFHD+HP"
334
-             }
335
-              if(modetype[i].mode_id == 14){
336
-               modetype[i].mode_id = "腹水回输"
337
-             }
338
-            if(modetype[i].mode_id == 19){
339
-               modetype[i].mode_id = "IUF+HD"
340
-             }
341
-           }
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
+           //}
342
            this.modetype = modetype
503
            this.modetype = modetype
343
            console.log("modetype",modetype)
504
            console.log("modetype",modetype)
344
-         
505
+
345
          }
506
          }
346
       })
507
       })
347
     },
508
     },
399
             //   if(infectious[i].disease_id == 6){
560
             //   if(infectious[i].disease_id == 6){
400
             //     infectious[i].disease_id = "梅毒"
561
             //     infectious[i].disease_id = "梅毒"
401
             //   }
562
             //   }
402
-               
563
+
403
             // }
564
             // }
404
              var otherTotal = response.data.data.otherTotal
565
              var otherTotal = response.data.data.otherTotal
405
              this.otherTotal = otherTotal
566
              this.otherTotal = otherTotal
416
           this.ageTotal =  response.data.data.total
577
           this.ageTotal =  response.data.data.total
417
          // var two = response.data.data.two
578
          // var two = response.data.data.two
418
         //  console.log("two",two)
579
         //  console.log("two",two)
419
-       
580
+
420
          }
581
          }
421
       })
582
       })
422
     },
583
     },
424
     getTotalDialysisCount(timeStar,timeEnd){
585
     getTotalDialysisCount(timeStar,timeEnd){
425
       getTotalDialysisCount(timeStar,timeEnd).then(response=>{
586
       getTotalDialysisCount(timeStar,timeEnd).then(response=>{
426
          if(response.data.state == 1){
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)
427
            var patients = response.data.data.patients
592
            var patients = response.data.data.patients
428
-           var now = new Date()
429
-           var nowMonth = now.getMonth(); //当前月 
430
-           var nowYear = now.getFullYear(); //当前年 
431
-           var notime =  moment(new Date()).format('YYYY-MM-DD')
432
-           var nowdataunix =  Date.parse(notime)/1000
433
-           console.log("档期是---------------",nowdataunix)
593
+           var arr =[]
594
+           var arrtwo = []
595
+           var arrthree = []
434
            for(let i=0;i<patients.length;i++){
596
            for(let i=0;i<patients.length;i++){
435
-             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)
436
              }
605
              }
437
            }
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)
438
            console.log("patients",patients)
613
            console.log("patients",patients)
614
+
439
             var date =  new Date(1212508800)
615
             var date =  new Date(1212508800)
440
           console.log("date",date)
616
           console.log("date",date)
441
-          
617
+
442
          }
618
          }
443
       })
619
       })
444
     }
620
     }
448
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
624
       const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
449
       console.log("开始时间",startDate)
625
       console.log("开始时间",startDate)
450
       const endDate = moment(new Date()).format('YYYY-MM-DD')
626
       const endDate = moment(new Date()).format('YYYY-MM-DD')
451
-     // console.log("结束时间",endDate) 
627
+     // console.log("结束时间",endDate)
452
       var now = new Date()
628
       var now = new Date()
453
-      var nowMonth = now.getMonth(); //当前月 
454
-      var nowYear = now.getFullYear(); //当前年 
629
+      var nowMonth = now.getMonth(); //当前月
630
+      var nowYear = now.getFullYear(); //当前年
455
       //本月的开始时间
631
       //本月的开始时间
456
-      var monthStartDate = new Date(nowYear, nowMonth, 1); 
632
+      var monthStartDate = new Date(nowYear, nowMonth, 1);
457
       var timeStar=Date.parse(monthStartDate)/1000;//s
633
       var timeStar=Date.parse(monthStartDate)/1000;//s
458
      // console.log("本月第一天",timeStar)
634
      // console.log("本月第一天",timeStar)
459
       //本月的结束时间
635
       //本月的结束时间

+ 3 - 0
src/xt_pages/qcd/patientAnalysis/dialysisAge.vue View File

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

+ 13 - 1
src/xt_pages/qcd/patientComplianceDetails.vue View File

96
 import echarts from "echarts";
96
 import echarts from "echarts";
97
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
97
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
98
 import LineChart from "../qcd/components/LineChart";
98
 import LineChart from "../qcd/components/LineChart";
99
+import { uParseTime } from "@/utils/tools";
99
 export default {
100
 export default {
100
   components: {
101
   components: {
101
     LineChart,
102
     LineChart,
266
     },
267
     },
267
     clickQuality(index) {
268
     clickQuality(index) {
268
       this.quality = index;
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
 </script>
284
 </script>

+ 80 - 173
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
8
         </el-form-item>
8
         </el-form-item>
9
       </el-form>
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
       <label class="title">
10
       <label class="title">
19
         <span class="name">日期查询</span> :
11
         <span class="name">日期查询</span> :
20
       </label>
12
       </label>
47
     <el-container>
39
     <el-container>
48
       <div style="width:150px">
40
       <div style="width:150px">
49
         <div class="tableTitle">患者列表</div>
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">
43
+          <el-table-column prop="date" label="日期" width="70">
44
+            <template slot-scope="scope">{{getTime(scope.row.created_time)}}</template>
45
+          </el-table-column>
46
+          <el-table-column prop="name" label="姓名" width="80">
47
+            <template slot-scope="scope">{{ scope.row.name }}</template>
48
+          </el-table-column>
53
         </el-table>
49
         </el-table>
54
       </div>
50
       </div>
55
       <div style="padding-left:10px;flex:1">
51
       <div style="padding-left:10px;flex:1">
56
         <div class="tableTitle">统计表</div>
52
         <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>
53
+        <el-table :data="DialysisData" style="width: 100%" border>
54
+          <el-table-column fixed prop="date" label="姓名">
55
+            <template slot-scope="scope">{{ scope.row.name }}</template>
56
+          </el-table-column>
57
+          <el-table-column prop="name" label="年龄">
58
+             <template slot-scope="scope">{{ scope.row.id_card_no }}</template>
59
+          </el-table-column>
60
+          <el-table-column prop="province" label="透析号">
61
+              <template slot-scope="scope">{{ scope.row.dialysis_no }}</template>
62
+          </el-table-column>
63
+          <el-table-column prop="city" label="透析模式">
64
+              <template slot-scope="scope">{{ scope.row.mode_id }}</template>
65
+           </el-table-column>
66
+          <el-table-column prop="address" label="透析总次数"></el-table-column>
64
         </el-table>
67
         </el-table>
65
 
68
 
66
         <el-pagination
69
         <el-pagination
82
 
85
 
83
 
86
 
84
 <script>
87
 <script>
88
+ import { getCurrentOrgPatients,getDialysisList } from "@/api/common/common";
89
+ import { uParseTime } from "@/utils/tools";
85
 export default {
90
 export default {
86
   data() {
91
   data() {
87
     return {
92
     return {
89
         start_time: "",
94
         start_time: "",
90
         end_time: "",
95
         end_time: "",
91
         page: 1,
96
         page: 1,
92
-        limit: 10
97
+        limit: 20
93
       },
98
       },
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
-      ],
99
+      total:0,
100
+      options: [],
116
       value: "请选项",
101
       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
-      ]
102
+      tableData: [],
103
+      DialysisData: [],
104
+      patientsData:[],
249
     };
105
     };
250
   },
106
   },
251
   methods: {
107
   methods: {
258
         this.listQuery.end_time = "";
114
         this.listQuery.end_time = "";
259
       } else {
115
       } else {
260
       }
116
       }
117
+    },
118
+    getCurrentOrgPatients(){
119
+      getCurrentOrgPatients().then(response=>{
120
+         if(response.data.state == 1){
121
+           var patients = response.data.data.patients
122
+           console.log("病人列表3",patients)
123
+           this.patientsData = patients
124
+         }
125
+      })
126
+    },
127
+    getTime(time) {
128
+      return uParseTime(time, "{y}-{m}-{d}");
129
+    },
130
+    getDialysisList(){
131
+      getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
132
+         if(response.data.state === 1){
133
+           var  dialysislist =  response.data.data.dialysislist
134
+           console.log("dialysislist",dialysislist)
135
+           this.DialysisData = dialysislist
136
+           var total = response.data.data.total
137
+           console.log("total",total)
138
+           this.total = total
139
+         }
140
+      })
261
     }
141
     }
142
+  },
143
+  created(){
144
+    var nowDate = new Date();
145
+    var nowYear = nowDate.getFullYear();
146
+    var nowMonth = nowDate.getMonth() + 1;
147
+    var nowDay = nowDate.getDate();
148
+    this.listQuery.end_time =
149
+      nowYear +
150
+      "-" +
151
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
152
+      "-" +
153
+      (nowDay < 10 ? "0" + nowDay : nowDay);
154
+    nowDate.setMonth(nowDate.getMonth() - 3);
155
+    nowYear = nowDate.getFullYear();
156
+    nowMonth = nowDate.getMonth() + 1;
157
+    nowDay = nowDate.getDate();
158
+    this.listQuery.start_time =
159
+      nowYear +
160
+      "-" +
161
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
162
+      "-" +
163
+      (nowDay < 10 ? "0" + nowDay : nowDay);
164
+    
165
+     //获取该机构下的所有患者
166
+     this.getCurrentOrgPatients()
167
+     //统计列表
168
+     this.getDialysisList()
262
   }
169
   }
263
 };
170
 };
264
 </script>
171
 </script>