261 lines
9.6 KiB
Vue
261 lines
9.6 KiB
Vue
<template>
|
|
<page-meta :page-style="'overflow:'+(ifShowPageMeta?'hidden':'visible')"></page-meta>
|
|
<view>
|
|
<!-- 顶部操作条 -->
|
|
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
|
<block slot="backText">返回</block>
|
|
<block slot="content">服务订单详情</block>
|
|
</cu-custom>
|
|
<!-- 任务进度跟踪 -->
|
|
<view v-if="servDetail.orderStatus === 3" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm">
|
|
<uni-collapse v-model="value">
|
|
<uni-collapse-item :open="true">
|
|
<template v-slot:title>
|
|
<view class="cu-bar">
|
|
<view class="action bar-first-action">
|
|
<text class="cuIcon-titles text-main-color"></text> 任务进度跟踪
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<view class="cu-timeline">
|
|
<view class="cu-item text-main-color" v-for="(item, index) in servDetail.taskTraceLine">
|
|
<view class="content shadow-blur" :class="index === 0 ? 'bg-main-color light' : 'bg-gray'">
|
|
<text class="margin-right">{{item.time}}</text>
|
|
<text>{{item.action}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse>
|
|
</view>
|
|
<!-- 服务单概况 -->
|
|
<view class="bg-white margin-lr-sm margin-top-sm padding">
|
|
<view class="flex align-center">
|
|
<text class="text-xl margin-right">{{servDetail.goodsName}}</text>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus === 5">已完成</view>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus === 4">待确认</view>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus === 3">服务中</view>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus === 2">待上门</view>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus === 1">未约/未排</view>
|
|
</view>
|
|
<!-- <view class="margin-top-sm">
|
|
<view v-for="(item, index) in servDetail.mainServOrder.orderTag" class='cu-tag radius margin-right-sm'>
|
|
{{item}}</view>
|
|
</view> -->
|
|
<view class="margin-top-sm">
|
|
<text class="cuIcon-location text-main-color margin-right-xs"></text>
|
|
<text>{{servDetail.address}}</text>
|
|
</view>
|
|
<view class="margin-top-sm">
|
|
<text class="cuIcon-people text-main-color margin-right-xs"></text>
|
|
<text class="margin-right-sm">{{servDetail.customerName}}</text>
|
|
<text>{{servDetail.customerPhone}}</text>
|
|
</view>
|
|
<view class="margin-top-sm">
|
|
<text class="cuIcon-time text-main-color margin-right-xs"></text>
|
|
<text>预约时间:{{servDetail.expectTimeStart + '~' + servDetail.expectTimeEnd}}</text>
|
|
</view>
|
|
<!-- <view class="margin-top-sm">
|
|
<text class="cuIcon-time text-main-color margin-right-xs"></text>
|
|
<text>排单时间:{{servDetail.mainServOrder.boodTime}}</text>
|
|
</view> -->
|
|
<view class="margin-top-sm" v-if="servDetail.orderStatus >= 3">
|
|
<text class="cuIcon-time text-main-color margin-right-xs"></text>
|
|
<text>上门时间:{{servDetail.workBeginTime}}</text>
|
|
</view>
|
|
<view class="margin-top-sm">
|
|
<text class="cuIcon-moneybag text-main-color margin-right-xs"></text>
|
|
<text>任务金额:</text>
|
|
<text class="text-price">{{servDetail.payMoney}}</text>
|
|
</view>
|
|
<view class="margin-top-sm" v-if="servDetail.customerRemark">
|
|
<text class="cuIcon-message text-main-color margin-right-xs"></text>
|
|
<text>备注:{{servDetail.customerRemark}}</text>
|
|
</view>
|
|
<!-- <view class="margin-top-xs text-sm text-gray"
|
|
v-for="(item, index) in servDetail.mainServOrder.gratuityRecord">
|
|
追加费用:<text class="text-price">{{item.price}}</text>[{{item.type}}]
|
|
</view> -->
|
|
</view>
|
|
<!-- 待服务列 -->
|
|
<view class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm">
|
|
<view class="cu-bar solid-bottom">
|
|
<view class="action bar-first-action">
|
|
<text class="cuIcon-titles text-main-color"></text> 商品信息
|
|
</view>
|
|
</view>
|
|
<view class="margin-top-sm">
|
|
<product-picked :product="servDetail" :pickedList="servDetail.standardList" :columnTitleArr="servingColumnHeaders" :valFieldArr="servingValFields"></product-picked>
|
|
</view>
|
|
</view>
|
|
<!-- 完成记录 -->
|
|
<view v-if="[0, 1].indexOf(servDetail.orderStatus) === -1" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm" v-for="(item, index) in servDetail.standardList">
|
|
<view class="cu-bar solid-bottom">
|
|
<view class="action bar-first-action">
|
|
<text class="cuIcon-titles text-main-color"></text> 完成记录
|
|
</view>
|
|
<view class='cu-tag bg-purple radius light margin-right-sm' v-if="servDetail.orderStatus > 3">{{servDetail.workFinishTime}}</view>
|
|
</view>
|
|
<view class="margin-top-sm">
|
|
<product-picked :pickedList="[item]" :columnTitleArr="servedColumnHeaders" :valFieldArr="servedValFields"></product-picked>
|
|
</view>
|
|
</view>
|
|
<!-- 订单编码和时间 -->
|
|
<view class="bg-white margin-top-sm padding margin-lr-sm margin-bottom-with-bar">
|
|
<view v-if="[0, 1].indexOf(servDetail.orderStatus) !== -1">订单编码:{{servDetail.orderMasterCode}}</view>
|
|
<view v-else>订单编码:{{servDetail.orderDetailCode}}</view>
|
|
<view class="margin-top-xs">订单时间:{{servDetail.createTime}}</view>
|
|
</view>
|
|
<!-- 底部操作栏 -->
|
|
<view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderStatus === 2">
|
|
<!-- <view class="action" data-popup="orderManage" @click="togglePopup">
|
|
<view class="cuIcon-list"></view> 订单管理
|
|
</view>
|
|
<view class="action" data-modal="sendUrgentMsgModal" @click="showModal">
|
|
<view class="cuIcon-mail">
|
|
<view class="cu-tag badge" v-if="servDetail.talkMsgNum > 0">{{servDetail.talkMsgNum}}</view>
|
|
</view>
|
|
发送急报
|
|
</view> -->
|
|
<view class="action" data-popup="orderManage">
|
|
</view>
|
|
<view class="action" data-modal="sendUrgentMsgModal">
|
|
</view>
|
|
<view v-if="servDetail.orderStatus === 2" class="bg-main-color submit" @click="workBegin">立即上门</view>
|
|
</view>
|
|
<uni-popup ref="orderManage" type="bottom" @change="changePopupState">
|
|
<view class="bg-white text-center">
|
|
<view v-for="(menu,index) in orderManageMenu" class="padding solid-bottom" :data-action="menu.action" @click="clickOrderManageMenu">
|
|
{{menu.name}}
|
|
</view>
|
|
</view>
|
|
<!-- 底部占位 -->
|
|
<view class="cu-bar bg-white fixed-bottom-bar"></view>
|
|
</uni-popup>
|
|
<!-- 模态框 -->
|
|
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import productPicked from '@/components/goods-card/product-picked.vue';
|
|
import urgentMsg from '@/pages/order-manage/modal/urgent-msg.vue';
|
|
|
|
export default {
|
|
components: {
|
|
productPicked,
|
|
urgentMsg
|
|
},
|
|
data() {
|
|
return {
|
|
value: ['0'],
|
|
order: {},
|
|
servDetail: {},
|
|
finishRecord4Show: [],
|
|
servingColumnHeaders: ['购买型号', '购买量', '待服务'],
|
|
servedColumnHeaders: ['购买型号', '购买量', '已服务'],
|
|
servingValFields: ['standardName', 'standardNum', 'waitServerNum'],
|
|
servedValFields: ['standardName', 'standardNum', 'serverNum'],
|
|
ifShowPageMeta: false,
|
|
orderManageMenu: [{
|
|
name: '申请配件',
|
|
action: 'applyFittings'
|
|
}, {
|
|
name: '申请附加费',
|
|
action: ''
|
|
}, {
|
|
name: '拍照回单',
|
|
action: ''
|
|
}, {
|
|
name: '指派/撤回订单',
|
|
action: ''
|
|
}, {
|
|
name: '申请退单',
|
|
action: 'applyCancelOrder'
|
|
}],
|
|
sendUrgentMsgModal: false
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
if (options && options.order) {
|
|
this.order = JSON.parse(decodeURIComponent(options.order));
|
|
}
|
|
this.loadData();
|
|
},
|
|
methods: {
|
|
async loadData() {
|
|
let orderId = null;
|
|
let funName = null;
|
|
if ([0, 1].indexOf(this.order.orderStatus) !== -1) {
|
|
// 展示主单信息
|
|
orderId = this.order.orderMasterId;
|
|
funName = "getOrderMasterDetail";
|
|
} else {
|
|
// 展示子单信息
|
|
orderId = this.order.orderDetailId;
|
|
funName = "getOrderDetail";
|
|
}
|
|
let servDetailRes = await this.$request[funName]({
|
|
id: orderId
|
|
});
|
|
this.servDetail = servDetailRes.data;
|
|
},
|
|
changePopupState(e) {
|
|
this.ifShowPageMeta = e.show;
|
|
},
|
|
togglePopup(e) {
|
|
if (this.ifShowPageMeta) {
|
|
this.$refs[e.currentTarget.dataset.popup].close();
|
|
} else {
|
|
this.$refs[e.currentTarget.dataset.popup].open();
|
|
}
|
|
},
|
|
clickOrderManageMenu(e) {
|
|
this[e.currentTarget.dataset.action]();
|
|
},
|
|
applyFittings() {
|
|
console.log("申请配件")
|
|
},
|
|
applyCancelOrder() {
|
|
let params = {
|
|
orderInfo: this.servDetail.mainServOrder
|
|
}
|
|
console.log(params)
|
|
uni.navigateTo({
|
|
url: '/pages/order-manage/cancel-order?params=' + encodeURIComponent(JSON.stringify(params))
|
|
})
|
|
},
|
|
async workBegin() {
|
|
let curDate = new Date();
|
|
let formatCurDate = curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate()
|
|
+ ' ' + curDate.getHours() + ':' + curDate.getMinutes() + ':' + curDate.getSeconds();
|
|
let params = {
|
|
id: this.servDetail.orderDetailId,
|
|
orderStatus: 3,
|
|
workBeginTime: formatCurDate
|
|
}
|
|
let res = await this.$request.updateDetailOrder(params);
|
|
if (res && res.code === 0) {
|
|
this.loadData(this.servDetail.orderDetailId);
|
|
uni.showToast({
|
|
icon: 'success'
|
|
})
|
|
}
|
|
},
|
|
showModal(e) {
|
|
this[e.currentTarget.dataset.modal] = true;
|
|
},
|
|
hideModal(e) {
|
|
this[e.currentTarget.dataset.modal] = false;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.bar-first-action {
|
|
margin-left: unset !important;
|
|
font-size: 30rpx !important;
|
|
}
|
|
</style>
|