Commit 82b25374 by qinjianhui

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

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