Browse Source

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

陈少旭 7 months ago
parent
commit
c174589e5c
34 changed files with 6730 additions and 92 deletions
  1. 102 0
      src/router/modules/Dialysisanalysis.js
  2. 11 0
      src/router/modules/patient.js
  3. 9 9
      src/utils/tools.js
  4. 715 0
      src/xt_pages/Dialysisanalysis/weightblood/components/after_Blood.vue
  5. 715 0
      src/xt_pages/Dialysisanalysis/weightblood/components/before_Blood.vue
  6. 600 0
      src/xt_pages/Dialysisanalysis/weightblood/components/blood_table.vue
  7. 681 0
      src/xt_pages/Dialysisanalysis/weightblood/components/dialyze_after.vue
  8. 682 0
      src/xt_pages/Dialysisanalysis/weightblood/components/dry_denominator.vue
  9. 711 0
      src/xt_pages/Dialysisanalysis/weightblood/components/dry_weight.vue
  10. 682 0
      src/xt_pages/Dialysisanalysis/weightblood/components/list_denominator.vue
  11. 618 0
      src/xt_pages/Dialysisanalysis/weightblood/components/weight_table.vue
  12. 276 0
      src/xt_pages/Dialysisanalysis/weightblood/index.vue
  13. 4 2
      src/xt_pages/dialysis/PatientBox.vue
  14. 1 1
      src/xt_pages/dialysis/batch_print/batch_print_order_forty.vue
  15. 4 3
      src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue
  16. 3 0
      src/xt_pages/dialysis/details/index.vue
  17. 1 1
      src/xt_pages/dialysis/doctorAdvicePrint.vue
  18. 2 2
      src/xt_pages/dialysis/newDoctorAdvice.vue
  19. 1 1
      src/xt_pages/dialysis/template/DialysisPrintOrderForty.vue
  20. 125 2
      src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue
  21. 15 7
      src/xt_pages/outpatientCharges/listPrint.vue
  22. 226 0
      src/xt_pages/outpatientCharges/listTemplate/listPrintforu.vue
  23. 14 5
      src/xt_pages/outpatientCharges/statementTemplate/privateChargePrint.vue
  24. 10 20
      src/xt_pages/outpatientDoctorStation/template/prineight.vue
  25. 3 3
      src/xt_pages/outpatientTool/components/pdetail.vue
  26. 10 1
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  27. 14 1
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  28. 18 1
      src/xt_pages/stock/selfPreparedMedicine/editWarehouseOut.vue
  29. 0 8
      src/xt_pages/stock/selfPreparedMedicine/newDrugQuery.vue
  30. 2 2
      src/xt_pages/stock/selfPreparedMedicine/warehouseInfo.vue
  31. 2 2
      src/xt_pages/stock/selfPreparedMedicine/warehouseOut.vue
  32. 15 8
      src/xt_pages/user/components/PatientSidebar.vue
  33. 445 0
      src/xt_pages/user/lapsoSummary.vue
  34. 13 13
      src/xt_permission.js

+ 102 - 0
src/router/modules/Dialysisanalysis.js View File

@@ -32,6 +32,17 @@ export default {
32 32
         noCache: true
33 33
       }
34 34
     },
35
+    // {//体重血压质控
36
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood',
37
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/index'),
38
+    //   name: 'weightblood',
39
+    //   meta: {
40
+    //     title: '体重血压分析',
41
+    //     noCache: true
42
+    //   }
43
+    // },
44
+
45
+
35 46
     {//透析总量分析
36 47
       path: '/Dialysisanalysis/qualitycontrol/new_otherIndicators/Total_analysis',
37 48
       component: () => import('@/xt_pages/Dialysisanalysis/new_otherIndicators/components/Total_analysis'),
@@ -88,6 +99,97 @@ export default {
88 99
       is_menu: false
89 100
     },
90 101
 
102
+    // 体重血压
103
+    // {//干体重分析
104
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/dry_weight',
105
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/dry_weight'),
106
+    //   name: 'dry_weight',
107
+    //   meta: {
108
+    //     title: '患者干体重分析',
109
+    //     noCache: true
110
+    //   },
111
+    //   hidden: true,
112
+    //   is_menu: false
113
+    // },
114
+    // {//上次透析分母
115
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/list_denominator',
116
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/list_denominator'),
117
+    //   name: 'list_denominator',
118
+    //   meta: {
119
+    //     title: '患者体重增长分析(以上次透后体重为分母)',
120
+    //     noCache: true
121
+    //   },
122
+    //   hidden: true,
123
+    //   is_menu: false
124
+    // },
125
+    // {//干体重分母
126
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/dry_denominator',
127
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/dry_denominator'),
128
+    //   name: 'dry_denominator',
129
+    //   meta: {
130
+    //     title: '患者体重增长分析(以干体重为分母)',
131
+    //     noCache: true
132
+    //   },
133
+    //   hidden: true,
134
+    //   is_menu: false
135
+    // },
136
+    // {//患者透后体重分析
137
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/dialyze_after',
138
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/dialyze_after'),
139
+    //   name: 'dialyze_after',
140
+    //   meta: {
141
+    //     title: '患者透后体重分析',
142
+    //     noCache: true
143
+    //   },
144
+    //   hidden: true,
145
+    //   is_menu: false
146
+    // },
147
+    // {//患者体重详情
148
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/weight_table',
149
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/weight_table'),
150
+    //   name: 'weight_table',
151
+    //   meta: {
152
+    //     title: '患者体重详情',
153
+    //     noCache: true
154
+    //   },
155
+    //   hidden: true,
156
+    //   is_menu: false
157
+    // },
158
+    // {//透前血压分析
159
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/before_Blood',
160
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/before_Blood'),
161
+    //   name: 'before_Blood',
162
+    //   meta: {
163
+    //     title: '透前血压分析',
164
+    //     noCache: true
165
+    //   },
166
+    //   hidden: true,
167
+    //   is_menu: false
168
+    // },
169
+    // {//透前血压分析
170
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/after_Blood',
171
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/after_Blood'),
172
+    //   name: 'after_Blood',
173
+    //   meta: {
174
+    //     title: '透后血压分析',
175
+    //     noCache: true
176
+    //   },
177
+    //   hidden: true,
178
+    //   is_menu: false
179
+    // },
180
+    // {//患者血压详情
181
+    //   path: '/Dialysisanalysis/qualitycontrol/weightblood/blood_table',
182
+    //   component: () => import('@/xt_pages/Dialysisanalysis/weightblood/components/blood_table'),
183
+    //   name: 'blood_table',
184
+    //   meta: {
185
+    //     title: '透后血压分析',
186
+    //     noCache: true
187
+    //   },
188
+    //   hidden: true,
189
+    //   is_menu: false
190
+    // },
191
+
192
+
91 193
 
92 194
     {
93 195
       path: '/Dialysisanalysis/qualitycontrol/Indicatorsdetail',

+ 11 - 0
src/router/modules/patient.js View File

@@ -172,6 +172,17 @@ export default {
172 172
       noCache: true
173 173
     }
174 174
   },
175
+  {
176
+    path: '/patient/patient/:id/lapsoSummary',
177
+    component: () => import('@/xt_pages/user/lapsoSummary'),
178
+    hidden: true,
179
+    is_menu: false,
180
+    name: 'lapsoSummary',
181
+    meta: {
182
+      title: 'lapsoSummary',
183
+      noCache: true
184
+    }
185
+  },
175 186
   {
176 187
     path: '/patients/course',
177 188
     component: () => import('@/xt_pages/user/courseOfDisease'),

+ 9 - 9
src/utils/tools.js View File

@@ -26,18 +26,18 @@ export function jsGetAge(strBirthday, splitstr) {
26 26
   var birthMonth = strBirthdayArr[1]
27 27
   var birthDay = strBirthdayArr[2]
28 28
 
29
-  console.log("birthYear",birthYear)
30
-  console.log("birthMonth",birthMonth)
31
-  console.log("birthDay",birthDay)
29
+  // console.log("birthYear",birthYear)
30
+  // console.log("birthMonth",birthMonth)
31
+  // console.log("birthDay",birthDay)
32 32
 
33 33
   var d = new Date()
34 34
   var nowYear = d.getFullYear()
35 35
   var nowMonth = d.getMonth() + 1
36 36
   var nowDay = d.getDate()
37 37
 
38
-  console.log("nowYear",nowYear)
39
-  console.log("nowMonth",nowMonth)
40
-  console.log("nowDay",nowDay)
38
+  // console.log("nowYear",nowYear)
39
+  // console.log("nowMonth",nowMonth)
40
+  // console.log("nowDay",nowDay)
41 41
 
42 42
   if (nowYear == birthYear) {
43 43
     returnAge = 0 // 同年 则为0岁
@@ -86,9 +86,9 @@ export function jsGetAgeOne(strBirthday,splitstr, nowYear,nowMonth,nowDay) {
86 86
   // console.log("anowMonth",anowMonth)
87 87
   // console.log("anowDay",anowDay)
88 88
 
89
-  console.log("brityYear666",strBirthdayArr[0])
90
-  console.log("birthMonth5656",strBirthdayArr[1])
91
-  console.log("birthDay5656",strBirthdayArr[2])
89
+  // console.log("brityYear666",strBirthdayArr[0])
90
+  // console.log("birthMonth5656",strBirthdayArr[1])
91
+  // console.log("birthDay5656",strBirthdayArr[2])
92 92
 
93 93
   if (nowYear == birthYear) {
94 94
     returnAge = 0 // 同年 则为0岁

+ 715 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/after_Blood.vue View File

@@ -0,0 +1,715 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者透后血压分析</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin:0 10px">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+          <div style="position: fixed;right: 5%;top: 50vh;">
53
+            <el-popover
54
+              placement="left"
55
+              title="提示"
56
+              width="500"
57
+              trigger="click"
58
+              content="1.统计时间段内留治患者干体重,在当前时间段的区间分布,不是统计每次透析的干体重。
59
+                       2.如果一个患者在时间段内,调整过两次干体重,以最后一次为准。">
60
+              <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
61
+              <!-- <el-button slot="reference">click 激活</el-button> -->
62
+            </el-popover>
63
+          </div>
64
+      </div>
65
+    </div>
66
+
67
+    <!-- 弹窗 -->
68
+    <div>
69
+      <el-dialog
70
+        title="提示"
71
+        :visible.sync="complete_dialog"
72
+        width="80%">
73
+        <div>
74
+          <div style="display: flex;margin-bottom: 20px;">
75
+            <div style="flex: 2;display: flex;">
76
+              <div>
77
+                日期:
78
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
79
+                  <el-option
80
+                    v-for="item in date_options"
81
+                    :key="item.value"
82
+                    :label="item.label"
83
+                    :value="item.value">
84
+                  </el-option>
85
+                </el-select>
86
+              </div>
87
+              <div style="margin:0 10px">
88
+                <el-date-picker
89
+                  v-model="start_date"
90
+                  type="date"
91
+                  value-format="yyyy-MM-dd"
92
+                  placeholder="选择日期"
93
+                  style="width: 150px;">
94
+                </el-date-picker>
95
+                <span>-</span>
96
+                <el-date-picker
97
+                  v-model="end_date"
98
+                  type="date"
99
+                  value-format="yyyy-MM-dd"
100
+                  placeholder="选择日期"
101
+                  style="width: 150px;">
102
+                </el-date-picker>
103
+              </div>
104
+
105
+              <div>
106
+                状态:
107
+                <el-select v-model="status_value" placeholder="请选择" style="width: 130px;">
108
+                  <el-option :key="0" label="不限" :value="0"></el-option>
109
+                  <el-option
110
+                    v-for="item in status_options"
111
+                    :key="item.value"
112
+                    :label="item.label"
113
+                    :value="item.value">
114
+                  </el-option>
115
+                </el-select>
116
+              </div>
117
+            </div>
118
+            <div style="flex: 1;">
119
+              <div>
120
+                <el-button type="primary" @click="detil_click">查询</el-button>
121
+
122
+                <el-button type="primary" @click="derive_click">导出</el-button>
123
+              </div>
124
+            </div>
125
+          </div>
126
+          <div>
127
+            <el-table :data="tableData"
128
+              border
129
+              style="width: 100%;"
130
+              :header-cell-style = "{'text-align':'center'}"
131
+              :cell-style="{'text-align':'center'}"
132
+              height="380">
133
+              <el-table-column
134
+                prop="index"
135
+                label="序号"
136
+                width="">
137
+              </el-table-column>
138
+              <el-table-column
139
+                prop="dialysis_no"
140
+                label="透析号"
141
+                width="">
142
+              </el-table-column>
143
+              <el-table-column
144
+                prop="patient_name"
145
+                label="患者姓名">
146
+              </el-table-column>
147
+              <el-table-column
148
+                prop="age"
149
+                label="年龄">
150
+              </el-table-column>
151
+              <el-table-column
152
+                prop="dialysis_date"
153
+                label="透析日期"
154
+                width="">
155
+              </el-table-column>
156
+              <el-table-column
157
+                prop="dialysis_date"
158
+                label="透后血压"
159
+                width="">
160
+              </el-table-column>
161
+            </el-table>
162
+          </div>
163
+          <div style="text-align:right;margin-top: 10px;">
164
+            <el-pagination
165
+              @size-change="handleSizeChange"
166
+              @current-change="handleCurrentChange"
167
+              :current-page="currentPage"
168
+              :page-sizes="[50,100, 200, 300, 400]"
169
+              :page-size="limit"
170
+              layout="total, sizes, prev, pager, next, jumper"
171
+              :total="total">
172
+            </el-pagination>
173
+          </div>
174
+        </div>
175
+        <span slot="footer" class="dialog-footer">
176
+          <el-button @click="complete_dialog = false">取 消</el-button>
177
+          <el-button type="primary" @click="complete_dialog = false">确 定</el-button>
178
+        </span>
179
+      </el-dialog>
180
+    </div>
181
+  </div>
182
+</template>
183
+<script>
184
+import * as echarts from 'echarts';
185
+import XLSX from 'xlsx';
186
+import { uParseTime } from "@/utils/tools";
187
+import {Getdialysistreatfinish,Getdialysistreatdetail} from '../../../../api/qcd'
188
+import {getAllNurseList} from '@/api/fallassement'
189
+import { getAllDoctorList} from "@/api/device"
190
+import html2canvas from "html2canvas"
191
+  export default {
192
+    components:{
193
+    },
194
+    data(){
195
+      return{
196
+        date_value:4,
197
+        start_date:'',
198
+        end_date:this.getTime(new Date()),
199
+        mode:'',
200
+        date_mode:'',
201
+        source:'',
202
+        status_value:0,
203
+        complete_dialog:false,
204
+        currentPage:1,
205
+        limit:50,
206
+        total:0,
207
+        tableData:[],
208
+        // status_options:[],
209
+        nurseList:[],
210
+        operators:[],
211
+        docList:[],
212
+        status_options:[{value:1,label:'达到透析处方时间'},{value:2,label:'超出处方时间'},{value:3,label:'未到达处方时间'}],
213
+        // status_options:[{value:1,label:'待定卧床'},{value:2,label:'<40KG'},{value:3,label:'40-50KG'},
214
+        //                 {value:4,label:'50-60KG'},{value:5,label:'<60-70KG'},{value:6,label:'>70KG'}
215
+        //                 ],
216
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
217
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
218
+        ],
219
+        mode_options:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
220
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
221
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
222
+          { id: 15, name: 'HD前置换' },{ id: 16, name: 'HD后置换' },{ id: 17, name: 'HDF前置换' },{ id: 18, name: 'HDF后置换' },
223
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
224
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
225
+        ],
226
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
227
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
228
+        status_id:"",
229
+      }
230
+    },
231
+    methods:{
232
+      // 返回
233
+      return_click(){
234
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
235
+      },
236
+      // 数据源
237
+      getecharts(){
238
+        var chartDom = document.getElementById('mychart')
239
+        var myChart = echarts.init(chartDom);
240
+        const params={
241
+          start_date:this.start_date,
242
+          end_date:this.end_date
243
+        }
244
+        Getdialysistreatfinish(params).then(response =>{
245
+          if(response.data.state ==1){
246
+            const list = response.data.data.data
247
+            const xAxis = []
248
+            const yAxis = []
249
+
250
+            const total = response.data.data.total
251
+            for(let key in list){
252
+              const obj={
253
+                name:key,
254
+                value:list[key]
255
+              }
256
+              xAxis.push(obj)
257
+              yAxis.push(key)
258
+            }
259
+            const status = []
260
+            // for(let i in yAxis){
261
+            //   const obj ={
262
+            //     value:(i*1)+1,
263
+            //     label:yAxis[i]
264
+            //   }
265
+            //   status.push(obj)
266
+            // }
267
+            // this.status_options = status
268
+            console.log('this.status_options',this.status_options);
269
+            const option = {
270
+                title:{
271
+                  text:'总数'+total,
272
+                  left:'5%',
273
+                  bottom:'5%',
274
+                  textStyle:{
275
+                    fontSize:30
276
+                  }
277
+                },
278
+                tooltip: {
279
+                  trigger: 'item',
280
+
281
+                },
282
+                legend: {
283
+                  data:yAxis,
284
+                  left: '10%',
285
+                  top: '30%',
286
+                  orient: 'vertical'
287
+                },
288
+                color:['#FFD7C0','#9FBDFC',"#A9E0F3", "#FF9994",'aquamarine','gold'],
289
+                series: [
290
+                  {
291
+                    name: '',
292
+                    type: 'pie',
293
+                    radius: ['40%', '70%'],
294
+                    avoidLabelOverlap: true,
295
+                    itemStyle: {
296
+                      borderRadius: 10,
297
+                      borderColor: '#fff',
298
+                      borderWidth: 2
299
+                    },
300
+                    label: {
301
+                      show: true,
302
+                      position: 'center',
303
+                      normal : {
304
+                        formatter: '{b}:{c}: ({d}%)',
305
+                        textStyle : {
306
+                          fontWeight : 'normal',
307
+                          fontSize : 15,
308
+                          color : "black"
309
+                        }
310
+                      }
311
+                    },
312
+                    emphasis: {
313
+                      label: {
314
+                        show: true,
315
+                        fontSize: 40,
316
+                        fontWeight: 'bold'
317
+                      }
318
+                    },
319
+                    labelLine: {
320
+                      show: false
321
+                    },
322
+                    data: xAxis
323
+                  }
324
+                ]
325
+              };
326
+            myChart.setOption(option);
327
+            myChart.on('click',params =>{
328
+              this.complete_dialog = true
329
+              console.log('bbbb',params);
330
+              var status_id =''
331
+              for(let i in this.status_options){
332
+                if(params.data.name == this.status_options[i].label){
333
+                  status_id = this.status_options[i].value
334
+                }
335
+              }
336
+              this.getdetail(status_id)
337
+            })
338
+          }
339
+        })
340
+
341
+      },
342
+      // 查询
343
+      sete_click(){
344
+        this.getecharts()
345
+      },
346
+      // 详情查询
347
+      detil_click(){
348
+        this.getdetail(this.status_value)
349
+      },
350
+       // 下载
351
+      Download_click(){
352
+        const options ={
353
+          allowTaint: true,
354
+          useCORS: true
355
+        }
356
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
357
+          // const imageSrc = canvas.toDataURL();
358
+          const imageUrl = canvas.toDataURL("image/png");
359
+          const blob = this.dataURLtoBlob(imageUrl)
360
+          const url = URL.createObjectURL(blob);
361
+          var link= document.createElement("a");
362
+        //   //将生成的图片url赋值给a标签的href属性
363
+          link.href = url;
364
+        //   //设置下载的文件名
365
+          link.download = "透析完成率统计.jpg";
366
+          // // 将a标签插入dom中
367
+          console.log('link',link);
368
+          document.body.appendChild(link);
369
+          //模拟点击事件触发下载
370
+          link.click();
371
+          // 完成之后销毁创建的a标签
372
+          document.body.removeChild(link);
373
+
374
+        })
375
+      },
376
+      // 导出excel
377
+      derive_click(){
378
+        let tableData = [
379
+          ['序号', '透析号', '患者姓名', '年龄','透析日期', '处方透析时长', '实际透析时长', '实际差(min)', '主治医生', '主治护士']//导出表头
380
+        ]
381
+        this.tableData.forEach((item,index) =>{
382
+          let rowdata=[]
383
+          rowdata=[
384
+            item.index,
385
+            item.dialysis_no,
386
+            item.patient_name,
387
+            item.age,
388
+            item.dialysis_date,
389
+            item.dialysis_duration,
390
+            item.actual_duration,
391
+            item.diff,
392
+            item.doctor,
393
+            item.nurse,
394
+          ]
395
+          tableData.push(rowdata)
396
+        })
397
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
398
+        let bookNew = XLSX.utils.book_new();
399
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析治疗完成率') // 工作簿名称
400
+        let name = '透析治疗完成率'+ '.xlsx'
401
+        XLSX.writeFile(bookNew, name) // 保存的文件名
402
+      },
403
+      // 详情数据源
404
+      getdetail(mode){
405
+        const params ={
406
+          start_date:this.start_date,
407
+          end_date:this.end_date,
408
+          mode:mode,
409
+          page:this.currentPage,
410
+          limit:this.limit,
411
+        }
412
+        Getdialysistreatdetail(params).then(response =>{
413
+          if(response.data.state){
414
+            const list = response.data.data.list
415
+            const xAxis = []
416
+            const table = []
417
+            list.forEach((item,index) =>{
418
+              const obj={
419
+                index:index+1,
420
+                dialysis_no:item.dialysis_no,
421
+                patient_name:item.patient_name,
422
+                age:this.analyzeIDCard(item.id_card_no),
423
+                dialysis_date:item.dialysis_date.split('T')[0],
424
+                dialysis_duration:item.dialysis_duration,
425
+                actual_duration:item.actual_duration,
426
+                diff:item.diff,
427
+                doctor:this.getdoctor(item.doctor),
428
+                nurse:this.getnurse(item.nurse)
429
+              }
430
+              table.push(obj)
431
+            })
432
+            this.tableData = table
433
+            this.total = response.data.data.total
434
+          }
435
+          console.log('55555',response);
436
+        })
437
+      },
438
+      // 选择日期
439
+      datachange(eve){
440
+        if(eve ==1){
441
+          this.start_date = this.getPreviousDate(7)
442
+          this.end_date = this.getTime(new Date())
443
+        }else if(eve==2){
444
+          this.start_date = this.getFirstDayOfWeek(new Date())
445
+          this.end_date = this.getTime(new Date())
446
+          console.log('this.start_date', this.start_date);
447
+        }else if(eve ==3){
448
+          var date=new Date()
449
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
450
+          var m =''
451
+          var d = ''
452
+          if(date.getMonth() + 1<10){
453
+            m = '0'+(date.getMonth() + 1)
454
+          }else{
455
+             m = date.getMonth() + 1
456
+          }
457
+          if(date.getDate()<10){
458
+             d = '0'+date.getDate()
459
+          }else{
460
+            d = date.getDate()
461
+          }
462
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
463
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
464
+          date.setDate(date.getDate() +6);
465
+          var mm = ''
466
+          var dd = ''
467
+          if(date.getMonth() + 1<10){
468
+            mm = '0'+(date.getMonth() + 1)
469
+          }else{
470
+            mm = date.getMonth() + 1
471
+          }
472
+          if(date.getDate()<10){
473
+            dd = '0'+date.getDate()
474
+          }else{
475
+            dd = date.getDate()
476
+          }
477
+          // if(date.getMonth() + 1<10)
478
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
479
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
480
+          console.log('this.end_date',this.end_date);
481
+
482
+        }else if(eve ==4){
483
+          this.start_date = this.getFirstDayOfMonth(new Date())
484
+          this.end_date = this.getTime(new Date())
485
+        }else if(eve ==5){
486
+          this.getLastMonthFirstDay()
487
+          this.getLastMonthLastDay()
488
+        }else if(eve == 6){
489
+          this.start_date = this.getFirstDayOfYear(new Date())
490
+          this.end_date = this.getTime(new Date())
491
+        }else if(eve == 7){
492
+          this.getLastYearFirstDay()
493
+          this.getLastYearLastDay()
494
+        }
495
+        console.log('eve',eve);
496
+      },
497
+      // 首先定义一个getPreviousDate函数,方便调用
498
+      getPreviousDate(numOfDays) {
499
+        var date = new Date();
500
+        date.setDate(date.getDate() - numOfDays);
501
+        var year = date.getFullYear();
502
+        if(date.getMonth() + 1<10){
503
+          var month = '0'+(date.getMonth() + 1);
504
+        }else{
505
+          var month = date.getMonth() + 1;
506
+        }
507
+
508
+        if(date.getDate()<10){
509
+          var day = '0'+date.getDate();
510
+        }else{
511
+          var day = date.getDate();
512
+        }
513
+        return year + "-" + month + "-" + day;
514
+      },
515
+      // 本周
516
+      getFirstDayOfWeek(date){
517
+        var weekday = date.getDay()
518
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
519
+        return this.timeFormat(date);
520
+      },
521
+      // 本月
522
+      getFirstDayOfMonth (date) {
523
+        date.setDate(1);
524
+        return this.timeFormat(date);
525
+      },
526
+       //上个月第一天
527
+       getLastMonthFirstDay() {
528
+          var date = new Date();
529
+          date.setDate(0);
530
+          var y = date.getFullYear(); //获取年份
531
+          var m = date.getMonth() + 1; //获取月份
532
+          m = m < 10 ? "0" + m : m;
533
+          this.start_date = [y, m, '01'].join("-")
534
+          // return [y, m, '01'].join("-");
535
+      },
536
+      // 上个月最后一天
537
+      getLastMonthLastDay() {
538
+          var date = new Date();
539
+          date.setDate(0);
540
+          var y = date.getFullYear(); //获取年份
541
+          var m = date.getMonth() + 1; //获取月份
542
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
543
+          m = m < 10 ? "0" + m : m; //月份补 0
544
+          d = d < 10 ? "0" + d : d; //日数补 0
545
+          this.end_date = [y, m, d].join("-")
546
+          // return [y, m, d].join("-");
547
+      },
548
+
549
+      // 本年
550
+      getFirstDayOfYear (date) {
551
+        date.setDate(1);
552
+        date.setMonth(0);
553
+        return this.timeFormat(date);
554
+      },
555
+      // 上一年第一天
556
+      getLastYearFirstDay() {
557
+          let date = new Date();
558
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
559
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
560
+         const start_day = date.setDate(1); // 设置日期为1日
561
+        //  const last_month = date.setMonth(11); // 设置月份为12月
562
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
563
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
564
+         this.start_date = this.getTime(start_day)
565
+        //  return this.start_date
566
+      },
567
+      // 上一年最后一天
568
+      getLastYearLastDay() {
569
+          let date = new Date();
570
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
571
+          const last_month = date.setMonth(12); // 设置月份为12月
572
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
573
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
574
+          this.end_date = this.getTime(last_day)
575
+          console.log('this.end_date',this.end_date);
576
+          // return this.end_date;
577
+      },
578
+      // 日期格式化
579
+      timeFormat(date) {
580
+          if (!date || typeof(date) === "string") {
581
+            this.error("参数异常,请检查...");
582
+          }
583
+          var y = date.getFullYear(); //年
584
+          if(date.getMonth() + 1<10){
585
+            var m ='0'+(date.getMonth() + 1); //月
586
+          }else{
587
+            var m =date.getMonth() + 1; //月
588
+          }
589
+          if(date.getDate() + 1<10){
590
+            var d ='0'+date.getDate(); //日
591
+          }else{
592
+            var d = date.getDate(); //日
593
+          }
594
+          // var d = date.getDate(); //日
595
+
596
+          return y + "-" + m + "-" + d;
597
+      },
598
+      handleCurrentChange(val){
599
+        this.currentPage = val
600
+        this.getdetail(this.status_value)
601
+      },
602
+      handleSizeChange(val){
603
+        this.limit = val
604
+        this.getdetail(this.status_value)
605
+      },
606
+       // 转换时间
607
+      getTime(val) {
608
+        if(val < 0){
609
+          return ""
610
+        }
611
+        if(val == ""){
612
+          return ""
613
+        }else {
614
+          return uParseTime(val, '{y}-{m}-{d}')
615
+        }
616
+      },
617
+      dataURLtoBlob(dataURL) {
618
+        const arr = dataURL.split(',');
619
+        const mime = arr[0].match(/:(.*?);/)[1];
620
+        const bstr = atob(arr[1]);
621
+        let n = bstr.length;
622
+        const u8arr = new Uint8Array(n);
623
+        while (n--) {
624
+          u8arr[n] = bstr.charCodeAt(n);
625
+        }
626
+        return new Blob([u8arr], { type: mime });
627
+      },
628
+      // 计算年龄
629
+      analyzeIDCard(IDCard){
630
+        var age = 0,yearBirth,monthBirth,dayBirth;
631
+        //获取用户身份证号码
632
+        var userCard = IDCard;
633
+        //如果身份证号码为undefind则返回空
634
+        if(!userCard){
635
+          return age;
636
+        }
637
+        var reg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/; //验证身份证号码的正则
638
+        if (reg.test(userCard)) {
639
+          if (userCard.length == 15) {
640
+              var org_birthday = userCard.substring(6, 12);
641
+              //获取出生年月日
642
+              yearBirth = "19" + org_birthday.substring(0, 2);
643
+              monthBirth = org_birthday.substring(2, 4);
644
+              dayBirth = org_birthday.substring(4, 6);
645
+              } else if (userCard.length == 18) {
646
+              //获取出生年月日
647
+              yearBirth = userCard.substring(6,10);
648
+              monthBirth = userCard.substring(10,12);
649
+              dayBirth = userCard.substring(12,14);
650
+
651
+            }
652
+            //获取当前年月日并计算年龄
653
+            var myDate = new Date();
654
+            var monthNow = myDate.getMonth() + 1;
655
+            var dayNow = myDate.getDate();
656
+            var age = myDate.getFullYear() - yearBirth;
657
+            if(monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)){
658
+              age--;
659
+            }
660
+            //返回年龄
661
+            return age;
662
+        } else {
663
+          return ''
664
+        }
665
+
666
+      },
667
+      // 护士
668
+      getAllNurseList(){
669
+        getAllNurseList().then(response=>{
670
+           if(response.data.state ==1){
671
+             var nurseList  = response.data.data.nurseList
672
+            console.log('0000',nurseList);
673
+             this.nurseList =nurseList
674
+           }
675
+        })
676
+      },
677
+      // 医生
678
+      getAllDoctorList(){
679
+        getAllDoctorList().then(response=>{
680
+          if(response.data.state == 1){
681
+              var list = response.data.data.list
682
+              console.log("list222222",list)
683
+              this.docList = list
684
+              this.operators = response.data.data.operators
685
+          }
686
+        })
687
+      },
688
+      getnurse(ids){
689
+        const nurse = this.nurseList
690
+        for(let i in nurse){
691
+          if(ids==nurse[i].admin_user_id){
692
+            return nurse[i].user_name
693
+          }
694
+        }
695
+      },
696
+      getdoctor(ids){
697
+        const doctor = this.docList
698
+        for(let i in doctor){
699
+          if(ids == doctor[i].admin_user_id){
700
+            return doctor[i].user_name
701
+          }
702
+        }
703
+      }
704
+    },
705
+    mounted(){
706
+      this.getecharts()
707
+    },
708
+    created(){
709
+      this.start_date = this.getFirstDayOfMonth(new Date())
710
+      this.getAllNurseList()
711
+      this.getAllDoctorList()
712
+    },
713
+
714
+  }
715
+</script>

+ 715 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/before_Blood.vue View File

@@ -0,0 +1,715 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者透前血压分析</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin:0 10px">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+          <div style="position: fixed;right: 5%;top: 50vh;">
53
+            <el-popover
54
+              placement="left"
55
+              title="提示"
56
+              width="500"
57
+              trigger="click"
58
+              content="1.统计时间段内留治患者干体重,在当前时间段的区间分布,不是统计每次透析的干体重。
59
+                       2.如果一个患者在时间段内,调整过两次干体重,以最后一次为准。">
60
+              <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
61
+              <!-- <el-button slot="reference">click 激活</el-button> -->
62
+            </el-popover>
63
+          </div>
64
+      </div>
65
+    </div>
66
+
67
+    <!-- 弹窗 -->
68
+    <div>
69
+      <el-dialog
70
+        title="提示"
71
+        :visible.sync="complete_dialog"
72
+        width="80%">
73
+        <div>
74
+          <div style="display: flex;margin-bottom: 20px;">
75
+            <div style="flex: 2;display: flex;">
76
+              <div>
77
+                日期:
78
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
79
+                  <el-option
80
+                    v-for="item in date_options"
81
+                    :key="item.value"
82
+                    :label="item.label"
83
+                    :value="item.value">
84
+                  </el-option>
85
+                </el-select>
86
+              </div>
87
+              <div style="margin:0 10px">
88
+                <el-date-picker
89
+                  v-model="start_date"
90
+                  type="date"
91
+                  value-format="yyyy-MM-dd"
92
+                  placeholder="选择日期"
93
+                  style="width: 150px;">
94
+                </el-date-picker>
95
+                <span>-</span>
96
+                <el-date-picker
97
+                  v-model="end_date"
98
+                  type="date"
99
+                  value-format="yyyy-MM-dd"
100
+                  placeholder="选择日期"
101
+                  style="width: 150px;">
102
+                </el-date-picker>
103
+              </div>
104
+
105
+              <div>
106
+                状态:
107
+                <el-select v-model="status_value" placeholder="请选择" style="width: 130px;">
108
+                  <el-option :key="0" label="不限" :value="0"></el-option>
109
+                  <el-option
110
+                    v-for="item in status_options"
111
+                    :key="item.value"
112
+                    :label="item.label"
113
+                    :value="item.value">
114
+                  </el-option>
115
+                </el-select>
116
+              </div>
117
+            </div>
118
+            <div style="flex: 1;">
119
+              <div>
120
+                <el-button type="primary" @click="detil_click">查询</el-button>
121
+
122
+                <el-button type="primary" @click="derive_click">导出</el-button>
123
+              </div>
124
+            </div>
125
+          </div>
126
+          <div>
127
+            <el-table :data="tableData"
128
+              border
129
+              style="width: 100%;"
130
+              :header-cell-style = "{'text-align':'center'}"
131
+              :cell-style="{'text-align':'center'}"
132
+              height="380">
133
+              <el-table-column
134
+                prop="index"
135
+                label="序号"
136
+                width="">
137
+              </el-table-column>
138
+              <el-table-column
139
+                prop="dialysis_no"
140
+                label="透析号"
141
+                width="">
142
+              </el-table-column>
143
+              <el-table-column
144
+                prop="patient_name"
145
+                label="患者姓名">
146
+              </el-table-column>
147
+              <el-table-column
148
+                prop="age"
149
+                label="年龄">
150
+              </el-table-column>
151
+              <el-table-column
152
+                prop="dialysis_date"
153
+                label="透析日期"
154
+                width="">
155
+              </el-table-column>
156
+              <el-table-column
157
+                prop="dialysis_date"
158
+                label="透前血压"
159
+                width="">
160
+              </el-table-column>
161
+            </el-table>
162
+          </div>
163
+          <div style="text-align:right;margin-top: 10px;">
164
+            <el-pagination
165
+              @size-change="handleSizeChange"
166
+              @current-change="handleCurrentChange"
167
+              :current-page="currentPage"
168
+              :page-sizes="[50,100, 200, 300, 400]"
169
+              :page-size="limit"
170
+              layout="total, sizes, prev, pager, next, jumper"
171
+              :total="total">
172
+            </el-pagination>
173
+          </div>
174
+        </div>
175
+        <span slot="footer" class="dialog-footer">
176
+          <el-button @click="complete_dialog = false">取 消</el-button>
177
+          <el-button type="primary" @click="complete_dialog = false">确 定</el-button>
178
+        </span>
179
+      </el-dialog>
180
+    </div>
181
+  </div>
182
+</template>
183
+<script>
184
+import * as echarts from 'echarts';
185
+import XLSX from 'xlsx';
186
+import { uParseTime } from "@/utils/tools";
187
+import {Getdialysistreatfinish,Getdialysistreatdetail} from '../../../../api/qcd'
188
+import {getAllNurseList} from '@/api/fallassement'
189
+import { getAllDoctorList} from "@/api/device"
190
+import html2canvas from "html2canvas"
191
+  export default {
192
+    components:{
193
+    },
194
+    data(){
195
+      return{
196
+        date_value:4,
197
+        start_date:'',
198
+        end_date:this.getTime(new Date()),
199
+        mode:'',
200
+        date_mode:'',
201
+        source:'',
202
+        status_value:0,
203
+        complete_dialog:false,
204
+        currentPage:1,
205
+        limit:50,
206
+        total:0,
207
+        tableData:[],
208
+        // status_options:[],
209
+        nurseList:[],
210
+        operators:[],
211
+        docList:[],
212
+        status_options:[{value:1,label:'达到透析处方时间'},{value:2,label:'超出处方时间'},{value:3,label:'未到达处方时间'}],
213
+        // status_options:[{value:1,label:'待定卧床'},{value:2,label:'<40KG'},{value:3,label:'40-50KG'},
214
+        //                 {value:4,label:'50-60KG'},{value:5,label:'<60-70KG'},{value:6,label:'>70KG'}
215
+        //                 ],
216
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
217
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
218
+        ],
219
+        mode_options:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
220
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
221
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
222
+          { id: 15, name: 'HD前置换' },{ id: 16, name: 'HD后置换' },{ id: 17, name: 'HDF前置换' },{ id: 18, name: 'HDF后置换' },
223
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
224
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
225
+        ],
226
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
227
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
228
+        status_id:"",
229
+      }
230
+    },
231
+    methods:{
232
+      // 返回
233
+      return_click(){
234
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
235
+      },
236
+      // 数据源
237
+      getecharts(){
238
+        var chartDom = document.getElementById('mychart')
239
+        var myChart = echarts.init(chartDom);
240
+        const params={
241
+          start_date:this.start_date,
242
+          end_date:this.end_date
243
+        }
244
+        Getdialysistreatfinish(params).then(response =>{
245
+          if(response.data.state ==1){
246
+            const list = response.data.data.data
247
+            const xAxis = []
248
+            const yAxis = []
249
+
250
+            const total = response.data.data.total
251
+            for(let key in list){
252
+              const obj={
253
+                name:key,
254
+                value:list[key]
255
+              }
256
+              xAxis.push(obj)
257
+              yAxis.push(key)
258
+            }
259
+            const status = []
260
+            // for(let i in yAxis){
261
+            //   const obj ={
262
+            //     value:(i*1)+1,
263
+            //     label:yAxis[i]
264
+            //   }
265
+            //   status.push(obj)
266
+            // }
267
+            // this.status_options = status
268
+            console.log('this.status_options',this.status_options);
269
+            const option = {
270
+                title:{
271
+                  text:'总数'+total,
272
+                  left:'5%',
273
+                  bottom:'5%',
274
+                  textStyle:{
275
+                    fontSize:30
276
+                  }
277
+                },
278
+                tooltip: {
279
+                  trigger: 'item',
280
+
281
+                },
282
+                legend: {
283
+                  data:yAxis,
284
+                  left: '10%',
285
+                  top: '30%',
286
+                  orient: 'vertical'
287
+                },
288
+                color:['#FFD7C0','#9FBDFC',"#A9E0F3", "#FF9994",'aquamarine','gold'],
289
+                series: [
290
+                  {
291
+                    name: '',
292
+                    type: 'pie',
293
+                    radius: ['40%', '70%'],
294
+                    avoidLabelOverlap: true,
295
+                    itemStyle: {
296
+                      borderRadius: 10,
297
+                      borderColor: '#fff',
298
+                      borderWidth: 2
299
+                    },
300
+                    label: {
301
+                      show: true,
302
+                      position: 'center',
303
+                      normal : {
304
+                        formatter: '{b}:{c}: ({d}%)',
305
+                        textStyle : {
306
+                          fontWeight : 'normal',
307
+                          fontSize : 15,
308
+                          color : "black"
309
+                        }
310
+                      }
311
+                    },
312
+                    emphasis: {
313
+                      label: {
314
+                        show: true,
315
+                        fontSize: 40,
316
+                        fontWeight: 'bold'
317
+                      }
318
+                    },
319
+                    labelLine: {
320
+                      show: false
321
+                    },
322
+                    data: xAxis
323
+                  }
324
+                ]
325
+              };
326
+            myChart.setOption(option);
327
+            myChart.on('click',params =>{
328
+              this.complete_dialog = true
329
+              console.log('bbbb',params);
330
+              var status_id =''
331
+              for(let i in this.status_options){
332
+                if(params.data.name == this.status_options[i].label){
333
+                  status_id = this.status_options[i].value
334
+                }
335
+              }
336
+              this.getdetail(status_id)
337
+            })
338
+          }
339
+        })
340
+
341
+      },
342
+      // 查询
343
+      sete_click(){
344
+        this.getecharts()
345
+      },
346
+      // 详情查询
347
+      detil_click(){
348
+        this.getdetail(this.status_value)
349
+      },
350
+       // 下载
351
+      Download_click(){
352
+        const options ={
353
+          allowTaint: true,
354
+          useCORS: true
355
+        }
356
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
357
+          // const imageSrc = canvas.toDataURL();
358
+          const imageUrl = canvas.toDataURL("image/png");
359
+          const blob = this.dataURLtoBlob(imageUrl)
360
+          const url = URL.createObjectURL(blob);
361
+          var link= document.createElement("a");
362
+        //   //将生成的图片url赋值给a标签的href属性
363
+          link.href = url;
364
+        //   //设置下载的文件名
365
+          link.download = "透析完成率统计.jpg";
366
+          // // 将a标签插入dom中
367
+          console.log('link',link);
368
+          document.body.appendChild(link);
369
+          //模拟点击事件触发下载
370
+          link.click();
371
+          // 完成之后销毁创建的a标签
372
+          document.body.removeChild(link);
373
+
374
+        })
375
+      },
376
+      // 导出excel
377
+      derive_click(){
378
+        let tableData = [
379
+          ['序号', '透析号', '患者姓名', '年龄','透析日期', '处方透析时长', '实际透析时长', '实际差(min)', '主治医生', '主治护士']//导出表头
380
+        ]
381
+        this.tableData.forEach((item,index) =>{
382
+          let rowdata=[]
383
+          rowdata=[
384
+            item.index,
385
+            item.dialysis_no,
386
+            item.patient_name,
387
+            item.age,
388
+            item.dialysis_date,
389
+            item.dialysis_duration,
390
+            item.actual_duration,
391
+            item.diff,
392
+            item.doctor,
393
+            item.nurse,
394
+          ]
395
+          tableData.push(rowdata)
396
+        })
397
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
398
+        let bookNew = XLSX.utils.book_new();
399
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析治疗完成率') // 工作簿名称
400
+        let name = '透析治疗完成率'+ '.xlsx'
401
+        XLSX.writeFile(bookNew, name) // 保存的文件名
402
+      },
403
+      // 详情数据源
404
+      getdetail(mode){
405
+        const params ={
406
+          start_date:this.start_date,
407
+          end_date:this.end_date,
408
+          mode:mode,
409
+          page:this.currentPage,
410
+          limit:this.limit,
411
+        }
412
+        Getdialysistreatdetail(params).then(response =>{
413
+          if(response.data.state){
414
+            const list = response.data.data.list
415
+            const xAxis = []
416
+            const table = []
417
+            list.forEach((item,index) =>{
418
+              const obj={
419
+                index:index+1,
420
+                dialysis_no:item.dialysis_no,
421
+                patient_name:item.patient_name,
422
+                age:this.analyzeIDCard(item.id_card_no),
423
+                dialysis_date:item.dialysis_date.split('T')[0],
424
+                dialysis_duration:item.dialysis_duration,
425
+                actual_duration:item.actual_duration,
426
+                diff:item.diff,
427
+                doctor:this.getdoctor(item.doctor),
428
+                nurse:this.getnurse(item.nurse)
429
+              }
430
+              table.push(obj)
431
+            })
432
+            this.tableData = table
433
+            this.total = response.data.data.total
434
+          }
435
+          console.log('55555',response);
436
+        })
437
+      },
438
+      // 选择日期
439
+      datachange(eve){
440
+        if(eve ==1){
441
+          this.start_date = this.getPreviousDate(7)
442
+          this.end_date = this.getTime(new Date())
443
+        }else if(eve==2){
444
+          this.start_date = this.getFirstDayOfWeek(new Date())
445
+          this.end_date = this.getTime(new Date())
446
+          console.log('this.start_date', this.start_date);
447
+        }else if(eve ==3){
448
+          var date=new Date()
449
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
450
+          var m =''
451
+          var d = ''
452
+          if(date.getMonth() + 1<10){
453
+            m = '0'+(date.getMonth() + 1)
454
+          }else{
455
+             m = date.getMonth() + 1
456
+          }
457
+          if(date.getDate()<10){
458
+             d = '0'+date.getDate()
459
+          }else{
460
+            d = date.getDate()
461
+          }
462
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
463
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
464
+          date.setDate(date.getDate() +6);
465
+          var mm = ''
466
+          var dd = ''
467
+          if(date.getMonth() + 1<10){
468
+            mm = '0'+(date.getMonth() + 1)
469
+          }else{
470
+            mm = date.getMonth() + 1
471
+          }
472
+          if(date.getDate()<10){
473
+            dd = '0'+date.getDate()
474
+          }else{
475
+            dd = date.getDate()
476
+          }
477
+          // if(date.getMonth() + 1<10)
478
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
479
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
480
+          console.log('this.end_date',this.end_date);
481
+
482
+        }else if(eve ==4){
483
+          this.start_date = this.getFirstDayOfMonth(new Date())
484
+          this.end_date = this.getTime(new Date())
485
+        }else if(eve ==5){
486
+          this.getLastMonthFirstDay()
487
+          this.getLastMonthLastDay()
488
+        }else if(eve == 6){
489
+          this.start_date = this.getFirstDayOfYear(new Date())
490
+          this.end_date = this.getTime(new Date())
491
+        }else if(eve == 7){
492
+          this.getLastYearFirstDay()
493
+          this.getLastYearLastDay()
494
+        }
495
+        console.log('eve',eve);
496
+      },
497
+      // 首先定义一个getPreviousDate函数,方便调用
498
+      getPreviousDate(numOfDays) {
499
+        var date = new Date();
500
+        date.setDate(date.getDate() - numOfDays);
501
+        var year = date.getFullYear();
502
+        if(date.getMonth() + 1<10){
503
+          var month = '0'+(date.getMonth() + 1);
504
+        }else{
505
+          var month = date.getMonth() + 1;
506
+        }
507
+
508
+        if(date.getDate()<10){
509
+          var day = '0'+date.getDate();
510
+        }else{
511
+          var day = date.getDate();
512
+        }
513
+        return year + "-" + month + "-" + day;
514
+      },
515
+      // 本周
516
+      getFirstDayOfWeek(date){
517
+        var weekday = date.getDay()
518
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
519
+        return this.timeFormat(date);
520
+      },
521
+      // 本月
522
+      getFirstDayOfMonth (date) {
523
+        date.setDate(1);
524
+        return this.timeFormat(date);
525
+      },
526
+       //上个月第一天
527
+       getLastMonthFirstDay() {
528
+          var date = new Date();
529
+          date.setDate(0);
530
+          var y = date.getFullYear(); //获取年份
531
+          var m = date.getMonth() + 1; //获取月份
532
+          m = m < 10 ? "0" + m : m;
533
+          this.start_date = [y, m, '01'].join("-")
534
+          // return [y, m, '01'].join("-");
535
+      },
536
+      // 上个月最后一天
537
+      getLastMonthLastDay() {
538
+          var date = new Date();
539
+          date.setDate(0);
540
+          var y = date.getFullYear(); //获取年份
541
+          var m = date.getMonth() + 1; //获取月份
542
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
543
+          m = m < 10 ? "0" + m : m; //月份补 0
544
+          d = d < 10 ? "0" + d : d; //日数补 0
545
+          this.end_date = [y, m, d].join("-")
546
+          // return [y, m, d].join("-");
547
+      },
548
+
549
+      // 本年
550
+      getFirstDayOfYear (date) {
551
+        date.setDate(1);
552
+        date.setMonth(0);
553
+        return this.timeFormat(date);
554
+      },
555
+      // 上一年第一天
556
+      getLastYearFirstDay() {
557
+          let date = new Date();
558
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
559
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
560
+         const start_day = date.setDate(1); // 设置日期为1日
561
+        //  const last_month = date.setMonth(11); // 设置月份为12月
562
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
563
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
564
+         this.start_date = this.getTime(start_day)
565
+        //  return this.start_date
566
+      },
567
+      // 上一年最后一天
568
+      getLastYearLastDay() {
569
+          let date = new Date();
570
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
571
+          const last_month = date.setMonth(12); // 设置月份为12月
572
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
573
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
574
+          this.end_date = this.getTime(last_day)
575
+          console.log('this.end_date',this.end_date);
576
+          // return this.end_date;
577
+      },
578
+      // 日期格式化
579
+      timeFormat(date) {
580
+          if (!date || typeof(date) === "string") {
581
+            this.error("参数异常,请检查...");
582
+          }
583
+          var y = date.getFullYear(); //年
584
+          if(date.getMonth() + 1<10){
585
+            var m ='0'+(date.getMonth() + 1); //月
586
+          }else{
587
+            var m =date.getMonth() + 1; //月
588
+          }
589
+          if(date.getDate() + 1<10){
590
+            var d ='0'+date.getDate(); //日
591
+          }else{
592
+            var d = date.getDate(); //日
593
+          }
594
+          // var d = date.getDate(); //日
595
+
596
+          return y + "-" + m + "-" + d;
597
+      },
598
+      handleCurrentChange(val){
599
+        this.currentPage = val
600
+        this.getdetail(this.status_value)
601
+      },
602
+      handleSizeChange(val){
603
+        this.limit = val
604
+        this.getdetail(this.status_value)
605
+      },
606
+       // 转换时间
607
+      getTime(val) {
608
+        if(val < 0){
609
+          return ""
610
+        }
611
+        if(val == ""){
612
+          return ""
613
+        }else {
614
+          return uParseTime(val, '{y}-{m}-{d}')
615
+        }
616
+      },
617
+      dataURLtoBlob(dataURL) {
618
+        const arr = dataURL.split(',');
619
+        const mime = arr[0].match(/:(.*?);/)[1];
620
+        const bstr = atob(arr[1]);
621
+        let n = bstr.length;
622
+        const u8arr = new Uint8Array(n);
623
+        while (n--) {
624
+          u8arr[n] = bstr.charCodeAt(n);
625
+        }
626
+        return new Blob([u8arr], { type: mime });
627
+      },
628
+      // 计算年龄
629
+      analyzeIDCard(IDCard){
630
+        var age = 0,yearBirth,monthBirth,dayBirth;
631
+        //获取用户身份证号码
632
+        var userCard = IDCard;
633
+        //如果身份证号码为undefind则返回空
634
+        if(!userCard){
635
+          return age;
636
+        }
637
+        var reg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/; //验证身份证号码的正则
638
+        if (reg.test(userCard)) {
639
+          if (userCard.length == 15) {
640
+              var org_birthday = userCard.substring(6, 12);
641
+              //获取出生年月日
642
+              yearBirth = "19" + org_birthday.substring(0, 2);
643
+              monthBirth = org_birthday.substring(2, 4);
644
+              dayBirth = org_birthday.substring(4, 6);
645
+              } else if (userCard.length == 18) {
646
+              //获取出生年月日
647
+              yearBirth = userCard.substring(6,10);
648
+              monthBirth = userCard.substring(10,12);
649
+              dayBirth = userCard.substring(12,14);
650
+
651
+            }
652
+            //获取当前年月日并计算年龄
653
+            var myDate = new Date();
654
+            var monthNow = myDate.getMonth() + 1;
655
+            var dayNow = myDate.getDate();
656
+            var age = myDate.getFullYear() - yearBirth;
657
+            if(monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)){
658
+              age--;
659
+            }
660
+            //返回年龄
661
+            return age;
662
+        } else {
663
+          return ''
664
+        }
665
+
666
+      },
667
+      // 护士
668
+      getAllNurseList(){
669
+        getAllNurseList().then(response=>{
670
+           if(response.data.state ==1){
671
+             var nurseList  = response.data.data.nurseList
672
+            console.log('0000',nurseList);
673
+             this.nurseList =nurseList
674
+           }
675
+        })
676
+      },
677
+      // 医生
678
+      getAllDoctorList(){
679
+        getAllDoctorList().then(response=>{
680
+          if(response.data.state == 1){
681
+              var list = response.data.data.list
682
+              console.log("list222222",list)
683
+              this.docList = list
684
+              this.operators = response.data.data.operators
685
+          }
686
+        })
687
+      },
688
+      getnurse(ids){
689
+        const nurse = this.nurseList
690
+        for(let i in nurse){
691
+          if(ids==nurse[i].admin_user_id){
692
+            return nurse[i].user_name
693
+          }
694
+        }
695
+      },
696
+      getdoctor(ids){
697
+        const doctor = this.docList
698
+        for(let i in doctor){
699
+          if(ids == doctor[i].admin_user_id){
700
+            return doctor[i].user_name
701
+          }
702
+        }
703
+      }
704
+    },
705
+    mounted(){
706
+      this.getecharts()
707
+    },
708
+    created(){
709
+      this.start_date = this.getFirstDayOfMonth(new Date())
710
+      this.getAllNurseList()
711
+      this.getAllDoctorList()
712
+    },
713
+
714
+  }
715
+</script>

