浏览代码

Merge remote-tracking branch 'origin/update' into update_branch

csx 6 年前
父节点
当前提交
1266a528c5

+ 16 - 0
src/api/qcd.js 查看文件

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
+}
10
+export function GetProcessIndicatorsData(params){
11
+    return request({
12
+        url:'/api/qcd/processindicatorsdata',
13
+        method:'get',
14
+        params:params
15
+    })
16
+}

文件差异内容过多而无法显示
+ 545 - 545
src/router/index.js


+ 23 - 23
src/xt_pages/dialysis/batch_print/batch_print_order.vue 查看文件

213
                                         <div class="inline_block" style="float: right;">
213
                                         <div class="inline_block" style="float: right;">
214
                                             医生签名:
214
                                             医生签名:
215
                                             <div class="under_line" style="width: 100px;">
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
                                                 <!-- <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" /> -->
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
                                             </div>
221
                                             </div>
265
                                                     &nbsp;{{monitor_record.result}}
265
                                                     &nbsp;{{monitor_record.result}}
266
                                                 </td>
266
                                                 </td>
267
                                             </tr>
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
                                         </tbody>
268
                                         </tbody>
284
                                     </table>
269
                                     </table>
285
                                 </td>
270
                                 </td>
509
                                                 </td>
494
                                                 </td>
510
                                             </tr>
495
                                             </tr>
511
                                             <!-- 使整个表有5行以上 -->
496
                                             <!-- 使整个表有5行以上 -->
512
-                                            <template v-if="record.advices.length < 5">
497
+                                            <!-- <template v-if="record.advices.length < 1">
513
                                             <tr v-for="(num) in (5 - record.advices.length)" :key="'5_' + num">
498
                                             <tr v-for="(num) in (5 - record.advices.length)" :key="'5_' + num">
514
                                                 <td>&nbsp;</td>
499
                                                 <td>&nbsp;</td>
515
                                                 <td></td>
500
                                                 <td></td>
525
                                                 <td></td>
510
                                                 <td></td>
526
                                                 <td></td>
511
                                                 <td></td>
527
                                             </tr>
512
                                             </tr>
528
-                                            </template>
513
+                                            </template> -->
529
                                         </tbody>
514
                                         </tbody>
530
                                     </table>
515
                                     </table>
531
                                 </td>
516
                                 </td>
