zhengchengwu 6 vuotta sitten
vanhempi
commit
f206857b26

+ 9 - 0
src/api/qcd.js Näytä tiedosto

@@ -0,0 +1,9 @@
1
+import request from '@/utils/request'
2
+
3
+export function getdialysistotaldata(params){
4
+    return request({
5
+        url:'/api/qcd/dialysistotaldata',
6
+        method:'get',
7
+        params:params
8
+    })
9
+}

File diff suppressed because it is too large
+ 545 - 545
src/router/index.js


+ 23 - 23
src/xt_pages/dialysis/batch_print/batch_print_order.vue Näytä tiedosto

@@ -213,9 +213,9 @@
213 213
                                         <div class="inline_block" style="float: right;">
214 214
                                             医生签名:
215 215
                                             <div class="under_line" style="width: 100px;">
216
-                                                
217
-                                                <span v-if="setAdminUserES(record.prescription, 'prescription_doctor') == ''">{{getAdminUser(record.prescription, 'prescription_doctor')}}</span>
218
-                                                <img class="es-img" :src="setAdminUserES(record.prescription, 'prescription_doctor')" alt="" srcset="" v-else style="height: 20px;">
216
+                                                <span v-if="!record.advices || typeof(record.advices[0]) == 'undefined' || typeof(record.advices[0][0]) == 'undefined'"></span>
217
+                                                <span v-else-if="setAdminUserES(record.advices[0][0], 'advice_doctor') == ''">{{getAdminUser(record.advices, 'advice_doctor')}}</span>
218
+                                                <img class="es-img" :src="setAdminUserES(record.advices[0][0], 'advice_doctor')" alt="" srcset="" v-else style="height: 20px;">
219 219
 
220 220
                                                 <!-- <img style="height: 20px;" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1552901663505&di=bf12bd343b552c6ccfb2ed12343a3141&imgtype=0&src=http%3A%2F%2Fd.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fe61190ef76c6a7ef7d58560df3faaf51f3de669b.jpg" /> -->
221 221
                                             </div>
@@ -265,21 +265,6 @@
265 265
                                                     &nbsp;{{monitor_record.result}}
266 266
                                                 </td>
267 267
                                             </tr>
268
-                                            <!-- 使整个表有7行以上 -->
269
-                                            <template v-if="record.monitor_records.length < 8">
270
-                                            <tr v-for="(num) in (8 - record.monitor_records.length)" :key="'8_' + num">
271
-                                                <td></td>
272
-                                                <td>/</td>
273
-                                                <td></td>
274
-                                                <td></td>
275
-                                                <td></td>
276
-                                                <td></td>
277
-                                                <td></td>
278
-                                                <td></td>
279
-                                                <td></td>
280
-                                                <td></td>
281
-                                            </tr>
282
-                                            </template>
283 268
                                         </tbody>
284 269
                                     </table>
285 270
                                 </td>
@@ -509,7 +494,7 @@
509 494
                                                 </td>
510 495
                                             </tr>
511 496
                                             <!-- 使整个表有5行以上 -->
512
-                                            <template v-if="record.advices.length < 5">
497
+                                            <!-- <template v-if="record.advices.length < 1">
513 498
                                             <tr v-for="(num) in (5 - record.advices.length)" :key="'5_' + num">
514 499
                                                 <td>&nbsp;</td>
515 500
                                                 <td></td>
@@ -525,7 +510,7 @@
525 510
                                                 <td></td>
526 511
                                                 <td></td>
527 512
                                             </tr>
528
-                                            </template>
513
+                                            </template> -->
529 514
                                         </tbody>
530 515
                                     </table>
531 516
                                 </td>
