Parcourir la source

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

XMLWAN il y a 5 ans
Parent
révision
0bb7afe032

+ 42 - 24
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue Voir le fichier

@@ -110,7 +110,18 @@ export default {
110 110
               normal: {
111 111
                 show: true,
112 112
                 position: "top",
113
-                formatter: "{c}次"
113
+                formatter: (params) => {
114
+                  if(this.obj.length > 0){
115
+                      let str = ''
116
+                      str = params.data +'次' + '\n(参考值'+ this.obj[params.dataIndex] +'次)'
117
+                      console.log(str)
118
+                    return str
119
+                  }else{
120
+                    let str = ''
121
+                    str = params.data+'次'
122
+                    return str
123
+                  }
124
+                }
114 125
               }
115 126
             },
116 127
             //配置样式
@@ -168,18 +179,11 @@ export default {
168 179
         xAxis: [],
169 180
         series: []
170 181
       },
182
+      obj:[]
171 183
     };
172 184
   },
173 185
   methods: {
174
-    changeTime(val) {
175
-      var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
176
-      if (time > 0) {
177
-        this.$message.error("结束时间不能小于开始时间");
178
-        this.listQuery.start_time = "";
179
-      } else {
180
-        this.getInspectionTotalCount();
181
-      }
182
-    },
186
+    changeTime() {},
183 187
     changeEndTime(val) {
184 188
       var time =
185 189
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -187,13 +191,8 @@ export default {
187 191
         this.$message.error("结束时间不能小于开始时间");
188 192
         this.listQuery.end_time = "";
189 193
       } else {
190
-        this.getInspectionTotalCount()
191 194
       }
192 195
     },
193
-    getTimestamp(time) {
194
-      // 把时间日期转成时间戳
195
-      return new Date(time).getTime() / 1000;
196
-    },
197 196
     getCurrentOrgPatients(){
198 197
       getCurrentOrgPatients().then(response=>{
199 198
          var patients = response.data.data.patients
@@ -205,9 +204,9 @@ export default {
205 204
           if(response.data.state === 1){
206 205
             var Inspection = response.data.data.Inspection
207 206
             this.tableData = Inspection
208
-           // console.log("Inspection",Inspection)
207
+            console.log("Inspection",Inspection)
209 208
             var counts = response.data.data.counts
210
-           // console.log("counts",counts)
209
+            console.log("counts",counts)
211 210
             var arr = []
212 211
             for(let i=0;i<Inspection.length;i++){
213 212
                for(let j=0;j<counts.length;j++){
@@ -216,7 +215,7 @@ export default {
216 215
                  }
217 216
                }
218 217
             }
219
-           // console.log("arr",arr)
218
+            console.log("arr",arr)
220 219
             var hash = {};
221 220
             var i = 0;
222 221
             var res = [];
@@ -232,7 +231,7 @@ export default {
232 231
             res.map(item => {
233 232
              item.Count = eval(item.Count.join('+'))
234 233
             })
235
-           // console.log(11111,res)
234
+            console.log(11111,res)
236 235
 
237 236
             for (const key in this.tableData) {
238 237
               this.modesData.xAxis.push(this.tableData[key].project_name);
@@ -243,19 +242,22 @@ export default {
243 242
                 this.modesData.series.push(0);
244 243
               }
245 244
             }
245
+            
246 246
             this.chart.series[0].data = this.modesData.series
247 247
             this.chart.xAxis.data = this.modesData.xAxis
248
-           // console.log(2222,this.modesData)
248
+            console.log(2222,this.modesData)
249 249
           }
250 250
       })
251 251
     },
252 252
 
253 253
     //获取单个病人数据
254 254
     handleChange(val){
255
+      this.modesData.series = []
256
+      this.modesData.xAxis = []
255 257
        getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
256 258
           if(response.data.state === 1){
257 259
             var patientdetail = response.data.data.patientdetail
258
-           // console.log("patientdetail",patientdetail)
260
+            console.log("patientdetail",patientdetail)
259 261
             var arr=[]
260 262
             for(let i=0;i<this.tableData.length;i++){
261 263
               for(let j=0;j<patientdetail.length;j++){
@@ -264,7 +266,23 @@ export default {
264 266
                  }
265 267
               }
266 268
             }
267
-           // console.log("arr",arr)
269
+            console.log("arr",arr)
270
+           let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
271
+           let day = parseInt(time / (1000 * 60 * 60 * 24))
272
+           console.log("time",parseInt(time / (1000 * 60 * 60 * 24)))
273
+            for (const key in this.tableData) {
274
+              this.modesData.xAxis.push(this.tableData[key].project_name);
275
+              if (key in arr) {
276
+                this.modesData.series.push(parseInt(arr[key].Count));
277
+                this.obj.push(Math.round(day / arr[key].InspectionFrequency))
278
+                // batotal += parseInt(res[key].Count);
279
+              } else {
280
+                this.modesData.series.push(0);
281
+                this.obj.push(0)
282
+              }
283
+            }
284
+            this.chart.series[0].data = this.modesData.series
285
+            this.chart.xAxis.data = this.modesData.xAxis
268 286
           }
269 287
        })
270 288
     },
@@ -274,7 +292,7 @@ export default {
274 292
       getSearchPatientInfo(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
275 293
          if(response.data.state  === 1){
276 294
            var PatientsInfo = response.data.data.PatientsInfo
277
-         //  console.log("PatientsInfo",PatientsInfo)
295
+           console.log("PatientsInfo",PatientsInfo)
278 296
            var arr = []
279 297
            for(let i=0;i<this.tableData.length;i++){
280 298
              for(let j=0;j<PatientsInfo.length;j++){
@@ -283,7 +301,7 @@ export default {
283 301
                  }
284 302
              }
285 303
            }
286
-         //  console.log("arr",arr)
304
+           console.log("arr",arr)
287 305
          }
288 306
       })
289 307
     }

+ 2 - 0
src/xt_pages/qcd/treatmentControlAnalysis/components/TimeAll.vue Voir le fichier

@@ -254,6 +254,8 @@ export default {
254 254
      this.geStatistics()
255 255
    },
256 256
     geStatistics(){
257
+      this.modesData.series = []
258
+      this.modesData.xAxis = []
257 259
       geStatistics(this.listQuery).then(response=>{
258 260
         if(response.data.state === 1){
259 261
           var dtd =  response.data.data.statistics