|
|
@@ -44,14 +44,34 @@
|
|
44
|
44
|
@confirm="handleAddOneConfirm"
|
|
45
|
45
|
>
|
|
46
|
46
|
<view class="add-one-modal-content">
|
|
47
|
|
- <u-button
|
|
48
|
|
- type="primary"
|
|
49
|
|
- plain
|
|
50
|
|
- @click="showBrandSelector = true"
|
|
51
|
|
- class="brand-select-btn"
|
|
52
|
|
- >
|
|
53
|
|
- {{ currentAddBrand.dictLabel || '点击请选择品牌' }}
|
|
54
|
|
- </u-button>
|
|
|
47
|
+ <view class="add-one-form-item">
|
|
|
48
|
+ <text class="form-label">品牌<text class="required">*</text></text>
|
|
|
49
|
+ <u-button
|
|
|
50
|
+ type="primary"
|
|
|
51
|
+ plain
|
|
|
52
|
+ @click="showBrandSelector = true"
|
|
|
53
|
+ class="brand-select-btn"
|
|
|
54
|
+ >
|
|
|
55
|
+ {{ currentAddBrand.dictLabel || '点击请选择品牌' }}
|
|
|
56
|
+ </u-button>
|
|
|
57
|
+ </view>
|
|
|
58
|
+ <view class="add-one-form-item">
|
|
|
59
|
+ <text class="form-label">型号</text>
|
|
|
60
|
+ <u-input
|
|
|
61
|
+ v-model="currentAddModel"
|
|
|
62
|
+ placeholder="请输入型号"
|
|
|
63
|
+ class="form-input"
|
|
|
64
|
+ />
|
|
|
65
|
+ </view>
|
|
|
66
|
+ <view class="add-one-form-item">
|
|
|
67
|
+ <text class="form-label">价格</text>
|
|
|
68
|
+ <u-input
|
|
|
69
|
+ v-model="currentAddPrice"
|
|
|
70
|
+ placeholder="请输入价格"
|
|
|
71
|
+ type="number"
|
|
|
72
|
+ class="form-input"
|
|
|
73
|
+ />
|
|
|
74
|
+ </view>
|
|
55
|
75
|
</view>
|
|
56
|
76
|
</u-modal>
|
|
57
|
77
|
|
|
|
@@ -122,6 +142,8 @@ export default {
|
|
122
|
142
|
// 品牌选择相关
|
|
123
|
143
|
brandColumns: [[]],
|
|
124
|
144
|
currentAddBrand: {},
|
|
|
145
|
+ currentAddModel: '',
|
|
|
146
|
+ currentAddPrice: '',
|
|
125
|
147
|
// 模态窗配置
|
|
126
|
148
|
modalConfig: {
|
|
127
|
149
|
title: '',
|
|
|
@@ -312,9 +334,17 @@ export default {
|
|
312
|
334
|
* 确认加一单
|
|
313
|
335
|
*/
|
|
314
|
336
|
async handleAddOneConfirm() {
|
|
|
337
|
+ // 验证品牌是否已选择(必选)
|
|
|
338
|
+ if (!this.currentAddBrand.dictValue) {
|
|
|
339
|
+ uni.$u.toast('请选择品牌')
|
|
|
340
|
+ return
|
|
|
341
|
+ }
|
|
|
342
|
+
|
|
315
|
343
|
try {
|
|
316
|
344
|
await uni.$u.api.addReceiptForm({
|
|
317
|
345
|
brand: this.currentAddBrand.dictValue,
|
|
|
346
|
+ model: this.currentAddModel || '',
|
|
|
347
|
+ sellingPrice: this.currentAddPrice || '',
|
|
318
|
348
|
sendFormId: this.orderId,
|
|
319
|
349
|
clueId: this.clueId
|
|
320
|
350
|
})
|
|
|
@@ -326,6 +356,8 @@ export default {
|
|
326
|
356
|
} finally {
|
|
327
|
357
|
this.addOneModalVisible = false
|
|
328
|
358
|
this.currentAddBrand = {}
|
|
|
359
|
+ this.currentAddModel = ''
|
|
|
360
|
+ this.currentAddPrice = ''
|
|
329
|
361
|
}
|
|
330
|
362
|
},
|
|
331
|
363
|
|
|
|
@@ -335,6 +367,8 @@ export default {
|
|
335
|
367
|
handleAddOneCancel() {
|
|
336
|
368
|
this.addOneModalVisible = false
|
|
337
|
369
|
this.currentAddBrand = {}
|
|
|
370
|
+ this.currentAddModel = ''
|
|
|
371
|
+ this.currentAddPrice = ''
|
|
338
|
372
|
}
|
|
339
|
373
|
}
|
|
340
|
374
|
}
|
|
|
@@ -397,7 +431,36 @@ export default {
|
|
397
|
431
|
padding: 20rpx 0;
|
|
398
|
432
|
}
|
|
399
|
433
|
|
|
|
434
|
+.add-one-form-item {
|
|
|
435
|
+ margin-bottom: 30rpx;
|
|
|
436
|
+
|
|
|
437
|
+ &:last-child {
|
|
|
438
|
+ margin-bottom: 0;
|
|
|
439
|
+ }
|
|
|
440
|
+}
|
|
|
441
|
+
|
|
|
442
|
+.form-label {
|
|
|
443
|
+ display: block;
|
|
|
444
|
+ font-size: 28rpx;
|
|
|
445
|
+ color: #333;
|
|
|
446
|
+ margin-bottom: 15rpx;
|
|
|
447
|
+ font-weight: 500;
|
|
|
448
|
+}
|
|
|
449
|
+
|
|
|
450
|
+.required {
|
|
|
451
|
+ color: #f56c6c;
|
|
|
452
|
+ margin-left: 4rpx;
|
|
|
453
|
+}
|
|
|
454
|
+
|
|
400
|
455
|
.brand-select-btn {
|
|
401
|
456
|
width: 100%;
|
|
402
|
457
|
}
|
|
|
458
|
+
|
|
|
459
|
+.form-input {
|
|
|
460
|
+ width: 100%;
|
|
|
461
|
+ border: 2rpx solid #e0e0e0;
|
|
|
462
|
+ border-radius: 10rpx;
|
|
|
463
|
+ padding: 20rpx;
|
|
|
464
|
+ font-size: 28rpx;
|
|
|
465
|
+}
|
|
403
|
466
|
</style>
|