emis-app/pages/tabBar/order/order.vue

259 lines
7.7 KiB
Vue
Raw Normal View History

2023-11-25 16:30:38 +00:00
<template>
2024-05-06 16:38:24 +00:00
<tpx-page>
<tpx-layout>
<template v-slot:header>
2024-06-18 16:16:19 +00:00
<view class="">
<view class="" style="padding: 20rpx;background-color:#B12D29;border-radius: 0;">
2023-12-19 17:58:00 +00:00
2024-06-18 16:16:19 +00:00
<u-row v-if="staticDataList.length > 0" justify="between">
2024-06-13 07:01:03 +00:00
<template v-for="(mbItem, mIndex) in staticDataList">
2024-06-18 16:16:19 +00:00
<u-row>
<text class="clr-wht font-26" style="opacity: 0.8;">{{mbItem.title}}</text>
<text class="pl-10 clr-wht font-38 font-weight">{{mbItem.subTitle}}</text>
</u-row>
2024-06-13 07:01:03 +00:00
</template>
2024-05-06 16:38:24 +00:00
</u-row>
</view>
</view>
2024-06-18 16:16:19 +00:00
<view class="com-jianju" style="padding-top: 16rpx;">
<u-row justify="between">
<view style="width: 140rpx;" class="font-weight">运单号</view>
<view style="flex:1;">
<tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入或扫码"
@change="handleScanValChange" iconPos="right"></tpx-scan-input>
</view>
</u-row>
<u-row justify="between" custom-style="margin-top:16rpx;">
<view style="width: 140rpx;" class="font-weight">日期</view>
<view style="flex:1;">
<tpx-date-input v-model:value="searchParam._date" placeholder="请选择时间"></tpx-date-input>
</view>
</u-row>
</view>
<view class="com-jianju" style="padding-top: 16rpx;">
2024-05-06 16:38:24 +00:00
<u-row justify="between" align="top">
<u-col span="12">
<!-- 订单状态 -->
2024-06-21 04:55:51 +00:00
<tpx-tabs :list="dicData.emis_waybill_stat_type" v-model:value="searchParam.params.waybillStatType"
2024-05-06 16:38:24 +00:00
@tabchange="(val)=> { handleSearchParamChange() }" v-slot="curOrdTab"
>
<text slot>
2024-06-18 08:43:27 +00:00
(<text>{{ staticInfo.orderStat[curOrdTab.item.val] || 0 }}</text>)
2024-05-06 16:38:24 +00:00
</text>
</tpx-tabs>
</u-col>
2023-12-19 17:58:00 +00:00
</u-row>
</view>
2024-05-06 16:38:24 +00:00
</template>
<template v-slot:body>
<view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
2024-06-21 05:51:48 +00:00
ref="listRef" @onListReload="handleListReload"
2024-05-06 16:38:24 +00:00
>
<view class="pgb-cont">
<!-- 列表数据 -->
2024-05-07 05:46:42 +00:00
<view v-for="(item) in resData.list" class="ord-list-item">
2024-05-23 08:37:07 +00:00
<view class="mt-10">
<bpd-send-reciever-tmp :value="item" :showInfoBtn="false"></bpd-send-reciever-tmp>
</view>
2024-05-06 16:38:24 +00:00
<u-line color="#DEDEDE" margin="30rpx 0 0 0"></u-line>
<u-row justify="end" custom-style="margin-top:20rpx;">
<view style="display: inline-block;white-space: nowrap;">
2024-06-19 16:29:47 +00:00
<u-row v-if="!item.billCode">
<u-button @click="handleDealItem(item, { type: 1 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">接单</u-button>
<u-button @click="handleDealItem(item, { type: 2 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">立即开单</u-button>
<u-button @click="handleDealItem(item, { type: 3 })" shape="circle" type="primary"
2024-05-06 16:38:24 +00:00
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">取消</u-button>
2024-06-19 16:29:47 +00:00
</u-row>
<u-row v-else="">
<u-button v-if="item.waybillStatus == 0" @click="handleDealItem(item, { type: 2 })" shape="circle" type="primary" :plain="true"
2024-05-06 16:38:24 +00:00
custom-style="height: 54rpx;margin-left: 12rpx;">立即开单</u-button>
2024-06-19 16:29:47 +00:00
<u-button v-if="item.waybillStatus == 0" @click="handleDealItem(item, { type: 4 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">揽收</u-button>
<u-button v-if="item.waybillStatus == 40" @click="handleDealItem(item, { type: 5 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">签收扫描</u-button>
2024-05-06 16:38:24 +00:00
</u-row>
</view>
2023-12-19 17:58:00 +00:00
</u-row>
</view>
2024-05-06 16:38:24 +00:00
</view>
</tpx-scroll-view>
2023-12-19 17:58:00 +00:00
</view>
2024-05-06 16:38:24 +00:00
</template>
</tpx-layout>
</tpx-page>
2023-11-25 16:30:38 +00:00
</template>
2024-05-06 16:38:24 +00:00
2023-11-25 16:30:38 +00:00
<script>
2024-05-08 16:44:38 +00:00
import { dateRangeList } from "@/common/enum"
2024-05-06 16:38:24 +00:00
import * as apiService from "@/common/api"
2024-05-23 08:37:07 +00:00
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
2024-06-13 07:01:03 +00:00
import { getAuthList, authCodeEnum } from "@/common/authCode"
2024-02-29 06:05:33 +00:00
2023-12-19 17:58:00 +00:00
export default {
2023-11-25 16:30:38 +00:00
props: {
2023-12-19 17:58:00 +00:00
},
computed: {
2024-05-07 05:46:42 +00:00
dicData() {
return this.$store.getters.dicData
},
2024-06-13 07:01:03 +00:00
staticDataList(){
let { commStat } = this.staticInfo
let list = [
2024-06-18 08:43:27 +00:00
{ title: '待处理订单', subTitle: commStat.waitDoNum || 0, url: '', code: authCodeEnum.dingDanGaiKuang },
{ title: '累计处理订单', subTitle: commStat.hasDoNum || 0, url: '', code: authCodeEnum.dingDanGaiKuang }
2024-06-13 07:01:03 +00:00
]
list = getAuthList({ list, _thisPage: this })
return list
},
2023-11-25 16:30:38 +00:00
},
2024-05-23 08:37:07 +00:00
components: { BpdSendRecieverTmp },
2023-12-19 17:58:00 +00:00
data() {
2024-05-08 16:44:38 +00:00
let { dicData } = this.$store.getters
2023-12-19 17:58:00 +00:00
return {
2024-06-13 07:01:03 +00:00
authCodeEnum,
2024-05-08 16:44:38 +00:00
...JSON.parse(JSON.stringify({ dateRangeList })),
2023-12-19 17:58:00 +00:00
searchParam: {
2024-06-18 08:43:27 +00:00
billCode: '',
_date: [],
2024-06-21 04:55:51 +00:00
params: {
waybillStatType: dicData?.emis_waybill_stat_type?.[0]?.val,
}
2024-05-06 16:38:24 +00:00
},
queryOption: {
2024-06-13 07:01:03 +00:00
},
staticInfo: {
commStat: {},
orderStat: {},
2023-11-25 16:30:38 +00:00
},
2024-05-06 16:38:24 +00:00
resData: {
list: []
}
2023-11-25 16:30:38 +00:00
}
},
2023-12-19 17:58:00 +00:00
onShareAppMessage() {
return {
// title: '',
// path: 'TODO'
}
},
2024-05-08 07:56:01 +00:00
onShow(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
2024-06-18 08:43:27 +00:00
this.initData()
2024-05-08 07:56:01 +00:00
},
2024-05-07 05:46:42 +00:00
onLoad(option) {
this.queryOption = option
2023-12-19 17:58:00 +00:00
this.initData();
},
onUnload() {
},
methods: {
2024-06-18 16:16:19 +00:00
transSearchPm(param){
let cpParam = JSON.parse(JSON.stringify(param))
2024-06-21 04:55:51 +00:00
cpParam.params.beginDate = cpParam._date[0]
cpParam.params.endDate = cpParam._date[1]
2024-06-18 16:16:19 +00:00
return cpParam
},
async getListFun(param){
let cpParam = this.transSearchPm(param)
let res = await apiService.getOrderList(cpParam)
return res
},
2023-12-19 17:58:00 +00:00
initData(){
2024-06-18 08:43:27 +00:00
},
2024-06-21 05:51:48 +00:00
handleListReload(params){
// list重置到第一页,需重新查询统计数据
this.getStaticData(params)
},
async getStaticData(params){
let cpParam = this.transSearchPm(params)
2024-06-18 16:16:19 +00:00
const staRes = await apiService.getWaybillStatMap(cpParam)
2024-06-18 08:43:27 +00:00
let { hasDoNum, waitDoNum, statNumList } = staRes.data
this.staticInfo.commStat = { hasDoNum, waitDoNum }
let orderStat = {}
statNumList.map(t=> {
orderStat[t.statType] = t.statNum
})
this.staticInfo.orderStat = orderStat
2023-12-19 17:58:00 +00:00
},
async handleDealItem(item, deal = { type: '1' }) {
2024-05-07 16:13:08 +00:00
let itemQuery = `?billCode=${item.billCode || ''}&orderSn=${item.orderSn || ''}`
2023-12-19 17:58:00 +00:00
switch (deal.type){
2024-06-19 16:29:47 +00:00
case 1: // 接单
// TODO
await this.confirmModal('确认要接单吗?')
2023-12-19 17:58:00 +00:00
break;
2024-06-19 16:29:47 +00:00
case 2: // 立即开单
this.goto(`post/openorder${itemQuery}`)
2023-12-19 17:58:00 +00:00
break;
2024-06-19 16:29:47 +00:00
case 3: // 取消
// TODO
2024-02-29 06:05:33 +00:00
await this.confirmModal('确认要取消吗?')
2023-12-19 17:58:00 +00:00
break;
2024-06-19 16:29:47 +00:00
case 4: // 揽收
2024-05-07 16:13:08 +00:00
this.goto(`deliveryDeal/pickUp${itemQuery}`)
2024-05-07 13:44:17 +00:00
break;
2024-06-19 16:29:47 +00:00
case 5: // 签收扫描
this.goto(`deliveryDeal/signedScanning${itemQuery}`)
break;
2023-12-19 17:58:00 +00:00
default:
break;
}
2024-05-08 16:44:38 +00:00
},
handleSearchParamChange() {
2023-12-19 17:58:00 +00:00
}
}
}
2023-11-25 16:30:38 +00:00
</script>
2023-12-01 04:47:59 +00:00
<style lang="scss">
2023-12-19 17:58:00 +00:00
@import '@/common/uni-nvue.scss';
page {
background-color: #fff !important;
height: 100% !important;
}
2023-11-25 16:30:38 +00:00
</style>
2023-12-19 17:58:00 +00:00
<style scoped lang="scss">
.pgb-cont{
padding: 30rpx;
}
.ord-list-item{
border: 2px solid #F6F6F6;
box-shadow: 0rpx 3rpx 12rpx 0rpx rgba(139,139,139,0.06);
border-radius: 20rpx;
padding: 22rpx 30rpx;
background-color: #fff;
margin-bottom: 30rpx;
}
.search-more-panel{
overflow: hidden;
position: absolute;
left: 0;
right: 0;
height: calc(70vh);
z-index: 200;
}
.smp-body{
padding: 30rpx;
display: flex;
flex-direction: column;
height: 100%;
background-color: #FFF;
border-radius: 0 0 30rpx 30rpx;
box-sizing: border-box;
}
.smp-content{
flex: 1;
position: relative;
}
</style>