spring
2025-11-29 057c13502ecedf49d85d47ab23f3492859f16653
fix: 技术文件变更时,生产就不能继续报工了。
已修改4个文件
48 ■■■■■ 文件已修改
src/api/product/twist.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/product/wire.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/detail/twistDetail.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/detail/wireDetail.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/product/twist.ts
@@ -141,6 +141,15 @@
      method: "POST",
    });
  },
  // 验证变更
  verifyChanges(params: { projectId: number | string }) {
    return request<BaseResult<any>>({
      url: "/app/verifyChanges",
      method: "GET",
      data: params,
    });
  },
};
export default TwistApi;
src/api/product/wire.ts
@@ -72,6 +72,15 @@
      method: "DELETE",
    });
  },
  // 验证变更
  verifyChanges(params: { projectId: number | string }) {
    return request<BaseResult<any>>({
      url: "/app/verifyChanges",
      method: "GET",
      data: params,
    });
  },
};
export default WireApi;
src/pages/production/detail/twistDetail.vue
@@ -53,11 +53,13 @@
  amount: undefined,
  unAmount: undefined,
});
const detailData = ref<any>({});
const getDetailData = async (id: string) => {
  const { data } = await TwistApi.getTwistDetailById({
    id: id,
  });
  detailData.value = data;
  cardData.deviceModel = data.deviceModel;
  cardData.model = data.model;
  cardData.systemNo = data.systemNo;
@@ -84,7 +86,18 @@
};
// 处理报工点击
const handleReportClick = () => {
const handleReportClick = async () => {
  // 先请求验证变更接口
  try {
    const { code } = await TwistApi.verifyChanges({ projectId: detailData.value.projectId });
    if (code !== 200) {
      return;
    }
  } catch (error) {
    console.error("验证变更失败:", error);
    return;
  }
  const prepareId = getPrepareId();
  console.log("绞线表格报工检查 - prepareId值:", prepareId);
src/pages/production/detail/wireDetail.vue
@@ -59,11 +59,13 @@
  contractNo: undefined,
  type: "拉丝",
});
const detailData = ref<any>({});
const getDetailData = async (id: string) => {
  const { data } = await WireApi.getWireDetailById({
    id: id,
  });
  detailData.value = data;
  cardData.deviceModel = data.deviceModel;
  cardData.model = data.model;
  cardData.systemNo = data.systemNo;
@@ -94,7 +96,18 @@
};
// 处理报工点击
const handleReportClick = () => {
const handleReportClick = async () => {
  // 先请求验证变更接口
  try {
    const { code } = await WireApi.verifyChanges({ projectId: detailData.value.projectId });
    if (code !== 200) {
      return;
    }
  } catch (error) {
    console.error("验证变更失败:", error);
    return;
  }
  const prepareId = getPrepareId();
  console.log("拉丝表格报工检查 - prepareId值:", prepareId);