|
@@ -0,0 +1,698 @@
|
|
1
|
+<template>
|
|
2
|
+
|
|
3
|
+ <div class="prescriptionTable">
|
|
4
|
+ <el-table v-if="prescription.advices && prescription.advices.length > 0" :data="prescription.advices" border
|
|
5
|
+ style="width: 99%;" :row-style="{ color: '#303133' }"
|
|
6
|
+ :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
|
|
7
|
+ <el-table-column align="center" width="70" label="序号">
|
|
8
|
+ <template slot-scope="scope">
|
|
9
|
+ <div style="display:flex;align-items:center;">
|
|
10
|
+ <el-input v-model="scope.row.groupno" placeholder=""></el-input>
|
|
11
|
+ </div>
|
|
12
|
+ </template>
|
|
13
|
+ </el-table-column>
|
|
14
|
+ <el-table-column align="center" prop="drug_name" label="名称">
|
|
15
|
+ <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span>
|
|
16
|
+ </template>
|
|
17
|
+ </el-table-column>
|
|
18
|
+
|
|
19
|
+ <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
|
|
20
|
+ <template slot-scope="scope">
|
|
21
|
+ <div style="display:flex;align-items:center;">
|
|
22
|
+ <el-input v-model="scope.row.single_dose" @input="getAllChange(scope)"
|
|
23
|
+ style="width:50%;"></el-input>
|
|
24
|
+ <!-- <div>{{scope.row.single_dose_unit}}</div> -->
|
|
25
|
+ <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
|
|
26
|
+ @change="getAllChange(scope)">
|
|
27
|
+ <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
|
|
28
|
+ <el-option :label="scope.row.drug.dose_unit"
|
|
29
|
+ v-if="scope.row.drug.dose_unit != scope.row.drug.min_unit"
|
|
30
|
+ :value="scope.row.drug.dose_unit"></el-option>
|
|
31
|
+ </el-select>
|
|
32
|
+ </div>
|
|
33
|
+ </template>
|
|
34
|
+ </el-table-column>
|
|
35
|
+ <el-table-column align="center" prop="delivery_way" width="100" label="用法">
|
|
36
|
+ <template slot-scope="scope">
|
|
37
|
+ <el-select v-model="scope.row.delivery_way" placeholder="请选择">
|
|
38
|
+ <el-option
|
|
39
|
+ v-for="(item,index) in drugways"
|
|
40
|
+ :key="index"
|
|
41
|
+ :label="item.name"
|
|
42
|
+ :value="item.name">
|
|
43
|
+ </el-option>
|
|
44
|
+ </el-select>
|
|
45
|
+ </template>
|
|
46
|
+ </el-table-column>
|
|
47
|
+ <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
|
|
48
|
+ <template slot-scope="scope">
|
|
49
|
+ <el-select v-model="scope.row.execution_frequency" placehold er="请选择" @change="getAllChange(scope)">
|
|
50
|
+ <el-option
|
|
51
|
+ v-for="item,index in efs"
|
|
52
|
+ :key="index"
|
|
53
|
+ :label="item.name"
|
|
54
|
+ :value="item.name">
|
|
55
|
+ </el-option>
|
|
56
|
+ </el-select>
|
|
57
|
+ </template>
|
|
58
|
+ </el-table-column>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+ <el-table-column align="center" prop="day" width="70" label="天数">
|
|
62
|
+ <template slot-scope="scope">
|
|
63
|
+ <div style="display:flex;align-items:center;">
|
|
64
|
+ <el-input v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>
|
|
65
|
+ {{'天'}}
|
|
66
|
+ </div>
|
|
67
|
+ </template>
|
|
68
|
+ </el-table-column>
|
|
69
|
+
|
|
70
|
+ <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
|
|
71
|
+ <template slot-scope="scope">
|
|
72
|
+ <div style="display:flex;align-items:center;">
|
|
73
|
+ <el-input v-model="scope.row.prescribing_number" style="width:50%"
|
|
74
|
+ @input="changePrescribingNumber(scope)" placeholder=""></el-input>
|
|
75
|
+ <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
|
|
76
|
+ <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
|
|
77
|
+ @change="getAllChange(scope)">
|
|
78
|
+ <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
|
|
79
|
+ <el-option :label="scope.row.drug.max_unit"
|
|
80
|
+ v-if="scope.row.drug.min_unit != scope.row.drug.max_unit"
|
|
81
|
+ :value="scope.row.drug.max_unit"></el-option>
|
|
82
|
+ </el-select>
|
|
83
|
+ </div>
|
|
84
|
+ </template>
|
|
85
|
+ </el-table-column>
|
|
86
|
+ <el-table-column align="center" prop="retail_price" width="80" label="单价">
|
|
87
|
+ <template slot-scope="scope">
|
|
88
|
+ <div style="display:flex;align-items:center;">
|
|
89
|
+ <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
|
|
90
|
+ <div>{{'元'}}</div>
|
|
91
|
+ </div>
|
|
92
|
+
|
|
93
|
+ </template>
|
|
94
|
+ </el-table-column>
|
|
95
|
+ <el-table-column align="center" prop="remark" width="50" label="备注">
|
|
96
|
+ <template slot-scope="scope">
|
|
97
|
+ <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
|
|
98
|
+ </template>
|
|
99
|
+ </el-table-column>
|
|
100
|
+
|
|
101
|
+ <el-table-column align="center" prop="remark" width="50" label="推送频率">
|
|
102
|
+ <template slot-scope="scope">
|
|
103
|
+ <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
|
|
104
|
+ <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
|
|
105
|
+ <div v-if="scope.row.frequency_type == 3">{{scope.row.week_day}}</div>
|
|
106
|
+
|
|
107
|
+ </template>
|
|
108
|
+ </el-table-column>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+ <el-table-column align="center" width="100" prop="name" label="操作">
|
|
112
|
+ <template slot-scope="scope">
|
|
113
|
+ <!--<i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>-->
|
|
114
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row,scope.$index)">推送</el-button>
|
|
115
|
+ <el-button size="mini" type="danger" @click="deleteDrug(scope.row,scope.$index)">删除</el-button>
|
|
116
|
+ </template>
|
|
117
|
+ </el-table-column>
|
|
118
|
+ </el-table>
|
|
119
|
+
|
|
120
|
+ <el-table v-if="prescription.project &&prescription.project.length > 0" :data="prescription.project" border
|
|
121
|
+ style="width: 99%;" :row-style="{ color: '#303133' }"
|
|
122
|
+ :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
|
|
123
|
+ <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
|
|
124
|
+ <el-table-column align="center" prop="project_name" label="名称">
|
|
125
|
+ <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span>
|
|
126
|
+ </template>
|
|
127
|
+ </el-table-column>
|
|
128
|
+ <el-table-column align="center" prop="statistical_classification" width="100" label="组">
|
|
129
|
+ <template slot-scope="scope">{{scope.row.type ==
|
|
130
|
+ 2?getGroup(scope.row.statistical_classification):'耗材'}}
|
|
131
|
+ </template>
|
|
132
|
+ </el-table-column>
|
|
133
|
+ <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
|
|
134
|
+ <template slot-scope="scope">
|
|
135
|
+ <div style="display:flex;align-items:center;">
|
|
136
|
+ <el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)"
|
|
137
|
+ placeholder=""></el-input>
|
|
138
|
+ <div>{{scope.row.unit}}</div>
|
|
139
|
+ </div>
|
|
140
|
+
|
|
141
|
+ </template>
|
|
142
|
+ </el-table-column>
|
|
143
|
+ <el-table-column align="center" prop="delivery_way" width="80" label="用法">
|
|
144
|
+ <template slot-scope="scope">
|
|
145
|
+ <el-autocomplete
|
|
146
|
+ style="width:100%;"
|
|
147
|
+ class="inline-input"
|
|
148
|
+ v-model="scope.row.delivery_way"
|
|
149
|
+ :fetch-suggestions="querySearch2"
|
|
150
|
+ placeholder="请输入内容"
|
|
151
|
+ ></el-autocomplete>
|
|
152
|
+ </template>
|
|
153
|
+ </el-table-column>
|
|
154
|
+ <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
|
|
155
|
+ <template slot-scope="scope">
|
|
156
|
+ <el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>
|
|
157
|
+ </template>
|
|
158
|
+ </el-table-column>
|
|
159
|
+ <el-table-column align="center" prop="number_days" width="70" label="天数">
|
|
160
|
+ <template slot-scope="scope">
|
|
161
|
+ <div style="display:flex;align-items:center;">
|
|
162
|
+ <el-input v-model="scope.row.number_days" @input="getProjectDay(scope)"
|
|
163
|
+ placeholder=""></el-input>
|
|
164
|
+ <div>{{'天'}}</div>
|
|
165
|
+ </div>
|
|
166
|
+ </template>
|
|
167
|
+ </el-table-column>
|
|
168
|
+ <el-table-column align="center" prop="total" width="70" label="总量">
|
|
169
|
+ <template slot-scope="scope">
|
|
170
|
+ <div style="display:flex;align-items:center;">
|
|
171
|
+ <el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>
|
|
172
|
+ <div>{{scope.row.unit}}</div>
|
|
173
|
+
|
|
174
|
+ </div>
|
|
175
|
+ </template>
|
|
176
|
+ </el-table-column>
|
|
177
|
+ <el-table-column align="center" prop="name" width="70" label="单价">
|
|
178
|
+ <template slot-scope="scope">
|
|
179
|
+ <div style="display:flex;align-items:center;">
|
|
180
|
+ <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
|
|
181
|
+ <div>{{'元'}}</div>
|
|
182
|
+ </div>
|
|
183
|
+
|
|
184
|
+ </template>
|
|
185
|
+ </el-table-column>
|
|
186
|
+ <el-table-column align="center" prop="name" width="50" label="备注">
|
|
187
|
+ <template slot-scope="scope">
|
|
188
|
+ <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
|
|
189
|
+ </template>
|
|
190
|
+ </el-table-column>
|
|
191
|
+ <el-table-column align="center" prop="remark" width="70" label="推送频率">
|
|
192
|
+ <template slot-scope="scope">
|
|
193
|
+ <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
|
|
194
|
+ <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
|
|
195
|
+ <div v-if="scope.row.frequency_type == 3">{{scope.row.week_day}}</div>
|
|
196
|
+
|
|
197
|
+ </template>
|
|
198
|
+ </el-table-column>
|
|
199
|
+ <el-table-column align="center" width="140" prop="name" label="操作">
|
|
200
|
+ <template slot-scope="scope">
|
|
201
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row,scope.$index)">推送</el-button>
|
|
202
|
+ <el-button size="mini" type="danger" @click="deleteProject(scope.row,scope.$index)">删除
|
|
203
|
+ </el-button>
|
|
204
|
+ <!--<i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>-->
|
|
205
|
+ <!--<button class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)">删除</>-->
|
|
206
|
+
|
|
207
|
+ </template>
|
|
208
|
+ </el-table-column>
|
|
209
|
+ </el-table>
|
|
210
|
+
|
|
211
|
+ <div class="additionalBox">
|
|
212
|
+ <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
|
|
213
|
+ <span :title="item.item_name">{{item.item_name}}</span>
|
|
214
|
+ <el-input v-model="item.price" placeholder="" style="width:50px;"></el-input>
|
|
215
|
+ 共
|
|
216
|
+ <el-input v-model="item.count" placeholder="" style="width:50px;"></el-input>
|
|
217
|
+ 次
|
|
218
|
+ <i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>
|
|
219
|
+ </div>
|
|
220
|
+ </div>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+ <div>
|
|
224
|
+ <el-dialog title="推送频率设置" :visible.sync="templateFormVisible" width="854px">
|
|
225
|
+ <el-form
|
|
226
|
+ ref="templateForm"
|
|
227
|
+ label-width="90px"
|
|
228
|
+ >
|
|
229
|
+ <el-row>
|
|
230
|
+ <el-col :span="24" >
|
|
231
|
+ <el-form-item label="周期提醒 :">
|
|
232
|
+ <el-radio-group v-model="frequency_type">
|
|
233
|
+ <el-radio :label="1">每次必推</el-radio>
|
|
234
|
+ <el-radio :label="2">天数频率</el-radio>
|
|
235
|
+ <el-radio :label="3">星期频率</el-radio>
|
|
236
|
+ </el-radio-group>
|
|
237
|
+ </el-form-item>
|
|
238
|
+ </el-col>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+ <el-col :span="12" v-if="frequency_type == 2">
|
|
242
|
+ <el-form-item prop="day_count">
|
|
243
|
+ <el-input style="width: 50px" v-model="day_count"></el-input>
|
|
244
|
+ 天/一次
|
|
245
|
+ </el-form-item>
|
|
246
|
+ </el-col>
|
|
247
|
+
|
|
248
|
+ <el-col :span="24" v-if="frequency_type == 3">
|
|
249
|
+ <el-form-item prop="weekday">
|
|
250
|
+ <el-checkbox-group v-model="week_days">
|
|
251
|
+ <el-checkbox label="周一" name="周一" key="1">周一</el-checkbox>
|
|
252
|
+ <el-checkbox label="周二" name="周二" key="2">周二</el-checkbox>
|
|
253
|
+ <el-checkbox label="周三" name="周三" key="3">周三</el-checkbox>
|
|
254
|
+ <el-checkbox label="周四" name="周四" key="4">周四</el-checkbox>
|
|
255
|
+ <el-checkbox label="周五" name="周五" key="5">周五</el-checkbox>
|
|
256
|
+ <el-checkbox label="周六" name="周六" key="6">周六</el-checkbox>
|
|
257
|
+ <el-checkbox label="周日" name="周日" key="7">周日</el-checkbox>
|
|
258
|
+ </el-checkbox-group>
|
|
259
|
+ </el-form-item>
|
|
260
|
+ </el-col>
|
|
261
|
+
|
|
262
|
+ </el-row>
|
|
263
|
+ </el-form>
|
|
264
|
+ <div slot="footer" class="dialog-footer">
|
|
265
|
+ <el-button @click="templateFormVisible = false">取消</el-button>
|
|
266
|
+ <el-button type="primary" @click="submitTemplate()">保 存</el-button>
|
|
267
|
+ </div>
|
|
268
|
+ </el-dialog>
|
|
269
|
+ </div>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+ </div>
|
|
273
|
+</template>
|
|
274
|
+
|
|
275
|
+<script>
|
|
276
|
+ import { getDictionaryDataConfig } from '@/utils/data'
|
|
277
|
+ import { delHisAddition, delHisAdvice, delHisProject, getInitData } from '@/api/his/his'
|
|
278
|
+ import { delHisModePrescriptionAdviceTemplate, delHisModePrescriptionProjectTemplate } from '@/api/his/his_config'
|
|
279
|
+
|
|
280
|
+ export default {
|
|
281
|
+ props: {
|
|
282
|
+ preDrugs: Array,
|
|
283
|
+ activeType: Number,
|
|
284
|
+ addtions_charge: Array,
|
|
285
|
+ prescription: {
|
|
286
|
+ type: Object,
|
|
287
|
+ default: function() {
|
|
288
|
+ return {
|
|
289
|
+ name: '',
|
|
290
|
+ advices: [],
|
|
291
|
+ project: [],
|
|
292
|
+ drugways: [],
|
|
293
|
+ efs: []
|
|
294
|
+ }
|
|
295
|
+ }
|
|
296
|
+ }
|
|
297
|
+ },
|
|
298
|
+ data() {
|
|
299
|
+ return {
|
|
300
|
+ week_days: [],
|
|
301
|
+
|
|
302
|
+ current_row: null,
|
|
303
|
+ current_index: 0,
|
|
304
|
+ templateFormVisible: false,
|
|
305
|
+ frequency_type: 1,
|
|
306
|
+ day_count: 0,
|
|
307
|
+ advices: [],
|
|
308
|
+ tableData: [],
|
|
309
|
+ newoptions: [{
|
|
310
|
+ value: '1',
|
|
311
|
+ label: '1'
|
|
312
|
+ }, {
|
|
313
|
+ value: '2',
|
|
314
|
+ label: '2'
|
|
315
|
+ }, {
|
|
316
|
+ value: '3',
|
|
317
|
+ label: '3'
|
|
318
|
+ }, {
|
|
319
|
+ value: '4',
|
|
320
|
+ label: '4'
|
|
321
|
+ }, {
|
|
322
|
+ value: '5',
|
|
323
|
+ label: '5'
|
|
324
|
+ }],
|
|
325
|
+ value: '1',
|
|
326
|
+ input: 1
|
|
327
|
+ }
|
|
328
|
+ },
|
|
329
|
+
|
|
330
|
+ methods: {
|
|
331
|
+ submitTemplate() {
|
|
332
|
+ console.log(this.current_index)
|
|
333
|
+
|
|
334
|
+ console.log( this.prescription.project[this.current_index])
|
|
335
|
+ if (this.prescription.advices && this.prescription.advices.length > 0 && this.prescription.project && this.prescription.project.length == 0) {
|
|
336
|
+ this.prescription.advices[this.current_index].frequency_type = this.frequency_type
|
|
337
|
+ this.prescription.advices[this.current_index].day_count = this.day_count
|
|
338
|
+ this.prescription.advices[this.current_index].week_day = this.week_days.join(",")
|
|
339
|
+
|
|
340
|
+ }
|
|
341
|
+
|
|
342
|
+ if (this.prescription.advices && this.prescription.advices.length == 0 && this.prescription.project && this.prescription.project.length > 0) {
|
|
343
|
+ this.prescription.project[this.current_index].frequency_type = this.frequency_type
|
|
344
|
+ this.prescription.project[this.current_index].day_count = this.day_count
|
|
345
|
+ this.prescription.project[this.current_index].week_day =this.week_days.join(",")
|
|
346
|
+ }
|
|
347
|
+ this.templateFormVisible = false
|
|
348
|
+ },
|
|
349
|
+ handleEdit(row, index) {
|
|
350
|
+ this.current_row = row
|
|
351
|
+ this.current_index = index
|
|
352
|
+ this.frequency_type = this.current_row.frequency_type
|
|
353
|
+ this.day_count = this.current_row.day_count
|
|
354
|
+ this.week_days = this.current_row.week_day.split(",")
|
|
355
|
+ this.templateFormVisible = true
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+ },
|
|
359
|
+ createFilter(queryString) {
|
|
360
|
+ return (restaurant) => {
|
|
361
|
+ return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
|
362
|
+ }
|
|
363
|
+ },
|
|
364
|
+ querySearch2(queryString, cb) {
|
|
365
|
+ var restaurants = this.getDictionaryDataConfig('system', 'project_use')
|
|
366
|
+ restaurants.map(item => {
|
|
367
|
+ item.value = item.name
|
|
368
|
+ })
|
|
369
|
+ var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
|
|
370
|
+ // 调用 callback 返回建议列表的数据
|
|
371
|
+ cb(results)
|
|
372
|
+ },
|
|
373
|
+ delAddition(index, addition) {
|
|
374
|
+ this.$confirm('附加费删除后不可恢复,是否确认删除', '删除', {
|
|
375
|
+ confirmButtonText: '确 定',
|
|
376
|
+ cancelButtonText: '取 消',
|
|
377
|
+ type: 'warning'
|
|
378
|
+ }).then(() => {
|
|
379
|
+ this.$nextTick(function() {
|
|
380
|
+ if (addition.id == 0) {
|
|
381
|
+ this.prescription.addition.splice(index, 1)
|
|
382
|
+ } else {
|
|
383
|
+ let params = {
|
|
384
|
+ 'id': addition.id
|
|
385
|
+ }
|
|
386
|
+ delHisAddition(params).then(response => {
|
|
387
|
+ if (response.data.state == 0) {
|
|
388
|
+ this.$message.error(response.data.msg)
|
|
389
|
+ return false
|
|
390
|
+ } else {
|
|
391
|
+ var temp2 = this.deepClone(this.prescription.addition)
|
|
392
|
+ temp2.splice(index, 1)
|
|
393
|
+ this.prescription.addition = temp2
|
|
394
|
+ this.$message.success(response.data.data.msg)
|
|
395
|
+ }
|
|
396
|
+ })
|
|
397
|
+ }
|
|
398
|
+ })
|
|
399
|
+
|
|
400
|
+ })
|
|
401
|
+ .catch(() => {
|
|
402
|
+ })
|
|
403
|
+
|
|
404
|
+ },
|
|
405
|
+ getInitData() {
|
|
406
|
+ getInitData().then(response => {
|
|
407
|
+ if (response.data.state == 0) {
|
|
408
|
+ this.$message.error(response.data.msg)
|
|
409
|
+ return false
|
|
410
|
+ } else {
|
|
411
|
+ this.drugways = response.data.data.drugways
|
|
412
|
+ this.efs = response.data.data.efs
|
|
413
|
+ }
|
|
414
|
+ })
|
|
415
|
+
|
|
416
|
+ },
|
|
417
|
+ deleteDrug: function(row, index) {
|
|
418
|
+
|
|
419
|
+ this.$confirm('药品删除后不可恢复,是否确认删除', '删除', {
|
|
420
|
+ confirmButtonText: '确 定',
|
|
421
|
+ cancelButtonText: '取 消',
|
|
422
|
+ type: 'warning'
|
|
423
|
+ }).then(() => {
|
|
424
|
+ this.$nextTick(function() {
|
|
425
|
+ if (row.advice_id == 0) {
|
|
426
|
+ this.prescription.advices.splice(index, 1)
|
|
427
|
+ } else {
|
|
428
|
+ let params = {
|
|
429
|
+ 'id': row.advice_id
|
|
430
|
+ }
|
|
431
|
+ console.log(row)
|
|
432
|
+
|
|
433
|
+ console.log(params)
|
|
434
|
+ delHisModePrescriptionAdviceTemplate(params).then(response => {
|
|
435
|
+ if (response.data.state == 0) {
|
|
436
|
+ this.$message.error(response.data.msg)
|
|
437
|
+ return false
|
|
438
|
+ } else {
|
|
439
|
+ var temp2 = this.deepClone(this.prescription.advices)
|
|
440
|
+ temp2.splice(index, 1)
|
|
441
|
+ this.prescription.advices = temp2
|
|
442
|
+ this.$message.success(response.data.data.msg)
|
|
443
|
+ }
|
|
444
|
+ })
|
|
445
|
+
|
|
446
|
+ }
|
|
447
|
+
|
|
448
|
+ })
|
|
449
|
+
|
|
450
|
+ })
|
|
451
|
+ .catch(() => {
|
|
452
|
+ })
|
|
453
|
+
|
|
454
|
+ }, deepClone(source) {
|
|
455
|
+ if (!source && typeof source !== 'object') {
|
|
456
|
+ throw new Error('error arguments', 'shallowClone')
|
|
457
|
+ }
|
|
458
|
+ const targetObj = source.constructor === Array ? [] : {}
|
|
459
|
+ Object.keys(source).forEach((keys) => {
|
|
460
|
+ if (source[keys] && typeof source[keys] === 'object') {
|
|
461
|
+ targetObj[keys] = this.deepClone(source[keys])
|
|
462
|
+ } else {
|
|
463
|
+ targetObj[keys] = source[keys]
|
|
464
|
+ }
|
|
465
|
+ })
|
|
466
|
+ return targetObj
|
|
467
|
+ },
|
|
468
|
+
|
|
469
|
+ setNewData: function(data) {
|
|
470
|
+ this.prescription = data
|
|
471
|
+
|
|
472
|
+ // this.prescription.advices = data.advices
|
|
473
|
+ },
|
|
474
|
+ getDictionaryDataConfig(module, filed_name) {
|
|
475
|
+ return getDictionaryDataConfig(module, filed_name)
|
|
476
|
+ },
|
|
477
|
+ getGroup(id) {
|
|
478
|
+ var name = ''
|
|
479
|
+ var statistics_category = getDictionaryDataConfig('system', 'statistics_category')
|
|
480
|
+ console.log('2235', statistics_category)
|
|
481
|
+ for (let i = 0; i < statistics_category.length; i++) {
|
|
482
|
+ if (id == statistics_category[i].id) {
|
|
483
|
+ name = statistics_category[i].name
|
|
484
|
+ }
|
|
485
|
+ }
|
|
486
|
+ return name
|
|
487
|
+ },
|
|
488
|
+ deleteProject(row, i) {
|
|
489
|
+ if (this.prescription.order_status == 2) {
|
|
490
|
+ this.$message.error('该处方已经结算,无法删除')
|
|
491
|
+ return
|
|
492
|
+ }
|
|
493
|
+ this.$confirm('项目删除后不可恢复,是否确认删除', '删除', {
|
|
494
|
+ confirmButtonText: '确 定',
|
|
495
|
+ cancelButtonText: '取 消',
|
|
496
|
+ type: 'warning'
|
|
497
|
+ }).then(() => {
|
|
498
|
+ if (row.id == 0) {
|
|
499
|
+ this.prescription.project.splice(i, 1)
|
|
500
|
+
|
|
501
|
+ } else {
|
|
502
|
+ let params = {
|
|
503
|
+ 'id': row.id
|
|
504
|
+ }
|
|
505
|
+ delHisModePrescriptionProjectTemplate(params).then(response => {
|
|
506
|
+ if (response.data.state == 0) {
|
|
507
|
+ this.$message.error(response.data.msg)
|
|
508
|
+ return false
|
|
509
|
+ } else {
|
|
510
|
+ for (let i = 0; i < this.prescription.project.length; i++) {
|
|
511
|
+ if (this.prescription.project[i].id == row.id) {
|
|
512
|
+ this.prescription.project.splice(i, 1)
|
|
513
|
+ }
|
|
514
|
+ }
|
|
515
|
+ this.$message.success(response.data.data.msg)
|
|
516
|
+ }
|
|
517
|
+ })
|
|
518
|
+ }
|
|
519
|
+ })
|
|
520
|
+ .catch(() => {
|
|
521
|
+ })
|
|
522
|
+
|
|
523
|
+ },
|
|
524
|
+ getAllChange(scope) {
|
|
525
|
+ if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
|
|
526
|
+ if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
|
527
|
+ console.log(1)
|
|
528
|
+ scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
|
|
529
|
+ } else {
|
|
530
|
+ console.log(12)
|
|
531
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number)
|
|
532
|
+ }
|
|
533
|
+ } else {
|
|
534
|
+ if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
|
535
|
+ console.log(123)
|
|
536
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose)
|
|
537
|
+ } else {
|
|
538
|
+ console.log(1234)
|
|
539
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose / scope.row.drug.min_number)
|
|
540
|
+ }
|
|
541
|
+ }
|
|
542
|
+ if (scope.row.prescribing_number == 0) {
|
|
543
|
+ scope.row.prescribing_number = 1
|
|
544
|
+ }
|
|
545
|
+ // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
546
|
+ // // scope.row.retail_price = scope.row.drug.min_price * scope.row.prescribing_number
|
|
547
|
+ // if(scope.row.prescribing_number > scope.row.drug.total){
|
|
548
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
549
|
+ // }
|
|
550
|
+ // }else{
|
|
551
|
+ // if((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total){
|
|
552
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
553
|
+ // }
|
|
554
|
+ // // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
|
|
555
|
+ // }
|
|
556
|
+
|
|
557
|
+ },
|
|
558
|
+ changePrescribingNumber(scope) {
|
|
559
|
+ // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
560
|
+ // if(parseInt(scope.row.prescribing_number) > scope.row.drug.total){
|
|
561
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
562
|
+ // }
|
|
563
|
+ // }else{
|
|
564
|
+ // if((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total){
|
|
565
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
566
|
+ // }
|
|
567
|
+ // }
|
|
568
|
+ }, getAllChange(scope) {
|
|
569
|
+ if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
|
|
570
|
+ if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
|
571
|
+ console.log(1)
|
|
572
|
+ scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
|
|
573
|
+ } else {
|
|
574
|
+ console.log(12)
|
|
575
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.drug.min_number)
|
|
576
|
+ }
|
|
577
|
+ } else {
|
|
578
|
+ if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
|
579
|
+ console.log(123)
|
|
580
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.drug.dose)
|
|
581
|
+ } else {
|
|
582
|
+ console.log(1234)
|
|
583
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.drug.dose / scope.row.drug.min_number)
|
|
584
|
+ }
|
|
585
|
+ }
|
|
586
|
+ if (scope.row.prescribing_number == 0) {
|
|
587
|
+ scope.row.prescribing_number = 1
|
|
588
|
+ }
|
|
589
|
+ if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
|
590
|
+ // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
|
|
591
|
+ if (scope.row.prescribing_number > scope.row.drug.total) {
|
|
592
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
593
|
+ }
|
|
594
|
+ } else {
|
|
595
|
+ if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
|
|
596
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
597
|
+ }
|
|
598
|
+ // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
|
|
599
|
+ }
|
|
600
|
+
|
|
601
|
+ },
|
|
602
|
+
|
|
603
|
+ getSingleDose(scope) {
|
|
604
|
+ this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
|
|
605
|
+ },
|
|
606
|
+ getDay(scope) {
|
|
607
|
+ this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
|
|
608
|
+ },
|
|
609
|
+ getProjectSingleDose(scope) {
|
|
610
|
+ this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
|
|
611
|
+ if (this.prescription.project[scope.$index].total == 0) {
|
|
612
|
+ this.prescription.project[scope.$index].total = 1
|
|
613
|
+ }
|
|
614
|
+ },
|
|
615
|
+ getProjectDay(scope) {
|
|
616
|
+ this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
|
|
617
|
+ if (this.prescription.project[scope.$index].total == 0) {
|
|
618
|
+ this.prescription.project[scope.$index].total = 1
|
|
619
|
+ }
|
|
620
|
+ }
|
|
621
|
+ }, mounted() {
|
|
622
|
+ this.getInitData()
|
|
623
|
+
|
|
624
|
+ },
|
|
625
|
+ watch: {
|
|
626
|
+ // "prescription.advices":{
|
|
627
|
+ // handler(newVal,oldVal){
|
|
628
|
+ // newVal.map(item => {
|
|
629
|
+ // item.prescribing_number = item.single_dose * item.day
|
|
630
|
+ // if(item.single_dose != oldVal[index].single_dose || item.number_days != oldVal[index].number_days){
|
|
631
|
+ // item.total = item.single_dose * item.number_days
|
|
632
|
+ // }
|
|
633
|
+
|
|
634
|
+ // })
|
|
635
|
+ // },
|
|
636
|
+ // deep:true
|
|
637
|
+ // },
|
|
638
|
+ // "prescription.project":{
|
|
639
|
+ // handler(newVal,oldVal){
|
|
640
|
+ // newVal.map((item,index) => {
|
|
641
|
+ // if(item.single_dose != oldVal[index].single_dose || item.number_days != oldVal[index].number_days){
|
|
642
|
+ // item.total = item.single_dose * item.number_days
|
|
643
|
+ // }
|
|
644
|
+
|
|
645
|
+ // })
|
|
646
|
+ // },
|
|
647
|
+ // deep:true
|
|
648
|
+ // }
|
|
649
|
+ }
|
|
650
|
+
|
|
651
|
+ }
|
|
652
|
+</script>
|
|
653
|
+
|
|
654
|
+<style lang="scss">
|
|
655
|
+ .prescriptionTable {
|
|
656
|
+
|
|
657
|
+ .el-input__inner {
|
|
658
|
+ padding: 0 5px;
|
|
659
|
+ }
|
|
660
|
+
|
|
661
|
+ .additionalBox {
|
|
662
|
+ margin-top: 20px;
|
|
663
|
+ display: flex;
|
|
664
|
+ flex-wrap: wrap;
|
|
665
|
+
|
|
666
|
+ .additionalOne {
|
|
667
|
+ margin-right: 20px;
|
|
668
|
+ margin-bottom: 10px;
|
|
669
|
+ display: flex;
|
|
670
|
+ align-items: center;
|
|
671
|
+
|
|
672
|
+ > span {
|
|
673
|
+ white-space: nowrap;
|
|
674
|
+ overflow: hidden;
|
|
675
|
+ text-overflow: ellipsis;
|
|
676
|
+ width: 80px;
|
|
677
|
+ display: inline-block;
|
|
678
|
+ font-size: 14px;
|
|
679
|
+ }
|
|
680
|
+
|
|
681
|
+ }
|
|
682
|
+ .deleteIcon {
|
|
683
|
+ color: red;
|
|
684
|
+ margin-left: 5px;
|
|
685
|
+ }
|
|
686
|
+
|
|
687
|
+ }
|
|
688
|
+ .el-table th .cell, .el-table td .cell {
|
|
689
|
+ padding: 0 2px;
|
|
690
|
+ white-space: pre-line;
|
|
691
|
+ }
|
|
692
|
+
|
|
693
|
+ .el-icon-delete {
|
|
694
|
+ color: red;
|
|
695
|
+ }
|
|
696
|
+
|
|
697
|
+ }
|
|
698
|
+</style>
|