Browse Source

住院费用美化

huangyw 3 years ago
parent
commit
9d223a2c0b
1 changed files with 228 additions and 124 deletions
  1. 228 124
      src/xt_pages/hospitalStation/components/settlePrescriptionTable.vue

+ 228 - 124
src/xt_pages/hospitalStation/components/settlePrescriptionTable.vue View File

@@ -1,54 +1,85 @@
1 1
 <template>
2 2
   <div class="prescriptionTable">
3
-    <el-table v-if="prescription.type == 1" :data="prescription.advices" border style="width: 99%;"
4
-              :row-style="{ color: '#303133' }"
5
-              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
6
-      <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
3
+    <el-table
4
+      v-if="prescription.type == 1"
5
+      :data="prescription.advices"
6
+      border
7
+      style="width: 99%"
8
+      :row-style="changColor"
9
+      :header-cell-style="{
10
+        backgroundColor: 'rgb(245, 247, 250)',
11
+        color: '#606266',
12
+      }"
13
+      highlight-current-row
14
+    >
15
+      <el-table-column
16
+        align="center"
17
+        type="index"
18
+        width="40"
19
+        label="序号"
20
+      ></el-table-column>
7 21
       <el-table-column align="center" prop="name" label="名称">
8
-        <template slot-scope="scope"><span :title='scope.row.drug_name'>{{ scope.row.drug_name }}</span></template>
22
+        <template slot-scope="scope"
23
+          ><span :title="scope.row.drug_name">{{
24
+            scope.row.drug_name
25
+          }}</span></template
26
+        >
9 27
       </el-table-column>
10 28
 
11 29
       <el-table-column align="center" prop="name" width="90" label="单次用量">
12 30
         <template slot-scope="scope">
13 31
           <!--<el-input v-model="scope.row.single_dose" readonly style="width:65%;"></el-input>-->
14
-          <div>{{scope.row.single_dose}}&nbsp;&nbsp;{{scope.row.single_dose_unit}}</div>
32
+          <div>
33
+            {{ scope.row.single_dose }}&nbsp;&nbsp;{{
34
+              scope.row.single_dose_unit
35
+            }}
36
+          </div>
15 37
         </template>
16 38
       </el-table-column>
17 39
       <el-table-column align="center" prop="name" width="100" label="用法">
18 40
         <template slot-scope="scope">
19 41
           <!--<el-input v-model="scope.row.delivery_way" readonly></el-input>-->
20
-          <div> {{scope.row.delivery_way}}</div>
21
-
42
+          <div>{{ scope.row.delivery_way }}</div>
22 43
         </template>
23 44
       </el-table-column>
24 45
       <el-table-column align="center" prop="name" width="100" label="频率">
25 46
         <template slot-scope="scope">
26
-          <div> {{scope.row.execution_frequency}}</div>
47
+          <div>{{ scope.row.execution_frequency }}</div>
27 48
 
28 49
           <!--<el-input v-model="scope.row.execution_frequency" readonly></el-input>-->
29 50
         </template>
30 51
       </el-table-column>
31 52
 
32 53
       <el-table-column align="center" prop="day" width="50" label="天数">
33
-        <template slot-scope="scope">{{scope.row.day}}天</template>
54
+        <template slot-scope="scope">{{ scope.row.day }}天</template>
34 55
       </el-table-column>
35 56
 
36 57
       <el-table-column align="center" prop="name" width="100" label="总量">
37 58
         <template slot-scope="scope">
38 59
           <!--<el-input v-model="scope.row.prescribing_number" style="width:60%" readonly placeholder=""></el-input>-->
39
-          <div>{{scope.row.prescribing_number}}&nbsp;&nbsp;{{scope.row.prescribing_number_unit}}</div>
60
+          <div>
61
+            {{ scope.row.prescribing_number }}&nbsp;&nbsp;{{
62
+              scope.row.prescribing_number_unit
63
+            }}
64
+          </div>
40 65
         </template>
41 66
       </el-table-column>
42 67
       <el-table-column align="center" prop="name" width="60" label="单价">
43 68
         <template slot-scope="scope">
44
-          <div> {{scope.row.retail_price}}元</div>
69
+          <div>{{ scope.row.retail_price }}元</div>
45 70
 
46 71
           <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
47 72
         </template>
48 73
       </el-table-column>
49 74
       <el-table-column align="center" prop="name" width="60" label="总价">
50 75
         <template slot-scope="scope">
51
-          <div> {{(scope.row.prescribing_number * scope.row.retail_price).toFixed(2)}}元</div>
76
+          <div>
77
+            {{
78
+              (scope.row.prescribing_number * scope.row.retail_price).toFixed(
79
+                2
80
+              )
81
+            }}元
82
+          </div>
52 83
 
53 84
           <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
54 85
         </template>
