|
|
|
@ -2,28 +2,24 @@ |
|
|
|
<view> |
|
|
|
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" /> |
|
|
|
|
|
|
|
<view class="item-wrapper"> |
|
|
|
<view class="ulList" v-if="bList.length > 0"> |
|
|
|
<ul> |
|
|
|
<li v-for="(item,index ) in bList" :key="index"> |
|
|
|
<uni-card :title="'店铺名称:张三的店'" :sub-title="'明珠早市馆15001 (13521420172)'"> |
|
|
|
<view class="uni-body" @tap="goPhone"> |
|
|
|
<text class="cardText">德邦物流:</text> |
|
|
|
<text style="color: blue;text-decoration-line: underline;">15014256321</text> |
|
|
|
</view> |
|
|
|
<view class="uni-body"> |
|
|
|
<text class="cardText"> 下单时间:</text> |
|
|
|
<text class="priceText"> 2023-11-29 12:00:01</text> |
|
|
|
</view> |
|
|
|
<view class="uni-body"> |
|
|
|
<text class="cardText"> 订单状态:</text> |
|
|
|
待送达 |
|
|
|
</view> |
|
|
|
</uni-card> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item-wrapper"> |
|
|
|
<view class="ulList" v-if="bList.length > 0"> |
|
|
|
<ul> |
|
|
|
<li v-for="(item,index ) in bList" :key="index"> |
|
|
|
<uni-card :title="'店铺名称:'+item.shopName" :sub-title="item.getOrderAddress+'('+item.mobile+')'"> |
|
|
|
<view class="uni-body"> |
|
|
|
<text class="cardText">{{item.orderAddress}}</text> |
|
|
|
</view> |
|
|
|
<view class="uni-body"> |
|
|
|
<text class="cardText"> 下单时间:</text> |
|
|
|
<text class="priceText"> {{item.createTime}}</text> |
|
|
|
</view> |
|
|
|
</uni-card> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-loadmore :status="status" /> |
|
|
|
<u-modal :show="modalShow" title="详细地址" :content='content' @confirm="modalShow = false"></u-modal> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -33,149 +29,92 @@ |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
range: '', |
|
|
|
name: '', |
|
|
|
shopList: [], |
|
|
|
return { |
|
|
|
range:[], |
|
|
|
modalShow: false, |
|
|
|
content: '地址地址地址', |
|
|
|
query: { |
|
|
|
saleVO: { |
|
|
|
searchDateVo: { |
|
|
|
endDate: '', |
|
|
|
startDate: '' |
|
|
|
}, |
|
|
|
transCompany: '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
bList:[] |
|
|
|
orderStatus:0, |
|
|
|
status: 'loadmore', |
|
|
|
endDate: '', |
|
|
|
startDate: '', |
|
|
|
transCompany: '', |
|
|
|
totalPages:0, |
|
|
|
pages:1, |
|
|
|
bList:[], |
|
|
|
id:'', |
|
|
|
type:'', |
|
|
|
companyName:'', |
|
|
|
} |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
if (this.pages >= this.totalPages) return; |
|
|
|
this.status = 'loading'; |
|
|
|
this.pages = ++this.pages; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
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() |
|
|
|
this.getAllList() |
|
|
|
onShow() { |
|
|
|
this.getMonth(); |
|
|
|
this.id = uni.getStorageSync('transCompany') |
|
|
|
this.companyName = uni.getStorageSync('companyName') |
|
|
|
this.type = uni.getStorageSync('isOnLine') |
|
|
|
this.transCompany = this.id |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
sectionChange(index) { |
|
|
|
this.current = index |
|
|
|
this.bList = [] |
|
|
|
if (index == 0) { |
|
|
|
this.getAllList() |
|
|
|
} |
|
|
|
if (index == 1) { |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
if (index == 2) { |
|
|
|
this.getReturnList() |
|
|
|
} |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
this.tui.request('/app/sale/listAll', 'post', { |
|
|
|
remarkSR:2, |
|
|
|
shopId: this.shopId, |
|
|
|
searchDateVo: this.query |
|
|
|
}, false, false, false).then(res => { |
|
|
|
if (res.code !== 200) return |
|
|
|
this.bList = res.result |
|
|
|
}) |
|
|
|
}, |
|
|
|
getAllList() { |
|
|
|
this.tui.request('/app/sale/listAll', 'post', { |
|
|
|
remarkSR:2, |
|
|
|
shopId: this.shopId, |
|
|
|
searchDateVo: this.query |
|
|
|
}, false, false, false).then(res => { |
|
|
|
if (res.code !== 200) return |
|
|
|
this.bList = res.result.saleList |
|
|
|
this.status = 'loading'; |
|
|
|
uni.request({ |
|
|
|
url: this.tui.interfaceUrl() + '/order/getByCondition', |
|
|
|
data: { |
|
|
|
orderStatus:4, |
|
|
|
endDate: this.range[1], |
|
|
|
startDate: this.range[0], |
|
|
|
transCompany: this.transCompany, |
|
|
|
pageNumber:this.pages, |
|
|
|
pageSize:10 |
|
|
|
}, |
|
|
|
header: { |
|
|
|
'content-type': 'application/x-www-form-urlencoded', |
|
|
|
'appWLToken': this.tui.getToken() |
|
|
|
}, |
|
|
|
method: 'GET', //'GET','POST' |
|
|
|
dataType: 'json', |
|
|
|
success: (res) => { |
|
|
|
this.status = 'nomore'; |
|
|
|
if (res.data.code == 200){ |
|
|
|
this.bList = res.data.result.content |
|
|
|
if (this.pages == 1) { |
|
|
|
this.bList = res.data.result.content |
|
|
|
} else { |
|
|
|
this.bList = [...this.bList, ...res.data.result.content] |
|
|
|
} |
|
|
|
this.totalPages = res.data.result.totalPages |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
this.tui.toast("网络不给力,请稍后再试~") |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getReturnList() { |
|
|
|
this.tui.request('/app/sale/listAll', 'post', { |
|
|
|
remarkSR:3, |
|
|
|
shopId: this.shopId, |
|
|
|
searchDateVo: this.query |
|
|
|
}, false, false, false).then(res => { |
|
|
|
if (res.code !== 200) return |
|
|
|
this.bList = res.result.returnSaleList |
|
|
|
}) |
|
|
|
}, |
|
|
|
dateChange() { |
|
|
|
this.query.startDate = this.range[0] |
|
|
|
this.query.endDate = this.range[1] |
|
|
|
this.sectionChange(this.current) |
|
|
|
}, |
|
|
|
gotoInfo() { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/index/shopInfo` |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
gotoSearchData() { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/other/logisticsDetail' |
|
|
|
}) |
|
|
|
}, |
|
|
|
getShopList() { |
|
|
|
const that = this |
|
|
|
uni.request({ |
|
|
|
url: tui.interfaceUrl() + '/app/sale/listCompany', |
|
|
|
data: this.query.saleVO, |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
|
'appWLToken': tui.getToken() |
|
|
|
}, |
|
|
|
method: 'post', |
|
|
|
dataType: 'json', |
|
|
|
success: (res) => { |
|
|
|
that.shopList = res.data.result |
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
tui.toast("网络不给力,请稍后再试~") |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onCellClick(item) { |
|
|
|
this.modalShow = true |
|
|
|
this.content = item.receiveAddress |
|
|
|
}, |
|
|
|
onDatePackerChange(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; |
|
|
|
}, |
|
|
|
goPhone(){ |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: '13521030702' |
|
|
|
}); |
|
|
|
}, |
|
|
|
//获取当月1日到当前时间 |
|
|
|
getMonth() { |
|
|
|
//获取新的时间 |
|
|
|
let date = new Date() |
|
|
|
//获取当前时间的年份转为字符串 |
|
|
|
let year = date.getFullYear().toString() //'年' |
|
|
|
//获取月份,由于月份从0开始,此处要加1,判断是否小于10,如果是在字符串前面拼接'0' |
|
|
|
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月' |
|
|
|
//获取天,判断是否小于10,如果是在字符串前面拼接'0' |
|
|
|
let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日' |
|
|
|
//字符串拼接,开始时间,结束时间 |
|
|
|
let end = year + '-' + month + '-' + da //当天 |
|
|
|
let beg = year + '-' + month + '-01' //当月第一天 |
|
|
|
this.range = [beg,end] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|