Commit ec5291a4 by linjinhong

fix:修改问题

parent 4a4ca76c
......@@ -443,7 +443,7 @@ export function toOutOfStockApi(ids: number[]) {
export function arrangeFinishApi(params: {
productIdList: number[]
templateWidth?: number
type: string
type?: string
}) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderProductUs/arrangeFinish`,
......
......@@ -2431,10 +2431,6 @@
>
<el-form :model="typesettingForm" label-width="100px">
<el-form-item label="排版类型:" prop="type">
<!-- <el-select v-model="typesettingForm.type">
<el-option label="tiff排版" value="tiff"></el-option>
<el-option label="png排版" value="png"></el-option>
</el-select> -->
<el-checkbox-group v-model="typesettingForm.typeArr">
<el-checkbox label="tiff">tiff排版</el-checkbox>
<el-checkbox label="png">png排版</el-checkbox>
......@@ -2445,29 +2441,11 @@
<el-radio :value="40">40cm</el-radio>
<el-radio :value="60">60cm</el-radio>
</el-radio-group>
<!-- <el-select v-model="typesettingForm.templateWidth">
<el-option label="40cm" :value="40"></el-option>
<el-option label="60cm" :value="60"></el-option>
</el-select> -->
</el-form-item>
</el-form>
<template #footer>
<el-button @click="typesettingVisible = false">取消</el-button>
<el-button
type="primary"
@click="
() => {
console.log(999, typesettingType)
return typesettingType == 1
? handleReComposingDesign()
: typesettingType == 2
? arrangeFinish()
: downloadTifItem()
}
"
>确认</el-button
>
<el-button type="primary" @click="submitTypesetting">确认</el-button>
</template>
</ElDialog>
</template>
......@@ -2980,23 +2958,24 @@ const handleBatchDelete = async (type: string, id?: string) => {
// 批量下载 重新排版
const handleReComposingDesign = async () => {
const row = { ...(typesettingRow.value as PodUsOrderListData) }
// try {
// await showConfirm('确定重新排版吗?', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning',
// })
// } catch {
// return
// }
reComposingLoadingMap[row.id] = true
typesettingVisible.value = false
const params: {
id: number
templateWidth?: number
type?: string
} = {
id: row.id,
}
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && typeArr?.length) {
params.templateWidth = templateWidth
params.type = typeArr.join(',')
}
try {
const res = await batchDownloadRecomposingApi({
id: row.id,
type: typesettingForm.value?.typeArr?.join(',') || '',
templateWidth: typesettingForm.value.templateWidth,
})
const res = await batchDownloadRecomposingApi(params)
if (res.code !== 200) return
ElMessage.success(res.message)
search()
......@@ -3674,8 +3653,10 @@ const downloadTifItem = async () => {
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const type = (typesettingForm.value?.typeArr?.join(',') as string) || ''
const templateWidth = typesettingForm.value?.templateWidth as number
const templateWidth =
(typesettingForm.value?.templateWidth as number) || undefined
typesettingVisible.value = false
try {
const res = await composingDesignImages([row.id], type, templateWidth)
......@@ -4180,8 +4161,10 @@ const typesettingForm = ref<{
const typesettingVisible = ref(false)
const typesettingType = ref<number>()
const typesettingRow = ref<PodUsOrderListData>()
const showArrange = async (type: number, data?: PodUsOrderListData) => {
typesettingType.value = type
typesettingForm.value = {}
if (type === 1 || type === 3) {
typesettingRow.value = data
} else if (type === 2) {
......@@ -4239,11 +4222,19 @@ const arrangeFinish = async () => {
background: 'rgba(0, 0, 0, 0.3)',
})
const selectedIds = cardSelection.value.map((item) => item.id)
const params = {
const params: {
productIdList: number[]
templateWidth?: number
type?: string
} = {
productIdList: selectedIds,
templateWidth: typesettingForm.value.templateWidth,
type: typesettingForm.value?.typeArr?.join(',') || '',
}
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && typeArr?.length) {
params.templateWidth = templateWidth
params.type = typeArr.join(',')
}
console.log(4233, params)
typesettingVisible.value = false
try {
......@@ -4259,6 +4250,26 @@ const arrangeFinish = async () => {
}
}
const submitTypesetting = () => {
const { templateWidth, typeArr } = typesettingForm.value
if (templateWidth && !typeArr?.length) {
return ElMessage.warning('请选择排版类型')
} else if (!templateWidth && typeArr?.length) {
return ElMessage.warning('请选择排版宽度')
}
if (typesettingType.value == 3) {
if (!templateWidth && !typeArr?.length) {
return ElMessage.warning('排版类型和排版宽度为必选项')
}
}
return typesettingType.value == 1
? handleReComposingDesign()
: typesettingType.value == 2
? arrangeFinish()
: downloadTifItem()
}
interface timeLineType {
time_iso?: 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