Commit 9deae37e by zhuzhequan

feat:pod订单(us) 添加prn文件上传下载

parent 8f57c541
...@@ -85,6 +85,23 @@ export function getCardOrderList( ...@@ -85,6 +85,23 @@ export function getCardOrderList(
}, },
) )
} }
export function uploadPRNFile(
id: number,
data: FormData,
) {
return axios.post<never, BaseRespData<string>>(
`/factory/podBatchDownload/uploadPRNFile?id=${id}`,
data
)
}
export function updatePRNDownloadStatus(
id: number
) {
return axios.get<never, BaseRespData<string>>(
`/factory/podBatchDownload/updatePRNDownloadStatus?id=${id}`
)
}
export function confirmOrderApi( export function confirmOrderApi(
data: number[], data: number[],
productionClient: string, productionClient: string,
......
...@@ -48,8 +48,11 @@ export interface SearchForm { ...@@ -48,8 +48,11 @@ export interface SearchForm {
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
thirdOrderNumber?: string thirdOrderNumber?: string
prnUrl?: string
factoryOrderNumber?: string factoryOrderNumber?: string
prnDownloadStatus?: boolean
shopNumber?: string shopNumber?: string
isUpload?: boolean
factoryOnlineId?: number | null factoryOnlineId?: number | null
factoryNo?: number | null factoryNo?: number | null
factoryCode?: string | null factoryCode?: string | null
......
...@@ -399,33 +399,43 @@ ...@@ -399,33 +399,43 @@
> >
<ElDropdown> <ElDropdown>
<el-button type="primary"> <el-button type="primary">
DTF排版<el-icon class="el-icon--right"><ArrowDown /></el-icon> DTF排版
<el-icon class="el-icon--right">
<ArrowDown />
</el-icon>
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<ElDropdownMenu> <ElDropdownMenu>
<ElDropdownItem <ElDropdownItem
:loading="tifDownloadLoading" :loading="tifDownloadLoading"
@click="downloadTif('tiff', 42)" @click="downloadTif('tiff', 42)"
>TIF(40+2cm)</ElDropdownItem >TIF(40+2cm)
</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
:loading="tifDownloadLoading" :loading="tifDownloadLoading"
@click="downloadTif('tiff', 60)" @click="downloadTif('tiff', 60)"
>TIF(60cm)</ElDropdownItem >TIF(60cm)
</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
:loading="pngDownloadLoading" :loading="pngDownloadLoading"
@click="downloadTif('png', 42)" @click="downloadTif('png', 42)"
>PNG(40+2cm)</ElDropdownItem >PNG(40+2cm)
</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
:loading="pngDownloadLoading" :loading="pngDownloadLoading"
@click="downloadTif('png', 60)" @click="downloadTif('png', 60)"
>PNG(60cm)</ElDropdownItem >PNG(60cm)
</ElDropdownItem
>
</ElDropdownMenu>
</template
>
</ElDropdown
> >
</ElDropdownMenu></template </ElFormItem
></ElDropdown
></ElFormItem
> >
<!-- <ElFormItem <!-- <ElFormItem
v-if=" v-if="
...@@ -1781,6 +1791,26 @@ ...@@ -1781,6 +1791,26 @@
{{ row.automaticComposing ? '是' : '否' }} {{ row.automaticComposing ? '是' : '否' }}
</div> </div>
</template> </template>
<template #prn="{ row }">
<div style="display: flex">
<span :title="fileName(row)" class="flex-1">{{ fileName(row) }}</span>
<el-link :disabled="row.isUpload" underline="never" type="success" @click="uploadFile(row)">上传</el-link>
<el-icon v-if="row.isUpload" style="right: 0;top:5px;" class="is-loading"
>
<Loading
/>
</el-icon>
<el-link
:disabled="!row.prnUrl" style="margin-left: 8px" underline="never" type="primary"
@click="downloadRowProFile(row)">下载
</el-link>
<el-icon v-if="row.prnDownloadStatus" style="right: -2px" class="check-icon"
>
<CircleCheckFilled
/>
</el-icon>
</div>
</template>
<template #composingParam="{ row }"> <template #composingParam="{ row }">
<div style="white-space: pre-line"> <div style="white-space: pre-line">
{{ row.composingParam?.split(';').join('\n') }} {{ row.composingParam?.split(';').join('\n') }}
...@@ -1825,10 +1855,11 @@ ...@@ -1825,10 +1855,11 @@
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
link link
title="打印拣货单"
type="primary" type="primary"
@click="printPickingOrderItem(row, 1)" @click="printPickingOrderItem(row, 1)"
> >
打印拣货单 拣货单
</ElButton> </ElButton>
<el-icon v-if="row.printPickOrder" class="check-icon" <el-icon v-if="row.printPickOrder" class="check-icon"
><CircleCheckFilled ><CircleCheckFilled
...@@ -1837,10 +1868,11 @@ ...@@ -1837,10 +1868,11 @@
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
link link
title="打印生产单"
type="primary" type="primary"
@click="printPickingOrderItem(row, 2)" @click="printPickingOrderItem(row, 2)"
> >
打印生产单 生产单
</ElButton> </ElButton>
<el-icon v-if="row.printProductOrder" class="check-icon" <el-icon v-if="row.printProductOrder" class="check-icon"
><CircleCheckFilled ><CircleCheckFilled
...@@ -1850,11 +1882,12 @@ ...@@ -1850,11 +1882,12 @@
<ElButton <ElButton
:disabled="row.productNum > 50" :disabled="row.productNum > 50"
link link
title="重新排版"
type="warning" type="warning"
:loading="reComposingLoadingMap[row.id]" :loading="reComposingLoadingMap[row.id]"
@click="showArrange(1, row)" @click="showArrange(1, row)"
> >
新排版
</ElButton> </ElButton>
</span> </span>
<span class="operate-item"> <span class="operate-item">
...@@ -1994,8 +2027,8 @@ ...@@ -1994,8 +2027,8 @@
<div <div
v-for="(cardItem) in tableData as ProductList[]" v-for="(cardItem) in tableData as ProductList[]"
:key="cardItem.id" :key="cardItem.id"
class="card-list-item"
ref="cardRefs" ref="cardRefs"
class="card-list-item"
@click="cardClick(cardItem)" @click="cardClick(cardItem)"
@mouseleave="handleChangeImages(null, cardItem)" @mouseleave="handleChangeImages(null, cardItem)"
> >
...@@ -2043,24 +2076,25 @@ ...@@ -2043,24 +2076,25 @@
type="primary" type="primary"
:title="item.name || ''" :title="item.name || ''"
style="margin-bottom: 2px" style="margin-bottom: 2px"
>{{ item.name || '' }}</el-tag >{{ item.name || '' }}
</el-tag
> >
</div> </div>
</template> </template>
<div <div
class="flex" v-if="cardItem.customTagList?.length"
ref="tagRefs" ref="tagRefs"
class="flex"
style="gap: 5px; overflow: hidden" style="gap: 5px; overflow: hidden"
v-if="cardItem.customTagList?.length"
> >
<el-tag <el-tag
size="small"
type="primary"
v-for="(item, index) in cardItem.customTagList.slice( v-for="(item, index) in cardItem.customTagList.slice(
0, 0,
3, 3,
)" )"
:key="index" :key="index"
size="small"
type="primary"
><span ><span
style=" style="
width: 50px; width: 50px;
...@@ -2075,10 +2109,11 @@ ...@@ -2075,10 +2109,11 @@
></el-tag ></el-tag
> >
<el-tag <el-tag
v-if="cardItem.customTagList?.slice(3)?.length"
size="small" size="small"
type="primary" type="primary"
v-if="cardItem.customTagList?.slice(3)?.length" >+{{ cardItem.customTagList.slice(3).length }}
>+{{ cardItem.customTagList.slice(3).length }}</el-tag </el-tag
> >
</div> </div>
</el-tooltip> </el-tooltip>
...@@ -2639,8 +2674,8 @@ ...@@ -2639,8 +2674,8 @@
v-model:form="currentRow" v-model:form="currentRow"
v-model:visible="updateAddVisible" v-model:visible="updateAddVisible"
:country-list="countryList" :country-list="countryList"
@success="search"
:type="updateAddressType" :type="updateAddressType"
@success="search"
></UpdateAddress> ></UpdateAddress>
<ElDialog <ElDialog
v-model="exceptionDialogVisible" v-model="exceptionDialogVisible"
...@@ -2842,7 +2877,8 @@ ...@@ -2842,7 +2877,8 @@
typesettingVisible = false typesettingVisible = false
} }
" "
>取消</el-button >取消
</el-button
> >
<el-button type="primary" @click="submitTypesetting">确认</el-button> <el-button type="primary" @click="submitTypesetting">确认</el-button>
</template> </template>
...@@ -2903,6 +2939,7 @@ import { ...@@ -2903,6 +2939,7 @@ import {
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
uploadPRNFile,
getOrderList, getOrderList,
getOrderTabData, getOrderTabData,
confirmOrderApi, confirmOrderApi,
...@@ -2964,7 +3001,7 @@ import { ...@@ -2964,7 +3001,7 @@ import {
getCustomTagListApi, getCustomTagListApi,
getLogisticsWayApi, getLogisticsWayApi,
printNormalPickPdfApi, printNormalPickPdfApi,
reissueOrderApi reissueOrderApi, updatePRNDownloadStatus,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -2997,6 +3034,7 @@ import { showConfirm } from '@/utils/ui' ...@@ -2997,6 +3034,7 @@ import { showConfirm } from '@/utils/ui'
import { import {
DocumentCopy, DocumentCopy,
EditPen, EditPen,
Loading,
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus' import { Column, ElFormItem } from 'element-plus'
...@@ -3025,7 +3063,7 @@ import { ...@@ -3025,7 +3063,7 @@ import {
declare global { declare global {
interface Window { interface Window {
ActiveXObject: { ActiveXObject: {
new (type: string): XMLHttpRequest new(type: string): XMLHttpRequest
} }
VBS_BinaryToArray: { VBS_BinaryToArray: {
(data: unknown): { toArray(): number[] } (data: unknown): { toArray(): number[] }
...@@ -3552,6 +3590,12 @@ const tableColumns = computed(() => { ...@@ -3552,6 +3590,12 @@ const tableColumns = computed(() => {
prop: 'automaticComposing', prop: 'automaticComposing',
slot: 'automaticComposing', slot: 'automaticComposing',
align: 'center', align: 'center',
}, {
label: 'PRN文件',
width: 300,
prop: 'automaticComposing',
slot: 'prn',
align: 'right',
}, },
{ {
label: '排版参数', label: '排版参数',
...@@ -3563,7 +3607,7 @@ const tableColumns = computed(() => { ...@@ -3563,7 +3607,7 @@ const tableColumns = computed(() => {
{ {
label: '操作', label: '操作',
slot: 'operate', slot: 'operate',
width: 350, width: 300,
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
prop: 'operate', prop: 'operate',
...@@ -3967,7 +4011,10 @@ watch( ...@@ -3967,7 +4011,10 @@ watch(
}, },
{ deep: true, immediate: true }, // 添加immediate确保初始化时执行 { deep: true, immediate: true }, // 添加immediate确保初始化时执行
) )
const fileName = (row: PodUsOrderListData) => {
if (!row.prnUrl) return ''
return row.prnUrl.split('/')[row.prnUrl.split('/').length - 1]
}
const search = () => { const search = () => {
selection.value = [] selection.value = []
cardSelection.value = [] cardSelection.value = []
...@@ -4145,6 +4192,37 @@ const productionClientVisible = ref(false) ...@@ -4145,6 +4192,37 @@ const productionClientVisible = ref(false)
// productionClientVisible.value = true // productionClientVisible.value = true
// } // }
const downloadRowProFile = async (row: PodUsOrderListData) => {
const url =
`https://factory.jomalls.com/upload/factory` + row.prnUrl
window.open(url, '_blank')
await updatePRNDownloadStatus(
row.id,
)
search()
}
const uploadFile = (row: PodUsOrderListData) => {
const input = document.createElement('input')
input.style.display = 'none'
input.type = 'file'
input.multiple = false
input?.click()
row.isUpload = true
input.onchange = async function() {
try {
if (input.files && input.files.length) {
const fm = new FormData()
fm.append('file', input.files?.[0])
const res = await uploadPRNFile(row.id, fm)
row.prnUrl = res.message
}
} finally {
row.isUpload = false
}
}
}
const downloadTif = async (type: string, templateWidth: number) => { const downloadTif = async (type: string, templateWidth: number) => {
if (!cardSelection.value.length) { if (!cardSelection.value.length) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
...@@ -6562,6 +6640,7 @@ const printNormal = async () => { ...@@ -6562,6 +6640,7 @@ const printNormal = async () => {
background: rgb(255 243 205); background: rgb(255 243 205);
color: rgb(91, 99, 18); color: rgb(91, 99, 18);
} }
.empty { .empty {
height: 100%; height: 100%;
display: flex; display: flex;
...@@ -6765,13 +6844,16 @@ const printNormal = async () => { ...@@ -6765,13 +6844,16 @@ const printNormal = async () => {
color: white; color: white;
font-weight: bold; font-weight: bold;
} }
.triangle-container-wrap { .triangle-container-wrap {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
} }
.triangle-container { .triangle-container {
position: relative; position: relative;
.triangle-marker { .triangle-marker {
width: 0; width: 0;
height: 0; height: 0;
...@@ -6779,6 +6861,7 @@ const printNormal = async () => { ...@@ -6779,6 +6861,7 @@ const printNormal = async () => {
border-right: 18px solid #e74c3c; border-right: 18px solid #e74c3c;
border-top: 18px solid #e74c3c; border-top: 18px solid #e74c3c;
} }
.content { .content {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -6790,13 +6873,16 @@ const printNormal = async () => { ...@@ -6790,13 +6873,16 @@ const printNormal = async () => {
font-size: 12px; font-size: 12px;
} }
} }
.triangle-container-wrap { .triangle-container-wrap {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
} }
.triangle-container { .triangle-container {
position: relative; position: relative;
.triangle-marker { .triangle-marker {
width: 0; width: 0;
height: 0; height: 0;
...@@ -6804,6 +6890,7 @@ const printNormal = async () => { ...@@ -6804,6 +6890,7 @@ const printNormal = async () => {
border-right: 18px solid #e74c3c; border-right: 18px solid #e74c3c;
border-top: 18px solid #e74c3c; border-top: 18px solid #e74c3c;
} }
.content { .content {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -6839,8 +6926,8 @@ const printNormal = async () => { ...@@ -6839,8 +6926,8 @@ const printNormal = async () => {
} }
.el-timeline .el-timeline
> .el-timeline-item:first-child > .el-timeline-item:first-child
.el-timeline-item__timestamp.is-top { .el-timeline-item__timestamp.is-top {
color: #409eff; color: #409eff;
} }
...@@ -6849,6 +6936,7 @@ const printNormal = async () => { ...@@ -6849,6 +6936,7 @@ const printNormal = async () => {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.tabs-node-quantity { .tabs-node-quantity {
position: relative; position: relative;
color: red; color: red;
...@@ -6856,6 +6944,7 @@ const printNormal = async () => { ...@@ -6856,6 +6944,7 @@ const printNormal = async () => {
top: -10px; top: -10px;
right: 0px; right: 0px;
} }
.operate-item { .operate-item {
position: relative; position: relative;
} }
...@@ -6867,4 +6956,12 @@ const printNormal = async () => { ...@@ -6867,4 +6956,12 @@ const printNormal = async () => {
top: 30%; top: 30%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.flex-1 {
flex: 1;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style> </style>
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