ZN
4 天以前 b461c6527e3a85e9af59e7680e792bcb5ffb6b7e
Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
已添加1个文件
已修改5个文件
593 ■■■■ 文件已修改
src/components/Dialog/FormDialog.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/Logo.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/monthlyStatistics/components/auditDia.vue 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/monthlyStatistics/components/formDia.vue 259 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/monthlyStatistics/index.vue 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/socialSecuritySet/components/formDia.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Dialog/FormDialog.vue
@@ -8,14 +8,18 @@
    <slot></slot>
    <template #footer>
      <div class="dialog-footer">
        <el-button
          v-if="showConfirm"
          type="primary"
          @click="handleConfirm"
        >
          ç¡®è®¤
        </el-button>
        <el-button @click="handleCancel">取消</el-button>
        <!-- è‡ªå®šä¹‰æŒ‰é’®æ’æ§½ -->
        <slot name="footer">
          <!-- é»˜è®¤æŒ‰é’® -->
          <el-button
            v-if="showConfirm"
            type="primary"
            @click="handleConfirm"
          >
            ç¡®è®¤
          </el-button>
          <el-button @click="handleCancel">取消</el-button>
        </slot>
      </div>
    </template>
  </el-dialog>
src/layout/components/Sidebar/Logo.vue
@@ -2,11 +2,11 @@
  <div class="sidebar-logo-container" :class="{ 'collapse': collapse }">
    <transition name="sidebarLogoFade">
      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<!--        <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="公司Logo" />-->
        <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="公司Logo" />
        <h1 class="sidebar-title">{{ title }}</h1>
      </router-link>
      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
<!--        <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="公司Logo" />-->
        <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="公司Logo" />
        <h1 class="sidebar-title">{{ title }}</h1>
      </router-link>
    </transition>
src/views/personnelManagement/monthlyStatistics/components/auditDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,216 @@
<template>
  <FormDialog
    v-model="dialogVisible"
    title="工资审核"
    width="900px"
    @close="handleClose"
  >
    <!-- å·¥èµ„表基础信息 -->
    <el-card shadow="never" style="margin-bottom: 16px;">
      <template #header>
        <span>工资表信息</span>
      </template>
      <el-descriptions :column="3" border>
        <el-descriptions-item label="工资主题">{{ auditData?.salaryTitle || '-' }}</el-descriptions-item>
        <el-descriptions-item label="工资月份">{{ auditData?.salaryMonth || '-' }}</el-descriptions-item>
        <el-descriptions-item label="工资总额">Â¥ {{ formatMoney(auditData?.totalSalary) }}</el-descriptions-item>
        <el-descriptions-item label="支付银行">{{ auditData?.payBank || '-' }}</el-descriptions-item>
        <el-descriptions-item label="审核人">{{ auditData?.auditUserName || '-' }}</el-descriptions-item>
        <el-descriptions-item label="备注">{{ auditData?.remark || '-' }}</el-descriptions-item>
      </el-descriptions>
    </el-card>
    <!-- å‘˜å·¥å·¥èµ„明细 -->
      <el-card shadow="never" style="margin-bottom: 16px;">
        <template #header>
          <span>员工工资明细</span>
        </template>
        <div v-if="!employeeList || employeeList.length === 0" style="text-align: center; padding: 20px; color: #909399;">
          <div>暂无员工工资明细数据</div>
          <div style="font-size: 12px; margin-top: 5px;">员工明细数据需要在工资表生成或编辑时才会保存</div>
        </div>
        <div v-else>
          <el-table :data="employeeList" border max-height="300" style="width: 100%">
            <el-table-column prop="staffName" label="员工姓名" width="100" />
            <el-table-column prop="deptName" label="部门" width="120" />
            <el-table-column prop="basicSalary" label="基本工资" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.basicSalary) }}</template>
            </el-table-column>
            <el-table-column prop="pieceSalary" label="计件工资" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.pieceSalary) }}</template>
            </el-table-column>
            <el-table-column prop="hourlySalary" label="计时工资" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.hourlySalary) }}</template>
            </el-table-column>
            <el-table-column prop="otherIncome" label="其他收入" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.otherIncome) }}</template>
            </el-table-column>
            <el-table-column prop="socialPersonal" label="社保个人" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.socialPersonal) }}</template>
            </el-table-column>
            <el-table-column prop="fundPersonal" label="公积金个人" width="120" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.fundPersonal) }}</template>
            </el-table-column>
            <el-table-column prop="salaryTax" label="工资个税" width="100" align="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.salaryTax) }}</template>
            </el-table-column>
            <el-table-column prop="netSalary" label="实发工资" width="100" align="right" fixed="right">
              <template #default="{ row }">Â¥ {{ formatMoney(row.netSalary) }}</template>
            </el-table-column>
          </el-table>
          <div style="margin-top: 10px; text-align: right; font-weight: bold;">
            å·¥èµ„总额:¥ {{ formatMoney(totalSalary) }}
          </div>
        </div>
      </el-card>
    <!-- å®¡æ ¸æ“ä½œ -->
    <el-form label-position="top">
      <el-form-item label="审核结果" required>
        <el-radio-group v-model="auditResult">
          <el-radio :value="4">通过</el-radio>
          <el-radio :value="2">不通过</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <template #footer>
      <el-button type="primary" :loading="loading" @click="handleConfirm">
        ç¡®å®š
      </el-button>
       <el-button @click="handleClose">取消</el-button>
    </template>
  </FormDialog>
