<!--
|
协同审批 / 业务单据详情
|
approveType 5=采购 6=报价 7=发货,单据号取表单「审批事由」字段承载的编号
|
-->
|
<template>
|
<view class="business-detail">
|
<!-- 报价审批详情 -->
|
<view v-if="isQuotationApproval"
|
class="business-detail-block">
|
<u-divider text="报价详情"
|
text-size="28rpx"
|
color="#2979ff"></u-divider>
|
<u-skeleton :loading="quotationLoading"
|
rows="3"
|
animated>
|
<view v-if="!currentQuotation || !currentQuotation.quotationNo"
|
class="business-detail-empty">
|
未查询到对应报价详情
|
</view>
|
<view v-else>
|
<u-cell-group :border="false">
|
<u-cell title="报价单号"
|
:value="currentQuotation.quotationNo"></u-cell>
|
<u-cell title="客户名称"
|
:value="currentQuotation.customer"></u-cell>
|
<u-cell title="业务员"
|
:value="currentQuotation.salesperson"></u-cell>
|
<u-cell title="报价日期"
|
:value="currentQuotation.quotationDate"></u-cell>
|
<u-cell title="有效期至"
|
:value="currentQuotation.validDate"></u-cell>
|
<u-cell title="付款方式"
|
:value="currentQuotation.paymentMethod"></u-cell>
|
<u-cell title="报价总额">
|
<template #value>
|
<text class="business-detail-amount">
|
¥{{ Number(currentQuotation.totalAmount ?? 0).toFixed(2) }}
|
</text>
|
</template>
|
</u-cell>
|
</u-cell-group>
|
<view class="business-detail-products">
|
<view class="business-detail-subtitle">产品明细</view>
|
<view v-for="(item, index) in (currentQuotation.products || [])"
|
:key="index"
|
class="business-detail-item">
|
<view class="business-detail-item-head">
|
<text class="business-detail-item-name">{{ item.product }}</text>
|
<text class="business-detail-amount">¥{{ Number(item.unitPrice ?? 0).toFixed(2) }}</text>
|
</view>
|
<view class="business-detail-item-desc">
|
规格: {{ item.specification }} | 单位: {{ item.unit }}
|
</view>
|
</view>
|
</view>
|
<view v-if="currentQuotation.remark"
|
class="business-detail-remark">
|
<view class="business-detail-subtitle">备注</view>
|
<view class="business-detail-remark-text">{{ currentQuotation.remark }}</view>
|
</view>
|
</view>
|
</u-skeleton>
|
</view>
|
|
<!-- 采购审批详情 -->
|
<view v-if="isPurchaseApproval"
|
class="business-detail-block">
|
<u-divider text="采购详情"
|
text-size="28rpx"
|
color="#2979ff"></u-divider>
|
<u-skeleton :loading="purchaseLoading"
|
rows="3"
|
animated>
|
<view v-if="!currentPurchase || !currentPurchase.purchaseContractNumber"
|
class="business-detail-empty">
|
未查询到对应采购详情
|
</view>
|
<view v-else>
|
<u-cell-group :border="false">
|
<u-cell title="采购合同号"
|
:value="currentPurchase.purchaseContractNumber"></u-cell>
|
<u-cell title="供应商名称"
|
:value="currentPurchase.supplierName"></u-cell>
|
<u-cell title="项目名称"
|
:value="currentPurchase.projectName"></u-cell>
|
<u-cell title="销售合同号"
|
:value="currentPurchase.salesContractNo"></u-cell>
|
<u-cell title="签订日期"
|
:value="currentPurchase.executionDate"></u-cell>
|
<u-cell title="录入日期"
|
:value="currentPurchase.entryDate"></u-cell>
|
<u-cell title="付款方式"
|
:value="currentPurchase.paymentMethod"></u-cell>
|
<u-cell title="合同金额">
|
<template #value>
|
<text class="business-detail-amount">
|
¥{{ Number(currentPurchase.contractAmount ?? 0).toFixed(2) }}
|
</text>
|
</template>
|
</u-cell>
|
</u-cell-group>
|
<view class="business-detail-products">
|
<view class="business-detail-subtitle">产品明细</view>
|
<view v-for="(item, index) in (currentPurchase.productData || [])"
|
:key="index"
|
class="business-detail-item">
|
<view class="business-detail-item-head">
|
<text class="business-detail-item-name">{{ item.productCategory }}</text>
|
<text class="business-detail-amount">¥{{ Number(item.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</text>
|
</view>
|
<view class="business-detail-item-desc">
|
规格: {{ item.specificationModel }} | 数量: {{ item.quantity }} {{ item.unit }}
|
</view>
|
<view class="business-detail-item-extra">
|
含税单价: ¥{{ Number(item.taxInclusiveUnitPrice ?? 0).toFixed(2) }}
|
</view>
|
</view>
|
</view>
|
</view>
|
</u-skeleton>
|
</view>
|
|
<!-- 发货审批详情 -->
|
<view v-if="isDeliveryApproval"
|
class="business-detail-block">
|
<u-divider text="发货详情"
|
text-size="28rpx"
|
color="#2979ff"></u-divider>
|
<u-skeleton :loading="deliveryLoading"
|
rows="3"
|
animated>
|
<view v-if="!currentDelivery || !currentDelivery.shippingInfo"
|
class="business-detail-empty">
|
未查询到对应发货详情
|
</view>
|
<view v-else>
|
<u-cell-group :border="false">
|
<u-cell title="销售订单"
|
:value="currentDelivery.shippingInfo.salesContractNo || '--'"></u-cell>
|
<u-cell title="发货订单号"
|
:value="currentDelivery.shippingInfo.shippingNo || '--'"></u-cell>
|
<u-cell title="客户名称"
|
:value="currentDelivery.shippingInfo.customerName || '--'"></u-cell>
|
<u-cell title="发货类型"
|
:value="currentDelivery.shippingInfo.type || '--'"></u-cell>
|
<u-cell title="发货日期"
|
:value="currentDelivery.shippingInfo.shippingDate || '--'"></u-cell>
|
<u-cell title="审核状态"
|
:value="currentDelivery.shippingInfo.status || '--'"></u-cell>
|
<u-cell title="发货车牌号"
|
:value="currentDelivery.shippingInfo.shippingCarNumber || '--'"></u-cell>
|
<u-cell title="快递公司"
|
:value="currentDelivery.shippingInfo.expressCompany || '--'"></u-cell>
|
<u-cell title="快递单号"
|
:value="currentDelivery.shippingInfo.expressNumber || '--'"></u-cell>
|
</u-cell-group>
|
<view class="business-detail-products">
|
<view class="business-detail-subtitle">产品明细</view>
|
<view v-for="(item, index) in deliveryProductList"
|
:key="index"
|
class="business-detail-item">
|
<view class="business-detail-item-head">
|
<text class="business-detail-item-name">{{ item.productName }}</text>
|
<text class="business-detail-count">数量: {{ item.deliveryQuantity }}</text>
|
</view>
|
<view class="business-detail-item-desc">
|
规格: {{ item.specificationModel }}
|
</view>
|
<view v-if="item.batchNo"
|
class="business-detail-item-extra">
|
批号: {{ item.batchNo }}
|
</view>
|
</view>
|
</view>
|
<view v-if="currentDelivery.shippingInfo.storageBlobVOs && currentDelivery.shippingInfo.storageBlobVOs.length"
|
class="business-detail-remark">
|
<view class="business-detail-subtitle">发货图片</view>
|
<CommonUpload :model-value="currentDelivery.shippingInfo.storageBlobVOs"
|
disabled />
|
</view>
|
</view>
|
</u-skeleton>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { computed, ref, watch } from "vue";
|
import CommonUpload from "@/components/CommonUpload.vue";
|
import { getDeliveryDetailByShippingNo } from "@/api/collaborativeApproval/approvalProcess";
|
import { getQuotationList } from "@/api/salesManagement/salesQuotation";
|
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger";
|
|
const props = defineProps({
|
/** 审批类型:5 采购 / 6 报价 / 7 发货 */
|
approveType: { type: [Number, String], default: 0 },
|
/** 业务单据编号(表单「审批事由」承载) */
|
businessNo: { type: String, default: "" },
|
});
|
|
const type = computed(() => Number(props.approveType));
|
const isQuotationApproval = computed(() => type.value === 6);
|
const isPurchaseApproval = computed(() => type.value === 5);
|
const isDeliveryApproval = computed(() => type.value === 7);
|
|
const quotationLoading = ref(false);
|
const currentQuotation = ref({});
|
const purchaseLoading = ref(false);
|
const currentPurchase = ref({});
|
const deliveryLoading = ref(false);
|
const currentDelivery = ref({});
|
const deliveryProductList = ref([]);
|
|
const fetchDetailData = async () => {
|
const no = (props.businessNo || "").trim();
|
if (!no) return;
|
|
if (isQuotationApproval.value) {
|
quotationLoading.value = true;
|
getQuotationList({ quotationNo: no })
|
.then(res => {
|
const records = res?.data?.records || [];
|
currentQuotation.value = records[0] || {};
|
})
|
.catch(() => {
|
currentQuotation.value = {};
|
})
|
.finally(() => {
|
quotationLoading.value = false;
|
});
|
return;
|
}
|
|
if (isPurchaseApproval.value) {
|
purchaseLoading.value = true;
|
getPurchaseByCode({ purchaseContractNumber: no })
|
.then(res => {
|
currentPurchase.value = res?.data || res || {};
|
})
|
.catch(() => {
|
currentPurchase.value = {};
|
})
|
.finally(() => {
|
purchaseLoading.value = false;
|
});
|
return;
|
}
|
|
if (isDeliveryApproval.value) {
|
deliveryLoading.value = true;
|
currentDelivery.value = {};
|
deliveryProductList.value = [];
|
getDeliveryDetailByShippingNo({ shippingNo: no })
|
.then(res => {
|
const detailData = res?.data || res || {};
|
currentDelivery.value = detailData;
|
deliveryProductList.value =
|
detailData.shippingProductDetailDtoList || [];
|
})
|
.catch(() => {
|
currentDelivery.value = {};
|
deliveryProductList.value = [];
|
})
|
.finally(() => {
|
deliveryLoading.value = false;
|
});
|
}
|
};
|
|
watch(
|
() => [props.approveType, props.businessNo],
|
() => {
|
currentQuotation.value = {};
|
currentPurchase.value = {};
|
currentDelivery.value = {};
|
deliveryProductList.value = [];
|
fetchDetailData();
|
},
|
{ immediate: true }
|
);
|
</script>
|
|
<style scoped lang="scss">
|
.business-detail-block {
|
margin: 20rpx 0;
|
}
|
|
.business-detail-empty {
|
padding: 40rpx;
|
text-align: center;
|
color: #999;
|
}
|
|
.business-detail-amount {
|
font-size: 32rpx;
|
color: #e6a23c;
|
font-weight: bold;
|
}
|
|
.business-detail-count {
|
color: #2979ff;
|
}
|
|
.business-detail-products {
|
margin-top: 20rpx;
|
padding: 0 30rpx;
|
}
|
|
.business-detail-subtitle {
|
font-size: 28rpx;
|
font-weight: bold;
|
margin-bottom: 10rpx;
|
}
|
|
.business-detail-item {
|
background: #f8f8f8;
|
border-radius: 8rpx;
|
padding: 20rpx;
|
margin-bottom: 10rpx;
|
}
|
|
.business-detail-item-head {
|
display: flex;
|
justify-content: space-between;
|
}
|
|
.business-detail-item-name {
|
font-weight: bold;
|
}
|
|
.business-detail-item-desc {
|
font-size: 24rpx;
|
color: #666;
|
margin-top: 10rpx;
|
}
|
|
.business-detail-item-extra {
|
font-size: 24rpx;
|
color: #999;
|
margin-top: 4rpx;
|
}
|
|
.business-detail-remark {
|
margin-top: 20rpx;
|
padding: 0 30rpx;
|
}
|
|
.business-detail-remark-text {
|
font-size: 26rpx;
|
color: #666;
|
margin-top: 10rpx;
|
}
|
</style>
|