+ 600 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/blood_table.vue View File

@@ -0,0 +1,600 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者血压详情</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;margin-bottom: 20px;">
14
+          <div style="flex: 2;display: flex;flex-wrap:wrap">
15
+            <div>
16
+              日期:
17
+              <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
18
+                <el-option
19
+                  v-for="item in date_options"
20
+                  :key="item.value"
21
+                  :label="item.label"
22
+                  :value="item.value">
23
+                </el-option>
24
+              </el-select>
25
+            </div>
26
+            <div style="margin:0 10px;">
27
+              <el-date-picker
28
+                v-model="start_date"
29
+                type="date"
30
+                value-format="yyyy-MM-dd"
31
+                placeholder="选择日期"
32
+                style="width: 150px;">
33
+              </el-date-picker>
34
+              <span>-</span>
35
+              <el-date-picker
36
+                v-model="end_date"
37
+                type="date"
38
+                value-format="yyyy-MM-dd"
39
+                placeholder="选择日期"
40
+                style="width: 150px;">
41
+              </el-date-picker>
42
+            </div>
43
+            <div>
44
+              体重增长:
45
+              <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
46
+                <el-option :key="0" label="不限" :value="0"></el-option>
47
+                <el-option
48
+                  v-for="item in dialyze_options"
49
+                  :key="item.id"
50
+                  :label="item.name"
51
+                  :value="item.id">
52
+                </el-option>
53
+              </el-select>
54
+            </div>
55
+            
56
+          </div>
57
+          <div style="flex: 1;">
58
+            <div>
59
+              <el-button type="primary" @click="deil_click">查询</el-button>
60
+              <el-button type="primary" @click="exportExcel">导出</el-button>
61
+            </div>
62
+          </div>
63
+        </div>
64
+
65
+        <el-table :data="tableData" border style="width: 100%"
66
+        :header-cell-style="{textAlign: 'center'}"
67
+        :cell-style="{ textAlign: 'center' }"
68
+        height="380">
69
+          <el-table-column
70
+            prop="index"
71
+            label="序号"
72
+            width="">
73
+          </el-table-column>
74
+          <el-table-column
75
+            prop="dialysis_no"
76
+            label="透析号"
77
+            width="">
78
+          </el-table-column>
79
+          <el-table-column
80
+            prop="name"
81
+            label="患者姓名">
82
+          </el-table-column>
83
+          <el-table-column
84
+            prop="name"
85
+            label="性别"
86
+            width="">
87
+          </el-table-column>
88
+          <el-table-column
89
+            prop="name"
90
+            label="年龄"
91
+            width="">
92
+          </el-table-column>
93
+          <el-table-column
94
+            prop="date"
95
+            label="透析日期"
96
+            width="">
97
+          </el-table-column>
98
+          <el-table-column
99
+            prop="mode_name"
100
+            label="干体重"
101
+            width="">
102
+          </el-table-column>
103
+          <el-table-column
104
+            prop="dialyszers"
105
+            label="超滤总量(L)">
106
+          </el-table-column>
107
+          <el-table-column
108
+            prop="date"
109
+            label="实际超滤量(ml)"
110
+            width="">
111
+          </el-table-column>
112
+          <el-table-column
113
+            prop="mode_name"
114
+            label="超滤滤"
115
+            width="">
116
+          </el-table-column>
117
+          <el-table-column
118
+            prop="dialyszers"
119
+            label="透前血压">
120
+          </el-table-column>
121
+          <el-table-column
122
+            prop="dialyszers"
123
+            label="监测记录血压">
124
+          </el-table-column>
125
+          <el-table-column
126
+            prop="dialyszers"
127
+            label="透后血压">
128
+          </el-table-column>
129
+        </el-table>
130
+        <div style="text-align: right;margin-top: 10px;">
131
+          <el-pagination
132
+            @size-change="handleSizeChange"
133
+            @current-change="handleCurrentChange"
134
+            :current-page="currentPage"
135
+            :page-sizes="[50,100, 200, 300, 400]"
136
+            :page-size="limit"
137
+            layout="total, sizes, prev, pager, next, jumper"
138
+            :total="total">
139
+          </el-pagination>
140
+        </div>
141
+      </div>
142
+    </div>
143
+
144
+    <!-- 弹窗 -->
145
+   
146
+  </div>
147
+</template>
148
+<script>
149
+import * as echarts from 'echarts';
150
+import XLSX from 'xlsx';
151
+import { uParseTime } from "@/utils/tools";
152
+import {Getdialyzer,Getdialyzerdetail,Getdialyzerconfig} from '../../../../api/qcd'
153
+import { forEach } from 'jszip';
154
+import html2canvas from "html2canvas"
155
+  export default {
156
+    components:{
157
+    },
158
+    data(){
159
+      return{
160
+        date_value:4,
161
+        start_date:'',
162
+        end_date:this.getTime(new Date()),
163
+        mode:'',
164
+        date_mode:'',
165
+        source:'',
166
+        dialyze_value:0,
167
+        dialyze_dialog:false,
168
+        currentPage:1,
169
+        limit:50,
170
+        total:0,
171
+        tableData:[],
172
+        dialyze_options:[],
173
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
174
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
175
+        ],
176
+        modearr:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
177
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
178
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
179
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
180
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
181
+          { id:30, name:"血浆胆红素吸附+HP"},{ id:31, name:"HPD"},{ id:32, name:"HDP"},{ id:33, name:"HFD"},{ id:34, name:"HDF100"},
182
+          { id:35, name:"HDF600"},{ id:36, name:"HDF800"},{ id:37, name:"HDF1000"},
183
+        ],
184
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
185
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
186
+
187
+
188
+        input:'',
189
+      }
190
+    },
191
+    methods:{
192
+      // 返回
193
+      return_click(){
194
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
195
+      },
196
+      // 数据源
197
+      getecharts(){
198
+        var chartDom = document.getElementById('mychart')
199
+        var myChart = echarts.init(chartDom);
200
+        const params ={
201
+          start_date:this.start_date,
202
+          end_date:this.end_date,
203
+        }
204
+        Getdialyzer(params).then(response =>{
205
+          console.log('ressponse',response.data.data);
206
+          if(response.data.state ==1){
207
+            console.log('bbbbbbbbb',response.data.data);
208
+            const list = response.data.data.data
209
+            const xAxis =[]
210
+            const yAxis = []
211
+            list.forEach(item =>{
212
+
213
+              xAxis.push(item.name)
214
+              yAxis.push(item.count)
215
+            })
216
+            this.bar_xAxis = xAxis
217
+            const options = []
218
+            for(let i in xAxis){
219
+              const arr ={
220
+                id:i+1,
221
+                name:xAxis[i]
222
+              }
223
+              options.push(arr)
224
+            }
225
+            this.dialyze_options = options
226
+            const option = {
227
+              xAxis: {
228
+                type: 'category',
229
+                data: xAxis,
230
+                axisLabel:{
231
+                  interval:0,
232
+                }
233
+              },
234
+              yAxis: {
235
+                type: 'value'
236
+              },
237
+              series: [
238
+                {
239
+                  data:yAxis ,
240
+                  type: 'bar',
241
+                  barWidth: '25%',
242
+                  label: {
243
+                    normal: {
244
+                      show: true,
245
+                      position: 'top',
246
+                      formatter: '{c}',
247
+                      textStyle:{
248
+                        color: 'black',//字体颜色
249
+                        fontSize: 13//字体大小
250
+                      }
251
+                    },
252
+                  },
253
+                  itemStyle:{
254
+                    normal:{
255
+                      color:function (params){
256
+                        // const colorarr=['#FFA333','#A155E8','#6D91FF','#A233A2'];
257
+                        var colorarr = [["#A9E0F3", "#9FBDFC"],["#FFD7C0", "#FF9994"]]
258
+                        var index = params.dataIndex;
259
+                        if (params.dataIndex >= colorarr.length) {
260
+                          index = params.dataIndex % colorarr.length;
261
+                        }
262
+                        return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
263
+                          { offset: 0, color: colorarr[index][0] },
264
+                          // { offset: 0.5, color: colorList[index][1] },
265
+                          { offset: 1, color: colorarr[index][1] }
266
+                        ]);
267
+                      }
268
+                    }
269
+                  }
270
+                }
271
+              ]
272
+            }
273
+            myChart.setOption(option);
274
+            myChart.on('click',params =>{
275
+              this.dialyze_dialog = true
276
+              console.log('vvvvv',params);
277
+              this.Getdialyzerdetail(params.name)
278
+            })
279
+          }
280
+
281
+        })
282
+
283
+      },
284
+      // 导出excel
285
+      exportExcel(){
286
+        let tableData = [
287
+          ['序号', '透析号', '患者姓名', '透析日期','透析模式', '透析器']//导出表头
288
+        ]
289
+        this.tableData.forEach((item,index) =>{
290
+          let rowdata=[]
291
+          rowdata=[
292
+            item.index,
293
+            item.dialysis_no,
294
+            item.name,
295
+            item.date,
296
+            item.mode_name,
297
+            item.dialyszers,
298
+          ]
299
+          tableData.push(rowdata)
300
+        })
301
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
302
+        let bookNew = XLSX.utils.book_new();
303
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析器使用统计') // 工作簿名称
304
+        let name = '透析器使用统计'+ '.xlsx'
305
+        XLSX.writeFile(bookNew, name) // 保存的文件名
306
+      },
307
+      // 查询
308
+      sete_click(){
309
+        this.getecharts()
310
+      },
311
+      // 详情查询
312
+      deil_click(){
313
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
314
+      },
315
+       // 下载
316
+      Download_click(){
317
+        const options ={
318
+          allowTaint: true,
319
+          useCORS: true
320
+        }
321
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
322
+          // const imageSrc = canvas.toDataURL();
323
+          const imageUrl = canvas.toDataURL("image/png");
324
+          // console.log('5555',imageUrl);
325
+        //   // const base = this.url.split(',')[1]
326
+        //   // console.log('2222',base);
327
+          const blob = this.dataURLtoBlob(imageUrl)
328
+          // console.log('4444',blob);
329
+          const url = URL.createObjectURL(blob);
330
+          // const file = (this.url).blob();
331
+          // console.log('1111',url);
332
+          var link= document.createElement("a");
333
+        //   //将生成的图片url赋值给a标签的href属性
334
+          link.href = url;
335
+        //   //设置下载的文件名
336
+          link.download = "透析器使用统计.jpg";
337
+          // // 将a标签插入dom中
338
+          console.log('link',link);
339
+          document.body.appendChild(link);
340
+          //模拟点击事件触发下载
341
+          link.click();
342
+          // 完成之后销毁创建的a标签
343
+          document.body.removeChild(link);
344
+
345
+        })
346
+      },
347
+      // 选择日期
348
+      datachange(eve){
349
+        if(eve ==1){
350
+          this.start_date = this.getPreviousDate(7)
351
+          this.end_date = this.getTime(new Date())
352
+        }else if(eve==2){
353
+          this.start_date = this.getFirstDayOfWeek(new Date())
354
+          this.end_date = this.getTime(new Date())
355
+          console.log('this.start_date', this.start_date);
356
+        }else if(eve ==3){
357
+          var date=new Date()
358
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
359
+          var m =''
360
+          var d = ''
361
+          if(date.getMonth() + 1<10){
362
+            m = '0'+(date.getMonth() + 1)
363
+          }else{
364
+             m = date.getMonth() + 1
365
+          }
366
+          if(date.getDate()<10){
367
+             d = '0'+date.getDate()
368
+          }else{
369
+            d = date.getDate()
370
+          }
371
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
372
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
373
+          date.setDate(date.getDate() +6);
374
+          var mm = ''
375
+          var dd = ''
376
+          if(date.getMonth() + 1<10){
377
+            mm = '0'+(date.getMonth() + 1)
378
+          }else{
379
+            mm = date.getMonth() + 1
380
+          }
381
+          if(date.getDate()<10){
382
+            dd = '0'+date.getDate()
383
+          }else{
384
+            dd = date.getDate()
385
+          }
386
+          // if(date.getMonth() + 1<10)
387
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
388
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
389
+          console.log('this.end_date',this.end_date);
390
+
391
+        }else if(eve ==4){
392
+          this.start_date = this.getFirstDayOfMonth(new Date())
393
+          this.end_date = this.getTime(new Date())
394
+        }else if(eve ==5){
395
+          this.getLastMonthFirstDay()
396
+          this.getLastMonthLastDay()
397
+        }else if(eve == 6){
398
+          this.start_date = this.getFirstDayOfYear(new Date())
399
+          this.end_date = this.getTime(new Date())
400
+        }else if(eve == 7){
401
+          this.getLastYearFirstDay()
402
+          this.getLastYearLastDay()
403
+        }
404
+        console.log('eve',eve);
405
+      },
406
+      // 详情数据源
407
+      Getdialyzerdetail(name){
408
+        const params={
409
+          dialyzer:name,
410
+          start_date:this.start_date,
411
+          end_date:this.end_date,
412
+          page:this.currentPage,
413
+          limit:this.limit,
414
+        }
415
+        Getdialyzerdetail(params).then(response =>{
416
+          if(response.data.state == 1){
417
+            const list = response.data.data.prescriptions
418
+            const table=[]
419
+            list.forEach((item,index)=>{
420
+              const obj ={
421
+                index:index+1,
422
+                dialysis_no:item.patient.dialysis_no,
423
+                name:item.patient.name,
424
+                date:this.getTime(item.record_date),
425
+                mode_name:this.getmode(item.mode_id),
426
+                dialyszers:item.dialysis_dialyszers +'  '+ item.dialysis_irrigation+'  '+item.dialysis_strainer
427
+                // dialyszers:item.dialysis_dialyszers || item.dialysis_irrigation || item.dialysis_strainer
428
+              }
429
+              table.push(obj)
430
+            })
431
+            this.tableData = table
432
+            this.total = response.data.data.total
433
+          }
434
+          console.log('77777',response);
435
+        })
436
+      },
437
+       // 首先定义一个getPreviousDate函数,方便调用
438
+      getPreviousDate(numOfDays) {
439
+        var date = new Date();
440
+        date.setDate(date.getDate() - numOfDays);
441
+        var year = date.getFullYear();
442
+        if(date.getMonth() + 1<10){
443
+          var month = '0'+(date.getMonth() + 1);
444
+        }else{
445
+          var month = date.getMonth() + 1;
446
+        }
447
+
448
+        if(date.getDate()<10){
449
+          var day = '0'+date.getDate();
450
+        }else{
451
+          var day = date.getDate();
452
+        }
453
+        return year + "-" + month + "-" + day;
454
+      },
455
+      // 本周
456
+      getFirstDayOfWeek(date){
457
+        var weekday = date.getDay()
458
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
459
+        return this.timeFormat(date);
460
+      },
461
+      // 本月
462
+      getFirstDayOfMonth (date) {
463
+        date.setDate(1);
464
+        return this.timeFormat(date);
465
+      },
466
+       //上个月第一天
467
+      getLastMonthFirstDay() {
468
+          var date = new Date();
469
+          date.setDate(0);
470
+          var y = date.getFullYear(); //获取年份
471
+          var m = date.getMonth() + 1; //获取月份
472
+          m = m < 10 ? "0" + m : m;
473
+          this.start_date = [y, m, '01'].join("-")
474
+          // return [y, m, '01'].join("-");
475
+      },
476
+      // 上个月最后一天
477
+      getLastMonthLastDay() {
478
+          var date = new Date();
479
+          date.setDate(0);
480
+          var y = date.getFullYear(); //获取年份
481
+          var m = date.getMonth() + 1; //获取月份
482
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
483
+          m = m < 10 ? "0" + m : m; //月份补 0
484
+          d = d < 10 ? "0" + d : d; //日数补 0
485
+          this.end_date = [y, m, d].join("-")
486
+          // return [y, m, d].join("-");
487
+      },
488
+      // 本年
489
+      getFirstDayOfYear (date) {
490
+        date.setDate(1);
491
+        date.setMonth(0);
492
+        return this.timeFormat(date);
493
+      },
494
+      // 上一年第一天
495
+      getLastYearFirstDay() {
496
+          let date = new Date();
497
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
498
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
499
+         const start_day = date.setDate(1); // 设置日期为1日
500
+        //  const last_month = date.setMonth(11); // 设置月份为12月
501
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
502
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
503
+         this.start_date = this.getTime(start_day)
504
+        //  return this.start_date
505
+      },
506
+      // 上一年最后一天
507
+      getLastYearLastDay() {
508
+          let date = new Date();
509
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
510
+          const last_month = date.setMonth(12); // 设置月份为12月
511
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
512
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
513
+          this.end_date = this.getTime(last_day)
514
+          console.log('this.end_date',this.end_date);
515
+          // return this.end_date;
516
+      },
517
+      // 日期格式化
518
+      timeFormat(date) {
519
+          if (!date || typeof(date) === "string") {
520
+            this.error("参数异常,请检查...");
521
+          }
522
+          var y = date.getFullYear(); //年
523
+          if(date.getMonth() + 1<10){
524
+            var m ='0'+(date.getMonth() + 1); //月
525
+          }else{
526
+            var m =date.getMonth() + 1; //月
527
+          }
528
+          if(date.getDate() + 1<10){
529
+            var d ='0'+date.getDate(); //日
530
+          }else{
531
+            var d = date.getDate(); //日
532
+          }
533
+          // var d = date.getDate(); //日
534
+
535
+          return y + "-" + m + "-" + d;
536
+      },
537
+      handleCurrentChange(val){
538
+        this.currentPage = val
539
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
540
+      },
541
+      handleSizeChange(val){
542
+        this.limit = val
543
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
544
+      },
545
+      // 透析模式
546
+      getmode(ids){
547
+        const modes=this.modearr
548
+        for(let i in modes){
549
+          if(ids == modes[i].id){
550
+            return modes[i].name
551
+          }
552
+        }
553
+      },
554
+       // 转换时间
555
+      getTime(val) {
556
+        if(val < 0){
557
+          return ""
558
+        }
559
+        if(val == ""){
560
+          return ""
561
+        }else {
562
+          return uParseTime(val, '{y}-{m}-{d}')
563
+        }
564
+      },
565
+      dataURLtoBlob(dataURL) {
566
+        const arr = dataURL.split(',');
567
+        const mime = arr[0].match(/:(.*?);/)[1];
568
+        const bstr = atob(arr[1]);
569
+        let n = bstr.length;
570
+        const u8arr = new Uint8Array(n);
571
+        while (n--) {
572
+          u8arr[n] = bstr.charCodeAt(n);
573
+        }
574
+        return new Blob([u8arr], { type: mime });
575
+      },
576
+      // 全部透析器
577
+      Getdialyzerconfig(){
578
+        Getdialyzerconfig().then(response =>{
579
+          console.log('666666',response);
580
+        })
581
+      },
582
+      getdialyze(val){
583
+        const option = this.dialyze_options
584
+        for(let i in option){
585
+          if(val == option[i].id){
586
+            return option[i].name
587
+          }
588
+        }
589
+      }
590
+    },
591
+    mounted(){
592
+      this.getecharts()
593
+    },
594
+    created(){
595
+      this.start_date = this.getFirstDayOfMonth(new Date())
596
+      this.Getdialyzerconfig()
597
+    },
598
+
599
+  }
600
+</script>

