fix PackageConfig*.vue style

This commit is contained in:
Timi
2026-09-06 01:10:22 +08:00
parent 3698f7151f
commit d929dbe622
7 changed files with 472 additions and 142 deletions
+14 -6
View File
@@ -90,9 +90,9 @@
v-model="item.quantity"
size="large"
:max="maxQuantity"
:min="1"
:step="1"
:integer="false"
:min="getQuantityStep(item)"
:step="getQuantityStep(item)"
:integer="!getProduct(item)?.allowDecimalQuantity"
theme="outline"
/>
</t-form-item>
@@ -184,7 +184,7 @@ import type { Product, ProductUnit } from "@/types/Product";
import type { PhotoItem } from "@/types/Photo";
import type { DirectProductOrderItemRequest } from "@/types/SalesOrder";
import { createPackageRequestNo, normalizePackageQuantity, parsePackageAmount } from "@/utils/package";
import { formatProductAmount } from "@/utils/product";
import { formatProductAmount, getProductQuantityStep } from "@/utils/product";
import { getErrorMessage } from "@/utils/error";
import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission";
@@ -219,6 +219,15 @@ const scanCode = ref("");
const scannerVisible = ref(false);
const scanStatus = ref("点击扫码开始识别。");
let latestDecodedText = "";
function getProduct(item: FormItem): Product | undefined {
return productCache.get(item.productId || "");
}
function getQuantityStep(item: FormItem): number {
return getProductQuantityStep(getProduct(item));
}
const totalAmount = computed(() => {
let amount = 0;
for (const item of items.value) {
@@ -380,6 +389,7 @@ function validate(): boolean {
const quantity = normalizePackageQuantity(item.quantity ?? "");
const key = `${item.productId}\u0000${item.productUnitId}`;
if (!item.productId || !item.productUnitId || !quantity || quantity === "0") { Message.warning("产品单位和正数量不能为空"); return false; }
if (getProduct(item) && !getProduct(item)!.allowDecimalQuantity && quantity.includes(".")) { Message.warning("该产品不允许小数数量"); return false; }
if (keys.has(key)) { Message.warning("产品单位不能重复"); return false; }
keys.add(key);
if (canPriceOverride.value && item.unitPriceText && parsePackageAmount(item.unitPriceText) === undefined) { Message.warning("成交单价必须是合法金额"); return false; }
@@ -499,7 +509,6 @@ onUnmounted(() => navBarStore.clearRight());
gap: .625rem;
display: flex;
align-items: center;
margin-bottom: .375rem;
.no {
width: 1.75rem;
@@ -560,7 +569,6 @@ onUnmounted(() => navBarStore.clearRight());
}
}
.textarea {
width: 100%;
}