<script setup lang="ts">
|
import { computed, reactive, ref } from "vue";
|
import { onLoad } from "@dcloudio/uni-app";
|
import {
|
createPurchase,
|
getAccountSimpleList,
|
getPurchase,
|
getPurchaseInvoiceSimpleList,
|
getPurchaseOrderPage,
|
getSimpleUserList,
|
updatePurchase,
|
type AccountSimple,
|
type PurchaseInvoiceSimple,
|
type PurchaseItem,
|
type PurchaseKind,
|
type PurchaseRecord,
|
type UserSimple,
|
} from "../../../api/purchase";
|
import { getMaterialPage, type MaterialItem } from "../../../api/basic-data";
|
import {
|
getSupplierSimpleList,
|
type SupplierItem,
|
} from "../../../api/supplier";
|
import { useAuth } from "../../../stores/auth";
|
import { materialOptionText } from "../../../utils/material";
|
|
const props = defineProps<{ kind: PurchaseKind }>();
|
const { state } = useAuth();
|
const id = ref<number>();
|
const saving = ref(false);
|
const suppliers = ref<SupplierItem[]>([]);
|
const materials = ref<MaterialItem[]>([]);
|
const orders = ref<PurchaseRecord[]>([]);
|
const invoices = ref<PurchaseInvoiceSimple[]>([]);
|
const accounts = ref<AccountSimple[]>([]);
|
const users = ref<UserSimple[]>([]);
|
const form = reactive<PurchaseRecord>({
|
items: [],
|
blobIds: [],
|
attachmentList: [],
|
});
|
const title = computed(
|
() =>
|
({
|
request: "采购申请",
|
order: "采购订单",
|
invoice: "采购来票",
|
payment: "采购付款",
|
}[props.kind])
|
);
|
const withItems = computed(() =>
|
["request", "order", "payment"].includes(props.kind)
|
);
|
const materialOptions = computed(() => materials.value.map(item => materialOptionText(item, "请选择产品")));
|
const userLabel = (user: UserSimple) =>
|
user.nickname || user.username || `用户 #${user.id}`;
|
const today = () => {
|
const date = new Date();
|
const pad = (value: number) => String(value).padStart(2, "0");
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(
|
date.getDate()
|
)}`;
|
};
|
const dateTime = (value?: string) =>
|
value ? (value.includes(" ") ? value : `${value} 00:00:00`) : value;
|
const message = (error: unknown) =>
|
error instanceof Error ? error.message : "操作失败";
|
function num(value: string) {
|
const result = Number(value);
|
return Number.isFinite(result) ? result : 0;
|
}
|
function requestItemAmount(item: PurchaseItem) {
|
return (item.productPrice || 0) * (item.count || 0);
|
}
|
function productText(item: PurchaseItem) {
|
return materialOptionText({
|
productName: item.productName,
|
productCode: item.productCode,
|
productSpecification: item.productSpecification,
|
productUnitName: item.productUnitName,
|
}, "请选择产品");
|
}
|
function orderItemAmounts(item: PurchaseItem) {
|
const productAmount = (item.productPrice || 0) * (item.count || 0);
|
const taxAmount = productAmount * ((item.taxPercent || 0) / 100);
|
return { productAmount, taxAmount, totalAmount: productAmount + taxAmount };
|
}
|
function updateOrderAmounts() {
|
if (props.kind !== "order") return;
|
const gross = (form.items || []).reduce(
|
(sum, item) => sum + orderItemAmounts(item).totalAmount,
|
0
|
);
|
const discount = gross * ((form.discountPercent || 0) / 100);
|
form.discountPrice = discount;
|
form.totalPrice = gross - discount;
|
}
|
function addItem() {
|
form.items!.push({
|
count: 1,
|
productPrice: 0,
|
taxPercent: 0,
|
paymentPrice: 0,
|
paidPrice: 0,
|
qcCheckFlag: false,
|
});
|
updateOrderAmounts();
|
}
|
function removeItem(index: number) {
|
form.items!.splice(index, 1);
|
updateOrderAmounts();
|
}
|
async function selectSupplier(event: { detail: { value: string } }) {
|
const supplier = suppliers.value[Number(event.detail.value)];
|
form.supplierId = supplier?.id;
|
form.supplierName = supplier?.name;
|
if (props.kind === "payment" && state.accessToken && supplier?.id) {
|
invoices.value = await getPurchaseInvoiceSimpleList(
|
state.accessToken,
|
supplier.id
|
);
|
form.invoiceId = undefined;
|
form.items = [];
|
form.totalPrice = 0;
|
form.paymentPrice = 0;
|
}
|
}
|
function selectOrder(event: { detail: { value: string } }) {
|
const order = orders.value[Number(event.detail.value)];
|
if (!order) return;
|
form.purchaseOrderId = order.id;
|
form.order = { id: order.id, no: order.no };
|
form.supplierId = order.supplierId;
|
form.supplierName = order.supplierName;
|
}
|
function selectInvoice(event: { detail: { value: string } }) {
|
const invoice = invoices.value[Number(event.detail.value)];
|
if (!invoice) return;
|
const remaining = invoice.remainingInvoicePrice || 0;
|
form.invoiceId = invoice.id;
|
form.invoice = {
|
no: invoice.no,
|
invoiceNo: invoice.invoiceNo,
|
remainingInvoicePrice: remaining,
|
};
|
form.items = [
|
{
|
bizType: 13,
|
bizId: invoice.id,
|
bizNo: invoice.no,
|
totalPrice: invoice.price || remaining,
|
paidPrice: Math.max((invoice.price || remaining) - remaining, 0),
|
paymentPrice: remaining,
|
},
|
];
|
form.totalPrice = remaining;
|
updatePaymentPrice();
|
}
|
function selectAccount(event: { detail: { value: string } }) {
|
const account = accounts.value[Number(event.detail.value)];
|
form.accountId = account?.id;
|
form.accountName = account?.name;
|
}
|
function selectUser(event: { detail: { value: string } }) {
|
const user = users.value[Number(event.detail.value)];
|
form.financeUserId = user?.id;
|
form.financeUserName = user ? userLabel(user) : undefined;
|
}
|
function selectMaterial(event: { detail: { value: string } }, index: number) {
|
const material = materials.value[Number(event.detail.value)];
|
const item = form.items![index];
|
if (!material) return;
|
item.productId = material.id;
|
item.productName = material.name;
|
item.productCode = material.code;
|
item.productSpecification = material.specification;
|
item.productUnitId = material.unitMeasureId;
|
item.productUnitName = material.unitMeasureName;
|
item.productPrice = material.purchasePrice || 0;
|
updateOrderAmounts();
|
}
|
function updatePaymentPrice() {
|
const total = (form.items || []).reduce(
|
(sum, item) => sum + (item.paymentPrice || 0),
|
0
|
);
|
form.totalPrice = total;
|
form.paymentPrice = total - (form.discountPrice || 0);
|
}
|
async function load() {
|
if (!state.accessToken) return;
|
try {
|
const tasks: Promise<unknown>[] = [
|
getSupplierSimpleList(state.accessToken),
|
getMaterialPage(state.accessToken, {
|
pageNo: 1,
|
pageSize: 100,
|
status: 0,
|
}),
|
];
|
if (props.kind === "invoice")
|
tasks.push(
|
getPurchaseOrderPage(state.accessToken, {
|
pageNo: 1,
|
pageSize: 100,
|
status: 20,
|
})
|
);
|
if (props.kind === "order" || props.kind === "payment")
|
tasks.push(getAccountSimpleList(state.accessToken));
|
if (props.kind === "payment")
|
tasks.push(getSimpleUserList(state.accessToken));
|
const [supplierData, materialData, ...extras] = await Promise.all(tasks);
|
suppliers.value = supplierData as SupplierItem[];
|
materials.value = (materialData as { list: MaterialItem[] }).list;
|
let extraIndex = 0;
|
if (props.kind === "invoice")
|
orders.value = (extras[extraIndex++] as { list: PurchaseRecord[] }).list;
|
if (props.kind === "order" || props.kind === "payment")
|
accounts.value = extras[extraIndex++] as AccountSimple[];
|
if (props.kind === "payment")
|
users.value = extras[extraIndex++] as UserSimple[];
|
if (id.value) {
|
Object.assign(
|
form,
|
await getPurchase(state.accessToken, props.kind, id.value)
|
);
|
form.blobIds =
|
form.attachmentList?.map(item => item.id) || form.blobIds || [];
|
if (props.kind === "payment" && form.supplierId)
|
invoices.value = await getPurchaseInvoiceSimpleList(
|
state.accessToken,
|
form.supplierId
|
);
|
} else {
|
if (props.kind === "request") form.requestTime = today();
|
else if (props.kind === "order") {
|
form.orderTime = today();
|
const account = accounts.value.find(item => item.defaultStatus);
|
form.accountId = account?.id;
|
form.accountName = account?.name;
|
} else if (props.kind === "invoice") form.invoiceTime = today();
|
else {
|
form.paymentTime = today();
|
form.discountPrice = 0;
|
const account = accounts.value.find(item => item.defaultStatus);
|
form.accountId = account?.id;
|
form.accountName = account?.name;
|
}
|
if (withItems.value && props.kind !== "payment") addItem();
|
}
|
} catch (error) {
|
uni.showToast({ title: message(error), icon: "none" });
|
}
|
}
|
function payload(): PurchaseRecord {
|
updateOrderAmounts();
|
if (props.kind === "request") {
|
return {
|
no: form.no,
|
requestTime: dateTime(form.requestTime),
|
supplierId: form.supplierId,
|
discountPercent: form.discountPercent,
|
depositPrice: form.depositPrice,
|
requestReason: form.requestReason,
|
blobIds: form.blobIds,
|
remark: form.remark,
|
items: form.items?.map(item => ({
|
productId: item.productId,
|
productUnitId: item.productUnitId,
|
productPrice: item.productPrice,
|
count: item.count,
|
taxPercent: item.taxPercent,
|
demandTime: item.demandTime,
|
qcCheckFlag: item.qcCheckFlag,
|
remark: item.remark,
|
})),
|
};
|
}
|
const data: PurchaseRecord = {
|
...form,
|
items: form.items?.map(item => ({ ...item })),
|
};
|
data.requestTime = dateTime(data.requestTime);
|
data.orderTime = dateTime(data.orderTime);
|
data.invoiceTime = dateTime(data.invoiceTime);
|
data.paymentTime = dateTime(data.paymentTime);
|
data.items?.forEach(item => {
|
item.demandTime = dateTime(item.demandTime);
|
if (props.kind === "order")
|
item.totalPrice = orderItemAmounts(item).totalAmount;
|
});
|
return data;
|
}
|
async function save() {
|
if (!state.accessToken || saving.value) return;
|
if (props.kind === "invoice" && !form.purchaseOrderId)
|
return uni.showToast({ title: "请选择采购订单", icon: "none" });
|
if (
|
props.kind === "invoice" &&
|
(!form.invoiceNo || !form.price || form.price <= 0)
|
)
|
return uni.showToast({ title: "请填写发票号码和有效金额", icon: "none" });
|
if (
|
props.kind === "payment" &&
|
(!form.supplierId ||
|
!form.invoiceId ||
|
!form.accountId ||
|
form.discountPrice === undefined ||
|
!form.items?.length)
|
)
|
return uni.showToast({
|
title: "请补全供应商、来票、账户、优惠和付款明细",
|
icon: "none",
|
});
|
if ((props.kind === "request" || props.kind === "order") && !form.supplierId)
|
return uni.showToast({ title: "请选择供应商", icon: "none" });
|
if (props.kind === "order" && (form.depositPrice || 0) > (form.totalPrice || 0))
|
return uni.showToast({ title: "支付订金不能大于优惠后金额", icon: "none" });
|
if (withItems.value && !form.items?.length)
|
return uni.showToast({ title: "请至少添加一条明细", icon: "none" });
|
if (props.kind === "request" || props.kind === "order") {
|
const invalidIndex = form.items?.findIndex(
|
item => !item.productId || !item.count || item.count <= 0
|
);
|
if (invalidIndex !== undefined && invalidIndex >= 0)
|
return uni.showToast({
|
title: `请补全第 ${invalidIndex + 1} 条明细的物料和数量`,
|
icon: "none",
|
});
|
}
|
if (props.kind === "payment") {
|
const amount = form.items![0].paymentPrice || 0;
|
const remaining = form.invoice?.remainingInvoicePrice || 0;
|
if (amount <= 0 || amount > remaining || (form.paymentPrice || 0) < 0)
|
return uni.showToast({ title: "付款金额或优惠金额不正确", icon: "none" });
|
}
|
saving.value = true;
|
try {
|
const data = payload();
|
if (id.value)
|
await updatePurchase(state.accessToken, props.kind, {
|
...data,
|
id: id.value,
|
});
|
else await createPurchase(state.accessToken, props.kind, data);
|
uni.showToast({ title: "保存成功", icon: "success" });
|
setTimeout(() => uni.navigateBack(), 400);
|
} catch (error) {
|
uni.showToast({ title: message(error), icon: "none" });
|
} finally {
|
saving.value = false;
|
}
|
}
|
onLoad(query => {
|
id.value = query.id ? Number(query.id) : undefined;
|
load();
|
});
|
</script>
|
|
<template>
|
<view class="page">
|
<view class="form-title">
|
<text>{{ id ? '编辑' : '新增' }}{{ title }}</text>
|
<text class="form-subtitle">带 * 的项目为必填项</text>
|
</view>
|
<view class="card">
|
<view class="card-title">基础信息</view>
|
<view class="field-grid">
|
<view v-if="kind === 'request' || kind === 'order'"
|
class="field">
|
<text>单据编号</text>
|
<view class="readonly">{{ form.no || '系统自动生成' }}</view>
|
</view>
|
<view v-if="kind === 'request' || kind === 'order' || kind === 'payment'"
|
class="field required">
|
<text>供应商</text>
|
<picker :range="suppliers"
|
range-key="name"
|
@change="selectSupplier">
|
<view class="picker-value"><text>{{ form.supplierName || '请选择供应商' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view v-if="kind === 'request'"
|
class="field required">
|
<text>申请时间</text>
|
<picker mode="date"
|
:value="form.requestTime"
|
@change="form.requestTime = $event.detail.value">
|
<view class="picker-value"><text>{{ form.requestTime || '请选择申请时间' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<template v-if="kind === 'request'">
|
<view class="field">
|
<text>优惠率(%)</text>
|
<input :value="String(form.discountPercent || '')"
|
type="digit"
|
placeholder="请输入优惠率"
|
@input="form.discountPercent = num($event.detail.value)" />
|
</view>
|
<view class="field">
|
<text>定金</text>
|
<input :value="String(form.depositPrice || '')"
|
type="digit"
|
placeholder="请输入定金"
|
@input="form.depositPrice = num($event.detail.value)" />
|
</view>
|
</template>
|
<template v-if="kind === 'order'">
|
<view class="field required">
|
<text>订单时间</text>
|
<picker mode="date"
|
:value="form.orderTime"
|
@change="form.orderTime = $event.detail.value">
|
<view class="picker-value"><text>{{ form.orderTime || '请选择订单时间' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field">
|
<text>结算账户</text>
|
<picker :range="accounts"
|
range-key="name"
|
@change="selectAccount">
|
<view class="picker-value"><text>{{ form.accountName || '请选择结算账户' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field">
|
<text>支付订金</text>
|
<input :value="String(form.depositPrice || '')"
|
type="digit"
|
placeholder="请输入支付订金"
|
@input="form.depositPrice = num($event.detail.value)" />
|
</view>
|
<view class="field">
|
<text>优惠率(%)</text>
|
<input :value="String(form.discountPercent || '')"
|
type="digit"
|
placeholder="请输入优惠率"
|
@input="form.discountPercent = num($event.detail.value); updateOrderAmounts()" />
|
</view>
|
<view class="field">
|
<text>付款优惠</text>
|
<view class="readonly">¥ {{ (form.discountPrice || 0).toFixed(2) }}</view>
|
</view>
|
<view class="field">
|
<text>优惠后金额</text>
|
<view class="readonly emphasis">¥ {{ (form.totalPrice || 0).toFixed(2) }}</view>
|
</view>
|
</template>
|
<template v-if="kind === 'invoice'">
|
<view class="field required">
|
<text>采购订单</text>
|
<picker :range="orders"
|
range-key="no"
|
@change="selectOrder">
|
<view class="picker-value"><text>{{ form.order?.no || '请选择已审核订单' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field">
|
<text>供应商</text>
|
<view class="readonly">{{ form.supplierName || '选择订单后自动带出' }}</view>
|
</view>
|
<view class="field required"><text>发票号码</text><input v-model="form.invoiceNo"
|
placeholder="请输入发票号码" /></view>
|
<view class="field"><text>发票抬头</text><input v-model="form.invoiceTitle"
|
placeholder="请输入发票抬头" /></view>
|
<view class="field required"><text>来票金额(元)</text><input :value="String(form.price || '')"
|
type="digit"
|
placeholder="请输入来票金额"
|
@input="form.price = num($event.detail.value)" /></view>
|
<view class="field"><text>来票日期</text>
|
<picker mode="date"
|
:value="form.invoiceTime"
|
@change="form.invoiceTime = $event.detail.value">
|
<view class="picker-value"><text>{{ form.invoiceTime || '请选择来票日期' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
</template>
|
<template v-if="kind === 'payment'">
|
<view class="field"><text>付款单号</text>
|
<view class="readonly">{{ form.no || '系统自动生成' }}</view>
|
</view>
|
<view class="field required"><text>关联来票</text>
|
<picker :range="invoices"
|
range-key="invoiceNo"
|
@change="selectInvoice">
|
<view class="picker-value"><text>{{ form.invoice?.invoiceNo || form.invoice?.no || '请先选择供应商' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field required"><text>付款账户</text>
|
<picker :range="accounts"
|
range-key="name"
|
@change="selectAccount">
|
<view class="picker-value"><text>{{ form.accountName || '请选择结算账户' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field"><text>财务人员</text>
|
<picker :range="users"
|
range-key="nickname"
|
@change="selectUser">
|
<view class="picker-value"><text>{{ form.financeUserName || '请选择财务人员' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="field"><text>合计付款</text>
|
<view class="readonly">¥ {{ (form.totalPrice || 0).toFixed(2) }}</view>
|
</view>
|
<view class="field"><text>优惠金额</text><input :value="String(form.discountPrice || 0)"
|
type="digit"
|
@input="form.discountPrice = num($event.detail.value); updatePaymentPrice()" /></view>
|
<view class="field"><text>实际付款</text>
|
<view class="readonly emphasis">¥ {{ (form.paymentPrice || 0).toFixed(2) }}</view>
|
</view>
|
<view class="field"><text>付款时间</text>
|
<picker mode="date"
|
:value="form.paymentTime"
|
@change="form.paymentTime = $event.detail.value">
|
<view class="picker-value"><text>{{ form.paymentTime || '请选择付款日期' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
</template>
|
</view>
|
<view v-if="kind === 'request'"
|
class="field full-field"><text>申请理由</text><textarea v-model="form.requestReason"
|
placeholder="请输入申请理由" ></textarea></view>
|
<view class="field full-field"><text>备注</text><textarea v-model="form.remark"
|
placeholder="请输入备注" ></textarea></view>
|
</view>
|
<view v-if="withItems"
|
class="card">
|
<view class="section"><text>{{ kind === 'payment' ? '付款明细' : kind === 'request' ? '申请明细' : '采购产品清单' }}</text><button v-if="kind !== 'payment'"
|
@click="addItem">添加{{ kind === 'request' ? '申请' : '采购' }}产品</button></view>
|
<view v-for="(item, index) in form.items"
|
:key="item.id || index"
|
class="item">
|
<view class="item-head"><text>明细 {{ index + 1 }}</text><button v-if="kind !== 'payment'"
|
class="danger"
|
@click="removeItem(index)">删除</button></view>
|
<template v-if="kind !== 'payment'">
|
<view class="item-grid">
|
<view class="item-field wide"><text>产品名称 <text class="required">*</text></text>
|
<picker :range="materialOptions"
|
@change="selectMaterial($event, index)">
|
<view class="picker-value"><text>{{ productText(item) }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="item-field"><text>单位</text>
|
<view class="readonly">{{ item.productUnitName || '--' }}</view>
|
</view>
|
<view class="item-field"><text>数量 <text class="required">*</text></text><input :value="String(item.count || '')"
|
type="digit"
|
placeholder="请输入数量"
|
@input="item.count = num($event.detail.value); updateOrderAmounts()" /></view>
|
<view class="item-field"><text>{{ kind === 'request' ? '单价(参考价)' : '产品单价' }}</text><input :value="String(item.productPrice || '')"
|
type="digit"
|
placeholder="请输入单价"
|
@input="item.productPrice = num($event.detail.value); updateOrderAmounts()" /></view>
|
<view class="item-field"><text>税率(%)</text><input :value="String(item.taxPercent || 0)"
|
type="digit"
|
@input="item.taxPercent = num($event.detail.value); updateOrderAmounts()" /></view>
|
<view class="item-field"><text>{{ kind === 'request' ? '预估金额' : '金额' }}</text>
|
<view class="readonly">¥ {{ kind === 'request' ? requestItemAmount(item).toFixed(2) : orderItemAmounts(item).productAmount.toFixed(2) }}</view>
|
</view>
|
<view v-if="kind === 'order'"
|
class="item-field"><text>税额</text>
|
<view class="readonly">¥ {{ orderItemAmounts(item).taxAmount.toFixed(2) }}</view>
|
</view>
|
<view v-if="kind === 'order'"
|
class="item-field"><text>含税金额</text>
|
<view class="readonly emphasis">¥ {{ orderItemAmounts(item).totalAmount.toFixed(2) }}</view>
|
</view>
|
<view v-if="kind === 'request'"
|
class="item-field"><text>需求日期</text>
|
<picker mode="date"
|
:value="item.demandTime"
|
@change="item.demandTime = $event.detail.value">
|
<view class="picker-value"><text>{{ item.demandTime || '请选择需求日期' }}</text><text>›</text></view>
|
</picker>
|
</view>
|
<view class="item-field"><text>是否质检</text>
|
<view class="check"
|
@click="item.qcCheckFlag = !item.qcCheckFlag">{{ item.qcCheckFlag ? '是' : '否' }}</view>
|
</view>
|
</view>
|
<view class="item-field full-item"><text>明细备注</text><textarea v-model="item.remark"
|
placeholder="请输入明细备注" ></textarea></view>
|
</template>
|
<template v-else>
|
<view class="payment-item"><text>{{ form.invoice?.invoiceNo || form.invoice?.no || '未选择来票' }}</text><text>剩余可付:¥ {{ (form.invoice?.remainingInvoicePrice || 0).toFixed(2) }}</text>
|
<view class="item-field"><text>本次付款金额</text><input :value="String(item.paymentPrice || '')"
|
type="digit"
|
placeholder="请输入本次付款金额"
|
@input="item.paymentPrice = num($event.detail.value); updatePaymentPrice()" /></view>
|
</view>
|
</template>
|
</view>
|
<view v-if="kind === 'request' || kind === 'order'"
|
class="summary"><text>合计</text>
|
<view><text>数量:{{ (form.items || []).reduce((sum, item) => sum + (item.count || 0), 0).toFixed(3) }}</text><text>金额:¥ {{ (form.items || []).reduce((sum, item) => sum + (kind === 'request' ? requestItemAmount(item) : orderItemAmounts(item).totalAmount), 0).toFixed(2) }}</text></view>
|
</view>
|
</view>
|
<button class="save"
|
:loading="saving"
|
@click="save">保存{{ title }}</button>
|
</view>
|
</template>
|
|
<style lang="scss" scoped>
|
.page {
|
min-height: 100vh;
|
padding: 28rpx 30rpx 150rpx;
|
box-sizing: border-box;
|
background: #f5f6f7;
|
}
|
.form-title {
|
display: flex;
|
align-items: baseline;
|
justify-content: space-between;
|
padding: 8rpx 4rpx 22rpx;
|
color: #1d2129;
|
font-size: 34rpx;
|
font-weight: 600;
|
}
|
.form-subtitle {
|
color: #86909c;
|
font-size: 22rpx;
|
font-weight: 400;
|
}
|
.card {
|
margin-bottom: 20rpx;
|
overflow: hidden;
|
background: #fff;
|
border-radius: 16rpx;
|
}
|
.card-title,
|
.section {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
min-height: 88rpx;
|
padding: 0 24rpx;
|
color: #1d2129;
|
font-size: 29rpx;
|
font-weight: 600;
|
border-bottom: 1rpx solid #f2f3f5;
|
}
|
.field-grid,
|
.item-grid {
|
display: flex;
|
flex-wrap: wrap;
|
padding: 0 24rpx;
|
}
|
.field,
|
.item-field {
|
width: calc(50% - 10rpx);
|
padding: 20rpx 0;
|
box-sizing: border-box;
|
}
|
.field:nth-child(odd),
|
.item-field:nth-child(odd) {
|
margin-right: 20rpx;
|
}
|
.field > text,
|
.item-field > text {
|
display: block;
|
margin-bottom: 12rpx;
|
color: #4e5969;
|
font-size: 24rpx;
|
line-height: 34rpx;
|
}
|
.required > text::before {
|
margin-right: 6rpx;
|
color: #f53f3f;
|
content: "*";
|
}
|
.field input,
|
.field textarea,
|
.item-field input,
|
.item-field textarea,
|
.readonly,
|
.picker-value {
|
width: 100%;
|
min-height: 64rpx;
|
padding: 0 16rpx;
|
box-sizing: border-box;
|
color: #1d2129;
|
font-size: 26rpx;
|
line-height: 64rpx;
|
background: #f7f8fa;
|
border-radius: 8rpx;
|
}
|
.picker-value,
|
.readonly {
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
.readonly {
|
color: #4e5969;
|
}
|
.emphasis {
|
color: var(--color-primary, #165dff);
|
font-weight: 600;
|
}
|
.full-field,
|
.wide,
|
.full-item {
|
width: 100%;
|
margin-right: 0 !important;
|
}
|
.full-field {
|
padding: 0 24rpx 22rpx;
|
box-sizing: border-box;
|
}
|
.full-field textarea,
|
.full-item textarea {
|
height: 128rpx;
|
padding-top: 14rpx;
|
line-height: 36rpx;
|
}
|
.item {
|
margin: 20rpx 24rpx 0;
|
padding: 0 20rpx 20rpx;
|
background: #f7f8fa;
|
border-radius: 12rpx;
|
}
|
.item-head {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
min-height: 76rpx;
|
color: #1d2129;
|
font-size: 27rpx;
|
font-weight: 600;
|
}
|
.item-grid {
|
padding: 0;
|
}
|
.item-field {
|
padding: 12rpx 0;
|
}
|
.item-field:nth-child(odd) {
|
margin-right: 20rpx;
|
}
|
.item-field.full-item {
|
padding-bottom: 0;
|
}
|
.check {
|
min-height: 64rpx;
|
padding: 0 16rpx;
|
color: var(--color-primary, #165dff);
|
font-size: 26rpx;
|
line-height: 64rpx;
|
background: #edf4ff;
|
border-radius: 8rpx;
|
}
|
.payment-item {
|
color: #4e5969;
|
font-size: 25rpx;
|
}
|
.payment-item > text {
|
display: block;
|
padding-top: 14rpx;
|
}
|
.summary {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding: 24rpx;
|
margin-top: 20rpx;
|
color: #1d2129;
|
font-size: 27rpx;
|
font-weight: 600;
|
background: #edf4ff;
|
}
|
.summary view {
|
display: flex;
|
flex-direction: column;
|
align-items: flex-end;
|
color: var(--color-primary, #165dff);
|
font-size: 24rpx;
|
font-weight: 400;
|
line-height: 38rpx;
|
}
|
.section button,
|
.item button {
|
margin: 0;
|
padding: 0 16rpx;
|
color: var(--color-primary, #165dff);
|
font-size: 23rpx;
|
line-height: 52rpx;
|
background: #edf4ff;
|
border-radius: 8rpx;
|
}
|
.danger {
|
color: #f53f3f !important;
|
}
|
.attachments {
|
padding-bottom: 8rpx;
|
}
|
.attachment {
|
display: flex;
|
justify-content: space-between;
|
padding: 18rpx 24rpx;
|
color: var(--color-primary, #165dff);
|
font-size: 25rpx;
|
border-bottom: 1rpx solid #f2f3f5;
|
}
|
.attachment text:first-child {
|
max-width: 78%;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
.empty {
|
display: block;
|
padding: 18rpx 24rpx;
|
color: #86909c;
|
font-size: 24rpx;
|
}
|
.save {
|
position: fixed;
|
right: 30rpx;
|
bottom: calc(24rpx + env(safe-area-inset-bottom));
|
left: 30rpx;
|
z-index: 10;
|
height: 84rpx;
|
color: #fff;
|
font-size: 30rpx;
|
line-height: 84rpx;
|
background: var(--color-primary, #165dff);
|
border-radius: 14rpx;
|
}
|
.save::after,
|
button::after {
|
border: 0;
|
}
|
</style>
|