diff --git a/src/api/afterSale/index.ts b/src/api/afterSale/index.ts index 87e58597..c8111df4 100644 --- a/src/api/afterSale/index.ts +++ b/src/api/afterSale/index.ts @@ -84,9 +84,13 @@ export interface AfterSaleStep { /** 文件引用 */ export interface FileReference { - file_id: number + id?: number + file_id?: number file_name?: string file_url?: string + file_key?: string + file_size?: number + mime_type?: string } // ==================== 请求参数类型 ==================== @@ -132,7 +136,6 @@ export interface AfterSaleTransferParams { /** 处理工单参数 */ export interface AfterSaleHandleWorkOrderParams { id: number - action: string status?: AfterSaleStatus remark?: string attachment_ids?: number[] diff --git a/src/lang/en-US.ts b/src/lang/en-US.ts index 7583e4c3..6e7b2525 100644 --- a/src/lang/en-US.ts +++ b/src/lang/en-US.ts @@ -54,6 +54,7 @@ export default { "Data": "Data", "Video": "Video", "Message": "Message", + "WorkOrder": "Work Order", "Profile": "Profile", "printTemplate": "Print Template", 'Permission': 'Permission', diff --git a/src/lang/zh-CN.ts b/src/lang/zh-CN.ts index dac13632..a3bb2baf 100644 --- a/src/lang/zh-CN.ts +++ b/src/lang/zh-CN.ts @@ -55,6 +55,7 @@ export default { "Data": "数据", "Video": "录像", "Message": "消息", + "WorkOrder": "工单", "Profile": "个人中心", "printTemplate": "打印模板", 'Permission': '权限管理', diff --git a/src/layout/component/Navbar.vue b/src/layout/component/Navbar.vue index 3e729511..58beb4f1 100644 --- a/src/layout/component/Navbar.vue +++ b/src/layout/component/Navbar.vue @@ -35,7 +35,7 @@ @@ -101,7 +101,7 @@ import LangSelect from '@/components/LangSelect/index.vue' import TopMenu from './TopMenu.vue' import dayjs from 'dayjs' import { useFullscreen } from '@vueuse/core' -import { afterSaleWorkCount } from '@/api/afterSale/index' +import { afterSaleWorkCount, afterSaleWorkList } from '@/api/afterSale/index' const { isFullscreen, toggle } = useFullscreen() @@ -129,12 +129,21 @@ async function fetchWorkOrderBadge() { try { const res: any = await afterSaleWorkCount() if (res && (res.code === 1 || res.code === 200 || res.code === 20000 || res.flag === 'success')) { - const data = res.data ?? res - workOrderBadgeCount.value = data.pending ?? data.total ?? 0 + workOrderBadgeCount.value = res.count ?? res.data?.count ?? 0 + return } - } catch { - // 静默失败,角标保持旧值 - } + } catch { /* 接口未就绪,降级使用列表接口 */ } + // 降级:用 workList pageSize=1 获取总数 + try { + const res: any = await afterSaleWorkList({ + pagination: { page: 1, pageSize: 1 }, + where: { status: { operator: 'in', value: ['pending', 'processing'] } }, + }) + if (res && (res.code === 1 || res.code === 200 || res.code === 20000 || res.flag === 'success')) { + const data = res.data ?? res + workOrderBadgeCount.value = data.total ?? (data.pagination?.total ?? 0) + } + } catch { /* 静默失败 */ } } const activeWarehouse = computed(() => { @@ -211,8 +220,8 @@ const logout = async () => { onMounted(() => { calculateDays() fetchWorkOrderBadge() - // 每 60 秒刷新一次工单角标 - badgeTimer = setInterval(fetchWorkOrderBadge, 60000) + // 每 30 秒刷新一次工单角标 + badgeTimer = setInterval(fetchWorkOrderBadge, 30000) }) onUnmounted(() => { diff --git a/src/views/afterSale/detail/AfterSaleDetailDialog.vue b/src/views/afterSale/detail/AfterSaleDetailDialog.vue new file mode 100644 index 00000000..d750cac0 --- /dev/null +++ b/src/views/afterSale/detail/AfterSaleDetailDialog.vue @@ -0,0 +1,380 @@ + + + + + diff --git a/src/views/afterSale/detail/ClaimDialog.vue b/src/views/afterSale/detail/ClaimDialog.vue new file mode 100644 index 00000000..dabc2c9a --- /dev/null +++ b/src/views/afterSale/detail/ClaimDialog.vue @@ -0,0 +1,94 @@ + + + diff --git a/src/views/afterSale/detail/HandleDialog.vue b/src/views/afterSale/detail/HandleDialog.vue new file mode 100644 index 00000000..397739a2 --- /dev/null +++ b/src/views/afterSale/detail/HandleDialog.vue @@ -0,0 +1,120 @@ + + + diff --git a/src/views/afterSale/detail/TransferDialog.vue b/src/views/afterSale/detail/TransferDialog.vue new file mode 100644 index 00000000..720e453b --- /dev/null +++ b/src/views/afterSale/detail/TransferDialog.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/views/afterSale/detail/index.vue b/src/views/afterSale/detail/index.vue index c396e22a..17617a9f 100644 --- a/src/views/afterSale/detail/index.vue +++ b/src/views/afterSale/detail/index.vue @@ -155,9 +155,16 @@ 操作人: {{ parseOperatorName(step.operator_snapshot) }}
- 附件: - {{ att.file_name || `文件${att.file_id}` }} + + {{ att.file_name || `文件${(att as any).id || att.file_id}` }}
@@ -184,9 +191,6 @@ - - - @@ -557,18 +561,15 @@ const handleLoading = ref(false) const handleFormRef = ref() const handleForm = reactive({ - action: '' as string, status: '' as string, remark: '' as string, }) const handleRules: FormRules = { - action: [{ required: true, message: '请输入操作动作', trigger: 'blur' }], status: [{ required: true, message: '请选择更新状态', trigger: 'change' }], } function showHandleDialog() { - handleForm.action = '' handleForm.status = detail.value?.status || 'processing' handleForm.remark = '' resetHandleAttachments() @@ -586,7 +587,6 @@ async function handleSubmitHandle() { const params: AfterSaleHandleWorkOrderParams = { id: detail.value.id, - action: handleForm.action, status: handleForm.status as any, remark: handleForm.remark || undefined, attachment_ids: attachmentIds.length > 0 ? attachmentIds : undefined, diff --git a/src/views/afterSale/list/afterSale-config.ts b/src/views/afterSale/list/afterSale-config.ts index 64879100..89078caa 100644 --- a/src/views/afterSale/list/afterSale-config.ts +++ b/src/views/afterSale/list/afterSale-config.ts @@ -48,7 +48,7 @@ export const AFTER_SALE_SUB_TYPE_MAP: Record = { // -------------------- 售后状态 -------------------- export const AFTER_SALE_STATUS_MAP: Record = { - pending: '待处理', + pending: '未开始处理', processing: '处理中', completed: '已完成', closed: '已关闭', @@ -251,13 +251,12 @@ export const afterSaleColumns = [ { prop: 'receiving_no', label: '收货单号', width: '150', showOverflowTooltip: true }, { prop: 'resolved_at', label: '完结时间', width: '170' }, { prop: 'created_at', label: '创建时间', width: '170' }, - { prop: 'actions', label: '操作', width: '180', fixed: 'right' }, + { prop: 'actions', label: '操作', width: '100', fixed: 'right' }, ] // -------------------- 工具栏按钮 -------------------- export const afterSaleToolbarButtons: ToolbarButtonConfig[] = [ { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'refresh' }, - { key: 'create', label: '创建售后单', category: 'action', size: 'small', type: 'primary', action: 'showCreateDialog' }, { key: 'export', label: '导出', category: 'action', size: 'small', type: 'success', loadingKey: 'exportLoading', action: 'handleExport' }, ] diff --git a/src/views/afterSale/list/index.vue b/src/views/afterSale/list/index.vue index 6e0a9780..c394fa7f 100644 --- a/src/views/afterSale/list/index.vue +++ b/src/views/afterSale/list/index.vue @@ -24,24 +24,13 @@ @action="handleToolbarButtonClick" /> -
- - 售后工作列表 - 售后审计列表 - -
详情 - 编辑 - 转单
@@ -214,16 +201,22 @@ :update-time="exportTaskProgress.updateTime" /> + + +