</template>
<script setup>
import { ref, computed, reactive, toRefs, getCurrentInstance, watch } from "vue";
import { ElMessage } from "element-plus";
import Cookies from "js-cookie";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import { staffSalaryMainUpdate } from "@/api/personnelManagement/staffSalaryMain.js";
const emit = defineEmits(["update:modelValue", "close", "success"]);
const props = defineProps({
  modelValue: { type: Boolean, default: false },
  row: { type: Object, default: () => ({}) },
});
const { proxy } = getCurrentInstance();
const dialogVisible = computed({
  get: () => props.modelValue,
  set: (val) => emit("update:modelValue", val),
});
const loading = ref(false);
const auditResult = ref(4); // é»˜è®¤é€šè¿‡
const auditData = ref({});
const employeeList = ref([]);
// ç›‘听row数据变化
watch(() => props.row, (newRow) => {
  if (newRow && Object.keys(newRow).length > 0) {
    loadAuditData(newRow);
  }
}, { immediate: true });
// æ ¼å¼åŒ–金额
const formatMoney = (value) => {
  const num = Number(value) || 0;
  return num.toFixed(2);
};
// è®¡ç®—工资总额
const totalSalary = computed(() => {
  return employeeList.value.reduce((sum, e) => {
    const salary = Number(e.netSalary) || 0;
    return sum + salary;
  }, 0);
});
// åŠ è½½å®¡æ ¸æ•°æ®
const loadAuditData = (row) => {
  auditData.value = row || {};
  auditResult.value = 4; // é»˜è®¤é€‰æ‹©é€šè¿‡
  // åŠ è½½å‘˜å·¥å·¥èµ„æ˜Žç»†æ•°æ®
  if (row?.staffSalaryDetailList && Array.isArray(row.staffSalaryDetailList)) {
    employeeList.value = row.staffSalaryDetailList.map((e) => ({
      staffName: e.staffName ?? "",
      deptName: e.deptName ?? "",
      basicSalary: Number(e.basicSalary) || 0,
      pieceSalary: Number(e.pieceSalary) || 0,
      hourlySalary: Number(e.hourlySalary) || 0,
      otherIncome: Number(e.otherIncome) || 0,
      socialPersonal: Number(e.socialPersonal) || 0,
      fundPersonal: Number(e.fundPersonal) || 0,
      salaryTax: Number(e.salaryTax) || 0,
      netSalary: Number(e.netSalary) || 0,
    }));
  } else {
    console.log('没有找到员工明细数据');
    employeeList.value = [];
  }
};
// æ‰“开弹窗
const openDialog = (row) => {
  loadAuditData(row);
  dialogVisible.value = true;
};
// å…³é—­å¼¹çª—
const handleClose = () => {
  dialogVisible.value = false;
  emit("close");
};
// ç¡®è®¤å®¡æ ¸
const handleConfirm = () => {
  try {
    const row = auditData.value;
    if (!row?.id) {
      ElMessage.warning("数据异常,请重试");
      return;
    }
    const username = Cookies.get("username") || "";
    const userIdRaw = Cookies.get("userId");
    const auditUserId = userIdRaw ? Number(userIdRaw) : undefined;
    // æž„建审核数据
    const submitData = {
      id: row.id,
      status: Number(auditResult.value) === 2 ? 2 : 4, // 2=不通过 4=通过(待发放)
      auditUserId,
      auditUserName: username,
    };
    loading.value = true;
    staffSalaryMainUpdate(submitData)
      .then(() => {
        ElMessage.success("审核成功");
        dialogVisible.value = false;
        emit("success");
      })
      .catch((error) => {
        console.error('审核失败:', error)
      })
      .finally(() => {
        loading.value = false;
      });
  } catch (error) {
    console.error('审核处理异常:', error);
    loading.value = false;
  }
};
defineExpose({ openDialog });
</script>
<style scoped>
:deep(.el-descriptions__label) {
  width: 100px;
}
</style>
src/views/personnelManagement/monthlyStatistics/components/formDia.vue
@@ -4,9 +4,12 @@
    :title="operationType === 'add' ? '新建工资表' : '编辑工资表'"
    width="90%"
    @close="closeDia"
    @confirm="submitForm"
    @cancel="closeDia"
  >
    <template #footer>
      <el-button type="info" @click="saveDraft">保存草稿</el-button>
      <el-button type="primary" @click="submitForm">确认提交</el-button>
      <el-button @click="closeDia">取消</el-button>
    </template>
    <div class="form-dia-body">
      <!-- åŸºç¡€èµ„æ–™ -->
      <el-card class="form-card" shadow="never">