616
             if (resp.state == 1) {
601
             if (resp.state == 1) {
617
                 this.records = this.records.concat(resp.data.schedules);
602
                 this.records = this.records.concat(resp.data.schedules);
618
                 for (const recordIndex in this.records) {
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
                     var childMap = {};
620
                     var childMap = {};
620
                     for (const index in this.records[recordIndex].advices) {
621
                     for (const index in this.records[recordIndex].advices) {
621
                         if (this.records[recordIndex].advices[index].parent_id == 0) {
622
                         if (this.records[recordIndex].advices[index].parent_id == 0) {
645
                     var rightAdvice = [];
646
                     var rightAdvice = [];
646
                     var adlen = advices.length;
647
                     var adlen = advices.length;
647
 
648
 
648
-                    debugger
649
                     var halfLen = adlen % 2 == 0 ? adlen / 2 : (adlen+1) / 2;
649
                     var halfLen = adlen % 2 == 0 ? adlen / 2 : (adlen+1) / 2;
650
                     for (var i = 0; i < halfLen; i++) {
650
                     for (var i = 0; i < halfLen; i++) {
651
                         leftAdvice.push(advices[i]);
651
                         leftAdvice.push(advices[i]);
763
             }
763
             }
764
         },
764
         },
765
         setAdminUserES(key, id) {
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
                 return ''
767
                 return ''
768
             }
768
             }
769
             if (key[id] == 0) {
769
             if (key[id] == 0) {
776
             }
776
             }
777
         },
777
         },
778
         getAdminUser(key, id) {
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
                 return ''
780
                 return ''
781
             }
781
             }
782
             if (key[id] == 0) {
782
             if (key[id] == 0) {

+ 2 - 2
src/xt_pages/dialysis/dialysisPrintOrder.vue 查看文件

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

+ 0 - 0
src/xt_pages/patientanalysis/index.vue 查看文件


+ 119 - 0
src/xt_pages/qcd/components/BarChart.vue 查看文件

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>

+ 108 - 0
src/xt_pages/qcd/components/PieChart.vue 查看文件

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
+export default {
11
+  props: {
12
+    className: {
13
+      type: String,
14
+      default: 'chart'
15
+    },
16
+    width: {
17
+      type: String,
18
+      default: '100%'
19
+    },
20
+    height: {
21
+      type: String,
22
+      default: '320px'
23
+    },
24
+    title:{
25
+      type: String,
26
+      default: 'chart'
27
+    },
28
+    options:{
29
+      type:Object,
30
+      default:function(){
31
+        return {}
32
+      }
33
+    }
34
+  },
35
+  data() {
36
+    return {
37
+      chart: null,
38
+      chartOptions:{},
39
+    }
40
+  },
41
+  mounted() {
42
+    this.initChart()
43
+    this.__resizeHanlder = debounce(() => {
44
+      if (this.chart) {
45
+        this.chart.resize()
46
+      }
47
+    }, 100)
48
+    window.addEventListener('resize', this.__resizeHanlder)
49
+  },
50
+  beforeDestroy() {
51
+    if (!this.chart) {
52
+      return
53
+    }
54
+    window.removeEventListener('resize', this.__resizeHanlder)
55
+    this.chart.dispose()
56
+    this.chart = null
57
+  },
58
+  created(){
59
+    this.chartOptions = this.options;
60
+  },
61
+  methods: {
62
+    initChart() {
63
+      this.chart = echarts.init(this.$el, 'macarons')
64
+
65
+      this.chart.setOption({
66
+        title: {
67
+            text: this.title,
68
+        },
69
+        tooltip: {
70
+          trigger: 'item',
71
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
72
+        },
73
+        legend: {
74
+          left: 'center',
75
+          bottom: '10',
76
+          data: this.chartOptions.legend,
77
+        },
78
+        calculable: true,
79
+        series: [
80
+          {
81
+            name: '',
82
+            type: 'pie',
83
+            roseType: 'radius',
84
+            radius: [15, 95],
85
+            center: ['50%', '38%'],
86
+            data: this.chartOptions.series,
87
+            animationEasing: 'cubicInOut',
88
+            animationDuration: 2600
89
+          }
90
+        ]
91
+      })
92
+    }
93
+  },
94
+  watch:{
95
+    "options":function(){
96
+      this.chartOptions = this.options;
97
+      this.initChart()
98
+      this.__resizeHanlder = debounce(() => {
99
+        if (this.chart) {
100
+          this.chart.resize() 
101
+        }
102
+      }, 100)
103
+      window.addEventListener('resize', this.__resizeHanlder)
104
+    }
105
+    
106
+  } 
107
+}
108
+</script>

+ 548 - 0
src/xt_pages/qcd/dialysisTotal.vue 查看文件

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>

+ 478 - 0
src/xt_pages/qcd/processIndicators.vue 查看文件

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.project_id" :label="item.project_name" :value="item.project_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
+            <pie-chart title="完成情况" :options="CompletionOptions"/>
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
+      :span-method="mergeSpan"
92
+      border
93
+      fit
94
+      highlight-current-row
95
+      style="width: 100%;margin-top: 10px;"
96
+    >
97
+      
98
+      <el-table-column label="透析号" min-width="80" property="patient_id" align="center">
99
+        <template slot-scope="scope"><span>{{getPatientDialysisNo(scope.row.patient_id)}}</span></template>
100
+      </el-table-column>
101
+      <el-table-column label="姓名" min-width="80" property="patient_id" align="center">
102
+        <template slot-scope="scope"><span>{{getPatientName(scope.row.patient_id)}}</span></template>
103
+      </el-table-column>
104
+      <el-table-column label="检查项目" min-width="80" property="project_id" align="center">
105
+        <template slot-scope="scope"><span>{{getProjectName(scope.row.project_id)}}</span></template>
106
+      </el-table-column>
107
+      <el-table-column label="检查日期" min-width="80" property="inspect_date" align="center">
108
+        <template slot-scope="scope"><span>{{getTime(scope.row.inspect_date, '{y}{m}{d}')}}</span></template>
109
+      </el-table-column>
110
+    </el-table>
111
+
112
+    <!-- <pagi-nation title="分页"></pagi-nation> -->
113
+
114
+    <el-pagination
115
+      @size-change="handleSizeChange"
116
+      @current-change="handleCurrentChange"
117
+      :current-page="listQuery.pate"
118
+      :page-sizes="[10, 20, 50, 100]"
119
+      :page-size="10"
120
+      background
121
+      style="margin-top:20px;"
122
+      layout="total, sizes, prev, pager, next, jumper"
123
+      :total="total"
124
+    ></el-pagination>
125
+  </div>
126
+</template>
127
+
128
+
129
+<script>
130
+import { GetProcessIndicatorsData  } from "@/api/qcd";
131
+import PieChart from './components/PieChart'
132
+import {uParseTime} from "@/utils/tools";
133
+export default {
134
+  name: "dialysisTotal",
135
+  data() {
136
+    return {
137
+      total: 0,
138
+      projectOptions:{},
139
+      patientMap:{},
140
+        CompletionOptions:{
141
+            legend:[],
142
+            series:[],
143
+        },
144
+      listQuery: {
145
+        start_time: "",
146
+        end_time: "",
147
+        page: 1,
148
+        limit: 10,
149
+        lapseto: 0,
150
+        project_id:'',
151
+        dialysis_age:0,
152
+      },
153
+      tableData: [],
154
+      tableRowData:[],
155
+      lapsetoType: 0,
156
+      lapsetoState: [
157
+        { value: 0, label: "全部", source: 0, lapseto: 0 },
158
+        { value: 1, label: "转出", source: 0, lapseto: 2 },
159
+        { value: 2, label: "留治", source: 0, lapseto: 1 }
160
+      ],
161
+      dialysisAge: 0,
162
+      dialysisAgeOptions: [
163
+        { value: 0, label: "全部" },
164
+        { value: 1, label: "大于三个月" },
165
+        { value: 2, label: "小于三个月" }
166
+      ],
167
+      pickerOptions: {
168
+        shortcuts: [
169
+          {
170
+            text: "今天",
171
+            onClick(picker) {
172
+              picker.$emit("pick", new Date());
173
+            }
174
+          },
175
+          {
176
+            text: "昨天",
177
+            onClick(picker) {
178
+              const date = new Date();
179
+              date.setTime(date.getTime() - 3600 * 1000 * 24);
180
+              picker.$emit("pick", date);
181
+            }
182
+          },
183
+          {
184
+            text: "一周前",
185
+            onClick(picker) {
186
+              const date = new Date();
187
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
188
+              picker.$emit("pick", date);
189
+            }
190
+          },
191
+          {
192
+            text: "清空",
193
+            onClick(picker) {
194
+              picker.$emit("pick");
195
+            }
196
+          }
197
+        ]
198
+      }
199
+    };
200
+  },
201
+  created() {
202
+
203
+    var nowDate = new Date();
204
+    var nowYear = nowDate.getFullYear();
205
+    var nowMonth = nowDate.getMonth() + 1;
206
+    var nowDay = nowDate.getDate();
207
+    this.listQuery.end_time =
208
+      nowYear +
209
+      "-" +
210
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
211
+      "-" +
212
+      (nowDay < 10 ? "0" + nowDay : nowDay);
213
+    nowDate.setMonth(nowDate.getMonth() - 3);
214
+    nowYear = nowDate.getFullYear();
215
+    nowMonth = nowDate.getMonth() + 1;
216
+    nowDay = nowDate.getDate();
217
+    this.listQuery.start_time =
218
+      nowYear +
219
+      "-" +
220
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
221
+      "-" +
222
+      (nowDay < 10 ? "0" + nowDay : nowDay);
223
+    this.getList();
224
+  },
225
+  methods: {
226
+    getList() {
227
+      GetProcessIndicatorsData(this.listQuery).then(response => {
228
+        if (response.data.state == 0) {
229
+          this.$message.error(response.data.msg);
230
+          return false;
231
+        } else {
232
+          this.tableData = [];
233
+          this.tableRowData = [];
234
+          this.total = response.data.data.total;
235
+          var unfinishedcount = response.data.data.unfinishedcount;
236
+          var finishedcount = this.total - unfinishedcount;
237
+          this.CompletionOptions = {
238
+            legend:[],
239
+            series:[],
240
+          };
241
+          this.CompletionOptions.legend.push('定时完成人次');
242
+          this.CompletionOptions.series.push({
243
+                value:finishedcount,name:'定时完成人次'
244
+            });
245
+          this.CompletionOptions.legend.push('未时完成人次');
246
+          this.CompletionOptions.series.push({
247
+                value:unfinishedcount,name:'未时完成人次'
248
+            });
249
+
250
+          
251
+        
252
+          var references = response.data.data.references;
253
+          for (const index in references) {
254
+            if (references[index].project_id in this.projectOptions) {
255
+              continue;  
256
+            }
257
+            this.$set(this.projectOptions, references[index].project_id, references[index]);
258
+          }
259
+
260
+          var patients = response.data.data.patients;
261
+          for (const index in patients) {
262
+            if (patients[index].id in this.patientMap) {
263
+              continue;  
264
+            }
265
+            this.$set(this.patientMap, patients[index].id, patients[index]);
266
+          }
267
+          var temInspections = {};
268
+          var inspections = response.data.data.inspections;
269
+          for (const index in inspections) {
270
+            var key = inspections[index].inspect_date + '_' + inspections[index].patient_id;
271
+            if (!(key in temInspections)) {
272
+              temInspections[key] = {};
273
+            }
274
+            if (inspections[index].project_id in temInspections[key]) {
275
+              continue;
276
+            }
277
+            temInspections[key][inspections[index].project_id] = inspections[index];
278
+          }
279
+          var rowIndex = 0;
280
+          var childIndex = 0;
281
+          for (const key in temInspections) {
282
+            this.tableRowData.push(1);
283
+            var parentIndex = rowIndex;
284
+            childIndex = 0;
285
+            for (const child in temInspections[key]) {
286
+              this.tableData.push(temInspections[key][child]);
287
+              if(childIndex>0) {
288
+                this.tableRowData[parentIndex] += 1;
289
+                this.tableRowData.push(0);
290
+              }
291
+              childIndex++;
292
+              rowIndex++;
293
+            }
294
+          }
295
+
296
+        }
297
+      });
298
+    },
299
+    changeTime() {
300
+      this.getList();
301
+    },
302
+    selectLapseTo(lapseto) {
303
+      this.lapsetoType = lapseto;
304
+      this.listQuery.lapseto = lapseto;
305
+      this.getList();
306
+    },
307
+    selectdialysisAges(type) {
308
+      this.dialysisAge = type;
309
+      this.listQuery.dialysis_age = type;
310
+      this.getList();
311
+    },
312
+    changeModel() {
313
+      this.getList();
314
+    },
315
+    handleSizeChange(val) {
316
+      this.listQuery.limit = val;
317
+      this.getList();
318
+    },
319
+    handleCurrentChange(val) {
320
+      this.listQuery.page = val;
321
+      this.getList();
322
+    },
323
+    getTime(value, temp) {
324
+        if (value != undefined) {
325
+          return uParseTime(value, temp)
326
+        }
327
+        return ""
328
+    },
329
+    getProjectName(id) {
330
+      return (id in this.projectOptions) ? this.projectOptions[id].project_name:'';
331
+    },
332
+    getPatientName(id) {
333
+      return (id in this.patientMap) ? this.patientMap[id].name:'';
334
+    },
335
+    getPatientDialysisNo(id) {
336
+      return (id in this.patientMap) ? this.patientMap[id].dialysis_no:'';
337
+    },
338
+    mergeSpan({row, column, rowIndex, columnIndex}) {
339
+      if (columnIndex === 0 || columnIndex === 1 || columnIndex === 3) {
340
+        const _row = this.tableRowData[rowIndex];
341
+        const _col = _row > 0 ? 1 : 0;
342
+        return {
343
+          rowspan: _row,
344
+          colspan: _col
345
+        }
346
+      }
347
+    },
348
+  },
349
+  components: {
350
+      PieChart
351
+  }
352
+};
353
+</script>
354
+
355
+<style rel="stylesheet/scss" lang="scss" scoped>
356
+.app-container {
357
+//   margin: 20px;
358
+    margin-bottom: 50px;
359
+  font-size: 15px;
360
+  .filter-container {
361
+    padding-bottom: 5px;
362
+  }
363
+  .hui {
364
+    color: #909399;
365
+    margin-bottom: 5px;
366
+  }
367
+  .huixiao {
368
+    border: solid 1px #ebeef5;
369
+  }
370
+  .el-pagination {
371
+    float: right !important;
372
+  }
373
+  .search-component {
374
+    width: 500px;
375
+    .searchBox {
376
+      width: 300px;
377
+      height: 36px;
378
+      line-height: 36px;
379
+      padding-left: 15px;
380
+      border: 1px #dcdfe6 solid;
381
+      border-right: none;
382
+      outline: none;
383
+      float: left;
384
+      border-radius: 6px 0 0 6px;
385
+      font-size: 14px;
386
+      color: #333;
387
+      background: #fff;
388
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
389
+    }
390
+    .searchBtn {
391
+      background-color: #409eff;
392
+      color: #fff;
393
+      font-size: 15px;
394
+      text-align: center;
395
+      height: 36px;
396
+      line-height: 36px;
397
+      float: left;
398
+      outline: none;
399
+      width: 70px;
400
+      border: none;
401
+      border-radius: 0 6px 6px 0;
402
+      font-family: "Microsoft Yahei";
403
+      cursor: pointer;
404
+    }
405
+  }
406
+  .cell {
407
+    margin: 0px 0 15px 0;
408
+    -moz-box-sizing: border-box;
409
+    -webkit-box-sizing: border-box;
410
+    -o-box-sizing: border-box;
411
+    -ms-box-sizing: border-box;
412
+    box-sizing: border-box;
413
+    display: -webkit-box;
414
+    display: -ms-flexbox;
415
+    // display: flex;
416
+    -webkit-box-align: flex-start;
417
+    -ms-flex-align: flex-start;
418
+    align-items: flex-start;
419
+    text-align: left;
420
+    justify-content: flex-start;
421
+    color: #333;
422
+    .title {
423
+      width: 80px;
424
+      display: inline-block;
425
+      font-weight: normal;
426
+      color: #909399;
427
+      padding: 6px 0;
428
+      font-weight: 700;
429
+      .name {
430
+        width: 60px;
431
+        text-align: justify;
432
+        text-justify: distribute-all-lines;
433
+        text-align-last: justify;
434
+        -moz-text-align-last: justify;
435
+        -webkit-text-align-last: justify;
436
+        display: inline-block;
437
+      }
438
+    }
439
+    .time {
440
+      -webkit-box-flex: 1;
441
+      -ms-flex: 1;
442
+      flex: 1;
443
+      ul {
444
+        padding: 0;
445
+        margin: 0;
446
+        li {
447
+          float: left;
448
+          list-style: none;
449
+          cursor: pointer;
450
+          padding: 6px 10px;
451
+          color: #606266;
452
+          border-radius: 4px;
453
+          margin: 0 4px 0 0;
454
+          &:hover {
455
+            background: #409eff;
456
+            color: #fff;
457
+          }
458
+        }
459
+        .active {
460
+          background: #409eff;
461
+          color: #fff;
462
+        }
463
+      }
464
+    }
465
+  }
466
+  .amount {
467
+    font-weight: normal;
468
+    padding: 10px 0 0 0;
469
+    color: #606266;
470
+    font-size: 14px;
471
+    span {
472
+      color: #ef2525;
473
+      font-family: "Arial";
474
+      padding: 0 2px;
475
+    }
476
+  }
477
+}
478
+</style>

+ 6 - 2
src/xt_pages/workforce/components/template_table.vue 查看文件

245
 
245
 
246
             for (let index = 0; index < this.template.items.length; index++) {
246
             for (let index = 0; index < this.template.items.length; index++) {
247
                 const template_item = this.template.items[index];
247
                 const template_item = this.template.items[index];
248
+                if (template_item.patient == null) {
249
+                    continue;
250
+                }
248
 
251
 
249
                 for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
252
                 for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
250
                     const device_number = this.opera_device_numbers[d_i];
253
                     const device_number = this.opera_device_numbers[d_i];
255
                         cell_item.pid = template_item.patient_id
258
                         cell_item.pid = template_item.patient_id
256
                         cell_item.name = template_item.patient.name
259
                         cell_item.name = template_item.patient.name
257
                         cell_item.treat_mode_id = template_item.treat_mode
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
                         device_number.total += 1
262
                         device_number.total += 1
260
 
263
 
261
                         // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
264
                         // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
264
                         o_cell_item.pid = template_item.patient_id
267
                         o_cell_item.pid = template_item.patient_id
265
                         o_cell_item.name = template_item.patient.name
268
                         o_cell_item.name = template_item.patient.name
266
                         o_cell_item.treat_mode_id = template_item.treat_mode
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
                         o_device_number.total += 1
271
                         o_device_number.total += 1
269
 
272
 
270
                         break
273
                         break
563
                         message: "已保存",
566
                         message: "已保存",
564
                         type: "success",
567
                         type: "success",
565
                     })
568
                     })
569
+                    this.template.items = resp.data.items
566
                 } else {
570
                 } else {
567
                     this.$message.error(resp.msg)
571
                     this.$message.error(resp.msg)
568
                 }
572
                 }

+ 13 - 13
src/xt_permission.js 查看文件

10
 
10
 
11
 router.beforeEach((to, from, next) => {
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
   NProgress.start()
28
   NProgress.start()