@@ -56,98 +87,137 @@
56 87
 
57 88
       <el-table-column align="center" prop="name" width="60" label="全自费金额">
58 89
         <template slot-scope="scope">
59
-          <div> {{scope.row.fulamt_ownpay_amt}}元</div>
90
+          <div>{{ scope.row.fulamt_ownpay_amt }}元</div>
60 91
         </template>
61 92
       </el-table-column>
62 93
 
63
-
64
-
65 94
       <el-table-column align="center" prop="name" width="60" label="超限价金额">
66 95
         <template slot-scope="scope">
67
-          <div> {{scope.row.overlmt_amt}}元</div>
96
+          <div>{{ scope.row.overlmt_amt }}元</div>
68 97
         </template>
69 98
       </el-table-column>
70 99
 
71
-
72
-      <el-table-column align="center" prop="name" width="60" label="先行自付金额">
100
+      <el-table-column
101
+        align="center"
102
+        prop="name"
103
+        width="60"
104
+        label="先行自付金额"
105
+      >
73 106
         <template slot-scope="scope">
74
-          <div> {{scope.row.preselfpay_amt}}元</div>
107
+          <div>{{ scope.row.preselfpay_amt }}元</div>
75 108
         </template>
76 109
       </el-table-column>
77 110
 
78
-
79
-      <el-table-column align="center" prop="name" width="60" label="符合正常范围金额">
111
+      <el-table-column
112
+        align="center"
113
+        prop="name"
114
+        width="60"
115
+        label="符合正常范围金额"
116
+      >
80 117
         <template slot-scope="scope">
81
-          <div> {{scope.row.inscp_scp_amt}}元</div>
118
+          <div>{{ scope.row.inscp_scp_amt }}元</div>
82 119
         </template>
83 120
       </el-table-column>
84 121
 
85
-
86
-
87
-
88 122
       <el-table-column align="center" prop="name" width="50" label="备注">
89 123
         <template slot-scope="scope">
90 124
           <!--<el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>-->
91
-          <div> {{scope.row.remark}}</div>
125
+          <div>{{ scope.row.remark }}</div>
92 126
         </template>
93 127
       </el-table-column>
94 128
     </el-table>
95
-    <el-table v-if="prescription.type == 2" :data="prescription.project" border style="width: 99%;"
96
-              :row-style="{ color: '#303133' }"
97
-              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
98
-      <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
129
+    <el-table
130
+      v-if="prescription.type == 2"
131
+      :data="prescription.project"
132
+      border
133
+      style="width: 99%"
134
+      :row-style="changColor"
135
+      :header-cell-style="{
136
+        backgroundColor: 'rgb(245, 247, 250)',
137
+        color: '#606266',
138
+      }"
139
+      highlight-current-row
140
+    >
141
+      <el-table-column
142
+        align="center"
143
+        type="index"
144
+        width="40"
145
+        label="序号"
146
+      ></el-table-column>
99 147
       <el-table-column align="center" prop="project_name" label="名称">
100 148
         <template slot-scope="scope">{{ scope.row.project_name }}</template>
101 149
       </el-table-column>
102
-      <el-table-column align="center" prop="statistical_classification" width="100" label="组">
103
-        <template slot-scope="scope">{{getGroup(scope.row.statistical_classification)}}</template>
150
+      <el-table-column
151
+        align="center"
152
+        prop="statistical_classification"
153
+        width="100"
154
+        label="组"
155
+      >
156
+        <template slot-scope="scope">{{
157
+          getGroup(scope.row.statistical_classification)
158
+        }}</template>
104 159
       </el-table-column>
105
-      <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
106
-        <template slot-scope="scope">{{scope.row.single_dose}}{{scope.row.unit}}</template>
107
-
160
+      <el-table-column
161
+        align="center"
162
+        prop="single_dose"
163
+        width="80"
164
+        label="单次用量"
165
+      >
166
+        <template slot-scope="scope"
167
+          >{{ scope.row.single_dose }}{{ scope.row.unit }}</template
168
+        >
108 169
       </el-table-column>
109
-      <el-table-column align="center" prop="delivery_way" width="80" label="用法">
170
+      <el-table-column
171
+        align="center"
172
+        prop="delivery_way"
173
+        width="80"
174
+        label="用法"
175
+      >
110 176
         <template slot-scope="scope">
111 177
           <!--<el-input v-model="scope.row.delivery_way" placeholder="" readonly></el-input>-->
112
-          {{scope.row.delivery_way}}
113
-
178
+          {{ scope.row.delivery_way }}
114 179
         </template>
115 180
       </el-table-column>
116
-      <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
181
+      <el-table-column
182
+        align="center"
183
+        prop="execution_frequency"
184
+        width="80"
185
+        label="频率"
186
+      >
117 187
         <template slot-scope="scope">