@@ -34,7 +37,6 @@
                  placeholder="请选择"
                  clearable
                  multiple
                  collapse-tags
                  collapse-tags-tooltip
                  style="width: 100%"
                >
@@ -89,6 +91,24 @@
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="审核人" prop="auditUserId">
                <el-select
                  v-model="form.auditUserId"
                  placeholder="请选择审核人"
                  clearable
                  filterable
                  style="width: 100%"
                >
                  <el-option
                    v-for="item in userList"
                    :key="item.userId"
                    :label="item.nickName"
                    :value="item.userId"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-card>
@@ -96,10 +116,7 @@
      <!-- æ“ä½œæŒ‰é’® -->
      <div class="toolbar">
        <el-button type="primary" @click="handleGenerate">生成工资表</el-button>
        <el-button @click="handleExport">导出</el-button>
        <el-button @click="handleImport">导入</el-button>
        <el-button @click="handleClear">清空</el-button>
        <el-button @click="openAddPerson">新增人员</el-button>
        <el-button @click="handleBatchDelete">删除</el-button>
        <el-button @click="handleTaxForm">个税表</el-button>
      </div>
@@ -182,6 +199,70 @@
              />
            </template>
          </el-table-column>
          <el-table-column label="其他支出" minWidth="110">
            <template #default="{ row }">
              <el-input
                v-model.number="row.otherDeduct"
                type="number"
                placeholder="0"
                size="small"
                @input="row.otherDeduct = parseNum(row.otherDeduct)"
              />
            </template>
          </el-table-column>
          <el-table-column label="工资个税" minWidth="110">
            <template #default="{ row }">
              <el-input
                v-model.number="row.salaryTax"
                type="number"
                placeholder="0"
                size="small"
                @input="row.salaryTax = parseNum(row.salaryTax)"
              />
            </template>
          </el-table-column>
          <el-table-column label="应发工资" minWidth="110">
            <template #default="{ row }">
              <el-input
                v-model.number="row.grossSalary"
                type="number"
                placeholder="0"
                size="small"
                @input="row.grossSalary = parseNum(row.grossSalary)"
              />
            </template>
          </el-table-column>
          <el-table-column label="应扣工资" minWidth="110">
            <template #default="{ row }">
              <el-input
                v-model.number="row.deductSalary"
                type="number"
                placeholder="0"
                size="small"
                @input="row.deductSalary = parseNum(row.deductSalary)"
              />
            </template>
          </el-table-column>
          <el-table-column label="实发工资" minWidth="110">
            <template #default="{ row }">
              <el-input
                v-model.number="row.netSalary"
                type="number"
                placeholder="0"
                size="small"
                @input="row.netSalary = parseNum(row.netSalary)"
              />
            </template>
          </el-table-column>
          <el-table-column label="备注" minWidth="120">
            <template #default="{ row }">
              <el-input
                v-model="row.remark"
                placeholder="请输入"
                size="small"
              />
            </template>
          </el-table-column>
          <el-table-column label="操作" width="80" align="center" fixed="right">
            <template #default="{ row }">
              <el-button type="primary" link @click="removeEmployee(row)">删除</el-button>