+ 681 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/dialyze_after.vue View File

@@ -0,0 +1,681 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者透后体重分析</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin: 0 10px;">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+        <div style="position: fixed;right: 5%;top: 50vh;">
53
+          <el-popover
54
+            placement="left"
55
+            title="提示"
56
+            width="500"
57
+            trigger="click"
58
+            content="1.统计时间段内所有患者每次透析后,透后体重是否在干体重的±0.3范围内。">
59
+            <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
60
+            <!-- <el-button slot="reference">click 激活</el-button> -->
61
+          </el-popover>
62
+        </div>
63
+      </div>
64
+    </div>
65
+
66
+    <!-- 弹窗 -->
67
+    <div>
68
+      <el-dialog
69
+        title="详情"
70
+        :visible.sync="dialyze_dialog"
71
+        width="80%">
72
+        <div>
73
+          <div style="display: flex;margin-bottom: 20px;">
74
+            <div style="flex: 2;display: flex;flex-wrap:wrap">
75
+              <div>
76
+                日期:
77
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
78
+                  <el-option
79
+                    v-for="item in date_options"
80
+                    :key="item.value"
81
+                    :label="item.label"
82
+                    :value="item.value">
83
+                  </el-option>
84
+                </el-select>
85
+              </div>
86
+              <div style="margin:0 10px;">
87
+                <el-date-picker
88
+                  v-model="start_date"
89
+                  type="date"
90
+                  value-format="yyyy-MM-dd"
91
+                  placeholder="选择日期"
92
+                  style="width: 150px;">
93
+                </el-date-picker>
94
+                <span>-</span>
95
+                <el-date-picker
96
+                  v-model="end_date"
97
+                  type="date"
98
+                  value-format="yyyy-MM-dd"
99
+                  placeholder="选择日期"
100
+                  style="width: 150px;">
101
+                </el-date-picker>
102
+              </div>
103
+              <div>
104
+                体重增长:
105
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
106
+                  <el-option :key="0" label="不限" :value="0"></el-option>
107
+                  <el-option
108
+                    v-for="item in dialyze_options"
109
+                    :key="item.id"
110
+                    :label="item.name"
111
+                    :value="item.id">
112
+                  </el-option>
113
+                </el-select>
114
+              </div>
115
+              <div>
116
+                干体重:
117
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
118
+                  <el-option :key="0" label="不限" :value="0"></el-option>
119
+                  <el-option
120
+                    v-for="item in dialyze_options"
121
+                    :key="item.id"
122
+                    :label="item.name"
123
+                    :value="item.id">
124
+                  </el-option>
125
+                </el-select>
126
+              </div>
127
+              <div>
128
+                透后体重:
129
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
130
+                  <el-option :key="0" label="不限" :value="0"></el-option>
131
+                  <el-option
132
+                    v-for="item in dialyze_options"
133
+                    :key="item.id"
134
+                    :label="item.name"
135
+                    :value="item.id">
136
+                  </el-option>
137
+                </el-select>
138
+              </div>
139
+              <div >
140
+                <el-input v-model="input" placeholder="搜索患者姓名"></el-input>
141
+              </div>
142
+            </div>
143
+            <div style="flex: 1;">
144
+              <div>
145
+                <el-button type="primary" @click="deil_click">查询</el-button>
146
+                <el-button type="primary" @click="exportExcel">导出</el-button>
147
+              </div>
148
+            </div>
149
+          </div>
150
+
151
+          <el-table :data="tableData" border style="width: 100%"
152
+          :header-cell-style="{textAlign: 'center'}"
153
+          :cell-style="{ textAlign: 'center' }"
154
+          height="380">
155
+            <el-table-column
156
+              prop="index"
157
+              label="序号"
158
+              width="">
159
+            </el-table-column>
160
+            <el-table-column
161
+              prop="dialysis_no"
162
+              label="透析号"
163
+              width="">
164
+            </el-table-column>
165
+            <el-table-column
166
+              prop="name"
167
+              label="患者姓名">
168
+            </el-table-column>
169
+            <el-table-column
170
+              prop="name"
171
+              label="性别"
172
+              width="">
173
+            </el-table-column>
174
+            <el-table-column
175
+              prop="name"
176
+              label="年龄"
177
+              width="">
178
+            </el-table-column>
179
+            <el-table-column
180
+              prop="date"
181
+              label="透析日期"
182
+              width="">
183
+            </el-table-column>
184
+            <el-table-column
185
+              prop="mode_name"
186
+              label="干体重"
187
+              width="">
188
+            </el-table-column>
189
+            <el-table-column
190
+              prop="dialyszers"
191
+              label="前次透后体重">
192
+            </el-table-column>
193
+            <el-table-column
194
+              prop="date"
195
+              label="透前体重"
196
+              width="">
197
+            </el-table-column>
198
+            <el-table-column
199
+              prop="mode_name"
200
+              label="体重增加"
201
+              width="">
202
+            </el-table-column>
203
+            <el-table-column
204
+              prop="dialyszers"
205
+              label="透后体重">
206
+            </el-table-column>
207
+          </el-table>
208
+          <div style="text-align: right;margin-top: 10px;">
209
+            <el-pagination
210
+              @size-change="handleSizeChange"
211
+              @current-change="handleCurrentChange"
212
+              :current-page="currentPage"
213
+              :page-sizes="[50,100, 200, 300, 400]"
214
+              :page-size="limit"
215
+              layout="total, sizes, prev, pager, next, jumper"
216
+              :total="total">
217
+            </el-pagination>
218
+          </div>
219
+
220
+        </div>
221
+        <span slot="footer" class="dialog-footer">
222
+          <el-button @click="dialyze_dialog = false">取 消</el-button>
223
+          <el-button type="primary" @click="dialyze_dialog = false">确 定</el-button>
224
+        </span>
225
+      </el-dialog>
226
+    </div>
227
+  </div>
228
+</template>
229
+<script>
230
+import * as echarts from 'echarts';
231
+import XLSX from 'xlsx';
232
+import { uParseTime } from "@/utils/tools";
233
+import {Getdialyzer,Getdialyzerdetail,Getdialyzerconfig} from '../../../../api/qcd'
234
+import { forEach } from 'jszip';
235
+import html2canvas from "html2canvas"
236
+  export default {
237
+    components:{
238
+    },
239
+    data(){
240
+      return{
241
+        date_value:4,
242
+        start_date:'',
243
+        end_date:this.getTime(new Date()),
244
+        mode:'',
245
+        date_mode:'',
246
+        source:'',
247
+        dialyze_value:0,
248
+        dialyze_dialog:false,
249
+        currentPage:1,
250
+        limit:50,
251
+        total:0,
252
+        tableData:[],
253
+        dialyze_options:[],
254
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
255
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
256
+        ],
257
+        modearr:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
258
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
259
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
260
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
261
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
262
+          { id:30, name:"血浆胆红素吸附+HP"},{ id:31, name:"HPD"},{ id:32, name:"HDP"},{ id:33, name:"HFD"},{ id:34, name:"HDF100"},
263
+          { id:35, name:"HDF600"},{ id:36, name:"HDF800"},{ id:37, name:"HDF1000"},
264
+        ],
265
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
266
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
267
+
268
+
269
+        input:'',
270
+      }
271
+    },
272
+    methods:{
273
+      // 返回
274
+      return_click(){
275
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
276
+      },
277
+      // 数据源
278
+      getecharts(){
279
+        var chartDom = document.getElementById('mychart')
280
+        var myChart = echarts.init(chartDom);
281
+        const params ={
282
+          start_date:this.start_date,
283
+          end_date:this.end_date,
284
+        }
285
+        Getdialyzer(params).then(response =>{
286
+          console.log('ressponse',response.data.data);
287
+          if(response.data.state ==1){
288
+            console.log('bbbbbbbbb',response.data.data);
289
+            const list = response.data.data.data
290
+            const xAxis =[]
291
+            const yAxis = []
292
+            list.forEach(item =>{
293
+
294
+              xAxis.push(item.name)
295
+              yAxis.push(item.count)
296
+            })
297
+            this.bar_xAxis = xAxis
298
+            const options = []
299
+            for(let i in xAxis){
300
+              const arr ={
301
+                id:i+1,
302
+                name:xAxis[i]
303
+              }
304
+              options.push(arr)
305
+            }
306
+            this.dialyze_options = options
307
+            const option = {
308
+              xAxis: {
309
+                type: 'category',
310
+                data: xAxis,
311
+                axisLabel:{
312
+                  interval:0,
313
+                }
314
+              },
315
+              yAxis: {
316
+                type: 'value'
317
+              },
318
+              series: [
319
+                {
320
+                  data:yAxis ,
321
+                  type: 'bar',
322
+                  barWidth: '25%',
323
+                  label: {
324
+                    normal: {
325
+                      show: true,
326
+                      position: 'top',
327
+                      formatter: '{c}',
328
+                      textStyle:{
329
+                        color: 'black',//字体颜色
330
+                        fontSize: 13//字体大小
331
+                      }
332
+                    },
333
+                  },
334
+                  itemStyle:{
335
+                    normal:{
336
+                      color:function (params){
337
+                        // const colorarr=['#FFA333','#A155E8','#6D91FF','#A233A2'];
338
+                        var colorarr = [["#A9E0F3", "#9FBDFC"],["#FFD7C0", "#FF9994"]]
339
+                        var index = params.dataIndex;
340
+                        if (params.dataIndex >= colorarr.length) {
341
+                          index = params.dataIndex % colorarr.length;
342
+                        }
343
+                        return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
344
+                          { offset: 0, color: colorarr[index][0] },
345
+                          // { offset: 0.5, color: colorList[index][1] },
346
+                          { offset: 1, color: colorarr[index][1] }
347
+                        ]);
348
+                      }
349
+                    }
350
+                  }
351
+                }
352
+              ]
353
+            }
354
+            myChart.setOption(option);
355
+            myChart.on('click',params =>{
356
+              this.dialyze_dialog = true
357
+              console.log('vvvvv',params);
358
+              this.Getdialyzerdetail(params.name)
359
+            })
360
+          }
361
+
362
+        })
363
+
364
+      },
365
+      // 导出excel
366
+      exportExcel(){
367
+        let tableData = [
368
+          ['序号', '透析号', '患者姓名', '透析日期','透析模式', '透析器']//导出表头
369
+        ]
370
+        this.tableData.forEach((item,index) =>{
371
+          let rowdata=[]
372
+          rowdata=[
373
+            item.index,
374
+            item.dialysis_no,
375
+            item.name,
376
+            item.date,
377
+            item.mode_name,
378
+            item.dialyszers,
379
+          ]
380
+          tableData.push(rowdata)
381
+        })
382
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
383
+        let bookNew = XLSX.utils.book_new();
384
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析器使用统计') // 工作簿名称
385
+        let name = '透析器使用统计'+ '.xlsx'
386
+        XLSX.writeFile(bookNew, name) // 保存的文件名
387
+      },
388
+      // 查询
389
+      sete_click(){
390
+        this.getecharts()
391
+      },
392
+      // 详情查询
393
+      deil_click(){
394
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
395
+      },
396
+       // 下载
397
+      Download_click(){
398
+        const options ={
399
+          allowTaint: true,
400
+          useCORS: true
401
+        }
402
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
403
+          // const imageSrc = canvas.toDataURL();
404
+          const imageUrl = canvas.toDataURL("image/png");
405
+          // console.log('5555',imageUrl);
406
+        //   // const base = this.url.split(',')[1]
407
+        //   // console.log('2222',base);
408
+          const blob = this.dataURLtoBlob(imageUrl)
409
+          // console.log('4444',blob);
410
+          const url = URL.createObjectURL(blob);
411
+          // const file = (this.url).blob();
412
+          // console.log('1111',url);
413
+          var link= document.createElement("a");
414
+        //   //将生成的图片url赋值给a标签的href属性
415
+          link.href = url;
416
+        //   //设置下载的文件名
417
+          link.download = "透析器使用统计.jpg";
418
+          // // 将a标签插入dom中
419
+          console.log('link',link);
420
+          document.body.appendChild(link);
421
+          //模拟点击事件触发下载
422
+          link.click();
423
+          // 完成之后销毁创建的a标签
424
+          document.body.removeChild(link);
425
+
426
+        })
427
+      },
428
+      // 选择日期
429
+      datachange(eve){
430
+        if(eve ==1){
431
+          this.start_date = this.getPreviousDate(7)
432
+          this.end_date = this.getTime(new Date())
433
+        }else if(eve==2){
434
+          this.start_date = this.getFirstDayOfWeek(new Date())
435
+          this.end_date = this.getTime(new Date())
436
+          console.log('this.start_date', this.start_date);
437
+        }else if(eve ==3){
438
+          var date=new Date()
439
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
440
+          var m =''
441
+          var d = ''
442
+          if(date.getMonth() + 1<10){
443
+            m = '0'+(date.getMonth() + 1)
444
+          }else{
445
+             m = date.getMonth() + 1
446
+          }
447
+          if(date.getDate()<10){
448
+             d = '0'+date.getDate()
449
+          }else{
450
+            d = date.getDate()
451
+          }
452
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
453
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
454
+          date.setDate(date.getDate() +6);
455
+          var mm = ''
456
+          var dd = ''
457
+          if(date.getMonth() + 1<10){
458
+            mm = '0'+(date.getMonth() + 1)
459
+          }else{
460
+            mm = date.getMonth() + 1
461
+          }
462
+          if(date.getDate()<10){
463
+            dd = '0'+date.getDate()
464
+          }else{
465
+            dd = date.getDate()
466
+          }
467
+          // if(date.getMonth() + 1<10)
468
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
469
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
470
+          console.log('this.end_date',this.end_date);
471
+
472
+        }else if(eve ==4){
473
+          this.start_date = this.getFirstDayOfMonth(new Date())
474
+          this.end_date = this.getTime(new Date())
475
+        }else if(eve ==5){
476
+          this.getLastMonthFirstDay()
477
+          this.getLastMonthLastDay()
478
+        }else if(eve == 6){
479
+          this.start_date = this.getFirstDayOfYear(new Date())
480
+          this.end_date = this.getTime(new Date())
481
+        }else if(eve == 7){
482
+          this.getLastYearFirstDay()
483
+          this.getLastYearLastDay()
484
+        }
485
+        console.log('eve',eve);
486
+      },
487
+      // 详情数据源
488
+      Getdialyzerdetail(name){
489
+        const params={
490
+          dialyzer:name,
491
+          start_date:this.start_date,
492
+          end_date:this.end_date,
493
+          page:this.currentPage,
494
+          limit:this.limit,
495
+        }
496
+        Getdialyzerdetail(params).then(response =>{
497
+          if(response.data.state == 1){
498
+            const list = response.data.data.prescriptions
499
+            const table=[]
500
+            list.forEach((item,index)=>{
501
+              const obj ={
502
+                index:index+1,
503
+                dialysis_no:item.patient.dialysis_no,
504
+                name:item.patient.name,
505
+                date:this.getTime(item.record_date),
506
+                mode_name:this.getmode(item.mode_id),
507
+                dialyszers:item.dialysis_dialyszers +'  '+ item.dialysis_irrigation+'  '+item.dialysis_strainer
508
+                // dialyszers:item.dialysis_dialyszers || item.dialysis_irrigation || item.dialysis_strainer
509
+              }
510
+              table.push(obj)
511
+            })
512
+            this.tableData = table
513
+            this.total = response.data.data.total
514
+          }
515
+          console.log('77777',response);
516
+        })
517
+      },
518
+       // 首先定义一个getPreviousDate函数,方便调用
519
+      getPreviousDate(numOfDays) {
520
+        var date = new Date();
521
+        date.setDate(date.getDate() - numOfDays);
522
+        var year = date.getFullYear();
523
+        if(date.getMonth() + 1<10){
524
+          var month = '0'+(date.getMonth() + 1);
525
+        }else{
526
+          var month = date.getMonth() + 1;
527
+        }
528
+
529
+        if(date.getDate()<10){
530
+          var day = '0'+date.getDate();
531
+        }else{
532
+          var day = date.getDate();
533
+        }
534
+        return year + "-" + month + "-" + day;
535
+      },
536
+      // 本周
537
+      getFirstDayOfWeek(date){
538
+        var weekday = date.getDay()
539
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
540
+        return this.timeFormat(date);
541
+      },
542
+      // 本月
543
+      getFirstDayOfMonth (date) {
544
+        date.setDate(1);
545
+        return this.timeFormat(date);
546
+      },
547
+       //上个月第一天
548
+      getLastMonthFirstDay() {
549
+          var date = new Date();
550
+          date.setDate(0);
551
+          var y = date.getFullYear(); //获取年份
552
+          var m = date.getMonth() + 1; //获取月份
553
+          m = m < 10 ? "0" + m : m;
554
+          this.start_date = [y, m, '01'].join("-")
555
+          // return [y, m, '01'].join("-");
556
+      },
557
+      // 上个月最后一天
558
+      getLastMonthLastDay() {
559
+          var date = new Date();
560
+          date.setDate(0);
561
+          var y = date.getFullYear(); //获取年份
562
+          var m = date.getMonth() + 1; //获取月份
563
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
564
+          m = m < 10 ? "0" + m : m; //月份补 0
565
+          d = d < 10 ? "0" + d : d; //日数补 0
566
+          this.end_date = [y, m, d].join("-")
567
+          // return [y, m, d].join("-");
568
+      },
569
+      // 本年
570
+      getFirstDayOfYear (date) {
571
+        date.setDate(1);
572
+        date.setMonth(0);
573
+        return this.timeFormat(date);
574
+      },
575
+      // 上一年第一天
576
+      getLastYearFirstDay() {
577
+          let date = new Date();
578
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
579
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
580
+         const start_day = date.setDate(1); // 设置日期为1日
581
+        //  const last_month = date.setMonth(11); // 设置月份为12月
582
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
583
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
584
+         this.start_date = this.getTime(start_day)
585
+        //  return this.start_date
586
+      },
587
+      // 上一年最后一天
588
+      getLastYearLastDay() {
589
+          let date = new Date();
590
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
591
+          const last_month = date.setMonth(12); // 设置月份为12月
592
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
593
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
594
+          this.end_date = this.getTime(last_day)
595
+          console.log('this.end_date',this.end_date);
596
+          // return this.end_date;
597
+      },
598
+      // 日期格式化
599
+      timeFormat(date) {
600
+          if (!date || typeof(date) === "string") {
601
+            this.error("参数异常,请检查...");
602
+          }
603
+          var y = date.getFullYear(); //年
604
+          if(date.getMonth() + 1<10){
605
+            var m ='0'+(date.getMonth() + 1); //月
606
+          }else{
607
+            var m =date.getMonth() + 1; //月
608
+          }
609
+          if(date.getDate() + 1<10){
610
+            var d ='0'+date.getDate(); //日
611
+          }else{
612
+            var d = date.getDate(); //日
613
+          }
614
+          // var d = date.getDate(); //日
615
+
616
+          return y + "-" + m + "-" + d;
617
+      },
618
+      handleCurrentChange(val){
619
+        this.currentPage = val
620
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
621
+      },
622
+      handleSizeChange(val){
623
+        this.limit = val
624
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
625
+      },
626
+      // 透析模式
627
+      getmode(ids){
628
+        const modes=this.modearr
629
+        for(let i in modes){
630
+          if(ids == modes[i].id){
631
+            return modes[i].name
632
+          }
633
+        }
634
+      },
635
+       // 转换时间
636
+      getTime(val) {
637
+        if(val < 0){
638
+          return ""
639
+        }
640
+        if(val == ""){
641
+          return ""
642
+        }else {
643
+          return uParseTime(val, '{y}-{m}-{d}')
644
+        }
645
+      },
646
+      dataURLtoBlob(dataURL) {
647
+        const arr = dataURL.split(',');
648
+        const mime = arr[0].match(/:(.*?);/)[1];
649
+        const bstr = atob(arr[1]);
650
+        let n = bstr.length;
651
+        const u8arr = new Uint8Array(n);
652
+        while (n--) {
653
+          u8arr[n] = bstr.charCodeAt(n);
654
+        }
655
+        return new Blob([u8arr], { type: mime });
656
+      },
657
+      // 全部透析器
658
+      Getdialyzerconfig(){
659
+        Getdialyzerconfig().then(response =>{
660
+          console.log('666666',response);
661
+        })
662
+      },
663
+      getdialyze(val){
664
+        const option = this.dialyze_options
665
+        for(let i in option){
666
+          if(val == option[i].id){
667
+            return option[i].name
668
+          }
669
+        }
670
+      }
671
+    },
672
+    mounted(){
673
+      this.getecharts()
674
+    },
675
+    created(){
676
+      this.start_date = this.getFirstDayOfMonth(new Date())
677
+      this.Getdialyzerconfig()
678
+    },
679
+
680
+  }
681
+</script>

+ 682 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/dry_denominator.vue View File

