fix(fixcontact): 修复前端页面 QA 审查发现的问题
- 表单编号搜索逐字触发查询改为 500ms 防抖,避免请求洪泛(P1-1) - 是否所办领导审批=是时对所办领导做条件必填校验,防止审批人留空(P1-2) - handleFlowScheduleConfirm 增加 try/catch 与失败提示(P2-1) - 移除旧「导入」按钮,仅保留模板导入/模板校验/下载模板(P2-2) - 下载模板增加网络异常兜底提示(P2-3) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,6 @@ enum Api {
|
|||||||
edit = '/bg/fixcontact/fixedContact20260730/edit',
|
edit = '/bg/fixcontact/fixedContact20260730/edit',
|
||||||
deleteOne = '/bg/fixcontact/fixedContact20260730/delete',
|
deleteOne = '/bg/fixcontact/fixedContact20260730/delete',
|
||||||
deleteBatch = '/bg/fixcontact/fixedContact20260730/deleteBatch',
|
deleteBatch = '/bg/fixcontact/fixedContact20260730/deleteBatch',
|
||||||
importExcel = '/bg/fixcontact/fixedContact20260730/importExcel',
|
|
||||||
exportXls = '/bg/fixcontact/fixedContact20260730/exportXls',
|
exportXls = '/bg/fixcontact/fixedContact20260730/exportXls',
|
||||||
exportXlsHeaders = '/bg/fixcontact/fixedContact20260730/exportXlsHeaders',
|
exportXlsHeaders = '/bg/fixcontact/fixedContact20260730/exportXlsHeaders',
|
||||||
importExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/importExcelByEasyExcel',
|
importExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/importExcelByEasyExcel',
|
||||||
@@ -20,7 +19,6 @@ enum Api {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getExportUrl = Api.exportXls;
|
export const getExportUrl = Api.exportXls;
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
export const getExportXlsHeadersUrl = Api.exportXlsHeaders;
|
export const getExportXlsHeadersUrl = Api.exportXlsHeaders;
|
||||||
export const getImportExcelByEasyExcelUrl = Api.importExcelByEasyExcel;
|
export const getImportExcelByEasyExcelUrl = Api.importExcelByEasyExcel;
|
||||||
export const getCheckExcelByEasyExcelUrl = Api.checkExcelByEasyExcel;
|
export const getCheckExcelByEasyExcelUrl = Api.checkExcelByEasyExcel;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="支持模糊查询">表单编号</a-tooltip>
|
<a-tooltip title="支持模糊查询">表单编号</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip title="支持模糊查询"><JInput v-model:value="queryParam.formNo" type="like" placeholder="请输入表单编号" allow-clear trim @update:value="searchQuery" /></a-tooltip>
|
<a-tooltip title="支持模糊查询"><JInput v-model:value="queryParam.formNo" type="like" placeholder="请输入表单编号" allow-clear trim @update:value="debouncedSearchQuery" /></a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
@@ -99,7 +99,6 @@
|
|||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:import-outlined" @click="onImportXls"> 导入</j-upload-button>
|
|
||||||
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:download-outlined" @click="handleDownloadTemplate">下载模板</a-button>
|
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:download-outlined" @click="handleDownloadTemplate">下载模板</a-button>
|
||||||
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:check-outlined" @click="handleCheckExcel">模板校验</j-upload-button>
|
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:check-outlined" @click="handleCheckExcel">模板校验</j-upload-button>
|
||||||
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:import-outlined" @click="handleImportByTemplate">模板导入</j-upload-button>
|
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:import-outlined" @click="handleImportByTemplate">模板导入</j-upload-button>
|
||||||
@@ -202,8 +201,9 @@
|
|||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { startProcessSchedules } from '/@/api/common/api';
|
import { startProcessSchedules } from '/@/api/common/api';
|
||||||
import { dateUtil } from '/@/utils/dateUtil';
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
|
import { useDebounceFn } from '@vueuse/core';
|
||||||
import { columns, superQuerySchema, fixedContactFeedbackColumns } from './FixedContact20260730.data';
|
import { columns, superQuerySchema, fixedContactFeedbackColumns } from './FixedContact20260730.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getExportXlsHeadersUrl, getImportExcelByEasyExcelUrl, getCheckExcelByEasyExcelUrl, fixedContactFeedbackList, saveOrUpdate, withDrawFixContact, statusStats } from './FixedContact20260730.api';
|
import { list, deleteOne, batchDelete, getExportUrl, getExportXlsHeadersUrl, getImportExcelByEasyExcelUrl, getCheckExcelByEasyExcelUrl, fixedContactFeedbackList, saveOrUpdate, withDrawFixContact, statusStats } from './FixedContact20260730.api';
|
||||||
import { showImportValidationErrors } from '/@/utils/helper/importError';
|
import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||||
|
|
||||||
function expandIcon({ expanded, onExpand, record }: { expanded: boolean; onExpand: Function; record: Recordable }) {
|
function expandIcon({ expanded, onExpand, record }: { expanded: boolean; onExpand: Function; record: Recordable }) {
|
||||||
@@ -252,7 +252,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
|
|
||||||
const feedbackExpandColumns: BasicColumn[] = [...fixedContactFeedbackColumns];
|
const feedbackExpandColumns: BasicColumn[] = [...fixedContactFeedbackColumns];
|
||||||
|
|
||||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
const { tableContext, onExportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
title: '定点联系单',
|
title: '定点联系单',
|
||||||
api: list,
|
api: list,
|
||||||
@@ -280,10 +280,6 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
name: '定点联系单',
|
name: '定点联系单',
|
||||||
url: getExportUrl,
|
url: getExportUrl,
|
||||||
},
|
},
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
@@ -385,6 +381,9 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
fetchStatusStats();
|
fetchStatusStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 输入框逐字触发的查询做防抖,查询按钮/回车仍走未防抖的 searchQuery
|
||||||
|
const debouncedSearchQuery = useDebounceFn(searchQuery, 500);
|
||||||
|
|
||||||
function clearQueryParams() {
|
function clearQueryParams() {
|
||||||
Object.keys(queryParam).forEach((key) => {
|
Object.keys(queryParam).forEach((key) => {
|
||||||
delete queryParam[key];
|
delete queryParam[key];
|
||||||
@@ -618,7 +617,12 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
await startProcessSchedules(params);
|
await startProcessSchedules(params);
|
||||||
|
} catch (e) {
|
||||||
|
createMessage.error('发起流程失败,请稍后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
await saveOrUpdate({ id: record.id, bpmStatus: '2', superviseCount: nextSuperviseCount, isNeedAppro: options.isNeedAppro ?? record.isNeedAppro ?? '0', supDeptleaderid: options.supDeptleaderid ?? record.supDeptleaderid ?? '' }, true);
|
await saveOrUpdate({ id: record.id, bpmStatus: '2', superviseCount: nextSuperviseCount, isNeedAppro: options.isNeedAppro ?? record.isNeedAppro ?? '0', supDeptleaderid: options.supDeptleaderid ?? record.supDeptleaderid ?? '' }, true);
|
||||||
createMessage.success('发起成功');
|
createMessage.success('发起成功');
|
||||||
reload();
|
reload();
|
||||||
@@ -637,10 +641,16 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
const data = await defHttp.get(
|
let data;
|
||||||
|
try {
|
||||||
|
data = await defHttp.get(
|
||||||
{ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 },
|
{ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 },
|
||||||
{ isTransformResponse: false },
|
{ isTransformResponse: false },
|
||||||
);
|
);
|
||||||
|
} catch (e) {
|
||||||
|
createMessage.error('模板下载失败,请稍后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!data) {
|
if (!data) {
|
||||||
createMessage.warning('文件下载失败');
|
createMessage.warning('文件下载失败');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -168,6 +168,16 @@
|
|||||||
relatedLeader: [{ required: true, message: '请选择相关分管所领导' }],
|
relatedLeader: [{ required: true, message: '请选择相关分管所领导' }],
|
||||||
applicant: [{ required: true, message: '请选择申请人' }],
|
applicant: [{ required: true, message: '请选择申请人' }],
|
||||||
hostDept: [{ required: true, message: '请选择主办部门' }],
|
hostDept: [{ required: true, message: '请选择主办部门' }],
|
||||||
|
supDeptleaderid: [
|
||||||
|
{
|
||||||
|
validator: async (_rule, value) => {
|
||||||
|
if (formData.isNeedAppro === '1' && !value) {
|
||||||
|
return Promise.reject('请选择所办领导');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|||||||
Reference in New Issue
Block a user