huminmin
2026-07-13 61939d6a198a44de2f51193e3b4500d78b16b506
修改生产核算
已修改2个文件
80 ■■■■■ 文件已修改
src/api/productionManagement/productionCosting.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionCosting/index.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productionManagement/productionCosting.js
@@ -29,3 +29,21 @@
    params: query,
  });
}
// 批量核算
export function productionAccountingBatchAccounting(data) {
  return request({
    url: "/productionAccount/batchAccounting",
    method: "post",
    data,
  });
}
// 单个修正
export function productionAccountingSingleAdjust(data) {
  return request({
    url: "/productionAccount/singleAdjust",
    method: "post",
    data,
  });
}
src/views/productionManagement/productionCosting/index.vue
@@ -95,10 +95,13 @@
               title="单个修正"
               width="520px">
      <el-form :model="adjustForm" label-width="120px">
        <el-form-item label="报工单号">
          <el-input v-model="adjustForm.reportNo" disabled />
        </el-form-item>
        <el-form-item label="报工人员">
          <el-input v-model="adjustForm.schedulingUserName" disabled />
        </el-form-item>
        <el-form-item label="工资">
        <el-form-item label="修正金额">
          <el-input-number v-model="adjustForm.wages" :min="0" :precision="2" style="width: 100%" />
        </el-form-item>
        <el-form-item label="修正说明">
@@ -120,6 +123,8 @@
  import {
    salesLedgerProductionAccountingListProductionDetails,
    salesLedgerProductionAccountingList,
    productionAccountingBatchAccounting,
    productionAccountingSingleAdjust,
  } from "@/api/productionManagement/productionCosting.js";
  const { proxy } = getCurrentInstance();
@@ -147,7 +152,7 @@
    },
    {
      label: "审核状态",
      prop: "auditStatusName",
      prop: "auditStatus",
      minWidth: 100,
      dataType: "tag",
      formatData: val => formatTag(val, {
@@ -166,7 +171,7 @@
    },
    {
      label: "报工类型",
      prop: "reportTypeName",
      prop: "reportType",
      minWidth: 100,
      dataType: "tag",
      formatData: val => formatTag(val, {
@@ -235,6 +240,11 @@
      prop: "wages",
      minWidth: 100,
    },
    {
      label: "修正说明",
      prop: "adjustRemark",
      minWidth: 160,
    },
  ]);
  // 左侧汇总台账列(生产人、产量、工资、合格率)
@@ -273,6 +283,7 @@
  const adjustDialogVisible = ref(false);
  const adjustForm = reactive({
    id: null,
    reportNo: "",
    schedulingUserName: "",
    wages: 0,
    remark: "",
@@ -436,9 +447,9 @@
    })
      .then(() => {
        proxy.download(
          "/salesLedger/productionAccounting/export",
          "/productionAccount/exportSalarySlip",
          { ...searchForm.value },
          "生产核算.xlsx"
          "生产工资条.xlsx"
        );
      })
      .catch(() => {
@@ -447,7 +458,22 @@
  };
  const handleBatchAccounting = () => {
    proxy.$modal.msgWarning("当前页面已按审核通过的合格报工汇总工资,批量核算接口后续可直接接入。");
    ElMessageBox.confirm("确定要按当前筛选条件执行批量核算吗?", "批量核算", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        const { dateRange, ...batchPayload } = searchForm.value;
        return productionAccountingBatchAccounting(batchPayload);
      })
      .then(() => {
        proxy.$modal.msgSuccess("批量核算成功");
        reloadData();
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
  };
  const handleSingleAdjust = () => {
@@ -461,6 +487,7 @@
    }
    const row = selectedRows.value[0];
    adjustForm.id = row.id;
    adjustForm.reportNo = row.reportNo || "";
    adjustForm.schedulingUserName = row.schedulingUserName || "";
    adjustForm.wages = Number(row.wages || 0);
    adjustForm.remark = "";
@@ -468,8 +495,27 @@
  };
  const confirmAdjust = () => {
    proxy.$modal.msgSuccess("已保存修正说明,后续可接入工资修正接口。");
    adjustDialogVisible.value = false;
    const selectedRow = selectedRows.value[0];
    if (!selectedRow || !selectedRow.userId) {
      proxy.$modal.msgWarning("当前记录缺少报工人员信息,无法修正");
      return;
    }
    if (!adjustForm.wages && adjustForm.wages !== 0) {
      proxy.$modal.msgWarning("请输入修正金额");
      return;
    }
    productionAccountingSingleAdjust({
      productionProductMainId: adjustForm.id,
      schedulingUserId: selectedRow.userId,
      schedulingUserName: adjustForm.schedulingUserName,
      adjustAmount: adjustForm.wages,
      adjustRemark: adjustForm.remark,
      adjustUser: proxy.$store?.state?.user?.userId || undefined,
    }).then(() => {
      proxy.$modal.msgSuccess("修正成功");
      adjustDialogVisible.value = false;
      reloadData();
    }).catch(() => {});
  };
  const handleRowAdjust = row => {