@@ -0,0 +1,682 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者体重增长分析(以干体重为分母)</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin: 0 10px;">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+        <div style="position: fixed;right: 5%;top: 50vh;">
53
+          <el-popover
54
+            placement="left"
55
+            title="提示"
56
+            width="500"
57
+            trigger="click"
58
+            content="1.统计时间段内所有患者每次透析时的体重增长情况。
59
+                      2.体重增长=(透前体重-干体重)/干体重×100%。">
60
+            <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
61
+            <!-- <el-button slot="reference">click 激活</el-button> -->
62
+          </el-popover>
63
+        </div>
64
+      </div>
65
+    </div>
66
+
67
+    <!-- 弹窗 -->
68
+    <div>
69
+      <el-dialog
70
+        title="详情"
71
+        :visible.sync="dialyze_dialog"
72
+        width="80%">
73
+        <div>
74
+          <div style="display: flex;margin-bottom: 20px;">
75
+            <div style="flex: 2;display: flex;flex-wrap:wrap">
76
+              <div>
77
+                日期:
78
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
79
+                  <el-option
80
+                    v-for="item in date_options"
81
+                    :key="item.value"
82
+                    :label="item.label"
83
+                    :value="item.value">
84
+                  </el-option>
85
+                </el-select>
86
+              </div>
87
+              <div style="margin:0 10px;">
88
+                <el-date-picker
89
+                  v-model="start_date"
90
+                  type="date"
91
+                  value-format="yyyy-MM-dd"
92
+                  placeholder="选择日期"
93
+                  style="width: 150px;">
94
+                </el-date-picker>
95
+                <span>-</span>
96
+                <el-date-picker
97
+                  v-model="end_date"
98
+                  type="date"
99
+                  value-format="yyyy-MM-dd"
100
+                  placeholder="选择日期"
101
+                  style="width: 150px;">
102
+                </el-date-picker>
103
+              </div>
104
+              <div>
105
+                体重增长:
106
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
107
+                  <el-option :key="0" label="不限" :value="0"></el-option>
108
+                  <el-option
109
+                    v-for="item in dialyze_options"
110
+                    :key="item.id"
111
+                    :label="item.name"
112
+                    :value="item.id">
113
+                  </el-option>
114
+                </el-select>
115
+              </div>
116
+              <div>
117
+                干体重:
118
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
119
+                  <el-option :key="0" label="不限" :value="0"></el-option>
120
+                  <el-option
121
+                    v-for="item in dialyze_options"
122
+                    :key="item.id"
123
+                    :label="item.name"
124
+                    :value="item.id">
125
+                  </el-option>
126
+                </el-select>
127
+              </div>
128
+              <div>
129
+                透后体重:
130
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
131
+                  <el-option :key="0" label="不限" :value="0"></el-option>
132
+                  <el-option
133
+                    v-for="item in dialyze_options"
134
+                    :key="item.id"
135
+                    :label="item.name"
136
+                    :value="item.id">
137
+                  </el-option>
138
+                </el-select>
139
+              </div>
140
+              <div >
141
+                <el-input v-model="input" placeholder="搜索患者姓名"></el-input>
142
+              </div>
143
+            </div>
144
+            <div style="flex: 1;">
145
+              <div>
146
+                <el-button type="primary" @click="deil_click">查询</el-button>
147
+                <el-button type="primary" @click="exportExcel">导出</el-button>
148
+              </div>
149
+            </div>
150
+          </div>
151
+
152
+          <el-table :data="tableData" border style="width: 100%"
153
+          :header-cell-style="{textAlign: 'center'}"
154
+          :cell-style="{ textAlign: 'center' }"
155
+          height="380">
156
+            <el-table-column
157
+              prop="index"
158
+              label="序号"
159
+              width="">
160
+            </el-table-column>
161
+            <el-table-column
162
+              prop="dialysis_no"
163
+              label="透析号"
164
+              width="">
165
+            </el-table-column>
166
+            <el-table-column
167
+              prop="name"
168
+              label="患者姓名">
169
+            </el-table-column>
170
+            <el-table-column
171
+              prop="name"
172
+              label="性别"
173
+              width="">
174
+            </el-table-column>
175
+            <el-table-column
176
+              prop="name"
177
+              label="年龄"
178
+              width="">
179
+            </el-table-column>
180
+            <el-table-column
181
+              prop="date"
182
+              label="透析日期"
183
+              width="">
184
+            </el-table-column>
185
+            <el-table-column
186
+              prop="mode_name"
187
+              label="干体重"
188
+              width="">
189
+            </el-table-column>
190
+            <el-table-column
191
+              prop="dialyszers"
192
+              label="前次透后体重">
193
+            </el-table-column>
194
+            <el-table-column
195
+              prop="date"
196
+              label="透前体重"
197
+              width="">
198
+            </el-table-column>
199
+            <el-table-column
200
+              prop="mode_name"
201
+              label="体重增加"
202
+              width="">
203
+            </el-table-column>
204
+            <el-table-column
205
+              prop="dialyszers"
206
+              label="透后体重">
207
+            </el-table-column>
208
+          </el-table>
209
+          <div style="text-align: right;margin-top: 10px;">
210
+            <el-pagination
211
+              @size-change="handleSizeChange"
212
+              @current-change="handleCurrentChange"
213
+              :current-page="currentPage"
214
+              :page-sizes="[50,100, 200, 300, 400]"
215
+              :page-size="limit"
216
+              layout="total, sizes, prev, pager, next, jumper"
217
+              :total="total">
218
+            </el-pagination>
219
+          </div>
220
+
221
+        </div>
222
+        <span slot="footer" class="dialog-footer">
223
+          <el-button @click="dialyze_dialog = false">取 消</el-button>
224
+          <el-button type="primary" @click="dialyze_dialog = false">确 定</el-button>
225
+        </span>
226
+      </el-dialog>
227
+    </div>
228
+  </div>
229
+</template>
230
+<script>
231
+import * as echarts from 'echarts';
232
+import XLSX from 'xlsx';
233
+import { uParseTime } from "@/utils/tools";
234
+import {Getdialyzer,Getdialyzerdetail,Getdialyzerconfig} from '../../../../api/qcd'
235
+import { forEach } from 'jszip';
236
+import html2canvas from "html2canvas"
237
+  export default {
238
+    components:{
239
+    },
240
+    data(){
241
+      return{
242
+        date_value:4,
243
+        start_date:'',
244
+        end_date:this.getTime(new Date()),
245
+        mode:'',
246
+        date_mode:'',
247
+        source:'',
248
+        dialyze_value:0,
249
+        dialyze_dialog:false,
250
+        currentPage:1,
251
+        limit:50,
252
+        total:0,
253
+        tableData:[],
254
+        dialyze_options:[],
255
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
256
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
257
+        ],
258
+        modearr:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
259
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
260
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
261
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
262
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
263
+          { id:30, name:"血浆胆红素吸附+HP"},{ id:31, name:"HPD"},{ id:32, name:"HDP"},{ id:33, name:"HFD"},{ id:34, name:"HDF100"},
264
+          { id:35, name:"HDF600"},{ id:36, name:"HDF800"},{ id:37, name:"HDF1000"},
265
+        ],
266
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
267
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
268
+
269
+
270
+        input:'',
271
+      }
272
+    },
273
+    methods:{
274
+      // 返回
275
+      return_click(){
276
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
277
+      },
278
+      // 数据源
279
+      getecharts(){
280
+        var chartDom = document.getElementById('mychart')
281
+        var myChart = echarts.init(chartDom);
282
+        const params ={
283
+          start_date:this.start_date,
284
+          end_date:this.end_date,
285
+        }
286
+        Getdialyzer(params).then(response =>{
287
+          console.log('ressponse',response.data.data);
288
+          if(response.data.state ==1){
289
+            console.log('bbbbbbbbb',response.data.data);
290
+            const list = response.data.data.data
291
+            const xAxis =[]
292
+            const yAxis = []
293
+            list.forEach(item =>{
294
+
295
+              xAxis.push(item.name)
296
+              yAxis.push(item.count)
297
+            })
298
+            this.bar_xAxis = xAxis
299
+            const options = []
300
+            for(let i in xAxis){
301
+              const arr ={
302
+                id:i+1,
303
+                name:xAxis[i]
304
+              }
305
+              options.push(arr)
306
+            }
307
+            this.dialyze_options = options
308
+            const option = {
309
+              xAxis: {
310
+                type: 'category',
311
+                data: xAxis,
312
+                axisLabel:{
313
+                  interval:0,
314
+                }
315
+              },
316
+              yAxis: {
317
+                type: 'value'
318
+              },
319
+              series: [
320
+                {
321
+                  data:yAxis ,
322
+                  type: 'bar',
323
+                  barWidth: '25%',
324
+                  label: {
325
+                    normal: {
326
+                      show: true,
327
+                      position: 'top',
328
+                      formatter: '{c}',
329
+                      textStyle:{
330
+                        color: 'black',//字体颜色
331
+                        fontSize: 13//字体大小
332
+                      }
333
+                    },
334
+                  },
335
+                  itemStyle:{
336
+                    normal:{
337
+                      color:function (params){
338
+                        // const colorarr=['#FFA333','#A155E8','#6D91FF','#A233A2'];
339
+                        var colorarr = [["#A9E0F3", "#9FBDFC"],["#FFD7C0", "#FF9994"]]
340
+                        var index = params.dataIndex;
341
+                        if (params.dataIndex >= colorarr.length) {
342
+                          index = params.dataIndex % colorarr.length;
343
+                        }
344
+                        return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
345
+                          { offset: 0, color: colorarr[index][0] },
346
+                          // { offset: 0.5, color: colorList[index][1] },
347
+                          { offset: 1, color: colorarr[index][1] }
348
+                        ]);
349
+                      }
350
+                    }
351
+                  }
352
+                }
353
+              ]
354
+            }
355
+            myChart.setOption(option);
356
+            myChart.on('click',params =>{
357
+              this.dialyze_dialog = true
358
+              console.log('vvvvv',params);
359
+              this.Getdialyzerdetail(params.name)
360
+            })
361
+          }
362
+
363
+        })
364
+
365
+      },
366
+      // 导出excel
367
+      exportExcel(){
368
+        let tableData = [
369
+          ['序号', '透析号', '患者姓名', '透析日期','透析模式', '透析器']//导出表头
370
+        ]
371
+        this.tableData.forEach((item,index) =>{
372
+          let rowdata=[]
373
+          rowdata=[
374
+            item.index,
375
+            item.dialysis_no,
376
+            item.name,
377
+            item.date,
378
+            item.mode_name,
379
+            item.dialyszers,
380
+          ]
381
+          tableData.push(rowdata)
382
+        })
383
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
384
+        let bookNew = XLSX.utils.book_new();
385
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析器使用统计') // 工作簿名称
386
+        let name = '透析器使用统计'+ '.xlsx'
387
+        XLSX.writeFile(bookNew, name) // 保存的文件名
388
+      },
389
+      // 查询
390
+      sete_click(){
391
+        this.getecharts()
392
+      },
393
+      // 详情查询
394
+      deil_click(){
395
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
396
+      },
397
+       // 下载
398
+      Download_click(){
399
+        const options ={
400
+          allowTaint: true,
401
+          useCORS: true
402
+        }
403
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
404
+          // const imageSrc = canvas.toDataURL();
405
+          const imageUrl = canvas.toDataURL("image/png");
406
+          // console.log('5555',imageUrl);
407
+        //   // const base = this.url.split(',')[1]
408
+        //   // console.log('2222',base);
409
+          const blob = this.dataURLtoBlob(imageUrl)
410
+          // console.log('4444',blob);
411
+          const url = URL.createObjectURL(blob);
412
+          // const file = (this.url).blob();
413
+          // console.log('1111',url);
414
+          var link= document.createElement("a");
415
+        //   //将生成的图片url赋值给a标签的href属性
416
+          link.href = url;
417
+        //   //设置下载的文件名
418
+          link.download = "透析器使用统计.jpg";
419
+          // // 将a标签插入dom中
420
+          console.log('link',link);
421
+          document.body.appendChild(link);
422
+          //模拟点击事件触发下载
423
+          link.click();
424
+          // 完成之后销毁创建的a标签
425
+          document.body.removeChild(link);
426
+
427
+        })
428
+      },
429
+      // 选择日期
430
+      datachange(eve){
431
+        if(eve ==1){
432
+          this.start_date = this.getPreviousDate(7)
433
+          this.end_date = this.getTime(new Date())
434
+        }else if(eve==2){
435
+          this.start_date = this.getFirstDayOfWeek(new Date())
436
+          this.end_date = this.getTime(new Date())
437
+          console.log('this.start_date', this.start_date);
438
+        }else if(eve ==3){
439
+          var date=new Date()
440
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
441
+          var m =''
442
+          var d = ''
443
+          if(date.getMonth() + 1<10){
444
+            m = '0'+(date.getMonth() + 1)
445
+          }else{
446
+             m = date.getMonth() + 1
447
+          }
448
+          if(date.getDate()<10){
449
+             d = '0'+date.getDate()
450
+          }else{
451
+            d = date.getDate()
452
+          }
453
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
454
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
455
+          date.setDate(date.getDate() +6);
456
+          var mm = ''
457
+          var dd = ''
458
+          if(date.getMonth() + 1<10){
459
+            mm = '0'+(date.getMonth() + 1)
460
+          }else{
461
+            mm = date.getMonth() + 1
462
+          }
463
+          if(date.getDate()<10){
464
+            dd = '0'+date.getDate()
465
+          }else{
466
+            dd = date.getDate()
467
+          }
468
+          // if(date.getMonth() + 1<10)
469
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
470
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
471
+          console.log('this.end_date',this.end_date);
472
+
473
+        }else if(eve ==4){
474
+          this.start_date = this.getFirstDayOfMonth(new Date())
475
+          this.end_date = this.getTime(new Date())
476
+        }else if(eve ==5){
477
+          this.getLastMonthFirstDay()
478
+          this.getLastMonthLastDay()
479
+        }else if(eve == 6){
480
+          this.start_date = this.getFirstDayOfYear(new Date())
481
+          this.end_date = this.getTime(new Date())
482
+        }else if(eve == 7){
483
+          this.getLastYearFirstDay()
484
+          this.getLastYearLastDay()
485
+        }
486
+        console.log('eve',eve);
487
+      },
488
+      // 详情数据源
489
+      Getdialyzerdetail(name){
490
+        const params={
491
+          dialyzer:name,
492
+          start_date:this.start_date,
493
+          end_date:this.end_date,
494
+          page:this.currentPage,
495
+          limit:this.limit,
496
+        }
497
+        Getdialyzerdetail(params).then(response =>{
498
+          if(response.data.state == 1){
499
+            const list = response.data.data.prescriptions
500
+            const table=[]
501
+            list.forEach((item,index)=>{
502
+              const obj ={
503
+                index:index+1,
504
+                dialysis_no:item.patient.dialysis_no,
505
+                name:item.patient.name,
506
+                date:this.getTime(item.record_date),
507
+                mode_name:this.getmode(item.mode_id),
508
+                dialyszers:item.dialysis_dialyszers +'  '+ item.dialysis_irrigation+'  '+item.dialysis_strainer
509
+                // dialyszers:item.dialysis_dialyszers || item.dialysis_irrigation || item.dialysis_strainer
510
+              }
511
+              table.push(obj)
512
+            })
513
+            this.tableData = table
514
+            this.total = response.data.data.total
515
+          }
516
+          console.log('77777',response);
517
+        })
518
+      },
519
+       // 首先定义一个getPreviousDate函数,方便调用
520
+      getPreviousDate(numOfDays) {
521
+        var date = new Date();
522
+        date.setDate(date.getDate() - numOfDays);
523
+        var year = date.getFullYear();
524
+        if(date.getMonth() + 1<10){
525
+          var month = '0'+(date.getMonth() + 1);
526
+        }else{
527
+          var month = date.getMonth() + 1;
528
+        }
529
+
530
+        if(date.getDate()<10){
531
+          var day = '0'+date.getDate();
532
+        }else{
533
+          var day = date.getDate();
534
+        }
535
+        return year + "-" + month + "-" + day;
536
+      },
537
+      // 本周
538
+      getFirstDayOfWeek(date){
539
+        var weekday = date.getDay()
540
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
541
+        return this.timeFormat(date);
542
+      },
543
+      // 本月
544
+      getFirstDayOfMonth (date) {
545
+        date.setDate(1);
546
+        return this.timeFormat(date);
547
+      },
548
+       //上个月第一天
549
+      getLastMonthFirstDay() {
550
+          var date = new Date();
551
+          date.setDate(0);
552
+          var y = date.getFullYear(); //获取年份
553
+          var m = date.getMonth() + 1; //获取月份
554
+          m = m < 10 ? "0" + m : m;
555
+          this.start_date = [y, m, '01'].join("-")
556
+          // return [y, m, '01'].join("-");
557
+      },
558
+      // 上个月最后一天
559
+      getLastMonthLastDay() {
560
+          var date = new Date();
561
+          date.setDate(0);
562
+          var y = date.getFullYear(); //获取年份
563
+          var m = date.getMonth() + 1; //获取月份
564
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
565
+          m = m < 10 ? "0" + m : m; //月份补 0
566
+          d = d < 10 ? "0" + d : d; //日数补 0
567
+          this.end_date = [y, m, d].join("-")
568
+          // return [y, m, d].join("-");
569
+      },
570
+      // 本年
571
+      getFirstDayOfYear (date) {
572
+        date.setDate(1);
573
+        date.setMonth(0);
574
+        return this.timeFormat(date);
575
+      },
576
+      // 上一年第一天
577
+      getLastYearFirstDay() {
578
+          let date = new Date();
579
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
580
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
581
+         const start_day = date.setDate(1); // 设置日期为1日
582
+        //  const last_month = date.setMonth(11); // 设置月份为12月
583
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
584
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
585
+         this.start_date = this.getTime(start_day)
586
+        //  return this.start_date
587
+      },
588
+      // 上一年最后一天
589
+      getLastYearLastDay() {
590
+          let date = new Date();
591
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
592
+          const last_month = date.setMonth(12); // 设置月份为12月
593
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
594
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
595
+          this.end_date = this.getTime(last_day)
596
+          console.log('this.end_date',this.end_date);
597
+          // return this.end_date;
598
+      },
599
+      // 日期格式化
600
+      timeFormat(date) {
601
+          if (!date || typeof(date) === "string") {
602
+            this.error("参数异常,请检查...");
603
+          }
604
+          var y = date.getFullYear(); //年
605
+          if(date.getMonth() + 1<10){
606
+            var m ='0'+(date.getMonth() + 1); //月
607
+          }else{
608
+            var m =date.getMonth() + 1; //月
609
+          }
610
+          if(date.getDate() + 1<10){
611
+            var d ='0'+date.getDate(); //日
612
+          }else{
613
+            var d = date.getDate(); //日
614
+          }
615
+          // var d = date.getDate(); //日
616
+
617
+          return y + "-" + m + "-" + d;
618
+      },
619
+      handleCurrentChange(val){
620
+        this.currentPage = val
621
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
622
+      },
623
+      handleSizeChange(val){
624
+        this.limit = val
625
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
626
+      },
627
+      // 透析模式
628
+      getmode(ids){
629
+        const modes=this.modearr
630
+        for(let i in modes){
631
+          if(ids == modes[i].id){
632
+            return modes[i].name
633
+          }
634
+        }
635
+      },
636
+       // 转换时间
637
+      getTime(val) {
638
+        if(val < 0){
639
+          return ""
640
+        }
641
+        if(val == ""){
642
+          return ""
643
+        }else {
644
+          return uParseTime(val, '{y}-{m}-{d}')
645
+        }
646
+      },
647
+      dataURLtoBlob(dataURL) {
648
+        const arr = dataURL.split(',');
649
+        const mime = arr[0].match(/:(.*?);/)[1];
650
+        const bstr = atob(arr[1]);
651
+        let n = bstr.length;
652
+        const u8arr = new Uint8Array(n);
653
+        while (n--) {
654
+          u8arr[n] = bstr.charCodeAt(n);
655
+        }
656
+        return new Blob([u8arr], { type: mime });
657
+      },
658
+      // 全部透析器
659
+      Getdialyzerconfig(){
660
+        Getdialyzerconfig().then(response =>{
661
+          console.log('666666',response);
662
+        })
663
+      },
664
+      getdialyze(val){
665
+        const option = this.dialyze_options
666
+        for(let i in option){
667
+          if(val == option[i].id){
668
+            return option[i].name
669
+          }
670
+        }
671
+      }
672
+    },
673
+    mounted(){
674
+      this.getecharts()
675
+    },
676
+    created(){
677
+      this.start_date = this.getFirstDayOfMonth(new Date())
678
+      this.Getdialyzerconfig()
679
+    },
680
+
681
+  }
682
+</script>

+ 711 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/dry_weight.vue View File

@@ -0,0 +1,711 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者干体重分析</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin:0 10px">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+          <div style="position: fixed;right: 5%;top: 50vh;">
53
+            <el-popover
54
+              placement="left"
55
+              title="提示"
56
+              width="500"
57
+              trigger="click"
58
+              content="1.统计时间段内留治患者干体重,在当前时间段的区间分布,不是统计每次透析的干体重。
59
+                       2.如果一个患者在时间段内,调整过两次干体重,以最后一次为准。">
60
+              <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
61
+              <!-- <el-button slot="reference">click 激活</el-button> -->
62
+            </el-popover>
63
+          </div>
64
+      </div>
65
+    </div>
66
+
67
+    <!-- 弹窗 -->
68
+    <div>
69
+      <el-dialog
70
+        title="提示"
71
+        :visible.sync="complete_dialog"
72
+        width="80%">
73
+        <div>
74
+          <div style="display: flex;margin-bottom: 20px;">
75
+            <div style="flex: 2;display: flex;">
76
+              <div>
77
+                日期:
78
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
79
+                  <el-option
80
+                    v-for="item in date_options"
81
+                    :key="item.value"
82
+                    :label="item.label"
83
+                    :value="item.value">
84
+                  </el-option>
85
+                </el-select>
86
+              </div>
87
+              <div style="margin:0 10px">
88
+                <el-date-picker
89
+                  v-model="start_date"
90
+                  type="date"
91
+                  value-format="yyyy-MM-dd"
92
+                  placeholder="选择日期"
93
+                  style="width: 150px;">
94
+                </el-date-picker>
95
+                <span>-</span>
96
+                <el-date-picker
97
+                  v-model="end_date"
98
+                  type="date"
99
+                  value-format="yyyy-MM-dd"
100
+                  placeholder="选择日期"
101
+                  style="width: 150px;">
102
+                </el-date-picker>
103
+              </div>
104
+
105
+              <div>
106
+                状态:
107
+                <el-select v-model="status_value" placeholder="请选择" style="width: 130px;">
108
+                  <el-option :key="0" label="不限" :value="0"></el-option>
109
+                  <el-option
110
+                    v-for="item in status_options"
111
+                    :key="item.value"
112
+                    :label="item.label"
113
+                    :value="item.value">
114
+                  </el-option>
115
+                </el-select>
116
+              </div>
117
+            </div>
118
+            <div style="flex: 1;">
119
+              <div>
120
+                <el-button type="primary" @click="detil_click">查询</el-button>
121
+
122
+                <el-button type="primary" @click="derive_click">导出</el-button>
123
+              </div>
124
+            </div>
125
+          </div>
126
+          <div>
127
+            <el-table :data="tableData"
128
+              border
129
+              style="width: 100%;"
130
+              :header-cell-style = "{'text-align':'center'}"
131
+              :cell-style="{'text-align':'center'}"
132
+              height="380">
133
+              <el-table-column
134
+                prop="index"
135
+                label="序号"
136
+                width="">
137
+              </el-table-column>
138
+              <el-table-column
139
+                prop="dialysis_no"
140
+                label="透析号"
141
+                width="">
142
+              </el-table-column>
143
+              <el-table-column
144
+                prop="patient_name"
145
+                label="患者姓名">
146
+              </el-table-column>
147
+              <el-table-column
148
+                prop="age"
149
+                label="年龄">
150
+              </el-table-column>
151
+              <el-table-column
152
+                prop="dialysis_date"
153
+                label="干体重"
154
+                width="">
155
+              </el-table-column>
156
+             
157
+            </el-table>
158
+          </div>
159
+          <div style="text-align:right;margin-top: 10px;">
160
+            <el-pagination
161
+              @size-change="handleSizeChange"
162
+              @current-change="handleCurrentChange"
163
+              :current-page="currentPage"
164
+              :page-sizes="[50,100, 200, 300, 400]"
165
+              :page-size="limit"
166
+              layout="total, sizes, prev, pager, next, jumper"
167
+              :total="total">
168
+            </el-pagination>
169
+          </div>
170
+        </div>
171
+        <span slot="footer" class="dialog-footer">
172
+          <el-button @click="complete_dialog = false">取 消</el-button>
173
+          <el-button type="primary" @click="complete_dialog = false">确 定</el-button>
174
+        </span>
175
+      </el-dialog>
176
+    </div>
177
+  </div>
178
+</template>
179
+<script>
180
+import * as echarts from 'echarts';
181
+import XLSX from 'xlsx';
182
+import { uParseTime } from "@/utils/tools";
183
+import {Getdialysistreatfinish,Getdialysistreatdetail} from '../../../../api/qcd'
184
+import {getAllNurseList} from '@/api/fallassement'
185
+import { getAllDoctorList} from "@/api/device"
186
+import html2canvas from "html2canvas"
187
+  export default {
188
+    components:{
189
+    },
190
+    data(){
191
+      return{
192
+        date_value:4,
193
+        start_date:'',
194
+        end_date:this.getTime(new Date()),
195
+        mode:'',
196
+        date_mode:'',
197
+        source:'',
198
+        status_value:0,
199
+        complete_dialog:false,
200
+        currentPage:1,
201
+        limit:50,
202
+        total:0,
203
+        tableData:[],
204
+        // status_options:[],
205
+        nurseList:[],
206
+        operators:[],
207
+        docList:[],
208
+        status_options:[{value:1,label:'达到透析处方时间'},{value:2,label:'超出处方时间'},{value:3,label:'未到达处方时间'}],
209
+        // status_options:[{value:1,label:'待定卧床'},{value:2,label:'<40KG'},{value:3,label:'40-50KG'},
210
+        //                 {value:4,label:'50-60KG'},{value:5,label:'<60-70KG'},{value:6,label:'>70KG'}
211
+        //                 ],
212
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
213
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
214
+        ],
215
+        mode_options:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
216
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
217
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
218
+          { id: 15, name: 'HD前置换' },{ id: 16, name: 'HD后置换' },{ id: 17, name: 'HDF前置换' },{ id: 18, name: 'HDF后置换' },
219
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
220
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
221
+        ],
222
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
223
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
224
+        status_id:"",
225
+      }
226
+    },
227
+    methods:{
228
+      // 返回
229
+      return_click(){
230
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
231
+      },
232
+      // 数据源
233
+      getecharts(){
234
+        var chartDom = document.getElementById('mychart')
235
+        var myChart = echarts.init(chartDom);
236
+        const params={
237
+          start_date:this.start_date,
238
+          end_date:this.end_date
239
+        }
240
+        Getdialysistreatfinish(params).then(response =>{
241
+          if(response.data.state ==1){
242
+            const list = response.data.data.data
243
+            const xAxis = []
244
+            const yAxis = []
245
+
246
+            const total = response.data.data.total
247
+            for(let key in list){
248
+              const obj={
249
+                name:key,
250
+                value:list[key]
251
+              }
252
+              xAxis.push(obj)
253
+              yAxis.push(key)
254
+            }
255
+            const status = []
256
+            // for(let i in yAxis){
257
+            //   const obj ={
258
+            //     value:(i*1)+1,
259
+            //     label:yAxis[i]
260
+            //   }
261
+            //   status.push(obj)
262
+            // }
263
+            // this.status_options = status
264
+            console.log('this.status_options',this.status_options);
265
+            const option = {
266
+                title:{
267
+                  text:'总数'+total,
268
+                  left:'5%',
269
+                  bottom:'5%',
270
+                  textStyle:{
271
+                    fontSize:30
272
+                  }
273
+                },
274
+                tooltip: {
275
+                  trigger: 'item',
276
+
277
+                },
278
+                legend: {
279
+                  data:yAxis,
280
+                  left: '10%',
281
+                  top: '30%',
282
+                  orient: 'vertical'
283
+                },
284
+                color:['#FFD7C0','#9FBDFC',"#A9E0F3", "#FF9994",'aquamarine','gold'],
285
+                series: [
286
+                  {
287
+                    name: '',
288
+                    type: 'pie',
289
+                    radius: ['40%', '70%'],
290
+                    avoidLabelOverlap: true,
291
+                    itemStyle: {
292
+                      borderRadius: 10,
293
+                      borderColor: '#fff',
294
+                      borderWidth: 2
295
+                    },
296
+                    label: {
297
+                      show: true,
298
+                      position: 'center',
299
+                      normal : {
300
+                        formatter: '{b}:{c}: ({d}%)',
301
+                        textStyle : {
302
+                          fontWeight : 'normal',
303
+                          fontSize : 15,
304
+                          color : "black"
305
+                        }
306
+                      }
307
+                    },
308
+                    emphasis: {
309
+                      label: {
310
+                        show: true,
311
+                        fontSize: 40,
312
+                        fontWeight: 'bold'
313
+                      }
314
+                    },
315
+                    labelLine: {
316
+                      show: false
317
+                    },
318
+                    data: xAxis
319
+                  }
320
+                ]
321
+              };
322
+            myChart.setOption(option);
323
+            myChart.on('click',params =>{
324
+              this.complete_dialog = true
325
+              console.log('bbbb',params);
326
+              var status_id =''
327
+              for(let i in this.status_options){
328
+                if(params.data.name == this.status_options[i].label){
329
+                  status_id = this.status_options[i].value
330
+                }
331
+              }
332
+              this.getdetail(status_id)
333
+            })
334
+          }
335
+        })
336
+
337
+      },
338
+      // 查询
339
+      sete_click(){
340
+        this.getecharts()
341
+      },
342
+      // 详情查询
343
+      detil_click(){
344
+        this.getdetail(this.status_value)
345
+      },
346
+       // 下载
347
+      Download_click(){
348
+        const options ={
349
+          allowTaint: true,
350
+          useCORS: true
351
+        }
352
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
353
+          // const imageSrc = canvas.toDataURL();
354
+          const imageUrl = canvas.toDataURL("image/png");
355
+          const blob = this.dataURLtoBlob(imageUrl)
356
+          const url = URL.createObjectURL(blob);
357
+          var link= document.createElement("a");
358
+        //   //将生成的图片url赋值给a标签的href属性
359
+          link.href = url;
360
+        //   //设置下载的文件名
361
+          link.download = "透析完成率统计.jpg";
362
+          // // 将a标签插入dom中
363
+          console.log('link',link);
364
+          document.body.appendChild(link);
365
+          //模拟点击事件触发下载
366
+          link.click();
367
+          // 完成之后销毁创建的a标签
368
+          document.body.removeChild(link);
369
+
370
+        })
371
+      },
372
+      // 导出excel
373
+      derive_click(){
374
+        let tableData = [
375
+          ['序号', '透析号', '患者姓名', '年龄','透析日期', '处方透析时长', '实际透析时长', '实际差(min)', '主治医生', '主治护士']//导出表头
376
+        ]
377
+        this.tableData.forEach((item,index) =>{
378
+          let rowdata=[]
379
+          rowdata=[
380
+            item.index,
381
+            item.dialysis_no,
382
+            item.patient_name,
383
+            item.age,
384
+            item.dialysis_date,
385
+            item.dialysis_duration,
386
+            item.actual_duration,
387
+            item.diff,
388
+            item.doctor,
389
+            item.nurse,
390
+          ]
391
+          tableData.push(rowdata)
392
+        })
393
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
394
+        let bookNew = XLSX.utils.book_new();
395
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析治疗完成率') // 工作簿名称
396
+        let name = '透析治疗完成率'+ '.xlsx'
397
+        XLSX.writeFile(bookNew, name) // 保存的文件名
398
+      },
399
+      // 详情数据源
400
+      getdetail(mode){
401
+        const params ={
402
+          start_date:this.start_date,
403
+          end_date:this.end_date,
404
+          mode:mode,
405
+          page:this.currentPage,
406
+          limit:this.limit,
407
+        }
408
+        Getdialysistreatdetail(params).then(response =>{
409
+          if(response.data.state){
410
+            const list = response.data.data.list
411
+            const xAxis = []
412
+            const table = []
413
+            list.forEach((item,index) =>{
414
+              const obj={
415
+                index:index+1,
416
+                dialysis_no:item.dialysis_no,
417
+                patient_name:item.patient_name,
418
+                age:this.analyzeIDCard(item.id_card_no),
419
+                dialysis_date:item.dialysis_date.split('T')[0],
420
+                dialysis_duration:item.dialysis_duration,
421
+                actual_duration:item.actual_duration,
422
+                diff:item.diff,
423
+                doctor:this.getdoctor(item.doctor),
424
+                nurse:this.getnurse(item.nurse)
425
+              }
426
+              table.push(obj)
427
+            })
428
+            this.tableData = table
429
+            this.total = response.data.data.total
430
+          }
431
+          console.log('55555',response);
432
+        })
433
+      },
434
+      // 选择日期
435
+      datachange(eve){
436
+        if(eve ==1){
437
+          this.start_date = this.getPreviousDate(7)
438
+          this.end_date = this.getTime(new Date())
439
+        }else if(eve==2){
440
+          this.start_date = this.getFirstDayOfWeek(new Date())
441
+          this.end_date = this.getTime(new Date())
442
+          console.log('this.start_date', this.start_date);
443
+        }else if(eve ==3){
444
+          var date=new Date()
445
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
446
+          var m =''
447
+          var d = ''
448
+          if(date.getMonth() + 1<10){
449
+            m = '0'+(date.getMonth() + 1)
450
+          }else{
451
+             m = date.getMonth() + 1
452
+          }
453
+          if(date.getDate()<10){
454
+             d = '0'+date.getDate()
455
+          }else{
456
+            d = date.getDate()
457
+          }
458
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
459
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
460
+          date.setDate(date.getDate() +6);
461
+          var mm = ''
462
+          var dd = ''
463
+          if(date.getMonth() + 1<10){
464
+            mm = '0'+(date.getMonth() + 1)
465
+          }else{
466
+            mm = date.getMonth() + 1
467
+          }
468
+          if(date.getDate()<10){
469
+            dd = '0'+date.getDate()
470
+          }else{
471
+            dd = date.getDate()
472
+          }
473
+          // if(date.getMonth() + 1<10)
474
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
475
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
476
+          console.log('this.end_date',this.end_date);
477
+
478
+        }else if(eve ==4){
479
+          this.start_date = this.getFirstDayOfMonth(new Date())
480
+          this.end_date = this.getTime(new Date())
481
+        }else if(eve ==5){
482
+          this.getLastMonthFirstDay()
483
+          this.getLastMonthLastDay()
484
+        }else if(eve == 6){
485
+          this.start_date = this.getFirstDayOfYear(new Date())
486
+          this.end_date = this.getTime(new Date())
487
+        }else if(eve == 7){
488
+          this.getLastYearFirstDay()
489
+          this.getLastYearLastDay()
490
+        }
491
+        console.log('eve',eve);
492
+      },
493
+      // 首先定义一个getPreviousDate函数,方便调用
494
+      getPreviousDate(numOfDays) {
495
+        var date = new Date();
496
+        date.setDate(date.getDate() - numOfDays);
497
+        var year = date.getFullYear();
498
+        if(date.getMonth() + 1<10){
499
+          var month = '0'+(date.getMonth() + 1);
500
+        }else{
501
+          var month = date.getMonth() + 1;
502
+        }
503
+
504
+        if(date.getDate()<10){
505
+          var day = '0'+date.getDate();
506
+        }else{
507
+          var day = date.getDate();
508
+        }
509
+        return year + "-" + month + "-" + day;
510
+      },
511
+      // 本周
512
+      getFirstDayOfWeek(date){
513
+        var weekday = date.getDay()
514
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
515
+        return this.timeFormat(date);
516
+      },
517
+      // 本月
518
+      getFirstDayOfMonth (date) {
519
+        date.setDate(1);
520
+        return this.timeFormat(date);
521
+      },
522
+       //上个月第一天
523
+       getLastMonthFirstDay() {
524
+          var date = new Date();
525
+          date.setDate(0);
526
+          var y = date.getFullYear(); //获取年份
527
+          var m = date.getMonth() + 1; //获取月份
528
+          m = m < 10 ? "0" + m : m;
529
+          this.start_date = [y, m, '01'].join("-")
530
+          // return [y, m, '01'].join("-");
531
+      },
532
+      // 上个月最后一天
533
+      getLastMonthLastDay() {
534
+          var date = new Date();
535
+          date.setDate(0);
536
+          var y = date.getFullYear(); //获取年份
537
+          var m = date.getMonth() + 1; //获取月份
538
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
539
+          m = m < 10 ? "0" + m : m; //月份补 0
540
+          d = d < 10 ? "0" + d : d; //日数补 0
541
+          this.end_date = [y, m, d].join("-")
542
+          // return [y, m, d].join("-");
543
+      },
544
+
545
+      // 本年
546
+      getFirstDayOfYear (date) {
547
+        date.setDate(1);
548
+        date.setMonth(0);
549
+        return this.timeFormat(date);
550
+      },
551
+      // 上一年第一天
552
+      getLastYearFirstDay() {
553
+          let date = new Date();
554
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
555
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
556
+         const start_day = date.setDate(1); // 设置日期为1日
557
+        //  const last_month = date.setMonth(11); // 设置月份为12月
558
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
559
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
560
+         this.start_date = this.getTime(start_day)
561
+        //  return this.start_date
562
+      },
563
+      // 上一年最后一天
564
+      getLastYearLastDay() {
565
+          let date = new Date();
566
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
567
+          const last_month = date.setMonth(12); // 设置月份为12月
568
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
569
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
570
+          this.end_date = this.getTime(last_day)
571
+          console.log('this.end_date',this.end_date);
572
+          // return this.end_date;
573
+      },
574
+      // 日期格式化
575
+      timeFormat(date) {
576
+          if (!date || typeof(date) === "string") {
577
+            this.error("参数异常,请检查...");
578
+          }
579
+          var y = date.getFullYear(); //年
580
+          if(date.getMonth() + 1<10){
581
+            var m ='0'+(date.getMonth() + 1); //月
582
+          }else{
583
+            var m =date.getMonth() + 1; //月
584
+          }
585
+          if(date.getDate() + 1<10){
586
+            var d ='0'+date.getDate(); //日
587
+          }else{
588
+            var d = date.getDate(); //日
589
+          }
590
+          // var d = date.getDate(); //日
591
+
592
+          return y + "-" + m + "-" + d;
593
+      },
594
+      handleCurrentChange(val){
595
+        this.currentPage = val
596
+        this.getdetail(this.status_value)
597
+      },
598
+      handleSizeChange(val){
599
+        this.limit = val
600
+        this.getdetail(this.status_value)
601
+      },
602
+       // 转换时间
603
+      getTime(val) {
604
+        if(val < 0){
605
+          return ""
606
+        }
607
+        if(val == ""){
608
+          return ""
609
+        }else {
610
+          return uParseTime(val, '{y}-{m}-{d}')
611
+        }
612
+      },
613
+      dataURLtoBlob(dataURL) {
614
+        const arr = dataURL.split(',');
615
+        const mime = arr[0].match(/:(.*?);/)[1];
616
+        const bstr = atob(arr[1]);
617
+        let n = bstr.length;
618
+        const u8arr = new Uint8Array(n);
619
+        while (n--) {
620
+          u8arr[n] = bstr.charCodeAt(n);
621
+        }
622
+        return new Blob([u8arr], { type: mime });
623
+      },
624
+      // 计算年龄
625
+      analyzeIDCard(IDCard){
626
+        var age = 0,yearBirth,monthBirth,dayBirth;
627
+        //获取用户身份证号码
628
+        var userCard = IDCard;
629
+        //如果身份证号码为undefind则返回空
630
+        if(!userCard){
631
+          return age;
632
+        }
633
+        var reg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/; //验证身份证号码的正则
634
+        if (reg.test(userCard)) {
635
+          if (userCard.length == 15) {
636
+              var org_birthday = userCard.substring(6, 12);
637
+              //获取出生年月日
638
+              yearBirth = "19" + org_birthday.substring(0, 2);
639
+              monthBirth = org_birthday.substring(2, 4);
640
+              dayBirth = org_birthday.substring(4, 6);
641
+              } else if (userCard.length == 18) {
642
+              //获取出生年月日
643
+              yearBirth = userCard.substring(6,10);
644
+              monthBirth = userCard.substring(10,12);
645
+              dayBirth = userCard.substring(12,14);
646
+
647
+            }
648
+            //获取当前年月日并计算年龄
649
+            var myDate = new Date();
650
+            var monthNow = myDate.getMonth() + 1;
651
+            var dayNow = myDate.getDate();
652
+            var age = myDate.getFullYear() - yearBirth;
653
+            if(monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)){
654
+              age--;
655
+            }
656
+            //返回年龄
657
+            return age;
658
+        } else {
659
+          return ''
660
+        }
661
+
662
+      },
663
+      // 护士
664
+      getAllNurseList(){
665
+        getAllNurseList().then(response=>{
666
+           if(response.data.state ==1){
667
+             var nurseList  = response.data.data.nurseList
668
+            console.log('0000',nurseList);
669
+             this.nurseList =nurseList
670
+           }
671
+        })
672
+      },
673
+      // 医生
674
+      getAllDoctorList(){
675
+        getAllDoctorList().then(response=>{
676
+          if(response.data.state == 1){
677
+              var list = response.data.data.list
678
+              console.log("list222222",list)
679
+              this.docList = list
680
+              this.operators = response.data.data.operators
681
+          }
682
+        })
683
+      },
684
+      getnurse(ids){
685
+        const nurse = this.nurseList
686
+        for(let i in nurse){
687
+          if(ids==nurse[i].admin_user_id){
688
+            return nurse[i].user_name
689
+          }
690
+        }
691
+      },
692
+      getdoctor(ids){
693
+        const doctor = this.docList
694
+        for(let i in doctor){
695
+          if(ids == doctor[i].admin_user_id){
696
+            return doctor[i].user_name
697
+          }
698
+        }
699
+      }
700
+    },
701
+    mounted(){
702
+      this.getecharts()
703
+    },
704
+    created(){
705
+      this.start_date = this.getFirstDayOfMonth(new Date())
706
+      this.getAllNurseList()
707
+      this.getAllDoctorList()
708
+    },
709
+
710
+  }
711
+</script>

