dingdong-master/pages/order-manage/order-manage-parts.vue

2109 lines
99 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<page-meta :page-style="'overflow:'+(ifShowPageMeta?'hidden':'visible')"></page-meta>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">商品订单</block>
</cu-custom>
<view class="sticky-bar" :style="[{top: stickyTop + 'px'}]">
<!-- 条件筛选栏 -->
<view class="padding-tb bg-white solid-bottom">
<view class="flex justify-start align-center padding-lr">
<text class="margin-right-xs inline-lable">全部</text>
<!-- <my-uni-combox class="inline-combox margin-right-xs" :candidates="stateList" placeholder="请选择"
v-model="formData.state"></my-uni-combox>
<my-uni-combox class="inline-combox" :candidates="subStateList" placeholder="请选择"
v-model="formData.subState"></my-uni-combox> -->
<!-- 区域筛选picker -->
<picker class="inline-combox margin-right-xs" :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" :value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
<input class="radius-input" disabled :value="formData.area ? formData.area[0].areaName + '-' + formData.area[1].areaName + '-' + formData.area[2].areaName : ''"
placeholder="请选择区域"></input>
</picker>
<!-- 品类筛选picker -->
<picker class="inline-combox" :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
<input class="line-input radius-input" disabled :value="formData.category ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
placeholder="请选择品类"></input>
</picker>
</view>
<view class="flex justify-between align-center margin-top-xs padding-left">
<view class="flex justify-between align-center" style="flex-basis: 55%;">
<input class="line-input radius-input margin-right-sm" v-model="formData.orderKeywords"
placeholder="请输入订单关键字"></input>
<view class="text-xl text-bold">
<text class="cuIcon-search margin-right-sm" @click="searchOrder"></text>
<text class="cuIcon-refresh" @click="resetConditions"></text>
</view>
</view>
<view class="cu-list grid no-border col-2 padding-top-sm bg-white" style="flex-basis: 42%;">
<view class="cu-item" :class="index==stateCur?'bg-main-color light cur':''" v-for="(item,index) in stateList" :key="index" :data-id="index" @tap="statusSelect" v-if="item.code > 103">
<view class="margin-bottom-xs">{{item.name}}</view>
<view v-if="item.code === 105">({{orderStatistics.monitoredOrderNum}})</view>
<view v-else-if="item.code === 104">({{orderStatistics.shelvedOrderNum}})</view>
<view v-else>(0)</view>
</view>
</view>
</view>
</view>
<!-- 状态分类tab -->
<view class="cu-list grid no-border col-5 padding-top-sm bg-white">
<view class="cu-item" :class="index==stateCur?'bg-main-color light cur':''" v-for="(item,index) in stateList" :key="index" :data-id="index" @tap="statusSelect" v-if="item.code <= 103">
<view class="margin-bottom-xs">{{item.name}}</view>
<view v-if="item.code === 0">({{orderStatistics.newOrderNum}})</view>
<view v-else-if="item.code === 101">({{orderStatistics.tomorrowOrderNum}})</view>
<view v-else-if="item.code === 102">({{orderStatistics.todayOrderNum}})</view>
<view v-else-if="item.code === 103">({{orderStatistics.overTimeOrderNum}})</view>
<view v-else>(0)</view>
</view>
<!-- <view class="cu-item" :class="stateCur === 0 ? 'bg-main-color light' : ''" :data-id="0" @tap="statusSelect">
<view class="margin-bottom-xs">超时单</view>
<view>({{myOrders.summary.overtimeOrderNum}})</view>
</view>
<view class="cu-item" :class="stateCur === 1 ? 'bg-main-color light' : ''" :data-id="1" @tap="statusSelect">
<view class="margin-bottom-xs">今日单</view>
<view>({{myOrders.summary.todayOrderNum}})</view>
</view>
<view class="cu-item" :class="stateCur === 2 ? 'bg-main-color light' : ''" :data-id="2" @tap="statusSelect">
<view class="margin-bottom-xs">明日单</view>
<view>({{myOrders.summary.tomorrowOrderNum}})</view>
</view>
<view class="cu-item" :class="stateCur === 3 ? 'bg-main-color light' : ''" :data-id="3" @tap="statusSelect">
<view class="margin-bottom-xs">急报单</view>
<view>({{myOrders.summary.urgentMsgOrderNum}})</view>
</view>
<view class="cu-item" :class="stateCur === 0 ? 'bg-main-color light' : ''" :data-id="4" @tap="statusSelect">
<view class="margin-bottom-xs">新订单</view>
<view>({{myOrders.summary.newOrderNum}})</view>
</view> -->
</view>
<!-- 子状态分类tab -->
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true" :scroll-left="scrollLeft">
<view class="cu-item" :class="index==tabCur?'text-main-color cur':''" v-for="(item,index) in subStateList"
:key="index" @tap="tabSelect" :data-id="index">
<text class="margin-right-xs">{{item.name}}</text>
<text v-if="item.code === 1">({{orderStatistics.planOrderNum}})</text>
<text v-else-if="item.code === 2">({{orderStatistics.waitServOrderNum}})</text>
<text v-else-if="item.code === 3">({{orderStatistics.servingOrderNum}})</text>
<text v-else-if="item.code === 4">({{orderStatistics.waitSureOrderNum}})</text>
<text v-else-if="item.code === 5 && item.isChild">({{orderStatistics.finishedOrderNum}})</text>
<text v-else-if="item.code === 5 && !item.isChild">({{orderStatistics.finishedMasterOrderNum}})</text>
<text v-else-if="item.other === 0">({{orderStatistics.afterListNum}})</text>
<text v-else>(0)</text>
</view>
</scroll-view>
</view>
<!-- tab content -->
<view class="padding bg-white margin-top-sm margin-lr-sm" v-for="(order, index) in orderList" :key="index">
<view class="flex justify-between">
<view class="text-lg text-bold text-cut">{{order.goodsName}}</view>
<!-- 不同状态订单使用不同角标 -->
<template v-if="order.orderStatus === 0" >
<view v-if="order.orderDetailId == null" class="right-tag padding-lr-sm padding-tb-xs bg-cyan">未</view>
<view v-else class="right-tag padding-lr-sm padding-tb-xs bg-cyan">新</view>
</template>
<view v-else-if="([2, 5].indexOf(stateCur) >= 0 || tabCur === 4) && order.isMonitoredOrder" class="right-tag padding-lr-sm padding-tb-xs bg-orange">监</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" 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-orange">确</view>
<view v-else-if="order.orderStatus === 5" class="right-tag padding-lr-sm padding-tb-xs bg-green">完</view>
</view>
<view class="float-left">
<view v-if="order.goodsBrand" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>{{order.goodsBrand}}</view>
<view v-if="order.goodsSpecification" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>{{order.goodsSpecification}}</view>
</view>
<view class="float-left">
<view v-if="order.consultMode === '01'" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>合约单</view>
<view v-if="order.payType === 1 && order.consultMode !== '01'" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>到付单</view>
<template v-if="order.deliveryType">
<view v-if="order.deliveryType == 1" class='cu-tag margin-right-xs radius line-red margin-top-xs'>发快递/物流</view>
<view v-if="order.deliveryType == 2" class='cu-tag margin-right-xs radius line-red margin-top-xs'>送货上门</view>
<view v-if="order.deliveryType == 3" class='cu-tag margin-right-xs radius line-red margin-top-xs'>客户自提</view>
</template>
<template v-if="order.consultMode === '01'">
<view v-if="order.changeMoney" class='cu-tag margin-right-xs radius line-red margin-top-xs'>有待付款</view>
<view v-else class='cu-tag margin-right-xs radius line-red margin-top-xs'>款已付清</view>
</template>
<template v-else>
<view v-if="order.changeMoney || order.payStatus != 1" class='cu-tag margin-right-xs radius line-red margin-top-xs'>有待付款</view>
<view v-else class='cu-tag margin-right-xs radius line-red margin-top-xs'>款已付清</view>
</template>
<template v-if="order.insuranceId">
<view class='cu-tag margin-right-xs radius line-main-color margin-top-xs' v-if="order.orderStatus === 0">保险预备中</view>
<view class='cu-tag margin-right-xs radius line-main-color margin-top-xs' v-else-if="[1,2,3,4].includes(order.orderStatus)">保险已生效</view>
<view class='cu-tag margin-right-xs radius line-main-color margin-top-xs' v-else>保险已完结</view>
</template>
</view>
<view>
<view v-if="order.timeout == 1" class="float-left">
<view v-if="order.orderStatus === 0" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未接单</view>
<!-- <view v-else-if="order.orderStatus === 1 && order.isCall === '01'" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未预约</view> -->
<view v-else-if="order.orderStatus === 1" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未发货</view>
<!-- <view v-else-if="order.orderStatus === 1 && order.orderDetailId != null" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未预约</view> -->
<view v-else-if="order.orderStatus === 2" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未发货</view>
<!-- <view v-else-if="order.orderStatus === 3" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未完单</view> -->
</view>
<view class="float-left" v-if="order.afterTimeout == 1 && (order.orderDetailId != null || tabCur === 4)">
<view class='cu-tag margin-right-xs radius line-red margin-top-xs'>售后超时</view>
</view>
<!-- <view class="float-left" v-else-if="order.orderTimeoutRecords" v-for="(timeoutRecord, recordIndex) in order.orderTimeoutRecords">
<view v-if="timeoutRecord.orderStatus === 0" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未接单</view>
<view v-else-if="timeoutRecord.orderStatus === 1" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未预约</view>
<view v-else-if="timeoutRecord.orderStatus === 2" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未上门</view>
<view v-else-if="timeoutRecord.orderStatus === 3" class='cu-tag margin-right-xs radius line-red margin-top-xs'>超时未完单</view>
</view> -->
</view>
<view class="float-left" v-for="(afterServiceRecord, afterServiceRecordIndex) in order.afterServiceRecordList" :key="afterServiceRecord.id">
<template v-if="afterServiceRecord.customerFinalCheck === null && afterServiceRecord.customerReasonType">
<view v-if="afterServiceRecord.workerFeedbackResult === null" class='cu-tag margin-right-xs radius line-red margin-top-xs'>售后发起中</view>
<view v-else class='cu-tag margin-right-xs radius line-red margin-top-xs'>售后反馈中</view>
</template>
<view v-if="afterServiceRecord.workerFeedbackResult == 1 && afterServiceRecord.customerFinalCheck == null" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>售后已同意</view>
<view v-if="afterServiceRecord.workerFeedbackResult == 0 && afterServiceRecord.customerFinalCheck == null" class='cu-tag margin-right-xs radius line-red margin-top-xs'>售后已拒绝</view>
<view v-if="order.afterPlatformServiceStatus == 1" class='cu-tag margin-right-xs radius line-red margin-top-xs'>售后纠纷中</view>
<view v-if="afterServiceRecord.customerFinalCheck == 1 || afterServiceRecord.customerFinalCheck == 2" class='cu-tag margin-right-xs radius line-main-color margin-top-xs'>售后已完成</view>
</view>
<view class="float-clear"></view>
<view class="margin-top-sm order-name">
<view>
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-people"></text></text>
<text>姓名:{{order.customerName}}</text>
</view>
<view v-if="order.insuranceId">
<text style="padding-right: 20rpx;">保险要求</text>
<text class="text-main-color" data-modal="showInsuranceDetail" @click="showModal($event, order)"> 详情...</text>
</view>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-location"></text></text>
<text class="margin-right-xs">{{order.provinceName + order.cityName + order.countryName + order.streetName + order.address}}</text>
<text class="text-lg margin-right-xs" @tap="copyData(order.customerName + ' ' + order.customerPhone + ' ' + order.provinceName + order.cityName + order.countryName + order.streetName + order.address)"><text class="cuIcon-copy"></text></text>
<text class="text-main-color" v-if="order.isDeliveryToStore == 1" @tap="copyData(order.serviceShop.shopName + ' ' + order.serviceShop.phone + ' '+ order.serviceShop.provinceName + order.serviceShop.cityName + order.serviceShop.countryName + order.serviceShop.streetName + order.serviceShop.address)">提取店址</text>
</view>
<view class="margin-top-sm" v-if="order.isDeliveryToStore == 1">
<text class="text-main-color text-sm margin-right-xs">客户勾选发货至安装/服务店,建议先联系店铺后发货!</text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<!-- <text v-if="order.expectTimeEndFront">发货时间:{{order.expectTimeStartFront + '~' + order.expectTimeEndFront}}</text> -->
<text>预约时间:{{order.expectTimeStartFront}}</text>
</view>
<view class="margin-top-sm" v-if="order.orderDetailId != null && order.orderStatus > 2">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>发货时间:{{order.workBeginTime}}</text>
</view>
<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'"
:day="$dateUtil.countDownDiff(order.expectTimeStart).day"
:hour="$dateUtil.countDownDiff(order.expectTimeStart).hour"
:minute="$dateUtil.countDownDiff(order.expectTimeStart).min"
:second="$dateUtil.countDownDiff(order.expectTimeStart).seconds">
</uni-countdown>
</view>
<view class="margin-top-sm" v-if="order.orderDetailId != null && order.orderStatus > 3">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>完成时间:{{order.workFinishTime}}</text>
</view>
<view class="margin-top-sm flex justify-start align-center" v-if="order.orderStatus === 3">
<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'"
:day="$dateUtil.countDownDiff(order.confirmStartTime).day"
:hour="$dateUtil.countDownDiff(order.confirmStartTime).hour"
:minute="$dateUtil.countDownDiff(order.confirmStartTime).min"
:second="$dateUtil.countDownDiff(order.confirmStartTime).seconds">
</uni-countdown>
</view>
<template v-if="order.consultMode === '01' && order.orderStatus === 4 && order.payStatus != 1">
<view class="margin-top-sm flex justify-start align-center">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>距完单分帐:</text>
<text style="color: #e35b33;">合约单按期结算款项,请等待…</text>
</view>
</template>
<template v-else>
<view class="margin-top-sm flex justify-start align-center" v-if="order.orderDetailId != null && tabCur === 3 && order.drawCashStatus === 0 && $dateUtil.addHours(order.workFinishTime, 1).getTime() > new Date().getTime()">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>距完单分帐:</text>
<uni-countdown v-if="order.shareAccountCountdownEndTime" :show-colon="false" :backgroundColor="'#e35b33'" :color="'#faf3f0'"
:day="$dateUtil.countDownDiff(order.shareAccountCountdownEndTime).day"
:hour="$dateUtil.countDownDiff(order.shareAccountCountdownEndTime).hour"
:minute="$dateUtil.countDownDiff(order.shareAccountCountdownEndTime).min"
:second="$dateUtil.countDownDiff(order.shareAccountCountdownEndTime).seconds"
@timeup="reloadMasterOrderPage()">
</uni-countdown>
</view>
<view class="margin-top-sm text-red" @click="normalShowModalByRef('ledgerAccountRemark')"
v-if="order.orderDetailId != null && tabCur === 3 && order.drawCashStatus === 0 && $dateUtil.addHours(order.workFinishTime, 1).getTime() < new Date().getTime()">
<text class="text-lg margin-right-xs"><text class="cuIcon-notice"></text></text>
<text>银联发起T+1支付中正在刷新...</text>
<text class="text-main-color margin-left-sm">详情</text>
</view>
<view class="margin-top-sm text-red" @click="normalShowModalByRef('ledgerAccountRemark')"
v-if="order.orderDetailId != null && order.drawCashStatus === 1">
<text class="text-lg margin-right-xs"><text class="cuIcon-notice"></text></text>
<text>银联发起T+1支付中{{order.drawCashTime}}</text>
<text class="text-main-color margin-left-sm">详情</text>
</view>
<!-- <view class="margin-top-sm text-red" v-if="order.orderDetailId != null && order.drawCashStatus === 2">
<text class="text-lg margin-right-xs"><text class="cuIcon-notice"></text></text>
<text>本单银联已确认货款结算完毕(订单支付完成),款项已到达或即将到达您所绑定帐户,同意退款的需同意后您线下与客户另行操作,系统无法提供原路返回退款!</text>
</view> -->
<view class="margin-top-sm text-red" v-if="order.orderDetailId != null && order.drawCashStatus === 2">
<text class="text-lg margin-right-xs"><text class="cuIcon-notice"></text></text>
<text>货款分账成功:{{order.arrivalTime}}</text>
</view>
<view class="margin-top-sm text-red" v-if="order.orderDetailId != null && order.drawCashStatus === -1">
<text class="text-lg margin-right-xs"><text class="cuIcon-notice"></text></text>
<text>提现失败</text>
</view>
</template>
<!-- 不同状态订单支持不同操作按钮 -->
<view v-if="order.orderStatus === 0">
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @click="getCanAssignList(order)" @tap="togglePopup($event, order)">派单</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" @click="showServOrderDetail(order)">查看</button>
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrderPopup" @click="getCanAssignList(order)" @tap="togglePopup($event, order, 'transferOrder')">转发</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" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.hasServiceOrder === 0 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showAcceptOrderNoticeModal" @click="acceptOrder($event, order, order.orderMasterId, order.orderMasterCode, 1, 'updateMasterOrder')" v-if="order.orderDetailId == null">确认接单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showAcceptOrderNoticeModal" @click="acceptOrder($event, order, order.orderDetailId, order.orderDetailCode, 1, 'updateDetailOrder')" v-else>确认接单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId == null" @click="rejectMasterOrder(order)">拒绝接单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-else @click="rejectDetailOrder(order)">拒绝接单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
</view>
<view v-if="order.orderStatus === 1 && tabCur === 0">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrderPopup" @click="getCanAssignList(order)" @tap="togglePopup($event, order)" v-show="order.orderDetailId == null">派单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathToSelf" @tap="showModal($event, order)" v-show="order.orderDetailId == null">分次发货</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showTimeArrangeModal" @tap="showModal($event, order, true)">排期发货</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null" @click="rejectMasterOrderWhenAccepted(order)">{{order.masterWorkerId === order.workerId ? '退回重派' : '退单'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId == null" @click="rejectMasterOrderWhenAccepted(order)">退单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.insuranceId" data-modal="showInsuranceRetinue" @click="insuranceRetinueAdd($event, order)">保险增员</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDeliverGoods" data-isquicklydelivery="1" @tap="showModal($event, order)">立即发货</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)" v-show="order.orderDetailId != null">收款码</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.hasServiceOrder === 1" @click="ServOrderRefund(order)">整单退款</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
</view>
<view v-else-if="order.orderStatus === 1">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null && order.insuranceId" data-modal="showInsuranceRetinue" @click="insuranceRetinueAdd($event, order)">保险增员</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.hasServiceOrder === 1" @click="ServOrderRefund(order)">整单退款</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
</view>
<view v-if="order.orderStatus === 2">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="makePhoneCall(order.customerPhone)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">修改时间</button>
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showOnDoorNoticeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">发货</button> -->
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDeliverGoods" data-isquicklydelivery="1" @tap="showModal($event, order)">立即发货</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null" @click="rejectMasterOrderWhenAccepted(order)">{{order.masterWorkerId === order.workerId ? '退回重派' : '退单'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null && order.insuranceId" data-modal="showInsuranceRetinue" @click="insuranceRetinueAdd($event, order)">保险增员</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)" v-show="order.orderDetailId != null">收款码</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.hasServiceOrder === 1" @click="ServOrderRefund(order)">整单退款</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
</view>
<view v-if="order.orderStatus === 3">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="recordClockInLocation(order)" v-if="hasAuthLocation && order.orderDetailId != null && !order.clockInLocation">打卡到达</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" open-type="openSetting" @opensetting="authLocationCallback" v-else-if="order.orderDetailId != null && !order.clockInLocation">授权打卡</button> -->
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOffline" data-modal="showNewServPriceOfflineModal" v-show="order.orderDetailId != null && order.clockInLocation && order.payType === 1">报价/完单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOnline" data-modal="showNewServPriceOnlineModal" v-show="order.orderDetailId != null && order.clockInLocation && order.payType === 0">报价/完单</button> -->
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOffline" data-modal="showNewServPriceOfflineModal" v-show="order.orderDetailId != null && order.payType === 1">报价/完单</button> -->
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOnline" data-modal="showNewServPriceOnlineModal" v-show="order.orderDetailId != null && order.payType === 0">报价/完单</button> -->
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showHandoffGoodsRecord" @tap="showModal($event, order)">交货记录</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="makePhoneCall(order.customerPhone)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">重新排期</button>
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)" v-if="order.payStatus === 1" v-show="order.orderDetailId != null">发起完单</button> -->
<!-- <button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)" v-show="order.orderDetailId != null">生成收款码</button> -->
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null" @click="rejectMasterOrderWhenAccepted(order)">{{order.masterWorkerId === order.workerId ? '退回重派' : '退单'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)" v-show="order.orderDetailId != null">收款码</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.hasServiceOrder === 1" @click="ServOrderRefund(order)">整单退款</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
</view>
<view v-if="order.orderStatus === 4 || order.orderStatus === 5">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOffline" data-modal="showNewServPriceOfflineModal" v-show="order.orderDetailId != null && order.clockInLocation && order.payType === 1 && order.consultMode === '01'">报价/完单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click = "changePrice($event, order)" data-ref="newServPriceOnline" data-modal="showNewServPriceOnlineModal" v-show="order.orderDetailId != null && order.clockInLocation && order.payType === 0 && order.consultMode === '01'">报价/完单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.drawCashStatus !== 1" @click="serveringReturn(order)">发货退回</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" :class="['cu-btn', order.isInvoiced == 1 ? 'bg-main-color' : 'bg-gray', 'margin-right-xs', 'shadow-blur', 'margin-top-sm']" v-if="order.isNeedBill" @click="makeSureBillSigned(order)">{{order.isInvoiced == 1 ? '需开票' : '已开票'}}</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.hasServiceOrder === 1" @click="ServOrderRefund(order)">整单退款</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showDispathSure" @tap="showModal($event, order)" v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1">安装确认</button>
</view>
<!-- <view v-if="order.orderStatus === 'afterSaleService'">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
</view> -->
<view v-if="order.hasServiceOrder === 1" class="padding-top-sm">
<text class="text-red">派出的安装单,在“服务订单”处跟踪与管理!</text>
</view>
<view v-if="order.serviceCancelled == 1 && order.serviceShopId && order.goods.installService == 1 && stateCur != 6" class="padding-top-sm">
<text class="text-red">派出的安装单被拒单或已撤回,请重新点“安装确认”</text>
</view>
<view v-if="stateCur === 0 && order.hasServiceOrder == 1">
<text class="text-red">安装单需先完成,本单方能进入结算栏</text>
</view>
<view v-if="tabCur === 2 && order.hasServiceOrder == 1">
<text class="text-red">安装单需先完成,本单方能进入下一栏</text>
</view>
<view v-if="order.showAfterServiceRecord == 1 && order.afterServiceRecordList && order.afterServiceRecordList.length && order.orderDetailId != null" class="bg-white margin-top-sm">
<view v-for="(afterServiceRecord, afterServiceRecordIndex) in order.afterServiceRecordList" :key="afterServiceRecord.id">
<afterServiceRecordGoods
:after-service-record="afterServiceRecord"
:order="order"
@redoGoHome="() => showModalByRef('sure2Revisit', order, null)"
@callModal="(modelName) => showModal({currentTarget: {dataset: {modal: modelName, isquicklydelivery: '0'}}}, order)"
@getDeliveryFlow="(trackingNumber) => {showDeliveryFlow = true; showDeliveryFlowTrackingNumber = trackingNumber;}"
@refreshOrderList="() => reloadMasterOrderPage()"
></afterServiceRecordGoods>
<!-- <view v-if="afterServiceRecord.createBy == 1" class="padding-tb solid-top">
<view class='cu-tag bg-main-color radius light'>售后发起中</view>
<view class="text-gray text-sm margin-bottom-xs">您需快速操作反馈24小时内不操作将自动同意</view>
<view v-if="afterServiceRecord.operType === 1">
<view class="flex justify-start align-end">
<text>{{afterServiceRecord.operType === 1 ? '退款申请:' : '待处理售后:'}}</text>
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
:day="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.createTime, 24)).day"
:hour="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.createTime, 24)).hour"
:minute="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.createTime, 24)).min"
:second="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.createTime, 24)).seconds">
</uni-countdown>
</view>
<view>
<text>退款金额:</text>
<text v-if="afterServiceRecord.refund">{{afterServiceRecord.refund}}</text>
<text v-else-if="order.payMoney">{{order.payMoney}}</text>
</view>
<view>
<text>售后类型:</text>
<text v-if="afterServiceRecord.afterServiceType === 1">未收到货,我要退单退款!</text>
<text v-else-if="afterServiceRecord.afterServiceType === 2">未收到货(发货在途),我要退款!</text>
<text v-else-if="afterServiceRecord.afterServiceType === 3">已收到货,我要退款退货!</text>
</view>
<view>
<text>申请原因:</text>
<text v-if="afterServiceRecord.customerReasonType === 1">不想要了</text>
<text v-else-if="afterServiceRecord.customerReasonType === 2">买错型号尺寸了</text>
<text v-else-if="afterServiceRecord.customerReasonType === 3">材质与商品描述不符</text>
<text v-else-if="afterServiceRecord.customerReasonType === 4">大小尺寸与商品描述不符</text>
<text v-else-if="afterServiceRecord.customerReasonType === 5">颜色、款式、型号与描述不符</text>
<text v-else-if="afterServiceRecord.customerReasonType === 6">出现质量问题</text>
<text v-else-if="afterServiceRecord.customerReasonType === 7">收到商品少件(少配件)</text>
<text v-else-if="afterServiceRecord.customerReasonType === 8">商家发错货</text>
<text v-else-if="afterServiceRecord.customerReasonType === 9">商品破损或污渍</text>
<text v-else-if="afterServiceRecord.customerReasonType === 10">未按承诺时间发货</text>
<text v-else-if="afterServiceRecord.customerReasonType === 11">未见快递/物流有信息</text>
<text v-else-if="afterServiceRecord.customerReasonType === 12">其它原因</text>
</view>
<view>
<text>具体原因:</text>
<text v-if="afterServiceRecord.customerReason">{{afterServiceRecord.customerReason}}</text>
</view>
<view v-if="afterServiceRecord.operType === 2">
<text>完成操作:点击“操作处理”提交由客服回访!</text>
</view>
<view class="grid col-3 grid-square flex-sub margin-top-sm">
<view class="bg-img" v-for="(imgObj, imgIndex) in afterServiceRecord.imgsList" :key="imgIndex" v-if="imgObj.imgUploadBy === 1">
<image :src="imgObj.imgUrl" @tap="viewImage($event, [imgObj.imgUrl])" :data-url="imgObj.imgUrl" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="flex justify-end align-end margin-tb-sm" v-if="!afterServiceRecord.updateBy || afterServiceRecord.updateBy == 1">
<button class="cu-btn sm bg-yellow margin-right-sm" @tap="showModalByRef('sure2Revisit', order, null)">重发/补发</button>
<button class="cu-btn sm bg-yellow margin-right-sm" data-modal="rejectAfterSale" @tap="showModal($event, order)">拒绝处理</button>
<button class="cu-btn sm bg-yellow margin-right-sm" data-modal="agreeAfterSale" @tap="showModal($event, order)">操作处理</button>
</view>
</view>
<view v-if="afterServiceRecord.updateBy != 1" class="padding-tb solid-top">
<view class='cu-tag bg-main-color radius light'>师傅反馈</view>
<view>
<view class="margin-top-xs">
<text>师傅反馈结果:</text>
<text v-if="afterServiceRecord.workerFeedbackResult === 0">拒绝</text>
<text v-else-if="afterServiceRecord.workerFeedbackResult === 1">同意</text>
<text v-else-if="afterServiceRecord.workerFeedbackResult === 2 || afterServiceRecord.workerFeedbackResult === 3">{{order.orderType == 1 ? '重发/补发商品' : '上门重做/补做'}}</text>
</view>
<view v-if="afterServiceRecord.workerFeedbackResult === 1">
<text>同意退款金额:</text>
<text>{{afterServiceRecord.agreedRefund ? afterServiceRecord.agreedRefund : afterServiceRecord.refund}}</text>
</view>
<view v-if="afterServiceRecord.workerFeedbackResult === 2 || afterServiceRecord.workerFeedbackResult === 3" style="padding-left: 196upx;">
<view v-if="afterServiceRecord.workerResendPlan">
<text v-if="afterServiceRecord.workerResendPlan == 1">重发/补发,您无需退货</text>
<text v-if="afterServiceRecord.workerResendPlan == 2">重发/补发前,您需先退货</text>
<text v-if="afterServiceRecord.workerResendPlan == 3">请您退回商品,给你换货</text>
<text v-if="afterServiceRecord.workerResendPlan == 4">请退回商品,为您售后换货</text>
</view>
<view>客户同意则本次退款金额为0元</view>
<view>客户同意的需马上处理并重新提交</view>
</view>
<view class="text-right" v-if="afterServiceRecord.customerAgreeRedo === 1">
<view class='cu-tag bg-main-color radius light'>客户同意方案</view>
</view>
<view v-if="afterServiceRecord.workerFeedbackResult !== 2 && afterServiceRecord.workerFeedbackResult !== 3">
<text>师傅反馈:</text>
<text v-if="afterServiceRecord.workerFeedbackReasonType === 1">客户原因</text>
<text v-else-if="afterServiceRecord.workerFeedbackReasonType === 2">商家原因</text>
<text v-else-if="afterServiceRecord.workerFeedbackReasonType === 3">其他</text>
<text v-if="afterServiceRecord.workerFeedbackReason">
<text v-if="afterServiceRecord.workerFeedbackReasonType"></text>
{{afterServiceRecord.workerFeedbackReason}}
</text>
</view>
<view class="grid col-3 grid-square flex-sub margin-top-sm" v-if="afterServiceRecord.workerFeedbackImages">
<view class="bg-img" v-for="(imgUrl, imgIndex) in afterServiceRecord.workerFeedbackImages.split(',')" :key="imgIndex">
<image :src="imgUrl" @tap="viewImage($event, [imgUrl])" :data-url="imgUrl" mode="aspectFill"></image>
</view>
</view>
<template v-if="afterServiceRecord.workerFeedbackResult === 3">
<view class="margin-top-xs">
<text>师傅重发/补发提交:</text>
</view>
<view class="flex justify-between align-center">
<text>发货方式:{{afterServiceRecord.workerResendType == 1 ? '发快递/物流': (afterServiceRecord.workerResendType == 2 ? '送货上门' : '客户自提')}}</text>
<text v-if="afterServiceRecord.workerResendType == 1" @click="copyData(afterServiceRecord.workerResendTrackingNumber)">{{afterServiceRecord.workerResendTrackingNumber}}<text class="cuIcon-copy"></text></text>
</view>
<view class="grid col-3 grid-square flex-sub margin-top-sm" v-if="afterServiceRecord.workerResendImages">
<view class="bg-img" v-for="(imgUrl, imgIndex) in afterServiceRecord.workerResendImages.split(',')" :key="imgIndex">
<image :src="imgUrl" @tap="viewImage($event, [imgUrl])" :data-url="imgUrl" mode="aspectFill"></image>
</view>
</view>
<view class="margin-bottom-xs" v-if="afterServiceRecord.workerResendRemark">
<text>发货备注:{{afterServiceRecord.workerResendRemark}}</text>
</view>
</template>
</view>
</view>
<view style="border-top: 1px solid gainsboro;padding-top: 10upx;" v-if="afterServiceRecord.customerFinalCheck == null && (afterServiceRecord.workerFeedbackResult === 0 || afterServiceRecord.workerFeedbackResult === 1 || afterServiceRecord.workerFeedbackResult === 3)">
<text class="text-gray" style="font-size: 20upx;">待客户验收或审核36小时未操作将自动取消本次售后</text>
<view class="flex align-center margin-top-sm">
<text>工单时限:</text>
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
:day="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.redoCompleteTime, 36)).day"
:hour="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.redoCompleteTime, 36)).hour"
:minute="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.redoCompleteTime, 36)).min"
:second="$dateUtil.countDownDiff($dateUtil.addHours(afterServiceRecord.redoCompleteTime, 36)).seconds">
</uni-countdown>
</view>
</view>
<view class="flex justify-end align-end margin-tb-sm" v-if="afterServiceRecord.workerFeedbackResult === 2">
<button class="cu-btn sm bg-yellow margin-right-sm" data-modal="showDeliverGoods" @tap="showModal($event, order)">立即重发/补发</button>
</view>
<view v-if="afterServiceRecord.customerFinalCheck != null" class="padding-tb solid-top">
<view class='cu-tag bg-main-color radius light'>客户最终确认</view>
<view class="margin-top-xs">{{afterServiceRecord.customerFinalCheck === 1 ? '同意' : '不同意'}}</view>
<view v-if="afterServiceRecord.customerFinalCheck === 0">
<view class="grid col-3 grid-square flex-sub margin-top-sm" v-if="afterServiceRecord.customerDisagreeImages">
<view class="bg-img" v-for="imgUrl in afterServiceRecord.customerDisagreeImages.split(',')" :key="imgUrl">
<image :src="imgUrl" @tap="viewImage($event, [imgUrl])" :data-url="imgUrl" mode="aspectFill"></image>
</view>
</view>
<view class="margin-bottom-xs" v-if="afterServiceRecord.customerDisagreeReason">
<text>不同意理由:{{afterServiceRecord.customerDisagreeReason}}</text>
</view>
<view class="text-red" v-if="afterServiceRecord.customerFinalCheck === 0">订单交由平台协商处理</view>
</view>
<view v-else-if="afterServiceRecord.customerFinalCheck === 1">
<template v-if="afterServiceRecord.workerFeedbackResult !== 0">
<view v-if="(afterServiceRecord.agreedRefund > 0 || afterServiceRecord.originalRefund > 0) && order.payStatus == 1">
<view>
<text>本单退款,系统已发起按客户支付的帐户原路退回</text>
<text class="text-red">{{afterServiceRecord.agreedRefund || afterServiceRecord.originalRefund}}</text>
<text>元,银行按工作日退款,节假日顺延到帐。遇客户问询,请其耐心等待,到账时会在客户端”客户最终确认“处有到账时间。</text>
</view>
<view>退款支付到账:{{afterServiceRecord.refundApplyTime}}</view>
</view>
<view v-else-if="order.payStatus == 0">
<text v-if="afterServiceRecord.workerFeedbackResult === 3">本次售后已重新补做并验收完成退款额为0。</text>
<text v-else>本单已退款{{afterServiceRecord.agreedRefund}}元因未实际支付实退为0元。未退部分继续完成订单及正常支付</text>
</view>
</template>
<view v-else>
<text>本次售后已操作完毕,售后申请已结束!</text>
</view>
</view>
</view> -->
</view>
</view>
<view class="margin-top-sm solid-top padding-top-sm" @click.stop="updateOrderWorkerRemark(order, index)">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-comment"></text></text>
<text>{{order.workerRemark || '可输入本单备注语'}}</text>
<!-- <text class="cuIcon-edit margin-left-sm" @click="updateOrderWorkerRemark(order, index)"></text> -->
</view>
</view>
<load-status-bar v-show="[5,6].indexOf(tabCur) >= 0 || (stateCur != null && stateList[stateCur].code === 105)" ref="loadStatusBar" @loadMore="loadMasterOrderPage"></load-status-bar>
<view v-show="tabCur !== 5 && stateCur !== 0" class="cu-tabbar-height"></view>
<!-- 模态框 -->
<!-- <agree-after-sale v-if="agreeAfterSale" :show="agreeAfterSale" :data="curOrder" @confirmFeedback="reloadMasterOrderPage" @close="agreeAfterSale = false"></agree-after-sale> -->
<agree-after-sale-goods v-if="agreeAfterSale" :show="agreeAfterSale" :data="curOrder" @confirmFeedback="reloadMasterOrderPage" @close="agreeAfterSale = false"></agree-after-sale-goods>
<reject-after-sale v-if="rejectAfterSale" :show="rejectAfterSale" :data="curOrder" @confirmFeedback="reloadMasterOrderPage" @close="rejectAfterSale = false"></reject-after-sale>
<time-arrange v-if="showTimeArrangeModal" :orderType="1" :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime" @close="showTimeArrangeModal = false"></time-arrange>
<time-arrange-fail v-if="showArrangeFailTimeModal" :show="showArrangeFailTimeModal" :data="curOrder" @close="showArrangeFailTimeModal = false"></time-arrange-fail>
<new-serv-price-online v-if="showNewServPriceOnlineModal" ref="newServPriceOnline" :show="showNewServPriceOnlineModal" :data="curOrder" @finishOrder="finishOrder" @close="showNewServPriceOnlineModal = false;reloadMasterOrderPage()"></new-serv-price-online>
<new-serv-price-offline v-if="showNewServPriceOfflineModal" ref="newServPriceOffline" :show="showNewServPriceOfflineModal" :data="curOrder" @finishOrder="finishOrder" @close="showNewServPriceOfflineModal = false;reloadMasterOrderPage()"></new-serv-price-offline>
<pay-qrcode v-if="showPayQrcodeModal" ref="payQrcode" :show="showPayQrcodeModal" :data="curOrder" @finishQrPay="finishQrPay"></pay-qrcode>
<edit-time-arrange v-if="showEditTimeArrangeModal" :orderType="1" :show="showEditTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime" :ifRollback2WS="true" @close="showEditTimeArrangeModal = false"></edit-time-arrange>
<urgent-msg v-if="sendUrgentMsgModal" :show="sendUrgentMsgModal" @hideModal="sendUrgentMsgModal = false"></urgent-msg>
<pic-modal ref="showPicModal" :imgList="picModalImgList"></pic-modal>
<on-door-immediately v-if="showOnDoorNoticeModal" :show="showOnDoorNoticeModal" :data="curOrder" @close="showOnDoorNoticeModal = false" @confirmFeedback="reloadMasterOrderPage"></on-door-immediately>
<accept-order-notice v-if="showAcceptOrderNoticeModal" :show="showAcceptOrderNoticeModal" :data="curOrder" @close="showAcceptOrderNoticeModal = false" @confirmFeedback="setCurTab(0)"></accept-order-notice>
<insurance-detail v-if="showInsuranceDetail" :show="showInsuranceDetail" :data="curOrder" @close="showInsuranceDetail = false"></insurance-detail>
<insurance-retinue v-if="showInsuranceRetinue" :show="showInsuranceRetinue" :data="curOrder" @close="showInsuranceRetinue = false" ref="insuranceRetinueRef"></insurance-retinue>
<insurance-vertify v-if="showInsuranceVertify" :show="showInsuranceVertify" :data="curOrder" @close="showInsuranceVertify = false" ref="insuranceVertifyRef" @success="certVertifySuccess"></insurance-vertify>
<allocateServiceMoney v-if="showAllocateServiceMoney" :show="showAllocateServiceMoney" :data="curOrder" @close="showAllocateServiceMoney = false" @confirmFeedback="showAllocateServiceMoney = false;reloadMasterOrderPage()"></allocateServiceMoney>
<deliverGoods v-if="showDeliverGoods" :show="showDeliverGoods" :data="curOrder" :isQuicklyDelivery="isQuicklyDelivery" @close="showDeliverGoods = false" @confirmFeedback="deliveryNowDo"></deliverGoods>
<handoff-goods-record v-if="showHandoffGoodsRecord" :show="showHandoffGoodsRecord" :data="curOrder" @close="showHandoffGoodsRecord = false" @confirmFeedback="showHandoffGoodsRecord = false;reloadMasterOrderPage()"></handoff-goods-record>
<dispatch-order-to-self v-if="showDispathToSelf" :orderType="1" :show="showDispathToSelf" :data="curOrder" @close="showDispathToSelf = false" @assignWork="assignWork" @confirmFeedback="showDispathToSelf = false;reloadMasterOrderPage()"></dispatch-order-to-self>
<dispatch-order-sure v-if="showDispathSure" :orderType="1" :show="showDispathSure" :data="curOrder" @close="showDispathSure = false" @confirmFeedback="showDispathSure = false;reloadMasterOrderPage()"></dispatch-order-sure>
<confirm-modal ref="ledgerAccountRemark" :showCancel="false" :showConfirm="true">
<block slot="contentView">
<view class="text-left">
<view class="text-bold">T+1银联结算动态</view>
<view>订单款项已进入发起银联分帐付款指令中请确保您的银行帐户已绑定银联支持任意个人银行帐户绑定结算。根据支付规则分帐支付按T+1结算方式即按发起时间次日内清算机构【银联】根据清算信息完成支付到帐如遇节假日则节假日后的次日内完成支付到帐</view>
</view>
</block>
</confirm-modal>
<confirm-modal ref="sure2Revisit" :cancelMsg="'退出'" @confirm="revisit" @cancel="hideModal">
<block slot="contentView">
<view class="text-left">
<!-- <view class="text-bold">T+1银联结算动态</view> -->
<view class="flex justify-start align-center margin-top-sm" style="padding-bottom: 20px;">
<view class="title">重发/补发前:</view>
<my-uni-combox class="form-val-area inline-input" screenMaxHeight="100px" :candidates="afterServiceArr" placeholder="请选择" :showField="'name'"
v-model="afterServiceType">
</my-uni-combox>
</view>
<view>您选择重发/换货/补发商品,请先与客户协商一致并重新发货,选择重发/补发则客户发起的退款默认退额为0元。</view>
</view>
</block>
</confirm-modal>
<confirm-modal ref="mutipleLineModal" :showCancel="false" :showConfirm="true">
<block slot="contentView">
<view class="text-left">
<view class="text-bold text-center margin-bottom-xs">提示:</view>
<view class="margin-bottom-sm" v-for="(item, index) in mutipleLineText" :key="index">{{item}}</view>
</view>
</block>
</confirm-modal>
<!-- popup -->
<uni-popup ref="dispatchOrderPopup" type="bottom" @change="changePopupState">
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="dispatchOrderPopup" @click="togglePopup"><text
class="cuIcon-close"></text></view>
<view class="bg-white padding" style="padding-top: 74rpx; min-height: 1000rpx;">
<dispatch-order ref="dispatchOrder" v-if="myTeamMembers && myTeamMembers.length > 0" :orderMode="curOrder.orderMode" @assignWork="assignWork" :members="myTeamMembers" :totalMoney="curOrder.serverMoney"></dispatch-order>
<view v-else class="align-center-view text-xl">无可指派的师傅</view>
</view>
<!-- 底部占位 -->
<view class="cu-bar bg-white fixed-bottom-bar"></view>
</uni-popup>
<!-- 账户及实名弹窗 -->
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind>
<vertify-certify ref="vertifyCertify"></vertify-certify>
<uni-popup ref="editOrderRemarkPopup" type="center">
<uni-popup-dialog title="修改本单备忘语" mode="input" :value="curOrder.workerRemark" v-if="showEditWorkerRemark" @close="showEditWorkerRemark = false" @confirm="updateOrderWorkerRemarkOpreation"></uni-popup-dialog>
</uni-popup>
<deliveryFlowDetail :show="showDeliveryFlow" :trackingNumber="showDeliveryFlowTrackingNumber" @close="showDeliveryFlow = false"></deliveryFlowDetail>
</view>
</template>
<script>
import myUniCombox from '@/components/uni-combox/my-uni-combox.vue';
import timeArrange from '@/pages/order-manage/modal/time-arrange.vue';
import timeArrangeFail from '@/pages/order-manage/modal/time-arrange-fail.vue';
import editTimeArrange from '@/pages/order-manage/modal/edit-time-arrange.vue';
import dispatchOrder from '@/pages/order-manage/dispatch-order.vue';
import newServPriceOnline from '@/pages/order-manage/modal/new-serv-price-online.vue';
import newServPriceOffline from '@/pages/order-manage/modal/new-serv-price-offline.vue';
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';
// import agreeAfterSale from '@/pages/order-manage/modal/agree-after-sale.vue';
import agreeAfterSaleGoods from '@/pages/order-manage/modal/agree-after-sale-goods.vue';
import rejectAfterSale from '@/pages/order-manage/modal/reject-after-sale.vue';
import onDoorImmediately from '@/pages/order-manage/modal/on-door-immediately.vue';
import acceptOrderNotice from '@/pages/order-manage/modal/accept-order-notice.vue';
import insuranceDetail from '@/pages/order-manage/modal/insurance-detail.vue';
import insuranceRetinue from '@/pages/order-manage/modal/insurance-retinue.vue';
import insuranceVertify from '@/pages/order-manage/modal/insurance-vertify.vue';
import allocateServiceMoney from '@/pages/order-manage/modal/allocate-service-money.vue';
import deliverGoods from '@/pages/order-manage/modal/deliver-goods.vue';
import handoffGoodsRecord from '@/pages/order-manage/modal/handoff-goods-record.vue';
import dispatchOrderToSelf from '@/pages/order-manage/modal/dispatch-order-to-self.vue';
import dispatchOrderSure from '@/pages/order-manage/modal/dispatch-order-sure.vue';
import afterServiceRecordGoods from './components/afterServiceRecordGoods.vue';
import deliveryFlowDetail from '@/pages/order-manage/modal/delivery_flow_detail.vue';
export default {
components: {
myUniCombox,
timeArrange,
timeArrangeFail,
editTimeArrange,
dispatchOrder,
newServPriceOnline,
newServPriceOffline,
payQrcode,
urgentMsg,
picModal,
loadStatusBar,
agreeAfterSaleGoods,
rejectAfterSale,
onDoorImmediately,
acceptOrderNotice,
insuranceDetail,
insuranceRetinue,
insuranceVertify,
allocateServiceMoney,
deliverGoods,
handoffGoodsRecord,
dispatchOrderToSelf,
dispatchOrderSure,
afterServiceRecordGoods,
deliveryFlowDetail
},
data() {
return {
formData: {
category: null,
area: null,
orderKeywords: ''
},
areaList: [],
areaMultiIndex: [0, 0, 0],
categoryList: [],
categoryMultiIndex: [0, 0, 0],
stateList: [{
code: 105,
name: '监控单'
}, {
code: 104,
name: '搁置单'
}, {
code: 103,
name: '超时单'
}, {
code: 102,
name: '今待发'
}, {
code: 101,
name: '明待发'
}, {
code: 100,
name: '急报单'
}, {
code: 0,
name: '新订单'
}],
subStateList: [{
code: 1,
name: '拣货/发货'
}, {
code: 2,
name: '预约发货'
}, {
code: 3,
name: '发货中'
}, {
code: 4,
name: '确认中'
},
// {
// code: '-',
// name: '售后中'
// },
{
other: 0,
name: '售后中',
}, {
code: 5,
name: '已完成/子',
isChild: true
}, {
code: 5,
name: '已完成/主',
isChild: false
}],
myOrders: {},
orderList: [],
// pageParams: [],
pageNum: 1,
pageSize: 0,
curOrder: {},
myTeamMembers: [],
scrollLeft: 0,
stickyTop: this.CustomBar,
tabCur: 0,
orderType: 0,
stateCur: null,
showTimeArrangeModal: false,
showArrangeFailTimeModal: false,
showNewServPriceOnlineModal: false,
showNewServPriceOfflineModal: false,
showPayQrcodeModal: false,
showEditTimeArrangeModal: false,
showOnDoorNoticeModal: false,
showAcceptOrderNoticeModal: false,
showInsuranceDetail: false,
showInsuranceRetinue: false,
showInsuranceVertify: false,
sendUrgentMsgModal: false,
agreeAfterSale: false,
rejectAfterSale: false,
ifShowPageMeta: false,
picModalImgList: [],
curDate: '',
curUserInfo: {},
orderStatistics: {},
hasAuthLocation: true,
storageArgs: null,
showAllocateServiceMoney: false,
showDeliverGoods: false,
showHandoffGoodsRecord: false,
showDispathToSelf: false,
showDispathSure: false,
showEditWorkerRemark: false,
afterServiceArr: [
{
code: 1,
name: '重发/补发,您无需退货'
},
{
code: 2,
name: '重发/补发前,您需先退货'
},
{
code: 3,
name: '请您退回商品,给你换货'
},
{
code: 4,
name: '请退回商品,为您售后换货'
}
],
afterServiceType: null,
isQuicklyDelivery: '0',
showDeliveryFlow: false,
showDeliveryFlowTrackingNumber: '',
mutipleLineText: []
}
},
onLoad(option) {
if (option && option.tabCur) {
this.stateCur = null;
this.tabCur = option.tabCur;
} else if(option && option.stateCur) {
this.tabCur = null;
this.stateCur = option.stateCur;
} else if(option && option.orderType) {
this.orderType = option.orderType;
}
this.loadData();
this.bindEvent();
},
onShow() {
const isDetailPage = uni.getStorageSync('isDetailPage');
if(this.orderList.length && !isDetailPage){
console.log('isDetailPage', isDetailPage);
this.reloadMasterOrderPage();
}
uni.setStorageSync('isDetailPage', '')
},
onUnload() {
this.offBindEvent();
},
methods: {
async loadData() {
// 获取当前登录用户信息
this.curUserInfo = this.$request.getCurUserInfo();
// const res = await this.$request.getWorkerInfo(this.curUserInfo.workerId)
// if(res.data.loginStatus == 1) {
// // 禁止登录,退出登录
// uni.clearStorageSync('userProfile');
// uni.showToast({
// icon: 'none',
// title: '您已被禁止登录',
// duration: 3000,
// success() {
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/login/login'
// })
// }, 3000)
// }
// })
// return
// }
// let myTeamInfo = await this.$api.data('myTeamInfo');
// this.myTeamMembers = myTeamInfo.members;
this.myOrders = await this.$api.data('myOrders');
// this.orderList = this.myOrders.orderList;
// this.areaList = await this.$api.data('areaList');
// this.categoryList = await this.$api.data('categoryList');
// 初始化分页参数
// for(let i = 0; i < this.subStateList.length; i++) {
// this.pageParams.push({
// pageNum: 0
// });
// }
Promise.allSettled([
// 初始化订单列表
this.loadMasterOrderPage({
orderStatus: this.subStateList[0].code
}),
// 订单统计
this.loadOrderStatistics()
]).then(() => {
// 初始化品类及区域列表
this.loadCategoryList();
this.loadRegionList();
// 初始化指派成员
this.loadTeamMembers();
})
},
reloadMasterOrderPage(params = {}) {
console.log('reloadMasterOrderPage');
this.pageNum = 1;
this.orderList = [];
// this.$refs.loadStatusBar.showLoadMore();
this.loadMasterOrderPage();
// 订单统计
this.loadOrderStatistics();
},
async loadMasterOrderPage(params = {}) {
// 公共条件
params.shelveStatus = 0;
params.goodsName = this.formData.orderKeywords;
params.countryId = this.formData.area && this.formData.area.length > 2 ? this.formData.area[2].areaId : null;
params.goodsCategoryId = this.formData.category && this.formData.category.length > 2 ? this.formData.category[2].goodsCategoryId : null;
params.orderByColumn = "updateTime";
params.isAsc = "desc";
// 状态
if (this.tabCur != null) {
params.orderStatus = this.subStateList[this.tabCur].code;
} else if (this.stateCur != null && (this.stateList[this.stateCur].code === 0 || this.stateList[this.stateCur].code === 100)) {
params.orderStatus = this.stateList[this.stateCur].code;
}
// 分页
if ((this.stateCur != null && [105].indexOf(this.stateList[this.stateCur].code) >= 0) || [0, 4, 5, 6].indexOf(this.tabCur) >= 0) {
params.pageSize = this.$globalData.initPageSize;
params.pageNum = this.pageNum;
} else {
params.pageSize = 10000;
params.pageNum = 1;
}
// 其他需要特别处理的条件
let date = new Date();
if (this.stateCur != null) {
if (this.stateList[this.stateCur].code === 102) {
// 今日单
params.orderStatus = 2;
params.expectTimeStart = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 00:00:00",
params.expectTimeEnd = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 23:59:59"
params.orderByColumn = "expectTimeStart";
params.isAsc = "asc";
} else if (this.stateList[this.stateCur].code === 101) {
// 明日单
params.orderStatus = 2;
params.expectTimeStart = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate() + 1) + " 00:00:00",
params.expectTimeEnd = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate() + 1) + " 23:59:59"
params.orderByColumn = "expectTimeStart";
params.isAsc = "asc";
} else if (this.stateList[this.stateCur].code === 104) {
// 搁置单
params.shelveStatus = 1;
// params.isMonitoredOrder = true;
// params.allSelfAssigned = 0;
} else if (this.stateList[this.stateCur].code === 105) {
// 监控单
// params.orderStatuses = "2,3,4,5";
params.allSelfAssigned = 0;
params.isMonitoredOrder = true;
} else if (this.stateList[this.stateCur].code === 103) {
// 超时单
params.isMonitoredOrder = true;
params.orderByColumn = "createTime";
params.isAsc = "desc";
} else if (this.stateList[this.stateCur].code === 0) {
// 新订单
params.orderByColumn = "createTime";
params.isAsc = "desc";
}
// else if (this.stateList[this.stateCur].code === 100) {
// // 急报单
// params.isMonitoredOrder = true;
// params.allSelfAssigned = 0;
// }
} else if (this.tabCur != null) {
if (this.tabCur === 4) {
// 售后中的单
params.isMonitoredOrder = true;
params.allSelfAssigned = 0;
} else if (this.tabCur === 3) {
// 确认中的单
params.workFinishTimeExisted = true;
params.drawCashStatusList = [0,1];
params.orderStatus = null;
params.orderStatusList = [4,5];
} else if (this.tabCur === 5) {
// 已完成/子单
params.workFinishTimeExisted = true;
params.drawCashStatus = 2;
} else if (this.tabCur === 1) {
// 待上门
params.orderByColumn = "expectTimeStart";
params.isAsc = "asc";
}
}
params.orderType = this.orderType;
try {
let res = null;
let tmpStateCur = this.stateCur;
let tmpTabCur = this.tabCur;
// 不同状态的单需要请求不同接口
if ((this.stateCur != null && [105].indexOf(this.stateList[this.stateCur].code) >= 0) || (this.tabCur === 6)) {
// 只查询主单,需要进行分页处理
this.$refs.loadStatusBar.showLoading();
res = await this.$request.qryMasterOrderPage(params);
// 如果选中的状态栏已经切换,则直接返回
if (this.stateCur !== tmpStateCur || this.tabCur !== tmpTabCur) {
return;
}
if (res && res.rows) {
let rowsLength = res.rows.length;
if (rowsLength > 0) {
this.orderList = this.orderList.concat(res.rows);
this.pageNum++;
if (rowsLength === params.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
}
this.$refs.loadStatusBar.showLoadOver();
} else if ((this.stateCur != null && [103, 100, 0].indexOf(this.stateList[this.stateCur].code) >= 0) || [0, 4].indexOf(this.tabCur) >= 0) {
let funName = "qryMixOrderList";
// 展示混合单,不做分页处理
if (this.stateCur != null && this.stateList[this.stateCur].code === 103) {
// 超时单
params.orderStatus = null;
params.timeout = 1;
} else if (this.tabCur === 4) {
funName = "qryMixAfterList";
}
res = await this.$request[funName](params);
// 如果选中的状态栏已经切换,则直接返回
if (this.stateCur !== tmpStateCur || this.tabCur !== tmpTabCur) {
return;
}
if (res && res.data) {
this.orderList = res.data;
}
} else {
// 只查询子单,需要进行分页处理
this.$refs.loadStatusBar.showLoading();
let funName = "qryDetailOrderPage";
if (this.tabCur === 4) {
funName = "getAfterList";
}
res = await this.$request[funName](params);
// 如果选中的状态栏已经切换,则直接返回
if (this.stateCur !== tmpStateCur || this.tabCur !== tmpTabCur) {
return;
}
if (res && res.rows) {
let rowsLength = res.rows.length;
if (rowsLength > 0) {
this.orderList = this.orderList.concat(res.rows);
this.pageNum++;
if (rowsLength === params.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
}
this.$refs.loadStatusBar.showLoadOver();
}
} catch (e) {
console.error(e)
this.$refs.loadStatusBar.showLoadErr();
}
},
async loadCategoryList(idArr) {
let typeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2
});
typeList = typeList.data;
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
let subTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
let subSubTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: col2Id
});
subSubTypeList = subSubTypeList.data;
let col3Id = idArr ? idArr[2] : subSubTypeList[0].goodsCategoryId;
let thirdTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: col3Id
});
thirdTypeList = thirdTypeList.data;
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryList.push(thirdTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();
regionList = regionList.data;
let subRegionList = [];
let subSubRegionList = [];
if (regionList && regionList.length > 0) {
subRegionList = await this.$request.areaListByStep({
parentCode: regionList[0].areaCode
});
subRegionList = subRegionList.data;
}
if (subRegionList && subRegionList.length > 0) {
subSubRegionList = await this.$request.areaListByStep({
parentCode: subRegionList[0].areaCode
});
subSubRegionList = subSubRegionList.data;
}
this.areaList.push(regionList);
this.areaList.push(subRegionList);
this.areaList.push(subSubRegionList);
},
async loadTeamMembers() {
let res = await this.$request.getTeamPage({
leaderId: this.curUserInfo.workerId,
workerId: null
});
this.myTeamMembers = res.rows;
},
async loadOrderStatistics() {
let res = await this.$request.orderStatistics({
orderType: this.orderType
});
this.orderStatistics = res.data;
},
bindEvent() {
uni.$on(this.$globalFun.HIDE_MODAL, this.hideModal);
},
offBindEvent() {
uni.$off(this.$globalFun.HIDE_MODAL);
},
async regionColChange(e) {
let colObj = e.detail;
if (colObj.column == 0) {
// 通过一级查二级
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode});
subAreaList = subAreaList.data;
let subSubAreaList = [];
if (subAreaList.length) {
subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode});
subSubAreaList = subSubAreaList.data;
}
this.areaList.pop();
this.areaList.pop();
this.areaList.push(subAreaList);
this.areaList.push(subSubAreaList);
this.areaMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
// 通过二级查三级
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[1][colObj.value].areaCode});
subAreaList = subAreaList.data;
this.areaList.pop();
this.areaList.push(subAreaList);
this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0];
}
},
regionChange(e) {
this.areaMultiIndex = e.detail.value;
let chosenArea = [];
for(let i = 0; i < this.areaList.length; i++) {
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
}
this.formData.area = chosenArea;
},
async categoryColChange(e) {
let colObj = e.detail;
if (colObj.column == 0) {
// 通过一级查询二级
let subTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
});
subTypeList = subTypeList.data;
let subSubTypeList = [];
if (subTypeList && subTypeList.length) {
subSubTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
}
this.categoryList.pop();
this.categoryList.pop();
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
// 通过二级查三级
let subSubTypeList = await this.$request.listByStep({
type: this.orderType == 0 ? 1 : 2,
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
this.categoryList.pop();
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
}
},
categoryChange(e) {
this.categoryMultiIndex = e.detail.value;
let chosenCategory = [];
for(let i = 0; i < this.categoryList.length; i++) {
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
}
this.formData.category = chosenCategory;
},
searchOrder() {
this.reloadMasterOrderPage();
},
resetConditions() {
this.formData = {
category: null,
area: null,
orderKeywords: ''
}
},
tabSelect(e) {
this.stateCur = null;
this.tabCur = e.currentTarget.dataset.id;
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
// this.reloadMasterOrderPage(this.stateCur, this.subStateList[this.tabCur].code);
this.reloadMasterOrderPage();
},
statusSelect(e) {
this.tabCur = null;
this.stateCur = e.currentTarget.dataset.id;
this.reloadMasterOrderPage();
},
getCurDateAndTime() {
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 00:00:00";
},
async showModal(e, orderInfo, isCheckOrderInsurance) {
if(isCheckOrderInsurance) {
let resCheck = await this.$request.checkOrderInsurance({
orderCode: orderInfo.orderMasterCode
});
if(resCheck.code !== 0) return;
}
this.getCurDateAndTime();
if (orderInfo) {
this.curOrder = orderInfo;
}
console.log(e);
if(e.currentTarget.dataset.isquicklydelivery !== undefined) {
this.isQuicklyDelivery = e.currentTarget.dataset.isquicklydelivery
}
this[e.currentTarget.dataset.modal] = true;
},
showModalByRef(refName, curOrder, params) {
this.$refs[refName].showModal(curOrder, params);
this.curOrder = curOrder;
},
normalShowModalByRef(refName) {
this.$refs[refName].showModal();
},
hideModal(e) {
console.log(e);
this.curOrder = null;
this[e.currentTarget.dataset.modal] = false;
},
copyData(data) {
uni.setClipboardData({
data: data
});
},
// 修改主单和子单信息之后的回调
async deliveryNowDo() {
if(!this.curOrder.orderDetailId) {
await this.assignWork2MySelf(this.curOrder, 1);
}
this.showDeliverGoods = false;
this.reloadMasterOrderPage()
},
async editServTime(id, datetimeArr, ifRollback2WS, order) {
// 确定方法名
let reqFunName = "updateOrder";
if (this.tabCur === 0 && order.orderDetailId == null) {
id = order.orderMasterId;
} else {
reqFunName = "updateDetailOrder";
id = order.orderDetailId;
}
// 确定参数
let params = datetimeArr && datetimeArr.length > 1 ? {
id: id,
expectTimeStart: datetimeArr[0],
expectTimeEnd: datetimeArr[1],
useTimeNotRange: datetimeArr[1] == null ? true : false
} : {
id: id,
revTime: datetime
}
let res = await this.$request[reqFunName](params);
if (res.code === 0) {
let finishFlag = false;
if (ifRollback2WS) {
let statusUpdateRes = await this.updateOrderDetailStatus({
id: id,
orderStatus: 2,
workBeginTime: ''
});
if (statusUpdateRes && statusUpdateRes.code === 0) {
finishFlag = true;
}
} else if (order && order.orderDetailId == null) {
finishFlag = await this.assignWork2MySelf(order);
} else {
finishFlag = await this.updateOrderStatus(order.orderDetailId, 2, 'updateDetailOrder');
}
if (finishFlag) {
this.reloadMasterOrderPage();
// this.addOrderOperate({
// orderId: id,
// orderType: reqFunName === 'updateOrder' ? '01' : '02',
// content: '预约时间'
// })
uni.showToast({
title: '排期发货成功',
icon: 'none',
duration: 2000
})
}
}
},
async updateOrderDetailStatus(params = {}) {
let res = await this.$request.updateDetailOrder(params);
return res;
},
// 添加操作节点
async addOrderOperate(params = {}) {
let res = await this.$request.addOrderOperate(params);
return res;
},
// async ledgerAccountcountdownTimeup(order = {}, index) {
// let res = await this.$request.updateDetailOrder({
// id: order.orderDetailId,
// ledgerAccountStatus: 1
// });
// if (!res || res.code !== 0) {
// uni.showToast({
// icon: 'none',
// title: '分账倒计时异常,订单号:' + order.orderDetailId,
// duration: 2000
// })
// } else if (this.tabCur === 3) {
// // TODO:更新此订单信息
// uni.showToast({
// icon: 'none',
// title: '订单编码:' + order.orderDetailCode + '已进入分账中,请再次点击确认中栏目',
// duration: 3000
// })
// }
// },
showArrangeFailTime(e) {
this.showTimeArrangeModal = false;
this.showEditTimeArrangeModal = false;
this.showArrangeFailTimeModal = true;
},
finishQrPay(e) {
this.hideModal(e);
this.reloadMasterOrderPage();
},
togglePopup(e, orderInfo, orderType) {
if (this.ifShowPageMeta) {
this.$refs[e.currentTarget.dataset.popup].close();
let timeout = setTimeout(() => {
this.curOrder = null;
}, 100);
} else {
if (orderInfo) {
this.curOrder = orderInfo;
}
if (orderType === 'transferOrder') {
this.curOrder.orderMode = 'transferOrder'
}
this.$refs[e.currentTarget.dataset.popup].open();
}
},
changePopupState(e) {
this.ifShowPageMeta = e.show;
},
makePhoneCall(tel) {
console.log('order.customerPhone==='+tel);
if(!tel) return
uni.makePhoneCall({
phoneNumber: tel
})
},
async makePayQrcode(e, orderInfo) {
if (orderInfo.payStatus === 1) {
uni.showToast({
title: '订单已支付,不要重复付款!',
icon: 'none'
})
return;
}
let res = await this.$request.qrPay(orderInfo);
if (res && res.code === 0) {
this.showModal(e, orderInfo);
this.$nextTick(() => {
this.$refs.payQrcode.showQrcode(res.data.expend.qrcode_url);
})
}
},
async insuranceRetinueAdd(e, orderInfo) {
this.showModal(e, orderInfo);
if(orderInfo.orderDetailId) {
this.$nextTick(() => {
this.$refs.insuranceRetinueRef.initData()
})
}
},
showServOrderDetail(order) {
uni.setStorageSync('isDetailPage', true);
uni.navigateTo({
url: '/pages/order-manage/serv-detail?order=' + encodeURIComponent(JSON.stringify(order))
})
},
async finishOrder(order) {
let checkRes = await this.checkBankAndCertify();
if (!checkRes) {
return;
}
uni.navigateTo({
url: '/pages/order-manage/finish-order?order=' + encodeURIComponent(JSON.stringify(order))
})
},
async checkBankAndCertify() {
// 查询账户绑定信息
let bankCardRes = await this.$request.getBindBankCardByWorkerId({
workerId: this.curUserInfo.workerId
});
this.bankCard = bankCardRes.data;
// 查询实名信息
let certifyInfoRes = await this.$request.getWorkerCertify();
this.certifyInfo = certifyInfoRes.data;
if (!this.certifyInfo || !this.certifyInfo.workerCertificationId) {
this.$refs.vertifyCertify.showModal();
return false;
} else if (this.certifyInfo.status != 1) {
uni.showToast({
icon: 'none',
title: '实名认证审核通过后才可进行操作',
duration: 2500
})
return false;
} else if (!this.bankCard || !this.bankCard.bankNum) {
this.$refs.vertifyBankBind.showModal();
return false;
}
return true;
},
certVertifySuccess(data) {
const cacheArgs = Array.from(this.storageArgs)
const sendArgs = cacheArgs.length > 6 ? cacheArgs.slice(0,-1) : cacheArgs
this.acceptOrder(...sendArgs, data)
this.showInsuranceVertify = false
},
varifyDetailOrderUser() {
const remark = this.curUserInfo.remark ? JSON.parse(this.curUserInfo.remark) : {certNo: '',certName: ''}
if(remark.certNo && remark.certName) {
return {
check: true,
...remark
}
} else {
// 没有身份信息,让填写
return {
check: false,
...remark
}
}
},
async acceptOrder(e, order, id, code, status, funName, certData = {}) {
// 如果是配件订单,先拆分订单
if(order.orderType === 1 && order.hasServiceOrder === 0 && order.serviceShopId && order.goods.installService == 1) {
// this.curOrder = order;
// this.showAllocateServiceMoney = true;
uni.showToast({
icon: 'none',
title: '商品包安装/包服务,接单前请先安装确认!'
})
return
}
if(order.orderDetailId && order.insuranceId) {
// 子单并且订单有保险
const detailUserStatus = this.varifyDetailOrderUser()
if(detailUserStatus.check) {
const validUser = certData.certNo && certData.certName ? certData : detailUserStatus
const res = await this.$request.insuranceUserAdd({
idCardNum: validUser.certNo,
phone: this.curUserInfo.phone,
name: validUser.certName,
orderDetailId: order.orderDetailId
})
if (res.code === 0) {
// 增员完毕,保险已生效
} else {
uni.showToast({
icon: 'none',
title: '保险未响应,请再次点接单',
})
// 没有身份信息,让用户填写
// this.storageArgs = arguments;
// this.showInsuranceVertify = true
return
}
} else {
// 没有身份信息,让用户填写
this.storageArgs = arguments;
this.showInsuranceVertify = true
return
}
}
if(order.insuranceId) {
// 订单有保险校验保险信息
const varifyData = await this.$request.certNoTwoElementVerification({
workerId: this.curUserInfo.workerId,
...certData
})
if(varifyData && varifyData.code === 0 && varifyData.data === '身份证二要素校验失败!') {
// 验证不通过,弹出输入弹窗
uni.showToast({
icon: 'none',
title: '身份信息校验失败,请重新输入',
duration: 2500
})
this.storageArgs = arguments;
this.showInsuranceVertify = true
return
}
}
this.storageArgs = null;
let res = await this.$request[funName]({
id: id,
orderStatus: status,
});
if (res && res.code === 0) {
this.reloadMasterOrderPage();
this.showModal(e, order);
if(funName == 'updateMasterOrder') {
this.addOrderOperate({
orderId: id,
orderType: '01',
content: `师傅接单`
})
} else {
this.addOrderOperate({
orderId: id,
orderType: '02',
content: `师傅接单`
})
}
}
},
async noticeMsg(params = {}) {
this.$request.noticeMsg({
openId: this.curUserInfo.openId,
remind: params.remind,
orderId: params.orderId,
name: params.name,
orderStatus: 'RECEIVE'
});
},
async updateOrderStatus(id, status, funName) {
let res = await this.$request[funName]({
id: id,
orderStatus: status,
});
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success'
})
return true;
}
return false;
},
updateRefundStatus(status, index) {
this.orderList[index].refundStatus = status;
},
updateAfterSaleDealStatus(status, index) {
this.orderList[index].afterSaleDealStatus = status;
},
getCanAssignList(order) {
if (this.myTeamMembers && this.myTeamMembers.length) {
this.$refs.dispatchOrderPopup.$children[0].loadData(order);
}
},
async workBegin(order) {
let curDate = new Date();
let formatCurDate = curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate()
+ ' ' + curDate.getHours() + ':' + curDate.getMinutes() + ':' + curDate.getSeconds();
let params = {
id: order.orderDetailId,
orderStatus: 3,
workBeginTime: formatCurDate
}
let res = await this.$request.updateDetailOrder(params);
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success',
duration: 1000
})
}
},
/* modalpopup确认或关闭后的回调 */
async showAfterSalePic() {
// TODO:查询该售后单中的拒绝原因中上传的截图
this.picModalImgList = await this.$api.data('picImgList');
console.log(this.picModalImgList)
},
async assignWork(params) {
// 仅属于转发操作
if(this.curOrder.orderMode === 'transferOrder') {
const newParams = {
newWorkerId: params.workerId,
transferAmount: params.totalPay,
orderId: params.orderMasterId,
}
let res = await this.$request.transferOrder(newParams);
console.log(res);
if (res && res.code === 0) {
this.$refs.dispatchOrderPopup.close();
this.reloadMasterOrderPage();
this.addOrderOperate({
orderId: this.curOrder.orderDetailId == null ? this.curOrder.orderMasterId : this.curOrder.orderDetailId,
orderType: this.curOrder.orderDetailId == null ? '01' : '02',
content: params.workerName ? `师傅转发给-${params.workerName}` : '师傅转发到大厅'
})
uni.showToast({
title: '转发成功',
icon: 'success'
})
return true;
} else {
uni.showToast({
title: '转发失败',
icon: 'none'
})
return false;
}
} else {
let res = await this.$request.assign(params);
if (res && res.code === 0) {
this.getCanAssignList(this.curOrder);
this.reloadMasterOrderPage();
uni.showToast({
title: '派单成功',
icon: 'success'
})
if(params.workerName) {
this.addOrderOperate({
orderId: this.curOrder.orderDetailId == null ? this.curOrder.orderMasterId : this.curOrder.orderDetailId,
orderType: this.curOrder.orderDetailId == null ? '01' : '02',
content: `师傅派单给-${params.workerName}`
})
}
return true;
} else {
uni.showToast({
title: '派单失败,请确认派单价格不高于本订单价格',
icon: 'none'
})
return false;
}
}
},
async assignWork2MySelf(orderInfo, toNextStatusSerivce) {
let resCheck = await this.$request.checkOrderInsurance({
orderCode: orderInfo.orderMasterCode
});
if(resCheck.code !== 0) return;
let res = await this.$request.getCanAssignList({
orderMasterId: orderInfo.orderMasterId
});
let pickedList = res.data;
let goodsToAssign = [];
pickedList.forEach((goods) => {
goodsToAssign.push({
goodsStandardId: goods.goodsStandardId,
num: goods.goodsNum
})
});
let params = {
goodsList: goodsToAssign,
workerId: this.curUserInfo.workerId,
totalPay: orderInfo.totalMoney,
orderMasterId: orderInfo.orderMasterId,
isAll: 1
}
if(toNextStatusSerivce) {
params.isQuicklyDelivery = 1
}
this.addOrderOperate({
orderId: orderInfo.orderDetailId == null ? orderInfo.orderMasterId : orderInfo.orderDetailId,
orderType: orderInfo.orderDetailId == null ? '01' : '02',
content: '师傅接单'
})
console.log(params)
return await this.assignWork(params);
},
async rejectMasterOrder(order) {
let res = await this.$request.updateOrder({
id: order.orderMasterId,
workerId: -1
});
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success',
title: '拒单成功',
duration: 1000
})
} else {
uni.showToast({
icon: 'none',
title: '拒单失败'
})
}
},
async rejectDetailOrder(order) {
let res = await this.$request.rejectDetailOrder({
id: order.orderDetailId
});
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success',
title: '退单成功',
duration: 1000
})
this.addOrderOperate({
orderId: order.orderDetailId,
orderType: '02',
content: '师傅退单'
})
} else {
uni.showToast({
icon: 'none',
title: '退单失败'
})
}
},
rejectMasterOrderWhenAccepted(order) {
if(order.orderDetailId == null && this.tabCur === 0) {
// 到店服务主单退单的那个退单键。和商品有派安装单的时候退单的退单键
if(order.goods.storeService && order.hasServiceOrder !== 1) {
this.mutipleLineText = [
'1.你的订单属到店服务,整单退单请把所有派出子单退回后,让客户点“取消订单”键。',
'2.如派出子单已完成结算支付则客户无法“取消订单”,且已完成订单的金额与分销金额无法系统退回。非客户责任的建议你线下退全款并完成订单(等于你承担无法退回的分销费用)!'
]
this.$refs.mutipleLineModal.showModal();
return;
}
if(order.serviceCancelled != 1 && order.hasServiceOrder === 1) {
this.mutipleLineText = [
'1.你有派出安装服务单(服务订单监控单内查看),退单需协商服务单先退回,然后请让客户点“取消订单”键。',
'2.如服务单已安装/已施工无法免费退回,你可协商单独付服务费让其退回。',
'3.如安装服务单已完成并从系统上支付结算,则服务单与分销款无法系统退回。非客户责任的建议你线下退全款并完成订单(等于你承担安装费与分销费)!'
]
this.$refs.mutipleLineModal.showModal();
return;
}
}
if(order.masterWorkerId === order.workerId) {
uni.showModal({
title: '提示',
content: order.orderType == 1 ? '确认后订单回到你拣货/发货栏,你可重新派单或操作彻底退单' : '确认后订单回到你未约/未排栏,你可重新派单或操作彻底退单',
success: async (res) => {
if(res.confirm) {
let res
if(order.orderDetailId) {
res = await this.$request.rejectDetailOrder({
id: order.orderDetailId
});
} else {
res = await this.$request.rejectMasterOrderWhenAccepted({
id: order.orderMasterId
});
}
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'none',
title: '退单成功',
duration: 1000
})
// this.addOrderOperate({
// orderId: order.orderMasterId,
// orderType: '01',
// content: '师傅退单'
// })
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
})
}
}
}
})
} else {
const orderId = order.orderDetailId ? order.orderDetailId : order.orderMasterId
const isDetailOrder = order.orderDetailId ? 1 : 0
uni.navigateTo({
url: '/pages/order-manage/cancel-order?orderId='+orderId+'&orderType=1&isDetailOrder='+isDetailOrder
})
}
},
async getChangedPrice(order) {
let res = await this.$request.getChangeOrderPrice(order);
if (res && res.code === 0 && res.data) {
return res.data;
}
return null;
},
async changePrice(e, order) {
let priceObj = await this.getChangedPrice(order);
let refName = e.currentTarget.dataset.ref;
this.showModal(e, order);
this.$nextTick(() => {
this.$refs[refName].init(priceObj);
})
},
viewImage(e, imgList) {
uni.previewImage({
urls: imgList,
current: e.currentTarget.dataset.url
});
},
async authLocationCallback(res) {
if (res.detail.authSetting['scope.userLocation']) {
this.hasAuthLocation = true;
}
},
async recordClockInLocation(order) {
let _this = this;
// 通过 wx.getSetting 先查询一下用户是否授权了authScope
let res1 = await wx.getSetting();
if (res1) {
if (!res1.authSetting['scope.userLocation']) {
let res2 = await wx.getLocation({
type: 'gcj02',
fail: async (result) => {
console.log(result)
if (result.errno === 103) {
this.hasAuthLocation = false;
// 用户授权
uni.showToast({
title: '请先授权',
icon: 'none',
duration: 1500
})
} else {
// 用户授权
uni.showToast({
title: '请确认是否开启定位',
icon: 'none',
duration: 1500
})
}
},
success: async (result) => {
_this.persistClockInLocation(order, result);
}
})
} else {
wx.getLocation({
type: 'gcj02',
fail: async (result) => {
console.log(result)
if (result.errCode === 2 || result.errCode === 404) {
uni.showToast({
title: '定位获取失败,请确认是否开启定位',
icon: 'none',
duration: 2500
})
} else {
uni.showToast({
title: '定位获取失败,请稍后重试',
icon: 'none',
duration: 2500
})
}
},
success: async (result) => {
_this.persistClockInLocation(order, result);
}
})
}
}
},
async persistClockInLocation(order, res) {
let params = {
id: order.orderDetailId,
clockInLocation: res.longitude + "," + res.latitude
}
let updateOrderRes = await this.$request.updateDetailOrder(params);
if (updateOrderRes && updateOrderRes.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success',
duration: 1000
})
this.addOrderOperate({
orderId: order.orderDetailId,
orderType: '02',
content: '打卡到达'
})
}
},
async revisit() {
if(!this.afterServiceType) {
uni.showToast({
icon: 'none',
duration: 1000,
title: '请选择重发/补发方案',
})
return;
}
let res = await this.$request.workerResendPlan({
id: this.curOrder.afterServiceRecordList[0].id,
orderDetailId: this.curOrder.orderDetailId,
workerResendPlan: this.afterServiceType.code,
updateBy: this.curUserInfo.workerId,
workerFeedbackResult: 2
});
if (res && res.code === 0) {
uni.showToast({
icon: 'success',
title: '提交成功',
duration: 1000
})
this.reloadMasterOrderPage();
this.afterServiceType = null
return;
}
uni.showToast({
icon: 'error',
duration: 1000,
title: '提交失败',
})
},
setCurTab(curTab) {
this.tabCur = curTab;
this.stateCur = null;
this.reloadMasterOrderPage();
},
// 确认开票
makeSureBillSigned(order) {
if(order.isInvoiced != 1) return
uni.showModal({
title: '温馨提示',
content: '开票金额应按客户购买金额开票(与上架的售价相同),如售价未含税需与客户沟通一致。确认已开票及给客户发送票据后请点确定',
confirmText: '确认',
cancelText: '关闭',
success: async (res) => {
if (res.confirm) {
await this.$request.changeInvoiceStatus({
id: order.orderDetailId || order.orderMasterId,
isInvoiced: 1
})
this.reloadMasterOrderPage();
}
}
})
},
async serveringReturn(order) {
const res = await this.$request.returnOrder({
id: order.orderDetailId
})
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'success',
title: '操作成功',
duration: 1000
})
this.addOrderOperate({
orderId: order.orderDetailId,
orderType: '02',
content: '发货退回'
})
} else {
uni.showToast({
icon: 'none',
title: '操作失败',
duration: 1000
})
}
},
updateOrderWorkerRemark(order, index) {
this.curOrder = order;
this.curOrder.currentIndex = index;
this.showEditWorkerRemark = true;
this.$refs.editOrderRemarkPopup.open()
},
async updateOrderWorkerRemarkOpreation(input) {
let reqFunName = "saveMasterWorkerRemark", id;
if (this.curOrder.orderDetailId) {
reqFunName = "updateDetailOrder";
id = this.curOrder.orderDetailId;
} else {
id = this.curOrder.orderMasterId;
}
// 确定参数
let params = {
id: id,
workerRemark: input
}
let res = await this.$request[reqFunName](params);
if (res.code === 0) {
uni.showToast({
icon: 'success',
title: '操作成功',
duration: 1000
})
const currentOrder = this.orderList[this.curOrder.currentIndex]
currentOrder.workerRemark = input
this.set(this.orderList, this.curOrder.currentIndex, currentOrder)
} else {
uni.showToast({
icon: 'none',
title: '操作失败',
duration: 1000
})
}
},
ServOrderRefund(order) {
uni.showModal({
title: '提示',
content: '是否确认整单退款?',
success: async (res) => {
if(res.confirm) {
let res = await this.$request.goodsOrderRefund({
goodsOrderMasterId: order.orderMasterId
});
if (res.code === 0) {
uni.showToast({
icon: 'success',
title: '操作成功',
duration: 1000
})
this.reloadMasterOrderPage();
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 1000
})
}
}
}
})
}
}
}
</script>
<style scoped>
.inline-combox {
display: inline-block;
width: calc((90vw - 80rpx)/2);
}
.cu-list.grid.no-border {
padding: unset;
}
.cu-list.grid.no-border>.cu-item {
padding-top: 20rpx;
padding-bottom: 20rpx;
}
.right-tag {
position: relative;
right: -30rpx;
border-radius: 40rpx 0 0 40rpx;
}
.cu-tag+.cu-tag {
margin-left: unset;
}
.left-top-sm-bar {
position: absolute;
right: 25rpx;
top: 25rpx;
z-index: 99;
}
.order-name {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>