|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<el-dialog
|
3
|
3
|
:title="formTitle"
|
4
|
|
- width="900px"
|
|
4
|
+ width="1200px"
|
5
|
5
|
:visible.sync="visible"
|
6
|
6
|
:before-close="_close"
|
7
|
7
|
>
|
|
@@ -56,61 +56,228 @@
|
56
|
56
|
<el-option
|
57
|
57
|
v-for="item,index in projectList"
|
58
|
58
|
:key="index"
|
59
|
|
- :label="item.project_name"
|
|
59
|
+ :label="item.type == 1 ? item.drug_name : item.project_name"
|
60
|
60
|
:value="item.new_id">
|
61
|
61
|
</el-option>
|
62
|
62
|
</el-select>
|
63
|
63
|
|
64
|
64
|
</el-form-item>
|
65
|
|
- <el-form-item label="数量" style="width:50%;">
|
|
65
|
+ <el-form-item label="操作" style="width:50%;">
|
66
|
66
|
<div style="display:flex;">
|
67
|
|
- <el-input v-model="form.number" style="margin-right:10px;"></el-input>
|
|
67
|
+<!-- <el-input v-model="form.number" style="margin-right:10px;"></el-input>-->
|
68
|
68
|
<el-button type="primary" @click="addProjectList">添加</el-button>
|
69
|
69
|
</div>
|
70
|
70
|
</el-form-item>
|
71
|
71
|
</el-form>
|
72
|
72
|
<el-form>
|
73
|
|
- <el-table :data="tableData" border style="100%" :row-style="{ color: '#303133' }"
|
74
|
|
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
75
|
|
- highlight-current-row ref="tab">
|
76
|
|
- <el-table-column align="center" prop="name" label="分类" width="120">
|
77
|
|
- <template slot-scope="scope">
|
78
|
|
- <div>{{scope.row.type == 2?getId(scope.row.statistical_classification):'耗材'}}</div>
|
79
|
|
- </template>
|
80
|
|
- </el-table-column>
|
81
|
|
- <el-table-column align="center" prop="name" label="组套明细" width="120">
|
82
|
|
- <template slot-scope="scope">{{scope.row.project_name}}</template>
|
83
|
|
- </el-table-column>
|
84
|
|
- <el-table-column align="center" prop="name" label="数量" width="120">
|
85
|
|
- <template slot-scope="scope">{{scope.row.number}}</template>
|
86
|
|
- </el-table-column>
|
87
|
|
- <el-table-column align="center" prop="name" label="单位" width="120">
|
88
|
|
- <template slot-scope="scope">
|
89
|
|
- <div v-if="scope.row.type == 2">{{scope.row.unit}}</div>
|
90
|
|
- <div v-if="scope.row.type == 3">{{scope.row.unit}}</div>
|
91
|
|
- </template>
|
92
|
|
- </el-table-column>
|
93
|
|
- <el-table-column align="center" prop="name" label="单价" width="120">
|
94
|
|
- <template slot-scope="scope">{{scope.row.price}}</template>
|
95
|
|
- </el-table-column>
|
96
|
|
- <el-table-column align="center" prop="name" label="操作">
|
97
|
|
- <template slot-scope="scope">
|
98
|
|
- <el-tooltip
|
99
|
|
- class="item"
|
100
|
|
- effect="dark"
|
101
|
|
- content="删除"
|
102
|
|
- placement="top"
|
103
|
|
- >
|
104
|
|
- <el-button
|
105
|
|
- type="danger"
|
106
|
|
- icon="el-icon-delete"
|
107
|
|
- size="small"
|
108
|
|
- @click="DeleteProject(scope.row.m_id,scope.$index)"
|
109
|
|
- ></el-button>
|
110
|
|
- </el-tooltip>
|
111
|
|
- </template>
|
112
|
|
- </el-table-column>
|
113
|
|
- </el-table>
|
|
73
|
+<!-- <el-table :data="tableData" border style="100%" :row-style="{ color: '#303133' }"-->
|
|
74
|
+<!-- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
|
|
75
|
+<!-- highlight-current-row ref="tab">-->
|
|
76
|
+<!-- <el-table-column align="center" prop="name" label="分类" width="120">-->
|
|
77
|
+<!-- <template slot-scope="scope">-->
|
|
78
|
+<!-- <div>{{scope.row.type == 2?getId(scope.row.statistical_classification):'耗材'}}</div>-->
|
|
79
|
+<!-- </template>-->
|
|
80
|
+<!-- </el-table-column>-->
|
|
81
|
+<!-- <el-table-column align="center" prop="name" label="组套明细" width="120">-->
|
|
82
|
+<!-- <template slot-scope="scope">{{scope.row.project_name}}</template>-->
|
|
83
|
+<!-- </el-table-column>-->
|
|
84
|
+<!-- <el-table-column align="center" prop="name" label="数量" width="120">-->
|
|
85
|
+<!-- <template slot-scope="scope">{{scope.row.number}}</template>-->
|
|
86
|
+<!-- </el-table-column>-->
|
|
87
|
+<!-- <el-table-column align="center" prop="name" label="单位" width="120">-->
|
|
88
|
+<!-- <template slot-scope="scope">-->
|
|
89
|
+<!-- <div v-if="scope.row.type == 2">{{scope.row.unit}}</div>-->
|
|
90
|
+<!-- <div v-if="scope.row.type == 3">{{scope.row.unit}}</div>-->
|
|
91
|
+<!-- </template>-->
|
|
92
|
+<!-- </el-table-column>-->
|
|
93
|
+<!-- <el-table-column align="center" prop="name" label="单价" width="120">-->
|
|
94
|
+<!-- <template slot-scope="scope">{{scope.row.price}}</template>-->
|
|
95
|
+<!-- </el-table-column>-->
|
|
96
|
+<!-- <el-table-column align="center" prop="name" label="操作">-->
|
|
97
|
+<!-- <template slot-scope="scope">-->
|
|
98
|
+<!-- <el-tooltip-->
|
|
99
|
+<!-- class="item"-->
|
|
100
|
+<!-- effect="dark"-->
|
|
101
|
+<!-- content="删除"-->
|
|
102
|
+<!-- placement="top"-->
|
|
103
|
+<!-- >-->
|
|
104
|
+<!-- <el-button-->
|
|
105
|
+<!-- type="danger"-->
|
|
106
|
+<!-- icon="el-icon-delete"-->
|
|
107
|
+<!-- size="small"-->
|
|
108
|
+<!-- @click="DeleteProject(scope.row.m_id,scope.$index,scope.row.type)"-->
|
|
109
|
+<!-- ></el-button>-->
|
|
110
|
+<!-- </el-tooltip>-->
|
|
111
|
+<!-- </template>-->
|
|
112
|
+<!-- </el-table-column>-->
|
|
113
|
+<!-- </el-table>-->
|
|
114
|
+
|
|
115
|
+ <el-table
|
|
116
|
+ :data="drug_tableData"
|
|
117
|
+ max-height="300"
|
|
118
|
+ border
|
|
119
|
+ style="100%"
|
|
120
|
+ :row-style="{ color: '#303133' }"
|
|
121
|
+ :header-cell-style="{
|
|
122
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
123
|
+ color: '#606266',
|
|
124
|
+ }"
|
|
125
|
+ highlight-current-row
|
|
126
|
+ ref="tab"
|
|
127
|
+ >
|
|
128
|
+ <el-table-column align="center" prop="drug_name" label="名称" fixed>
|
|
129
|
+ <template slot-scope="scope"><span>{{ scope.row.type == 1?scope.row.drug_name: scope.row.project_name}}</span>
|
|
130
|
+ </template>
|
|
131
|
+ </el-table-column>
|
|
132
|
+
|
|
133
|
+ <el-table-column align="center" prop="drug_name" width="100" label="规格">
|
|
134
|
+ <template slot-scope="scope">
|
|
135
|
+ <span v-if="scope.row.type == 1" >
|
|
136
|
+ {{ scope.row.dose }}{{ scope.row.dose_unit }}*{{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
|
|
137
|
+ </span>
|
|
138
|
+ </template>
|
|
139
|
+ </el-table-column>
|
|
140
|
+ <el-table-column align="center" prop="single_dose" width="180" label="单次用量">
|
|
141
|
+ <template slot-scope="scope">
|
|
142
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
|
|
143
|
+ <el-input v-model="scope.row.single_dose" @input="getAllChangeTwo(scope)"
|
|
144
|
+ style="width:50%;"></el-input>
|
|
145
|
+ <!-- <div>{{scope.row.single_dose_unit}}</div> -->
|
|
146
|
+ <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
|
|
147
|
+ @change="getAllChangeTwo(scope)" >
|
|
148
|
+ <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
|
|
149
|
+ <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
|
|
150
|
+
|
|
151
|
+ <el-option :label="scope.row.dose_unit"
|
|
152
|
+ v-if="scope.row.dose_unit != scope.row.min_unit"
|
|
153
|
+ :value="scope.row.dose_unit"></el-option>
|
|
154
|
+ </el-select>
|
|
155
|
+ </div>
|
|
156
|
+ <span v-if="scope.row.type == 2">
|
|
157
|
+ </span>
|
|
158
|
+ <span v-if="scope.row.type == 3">
|
|
159
|
+ </span>
|
|
160
|
+ </template>
|
|
161
|
+ </el-table-column>
|
|
162
|
+ <el-table-column align="center" prop="delivery_way" width="100" label="用法">
|
|
163
|
+ <template slot-scope="scope">
|
|
164
|
+ <div v-if="scope.row.type == 1">
|
|
165
|
+ <el-select v-model="scope.row.delivery_way" placeholder="请选择">
|
|
166
|
+ <el-option
|
|
167
|
+ v-for="(item,index) in drugways"
|
|
168
|
+ :key="index"
|
|
169
|
+ :label="item.name"
|
|
170
|
+ :value="item.name">
|
|
171
|
+ </el-option>
|
|
172
|
+ </el-select>
|
|
173
|
+ </div>
|
|
174
|
+ <div v-if="scope.row.type == 2">
|
|
175
|
+
|
|
176
|
+ </div>
|
|
177
|
+ <div v-if="scope.row.type == 3">
|
|
178
|
+
|
|
179
|
+ </div>
|
|
180
|
+ </template>
|
|
181
|
+ </el-table-column>
|
|
182
|
+ <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
|
|
183
|
+ <template slot-scope="scope">
|
|
184
|
+ <div v-if="scope.row.type == 1">
|
|
185
|
+ <el-select v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChangeTwo(scope)">
|
|
186
|
+ <el-option
|
|
187
|
+ v-for="item,index in efs"
|
|
188
|
+ :key="index"
|
|
189
|
+ :label="item.name"
|
|
190
|
+ :value="item.name">
|
|
191
|
+ </el-option>
|
|
192
|
+ </el-select>
|
|
193
|
+ </div>
|
|
194
|
+ <div v-if="scope.row.type == 2">
|
|
195
|
+
|
|
196
|
+ </div>
|
|
197
|
+ <div v-if="scope.row.type == 3">
|
|
198
|
+
|
|
199
|
+ </div>
|
|
200
|
+ </template>
|
|
201
|
+ </el-table-column>
|
|
202
|
+
|
|
203
|
+ <el-table-column align="center" prop="day" width="100" label="天数">
|
|
204
|
+ <template slot-scope="scope">
|
|
205
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
|
|
206
|
+ <el-input v-model="scope.row.day" @input="getAllChangeTwo(scope)" placeholder=""></el-input>
|
|
207
|
+ {{'天'}}
|
|
208
|
+ </div>
|
|
209
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
|
|
210
|
+ <!-- {{'1天'}}-->
|
|
211
|
+ </div>
|
|
212
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
|
|
213
|
+ <!-- {{'1天'}}-->
|
|
214
|
+ </div>
|
|
215
|
+ </template>
|
|
216
|
+ </el-table-column>
|
|
217
|
+
|
|
218
|
+ <el-table-column align="center" prop="prescribing_number" width="150" label="总量">
|
|
219
|
+ <template slot-scope="scope">
|
|
220
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
|
|
221
|
+ <el-input v-model="scope.row.prescribing_number"
|
|
222
|
+ style="width:50%" placeholder=""></el-input>
|
|
223
|
+ <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
|
|
224
|
+ <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
|
|
225
|
+ @change="getPrescribingNumberUnit(scope)">
|
|
226
|
+ <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
|
|
227
|
+ <el-option :label="scope.row.max_unit"
|
|
228
|
+ v-if="scope.row.min_unit != scope.row.max_unit"
|
|
229
|
+ :value="scope.row.max_unit"></el-option>
|
|
230
|
+ </el-select>
|
|
231
|
+ </div>
|
|
232
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
|
|
233
|
+ <el-input v-model="scope.row.number"
|
|
234
|
+ style="width:50%" placeholder=""></el-input>
|
|
235
|
+ <div>{{scope.row.unit }}</div>
|
|
236
|
+ </div>
|
|
237
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
|
|
238
|
+ <el-input v-model="scope.row.number"
|
|
239
|
+ style="width:50%" placeholder=""></el-input>
|
|
240
|
+ <div>{{scope.row.unit }}</div>
|
|
241
|
+ </div>
|
|
242
|
+ </template>
|
|
243
|
+ </el-table-column>
|
|
244
|
+ <el-table-column align="center" prop="retail_price" width="100" label="单价">
|
|
245
|
+ <template slot-scope="scope">
|
|
246
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
|
|
247
|
+ <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
|
|
248
|
+ <div>{{'元'}}</div>
|
|
249
|
+ </div>
|
|
250
|
+
|
|
251
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
|
|
252
|
+ <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
|
|
253
|
+ <div>{{'元'}}</div>
|
|
254
|
+ <!-- <div>{{scope.row.price }}</div>-->
|
|
255
|
+ </div>
|
|
256
|
+ <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
|
|
257
|
+ <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
|
|
258
|
+ <div>{{'元'}}</div>
|
|
259
|
+ </div>
|
|
260
|
+ </template>
|
|
261
|
+ </el-table-column>
|
|
262
|
+ <el-table-column align="center" prop="name" label="操作" >
|
|
263
|
+ <template slot-scope="scope">
|
|
264
|
+ <el-tooltip
|
|
265
|
+ class="item"
|
|
266
|
+ effect="dark"
|
|
267
|
+ content="删除"
|
|
268
|
+ placement="top"
|
|
269
|
+ >
|
|
270
|
+ <el-button
|
|
271
|
+ type="danger"
|
|
272
|
+ icon="el-icon-delete"
|
|
273
|
+ size="small"
|
|
274
|
+ @click="DeleteProject(scope.row.m_id, scope.$index,scope.row.type)"
|
|
275
|
+ ></el-button>
|
|
276
|
+ </el-tooltip>
|
|
277
|
+ </template>
|
|
278
|
+ </el-table-column>
|
|
279
|
+ </el-table>
|
|
280
|
+
|
114
|
281
|
</el-form>
|
115
|
282
|
</div>
|
116
|
283
|
|
|
@@ -124,11 +291,13 @@
|
124
|
291
|
|
125
|
292
|
<script>
|
126
|
293
|
import {
|
|
294
|
+ getInitData,
|
127
|
295
|
editTeam
|
128
|
296
|
} from '@/api/his/his'
|
129
|
297
|
import {
|
130
|
298
|
addProjectList,
|
131
|
299
|
DeleteProject,
|
|
300
|
+ DeleteDrug,
|
132
|
301
|
getAllProjectList,
|
133
|
302
|
getProjectTeamDetail,
|
134
|
303
|
updatedProjectTeam
|
|
@@ -172,11 +341,124 @@
|
172
|
341
|
//team_type: [{ required: true, message: '请填写组套类型', trigger: 'change' }]
|
173
|
342
|
},
|
174
|
343
|
tableData: [],
|
|
344
|
+ drug_tableData:[],
|
175
|
345
|
item_id: [],
|
176
|
|
- projectList: []
|
|
346
|
+ projectList: [],
|
|
347
|
+ drugways: [],
|
|
348
|
+ efs: [],
|
177
|
349
|
}
|
178
|
350
|
},
|
179
|
351
|
methods: {
|
|
352
|
+ // getNum(execution_frequency) {
|
|
353
|
+ // let arr = [
|
|
354
|
+ // { name: '立即执行', count: 1 },
|
|
355
|
+ // { name: '透析时', count: 1 },
|
|
356
|
+ // { name: '透析1h一次', count: 1 },
|
|
357
|
+ // { name: '透析2h一次', count: 1 },
|
|
358
|
+ // { name: '透析3h一次', count: 1 },
|
|
359
|
+ // { name: '每日一次', count: 12 },
|
|
360
|
+ // { name: '每日两次', count: 6 },
|
|
361
|
+ // { name: '每日三次', count: 4 },
|
|
362
|
+ // { name: '每晚一次', count: 1 },
|
|
363
|
+ // { name: '每晚', count: 1 },
|
|
364
|
+ // { name: '上机前', count: 1 },
|
|
365
|
+ // { name: '下机前', count: 1 },
|
|
366
|
+ // { name: '透析后立即', count: 1 },
|
|
367
|
+ // { name: '持续使用', count: 1 },
|
|
368
|
+ // { name: '临时开药', count: 1 },
|
|
369
|
+ // { name: '临睡前', count: 1 },
|
|
370
|
+ // { name: '隔日一次', count: 1 },
|
|
371
|
+ // { name: '隔三日一次', count: 1 },
|
|
372
|
+ // { name: '每二小时一次', count: 12 },
|
|
373
|
+ // { name: '每四小时一次', count: 6 },
|
|
374
|
+ // { name: '每六小时一次', count: 4 },
|
|
375
|
+ // { name: '每八小时一次', count: 3 }
|
|
376
|
+ // ]
|
|
377
|
+ // let num = ''
|
|
378
|
+ // arr.map(item => {
|
|
379
|
+ // if (item.name == execution_frequency) {
|
|
380
|
+ // num = item.count
|
|
381
|
+ // }
|
|
382
|
+ // })
|
|
383
|
+ // if (num == '') {
|
|
384
|
+ // num = 1
|
|
385
|
+ // }
|
|
386
|
+ // return num
|
|
387
|
+ // },
|
|
388
|
+
|
|
389
|
+ getAllChange(scope) {
|
|
390
|
+ if(this.$store.getters.xt_user.org_id != 10206) {
|
|
391
|
+ if (scope.row.min_unit == scope.row.single_dose_unit) {
|
|
392
|
+ if (scope.row.prescribing_number_unit == scope.row.min_unit) {
|
|
393
|
+ console.log(1)
|
|
394
|
+ 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)
|
|
395
|
+ } else {
|
|
396
|
+ console.log(12)
|
|
397
|
+ 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.min_number)
|
|
398
|
+ }
|
|
399
|
+ } else {
|
|
400
|
+ if (scope.row.prescribing_number_unit == scope.row.min_unit) {
|
|
401
|
+ console.log(123)
|
|
402
|
+ 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.dose)
|
|
403
|
+ } else {
|
|
404
|
+ console.log(1234)
|
|
405
|
+ 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.dose / scope.row.min_number)
|
|
406
|
+ }
|
|
407
|
+ }
|
|
408
|
+ if (scope.row.prescribing_number == 0) {
|
|
409
|
+ scope.row.prescribing_number = 1
|
|
410
|
+ }
|
|
411
|
+
|
|
412
|
+ }
|
|
413
|
+
|
|
414
|
+ },
|
|
415
|
+ getInitData() {
|
|
416
|
+ getInitData().then(response => {
|
|
417
|
+ if (response.data.state == 0) {
|
|
418
|
+ this.$message.error(response.data.msg)
|
|
419
|
+ return false
|
|
420
|
+ } else {
|
|
421
|
+ this.drugways = response.data.data.drugways
|
|
422
|
+ this.efs = response.data.data.efs
|
|
423
|
+
|
|
424
|
+ }
|
|
425
|
+ })
|
|
426
|
+
|
|
427
|
+ },
|
|
428
|
+ getAllChangeTwo(scope) {
|
|
429
|
+ if(this.$store.getters.xt_user.org_id != 10206) {
|
|
430
|
+ console.log('yyyyyyyy',scope);
|
|
431
|
+ if (scope.row.min_unit == scope.row.single_dose_unit) {
|
|
432
|
+ if (scope.row.prescribing_number_unit == scope.row.min_unit) {
|
|
433
|
+ console.log(1)
|
|
434
|
+ 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)
|
|
435
|
+ } else {
|
|
436
|
+ console.log(12)
|
|
437
|
+ 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.min_number)
|
|
438
|
+ }
|
|
439
|
+ } else {
|
|
440
|
+ if (scope.row.prescribing_number_unit == scope.row.min_unit) {
|
|
441
|
+ console.log('123',scope.row.dose,scope.row.execution_frequency,scope.row.min_unit)
|
|
442
|
+ // 单次用量single_dose,用量单位single_dose_unit,用法delivery_way,频率execution_frequency 总量prescribing_number,规格drug.dose
|
|
443
|
+ scope.row.prescribing_number = Math.ceil((parseInt(scope.row.single_dose) * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / parseInt(this.getdrugdose(scope.row.dose)) ) // / scope.row.drug.dose
|
|
444
|
+ } else {
|
|
445
|
+ console.log(1234,scope.row.dose)
|
|
446
|
+ 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.dose*1) / (scope.row.min_number*1))//
|
|
447
|
+ }
|
|
448
|
+ }
|
|
449
|
+ if (scope.row.prescribing_number == 0) {
|
|
450
|
+ scope.row.prescribing_number = 1
|
|
451
|
+ }
|
|
452
|
+ }
|
|
453
|
+ },
|
|
454
|
+ getPrescribingNumberUnit(scope) {
|
|
455
|
+
|
|
456
|
+ if (scope.row.prescribing_number_unit == scope.row.min_unit) {
|
|
457
|
+ scope.row.retail_price = scope.row.drug.min_price
|
|
458
|
+ } else {
|
|
459
|
+ scope.row.retail_price = scope.row.drug.retail_price
|
|
460
|
+ }
|
|
461
|
+ },
|
180
|
462
|
getUnit(id){
|
181
|
463
|
var arr = getDataConfig('hemodialysis','units')
|
182
|
464
|
for(let i = 0;i < arr.length; i++){
|
|
@@ -206,17 +488,22 @@
|
206
|
488
|
show(id) {
|
207
|
489
|
this.visible = true
|
208
|
490
|
this.formTitle = '编辑'
|
|
491
|
+ this.getInitData()
|
209
|
492
|
this.getlist(id)
|
210
|
493
|
this.getProjectTeamDetail(id)
|
211
|
494
|
this.projectList = []
|
212
|
|
- },
|
|
495
|
+ },
|
213
|
496
|
getlist(id) {
|
214
|
497
|
|
215
|
498
|
getAllProjectList().then(response => {
|
216
|
499
|
if (response.data.state == 1) {
|
217
|
|
-
|
|
500
|
+
|
218
|
501
|
var projectList = response.data.data.projectList
|
219
|
502
|
var goodInfos = response.data.data.good_info
|
|
503
|
+
|
|
504
|
+ var drug_infos = response.data.data.drug;
|
|
505
|
+
|
|
506
|
+
|
220
|
507
|
console.log("332323232323232",goodInfos)
|
221
|
508
|
for (let i = 0; i < projectList.length; i++) {
|
222
|
509
|
let obj = {
|
|
@@ -251,7 +538,35 @@
|
251
|
538
|
}
|
252
|
539
|
this.projectList.push(obj)
|
253
|
540
|
}
|
254
|
|
- console.log("编辑项目23332232323",this.projectList)
|
|
541
|
+
|
|
542
|
+ for (let i = 0; i < drug_infos.length; i++) {
|
|
543
|
+ let obj = {
|
|
544
|
+ id: drug_infos[i].id,
|
|
545
|
+ m_id: 0,
|
|
546
|
+ drug_name: drug_infos[i].drug_name,
|
|
547
|
+ single_dose: drug_infos[i].single_dose.toString(),
|
|
548
|
+ delivery_way: drug_infos[i].delivery_way,
|
|
549
|
+ execution_frequency: drug_infos[i].execution_frequency,
|
|
550
|
+ dose: drug_infos[i].dose,
|
|
551
|
+ dose_unit: drug_infos[i].dose_unit,
|
|
552
|
+ min_number: drug_infos[i].min_number,
|
|
553
|
+ min_unit: drug_infos[i].min_unit,
|
|
554
|
+ max_unit: drug_infos[i].max_unit,
|
|
555
|
+ type: 1,
|
|
556
|
+ retail_price: drug_infos[i].retail_price.toString(),
|
|
557
|
+ remark: '',
|
|
558
|
+ day: '1',
|
|
559
|
+ prescribing_number: drug_infos[i].prescribing_number,
|
|
560
|
+ single_dose_unit: drug_infos[i].dose_unit,
|
|
561
|
+ prescribing_number_unit: drug_infos[i].prescribing_number_unit,
|
|
562
|
+ medical_insurance_number: drug_infos[i].medical_insurance_number,
|
|
563
|
+ new_id: Math.floor(
|
|
564
|
+ (Math.random() + Math.floor(Math.random() * 9 + 1)) *
|
|
565
|
+ Math.pow(10, 10 - 1)),
|
|
566
|
+ };
|
|
567
|
+ this.projectList.push(obj);
|
|
568
|
+ }
|
|
569
|
+
|
255
|
570
|
}
|
256
|
571
|
})
|
257
|
572
|
},
|
|
@@ -263,11 +578,15 @@
|
263
|
578
|
getProjectTeamDetail(id).then(response => {
|
264
|
579
|
if (response.data.state == 1) {
|
265
|
580
|
this.tableData = []
|
|
581
|
+ this.drug_tableData = []
|
|
582
|
+
|
266
|
583
|
var projectTeamDetail = response.data.data.projectTeamDetail
|
267
|
584
|
var hisList = response.data.data.hisList
|
268
|
585
|
|
269
|
|
- for (let i = 0; i < hisList.length; i++) {
|
|
586
|
+ var hisList_drug = response.data.data.hisList_drug
|
270
|
587
|
|
|
588
|
+
|
|
589
|
+ for (let i = 0; i < hisList.length; i++) {
|
271
|
590
|
let obj = {
|
272
|
591
|
m_id: hisList[i].id,
|
273
|
592
|
id: hisList[i].project_id,
|
|
@@ -275,17 +594,40 @@
|
275
|
594
|
type: hisList[i].type
|
276
|
595
|
}
|
277
|
596
|
if (hisList[i].type == 2) {
|
278
|
|
- obj['statistical_classification'] = hisList[i].project.statistical_classification
|
279
|
597
|
obj['project_name'] = hisList[i].project.project_name
|
280
|
598
|
obj['unit'] = hisList[i].project.unit
|
281
|
599
|
obj['price'] = hisList[i].project.price
|
282
|
|
-
|
283
|
600
|
} else {
|
284
|
601
|
obj['project_name'] = hisList[i].good_info.good_name
|
285
|
602
|
obj['unit'] = hisList[i].good_info.packing_unit
|
286
|
603
|
obj['price'] = hisList[i].good_info.retail_price
|
287
|
604
|
}
|
288
|
605
|
this.tableData.push(obj)
|
|
606
|
+ this.drug_tableData.push(obj)
|
|
607
|
+ }
|
|
608
|
+ for (let i = 0; i < hisList_drug.length; i++) {
|
|
609
|
+
|
|
610
|
+ let obj = {
|
|
611
|
+ m_id: hisList_drug[i].id,
|
|
612
|
+ id: hisList_drug[i].drug_id,
|
|
613
|
+ drug_name: hisList_drug[i].drug.drug_name,
|
|
614
|
+ single_dose: hisList_drug[i].single_dose.toString(),
|
|
615
|
+ delivery_way: hisList_drug[i].delivery_way,
|
|
616
|
+ execution_frequency: hisList_drug[i].execution_frequency,
|
|
617
|
+ dose: hisList_drug[i].drug.dose,
|
|
618
|
+ dose_unit: hisList_drug[i].drug.dose_unit,
|
|
619
|
+ min_number: hisList_drug[i].drug.min_number,
|
|
620
|
+ min_unit: hisList_drug[i].drug.min_unit,
|
|
621
|
+ max_unit: hisList_drug[i].drug.max_unit,
|
|
622
|
+ type: 1,
|
|
623
|
+ retail_price: hisList_drug[i].drug.retail_price.toString(),
|
|
624
|
+ remark: '',
|
|
625
|
+ day: hisList_drug[i].day_count,
|
|
626
|
+ prescribing_number: hisList_drug[i].prescribing_number,
|
|
627
|
+ single_dose_unit: hisList_drug[i].single_dose_unit,
|
|
628
|
+ prescribing_number_unit: hisList_drug[i].prescribing_number_unit,
|
|
629
|
+ }
|
|
630
|
+ this.drug_tableData.push(obj)
|
289
|
631
|
}
|
290
|
632
|
this.form.id = projectTeamDetail.id
|
291
|
633
|
this.form.project_team = projectTeamDetail.project_team
|
|
@@ -316,6 +658,51 @@
|
316
|
658
|
}
|
317
|
659
|
}
|
318
|
660
|
|
|
661
|
+ var drug_tableDatas = []
|
|
662
|
+ var tableDatas = []
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+ for (let i = 0; i < this.drug_tableData.length; i++) {
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+ if (this.drug_tableData[i].type == 1) {
|
|
670
|
+ drug_tableDatas.push(this.drug_tableData[i])
|
|
671
|
+ }else{
|
|
672
|
+ this.drug_tableData[i].number = this.drug_tableData[i].number.toString()
|
|
673
|
+ tableDatas.push(this.drug_tableData[i])
|
|
674
|
+ }
|
|
675
|
+ }
|
|
676
|
+
|
|
677
|
+ if(isNaN(this.form.price)){
|
|
678
|
+ this.form.price = 0
|
|
679
|
+ let c = 0
|
|
680
|
+ for (let i = 0; i < this.drug_tableData.length; i++) {
|
|
681
|
+ if(this.drug_tableData[i].type == 1){
|
|
682
|
+ if(this.drug_tableData[i].retail_price == ""){
|
|
683
|
+ this.drug_tableData[i].retail_price = 0
|
|
684
|
+ }
|
|
685
|
+ let a = parseFloat(this.drug_tableData[i].prescribing_number).toFixed(2)
|
|
686
|
+ let b = parseFloat(this.drug_tableData[i].retail_price).toFixed(2)
|
|
687
|
+ c = c + this.form.price + (a * b)
|
|
688
|
+ }else{
|
|
689
|
+ if(this.drug_tableData[i].price == ""){
|
|
690
|
+ this.drug_tableData[i].price = 0
|
|
691
|
+ }
|
|
692
|
+ let a = parseFloat(this.drug_tableData[i].number).toFixed(2)
|
|
693
|
+ let b = parseFloat(this.drug_tableData[i].price).toFixed(2)
|
|
694
|
+ c = c + this.form.price + (a * b)
|
|
695
|
+ }
|
|
696
|
+
|
|
697
|
+ }
|
|
698
|
+ console.log(c)
|
|
699
|
+
|
|
700
|
+ this.form.price = c.toFixed(2)
|
|
701
|
+
|
|
702
|
+ }
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
319
|
706
|
if (valid) {
|
320
|
707
|
var params = {
|
321
|
708
|
id: this.form.id,
|
|
@@ -329,7 +716,8 @@
|
329
|
716
|
sort:parseInt(this.form.sort)
|
330
|
717
|
}
|
331
|
718
|
let data = {
|
332
|
|
- 'info': arr
|
|
719
|
+ 'info': tableDatas,
|
|
720
|
+ "drug_info": drug_tableDatas,
|
333
|
721
|
} // console.log("params",params)
|
334
|
722
|
editTeam(params, data).then(response => {
|
335
|
723
|
if (response.data.state == 1) {
|
|
@@ -357,41 +745,60 @@
|
357
|
745
|
return name
|
358
|
746
|
},
|
359
|
747
|
addProjectList() {
|
360
|
|
-
|
|
748
|
+
|
361
|
749
|
var project_name = ""
|
362
|
750
|
for(let i=0;i<this.projectList.length;i++){
|
363
|
|
- if(this.form.project_detail == this.projectList[i].new_id){
|
|
751
|
+ if(this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type != 1){
|
364
|
752
|
project_name = this.projectList[i].project_name
|
365
|
753
|
}
|
366
|
754
|
}
|
367
|
755
|
if(this.tableData.length > 0){
|
368
|
756
|
for(let i=0;i<this.tableData.length;i++){
|
369
|
|
- if(this.tableData[i].project_name == project_name){
|
|
757
|
+ if(this.tableData[i].project_name == project_name && this.projectList[i].type != 1){
|
370
|
758
|
this.$message.error("项目名称已存在")
|
371
|
759
|
return
|
372
|
760
|
}
|
373
|
761
|
}
|
374
|
762
|
}
|
375
|
763
|
for (let i = 0; i < this.projectList.length; i++) {
|
376
|
|
- if (this.form.project_detail == this.projectList[i].new_id) {
|
|
764
|
+ if (this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type != 1) {
|
377
|
765
|
this.projectList[i].number = this.form.number
|
378
|
766
|
this.projectList[i].number = this.projectList[i].number.toString()
|
379
|
767
|
this.tableData.push(this.projectList[i])
|
|
768
|
+ this.drug_tableData.push(this.projectList[i])
|
|
769
|
+
|
|
770
|
+ this.form.project_detail = ''
|
|
771
|
+ this.form.number = ''
|
|
772
|
+ }
|
|
773
|
+ }
|
|
774
|
+ for (let i = 0; i < this.projectList.length; i++) {
|
|
775
|
+ if (this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type == 1) {
|
|
776
|
+ this.projectList[i].prescribing_number = this.form.number.toString()
|
|
777
|
+ this.projectList[i].m_id = 0
|
|
778
|
+ this.drug_tableData.push(this.projectList[i])
|
380
|
779
|
this.form.project_detail = ''
|
381
|
780
|
this.form.number = ''
|
382
|
781
|
}
|
383
|
782
|
}
|
384
|
783
|
|
385
|
784
|
},
|
386
|
|
- DeleteProject(id, index) {
|
|
785
|
+ DeleteProject(id, index,type) {
|
|
786
|
+ console.log(id)
|
387
|
787
|
|
388
|
788
|
if (id == 0) {
|
|
789
|
+
|
389
|
790
|
this.$confirm('确认删除此项目吗?', '删除', {
|
390
|
791
|
confirmButtonText: '确 定',
|
391
|
792
|
cancelButtonText: '取 消',
|
392
|
793
|
type: 'warning'
|
393
|
794
|
}).then(() => {
|
394
|
|
- this.tableData.splice(index, 1)
|
|
795
|
+ if(type == 1){
|
|
796
|
+ this.drug_tableData.splice(index, 1)
|
|
797
|
+ }else{
|
|
798
|
+ this.tableData.splice(index, 1)
|
|
799
|
+ this.drug_tableData.splice(index, 1)
|
|
800
|
+
|
|
801
|
+ }
|
395
|
802
|
|
396
|
803
|
})
|
397
|
804
|
.catch(() => {
|
|
@@ -403,14 +810,27 @@
|
403
|
810
|
cancelButtonText: '取 消',
|
404
|
811
|
type: 'warning'
|
405
|
812
|
}).then(() => {
|
406
|
|
- DeleteProject(id).then(response => {
|
407
|
|
- if (response.data.state == 1) {
|
408
|
|
- this.tableData.splice(index, 1)
|
|
813
|
+ if(type == 1){
|
|
814
|
+ DeleteDrug(id).then(response => {
|
|
815
|
+ if (response.data.state == 1) {
|
|
816
|
+ this.drug_tableData.splice(index, 1)
|
|
817
|
+ } else {
|
|
818
|
+ }
|
|
819
|
+ })
|
409
|
820
|
|
410
|
|
- } else {
|
|
821
|
+ }else{
|
|
822
|
+ DeleteProject(id).then(response => {
|
|
823
|
+ if (response.data.state == 1) {
|
|
824
|
+ this.tableData.splice(index, 1)
|
|
825
|
+ this.drug_tableData.splice(index, 1)
|
|
826
|
+
|
|
827
|
+ } else {
|
|
828
|
+
|
|
829
|
+ }
|
|
830
|
+ })
|
|
831
|
+
|
|
832
|
+ }
|
411
|
833
|
|
412
|
|
- }
|
413
|
|
- })
|
414
|
834
|
})
|
415
|
835
|
.catch(() => {
|
416
|
836
|
})
|
|
@@ -423,17 +843,20 @@
|
423
|
843
|
this.getlist()
|
424
|
844
|
},
|
425
|
845
|
watch: {
|
426
|
|
- 'tableData': function() {
|
|
846
|
+ 'drug_tableData': function() {
|
427
|
847
|
let c = 0
|
428
|
848
|
this.form.price = 0
|
429
|
|
- for (let i = 0; i < this.tableData.length; i++) {
|
430
|
|
- let a = parseFloat(this.tableData[i].number).toFixed(2)
|
431
|
|
- let b = parseFloat(this.tableData[i].price).toFixed(2)
|
432
|
|
- console.log(a)
|
433
|
|
- console.log(b)
|
434
|
|
-
|
|
849
|
+ for (let i = 0; i < this.drug_tableData.length; i++) {
|
|
850
|
+ if(this.drug_tableData[i].type == 1){
|
|
851
|
+ let a = parseFloat(this.drug_tableData[i].prescribing_number).toFixed(2)
|
|
852
|
+ let b = parseFloat(this.drug_tableData[i].retail_price).toFixed(2)
|
|
853
|
+ c = c + this.form.price + (a * b)
|
|
854
|
+ }else{
|
|
855
|
+ let a = parseFloat(this.drug_tableData[i].number).toFixed(2)
|
|
856
|
+ let b = parseFloat(this.drug_tableData[i].price).toFixed(2)
|
|
857
|
+ c = c + this.form.price + (a * b)
|
435
|
858
|
|
436
|
|
- c = c + this.form.price + (a * b)
|
|
859
|
+ }
|
437
|
860
|
|
438
|
861
|
}
|
439
|
862
|
this.form.price = c.toFixed(2)
|