后台接口对接
This commit is contained in:
parent
6fdd9601aa
commit
23cc668c03
|
|
@ -300,7 +300,11 @@ export default {
|
|||
let res = await uni.request({
|
||||
url: '/worker/team/getTeamList',
|
||||
method: 'POST',
|
||||
data: params
|
||||
data: params,
|
||||
header: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
|
|
@ -345,5 +349,17 @@ export default {
|
|||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async qryMasterOrderPage(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/master/app/list',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
header: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,13 @@
|
|||
<!-- tab content -->
|
||||
<view class="padding bg-white margin-top-sm margin-lr-sm" v-for="(order, index) in orderList">
|
||||
<view class="flex justify-between">
|
||||
<view class="text-lg text-bold text-cut">{{order.title}}</view>
|
||||
<view class="text-lg text-bold text-cut">{{order.orderGoods.goodsName}}</view>
|
||||
<!-- 不同状态订单使用不同角标 -->
|
||||
<view v-if="order.state === 'newOrder'" class="right-tag padding-lr-sm padding-tb-xs bg-cyan">新</view>
|
||||
<view v-else-if="order.subState === 'waitArrange'" class="right-tag padding-lr-sm padding-tb-xs bg-main-color">未</view>
|
||||
<view v-else-if="order.subState === 'waitToServ'" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">待</view>
|
||||
<view v-else-if="order.subState === 'waitServing' || order.subState === 'afterSaleService'" class="right-tag padding-lr-sm padding-tb-xs bg-purple">服</view>
|
||||
<view v-else-if="order.subState === 'finishing'" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">确</view>
|
||||
<view v-if="order.orderStatus === 0" class="right-tag padding-lr-sm padding-tb-xs bg-cyan">新</view>
|
||||
<view v-else-if="order.orderStatus === 1" class="right-tag padding-lr-sm padding-tb-xs bg-main-color">未</view>
|
||||
<view v-else-if="order.orderStatus === 2" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">待</view>
|
||||
<view v-else-if="order.orderStatus === 3 || order.orderStatus === 6" class="right-tag padding-lr-sm padding-tb-xs bg-purple">服</view>
|
||||
<view v-else-if="order.orderStatus === 4" class="right-tag padding-lr-sm padding-tb-xs bg-yellow">确</view>
|
||||
</view>
|
||||
<view>
|
||||
<view v-for="(tag, index1) in order.tags" v-if="tag.level === 'error'" class='cu-tag margin-right-xs radius line-red margin-top-xs'>{{tag.content}}</view>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
||||
<text>服务时间:{{order.servTime}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center" v-if="order.subState === 'waitToServ'">
|
||||
<view class="margin-top-sm flex justify-start align-center" v-if="order.orderStatus === 2">
|
||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-repair"></text></text>
|
||||
<text>距上门:</text>
|
||||
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
:second="$dateUtil.countDownDiff(order.deadlineDate).seconds">
|
||||
</uni-countdown>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center" v-if="order.subState === 'finishing' && order.chargeReachDate">
|
||||
<view class="margin-top-sm flex justify-start align-center" v-if="order.subState === 4 && order.chargeReachDate">
|
||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
||||
<text>距到帐:</text>
|
||||
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
|
||||
|
|
@ -119,23 +119,23 @@
|
|||
</uni-countdown>
|
||||
</view>
|
||||
<!-- 不同状态订单支持不同操作按钮 -->
|
||||
<view v-if="order.state === 'newOrder'">
|
||||
<view v-if="order.orderStatus === 0">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @tap="togglePopup($event, index)">派单</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">改价</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">转发</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">确认接单</button>
|
||||
</view>
|
||||
<view v-if="order.subState === 'waitArrange'">
|
||||
<view v-if="order.orderStatus === 1">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @tap="togglePopup($event, index)">派单</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showTimeArrangeModal" @tap="showModal($event, index)">预约时间</button>
|
||||
</view>
|
||||
<view v-if="order.subState === 'waitToServ'">
|
||||
<view v-if="order.orderStatus === 2">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail('waitToServ')">查看</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, index)">修改时间</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
|
||||
</view>
|
||||
<view v-if="order.subState === 'waitServing'">
|
||||
<view v-if="order.orderStatus === 3">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail('waitServing')">查看</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, index)">改价</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
|
||||
|
|
@ -143,10 +143,10 @@
|
|||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)">拍照回单</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" @tap="makePayQrcode($event, index)">生成付款码</button>
|
||||
</view>
|
||||
<view v-if="order.subState === 'finishing'">
|
||||
<view v-if="order.orderStatus === 4">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="sendUrgentMsgModal" @tap="showModal($event, index)">师傅急报</button>
|
||||
</view>
|
||||
<view v-if="order.subState === 'afterSaleService'">
|
||||
<view v-if="order.orderStatus === 'afterSaleService'">
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, index)">修改时间</button>
|
||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
|
||||
|
|
@ -198,11 +198,12 @@
|
|||
<button class="cu-btn sm bg-yellow margin-right-sm" v-else disabled type="">已同意</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-sm solid-top padding-top-sm" v-if="Boolean(order.comments)">
|
||||
<view class="margin-top-sm solid-top padding-top-sm" v-if="Boolean(order.remark)">
|
||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-comment"></text></text>
|
||||
<text>备注:{{order.comments}}</text>
|
||||
<text>备注:{{order.remark}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<load-status-bar ref="loadStatusBar"></load-status-bar>
|
||||
<!-- 模态框 -->
|
||||
<time-arrange :show="showTimeArrangeModal" :data="curOrder"></time-arrange>
|
||||
<time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail>
|
||||
|
|
@ -235,6 +236,7 @@
|
|||
import payQrcode from '@/pages/order-manage/modal/pay-qrcode.vue';
|
||||
import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue';
|
||||
import picModal from '@/components/modal/pic-modal.vue';
|
||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -246,7 +248,8 @@
|
|||
newServPrice,
|
||||
payQrcode,
|
||||
urgentMsg,
|
||||
picModal
|
||||
picModal,
|
||||
loadStatusBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -285,17 +288,18 @@
|
|||
code: 3,
|
||||
name: '服务中'
|
||||
}, {
|
||||
code: 4,
|
||||
code: 6,
|
||||
name: '确认中'
|
||||
}, {
|
||||
code: 5,
|
||||
code: '-',
|
||||
name: '售后中'
|
||||
}, {
|
||||
code: 6,
|
||||
code: 4,
|
||||
name: '已完成'
|
||||
}],
|
||||
myOrders: {},
|
||||
orderList: [],
|
||||
pageParams: [],
|
||||
curOrder: {},
|
||||
myTeamMembers: [],
|
||||
scrollLeft: 0,
|
||||
|
|
@ -324,9 +328,50 @@
|
|||
let myTeamInfo = await this.$api.data('myTeamInfo');
|
||||
this.myTeamMembers = myTeamInfo.members;
|
||||
this.myOrders = await this.$api.data('myOrders');
|
||||
this.orderList = this.myOrders.orderList;
|
||||
// this.orderList = this.myOrders.orderList;
|
||||
this.areaList = await this.$api.data('areaList');
|
||||
this.categoryList = await this.$api.data('categoryList');
|
||||
this.categoryList = await this.$api.data('categoryList');
|
||||
|
||||
for(let i = 0; i < this.subStateList.length; i++) {
|
||||
this.pageParams.push({
|
||||
pageNum: 0
|
||||
});
|
||||
}
|
||||
// 初始化订单列表
|
||||
this.loadMasterOrderPage({
|
||||
orderStatus: this.subStateList[0].code
|
||||
});
|
||||
},
|
||||
reloadMasterOrderPage(params = {}) {
|
||||
this.pageParams = [];
|
||||
for(let i = 0; i < this.subStateList.length; i++) {
|
||||
this.pageParams.push({
|
||||
pageNum: 0
|
||||
});
|
||||
}
|
||||
this.orderList = [];
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
this.loadMasterOrderPage(params);
|
||||
},
|
||||
async loadMasterOrderPage(params = {}) {
|
||||
params.pageNum = this.pageParams[this.tabCur].pageNum;
|
||||
params.pageSize = this.$globalData.initPageSize;
|
||||
this.$refs.loadStatusBar.showLoading();
|
||||
try {
|
||||
let res = await this.$request.qryMasterOrderPage(params);
|
||||
let rowsLength = res.rows.length;
|
||||
if (rowsLength > 0) {
|
||||
this.orderList = this.orderList.concat(res.rows);
|
||||
this.pageParams[this.tabCur].pageNum++;
|
||||
if (rowsLength === this.pageSize) {
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
}
|
||||
}
|
||||
this.$refs.loadStatusBar.showLoadOver();
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
this.$refs.loadStatusBar.showLoadErr();
|
||||
}
|
||||
},
|
||||
bindEvent() {
|
||||
uni.$on(this.$globalFun.SHOW_ARRANGE_FAIL_TIME, this.showArrangeFailTime);
|
||||
|
|
@ -361,7 +406,10 @@
|
|||
tabSelect(e) {
|
||||
this.tabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
||||
this.loadData(this.stateCur, this.subStateList[this.tabCur].code);
|
||||
// this.reloadMasterOrderPage(this.stateCur, this.subStateList[this.tabCur].code);
|
||||
this.reloadMasterOrderPage({
|
||||
orderStatus: this.subStateList[this.tabCur].code
|
||||
});
|
||||
},
|
||||
statusSelect(e) {
|
||||
this.stateCur = e.currentTarget.dataset.id;
|
||||
|
|
@ -432,10 +480,10 @@
|
|||
})
|
||||
},
|
||||
updateRefundStatus(status, index) {
|
||||
this.myOrders.orderList[index].refundStatus = status;
|
||||
this.orderList[index].refundStatus = status;
|
||||
},
|
||||
updateAfterSaleDealStatus(status, index) {
|
||||
this.myOrders.orderList[index].afterSaleDealStatus = status;
|
||||
this.orderList[index].afterSaleDealStatus = status;
|
||||
},
|
||||
async showAfterSalePic() {
|
||||
// TODO:查询该售后单中的拒绝原因中上传的截图
|
||||
|
|
|
|||
Loading…
Reference in New Issue