Commit 1bdbbed5 by linjinhong
parents b4150a0e 7ea45907
......@@ -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
......
......@@ -48,6 +48,7 @@ export interface SearchForm {
export interface PodUsOrderListData {
id: number
thirdOrderNumber?: string
batchArrangeNumber?: string
prnUrl?: string
factoryOrderNumber?: string
prnDownloadStatus?: boolean
......
<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>
......@@ -2542,10 +2547,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,
......@@ -2680,6 +2687,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)
......@@ -2971,6 +2979,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">
......@@ -1761,17 +1770,30 @@
{{ row.automaticComposing ? '是' : '否' }}
</div>
</template>
<template #prn="{ row }">
<div style="display: flex">
<span :title="fileName(row)" class="flex-1">{{
fileName(row)
}}</span>
<template #composingParam="{ row }">
<div style="white-space: pre-line">
{{ row.composingParam?.split(';').join('\n') }}
</div>
</template>
<template #failTime="{ row }">
<div style="white-space: pre-line">
{{ row.failTime?.replace('T', ' ') }}
</div>
</template>
<template #failReason="{ row }">
<span style="white-space: pre-line" v-html="row.failReason"></span>
</template>
<template #operate="{ row }">
<div
v-if="status === 'BATCH_DOWNLOAD'"
class="operate-box-vertical"
>
<el-link
:disabled="row.isUpload"
underline="never"
type="success"
@click="uploadFile(row)"
>上传</el-link
>上传PRN</el-link
>
<el-icon
v-if="row.isUpload"
......@@ -1784,50 +1806,19 @@
:disabled="!row.prnUrl"
style="margin-left: 8px"
underline="never"
type="primary"
:title="fileName(row)"
type="success"
@click="downloadRowProFile(row)"
>下载
>下载PRN
</el-link>
<el-icon
v-if="row.prnDownloadStatus"
style="right: -2px"
class="check-icon"
class="download-icon"
style="position:relative;right: 7px"
>
<CircleCheckFilled />
</el-icon>
</div>
</template>
<template #composingParam="{ row }">
<div style="white-space: pre-line">
{{ row.composingParam?.split(';').join('\n') }}
</div>
</template>
<template #failTime="{ row }">
<div style="white-space: pre-line">
{{ row.failTime?.replace('T', ' ') }}
</div>
</template>
<template #failReason="{ row }">
<span style="white-space: pre-line" v-html="row.failReason"></span>
</template>
<template #operate="{ row }">
<div
v-if="status === 'BATCH_DOWNLOAD'"
class="operate-box-vertical"
>
<span class="operate-item">
<ElButton
:disabled="!row.url && !row.tiffUrl"
link
type="primary"
@click="handleDownload(row)"
>
下载
</ElButton>
<el-icon v-if="row.downloadStatus" class="check-icon"
><CircleCheckFilled
/></el-icon>
</span>
<!-- <span class="operate-item">
<ElButton
:disabled="!row.tiffUrl"
......@@ -1865,24 +1856,29 @@
/></el-icon>
</span>
<span class="operate-item">
<ElButton
:disabled="row.productNum > 50"
:disabled="!row.url && !row.tiffUrl"
link
title="重新排版"
type="warning"
:loading="reComposingLoadingMap[row.id]"
@click="showArrange(1, row)"
type="primary"
@click="handleDownload(row)"
>
重排
下载素材
</ElButton>
<el-icon v-if="row.downloadStatus" class="download-icon"
><CircleCheckFilled
/></el-icon>
</span>
<span class="operate-item">
<ElButton
:disabled="row.productNum > 50"
link
type="danger"
@click="handleBatchDelete('single', row.id)"
title="重新排版"
type="warning"
:loading="reComposingLoadingMap[row.id]"
@click="showArrange(1, row)"
>
删除
重排
</ElButton>
</span>
</div>
......@@ -2905,6 +2901,7 @@
<ElButton type="primary" @click="confirmReplenishment">确定</ElButton>
</template>
</ElDialog>
<print-warehouse-sku-tag ref="printWarehouseSkuDialogRef" />
<ReissueOrderComponent
ref="reissueOrderRef"
:selection="selection"
......@@ -3031,7 +3028,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'
......@@ -3055,6 +3052,7 @@ import {
type NavigationGuardNext,
type RouteLocationNormalized,
} from 'vue-router'
import PrintWarehouseSkuTag from '@/views/order/components/printWarehouseSkuTag.vue'
declare global {
interface Window {
......@@ -3088,6 +3086,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 }[]>([])
......@@ -3137,6 +3136,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
}
......@@ -3564,13 +3571,7 @@ const tableColumns = computed(() => {
prop: 'employeeAccount',
align: 'center',
},
{
label: '失败原因',
minWidth: 250,
prop: 'failReason',
slot: 'failReason',
align: 'left',
},
{
label: '创建时间',
width: 180,
......@@ -3593,11 +3594,11 @@ const tableColumns = computed(() => {
align: 'center',
},
{
label: 'PRN文件',
width: 300,
prop: 'automaticComposing',
slot: 'prn',
align: 'right',
label: '失败原因',
minWidth: 250,
prop: 'failReason',
slot: 'failReason',
align: 'left',
},
{
label: '排版参数',
......@@ -3609,7 +3610,7 @@ const tableColumns = computed(() => {
{
label: '操作',
slot: 'operate',
width: 300,
width: 400,
align: 'center',
fixed: 'right',
prop: 'operate',
......@@ -4207,19 +4208,25 @@ const uploadFile = (row: PodUsOrderListData) => {
input.type = 'file'
input.multiple = false
input?.click()
row.isUpload = true
input.onchange = async function () {
try {
if (input.files && input.files.length) {
if(!input.files[0].name.startsWith(row.batchArrangeNumber || '')) {
await ElMessageBox.confirm(`文件名不是以批次号开头是否继续上传?`, '提示', {
confirmButtonText: '确定',
type: 'warning',
})
}
row.isUpload = true
uploadList.value.push(row)
const fm = new FormData()
fm.append('file', input.files?.[0])
fm.append('file', (input.files as never)?.[0])
row.fileName = input.files?.[0]?.name
// console.log(4219, input.files?.[0])
const res = await uploadPRNFile(row.id, fm)
const res = await uploadPRNFile(row.id, fm as never)
row.prnUrl = res.message
}
} finally {
......@@ -6942,7 +6949,9 @@ const printNormal = async () => {
.operate-item {
position: relative;
}
.download-icon{
color: var(--el-color-success);
}
.check-icon {
color: var(--el-color-success);
position: absolute;
......
......@@ -236,6 +236,7 @@ const {
})
const dialogVisible = ref(false)
const editLoading = ref(false)
const goodsTableData = ref([])
const supplierTableData = ref<IgoodsType[]>([])
......@@ -899,11 +900,11 @@ async function addPice(product: IgoodsType) {
const tempArr = product.supplierPriceItemList || product.customProductItemList
pricetableData.value = cloneDeep(
tempArr?.map((el) => {
if (!el.productItemId) el.productItemId = el.id || ''
return {
...el,
productItemImage: el.productItemImage || el.image,
productItemSku: el.productItemSku || el.sku,
productItemId: el.id || '',
}
}) || [],
)
......
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