From 73b229bb9535079b22077e4df7ff4a7debc418f7 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 1 Sep 2026 20:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ContainerCustomsPanel.test.ts | 27 +++++++++-------- .../components/ContainerCustomsPanel.vue | 30 +++++++++---------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/modules/container-loading/components/ContainerCustomsPanel.test.ts b/src/modules/container-loading/components/ContainerCustomsPanel.test.ts index 3166eac1..f55bcad7 100644 --- a/src/modules/container-loading/components/ContainerCustomsPanel.test.ts +++ b/src/modules/container-loading/components/ContainerCustomsPanel.test.ts @@ -69,27 +69,30 @@ describe('ContainerCustomsPanel', () => { const wrapper = await render('READY_TO_START') expect(wrapper.text()).toContain('开始报关') expect(wrapper.text()).toContain('客户退税资料.pdf') - expect(wrapper.find('[aria-label="下载源资料 客户退税资料.pdf"]').exists()).toBe(true) - expect(buttonTexts(wrapper)).not.toContain('上传完成文件') - expect(buttonTexts(wrapper)).not.toContain('覆盖完成文件') + expect(wrapper.text()).toContain('客户退税资料') + expect(wrapper.text()).toContain('报关完成文件') + expect(wrapper.text()).not.toContain('客户报关资料') + expect(wrapper.find('[aria-label="下载客户退税资料 客户退税资料.pdf"]').exists()).toBe(true) + expect(buttonTexts(wrapper)).not.toContain('上传报关完成文件') + expect(buttonTexts(wrapper)).not.toContain('覆盖报关完成文件') expect(buttonTexts(wrapper)).not.toContain('提交') }) it('allows completion upload and overwrite only while DECLARING with manage permission', async () => { let wrapper = await render('DECLARING', true, false) - expect(wrapper.text()).toContain('上传完成文件') + expect(wrapper.text()).toContain('上传报关完成文件') expect(wrapper.text()).toContain('提交') wrapper.unmount() wrapper = await render('DECLARING', true, true) - expect(wrapper.text()).toContain('覆盖完成文件') + expect(wrapper.text()).toContain('覆盖报关完成文件') expect(wrapper.text()).toContain('报关完成文件.pdf') wrapper.unmount() wrapper = await render('DECLARING', false, true) expect(wrapper.text()).toContain('只读') - expect(buttonTexts(wrapper)).not.toContain('上传完成文件') - expect(buttonTexts(wrapper)).not.toContain('覆盖完成文件') + expect(buttonTexts(wrapper)).not.toContain('上传报关完成文件') + expect(buttonTexts(wrapper)).not.toContain('覆盖报关完成文件') expect(buttonTexts(wrapper)).not.toContain('提交') }) @@ -98,19 +101,19 @@ describe('ContainerCustomsPanel', () => { expect(wrapper.text()).toContain('客户退税资料.pdf') expect(wrapper.text()).toContain('报关完成文件.pdf') expect(wrapper.text()).toContain('报关已完成,待其他离仓条件') - expect(buttonTexts(wrapper)).not.toContain('上传完成文件') - expect(buttonTexts(wrapper)).not.toContain('覆盖完成文件') + expect(buttonTexts(wrapper)).not.toContain('上传报关完成文件') + expect(buttonTexts(wrapper)).not.toContain('覆盖报关完成文件') expect(buttonTexts(wrapper)).not.toContain('提交') }) it('routes source and completion downloads independently by the long document id and original names', async () => { const wrapper = await render('COMPLETED', false, true) - await wrapper.get('[aria-label="下载源资料 客户退税资料.pdf"]').trigger('click') + await wrapper.get('[aria-label="下载客户退税资料 客户退税资料.pdf"]').trigger('click') await flushPromises() expect(api.downloadSource).toHaveBeenCalledWith('2092438843630391407') expect(api.downloadCompletion).not.toHaveBeenCalled() - await wrapper.get('[aria-label="下载完成文件 报关完成文件.pdf"]').trigger('click') + await wrapper.get('[aria-label="下载报关完成文件 报关完成文件.pdf"]').trigger('click') await flushPromises() expect(api.downloadCompletion).toHaveBeenCalledWith('2092438843630391407') expect(HTMLAnchorElement.prototype.click).toHaveBeenCalledTimes(2) @@ -122,7 +125,7 @@ describe('ContainerCustomsPanel', () => { api.downloadSource.mockRejectedValueOnce(new ApiResponseError('文件不可用', 'CUSTOMS_FILE_404', 404, undefined, 'request-customs-download', 'trace-customs-download')) const wrapper = await render('COMPLETED', false, true) - await wrapper.get('[aria-label="下载源资料 客户退税资料.pdf"]').trigger('click') + await wrapper.get('[aria-label="下载客户退税资料 客户退税资料.pdf"]').trigger('click') await flushPromises() expect(wrapper.text()).toContain('文件不可用') diff --git a/src/modules/container-loading/components/ContainerCustomsPanel.vue b/src/modules/container-loading/components/ContainerCustomsPanel.vue index 67adef2a..3bb09b2d 100644 --- a/src/modules/container-loading/components/ContainerCustomsPanel.vue +++ b/src/modules/container-loading/components/ContainerCustomsPanel.vue @@ -40,7 +40,7 @@ const missingCoverageCount = computed(() => Math.max(0, (customs.value?.taxRefun const allBuy = computed(() => customs.value?.taxRefundCount === 0) const missingCompletionCount = computed(() => customs.value?.documents.filter((item) => !item.completion).length || 0) const statusText: Record = { - WAITING_CUSTOMER_DOCUMENTS: '待客户补齐资料', READY_TO_START: '可开始报关', DECLARING: '报关中', COMPLETED: '报关已完成', + WAITING_CUSTOMER_DOCUMENTS: '待客户补齐退税资料', READY_TO_START: '可开始报关', DECLARING: '报关中', COMPLETED: '报关已完成', } function documentCustomers(document: ContainerCustomsDocument) { @@ -64,7 +64,7 @@ async function load() { async function start() { if (!customs.value || customs.value.status !== 'READY_TO_START') return try { - await ElMessageBox.confirm('开始后将冻结客户当前资料版本、关联入仓码覆盖范围及平台买单准备事实,确认开始整柜报关?', '开始整柜报关', { type: 'warning', confirmButtonText: '确认开始' }) + await ElMessageBox.confirm('开始后将冻结客户当前退税资料版本、关联入仓码覆盖范围及平台买单准备事实,确认开始整柜报关?', '开始整柜报关', { type: 'warning', confirmButtonText: '确认开始' }) } catch { return } actionLoading.value = true; actionError.value = null try { customs.value = await startContainerCustoms(props.loadingPlanId, customs.value.version); ElMessage.success('整柜报关已开始') } @@ -75,11 +75,11 @@ async function start() { async function uploadCompletion(document: ContainerCustomsDocument) { if (!props.canManage || customs.value?.status !== 'DECLARING') return const selected = completionFiles[document.documentId] - if (!selected) { ElMessage.warning('请选择对应完成文件'); return } + if (!selected) { ElMessage.warning('请选择对应的报关完成文件'); return } const finalConfirmation = !document.completion && missingCompletionCount.value === 1 if (finalConfirmation) { try { - await ElMessageBox.confirm('这是最后一份待上传完成文件;确认后系统将自动完成当前混合/退税柜报关。是否继续?', '完成整柜报关', { type: 'warning', confirmButtonText: '确认上传并完成' }) + await ElMessageBox.confirm('这是最后一份待上传的报关完成文件;确认后系统将自动完成当前混合/退税柜报关。是否继续?', '完成整柜报关', { type: 'warning', confirmButtonText: '确认上传并完成' }) } catch { return } } actionLoading.value = true; actionError.value = null @@ -88,8 +88,8 @@ async function uploadCompletion(document: ContainerCustomsDocument) { completionFiles[document.documentId] = null await load() emit('refreshed') - ElMessage.success(finalConfirmation ? '完成文件已上传,整柜报关已完成' : '完成文件已上传') - } catch (error) { actionError.value = getApiErrorDetails(error, '完成文件上传失败') } + ElMessage.success(finalConfirmation ? '报关完成文件已上传,整柜报关已完成' : '报关完成文件已上传') + } catch (error) { actionError.value = getApiErrorDetails(error, '报关完成文件上传失败') } finally { actionLoading.value = false } } @@ -113,9 +113,9 @@ async function downloadFile(document: ContainerCustomsDocument, kind: 'source' | ? await downloadContainerCustomsDocument(document.documentId) : await downloadContainerCustomsCompletion(document.documentId) saveBlob(blob, target.fileName) - ElMessage.success(`${kind === 'source' ? '源资料' : '完成文件'}下载已开始`) + ElMessage.success(`${kind === 'source' ? '客户退税资料' : '报关完成文件'}下载已开始`) } catch (error) { - actionError.value = getApiErrorDetails(error, `${kind === 'source' ? '源资料' : '完成文件'}下载失败`) + actionError.value = getApiErrorDetails(error, `${kind === 'source' ? '客户退税资料' : '报关完成文件'}下载失败`) } finally { downloadingKey.value = '' } @@ -168,17 +168,17 @@ onMounted(load)