Procházet zdrojové kódy

薪资批次送审接入公共 BPM + 工资条异议审批 + 工资条状态按后端英文编码修正

工资条批次:新增「提交审批」按钮(hr:payrollBatches:submit),走统一 processSubmitDialog,businessKey=hr_payroll_batch_approval,businessId=批次 id;可点性只认后端 availableActions 的 SUBMIT_APPROVAL,提交成功后重拉批次与 dashboard

工资条页文案与视觉:状态提示只描述批次状态与下一步约束、不再复述按钮名(CALCULATED 按阻断异常条数分文案),删除两条文档式说明与 .steps-note--muted;流程条与列表区按钮统一实色;「已同步」「阻断 x · 未关闭 y 条」标签改为仅异常时显示(0 条不挂红标)

工资条异议:新增异议审批状态列与「提交审批/重新提交审批」入口,businessKey=hr_payroll_payslip_appeal_approval,与更正审批 hr_payroll_correction_approval 分离;审批字段后端未返回时按未提交审批降级展示

我的工资条:工资条状态改用后端英文编码 WAIT_PUBLISH/PUBLISHED/VIEWED/CONFIRMED/APPEALED/CORRECTED/CLOSED,修复确认与异议按钮因数字比对失效的问题,状态标签配色与列表一致,删除详情底部说明

薪资调整弹框:去掉重复的规则说明 alert 与附件/多选提示,仅保留必要校验;路由:资源表只配 path 未配 component 时用 path 反查视图,避免菜单内容区空白,并补「我的工资条」path 映射
lihaiting před 1 týdnem
rodič
revize
d4c9da3e25

+ 79 - 1
src/api/salary/payslipAction.js

