fix: 入库前需加上仓库管理员审审批这一流程,审核通过后才能入库。另外在消息通知中需要展示这个审批信息
已修改5个文件
203 ■■■■■ 文件已修改
src/api/inventoryManagement/stockInRecord.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/Record.vue 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockInRecord.js
@@ -9,6 +9,14 @@
    });
};
// 根据 ID 查询单条入库记录详情
export const getStockInRecordById = (id) => {
    return request({
        url: "/stockInRecord/getById",
        method: "get",
        params: { id },
    });
};
export const updateStockInRecord = (id, data) => {
    return request({
@@ -18,6 +26,15 @@
    });
};
// 重新提起审批(更新入库记录)
export const updateStockInRecordForReApprove = (data) => {
    return request({
        url: "/stocklnRecord/updateStocklnRecord",
        method: "post",
        data,
    });
};
export const batchDeleteStockInRecords = (ids) => {
    return request({
        url: "/stockInRecord",
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -39,6 +39,59 @@
                        </el-form-item>
                    </el-col>
                </el-row>
        <!-- 入库审批:展示入库信息 -->
        <!-- <el-row v-if="isInventoryApproval">
          <el-col :span="24">
            <el-form-item label="是否入库审核通过:">
              <el-tag :type="form.inventoryReview ? 'success' : 'danger'">
                {{ form.inventoryReview ? '是' : '否' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row v-if="isInventoryApproval">
          <el-col :span="12">
            <el-form-item label="入库类型:">
              <el-tag type="info">
                {{ form.storageType || '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入库数量:">
              <el-tag type="warning">
                {{ form.stockInNum ?? '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 入库审批:展示入库台账明细(字段形式) -->
      <el-row v-if="isInventoryApproval" style="margin-top: 10px">
        <el-col :span="12">
          <el-form-item label="产品名称:">
            <el-tag type="info">
              {{ currentStockIn.productName || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="规格型号:">
            <el-tag type="info">
              {{ currentStockIn.model || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="isInventoryApproval">
        <el-col :span="24">
          <el-form-item label="生产订单号:">
            <el-tag type="info">
              {{ currentStockIn.productionOrderNo || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
                <!-- 审批人选择(动态节点) -->
                <el-row :gutter="30">
                    <el-col :span="12">
@@ -168,6 +221,8 @@
        </el-skeleton>
      </div>
      <el-form :model="{ activities }" ref="formRef" label-position="top">
        <el-steps :active="getActiveStep()" finish-status="success" process-status="process" align-center direction="vertical">
          <el-step
@@ -232,6 +287,7 @@
import { WarningFilled, Edit, Check, MoreFilled } from '@element-plus/icons-vue'
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
import { getStockInRecordById } from "@/api/inventoryManagement/stockInRecord.js";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -253,8 +309,11 @@
const currentQuotation = ref({})
const purchaseLoading = ref(false)
const currentPurchase = ref({})
const stockInLoading = ref(false)
const currentStockIn = ref({})
const isQuotationApproval = computed(() => Number(props.approveType) === 6)
const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
const isInventoryApproval = computed(() => Number(props.approveType) === 9)
const data = reactive({
    form: {
@@ -264,6 +323,10 @@
        approveDeptId: "",
        approveReason: "",
        checkResult: "",
    inventoryReview: false,
    storageType: "",
    stockInNum: null,
    recordId: null,
    },
});
const { form } = toRefs(data);
@@ -295,6 +358,7 @@
  dialogFormVisible.value = true;
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
    userListNoPageByTenantId().then((res) => {
        userList.value = res.data;
    });
@@ -355,6 +419,28 @@
    }
  }
  // 入库审批:根据 recordId 查询入库台账详情
  if (isInventoryApproval.value) {
    const recordId = row?.recordId;
    form.value.recordId = recordId ?? form.value.recordId;
    form.value.inventoryReview = row?.inventoryReview ?? form.value.inventoryReview;
    form.value.storageType = row?.storageType ?? form.value.storageType;
    if (recordId) {
      stockInLoading.value = true;
      getStockInRecordById(recordId)
        .then((res) => {
          currentStockIn.value = res?.data || res || {};
        })
        .catch((err) => {
          console.error("查询入库记录失败:", err);
          proxy.$modal.msgError("查询入库记录失败");
        })
        .finally(() => {
          stockInLoading.value = false;
        });
    }
  }
  approveProcessDetails(row.approveId).then((res) => {
    activities.value = res.data
    // 增加isApproval字段
@@ -392,6 +478,14 @@
    return;
  }
  currentActivity.approveNodeStatus = status;
  // 始终带上当前审批类型(入库审批为 9)
  currentActivity.approveType = Number(props.approveType);
  // 入库审批:把入库相关字段写入当前节点
  if (isInventoryApproval.value) {
    currentActivity.recordId = form.value.recordId;
    currentActivity.storageType = form.value.storageType;
    currentActivity.inventoryReview = status === 1;
  }
  // 判断是否为最后一步
  const isLast = activities.value.findIndex(a => a.isShen) === activities.value.length-1;
  updateApproveNode({ ...currentActivity, isLast }).then(() => {
@@ -407,6 +501,8 @@
  currentQuotation.value = {}
  purchaseLoading.value = false
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  emit('close')
};
defineExpose({
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -243,7 +243,10 @@
    startDate: "", // 请假开始时间
    endDate: "", // 请假结束时间
    price: null, // 报销金额
    location: "" // 出差地点
    location: "", // 出差地点
    inventoryReview: false, // 入库是否审核通过
    storageType: "",       // 入库类型(合格/不合格)
    recordId: null,        // 入库记录ID
  },
  rules: {
    approveTime: [{ required: false, message: "请输入", trigger: "change" },],
@@ -316,6 +319,10 @@
        currentApproveStatus.value = row.approveStatus
    approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => {
            form.value = {...res.data}
      // 确保入库审批相关字段从列表行透传进来
      form.value.recordId = row.recordId ?? form.value.recordId
      form.value.inventoryReview = row.inventoryReview ?? form.value.inventoryReview
      form.value.storageType = row.storageType ?? form.value.storageType
      // 反显审批人
      if (res.data && res.data.approveUserIds) {
        const userIds = res.data.approveUserIds.split(',')
@@ -365,6 +372,13 @@
  // 收集所有节点的审批人id
  form.value.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
  form.value.approveType = props.approveType
  // 入库审批:直接透传入库相关字段(由外部预先填充)
  if (props.approveType == 9) {
    // 确保布尔类型正确
    form.value.inventoryReview = !!form.value.inventoryReview
    // storageType、recordId 按照查出来的数据原样带给后台
  }
  // 审批人必填校验
  const hasEmptyApprover = approverNodes.value.some(node => !node.userId)
  if (hasEmptyApprover) {
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -9,6 +9,7 @@
      <el-tab-pane label="采购审批" name="5"></el-tab-pane>
      <el-tab-pane label="报价审批" name="6"></el-tab-pane>
      <el-tab-pane label="发货审批" name="7"></el-tab-pane>
      <el-tab-pane label="入库审批" name="9"></el-tab-pane>
    </el-tabs>
    
    <div class="search_form">
@@ -38,14 +39,14 @@
        <el-button
          type="primary"
          @click="openForm('add')"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
        >新增</el-button>
        <el-button @click="handleOut">导出</el-button>
        <el-button
          type="danger"
          plain
          @click="handleDelete"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
        >删除</el-button>
      </div>
    </div>
@@ -212,6 +213,7 @@
        currentApproveType.value === 5 ||
        currentApproveType.value === 6 ||
        currentApproveType.value === 7 ||
        currentApproveType.value === 9 ||
        row.approveStatus == 2 ||
        row.approveStatus == 1 ||
        row.approveStatus == 4
@@ -310,6 +312,7 @@
    5: "/approveProcess/exportFive",
    6: "/approveProcess/exportSix",
    7: "/approveProcess/exportSeven",
    9: "/approveProcess/exportNine",
  }
  const url = urlMap[type] || urlMap[0]
  const nameMap = {
@@ -321,6 +324,7 @@
    5: "采购申请审批表",
    6: "报价审批表",
    7: "发货审批表",
    9: "入库审批表",
  }
  const fileName = nameMap[type] || nameMap[0]
  proxy.download(url, {}, `${fileName}.xlsx`)
src/views/inventoryManagement/receiptManagement/Record.vue
@@ -73,6 +73,25 @@
        <el-table-column label="入库数量"
                         prop="stockInNum"
                         show-overflow-tooltip/>
        <el-table-column label="审批状态"
                         prop="approveStatus"
                         align="center"
                         width="180">
          <template #default="scope">
            <el-tag :type="getApproveStatusType(scope.row.approveStatus)">
              {{ getApproveStatusText(scope.row.approveStatus) }}
            </el-tag>
            <el-button
              v-if="scope.row.approveStatus === 3"
              type="primary"
              link
              style="margin-left: 8px"
              @click="handleReApprove(scope.row)"
            >
              重新提起审批
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="入库人"
                         prop="createBy"
                         show-overflow-tooltip/>
@@ -107,6 +126,7 @@
import {
  getStockInRecordListPage,
  batchDeleteStockInRecords,
  updateStockInRecordForReApprove,
} from "@/api/inventoryManagement/stockInRecord.js";
import {
  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
@@ -152,6 +172,24 @@
  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
const getApproveStatusText = (status) => {
  if (status === 0) return "待审核";
  if (status === 1) return "审核中";
  if (status === 2) return "审核完成";
  if (status === 3) return "审核未通过";
  if (status === 4) return "已重新提交";
  return "-";
};
const getApproveStatusType = (status) => {
  if (status === 0) return "warning";
  if (status === 1) return "primary";
  if (status === 2) return "success";
  if (status === 3) return "danger";
  if (status === 4) return "info";
  return "";
};
const pageProductChange = obj => {
  page.current = obj.page;
  page.size = obj.limit;
@@ -195,6 +233,34 @@
const expandedRowKeys = ref([]);
const handleReApprove = (row) => {
  if (!row || !row.id) {
    return;
  }
  ElMessageBox.confirm(
    "该记录审核未通过,是否重新提起入库审批?",
    "重新提起审批",
    {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    }
  )
    .then(() => {
      updateStockInRecordForReApprove({ ...row })
        .then(() => {
          proxy.$modal.msgSuccess("已重新发起审批");
          getList();
        })
        .catch(() => {
          proxy.$modal.msgError("重新发起审批失败");
        });
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
// 导出
const handleOut = () => {
  ElMessageBox.confirm("是否确认导出?", "导出", {