@@ -189,6 +270,10 @@
          </el-table-column>
        </el-table>
        <div v-if="!employeeList.length" class="table-empty">暂无数据</div>
        <div v-else class="salary-total">
          <span class="total-label">工资总额:</span>
          <span class="total-value">Â¥ {{ totalSalary.toFixed(2) }}</span>
        </div>
      </div>
    </div>
@@ -262,6 +347,8 @@
  staffSalaryMainUpdate,
  staffSalaryMainCalculateSalary,
} from "@/api/personnelManagement/staffSalaryMain.js";
import { userListNoPageByTenantId } from "@/api/system/user.js";
const emit = defineEmits(["update:modelValue", "close"]);
const props = defineProps({
@@ -287,6 +374,7 @@
const employeeList = ref([]);
const selectedEmployees = ref([]);
const bankOptions = ref([]);
const userList = ref([]);
const taxTableData = ref([
  { level: 1, range: "不超过36000元", rate: 3, quickDeduction: 0 },
  { level: 2, range: "超过36000-144000元", rate: 10, quickDeduction: 2520 },
@@ -312,14 +400,28 @@
    salaryMonth: "",
    remark: "",
    payBank: "",
    auditUserId: undefined,
  },
  rules: {
    salaryTitle: [{ required: true, message: "请输入工资主题", trigger: "blur" }],
    deptIds: [{ required: true, message: "请选择部门", trigger: "change" }],
    salaryMonth: [{ required: true, message: "请选择工资月份", trigger: "change" }],
    auditUserId: [{ required: true, message: "请选择审核人", trigger: "change" }],
  },
});
const { form, rules } = toRefs(data);
// è®¡ç®—工资总额(所有员工实发工资之和)
const totalSalary = computed(() => {
  return employeeList.value.reduce((sum, e) => sum + parseNum(e.netSalary), 0);
});
// æ ¹æ®å®¡æ ¸äººID获取审核人名称
const auditUserName = computed(() => {
  if (!form.value.auditUserId) return "";
  const user = userList.value.find(u => u.userId === form.value.auditUserId);
  return user ? user.nickName : "";
});
const loadBankOptions = () => {
  return bankList().then((res) => {
@@ -327,6 +429,12 @@
    bankOptions.value = list
      .map((b) => (b?.bankName == null ? "" : String(b.bankName).trim()))
      .filter((v) => v !== "");
  });
};
const loadUserList = () => {
  return userListNoPageByTenantId().then((res) => {
    userList.value = res.data || [];
  });
};
@@ -389,6 +497,7 @@
  nextTick(() => {
    loadDeptOptions();
    loadBankOptions();
    loadUserList();
    employeeList.value = [];
    Object.assign(form.value, {
      id: undefined,
@@ -397,6 +506,7 @@
      salaryMonth: "",
      remark: "",
      payBank: "",
      auditUserId: undefined,
    });
    // ç¼–辑:列表页已返回主表字段;这里只做回显(明细由“生成工资表/计算工资”得到)
    if (type === "edit" && row?.id) {
@@ -409,6 +519,30 @@
      form.value.salaryMonth = row.salaryMonth ?? "";
      form.value.remark = row.remark ?? "";
      form.value.payBank = row.payBank ?? "";
      form.value.auditUserId = row.auditUserId ?? undefined;
      // å¦‚果有员工明细数据,直接反显
      if (row.staffSalaryDetailList && row.staffSalaryDetailList.length > 0) {
        employeeList.value = row.staffSalaryDetailList.map((e) => ({
          staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
          id: e.staffOnJobId ?? e.staffId ?? e.id,
          staffName: e.staffName ?? "",
          postName: e.postName ?? "",
          deptName: e.deptName ?? "",
          basicSalary: parseNum(e.basicSalary),
          pieceSalary: parseNum(e.pieceSalary),
          hourlySalary: parseNum(e.hourlySalary),
          otherIncome: parseNum(e.otherIncome),
          socialPersonal: parseNum(e.socialPersonal),
          fundPersonal: parseNum(e.fundPersonal),
          otherDeduct: parseNum(e.otherDeduct),
          salaryTax: parseNum(e.salaryTax),
          grossSalary: parseNum(e.grossSalary),
          deductSalary: parseNum(e.deductSalary),
          netSalary: parseNum(e.netSalary),
          remark: e.remark ?? "",
        }));
      }
    }
  });
};
@@ -522,14 +656,6 @@
  });
};
const handleExport = () => {
  proxy.$modal.msgInfo("导出功能需对接后端");
};
const handleImport = () => {
  proxy.$modal.msgInfo("导入功能需对接后端");
};
const handleClear = () => {
  proxy.$modal.confirm("确定清空当前员工列表吗?").then(() => {
    employeeList.value = [];
@@ -543,44 +669,58 @@
const submitForm = () => {
  formRef.value?.validate((valid) => {
    if (!valid) return;
    const payload = {
      id: form.value.id,
      salaryTitle: form.value.salaryTitle,
      deptIds: form.value.deptIds?.length ? form.value.deptIds.join(",") : "",
      salaryMonth: form.value.salaryMonth,
      remark: form.value.remark,
      payBank: form.value.payBank,
      staffSalaryDetailList: employeeList.value.map((e) => ({
        staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
        staffName: e.staffName,
        postName: e.postName ?? "",
        deptName: e.deptName ?? "",
        basicSalary: parseNum(e.basicSalary),
        pieceSalary: parseNum(e.pieceSalary),
        hourlySalary: parseNum(e.hourlySalary),
        otherIncome: parseNum(e.otherIncome),
        socialPersonal: parseNum(e.socialPersonal),
        fundPersonal: parseNum(e.fundPersonal),
        otherDeduct: parseNum(e.otherDeduct),
        salaryTax: parseNum(e.salaryTax),
        grossSalary: parseNum(e.grossSalary),
        deductSalary: parseNum(e.deductSalary),
        netSalary: parseNum(e.netSalary),
        remark: e.remark ?? "",
      })),
    };
    if (props.operationType === "add") {
      staffSalaryMainAdd({ ...payload, status: 1 }).then(() => {
        proxy.$modal.msgSuccess("新增成功");
        closeDia();
      });
    } else {
      staffSalaryMainUpdate(payload).then(() => {
        proxy.$modal.msgSuccess("修改成功");
        closeDia();
      });
    }
    saveData(3); // ç¡®è®¤æäº¤ï¼ŒçŠ¶æ€ä¸º3(待审核)
  });
};
const saveDraft = () => {
  formRef.value?.validate((valid) => {
    if (!valid) return;
    saveData(1); // ä¿å­˜è‰ç¨¿ï¼ŒçŠ¶æ€ä¸º1(草稿)
  });
};
const saveData = (status) => {
  const payload = {
    id: form.value.id,
    salaryTitle: form.value.salaryTitle,
    deptIds: form.value.deptIds?.length ? form.value.deptIds.join(",") : "",
    salaryMonth: form.value.salaryMonth,
    remark: form.value.remark,
    payBank: form.value.payBank,
    auditUserId: form.value.auditUserId,
    auditUserName: auditUserName.value,
    totalSalary: totalSalary.value,
    staffSalaryDetailList: employeeList.value.map((e) => ({
      staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id,
      staffName: e.staffName,
      postName: e.postName ?? "",
      deptName: e.deptName ?? "",
      basicSalary: parseNum(e.basicSalary),
      pieceSalary: parseNum(e.pieceSalary),
      hourlySalary: parseNum(e.hourlySalary),
      otherIncome: parseNum(e.otherIncome),
      socialPersonal: parseNum(e.socialPersonal),
      fundPersonal: parseNum(e.fundPersonal),
      otherDeduct: parseNum(e.otherDeduct),
      salaryTax: parseNum(e.salaryTax),
      grossSalary: parseNum(e.grossSalary),
      deductSalary: parseNum(e.deductSalary),
      netSalary: parseNum(e.netSalary),
      remark: e.remark ?? "",
    })),
  };
  if (props.operationType === "add") {
    staffSalaryMainAdd({ ...payload, status }).then(() => {
      proxy.$modal.msgSuccess(status === 1 ? "草稿保存成功" : "提交成功");
      closeDia();
    });
  } else {
    staffSalaryMainUpdate({ ...payload, status }).then(() => {
      proxy.$modal.msgSuccess(status === 1 ? "草稿保存成功" : "提交成功");
      closeDia();
    });
  }
};
const closeDia = () => {
@@ -644,4 +784,21 @@
.dialog-footer {
  text-align: right;
}
.salary-total {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: #f5f7fa;
  border-radius: 4px;
  text-align: right;
  font-size: 16px;
}
.salary-total .total-label {
  color: #606266;
  margin-right: 8px;
}
.salary-total .total-value {
  color: #f56c6c;
  font-weight: bold;
  font-size: 18px;
}
</style>
src/views/personnelManagement/monthlyStatistics/index.vue
@@ -4,7 +4,7 @@
      <div>
        <span class="search_title">主题:</span>
        <el-input
          v-model="searchForm.title"
          v-model="searchForm.salaryTitle"
          style="width: 240px"
          placeholder="请输入主题"
          clearable
@@ -81,28 +81,18 @@
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="issueDialogVisible = false">取消</el-button>
        <el-button type="primary" :loading="issueLoading" @click="confirmIssue">
          ç¡®å®š
        </el-button>
        <el-button @click="issueDialogVisible = false">取消</el-button>
      </template>
    </el-dialog>
    <el-dialog v-model="auditDialogVisible" title="工资审核" width="720px">
      <el-form label-position="top">
        <el-form-item label="审核结果" required>
          <el-radio-group v-model="auditForm.result">
            <el-radio :value="4">通过</el-radio>
            <el-radio :value="2">不通过</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="auditDialogVisible = false">取消</el-button>
        <el-button type="primary" :loading="auditLoading" @click="confirmAudit">
          ç¡®å®š
        </el-button>
      </template>
    </el-dialog>
    <audit-dia
      v-model="auditDialogVisible"
      :row="auditRow"
      @close="auditDialogVisible = false"
      @success="handleAuditSuccess"
    />
  </div>
</template>
@@ -120,6 +110,7 @@
import Cookies from "js-cookie";
import FormDia from "./components/formDia.vue";
import BankSettingDia from "./components/bankSettingDia.vue";
import AuditDia from "./components/auditDia.vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import { bankList } from "@/api/personnelManagement/bank.js";
import {
@@ -130,7 +121,7 @@
const data = reactive({
  searchForm: {
    title: "",
    salaryTitle: "",
    status: "",
    salaryMonth: "",
  },
@@ -140,7 +131,22 @@
const tableColumn = ref([
  { label: "工资主题", prop: "salaryTitle", minWidth: 140 },
  { label: "工资月份", prop: "salaryMonth", width: 120 },
  { label: "状态", prop: "statusName", width: 110 },
  {
    label: "状态",
    prop: "statusName",
    width: 110,
    dataType: "tag",
    formatType: (status) => {
      const statusMap = {
        "草稿": "info",
        "审核未通过": "danger",
        "待审核": "warning",
        "待发放": "primary",
        "已发放": "success"
      };
      return statusMap[status] || "info";
    }
  },
  { label: "工资总额", prop: "totalSalary", width: 120 },
  { label: "支付银行", prop: "payBank", width: 120 },
  { label: "审核人", prop: "auditUserName", width: 110 },
@@ -155,19 +161,19 @@
      {
        name: "编辑",
        type: "text",
        showHide: (row) => Number(row?.status) === 1 || Number(row?.status) === 2,
        disabled: (row) => Number(row?.status) !== 1 && Number(row?.status) !== 2,
        clickFun: (row) => openForm("edit", row),
      },
      {
        name: "审核",
        type: "text",
        showHide: (row) => Number(row?.status) === 3,
        disabled: (row) => Number(row?.status) !== 3,
        clickFun: (row) => openAudit(row),
      },
      {
        name: "发放",
        type: "text",
        showHide: (row) => Number(row?.status) === 4,
        disabled: (row) => Number(row?.status) !== 4,
        clickFun: (row) => openIssue(row),
      },
    ],
@@ -195,9 +201,8 @@
const issueRow = ref(null);
const issueForm = reactive({ bank: "" });
const auditDialogVisible = ref(false);
const auditLoading = ref(false);
const auditRow = ref(null);
const auditForm = reactive({ result: 4 }); // 4=通过(待发放) 2=不通过
const auditDiaRef = ref(null);
const issueBankOptions = computed(() => {
  const options = Array.isArray(bankSetting.value?.options) ? bankSetting.value.options : [];
@@ -235,7 +240,7 @@
};
const handleReset = () => {
  searchForm.value.title = "";
  searchForm.value.salaryTitle = "";
  searchForm.value.status = "";
  searchForm.value.salaryMonth = "";
  page.current = 1;
@@ -258,6 +263,7 @@
    .then((res) => {
      tableLoading.value = false;
      const records = res.data?.records ?? res.data?.list ?? [];
      console.log('列表接口返回数据:', records);
      // å…¼å®¹åŽç«¯å­—段:若接口仍返回台账结构,可在此做映射
      tableData.value = records.map((item) => ({
        ...item,
@@ -293,9 +299,16 @@
};
const openAudit = (row) => {
  console.log('打开审核,传入的数据:', row);
  auditRow.value = row || null;
  auditForm.result = 4;
  auditDialogVisible.value = true;
  nextTick(() => {
    auditDiaRef.value?.openDialog(row);
  });
};
const handleAuditSuccess = () => {
  getList();
};
const openIssue = (row) => {
@@ -309,31 +322,7 @@
  issueDialogVisible.value = true;
};
const confirmAudit = () => {
  const row = auditRow.value;
  if (!row?.id) {
    auditDialogVisible.value = false;
    return;
  }
  const username = Cookies.get("username") || "";
  const userIdRaw = Cookies.get("userId");
  const auditUserId = userIdRaw ? Number(userIdRaw) : undefined;
  auditLoading.value = true;
  staffSalaryMainUpdate({
    id: row.id,
    status: Number(auditForm.result) === 2 ? 2 : 4,
    auditUserId,
    auditUserName: username,
  })
    .then(() => {
      proxy?.$modal?.msgSuccess?.("审核成功");
      auditDialogVisible.value = false;
      getList();
    })
    .finally(() => {
      auditLoading.value = false;
    });
};
const confirmIssue = () => {
  const bank = issueForm.bank ? String(issueForm.bank).trim() : "";
src/views/personnelManagement/socialSecuritySet/components/formDia.vue
@@ -200,6 +200,7 @@
  { label: "失业保险", value: "失业保险" },
  { label: "工伤保险", value: "工伤保险" },
  { label: "生育保险", value: "生育保险" },
  { label: "公积金", value: "公积金" },
];
const defaultBenefit = () => ({