2024-03-11 05:30:11 +00:00
|
|
|
|
<template>
|
|
|
|
|
<view class="search">
|
|
|
|
|
<view v-if="!isShowSearch" @click="isShowSearch = true">
|
|
|
|
|
<u-icon color="#C1C1C1" name="search"></u-icon
|
|
|
|
|
><text>请输入客户名称</text>
|
|
|
|
|
</view>
|
|
|
|
|
<u-search
|
|
|
|
|
v-else
|
|
|
|
|
placeholder="请输入客户名称"
|
|
|
|
|
v-model="keyword"
|
|
|
|
|
:focus="true"
|
|
|
|
|
bgColor="#fff"
|
|
|
|
|
:clearabled="true"
|
|
|
|
|
:showAction="false"
|
|
|
|
|
placeholderColor="#C1C1C1"
|
|
|
|
|
></u-search>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="card-box">
|
|
|
|
|
<view class="c-tab">
|
|
|
|
|
<text
|
|
|
|
|
v-for="(item, index) in tabList"
|
|
|
|
|
:key="index"
|
|
|
|
|
:class="{ active: currentTab === item.key }"
|
|
|
|
|
@click="handleTab(item)"
|
|
|
|
|
>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<block v-for="(item, index) in pageList.list" :key="index">
|
|
|
|
|
<view class="c-layout">
|
|
|
|
|
<view
|
|
|
|
|
><checkbox
|
|
|
|
|
:color="'#00D2E3'"
|
2024-03-12 05:34:36 +00:00
|
|
|
|
:checked="state.checkMap[item.id + '']"
|
2024-03-11 05:30:11 +00:00
|
|
|
|
style="transform: scale(0.5)"
|
2024-03-12 05:34:36 +00:00
|
|
|
|
@click="state.checkMap[item.id + ''] = !state.checkMap[item.id + '']"
|
2024-03-11 05:30:11 +00:00
|
|
|
|
/></view>
|
|
|
|
|
<view class="inner-box">
|
|
|
|
|
<view class="top-flex-box">
|
|
|
|
|
<view>
|
|
|
|
|
<view>
|
|
|
|
|
<text class="number">出货单号:{{ item.receiptNumber }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<text class="name">{{ item.userName }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bottom-flex-box">
|
|
|
|
|
<view>
|
|
|
|
|
<view>
|
|
|
|
|
<text class="desc"
|
|
|
|
|
>过磅总净重:{{ item.netWeight || 0 }}KG</text
|
|
|
|
|
>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<text class="btn">
|
|
|
|
|
<text
|
|
|
|
|
v-if="currentTab === 2"
|
2024-03-12 05:34:36 +00:00
|
|
|
|
@click="handleReview(item.id, 2)"
|
2024-03-11 05:30:11 +00:00
|
|
|
|
>出货结算</text
|
|
|
|
|
>
|
2024-03-12 05:34:36 +00:00
|
|
|
|
<text v-if="currentTab === 3" @click="handleReview(item.id, 3)">去结算</text>
|
|
|
|
|
<text v-if="currentTab === 4" @click="handleReview(item.id, 4)">查看</text>
|
2024-03-11 05:30:11 +00:00
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-gap
|
|
|
|
|
height="10"
|
|
|
|
|
bgColor="#f8f8f8"
|
|
|
|
|
v-if="index < pageList.list.length - 1"
|
|
|
|
|
></u-gap>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn-box" v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0">
|
|
|
|
|
<u-button
|
|
|
|
|
text="全选/取消"
|
|
|
|
|
color="#fff"
|
|
|
|
|
:customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }"
|
|
|
|
|
@click="handleSelect"
|
|
|
|
|
></u-button>
|
|
|
|
|
<u-button type="primary" :text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"></u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ShipmentApi } from "@/services/index";
|
2024-03-12 05:34:36 +00:00
|
|
|
|
import { ScaleStatusBtnType } from "@/utils/enum";
|
2024-03-11 05:30:11 +00:00
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
// scaleStatus
|
|
|
|
|
interface PageResult<T> {
|
|
|
|
|
total: number;
|
|
|
|
|
list: T[];
|
|
|
|
|
pageNum: number;
|
|
|
|
|
pageSize: number;
|
|
|
|
|
}
|
2024-03-12 05:34:36 +00:00
|
|
|
|
const pageList: PageResult<Shipment> = reactive({
|
2024-03-11 05:30:11 +00:00
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
});
|
|
|
|
|
const keyword = ref();
|
|
|
|
|
const isShowSearch = ref(false);
|
|
|
|
|
const state = reactive<{
|
|
|
|
|
[attrName: string]: any;
|
|
|
|
|
}>({
|
|
|
|
|
checkMap: {},
|
|
|
|
|
isAll: false,
|
|
|
|
|
});
|
|
|
|
|
const tabList = reactive([
|
|
|
|
|
{
|
|
|
|
|
name: "待出货结算",
|
|
|
|
|
key: 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "已出未结算",
|
|
|
|
|
key: 3,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "已出已结算",
|
|
|
|
|
key: 4,
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const currentTab = ref(2);
|
|
|
|
|
const handleTab = (item: any) => {
|
|
|
|
|
currentTab.value = item.key;
|
|
|
|
|
getOrderList();
|
|
|
|
|
};
|
2024-03-12 05:34:36 +00:00
|
|
|
|
const handleReview = (id: string, scaleStatus: number) => {
|
|
|
|
|
let type = ScaleStatusBtnType.ShipmentSettlement
|
|
|
|
|
if (scaleStatus === 2) {
|
|
|
|
|
type = ScaleStatusBtnType.ShipmentSettlement
|
|
|
|
|
} else if (scaleStatus === 3) {
|
|
|
|
|
type = ScaleStatusBtnType.ShipmentNoPay
|
|
|
|
|
} else if (scaleStatus === 4) {
|
|
|
|
|
type = ScaleStatusBtnType.ShipmentPay
|
|
|
|
|
}
|
2024-03-11 05:30:11 +00:00
|
|
|
|
uni.navigateTo({
|
2024-03-12 05:34:36 +00:00
|
|
|
|
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}`, // 要跳转到的页面路径
|
2024-03-11 05:30:11 +00:00
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const handleSelect = () => {
|
|
|
|
|
state.isAll = !state.isAll;
|
|
|
|
|
Object.keys(state.checkMap).forEach((item) => {
|
|
|
|
|
state.checkMap[item] = state.isAll;
|
|
|
|
|
});
|
2024-03-12 05:34:36 +00:00
|
|
|
|
console.log(state.checkMap)
|
2024-03-11 05:30:11 +00:00
|
|
|
|
};
|
|
|
|
|
const getOrderList = () => {
|
|
|
|
|
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
(pageList as any).list = res.data.list;
|
|
|
|
|
(res.data.list as any).forEach((item: any) => {
|
2024-03-12 05:34:36 +00:00
|
|
|
|
state.checkMap[item.id] = false;
|
2024-03-11 05:30:11 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getOrderList();
|
|
|
|
|
});
|
|
|
|
|
onLoad((option) => {
|
|
|
|
|
currentTab.value = parseInt((option as any).scaleStatus);
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.search {
|
|
|
|
|
box-shadow: 0rpx 3rpx 16rpx 5rpx rgba(0, 0, 0, 0.2);
|
|
|
|
|
border-radius: 28rpx;
|
|
|
|
|
background: rgba(255, 255, 255, 0.86);
|
|
|
|
|
width: 80%;
|
|
|
|
|
margin: 0px auto;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #c1c1c1;
|
|
|
|
|
> view {
|
|
|
|
|
line-height: 60rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
text {
|
|
|
|
|
margin-left: 15rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.card-box {
|
|
|
|
|
.c-tab {
|
|
|
|
|
font-family: Source Han Sans CN;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #999999;
|
|
|
|
|
line-height: 41rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
|
|
|
|
|
text {
|
|
|
|
|
padding: 16rpx;
|
|
|
|
|
}
|
|
|
|
|
.active {
|
|
|
|
|
color: $u-primary;
|
|
|
|
|
border-bottom: 5rpx solid $u-primary;
|
|
|
|
|
border-radius: 5rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.c-layout {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 30rpx 25rpx 30rpx 0rpx;
|
|
|
|
|
}
|
|
|
|
|
.inner-box {
|
|
|
|
|
width: 100%;
|
|
|
|
|
// padding: 40rpx 40rpx;
|
|
|
|
|
.bottom-flex-box {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.btn {
|
|
|
|
|
border-radius: 24rpx;
|
|
|
|
|
border: 1px solid #00dcee;
|
|
|
|
|
padding: 10rpx 30rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #00dcee;
|
|
|
|
|
line-height: 41rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
|
|
|
|
border-radius: 13rpx;
|
|
|
|
|
margin: 0rpx 25rpx;
|
|
|
|
|
margin-top: 35rpx;
|
|
|
|
|
font-family: Source Han Sans CN;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #000000;
|
|
|
|
|
line-height: 41rpx;
|
|
|
|
|
|
|
|
|
|
.desc {
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #999999;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
.name {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #000000;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
.flex-box {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #000000;
|
|
|
|
|
line-height: 41rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.btn-box {
|
|
|
|
|
margin-top: 60rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
|
|
|
|
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
|
|
|
|
padding: 25rpx 50rpx;
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0rpx;
|
|
|
|
|
width: calc(100vw - 100rpx);
|
|
|
|
|
::v-deep button {
|
|
|
|
|
border-radius: 43rpx;
|
|
|
|
|
}
|
|
|
|
|
::v-deep button + button {
|
|
|
|
|
margin-left: 50rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|