Commit 8675075a by zhuzhequan

Merge branch 'dev' into 'master'

feat:打印sku标签功能

See merge request !113
parents 63ba7cc3 c82b1ccc
......@@ -54,7 +54,6 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
......
......@@ -16,6 +16,7 @@ import {
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData, OrderData } from '@/types/api/podMakeOrder'
import { PrintData } from '@/types/api/podOrder.ts'
export function exportPodCnInfo(data: ExportParams) {
return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderCn/exportPodCnOrder',
......@@ -145,6 +146,25 @@ export function getCardOrderList(
},
)
}
export function batchCheckPrintPodCn(
ids:string
) {
return axios.get<never, BaseRespData<PrintData[]>>(
`/factory/podJomallOrderCn/batchCheckPrintPodCn?ids=${ids}`,
)
}
export function batchCheckPrintPodUs(
ids:string
) {
return axios.get<never, BaseRespData<PrintData[]>>(
`/factory/podJomallOrderUs/batchCheckPrintPodUs?ids=${ids}`,
)
}
export function confirmOrderApi(
data: number[],
productionClient: string,
......
......@@ -716,4 +716,4 @@ export function printBarcodeApi(data: { id: number, dataVersion: number }[]) {
'factoryStockingPlanRecord/print_barcode',
data,
)
}
\ No newline at end of file
}
......@@ -3,7 +3,15 @@ export interface Tab {
statusName?: string
quantity?: number
}
export interface PrintData{
locationName: string
pickingLocation?: string
skuName?: string
warehouseSku?: string
supplierItemNo?: string
number?: string
}
export interface SearchForm {
status?: string | null
factorySubOrderNumber?: string
......
<script setup lang="ts">
import { batchCheckPrintPodCn, batchCheckPrintPodUs } from '@/api/podCnOrder.ts'
import { InterWarehousePage } from '@/types/api/warehouse.ts'
import { ElMessage } from 'element-plus'
import { factoryWarehouseInventoryPrint } from '@/api/warehouse.ts'
import { filePath } from '@/api/axios.ts'
import { PrintData } from '@/types/api/podOrder.ts'
const showPrintDialog = ref(false)
const printData = ref<PrintData[]>([])
const open = async (type: number,ids:string) => {
let res
printData.value = []
if (type === 1) {
res = await batchCheckPrintPodCn(ids)
}else{
res= await batchCheckPrintPodUs(ids)
}
showPrintDialog.value = true
printData.value = res.data
}
async function handlePrintProductTag() {
const flag = printData.value.every(
(el: InterWarehousePage) => el.number && el.number != '0',
)
if (!flag) {
return ElMessage.warning('打印数量需大于0')
}
const list = printData.value.map(
({
skuName = '',
warehouseSku = '',
supplierItemNo = '',
number = '',
locationName = '',
}) => ({
skuName,
warehouseSku,
supplierItemNo,
number,
locationName,
}),
)
const res = await factoryWarehouseInventoryPrint({
list,
code: 'PT002',
})
showPrintDialog.value = false
window.open(filePath + res.message, '_blank')
}
defineExpose({open})
</script>
<template>
<el-dialog v-model="showPrintDialog" title="打印参数设置">
<el-table height="400px" :data="printData" border>
<el-table-column width="60" align="center" type="index" label="序号" />
<el-table-column align="center" prop="skuName" label="商品名称" />
<el-table-column align="center" prop="warehouseSku" label="库存SKU" />
<el-table-column align="center" prop="locationName" label="库位编码" />
<el-table-column align="center" prop="supplierItemNo" label="款号" />
<el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }">
<el-input
v-model.number="row.number"
oninput="value=value.replace(/[^\-?\d.]/g,'')"
placeholder="打印数量"
clearable
></el-input>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="showPrintDialog = false">取消</el-button>
<el-button type="primary" @click="handlePrintProductTag">打印</el-button>
</template>
</el-dialog>
</template>
<style scoped lang="scss">
</style>
......@@ -804,6 +804,11 @@
>批量删除</ElButton
>
</span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="warning" @click="showPrintSku"
>打印库存sku标签</ElButton
>
</span>
</ElFormItem>
</ElForm>
</div>
......@@ -2524,10 +2529,12 @@
}
"
></ChangeWayDialog>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
</template>
<script setup lang="ts">
import { getUserMarkList } from '@/api/common'
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import PrintWarehouseSkuTag from '../components/printWarehouseSkuTag.vue'
// import { AnyObject } from '@/types/api/warehouse'
import {
InfoFilled,
......@@ -2662,6 +2669,7 @@ const isSuperFactory: boolean = userStore.user?.factory.dropShipping || false
const tabsNav = ref<Tab[]>()
const isAuto = ref(true)
const printWarehouseSkuDialogRef = ref()
const calculatedPrice = (item: ProductList) => {
const templatePrice = new BigNumber(item.templatePrice || 0)
......@@ -2953,6 +2961,15 @@ const changeExceptionOrder = async () => {
currentOrderIds.value = selection.value.map((item) => item.id)
exceptionDialogVisible.value = true
}
const showPrintSku = async () => {
if(!selection.value.length) {
return ElMessage.warning('请选择数据')
}
await printWarehouseSkuDialogRef.value?.open(1,selection.value.map((item) => item.id).join(','))
}
const handleExceptionConfirm = async () => {
try {
await exceptionFormRef.value.validate()
......
......@@ -835,6 +835,15 @@
<ElButton type="success" @click="reissueOrder">补发</ElButton>
</span>
</ElFormItem>
<ElFormItem v-if="status === 'WAIT_SHIPMENT'">
<span class="item">
<ElButton type="warning" @click="showPrintSku"
>打印库存sku标签</ElButton
>
</span>
</ElFormItem>
</ElForm>
</div>
<div class="header-filter-tab">
......@@ -2901,6 +2910,7 @@
<ElButton type="primary" @click="confirmReplenishment">确定</ElButton>
</template>
</ElDialog>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
<ReissueOrderComponent
ref="reissueOrderRef"
:selection="selection"
......@@ -3027,7 +3037,7 @@ import {
Loading,
CircleCheckFilled,
} from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus'
import { Column, ElFormItem, ElMessage } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios'
......@@ -3051,6 +3061,7 @@ import {
type NavigationGuardNext,
type RouteLocationNormalized,
} from 'vue-router'
import PrintWarehouseSkuTag from '@/views/order/components/printWarehouseSkuTag.vue'
declare global {
interface Window {
......@@ -3084,6 +3095,7 @@ const sourceList = [
const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL']
const tabsNav = ref<Tab[]>()
const reissueOrderRef = ref()
const printWarehouseSkuDialogRef = ref()
const isAuto = ref(true)
const countryList = ref([])
const logisticsWayList = ref<{ name: string; id: number }[]>([])
......@@ -3133,6 +3145,14 @@ const updateTrackingNumber = async (row: PodUsOrderListData) => {
}
}
const showPrintSku = async () => {
if(!selection.value.length) {
return ElMessage.warning('请选择数据')
}
await printWarehouseSkuDialogRef.value?.open(2,selection.value.map((item) => item.id).join(','))
}
const exportData = () => {
exportVisible.value = true
}
......
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