Commit 2c537b23 by wusiyi

ffix: 批量下载重新排版优化

parent d9d84ad2
...@@ -1050,9 +1050,7 @@ ...@@ -1050,9 +1050,7 @@
</div> </div>
</template> </template>
<template #failReason="{ row }"> <template #failReason="{ row }">
<div style="white-space: pre-line"> <span v-html="row.failReason" style="white-space: pre-line"></span>
{{ row.failReason }}
</div>
</template> </template>
<template #operate="{ row }"> <template #operate="{ row }">
<div <div
...@@ -1083,6 +1081,7 @@ ...@@ -1083,6 +1081,7 @@
<ElButton <ElButton
link link
type="warning" type="warning"
:loading="reComposingLoadingMap[row.id]"
@click="handleReComposingDesign(row)" @click="handleReComposingDesign(row)"
> >
重新排版 重新排版
...@@ -1889,7 +1888,7 @@ import { useValue } from '@/utils/hooks/useValue' ...@@ -1889,7 +1888,7 @@ import { useValue } from '@/utils/hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { DocumentCopy, EditPen } from '@element-plus/icons-vue' import { DocumentCopy, EditPen } from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus' import { Column, ElFormItem } from 'element-plus'
import { computed, onMounted, ref, nextTick } from 'vue' import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue' import PodMakeOrder from './PodMakeOrder.vue'
...@@ -1945,6 +1944,7 @@ const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null) ...@@ -1945,6 +1944,7 @@ const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false) const confirmDialogShow = ref(false)
const tifDownloadLoading = ref(false) const tifDownloadLoading = ref(false)
const pngDownloadLoading = ref(false) const pngDownloadLoading = ref(false)
const reComposingLoading = ref(false)
const isChangeWay = ref(false) const isChangeWay = ref(false)
const confirmData = ref([]) const confirmData = ref([])
const logisticsWayData = ref([]) const logisticsWayData = ref([])
...@@ -2164,11 +2164,8 @@ const handleReComposingDesign = async (row: PodUsOrderListData) => { ...@@ -2164,11 +2164,8 @@ const handleReComposingDesign = async (row: PodUsOrderListData) => {
} catch { } catch {
return return
} }
const loading = ElLoading.service({ reComposingLoadingMap[row.id] = true
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try { try {
const res = await batchDownloadRecomposingApi({ id: row.id }) const res = await batchDownloadRecomposingApi({ id: row.id })
if (res.code !== 200) return if (res.code !== 200) return
...@@ -2178,7 +2175,7 @@ const handleReComposingDesign = async (row: PodUsOrderListData) => { ...@@ -2178,7 +2175,7 @@ const handleReComposingDesign = async (row: PodUsOrderListData) => {
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
loading.close() reComposingLoadingMap[row.id] = false
} }
} }
const tableColumns = computed(() => { const tableColumns = computed(() => {
...@@ -2187,20 +2184,20 @@ const tableColumns = computed(() => { ...@@ -2187,20 +2184,20 @@ const tableColumns = computed(() => {
{ {
label: '批次号', label: '批次号',
prop: 'batchArrangeNum', prop: 'batchArrangeNum',
minWidth: 200, width: 150,
align: 'center', align: 'center',
}, },
{ {
label: '下载状态', label: '下载状态',
slot: 'downloadStatus', slot: 'downloadStatus',
width: 150, width: 100,
prop: 'downloadStatus', prop: 'downloadStatus',
align: 'center', align: 'center',
}, },
{ {
label: '订单数量', label: '订单数量',
prop: 'productNum', prop: 'productNum',
width: 120, width: 100,
align: 'center', align: 'center',
}, },
{ {
...@@ -2211,27 +2208,27 @@ const tableColumns = computed(() => { ...@@ -2211,27 +2208,27 @@ const tableColumns = computed(() => {
}, },
{ {
label: '创建人', label: '创建人',
width: 200, width: 100,
prop: 'employeeAccount', prop: 'employeeAccount',
align: 'center', align: 'center',
}, },
{ {
label: '失败原因', label: '失败原因',
width: 250, minWidth: 300,
prop: 'failReason', prop: 'failReason',
slot: 'failReason', slot: 'failReason',
align: 'left', align: 'left',
}, },
{ {
label: '创建时间', label: '创建时间',
width: 250, width: 200,
prop: 'createTime', prop: 'createTime',
slot: 'createTime', slot: 'createTime',
align: 'center', align: 'center',
}, },
{ {
label: '完成时间', label: '完成时间',
width: 250, width: 200,
prop: 'finishTime', prop: 'finishTime',
slot: 'finishTime', slot: 'finishTime',
align: 'center', align: 'center',
...@@ -2370,7 +2367,6 @@ const onCellStyle = ({ column }: { column: Column }) => { ...@@ -2370,7 +2367,6 @@ const onCellStyle = ({ column }: { column: Column }) => {
column.property === 'time' || column.property === 'time' ||
column.property === 'innerLabel' || column.property === 'innerLabel' ||
column.property === 'goods' || column.property === 'goods' ||
column.property === 'operate' ||
column.property === 'exceptionReason' column.property === 'exceptionReason'
) { ) {
return { verticalAlign: 'top' } return { verticalAlign: 'top' }
...@@ -3973,6 +3969,9 @@ function getPlatformImg(code: string) { ...@@ -3973,6 +3969,9 @@ function getPlatformImg(code: string) {
} }
return '' return ''
} }
// 全局 loading 改为每行 loading map
const reComposingLoadingMap = reactive<{ [key: number]: boolean }>({})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-filter-form { .header-filter-form {
...@@ -4213,6 +4212,7 @@ function getPlatformImg(code: string) { ...@@ -4213,6 +4212,7 @@ function getPlatformImg(code: string) {
.operate-box-vertical { .operate-box-vertical {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center;
gap: 10px; gap: 10px;
} }
......
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