From a8cb97933923d27abcd23f5696e211535e4160cd Mon Sep 17 00:00:00 2001 From: nanxiyu <13981706105@163.com> Date: Sat, 27 Dec 2025 16:44:46 +0800 Subject: [PATCH] 1 --- .../investment/common/ProjectExitPlanForm.vue | 3 +- .../common/ProjectPlanApplyForm.vue | 66 ++- .../common/ProjectPlanApplyFormDetails.vue | 552 ++++++++++-------- .../common/ProjectProgressReportForm.vue | 208 ++++--- .../ProjectProgressReportFormDeatils.vue | 24 +- .../mixedReform/MixedRegisterSections.vue | 42 +- src/i18n/pages/form/en.ts | 14 + src/i18n/pages/form/zh-cn.ts | 16 +- src/utils/flowFn.ts | 16 +- src/views/flow/create/all.vue | 35 +- .../components/drawer/approverDrawer.vue | 124 ++-- .../investment/mixedReformRegister/index.vue | 118 ++-- 12 files changed, 690 insertions(+), 528 deletions(-) diff --git a/src/components/investment/common/ProjectExitPlanForm.vue b/src/components/investment/common/ProjectExitPlanForm.vue index 8804cdd..c474905 100644 --- a/src/components/investment/common/ProjectExitPlanForm.vue +++ b/src/components/investment/common/ProjectExitPlanForm.vue @@ -172,7 +172,7 @@ diff --git a/src/components/investment/common/ProjectProgressReportForm.vue b/src/components/investment/common/ProjectProgressReportForm.vue index 3e357e0..71082f1 100644 --- a/src/components/investment/common/ProjectProgressReportForm.vue +++ b/src/components/investment/common/ProjectProgressReportForm.vue @@ -1,7 +1,8 @@ {{ t('progressReport.form.title') }} - {{ t('progressReport.form.reportTime') }}: {{formData.createTime || reportTime }} + {{ t('progressReport.form.reportTime') }}: {{ formData.createTime || reportTime }} + {{ t('progressReport.form.unit') }} @@ -11,26 +12,14 @@ - + :placeholder="t('progressReport.form.selectPlaceholder')" @change="handelSelectChange"> + - + @@ -40,24 +29,18 @@ - - + :placeholder="t('progressReport.form.inputPlaceholder')" clearable> + + - + @@ -70,7 +53,8 @@ - + {{ t('progressReport.form.unitSuffix') }} @@ -80,7 +64,8 @@ - + {{ t('progressReport.form.unitSuffix') }} @@ -125,14 +110,16 @@ :placeholder="t('progressReport.form.selectYearPlaceholder')" style="width: 100%" /> + :label="t('progressReport.form.currentYearPlannedInvestment')" required + prop="annualPlannedInvestment"> {{ t('progressReport.form.unitSuffix') }} + :label="t('progressReport.form.enterpriseCumulativeInvestmentToMonthEnd')" required + prop="ytdRemainingInvestment"> {{ t('progressReport.form.unitSuffix') }} @@ -210,8 +197,8 @@ - + @@ -284,7 +271,7 @@ export interface ProjectProgressReportFormData { const props = defineProps<{ modelValue?: InvestmentProjectProgress; - rules?:FormRules; + rules?: FormRules; }>(); const emit = defineEmits<{ @@ -292,37 +279,38 @@ const emit = defineEmits<{ }>(); const useForm = ref() const defaultForm = reactive({ - id: undefined, - projectName: '', - projectId: undefined, - projectStatus: '', - constructionStage: '', - implementingBody: '', - projectTotalAmount: undefined, - cumulativeInvestmentToDate: undefined, - completionRate: undefined, - cumulativePaymentToDate: undefined, - paymentCompletionRate: undefined, - annualReport: undefined, - annualPlannedInvestment: undefined, - ytdRemainingInvestment: undefined, - investmentCompletionRate: undefined, - plannedPayment: undefined, - actualPayment: undefined, - investmentPlanCompletionRate: undefined, - achievements: '', - coordinationIssues: '', - nextWorkPlan: '', - supportingDocuments: '', - remarks: '', - isFinalApplication: undefined, - createBy: '', - createTime: '', - updateBy: '', - updateTime: '', - delFlag: '', - processInstanceId: '', - status: '', + id: undefined, + projectName: '', + projectId: undefined, + projectStatus: '', + constructionStage: '', + implementingBody: '', + projectTotalAmount: undefined, + cumulativeInvestmentToDate: undefined, + completionRate: undefined, + cumulativePaymentToDate: undefined, + paymentCompletionRate: undefined, + annualReport: undefined, + annualPlannedInvestment: undefined, + ytdRemainingInvestment: undefined, + investmentCompletionRate: undefined, + plannedPayment: undefined, + actualPayment: undefined, + investmentPlanCompletionRate: undefined, + achievements: '', + coordinationIssues: '', + nextWorkPlan: '', + supportingDocuments: '', + remarks: '', + isFinalApplication: undefined, + createBy: '', + createTime: '', + updateBy: '', + updateTime: '', + delFlag: '', + processInstanceId: '', + status: '', + deptId: '' }) const formData = reactive({ ...defaultForm, ...props.modelValue }); const projectNameData = ref([]); @@ -340,14 +328,14 @@ const queryForm = reactive({ size: 10, }); const getProjectNameList = async () => { - try { - const res = await investmentProjectsPlanPage(queryForm); - projectNameData.value = res.data?.records || []; - total.value = res.data?.total || 0; - } catch (error) { - console.error(error); - projectNameData.value = []; // 出错时设置为空数组 - } + try { + const res = await investmentProjectsPlanPage(queryForm); + projectNameData.value = res.data?.records || []; + total.value = res.data?.total || 0; + } catch (error) { + console.error(error); + projectNameData.value = []; // 出错时设置为空数组 + } } getProjectNameList(); /** @@ -355,39 +343,39 @@ getProjectNameList(); * @param {string | number} value - 选中的项目ID */ const handelSelectChange = (value: string | number) => { - // 根据选中的项目ID查找对应的项目信息 - const selectedProject = projectNameData.value.find(item => - item.id == value - ); - // 如果找到了对应的项目,则更新实施单位字段 - if (selectedProject) { - formData.implementingBody = selectedProject.projectMainEntity || selectedProject.projectOwnerUnit || ''; - formData.projectName = selectedProject.projectName || ''; - formData.deptId = selectedProject.deptId; - } + // 根据选中的项目ID查找对应的项目信息 + const selectedProject = projectNameData.value.find(item => + item.id == value + ); + // 如果找到了对应的项目,则更新实施单位字段 + if (selectedProject) { + formData.implementingBody = selectedProject.projectMainEntity || selectedProject.projectOwnerUnit || ''; + formData.projectName = selectedProject.projectName || ''; + formData.deptId = String(selectedProject.deptId); + } } /** * 页码大小改变 * @param {number} pageSize - 新的页码大小 * */ const handlePageSizeChange = (pageSize: number) => { - queryForm.size = pageSize; - getProjectNameList(); + queryForm.size = pageSize; + getProjectNameList(); } /** * 页码改变 * @param {number} page - 新的页码 * */ const handlePageChange = (page: number) => { - queryForm.page = page; - getProjectNameList(); + queryForm.page = page; + getProjectNameList(); } // 监听 formData 变化,同步到父组件 watch( formData, (newVal) => { - console.log(newVal); + console.log(newVal); emit('update:modelValue', { ...newVal }); }, { deep: true } @@ -398,30 +386,30 @@ watch( () => props.modelValue, (newVal) => { if (newVal) { - if (typeof newVal.annualReport === 'number') newVal.annualReport = newVal.annualReport.toString() + if (typeof newVal.annualReport === 'number') newVal.annualReport = newVal.annualReport.toString() Object.assign(formData, defaultForm, newVal); } }, { immediate: true, deep: true } ); -const uploadChange = (_:any,data:any[]) =>{ - if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0){ - formData.supportingDocuments = []; - return; - } - formData.supportingDocuments = data.map((item:any) => { - return { - name: item.name, - url: item.url - } - }) +const uploadChange = (_: any, data: any[]) => { + if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0) { + formData.supportingDocuments = []; + return; + } + formData.supportingDocuments = data.map((item: any) => { + return { + name: item.name, + url: item.url + } + }) } defineExpose({ - validate: async () => { - const isValid = await useForm.value?.validate(); - if (!isValid) return false - return formData - }, + validate: async () => { + const isValid = await useForm.value?.validate(); + if (!isValid) return false + return formData + }, }) diff --git a/src/components/investment/common/ProjectProgressReportFormDeatils.vue b/src/components/investment/common/ProjectProgressReportFormDeatils.vue index d952c8b..e5cfaf9 100644 --- a/src/components/investment/common/ProjectProgressReportFormDeatils.vue +++ b/src/components/investment/common/ProjectProgressReportFormDeatils.vue @@ -143,7 +143,7 @@ - @@ -161,7 +161,7 @@ - {{ formData.isFinalApplication == '1' ? t('progressReport.form.yes') : + {{ formData.isFinalApplication === 1 ? t('progressReport.form.yes') : t('progressReport.form.no') }} @@ -252,6 +252,7 @@ const defaultForm = reactive({ delFlag: '', processInstanceId: '', status: '', + deptId: '', }) const formData = reactive({ ...defaultForm, ...props.modelValue }); const projectNameData = ref([]); @@ -279,20 +280,33 @@ const getProjectNameList = async () => { } } getProjectNameList(); + +/** + * 解析 supportingDocuments,处理可能是字符串或数组的情况 + */ +const parseSupportingDocuments = (value: string | { name: string; url: string }[] | undefined): { name: string; url: string }[] => { + if (!value) return []; + if (Array.isArray(value)) return value; + try { + return JSON.parse(value) || []; + } catch { + return []; + } +} /** * 初始化图片 * */ const uploadChange = (_: any, data: any[]) => { if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0) { - formData.supportingDocuments = []; + formData.supportingDocuments = '[]'; return; } - formData.supportingDocuments = data.map((item: any) => { + formData.supportingDocuments = JSON.stringify(data.map((item: any) => { return { name: item.name, url: item.url } - }) + })); } // 监听 formData 变化,同步到父组件 watch( diff --git a/src/components/investment/mixedReform/MixedRegisterSections.vue b/src/components/investment/mixedReform/MixedRegisterSections.vue index 9ab367f..71d8935 100644 --- a/src/components/investment/mixedReform/MixedRegisterSections.vue +++ b/src/components/investment/mixedReform/MixedRegisterSections.vue @@ -9,7 +9,8 @@ - + @@ -24,26 +25,14 @@ - + - - + + - - - - + + + + @@ -101,7 +91,7 @@ const handleLibrarySelect = (row: any) => { librarySelectVisible.value = false } -const formRef = ref(null) +const formRef = ref(null) const validate = async () => { const isValid = await formRef.value?.validate() if (isValid) { diff --git a/src/i18n/pages/form/en.ts b/src/i18n/pages/form/en.ts index fa3bc7b..c882e18 100644 --- a/src/i18n/pages/form/en.ts +++ b/src/i18n/pages/form/en.ts @@ -31,6 +31,20 @@ export default { confirmB: 'Confirm', cancelB: 'Cancel', selectText: 'Select', + // Added missing translations + operateFail: 'Operation failed', + operateSuccess: 'Operation successful', + success: 'Success', + noDataText: 'No data', + exportOkText: 'Export task submitted', + backBtn: 'Back', + saveBtn: 'Save', + closeBtn: 'Close', + submitBtn: 'Submit', + deleteMessage: { + confirm: 'Are you sure you want to delete the selected data?', + success: 'Delete successful', + }, }, message: { box: { diff --git a/src/i18n/pages/form/zh-cn.ts b/src/i18n/pages/form/zh-cn.ts index 0140c28..778764c 100644 --- a/src/i18n/pages/form/zh-cn.ts +++ b/src/i18n/pages/form/zh-cn.ts @@ -29,7 +29,21 @@ export default { isRequired: '必填项', confirmB: '确认', cancelB: '取消', - selectText: '选择' + selectText: '选择', + // 新增缺失的翻译 + operateFail: '操作失败', + operateSuccess: '操作成功', + success: '成功', + noDataText: '暂无数据', + exportOkText: '导出任务已提交', + backBtn: '返回', + saveBtn: '保存', + closeBtn: '关闭', + submitBtn: '提交', + deleteMessage: { + confirm: '确定删除选中数据吗?', + success: '删除成功', + }, }, message: { box: { diff --git a/src/utils/flowFn.ts b/src/utils/flowFn.ts index 35b5027..9a9c671 100644 --- a/src/utils/flowFn.ts +++ b/src/utils/flowFn.ts @@ -11,7 +11,7 @@ import 'element-plus/dist/index.css'; * @param flowId * @returns 流程实例ID或错误 */ -const handleUserSelection = (process: any, params: any,flowId:string): Promise<{ processInstanceId: string }> => { +const handleUserSelection = (process: any, params: any, flowId: string): Promise<{ processInstanceId: string }> => { if (!params.paramMap) params.paramMap = {}; // eslint-disable-next-line no-async-promise-executor @@ -25,10 +25,10 @@ const handleUserSelection = (process: any, params: any,flowId:string): Promise<{ let isResolved = false; // 将 timeout 声明移到函数开头 - let timeout:any; + let timeout: any; // 动态导入组件 - const {default: EmployeesDialog} = await import("/@/components/OrgSelector/employeesDialog.vue"); + const { default: EmployeesDialog } = await import("/@/components/OrgSelector/employeesDialog.vue"); // 创建应用实例 const app = createApp({ @@ -40,8 +40,8 @@ const handleUserSelection = (process: any, params: any,flowId:string): Promise<{ setTimeout(async () => { destroy(); try { - const res = await startProcessDirectly(flowId, params); - resolve(res); + const res = await startProcessDirectly(flowId, params); + resolve(res); } catch (err) { reject(err); } @@ -102,7 +102,7 @@ const handleUserSelection = (process: any, params: any,flowId:string): Promise<{ * @param params 流程参数 * @returns 流程实例ID或错误 */ -export const flowFn = async (flowIdKey: string, params: { paramMap?: Record, startUserId?: string, processInstanceId?: string }): Promise<{ processInstanceId: string } | Error> => { +export const flowFn = async (flowIdKey: string, params: { paramMap?: Record, startUserId?: string, processInstanceId?: string }): Promise<{ processInstanceId: string }> => { const flowStore = useGlobalFlowStore(); try { @@ -117,7 +117,7 @@ export const flowFn = async (flowIdKey: string, params: { paramMap?: Record, startUserId?: string, processInstanceId?: string } ): Promise<{ processInstanceId: string }> => { - if (!params.paramMap){ + if (!params.paramMap) { params.paramMap = {}; } const res = await startFlow({ flowId, ...params }); diff --git a/src/views/flow/create/all.vue b/src/views/flow/create/all.vue index 32151e1..a7c07ad 100644 --- a/src/views/flow/create/all.vue +++ b/src/views/flow/create/all.vue @@ -7,17 +7,12 @@ - + @click="activeStep = index"> + :class="[activeStep === index ? 'bg-primary text-white' : 'border-current']"> {{ index + 1 }} {{ $t(step.title) }} @@ -47,18 +42,18 @@ - + - {{ $t('flow.submit') }} + {{ $t('flow.submit') + }} + :title="$t('flow.checkIng')" :sub-title="$t('flow.checkSubIng')"> @@ -68,7 +63,9 @@ - + + + {{ item }} @@ -97,7 +94,7 @@ const step1Ref = ref(); const step2Ref = ref(); const step3Ref = ref(); -const validateErrMsg = ref([]); +const validateErrMsg = ref([]); const activeStep = ref(0); const validateFlowStep = ref(0); @@ -109,7 +106,7 @@ const gotoEdit = () => { activeStep.value = validateFlowStep.value; validateDialogShow.value = false; }; -const publish = (t) => { +const publish = (_t?: Event) => { validateErrMsg.value = []; validateFlowStep.value = 0; @@ -176,7 +173,7 @@ let step3NodeConfig = reactive({}); var paramGroupId = ref(); const checkStep1 = () => { - step1Ref.value.validate(function (valid, arr) { + step1Ref.value.validate(function (valid: boolean, arr: string[]) { if (valid) { validateFlowStep.value = 1; @@ -191,7 +188,7 @@ const checkStep1 = () => { }); }; const checkStep2 = () => { - step2Ref.value.validate(function (valid, arr) { + step2Ref.value.validate(function (valid: boolean, arr: string[]) { if (valid) { setTimeout(function () { validateFlowStep.value = 2; @@ -207,7 +204,7 @@ const checkStep2 = () => { const checkStep3 = () => { setTimeout(function () { - step3Ref.value.validate(function (valid, arr) { + step3Ref.value.validate(function (valid: boolean, arr: string[]) { if (valid) { validateFlowStep.value = 3; } else { diff --git a/src/views/flow/workflow/components/drawer/approverDrawer.vue b/src/views/flow/workflow/components/drawer/approverDrawer.vue index 637aca0..6b4269d 100644 --- a/src/views/flow/workflow/components/drawer/approverDrawer.vue +++ b/src/views/flow/workflow/components/drawer/approverDrawer.vue @@ -1,13 +1,6 @@ - + @@ -26,23 +19,28 @@ 选择角色 - + 选择成员 - + 人员控件 - - + + 审批终点 到第 - + 级部门主管终止 @@ -52,17 +50,15 @@ 多选 - + 多人审批时采用的审批方式 @@ -79,19 +75,16 @@ 审批人为空时 - + 自动通过 自动拒绝 自动结束 转交给管理员 指定人员 - + @@ -101,12 +94,8 @@ 直接结束流程 驳回到指定节点 - + @@ -121,7 +110,9 @@
@@ -79,19 +75,16 @@