Commit 8fcd26b4 by linjinhong

Merge branch 'dev_pod_cn_process' of…

Merge branch 'dev_pod_cn_process' of http://47.122.114.111:9999/qinjianhui/factory_front into dev_pod_cn_process
parents 45a7a329 71920388
......@@ -483,12 +483,13 @@ export function refreshProductInformationApi(data: {
}
// 设计图排版
export function composingDesignImages(
url: string,
data: number[],
type?: string,
templateWidth?: number,
) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/composingDesignImages?type=${type}&templateWidth=${templateWidth}`,
`${url}?type=${type}&templateWidth=${templateWidth}`,
data,
)
}
......
......@@ -397,12 +397,13 @@ export function updateSelfLogistics(params: {
// 更改物流
export function composingDesignImages(
url: string,
data: number[],
type?: string,
templateWidth?: number,
) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/composingDesignImages?type=${type}&templateWidth=${templateWidth}`,
`${url}?type=${type}&templateWidth=${templateWidth}`,
data,
)
}
......
......@@ -612,38 +612,6 @@
</ElDropdown>
</ElFormItem>
<ElFormItem>
<!-- <span
v-if="
status === 'PICKING' ||
status === 'TO_BE_REPLENISHMENT' ||
status === 'IN_PRODUCTION'
"
class="item"
>
<ElButton
:loading="tifDownloadLoading"
type="warning"
@click="downloadTif('tiff')"
>
TIF排版
</ElButton>
</span>
<span
v-if="
status === 'PICKING' ||
status === 'TO_BE_REPLENISHMENT' ||
status === 'IN_PRODUCTION'
"
class="item"
>
<ElButton
:loading="pngDownloadLoading"
type="warning"
@click="downloadTif('png')"
>
PNG排版
</ElButton>
</span> -->
<span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="success" @click="confirmProduct">
确认生产
......@@ -4313,13 +4281,18 @@ const downloadTif = async (type: string, templateWidth: number) => {
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const url =
status.value === 'TO_BE_REPLENISHMENT'
? 'factory/podJomallOrderCn/replenishmentComposingDesignImages'
: 'factory/podJomallOrderCn/composingDesignImages'
try {
const res = await composingDesignImages(
url,
cardSelection.value.map((el) => el.id),
type,
templateWidth,
)
const url =
const filePathUrl =
type === 'tiff'
? res.message?.startsWith('/temp')
? `https://factory.jomalls.com/upload/factory` + res.message
......@@ -4327,10 +4300,10 @@ const downloadTif = async (type: string, templateWidth: number) => {
: filePath + res.message
if (type === 'tiff') {
window.open(url, '_blank')
window.open(filePathUrl, '_blank')
tifDownloadLoading.value = false
} else {
fetch(url)
fetch(filePathUrl)
.then((response) => {
// 确保响应是 OK
if (!response.ok) {
......@@ -4406,9 +4379,13 @@ const downloadSingleType = async (
templateWidth?: number,
) => {
try {
const res = await composingDesignImages([id], type, templateWidth)
const url =
status.value === 'TO_BE_REPLENISHMENT'
? 'factory/podJomallOrderCn/replenishmentComposingDesignImages'
: 'factory/podJomallOrderCn/composingDesignImages'
const res = await composingDesignImages(url, [id], type, templateWidth)
const isTiff = type === 'tiff'
const url = isTiff
const filePathUrl = isTiff
? res.message?.startsWith('/temp')
? `https://factory.jomalls.com/upload/factory` + res.message
: `https://ps.jomalls.com/tiff/` + res.message
......@@ -4416,10 +4393,10 @@ const downloadSingleType = async (
if (isTiff) {
// 对于tiff类型,直接在新窗口打开
window.open(url, '_blank')
window.open(filePathUrl, '_blank')
} else {
// 对于其他类型,使用下载方式
await downloadFile(url, res.message as string)
await downloadFile(filePathUrl, res.message as string)
}
} catch (error) {
console.error(`下载类型 ${type} 时出错:`, error)
......
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