spring
2026-05-25 0c4429a719f5c95a7690fae51efaaa799ef4e77d
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -39,6 +39,65 @@
                  </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">
                {{ currentStockIn.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="12">
          <el-form-item label="料号:">
            <el-tag type="info">
              {{ currentStockIn.materialCode || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="生产订单号:">
            <el-tag type="info">
              {{ currentStockIn.npsNo || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
            <!-- 审批人选择(动态节点) -->
            <el-row :gutter="30">
               <el-col :span="12">
@@ -104,7 +163,7 @@
                <h4>产品明细</h4>
                <el-table :data="currentQuotation.products || []" border style="width: 100%">
                  <el-table-column prop="product" label="产品名称" />
                  <el-table-column prop="specificationModel" label="规格型号" />
                  <el-table-column prop="specification" label="规格型号" />
                  <el-table-column prop="unit" label="单位" />
                  <el-table-column prop="unitPrice" label="单价">
                    <template #default="scope">¥{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template>
@@ -153,6 +212,7 @@
                <el-table :data="currentPurchase.productData || []" border style="width: 100%">
                  <el-table-column prop="productCategory" label="产品名称" />
                  <el-table-column prop="specificationModel" label="规格型号" />
                  <el-table-column prop="materialCode" label="料号" />
                  <el-table-column prop="unit" label="单位" />
                  <el-table-column prop="quantity" label="数量" />
                  <el-table-column prop="taxInclusiveUnitPrice" label="含税单价">
@@ -167,6 +227,42 @@
          </template>
        </el-skeleton>
      </div>
      <!-- 发货审批:展示对应产品信息 -->
      <div v-if="isShipmentApproval" style="margin: 10px 0 18px;">
        <el-divider content-position="left">产品信息</el-divider>
        <el-skeleton :loading="shipmentProductLoading" animated>
          <template #template>
            <el-skeleton-item variant="h3" style="width: 30%" />
            <el-skeleton-item variant="text" style="width: 100%" />
            <el-skeleton-item variant="text" style="width: 100%" />
          </template>
          <template #default>
            <el-empty
              v-if="!currentShipmentProduct || !currentShipmentProduct.id"
              description="未查询到对应产品信息"
            />
            <template v-else>
              <el-descriptions :column="2" border>
                <el-descriptions-item label="产品大类">
                  {{ currentShipmentProduct.productCategory || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="规格型号">
                  {{ currentShipmentProduct.specificationModel || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="单位">
                  {{ currentShipmentProduct.unit || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="数量">
                  {{ currentShipmentProduct.quantity ?? "-" }}
                </el-descriptions-item>
              </el-descriptions>
            </template>
          </template>
        </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">
@@ -196,10 +292,6 @@
              </div>
              <div v-if="!activity.isShen" class="node-reason">
                <span>审批意见:</span>{{ activity.approveNodeReason }}
              </div>
              <div v-if="!activity.isShen" class="node-reason">
                <span>签名:</span>
                        <img :src="activity.urlTem" class="signImg" alt="" v-if="activity.urlTem"/>
              </div>
              <div v-else-if="activity.isShen">
                <el-form-item
@@ -236,6 +328,8 @@
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";
import { getSalesProductById } from "@/api/salesManagement/salesLedger.js";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -257,8 +351,14 @@
const currentQuotation = ref({})
const purchaseLoading = ref(false)
const currentPurchase = ref({})
const stockInLoading = ref(false)
const currentStockIn = ref({})
const shipmentProductLoading = ref(false)
const currentShipmentProduct = ref({})
const isQuotationApproval = computed(() => Number(props.approveType) === 6)
const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
const isShipmentApproval = computed(() => Number(props.approveType) === 7)
const isInventoryApproval = computed(() => Number(props.approveType) === 9)
const data = reactive({
   form: {
@@ -268,6 +368,10 @@
      approveDeptId: "",
      approveReason: "",
      checkResult: "",
    inventoryReview: false,
    storageType: "",
    stockInNum: null,
    recordId: null,
   },
});
const { form } = toRefs(data);
@@ -299,6 +403,8 @@
  dialogFormVisible.value = true;
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
  currentShipmentProduct.value = {}
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
@@ -359,6 +465,48 @@
    }
  }
  // 发货审批:根据审批列表中的 recordId 查询对应产品详情
  if (isShipmentApproval.value) {
    const recordId = row?.recordId;
    form.value.recordId = recordId ?? form.value.recordId;
    if (recordId) {
      shipmentProductLoading.value = true;
      getSalesProductById({ id: recordId })
        .then((res) => {
          currentShipmentProduct.value = res?.data || res || {};
        })
        .catch((err) => {
          console.error("查询发货产品详情失败:", err);
          proxy.$modal.msgError("查询发货产品详情失败");
        })
        .finally(() => {
          shipmentProductLoading.value = false;
        });
    }
  }
  // 入库审批:根据 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字段
@@ -396,6 +544,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(() => {
@@ -411,6 +567,10 @@
  currentQuotation.value = {}
  purchaseLoading.value = false
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  shipmentProductLoading.value = false
  currentShipmentProduct.value = {}
  emit('close')
};
defineExpose({
@@ -449,4 +609,4 @@
   width: 200px;
   height: 60px;
}
</style>
</style>