@@ -616,6 +601,22 @@ export default {
616 601
             if (resp.state == 1) {
617 602
                 this.records = this.records.concat(resp.data.schedules);
618 603
                 for (const recordIndex in this.records) {
604
+                    var dlegh = 0;
605
+                    if(this.records[recordIndex].monitor_records && this.records[recordIndex].monitor_records.length<8) {
606
+                        dlegh = 8 - this.records[recordIndex].monitor_records.length;
607
+                    }else {
608
+                        dlegh = 8;
609
+                    }
610
+                    if (dlegh>0) {
611
+                        if(typeof(this.records[recordIndex].monitor_records) =='undefined' || this.records[recordIndex].monitor_records==null) {
612
+                            this.records[recordIndex].monitor_records = [];
613
+                        }
614
+                        for (let index = 0; index < dlegh; index++) {
615
+                            this.records[recordIndex].monitor_records.push([]);
616
+                        }
617
+                    }
618
+
619
+                
619 620
                     var childMap = {};
620 621
                     for (const index in this.records[recordIndex].advices) {
621 622
                         if (this.records[recordIndex].advices[index].parent_id == 0) {
@@ -645,7 +646,6 @@ export default {
645 646
                     var rightAdvice = [];
646 647
                     var adlen = advices.length;
647 648
 
648
-                    debugger
649 649
                     var halfLen = adlen % 2 == 0 ? adlen / 2 : (adlen+1) / 2;
650 650
                     for (var i = 0; i < halfLen; i++) {
651 651
                         leftAdvice.push(advices[i]);
@@ -763,7 +763,7 @@ export default {
763 763
             }
764 764
         },
765 765
         setAdminUserES(key, id) {
766
-            if (key == null || typeof(key) == 'undefined' || typeof(key[id]) == 'undefined') {
766
+            if (typeof(key) == 'undefined' || key == null || typeof(key[id]) == 'undefined') {
767 767
                 return ''
768 768
             }
769 769
             if (key[id] == 0) {
@@ -776,7 +776,7 @@ export default {
776 776
             }
777 777
         },
778 778
         getAdminUser(key, id) {
779
-            if (key == null || typeof(key) == 'undefined' || typeof(key[id]) == 'undefined') {
779
+            if (typeof(key) == 'undefined' || key == null || typeof(key[id]) == 'undefined') {
780 780
                 return ''
781 781
             }
782 782
             if (key[id] == 0) {

+ 2 - 2
src/xt_pages/dialysis/dialysisPrintOrder.vue Näytä tiedosto

@@ -966,7 +966,7 @@
966 966
           </tr>
967 967
 
968 968
           <!-- 使整个表有5行以上 -->
969
-          <template v-if="advices.length < 5">
969
+          <!-- <template v-if="advices.length < 5">
970 970
           <tr v-for="(num) in (5 - advices.length)" :key="'5_' + num">
971 971
               <td>&nbsp;</td>
972 972
               <td></td>
@@ -982,7 +982,7 @@
982 982
               <td></td>
983 983
               <td></td>
984 984
           </tr>
985
-          </template>
985
+          </template> -->
986 986
           </tbody>
987 987
         </table>
988 988
 

+ 0 - 0
src/xt_pages/patientanalysis/index.vue Näytä tiedosto


+ 119 - 0
src/xt_pages/qcd/components/BarChart.vue Näytä tiedosto

@@ -0,0 +1,119 @@
1
+<template>
2
+  <div :class="className" :style="{height:height,width:width}"></div>
3
+</template>
4
+
5
+<script>
6
+import echarts from 'echarts'
7
+require('echarts/theme/macarons') // echarts theme
8
+import { debounce } from '@/utils'
9
+
10
+const animationDuration = 6000
11
+
12
+export default {
13
+  props: {
14
+    className: {
15
+      type: String,
16
+      default: 'chart'
17
+    },
18
+    width: {
19
+      type: String,
20
+      default: '100%'
21
+    },
22
+    height: {
23
+      type: String,
24
+      default: '300px'
25
+    },
26
+    title:{
27
+      type: String,
28
+      default: 'chart'
29
+    },
30
+    options:{
31
+      type:Object,
32
+      default:function(){
33
+        return {}
34
+      }
35
+    }
36
+  },
37
+  data() {
38
+    return {
39
+      chart: null,
40
+      chartOptions:{},
41
+    }
42
+  },
43
+  mounted() {
44
+    this.initChart()
45
+    this.__resizeHanlder = debounce(() => {
46
+      if (this.chart) {
47
+        this.chart.resize() 
48
+      }
49
+    }, 100)
50
+    window.addEventListener('resize', this.__resizeHanlder)
51
+  },
52
+  beforeDestroy() {
53
+    if (!this.chart) {
54
+      return
55
+    }
56
+    window.removeEventListener('resize', this.__resizeHanlder)
57
+    this.chart.dispose()
58
+    this.chart = null
59
+  },
60
+  created(){
61
+  },
62
+  watch:{
63
+    "options":function(){
64
+      this.chartOptions = this.options;
65
+      this.initChart()
66
+      this.__resizeHanlder = debounce(() => {
67
+        if (this.chart) {
68
+          this.chart.resize() 
69
+        }
70
+      }, 100)
71
+      window.addEventListener('resize', this.__resizeHanlder)
72
+    }
73
+  },
74
+  methods: {
75
+    initChart() {
76
+      console.log("this.chartOptions", this.chartOptions);
77
+      this.chart = echarts.init(this.$el, 'macarons')
78
+      this.chart.setOption({
79
+        title: {
80
+            text: this.title,
81
+        },
82
+        tooltip: {
83
+          trigger: 'axis',
84
+          axisPointer: { // 坐标轴指示器,坐标轴触发有效
85
+            type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
86
+          }
87
+        },
88
+        grid: {
89
+          left: '2%',
90
+          right: '2%',
91
+          bottom: '3%',
92
+          containLabel: true
93
+        },
94
+        xAxis: [{
95
+          type: 'category',
96
+          data:  this.chartOptions.xAxis,
97
+          axisTick: {
98
+            alignWithLabel: true
99
+          }
100
+        }],
101
+        yAxis: [{
102
+          type: 'value',
103
+          axisTick: {
104
+            show: false
105
+          }
106
+        }],
107
+        series: [{
108
+          name: '',
109
+          type: 'bar',
110
+          stack: 'vistors',
111
+          barWidth: '60%',
112
+          data: this.chartOptions.series,
113
+          animationDuration
114
+        }]
115
+      })
116
+    }
117
+  }
118
+}
119
+</script>

+ 548 - 0
src/xt_pages/qcd/dialysisTotal.vue Näytä tiedosto

@@ -0,0 +1,548 @@
1
+<template>
2
+  <div class="app-container">
3
+    <div class="cell">
4
+      <label class="title">
5
+        <span class="name">日期查询</span> :
6
+      </label>
7
+      <el-date-picker
8
+        v-model="listQuery.start_time"
9
+        prefix-icon="el-icon-date"
10
+        @change="changeTime"
11
+        :editable="false"
12
+        style="width: 196px;"
13
+        type="date"
14
+        placeholder="选择日期时间"
15
+        align="right"
16
+        :picker-options="pickerOptions"
17
+        format="yyyy-MM-dd"
18
+        value-format="yyyy-MM-dd"
19
+      ></el-date-picker>
20
+      <span class>-</span>
21
+      <el-date-picker
22
+        v-model="listQuery.end_time"
23
+        prefix-icon="el-icon-date"
24
+        @change="changeTime"
25
+        :editable="false"
26
+        style="width: 196px;"
27
+        type="date"
28
+        placeholder="选择日期时间"
29
+        align="right"
30
+        :picker-options="pickerOptions"
31
+        format="yyyy-MM-dd"
32
+        value-format="yyyy-MM-dd"
33
+      ></el-date-picker>
34
+    </div>
35
+    <div class="cell clearfix">
36
+      <label class="title">
37
+        <span class="name">统计方式</span> :
38
+      </label>
39
+      <div class="time">
40
+        <ul class>
41
+          <li
42
+            :class="item.value==statisticalMethod?'active':''"
43
+            @click="selectStatisticalMethod(item.value)"
44
+            v-for="item in statisticalMethods"
45
+            :key="item.value"
46
+          >{{item.label}}</li>
47
+        </ul>
48
+      </div>
49
+    </div>
50
+    <div class="cell clearfix">
51
+      <label class="title">
52
+        <span class="name">转归状态</span> :
53
+      </label>
54
+      <div class="time">
55
+        <ul class>
56
+          <li
57
+            :class="item.lapseto==lapsetoType?'active':''"
58
+            @click="selectLapseTo( item.lapseto)"
59
+            v-for="item in lapsetoState"
60
+            :key="item.value"
61
+          >{{item.label}}</li>
62
+        </ul>
63
+      </div>
64
+    </div>
65
+
66
+    <div class="cell">
67
+      <label class="title">
68
+        <span class="name">透析模式</span> :
69
+      </label>
70
+      <el-select v-model="listQuery.mode_id" placeholder="请选择" @change="changeModel()">
71
+        <el-option label="全部" value></el-option>
72
+        <el-option v-for="item in modeOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
73
+      </el-select>
74
+    </div>
75
+
76
+    <h4 class="hui">统计图</h4>
77
+    <hr class="huixiao">
78
+    <el-row :gutter="32">
79
+      <el-col :xs="24" :sm="24" :lg="24">
80
+        <div class="chart-wrapper">
81
+            <bar-chart :title="totitle + batotal +'人次'" :options="modesData" />
82
+        </div>
83
+      </el-col>
84
+    </el-row>
85
+
86
+    <h4 class="hui">统计表</h4>
87
+    <hr class="huixiao">
88
+    <el-table
89
+      ref="multipleTable"
90
+      :data="tableData"
91
+      border
92
+      fit
93
+      highlight-current-row
94
+      style="width: 100%;margin-top: 10px;"
95
+    >
96
+      <el-table-column label="日期" min-width="80" property="date" align="center"></el-table-column>
97
+      <el-table-column
98
+        :label="modeOptions[1].name"
99
+        v-if="listQuery.mode_id==1||listQuery.mode_id==''"
100
+        property="data[1].number"
101
+        align="center"
102
+      ></el-table-column>
103
+      <el-table-column
104
+        :label="modeOptions[2].name"
105
+        v-if="listQuery.mode_id==2||listQuery.mode_id==''"
106
+        property="data[2].number"
107
+        align="center"
108
+      ></el-table-column>
109
+      <el-table-column
110
+        :label="modeOptions[3].name"
111
+        v-if="listQuery.mode_id==3||listQuery.mode_id==''"
112
+        property="data[3].number"
113
+        align="center"
114
+      ></el-table-column>
115
+      <el-table-column
116
+        :label="modeOptions[4].name"
117
+        v-if="listQuery.mode_id==4||listQuery.mode_id==''"
118
+        property="data[4].number"
119
+        align="center"
120
+      ></el-table-column>
121
+      <el-table-column
122
+        :label="modeOptions[5].name"
123
+        v-if="listQuery.mode_id==5||listQuery.mode_id==''"
124
+        property="data[5].number"
125
+        align="center"
126
+      ></el-table-column>
127
+      <el-table-column
128
+        :label="modeOptions[6].name"
129
+        v-if="listQuery.mode_id==6||listQuery.mode_id==''"
130
+        property="data[6].number"
131
+        align="center"
132
+      ></el-table-column>
133
+      <el-table-column
134
+        :label="modeOptions[7].name"
135
+        v-if="listQuery.mode_id==7||listQuery.mode_id==''"
136
+        property="data[7].number"
137
+        align="center"
138
+      ></el-table-column>
139
+      <el-table-column
140
+        :label="modeOptions[8].name"
141
+        v-if="listQuery.mode_id==8||listQuery.mode_id==''"
142
+        property="data[8].number"
143
+        align="center"
144
+      ></el-table-column>
145
+      <el-table-column
146
+        :label="modeOptions[9].name"
147
+        v-if="listQuery.mode_id==9||listQuery.mode_id==''"
148
+        property="data[9].number"
149
+        align="center"
150
+      ></el-table-column>
151
+      <el-table-column
152
+        :label="modeOptions[10].name"
153
+        v-if="listQuery.mode_id==10||listQuery.mode_id==''"
154
+        property="data[10].number"
155
+        align="center"
156
+      ></el-table-column>
157
+      <el-table-column
158
+        :label="modeOptions[11].name"
159
+        v-if="listQuery.mode_id==11||listQuery.mode_id==''"
160
+        property="data[11].number"
161
+        align="center"
162
+      ></el-table-column>
163
+      <el-table-column
164
+        :label="modeOptions[12].name"
165
+        v-if="listQuery.mode_id==12||listQuery.mode_id==''"
166
+        property="data[12].number"
167
+        align="center"
168
+      ></el-table-column>
169
+      <el-table-column
170
+        :label="modeOptions[13].name"
171
+        v-if="listQuery.mode_id==13||listQuery.mode_id==''"
172
+        property="data[13].number"
173
+        align="center"
174
+      ></el-table-column>
175
+      <el-table-column
176
+        :label="modeOptions[14].name"
177
+        v-if="listQuery.mode_id==14||listQuery.mode_id==''"
178
+        property="data[14].number"
179
+        align="center"
180
+      ></el-table-column>
181
+      <el-table-column
182
+        :label="modeOptions[15].name"
183
+        v-if="listQuery.mode_id==15||listQuery.mode_id==''"
184
+        property="data[15].number"
185
+        align="center"
186
+      ></el-table-column>
187
+      <el-table-column
188
+        :label="modeOptions[16].name"
189
+        v-if="listQuery.mode_id==16||listQuery.mode_id==''"
190
+        property="data[16].number"
191
+        align="center"
192
+      ></el-table-column>
193
+      <el-table-column
194
+        :label="modeOptions[17].name"
195
+        v-if="listQuery.mode_id==17||listQuery.mode_id==''"
196
+        property="data[17].number"
197
+        align="center"
198
+      ></el-table-column>
199
+      <el-table-column
200
+        :label="modeOptions[18].name"
201
+        v-if="listQuery.mode_id==18||listQuery.mode_id==''"
202
+        property="data[18].number"
203
+        align="center"
204
+      ></el-table-column>
205
+      <el-table-column label="总数" min-width="80" property="total" align="center"></el-table-column>
206
+    </el-table>
207
+
208
+    <!-- <pagi-nation title="分页"></pagi-nation> -->
209
+
210
+    <el-pagination
211
+      @size-change="handleSizeChange"
212
+      @current-change="handleCurrentChange"
213
+      :current-page="listQuery.pate"
214
+      :page-sizes="[10, 20, 50, 100]"
215
+      :page-size="10"
216
+      background
217
+      style="margin-top:20px;"
218
+      layout="total, sizes, prev, pager, next, jumper"
219
+      :total="total"
220
+    ></el-pagination>
221
+  </div>
222
+</template>
223
+
224
+
225
+<script>
226
+import { getdialysistotaldata } from "@/api/qcd";
227
+import BarChart from "./components/BarChart";
228
+export default {
229
+  name: "dialysisTotal",
230
+  data() {
231
+    return {
232
+      total: 0,
233
+      totitle:'全部',
234
+      batotal:0,
235
+      modesData: {
236
+        xAxis:[],
237
+        series:[],
238
+      },
239
+      listQuery: {
240
+        start_time: "",
241
+        end_time: "",
242
+        page: 1,
243
+        limit: 10,
244
+        lapseto: 0,
245
+        statistical_method: 0,
246
+        mode_id: ""
247
+      },
248
+      modeOptions: {},
249
+      tableData: [],
250
+      statisticalMethod: 0,
251
+      statisticalMethods: [
252
+        { value: 0, label: "全部" },
253
+        { value: 1, label: "开始透析" },
254
+        { value: 2, label: "排班" }
255
+      ],
256
+      lapsetoType: 0,
257
+      lapsetoState: [
258
+        { value: 0, label: "全部", source: 0, lapseto: 0 },
259
+        { value: 1, label: "转出", source: 0, lapseto: 2 },
260
+        { value: 2, label: "留治", source: 0, lapseto: 1 }
261
+      ],
262
+      pickerOptions: {
263
+        shortcuts: [
264
+          {
265
+            text: "今天",
266
+            onClick(picker) {
267
+              picker.$emit("pick", new Date());
268
+            }
269
+          },
270
+          {
271
+            text: "昨天",
272
+            onClick(picker) {
273
+              const date = new Date();
274
+              date.setTime(date.getTime() - 3600 * 1000 * 24);
275
+              picker.$emit("pick", date);
276
+            }
277
+          },
278
+          {
279
+            text: "一周前",
280
+            onClick(picker) {
281
+              const date = new Date();
282
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
283
+              picker.$emit("pick", date);
284
+            }
285
+          },
286
+          {
287
+            text: "清空",
288
+            onClick(picker) {
289
+              picker.$emit("pick");
290
+            }
291
+          }
292
+        ]
293
+      }
294
+    };
295
+  },
296
+  created() {
297
+    this.modeOptions = this.$store.getters.treatment_mode;
298
+
299
+    var nowDate = new Date();
300
+    var nowYear = nowDate.getFullYear();
301
+    var nowMonth = nowDate.getMonth() + 1;
302
+    var nowDay = nowDate.getDate();
303
+    this.listQuery.end_time =
304
+      nowYear +
305
+      "-" +
306
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
307
+      "-" +
308
+      (nowDay < 10 ? "0" + nowDay : nowDay);
309
+    nowDate.setMonth(nowDate.getMonth() - 3);
310
+    nowYear = nowDate.getFullYear();
311
+    nowMonth = nowDate.getMonth() + 1;
312
+    nowDay = nowDate.getDate();
313
+    this.listQuery.start_time =
314
+      nowYear +
315
+      "-" +
316
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
317
+      "-" +
318
+      (nowDay < 10 ? "0" + nowDay : nowDay);
319
+    this.getList();
320
+  },
321
+  methods: {
322
+    getList() {
323
+      getdialysistotaldata(this.listQuery).then(response => {
324
+        if (response.data.state == 0) {
325
+          this.$message.error(response.data.msg);
326
+          return false;
327
+        } else {
328
+          this.tableData = [];
329
+          var dtd = response.data.data.dtd;
330
+          var dd = {};
331
+          for (const index in dtd) {
332
+            if (!(dtd[index].date in dd)) {
333
+              dd[dtd[index].date] = {};
334
+            }
335
+            if (
336
+              !(dtd[index].mode_id in dd[dtd[index].date]) &&
337
+              dtd[index].mode_id != "0"
338
+            ) {
339
+              dd[dtd[index].date][dtd[index].mode_id] = dtd[index];
340
+            }
341
+          }
342
+          for (const key in dd) {
343
+            var total = 0;
344
+            for (const mkey in this.modeOptions) {
345
+              if (mkey in dd[key]) {
346
+                dd[key][mkey].mode = this.modeOptions[mkey].name;
347
+                total += parseInt(dd[key][mkey].number);
348
+              } else {
349
+                dd[key][mkey] = {
350
+                  mode: this.modeOptions[mkey].name,
351
+                  mode_id: mkey,
352
+                  number: 0,
353
+                  date: key
354
+                };
355
+              }
356
+            }
357
+            this.tableData.push({ date: key, data: dd[key], total: total });
358
+          }
359
+          this.total = response.data.data.total;
360
+
361
+          this.modesData = {
362
+            xAxis:[],
363
+            series:[],
364
+          };
365
+          var ttd = response.data.data.ttd;
366
+          var modeMap = {};
367
+          var batotal = 0;
368
+          for (const index in ttd) {
369
+            if (ttd[index].mode_id == "0") {
370
+              continue;
371
+            }
372
+            modeMap[ttd[index].mode_id] = ttd[index];
373
+          }
374
+          for (const key in this.modeOptions) {
375
+            this.modesData.xAxis.push(this.modeOptions[key].name);
376
+            if (key in modeMap) {
377
+              this.modesData.series.push( parseInt(modeMap[key].number));
378
+              batotal += parseInt(modeMap[key].number);
379
+            } else {
380
+              this.modesData.series.push(0);
381
+            }
382
+          }
383
+          this.batotal = batotal;
384
+        }
385
+      });
386
+    },
387
+    changeTime() {
388
+      this.getList();
389
+    },
390
+    selectStatisticalMethod(type) {
391
+      this.statisticalMethod = type;
392
+      this.listQuery.statistical_method = type;
393
+      if (type == 1) {
394
+          this.totitle = '总透析';
395
+      }else if(type == 2) {
396
+          this.totitle = '总排班';
397
+      }else {
398
+          this.totitle = '全部';
399
+      }
400
+      this.getList();
401
+    },
402
+    selectLapseTo(lapseto) {
403
+      this.lapsetoType = lapseto;
404
+      this.listQuery.lapseto = lapseto;
405
+      this.getList();
406
+    },
407
+    changeModel() {
408
+      this.getList();
409
+    },
410
+    handleSizeChange(val) {
411
+      this.listQuery.limit = val;
412
+      this.getList();
413
+    },
414
+    handleCurrentChange(val) {
415
+      this.listQuery.page = val;
416
+      this.getList();
417
+    }
418
+  },
419
+  components: {
420
+    BarChart
421
+  }
422
+};
423
+</script>
424
+
425
+<style rel="stylesheet/scss" lang="scss" scoped>
426
+.app-container {
427
+//   margin: 20px;
428
+    margin-bottom: 50px;
429
+  font-size: 15px;
430
+  .filter-container {
431
+    padding-bottom: 5px;
432
+  }
433
+  .hui {
434
+    color: #909399;
435
+    margin-bottom: 5px;
436
+  }
437
+  .huixiao {
438
+    border: solid 1px #ebeef5;
439
+  }
440
+  .el-pagination {
441
+    float: right !important;
442
+  }
443
+  .search-component {
444
+    width: 500px;
445
+    .searchBox {
446
+      width: 300px;
447
+      height: 36px;
448
+      line-height: 36px;
449
+      padding-left: 15px;
450
+      border: 1px #dcdfe6 solid;
451
+      border-right: none;
452
+      outline: none;
453
+      float: left;
454
+      border-radius: 6px 0 0 6px;
455
+      font-size: 14px;
456
+      color: #333;
457
+      background: #fff;
458
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
459
+    }
460
+    .searchBtn {
461
+      background-color: #409eff;
462
+      color: #fff;
463
+      font-size: 15px;
464
+      text-align: center;
465
+      height: 36px;
466
+      line-height: 36px;
467
+      float: left;
468
+      outline: none;
469
+      width: 70px;
470
+      border: none;
471
+      border-radius: 0 6px 6px 0;
472
+      font-family: "Microsoft Yahei";
473
+      cursor: pointer;
474
+    }
475
+  }
476
+  .cell {
477
+    margin: 0px 0 15px 0;
478
+    -moz-box-sizing: border-box;
479
+    -webkit-box-sizing: border-box;
480
+    -o-box-sizing: border-box;
481
+    -ms-box-sizing: border-box;
482
+    box-sizing: border-box;
483
+    display: -webkit-box;
484
+    display: -ms-flexbox;
485
+    // display: flex;
486
+    -webkit-box-align: flex-start;
487
+    -ms-flex-align: flex-start;
488
+    align-items: flex-start;
489
+    text-align: left;
490
+    justify-content: flex-start;
491
+    color: #333;
492
+    .title {
493
+      width: 80px;
494
+      display: inline-block;
495
+      font-weight: normal;
496
+      color: #909399;
497
+      padding: 6px 0;
498
+      font-weight: 700;
499
+      .name {
500
+        width: 60px;
501
+        text-align: justify;
502
+        text-justify: distribute-all-lines;
503
+        text-align-last: justify;
504
+        -moz-text-align-last: justify;
505
+        -webkit-text-align-last: justify;
506
+        display: inline-block;
507
+      }
508
+    }
509
+    .time {
510
+      -webkit-box-flex: 1;
511
+      -ms-flex: 1;
512
+      flex: 1;
513
+      ul {
514
+        padding: 0;
515
+        margin: 0;
516
+        li {
517
+          float: left;
518
+          list-style: none;
519
+          cursor: pointer;
520
+          padding: 6px 10px;
521
+          color: #606266;
522
+          border-radius: 4px;
523
+          margin: 0 4px 0 0;
524
+          &:hover {
525
+            background: #409eff;
526
+            color: #fff;
527
+          }
528
+        }
529
+        .active {
530
+          background: #409eff;
531
+          color: #fff;
532
+        }
533
+      }
534
+    }
535
+  }
536
+  .amount {
537
+    font-weight: normal;
538
+    padding: 10px 0 0 0;
539
+    color: #606266;
540
+    font-size: 14px;
541
+    span {
542
+      color: #ef2525;
543
+      font-family: "Arial";
544
+      padding: 0 2px;
545
+    }
546
+  }
547
+}
548
+</style>

+ 375 - 0
src/xt_pages/qcd/processIndicators.vue Näytä tiedosto

@@ -0,0 +1,375 @@
1
+<template>
2
+  <div class="app-container">
3
+    <div class="cell">
4
+      <label class="title">
5
+        <span class="name">日期查询</span> :
6
+      </label>
7
+      <el-date-picker
8
+        v-model="listQuery.start_time"
9
+        prefix-icon="el-icon-date"
10
+        @change="changeTime"
11
+        :editable="false"
12
+        style="width: 196px;"
13
+        type="date"
14
+        placeholder="选择日期时间"
15
+        align="right"
16
+        :picker-options="pickerOptions"
17
+        format="yyyy-MM-dd"
18
+        value-format="yyyy-MM-dd"
19
+      ></el-date-picker>
20
+      <span class>-</span>
21
+      <el-date-picker
22
+        v-model="listQuery.end_time"
23
+        prefix-icon="el-icon-date"
24
+        @change="changeTime"
25
+        :editable="false"
26
+        style="width: 196px;"
27
+        type="date"
28
+        placeholder="选择日期时间"
29
+        align="right"
30
+        :picker-options="pickerOptions"
31
+        format="yyyy-MM-dd"
32
+        value-format="yyyy-MM-dd"
33
+      ></el-date-picker>
34
+    </div>
35
+    <div class="cell clearfix">
36
+      <label class="title">
37
+        <span class="name">透析龄</span> :
38
+      </label>
39
+      <div class="time">
40
+        <ul class>
41
+          <li
42
+            :class="item.value==dialysisAge?'active':''"
43
+            @click="selectdialysisAges(item.value)"
44
+            v-for="item in dialysisAgeOptions"
45
+            :key="item.value"
46
+          >{{item.label}}</li>
47
+        </ul>
48
+      </div>
49
+    </div>
50
+    <div class="cell clearfix">
51
+      <label class="title">
52
+        <span class="name">转归状态</span> :
53
+      </label>
54
+      <div class="time">
55
+        <ul class>
56
+          <li
57
+            :class="item.lapseto==lapsetoType?'active':''"
58
+            @click="selectLapseTo( item.lapseto)"
59
+            v-for="item in lapsetoState"
60
+            :key="item.value"
61
+          >{{item.label}}</li>
62
+        </ul>
63
+      </div>
64
+    </div>
65
+
66
+    <div class="cell">
67
+      <label class="title">
68
+        <span class="name">检验项目</span> :
69
+      </label>
70
+      <el-select v-model="listQuery.project_id" placeholder="请选择" @change="changeModel()">
71
+        <el-option label="全部" value></el-option>
72
+        <el-option v-for="item in projectOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
73
+      </el-select>
74
+    </div>
75
+
76
+    <h4 class="hui">统计图</h4>
77
+    <hr class="huixiao">
78
+    <el-row :gutter="32">
79
+      <el-col :xs="24" :sm="24" :lg="24">
80
+        <div class="chart-wrapper">
81
+            <bar-chart :title="'人次'" :options="modesData" />
82
+        </div>
83
+      </el-col>
84
+    </el-row>
85
+
86
+    <h4 class="hui">统计表</h4>
87
+    <hr class="huixiao">
88
+    <el-table
89
+      ref="multipleTable"
90
+      :data="tableData"
91
+      border
92
+      fit
93
+      highlight-current-row
94
+      style="width: 100%;margin-top: 10px;"
95
+    >
96
+      <el-table-column label="日期" min-width="80" property="date" align="center"></el-table-column>
97
+      <el-table-column label="总数" min-width="80" property="total" align="center"></el-table-column>
98
+    </el-table>
99
+
100
+    <!-- <pagi-nation title="分页"></pagi-nation> -->
101
+
102
+    <el-pagination
103
+      @size-change="handleSizeChange"
104
+      @current-change="handleCurrentChange"
105
+      :current-page="listQuery.pate"
106
+      :page-sizes="[10, 20, 50, 100]"
107
+      :page-size="10"
108
+      background
109
+      style="margin-top:20px;"
110
+      layout="total, sizes, prev, pager, next, jumper"
111
+      :total="total"
112
+    ></el-pagination>
113
+  </div>
114
+</template>
115
+
116
+
117
+<script>
118
+import { getdialysistotaldata } from "@/api/qcd";
119
+import BarChart from "./components/BarChart";
120
+export default {
121
+  name: "processIndicators",
122
+  data() {
123
+    return {
124
+      total: 0,
125
+      modesData: {
126
+        xAxis:[],
127
+        series:[],
128
+      },
129
+      listQuery: {
130
+        start_time: "",
131
+        end_time: "",
132
+        page: 1,
133
+        limit: 10,
134
+        lapseto: 0,
135
+        dialysis_age: 0,
136
+        mode_id: ""
137
+      },
138
+      projectOptions: {},
139
+      tableData: [],
140
+      dialysisAge: 0,
141
+      dialysisAgeOptions: [
142
+        { value: 0, label: "全部" },
143
+        { value: 1, label: "大于三个月" },
144
+        { value: 2, label: "小于三个月" }
145
+      ],
146
+      lapsetoType: 0,
147
+      lapsetoState: [
148
+        { value: 0, label: "全部", source: 0, lapseto: 0 },
149
+        { value: 1, label: "转出", source: 0, lapseto: 2 },
150
+        { value: 2, label: "留治", source: 0, lapseto: 1 }
151
+      ],
152
+      pickerOptions: {
153
+        shortcuts: [
154
+          {
155
+            text: "今天",
156
+            onClick(picker) {
157
+              picker.$emit("pick", new Date());
158
+            }
159
+          },
160
+          {
161
+            text: "昨天",
162
+            onClick(picker) {
163
+              const date = new Date();
164
+              date.setTime(date.getTime() - 3600 * 1000 * 24);
165
+              picker.$emit("pick", date);
166
+            }
167
+          },
168
+          {
169
+            text: "一周前",
170
+            onClick(picker) {
171
+              const date = new Date();
172
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
173
+              picker.$emit("pick", date);
174
+            }
175
+          },
176
+          {
177
+            text: "清空",
178
+            onClick(picker) {
179
+              picker.$emit("pick");
180
+            }
181
+          }
182
+        ]
183
+      }
184
+    };
185
+  },
186
+  created() {
187
+
188
+    var nowDate = new Date();
189
+    var nowYear = nowDate.getFullYear();
190
+    var nowMonth = nowDate.getMonth() + 1;
191
+    var nowDay = nowDate.getDate();
192
+    this.listQuery.end_time =
193
+      nowYear +
194
+      "-" +
195
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
196
+      "-" +
197
+      (nowDay < 10 ? "0" + nowDay : nowDay);
198
+    nowDate.setMonth(nowDate.getMonth() - 3);
199
+    nowYear = nowDate.getFullYear();
200
+    nowMonth = nowDate.getMonth() + 1;
201
+    nowDay = nowDate.getDate();
202
+    this.listQuery.start_time =
203
+      nowYear +
204
+      "-" +
205
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
206
+      "-" +
207
+      (nowDay < 10 ? "0" + nowDay : nowDay);
208
+    this.getList();
209
+  },
210
+  methods: {
211
+    getList() {
212
+      getdialysistotaldata(this.listQuery).then(response => {
213
+        if (response.data.state == 0) {
214
+          this.$message.error(response.data.msg);
215
+          return false;
216
+        } else {
217
+          
218
+        }
219
+      });
220
+    },
221
+    changeTime() {
222
+      this.getList();
223
+    },
224
+    selectdialysisAges(type) {
225
+      this.dialysisAge = type;
226
+      this.listQuery.dialysis_age = type;
227
+      this.getList();
228
+    },
229
+    selectLapseTo(lapseto) {
230
+      this.lapsetoType = lapseto;
231
+      this.listQuery.lapseto = lapseto;
232
+      this.getList();
233
+    },
234
+    changeModel() {
235
+      this.getList();
236
+    },
237
+    handleSizeChange(val) {
238
+      this.listQuery.limit = val;
239
+      this.getList();
240
+    },
241
+    handleCurrentChange(val) {
242
+      this.listQuery.page = val;
243
+      this.getList();
244
+    }
245
+  },
246
+  components: {
247
+    BarChart
248
+  }
249
+};
250
+</script>
251
+
252
+<style rel="stylesheet/scss" lang="scss" scoped>
253
+.app-container {
254
+//   margin: 20px;
255
+    margin-bottom: 50px;
256
+  font-size: 15px;
257
+  .filter-container {
258
+    padding-bottom: 5px;
259
+  }
260
+  .hui {
261
+    color: #909399;
262
+    margin-bottom: 5px;
263
+  }
264
+  .huixiao {
265
+    border: solid 1px #ebeef5;
266
+  }
267
+  .el-pagination {
268
+    float: right !important;
269
+  }
270
+  .search-component {
271
+    width: 500px;
272
+    .searchBox {
273
+      width: 300px;
274
+      height: 36px;
275
+      line-height: 36px;
276
+      padding-left: 15px;
277
+      border: 1px #dcdfe6 solid;
278
+      border-right: none;
279
+      outline: none;
280
+      float: left;
281
+      border-radius: 6px 0 0 6px;
282
+      font-size: 14px;
283
+      color: #333;
284
+      background: #fff;
285
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
286
+    }
287
+    .searchBtn {
288
+      background-color: #409eff;
289
+      color: #fff;
290
+      font-size: 15px;
291
+      text-align: center;
292
+      height: 36px;
293
+      line-height: 36px;
294
+      float: left;
295
+      outline: none;
296
+      width: 70px;
297
+      border: none;
298
+      border-radius: 0 6px 6px 0;
299
+      font-family: "Microsoft Yahei";
300
+      cursor: pointer;
301
+    }
302
+  }
303
+  .cell {
304
+    margin: 0px 0 15px 0;
305
+    -moz-box-sizing: border-box;
306
+    -webkit-box-sizing: border-box;
307
+    -o-box-sizing: border-box;
308
+    -ms-box-sizing: border-box;
309
+    box-sizing: border-box;
310
+    display: -webkit-box;
311
+    display: -ms-flexbox;
312
+    // display: flex;
313
+    -webkit-box-align: flex-start;
314
+    -ms-flex-align: flex-start;
315
+    align-items: flex-start;
316
+    text-align: left;
317
+    justify-content: flex-start;
318
+    color: #333;
319
+    .title {
320
+      width: 80px;
321
+      display: inline-block;
322
+      font-weight: normal;
323
+      color: #909399;
324
+      padding: 6px 0;
325
+      font-weight: 700;
326
+      .name {
327
+        width: 60px;
328
+        text-align: justify;
329
+        text-justify: distribute-all-lines;
330
+        text-align-last: justify;
331
+        -moz-text-align-last: justify;
332
+        -webkit-text-align-last: justify;
333
+        display: inline-block;
334
+      }
335
+    }
336
+    .time {
337
+      -webkit-box-flex: 1;
338
+      -ms-flex: 1;
339
+      flex: 1;
340
+      ul {
341
+        padding: 0;
342
+        margin: 0;
343
+        li {
344
+          float: left;
345
+          list-style: none;
346
+          cursor: pointer;
347
+          padding: 6px 10px;
348
+          color: #606266;
349
+          border-radius: 4px;
350
+          margin: 0 4px 0 0;
351
+          &:hover {
352
+            background: #409eff;
353
+            color: #fff;
354
+          }
355
+        }
356
+        .active {
357
+          background: #409eff;
358
+          color: #fff;
359
+        }
360
+      }
361
+    }
362
+  }
363
+  .amount {
364
+    font-weight: normal;
365
+    padding: 10px 0 0 0;
366
+    color: #606266;
367
+    font-size: 14px;
368
+    span {
369
+      color: #ef2525;
370
+      font-family: "Arial";
371
+      padding: 0 2px;
372
+    }
373
+  }
374
+}
375
+</style>

+ 5 - 2
src/xt_pages/workforce/components/template_table.vue Näytä tiedosto

@@ -245,6 +245,9 @@ export default {
245 245
 
246 246
             for (let index = 0; index < this.template.items.length; index++) {
247 247
                 const template_item = this.template.items[index];
248
+                if (template_item.patient == null) {
249
+                    continue;
250
+                }
248 251
 
249 252
                 for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
250 253
                     const device_number = this.opera_device_numbers[d_i];
@@ -255,7 +258,7 @@ export default {
255 258
                         cell_item.pid = template_item.patient_id
256 259
                         cell_item.name = template_item.patient.name
257 260
                         cell_item.treat_mode_id = template_item.treat_mode
258
-                        cell_item.treat_mode = this.treat_modes[template_item.treat_mode].name
261
+                        cell_item.treat_mode = template_item.treat_mode?this.treat_modes[template_item.treat_mode].name:''
259 262
                         device_number.total += 1
260 263
 
261 264
                         // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
@@ -264,7 +267,7 @@ export default {
264 267
                         o_cell_item.pid = template_item.patient_id
265 268
                         o_cell_item.name = template_item.patient.name
266 269
                         o_cell_item.treat_mode_id = template_item.treat_mode
267
-                        o_cell_item.treat_mode = this.treat_modes[template_item.treat_mode].name
270
+                        o_cell_item.treat_mode = template_item.treat_mode?this.treat_modes[template_item.treat_mode].name:''
268 271
                         o_device_number.total += 1
269 272
 
270 273
                         break

+ 13 - 13
src/xt_permission.js Näytä tiedosto

@@ -10,19 +10,19 @@ const permissionWhiteList = loginWhiteList.concat(['/']) // 权限验证白名
10 10
 
11 11
 router.beforeEach((to, from, next) => {
12 12
   // 线上注释
13
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
14
-  //   store.dispatch('VerifyConfigList', []).then(() => {
15
-  //   next()
16
-  //   })
17
-  // }
18
-  // if (store.getters.permission_routers === undefined) {
19
-  //   store.dispatch('xt_GenerateRoutes', []).then(() => {
20
-  //     next()
21
-  //   })
22
-  // } else {
23
-  //   next()
24
-  // }
25
-  // return
13
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
14
+    store.dispatch('VerifyConfigList', []).then(() => {
15
+    next()
16
+    })
17
+  }
18
+  if (store.getters.permission_routers === undefined) {
19
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
20
+      next()
21
+    })
22
+  } else {
23
+    next()
24
+  }
25
+  return
26 26
   // 线上注释
27 27
 
28 28
   NProgress.start()