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' { ...@@ -54,7 +54,6 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
......
...@@ -16,6 +16,7 @@ import { ...@@ -16,6 +16,7 @@ import {
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData, OrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData, OrderData } from '@/types/api/podMakeOrder'
import { PrintData } from '@/types/api/podOrder.ts'
export function exportPodCnInfo(data: ExportParams) { export function exportPodCnInfo(data: ExportParams) {
return axios.post<never, BasePaginationData<never>>( return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderCn/exportPodCnOrder', 'factory/podJomallOrderCn/exportPodCnOrder',
...@@ -145,6 +146,25 @@ export function getCardOrderList( ...@@ -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( export function confirmOrderApi(
data: number[], data: number[],
productionClient: string, productionClient: string,
......
...@@ -716,4 +716,4 @@ export function printBarcodeApi(data: { id: number, dataVersion: number }[]) { ...@@ -716,4 +716,4 @@ export function printBarcodeApi(data: { id: number, dataVersion: number }[]) {
'factoryStockingPlanRecord/print_barcode', 'factoryStockingPlanRecord/print_barcode',
data, data,
) )
} }
\ No newline at end of file
...@@ -3,7 +3,15 @@ export interface Tab { ...@@ -3,7 +3,15 @@ export interface Tab {
statusName?: string statusName?: string
quantity?: number quantity?: number
} }
export interface PrintData{
locationName: string
pickingLocation?: string
skuName?: string
warehouseSku?: string
supplierItemNo?: string
number?: string
}
export interface SearchForm { export interface SearchForm {
status?: string | null status?: string | null
factorySubOrderNumber?: string 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 @@ ...@@ -804,6 +804,11 @@
>批量删除</ElButton >批量删除</ElButton
> >
</span> </span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="warning" @click="showPrintSku"
>打印库存sku标签</ElButton
>
</span>
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
</div> </div>
...@@ -2524,10 +2529,12 @@ ...@@ -2524,10 +2529,12 @@
} }
" "
></ChangeWayDialog> ></ChangeWayDialog>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx' import LogisticsWaySelect from '../../logistics/components/LogisticsWaySelect.tsx'
import PrintWarehouseSkuTag from '../components/printWarehouseSkuTag.vue'
// import { AnyObject } from '@/types/api/warehouse' // import { AnyObject } from '@/types/api/warehouse'
import { import {
InfoFilled, InfoFilled,
...@@ -2662,6 +2669,7 @@ const isSuperFactory: boolean = userStore.user?.factory.dropShipping || false ...@@ -2662,6 +2669,7 @@ const isSuperFactory: boolean = userStore.user?.factory.dropShipping || false
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const isAuto = ref(true) const isAuto = ref(true)
const printWarehouseSkuDialogRef = ref()
const calculatedPrice = (item: ProductList) => { const calculatedPrice = (item: ProductList) => {
const templatePrice = new BigNumber(item.templatePrice || 0) const templatePrice = new BigNumber(item.templatePrice || 0)
...@@ -2953,6 +2961,15 @@ const changeExceptionOrder = async () => { ...@@ -2953,6 +2961,15 @@ const changeExceptionOrder = async () => {
currentOrderIds.value = selection.value.map((item) => item.id) currentOrderIds.value = selection.value.map((item) => item.id)
exceptionDialogVisible.value = true 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 () => { const handleExceptionConfirm = async () => {
try { try {
await exceptionFormRef.value.validate() await exceptionFormRef.value.validate()
......
...@@ -835,6 +835,15 @@ ...@@ -835,6 +835,15 @@
<ElButton type="success" @click="reissueOrder">补发</ElButton> <ElButton type="success" @click="reissueOrder">补发</ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="status === 'WAIT_SHIPMENT'">
<span class="item">
<ElButton type="warning" @click="showPrintSku"
>打印库存sku标签</ElButton
>
</span>
</ElFormItem>
</ElForm> </ElForm>
</div> </div>
<div class="header-filter-tab"> <div class="header-filter-tab">
...@@ -2901,6 +2910,7 @@ ...@@ -2901,6 +2910,7 @@
<ElButton type="primary" @click="confirmReplenishment">确定</ElButton> <ElButton type="primary" @click="confirmReplenishment">确定</ElButton>
</template> </template>
</ElDialog> </ElDialog>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
<ReissueOrderComponent <ReissueOrderComponent
ref="reissueOrderRef" ref="reissueOrderRef"
:selection="selection" :selection="selection"
...@@ -3027,7 +3037,7 @@ import { ...@@ -3027,7 +3037,7 @@ import {
Loading, Loading,
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } 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 { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
...@@ -3051,6 +3061,7 @@ import { ...@@ -3051,6 +3061,7 @@ import {
type NavigationGuardNext, type NavigationGuardNext,
type RouteLocationNormalized, type RouteLocationNormalized,
} from 'vue-router' } from 'vue-router'
import PrintWarehouseSkuTag from '@/views/order/components/printWarehouseSkuTag.vue'
declare global { declare global {
interface Window { interface Window {
...@@ -3084,6 +3095,7 @@ const sourceList = [ ...@@ -3084,6 +3095,7 @@ const sourceList = [
const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL'] const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL']
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const reissueOrderRef = ref() const reissueOrderRef = ref()
const printWarehouseSkuDialogRef = ref()
const isAuto = ref(true) const isAuto = ref(true)
const countryList = ref([]) const countryList = ref([])
const logisticsWayList = ref<{ name: string; id: number }[]>([]) const logisticsWayList = ref<{ name: string; id: number }[]>([])
...@@ -3133,6 +3145,14 @@ const updateTrackingNumber = async (row: PodUsOrderListData) => { ...@@ -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 = () => { const exportData = () => {
exportVisible.value = true 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