+ 682 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/list_denominator.vue View File

@@ -0,0 +1,682 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者体重增长分析(以上次透后体重为分母)</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;">
14
+          <div>
15
+            日期:
16
+            <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
17
+              <el-option
18
+                v-for="item in date_options"
19
+                :key="item.value"
20
+                :label="item.label"
21
+                :value="item.value">
22
+              </el-option>
23
+            </el-select>
24
+          </div>
25
+          <div style="margin: 0 10px;">
26
+            <el-date-picker
27
+              v-model="start_date"
28
+              type="date"
29
+              value-format="yyyy-MM-dd"
30
+              placeholder="选择日期"
31
+              style="width: 150px;">
32
+            </el-date-picker>
33
+            <span>-</span>
34
+            <el-date-picker
35
+              v-model="end_date"
36
+              type="date"
37
+              value-format="yyyy-MM-dd"
38
+              placeholder="选择日期"
39
+              style="width: 150px;">
40
+            </el-date-picker>
41
+          </div>
42
+          <div>
43
+            <el-button type="primary" @click="sete_click">查询</el-button>
44
+            <el-button type="primary" @click="Download_click">下载</el-button>
45
+          </div>
46
+        </div>
47
+        <!-- 图表 -->
48
+        <div ref="mychart">
49
+          <div class="echart" id="mychart"  style="width:100%;height:60vh"></div>
50
+        </div>
51
+
52
+        <div style="position: fixed;right: 5%;top: 50vh;">
53
+          <el-popover
54
+            placement="left"
55
+            title="提示"
56
+            width="500"
57
+            trigger="click"
58
+            content="1.统计时间段内所有患者每次透析时的体重增长情况。
59
+                     2.体重增长=(透前体重-上次透后体重)/上次透后体重×100%。">
60
+            <img src="@/assets/img/xiang.png" alt="" style="height: 20px;width: 20px;" slot="reference">
61
+            <!-- <el-button slot="reference">click 激活</el-button> -->
62
+          </el-popover>
63
+        </div>
64
+      </div>
65
+    </div>
66
+
67
+    <!-- 弹窗 -->
68
+    <div>
69
+      <el-dialog
70
+        title="详情"
71
+        :visible.sync="dialyze_dialog"
72
+        width="80%">
73
+        <div>
74
+          <div style="display: flex;margin-bottom: 20px;">
75
+            <div style="flex: 2;display: flex;flex-wrap:wrap">
76
+              <div>
77
+                日期:
78
+                <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
79
+                  <el-option
80
+                    v-for="item in date_options"
81
+                    :key="item.value"
82
+                    :label="item.label"
83
+                    :value="item.value">
84
+                  </el-option>
85
+                </el-select>
86
+              </div>
87
+              <div style="margin:0 10px;">
88
+                <el-date-picker
89
+                  v-model="start_date"
90
+                  type="date"
91
+                  value-format="yyyy-MM-dd"
92
+                  placeholder="选择日期"
93
+                  style="width: 150px;">
94
+                </el-date-picker>
95
+                <span>-</span>
96
+                <el-date-picker
97
+                  v-model="end_date"
98
+                  type="date"
99
+                  value-format="yyyy-MM-dd"
100
+                  placeholder="选择日期"
101
+                  style="width: 150px;">
102
+                </el-date-picker>
103
+              </div>
104
+              <div>
105
+                体重增长:
106
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
107
+                  <el-option :key="0" label="不限" :value="0"></el-option>
108
+                  <el-option
109
+                    v-for="item in dialyze_options"
110
+                    :key="item.id"
111
+                    :label="item.name"
112
+                    :value="item.id">
113
+                  </el-option>
114
+                </el-select>
115
+              </div>
116
+              <div>
117
+                干体重:
118
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
119
+                  <el-option :key="0" label="不限" :value="0"></el-option>
120
+                  <el-option
121
+                    v-for="item in dialyze_options"
122
+                    :key="item.id"
123
+                    :label="item.name"
124
+                    :value="item.id">
125
+                  </el-option>
126
+                </el-select>
127
+              </div>
128
+              <div>
129
+                透后体重:
130
+                <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
131
+                  <el-option :key="0" label="不限" :value="0"></el-option>
132
+                  <el-option
133
+                    v-for="item in dialyze_options"
134
+                    :key="item.id"
135
+                    :label="item.name"
136
+                    :value="item.id">
137
+                  </el-option>
138
+                </el-select>
139
+              </div>
140
+              <div >
141
+                <el-input v-model="input" placeholder="搜索患者姓名"></el-input>
142
+              </div>
143
+            </div>
144
+            <div style="flex: 1;">
145
+              <div>
146
+                <el-button type="primary" @click="deil_click">查询</el-button>
147
+                <el-button type="primary" @click="exportExcel">导出</el-button>
148
+              </div>
149
+            </div>
150
+          </div>
151
+
152
+          <el-table :data="tableData" border style="width: 100%"
153
+          :header-cell-style="{textAlign: 'center'}"
154
+          :cell-style="{ textAlign: 'center' }"
155
+          height="380">
156
+            <el-table-column
157
+              prop="index"
158
+              label="序号"
159
+              width="">
160
+            </el-table-column>
161
+            <el-table-column
162
+              prop="dialysis_no"
163
+              label="透析号"
164
+              width="">
165
+            </el-table-column>
166
+            <el-table-column
167
+              prop="name"
168
+              label="患者姓名">
169
+            </el-table-column>
170
+            <el-table-column
171
+              prop="name"
172
+              label="性别"
173
+              width="">
174
+            </el-table-column>
175
+            <el-table-column
176
+              prop="name"
177
+              label="年龄"
178
+              width="">
179
+            </el-table-column>
180
+            <el-table-column
181
+              prop="date"
182
+              label="透析日期"
183
+              width="">
184
+            </el-table-column>
185
+            <el-table-column
186
+              prop="mode_name"
187
+              label="干体重"
188
+              width="">
189
+            </el-table-column>
190
+            <el-table-column
191
+              prop="dialyszers"
192
+              label="前次透后体重">
193
+            </el-table-column>
194
+            <el-table-column
195
+              prop="date"
196
+              label="透前体重"
197
+              width="">
198
+            </el-table-column>
199
+            <el-table-column
200
+              prop="mode_name"
201
+              label="体重增加"
202
+              width="">
203
+            </el-table-column>
204
+            <el-table-column
205
+              prop="dialyszers"
206
+              label="透后体重">
207
+            </el-table-column>
208
+          </el-table>
209
+          <div style="text-align: right;margin-top: 10px;">
210
+            <el-pagination
211
+              @size-change="handleSizeChange"
212
+              @current-change="handleCurrentChange"
213
+              :current-page="currentPage"
214
+              :page-sizes="[50,100, 200, 300, 400]"
215
+              :page-size="limit"
216
+              layout="total, sizes, prev, pager, next, jumper"
217
+              :total="total">
218
+            </el-pagination>
219
+          </div>
220
+
221
+        </div>
222
+        <span slot="footer" class="dialog-footer">
223
+          <el-button @click="dialyze_dialog = false">取 消</el-button>
224
+          <el-button type="primary" @click="dialyze_dialog = false">确 定</el-button>
225
+        </span>
226
+      </el-dialog>
227
+    </div>
228
+  </div>
229
+</template>
230
+<script>
231
+import * as echarts from 'echarts';
232
+import XLSX from 'xlsx';
233
+import { uParseTime } from "@/utils/tools";
234
+import {Getdialyzer,Getdialyzerdetail,Getdialyzerconfig} from '../../../../api/qcd'
235
+import { forEach } from 'jszip';
236
+import html2canvas from "html2canvas"
237
+  export default {
238
+    components:{
239
+    },
240
+    data(){
241
+      return{
242
+        date_value:4,
243
+        start_date:'',
244
+        end_date:this.getTime(new Date()),
245
+        mode:'',
246
+        date_mode:'',
247
+        source:'',
248
+        dialyze_value:0,
249
+        dialyze_dialog:false,
250
+        currentPage:1,
251
+        limit:50,
252
+        total:0,
253
+        tableData:[],
254
+        dialyze_options:[],
255
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
256
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
257
+        ],
258
+        modearr:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
259
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
260
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
261
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
262
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
263
+          { id:30, name:"血浆胆红素吸附+HP"},{ id:31, name:"HPD"},{ id:32, name:"HDP"},{ id:33, name:"HFD"},{ id:34, name:"HDF100"},
264
+          { id:35, name:"HDF600"},{ id:36, name:"HDF800"},{ id:37, name:"HDF1000"},
265
+        ],
266
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
267
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
268
+
269
+
270
+        input:'',
271
+      }
272
+    },
273
+    methods:{
274
+      // 返回
275
+      return_click(){
276
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
277
+      },
278
+      // 数据源
279
+      getecharts(){
280
+        var chartDom = document.getElementById('mychart')
281
+        var myChart = echarts.init(chartDom);
282
+        const params ={
283
+          start_date:this.start_date,
284
+          end_date:this.end_date,
285
+        }
286
+        Getdialyzer(params).then(response =>{
287
+          console.log('ressponse',response.data.data);
288
+          if(response.data.state ==1){
289
+            console.log('bbbbbbbbb',response.data.data);
290
+            const list = response.data.data.data
291
+            const xAxis =[]
292
+            const yAxis = []
293
+            list.forEach(item =>{
294
+
295
+              xAxis.push(item.name)
296
+              yAxis.push(item.count)
297
+            })
298
+            this.bar_xAxis = xAxis
299
+            const options = []
300
+            for(let i in xAxis){
301
+              const arr ={
302
+                id:i+1,
303
+                name:xAxis[i]
304
+              }
305
+              options.push(arr)
306
+            }
307
+            this.dialyze_options = options
308
+            const option = {
309
+              xAxis: {
310
+                type: 'category',
311
+                data: xAxis,
312
+                axisLabel:{
313
+                  interval:0,
314
+                }
315
+              },
316
+              yAxis: {
317
+                type: 'value'
318
+              },
319
+              series: [
320
+                {
321
+                  data:yAxis ,
322
+                  type: 'bar',
323
+                  barWidth: '25%',
324
+                  label: {
325
+                    normal: {
326
+                      show: true,
327
+                      position: 'top',
328
+                      formatter: '{c}',
329
+                      textStyle:{
330
+                        color: 'black',//字体颜色
331
+                        fontSize: 13//字体大小
332
+                      }
333
+                    },
334
+                  },
335
+                  itemStyle:{
336
+                    normal:{
337
+                      color:function (params){
338
+                        // const colorarr=['#FFA333','#A155E8','#6D91FF','#A233A2'];
339
+                        var colorarr = [["#A9E0F3", "#9FBDFC"],["#FFD7C0", "#FF9994"]]
340
+                        var index = params.dataIndex;
341
+                        if (params.dataIndex >= colorarr.length) {
342
+                          index = params.dataIndex % colorarr.length;
343
+                        }
344
+                        return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
345
+                          { offset: 0, color: colorarr[index][0] },
346
+                          // { offset: 0.5, color: colorList[index][1] },
347
+                          { offset: 1, color: colorarr[index][1] }
348
+                        ]);
349
+                      }
350
+                    }
351
+                  }
352
+                }
353
+              ]
354
+            }
355
+            myChart.setOption(option);
356
+            myChart.on('click',params =>{
357
+              this.dialyze_dialog = true
358
+              console.log('vvvvv',params);
359
+              this.Getdialyzerdetail(params.name)
360
+            })
361
+          }
362
+
363
+        })
364
+
365
+      },
366
+      // 导出excel
367
+      exportExcel(){
368
+        let tableData = [
369
+          ['序号', '透析号', '患者姓名', '透析日期','透析模式', '透析器']//导出表头
370
+        ]
371
+        this.tableData.forEach((item,index) =>{
372
+          let rowdata=[]
373
+          rowdata=[
374
+            item.index,
375
+            item.dialysis_no,
376
+            item.name,
377
+            item.date,
378
+            item.mode_name,
379
+            item.dialyszers,
380
+          ]
381
+          tableData.push(rowdata)
382
+        })
383
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
384
+        let bookNew = XLSX.utils.book_new();
385
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析器使用统计') // 工作簿名称
386
+        let name = '透析器使用统计'+ '.xlsx'
387
+        XLSX.writeFile(bookNew, name) // 保存的文件名
388
+      },
389
+      // 查询
390
+      sete_click(){
391
+        this.getecharts()
392
+      },
393
+      // 详情查询
394
+      deil_click(){
395
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
396
+      },
397
+       // 下载
398
+      Download_click(){
399
+        const options ={
400
+          allowTaint: true,
401
+          useCORS: true
402
+        }
403
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
404
+          // const imageSrc = canvas.toDataURL();
405
+          const imageUrl = canvas.toDataURL("image/png");
406
+          // console.log('5555',imageUrl);
407
+        //   // const base = this.url.split(',')[1]
408
+        //   // console.log('2222',base);
409
+          const blob = this.dataURLtoBlob(imageUrl)
410
+          // console.log('4444',blob);
411
+          const url = URL.createObjectURL(blob);
412
+          // const file = (this.url).blob();
413
+          // console.log('1111',url);
414
+          var link= document.createElement("a");
415
+        //   //将生成的图片url赋值给a标签的href属性
416
+          link.href = url;
417
+        //   //设置下载的文件名
418
+          link.download = "透析器使用统计.jpg";
419
+          // // 将a标签插入dom中
420
+          console.log('link',link);
421
+          document.body.appendChild(link);
422
+          //模拟点击事件触发下载
423
+          link.click();
424
+          // 完成之后销毁创建的a标签
425
+          document.body.removeChild(link);
426
+
427
+        })
428
+      },
429
+      // 选择日期
430
+      datachange(eve){
431
+        if(eve ==1){
432
+          this.start_date = this.getPreviousDate(7)
433
+          this.end_date = this.getTime(new Date())
434
+        }else if(eve==2){
435
+          this.start_date = this.getFirstDayOfWeek(new Date())
436
+          this.end_date = this.getTime(new Date())
437
+          console.log('this.start_date', this.start_date);
438
+        }else if(eve ==3){
439
+          var date=new Date()
440
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
441
+          var m =''
442
+          var d = ''
443
+          if(date.getMonth() + 1<10){
444
+            m = '0'+(date.getMonth() + 1)
445
+          }else{
446
+             m = date.getMonth() + 1
447
+          }
448
+          if(date.getDate()<10){
449
+             d = '0'+date.getDate()
450
+          }else{
451
+            d = date.getDate()
452
+          }
453
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
454
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
455
+          date.setDate(date.getDate() +6);
456
+          var mm = ''
457
+          var dd = ''
458
+          if(date.getMonth() + 1<10){
459
+            mm = '0'+(date.getMonth() + 1)
460
+          }else{
461
+            mm = date.getMonth() + 1
462
+          }
463
+          if(date.getDate()<10){
464
+            dd = '0'+date.getDate()
465
+          }else{
466
+            dd = date.getDate()
467
+          }
468
+          // if(date.getMonth() + 1<10)
469
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
470
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
471
+          console.log('this.end_date',this.end_date);
472
+
473
+        }else if(eve ==4){
474
+          this.start_date = this.getFirstDayOfMonth(new Date())
475
+          this.end_date = this.getTime(new Date())
476
+        }else if(eve ==5){
477
+          this.getLastMonthFirstDay()
478
+          this.getLastMonthLastDay()
479
+        }else if(eve == 6){
480
+          this.start_date = this.getFirstDayOfYear(new Date())
481
+          this.end_date = this.getTime(new Date())
482
+        }else if(eve == 7){
483
+          this.getLastYearFirstDay()
484
+          this.getLastYearLastDay()
485
+        }
486
+        console.log('eve',eve);
487
+      },
488
+      // 详情数据源
489
+      Getdialyzerdetail(name){
490
+        const params={
491
+          dialyzer:name,
492
+          start_date:this.start_date,
493
+          end_date:this.end_date,
494
+          page:this.currentPage,
495
+          limit:this.limit,
496
+        }
497
+        Getdialyzerdetail(params).then(response =>{
498
+          if(response.data.state == 1){
499
+            const list = response.data.data.prescriptions
500
+            const table=[]
501
+            list.forEach((item,index)=>{
502
+              const obj ={
503
+                index:index+1,
504
+                dialysis_no:item.patient.dialysis_no,
505
+                name:item.patient.name,
506
+                date:this.getTime(item.record_date),
507
+                mode_name:this.getmode(item.mode_id),
508
+                dialyszers:item.dialysis_dialyszers +'  '+ item.dialysis_irrigation+'  '+item.dialysis_strainer
509
+                // dialyszers:item.dialysis_dialyszers || item.dialysis_irrigation || item.dialysis_strainer
510
+              }
511
+              table.push(obj)
512
+            })
513
+            this.tableData = table
514
+            this.total = response.data.data.total
515
+          }
516
+          console.log('77777',response);
517
+        })
518
+      },
519
+       // 首先定义一个getPreviousDate函数,方便调用
520
+      getPreviousDate(numOfDays) {
521
+        var date = new Date();
522
+        date.setDate(date.getDate() - numOfDays);
523
+        var year = date.getFullYear();
524
+        if(date.getMonth() + 1<10){
525
+          var month = '0'+(date.getMonth() + 1);
526
+        }else{
527
+          var month = date.getMonth() + 1;
528
+        }
529
+
530
+        if(date.getDate()<10){
531
+          var day = '0'+date.getDate();
532
+        }else{
533
+          var day = date.getDate();
534
+        }
535
+        return year + "-" + month + "-" + day;
536
+      },
537
+      // 本周
538
+      getFirstDayOfWeek(date){
539
+        var weekday = date.getDay()
540
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
541
+        return this.timeFormat(date);
542
+      },
543
+      // 本月
544
+      getFirstDayOfMonth (date) {
545
+        date.setDate(1);
546
+        return this.timeFormat(date);
547
+      },
548
+       //上个月第一天
549
+      getLastMonthFirstDay() {
550
+          var date = new Date();
551
+          date.setDate(0);
552
+          var y = date.getFullYear(); //获取年份
553
+          var m = date.getMonth() + 1; //获取月份
554
+          m = m < 10 ? "0" + m : m;
555
+          this.start_date = [y, m, '01'].join("-")
556
+          // return [y, m, '01'].join("-");
557
+      },
558
+      // 上个月最后一天
559
+      getLastMonthLastDay() {
560
+          var date = new Date();
561
+          date.setDate(0);
562
+          var y = date.getFullYear(); //获取年份
563
+          var m = date.getMonth() + 1; //获取月份
564
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
565
+          m = m < 10 ? "0" + m : m; //月份补 0
566
+          d = d < 10 ? "0" + d : d; //日数补 0
567
+          this.end_date = [y, m, d].join("-")
568
+          // return [y, m, d].join("-");
569
+      },
570
+      // 本年
571
+      getFirstDayOfYear (date) {
572
+        date.setDate(1);
573
+        date.setMonth(0);
574
+        return this.timeFormat(date);
575
+      },
576
+      // 上一年第一天
577
+      getLastYearFirstDay() {
578
+          let date = new Date();
579
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
580
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
581
+         const start_day = date.setDate(1); // 设置日期为1日
582
+        //  const last_month = date.setMonth(11); // 设置月份为12月
583
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
584
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
585
+         this.start_date = this.getTime(start_day)
586
+        //  return this.start_date
587
+      },
588
+      // 上一年最后一天
589
+      getLastYearLastDay() {
590
+          let date = new Date();
591
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
592
+          const last_month = date.setMonth(12); // 设置月份为12月
593
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
594
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
595
+          this.end_date = this.getTime(last_day)
596
+          console.log('this.end_date',this.end_date);
597
+          // return this.end_date;
598
+      },
599
+      // 日期格式化
600
+      timeFormat(date) {
601
+          if (!date || typeof(date) === "string") {
602
+            this.error("参数异常,请检查...");
603
+          }
604
+          var y = date.getFullYear(); //年
605
+          if(date.getMonth() + 1<10){
606
+            var m ='0'+(date.getMonth() + 1); //月
607
+          }else{
608
+            var m =date.getMonth() + 1; //月
609
+          }
610
+          if(date.getDate() + 1<10){
611
+            var d ='0'+date.getDate(); //日
612
+          }else{
613
+            var d = date.getDate(); //日
614
+          }
615
+          // var d = date.getDate(); //日
616
+
617
+          return y + "-" + m + "-" + d;
618
+      },
619
+      handleCurrentChange(val){
620
+        this.currentPage = val
621
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
622
+      },
623
+      handleSizeChange(val){
624
+        this.limit = val
625
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
626
+      },
627
+      // 透析模式
628
+      getmode(ids){
629
+        const modes=this.modearr
630
+        for(let i in modes){
631
+          if(ids == modes[i].id){
632
+            return modes[i].name
633
+          }
634
+        }
635
+      },
636
+       // 转换时间
637
+      getTime(val) {
638
+        if(val < 0){
639
+          return ""
640
+        }
641
+        if(val == ""){
642
+          return ""
643
+        }else {
644
+          return uParseTime(val, '{y}-{m}-{d}')
645
+        }
646
+      },
647
+      dataURLtoBlob(dataURL) {
648
+        const arr = dataURL.split(',');
649
+        const mime = arr[0].match(/:(.*?);/)[1];
650
+        const bstr = atob(arr[1]);
651
+        let n = bstr.length;
652
+        const u8arr = new Uint8Array(n);
653
+        while (n--) {
654
+          u8arr[n] = bstr.charCodeAt(n);
655
+        }
656
+        return new Blob([u8arr], { type: mime });
657
+      },
658
+      // 全部透析器
659
+      Getdialyzerconfig(){
660
+        Getdialyzerconfig().then(response =>{
661
+          console.log('666666',response);
662
+        })
663
+      },
664
+      getdialyze(val){
665
+        const option = this.dialyze_options
666
+        for(let i in option){
667
+          if(val == option[i].id){
668
+            return option[i].name
669
+          }
670
+        }
671
+      }
672
+    },
673
+    mounted(){
674
+      this.getecharts()
675
+    },
676
+    created(){
677
+      this.start_date = this.getFirstDayOfMonth(new Date())
678
+      this.Getdialyzerconfig()
679
+    },
680
+
681
+  }
682
+</script>

