emis-sapp/pages/tabBar/search/search.vue
2024-06-03 18:10:16 +08:00

247 lines
7.8 KiB
Vue

<template>
<tpx-page>
<tpx-layout>
<template v-slot:header>
<view class="customer_nav_bar">
<view class="com-jianju" style="width: 490rpx;">
<!-- 关键字搜索框 -->
<tpx-search placeholder="请输入运单号/订单号" v-model:value="searchParam.keyword" @change="handleSearchParamChange()" bgColor="#FFF" :timelyTrigger="false"></tpx-search>
</view>
<view class="com-jianju" style="padding-top: 40rpx;">
<u-row justify="between" align="top">
<u-col span="9">
<!-- 订单状态 -->
<tpx-tabs :list="dicData.emis_order_status" v-model:value="searchParam.ordStatus"
@tabchange="(val)=> { handleSearchParamChange() }" mode="info" v-slot="curOrdTab"
>
<text slot>
(<text>{{curOrdTab.item.val}}</text>)
</text>
</tpx-tabs>
</u-col>
<u-col span="2">
<!-- 更多查询条件 -->
<u-button @click="handleSearchMoreBtn()" :hairline="false" shape="circle" size="mini" custom-style="border-radius: 23rpx;font-size: 26rpx;height: 50rpx;">
<u-row justify="center">
<view :style="'padding-right: 4rpx;white-space: nowrap;' + (hasExtSchParam?'color: #B12D29;':'color: #666;')">
{{hasExtSchParam?'已':''}}筛选
</view>
<u-icon :name="showSearchMore?'arrow-up-fill':'arrow-down-fill'"
:color="(hasExtSchParam?'#B12D29':'#666')" size="18" custom-style="margin-top: 2rpx;"
></u-icon>
</u-row>
</u-button>
</u-col>
</u-row>
</view>
<!-- 状态搜索 -->
<view v-if="showSearchMore" class="search-more-panel">
<view class="smp-body slideInDown animated fast">
<view class="smp-content">
<view class="pos-abt-all" style="overflow-y: auto;">
<view style="padding: 0 0 30rpx 0">
<view>
<u-text text="快递状态" size="28" :bold="true" margin="0 0 20rpx 0"></u-text>
<tpx-tags :list="dlvTypeList" v-model:value="tmpSearchParam.postStatus" ></tpx-tags>
</view>
<view>
<u-text text="付款方式" size="28" :bold="true" margin="20rpx 0 20rpx 0"></u-text>
<tpx-tags :list="payTypeList" v-model:value="tmpSearchParam.payType" ></tpx-tags>
</view>
<view>
<u-text text="时间范围" size="28" :bold="true" margin="20rpx 0 20rpx 0"></u-text>
<tpx-tags type="single" :list="dateTypeList" v-model:value="tmpSearchParam.dateType" @onItemClick="handleCheckDate"></tpx-tags>
<tpx-tags v-if="tmpSearchParam.date" type='' :list="[{title: tmpSearchParam.date}]" @onItemClick="handleSwitchCladar()" mode="primary"></tpx-tags>
</view>
</view>
</view>
</view>
<view class="smp-foot">
<u-row gutter="20" justify="between">
<u-button @click="handleResetTempSearch()" shape="circle">重置</u-button>
<view style="width: 40rpx;"></view>
<u-button @click="handleConfirmTempSearch()" shape="circle" type="primary">确认</u-button>
</u-row>
</view>
</view>
</view>
</view>
</template>
<template v-slot:body>
<view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef"
>
<view class="pgb-cont">
<!-- 列表数据 -->
<view v-for="(item) in resData.list" class="ord-list-item">
<view class="mt-10">
<bpd-send-reciever-tmp :value="item" :showInfoBtn="false"></bpd-send-reciever-tmp>
</view>
<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;">
<u-row>
<u-button @click="goto(`warehousing/detail?id=${211}`)" shape="circle" type="primary" :plain="true"
custom-style="height: 54rpx;margin-left: 12rpx;">进仓确认</u-button>
<u-button @click="goto(`post/post?id=${222}`)" shape="circle" type="primary"
custom-style="height: 54rpx;margin-left: 12rpx;">再来一单</u-button>
<!-- <u-button shape="circle" type="primary" :plain="true" custom-style="height: 54rpx;margin-left: 16rpx;">单据</u-button> -->
<u-button @click="handleDealItem(item, { type: 4 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">取消</u-button>
<u-button @click="goto(`bill/detail?id=${222}`)" shape="circle" type="primary" :plain="true"
custom-style="height: 54rpx;margin-left: 12rpx;">去付款</u-button>
</u-row>
</view>
</u-row>
</view>
</view>
</tpx-scroll-view>
</view>
</template>
</tpx-layout>
<!-- 日历 -->
<!-- @close="handleSwitchCladar()" -->
<!-- <u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="tmpSearchParam.date.split('~')" @confirm="handleClaOk" @close="handleSwitchCladar"
></u-calendar> -->
</tpx-page>
</template>
<script>
import * as apiService from "@/common/api"
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
export default {
props: {
},
computed: {
dicData() {
return this.$store.getters.dicData
},
hasExtSchParam() {
let hasExt = false
const searchParam = this.searchParam
if(
(searchParam.postStatus && searchParam.postStatus.length > 0)
|| (searchParam.payType && searchParam.payType.length > 0)
|| (searchParam.date || (searchParam.dateType && searchParam.dateType != dateTypeEnum.custom) )
) {
hasExt = true
}
return hasExt
},
},
components: { BpdSendRecieverTmp },
data() {
let { dicData } = this.$store.getters
return {
showSearchMore: false,
showCladar: false,
tmpSearchParam: {
},
searchParam: {
keyword: '',
ordStatus: dicData.emis_order_status?.[0]?.val
},
queryOption: {
},
resData: {
list: []
}
}
},
onShareAppMessage() {
return {
}
},
onLoad(option) {
this.queryOption = option
this.initData();
},
onUnload() {
},
methods: {
getListFun: apiService.getOrderList,
initData(){
},
async handleDealItem(item, deal = { type: '1' }) {
let itemQuery = `?billCode=${item.billCode || ''}&orderSn=${item.orderSn || ''}`
switch (deal.type){
case 1: // 跳转
this.goto(`post/detail${itemQuery}`)
break;
case 2: // 复制订单号
this.setClipboardData(item.billCode || item.orderSn)
break;
case 3: // 删除
await this.confirmModal('确认要删除吗?')
break;
case 4: // 取消
await this.confirmModal('确认要取消吗?')
break;
default:
break;
}
},
handleSearchParamChange() {
}
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
.customer_nav_bar {
// padding-top: --status-bar-height;
padding-top: 80rpx;
background-color: #B12D29;
position: relative;
}
</style>
<style scoped lang="scss">
.pgb-cont{
padding: 30rpx;
}
.ord-list-item{
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>