spring
2026-05-25 0c4429a719f5c95a7690fae51efaaa799ef4e77d
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -83,8 +83,14 @@
        </el-col>
      </el-row>
      <el-row v-if="isInventoryApproval">
        <el-col :span="24">
        <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 || '-' }}
@@ -206,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="含税单价">
@@ -216,6 +223,40 @@
                  </el-table-column>
                </el-table>
              </div>
            </template>
          </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>
@@ -288,6 +329,7 @@
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()
@@ -311,8 +353,11 @@
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({
@@ -359,6 +404,7 @@
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
  currentShipmentProduct.value = {}
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
@@ -416,6 +462,26 @@
      }).finally(() => {
        purchaseLoading.value = false
      })
    }
  }
  // 发货审批:根据审批列表中的 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;
        });
    }
  }
@@ -503,6 +569,8 @@
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  shipmentProductLoading.value = false
  currentShipmentProduct.value = {}
  emit('close')
};
defineExpose({
@@ -541,4 +609,4 @@
   width: 200px;
   height: 60px;
}
</style>
</style>