+ 618 - 0
src/xt_pages/Dialysisanalysis/weightblood/components/weight_table.vue View File

@@ -0,0 +1,618 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <div>
5
+        <span>
6
+          <el-button @click="return_click" type="text" icon="el-icon-arrow-left">返回</el-button>
7
+        </span>&nbsp;&nbsp;
8
+        <span>患者体重详情</span>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <div class="page_patientControlAnalysis">
13
+        <div style="display: flex;margin-bottom: 20px;">
14
+          <div style="flex: 2;display: flex;flex-wrap:wrap">
15
+            <div>
16
+              日期:
17
+              <el-select v-model="date_value" @change="datachange" placeholder="请选择" style="width: 100px;">
18
+                <el-option
19
+                  v-for="item in date_options"
20
+                  :key="item.value"
21
+                  :label="item.label"
22
+                  :value="item.value">
23
+                </el-option>
24
+              </el-select>
25
+            </div>
26
+            <div style="margin:0 10px;">
27
+              <el-date-picker
28
+                v-model="start_date"
29
+                type="date"
30
+                value-format="yyyy-MM-dd"
31
+                placeholder="选择日期"
32
+                style="width: 150px;">
33
+              </el-date-picker>
34
+              <span>-</span>
35
+              <el-date-picker
36
+                v-model="end_date"
37
+                type="date"
38
+                value-format="yyyy-MM-dd"
39
+                placeholder="选择日期"
40
+                style="width: 150px;">
41
+              </el-date-picker>
42
+            </div>
43
+            <div>
44
+              体重增长:
45
+              <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
46
+                <el-option :key="0" label="不限" :value="0"></el-option>
47
+                <el-option
48
+                  v-for="item in dialyze_options"
49
+                  :key="item.id"
50
+                  :label="item.name"
51
+                  :value="item.id">
52
+                </el-option>
53
+              </el-select>
54
+            </div>
55
+            <div>
56
+              干体重:
57
+              <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
58
+                <el-option :key="0" label="不限" :value="0"></el-option>
59
+                <el-option
60
+                  v-for="item in dialyze_options"
61
+                  :key="item.id"
62
+                  :label="item.name"
63
+                  :value="item.id">
64
+                </el-option>
65
+              </el-select>
66
+            </div>
67
+            <div>
68
+              透后体重:
69
+              <el-select v-model="dialyze_value" placeholder="请选择" style="width: 100px;">
70
+                <el-option :key="0" label="不限" :value="0"></el-option>
71
+                <el-option
72
+                  v-for="item in dialyze_options"
73
+                  :key="item.id"
74
+                  :label="item.name"
75
+                  :value="item.id">
76
+                </el-option>
77
+              </el-select>
78
+            </div>
79
+            <div >
80
+              <el-input v-model="input" placeholder="搜索患者姓名"></el-input>
81
+            </div>
82
+          </div>
83
+          <div style="flex: 1;">
84
+            <div>
85
+              <el-button type="primary" @click="deil_click">查询</el-button>
86
+              <el-button type="primary" @click="exportExcel">导出</el-button>
87
+            </div>
88
+          </div>
89
+        </div>
90
+
91
+        <el-table :data="tableData" border style="width: 100%"
92
+        :header-cell-style="{textAlign: 'center'}"
93
+        :cell-style="{ textAlign: 'center' }"
94
+        height="380">
95
+          <el-table-column
96
+            prop="index"
97
+            label="序号"
98
+            width="">
99
+          </el-table-column>
100
+          <el-table-column
101
+            prop="dialysis_no"
102
+            label="透析号"
103
+            width="">
104
+          </el-table-column>
105
+          <el-table-column
106
+            prop="name"
107
+            label="患者姓名">
108
+          </el-table-column>
109
+          <el-table-column
110
+            prop="name"
111
+            label="性别"
112
+            width="">
113
+          </el-table-column>
114
+          <el-table-column
115
+            prop="name"
116
+            label="年龄"
117
+            width="">
118
+          </el-table-column>
119
+          <el-table-column
120
+            prop="date"
121
+            label="透析日期"
122
+            width="">
123
+          </el-table-column>
124
+          <el-table-column
125
+            prop="mode_name"
126
+            label="干体重"
127
+            width="">
128
+          </el-table-column>
129
+          <el-table-column
130
+            prop="dialyszers"
131
+            label="前次透后体重">
132
+          </el-table-column>
133
+          <el-table-column
134
+            prop="date"
135
+            label="透前体重"
136
+            width="">
137
+          </el-table-column>
138
+          <el-table-column
139
+            prop="mode_name"
140
+            label="体重增加"
141
+            width="">
142
+          </el-table-column>
143
+          <el-table-column
144
+            prop="dialyszers"
145
+            label="透后体重">
146
+          </el-table-column>
147
+        </el-table>
148
+        <div style="text-align: right;margin-top: 10px;">
149
+          <el-pagination
150
+            @size-change="handleSizeChange"
151
+            @current-change="handleCurrentChange"
152
+            :current-page="currentPage"
153
+            :page-sizes="[50,100, 200, 300, 400]"
154
+            :page-size="limit"
155
+            layout="total, sizes, prev, pager, next, jumper"
156
+            :total="total">
157
+          </el-pagination>
158
+        </div>
159
+      </div>
160
+    </div>
161
+
162
+    <!-- 弹窗 -->
163
+   
164
+  </div>
165
+</template>
166
+<script>
167
+import * as echarts from 'echarts';
168
+import XLSX from 'xlsx';
169
+import { uParseTime } from "@/utils/tools";
170
+import {Getdialyzer,Getdialyzerdetail,Getdialyzerconfig} from '../../../../api/qcd'
171
+import { forEach } from 'jszip';
172
+import html2canvas from "html2canvas"
173
+  export default {
174
+    components:{
175
+    },
176
+    data(){
177
+      return{
178
+        date_value:4,
179
+        start_date:'',
180
+        end_date:this.getTime(new Date()),
181
+        mode:'',
182
+        date_mode:'',
183
+        source:'',
184
+        dialyze_value:0,
185
+        dialyze_dialog:false,
186
+        currentPage:1,
187
+        limit:50,
188
+        total:0,
189
+        tableData:[],
190
+        dialyze_options:[],
191
+        date_options:[{value:1,label:'最近七天'},{value:2,label:'本周'},{value:3,label:'上周'},{value:4,label:'本月'},
192
+                      {value:5,label:'上月'},{value:6,label:'本年'},{value:7,label:'上一年'}
193
+        ],
194
+        modearr:[{ id: 1, name: 'HD' },{ id: 2, name: 'HDF' },{ id: 3, name: 'HD + HP' },{ id: 4, name: 'HP' },
195
+          { id: 5, name: 'HF' },{ id: 6, name: 'SCUF' },{ id: 7, name: 'IUF' },{ id: 8, name: 'HFHD' },{ id: 9, name: 'HFHD+HP' },
196
+          { id: 10, name: 'PHF' },{ id: 11, name: 'HFR' },{ id: 12, name: 'HDF+HP' },{ id: 13, name: 'CRRT' },{ id: 14, name: '腹水回输' },
197
+          { id:19, name:"IUF+HD"},{ id:20, name:"UF"},{ id:21, name:"HD+"},{ id:22, name:"血浆胆红素吸附+HDF"},{ id:23, name:"血浆胆红素吸附"},
198
+          { id:24, name:"I-HDF"},{ id:25, name:"HD高通"},{ id:26, name:"CVVH"},{ id:27, name:"CVVHD"},{ id:28, name:"CVVHDF"},{ id:29, name:"PE"},
199
+          { id:30, name:"血浆胆红素吸附+HP"},{ id:31, name:"HPD"},{ id:32, name:"HDP"},{ id:33, name:"HFD"},{ id:34, name:"HDF100"},
200
+          { id:35, name:"HDF600"},{ id:36, name:"HDF800"},{ id:37, name:"HDF1000"},
201
+        ],
202
+        date_mode_options:[{value:1,label:'按周'},{value:2,label:'按天'},{value:3,label:'按月'},{value:4,label:'按年'}],
203
+        source_options:[{value:1,label:'以开始透析为准'},{value:2,label:'以排班为准'}],
204
+
205
+
206
+        input:'',
207
+      }
208
+    },
209
+    methods:{
210
+      // 返回
211
+      return_click(){
212
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood')
213
+      },
214
+      // 数据源
215
+      getecharts(){
216
+        var chartDom = document.getElementById('mychart')
217
+        var myChart = echarts.init(chartDom);
218
+        const params ={
219
+          start_date:this.start_date,
220
+          end_date:this.end_date,
221
+        }
222
+        Getdialyzer(params).then(response =>{
223
+          console.log('ressponse',response.data.data);
224
+          if(response.data.state ==1){
225
+            console.log('bbbbbbbbb',response.data.data);
226
+            const list = response.data.data.data
227
+            const xAxis =[]
228
+            const yAxis = []
229
+            list.forEach(item =>{
230
+
231
+              xAxis.push(item.name)
232
+              yAxis.push(item.count)
233
+            })
234
+            this.bar_xAxis = xAxis
235
+            const options = []
236
+            for(let i in xAxis){
237
+              const arr ={
238
+                id:i+1,
239
+                name:xAxis[i]
240
+              }
241
+              options.push(arr)
242
+            }
243
+            this.dialyze_options = options
244
+            const option = {
245
+              xAxis: {
246
+                type: 'category',
247
+                data: xAxis,
248
+                axisLabel:{
249
+                  interval:0,
250
+                }
251
+              },
252
+              yAxis: {
253
+                type: 'value'
254
+              },
255
+              series: [
256
+                {
257
+                  data:yAxis ,
258
+                  type: 'bar',
259
+                  barWidth: '25%',
260
+                  label: {
261
+                    normal: {
262
+                      show: true,
263
+                      position: 'top',
264
+                      formatter: '{c}',
265
+                      textStyle:{
266
+                        color: 'black',//字体颜色
267
+                        fontSize: 13//字体大小
268
+                      }
269
+                    },
270
+                  },
271
+                  itemStyle:{
272
+                    normal:{
273
+                      color:function (params){
274
+                        // const colorarr=['#FFA333','#A155E8','#6D91FF','#A233A2'];
275
+                        var colorarr = [["#A9E0F3", "#9FBDFC"],["#FFD7C0", "#FF9994"]]
276
+                        var index = params.dataIndex;
277
+                        if (params.dataIndex >= colorarr.length) {
278
+                          index = params.dataIndex % colorarr.length;
279
+                        }
280
+                        return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
281
+                          { offset: 0, color: colorarr[index][0] },
282
+                          // { offset: 0.5, color: colorList[index][1] },
283
+                          { offset: 1, color: colorarr[index][1] }
284
+                        ]);
285
+                      }
286
+                    }
287
+                  }
288
+                }
289
+              ]
290
+            }
291
+            myChart.setOption(option);
292
+            myChart.on('click',params =>{
293
+              this.dialyze_dialog = true
294
+              console.log('vvvvv',params);
295
+              this.Getdialyzerdetail(params.name)
296
+            })
297
+          }
298
+
299
+        })
300
+
301
+      },
302
+      // 导出excel
303
+      exportExcel(){
304
+        let tableData = [
305
+          ['序号', '透析号', '患者姓名', '透析日期','透析模式', '透析器']//导出表头
306
+        ]
307
+        this.tableData.forEach((item,index) =>{
308
+          let rowdata=[]
309
+          rowdata=[
310
+            item.index,
311
+            item.dialysis_no,
312
+            item.name,
313
+            item.date,
314
+            item.mode_name,
315
+            item.dialyszers,
316
+          ]
317
+          tableData.push(rowdata)
318
+        })
319
+        let workSheet = XLSX.utils.aoa_to_sheet(tableData);
320
+        let bookNew = XLSX.utils.book_new();
321
+        XLSX.utils.book_append_sheet(bookNew, workSheet, '透析器使用统计') // 工作簿名称
322
+        let name = '透析器使用统计'+ '.xlsx'
323
+        XLSX.writeFile(bookNew, name) // 保存的文件名
324
+      },
325
+      // 查询
326
+      sete_click(){
327
+        this.getecharts()
328
+      },
329
+      // 详情查询
330
+      deil_click(){
331
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
332
+      },
333
+       // 下载
334
+      Download_click(){
335
+        const options ={
336
+          allowTaint: true,
337
+          useCORS: true
338
+        }
339
+        html2canvas(this.$refs.mychart,options).then(canvas =>{
340
+          // const imageSrc = canvas.toDataURL();
341
+          const imageUrl = canvas.toDataURL("image/png");
342
+          // console.log('5555',imageUrl);
343
+        //   // const base = this.url.split(',')[1]
344
+        //   // console.log('2222',base);
345
+          const blob = this.dataURLtoBlob(imageUrl)
346
+          // console.log('4444',blob);
347
+          const url = URL.createObjectURL(blob);
348
+          // const file = (this.url).blob();
349
+          // console.log('1111',url);
350
+          var link= document.createElement("a");
351
+        //   //将生成的图片url赋值给a标签的href属性
352
+          link.href = url;
353
+        //   //设置下载的文件名
354
+          link.download = "透析器使用统计.jpg";
355
+          // // 将a标签插入dom中
356
+          console.log('link',link);
357
+          document.body.appendChild(link);
358
+          //模拟点击事件触发下载
359
+          link.click();
360
+          // 完成之后销毁创建的a标签
361
+          document.body.removeChild(link);
362
+
363
+        })
364
+      },
365
+      // 选择日期
366
+      datachange(eve){
367
+        if(eve ==1){
368
+          this.start_date = this.getPreviousDate(7)
369
+          this.end_date = this.getTime(new Date())
370
+        }else if(eve==2){
371
+          this.start_date = this.getFirstDayOfWeek(new Date())
372
+          this.end_date = this.getTime(new Date())
373
+          console.log('this.start_date', this.start_date);
374
+        }else if(eve ==3){
375
+          var date=new Date()
376
+          date.setDate(date.getDate()-7 - date.getDay() + 1);
377
+          var m =''
378
+          var d = ''
379
+          if(date.getMonth() + 1<10){
380
+            m = '0'+(date.getMonth() + 1)
381
+          }else{
382
+             m = date.getMonth() + 1
383
+          }
384
+          if(date.getDate()<10){
385
+             d = '0'+date.getDate()
386
+          }else{
387
+            d = date.getDate()
388
+          }
389
+          // this.start_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
390
+          this.start_date = date.getFullYear() + "-" + m + "-" + d ;
391
+          date.setDate(date.getDate() +6);
392
+          var mm = ''
393
+          var dd = ''
394
+          if(date.getMonth() + 1<10){
395
+            mm = '0'+(date.getMonth() + 1)
396
+          }else{
397
+            mm = date.getMonth() + 1
398
+          }
399
+          if(date.getDate()<10){
400
+            dd = '0'+date.getDate()
401
+          }else{
402
+            dd = date.getDate()
403
+          }
404
+          // if(date.getMonth() + 1<10)
405
+          // this.end_date = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
406
+          this.end_date = date.getFullYear() + "-" + mm + "-" + dd ;
407
+          console.log('this.end_date',this.end_date);
408
+
409
+        }else if(eve ==4){
410
+          this.start_date = this.getFirstDayOfMonth(new Date())
411
+          this.end_date = this.getTime(new Date())
412
+        }else if(eve ==5){
413
+          this.getLastMonthFirstDay()
414
+          this.getLastMonthLastDay()
415
+        }else if(eve == 6){
416
+          this.start_date = this.getFirstDayOfYear(new Date())
417
+          this.end_date = this.getTime(new Date())
418
+        }else if(eve == 7){
419
+          this.getLastYearFirstDay()
420
+          this.getLastYearLastDay()
421
+        }
422
+        console.log('eve',eve);
423
+      },
424
+      // 详情数据源
425
+      Getdialyzerdetail(name){
426
+        const params={
427
+          dialyzer:name,
428
+          start_date:this.start_date,
429
+          end_date:this.end_date,
430
+          page:this.currentPage,
431
+          limit:this.limit,
432
+        }
433
+        Getdialyzerdetail(params).then(response =>{
434
+          if(response.data.state == 1){
435
+            const list = response.data.data.prescriptions
436
+            const table=[]
437
+            list.forEach((item,index)=>{
438
+              const obj ={
439
+                index:index+1,
440
+                dialysis_no:item.patient.dialysis_no,
441
+                name:item.patient.name,
442
+                date:this.getTime(item.record_date),
443
+                mode_name:this.getmode(item.mode_id),
444
+                dialyszers:item.dialysis_dialyszers +'  '+ item.dialysis_irrigation+'  '+item.dialysis_strainer
445
+                // dialyszers:item.dialysis_dialyszers || item.dialysis_irrigation || item.dialysis_strainer
446
+              }
447
+              table.push(obj)
448
+            })
449
+            this.tableData = table
450
+            this.total = response.data.data.total
451
+          }
452
+          console.log('77777',response);
453
+        })
454
+      },
455
+       // 首先定义一个getPreviousDate函数,方便调用
456
+      getPreviousDate(numOfDays) {
457
+        var date = new Date();
458
+        date.setDate(date.getDate() - numOfDays);
459
+        var year = date.getFullYear();
460
+        if(date.getMonth() + 1<10){
461
+          var month = '0'+(date.getMonth() + 1);
462
+        }else{
463
+          var month = date.getMonth() + 1;
464
+        }
465
+
466
+        if(date.getDate()<10){
467
+          var day = '0'+date.getDate();
468
+        }else{
469
+          var day = date.getDate();
470
+        }
471
+        return year + "-" + month + "-" + day;
472
+      },
473
+      // 本周
474
+      getFirstDayOfWeek(date){
475
+        var weekday = date.getDay()
476
+        date.setDate(date.getDate()-weekday+1);//往前算(weekday-1)天,年份、月份会自动变化
477
+        return this.timeFormat(date);
478
+      },
479
+      // 本月
480
+      getFirstDayOfMonth (date) {
481
+        date.setDate(1);
482
+        return this.timeFormat(date);
483
+      },
484
+       //上个月第一天
485
+      getLastMonthFirstDay() {
486
+          var date = new Date();
487
+          date.setDate(0);
488
+          var y = date.getFullYear(); //获取年份
489
+          var m = date.getMonth() + 1; //获取月份
490
+          m = m < 10 ? "0" + m : m;
491
+          this.start_date = [y, m, '01'].join("-")
492
+          // return [y, m, '01'].join("-");
493
+      },
494
+      // 上个月最后一天
495
+      getLastMonthLastDay() {
496
+          var date = new Date();
497
+          date.setDate(0);
498
+          var y = date.getFullYear(); //获取年份
499
+          var m = date.getMonth() + 1; //获取月份
500
+          var d = new Date(y, m, 0).getDate(); //获取当月最后一日
501
+          m = m < 10 ? "0" + m : m; //月份补 0
502
+          d = d < 10 ? "0" + d : d; //日数补 0
503
+          this.end_date = [y, m, d].join("-")
504
+          // return [y, m, d].join("-");
505
+      },
506
+      // 本年
507
+      getFirstDayOfYear (date) {
508
+        date.setDate(1);
509
+        date.setMonth(0);
510
+        return this.timeFormat(date);
511
+      },
512
+      // 上一年第一天
513
+      getLastYearFirstDay() {
514
+          let date = new Date();
515
+         const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
516
+         const start_month= date.setMonth(0); // 设置月份为1月(注意月份是从0开始的)
517
+         const start_day = date.setDate(1); // 设置日期为1日
518
+        //  const last_month = date.setMonth(11); // 设置月份为12月
519
+        //  const last_day = date.setDate(0); // 设置日期为0,这将自动设置为该月的最后一天
520
+        //  this.start_date = year+ "-" +start_month+ "-" +start_day
521
+         this.start_date = this.getTime(start_day)
522
+        //  return this.start_date
523
+      },
524
+      // 上一年最后一天
525
+      getLastYearLastDay() {
526
+          let date = new Date();
527
+          const year= date.setFullYear(date.getFullYear() - 1); // 设置年份为前一年
528
+          const last_month = date.setMonth(12); // 设置月份为12月
529
+          const last_day = date.setDate(0);// 设置日期为0,这将自动设置为该月的最后一天
530
+          // this.end_date =  year+ "-" +last_month+ "-" +last_day
531
+          this.end_date = this.getTime(last_day)
532
+          console.log('this.end_date',this.end_date);
533
+          // return this.end_date;
534
+      },
535
+      // 日期格式化
536
+      timeFormat(date) {
537
+          if (!date || typeof(date) === "string") {
538
+            this.error("参数异常,请检查...");
539
+          }
540
+          var y = date.getFullYear(); //年
541
+          if(date.getMonth() + 1<10){
542
+            var m ='0'+(date.getMonth() + 1); //月
543
+          }else{
544
+            var m =date.getMonth() + 1; //月
545
+          }
546
+          if(date.getDate() + 1<10){
547
+            var d ='0'+date.getDate(); //日
548
+          }else{
549
+            var d = date.getDate(); //日
550
+          }
551
+          // var d = date.getDate(); //日
552
+
553
+          return y + "-" + m + "-" + d;
554
+      },
555
+      handleCurrentChange(val){
556
+        this.currentPage = val
557
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
558
+      },
559
+      handleSizeChange(val){
560
+        this.limit = val
561
+        this.Getdialyzerdetail(this.getdialyze(this.dialyze_value))
562
+      },
563
+      // 透析模式
564
+      getmode(ids){
565
+        const modes=this.modearr
566
+        for(let i in modes){
567
+          if(ids == modes[i].id){
568
+            return modes[i].name
569
+          }
570
+        }
571
+      },
572
+       // 转换时间
573
+      getTime(val) {
574
+        if(val < 0){
575
+          return ""
576
+        }
577
+        if(val == ""){
578
+          return ""
579
+        }else {
580
+          return uParseTime(val, '{y}-{m}-{d}')
581
+        }
582
+      },
583
+      dataURLtoBlob(dataURL) {
584
+        const arr = dataURL.split(',');
585
+        const mime = arr[0].match(/:(.*?);/)[1];
586
+        const bstr = atob(arr[1]);
587
+        let n = bstr.length;
588
+        const u8arr = new Uint8Array(n);
589
+        while (n--) {
590
+          u8arr[n] = bstr.charCodeAt(n);
591
+        }
592
+        return new Blob([u8arr], { type: mime });
593
+      },
594
+      // 全部透析器
595
+      Getdialyzerconfig(){
596
+        Getdialyzerconfig().then(response =>{
597
+          console.log('666666',response);
598
+        })
599
+      },
600
+      getdialyze(val){
601
+        const option = this.dialyze_options
602
+        for(let i in option){
603
+          if(val == option[i].id){
604
+            return option[i].name
605
+          }
606
+        }
607
+      }
608
+    },
609
+    mounted(){
610
+      this.getecharts()
611
+    },
612
+    created(){
613
+      this.start_date = this.getFirstDayOfMonth(new Date())
614
+      this.Getdialyzerconfig()
615
+    },
616
+
617
+  }
618
+</script>

+ 276 - 0
src/xt_pages/Dialysisanalysis/weightblood/index.vue View File

@@ -0,0 +1,276 @@
1
+<!-- 其他指标 -->
2
+<template>
3
+  <div class="main-contain">
4
+    <div class="position">
5
+<!--        <bread-crumb :crumbs="crumbs"></bread-crumb>-->
6
+    </div>
7
+    <div class="app-container">
8
+      <div class="page_patientControlAnalysis">
9
+        <div class="photos">
10
+          <div v-for="(item,index) in indicators" :key="index"  @click="echart_click(item)"
11
+            style="width: 280px;height: 235px;border:1px solid gainsboro;border-radius: 8px;margin: 0 0 30px 28px"
12
+          >
13
+            <!-- <div v-if="" class="background date_type1" style="background-repeat: no-repeat;"></div>
14
+            <div v-if="item.check_type == 1" class="background date_type2" style="background-repeat: no-repeat;"></div>
15
+            <div v-if="item.check_type == 2" class="background date_type3" style="background-repeat: no-repeat;"></div>
16
+            <p class="title">{{item.item_name}}</p> -->
17
+            <div :class="[item.sub_check_type ==1 ? 'date_type1 background' : item.sub_check_type ==2 ?'date_type2 background':item.sub_check_type ==3 ?'date_type3 background':'']" style="background-repeat: no-repeat;"></div>
18
+            <!-- <div v-if="item.check_type == 1" class="background date_type2" style="background-repeat: no-repeat;"></div>
19
+            <div v-if="item.check_type == 2" class="background date_type3" style="background-repeat: no-repeat;"></div> -->
20
+            <!-- <div v-if="item.check_type == 1" class="background date_type1" style="background-repeat: no-repeat;"></div> -->
21
+
22
+            <p class="title" style="text-align: center;">{{item.item_name}}</p>
23
+
24
+          </div>
25
+        </div>
26
+      </div>
27
+    </div>
28
+  </div>
29
+</template>
30
+
31
+<script>
32
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
33
+import { getStatisticsList } from '../../../api/statistics'
34
+export default {
35
+  name:'index',
36
+  components: {
37
+      BreadCrumb,
38
+  },
39
+  data() {
40
+      return {
41
+        indicators:[],
42
+          activeName: 'first'
43
+      }
44
+  },
45
+  methods:{
46
+    getStatisticsList(){
47
+      let params = {
48
+      }
49
+      this.indicators = []
50
+      getStatisticsList(params).then(response => {
51
+        if (response.data.state == 1) {
52
+          this.indicators  =  this.indicators.concat(response.data.data.configurationlist)
53
+          console.log('444444444',this.indicators);
54
+          for(let i = 0; i < this.indicators.length; i++){
55
+            this.indicators[i]["check_type"] = 1
56
+            this.indicators[i]["sub_check_type"] = 1
57
+          }
58
+          let obj = {
59
+            "check_type":1,
60
+            "item_name":"患者干体重分析",
61
+            "sub_check_type":2
62
+          }
63
+          this.indicators.push(obj)
64
+          let obj2 = {
65
+            "check_type":2,
66
+            "item_name":"患者体重增长分析(以上次透后体重为分母)",
67
+            "sub_check_type":1
68
+          }
69
+          this.indicators.push(obj2)
70
+          let obj3 = {
71
+            "check_type":3,
72
+            "item_name":"患者体重增长分析(以干体重为分母)",
73
+            "sub_check_type":1
74
+          }
75
+          this.indicators.push(obj3)
76
+
77
+          let obj4 = {
78
+            "check_type":4,
79
+            "item_name":"患者透后体重分析",
80
+            "sub_check_type":1
81
+          }
82
+          this.indicators.push(obj4)
83
+          let obj5 = {
84
+            "check_type":5,
85
+            "item_name":"患者体重详情",
86
+            "sub_check_type":3
87
+          }
88
+          this.indicators.push(obj5)
89
+          let obj6 = {
90
+            "check_type":6,
91
+            "item_name":"患者透前血压分析",
92
+            "sub_check_type":2
93
+          }
94
+          this.indicators.push(obj6)
95
+
96
+          let obj7 = {
97
+            "check_type":7,
98
+            "item_name":"患者透后血压分析",
99
+            "sub_check_type":2
100
+          }
101
+          this.indicators.push(obj7)
102
+          let obj8 = {
103
+            "check_type":8,
104
+            "item_name":"患者血压详情",
105
+            "sub_check_type":3
106
+          }
107
+          this.indicators.push(obj8)
108
+
109
+          console.log( this.indicators)
110
+          // this.indicators.push("")
111
+        } else {
112
+          this.$message.error(response.data.msg)
113
+        }
114
+      })
115
+    },
116
+    echart_click(item){
117
+      if(item.check_type == 1){
118
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/dry_weight')
119
+      }else if(item.check_type == 2){
120
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/list_denominator')
121
+      }else if (item.check_type == 3){
122
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/dry_denominator')
123
+      }else if (item.check_type == 4){
124
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/dialyze_after')
125
+      } else if(item.check_type == 5){
126
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/weight_table')
127
+      }else if (item.check_type == 6){
128
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/before_Blood')
129
+      }else if (item.check_type == 7){
130
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/after_Blood')
131
+      }else if(item.check_type == 8){
132
+        this.$router.push('/Dialysisanalysis/qualitycontrol/weightblood/blood_table')
133
+      }
134
+     
135
+      
136
+      console.log('item',item);
137
+    }
138
+    // jump(project_id, item_id,project_type){
139
+    //   this.$router.push('/Dialysisanalysis/qualitycontrol/Indicatorsdetail?project_id='+project_id+"&item_id="+item_id+"&project_type="+parseInt(project_type))
140
+    // },
141
+    // handleClick(tab, event) {
142
+    //   console.log(tab, event);
143
+    // },
144
+    // echart_click(item){
145
+    //   // if(item.check_type == 1){
146
+    //   //   if(item.sub_check_type == 1){
147
+    //   //     this.$router.push('/Dialysisanalysis/qualitycontrol/Indicatorsdetail?project_id='+item.inspection_major+"&item_id="+item.inspection_minor+"&project_type="+parseInt(item.id))
148
+
149
+    //   //     // this.$router.push('/Dialysisanalysis/qualitycontrol/otherIndicators/components/columnarTotal')
150
+
151
+    //   //   }else if(item.sub_check_type == 2){
152
+    //   //     this.$router.push('/Dialysisanalysis/qualitycontrol/platelets')
153
+    //   //   }
154
+    //   // }else if(item.check_type == 2){
155
+    //   //   this.$router.push('/Dialysisanalysis/qualitycontrol/summary')
156
+    //   // }
157
+
158
+
159
+    // }
160
+  },
161
+  created(){
162
+  this.getStatisticsList()
163
+
164
+}
165
+}
166
+</script>
167
+
168
+<style lang="scss" scoped>
169
+
170
+.page_patientControlAnalysis{
171
+.background{
172
+  height: 180px;
173
+  width: 100%;
174
+  background-repeat:no-repeat;
175
+}
176
+.date_type1{
177
+  background: url('../../../assets/img/zhuzhuantu.png');
178
+}
179
+.date_type2{
180
+  background: url('../../../assets/img/bingzhuantua.png');
181
+}
182
+.date_type3{
183
+  background: url('../../../assets/img/biaoge.png');
184
+}
185
+
186
+.title{
187
+  font-size: 18px;
188
+  margin: 15px 10px;
189
+  color: #333333;
190
+  text-overflow: ellipsis;
191
+  overflow: hidden;
192
+  white-space: nowrap;
193
+}
194
+.tag {
195
+  margin-left: 10px;
196
+  height: 82px;
197
+  overflow: auto;
198
+}
199
+.use {
200
+  font-size: 14px;
201
+  color: #999;
202
+  margin-left: 10px;
203
+}
204
+// .shoucang{
205
+//   width: 20px;
206
+//   height: 20px;
207
+//   margin-right: 15px;
208
+//   float: right;
209
+//   background:url('../../../assets/img/xingixnghuise.png')
210
+// }
211
+.tags{
212
+  font-size: 14px;
213
+  font-family: Microsoft YaHei;
214
+  color: #477ac5;
215
+  background: #edf4ff;
216
+  margin-right: 3px;
217
+  margin-top: 3px;
218
+  padding: 1px 6px;
219
+  border-radius: 5px;
220
+}
221
+.photos{
222
+  display: flex;
223
+  justify-content: flex-start;
224
+  flex-wrap: wrap;
225
+}
226
+
227
+}
228
+// .page_patientControlAnalysis {
229
+
230
+// .pointTitle {
231
+//   font-size: 13px;
232
+// }
233
+
234
+// .chartTitle {
235
+//   font-size: 16px;
236
+//   font-weight: bold;
237
+//   color: #000000;
238
+// }
239
+
240
+// .point {
241
+//   width: 13px;
242
+//   height: 13px;
243
+//   background: linear-gradient(
244
+//       0deg,
245
+//       rgba(169, 224, 243, 1),
246
+//       rgba(159, 189, 252, 1)
247
+//   );
248
+//   border-radius: 7px;
249
+//   margin-right: 8px;
250
+// }
251
+
252
+// .pointTitle {
253
+//   font-size: 13px;
254
+// }
255
+
256
+// }
257
+
258
+</style>
259
+
260
+<style lang="scss">
261
+// .page_patientControlAnalysis {
262
+
263
+// .el-form-item {
264
+//   margin-bottom: 0;
265
+// }
266
+
267
+// .cell {
268
+//   text-align: center;
269
+// }
270
+
271
+// ::-webkit-scrollbar {
272
+//   height: 15px !important;
273
+// }
274
+
275
+// }
276
+</style>