118 188
           <!--<el-input v-model="scope.row.execution_frequency" placeholder="" readonly></el-input>-->
119
-          {{scope.row.execution_frequency}}
120
-
189
+          {{ scope.row.execution_frequency }}
121 190
         </template>
122 191
       </el-table-column>
123
-      <el-table-column align="center" prop="number_days" width="50" label="天数">
192
+      <el-table-column
193
+        align="center"
194
+        prop="number_days"
195
+        width="50"
196
+        label="天数"
197
+      >
124 198
         <template slot-scope="scope">
125 199
           <!--<el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>-->
126
-          {{scope.row.number_days}}天
127
-
200
+          {{ scope.row.number_days }}天
128 201
         </template>
129
-
130 202
       </el-table-column>
131 203
       <el-table-column align="center" prop="total" width="50" label="总量">
132 204
         <template slot-scope="scope">
133
-          <div style="display:flex;">
205
+          <div style="display: flex">
134 206
             <!--<el-input v-model="scope.row.total" placeholder="" readonly></el-input>-->
135
-            {{scope.row.total}} {{scope.row.unit}}
136
-
207
+            {{ scope.row.total }} {{ scope.row.unit }}
137 208
           </div>
138 209
         </template>
139 210
       </el-table-column>
140 211
       <el-table-column align="center" prop="name" width="50" label="单价">
141 212
         <template slot-scope="scope">
142 213
           <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
143
-          {{scope.row.price}}元
144
-
214
+          {{ scope.row.price }}元
145 215
         </template>
146 216
       </el-table-column>
147 217
 
148 218
       <el-table-column align="center" prop="name" width="60" label="总价">
149 219
         <template slot-scope="scope">
150
-          <div> {{(scope.row.total * scope.row.price).toFixed(2)}}元</div>
220
+          <div>{{ (scope.row.total * scope.row.price).toFixed(2) }}元</div>
151 221
 
152 222
           <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
153 223
         </template>
@@ -155,49 +225,66 @@
155 225
 
156 226
       <el-table-column align="center" prop="name" width="60" label="全自费金额">
157 227
         <template slot-scope="scope">
158
-          <div> {{scope.row.fulamt_ownpay_amt}}元</div>
228
+          <div>{{ scope.row.fulamt_ownpay_amt }}元</div>
159 229
         </template>
160 230
       </el-table-column>
161 231
 
162
-
163
-
164 232
       <el-table-column align="center" prop="name" width="60" label="超限价金额">
165 233
         <template slot-scope="scope">
166
-          <div> {{scope.row.overlmt_amt}}元</div>
234
+          <div>{{ scope.row.overlmt_amt }}元</div>
167 235
         </template>
168 236
       </el-table-column>
169 237
 
170
-
171
-      <el-table-column align="center" prop="name" width="60" label="先行自付金额">
238
+      <el-table-column
239
+        align="center"
240
+        prop="name"
241
+        width="60"
242
+        label="先行自付金额"
243
+      >
172 244
         <template slot-scope="scope">
173
-          <div> {{scope.row.preselfpay_amt}}元</div>
245
+          <div>{{ scope.row.preselfpay_amt }}元</div>
174 246
         </template>
175 247
       </el-table-column>
176 248
 
177
-
178
-      <el-table-column align="center" prop="name" width="60" label="符合正常范围金额">
249
+      <el-table-column
250
+        align="center"
251
+        prop="name"
252
+        width="60"
253
+        label="符合正常范围金额"
254
+      >
179 255
         <template slot-scope="scope">
180
-          <div> {{scope.row.inscp_scp_amt}}元</div>
256
+          <div>{{ scope.row.inscp_scp_amt }}元</div>
181 257
         </template>
182 258
       </el-table-column>
183 259
 
184
-
185
-
186 260
       <el-table-column align="center" prop="name" width="50" label="备注">
187 261
         <template slot-scope="scope">
188 262
           <!--<el-input v-model="scope.row.remark" readonly></el-input>-->
189
-          {{scope.row.remark}}
190
-
263
+          {{ scope.row.remark }}
191 264
         </template>
192 265
       </el-table-column>
193 266
     </el-table>
194 267
 
195 268
     <div class="additionalBox">
196
-      <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
197
-        <span :title="item.item_name">{{item.item_name}}</span>
198
-        <el-input v-model="item.price" placeholder="" style="width:50px;" readonly></el-input>
269
+      <div
270
+        class="additionalOne"
271
+        v-for="(item, index) in prescription.addition"
272
+        :key="index"
273
+      >
274
+        <span :title="item.item_name">{{ item.item_name }}</span>
275
+        <el-input
276
+          v-model="item.price"
277
+          placeholder=""
278
+          style="width: 50px"
279
+          readonly
280
+        ></el-input>
199 281
200
-        <el-input v-model="item.count" placeholder="" style="width:50px;" readonly></el-input>
282
+        <el-input
283
+          v-model="item.count"
284
+          placeholder=""
285
+          style="width: 50px"
286
+          readonly
287
+        ></el-input>
201 288
202 289
         <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
