Form copy.vue
16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="90%">
<el-row :gutter="15" class="" >
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules">
<el-col :span="8" v-if="false" >
<el-form-item label="耗卡编号" prop="id">
<el-input v-model="dataForm.id" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门店" prop="md">
<el-select v-model="dataForm.md" placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
<el-option v-for="(item, index) in mdOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门店编号" prop="mdbh">
<el-input v-model="dataForm.mdbh" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门店名称" prop="mdmc">
<el-input v-model="dataForm.mdmc" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="会员" prop="hy">
<el-select v-model="dataForm.hy" placeholder="请选择" clearable :style='{"width":"100%"}' filterable >
<el-option v-for="(item, index) in hyOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="会员账号" prop="hyzh">
<el-input v-model="dataForm.hyzh" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="会员名称" prop="hymc">
<el-input v-model="dataForm.hymc" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="顾客类型" prop="gklx">
<el-select v-model="dataForm.gklx" placeholder="请选择" clearable :style='{"width":"100%"}' >
<el-option v-for="(item, index) in gklxOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="消费金额" prop="xfje">
<el-input v-model="dataForm.xfje" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="手工费用" prop="sgfy">
<el-input v-model="dataForm.sgfy" placeholder="请输入" clearable :style='{"width":"100%"}' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否有科技部" prop="sfykjb">
<el-radio-group v-model="dataForm.sfykjb" :style='{}' >
<el-radio v-for="(item, index) in sfykjbOptions" :key="index" :label="item.id" >{{item.fullName}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label-width="0">
<el-table :data="dataForm.lqXhJksyjList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="id" label="业绩编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.id" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="glkdbh" label="关联开单编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.glkdbh" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="jks" label="健康师">
<template slot-scope="scope">
<user-select v-model="scope.row.jks" placeholder="请选择" clearable ></user-select>
</template>
</el-table-column>
<el-table-column prop="jksxm" label="健康师姓名">
<template slot-scope="scope">
<el-input v-model="scope.row.jksxm" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="jkszh" label="健康师账号">
<template slot-scope="scope">
<el-input v-model="scope.row.jkszh" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="jksyj" label="健康师业绩">
<template slot-scope="scope">
<el-input v-model="scope.row.jksyj" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="yjsj" label="业绩时间" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.yjsj" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="NCC-table-delBtn" @click="handleDelLqXhJksyjEntityList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addHandleLqXhJksyjEntityList()">
<el-button type="text" icon="el-icon-plus">新增</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label-width="0">
<el-table :data="dataForm.lqXhKjbsyjList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="id" label="业绩编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.id" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="glkdbh" label="关联开单编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.glkdbh" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="kjbls" label="科技部老师">
<template slot-scope="scope">
<user-select v-model="scope.row.kjbls" placeholder="请选择" clearable ></user-select>
</template>
</el-table-column>
<el-table-column prop="kjblsxm" label="科技部老师姓名">
<template slot-scope="scope">
<el-input v-model="scope.row.kjblsxm" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="kjblszh" label="科技部老师账号">
<template slot-scope="scope">
<el-input v-model="scope.row.kjblszh" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="kjblsyj" label="科技部老师业绩">
<template slot-scope="scope">
<el-input v-model="scope.row.kjblsyj" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="yjsj" label="业绩时间" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.yjsj" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="NCC-table-delBtn" @click="handleDelLqXhKjbsyjEntityList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addHandleLqXhKjbsyjEntityList()">
<el-button type="text" icon="el-icon-plus">新增</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label-width="0">
<el-table :data="dataForm.lqXhPxmxList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="id" label="明细编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.id" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="glkdbh" label="关联开单编号" v-if="false">
<template slot-scope="scope">
<el-input v-model="scope.row.glkdbh" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="px" label="品项">
<template slot-scope="scope">
<el-select v-model="scope.row.px" placeholder="请选择" clearable >
<el-option v-for="(item, index) in pxOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="pxmc" label="品项名称">
<template slot-scope="scope">
<el-input v-model="scope.row.pxmc" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="pxjg" label="品项价格">
<template slot-scope="scope">
<el-input v-model="scope.row.pxjg" placeholder="请输入" clearable ></el-input>
</template>
</el-table-column>
<el-table-column prop="xfzs" label="是否赠送">
<template slot-scope="scope">
<el-select v-model="scope.row.xfzs" placeholder="请选择" clearable >
<el-option v-for="(item, index) in xfzsOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="NCC-table-delBtn" @click="handleDelLqXhPxmxEntityList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addHandleLqXhPxmxEntityList()">
<el-button type="text" icon="el-icon-plus">新增</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="24" v-if="false" >
<el-form-item label="耗卡时间" prop="hksj">
<el-input v-model="dataForm.hksj" placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-if="false" >
<el-form-item label="操作人员" prop="czry">
<el-input v-model="dataForm.czry" placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取 消</el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { previewDataInterface } from '@/api/systemData/dataInterface'
export default {
components: {},
props: [],
data() {
return {
loading: false,
visible: false,
isDetail: false,
dataForm: {
id:'',
id:undefined,
md:undefined,
mdbh:undefined,
mdmc:undefined,
hy:undefined,
hyzh:undefined,
hymc:undefined,
gklx:undefined,
xfje:undefined,
sgfy:undefined,
sfykjb:undefined,
lqXhJksyjList:[],
lqXhKjbsyjList:[],
lqXhPxmxList:[],
hksj:undefined,
czry:undefined,
},
rules: {
},
mdOptions : [],
hyOptions : [],
gklxOptions:[{"fullName":"会员","id":"会员"},{"fullName":"非会员","id":"非会员"},{"fullName":"19.9","id":"19.9"}],
sfykjbOptions:[{"fullName":"是","id":"是"},{"fullName":"否","id":"否"}],
pxOptions : [],
xfzsOptions:[{"fullName":"是","id":"否"},{"fullName":"否","id":"否"}],
}
},
computed: {},
watch: {},
created() {
this.getmdOptions();
this.gethyOptions();
this.getpxOptions();
},
mounted() {
},
methods: {
getmdOptions(){
previewDataInterface('730960205902251269').then(res => {
this.mdOptions = res.data
});
},
gethyOptions(){
previewDataInterface('730998109110273285').then(res => {
this.hyOptions = res.data
});
},
getpxOptions(){
previewDataInterface('730971133356016901').then(res => {
this.pxOptions = res.data
});
},
goBack() {
this.$emit('refresh')
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
request({
url: '/api/Extend/LqXhHyhk/' + this.dataForm.id,
method: 'get'
}).then(res =>{
this.dataForm = res.data;
})
}
})
},
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.dataForm.id) {
request({
url: `/api/Extend/LqXhHyhk`,
method: 'post',
data: this.dataForm,
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false,
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/Extend/LqXhHyhk/' + this.dataForm.id,
method: 'PUT',
data: this.dataForm
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
}
})
},
addHandleLqXhJksyjEntityList() {
let item = {
id:undefined,
glkdbh:undefined,
jks:undefined,
jksxm:undefined,
jkszh:undefined,
jksyj:undefined,
yjsj:undefined,
}
this.dataForm.lqXhJksyjList.push(item)
},
handleDelLqXhJksyjEntityList(index) {
this.dataForm.lqXhJksyjList.splice(index, 1);
},
addHandleLqXhKjbsyjEntityList() {
let item = {
id:undefined,
glkdbh:undefined,
kjbls:undefined,
kjblsxm:undefined,
kjblszh:undefined,
kjblsyj:undefined,
yjsj:undefined,
}
this.dataForm.lqXhKjbsyjList.push(item)
},
handleDelLqXhKjbsyjEntityList(index) {
this.dataForm.lqXhKjbsyjList.splice(index, 1);
},
addHandleLqXhPxmxEntityList() {
let item = {
id:undefined,
glkdbh:undefined,
px:undefined,
pxmc:undefined,
pxjg:undefined,
xfzs:undefined,
}
this.dataForm.lqXhPxmxList.push(item)
},
handleDelLqXhPxmxEntityList(index) {
this.dataForm.lqXhPxmxList.splice(index, 1);
},
}
}
</script>