Commit bb0cdaef by linjinhong

fix:修改排单

parent b2b5ce7d
...@@ -1535,6 +1535,16 @@ ...@@ -1535,6 +1535,16 @@
{{ row.finishTime?.replace('T', ' ') }} {{ row.finishTime?.replace('T', ' ') }}
</div> </div>
</template> </template>
<template #automaticComposing="{ row }">
<div style="white-space: pre-line">
{{ row.automaticComposing ? '是' : '否' }}
</div>
</template>
<template #composingParam="{ row }">
<div style="white-space: pre-line">
{{ row.composingParam?.split(';').join('\n') }}
</div>
</template>
<template #failTime="{ row }"> <template #failTime="{ row }">
<div style="white-space: pre-line"> <div style="white-space: pre-line">
{{ row.failTime?.replace('T', ' ') }} {{ row.failTime?.replace('T', ' ') }}
...@@ -1550,15 +1560,15 @@ ...@@ -1550,15 +1560,15 @@
> >
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="!row.url" :disabled="!row.url && !row.tiffUrl"
link link
type="primary" type="primary"
@click="handleDownload(row, 'png')" @click="handleDownload(row)"
> >
PNG下载 下载
</ElButton> </ElButton>
</span> </span>
<span class="operate-item"> <!-- <span class="operate-item">
<ElButton <ElButton
:disabled="!row.tiffUrl" :disabled="!row.tiffUrl"
link link
...@@ -1567,7 +1577,7 @@ ...@@ -1567,7 +1577,7 @@
> >
TIF下载 TIF下载
</ElButton> </ElButton>
</span> </span> -->
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
link link
...@@ -2429,22 +2439,47 @@ ...@@ -2429,22 +2439,47 @@
width="500px" width="500px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-form :model="typesettingForm" label-width="100px"> <el-form :model="typesettingForm">
<el-form-item label="排版类型:" prop="type"> <el-form-item
<el-checkbox-group v-model="typesettingForm.typeArr"> label="自动排版 (烫画工艺推荐自动排版)"
<el-checkbox label="tiff">tiff排版</el-checkbox> prop="bool"
<el-checkbox label="png">png排版</el-checkbox> v-if="typesettingType == 2"
</el-checkbox-group> >
</el-form-item> <el-switch
<el-form-item label="排版宽度:" prop="type"> v-model="isAuto"
<el-radio-group v-model="typesettingForm.templateWidth"> class="ml-2"
<el-radio :value="40">40cm</el-radio> style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
<el-radio :value="60">60cm</el-radio> inline-prompt
</el-radio-group> active-text="是"
inactive-text="否"
@change="changeSwitch"
/>
</el-form-item> </el-form-item>
<div v-if="isAuto">
<el-form-item label="排版类型:" prop="type">
<el-radio-group v-model="typesettingForm.type">
<el-radio label="tiff">tiff排版</el-radio>
<el-radio label="png">png排版</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="排版宽度:" prop="type">
<el-radio-group v-model="typesettingForm.templateWidth">
<el-radio :value="40">40cm</el-radio>
<el-radio :value="60">60cm</el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="typesettingVisible = false">取消</el-button> <el-button
@click="
() => {
isAuto = true
typesettingVisible = false
}
"
>取消</el-button
>
<el-button type="primary" @click="submitTypesetting">确认</el-button> <el-button type="primary" @click="submitTypesetting">确认</el-button>
</template> </template>
</ElDialog> </ElDialog>
...@@ -2588,7 +2623,7 @@ declare global { ...@@ -2588,7 +2623,7 @@ declare global {
} }
} }
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const isAuto = ref(true)
const countryList = ref([]) const countryList = ref([])
const currentRow = ref<AddressInfo>({ const currentRow = ref<AddressInfo>({
receiverName: '', receiverName: '',
...@@ -2872,7 +2907,7 @@ const handleUpdateAddress = async (row: PodUsOrderListData) => { ...@@ -2872,7 +2907,7 @@ const handleUpdateAddress = async (row: PodUsOrderListData) => {
updateAddVisible.value = true updateAddVisible.value = true
} }
// 批量下载 下载 // 批量下载 下载
const handleDownload = async (row: PodUsOrderListData, type: string) => { const handleDownload = async (row: PodUsOrderListData) => {
try { try {
await showConfirm('确定下载吗?', { await showConfirm('确定下载吗?', {
confirmButtonText: '确认', confirmButtonText: '确认',
...@@ -2887,6 +2922,8 @@ const handleDownload = async (row: PodUsOrderListData, type: string) => { ...@@ -2887,6 +2922,8 @@ const handleDownload = async (row: PodUsOrderListData, type: string) => {
text: '操作中...', text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
const type = row.url && row.tiffUrl ? 'tiff' : row.url ? 'png' : 'tiff'
try { try {
const url = const url =
type === 'png' type === 'png'
...@@ -2969,10 +3006,10 @@ const handleReComposingDesign = async () => { ...@@ -2969,10 +3006,10 @@ const handleReComposingDesign = async () => {
} = { } = {
id: row.id, id: row.id,
} }
const { templateWidth, typeArr } = typesettingForm.value const { templateWidth, type } = typesettingForm.value
if (templateWidth && typeArr?.length) { if (templateWidth && type) {
params.templateWidth = templateWidth params.templateWidth = templateWidth
params.type = typeArr.join(',') params.type = type
} }
try { try {
const res = await batchDownloadRecomposingApi(params) const res = await batchDownloadRecomposingApi(params)
...@@ -2995,31 +3032,31 @@ const tableColumns = computed(() => { ...@@ -2995,31 +3032,31 @@ const tableColumns = computed(() => {
{ {
label: '批次号', label: '批次号',
prop: 'batchArrangeNum', prop: 'batchArrangeNum',
width: 150, width: 120,
align: 'center', align: 'center',
}, },
{ {
label: '下载状态', label: '下载状态',
slot: 'downloadStatus', slot: 'downloadStatus',
width: 100, width: 90,
prop: 'downloadStatus', prop: 'downloadStatus',
align: 'center', align: 'center',
}, },
{ {
label: '订单数量', label: '订单数量',
prop: 'productNum', prop: 'productNum',
width: 90, width: 85,
align: 'center', align: 'center',
}, },
{ {
label: '素材数量', label: '素材数量',
width: 90, width: 85,
prop: 'materialNum', prop: 'materialNum',
align: 'center', align: 'center',
}, },
{ {
label: '创建人', label: '创建人',
width: 100, width: 85,
prop: 'employeeAccount', prop: 'employeeAccount',
align: 'center', align: 'center',
}, },
...@@ -3044,17 +3081,24 @@ const tableColumns = computed(() => { ...@@ -3044,17 +3081,24 @@ const tableColumns = computed(() => {
slot: 'finishTime', slot: 'finishTime',
align: 'center', align: 'center',
}, },
// { {
// label: '失败时间', label: '自动下载',
// width: 250, width: 85,
// prop: 'failTime', prop: 'automaticComposing',
// slot: 'failTime', slot: 'automaticComposing',
// align: 'center', align: 'center',
// }, },
{
label: '排版参数',
width: 140,
prop: 'composingParam',
slot: 'composingParam',
align: 'center',
},
{ {
label: '操作', label: '操作',
slot: 'operate', slot: 'operate',
width: 450, width: 350,
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
prop: 'operate', prop: 'operate',
...@@ -3655,23 +3699,22 @@ const downloadTifItem = async () => { ...@@ -3655,23 +3699,22 @@ const downloadTifItem = async () => {
}) })
try { try {
const { templateWidth, typeArr } = typesettingForm.value const { templateWidth, type } = typesettingForm.value
const type = typeArr?.join(',') || ''
typesettingVisible.value = false typesettingVisible.value = false
// 处理下载逻辑 // // 处理下载逻辑
if ((typeArr as string[]).length > 1) { // if ((type as string[]).length > 1) {
// 并行处理多个类型 // // 并行处理多个类型
await Promise.allSettled( // await Promise.allSettled(
(typeArr as string[]).map((el) => // (type as string[]).map((el) =>
downloadSingleType(row.id, el, templateWidth), // downloadSingleType(row.id, el, templateWidth),
), // ),
) // )
} else { // } else {
// 处理单个类型 // 处理单个类型
await downloadSingleType(row.id, type, templateWidth) await downloadSingleType(row.id, type as string, templateWidth)
} // }
} catch (error) { } catch (error) {
console.error('下载过程中出错:', error) console.error('下载过程中出错:', error)
} finally { } finally {
...@@ -4355,10 +4398,10 @@ const arrangeFinish = async () => { ...@@ -4355,10 +4398,10 @@ const arrangeFinish = async () => {
} = { } = {
productIdList: selectedIds, productIdList: selectedIds,
} }
const { templateWidth, typeArr } = typesettingForm.value const { templateWidth, type } = typesettingForm.value
if (templateWidth && typeArr?.length) { if (templateWidth && type) {
params.templateWidth = templateWidth params.templateWidth = templateWidth
params.type = typeArr.join(',') params.type = type
} }
console.log(4233, params) console.log(4233, params)
...@@ -4377,18 +4420,18 @@ const arrangeFinish = async () => { ...@@ -4377,18 +4420,18 @@ const arrangeFinish = async () => {
} }
const submitTypesetting = () => { const submitTypesetting = () => {
const { templateWidth, typeArr } = typesettingForm.value const { templateWidth, type } = typesettingForm.value
if (templateWidth && !typeArr?.length) { if (templateWidth && !type) {
return ElMessage.warning('请选择排版类型') return ElMessage.warning('请选择排版类型')
} else if (!templateWidth && typeArr?.length) { } else if (!templateWidth && type) {
return ElMessage.warning('请选择排版宽度') return ElMessage.warning('请选择排版宽度')
} }
if (typesettingType.value == 3) { if (typesettingType.value == 3) {
if (!templateWidth && !typeArr?.length) { if (!templateWidth && !type) {
return ElMessage.warning('排版类型和排版宽度为必选项') return ElMessage.warning('排版类型和排版宽度为必选项')
} }
} }
isAuto.value = true
return typesettingType.value == 1 return typesettingType.value == 1
? handleReComposingDesign() ? handleReComposingDesign()
: typesettingType.value == 2 : typesettingType.value == 2
...@@ -4396,6 +4439,10 @@ const submitTypesetting = () => { ...@@ -4396,6 +4439,10 @@ const submitTypesetting = () => {
: downloadTifItem() : downloadTifItem()
} }
const changeSwitch = () => {
typesettingForm.value = {}
}
interface timeLineType { interface timeLineType {
time_iso?: string time_iso?: string
time_utc?: string time_utc?: string
......
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