@@ -62,6 +62,15 @@ function str(value) {
 /** 工资条更正审批业务键(发起 BPM 时使用) */
 export const PAYROLL_CORRECTION_BUSINESS_KEY = 'hr_payroll_correction_approval';
 
+/**
+ * 工资条异议(申诉)审批业务键 —— 必须在 BPM 里按这个标识部署流程定义。
+ *
+ * 与更正审批是两个独立流程:异议审批只决定「这条异议是否成立、是否值得更正」,
+ * 审批通过后 HR 再在申诉页做受理(驳回 / 创建更正),金额变更仍然走
+ * `hr_payroll_correction_approval`,两者不能合并成一条流程。
+ */
+export const PAYSLIP_APPEAL_BUSINESS_KEY = 'hr_payroll_payslip_appeal_approval';
+
 /* ---------------- 枚举 ---------------- */
 
 /** 申诉类型(后端示例:AMOUNT / ATTENDANCE / TAX / SOCIAL) */
@@ -110,9 +119,62 @@ function appealStatusTagType(status) {
   return item ? item.tagType : 'info';
 }
 
+/**
+ * 异议审批状态
+ *
+ * 注意与上面的 `status` 区分:`status` 是申诉单的**受理结果**(PROCESSING / REJECTED / CORRECTED),
+ * `approvalStatus` 是**异议审批流**的进展,两者是两条独立的状态线。
+ *
+ * 后端 `PayrollPayslipAppealVO` 目前还没有 approvalStatus / processInstanceId 字段,
+ * 因此这里做兼容读取:字段缺失时按「未提交审批」展示,列表照常可用;
+ * 后端把字段补进 VO 之后前端不需要再改。
+ */
+export const APPEAL_APPROVAL_STATUS_OPTIONS = [
+  { value: 'NOT_STARTED', label: '未提交审批', tagType: 'info' },
+  { value: 'APPROVING', label: '审批中', tagType: 'warning' },
+  { value: 'APPROVED', label: '审批通过', tagType: 'success' },
+  { value: 'REJECTED', label: '审批驳回', tagType: 'danger' }
+];
+
+const APPEAL_APPROVAL_STATUS_LABELS = APPEAL_APPROVAL_STATUS_OPTIONS.reduce(
+  (acc, item) => ({ ...acc, [item.value]: item.label }),
+  {}
+);
+
+/**
+ * 归一异议审批状态。
+ *
+ * 兼容后端的三种常见回法:
+ * 1. 直接给 approvalStatus(APPROVING / APPROVED / REJECTED);
+ * 2. 只给 processInstanceId —— 说明流程已发起但没回写结果,按「审批中」处理;
+ * 3. 什么都没给 —— 按「未提交审批」处理。
+ */
+export function normalizeAppealApprovalStatus(raw = {}) {
+  const code = String(
+    raw.approvalStatus || raw.approvalResult || raw.processStatus || ''
+  )
+    .trim()
+    .toUpperCase();
+  if (['APPROVING', 'RUNNING', 'PENDING', 'PENDING_APPROVAL', 'WAITING'].includes(code)) {
+    return 'APPROVING';
+  }
+  if (['APPROVED', 'PASS', 'PASSED'].includes(code)) return 'APPROVED';
+  if (['REJECTED', 'REFUSED', 'DENIED'].includes(code)) return 'REJECTED';
+  if (['NOT_STARTED', 'NONE', ''].includes(code)) {
+    return raw.processInstanceId || raw.approvalInstanceId ? 'APPROVING' : 'NOT_STARTED';
+  }
+  /* 未识别的取值原样返回,交给展示层直接显示,不做猜测 */
+  return code;
+}
+
 /**
  * 是否可受理:契约原文「**仅 PROCESSING 可处理**,重复请求会被状态校验拒绝,不会重复创建更正事实」。
  * 因此只有「处理中」的行才展示受理入口,终态一律不展示(后端同时兜底)。
+ *
+ * ★ 异议审批流上线后,「受理」在业务上应当以「审批通过」为前提;
+ *   但后端申诉单状态机尚未加入审批结果校验,前端此时若强制拦截,
+ *   在流程定义未部署的环境会直接把现有受理入口锁死。
+ *   因此这里仍按 PROCESSING 放行,审批进度用独立列提示,等后端补校验后再收紧。
  */
 export function isAppealHandleable(rawStatus) {
   return String(rawStatus || '').trim().toUpperCase() === 'PROCESSING';
@@ -148,7 +210,23 @@ function adaptAppeal(raw = {}) {
     handleable: isAppealHandleable(status),
     correctionId: raw.correctionId,
     handleResult: raw.handleResult || '',
-    handleTime: raw.handleTime || ''
+    handleTime: raw.handleTime || '',
+    /* ★ 异议审批:后端补字段即生效,缺失时按「未提交审批」降级展示 */
+    processInstanceId: raw.processInstanceId || raw.approvalInstanceId || '',
+    approvalStatus: normalizeAppealApprovalStatus(raw),
+    approvalStatusLabel:
+      APPEAL_APPROVAL_STATUS_LABELS[normalizeAppealApprovalStatus(raw)] ||
+      normalizeAppealApprovalStatus(raw),
+    approvalStatusTagType:
+      (
+        APPEAL_APPROVAL_STATUS_OPTIONS.find(
+          (opt) => opt.value === normalizeAppealApprovalStatus(raw)
+        ) || {}
+      ).tagType || 'info',
+    /* 可发起/重新发起审批:只有处理中的申诉才允许;审批中与已通过都不再重复发起 */
+    canStartApproval:
+      isAppealHandleable(status) &&
+      ['NOT_STARTED', 'REJECTED'].includes(normalizeAppealApprovalStatus(raw))
   };
 }
 

+ 21 - 9
src/api/salary/salarySlip.js

@@ -127,17 +127,19 @@ function requireIdempotentKey(value, scene) {
 /* ---------------- 枚举(取值以后端为准) ---------------- */
 
 /**
- * 工资条状态 —— 2026-10-30 后端确认枚举 PayrollPayslipStatusEnum(数字码):
- * 1 待发布 / 2 已发布 / 3 已查看 / 4 已确认 / 5 申诉中 / 6 已更正 / 7 已关闭
+ * 工资条状态 —— 后端 PayrollPayslipStatusEnum,落库与接口下发均为英文编码
+ * (PayrollConstants.PAYSLIP_*):WAIT_PUBLISH 待发布 / PUBLISHED 已发布 / VIEWED 已查看 /
+ * CONFIRMED 已确认 / APPEALED 申诉中 / CORRECTED 已更正 / CLOSED 已关闭。
+ * 注意:早期这里误按数字码 1~7 配置,导致列表兜底显示 PUBLISHED、状态筛选与环形图对不上。
  */
 export const PAYSLIP_STATUS_OPTIONS = [
-  { value: '1', label: '待发布', tagType: 'info' },
-  { value: '2', label: '已发布', tagType: 'primary' },
-  { value: '3', label: '已查看', tagType: 'info' },
-  { value: '4', label: '已确认', tagType: 'success' },
-  { value: '5', label: '申诉中', tagType: 'warning' },
-  { value: '6', label: '已更正', tagType: 'warning' },
-  { value: '7', label: '已关闭', tagType: 'info' }
+  { value: 'WAIT_PUBLISH', label: '待发布', tagType: 'info' },
+  { value: 'PUBLISHED', label: '已发布', tagType: 'primary' },
+  { value: 'VIEWED', label: '已查看', tagType: 'info' },
+  { value: 'CONFIRMED', label: '已确认', tagType: 'success' },
+  { value: 'APPEALED', label: '申诉中', tagType: 'warning' },
+  { value: 'CORRECTED', label: '已更正', tagType: 'warning' },
+  { value: 'CLOSED', label: '已关闭', tagType: 'info' }
 ];
 
 export const PAYSLIP_STATUS_LABELS = PAYSLIP_STATUS_OPTIONS.reduce(
@@ -414,6 +416,16 @@ export function canBatchAction(dashboard, action) {
   return hasBatchAction(actions, action);
 }
 
+/* ---------------- 薪资批次送审(公共 BPM 流程) ----------------
+ *
+ * 批次核算完成后走公共 BPM 提交审核弹框(与合同 / 离职 / 转正同一套 processSubmitDialog),
+ * 前端只负责把 businessKey + businessId + variables 带过去,不再自己调批次接口。
+ * 审批通过后由后端把批次状态推进到审批锁定(availableActions 随之变为 PUBLISH / EXPORT),
+ * 页面刷新 dashboard 即可拿到新动作集。
+ * ★ 流程定义 key 需后端流程模型配成同名(hr_payroll_batch_approval)。
+ */
+export const PAYROLL_BATCH_APPROVAL_BUSINESS_KEY = 'hr_payroll_batch_approval';
+
 /* ---------------- 适配器 ---------------- */
 
 /**

+ 15 - 0
src/router/routes.js

@@ -124,6 +124,10 @@ const PATH_COMPONENT_MAP = {
   '/salary-appeal': 'salary/appeal/index',
   '/salary-security': 'salary/security/index',
   '/salary-my-payslip': 'salary/myPayslip/index',
+  // 资源表里「我的工资条」按目录风格配的 path(我的工资条是新增菜单,容易只填 path 不填 component)
+  '/salary/myPayslip/index': 'salary/myPayslip/index',
+  '/salary/my-payslip/index': 'salary/myPayslip/index',
+  '/salary/myPayslip': 'salary/myPayslip/index',
 };
 
 /** 旧菜单 path → 新标题 */
@@ -304,6 +308,17 @@ function normalizeMenuComponents(menus = []) {
         next.component = mapped;
       } else if (next.component) {
         next.component = normalizeComponentKey(next.component);
+      } else {
+        /*
+         * 资源表只填了 path、没填 component(新增菜单时很常见)时,
+         * 用 path 反查已登记的视图。否则路由 component 为 undefined,
+         * 匹配成功后内容区整块空白,只有页签和面包屑还在。
+         * 只认 VIEW_LOADERS 里存在的路径,目录菜单(/salary 之类)不会被误判。
+         */
+        const fromPath = normalizedPath.replace(/^\/+/, '');
+        if (VIEW_LOADERS[fromPath]) {
+          next.component = fromPath;
+        }
       }
       const title =
         PATH_TITLE_MAP[pathKey] || PATH_TITLE_MAP[normalizedPath];

+ 104 - 3
src/views/salary/appeal/index.vue

@@ -80,11 +80,33 @@
           <el-tag size="mini" :type="row.statusTagType" effect="light">{{ row.statusLabel }}</el-tag>
         </template>
 
+        <template v-slot:approvalStatus="{ row }">
+          <el-tooltip
+            v-if="row.processInstanceId"
+            :content="`流程实例:${row.processInstanceId}`"
+            placement="top"
+          >
+            <el-tag size="mini" :type="row.approvalStatusTagType" effect="plain">
+              {{ row.approvalStatusLabel }}
+            </el-tag>
+          </el-tooltip>
+          <el-tag v-else size="mini" type="info" effect="plain">{{ row.approvalStatusLabel }}</el-tag>
+        </template>
+
         <template v-slot:handleResult="{ row }">
           <div class="reason-cell">{{ row.handleResult || '—' }}</div>
         </template>
 
         <template v-slot:action="{ row }">
+          <el-link
+            v-if="row.canStartApproval && $hasPermission('hr:payrollPayslips:manage')"
+            type="warning"
+            :underline="false"
+            icon="el-icon-promotion"
+            @click="startApproval(row)"
+          >
+            {{ row.approvalStatus === 'REJECTED' ? '重新提交审批' : '提交审批' }}
+          </el-link>
           <el-link
             v-if="canHandle(row) && $hasPermission('hr:payrollPayslips:correct')"
             type="primary"
@@ -94,7 +116,10 @@
           >
             受理
           </el-link>
-          <span v-else class="action-done">{{ row.handleTime ? `已于 ${String(row.handleTime).slice(0, 16).replace('T', ' ')} 处理` : '已处理' }}</span>
+          <span
+            v-if="!row.canStartApproval && !canHandle(row)"
+            class="action-done"
+          >{{ row.handleTime ? `已于 ${String(row.handleTime).slice(0, 16).replace('T', ' ')} 处理` : '已处理' }}</span>
         </template>
 
         <template slot="empty">
@@ -119,6 +144,20 @@
         <div class="wide"><span>申诉原因</span><strong>{{ current.appealReason || '—' }}</strong></div>
       </div>
 
+      <el-alert
+        v-if="current && current.approvalStatus !== 'APPROVED'"
+        type="info"
+        :closable="false"
+        show-icon
+        class="appeal-approval-hint"
+        title="该异议还没有审批通过"
+      >
+        <template slot="default">
+          建议先关闭本弹窗,在列表点「提交审批」走完异议审批再受理。当前直接受理不会阻断审批流,
+          审批结果仍会回写到同一条申诉单上。
+        </template>
+      </el-alert>
+
       <el-form ref="handleForm" :model="handleForm" :rules="handleRules" label-width="90px" @submit.native.prevent>
         <el-form-item label="处理动作" prop="action">
           <el-radio-group v-model="handleForm.action">
@@ -155,24 +194,36 @@
         <el-button type="primary" :loading="saving" @click="submitHandle">确认受理</el-button>
       </template>
     </ele-modal>
+
+    <!-- 异议审批发起(统一 BPM 组件) -->
+    <processSubmitDialog
+      v-if="approvalVisible"
+      :processSubmitDialogFlag.sync="approvalVisible"
+      ref="processSubmitDialogRef"
+      @reload="onApprovalReload"
+    />
   </div>
 </template>
 
 <script>
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { getOrgOptions, getCurrentOrgId } from '@/utils/current-org';
+  import { getCurrentUser } from '@/utils/token-util';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import {
     getPayslipAppealPage,
     handlePayslipAppeal,
     isAppealHandleable,
     APPEAL_HANDLE_ACTION_OPTIONS,
     APPEAL_STATUS_OPTIONS,
-    APPEAL_TYPE_OPTIONS
+    APPEAL_TYPE_OPTIONS,
+    PAYSLIP_APPEAL_BUSINESS_KEY
   } from '@/api/salary/payslipAction';
 
   export default {
     name: 'PayrollAppeal',
     mixins: [tabMixins],
+    components: { processSubmitDialog },
     data() {
       return {
         legalEntities: [],
@@ -185,6 +236,8 @@
         handleVisible: false,
         saving: false,
         current: null,
+        /* 异议审批发起弹窗(统一 BPM 组件) */
+        approvalVisible: false,
         handleForm: { action: 'REJECT', handleResult: '' },
         handleRules: {
           action: [{ required: true, message: '请选择处理动作', trigger: 'change' }],
@@ -200,10 +253,11 @@
           { columnKey: 'appealType', label: '类型', width: 110, align: 'center', slot: 'appealType' },
           { columnKey: 'appealReason', label: '申诉原因', minWidth: 220, align: 'left', slot: 'appealReason' },
           { columnKey: 'status', label: '处理状态', width: 120, align: 'center', slot: 'status' },
+          { columnKey: 'approvalStatus', label: '审批状态', width: 120, align: 'center', slot: 'approvalStatus' },
           { prop: 'correctionId', label: '关联更正单', width: 120, align: 'center' },
           { columnKey: 'handleResult', label: '处理结论', minWidth: 200, align: 'left', slot: 'handleResult' },
           { prop: 'handleTime', label: '处理时间', width: 150, align: 'center' },
-          { columnKey: 'action', label: '操作', width: 150, align: 'left', fixed: 'right', slot: 'action' }
+          { columnKey: 'action', label: '操作', width: 220, align: 'left', fixed: 'right', slot: 'action' }
         ],
         pageSize: this.$store.state.tablePageSize || 20
       };
@@ -268,6 +322,49 @@
           return { list: [], count: 0 };
         }
       },
+      /**
+       * 发起「工资条异议审批」。
+       *
+       * 流程标识必须与后端 HrApprovalProcessStartBinding 里的 businessKey 完全一致
+       * (`hr_payroll_payslip_appeal_approval`),改一边就要同步另一边,否则审批发起时
+       * 找不到对应的流程定义 / 收不到业务变量。
+       *
+       * businessId 传申诉单 id —— wt 端审批页按这个 id 取业务详情,
+       * variables 同时冗余一份摘要,保证流程定义刚部署、详情接口还没上线时也能看到关键信息。
+       */
+      startApproval(row) {
+        if (!row || !row.id) return;
+        this.current = row;
+        const user = getCurrentUser() || {};
+        this.approvalVisible = true;
+        this.$nextTick(() => {
+          const dialog = this.$refs.processSubmitDialogRef;
+          if (!dialog || typeof dialog.init !== 'function') return;
+          dialog.init({
+            businessId: row.id,
+            businessKey: PAYSLIP_APPEAL_BUSINESS_KEY,
+            formCreateUserId: user.id || user.userId || '',
+            variables: {
+              businessCode: `APPEAL-${row.id}`,
+              businessName: row.employeeName || String(row.userId || ''),
+              businessType: '工资条异议审批',
+              companyId: row.companyId != null ? String(row.companyId) : '',
+              appealId: String(row.id),
+              payslipId: row.payslipId != null ? String(row.payslipId) : '',
+              employeeName: row.employeeName || '',
+              jobNumber: row.jobNumber || '',
+              deptName: row.deptName || '',
+              appealType: row.appealType || '',
+              appealTypeLabel: row.appealTypeLabel || '',
+              appealReason: row.appealReason || ''
+            }
+          });
+        });
+      },
+      onApprovalReload() {
+        this.approvalVisible = false;
+        this.reload();
+      },
       openHandle(row) {
         this.current = row;
         /*
@@ -364,6 +461,10 @@
     }
   }
 
+  .appeal-approval-hint {
+    margin-bottom: 12px;
+  }
+
   .appeal-brief {
     display: grid;
     grid-template-columns: repeat(2, 1fr);

+ 58 - 25
src/views/salary/myPayslip/index.vue

@@ -16,7 +16,8 @@
       <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" :need-page="true"
         :cache-key="$tableCacheKey(cacheKeyUrl)">
         <template v-slot:payslipStatus="{ row }">
-          <el-tag size="mini" :type="statusTagType(row.payslipStatus)" effect="light">
+          <el-tag size="mini" :type="statusTagType(row.payslipStatus)" :class="statusTagClass(row.payslipStatus)"
+            effect="light">
             {{ row.payslipStatusLabel }}
           </el-tag>
         </template>
@@ -61,7 +62,8 @@
           <div>
             <span>状态</span>
             <strong>
-              <el-tag size="mini" :type="statusTagType(current.payslipStatus)" effect="light">
+              <el-tag size="mini" :type="statusTagType(current.payslipStatus)"
+                :class="statusTagClass(current.payslipStatus)" effect="light">
                 {{ current.payslipStatusLabel }}
               </el-tag>
             </strong>
@@ -123,10 +125,6 @@
             当前状态({{ current.payslipStatusLabel }})无可执行操作
           </span>
         </div>
-        <p class="detail-note">
-          「确认」表示对本月工资条无异议,确认后不可再对同一条重复确认;
-          「异议」提交后由 HR 在工资条申诉中受理,处理进度走统一申请审批。
-        </p>
       </div>
 
       <template v-slot:footer>
@@ -218,12 +216,12 @@ export default {
     },
     /** 确认入口:仅未确认、未申诉的发布态可确认(已确认/已申诉后端会拒绝,不放行误导用户) */
     canConfirm() {
-      return ['2', '3'].includes(this.current?.payslipStatus);
+      return ['PUBLISHED', 'VIEWED'].includes(this.current?.payslipStatus);
     },
     /** 异议入口:与确认同一前提,且已有异议说明的不再重复入口 */
     canAppeal() {
       return (
-        ['2', '3'].includes(this.current?.payslipStatus) &&
+        ['PUBLISHED', 'VIEWED'].includes(this.current?.payslipStatus) &&
         !this.detail?.appealReason
       );
     }
@@ -241,19 +239,24 @@ export default {
       })}`;
     },
     statusTagType(status) {
-      /* PayrollPayslipStatusEnum 数字码(2026-10-30 后端确认):1待发布 2已发布 3已查看
-         4已确认 5申诉中 6已更正 7已关闭 */
+      /* 后端 PayrollPayslipStatusEnum 下发英文编码:WAIT_PUBLISH / PUBLISHED / VIEWED /
+         CONFIRMED / APPEALED / CORRECTED / CLOSED */
       const types = {
-        1: 'info',
-        2: 'primary',
-        3: 'info',
-        4: 'success',
-        5: 'warning',
-        6: 'warning',
-        7: 'info'
+        WAIT_PUBLISH: 'info',
+        PUBLISHED: '',
+        /* 「已查看」用中性蓝(不走 success 绿),避免和「已确认」混淆 */
+        VIEWED: '',
+        CONFIRMED: 'success',
+        APPEALED: 'warning',
+        CORRECTED: 'warning',
+        CLOSED: 'info'
       };
       return types[status] || 'info';
     },
+    /** 已查看单独挂 class 兜底:全局样式把 info / success 改色时仍保持信息蓝 */
+    statusTagClass(status) {
+      return status === 'VIEWED' ? 'payslip-tag--viewed' : '';
+    },
     reload() {
       this.$refs.table && this.$refs.table.reload();
     },
@@ -420,6 +423,17 @@ export default {
   }
 }
 
+/*
+ * 「已查看」状态标签:浅蓝信息色。
+ * 用 !important 是因为 el-tag 的 --info / --success 颜色由主题样式先给出,
+ * 这里要保证不管主题怎么改,都能和绿色的「已确认」区分开。
+ */
+.payslip-tag--viewed {
+  color: #1d6fd8 !important;
+  background-color: #ecf5ff !important;
+  border-color: #b3d8ff !important;
+}
+
 .my-payslip-detail-modal {
   .payslip-detail {
     min-height: 180px;
@@ -434,18 +448,44 @@ export default {
     border-radius: 4px;
     background: #f5f7fa;
 
+    /*
+     * 每格改为 flex 行对齐:原来 span 是 inline-block、strong 是 inline,
+     * 「状态」格里的 el-tag 是 inline-flex(高 20px),基线对齐时会比左侧文字偏上,
+     * 看起来标签没居中。这里统一按行高 20px 垂直居中对齐。
+     */
+    > div {
+      display: flex;
+      align-items: center;
+      min-width: 0;
+      line-height: 20px;
+    }
+
     span {
-      display: inline-block;
+      flex: none;
+      display: block;
       min-width: 90px;
       color: #909399;
       font-size: 13px;
+      line-height: 20px;
     }
 
     strong {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      min-width: 0;
+      min-height: 20px;
       color: #303133;
       font-weight: 500;
+      line-height: 20px;
       word-break: break-all;
     }
+
+    /* 标签自身高度与行高对齐,避免上下各差 1px */
+    .el-tag {
+      line-height: 18px;
+      vertical-align: middle;
+    }
   }
 
   .detail-section-title {
@@ -542,13 +582,6 @@ export default {
     font-size: 13px;
     color: #c0c4cc;
   }
-
-  .detail-note {
-    margin: 0;
-    font-size: 12.5px;
-    color: #909399;
-    line-height: 1.7;
-  }
 }
 
 .my-payslip-appeal-modal {

+ 6 - 15
src/views/salary/salarySlip/components/SalaryAdjustDialog.vue

@@ -1,16 +1,9 @@
 <template>
   <ele-modal :visible="visible" width="600px" :close-on-click-modal="false" title="薪资人工调整" append-to-body
     custom-class="salary-adjust-modal" @update:visible="updateVisible">
-    <el-alert class="dialog-tip" type="warning" :closable="false" show-icon title="人工调整会记录原金额、调整金额与原因;调整金额可正可负">
-      <template slot="default">
-        单笔超过 1000 元或实发变化超过 10% 时,后端会将该调整标记为需二次审批。调整原因必填并写入审计。
-      </template>
-    </el-alert>
-
     <div v-if="row" class="slip-brief">
       <span class="brief-name">{{ row.employeeName || '—' }}</span>
       <span class="brief-meta">{{ row.payrollMonth || '' }}</span>
-      <span class="brief-meta">工资条 #{{ row.id }}</span>
     </div>
 
     <el-form ref="form" :model="form" :rules="rules" label-width="110px" v-loading="loading" @submit.native.prevent>
@@ -25,7 +18,8 @@
         </div>
       </el-form-item>
       <el-form-item label="调整金额" prop="adjustAmount">
-        <el-input-number v-model="form.adjustAmount" :controls="false" placeholder="正数增加、负数扣减" style="width: 100%" />
+        <el-input-number v-model="form.adjustAmount" :controls="false" placeholder="正数增加、负数扣减"
+          class="adjust-amount-input" style="width: 100%" />
         <div v-if="needSecondApproval" class="field-hint field-hint--warn">
           单笔调整超过 1000 元,提交后将标记为需二次审批。
         </div>
@@ -39,12 +33,8 @@
         <!--
           ★ C14 已明确:人工调整接口(/hr/payroll/batches/adjustments)只接收**单个**
           attachmentFileId,「不接受 URL、数组或逗号分隔多附件」。因此控件按单选使用:
-          多选后只保留最后 1 个并明确提示,不再出现「选了 3 个只传 1 个」的静默丢弃。
+          多选后由 watcher 只保留最后一个,避免「选了 3 个只传 1 个」的静默丢弃。
         -->
-        <div class="field-hint">
-          仅支持受控文件服务的附件主键(不支持外部链接);本接口最多 1 个附件,
-          选择多个时会只保留最后一个。
-        </div>
       </el-form-item>
     </el-form>
 
@@ -169,8 +159,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.dialog-tip {
-  margin-bottom: 14px;
+/* el-input-number 的 input 默认居中,金额输入框改为左对齐(placeholder 与输入值同起点) */
+.adjust-amount-input ::v-deep .el-input__inner {
+  text-align: left;
 }
 
 .slip-brief {

+ 175 - 77
src/views/salary/salarySlip/index.vue

@@ -49,12 +49,21 @@
             执行核算
           </el-button>
           <el-button v-if="$hasPermission('hr:payrollBatches:recalculate')" type="warning"
-            icon="el-icon-refresh-right" size="small" plain :loading="calcActionRunning === 'recalculate'"
+            icon="el-icon-refresh-right" size="small" :loading="calcActionRunning === 'recalculate'"
             :disabled="!canRecalculate || !!calcActionRunning || calcPrompting" @click="runCalc('recalculate')">
             重算
           </el-button>
+          <!--
+            提交审批:走公共 BPM 流程(processSubmitDialog),权限码 hr:payrollBatches:submit。
+            能否点击完全以后端 availableActions 里的 SUBMIT_APPROVAL 为准(核算完成且无阻断异常)。
+          -->
+          <el-button v-if="$hasPermission('hr:payrollBatches:submit')" type="success"
+            icon="el-icon-s-promotion" size="small" :disabled="!canSubmitApproval"
+            :title="actionHint || '仅核算完成且无阻断异常的批次可提交审批'" @click="openSubmitApproval">
+            提交审批
+          </el-button>
           <el-button v-if="canCancel && $hasPermission('hr:payrollBatches:cancel')" type="danger"
-            icon="el-icon-circle-close" size="small" plain :loading="cancelLoading"
+            icon="el-icon-circle-close" size="small" :loading="cancelLoading"
             :disabled="!!calcActionRunning || calcPrompting" @click="openCancel">
             取消批次
           </el-button>
@@ -73,25 +82,14 @@
         <i class="el-icon-info"></i>
         <span>{{ actionHint }}</span>
         <template v-if="actionLabels.length">
-          <span class="steps-hint-label">当前可执行操作:</span>
+          <span class="steps-hint-label">当前可操作:</span>
           <el-tag v-for="item in actionLabels" :key="item" size="mini" effect="plain" class="steps-hint-tag">
             {{ item }}
           </el-tag>
         </template>
       </div>
-      <p class="steps-note">
-        批次没有单独的「已发布」状态,故流程条到「锁定」为止;工资条是否已发布以下方列表的状态为准。
-        执行核算后若停在「取数(存在阻断)」,需先在上方「核算异常」里处理阻断项,再点「重新核算」继续 ——
-        按钮能不能点,以系统当前允许执行的操作为准,不会按批次名称或阶段去猜。
-      </p>
-      <p class="steps-note steps-note--muted">
-        <i class="el-icon-warning-outline"></i>
-        <b>取消批次</b>仅对<b>未锁定且未发布工资条</b>的
-        取数 / 核算 / 待确认批次开放 —— 已锁定或已发布工资条的批次会被拒绝,
-        那时只能走工资条的更正草稿或人工调整来修正。误建的批次建议尽早取消,
-        避免它以「已取消」状态留在统计口径之外却仍占用同月唯一性。
-        核算前置检查发现的悬空引用(如模板引用了已停用的五险一金方案)会以 <b>阻断异常</b>出现在下方异常卡里,
-        处理后再重算。
+      <p v-if="!actionHint" class="steps-note">
+        批次没有单独的「已发布」状态,流程条到「锁定」为止,工资条是否已发布以下方列表的状态为准。
       </p>
     </el-card>
 
@@ -100,7 +98,8 @@
       <div slot="header" class="sync-card-header">
         <span class="section-bar"></span>
         <span class="section-title">批次数据同步与核算概况</span>
-        <el-tag size="mini" class="sync-status-tag" :type="overview.synced ? 'success' : 'warning'">
+        <!-- 同步正常时不挂标签(步骤条「取数」节点已有状态),只在未同步 / 待取数时提示 -->
+        <el-tag v-if="!overview.synced" size="mini" type="warning" class="sync-status-tag">
           {{ overview.syncStatusLabel || '暂无批次' }}
         </el-tag>
         <el-tag v-if="overview.alertLevel && overview.alertLevel !== 'NONE'" size="mini"
@@ -161,7 +160,8 @@
           <div slot="header" class="sync-card-header">
             <span class="section-bar"></span>
             <span class="section-title">核算异常</span>
-            <el-tag size="mini" type="danger" class="warn-total-tag">
+            <!-- 0/0 不挂红色标签(下方空态已说明无异常),有异常才提示且阻断优先用红 -->
+            <el-tag v-if="hasUnclosedException" size="mini" :type="exceptionTagType" class="warn-total-tag">
               阻断 {{ overview.blockExceptionCount || 0 }} · 未关闭
               {{ overview.openExceptionCount || 0 }} 条
             </el-tag>
@@ -207,28 +207,16 @@
         </div>
         <div class="table-header-right">
           <el-button v-if="$hasPermission('hr:payrollBatches:publishPayslips')" type="primary" icon="el-icon-s-promotion"
-            plain :disabled="!canPublish" :title="actionHint || '仅审批锁定批次可发布'" @click="handleBatchPublish">
+            :disabled="!canPublish" :title="actionHint || '仅审批锁定批次可发布'" @click="handleBatchPublish">
             批量发布工资条
           </el-button>
-          <el-button v-if="$hasPermission('hr:payrollBatches:export')" type="primary" icon="el-icon-download" plain
+          <el-button v-if="$hasPermission('hr:payrollBatches:export')" type="primary" icon="el-icon-download"
             :disabled="!canExport" :title="actionHint || '仅审批锁定批次可导出'" @click="openExport">
             导出薪资表
           </el-button>
         </div>
       </div>
 
-      <!--
-        P2-10 / C19:讲清工资条的两个查看维度。
-        C19 已确认 `POST /hr/payroll/payslips/page` 的 batchId 与 payrollMonth 可二选一
-        (同时选时取交集),所以「清空批次 + 顶部选月份」就能跨批次按月看;
-        界面说明跟上,避免 HR 以为「选了月份看不到上个月」是故障。
-      -->
-      <div class="sheet-note">
-        <i class="el-icon-info" />
-        工资条按「薪资批次」查看:切换上方批次可看该批次的人员明细;<b>清空批次</b>后在顶部选择核算月份,即可跨批次按月查看;
-        跨批次的金额汇总请到「薪资统计」。
-      </div>
-
       <!-- 快速筛选 -->
       <!-- label-width 用 96px:「工资条状态」5 个字 + 默认 12px 右内边距需 82px,
            原来 80px 差 2px 会把最后一个字挤到第二行 -->
@@ -464,6 +452,10 @@
         <el-button type="danger" :loading="cancelLoading" @click="submitCancel">确认取消批次</el-button>
       </div>
     </el-dialog>
+
+    <!-- 提交审批:公共 BPM 弹框(选流程 / 执行人 / 流程图,提交后回调刷新 dashboard) -->
+    <processSubmitDialog :processSubmitDialogFlag.sync="processSubmitDialogFlag" v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef" @reload="onProcessSubmitReload" />
   </div>
 </template>
 
@@ -474,6 +466,7 @@ import { getOrgOptions, getCurrentOrgId } from '@/utils/current-org';
 import {
   BATCH_ACTION,
   PAYSLIP_STATUS_OPTIONS,
+  PAYROLL_BATCH_APPROVAL_BUSINESS_KEY,
   batchActionHint,
   batchActionLabel,
   canBatchAction,
@@ -496,6 +489,9 @@ import { download } from '@/utils/file';
 import StartCalcDialog from './components/StartCalcDialog.vue';
 import SalaryAdjustDialog from './components/SalaryAdjustDialog.vue';
 import PayslipCorrectionDialog from './components/PayslipCorrectionDialog.vue';
+/* 提交审批统一走公共 BPM 弹框(与合同 / 离职 / 转正同一套) */
+import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+import { getCurrentUser } from '@/utils/token-util';
 
 function formatAmount(val) {
   if (val === null || val === undefined || val === '') return '--';
@@ -516,7 +512,7 @@ function fmtDateTime(val) {
 export default {
   name: 'SalarySlip',
   mixins: [tabMixins],
-  components: { StartCalcDialog, SalaryAdjustDialog, PayslipCorrectionDialog },
+  components: { StartCalcDialog, SalaryAdjustDialog, PayslipCorrectionDialog, processSubmitDialog },
   data() {
     return {
       where: {
@@ -552,6 +548,8 @@ export default {
       cancelVisible: false,
       cancelLoading: false,
       cancelForm: { reason: '' },
+      /* 提交审批:公共 BPM 弹框开关(提交成功后 @reload 里刷新 dashboard 与列表) */
+      processSubmitDialogFlag: false,
       // 启动核算 / 人工调整 / 更正 / 导出
       startCalcVisible: false,
       adjustVisible: false,
@@ -666,6 +664,16 @@ export default {
       if (rate >= 50) return '#1890ff';
       return '#db7a25';
     },
+    /** 是否存在未关闭异常:0/0 时不挂异常标签,避免「红色 0 条」造成误读 */
+    hasUnclosedException() {
+      const block = Number(this.overview.blockExceptionCount) || 0;
+      const open = Number(this.overview.openExceptionCount) || 0;
+      return block + open > 0;
+    },
+    /** 异常标签颜色:有阻断用红,仅有非阻断预警用橙 */
+    exceptionTagType() {
+      return (Number(this.overview.blockExceptionCount) || 0) > 0 ? 'danger' : 'warning';
+    },
     /** 当前批次主键:工资条列表、导出、发布都以批次为维度 */
     currentBatchId() {
       return this.currentBatch?.id || '';
@@ -714,6 +722,14 @@ export default {
       if (!this.currentBatchId || !this.overviewReady) return false;
       return canBatchAction(this.overview, BATCH_ACTION.CANCEL);
     },
+    /**
+     * 提交审批:契约里 SUBMIT_APPROVAL 由后端在 availableActions 给出
+     * (核算完成且无阻断异常时才给),前端不自按 batchStatus 猜。
+     */
+    canSubmitApproval() {
+      if (!this.currentBatchId || !this.overviewReady) return false;
+      return canBatchAction(this.overview, BATCH_ACTION.SUBMIT_APPROVAL);
+    },
     /** 批量发布:契约「仅审批锁定批次可发布」(后端仍会校验阻断异常与发布状态) */
     canPublish() {
       if (!this.currentBatchId || !this.overviewReady) return false;
@@ -744,38 +760,43 @@ export default {
     },
     /** 按钮禁用原因(把后端状态机讲清楚,避免 HR 猜「为什么不能点」) */
     actionHint() {
-      if (!this.currentBatchId) return '请先选择薪资批次';
+      if (!this.currentBatchId) return '尚未选择薪资批次';
       /*
        * ★ 2026-10-09:可执行动作完全由后端 availableActions 给出,
        * 「取不到」与「终态空数组」都会让按钮全灰 —— 必须给出明确原因,不能静默。
        */
       if (!this.overviewReady) {
-        return '暂未获取到当前可执行的操作:正在加载,或加载失败 / 无权限(请重试或联系管理员)';
+        return '暂时取不到该批次的执行状态(加载中、加载失败或无权限),请稍后重试';
       }
       if (!this.availableActions.length) {
-        return '当前批次已无可用操作(流程已结束),如需继续请新建批次';
+        return '该批次流程已结束,没有可执行的操作';
       }
-      if (this.batchStatus === 'DRAFT') return '新建批次后点「执行核算」开始取数与试算';
+      /* 文案只说明「批次现在是什么状态、下一步的关键约束」,
+         不再逐个复述按钮名 —— 右侧「当前可操作」标签已经把可点的动作列出来了 */
+      if (this.batchStatus === 'DRAFT') return '批次已创建,尚未取数';
+      if (this.batchStatus === 'FETCHING') return '批次已创建,尚未取数';
       if (this.batchStatus === 'FETCHED') {
-        return '批次停在取数:先处理完下方阻断异常,再点「重算」继续';
+        return '取数已完成,但存在阻断项,处理完下方异常后才能继续核算';
       }
-      if (this.batchStatus === 'CALCULATING') return '核算进行中,请稍候刷新';
-      if (this.batchStatus === 'CALCULATED') return '核算完成,可「重算」或在异常清零后送审批';
-      if (this.batchStatus === 'APPROVING') return '审批中:批次已进入流程,不能再核算或取消';
+      if (this.batchStatus === 'CALCULATING') return '核算进行中,请稍候';
+      if (this.batchStatus === 'CALCULATED') {
+        const blockCount = Number(this.overview.blockExceptionCount) || 0;
+        return blockCount > 0
+          ? `核算已完成,但存在 ${blockCount} 条阻断异常,处理完并重新核算后才能送审`
+          : '核算已完成,结果确认无误即可提交审批';
+      }
+      if (this.batchStatus === 'APPROVING') return '审批中,等待审批结果,此期间不能核算或取消';
       if (this.batchStatus === 'APPROVED_LOCKED') {
-        return '审批锁定:可发布工资条或导出;金额修正走更正草稿 / 人工调整';
+        return '审批已锁定,可发布工资条或导出;金额修正走更正草稿或人工调整';
       }
       if (this.batchStatus === 'APPROVED') {
-        return '已审批(历史批次):如需修正金额请走更正草稿 / 人工调整';
+        return '历史批次(已审批),金额修正走更正草稿或人工调整';
       }
-      if (this.batchStatus === 'CONFIRMING') return '确认中:等待员工确认后再送审批';
-      /* FETCHING = 建批次后尚未取数,取数由「执行核算」触发,必须给出可操作的引导
-         (2026-11-12 变基合并:本地版文案与之等价,保留上游这句) */
-      if (this.batchStatus === 'FETCHING') return '批次待取数:点「执行核算」开始取数与试算';
-      if (this.batchStatus === 'PAID') return '该批次工资已发放,不再支持核算类操作';
+      if (this.batchStatus === 'CONFIRMING') return '工资条确认中,员工确认完成后才能送审';
+      if (this.batchStatus === 'PAID') return '工资已发放,不再支持核算类操作';
       if (this.batchStatus === 'CLOSED') return '批次已关闭,不再参与核算与统计';
       if (this.batchStatus === 'VOID') return '批次已作废,不再参与核算与统计';
-      if (this.batchStatus === 'REJECTED') return '审批已驳回:修正数据后可「重算」再送审';
+      if (this.batchStatus === 'REJECTED') return '审批已驳回,修正数据后重新核算再提交';
       if (this.batchStatus === 'CANCELLED') return '批次已取消,不再参与核算与统计';
       /*
        * P2-7:兜底不再返回空字符串。
@@ -784,8 +805,8 @@ export default {
        */
       const raw = this.currentBatch?.batchStatusRaw || this.currentBatch?.batchStatus;
       return raw
-        ? `当前批次状态「${raw}」下没有可执行的动作;如确需继续,请把该状态反馈给系统管理员`
-        : '当前批次状态下没有可执行的动作,请刷新后重试或联系管理员';
+        ? `当前批次状态「${raw}」暂不支持任何操作,请联系管理员`
+        : '暂不支持对该批次执行操作,请刷新后重试或联系管理员';
     },
     /** 步骤条进度:建批次 → 取数 → 核算 → 送审 → 锁定 */
     batchStepActive() {
@@ -1345,6 +1366,64 @@ export default {
         this.publishLoading = false;
       }
     },
+    /* ---------- 提交审批(公共 BPM 流程,businessKey = hr_payroll_batch_approval) ---------- */
+    async openSubmitApproval() {
+      if (!this.currentBatchId) {
+        this.$message.warning('请先选择薪资批次');
+        return;
+      }
+      if (!this.canSubmitApproval) {
+        this.$message.warning(
+          batchActionHint(this.overview, BATCH_ACTION.SUBMIT_APPROVAL) ||
+            `当前批次不可提交审批,批次状态:${
+              this.currentBatch?.batchStatusLabel || this.batchStatus || '-'
+            }`
+        );
+        return;
+      }
+      try {
+        await this.$confirm(
+          `提交后批次进入审批中,核算 / 重算 / 取消批次都不能再用,审批锁定后才能发布工资条。确认提交「${
+            this.currentBatch?.batchNo || this.currentBatchId
+          }」的薪资审批?`,
+          '提交审批',
+          { type: 'warning', confirmButtonText: '确认提交', cancelButtonText: '再想想' }
+        );
+      } catch (error) {
+        return;
+      }
+      this.launchApproval();
+    },
+    /** 打开公共 BPM 提交审核弹框(变量供流程分支 / 抄送取值,缺省不传空串) */
+    launchApproval() {
+      const batch = this.currentBatch || {};
+      const company = this.legalEntities.find(
+        (item) => String(item.id) === String(batch.companyId)
+      );
+      this.processSubmitDialogFlag = true;
+      this.$nextTick(() => {
+        const currentUser = getCurrentUser() || {};
+        this.$refs.processSubmitDialogRef?.init({
+          businessId: batch.id || this.currentBatchId,
+          businessKey: PAYROLL_BATCH_APPROVAL_BUSINESS_KEY,
+          formCreateUserId:
+            batch.createUserId || currentUser.id || currentUser.userId || '',
+          variables: {
+            businessCode: batch.batchNo || '',
+            businessName: `${batch.payrollMonth || ''} 薪资核算`.trim(),
+            businessType: '薪资核算',
+            groupId: batch.companyId || '',
+            groupName: company?.name || '',
+            payrollMonth: batch.payrollMonth || '',
+            employeeCount: this.overview.calculatedEmployeeCount || 0
+          }
+        });
+      });
+    },
+    /* 弹框提交成功:批次已进入审批中,重拉批次(状态 + dashboard 动作集),核算类动作随之消失 */
+    onProcessSubmitReload() {
+      this.loadBatches();
+    },
     /* ---------- Y19:受控导出(契约 body 只有 reason;仅审批锁定批次可导出 + 写审计) ---------- */
     openExport() {
       if (!this.currentBatchId) {
@@ -1496,18 +1575,6 @@ export default {
     font-size: 12.5px;
     line-height: 1.7;
     color: #909399;
-
-    &--muted {
-      margin-top: 6px;
-      padding: 8px 10px;
-      border-left: 2px solid #e6a23c;
-      background: #fdf6ec;
-      color: #a8845c;
-
-      b {
-        color: #b88230;
-      }
-    }
   }
 
   /* 当前状态可做什么(后端 availableActions 驱动) */
@@ -1731,20 +1798,6 @@ export default {
     }
   }
 
-  /* P2-10:工资条「按批次查看」的说明行 */
-  .sheet-note {
-    display: flex;
-    gap: 6px;
-    align-items: center;
-    margin-bottom: 12px;
-    font-size: 12.5px;
-    line-height: 1.7;
-    color: #909399;
-
-    i {
-      flex: none;
-    }
-  }
 
   .calc-table-filter {
     margin-bottom: 12px;
@@ -1815,11 +1868,56 @@ export default {
   color: #7a8699;
 }
 
+/*
+ * 完成率 / 核算异常两卡等高对齐:
+ * 左卡有圆环(固定 120px)+ 3 行统计,右卡空态只有一行,等高后右卡会剩一大片空白。
+ * 这里让两列 flex 拉伸,卡片 body 变纵向 flex,异常列表撑满剩余高度(多了可滚动),
+ * 空态用 margin:auto 垂直居中,视觉上和左卡底部对齐。
+ */
+.salary-calc-center .calc-overview-row {
+  display: flex;
+  flex-wrap: wrap;
+  align-items: stretch;
+}
+
+.salary-calc-center .calc-overview-row::before,
+.salary-calc-center .calc-overview-row::after {
+  display: none;
+}
+
+.salary-calc-center .calc-overview-row > .el-col {
+  float: none;
+}
+
+.salary-calc-center .calc-overview-row .overview-card {
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+}
+
+.salary-calc-center .calc-overview-row .overview-card > .el-card__body {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  min-height: 0;
+}
+
+.salary-calc-center .calc-overview-row .completion-block {
+  flex: 1;
+}
+
+.salary-calc-center .calc-overview-row .warning-list {
+  flex: 1;
+  min-height: 0;
+  overflow-y: auto;
+}
+
 .salary-calc-center .warning-empty {
   padding: 24px 0;
   text-align: center;
   font-size: 14px;
   color: #909399;
+  margin: auto;
 }
 
 .salary-calc-center .warning-empty i {