Commit 5fa52d77f5dec6b31eb39232b930e6914c21d231

Authored by 史婷婷
1 parent 4dd9e29d

feat:补货单-编辑&新增优化

@@ -712,6 +712,14 @@ @@ -712,6 +712,14 @@
712 "navigationBarBackgroundColor": "#ffffff", 712 "navigationBarBackgroundColor": "#ffffff",
713 "navigationBarTextStyle": "black" 713 "navigationBarTextStyle": "black"
714 } 714 }
  715 + },
  716 + {
  717 + "path": "pages/replenishment_order/modify",
  718 + "style": {
  719 + "navigationBarTitleText": "编辑补货单",
  720 + "navigationBarBackgroundColor": "#ffffff",
  721 + "navigationBarTextStyle": "black"
  722 + }
715 } 723 }
716 ], 724 ],
717 "subPackages": [ 725 "subPackages": [
@@ -69,8 +69,6 @@ @@ -69,8 +69,6 @@
69 </view> 69 </view>
70 <button class="btn submit" type="primary" @click="onSubmit">提交</button> 70 <button class="btn submit" type="primary" @click="onSubmit">提交</button>
71 </view> 71 </view>
72 - <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"  
73 - @confirm="onSheetConfirm" />  
74 <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source" 72 <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source"
75 :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey" 73 :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey"
76 :selectedKeys.sync="relate.selectedKeys" :source-extra="{ queryType: 'REPLENISHMENT' }" 74 :selectedKeys.sync="relate.selectedKeys" :source-extra="{ queryType: 'REPLENISHMENT' }"
@@ -82,14 +80,11 @@ @@ -82,14 +80,11 @@
82 import { loadOrderApi } from '@/api/change_list.js' 80 import { loadOrderApi } from '@/api/change_list.js'
83 import { createApi, getCodeApi } from '@/api/replenishment_order.js' 81 import { createApi, getCodeApi } from '@/api/replenishment_order.js'
84 import Product from './product.vue' 82 import Product from './product.vue'
85 -import SingleSelectSheet from '@/components/single-select/index.vue'  
86 import RelateSelectSheet from '@/components/relate-select/index.vue' 83 import RelateSelectSheet from '@/components/relate-select/index.vue'
87 -import { getDicName } from '@/utils/dic.js'  
88 -import { getDicByCodes } from '@/utils/dic'  
89 84
90 export default { 85 export default {
91 name: 'ReplenishmentOrderAdd', 86 name: 'ReplenishmentOrderAdd',
92 - components: { Product, SingleSelectSheet, RelateSelectSheet }, 87 + components: { Product, RelateSelectSheet },
93 data() { 88 data() {
94 return { 89 return {
95 form: { 90 form: {
@@ -113,24 +108,13 @@ export default { @@ -113,24 +108,13 @@ export default {
113 108
114 }, 109 },
115 initPurchaseOrderLineList: [], 110 initPurchaseOrderLineList: [],
116 - dicOptions: { SUPPLIER: [], APPLICABLE_STANDARD: [] },  
117 - sheet: { visible: false, title: '请选择', options: [], value: '', field: '' },  
118 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, 111 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
119 maxDeliveryDate: new Date().toISOString().substring(0, 10), 112 maxDeliveryDate: new Date().toISOString().substring(0, 10),
120 } 113 }
121 }, 114 },
122 onLoad() { 115 onLoad() {
123 - this.loadDicOptions()  
124 }, 116 },
125 methods: { 117 methods: {
126 - loadDicOptions() {  
127 - const dicCodes = ['SUPPLIER', 'APPLICABLE_STANDARD']  
128 - return getDicByCodes(dicCodes).then(results => {  
129 - this.dicOptions.SUPPLIER = results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : []  
130 - this.dicOptions.APPLICABLE_STANDARD = results.APPLICABLE_STANDARD && results.APPLICABLE_STANDARD.data ? results.APPLICABLE_STANDARD.data : []  
131 - this.refreshStandardName()  
132 - }).catch(() => { this.dicOptions = { SUPPLIER: [], APPLICABLE_STANDARD: [] } })  
133 - },  
134 async loadDetail(id) { 118 async loadDetail(id) {
135 try { 119 try {
136 const res = await getDetailApi(id) 120 const res = await getDetailApi(id)
@@ -140,31 +124,10 @@ export default { @@ -140,31 +124,10 @@ export default {
140 next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({ ...x })) : [] 124 next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({ ...x })) : []
141 this.form = next; 125 this.form = next;
142 this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; 126 this.initPurchaseOrderLineList = next.purchaseOrderLineList || [];
143 - this.refreshStandardName()  
144 } catch (e) { 127 } catch (e) {
145 uni.showToast({ title: '加载失败', icon: 'none' }) 128 uni.showToast({ title: '加载失败', icon: 'none' })
146 } 129 }
147 }, 130 },
148 - refreshStandardName() {  
149 - const est = (this.dicOptions.APPLICABLE_STANDARD || []).find(o => String(o.code) === String(this.form.executionStandard))  
150 - this.form.executionStandardName = est ? (est.name || '') : (this.form.executionStandardName || '')  
151 - },  
152 - openSheet(field) {  
153 - if (field === 'executionStandard') {  
154 - const options = (this.dicOptions.APPLICABLE_STANDARD || []).map(it => ({ label: it.name || '', value: it.code || '' }))  
155 - const current = this.form.executionStandard  
156 - const match = options.find(o => String(o.value) === String(current))  
157 - this.sheet = { ...this.sheet, visible: true, title: '执行标准', options, field, value: match ? match.value : '' }  
158 - }  
159 - },  
160 - onSheetConfirm({ value, label }) {  
161 - const field = this.sheet.field  
162 - if (field === 'executionStandard') {  
163 - this.form.executionStandard = value || ''  
164 - this.form.executionStandardName = label || ''  
165 - }  
166 - this.sheet.visible = false  
167 - },  
168 openRelate(fieldKey) { 131 openRelate(fieldKey) {
169 let config = {} 132 let config = {}
170 if (fieldKey === 'purchaseOrderName') { 133 if (fieldKey === 'purchaseOrderName') {
@@ -186,7 +149,6 @@ export default { @@ -186,7 +149,6 @@ export default {
186 } 149 }
187 const currentId = this.form && (this.form.id || this.form.code) 150 const currentId = this.form && (this.form.id || this.form.code)
188 const selectedKeys = currentId ? [currentId] : [] 151 const selectedKeys = currentId ? [currentId] : []
189 - this.sheet.visible = false  
190 this.relate.title = config.title 152 this.relate.title = config.title
191 this.relate.source = config.source 153 this.relate.source = config.source
192 this.relate.display = config.display 154 this.relate.display = config.display
@@ -222,14 +184,12 @@ export default { @@ -222,14 +184,12 @@ export default {
222 const lines = Array.isArray(next.purchaseOrderLineList) ? next.purchaseOrderLineList.map(x => ({ ...x, purchaseOrderLineId: x.id, shippedQuantity: x.assessmentExceedsAgreement, supplementaryQuantity: '', id: '' })) : [] 184 const lines = Array.isArray(next.purchaseOrderLineList) ? next.purchaseOrderLineList.map(x => ({ ...x, purchaseOrderLineId: x.id, shippedQuantity: x.assessmentExceedsAgreement, supplementaryQuantity: '', id: '' })) : []
223 this.initPurchaseOrderLineList = lines 185 this.initPurchaseOrderLineList = lines
224 this.calculateSummary(lines) 186 this.calculateSummary(lines)
225 - this.refreshStandardName()  
226 } catch (e) { 187 } catch (e) {
227 } 188 }
228 } else { 189 } else {
229 } 190 }
230 } 191 }
231 }, 192 },
232 - getDicName: getDicName,  
233 validateRequired() { 193 validateRequired() {
234 const checks = [ 194 const checks = [
235 { key: 'purchaseOrderName', label: '订单编号' } 195 { key: 'purchaseOrderName', label: '订单编号' }
@@ -24,22 +24,55 @@ @@ -24,22 +24,55 @@
24 </view> 24 </view>
25 </view> 25 </view>
26 </scroll-view> 26 </scroll-view>
  27 + <detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
27 </view> 28 </view>
28 </template> 29 </template>
29 30
30 <script> 31 <script>
31 -import { getDetailApi } from '@/api/replenishment_order.js' 32 +import { getDetailApi, cancelApi } from '@/api/replenishment_order.js'
32 import Product from './product.vue' 33 import Product from './product.vue'
  34 +import DetailButtons from '@/components/detail-buttons/index.vue'
33 35
34 export default { 36 export default {
35 name: 'ReplenishmentOrderDetail', 37 name: 'ReplenishmentOrderDetail',
36 - components: { Product }, 38 + components: { Product, DetailButtons },
37 data() { 39 data() {
38 return { 40 return {
39 form: {}, 41 form: {},
  42 + buttons: [
  43 + { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
  44 + { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' },
  45 + { text: '填写补货时间', visible: true, variant: 'outline', event: 'fill' },
  46 + { text: '审核', visible: true, variant: 'primary', event: 'audit' },
  47 + { text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },
  48 + ]
40 } 49 }
41 }, 50 },
42 computed: { 51 computed: {
  52 + statusFlags() {
  53 + const m = this.form || {}
  54 + const e = String(m.status || '')
  55 + console.log('___m', m)
  56 + console.log('___e', e)
  57 + return {
  58 + isRefuse: e === 'REFUSE' || false,
  59 + isAudit: e === 'AUDIT' || false,
  60 + canEdit: e === 'REFUSE' && m.isOwner || false,
  61 + canAudit: e === 'AUDIT' && m.showExamine || false,
  62 + canCancel: e === 'REFUSE' && m.isOwner || false,
  63 + canFill: e === 'PASS' && !m.completed || false,
  64 + }
  65 + },
  66 + displayButtons() {
  67 + const f = this.statusFlags
  68 + return [
  69 + { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:modify') },
  70 + { ...this.buttons[1], visible: this.$auth.hasPermi('shipping-plan-manage:replenishment-order:review') },
  71 + { ...this.buttons[2], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:fill') },
  72 + { ...this.buttons[3], visible: f.canAudit && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:approve') },
  73 + { ...this.buttons[4], visible: f.canCancel && this.$auth.hasPermi('shipping-plan-manage:replenishment-order:cancel') },
  74 + ]
  75 + }
43 }, 76 },
44 onLoad(query) { 77 onLoad(query) {
45 const id = (query && (query.id || query.code)) || '' 78 const id = (query && (query.id || query.code)) || ''
@@ -53,7 +86,54 @@ export default { @@ -53,7 +86,54 @@ export default {
53 } catch (e) { 86 } catch (e) {
54 this.form = {} 87 this.form = {}
55 } 88 }
56 - } 89 + },
  90 + handleButtonClick(btn) {
  91 + if (!btn || btn.disabled) return
  92 + const map = {
  93 + edit: () => this.onEdit(),
  94 + auditDetail: () => this.onAuditDetail(),
  95 + audit: () => this.onAudit(),
  96 + fill: () => this.onFill(),
  97 + cancel: () => this.onCancel(),
  98 + }
  99 + const fn = map[btn.event]
  100 + if (typeof fn === 'function') fn()
  101 + },
  102 + onEdit() {
  103 + const id = this.form.id || this.form.code
  104 + if (id) uni.navigateTo({ url: `/pages/replenishment_order/modify?id=${id}` })
  105 + },
  106 + onAuditDetail() {
  107 + const id = this.form.id || this.form.code
  108 + if (id) uni.navigateTo({ url: `/pages/approve/index?id=${id}&type=REPLENISHMENT_ORDER` })
  109 + },
  110 + onAudit() {
  111 + const id = this.form.id || this.form.code
  112 + if (id) uni.navigateTo({ url: `/pages/approve/audit?id=${id}&type=REPLENISHMENT_ORDER` })
  113 + },
  114 + onFill() {
  115 + const id = this.form.id || this.form.code
  116 + if (id) uni.navigateTo({ url: `/pages/replenishment_order/fill?id=${id}` })
  117 + },
  118 + onCancel() {
  119 + const id = this.form.id || this.form.code
  120 + if (!id) return
  121 + uni.showModal({
  122 + title: '提示',
  123 + content: '确定要取消该补货单吗?',
  124 + success: async (res) => {
  125 + if (res.confirm) {
  126 + try {
  127 + await cancelApi(id)
  128 + uni.showToast({ title: '取消成功', icon: 'success' })
  129 + this.loadDetail(id)
  130 + } catch (e) {
  131 + uni.showToast({ title: (e && e.msg) || '取消失败', icon: 'none' })
  132 + }
  133 + }
  134 + }
  135 + })
  136 + },
57 } 137 }
58 } 138 }
59 </script> 139 </script>
@@ -71,6 +151,7 @@ export default { @@ -71,6 +151,7 @@ export default {
71 } 151 }
72 152
73 .detail-page { 153 .detail-page {
  154 + padding-bottom: 150rpx;
74 } 155 }
75 156
76 .section { 157 .section {
  1 +<template>
  2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <uni-list>
  5 + <view class="section">
  6 + <!-- 编辑模式下,订单编号通常不允许修改,或者作为只读显示,但为了保持与新增页UI一致,这里保留结构但设为不可点击 -->
  7 + <uni-list-item class="select-item is-filled" :rightText="form.purchaseOrderName || ''">
  8 + <template v-slot:body>
  9 + <view class="item-title"><text class="required">*</text><text>订单编号</text></view>
  10 + </template>
  11 + </uni-list-item>
  12 + <uni-list-item title="补货单编号">
  13 + <template v-slot:footer>
  14 + <view class="readonly-text">{{ form.code }}</view>
  15 + </template>
  16 + </uni-list-item>
  17 + <uni-list-item title="分厂">
  18 + <template v-slot:footer>
  19 + <view class="readonly-text">{{ form.workshopName }}</view>
  20 + </template>
  21 + </uni-list-item>
  22 + <uni-list-item title="办事处">
  23 + <template v-slot:footer>
  24 + <view class="readonly-text">{{ form.deptName }}</view>
  25 + </template>
  26 + </uni-list-item>
  27 + <uni-list-item title="区域">
  28 + <template v-slot:footer>
  29 + <view class="readonly-text">{{ form.regionName }}</view>
  30 + </template>
  31 + </uni-list-item>
  32 + <uni-list-item title="购货单位">
  33 + <template v-slot:footer>
  34 + <view class="readonly-text">{{ form.customerName }}</view>
  35 + </template>
  36 + </uni-list-item>
  37 + <uni-list-item title="原计划发货日期">
  38 + <template v-slot:footer>
  39 + <uni-datetime-picker type="date" v-model="form.originPlanShipDate" :end="maxDeliveryDate" />
  40 + </template>
  41 + </uni-list-item>
  42 + </view>
  43 +
  44 + <!-- 产品 -->
  45 + <view class="section2">
  46 + <!-- mode="add" 允许编辑 -->
  47 + <Product mode="add" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange"
  48 + :orderDate="form.orderDate" />
  49 + </view>
  50 +
  51 + </uni-list>
  52 + </scroll-view>
  53 +
  54 + <view class="footer">
  55 + <view class="view-total">
  56 + <view class="head">合计</view>
  57 + <view class="row">
  58 + <view class="row2">
  59 + <text class="label">需发</text><text class="value">{{ form.totalQuantity }}</text>
  60 + </view>
  61 + <view class="row2">
  62 + <text class="label">实发</text><text class="value">{{ form.totalShippedQuantity }}</text>
  63 + </view>
  64 + </view>
  65 + <view class="row">
  66 + <view class="row2">
  67 + <text class="label">需求补货</text><text class="value">{{ form.totalSupplementaryQuantity }}</text>
  68 + </view>
  69 + </view>
  70 + </view>
  71 + <button class="btn submit" type="primary" @click="onSubmit">保存</button>
  72 + </view>
  73 + </view>
  74 +</template>
  75 +
  76 +<script>
  77 +import { updateApi, getDetailApi } from '@/api/replenishment_order.js'
  78 +import Product from './product.vue'
  79 +
  80 +export default {
  81 + name: 'ReplenishmentOrderModify',
  82 + components: { Product },
  83 + data() {
  84 + return {
  85 + form: {
  86 + purchaseOrderId: '',
  87 + id: '',
  88 + // 订单基础信息
  89 + purchaseOrderName: '',
  90 + customerName: '',
  91 + customerId: '',
  92 + workshopName: '',
  93 + workshopId: '',
  94 + originPlanShipDate: '',
  95 + deptName: '',
  96 + deptId: '',
  97 + totalQuantity: '',
  98 + totalShippedQuantity: '',
  99 + totalSupplementaryQuantity: '',
  100 + code: '',
  101 + // 默认当前日期 格式为 yyyy-MM-dd
  102 + orderDate: new Date().toISOString().substring(0, 10),
  103 +
  104 + },
  105 + initPurchaseOrderLineList: [],
  106 + maxDeliveryDate: new Date().toISOString().substring(0, 10),
  107 + }
  108 + },
  109 + onLoad(query) {
  110 + const id = (query && (query.id || query.code)) || ''
  111 + if (id) {
  112 + this.loadDetail(id)
  113 + }
  114 + },
  115 + methods: {
  116 + async loadDetail(id) {
  117 + try {
  118 + const res = await getDetailApi(id)
  119 + const m = res.data || {}
  120 + const next = { ...this.form, ...m }
  121 + // 确保ID存在
  122 + next.id = m.id || id
  123 + // 映射列表
  124 + // 注意:详情返回的是 replenishmentOrderLineList,需要赋值给 initPurchaseOrderLineList 以便 Product 组件初始化
  125 + // 且需要处理字段兼容性,确保 Product 组件能正确显示和编辑
  126 + const lines = Array.isArray(m.replenishmentOrderLineList) ? m.replenishmentOrderLineList.map(x => ({
  127 + ...x,
  128 + // 确保 Product 组件需要的字段存在
  129 + // Product组件使用: quantity(需发), shippedQuantity(实发), supplementaryQuantity(需求补货), salesPrice(单价)
  130 + // 详情接口返回的字段应该已经包含了这些,如果有差异需要在此处转换
  131 + // 注意:add.vue中 onRelateConfirm 做了映射,这里是回显,通常直接使用即可
  132 + })) : []
  133 +
  134 + this.form = next;
  135 + this.initPurchaseOrderLineList = lines;
  136 + // 初始计算合计
  137 + this.calculateSummary(lines)
  138 + } catch (e) {
  139 + uni.showToast({ title: '加载失败', icon: 'none' })
  140 + }
  141 + },
  142 + validateRequired() {
  143 + const checks = [
  144 + { key: 'purchaseOrderName', label: '订单编号' }
  145 + ]
  146 + for (const it of checks) {
  147 + const val = this.form[it.key]
  148 + if (val === undefined || val === null || String(val).trim() === '') {
  149 + uni.showToast({ title: `请先选择${it.label}`, icon: 'none' })
  150 + return false
  151 + }
  152 + }
  153 + return true
  154 + },
  155 + validateLineListRequired() {
  156 + const list = Array.isArray(this.form.purchaseOrderLineList) ? this.form.purchaseOrderLineList : []
  157 + if (list.length === 0) {
  158 + uni.showToast({ title: '请先添加产品', icon: 'none' })
  159 + return false
  160 + }
  161 + const fields = [
  162 + { key: 'brand', label: '牌号' },
  163 + { key: 'quantity', label: '需发' },
  164 + { key: 'supplementaryQuantity', label: '需求补货' },
  165 + ]
  166 + for (let i = 0; i < list.length; i++) {
  167 + const it = list[i] || {}
  168 + for (const f of fields) {
  169 + const v = it && it[f.key]
  170 + if (v === undefined || v === null || String(v).trim() === '') {
  171 + uni.showToast({ title: `产品第${i + 1}条:${f.label}不能为空!`, icon: 'none' })
  172 + return false
  173 + }
  174 + }
  175 + const has = (v) => v !== undefined && v !== null && String(v).trim() !== ''
  176 + if (has(it.thicknessTolPos) && has(it.thicknessTolNeg)) {
  177 + const pos = Number(it.thicknessTolPos)
  178 + const neg = Number(it.thicknessTolNeg)
  179 + if (!(pos > neg)) {
  180 + uni.showToast({ title: `产品第${i + 1}条:厚度公差上限需大于下限`, icon: 'none' })
  181 + return false
  182 + }
  183 + }
  184 + if (has(it.widthTolPos) && has(it.widthTolNeg)) {
  185 + const pos = Number(it.widthTolPos)
  186 + const neg = Number(it.widthTolNeg)
  187 + if (!(pos > neg)) {
  188 + uni.showToast({ title: `产品第${i + 1}条:宽度公差上限需大于下限`, icon: 'none' })
  189 + return false
  190 + }
  191 + }
  192 + if (has(it.lengthTolPos) && has(it.lengthTolNeg)) {
  193 + const pos = Number(it.lengthTolPos)
  194 + const neg = Number(it.lengthTolNeg)
  195 + if (!(pos > neg)) {
  196 + uni.showToast({ title: `产品第${i + 1}条:长度公差上限需大于下限`, icon: 'none' })
  197 + return false
  198 + }
  199 + }
  200 + }
  201 + return true
  202 + },
  203 + async onSubmit() {
  204 + if (!this.validateRequired()) return
  205 + if (!this.validateLineListRequired()) return
  206 + const payload = { ...this.form }
  207 + // 后端接口通常期望 replenishmentOrderLineList
  208 + payload.replenishmentOrderLineList = payload.purchaseOrderLineList || [];
  209 + // 清理可能存在的多余字段
  210 + delete payload.purchaseOrderLineList;
  211 +
  212 + console.log('onSubmit__payload', payload)
  213 + try {
  214 + await updateApi(payload)
  215 + uni.showToast({ title: '保存成功', icon: 'success' })
  216 + setTimeout(() => { uni.redirectTo({ url: '/pages/replenishment_order/index' }) }, 300)
  217 + } catch (e) {
  218 + uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
  219 + }
  220 + },
  221 + calculateSummary(list) {
  222 + const summary = (list || []).reduce((acc, it) => {
  223 + const qty = Number(it.supplementaryQuantity) || 0
  224 + const shipped = Number(it.shippedQuantity) || 0
  225 + const orderQty = Number(it.quantity) || 0
  226 + acc.totalSupplementaryQuantity += qty
  227 + acc.totalShippedQuantity += shipped
  228 + acc.totalQuantity += orderQty
  229 + return acc
  230 + }, { totalQuantity: 0, totalShippedQuantity: 0, totalSupplementaryQuantity: 0 })
  231 + this.form.totalQuantity = summary.totalQuantity
  232 + this.form.totalShippedQuantity = summary.totalShippedQuantity
  233 + this.form.totalSupplementaryQuantity = summary.totalSupplementaryQuantity
  234 + },
  235 + purchaseOrderLineListChange(data) {
  236 + const list = Array.isArray(data) ? data : []
  237 + this.form.purchaseOrderLineList = list
  238 + this.calculateSummary(list)
  239 + },
  240 + }
  241 +}
  242 +</script>
  243 +
  244 +<style lang="scss" scoped>
  245 +.page {
  246 + display: flex;
  247 + flex-direction: column;
  248 + height: 100%;
  249 +}
  250 +
  251 +.scroll {
  252 + flex: 1;
  253 + padding: 6rpx 0 356rpx;
  254 +}
  255 +
  256 +
  257 +
  258 +.title-header {
  259 + background-color: #fff;
  260 + display: flex;
  261 + align-items: center;
  262 + padding: 32rpx 32rpx 22rpx;
  263 +
  264 + .title-header_icon {
  265 + width: 32rpx;
  266 + height: 28rpx;
  267 + margin-right: 16rpx;
  268 + }
  269 +
  270 + span {
  271 + color: rgba(0, 0, 0, 0.9);
  272 + font-size: 32rpx;
  273 + line-height: 44rpx;
  274 + font-weight: 600;
  275 + }
  276 +}
  277 +
  278 +
  279 +.section {
  280 + background: #fff;
  281 + margin-bottom: 20rpx;
  282 +}
  283 +
  284 +.section2 {
  285 + background: #f1f1f1;
  286 +}
  287 +
  288 +::v-deep .uni-list {
  289 + background: transparent;
  290 +
  291 + &-item {
  292 + &__extra-text {
  293 + font-size: 32rpx;
  294 + }
  295 +
  296 + &__content-title {
  297 + font-size: 32rpx;
  298 + color: rgba(0, 0, 0, 0.9);
  299 + }
  300 +
  301 + &__container {
  302 + padding: 32rpx;
  303 + // align-items: center;
  304 +
  305 + .uni-easyinput {
  306 +
  307 + .is-disabled {
  308 + background-color: transparent !important;
  309 + }
  310 +
  311 + &__placeholder-class {
  312 + font-size: 32rpx;
  313 + color: rgba(0, 0, 0, 0.4);
  314 + }
  315 +
  316 + &__content {
  317 + border: none;
  318 +
  319 + &-input {
  320 + padding-left: 0 !important;
  321 + height: 48rpx;
  322 + line-height: 48rpx;
  323 + font-size: 32rpx;
  324 + }
  325 +
  326 + .content-clear-icon {
  327 + font-size: 44rpx !important;
  328 + }
  329 + }
  330 + }
  331 +
  332 + .amount-row {
  333 + flex: 1;
  334 + display: flex;
  335 + align-items: center;
  336 +
  337 + .uni-easyinput {
  338 + flex: 1;
  339 + }
  340 +
  341 + .unit {
  342 + margin-left: 16rpx;
  343 + color: rgba(0, 0, 0, 0.9);
  344 + }
  345 + }
  346 +
  347 + .item-title,
  348 + .uni-list-item__content {
  349 + flex: none;
  350 + min-height: 48rpx;
  351 + line-height: 48rpx;
  352 + font-size: 32rpx;
  353 + position: relative;
  354 + width: 210rpx;
  355 + margin-right: 32rpx;
  356 + color: rgba(0, 0, 0, 0.9);
  357 + padding-right: 0;
  358 +
  359 +
  360 + .required {
  361 + color: red;
  362 + position: absolute;
  363 + top: 50%;
  364 + transform: translateY(-50%);
  365 + left: -16rpx;
  366 + }
  367 + }
  368 +
  369 + }
  370 +
  371 + &.select-item {
  372 + &.is-empty {
  373 + .uni-list-item__extra-text {
  374 + color: rgba(0, 0, 0, 0.4) !important;
  375 + }
  376 + }
  377 +
  378 + &.is-filled {
  379 + .uni-list-item__extra-text {
  380 + color: rgba(0, 0, 0, 0.9) !important;
  381 + }
  382 + }
  383 +
  384 + .serial-number-row {
  385 + display: flex;
  386 + align-items: center;
  387 + }
  388 +
  389 + }
  390 +
  391 + &.mgb10 {
  392 + margin-bottom: 20rpx;
  393 + }
  394 +
  395 + }
  396 +
  397 + .title-header {
  398 + background-color: #fff;
  399 + display: flex;
  400 + align-items: center;
  401 + padding: 32rpx 32rpx 22rpx;
  402 +
  403 + &_icon {
  404 + width: 32rpx;
  405 + height: 28rpx;
  406 + margin-right: 16rpx;
  407 + }
  408 +
  409 + span {
  410 + color: rgba(0, 0, 0, 0.9);
  411 + font-size: 32rpx;
  412 + line-height: 44rpx;
  413 + font-weight: 600;
  414 + }
  415 + }
  416 +}
  417 +
  418 +/* 只读 easyinput 根据内容自适应高度 */
  419 +::v-deep .uni-list-item__container {
  420 + align-items: flex-start;
  421 +}
  422 +
  423 +/* 只读文本样式 */
  424 +.readonly-text {
  425 + color: rgba(0, 0, 0, 0.9);
  426 + font-size: 32rpx;
  427 + line-height: 48rpx;
  428 + text-align: right;
  429 + white-space: pre-wrap;
  430 + word-break: break-all;
  431 +}
  432 +
  433 +
  434 +.footer {
  435 + position: fixed;
  436 + left: 0;
  437 + right: 0;
  438 + bottom: 0;
  439 + padding: 0 32rpx 32rpx;
  440 + padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
  441 + background: #fff;
  442 + box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
  443 + z-index: 10;
  444 +
  445 + .btn {
  446 + height: 80rpx;
  447 + line-height: 80rpx;
  448 + border-radius: 12rpx;
  449 + font-size: 32rpx;
  450 + }
  451 +
  452 + .submit {
  453 + background: $theme-primary;
  454 + color: #fff;
  455 + }
  456 +
  457 + .view-total {
  458 + padding: 20rpx 0;
  459 +
  460 + .head {
  461 + font-size: 32rpx;
  462 + font-weight: 600;
  463 + line-height: 50rpx;
  464 + color: rgba(0, 0, 0, 0.9);
  465 + padding-bottom: 16rpx;
  466 + margin-bottom: 24rpx;
  467 + ;
  468 + border-bottom: 1px dashed #E7E7E7;
  469 + }
  470 +
  471 + .row {
  472 + display: flex;
  473 + margin-bottom: 24rpx;
  474 + line-height: 32rpx;
  475 +
  476 + .row2 {
  477 + width: 50%;
  478 + }
  479 +
  480 + .label {
  481 + width: 180rpx;
  482 + margin-right: 14rpx;
  483 + color: rgba(0, 0, 0, 0.6);
  484 + font-size: 28rpx;
  485 + }
  486 +
  487 + .value {
  488 + flex: 1;
  489 + color: rgba(0, 0, 0, 0.9);
  490 + font-size: 28rpx;
  491 + white-space: pre-wrap;
  492 + word-break: break-all;
  493 + }
  494 + }
  495 + }
  496 +}
  497 +</style>