<template>
|
<!-- <up-sticky bgColor="#fff">
|
<view class="c-p-18">
|
<up-input v-model="contentVal">
|
<template #suffix>
|
<up-button @tap="reservation" text="预约送货" type="primary" size="mini"></up-button>
|
</template>
|
</up-input>
|
</view>
|
</up-sticky> -->
|
<view class="c-p-b-100">
|
<view class="c-p-l-20 c-p-r-20" v-if="orderList&&orderList.length>0">
|
<view class="listrecord c-p-t-20" v-for="(item,index) in orderList" :key="item.keyid">
|
<view class="coreshop-ff chuany-bradius20">
|
|
<view class="chuany-font26">
|
<view class="chuany-flex chuany-justify-between">
|
<text class="chuany-width5">{{index+1}}</text>
|
<view class="chuany-width15">
|
{{$util.formatDate(item.createTime,'riqi')}}
|
</view>
|
<view class="chuany-width65">
|
<u-text size='14' :text="item.remark" lines="1">
|
</u-text>
|
</view>
|
<u-text align="right" size='14' type="error" text="未受理" @click='accept(item)'>
|
</u-text>
|
</view>
|
<view class="c-p-t-8">
|
<u--text :lines="1" :text="item.planContent"></u--text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<up-loadmore :status="loadStatus" />
|
</view>
|
<view v-else>
|
<up-empty text='暂无' icon="/static/order.png">
|
</up-empty>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
mapActions,
|
mapGetters,
|
mapMutations
|
} from 'vuex'
|
export default {
|
data() {
|
return {
|
orderList: [],
|
loadStatus: 'loadmore',
|
pageIndex: 1,
|
pageSize: 30,
|
contentVal: '',
|
options2: [{
|
text: '编辑',
|
style: {
|
backgroundColor: '#3c9cff'
|
}
|
}, {
|
text: '删除',
|
style: {
|
backgroundColor: '#f56c6c'
|
}
|
}],
|
}
|
},
|
onShow() {
|
this.init()
|
},
|
onPullDownRefresh() {
|
this.init()
|
uni.stopPullDownRefresh();
|
},
|
onReachBottom() {
|
if (this.loadStatus != 'nomore') {
|
this.getList()
|
}
|
},
|
computed: {
|
...mapGetters(['userInfo', 'identity']),
|
isAdmin() {
|
return this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false
|
},
|
|
},
|
methods: {
|
init() {
|
this.pageIndex = 1
|
this.pageSize = 30
|
this.loadStatus = 'loadmore'
|
this.orderList = []
|
this.contentVal = ''
|
this.getList()
|
},
|
reservation() {
|
this.$api.CreatAppointmentDeliver({
|
remark: this.contentVal
|
}).then(res => {
|
if (res.code == 1) {
|
this.contentVal = ''
|
this.init()
|
}
|
})
|
},
|
getList() {
|
let data = {
|
deliverState: 0,
|
page: {
|
pageIndex: this.pageIndex,
|
pageSize: this.pageSize,
|
}
|
}
|
this.$api.driverGetListAppointmentDeliverList(data).then(res => {
|
console.log(res, res.code, '-----------123’');
|
if (res.code == 1) {
|
if (this.pageIndex == 1) {
|
this.orderList = res.data.data
|
} else {
|
this.orderList = this.orderList.concat(...res.data.data)
|
}
|
console.log(this.orderList, 'orderList’');
|
// totalPages = res.data.totalCount
|
// 根据count数量判断是否还有数据
|
if (res.data.page.totalCount > this.orderList.length) {
|
this.loadStatus = 'loadmore'
|
this.pageIndex++
|
} else {
|
// 数据已加载完毕
|
this.loadStatus = 'nomore'
|
}
|
} else {
|
// _that.$refs.uToast.show({ message: res.msg, type: 'error' });
|
}
|
})
|
},
|
accept(item) {
|
let that = this
|
uni.showModal({
|
title: '提示',
|
content: '确认受理该送货吗?',
|
success: function(res) {
|
if (res.confirm) {
|
// 执行确认后的操作
|
that.$api.AcceptAppointmentDeliver(item.keyid).then(req => {
|
if (req.code == 1) {
|
that.$util.showToast({
|
title: '受理成功!'
|
})
|
that.init()
|
} else {
|
that.$util.showToast({
|
title: req.error
|
})
|
}
|
})
|
} else {
|
// 执行取消后的操作
|
}
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|