+ 4 - 2
src/xt_pages/dialysis/PatientBox.vue View File

@@ -590,8 +590,10 @@ export default {
590 590
             }
591 591
           }
592 592
           var lastMonitorRecord = resp.data.lastMonitorRecord;
593
-          var lastAssessmentAfterDislysis =
594
-            resp.data.lastAssessmentAfterDislysis;
593
+          var lastAssessmentAfterDislysis = resp.data.lastAssessmentAfterDislysis;
594
+          // if(this.$store.getters.xt_user.org.id == 10702 || this.$store.getters.xt_user.org.id == 0){
595
+          //   lastAssessmentAfterDislysis.actual_ultrafiltration = 0
596
+          // }
595 597
           var lastDialysisPrescribe = resp.data.lastDialysisPrescribe;
596 598
           var lastDryWeightDislysis = resp.data.lastDryWeightDislysis;
597 599
 

+ 1 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_forty.vue View File

@@ -490,7 +490,7 @@
490 490
                                 <td width="20">mg</td>
491 491
                                 <td width="10">)</td>
492 492
                                 <td width="100">
493
-                                    <label-box :isChecked="record.prescription.anticoagulant==6?true:record.prescription.anticoagulant==7?true:false" showValue='低分子肝素'></label-box> 
493
+                                    <label-box :isChecked="record.prescription.anticoagulant==3?true:false" showValue='低分子肝素'></label-box> 
494 494
                                 </td>
495 495
                                 
496 496
                                 <td width="10">(</td>

+ 4 - 3
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue View File

@@ -30,7 +30,7 @@
30 30
           <el-col :span="8" v-if="isShow('实际超滤量')">
31 31
             <el-form-item
32 32
               label="实际超滤量(ml): " :prop="isName('实际超滤量')" :rules="isCheckmust('实际超滤量')"
33
-              v-if=" this.template_id == 6 || this.template_id == 9 || this.template_id == 10 || this.template_id == 11  || this.template_id == 17 || this.template_id == 20 || this.template_id == 21 || this.template_id == 22 || this.template_id == 23 || this.template_id == 24 || this.template_id == 26 || this.template_id == 28 || this.template_id == 27 || this.template_id == 29 || this.template_id == 30 || this.template_id == 31 || this.template_id == 32 || this.template_id == 34 || this.template_id == 36 || this.template_id == 38 || this.template_id == 43 || this.template_id == 44 || this.template_id == 47 || this.template_id == 56 || this.template_id == 60 || this.$store.getters.xt_user.template_info.org_id == 10307 || this.$store.getters.xt_user.template_info.org_id == 10340 || this.$store.getters.xt_user.template_info.org_id == 9555 || this.$store.getters.xt_user.template_info.org_id == 10387 || this.$store.getters.xt_user.template_info.org_id == 10430 || this.$store.getters.xt_user.template_info.org_id == 10432 || this.$store.getters.xt_user.template_info.org_id == 10441 || this.$store.getters.xt_user.template_info.org_id == 10445 || this.$store.getters.xt_user.template_info.org_id == 10410 || this.$store.getters.xt_user.template_info.org_id == 10495 || this.$store.getters.xt_user.template_info.org_id == 10558 || this.$store.getters.xt_user.template_info.org_id == 10597 || this.$store.getters.xt_user.template_info.org_id == 10599 || this.$store.getters.xt_user.template_info.org_id == 10612 || this.$store.getters.xt_user.template_info.org_id == 10617 || this.$store.getters.xt_user.template_info.org_id == 10480 || this.$store.getters.xt_user.template_info.org_id == 10693  || this.$store.getters.xt_user.template_info.org_id == 10697"  >
33
+              v-if=" this.template_id == 6 || this.template_id == 9 || this.template_id == 10 || this.template_id == 11  || this.template_id == 17 || this.template_id == 20 || this.template_id == 21 || this.template_id == 22 || this.template_id == 23 || this.template_id == 24 || this.template_id == 26 || this.template_id == 28 || this.template_id == 27 || this.template_id == 29 || this.template_id == 30 || this.template_id == 31 || this.template_id == 32 || this.template_id == 34 || this.template_id == 36 || this.template_id == 38 || this.template_id == 43 || this.template_id == 44 || this.template_id == 47 || this.template_id == 56 || this.template_id == 60 || this.$store.getters.xt_user.template_info.org_id == 10307 || this.$store.getters.xt_user.template_info.org_id == 10340 || this.$store.getters.xt_user.template_info.org_id == 9555 || this.$store.getters.xt_user.template_info.org_id == 10387 || this.$store.getters.xt_user.template_info.org_id == 10430 || this.$store.getters.xt_user.template_info.org_id == 10432 || this.$store.getters.xt_user.template_info.org_id == 10441 || this.$store.getters.xt_user.template_info.org_id == 10445 || this.$store.getters.xt_user.template_info.org_id == 10410 || this.$store.getters.xt_user.template_info.org_id == 10495 || this.$store.getters.xt_user.template_info.org_id == 10558 || this.$store.getters.xt_user.template_info.org_id == 10597 || this.$store.getters.xt_user.template_info.org_id == 10599 || this.$store.getters.xt_user.template_info.org_id == 10612 || this.$store.getters.xt_user.template_info.org_id == 10617 || this.$store.getters.xt_user.template_info.org_id == 10480 || this.$store.getters.xt_user.template_info.org_id == 10693  || this.$store.getters.xt_user.template_info.org_id == 10697 || this.$store.getters.xt_user.template_info.org_id == 10702"  >
34 34
               <el-input v-model="form.actual_ultrafiltration"></el-input>
35 35
             </el-form-item>
36 36
             <el-form-item label="实际超滤量(L): " v-else :prop="isName('实际超滤量')" :rules="isCheckmust('实际超滤量')">
@@ -459,7 +459,7 @@
459 459
         <el-row :gutter="20"> -->
460 460
 
461 461
         <el-col :span="8" v-if="isShow('实际置换量')">
462
-          <el-form-item v-if="this.template_id == 20 || this.template_id == 21 || this.org_id ==10702 || this.org_id ==10702" label="实际置换量(ml): " :prop="isName('实际置换量')" :rules="isCheckmust('实际置换量')">
462
+          <el-form-item v-if="this.template_id == 20 || this.template_id == 21" label="实际置换量(ml): " :prop="isName('实际置换量')" :rules="isCheckmust('实际置换量')">
463 463
             <el-input v-model="form.actual_displacement"></el-input>
464 464
           </el-form-item>
465 465
           <el-form-item v-else label="实际置换量(L): " :prop="isName('实际置换量')" :rules="isCheckmust('实际置换量')">
@@ -1135,6 +1135,7 @@ export default {
1135 1135
       }
1136 1136
     },
