<template>
|
<view class="receipt-payment-detail">
|
<!-- 使用通用页面头部组件 -->
|
<PageHeader title="发货状态"
|
@back="goBack" />
|
<!-- 统计信息 -->
|
<view class="summary-info">
|
<view class="summary-item">
|
<text class="summary-label">客户名称</text>
|
<text class="summary-value">{{ outData.customerName }}</text>
|
</view>
|
<view class="summary-item">
|
<text class="summary-label">合同金额</text>
|
<text class="summary-value">{{ outData.contractAmount }}</text>
|
</view>
|
<view class="summary-item">
|
<text class="summary-label">签订日期</text>
|
<text class="summary-value">{{ outData.executionDate }}</text>
|
</view>
|
</view>
|
<!-- 回款记录明细列表 -->
|
<view class="detail-list"
|
v-if="tableData.length > 0">
|
<view v-for="(item, index) in tableData"
|
:key="index"
|
class="detail-item">
|
<view class="item-header">
|
<view class="item-left">
|
<view class="record-icon">
|
<up-icon name="file-text"
|
size="16"
|
color="#ffffff"></up-icon>
|
</view>
|
<text class="item-index">{{ item.productCategory }}</text>
|
</view>
|
</view>
|
<up-divider></up-divider>
|
<view class="item-details">
|
<view class="detail-row">
|
<text class="detail-label">产品大类</text>
|
<text class="detail-value">{{ item.productCategory }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">规格型号</text>
|
<text class="detail-value">{{ item.specificationModel }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">单位</text>
|
<text class="detail-value">{{ item.unit }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">产品状态</text>
|
<text v-if="item.approveStatus === 1"
|
class="detail-value highlight">充足</text>
|
<text v-else
|
class="detail-value danger">不足</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">发货状态</text>
|
<u-tag size="mini"
|
:type="getShippingStatusType(item)">{{ getShippingStatusText(item) }}</u-tag>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">快递公司</text>
|
<text class="detail-value">{{ item.expressCompany }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">快递单号</text>
|
<text class="detail-value">{{ item.expressNumber }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">发货车牌</text>
|
<u-tag size="mini"
|
v-if="item.shippingCarNumber"
|
type="success">{{ item.shippingCarNumber }}</u-tag>
|
<u-tag v-else
|
size="mini"
|
type="info">-</u-tag>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">发货日期</text>
|
<text class="detail-value">{{ item.shippingDate || '-' }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">数量</text>
|
<text class="detail-value">{{ item.quantity }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">税率(%)</text>
|
<text class="detail-value">{{ item.taxRate }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">含税单价(元)</text>
|
<text class="detail-value">{{ item.taxInclusiveUnitPrice }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">含税总价(元)</text>
|
<text class="detail-value">{{ item.taxInclusiveTotalPrice }}</text>
|
</view>
|
<view class="detail-row">
|
<text class="detail-label">不含税总价(元)</text>
|
<text class="detail-value">{{ item.taxExclusiveTotalPrice }}</text>
|
</view>
|
<up-divider></up-divider>
|
<u-button class="detail-button"
|
size="small"
|
type="primary"
|
:disabled="!canShip(item)"
|
@click="goout(item)">
|
发货
|
</u-button>
|
</view>
|
</view>
|
</view>
|
<view v-else
|
class="no-data">
|
<text>暂无回款记录</text>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { ref, computed, onMounted } from "vue";
|
import { productList } from "@/api/salesManagement/salesLedger";
|
|
// 客户信息
|
const supplierId = ref("");
|
|
// 表格数据
|
const tableData = ref([]);
|
|
// 返回上一页
|
const goBack = () => {
|
uni.removeStorageSync("supplierId");
|
uni.navigateBack();
|
};
|
const getShippingStatusType = row => {
|
// 如果已发货(有发货日期或车牌号),显示绿色
|
if (row.shippingDate || row.shippingCarNumber) {
|
return "success";
|
}
|
|
// 获取发货状态字段
|
const status = row.shippingStatus;
|
|
// 如果状态为空或未定义,默认为灰色(待发货)
|
if (status === null || status === undefined || status === "") {
|
return "info";
|
}
|
|
// 状态是字符串
|
const statusStr = String(status).trim();
|
const typeTextMap = {
|
待发货: "info",
|
待审核: "info",
|
审核中: "warning",
|
审核拒绝: "danger",
|
审核通过: "success",
|
已发货: "success",
|
};
|
return typeTextMap[statusStr] || "info";
|
};
|
const getShippingStatusText = row => {
|
// 如果已发货(有发货日期或车牌号),显示"已发货"
|
if (row.shippingDate || row.shippingCarNumber) {
|
return "已发货";
|
}
|
|
// 获取发货状态字段
|
const status = row.shippingStatus;
|
|
// 如果状态为空或未定义,默认为"待发货"
|
if (status === null || status === undefined || status === "") {
|
return "待发货";
|
}
|
|
// 状态是字符串
|
const statusStr = String(status).trim();
|
const statusTextMap = {
|
待发货: "待发货",
|
待审核: "待审核",
|
审核中: "审核中",
|
审核拒绝: "审核拒绝",
|
审核通过: "审核通过",
|
已发货: "已发货",
|
};
|
return statusTextMap[statusStr] || "待发货";
|
};
|
// 获取页面参数
|
const getPageParams = () => {
|
// 从本地存储获取供应商ID
|
const storedSupplierId = uni.getStorageSync("supplierId");
|
if (storedSupplierId) {
|
supplierId.value = storedSupplierId;
|
}
|
};
|
const goout = item => {
|
uni.setStorageSync("goOutData", JSON.stringify(item));
|
uni.navigateTo({
|
url: "/pages/sales/salesAccount/goOut",
|
});
|
};
|
|
// 查询列表
|
const getList = () => {
|
showLoadingToast("加载中...");
|
productList({
|
salesLedgerId: outData.value.id,
|
type: 1,
|
})
|
.then(res => {
|
tableData.value = res.data;
|
closeToast();
|
})
|
.catch(() => {
|
closeToast();
|
uni.showToast({
|
title: "查询失败",
|
icon: "error",
|
});
|
});
|
};
|
const canShip = row => {
|
// 产品状态必须是充足(approveStatus === 1)
|
if (row.approveStatus !== 1) {
|
return false;
|
}
|
|
// 获取发货状态
|
const shippingStatus = row.shippingStatus;
|
|
// 如果已发货(有发货日期或车牌号),不能再次发货
|
if (row.shippingDate || row.shippingCarNumber) {
|
return false;
|
}
|
|
// 发货状态必须是"待发货"或"审核拒绝"
|
const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
|
return statusStr === "待发货" || statusStr === "审核拒绝";
|
};
|
|
// 显示加载提示
|
const showLoadingToast = message => {
|
uni.showLoading({
|
title: message,
|
mask: true,
|
});
|
};
|
|
// 关闭提示
|
const closeToast = () => {
|
uni.hideLoading();
|
};
|
const outData = ref({});
|
|
onMounted(() => {
|
// 页面加载时获取参数并刷新列表
|
getPageParams();
|
// 从本地存储获取发货状态数据
|
outData.value = JSON.parse(uni.getStorageSync("outData"));
|
getList();
|
});
|
</script>
|
|
<style scoped lang="scss">
|
.receipt-payment-detail {
|
min-height: 100vh;
|
background: #f8f9fa;
|
position: relative;
|
}
|
|
.u-divider {
|
margin: 0 !important;
|
}
|
|
.summary-info {
|
background: #ffffff;
|
margin: 20px 20px 0 20px;
|
border-radius: 12px;
|
padding: 16px;
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
}
|
|
.summary-item {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 8px;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
}
|
|
.summary-label {
|
font-size: 14px;
|
color: #666;
|
}
|
|
.summary-value {
|
font-size: 14px;
|
color: #333;
|
font-weight: 500;
|
}
|
|
.summary-value.highlight {
|
color: #2979ff;
|
font-weight: 600;
|
}
|
|
.summary-value.danger {
|
color: #ff4757;
|
font-weight: 600;
|
}
|
|
.detail-list {
|
padding: 20px;
|
}
|
|
.detail-item {
|
background: #ffffff;
|
border-radius: 12px;
|
margin-bottom: 16px;
|
overflow: hidden;
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
padding: 0 16px;
|
}
|
|
.item-header {
|
padding: 10px 0;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.item-left {
|
display: flex;
|
align-items: center;
|
gap: 8px;
|
}
|
|
.record-icon {
|
width: 24px;
|
height: 24px;
|
background: #2979ff;
|
border-radius: 4px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.item-index {
|
font-size: 14px;
|
color: #333;
|
font-weight: 500;
|
}
|
|
.item-date {
|
font-size: 12px;
|
color: #666;
|
}
|
|
.item-details {
|
padding: 16px 0;
|
}
|
|
.detail-row {
|
display: flex;
|
align-items: flex-end;
|
justify-content: space-between;
|
margin-bottom: 8px;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
}
|
|
.detail-label {
|
font-size: 12px;
|
color: #777777;
|
min-width: 60px;
|
}
|
|
.detail-value {
|
font-size: 12px;
|
color: #000000;
|
text-align: right;
|
flex: 1;
|
margin-left: 16px;
|
}
|
|
.detail-value.highlight {
|
color: #2979ff;
|
font-weight: 500;
|
}
|
|
.detail-value.danger {
|
color: #ff4757;
|
font-weight: 500;
|
}
|
|
.no-data {
|
padding: 40px 0;
|
text-align: center;
|
color: #999;
|
}
|
</style>
|