Commit 82b25374 by qinjianhui

feat: 打印库存SKU标签功能开发

parent 7f93928e
......@@ -14,6 +14,7 @@ import type {
} from '@/types/api/factoryOrderNew'
import { ResultInfoDataItem } from '@/types/api/order/common'
import type { OrderData } from '@/types/api/podMakeOrder'
import type { PrintData } from '@/types/api/podOrder'
function normalizePodOrderQueryPayload(
data: Record<string, unknown>,
): Record<string, unknown> {
......@@ -509,3 +510,9 @@ export function statusPushApi(ids: (string | number)[]) {
ids,
)
}
export function batchCheckPrintPodOrder(ids: string) {
return axios.get<never, BaseRespData<PrintData[]>>(
`/factory/podOrder/batchCheckPrintPodOrder?ids=${ids}`,
)
}
......@@ -56,6 +56,9 @@ export interface ProductList {
podJomallCnNo?: string
thirdSkuCode?: string
previewImgs?: { sort?: string | number; title?: string; url: string }[]
operationNos?: string
variantSku?: string
productName?: string
}
export interface LogisticBill {
......
<script setup lang="ts">
import { batchCheckPrintPodCn, batchCheckPrintPodUs } from '@/api/podCnOrder.ts'
import { batchCheckPrintPodOrder } from '@/api/factoryOrderNew.ts'
import { InterWarehousePage } from '@/types/api/warehouse.ts'
import { ElMessage } from 'element-plus'
import { factoryWarehouseInventoryPrint } from '@/api/warehouse.ts'
......@@ -9,14 +10,16 @@ import { PrintData } from '@/types/api/podOrder.ts'
const showPrintDialog = ref(false)
const printData = ref<PrintData[]>([])
const open = async (type: number,ids:string) => {
let res
const apiMap: Record<number, (ids: string) => Promise<{ data: PrintData[] }>> = {
1: batchCheckPrintPodCn,
2: batchCheckPrintPodUs,
3: batchCheckPrintPodOrder,
}
const open = async (type: number, ids: string) => {
printData.value = []
if (type === 1) {
res = await batchCheckPrintPodCn(ids)
}else{
res= await batchCheckPrintPodUs(ids)
}
const api = apiMap[type] ?? batchCheckPrintPodCn
const res = await api(ids)
showPrintDialog.value = true
printData.value = res.data
}
......
......@@ -528,6 +528,7 @@
>单件打单</ElButton
>
</span>
<span
v-if="status === 'IN_PRODUCTION' || status === 'PENDING_PACKING'"
class="item"
......@@ -594,6 +595,11 @@
>
<ElButton type="danger" @click="handleSuspend">挂起</ElButton>
</span>
<span v-if="status === 'PENDING_PACKING'" class="item">
<ElButton type="success" @click="handlePrintWarehouseSkuTag"
>打印库存SKU标签</ElButton
>
</span>
<span
v-if="
status === 'PENDING_SCHEDULE' ||
......@@ -848,6 +854,7 @@
@set-printer="handlePrinterChange"
@refresh="() => refreshCurrentView({ isRefreshTree: true })"
/>
<PrintWarehouseSkuTag ref="printWarehouseSkuDialogRef" />
<ResultInfo
ref="resultRefs"
:list="resultInfo"
......@@ -923,6 +930,7 @@ import WeightDialog from '@/views/order/components/WeightDialog.vue'
import FastProduction from '@/views/order/components/FastProduction.vue'
import PodMakeOrder from '@/views/order/podUs/PodMakeOrder.vue'
import PodDistributionOrder from '@/views/order/podCN/PodDistributionOrder.vue'
import PrintWarehouseSkuTag from '@/views/order/components/printWarehouseSkuTag.vue'
import { ResultInfoDataItem } from '@/types/api/order/common'
import { useOrderDictionaries } from './hooks/useOrderDictionaries'
import { useOrderSearchForm } from './hooks/useOrderSearchForm'
......@@ -1372,6 +1380,7 @@ const pickFailDialogRef = ref<InstanceType<typeof PickFailDialog>>()
const operateDetailsDialogRef = ref()
const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
const createLogisticDialogRef = ref()
const printWarehouseSkuDialogRef = ref<InstanceType<typeof PrintWarehouseSkuTag>>()
const updateCustomsDialogVisible = ref(false)
const weightDialogRef = ref()
const detailVisible = ref(false)
......@@ -1844,6 +1853,11 @@ const handleQuickProduction = () => {
const handleSinglePrint = () => {
podDistributionOrderVisible.value = true
}
const handlePrintWarehouseSkuTag = async () => {
if (!ensureSelection()) return
const ids = getSelectedIds().join(',')
await printWarehouseSkuDialogRef.value?.open(3, ids)
}
const handleGetTrackingNumber = async () => {
await executeBatchAction({
getIds: getSelectedIds,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment