update ProductStockBatchConfigure.vue style
This commit is contained in:
@@ -1,17 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-can="permissionCodes.productStock.create" class="product-stock-batch-configure">
|
<div v-can="permissionCodes.productStock.create" class="product-stock-batch-configure">
|
||||||
<t-cell-group theme="card" class="batch-info">
|
|
||||||
<t-form class="form" label-width="5rem">
|
<t-form class="form" label-width="5rem">
|
||||||
<t-form-item label="入库备注" required-mark>
|
<t-form-item label="入库备注" required-mark>
|
||||||
<t-textarea
|
<div class="remark-wrap">
|
||||||
|
<t-input
|
||||||
v-model="productStockBatchStore.remark"
|
v-model="productStockBatchStore.remark"
|
||||||
:disabled="isSaving"
|
:disabled="isSaving"
|
||||||
borderless
|
borderless
|
||||||
maxlength="500"
|
maxlength="500"
|
||||||
autosize
|
autosize
|
||||||
placeholder="请输入本批次入库备注"
|
placeholder="本批次入库备注"
|
||||||
@update:model-value="invalidateRequestNo"
|
@update:model-value="invalidateRequestNo"
|
||||||
/>
|
/>
|
||||||
|
<t-button
|
||||||
|
type="button"
|
||||||
|
size="extra-small"
|
||||||
|
variant="outline"
|
||||||
|
:content="quickRemarkText"
|
||||||
|
:disabled="isSaving"
|
||||||
|
@click="applyQuickRemark"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
<t-form-item label-width="0">
|
<t-form-item label-width="0">
|
||||||
<media-selector
|
<media-selector
|
||||||
@@ -21,79 +30,104 @@
|
|||||||
:edit-mode="true"
|
:edit-mode="true"
|
||||||
:loading="isSaving"
|
:loading="isSaving"
|
||||||
:show-remove="!isSaving"
|
:show-remove="!isSaving"
|
||||||
title="共用附件(未单独添加时使用)"
|
title="共有入库记录(无专有记录时使用)"
|
||||||
@update:photo-items="invalidateRequestNo"
|
@update:photo-items="invalidateRequestNo"
|
||||||
/>
|
/>
|
||||||
<div class="attachment-tip" v-text="'每个 SKU 都必须有附件;未单独添加时使用共用附件'" />
|
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
</t-form>
|
</t-form>
|
||||||
</t-cell-group>
|
<t-form v-if="productStockBatchStore.selectedItemList.length" class="items form" label-width="0">
|
||||||
<div v-if="productStockBatchStore.selectedItemList.length" class="item-list">
|
<t-form-item
|
||||||
<article
|
|
||||||
v-for="item in productStockBatchStore.selectedItemList"
|
v-for="item in productStockBatchStore.selectedItemList"
|
||||||
:key="item.sku.id"
|
:key="item.sku.id"
|
||||||
class="sku-item"
|
class="item"
|
||||||
|
label-width="0"
|
||||||
>
|
>
|
||||||
<header class="sku-header">
|
<div class="content">
|
||||||
<div class="sku-title">
|
<div class="main">
|
||||||
<strong v-text="item.sku.name || '未命名 SKU'" />
|
<div class="left">
|
||||||
<span class="sku-note" v-text="getSkuNote(item)" />
|
<t-image
|
||||||
|
v-if="getProductPhotoURL(item.sku)"
|
||||||
|
:src="getProductPhotoURL(item.sku)"
|
||||||
|
:alt="item.productName || '产品图片'"
|
||||||
|
fit="cover"
|
||||||
|
class="avatar"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="avatar fallback"
|
||||||
|
v-text="(item.productName || item.sku.name || '产').slice(0, 1)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<div class="header">
|
||||||
|
<div class="title">
|
||||||
|
<div class="name clip-text" v-text="item.productName || '未命名产品'" />
|
||||||
|
<t-tag
|
||||||
|
v-if="!isDefaultSku(item) && item.sku.name"
|
||||||
|
size="small"
|
||||||
|
theme="primary"
|
||||||
|
variant="light-outline"
|
||||||
|
:content="item.sku.name"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<t-button
|
<t-button
|
||||||
theme="danger"
|
theme="danger"
|
||||||
variant="text"
|
variant="text"
|
||||||
size="small"
|
size="extra-small"
|
||||||
content="移除"
|
content="移除"
|
||||||
:disabled="isSaving"
|
:disabled="isSaving"
|
||||||
@click.stop="removeItem(item.sku.id || '')"
|
@click.stop="removeItem(item.sku.id || '')"
|
||||||
/>
|
/>
|
||||||
</header>
|
|
||||||
<div class="unit-selection">
|
|
||||||
<strong v-text="'入库单位'" />
|
|
||||||
<div class="unit-list" role="group" :aria-label="`选择${item.sku.name || 'SKU'}入库单位`">
|
|
||||||
<t-button
|
|
||||||
v-for="unit in getSelectableUnits(item)"
|
|
||||||
:key="unit.id"
|
|
||||||
size="small"
|
|
||||||
:theme="item.skuUnitId === unit.id ? 'primary' : 'default'"
|
|
||||||
:variant="item.skuUnitId === unit.id ? 'base' : 'outline'"
|
|
||||||
:disabled="isSaving"
|
|
||||||
:aria-pressed="item.skuUnitId === unit.id"
|
|
||||||
@click="selectUnit(item, unit)"
|
|
||||||
>
|
|
||||||
<span v-text="unit.name || '未命名单位'" />
|
|
||||||
</t-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="input">
|
||||||
<t-form class="form" label-width="5rem">
|
<t-stepper
|
||||||
<t-form-item label="数量" required-mark>
|
|
||||||
<t-input
|
|
||||||
v-model="item.quantity"
|
v-model="item.quantity"
|
||||||
|
class="quantity"
|
||||||
|
:max="Number.MAX_SAFE_INTEGER"
|
||||||
|
:min="0"
|
||||||
|
size="large"
|
||||||
|
:step="getProductQuantityStep(item.sku)"
|
||||||
|
:integer="!item.sku.allowDecimalQuantity"
|
||||||
:disabled="isSaving"
|
:disabled="isSaving"
|
||||||
type="number"
|
theme="outline"
|
||||||
align="right"
|
@change="invalidateRequestNo"
|
||||||
borderless
|
|
||||||
:placeholder="item.sku.allowDecimalQuantity ? '最多三位小数' : '请输入整数'"
|
|
||||||
@update:model-value="invalidateRequestNo"
|
|
||||||
/>
|
/>
|
||||||
</t-form-item>
|
<t-button
|
||||||
<t-form-item label-width="0">
|
size="extra-small"
|
||||||
|
variant="outline"
|
||||||
|
:content="getSelectedUnitName(item)"
|
||||||
|
:disabled="isSaving"
|
||||||
|
@click.stop="openUnitPicker(item)"
|
||||||
|
/>
|
||||||
|
<t-button
|
||||||
|
size="extra-small"
|
||||||
|
variant="outline"
|
||||||
|
content="专有入库记录"
|
||||||
|
:disabled="isSaving"
|
||||||
|
:aria-expanded="isAttachmentVisible(item.sku.id || '')"
|
||||||
|
@click.stop="toggleAttachmentVisibility(item.sku.id || '')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<media-selector
|
<media-selector
|
||||||
|
v-if="isAttachmentVisible(item.sku.id || '')"
|
||||||
:model-value="getAttachmentUrlList(item.attachmentItems)"
|
:model-value="getAttachmentUrlList(item.attachmentItems)"
|
||||||
v-model:photo-items="item.attachmentItems"
|
v-model:photo-items="item.attachmentItems"
|
||||||
:upload="uploadPhotos"
|
:upload="uploadPhotos"
|
||||||
:edit-mode="true"
|
:edit-mode="true"
|
||||||
|
title=""
|
||||||
:loading="isSaving"
|
:loading="isSaving"
|
||||||
:show-remove="!isSaving"
|
:show-remove="!isSaving"
|
||||||
title="SKU 附件(可选)"
|
|
||||||
@update:photo-items="invalidateRequestNo"
|
@update:photo-items="invalidateRequestNo"
|
||||||
/>
|
/>
|
||||||
<div class="attachment-tip" v-text="'添加 SKU 附件后,该 SKU 不使用共用附件'" />
|
</div>
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
</t-form>
|
</t-form>
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
<t-empty v-else description="没有已选 SKU,请返回重新选择" />
|
<t-empty v-else description="没有已选 SKU,请返回重新选择" />
|
||||||
|
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||||
|
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择入库单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||||
|
</t-popup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -102,19 +136,21 @@ import { onBeforeRouteLeave } from "vue-router";
|
|||||||
import { useUserStore } from "timi-web-api";
|
import { useUserStore } from "timi-web-api";
|
||||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||||
import { useNavBarStore } from "@/store/navBarStore";
|
import { useNavBarStore } from "@/store/navBarStore";
|
||||||
import { useProductStockBatchStore, type ProductStockBatchSelection } from "@/store/productStockBatchStore";
|
import { type ProductStockBatchSelection, useProductStockBatchStore } from "@/store/productStockBatchStore";
|
||||||
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
|
import MediaSelector from "@/components/mediaSelector/MediaSelector.vue";
|
||||||
import ProductAPI from "@/api/ProductAPI";
|
import ProductAPI from "@/api/ProductAPI";
|
||||||
import type { ProductStockManualInBatchItem, ProductStockManualInBatchRequest, ProductSkuUnit } from "@/types/Product";
|
import type { ProductSkuUnit, ProductStockManualInBatchItem, ProductStockManualInBatchRequest } from "@/types/Product";
|
||||||
import type { PhotoItem } from "@/types/Photo";
|
import type { PhotoItem } from "@/types/Photo";
|
||||||
import { getErrorMessage } from "@/utils/error";
|
import { getErrorMessage } from "@/utils/error";
|
||||||
import { createProductRequestNo } from "@/utils/product";
|
import { createProductRequestNo, getProductPhotoURL, getProductQuantityStep } from "@/utils/product";
|
||||||
import { emitListDataChanged, listDataEventKeys } from "@/utils/listDataEvents";
|
import { emitListDataChanged, listDataEventKeys } from "@/utils/listDataEvents";
|
||||||
import { Message } from "@/utils/message";
|
import { Message } from "@/utils/message";
|
||||||
import { permissionCodes } from "@/utils/permission";
|
import { permissionCodes } from "@/utils/permission";
|
||||||
import { getCurrentStoreId } from "@/utils/store";
|
import { getCurrentStoreId } from "@/utils/store";
|
||||||
import { uploadPhotoList } from "@/utils/photo";
|
import { uploadPhotoList } from "@/utils/photo";
|
||||||
|
|
||||||
|
type PickerValue = string | number;
|
||||||
|
|
||||||
defineOptions({ name: "ProductStockBatchConfigure" });
|
defineOptions({ name: "ProductStockBatchConfigure" });
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -125,9 +161,18 @@ const userStore = useUserStore();
|
|||||||
const activeStoreId = ref("");
|
const activeStoreId = ref("");
|
||||||
const isSaving = ref(false);
|
const isSaving = ref(false);
|
||||||
const uploadCount = ref(0);
|
const uploadCount = ref(0);
|
||||||
|
const visibleAttachmentSkuIdSet = ref<Set<string>>(new Set());
|
||||||
|
const unitPickerVisible = ref(false);
|
||||||
|
const unitPickerSkuId = ref("");
|
||||||
|
const unitPickerDraft = ref<PickerValue[]>([]);
|
||||||
|
const quickRemarkText = "正常入库";
|
||||||
const globalAttachmentUrlList = computed(() => productStockBatchStore.attachmentItems.map(item => item.url));
|
const globalAttachmentUrlList = computed(() => productStockBatchStore.attachmentItems.map(item => item.url));
|
||||||
|
const unitPickerOptions = computed(() => {
|
||||||
|
const item = productStockBatchStore.selectedItemList.find(candidate => candidate.sku.id === unitPickerSkuId.value);
|
||||||
|
return getSelectableUnits(item).map(unit => ({ label: unit.name || "未命名单位", value: unit.id || "" }));
|
||||||
|
});
|
||||||
const canSubmit = computed(() => {
|
const canSubmit = computed(() => {
|
||||||
const itemList = productStockBatchStore.selectedItemList;
|
const itemList = getSubmitItemList();
|
||||||
return !isSaving.value
|
return !isSaving.value
|
||||||
&& uploadCount.value === 0
|
&& uploadCount.value === 0
|
||||||
&& !!productStockBatchStore.remark.trim()
|
&& !!productStockBatchStore.remark.trim()
|
||||||
@@ -139,8 +184,12 @@ function getSelectableUnits(item?: ProductStockBatchSelection): ProductSkuUnit[]
|
|||||||
return (item?.sku.unitList || []).filter(unit => unit.allowPurchase && !!unit.id);
|
return (item?.sku.unitList || []).filter(unit => unit.allowPurchase && !!unit.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSkuNote(item: ProductStockBatchSelection): string {
|
function getSelectedUnitName(item: ProductStockBatchSelection): string {
|
||||||
return [item.productName || "未命名产品", item.sku.specSummary].filter(Boolean).join(" · ");
|
return getSelectableUnits(item).find(unit => unit.id === item.skuUnitId)?.name || "选择入库单位";
|
||||||
|
}
|
||||||
|
|
||||||
|
function isDefaultSku(item: ProductStockBatchSelection): boolean {
|
||||||
|
return !item.sku.specValueIdList?.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAttachmentUrlList(itemList: PhotoItem[]): string[] {
|
function getAttachmentUrlList(itemList: PhotoItem[]): string[] {
|
||||||
@@ -159,6 +208,39 @@ function invalidateRequestNo(): void {
|
|||||||
productStockBatchStore.requestNo = "";
|
productStockBatchStore.requestNo = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function applyQuickRemark(): void {
|
||||||
|
if (isSaving.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
productStockBatchStore.remark = quickRemarkText;
|
||||||
|
invalidateRequestNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAttachmentVisible(skuId: string): boolean {
|
||||||
|
return visibleAttachmentSkuIdSet.value.has(skuId);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleAttachmentVisibility(skuId: string): void {
|
||||||
|
if (isSaving.value || !skuId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const nextVisibleAttachmentSkuIdSet = new Set(visibleAttachmentSkuIdSet.value);
|
||||||
|
if (nextVisibleAttachmentSkuIdSet.has(skuId)) {
|
||||||
|
nextVisibleAttachmentSkuIdSet.delete(skuId);
|
||||||
|
} else {
|
||||||
|
nextVisibleAttachmentSkuIdSet.add(skuId);
|
||||||
|
}
|
||||||
|
visibleAttachmentSkuIdSet.value = nextVisibleAttachmentSkuIdSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isQuantityZero(item: ProductStockBatchSelection): boolean {
|
||||||
|
return !item.quantity.trim() || Number(item.quantity) === 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSubmitItemList(): ProductStockBatchSelection[] {
|
||||||
|
return productStockBatchStore.selectedItemList.filter(item => !isQuantityZero(item));
|
||||||
|
}
|
||||||
|
|
||||||
function isQuantityValid(item: ProductStockBatchSelection): boolean {
|
function isQuantityValid(item: ProductStockBatchSelection): boolean {
|
||||||
if (!/^\d+(?:\.\d{1,3})?$/.test(item.quantity) || !(0 < Number(item.quantity))) {
|
if (!/^\d+(?:\.\d{1,3})?$/.test(item.quantity) || !(0 < Number(item.quantity))) {
|
||||||
return false;
|
return false;
|
||||||
@@ -197,6 +279,30 @@ function selectUnit(item: ProductStockBatchSelection, unit: ProductSkuUnit): voi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openUnitPicker(item: ProductStockBatchSelection): void {
|
||||||
|
if (isSaving.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const unitList = getSelectableUnits(item);
|
||||||
|
if (!unitList.length) {
|
||||||
|
Message.warning("当前 SKU 没有可用于入库的单位");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
unitPickerSkuId.value = item.sku.id || "";
|
||||||
|
unitPickerDraft.value = [unitList.find(unit => unit.id === item.skuUnitId)?.id || unitList[0]?.id || ""];
|
||||||
|
unitPickerVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmUnitPicker(value: Array<string | number>): void {
|
||||||
|
const item = productStockBatchStore.selectedItemList.find(candidate => candidate.sku.id === unitPickerSkuId.value);
|
||||||
|
const skuUnitId = String(value[0] || "");
|
||||||
|
const unit = item ? getSelectableUnits(item).find(candidate => candidate.id === skuUnitId) : undefined;
|
||||||
|
if (item && unit) {
|
||||||
|
selectUnit(item, unit);
|
||||||
|
}
|
||||||
|
unitPickerVisible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
function removeItem(skuId: string): void {
|
function removeItem(skuId: string): void {
|
||||||
if (isSaving.value) {
|
if (isSaving.value) {
|
||||||
return;
|
return;
|
||||||
@@ -204,6 +310,13 @@ function removeItem(skuId: string): void {
|
|||||||
const itemIndex = productStockBatchStore.selectedItemList.findIndex(item => item.sku.id === skuId);
|
const itemIndex = productStockBatchStore.selectedItemList.findIndex(item => item.sku.id === skuId);
|
||||||
if (-1 < itemIndex) {
|
if (-1 < itemIndex) {
|
||||||
invalidateRequestNo();
|
invalidateRequestNo();
|
||||||
|
const nextVisibleAttachmentSkuIdSet = new Set(visibleAttachmentSkuIdSet.value);
|
||||||
|
nextVisibleAttachmentSkuIdSet.delete(skuId);
|
||||||
|
visibleAttachmentSkuIdSet.value = nextVisibleAttachmentSkuIdSet;
|
||||||
|
if (unitPickerSkuId.value === skuId) {
|
||||||
|
unitPickerVisible.value = false;
|
||||||
|
unitPickerSkuId.value = "";
|
||||||
|
}
|
||||||
productStockBatchStore.selectedItemList.splice(itemIndex, 1);
|
productStockBatchStore.selectedItemList.splice(itemIndex, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,7 +339,12 @@ function validate(): boolean {
|
|||||||
Message.warning("请至少选择一个 SKU");
|
Message.warning("请至少选择一个 SKU");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (const item of productStockBatchStore.selectedItemList) {
|
const itemList = getSubmitItemList();
|
||||||
|
if (!itemList.length) {
|
||||||
|
Message.warning("请至少填写一个大于 0 的入库数量");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (const item of itemList) {
|
||||||
if (!getSelectableUnits(item).some(unit => unit.id === item.skuUnitId)) {
|
if (!getSelectableUnits(item).some(unit => unit.id === item.skuUnitId)) {
|
||||||
Message.warning((item.sku.name || "SKU") + ":请选择入库单位");
|
Message.warning((item.sku.name || "SKU") + ":请选择入库单位");
|
||||||
return false;
|
return false;
|
||||||
@@ -251,7 +369,7 @@ function validate(): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildRequest(): ProductStockManualInBatchRequest {
|
function buildRequest(): ProductStockManualInBatchRequest {
|
||||||
const itemList: ProductStockManualInBatchItem[] = productStockBatchStore.selectedItemList.map(item => {
|
const itemList: ProductStockManualInBatchItem[] = getSubmitItemList().map(item => {
|
||||||
const attachmentList = getAttachmentList(item.attachmentItems);
|
const attachmentList = getAttachmentList(item.attachmentItems);
|
||||||
return {
|
return {
|
||||||
skuId: item.sku.id || "",
|
skuId: item.sku.id || "",
|
||||||
@@ -322,79 +440,99 @@ onUnmounted(() => navBarStore.clearRight());
|
|||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.product-stock-batch-configure {
|
.product-stock-batch-configure {
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: var(--app-nav-height) 0 1rem;
|
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.form {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.batch-info {
|
.batch-info {
|
||||||
padding: .25rem .75rem;
|
padding: .25rem .75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-list {
|
.remark-wrap {
|
||||||
gap: 1rem;
|
width: 100%;
|
||||||
margin: 0 1rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sku-item {
|
|
||||||
gap: 1rem;
|
|
||||||
border: 1px solid var(--td-component-border);
|
|
||||||
padding: 1rem;
|
|
||||||
display: flex;
|
|
||||||
background: var(--td-bg-color-container);
|
|
||||||
border-radius: 1rem;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sku-header {
|
|
||||||
gap: .75rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sku-title {
|
.items {
|
||||||
gap: .25rem;
|
margin: 0 1rem;
|
||||||
|
overflow: hidden;
|
||||||
|
background: var(--td-bg-color-container);
|
||||||
|
box-shadow: var(--td-shadow-1);
|
||||||
|
border-radius: 1rem;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: .625rem;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
:deep(.t-form__controls),
|
||||||
|
:deep(.t-form__controls-content) {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
gap: .5rem;
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
strong {
|
.main {
|
||||||
color: var(--td-text-color-primary);
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sku-note {
|
|
||||||
color: var(--td-text-color-secondary);
|
|
||||||
font-size: .75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.unit-list {
|
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
|
||||||
|
.left {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 3.5rem;
|
||||||
|
height: 3.5rem;
|
||||||
|
border-radius: .5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.unit-selection {
|
.right {
|
||||||
gap: .5rem;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
strong {
|
.header {
|
||||||
color: var(--td-text-color-primary);
|
gap: .5rem;
|
||||||
font-size: .875rem;
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
gap: .375rem;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
gap: .5rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
|
||||||
.attachment-tip {
|
.attachment-tip {
|
||||||
color: var(--td-text-color-secondary);
|
color: var(--td-text-color-secondary);
|
||||||
margin-top: .25rem;
|
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
|
margin-top: .25rem;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ import { useUserStore } from "timi-web-api";
|
|||||||
import ProductAPI from "@/api/ProductAPI";
|
import ProductAPI from "@/api/ProductAPI";
|
||||||
import ProductProfile from "@/pages/product/component/ProductProfile.vue";
|
import ProductProfile from "@/pages/product/component/ProductProfile.vue";
|
||||||
import ProductStockPackageSummary from "@/pages/product/component/ProductStockPackageSummary.vue";
|
import ProductStockPackageSummary from "@/pages/product/component/ProductStockPackageSummary.vue";
|
||||||
import ProductStockOperationPopup from "@/pages/product/ProductStockOperationPopup.vue";
|
import ProductStockOperationPopup from "@/pages/product/component/ProductStockOperationPopup.vue";
|
||||||
import { useNavBarStore } from "@/store/navBarStore";
|
import { useNavBarStore } from "@/store/navBarStore";
|
||||||
import type { Product, ProductSku, ProductStock, ProductSkuUnit, StockOperationType } from "@/types/Product";
|
import type { Product, ProductSku, ProductStock, ProductSkuUnit, StockOperationType } from "@/types/Product";
|
||||||
import { getErrorMessage } from "@/utils/error";
|
import { getErrorMessage } from "@/utils/error";
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export const useProductStockBatchStore = defineStore("product-stock-batch", () =
|
|||||||
const defaultUnit = item.sku.unitList?.find(unit => unit.allowPurchase && unit.id);
|
const defaultUnit = item.sku.unitList?.find(unit => unit.allowPurchase && unit.id);
|
||||||
selectedItemList.value.push({
|
selectedItemList.value.push({
|
||||||
...item,
|
...item,
|
||||||
quantity: "",
|
quantity: "0",
|
||||||
skuUnitId: defaultUnit?.id || "",
|
skuUnitId: defaultUnit?.id || "",
|
||||||
attachmentItems: []
|
attachmentItems: []
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user