buhuazhen
2026-06-02 a1569c557f684e2c77d6c0dabd396d44226ec1f7
feat: 班组成员选择只能在排产人员以及工序人员组里面选择
已修改1个文件
34 ■■■■ 文件已修改
src/views/productionManagement/workOrder/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue
@@ -543,6 +543,23 @@
  return ids.includes(uid);
};
// 判断当前用户是否在工序报工人中
const isCurrentUserInProcessUserIds = (row) => {
  const uid = String(currentUserId.value || "");
  if (!uid) return false;
  const ids = normalizeArray(row?.processUserIds)
      .map(id => String(id))
      .filter(Boolean);
  return ids.includes(uid);
};
// 判断当前用户是否可以报工(工单报工人 或 工序报工人)
const canCurrentUserReport = (row) => {
  return isCurrentUserInUserIds(row) || isCurrentUserInProcessUserIds(row);
};
const canOperateByReportWorker = computed(() => {
  return (row) => isCurrentUserReportWorker(row);
});
@@ -1071,9 +1088,9 @@
        clickFun: row => {
          showReportDialog(row);
        },
        // // 用户当前id
        // 用户当前id在工单报工人或工序报工人中
        disabled: row => row.completeQuantity >= row.planQuantity ||
            !isCurrentUserInUserIds(row) || row.hasUnreportedMachine
            !canCurrentUserReport(row) || row.hasUnreportedMachine
      },
      {
        name: "生产排产",
@@ -1471,13 +1488,18 @@
  reportForm.addQty = 0;
  reportForm.userIds = row.userIds || [];
  const ids = (row.userIds || "")
      .split(",")
      .map(id => id.trim())
  // 合并工单报工人和工序报工人,去重
  const workOrderUserIds = normalizeArray(row.userIds)
      .map(id => String(id).trim())
      .filter(Boolean);
  const processUserIds = normalizeArray(row.processUserIds)
      .map(id => String(id).trim())
      .filter(Boolean);
  const allowedUserIds = [...new Set([...workOrderUserIds, ...processUserIds])];
  // 只允许选择工单报工人和工序报工人
  reportForm.userIdsList = userTeamOptions.value
      // .filter(item => ids.includes(String(item.userId)))
      .filter(item => allowedUserIds.includes(String(item.userId)))
      .map(item => ({
        userId: item.userId,
        nickName: item.nickName