From baddb052ccd4a91ef1881ba663e6a4e55b05f4fb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 15:51:55 +0800
Subject: [PATCH] feat(hrm): 社保公积金方案表单加「适用部门」与默认缴费基数,修比例输入精度
---
src/views/mes/qc/ipqc/index.vue | 80 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/src/views/mes/qc/ipqc/index.vue b/src/views/mes/qc/ipqc/index.vue
index 832a85a..2c80419 100644
--- a/src/views/mes/qc/ipqc/index.vue
+++ b/src/views/mes/qc/ipqc/index.vue
@@ -2,15 +2,27 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesQcIpqcApi } from '#/api/mes/qc/ipqc';
+import { ref } from 'vue';
+
import { Page, useVbenModal } from '@vben/common-ui';
-import { MesQcStatusEnum } from '@vben/constants';
+import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { deleteIpqc, exportIpqc, getIpqcPage } from '#/api/mes/qc/ipqc';
+import { exportProductWord } from '#/api/mes/qc/indicatorresult';
+import {
+ deleteIpqc,
+ exportIpqc,
+ getIpqcPage,
+ importIpqc,
+ importIpqcTemplate,
+} from '#/api/mes/qc/ipqc';
import { $t } from '#/locales';
import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
+import QcImportFormModal from '#/views/mes/qc/components/import-form-modal.vue';
+import QcReportPrint from '#/views/mes/qc/components/qc-report-print.vue';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
@@ -25,9 +37,50 @@
destroyOnClose: true,
});
+const printRef = ref<InstanceType<typeof QcReportPrint> | null>(null);
+
+const [ImportModal, importModalApi] = useVbenModal({
+ connectedComponent: QcImportFormModal,
+ destroyOnClose: true,
+});
+
/** 鍒锋柊琛ㄦ牸 */
function handleRefresh() {
gridApi.query();
+}
+
+/** 鎵撳嵃妫�楠屾姤鍛� */
+async function handlePrint(row: MesQcIpqcApi.Ipqc) {
+ await printRef.value?.print(row.id!, MesQcTypeEnum.IPQC);
+}
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛屽垽瀹氱粨璁哄甫鍑烘楠岀粨鏋滐級 */
+async function handleExportProductWord(row: MesQcIpqcApi.Ipqc) {
+ const blob = await exportProductWord(row.id!, MesQcTypeEnum.IPQC);
+ downloadFileFromBlobPart({
+ fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
+ source: blob,
+ });
+}
+
+/** 鎵归噺瀵煎叆杩囩▼妫�楠屽崟 */
+function handleImport() {
+ importModalApi
+ .setData({
+ title: '鎵归噺瀵煎叆杩囩▼妫�楠屽崟',
+ templateApi: importIpqcTemplate,
+ importApi: importIpqc,
+ fileName: '杩囩▼妫�楠屽崟瀵煎叆妯℃澘.xls',
+ hints: [
+ '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢锛涘繀濉垪锛氭楠屽崟鍚嶇О銆佷骇鍝佺墿鏂欑紪鐮併�佹壒鍙枫�佸悎鏍煎搧鏁伴噺銆佷笉鍚堟牸鍝佹暟閲忋��',
+ '銆屼骇鍝佺墿鏂欑紪鐮併�嶉渶涓庛�岀墿鏂欑鐞嗐�嶄腑鐨勭紪鐮佸畬鍏ㄤ竴鑷达紱銆屾壒鍙枫�嶄负蹇呭~锛屼笉鍏佽涓虹┖銆�',
+ '銆屾楠岀被鍨嬨�嶆寜瀛楀吀鍚嶇О濉啓锛堣嚜鍒跺伐搴忔楠� / 棣栨 / 宸℃ / 鑷 / 鎴愬搧妫�楠岋級锛涖�屾娴嬬粨鏋溿�嶆寜瀛楀吀鍚嶇О濉啓锛堟牎楠岄�氳繃 / 鏍¢獙涓嶉�氳繃锛夈��',
+ '鍚堟牸鍝佹暟閲� + 涓嶅悎鏍煎搧鏁伴噺 蹇呴』绛変簬銆屾娴嬫暟閲忋�嶏紙鐣欑┖鏃惰嚜鍔ㄥ彇涓よ�呬箣鍜岋級锛涘伐搴� + 鏂欏簾 + 鍏朵粬搴熷搧 涔嬪拰涓嶅緱瓒呰繃涓嶅悎鏍煎搧鏁伴噺銆�',
+ '銆岃川妫�鏂规銆嶅~鏂规鍚嶇О锛岀暀绌哄垯鎸夌墿鏂欒嚜鍔ㄥ尮閰� IPQC 鏂规锛涖�屾娴嬩汉鍛樸�嶇暀绌哄彇褰撳墠鐧诲綍鐢ㄦ埛锛涖�屾娴嬫棩鏈熴�嶅彲鐣欑┖銆�',
+ '閫愯瀵煎叆锛屽け璐ヨ涓嶅奖鍝嶆垚鍔熻锛涘鍏ュ悗鐨勬楠屽崟涓恒�屽緟妫�楠屻�嶇姸鎬侊紝鍙湪鍒楄〃涓户缁紪杈戙�佸綍鍏ユ娴嬬粨鏋溿��',
+ ],
+ })
+ .open();
}
/** 鍒涘缓杩囩▼妫�楠屽崟 */
@@ -106,6 +159,8 @@
<Page auto-content-height>
<FormModal @success="handleRefresh" />
<ExportRangeModal />
+ <QcReportPrint ref="printRef" />
+ <ImportModal @success="handleRefresh" />
<Grid table-title="杩囩▼妫�楠屽崟鍒楄〃">
<template #toolbar-tools>
<TableAction
@@ -116,6 +171,13 @@
icon: ACTION_ICON.ADD,
auth: ['mes:qc-ipqc:create'],
onClick: handleCreate,
+ },
+ {
+ label: '鎵归噺瀵煎叆',
+ type: 'primary',
+ icon: ACTION_ICON.UPLOAD,
+ auth: ['mes:qc-ipqc:import'],
+ onClick: handleImport,
},
{
label: $t('ui.actionTitle.export'),
@@ -156,6 +218,20 @@
},
},
{
+ label: '鎵撳嵃鎶ュ憡',
+ type: 'link',
+ icon: 'ant-design:printer-outlined',
+ auth: ['mes:qc-ipqc:query'],
+ onClick: handlePrint.bind(null, row),
+ },
+ {
+ label: '瀵煎嚭浜у搧妫�楠屽崟',
+ type: 'link',
+ icon: 'ant-design:file-word-outlined',
+ auth: ['mes:qc-ipqc:query'],
+ onClick: handleExportProductWord.bind(null, row),
+ },
+ {
label: $t('common.detail'),
type: 'link',
icon: ACTION_ICON.VIEW,
--
Gitblit v1.9.3