support split unit for product order
This commit is contained in:
@@ -129,23 +129,23 @@
|
||||
<div class="content">
|
||||
<div class="metric">
|
||||
<strong v-text="getPackageQuantityText(item.quantity)" />
|
||||
<span>总数</span>
|
||||
<span>订单数量</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getAvailableQuantityClass(item)" v-text="getPackageQuantityText(item.availableQuantity)" />
|
||||
<span>可履约</span>
|
||||
<strong :class="getAvailableQuantityClass(item)" v-text="getPackageQuantityText(item.availableBaseQuantity)" />
|
||||
<span>可履约(基础)</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong v-text="getPackageQuantityText(item.pendingQuantity)" />
|
||||
<span>待核销</span>
|
||||
<strong v-text="getPackageQuantityText(item.pendingBaseQuantity)" />
|
||||
<span>待核销(基础)</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getFulfilledQuantityClass(item)" v-text="getPackageQuantityText(item.fulfilledQuantity)" />
|
||||
<span>已履约</span>
|
||||
<strong :class="getFulfilledQuantityClass(item)" v-text="getPackageQuantityText(item.fulfilledBaseQuantity)" />
|
||||
<span>已履约(基础)</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getRemainingQuantityClass(item)" v-text="getPackageQuantityText(item.remainingQuantity)" />
|
||||
<span>剩余</span>
|
||||
<strong :class="getRemainingQuantityClass(item)" v-text="getPackageQuantityText(item.remainingBaseQuantity)" />
|
||||
<span>剩余(基础)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,7 +242,7 @@ import {
|
||||
getStatusTheme
|
||||
} from "@/utils/salesOrder";
|
||||
import { Message } from "@/utils/message";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
import { uploadPhotoList } from "@/utils/photo";
|
||||
|
||||
defineOptions({ name: "SalesOrderDetail" });
|
||||
@@ -261,12 +261,11 @@ const canReadFund = computed(() => userStore.hasPermissions(permissionCodes.fund
|
||||
const canReadMyReceive = computed(() => userStore.hasPermissions(permissionCodes.fundReceive.create));
|
||||
const canUpdate = computed(() => userStore.hasPermissions(permissionCodes.salesOrder.update));
|
||||
const canCreateFulfillment = computed(() => userStore.hasPermissions(permissionCodes.orderFulfillment.create));
|
||||
const canOperateStock = computed(() => userStore.hasPermissions(permissionCodes.productStock.create));
|
||||
const canReceive = computed(() => !!order.value && order.value.status !== "CANCELLED" && order.value.paymentStatus !== "PAID" && userStore.hasPermissions(permissionCodes.fundReceive.create));
|
||||
const canRefund = computed(() => !!order.value && order.value.status === "CANCELLED" && order.value.refundStatus === "PENDING" && userStore.hasPermissions(permissionCodes.fund.refund));
|
||||
const canConfirmNoRefund = computed(() => !!order.value && order.value.status === "CANCELLED" && order.value.refundStatus === "PENDING" && userStore.hasPermissions(permissionCodes.fund.refund));
|
||||
const canCancel = computed(() => !!order.value && order.value.status === "ACTIVE" && !hasPendingFulfillment.value && userStore.hasPermissions(permissionCodes.salesOrder.cancel));
|
||||
const canFulfillByPayment = computed(() => order.value?.paymentStatus === "PAID" || (order.value?.paymentStatus === "PARTIALLY_PAID" && canOperateStock.value));
|
||||
const canFulfillByPayment = computed(() => order.value?.paymentStatus === "PAID" || userStore.hasRoles(gaoRoleCodes.storeManager));
|
||||
const photoURLList = computed(() => photoItems.value.map(item => item.url));
|
||||
|
||||
function toPhotoItems(attachmentList?: readonly Partial<Attachment>[]): PhotoItem[] {
|
||||
@@ -312,20 +311,20 @@ function getRemainingAmountClass(amount?: number | null): "green" | "red" | "gra
|
||||
}
|
||||
|
||||
function getAvailableQuantityClass(item: GaoSalesOrderItem): "green" | "orange" {
|
||||
return Number(item.availableQuantity || 0) === 0 ? "green" : "orange";
|
||||
return Number(item.availableBaseQuantity || 0) === 0 ? "green" : "orange";
|
||||
}
|
||||
|
||||
function getFulfilledQuantityClass(item: GaoSalesOrderItem): "green" | "orange" {
|
||||
return Number(item.remainingQuantity || 0) === 0 ? "green" : "orange";
|
||||
return Number(item.remainingBaseQuantity || 0) === 0 ? "green" : "orange";
|
||||
}
|
||||
|
||||
function getRemainingQuantityClass(item: GaoSalesOrderItem): "green" | "orange" {
|
||||
return Number(item.remainingQuantity || 0) === 0 ? "green" : "orange";
|
||||
return Number(item.remainingBaseQuantity || 0) === 0 ? "green" : "orange";
|
||||
}
|
||||
|
||||
function getItemFulfillmentStatus(item: GaoSalesOrderItem): { text: string; theme: "success" | "warning" | "danger" } {
|
||||
const fulfilledQuantity = Number(item.fulfilledQuantity || 0);
|
||||
const remainingQuantity = Number(item.remainingQuantity || 0);
|
||||
const fulfilledQuantity = Number(item.fulfilledBaseQuantity || 0);
|
||||
const remainingQuantity = Number(item.remainingBaseQuantity || 0);
|
||||
if (0 < fulfilledQuantity && remainingQuantity === 0) {
|
||||
return { text: "已完成", theme: "success" };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user