freight-web/src/PagesStatistics/shipmentPanel.vue

338 lines
8.2 KiB
Vue
Raw Normal View History

2024-03-04 07:10:11 +00:00
<template>
<view class="layout-box">
<view class="filter">
<up-input
2024-03-15 06:41:42 +00:00
v-model="state.startTime"
2024-03-04 07:10:11 +00:00
disabled
2024-04-23 02:47:52 +00:00
disabledColor=""
2024-03-04 07:10:11 +00:00
placeholder="请选择开始时间"
></up-input>
2024-03-04 07:10:11 +00:00
<text>-</text>
<up-input
2024-03-15 06:41:42 +00:00
v-model="state.endTime"
2024-03-04 07:10:11 +00:00
disabled
2024-04-23 02:47:52 +00:00
disabledColor=""
2024-03-04 07:10:11 +00:00
placeholder="请选择结束时间"
></up-input>
2024-03-15 06:41:42 +00:00
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
></u-icon>
2024-04-25 08:30:50 +00:00
<text class="status">{{
state.scaleStatus === -1
? "单据状态"
: getScaleStatus(1, state.scaleStatus)
}}</text>
2024-03-15 06:41:42 +00:00
<u-icon
name="arrow-down"
@click="handleDialog('showStatus', true)"
></u-icon>
2024-03-04 07:10:11 +00:00
<text class="btn" @click="handleDialog('showFilter', true)">筛选</text>
</view>
<view class="box">
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
2024-04-25 08:30:50 +00:00
<view class="num highlight">{{
formatMoney(state.summary.totalAmount)
}}</view>
2024-03-04 07:10:11 +00:00
<view>出货总量/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
2024-04-25 08:30:50 +00:00
<view class="num">{{
formatMoney(state.summary.totalPayShipment)
}}</view>
2024-03-04 07:10:11 +00:00
<view>已收/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
2024-04-25 08:30:50 +00:00
<view class="num">{{
formatMoney(state.summary.totalUnPayShipment)
}}</view>
2024-03-04 07:10:11 +00:00
<view>未收/kg</view>
</view>
</up-col>
</up-row>
</view>
<view class="box">
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
2024-04-25 08:30:50 +00:00
<view class="num highlight">{{
formatMoney(state.summary.totalCollection)
}}</view>
2024-03-15 06:41:42 +00:00
<view>结算金额/</view>
2024-03-04 07:10:11 +00:00
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
2024-04-25 08:30:50 +00:00
<view class="num">{{
formatMoney(state.summary.totalPayCollection)
}}</view>
2024-03-04 07:10:11 +00:00
<view>实收金额</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
2024-04-25 08:30:50 +00:00
<view class="num">{{
formatMoney(state.summary.totalUnPayCollection)
}}</view>
2024-03-04 07:10:11 +00:00
<view>应收金额</view>
</view>
</up-col>
</up-row>
</view>
<view class="box">
<up-row>
<up-col span="6">
<view class="inner-box" style="border: none">
2024-03-15 06:41:42 +00:00
<view class="num">{{ state.summary.totalReceipt }}</view>
2024-03-04 07:10:11 +00:00
<view>出货单</view>
</view>
</up-col>
<up-col span="6">
<view class="inner-box">
2024-03-15 06:41:42 +00:00
<view class="num">{{ state.summary.averagePrice }}</view>
<view>均价/kg</view>
2024-03-04 07:10:11 +00:00
</view>
</up-col>
</up-row>
</view>
<view class="box">
<uni-table stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
2024-03-15 06:41:42 +00:00
<uni-th v-for="(item, index) in tableTitleList" :key="index">{{
2024-03-04 07:10:11 +00:00
item.name
}}</uni-th>
</uni-tr>
<!-- 表格数据行 -->
2024-03-15 06:41:42 +00:00
<uni-tr v-for="(item, index) in state.summary.rankings" :key="index">
<uni-td>{{ item.userName }}</uni-td>
<uni-td>{{ item.totalAmount }}</uni-td>
<uni-td>{{ item.totalPayment }}</uni-td>
<uni-td>{{ item.totalOrderNumber }}</uni-td>
<uni-td>{{ item.totalOrderNumber }}</uni-td>
2024-03-04 07:10:11 +00:00
</uni-tr>
</uni-table>
</view>
</view>
<!-- 时间弹框 -->
2024-03-15 06:41:42 +00:00
<TimeDialog
ref="timeDialog"
:show="showDialog.showTime"
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
@changeTime="changeTime"
/>
2024-03-04 07:10:11 +00:00
<!-- 单据弹框 -->
2024-03-15 06:41:42 +00:00
<StatusDialog
:show="showDialog.showStatus"
:isShipment="true"
@handleDialog="(v:boolean) => {handleDialog('showStatus', v)}"
@changeStatus="changeStatus"
/>
2024-03-04 07:10:11 +00:00
2024-03-15 06:41:42 +00:00
<!-- 筛选弹框 -->
<FilterDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeOther="changeOther"
:isShipment="true"
/>
2024-03-04 07:10:11 +00:00
</template>
<script setup lang="ts">
2024-03-15 06:41:42 +00:00
import TimeDialog from "./components/TimeDialog.vue";
import StatusDialog from "./components/StatusDialog.vue";
import FilterDialog from "./components/FilterDialog.vue";
import { ShipmentApi } from "@/services";
2024-04-25 08:30:50 +00:00
import {
formatDate,
formatMoney,
getCurrentMonthStartAndEnd,
getScaleStatus,
} from "@/utils";
2024-03-04 07:10:11 +00:00
const tableTitleList = reactive([
{
name: "客户",
},
{
2024-03-15 06:41:42 +00:00
name: "结算重量/kg",
2024-03-04 07:10:11 +00:00
},
{
name: "结算金额",
},
{
name: "实收款",
},
{
name: "数量",
},
]);
const showDialog = <
{
2024-03-15 06:41:42 +00:00
[key: string]: boolean;
2024-03-04 07:10:11 +00:00
}
2024-03-15 06:41:42 +00:00
>reactive({
showTime: false,
showStatus: false,
showFilter: false,
});
2024-03-04 07:10:11 +00:00
2024-03-15 06:41:42 +00:00
const state = reactive<{
summary: ShipmentSummaryCount;
startTime: string;
endTime: string;
scaleStatus: number;
userId: number;
productId: number;
}>({
summary: {
totalAmount: 0, // 收货汇总:审核过收货总量
totalPayShipment: 0, // 已支付的出货总
totalUnPayShipment: 0, // 未支付的出货总量
totalCollection: 0, // 总收款
totalPayCollection: 0, // 已经收到的收款
totalUnPayCollection: 0, // 未收到的收款
totalReceipt: 0, // 收货单数量已审核的
averagePrice: 0, // 平均单价
rankings: [],
},
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
scaleStatus: -1,
userId: -1,
productId: -1,
});
const changeTime = (obj: any) => {
state.startTime = obj.startTime;
state.endTime = obj.endTime;
getList();
};
const changeStatus = (obj: any) => {
state.scaleStatus = obj.id;
getList();
};
2024-03-04 07:10:11 +00:00
2024-03-15 06:41:42 +00:00
const changeOther = (obj: any) => {
state.userId = obj.userId;
state.productId = obj.productId;
getList();
};
2024-03-04 07:10:11 +00:00
2024-03-15 06:41:42 +00:00
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const getList = () => {
let params: any = {
startTime: state.startTime + " 00:00:00",
endTime: state.endTime + " 23:59:59",
};
if (state.scaleStatus > -1) {
params.scaleStatus = state.scaleStatus;
}
if (state.userId > -1) {
params.userId = state.userId;
}
if (state.productId > -1) {
params.productId = state.productId;
}
ShipmentApi.getOrderInReceipt(params).then((res) => {
if (res.code === 200) {
state.summary = res.data;
}
});
};
onMounted(() => {
getList();
});
2024-03-04 07:10:11 +00:00
</script>
<style lang="scss" scoped>
.layout-box {
margin: 35.9rpx 25.64rpx;
.filter {
display: flex;
align-items: center;
justify-items: center;
font-family: Source Han Sans CN;
2024-03-15 06:41:42 +00:00
font-size: 28rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
::v-deep .up-input {
2024-03-04 07:10:11 +00:00
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;
font-weight: 400;
2024-03-15 06:41:42 +00:00
font-size: 24rpx !important;
2024-03-04 07:10:11 +00:00
color: #000000;
}
}
text {
margin: 0px 5rpx;
}
.status {
margin-left: 40rpx;
}
.btn {
color: $u-primary;
margin-left: 40rpx;
margin-right: 0rpx;
}
}
.box {
padding: 28rpx 20rpx;
2024-03-04 07:10:11 +00:00
// display: flex;
// justify-content: space-between;
align-items: center;
font-family: Source Han Sans CN;
font-weight: 400;
2024-03-15 06:41:42 +00:00
font-size: 26rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
text-align: center;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin-top: 30rpx;
}
.inner-box {
text-align: center;
font-family: Source Han Sans CN;
font-weight: 400;
2024-03-15 06:41:42 +00:00
font-size: 26rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
border-left: 1px solid #e9e9e9;
.num {
font-weight: bold;
font-size: 27rpx;
}
2024-04-23 02:47:52 +00:00
.highlight {
color: rgba(236, 15, 62, 1);
}
2024-03-04 07:10:11 +00:00
}
::v-deep .uni-table {
2024-03-15 06:41:42 +00:00
min-width: 500px !important;
2024-03-04 07:10:11 +00:00
.uni-table-th {
font-family: Source Han Sans CN;
font-weight: 500;
2024-03-15 06:41:42 +00:00
font-size: 24rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
padding: 5px 5px;
}
.uni-table-td {
font-family: Source Han Sans CN;
font-weight: 400;
2024-03-15 06:41:42 +00:00
font-size: 24rpx;
2024-03-04 07:10:11 +00:00
color: #000000;
}
}
}
</style>