203 290
       </div>
@@ -206,79 +293,96 @@
206 293
 </template>
207 294
 
208 295
 <script>
209
-import { getInitData } from '@/api/his/his'
210
-import { getDictionaryDataConfig} from "@/utils/data";
296
+import { getInitData } from "@/api/his/his";
297
+import { getDictionaryDataConfig } from "@/utils/data";
211 298
 
212 299
 export default {
213 300
   props: {
214
-    prescription: Object
301
+    prescription: Object,
215 302
   },
216 303
   data() {
217 304
     return {
218 305
       drugways: [],
219
-      efs: []
220
-    }
221
-  }, mounted() {
222
-    getInitData().then(response => {
306
+      efs: [],
307
+    };
308
+  },
309
+  mounted() {
310
+    getInitData().then((response) => {
223 311
       if (response.data.state == 0) {
224 312
         this.$message.error(response.data.msg);
225
-        return false
313
+        return false;
226 314
       } else {
227 315
         this.drugways = response.data.data.drugways;
228
-        this.efs = response.data.data.efs
316
+        this.efs = response.data.data.efs;
229 317
       }
230
-    })
231
-  }, methods:  {
232
-
318
+    });
319
+  },
320
+  methods: {
321
+    changColor({ row, rowIndex }) {
322
+      if (rowIndex % 2 == 1) {
323
+        // 变颜色的条件
324
+        return {
325
+          backgroundColor: "#C4E1FF",
326
+          color: "#303133", // 这个return的就是样式 可以是color 也可以是backgroundColor
327
+        };
328
+      } else {
329
+        return {
330
+          backgroundColor: "#ACD6FF",
331
+          color: "#303133",
332
+        };
333
+      }
334
+    },
233 335
 
234
-    getGroup(id){
336
+    getGroup(id) {
235 337
       var name = "";
236
-      var statistics_category =  getDictionaryDataConfig('system','statistics_category');
237
-      console.log("2235",statistics_category);
238
-      for(let i=0;i<statistics_category.length;i++){
239
-        if(id == statistics_category[i].id){
240
-          name = statistics_category[i].name
338
+      var statistics_category = getDictionaryDataConfig(
339
+        "system",
340
+        "statistics_category"
341
+      );
342
+      console.log("2235", statistics_category);
343
+      for (let i = 0; i < statistics_category.length; i++) {
344
+        if (id == statistics_category[i].id) {
345
+          name = statistics_category[i].name;
241 346
         }
242 347
       }
243
-      return name
348
+      return name;
244 349
     },
245
-
246
-
247
-  }
248
-}
350
+  },
351
+};
249 352
 </script>
250 353
 
251 354
 <style lang="scss">
252
-.prescriptionTable{
253
-.additionalBox{
254
-  margin-top: 20px;
255
-  display: flex;
256
-  flex-wrap: wrap;
257
-.additionalOne{
258
-  margin-right:20px;
259
-  margin-bottom:10px;
260
-  display: flex;
261
-  align-items: center;
262
->span{
263
-  white-space: nowrap;
264
-  overflow: hidden;
265
-  text-overflow: ellipsis;
266
-  width:80px;
267
-  display: inline-block;
268
-  font-size: 14px;
269
-}
270
-}
271
-.deleteIcon{
272
-  color:red;
273
-  margin-left:5px;
274
-}
275
-}
276
-.el-table th .cell, .el-table td .cell{
277
-  padding: 0 2px;
278
-  white-space: pre-line;
279
-}
280
-.el-icon-delete{
281
-  color:red;
282
-}
355
+.prescriptionTable {
356
+  .additionalBox {
357
+    margin-top: 20px;
358
+    display: flex;
359
+    flex-wrap: wrap;
360
+    .additionalOne {
361
+      margin-right: 20px;
362
+      margin-bottom: 10px;
363
+      display: flex;
364
+      align-items: center;
365
+      > span {
366
+        white-space: nowrap;
367
+        overflow: hidden;
368
+        text-overflow: ellipsis;
369
+        width: 80px;
370
+        display: inline-block;
371
+        font-size: 14px;
372
+      }
373
+    }
374
+    .deleteIcon {
375
+      color: red;
376
+      margin-left: 5px;
377
+    }
378
+  }
379
+  .el-table th .cell,
380
+  .el-table td .cell {
381
+    padding: 0 2px;
382
+    white-space: pre-line;
383
+  }
384
+  .el-icon-delete {
385
+    color: red;
386
+  }
283 387
 }
284 388
 </style>