You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
4.2 KiB
147 lines
4.2 KiB
<template>
|
|
<view>
|
|
<uni-section class="mb-10" title="历史订单" type="line">
|
|
<uni-datetime-picker v-model="range" type="date" @change="onDatePackerChange"/>
|
|
</uni-section>
|
|
<view class="item-wrapper">
|
|
<u-cell-group>
|
|
<u-cell @click="onCellClick(item)" :label="item.createTime" v-for="(item,index) in shopList" :key="index">
|
|
<view slot="title">
|
|
<view class="text">下单店铺:{{item.shopName}}</view>
|
|
<view class="text">收货地址:{{item.receiveAddress}}</view>
|
|
<view class="text">联系电话:{{item.recPhone}}</view>
|
|
<view class="text">物流人员:{{item.customerName}}</view>
|
|
</view>
|
|
</u-cell>
|
|
</u-cell-group>
|
|
</view>
|
|
<u-modal :show="modalShow" title="详细地址" :content='content' @confirm="modalShow = false"></u-modal>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import tui from '../../common/httpRequest.js'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
range: '',
|
|
name: '',
|
|
shopList: [],
|
|
modalShow: false,
|
|
content: '地址地址地址',
|
|
query: {
|
|
saleVO: {
|
|
searchDateVo: {
|
|
endDate: '',
|
|
startDate: ''
|
|
},
|
|
transCompany:''
|
|
},
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
const id = uni.getStorageSync('transCompany')
|
|
const date = this.formatDate(new Date(), 'YYYY-MM-DD')
|
|
this.query.saleVO.searchDateVo.startDate = date + ' 00:00:00'
|
|
this.query.saleVO.searchDateVo.endDate = date + ' 23:59:59'
|
|
this.query.saleVO.transCompany = id
|
|
this.range = date
|
|
this.getShopList()
|
|
},
|
|
methods: {
|
|
getShopList() {
|
|
// this.tui.request('/app/sale/listCompany', 'POST', {}, false, true, false).then(res => {
|
|
// if (res.code !== 200) return
|
|
// this.shopList = res.result.map((v) => {
|
|
// return {
|
|
// text: v.shopName,
|
|
// value: v.id
|
|
// }
|
|
// })
|
|
// })
|
|
const that = this
|
|
uni.request({
|
|
url: tui.interfaceUrl() + '/app/sale/listCompany',
|
|
data: this.query.saleVO,
|
|
header: {
|
|
'content-type': 'application/json',
|
|
// 'Authorization': tui.getToken()
|
|
'appWLToken': tui.getToken()
|
|
},
|
|
method: 'post', //'GET','POST'
|
|
dataType: 'json',
|
|
success: (res) => {
|
|
that.shopList = res.data.result
|
|
console.log(res)
|
|
},
|
|
fail: (res) => {
|
|
tui.toast("网络不给力,请稍后再试~")
|
|
console.log(res)
|
|
}
|
|
})
|
|
},
|
|
onCellClick(item) {
|
|
this.modalShow = true
|
|
this.content = item.receiveAddress
|
|
console.log('item', item)
|
|
},
|
|
onDatePackerChange(date) {
|
|
console.log(date)
|
|
if (!date) {
|
|
this.query.saleVO.searchDateVo.startDate = ''
|
|
this.query.saleVO.searchDateVo.endDate = ''
|
|
}else {
|
|
this.query.saleVO.searchDateVo.startDate = date + ' 00:00:00'
|
|
this.query.saleVO.searchDateVo.endDate = date + " 23:59:59"
|
|
}
|
|
this.getShopList()
|
|
},
|
|
formatDate(date, fmt) {
|
|
var o = {
|
|
'M+': date.getMonth() + 1, //月份
|
|
'D+': date.getDate(), //日
|
|
'H+': date.getHours(), //小时
|
|
'm+': date.getMinutes(), //分
|
|
's+': date.getSeconds(), //秒
|
|
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
|
|
'S': date.getMilliseconds() //毫秒
|
|
};
|
|
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
for (var k in o)
|
|
if (new RegExp('(' + k + ')').test(fmt))
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
return fmt;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.example-body {
|
|
}
|
|
|
|
.shop-choose {
|
|
padding: 25upx 15upx;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
|
|
.shop-name {
|
|
flex-basis: 150upx;
|
|
}
|
|
}
|
|
|
|
.item-wrapper {
|
|
margin-top: 24upx;
|
|
background-color: #fff;
|
|
overflow: hidden;
|
|
}
|
|
.text {
|
|
width: 600upx;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
}
|
|
</style>
|
|
|