|
@@ -10,83 +10,151 @@
|
10
|
10
|
@close="cancel"
|
11
|
11
|
:before-close="cancel"
|
12
|
12
|
>
|
13
|
|
- <div style="max-height: 65vh;overflow-y: auto;">
|
14
|
|
- <div v-for="(item , index) in listToDetails.listVO" :key="index">
|
|
13
|
+ <div style="max-height: 65vh; overflow-y: auto">
|
|
14
|
+ <div v-for="(item, index) in listToDetails.listVO" :key="index">
|
15
|
15
|
<h3>
|
16
|
|
- {{ initToothPosition(item.toothPosition) }}
|
17
|
|
- <el-button v-if="collectCostPatientsType == 1" @click="doAdd(index)" type="primary" plain icon="el-icon-plus" size="mini" style="margin-left: 10px;"
|
|
16
|
+ {{ initToothPosition(item.toothPosition) }}
|
|
17
|
+ <el-button
|
|
18
|
+ v-if="collectCostPatientsType == 1"
|
|
19
|
+ @click="doAdd(index)"
|
|
20
|
+ type="primary"
|
|
21
|
+ plain
|
|
22
|
+ icon="el-icon-plus"
|
|
23
|
+ size="mini"
|
|
24
|
+ style="margin-left: 10px"
|
18
|
25
|
>新建</el-button
|
19
|
26
|
>
|
20
|
27
|
</h3>
|
21
|
28
|
<el-table :data="item.collectCostDetailsVOList">
|
22
|
|
- <el-table-column label="项目编号" show-overflow-tooltip align="center">
|
23
|
|
- <template slot-scope="scope">
|
24
|
|
- <span>{{ scope.row.projectCode || '-' }}</span>
|
25
|
|
- </template>
|
26
|
|
- </el-table-column>
|
27
|
|
- <el-table-column label="项目名称" show-overflow-tooltip align="center">
|
28
|
|
- <template slot-scope="scope">
|
29
|
|
- <span>{{ scope.row.projectName || '-' }}</span>
|
30
|
|
- </template>
|
31
|
|
- </el-table-column>
|
32
|
|
- <el-table-column label="单价" show-overflow-tooltip align="center">
|
33
|
|
- <template slot-scope="scope">
|
34
|
|
- <span>{{ scope.row.unitPrice || '-' }}</span>
|
35
|
|
- </template>
|
36
|
|
- </el-table-column>
|
37
|
|
- <el-table-column label="优惠价格" show-overflow-tooltip align="center">
|
38
|
|
- <template slot-scope="scope">
|
39
|
|
- <span>
|
40
|
|
- <el-input :disabled="collectCostPatientsType !=1 " v-model="scope.row.preferentialPrice" @input="inputVal(index,scope.$index,scope.row.preferentialPrice)"></el-input>
|
41
|
|
- </span>
|
42
|
|
- </template>
|
43
|
|
- </el-table-column>
|
44
|
|
- <el-table-column label="单位" show-overflow-tooltip align="center">
|
45
|
|
- <template slot-scope="scope">
|
46
|
|
- <span>{{ scope.row.unit || '-' }}</span>
|
47
|
|
- </template>
|
48
|
|
- </el-table-column>
|
49
|
|
- <el-table-column label="数量" show-overflow-tooltip width="250" align="center">
|
50
|
|
- <template slot-scope="scope">
|
51
|
|
- <el-input-number :disabled="collectCostPatientsType !=1" @change="changeVal(index,scope.$index,scope.row.total)" size="mini" v-model="scope.row.total" style="" :min="1" :max="10" label="描述文字"></el-input-number>
|
52
|
|
- </template>
|
53
|
|
- </el-table-column>
|
54
|
|
- <el-table-column
|
55
|
|
- label="操作"
|
56
|
|
- align="center"
|
57
|
|
- width="120"
|
58
|
|
- fixed="right"
|
59
|
|
- v-if="collectCostPatientsType == 1"
|
60
|
|
- >
|
61
|
|
- <template slot-scope="scope">
|
62
|
|
- <i class="el-icon-delete" style="cursor: pointer;color: red;" @click="doDel(index,scope.$index)"></i>
|
63
|
|
- </template>
|
64
|
|
- </el-table-column>
|
65
|
|
- </el-table>
|
|
29
|
+ <el-table-column
|
|
30
|
+ label="项目编号"
|
|
31
|
+ show-overflow-tooltip
|
|
32
|
+ align="center"
|
|
33
|
+ >
|
|
34
|
+ <template slot-scope="scope">
|
|
35
|
+ <span>{{ scope.row.projectCode || '-' }}</span>
|
|
36
|
+ </template>
|
|
37
|
+ </el-table-column>
|
|
38
|
+ <el-table-column
|
|
39
|
+ label="项目名称"
|
|
40
|
+ show-overflow-tooltip
|
|
41
|
+ align="center"
|
|
42
|
+ >
|
|
43
|
+ <template slot-scope="scope">
|
|
44
|
+ <span>{{ scope.row.projectName || '-' }}</span>
|
|
45
|
+ </template>
|
|
46
|
+ </el-table-column>
|
|
47
|
+ <el-table-column label="单价" show-overflow-tooltip align="center">
|
|
48
|
+ <template slot-scope="scope">
|
|
49
|
+ <span>{{ scope.row.unitPrice || '-' }}</span>
|
|
50
|
+ </template>
|
|
51
|
+ </el-table-column>
|
|
52
|
+ <el-table-column
|
|
53
|
+ label="优惠价格"
|
|
54
|
+ show-overflow-tooltip
|
|
55
|
+ align="center"
|
|
56
|
+ >
|
|
57
|
+ <template slot-scope="scope">
|
|
58
|
+ <span>
|
|
59
|
+ <el-input
|
|
60
|
+ :disabled="collectCostPatientsType != 1"
|
|
61
|
+ v-model="scope.row.preferentialPrice"
|
|
62
|
+ @input="
|
|
63
|
+ inputVal(index, scope.$index, scope.row.preferentialPrice)
|
|
64
|
+ "
|
|
65
|
+ ></el-input>
|
|
66
|
+ </span>
|
|
67
|
+ </template>
|
|
68
|
+ </el-table-column>
|
|
69
|
+ <el-table-column label="单位" show-overflow-tooltip align="center">
|
|
70
|
+ <template slot-scope="scope">
|
|
71
|
+ <span>{{ scope.row.unit || '-' }}</span>
|
|
72
|
+ </template>
|
|
73
|
+ </el-table-column>
|
|
74
|
+ <el-table-column
|
|
75
|
+ label="数量"
|
|
76
|
+ show-overflow-tooltip
|
|
77
|
+ width="250"
|
|
78
|
+ align="center"
|
|
79
|
+ >
|
|
80
|
+ <template slot-scope="scope">
|
|
81
|
+ <el-input-number
|
|
82
|
+ :disabled="collectCostPatientsType != 1"
|
|
83
|
+ @change="changeVal(index, scope.$index, scope.row.total)"
|
|
84
|
+ size="mini"
|
|
85
|
+ v-model="scope.row.total"
|
|
86
|
+ style=""
|
|
87
|
+ :min="1"
|
|
88
|
+ :max="10"
|
|
89
|
+ label="描述文字"
|
|
90
|
+ ></el-input-number>
|
|
91
|
+ </template>
|
|
92
|
+ </el-table-column>
|
|
93
|
+ <el-table-column
|
|
94
|
+ label="操作"
|
|
95
|
+ align="center"
|
|
96
|
+ width="120"
|
|
97
|
+ fixed="right"
|
|
98
|
+ v-if="collectCostPatientsType == 1"
|
|
99
|
+ >
|
|
100
|
+ <template slot-scope="scope">
|
|
101
|
+ <i
|
|
102
|
+ class="el-icon-delete"
|
|
103
|
+ style="cursor: pointer; color: red"
|
|
104
|
+ @click="doDel(index, scope.$index)"
|
|
105
|
+ ></i>
|
|
106
|
+ </template>
|
|
107
|
+ </el-table-column>
|
|
108
|
+ </el-table>
|
66
|
109
|
</div>
|
67
|
110
|
</div>
|
68
|
111
|
<span slot="footer" class="dialog-footer">
|
69
|
|
- <div style="display: flex;align-items: center;">
|
70
|
|
- <span style="margin-left: 10px;">原价:{{ receivableCost }} (元)</span>
|
71
|
|
- <span style="margin-left: 10px;">应付价格:{{ preferentialPrice }} (元)</span>
|
72
|
|
- <span style="margin-left: 20px;display: flex;align-items: center;" v-if="collectCostPatientsType != 1">
|
|
112
|
+ <div style="display: flex; align-items: center">
|
|
113
|
+ <span style="margin-left: 10px"
|
|
114
|
+ >原价:{{ receivableCost }} (元)</span
|
|
115
|
+ >
|
|
116
|
+ <span style="margin-left: 10px"
|
|
117
|
+ >应付价格:{{ preferentialPrice }} (元)</span
|
|
118
|
+ >
|
|
119
|
+ <span
|
|
120
|
+ style="margin-left: 20px; display: flex; align-items: center"
|
|
121
|
+ v-if="collectCostPatientsType != 1"
|
|
122
|
+ >
|
73
|
123
|
实收:
|
74
|
|
- <el-input v-model="listToDetails.netReceiptsCost" :disabled="collectCostPatientsType!=2" style="width: 200px;"></el-input>
|
|
124
|
+ <el-input
|
|
125
|
+ v-model="listToDetails.netReceiptsCost"
|
|
126
|
+ :disabled="collectCostPatientsType != 2"
|
|
127
|
+ style="width: 200px"
|
|
128
|
+ ></el-input>
|
75
|
129
|
(元)
|
76
|
130
|
</span>
|
77
|
131
|
</div>
|
78
|
|
- <el-button v-if="collectCostPatientsType != 3" @click="cancel">取 消</el-button>
|
79
|
|
- <el-button v-if="collectCostPatientsType != 3" type="primary" @click="submit">确 定</el-button>
|
|
132
|
+ <el-button v-if="collectCostPatientsType != 3" @click="cancel"
|
|
133
|
+ >取 消</el-button
|
|
134
|
+ >
|
|
135
|
+ <el-button
|
|
136
|
+ v-if="collectCostPatientsType != 3"
|
|
137
|
+ type="primary"
|
|
138
|
+ @click="submit"
|
|
139
|
+ >确 定</el-button
|
|
140
|
+ >
|
80
|
141
|
</span>
|
81
|
142
|
</el-dialog>
|
82
|
143
|
|
83
|
|
- <addTemplateDialog ref="addTemplateDialogRef" @tableDataDown="tableDataDown"/>
|
|
144
|
+ <addTemplateDialog
|
|
145
|
+ ref="addTemplateDialogRef"
|
|
146
|
+ @tableDataDown="tableDataDown"
|
|
147
|
+ />
|
84
|
148
|
</div>
|
85
|
149
|
</template>
|
86
|
150
|
|
87
|
151
|
<script>
|
88
|
|
-import { listToDetails , collectCostPatientsUpdate ,collectCost} from '@/api/allApi.js'
|
89
|
|
-import initName from '@/utils/initName.js';
|
|
152
|
+import {
|
|
153
|
+ listToDetails,
|
|
154
|
+ collectCostPatientsUpdate,
|
|
155
|
+ collectCost
|
|
156
|
+} from '@/api/allApi.js'
|
|
157
|
+import initName from '@/utils/initName.js'
|
90
|
158
|
|
91
|
159
|
import addTemplateDialog from './addTemplateDialog.vue'
|
92
|
160
|
export default {
|
|
@@ -99,8 +167,8 @@ export default {
|
99
|
167
|
type: String
|
100
|
168
|
},
|
101
|
169
|
collectCostPatientsType: {
|
102
|
|
- type: String
|
103
|
|
- },
|
|
170
|
+ type: Number
|
|
171
|
+ }
|
104
|
172
|
},
|
105
|
173
|
components: {
|
106
|
174
|
addTemplateDialog
|
|
@@ -113,80 +181,113 @@ export default {
|
113
|
181
|
}
|
114
|
182
|
},
|
115
|
183
|
watch: {
|
116
|
|
- collectCostPatientsId(val){
|
|
184
|
+ collectCostPatientsId(val) {
|
117
|
185
|
if (val) {
|
118
|
186
|
this.initList()
|
119
|
187
|
}
|
120
|
188
|
}
|
121
|
189
|
},
|
122
|
190
|
computed: {
|
123
|
|
- receivableCost(){
|
124
|
|
- let num = 0;
|
125
|
|
- this.listToDetails.listVO.forEach(item => {
|
126
|
|
- const number = [];
|
127
|
|
- item.collectCostDetailsVOList.forEach(item1 => {
|
128
|
|
- number.push(item1.unitPrice * item1.total)
|
|
191
|
+ receivableCost() {
|
|
192
|
+ if (
|
|
193
|
+ Array.isArray(this.listToDetails.listVO) &&
|
|
194
|
+ this.listToDetails.listVO.length
|
|
195
|
+ ) {
|
|
196
|
+ let num = 0
|
|
197
|
+
|
|
198
|
+ this.listToDetails.listVO.forEach((item) => {
|
|
199
|
+ const number = []
|
|
200
|
+ item.collectCostDetailsVOList.forEach((item1) => {
|
|
201
|
+ number.push(item1.unitPrice * item1.total)
|
|
202
|
+ })
|
|
203
|
+ num += number.reduce((a, b) => a + b, 0)
|
129
|
204
|
})
|
130
|
|
- num += number.reduce((a, b) => a + b, 0);
|
131
|
|
- });
|
132
|
|
- return num;
|
|
205
|
+ return num
|
|
206
|
+ } else {
|
|
207
|
+ return 0
|
|
208
|
+ }
|
133
|
209
|
},
|
134
|
|
- preferentialPrice(){
|
135
|
|
- let num = 0;
|
136
|
|
- this.listToDetails.listVO.forEach(item => {
|
137
|
|
- const number = [];
|
138
|
|
- item.collectCostDetailsVOList.forEach(item1 => {
|
139
|
|
- number.push(item1.preferentialPrice * item1.total)
|
|
210
|
+ preferentialPrice() {
|
|
211
|
+ if (
|
|
212
|
+ Array.isArray(this.listToDetails.listVO) &&
|
|
213
|
+ this.listToDetails.listVO.length
|
|
214
|
+ ) {
|
|
215
|
+ let num = 0
|
|
216
|
+
|
|
217
|
+ this.listToDetails.listVO.forEach((item) => {
|
|
218
|
+ const number = []
|
|
219
|
+ item.collectCostDetailsVOList.forEach((item1) => {
|
|
220
|
+ number.push(item1.preferentialPrice * item1.total)
|
|
221
|
+ })
|
|
222
|
+ num += number.reduce((a, b) => a + b, 0)
|
140
|
223
|
})
|
141
|
|
- num += number.reduce((a, b) => a + b, 0);
|
142
|
|
- });
|
143
|
|
- return num;
|
144
|
|
- },
|
|
224
|
+ return num
|
|
225
|
+ } else {
|
|
226
|
+ return 0
|
|
227
|
+ }
|
|
228
|
+ }
|
145
|
229
|
},
|
146
|
230
|
mounted() {},
|
147
|
231
|
|
148
|
232
|
methods: {
|
149
|
|
- async initList (){
|
150
|
|
- const res = await listToDetails({collectCostPatientsId: this.collectCostPatientsId})
|
|
233
|
+ async initList() {
|
|
234
|
+ const res = await listToDetails({
|
|
235
|
+ collectCostPatientsId: this.collectCostPatientsId
|
|
236
|
+ })
|
151
|
237
|
this.listToDetails = res.data
|
152
|
238
|
},
|
153
|
239
|
cancel() {
|
154
|
240
|
this.$emit('cancelAll', '6')
|
155
|
241
|
},
|
156
|
|
- doDel(index1 , index2){
|
157
|
|
- this.listToDetails.listVO[index1].collectCostDetailsVOList.splice(index2,1)
|
|
242
|
+ doDel(index1, index2) {
|
|
243
|
+ this.listToDetails.listVO[index1].collectCostDetailsVOList.splice(
|
|
244
|
+ index2,
|
|
245
|
+ 1
|
|
246
|
+ )
|
158
|
247
|
},
|
159
|
|
- doAdd(index){
|
|
248
|
+ doAdd(index) {
|
160
|
249
|
this.toothPositionIndex = index
|
161
|
250
|
this.$refs.addTemplateDialogRef.addTemplateDialogVisible = true
|
162
|
251
|
this.$refs.addTemplateDialogRef.initcollectCostTypeList()
|
163
|
252
|
this.$refs.addTemplateDialogRef.initList()
|
164
|
253
|
},
|
165
|
|
- tableDataDown(tableDataDown){
|
166
|
|
- this.listToDetails.listVO[this.toothPositionIndex].collectCostDetailsVOList = [...this.listToDetails.listVO[this.toothPositionIndex].collectCostDetailsVOList,...tableDataDown]
|
|
254
|
+ tableDataDown(tableDataDown) {
|
|
255
|
+ this.listToDetails.listVO[
|
|
256
|
+ this.toothPositionIndex
|
|
257
|
+ ].collectCostDetailsVOList = [
|
|
258
|
+ ...this.listToDetails.listVO[this.toothPositionIndex]
|
|
259
|
+ .collectCostDetailsVOList,
|
|
260
|
+ ...tableDataDown
|
|
261
|
+ ]
|
167
|
262
|
},
|
168
|
|
- inputVal(index ,index1,val){
|
169
|
|
- this.$set(this.listToDetails.listVO[index].preferentialPrice, index1, { ...this.listToDetails.listVO[index], preferentialPrice: val });
|
|
263
|
+ inputVal(index, index1, val) {
|
|
264
|
+ this.$set(this.listToDetails.listVO[index].preferentialPrice, index1, {
|
|
265
|
+ ...this.listToDetails.listVO[index],
|
|
266
|
+ preferentialPrice: val
|
|
267
|
+ })
|
170
|
268
|
},
|
171
|
|
- changeVal(index ,index1,val){
|
172
|
|
- this.$set(this.listToDetails.listVO[index].total, index1, { ...this.listToDetails.listVO[index], total: val });
|
|
269
|
+ changeVal(index, index1, val) {
|
|
270
|
+ this.$set(this.listToDetails.listVO[index].total, index1, {
|
|
271
|
+ ...this.listToDetails.listVO[index],
|
|
272
|
+ total: val
|
|
273
|
+ })
|
173
|
274
|
},
|
174
|
|
- async submit(){
|
175
|
|
- if(this.collectCostPatientsType == 1){
|
|
275
|
+ async submit() {
|
|
276
|
+ if (this.collectCostPatientsType == 1) {
|
176
|
277
|
const res = await collectCostPatientsUpdate(this.listToDetails)
|
177
|
|
- if (res.code !== 200) return this.message.$error(res.msg);
|
|
278
|
+ if (res.code !== 200) return this.$message.error(res.msg)
|
178
|
279
|
this.$message.success('化价成功')
|
179
|
|
- }else {
|
|
280
|
+ } else {
|
180
|
281
|
const res = await collectCost({
|
181
|
282
|
id: this.collectCostPatientsId,
|
182
|
283
|
netReceiptsCost: this.listToDetails.netReceiptsCost
|
183
|
284
|
})
|
184
|
|
- if (res.code !== 200) return this.message.$error(res.msg);
|
|
285
|
+ if (res.code !== 200) return this.$message.error(res.msg)
|
185
|
286
|
this.$message.success('收费成功')
|
186
|
287
|
}
|
187
|
288
|
|
188
|
289
|
this.cancel()
|
189
|
|
- },
|
|
290
|
+ }
|
190
|
291
|
}
|
191
|
292
|
}
|
192
|
293
|
</script>
|