1137 1137
     isShow(name) {
1138
+      
1138 1139
       var filedList = store.getters.xt_user.fileds
1139 1140
 
1140 1141
       for (let i = 0; i < filedList.length; i++) {
@@ -1511,7 +1512,7 @@ export default {
1511 1512
       if(predialysis != null && predialysis.id == 0){
1512 1513
         if (last_after != null) {
1513 1514
           for (var key in last_after){
1514
-            if (key != 'actual_treatment_hour' && key != 'actual_treatment_minute' && key != 'weight_loss' && key != 'weight_after'  && key != 'systolic_blood_pressure' && key != 'diastolic_blood_pressure' && key != 'pulse_frequency' ){
1515
+            if (key != 'actual_treatment_hour' && key != 'actual_treatment_minute' && key != 'weight_loss' && key != 'weight_after'  && key != 'systolic_blood_pressure' && key != 'diastolic_blood_pressure' && key != 'pulse_frequency'  && key != 'actual_ultrafiltration'  ){
1515 1516
               this.$set(
1516 1517
                 this.form,
1517 1518
                 key,

+ 3 - 0
src/xt_pages/dialysis/details/index.vue View File

@@ -2055,6 +2055,9 @@ export default {
2055 2055
           }
2056 2056
           var lastMonitorRecord = resp.data.lastMonitorRecord
2057 2057
           var lastAssessmentAfterDislysis = resp.data.lastAssessmentAfterDislysis
2058
+          // if(this.org_id == 10702){
2059
+          //   lastAssessmentAfterDislysis.actual_ultrafiltration = 0
2060
+          // }
2058 2061
           // if(lastAssessmentAfterDislysis.hypertenison!=""){
2059 2062
           //   lastAssessmentAfterDislysis.hypertenison = lastAssessmentAfterDislysis.hypertenison.toString()
2060 2063
           // }

+ 1 - 1
src/xt_pages/dialysis/doctorAdvicePrint.vue View File

@@ -292,7 +292,7 @@ export default {
292 292
                     this.project = resp.data.project
293 293
                     resp.data.hisAdvices.map((item,index) => {
294 294
                     item.new_advice = item.new_advice ? item.new_advice : []
295
-                      if(this.org_id!=9671 && this.org_id!= 10318 && this.org_id!=0){
295
+                      if(this.org_id!=9671 && this.org_id!= 10318 && this.org_id!=0 && this.org_id!=10633){
296 296
                         if(this.project[index].project.length > 0){
297 297
                             this.project[index].project.map(it => {
298 298
                             let obj = {

+ 2 - 2
src/xt_pages/dialysis/newDoctorAdvice.vue View File

@@ -1365,11 +1365,11 @@ export default {
1365 1365
           name = ""
1366 1366
        }
1367 1367
 
1368
-       if(this.org_id == 9671 || this.org_id == 10340 || this.org_id == 0){
1368
+       if(this.org_id == 9671 || this.org_id == 10340){
1369 1369
         this.$router.push({ path: "/dialysis/doctorAdvicePrint/one",query:{time: new Date(this.time).getTime(),delivery_way:name} });
1370 1370
        }
1371 1371
 
1372
-       if(this.org_id != 9671 && this.org_id != 10340 && this.org_id!=0){
1372
+       if(this.org_id != 9671 && this.org_id != 10340){
1373 1373
         this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
1374 1374
        }
1375 1375
 

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderForty.vue View File

@@ -576,7 +576,7 @@
576 576
                   <td width="20">mg</td>
577 577
                   <td width="10">)</td>
578 578
                   <td width="100">
579
-                      <label-box :isChecked="prescription.anticoagulant==6?true:prescription.anticoagulant==7?true:false" showValue='低分子肝素'></label-box> 
579
+                      <label-box :isChecked="prescription.anticoagulant==3?true:false" showValue='低分子肝素'></label-box> 
580 580
                   </td>
581 581
                   
582 582
                   <td width="10">(</td>

+ 125 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue View File

@@ -3382,7 +3382,7 @@
3382 3382
 
3383 3383
 
3384 3384
                   </div>
3385
-                  <div v-if="org_id!=10440">
3385
+                  <div v-if="org_id ==10644">
3386 3386
                     <div class="inline_block" style="flex: 1" v-if="predialysis.catheter == ''">
3387 3387
                       穿刺护士:
3388 3388
                       <div
@@ -3504,7 +3504,130 @@
3504 3504
                     </div>
3505 3505
                   </div>
3506 3506
 
3507
-                  <div v-if="org_id==0||org_id==10440">
3507
+
3508
+                  <div v-if="org_id !=10644 && org_id!=10440">
3509
+                    <div class="inline_block" style="flex: 1" v-if="predialysis.catheter == ''">
3510
+                      穿刺护士:
3511
+                      <div
3512
+                        class="under_line"
3513
+                        style="width: 90px; text-align: center"
3514
+                      >
3515
+                        <span
3516
+                          style="height: 30px; display: inline-block"
3517
+                          v-if="
3518
+                            setAdminUserES(
3519
+                              dialysisOrder == null
3520
+                                ? 0
3521
+                                : dialysisOrder.puncture_nurse
3522
+                            ) == ''
3523
+                          "
3524
+                        >
3525
+                          {{
3526
+                            getAdminUser(
3527
+                              dialysisOrder == null
3528
+                                ? 0
3529
+                                : dialysisOrder.puncture_nurse
3530
+                            )
3531
+                          }}</span
3532
+                        >
3533
+                        <img
3534
+                          style="height: 35px"
3535
+                          :src="
3536
+                            setAdminUserES(
3537
+                              dialysisOrder == null
3538
+                                ? 0
3539
+                                : dialysisOrder.puncture_nurse
3540
+                            )
3541
+                          "
3542
+                          alt=""
3543
+                          srcset=""
3544
+                          v-else
3545
+                        />
3546
+                      </div>
3547
+                    </div>
3548
+
3549
+                    <div class="inline_block" style="flex: 1" v-if="predialysis.catheter != ''">
3550
+                      穿刺护士:
3551
+
3552
+                      <div
3553
+                        class="under_line"
3554
+                        style="width: 90px; text-align: center"
3555
+                        v-if="org_id==10644"
3556
+                      >
3557
+                        <span
3558
+                          style="height: 30px; display: inline-block"
3559
+                          v-if="
3560
+                            setAdminUserES(
3561
+                              dialysisOrder == null
3562
+                                ? 0
3563
+                                : dialysisOrder.puncture_nurse
3564
+                            ) == ''
3565
+                          "
3566
+                        >
3567
+                          {{
3568
+                            getAdminUser(
3569
+                              dialysisOrder == null
3570
+                                ? 0
3571
+                                : dialysisOrder.puncture_nurse
3572
+                            )
3573
+                          }}</span
3574
+                        >
3575
+                        <img
3576
+                          style="height: 35px"
3577
+                          :src="
3578
+                            setAdminUserES(
3579
+                              dialysisOrder == null
3580
+                                ? 0
3581
+                                : dialysisOrder.puncture_nurse
3582
+                            )
3583
+                          "
3584
+                          alt=""
3585
+                          srcset=""
3586
+                          v-else
3587
+                        />
3588
+                      </div>
3589
+
3590
+                      <div
3591
+                        class="under_line"
3592
+                        style="width: 90px; text-align: center"
3593
+                        v-if="org_id!=10644"
3594
+                      >
3595
+                        <span
3596
+                          style="height: 30px; display: inline-block"
3597
+                          v-if="
3598
+                            setAdminUserES(
3599
+                              dialysisOrder == null
3600
+                                ? 0
3601
+                                : dialysisOrder.puncture_nurse
3602
+                            ) == ''
3603
+                          "
3604
+                        >
3605
+                          {{
3606
+                            getAdminUser(
3607
+                              dialysisOrder == null
3608
+                                ? 0
3609
+                                : dialysisOrder.puncture_nurse
3610
+                            )
3611
+                          }}</span
3612
+                        >
3613
+                        <img
3614
+                          style="height: 35px"
3615
+                          :src="
3616
+                            setAdminUserES(
3617
+                              dialysisOrder == null
3618
+                                ? 0
3619
+                                : dialysisOrder.puncture_nurse
3620
+                            )
3621
+                          "
3622
+                          alt=""
3623
+                          srcset=""
3624
+                          v-else
3625
+                        />
3626
+                      </div>
3627
+                    </div>
3628
+                  </div>
3629
+
3630
+                  <div v-if="org_id==10440">
3508 3631
 
3509 3632
                     <div class="inline_block" style="flex: 1">
3510 3633
                      <div>

+ 15 - 7
src/xt_pages/outpatientCharges/listPrint.vue View File

@@ -14,12 +14,16 @@
14 14
     </template>
15 15
 
16 16
     <div class='dialysisPage' style="padding-top:40px;">
17
-      <printOne v-if=" org_id != 10106&&org_id != 10215&&org_id != 10265 && org_id!=9675 && org_id!=10485 &&org_id !=0 " :list="list" :patient="patient" :order="order" :admin="admin"></printOne>
17
+      
18
+      <listPrintforu v-if=" org_id != 10106&&org_id != 10215&&org_id != 10265 && org_id!=9675 && org_id!=10485 && org_id != 10191"
19
+        :list="list" :patient="patient" :order="order" :admin="admin">
20
+      </listPrintforu>
21
+      <printOne v-if="org_id == 10191" :list="list" :patient="patient" :order="order" :admin="admin"></printOne>
18 22
       <printTwo v-if="org_id == 10106 && this.paramsObj.balance_accounts_type != 2" :info="info" :order_infos="order_infos" :p_admin="p_admin" :charge_admin="charge_admin"></printTwo>
19 23
       <print-three v-if="org_id == 10106 && this.paramsObj.balance_accounts_type == 2" :info="info" :order_infos="order_infos" :p_admin="p_admin" :charge_admin="charge_admin"></print-three>
20 24
 <!--      <list-print-two v-if="org_id == 10215 || org_id==9675" :list="list" :patient="patient" :order="order" :admin="admin"></list-print-two>-->
21 25
      <list-print-three v-if="org_id == 10215 || org_id==9675  || org_id ==10485" :list="list" :patient="patient" :order="order" :admin="admin"></list-print-three>
22
-      <print-two10265  v-if="org_id == 10265 || org_id ==0 " :list="list" :patient="patient" :order="order" :admin="admin" :hospital_record="hospital_record"></print-two10265>
26
+      <print-two10265  v-if="org_id == 10265" :list="list" :patient="patient" :order="order" :admin="admin" :hospital_record="hospital_record"></print-two10265>
23 27
     </div>
24 28
   </div>
25 29
 </template>
@@ -36,16 +40,17 @@
36 40
   import ListPrintTwo from './listTemplate/listPrintTwo'
37 41
   import PrintTwo10265 from "./listTemplate/printTwo10265";
38 42
   import ListPrintThree from "./listTemplate/listPrintThree";
39
-
43
+  import listPrintforu from "./listTemplate/listPrintforu"
40 44
   export default {
41 45
     name: 'listPrint',
42 46
     components: {
47
+      listPrintforu,
43 48
       ListPrintThree,
44 49
       PrintTwo10265,
45 50
       ListPrintTwo,
46 51
       PrintThree,
47 52
       printOne,
48
-      printTwo
53
+      printTwo,
49 54
     },
50 55
     props: {
51 56
       paramsObj: Object
@@ -157,6 +162,8 @@
157 162
               console.log(this.list,'sssss')
158 163
 
159 164
             }else{
165
+              console.log('response.data.data',response.data.data);
166
+
160 167
               this.order = response.data.data.order
161 168
               this.patient = response.data.data.patient
162 169
               this.admin = response.data.data.admin_info
@@ -165,7 +172,8 @@
165 172
                 let obj = {
166 173
                   med_chrgitm_type: this.getType(infos.med_chrgitm_type),
167 174
                   price: infos.pric.toFixed(4),
168
-                  count: infos.cnt
175
+                  count: infos.cnt,
176
+                  selfpay_prop:infos.selfpay_prop,
169 177
                 }
170 178
                 if (infos.advice && infos.advice.id == 0 && infos.project && infos.project.id > 0) {
171 179
                   obj['p_time'] = this.getTimes(infos.project.prescription.ctime)
@@ -639,7 +647,7 @@
639 647
           }
640 648
         })
641 649
 
642
-      }, 
650
+      },
643 651
       getGoodUnit(id) {
644 652
         var goodUnit = this.$store.getters.good_unit
645 653
         for (let i = 0; i < goodUnit.length; i++) {
@@ -744,7 +752,7 @@
744 752
       //           }
745 753
       //           advice.push(adv)
746 754
       //         }
747
-              
755
+
748 756
       //         if(order_info[i].project.good_info.good_name !=''){
749 757
       //           const god={
750 758
       //             // advice_name:order_info[i].advice.advice_name,

+ 226 - 0
src/xt_pages/outpatientCharges/listTemplate/listPrintforu.vue View File

@@ -0,0 +1,226 @@
1
+<template>
2
+  <div id="list-print" class="list-print">
3
+      <div v-for='(i,index) in pageArr.length' :key="index" style="page-break-after: always;">
4
+        <div class="listTitle">{{$store.getters.xt_user.org.org_name}}费用清单</div>
5
+        <div class="listInfo">
6
+            <div>患者姓名:{{patient.name}}</div>
7
+            <div>性别:{{patient.gender == 1 ? '男': '女'}}</div>
8
+            <div>身份证号:{{patient.id_card_no}}</div>
9
+            <div>年龄:{{patient.age}}  岁</div>
10
+            <div>开方日期:{{getTimes(order.ctime)}}</div>
11
+        </div>
12
+        <div class="listInfo">
13
+            <div>结算类型:{{order.is_medicine_insurance == 1 ? "医保" : "自费"}}</div>
14
+            <div>就诊流水号:{{ order.mdtrt_id }}</div>
15
+            <div>透析号:{{patient.dialysis_no}}</div>
16
+            <div>发票号:{{order.fa_piao_number}}</div>
17
+        </div>
18
+        <div class="listInfo">
19
+            <div>总金额:{{ order.medfee_sumamt }}</div>
20
+            <div>个人支付金额:{{ order.psn_part_amt }}</div>
21
+            <div>基金支付金额:{{ order.fund_pay_sumamt }}</div>
22
+            <div>收费日期:{{getTimes(order.settle_accounts_date)}}</div>
23
+        </div>
24
+        
25
+        <table class="listTable" style="text-align: center;">
26
+            <tr style="border-bottom: 1px solid black;">
27
+              <td style="width:25%">医保编码</td>
28
+              <td style="width:25%">项目名称</td>
29
+              <td style="width:15%">规格</td>
30
+              <td style="width:5%">数量</td>
31
+              <td style="width:5%">单位</td>
32
+              <td style="width:8%">单价(元)</td>
33
+              <td style="width:8%">金额(元)</td>
34
+              <td style="width:8%">自负比例</td>
35
+            </tr>
36
+            <tr v-for="(item,index) in list" style="line-height: 30px;">
37
+                <!-- <template v-if="index == (list.length)-1">
38
+                    <tr style="border-bottom: 1px solid black;"></tr>
39
+                </template> -->
40
+                <td style="width:25%">{{item.code}}</td>
41
+                <td style="width:25%">{{item.name}}</td>
42
+                <td style="width:15%">{{item.spec}}</td>
43
+                <td style="width:5%">{{item.count}}</td>
44
+                <td style="width:5%">{{item.unit}}</td>
45
+                <td style="width:8%">{{(item.price*1).toFixed(2)}}</td>
46
+                <td style="width:8%">{{(item.price * item.count).toFixed(2)}}</td>
47
+                <td style="width:8%">
48
+                  {{(item.selfpay_prop)*100}}
49
+                  <span v-if="item.selfpay_prop !=''">%</span>
50
+                </td>
51
+            </tr>
52
+        </table>
53
+        <div style="border-top: 1px solid black;">
54
+          <div style="text-align: right;">
55
+            合计金额:{{order.medfee_sumamt}}
56
+          </div>
57
+        </div>
58
+      </div>
59
+  </div>
60
+</template>
61
+
62
+<script>
63
+import { uParseTime } from '@/utils/tools'
64
+
65
+export default {
66
+  props: {
67
+    list: {
68
+      type: Array,
69
+      default: function () {
70
+        return [];
71
+      }
72
+    },
73
+    patient: {
74
+      type: Object,
75
+      default: function () {
76
+        return {};
77
+      }
78
+    }, order: {
79
+      type: Object,
80
+      default: function () {
81
+        return {};
82
+      }
83
+    }, admin: {
84
+      type: Object,
85
+      default: function () {
86
+        return {};
87
+      }
88
+    },
89
+  },
90
+  data(){
91
+      return{
92
+          page:1,
93
+          pageArr:[],
94
+          org_id:'',
95
+          list:[]
96
+      }
97
+  },
98
+  // mounted(){
99
+  //     this.getPage()
100
+  // },
101
+  methods:{
102
+    getMedicineInsuranceKind(type){
103
+      switch (type) {
104
+        case "01":
105
+          return '甲类';
106
+        case "02":
107
+          return '乙类';
108
+        case "03":
109
+          return '自费';
110
+          break;
111
+      }
112
+
113
+    },
114
+    getNowTime: function () {
115
+      let dateTime
116
+      let yy = new Date().getFullYear()
117
+      let mm = new Date().getMonth() + 1
118
+      let dd = new Date().getDate()
119
+      let hh = new Date().getHours()
120
+      let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
121
+        :
122
+        new Date().getMinutes()
123
+      let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
124
+        :
125
+        new Date().getSeconds()
126
+      dateTime = yy + '-' + mm + '-' + dd
127
+      return dateTime
128
+    },
129
+    getTimes(time) {
130
+      return uParseTime(time, '{y}-{m}-{d}')
131
+    },
132
+    getPage(){
133
+
134
+      if(this.list.length <= 17){
135
+          this.page = 1
136
+          this.pageArr.push(this.list.length)
137
+      }else if(this.list.length > 17){
138
+          this.page = parseInt(this.list.length / 17)
139
+          let num = this.list.length % 17
140
+          for (var i=0;i<this.page;i++){
141
+              this.pageArr.push(17)
142
+          }
143
+          if(num != 0){
144
+              this.pageArr.push(num)
145
+          }
146
+      }
147
+      console.log('this.pageArr',this.list);
148
+    },
149
+    getlist(){
150
+      // if(this.list.length <= 17){
151
+          this.page = 1
152
+          this.pageArr.push(this.list.length)
153
+          console.log('this.pageArr',this.pageArr);
154
+      // }else if(this.list.length > 17){
155
+      //     this.page = parseInt(this.list.length / 17)
156
+      //     let num = this.list.length % 17
157
+      //     for (var i=0;i<this.page;i++){
158
+      //         this.pageArr.push(17)
159
+      //     }
160
+      //     if(num != 0){
161
+      //         this.pageArr.push(num)
162
+      //     }
163
+      // }
164
+    }
165
+  },
166
+  created(){
167
+   
168
+    this.org_id = this.$store.getters.xt_user.org_id
169
+  },
170
+  watch:{
171
+      list: {
172
+          handler(newVal) {
173
+            // this.list = newVal
174
+              this.getPage()
175
+              // this.getlist()
176
+          },
177
+          deep: true
178
+      }
179
+  }
180
+
181
+}
182
+
183
+
184
+</script>
185
+
186
+<style lang="scss" scoped>
187
+.list-print{
188
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
189
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
190
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
191
+  margin-bottom: 20px;
192
+  padding:20px 10px;
193
+}
194
+.listTitle{
195
+  font-size: 24px;
196
+  text-align: center;
197
+  font-weight: bold;
198
+  margin-bottom: 10px;
199
+}
200
+.listInfo{
201
+  display: flex;
202
+  font-size: 16px;
203
+  justify-content: space-between;
204
+  margin: 10px 0;
205
+}
206
+.listTable{
207
+  width: 100%;
208
+  text-align: center;
209
+  border-collapse: collapse;
210
+  line-height: 20px;
211
+  font-size: 14px;
212
+  border-color: #000;
213
+  text-align: left;
214
+}
215
+.listTable tr td {
216
+  padding: 0 5px;
217
+}
218
+.tableBottom{
219
+  font-size: 12px;
220
+  display: flex;
221
+  margin-top: 20px;
222
+}
223
+.tableBottomOne{
224
+  margin-right: 20px;
225
+}
226
+</style>

+ 14 - 5
src/xt_pages/outpatientCharges/statementTemplate/privateChargePrint.vue View File

@@ -10,7 +10,6 @@
10 10
     <div class="statementTitle" v-if="this.$store.getters.xt_user.org_id == 10489">湖北省社会医疗保险医疗费用结算单</div>
11 11
     <div class="statementTitle" v-if="this.$store.getters.xt_user.org_id == 10635 || this.$store.getters.xt_user.org_id == 0">河北省社会医疗保险医疗费用结算单</div>
12 12
 
13
-
14 13
     <div class="statementTitle" v-if="this.$store.getters.xt_user.org_id != 10489 && this.$store.getters.xt_user.org_id != 10515 &&
15 14
                   this.$store.getters.xt_user.org_id != 10375 && this.$store.getters.xt_user.org_id != 10188 &&
16 15
                   this.$store.getters.xt_user.org_id != 10217 &&this.$store.getters.xt_user.org_id != 10088 &&
@@ -72,11 +71,11 @@
72 71
 <!--        <td>{{getDay(info.his.in_hosptial_time.split(' ')[0] ,info.his.out_hosptial_time.split(' ')[0])}}</td>-->
73 72
 
74 73
         <td>入院日期</td>
75
-        <td></td>
74
+        <td>{{ getTime(info.settle_accounts_date) }}</td>
76 75
         <td>出院日期</td>
77
-        <td width="100"></td>
76
+        <td width="100">{{ getTime(info.settle_accounts_date) }}</td>
78 77
         <td>住院天数</td>
79
-        <td></td>
78
+        <td>0</td>
80 79
 
81 80
       </tr>
82 81
       <tr>
@@ -286,6 +285,7 @@
286 285
   </div>
287 286
 </template>
288 287
 <script>
288
+import { uParseTime } from '@/utils/tools'
289 289
 export default {
290 290
   props: {
291 291
     info: {
@@ -333,7 +333,16 @@ export default {
333 333
       dateTime = yy + '-' + mm + '-' + dd
334 334
       return dateTime
335 335
     },
336
-
336
+    getTime(val) {
337
+        if(val < 0){
338
+          return ""
339
+        }
340
+        if(val == ""){
341
+        return ""
342
+        }else {
343
+        return uParseTime(val, '{y}-{m}-{d}')
344
+        }
345
+    },
337 346
   }
338 347
 }
339 348
 

+ 10 - 20
src/xt_pages/outpatientDoctorStation/template/prineight.vue View File

@@ -603,7 +603,6 @@ export default{
603 603
               for(let x=j+1; x<advicess.length;x++){
604 604
                 if(advicess[j].groupno == advicess[x].groupno){
605 605
                   this.advicePrint[i].advices[j]['arr'].push(advicess.splice(x,1))
606
-                  // advicess.splice(x,1)
607 606
                   x--
608 607
                 }
609 608
               }
@@ -622,7 +621,6 @@ export default{
622 621
               );
623 622
             }
624 623
           }
625
-
626 624
           // console.log("处方222222", this.prescriptions);
627 625
           var hisPatient = response.data.data.hisPatient;
628 626
           console.log("hisPatient", hisPatient);
@@ -649,7 +647,9 @@ export default{
649 647
       getInitData().then((response) => {
650 648
         if (response.data.state == 1) {
651 649
           this.department = response.data.data.department;
652
-          this.diagnoses = response.data.data.diagnose;
650
+          // this.diagnoses = response.data.data.diagnose;
651
+          const diagnoses = response.data.data.diagnose;
652
+          this.diagnoses = diagnoses.reverse()
653 653
           console.log("争端", this.diagnoses);
654 654
         }
655 655
       });
@@ -664,7 +664,7 @@ export default{
664 664
       return name;
665 665
     },
666 666
     getTotalOne(id) {
667
-      console.log('999999999',this.prescriptions);
667
+      // console.log('999999999',this.prescriptions);
668 668
       var total = 0;
669 669
       var addtotal = 0;
670 670
       var zimuyao = 0;
@@ -699,7 +699,7 @@ export default{
699 699
       for (let i = 0; i < this.prescriptions.length; i++) {
700 700
         if (id == this.prescriptions[i].id) {
701 701
           if (this.prescriptions[i].advices != null) {
702
-            console.log('123456789',this.prescriptions[i].advices);
702
+            // console.log('123456789',this.prescriptions[i].advices);
703 703
             
704 704
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
705 705
               total =
@@ -713,18 +713,7 @@ export default{
713 713
                     this.prescriptions[i].advices[a].arr[b][0].price *
714 714
                     this.prescriptions[i].advices[a].arr[b][0].prescribing_number
715 715
                   }
716
-                //   if(this.prescriptions[i].advices[a].arr.length<2){
717
-                //     zimuyao = zimuyao +
718
-                //     this.prescriptions[i].advices[a].arr[0].price *
719
-                //     this.prescriptions[i].advices[a].arr[0].prescribing_number
720
-                //   }else{
721
-                //     const child = this.prescriptions[i].advices[a].arr
722
-                //     for(let i in child){
723
-                //       zimuyao = zimuyao +
724
-                //       child[i][0].price *
725
-                //       child[i][0].prescribing_number
726
-                //     }
727
-                //   }
716
+                
728 717
                 }
729 718
             }
730 719
           }
@@ -760,9 +749,10 @@ export default{
760 749
     getDiagnosis(id) {
761 750
       let arr = id.split(",");
762 751
       var name = "";
763
-      for (let i = 0; i < this.diagnoses.length; i++) {
764
-        if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
765
-          name += this.diagnoses[i].class_name + " ";
752
+      const diagnoses = this.diagnoses
753
+      for (let i = 0; i < diagnoses.length; i++) {
754
+        if (arr.indexOf(String(diagnoses[i].id)) > -1) {
755
+          name += diagnoses[i].class_name + " ";
766 756
         }
767 757
       }
768 758
       return name;

+ 3 - 3
src/xt_pages/outpatientTool/components/pdetail.vue View File

@@ -200,7 +200,7 @@ export default {
200 200
         let count = order.count
201 201
         let price = order.price.toFixed(2)
202 202
         let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
203
-        let total = order.total.toFixed(2)
203
+        let total = parseFloat(order.total).toFixed(2)
204 204
 
205 205
         let obj = {
206 206
           '患者姓名': name,
@@ -226,8 +226,8 @@ export default {
226 226
 
227 227
     },
228 228
     getCostType(type){
229
-      console.log(this.costClassifyList)
230
-      console.log(type)
229
+      // console.log(this.costClassifyList)
230
+      // console.log(type)
231 231
       var name = "";
232 232
       for (let i = 0; i < this.costClassifyList.length; i++) {
233 233
         if (type == this.costClassifyList[i].value) {

+ 10 - 1
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue View File

@@ -356,9 +356,15 @@
356 356
             </template>
357 357
           </el-table-column>
358 358
 
359
+          <el-table-column label="药品追溯码" width="150" align="center">
360
+            <template slot-scope="scope">
361
+              <el-input v-model="scope.row.drug_code"  placeholder="请输入药品追溯码"></el-input>
362
+            </template>
363
+          </el-table-column>
364
+
359 365
           <el-table-column label="备注" width="150" align="center">
360 366
             <template slot-scope="scope">
361
-              <el-input v-model="scope.row.remark"></el-input>
367
+              <el-input v-model="scope.row.remark"  placeholder="请输入备注"></el-input>
362 368
             </template>
363 369
           </el-table-column>
364 370
 
@@ -706,6 +712,7 @@ export default {
706 712
       tempObj["last_price"] = "";
707 713
       tempObj["count_unit"] = "";
708 714
       tempObj["min_number"] = "";
715
+      tempObj["drug_code"] = ""
709 716
       this.recordInfo.recordData.push(tempObj);
710 717
     },
711 718
     handleDelete: function (index, row) {
@@ -919,6 +926,7 @@ export default {
919 926
                 list[i].last_price = list[i].price
920 927
                 list[i].warehousing_count = list[i].warehousing_count.toString()
921 928
                 list[i].unitList = []
929
+                list[i].drug_code = list[i].drug_code
922 930
                 var obj = {id:1,name:""}
923 931
                 obj.name = list[i].drug.max_unit
924 932
                 var objOne = {id:2,name:""}
@@ -1178,6 +1186,7 @@ export default {
1178 1186
     tempObj["number"] = "";
1179 1187
     tempObj["count_unit"] = "";
1180 1188
     tempObj["min_number"] = "";
1189
+    tempObj["drug_code"] = ""
1181 1190
     this.recordInfo.recordData.push(tempObj);
1182 1191
 
1183 1192
     this.GetConfigInfo();

+ 14 - 1
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue View File

@@ -339,12 +339,20 @@
339 339
             </template>
340 340
           </el-table-column>
341 341
 
342
+          <el-table-column label="药品追溯码" width="150" align="center">
343
+            <template slot-scope="scope">
344
+              <el-input v-model="scope.row.drug_code"  placeholder="请输入药品追溯码" :disabled="disabled"></el-input>
345
+            </template>
346
+          </el-table-column>
347
+
342 348
           <el-table-column label="备注" width="150" align="center">
343 349
             <template slot-scope="scope">
344
-              <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
350
+              <el-input v-model="scope.row.remark"  placeholder="请输入备注" :disabled="disabled"></el-input>
345 351
             </template>
346 352
           </el-table-column>
347 353
 
354
+         
355
+
348 356
           <el-table-column
349 357
             label="操作"
350 358
             fixed="right"
@@ -618,6 +626,7 @@ export default {
618 626
       tempObj['retail_price'] = ""
619 627
       tempObj['drug_name'] = ""
620 628
       tempObj['manufacturer'] = ""
629
+      tempObj["drug_code"] = ""
621 630
       this.recordInfo.recordData.push(tempObj);
622 631
     },
623 632
     handleDelete: function(index, row) {
@@ -764,6 +773,8 @@ export default {
764 773
                 }
765 774
                 list[i].last_price = list[i].price
766 775
                 list[i].warehousing_count = list[i].warehousing_count.toString()
776
+
777
+                list[i].drug_code = list[i].drug_code
767 778
                 list[i].unitList = []
768 779
                 var obj = {id:1,name:""}
769 780
                 obj.name = list[i].drug.max_unit
@@ -829,6 +840,8 @@ export default {
829 840
 
830 841
             response.data.data.info[i].drug_type = response.data.data.info[i].drug.drug_type
831 842
 
843
+            response.data.data.info[i].drug_code = response.data.data.info[i].drug_code
844
+
832 845
            if(response.data.data.info[i].manufacturer == 0){
833 846
                response.data.data.info[i].manufacturer = ""
834 847
             }

+ 18 - 1
src/xt_pages/stock/selfPreparedMedicine/editWarehouseOut.vue View File

@@ -12,6 +12,7 @@
12 12
             size="small"
13 13
             type="primary"
14 14
             @click="submit()"
15
+            v-if="is_sys!=1 && is_check!=1"
15 16
             class="filter-item"
16 17
             >保 存</el-button
17 18
           >
@@ -36,7 +37,7 @@
36 37
       </div>
37 38
       <div class="app-container" v-loading="loading">
38 39
        
39
-        <div class="cell clearfix">
40
+        <div class="cell clearfix" v-if="is_sys == 0">
40 41
           <label class="title"
41 42
             ><span class="name"><span style="color: red">*</span>患者</span>
42 43
             :</label
@@ -637,6 +638,14 @@
637 638
         return name;
638 639
       },
639 640
       handleEdit: function (index, row) {
641
+        if(this.is_sys == 1){
642
+           this.$message.error("自动出库不能编辑!")
643
+           return
644
+        }
645
+        if(this.is_check == 1){
646
+           this.$message.error("自动出库不能编辑!")
647
+           return
648
+        }
640 649
         const tempObj = {};
641 650
         tempObj["id"] = 0;
642 651
         tempObj["drug_id"] = 0;
@@ -669,6 +678,14 @@
669 678
         this.recordInfo.recordData.push(tempObj);
670 679
       },
671 680
       handleDelete: function (index, row) {
681
+        if(this.is_sys == 1){
682
+         this.$message.error("自动出库不能删除!")
683
+         return
684
+        }
685
+        if(this.is_check == 1){
686
+          this.$message.error("已经审核不能删除!")
687
+          return
688
+        }
672 689
         if (this.recordInfo.recordData.length <= 1) {
673 690
           this.$message.error("只有一条记录的时候无法删除");
674 691
           return;

+ 0 - 8
src/xt_pages/stock/selfPreparedMedicine/newDrugQuery.vue View File

@@ -101,14 +101,6 @@
101 101
             >
102 102
               </el-pagination>
103 103
        </div>
104
-  
105
-  
106
-  
107
-   
108
-  
109
-  
110
-   
111
-  
112 104
     </div>
113 105
   </template>
114 106
   <script>

+ 2 - 2
src/xt_pages/stock/selfPreparedMedicine/warehouseInfo.vue View File

@@ -954,9 +954,9 @@ export default {
954 954
       },
955 955
       GetDrugTypeName(drug_type){
956 956
         var name = ""
957
-        console.log("drugTypeList---------------",this.drugTypeList)
957
+        // console.log("drugTypeList---------------",this.drugTypeList)
958 958
         for(let i=0;i<this.drugTypeList.length;i++){
959
-          if(drug_type == this.drugTypeList[i].value){
959
+          if(drug_type == this.drugTypeList[i].id){
960 960
              name = this.drugTypeList[i].name
961 961
           }
962 962
         }

+ 2 - 2
src/xt_pages/stock/selfPreparedMedicine/warehouseOut.vue View File

@@ -164,11 +164,11 @@
164 164
           </template>
165 165
         </el-table-column>
166 166
 
167
-        <el-table-column label="患者名称" align="center">
167
+        <!-- <el-table-column label="患者名称" align="center">
168 168
           <template slot-scope="scope">
169 169
              {{getPatientName(scope.row.patient_id)}}
170 170
           </template>
171
-        </el-table-column>
171
+        </el-table-column> -->
172 172
 
173 173
         <el-table-column label="制单人" align="center">
174 174
           <template slot-scope="scope">

+ 15 - 8
src/xt_pages/user/components/PatientSidebar.vue View File

@@ -179,7 +179,12 @@ export default {
179 179
             }, {
180 180
               name: '1-10',
181 181
               label: '出院小结'
182
-            }
182
+            },
183
+            // {
184
+            //   name: '1-12',
185
+            //   label: '转归记录'
186
+            // }
187
+
183 188
           ]
184 189
         },
185 190
         {
@@ -283,6 +288,7 @@ export default {
283 288
   },
284 289
   methods: {
285 290
     handleNodeClick(data) {
291
+      console.log("Data-----------",data.name)
286 292
       var name = data.name
287 293
       this.name = data.name
288 294
       window.sessionStorage.setItem('patientKey',data.name)
@@ -328,6 +334,8 @@ export default {
328 334
         this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
329 335
       } else if(name == '1-11'){
330 336
         this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
337
+      }else if(name == '1-12'){
338
+        this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
331 339
       } else if(name == '3-1'){
332 340
         this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
333 341
 
@@ -496,9 +504,9 @@ export default {
496 504
     }
497 505
   },
498 506
   created() {
499
-    var patientKey =  window.sessionStorage.getItem('patientKey')
507
+    var patientKey = window.sessionStorage.getItem('patientKey')
508
+    console.log("patient-----------------",patientKey)
500 509
     this.org_id = this.$store.getters.xt_user.template_info.org_id
501
-    console.log("patient",patientKey)
502 510
     var query = this.$route.path
503 511
     console.log("query",this.$route.path)
504 512
     if(patientKey){
@@ -519,11 +527,10 @@ export default {
519 527
           path: '/patients/patient/' + this.id + '/dryWeight'
520 528
         })
521 529
       }else if(patientKey == '1-11'){
522
-       this.$router.push({
523
-          path: '/patients/patient/' + this.id + '/firstDisease'
524
-        })
525
-      }
526
-       else if (patientKey == '1-5') {
530
+       this.$router.push({path: '/patients/patient/' + this.id + '/firstDisease'})
531
+      }else if(patientKey == '1-12'){
532
+        this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
533
+      }else if (patientKey == '1-5') {
527 534
         this.$router.push({ path: '/patients/rescue?id=' + this.id })
528 535
       } else if (patientKey == '2-1') {
529 536
         this.$router.push({

+ 445 - 0
src/xt_pages/user/lapsoSummary.vue View File

@@ -0,0 +1,445 @@
1
+<template>
2
+    <div class="patient-container">
3
+      <patient-sidebar :id="patientID" defaultActive="1-6" v-on:tran-patient="onTranPatient"></patient-sidebar>
4
+      <div class="patient-app-container advice-container app-container">
5
+        <div style="display:flex;justify-content: space-between;align-items: center;margin-bottom: 12px;">
6
+           <span style="font-weight:bold;">转归记录列表</span>
7
+           <el-button size="medium" type="primary" @click="dialogVisible =true">新增</el-button>
8
+        </div>
9
+        <el-table class="oictable" :data="tableData" border style="width:100%">
10
+        <el-table-column prop="start_time" label="建立日期" width="100" align="center">
11
+            <template slot-scope="scope">
12
+              <span>{{ getTime(scope.row.start_time)}}</span>
13
+            </template>
14
+       </el-table-column>
15
+        <el-table-column prop="blood_access_part_opera_id" label="血管通路" align="center" width="120">
16
+          <template slot-scope="scope">
17
+             <router-link
18
+                :to="'/patients/patient/' + scope.row.patient_id+'/vascularAccessDetail/'+scope.row.id"
19
+                style="color:#409eff;width:100%;display:block;"
20
+              >{{ scope.row.blood_access_part_opera_id }}
21
+              </router-link
22
+              >
23
+          </template>
24
+       </el-table-column>
25
+       <el-table-column prop="blood_access_part_id" label="血管通路部位" width="200" align="center">
26
+          <template slot-scope="scope">
27
+             <span>{{scope.row.blood_access_part_id}}</span>  
28
+          </template>
29
+       </el-table-column>
30
+        <el-table-column prop="inflow_pass" label="血管通路部位(其他)" width="100" align="center">
31
+           <template slot-scope="scope">
32
+              <span>{{scope.row.other_vascular}}</span>
33
+           </template>
34
+        </el-table-column>
35
+        <el-table-column prop="date" label="首次启用日期" width="120" align="center">
36
+            <template slot-scope="scope">
37
+              <span>{{ getTime(scope.row.first_start_time)}}</span>
38
+            </template>
39
+        </el-table-column>
40
+       
41
+         <el-table-column prop="date" label="停用日期" align="center" width="100">
42
+            <template slot-scope="scope">
43
+              <span v-if="scope.row.stop_time>0">{{ getTime(scope.row.stop_time)}}</span>
44
+               <span v-if="scope.row.stop_time<0"></span>
45
+            </template>
46
+        </el-table-column>
47
+         <el-table-column prop="date" label="停用原因" align="center" width="120">
48
+            <template slot-scope="scope">
49
+               <span>{{scope.row.stop_reason}}</span>
50
+            </template>
51
+        </el-table-column>
52
+         <el-table-column prop="date" label="使用寿命(天)" align="center" width="120">
53
+            <template slot-scope="scope">
54
+             <span v-if="scope.row.stop_time>0&&(scope.row.stop_time - scope.row.start_time)/86400 == 0"></span> 
55
+             <span v-if="scope.row.stop_time>0&&(scope.row.stop_time - scope.row.start_time)/86400 != 0">{{(scope.row.stop_time - scope.row.start_time)/86400}}</span>
56
+            </template>
57
+        </el-table-column>
58
+         
59
+        <el-table-column prop="date" label="导管感染转归" align="center" width="120">
60
+            <template slot-scope="scope">
61
+               <span v-if="scope.row.ci_type == 1">拔管</span>
62
+               <span v-if="scope.row.ci_type == 2">治愈</span>
63
+               <span v-if="scope.row.ci_type == 3">死亡</span>
64
+               <span v-if="scope.row.ci_type == 4">放弃</span>
65
+               <span v-if="scope.row.ci_type == 9">其它</span>
66
+            </template>
67
+        </el-table-column>
68
+         
69
+         <el-table-column prop="date" label="血培养检查结果" align="center" width="120">
70
+            <template slot-scope="scope">
71
+               <span v-if="scope.row.blood_cultupe == 0">阴性</span>
72
+               <span v-if="scope.row.blood_cultupe == 1">阳性</span>
73
+               <span v-if="scope.row.blood_cultupe == 9">未查</span>
74
+            </template>
75
+        </el-table-column>
76
+        
77
+       <el-table-column prop="date" label="患者导管转归类型" align="center" width="120">
78
+            <template slot-scope="scope">
79
+               <span v-if="scope.row.sequelae_type == 1">局部感染</span>
80
+               <span v-if="scope.row.sequelae_type == 2">静脉炎</span>
81
+               <span v-if="scope.row.sequelae_type == 3">导管细菌定植</span>
82
+               <span v-if="scope.row.sequelae_type == 4">导管相关血型感染</span>
83
+            </template>
84
+        </el-table-column>
85
+         <el-table-column prop="date" label="备注" align="center" width="180">
86
+            <template slot-scope="scope">
87
+               <span>{{scope.row.remark}}</span>
88
+            </template>
89
+        </el-table-column>
90
+        <el-table-column prop="date" label="创始人" align="center" width="100">
91
+            <template slot-scope="scope">
92
+              <span>{{getDoctor(scope.row.creator)}}</span>
93
+            </template>
94
+        </el-table-column>
95
+         <el-table-column prop="date" fixed="right" label="操作" width="140" align="center">
96
+            <template slot-scope="scope">
97
+               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
98
+                 <el-button
99
+                    type="primary"
100
+                    size="small"
101
+                    icon="el-icon-edit-outline"
102
+                   
103
+                    @click="handleUpdateAdviceTemplate(scope.row.id)"
104
+                    >
105
+                 </el-button>
106
+               </el-tooltip>
107
+                <el-tooltip class="item" effect="dark" content="删除" placement="top">
108
+                   <el-button
109
+                    size="small"
110
+                    type="danger"
111
+                    icon="el-icon-delete"
112
+                    @click="handleDeleteAdviceTemplate(scope.row.id, scope.$index)"
113
+                    >
114
+                   </el-button>
115
+                </el-tooltip>
116
+             </template>
117
+        </el-table-column>
118
+        </el-table>
119
+        <el-pagination
120
+          @size-change="handleSizeChange"
121
+          @current-change="handleCurrentChange"
122
+          :page-sizes="[10,20,50,100]"
123
+          :page-size="10"
124
+          background
125
+          style="margin-top:20px;"
126
+          align="right"
127
+          layout="total, sizes, prev, pager, next, jumper"
128
+          :total="total"></el-pagination>
129
+  
130
+        <el-dialog
131
+            title="新增"
132
+            :visible.sync="dialogVisible"
133
+            width="65%"
134
+            center>
135
+          <el-form label-width="150px" :model="form" ref="form" :rules="rules" >
136
+            <el-row  :gutter="24">
137
+              <el-col :span="24">
138
+                <el-form-item label="透析号:" >
139
+                    <el-input style="width:200px" v-model="dialysis_no"></el-input>
140
+                </el-form-item>
141
+                
142
+              </el-col>
143
+            </el-row>
144
+            <el-row  :gutter="24" >
145
+              <el-col :span="24">
146
+                 <el-form-item  label="姓名:">
147
+                    <el-input style="width:200px" v-model="name"></el-input>
148
+                 </el-form-item>
149
+              </el-col>
150
+            </el-row>
151
+            <el-row :gutter="24">
152
+                <el-col :span="24">
153
+                    <el-form-item label="转归类型:"  prop="access_project"  > 
154
+                        <el-radio-group style="padding: 10px;" v-model="lapse_type">
155
+                            <el-radio  label="1">转出</el-radio>
156
+                            <el-radio  label="2">院内转诊</el-radio>
157
+                      </el-radio-group>
158
+                    </el-form-item>
159
+                </el-col>
160
+            </el-row>
161
+
162
+            <el-row :gutter="24">
163
+                <el-col :span="24">
164
+                    <el-form-item label="转归分类:"  prop="access_project"  > 
165
+                        <el-radio-group style="padding: 10px;" v-model="lapse_class">
166
+                            <el-radio  label="1">终止透析</el-radio>
167
+                            <el-radio  label="2">转出院外</el-radio>
168
+                            <el-radio  label="3">回居住地透析</el-radio>
169
+                            <el-radio  label="4">临时透析</el-radio>
170
+                            <el-radio  label="5">转腹膜透析</el-radio>
171
+                            <el-radio  label="6">其他</el-radio>
172
+                            <el-radio  label="7">变更透析医院</el-radio>
173
+                      </el-radio-group>
174
+                    </el-form-item>
175
+                </el-col>
176
+            </el-row>
177
+
178
+            <el-row :gutter="24">
179
+                <el-col :span="24">
180
+                    <el-form-item label="转出原因:"  prop="access_project"> 
181
+                        <el-input style="width: 300px;height: 50px;"  type="textarea" v-model="lapse_reason"></el-input>
182
+                    </el-form-item>
183
+                </el-col>
184
+            </el-row>
185
+
186
+            <el-row :gutter="24">
187
+                <el-col :span="24">
188
+                    <el-form-item label="转出日期:"  prop="access_project"  > 
189
+                        <el-date-picker
190
+                            v-model="record_date"
191
+                            type="date"
192
+                            placeholder="选择日期">
193
+                         </el-date-picker>
194
+                    </el-form-item>
195
+                </el-col>
196
+            </el-row>
197
+
198
+            <el-row :gutter="24">
199
+                <el-col :span="24">
200
+                    <el-form-item label="操作人:"  prop="access_project"  > 
201
+                        <el-select v-model="admin_user_id" placeholder="请选择">
202
+                            <el-option
203
+                            v-for="item in options"
204
+                            :key="item.value"
205
+                            :label="item.label"
206
+                            :value="item.value">
207
+                            </el-option>
208
+                         </el-select>
209
+                    </el-form-item>
210
+                </el-col>
211
+            </el-row>
212
+
213
+            <el-row :gutter="24">
214
+                <el-col :span="24">
215
+                    <el-form-item label="备注:"  prop="access_project"  > 
216
+                        <el-input style="width: 300px;height: 50px;" type="textarea" v-model="remark"></el-input>
217
+                    </el-form-item>
218
+                </el-col>
219
+            </el-row>
220
+           
221
+          </el-form>
222
+  
223
+        <span slot="footer" class="dialog-footer">
224
+            <el-button @click="dialogVisible = false">取 消</el-button>
225
+            <el-button type="primary" @click="saveVasularAccess('form')">保存</el-button>
226
+        </span>
227
+        </el-dialog>
228
+  
229
+      </div>
230
+  
231
+       <!-- <multi-select-box
232
+          :propsForm="InnerDialogProps"
233
+          v-on:dialog-comfirm="innerDialogComfirm"
234
+          v-on:dialog-cancle="innerDialogCancle"
235
+        ></multi-select-box> -->
236
+        
237
+    </div>
238
+  </template>
239
+  <script>
240
+    const moment = require('moment')
241
+    import PatientSidebar from './components/PatientSidebar'
242
+    import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
243
+    import { saveVasularAccess,getAllVascularAccessList,getVascularAccessByDetail,updatedVasularAccess,DeleteVascularAccess,getAccessList } from '@/api/patient'
244
+  
245
+    import { jsGetAge, uParseTime } from '@/utils/tools'
246
+    import { getDataConfig } from '@/utils/data'
247
+    import multiSelectBox from '../dialysis/details/dialog/MultiSelectBox'
248
+    import sitemap from './Sitemap'
249
+    export default {
250
+      name: 'doctorAdvice',
251
+      components: {
252
+        PatientSidebar,
253
+        multiSelectBox,
254
+        sitemap
255
+      },
256
+      data() {
257
+        return {
258
+          tableData: [],
259
+          nowtime: moment(new Date()).format('YYYY-MM-DD'),
260
+          page: 1,
261
+          limit: 10,
262
+          total: 0,
263
+          rules: {
264
+            start_time: [{ required: true, message: '请输入建立日期' }],
265
+            access_project: [{ required: true, message: '请选择通路项目' }],
266
+            blood_access_part_opera_id:[{required:true,message:'请选择血管通路类型'}],
267
+            blood_access_part_id:[{required:true,message:"请选择血管通路"}],
268
+           //  first_start_time:[{required:true,message:"请选择首次启用日期"}],
269
+            user_status:[{required:true,message:"请选择使用状态"}]
270
+          },
271
+          dialogVisible:false,
272
+          editDialogVisible:false,
273
+          form:{
274
+           id:0,
275
+           access_project:"1",
276
+           blood_access_part_id:"",
277
+           blood_access_part_opera_id:"",
278
+           inflow_pass:"",
279
+           start_time:moment(new Date()).format('YYYY-MM-DD'),
280
+           first_start_time:moment(new Date()).format('YYYY-MM-DD'),
281
+           stop_reason:"",
282
+           user_status:1,
283
+           remark:"",
284
+           stop_time:"",
285
+           other_vascular:"",
286
+           ci_type:"",//导管感染转归
287
+           blood_cultupe:"", //血培养检查结果
288
+           sequelae_type:"",//患者导管转归类型
289
+          },
290
+          options:[
291
+           {id:1,name:"启用"},
292
+           {id:2,name:"停用"},
293
+           {id:3,name:"备用"}
294
+          ],
295
+          optionsPass:[
296
+            {id:1,name:"流入-动脉"},
297
+            {id:2,name:"流出-静脉"},
298
+          ],
299
+  
300
+          blood_access_part_opera:[],
301
+          blood_access_part:[],
302
+          show:false,
303
+          doctorList:[],
304
+          InnerDialogProps: {
305
+            values: [],
306
+            visibility: false,
307
+            isShowTextArea: true,
308
+            customContent: '',
309
+            titles: '',
310
+            type: '' // 不同弹框类型,用来匹配数据
311
+          },
312
+          new_blood_access_part_opera:[],
313
+          new_blood_access_part:[],
314
+         // 导管感染类型
315
+          optionsOne:[
316
+             {id:1,name:"局部感染"},
317
+             {id:2,name:"静脉炎"},
318
+             {id:3,name:"导管细菌定植"},
319
+             {id:4,name:"导管相关血型感染"},
320
+          ],
321
+        //   导管转归类型
322
+          optionsTwo:[
323
+             {id:1,name:"拔管"},
324
+             {id:2,name:"治愈"},
325
+             {id:3,name:"死亡"},
326
+             {id:4,name:"放弃"},
327
+             {id:9,name:"其它"},
328
+          ],
329
+        //  血培养检查结果
330
+          optionsThree:[
331
+             {id:0,name:"阴性"},
332
+             {id:1,name:"阳性"},
333
+             {id:9,name:"未查"}
334
+          ],
335
+          showOne:false,
336
+          name:"",
337
+          dialysis_no:"",
338
+          lapse_type:"",
339
+          lapse_class:"",
340
+          lapse_reason:"",
341
+          record_date:"",
342
+          admin_user_id:"",
343
+          remark:""
344
+        }
345
+      },
346
+      methods: {
347
+        clickuseradvicecell(row, column, cell, event) {
348
+        },
349
+        onTranPatient: function(tranPatient) {
350
+          this.currentPatient = tranPatient
351
+        },
352
+        CreateTime(time) {
353
+          return uParseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
354
+        },
355
+     
356
+       
357
+      
358
+       
359
+        handleSizeChange(limit) {
360
+          this.limit = limit
361
+          this.getlist()
362
+        },
363
+        handleCurrentChange(page) {
364
+          this.page = page
365
+        
366
+          this.getlist()
367
+        },
368
+        changeStatus(val){
369
+          if(val == 1 ){
370
+            this.show = false
371
+          }
372
+          if(val == 2){
373
+            this.show = true
374
+          }
375
+        },
376
+       getTime(val) {
377
+           if(val < 0){
378
+             return ""
379
+           }
380
+           if(val == ""){
381
+            return ""
382
+           }else {
383
+            return uParseTime(val, '{y}-{m}-{d}')
384
+           }
385
+        },
386
+     
387
+       getDoctor(id){
388
+         var name = ""
389
+         for(let i=0;i<this.doctorList.length;i++){
390
+            if(id == this.doctorList[i].admin_user_id){
391
+               name = this.doctorList[i].user_name
392
+            }
393
+         }
394
+         return name
395
+       },
396
+       handleDeleteAdviceTemplate(id,index){
397
+         this.$confirm("确认删除吗?", "删除", {
398
+          confirmButtonText: "确 定",
399
+          cancelButtonText: "取 消",
400
+          type: "warning"
401
+        })
402
+          .then(() => {
403
+            DeleteVascularAccess(id).then(response => {
404
+              if(response.data.state == 1){
405
+                var msg = response.data.data.msg
406
+                this.tableData.splice(index, 1);
407
+                this.$message.success("删除成功!")
408
+              }
409
+               
410
+              
411
+            });
412
+          })
413
+          .catch(() => {});
414
+       },
415
+       getlist(){
416
+            
417
+       }
418
+     
419
+  
420
+     
421
+      },
422
+      created() {
423
+        const id = this.$route.params && this.$route.params.id
424
+        this.patientID = parseInt(id)
425
+        this.getAllPatient()
426
+        this.getlist()
427
+      },
428
+     
429
+    }
430
+  </script>
431
+  
432
+  <style>
433
+    .oictable ::-webkit-scrollbar {
434
+      height: 15px;
435
+    }
436
+  </style>
437
+  
438
+  <style rel="stylesheet/scss" lang="scss">
439
+     ::-webkit-scrollbar{
440
+        height:15px;
441
+     }
442
+  
443
+  </style>
444
+  
445
+  

+ 13 - 13
src/xt_permission.js View File

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