add.vue
28.3 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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
<template>
<view class="page">
<scroll-view class="scroll" scroll-y>
<!-- 基础信息 -->
<uni-list>
<uni-list-item class="select-item" :class="form.weighingTicketId ? 'is-filled' : 'is-empty'" clickable
@click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow>
<template v-slot:body>
<view class="item-title"><text class="required">*</text><text>码单编号</text></view>
</template>
</uni-list-item>
<uni-list-item title="日期">
<template v-slot:footer>
<uni-easyinput :value="ticketDateText" :inputBorder="false" disabled placeholder="选择码单后自动带出" />
</template>
</uni-list-item>
<uni-list-item title="计划编号">
<template v-slot:footer>
<uni-easyinput :value="form.code" :inputBorder="false" disabled placeholder="选择码单后自动带出" />
</template>
</uni-list-item>
<uni-list-item title="单位">
<template v-slot:footer>
<uni-easyinput v-model="form.supplierName" :inputBorder="false" disabled placeholder="选择码单后自动带出" />
</template>
</uni-list-item>
<uni-list-item title="分厂">
<template v-slot:footer>
<uni-easyinput v-model="form.workshopName" :inputBorder="false" disabled placeholder="选择码单后自动带出" />
</template>
</uni-list-item>
</uni-list>
<!-- 申请净重明细(只读) -->
<view class="sub-table">
<view class="header">
<image class="opCollapse" src="/static/images/title.png" />
<text class="title">申请净重明细</text>
</view>
<view class="add-list">
<view v-if="!applyList.length" class="empty-tip">选择码单后自动带出</view>
<view v-for="(item, idx) in applyList" :key="'a-' + (item.rowId || idx)" class="block">
<uni-list>
<uni-list-item title="类别">
<template v-slot:footer>
<uni-easyinput :value="item.category" :inputBorder="false" disabled />
</template>
</uni-list-item>
<uni-list-item title="数量">
<template v-slot:footer>
<uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
</template>
</uni-list-item>
</uni-list>
</view>
</view>
</view>
<!-- 详情明细(可编辑) -->
<view class="sub-table">
<view class="header">
<image class="opCollapse" src="/static/images/title.png" />
<text class="title">详情明细</text>
<view class="ops">
<image class="opAdd" @click="addRow" src="/static/images/plus.png" />
</view>
</view>
<view class="add-list">
<view v-if="!detailList.length" class="empty-tip">选择码单后自动带出,也可新增行</view>
<view v-for="(item, idx) in detailList" :key="'d-' + (item.rowId || idx)" class="block">
<uni-list>
<!-- 计划编号:插入行选择,码单带出行只读 -->
<uni-list-item v-if="!item.brought" class="select-item" :class="item.planCode ? 'is-filled' : 'is-empty'">
<template v-slot:body>
<view class="item-title"><text class="required">*</text><text>计划编号</text></view>
</template>
<template v-slot:footer>
<picker mode="selector" :range="planCodeLabels"
@change="(e) => handlePlanChange(idx, Number(e.detail.value))">
<view class="picker-value" :class="{ placeholder: !item.planCode }">
{{ item.planCode || '请选择计划编号' }}
</view>
</picker>
</template>
</uni-list-item>
<uni-list-item v-else title="计划编号">
<template v-slot:footer>
<uni-easyinput :value="item.planCode" :inputBorder="false" disabled />
</template>
</uni-list-item>
<!-- 品种:插入行选择计划后可选,码单带出行只读 -->
<uni-list-item v-if="!item.brought" class="select-item" :class="item.productId ? 'is-filled' : 'is-empty'">
<template v-slot:body>
<view class="item-title"><text>品种</text></view>
</template>
<template v-slot:footer>
<picker mode="selector" :range="getProductLabels(item)" :disabled="!item.procurementPlanId"
@change="(e) => handleProductChange(idx, Number(e.detail.value))">
<view class="picker-value" :class="{ placeholder: !item.productName }">
{{ item.productName || (item.procurementPlanId ? '请选择品种' : '请先选择计划编号') }}
</view>
</picker>
</template>
</uni-list-item>
<uni-list-item v-else title="品种">
<template v-slot:footer>
<uni-easyinput :value="item.productName" :inputBorder="false" disabled />
</template>
</uni-list-item>
<!-- 类别:插入行未选品种时不可选,其余可选 -->
<uni-list-item class="select-item" :class="item.category ? 'is-filled' : 'is-empty'">
<template v-slot:body>
<view class="item-title"><text>类别</text></view>
</template>
<template v-slot:footer>
<picker v-if="item.brought || item.productId" mode="selector" :range="varietyLabels"
@change="(e) => handleVarietyChange(idx, Number(e.detail.value))">
<view class="picker-value" :class="{ placeholder: !item.category }">
{{ item.category || '请选择类别' }}
</view>
</picker>
<uni-easyinput v-else :value="item.category" :inputBorder="false" disabled placeholder="请先选择品种" />
</template>
</uni-list-item>
<!-- 名称:码单带出行/已选品种只读 -->
<uni-list-item title="名称">
<template v-slot:footer>
<uni-easyinput v-if="!item.brought && !item.productId" v-model="item.name" :inputBorder="false" placeholder="请输入名称" />
<uni-easyinput v-else :value="item.name" :inputBorder="false" disabled />
</template>
</uni-list-item>
<uni-list-item title="过磅数">
<template v-slot:footer>
<uni-easyinput :value="item.weighQuantity" :inputBorder="false" disabled />
</template>
</uni-list-item>
<uni-list-item title="杂率(%)">
<template v-slot:footer>
<uni-easyinput v-model="item.impurityRate" type="digit" :inputBorder="false" placeholder="请输入杂率" />
</template>
</uni-list-item>
<uni-list-item title="折斤">
<template v-slot:footer>
<uni-easyinput v-model="item.foldWeight" type="digit" :inputBorder="false" placeholder="请输入折斤" />
</template>
</uni-list-item>
<uni-list-item title="退料">
<template v-slot:footer>
<uni-easyinput v-model="item.returnWeight" type="digit" :inputBorder="false" placeholder="请输入退料" />
</template>
</uni-list-item>
<uni-list-item title="入库净重">
<template v-slot:footer>
<uni-easyinput v-model="item.netWeight" type="digit" :inputBorder="false" placeholder="请输入入库净重" />
</template>
</uni-list-item>
<uni-list-item title="备注">
<template v-slot:footer>
<uni-easyinput v-model="item.remark" :inputBorder="false" placeholder="请输入备注" />
</template>
</uni-list-item>
</uni-list>
<view class="block-ops">
<div class="toggle" @click="insertRow(idx)">
<image src="/static/images/plus.png" class="icon" />插入
</div>
<div v-if="!item.brought" class="del" @click="delRow(idx)">
<image src="/static/images/delete.png" class="icon" />删除
</div>
</view>
</view>
</view>
</view>
<!-- 合计 -->
<view class="total-card">
<view class="total-title">合计</view>
<view class="total-body">
<view class="total-item">
<text class="total-label">过磅数</text>
<text class="total-value">{{ totalSummary.totalWeighQuantity || '-' }}</text>
</view>
<view class="total-item">
<text class="total-label">折斤</text>
<text class="total-value">{{ totalSummary.totalFoldWeight || '-' }}</text>
</view>
<view class="total-item">
<text class="total-label">退料</text>
<text class="total-value">{{ totalSummary.totalReturnWeight || '-' }}</text>
</view>
<view class="total-item">
<text class="total-label">入库净重</text>
<text class="total-value">{{ totalSummary.totalNetWeight || '-' }}</text>
</view>
</view>
</view>
<!-- 其他信息 -->
<view class="remark-section">
<view class="header">
<image class="opCollapse" src="/static/images/title.png" />
<text class="title">其他信息</text>
</view>
<view class="section-content">
<uni-list>
<uni-list-item class="select-item" :class="form.settleType ? 'is-filled' : 'is-empty'">
<template v-slot:body>
<view class="item-title"><text class="required">*</text><text>类型</text></view>
</template>
<template v-slot:footer>
<picker mode="selector" :range="settleTypeLabels" @change="onSettleTypeChange">
<view class="picker-value" :class="{ placeholder: !form.settleType }">
{{ settleTypeName || '请选择类型' }}
</view>
</picker>
</template>
</uni-list-item>
</uni-list>
<view class="remark-group">
<view class="remark-label">备注</view>
<uni-easyinput v-model="form.remark" type="textarea" :inputBorder="false" placeholder="请输入备注" maxlength="2000" autoHeight />
</view>
</view>
</view>
<view class="footer">
<button class="btn submit" type="primary" @click="onSubmit">保存</button>
</view>
</scroll-view>
<RelateSelectSheet :visible.sync="ticketSheet.visible" title="选择码单" :multiple="false"
:fetchFn="ticketSheet.fetchFn" :display-fields="ticketSheet.displayFields"
row-key="id" :selectedKeys.sync="ticketSheet.selectedKeys" @confirm="onTicketConfirm" />
</view>
</template>
<script>
import RelateSelectSheet from '@/components/relate-select/index.vue'
import {
materialSettleTicketPageApi,
materialSettlePlanOptionsApi,
materialSettlePlanLineOptionsApi,
materialSettleCreateApi,
productVarietyQueryApi
} from '@/api/procure-manage/materialSettlement.js'
import { getDicByCodes } from '@/utils/dic.js'
export default {
name: 'AddMaterialSettlement',
components: { RelateSelectSheet },
data() {
return {
form: {
weighingTicketId: '',
weighingTicketCode: '',
completeTime: '',
code: '',
supplierName: '',
workshopName: '',
settleType: '',
remark: ''
},
dicOptions: { SETTLE_TYPE: [] },
// 选中的码单行
selectedTicketRow: null,
// 申请净重明细(只读)
applyList: [],
// 详情明细(可编辑)
detailList: [],
// 计划编号下拉选项(当前码单可选计划)
planOptions: [],
// 品种(类别)下拉选项
varietyOptions: [],
ticketSheet: {
visible: false,
fetchFn: null,
displayFields: [
{ label: '码单编号', field: 'code' },
{ label: '供应商', field: 'supplierName' },
{ label: '分厂', field: 'workshopName' },
{ label: '创建人', field: 'createBy' },
{ label: '完成时间', field: 'completeTime' }
],
selectedKeys: []
}
}
},
computed: {
settleTypeLabels() {
return (this.dicOptions.SETTLE_TYPE || []).map(it => it.name)
},
settleTypeName() {
const found = (this.dicOptions.SETTLE_TYPE || []).find(it => String(it.code) === String(this.form.settleType))
return found ? found.name : ''
},
ticketDateText() {
const s = this.form.completeTime == null ? '' : String(this.form.completeTime)
return s ? s.slice(0, 10) : ''
},
planCodeLabels() {
return this.planOptions.map(o => o.label)
},
varietyLabels() {
return (this.varietyOptions || []).map(item =>
[item.productName, item.code].filter(Boolean).join(' ')
)
},
// 详情明细各数值列合计(过磅数/折斤/入库净重保留两位小数,退料取整)
totalSummary() {
const list = this.detailList || []
const sum = (field, fixed) => Number(
list.reduce((acc, row) => acc + Number(row[field] || 0), 0).toFixed(fixed)
)
return {
totalWeighQuantity: sum('weighQuantity', 2),
totalFoldWeight: sum('foldWeight', 2),
totalReturnWeight: sum('returnWeight', 0),
totalNetWeight: sum('netWeight', 2)
}
}
},
created() {
this.ticketSheet.fetchFn = this.fetchTickets.bind(this)
this.loadDicData()
this.loadVarietyOptions()
},
methods: {
async loadDicData() {
try {
const results = await getDicByCodes(['SETTLE_TYPE'])
this.dicOptions.SETTLE_TYPE = (results.SETTLE_TYPE && results.SETTLE_TYPE.data) || []
} catch (e) {
this.dicOptions = { SETTLE_TYPE: [] }
}
},
async loadVarietyOptions() {
try {
const res = await productVarietyQueryApi({ pageIndex: 1, pageSize: 9999 })
const _data = (res && res.data) || {}
this.varietyOptions = _data.datas || _data.list || _data.records || []
} catch (e) {
this.varietyOptions = []
}
},
onSettleTypeChange(e) {
const idx = Number(e.detail.value)
const opt = (this.dicOptions.SETTLE_TYPE || [])[idx]
this.form.settleType = opt && opt.code != null ? String(opt.code) : ''
},
// 码单选择弹窗数据源
fetchTickets({ pageIndex, pageSize, extra }) {
const keyword = (extra && extra.keyword) || ''
const params = {
pageIndex,
pageSize,
code: keyword || undefined
}
return materialSettleTicketPageApi(params).then(res => {
const _data = (res && res.data) || {}
const records = _data.datas || _data.list || _data.records || []
const totalCount = _data.totalCount || _data.count || 0
const hasNext = _data.hasNext || false
return { records, totalCount, hasNext }
}).catch(() => ({ records: [], totalCount: 0, hasNext: false }))
},
openTicketSheet() {
this.ticketSheet.selectedKeys = this.selectedTicketRow ? [this.selectedTicketRow.id] : []
this.ticketSheet.visible = true
},
// 码单选择回调:由所选码单行带出主表信息与明细数据
onTicketConfirm({ items }) {
const row = (items || [])[0]
if (!row) return
if (this.selectedTicketRow && this.selectedTicketRow.id === row.id) return
this.selectedTicketRow = row
this.form.weighingTicketId = row.id || ''
this.form.weighingTicketCode = row.code || ''
this.form.completeTime = row.completeTime || ''
this.form.code = row.code || ''
this.form.supplierName = row.supplierName || ''
this.form.workshopName = row.workshopName || ''
this.form.settleType = row.settleType || ''
this.form.remark = row.remark || ''
// 申请净重明细:由码单带出
this.applyList = (row.applyLines || []).map(item => ({
rowId: genRowId(),
weighingTicketApplyLineId: item.weighingTicketApplyLineId || item.id || '',
category: item.category || '',
breedRelationshipId: item.breedRelationshipId || '',
quantity: item.quantity == null ? '' : item.quantity
}))
// 详情明细:由码单过磅明细带出(不可删除,计划编号/品种/过磅数不可编辑)
this.detailList = (row.weighLines || []).map(item => ({
rowId: genRowId(),
brought: true,
procurementPlanId: item.procurementPlanId || '',
planCode: item.planCode || '',
productId: item.productId || '',
productName: item.productName || '',
category: item.category || '',
breedRelationshipId: item.breedRelationshipId || '',
name: item.name || item.invoiceProductName || '',
weighQuantity: item.quantity == null ? '' : item.quantity,
impurityRate: '',
foldWeight: '',
returnWeight: '',
netWeight: '',
remark: ''
}))
// 加载当前码单可选计划下拉
this.loadPlanOptions(this.form.weighingTicketId)
},
loadPlanOptions(ticketId) {
if (!ticketId) {
this.planOptions = []
return
}
materialSettlePlanOptionsApi({ ticketId })
.then(res => {
const list = (res && res.data) || []
this.planOptions = (list || []).map(item => ({
label: item.planCode || '',
value: item.planId || item.id || ''
}))
})
.catch(() => {
this.planOptions = []
})
},
// 计划编号改选:重置品种与类别带出并加载该计划下可选品种
handlePlanChange(idx, optIdx) {
const opt = this.planOptions[optIdx]
if (!opt) return
const row = this.detailList[idx]
row.procurementPlanId = opt.value
row.planCode = opt.label
row.productId = ''
row.productName = ''
row.name = ''
row.weighQuantity = ''
row.category = ''
row.breedRelationshipId = ''
row.productOptions = []
materialSettlePlanLineOptionsApi({ planId: opt.value })
.then(res => {
const list = (res && res.data) || []
row.productOptions = (list || []).map(line => ({
label: line.productName || '',
value: line.productId || '',
name: line.name || '',
weighQuantity: line.weighQuantity == null ? (line.quantity == null ? '' : line.quantity) : line.weighQuantity,
category: line.category || '',
breedRelationshipId: line.breedRelationshipId || ''
}))
})
.catch(() => {
row.productOptions = []
})
},
getProductLabels(item) {
return (item.productOptions || []).map(o => o.label)
},
// 品种改选:带出名称、过磅数与类别;清空时同步清空带出数据
handleProductChange(idx, optIdx) {
const row = this.detailList[idx]
const item = (row.productOptions || [])[optIdx]
if (!item) {
row.productName = ''
row.name = ''
row.weighQuantity = ''
row.category = ''
row.breedRelationshipId = ''
return
}
row.productId = item.value
row.productName = item.label
row.name = item.name || ''
row.weighQuantity = item.weighQuantity == null ? '' : item.weighQuantity
row.category = item.category || ''
row.breedRelationshipId = item.breedRelationshipId || ''
},
// 类别改选:category=code,breedRelationshipId=id
handleVarietyChange(idx, optIdx) {
const raw = (this.varietyOptions || [])[optIdx]
if (!raw) return
const row = this.detailList[idx]
row.category = raw.code || ''
row.breedRelationshipId = raw.id || ''
},
// 新增空行
addRow() {
this.detailList.push(this.createRow())
},
// 在当前行下方插入空行
insertRow(idx) {
this.detailList.splice(idx + 1, 0, this.createRow())
},
// 删除行(仅插入行可删除)
delRow(idx) {
this.detailList.splice(idx, 1)
},
// 构造空行
createRow() {
return {
rowId: genRowId(),
brought: false,
procurementPlanId: '',
planCode: '',
productId: '',
productName: '',
category: '',
breedRelationshipId: '',
name: '',
weighQuantity: '',
impurityRate: '',
foldWeight: '',
returnWeight: '',
netWeight: '',
remark: '',
productOptions: []
}
},
validate() {
if (!this.form.weighingTicketId) return this.tip('请选择码单编号')
if (!this.form.settleType) return this.tip('请选择类型')
return true
},
tip(msg) {
uni.showToast({ title: msg, icon: 'none' })
return false
},
buildSubmitData() {
const t = this.totalSummary
return {
weighingTicketId: this.form.weighingTicketId,
settleType: this.form.settleType,
totalWeighQuantity: String(t.totalWeighQuantity),
totalFoldWeight: String(t.totalFoldWeight),
totalReturnWeight: String(t.totalReturnWeight),
totalNetWeight: String(t.totalNetWeight),
remark: this.form.remark || '',
// 申请净重明细
applyLines: (this.applyList || []).map(item => ({
weighingTicketApplyLineId: item.weighingTicketApplyLineId || '',
category: item.category || '',
breedRelationshipId: item.breedRelationshipId || '',
quantity: item.quantity == null ? '' : String(item.quantity),
itemId: item.breedRelationshipId || ''
})),
// 详情明细
lines: (this.detailList || []).map(item => ({
procurementPlanId: item.procurementPlanId || '',
planCode: item.planCode || '',
productId: item.productId || '',
category: item.category || '',
name: item.name || '',
weighQuantity: item.weighQuantity == null ? '' : String(item.weighQuantity),
impurityRate: item.impurityRate == null ? '' : String(item.impurityRate),
foldWeight: item.foldWeight == null ? '' : String(item.foldWeight),
returnWeight: item.returnWeight == null ? '' : String(item.returnWeight),
netWeight: item.netWeight == null ? '' : String(item.netWeight),
remark: item.remark || '',
itemId: item.breedRelationshipId || ''
}))
}
},
async onSubmit() {
if (!this.validate()) return
const confirmRes = await new Promise(resolve => {
uni.showModal({ title: '提示', content: '确定保存原料结算详情单吗?', confirmText: '确定', cancelText: '取消', success: resolve })
})
if (!(confirmRes && confirmRes.confirm)) return
uni.showLoading({ title: '提交中...', mask: true })
materialSettleCreateApi(this.buildSubmitData())
.then(() => {
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'none' })
try { uni.setStorageSync('MATERIAL_SETTLEMENT_LIST_NEED_REFRESH', '1') } catch (e) {}
setTimeout(() => { uni.navigateBack() }, 400)
})
.catch(e => {
uni.hideLoading()
uni.showToast({ title: (e && (e.msg || e.message)) || '保存失败', icon: 'none' })
})
}
}
}
// 生成前端临时行 id
function genRowId() {
return 'row_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 8)
}
</script>
<style lang="scss" scoped>
.page {
display: flex;
flex-direction: column;
height: 100%;
}
.scroll {
flex: 1;
padding: 12rpx 0 200rpx !important;
}
.footer {
z-index: 2;
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 32rpx;
padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
background: #fff;
box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
.btn {
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
font-size: 32rpx;
}
.submit {
background: $theme-primary;
color: #fff;
}
}
::v-deep .uni-list {
.uni-easyinput {
display: flex;
.uni-input-input {
color: rgba(0, 0, 0, 0.9);
}
}
.uni-input-placeholder {
z-index: 1;
}
.uni-input-input {
background-color: #ffffff;
}
background: transparent;
&-item {
&__extra-text {
font-size: 32rpx;
}
&__content-title {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.9);
}
&__container {
padding: 32rpx;
.uni-easyinput {
&__placeholder-class {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.4);
}
&__content {
border: none;
background-color: #ffffff !important;
&-input {
padding-left: 0 !important;
height: 48rpx;
line-height: 48rpx;
font-size: 32rpx;
}
.content-clear-icon {
font-size: 44rpx !important;
}
}
}
.item-title,
.uni-list-item__content {
flex: none;
min-height: 48rpx;
line-height: 48rpx;
font-size: 32rpx;
position: relative;
width: 240rpx;
margin-right: 32rpx;
color: rgba(0, 0, 0, 0.9);
.required {
color: red;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: -16rpx;
}
}
}
&.select-item {
&.is-empty {
.uni-list-item__extra-text {
color: rgba(0, 0, 0, 0.4) !important;
}
}
&.is-filled {
.uni-list-item__extra-text {
color: rgba(0, 0, 0, 0.9) !important;
}
}
}
}
}
.picker-value {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.9);
line-height: 48rpx;
text-align: right;
min-height: 48rpx;
&.placeholder {
color: rgba(0, 0, 0, 0.4);
}
}
.sub-table,
.remark-section {
margin-top: 20rpx;
background: #fff;
}
.header {
display: flex;
align-items: center;
padding: 24rpx 32rpx;
border-bottom: 1rpx solid #f0f0f0;
.opCollapse {
width: 32rpx;
height: 28rpx;
margin-right: 16rpx;
margin-top: 8rpx;
}
.title {
font-size: 32rpx;
color: rgba(0, 0, 0, 0.9);
font-weight: 600;
flex: 1;
}
.ops {
display: flex;
align-items: center;
.opAdd {
width: 40rpx;
height: 40rpx;
}
}
}
.add-list {
padding: 0 0 16rpx;
.empty-tip {
text-align: center;
padding: 60rpx 0;
color: rgba(0, 0, 0, 0.4);
font-size: 28rpx;
}
.block {
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.block-ops {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 48rpx;
padding: 20rpx 32rpx;
background: #f8f8f8;
.del,
.toggle {
display: flex;
align-items: center;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.6);
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
.del {
color: #d54941;
}
}
}
}
.total-card {
margin-top: 20rpx;
background: #fff;
padding: 24rpx 32rpx;
.total-title {
font-size: 32rpx;
font-weight: 600;
color: rgba(0, 0, 0, 0.9);
margin-bottom: 20rpx;
}
.total-body {
display: flex;
flex-wrap: wrap;
.total-item {
width: 50%;
display: flex;
align-items: center;
margin-bottom: 20rpx;
&:nth-last-child(-n + 2) {
margin-bottom: 0;
}
.total-label {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.6);
margin-right: 16rpx;
}
.total-value {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.9);
font-weight: 500;
}
}
}
}
.section-content {
padding: 32rpx;
}
.remark-group {
margin-top: 8rpx;
.remark-label {
display: flex;
align-items: center;
font-size: 32rpx;
color: rgba(0, 0, 0, 0.9);
margin-bottom: 16rpx;
}
}
</style>