fix style
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
v-model:visible="photoViewerVisible"
|
||||
:images="photoViewerImages"
|
||||
:items="photoViewerItems"
|
||||
:viewer-z-index="props.viewerZIndex"
|
||||
:show-actions="showViewerActions === true"
|
||||
:submitting="isSubmitting"
|
||||
@change-type="changePhotoType"
|
||||
@@ -75,6 +76,7 @@ interface Props {
|
||||
showTypeLabel?: boolean;
|
||||
submit?: (photoItems: PhotoItem[]) => Promise<void>;
|
||||
title?: string;
|
||||
viewerZIndex?: number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<t-image-viewer
|
||||
v-model:visible="viewerVisible"
|
||||
:images="images"
|
||||
:style="{ zIndex: props.viewerZIndex }"
|
||||
show-index
|
||||
@close="handleClose"
|
||||
@index-change="handleIndexChange"
|
||||
@@ -103,6 +104,7 @@ interface Props {
|
||||
showActions: boolean;
|
||||
submitting: boolean;
|
||||
visible: boolean;
|
||||
viewerZIndex?: number;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="deliveredAtText || '此刻'"
|
||||
@click="pickerVisible = true"
|
||||
@click="openDeliveredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="deliveredAtText"
|
||||
@@ -136,6 +136,7 @@
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
import FulfillmentAPI from "@/api/FulfillmentAPI";
|
||||
import ProductAPI from "@/api/ProductAPI";
|
||||
import { Time } from "timi-web";
|
||||
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
|
||||
import ProductSkuTags from "@/components/ProductSkuTags.vue";
|
||||
import ProductStockPreview from "@/components/ProductStockPreview.vue";
|
||||
@@ -383,6 +384,11 @@ function confirmTime(value: string | number): void {
|
||||
pickerVisible.value = false;
|
||||
}
|
||||
|
||||
function openDeliveredAtPicker(): void {
|
||||
draftTime.value = deliveredAtText.value || Time.formatDateTime(new Date());
|
||||
pickerVisible.value = true;
|
||||
}
|
||||
|
||||
function resetDeliveredAt(): void {
|
||||
deliveredAtText.value = "";
|
||||
draftTime.value = "";
|
||||
|
||||
@@ -458,7 +458,6 @@ onUnmounted(() => {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
min-height: 70vh;
|
||||
padding-top: 1rem;
|
||||
flex-direction: column;
|
||||
|
||||
.items {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<span v-text="getProductQuantityText(record.onHandBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.onHandDelta)" v-text="getProductQuantityText(record.onHandAfter)" />
|
||||
<span class="unit">基础单位</span>
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
@@ -54,7 +54,7 @@
|
||||
<span v-text="getProductQuantityText(record.reservedBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.reservedDelta)" v-text="getProductQuantityText(record.reservedAfter)" />
|
||||
<span class="unit">基础单位</span>
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
@@ -157,6 +157,7 @@ const navBarStore = useNavBarStore();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const record = ref<StockRecord>();
|
||||
const baseUnitName = ref("");
|
||||
const isLoading = ref(false);
|
||||
const isOperating = ref(false);
|
||||
const revokeVisible = ref(false);
|
||||
@@ -299,6 +300,15 @@ async function loadData(): Promise<void> {
|
||||
try {
|
||||
const result = await ProductAPI.recordDetail(id);
|
||||
record.value = result;
|
||||
baseUnitName.value = "";
|
||||
if (result.skuId) {
|
||||
try {
|
||||
const sku = await ProductAPI.skuDetail(result.skuId);
|
||||
baseUnitName.value = sku.unitList?.find(unit => unit.isBase)?.name || sku.unitList?.[0]?.name || "";
|
||||
} catch {
|
||||
baseUnitName.value = "";
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error(getErrorMessage(error, "库存流水加载失败"));
|
||||
} finally {
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
v-model:photo-items="sku.photoItemList"
|
||||
title="SKU 图片(选填)"
|
||||
:edit-mode="true"
|
||||
:viewer-z-index="skuEditorZIndex + 1"
|
||||
:upload="uploadPhotoList"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -577,7 +577,21 @@ async function handleCustomerChange(): Promise<void> {
|
||||
}
|
||||
|
||||
async function toDetail(item: SalesOrder): Promise<void> {
|
||||
if (item.id) await router.push(`/management/sales-orders/${item.id}`);
|
||||
if (item.id) await router.push({
|
||||
path: `/management/sales-orders/${item.id}`,
|
||||
query: { transitionDepth: String(getCurrentRouteDepth() + 1) }
|
||||
});
|
||||
}
|
||||
|
||||
function getCurrentRouteDepth(): number {
|
||||
const transitionDepth = Array.isArray(route.query.transitionDepth)
|
||||
? route.query.transitionDepth[0]
|
||||
: route.query.transitionDepth;
|
||||
const depth = Number(transitionDepth);
|
||||
if (transitionDepth && Number.isInteger(depth) && 0 <= depth && depth <= 20) {
|
||||
return depth;
|
||||
}
|
||||
return Number(route.meta.depth ?? 0);
|
||||
}
|
||||
|
||||
async function toPayment(item: SalesOrder): Promise<void> {
|
||||
|
||||
@@ -277,7 +277,7 @@ onUnmounted(() => {
|
||||
.filters {
|
||||
top: var(--app-nav-height);
|
||||
z-index: 10;
|
||||
padding: .5rem;
|
||||
padding: .5rem 1rem;
|
||||
position: sticky;
|
||||
|
||||
.search {
|
||||
|
||||
Reference in New Issue
Block a user