12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457 |
- <template>
- <div>
- <el-row class="track-detail">
- <!-- 订单追踪、订单详情 -->
- <el-col :span="7" v-loading="!orderDetailStutus && !showTrack" element-loading-text="拼命加载中">
- <div class="order_detail">
- <div class="detail_title">
- <div v-show="buttonStatus !== 0 && buttonStatus !== 10" class="detail_txt" @click="orderDetailStutus = 0" :class="{ detail_txt_ac: !orderDetailStutus }">
- 订单跟踪
- </div>
- <div class="detail_txt" @click="orderDetailStutus = 1" :class="{ detail_txt_ac: !!orderDetailStutus }">
- 订单详情
- </div>
- </div>
- <order-track v-show="showTrack" :riderArriveTime="riderArriveTime" :buttonStatus="buttonStatus" :trackOrder="trackOrder" v-if="!orderDetailStutus && needTrack"></order-track>
- <order-detail v-show="showDetail" :buttonStatus="buttonStatus" :orderDetail="orderDetail" v-else></order-detail>
- <!-- 订单跟踪、订单详情底部按钮 -->
- <div class="bottom-btns" v-show="showDetail || showTrack">
- <!-- 新订单 -->
- <div class="btns" v-if="buttonStatus === 0">
- <el-button size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
- <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots">忽略订单</el-button>
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" class="btn_bots">补打小票</el-button>
- <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
- </div>
- <!-- 预约单 -->
- <div class="btns" v-if="buttonStatus === 10">
- <div class="btn_bot" v-if="list[curIdx].waimaiOrderId">
- <el-dropdown>
- <span class="el-dropdown-link">更多</span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)"><span style="color: #fc7200">补打小票</span></el-dropdown-item>
- <el-dropdown-item @click.native="iGnoreOrder(list[curIdx].id)">忽略订单</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- <el-button size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
- <el-button v-if="list[curIdx].waimaiOrderId" size="small" @click.native="settingTime(list[curIdx])" class="btn_bots btn">{{
- list[curIdx].delayTime ? "修改定时" : "预约发单"
- }}</el-button>
- <el-button v-else size="small" @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
- <!-- <el-button size="small" @click.native="settingTime(list[curIdx])" class="btn_bots ">预约发单</el-button> -->
- <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
- <!-- <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)"><span style="color: #fc7200">补打小票</span></el-dropdown-item> -->
- </div>
- <!-- 待接单 -->
- <div class="btns" v-if="buttonStatus === 1">
- <el-button size="small" @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" v-if="list[curIdx].waimaiOrderId" class="btn_bots">补打小票</el-button>
- <el-button size="small" @click.native="addTip(list[curIdx].id)" class="btn_bots btn">加小费</el-button>
- </div>
- <!-- 取货中 -->
- <div class="btns" v-if="buttonStatus === 2">
- <el-button size="small" @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" v-if="list[curIdx].waimaiOrderId" class="btn_bots btn">补打小票</el-button>
- </div>
- <!-- 配送中 -->
- <div class="btns" v-if="buttonStatus === 3">
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId" class="btn_bots btn">补打小票</el-button>
- <el-button size='small' @click.native="againOrder(list[curIdx])" class="btn_bots btn">再来一单</el-button>
- </div>
- <!-- 异常单 -->
- <div class="btns" v-if="buttonStatus === -2">
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" v-if="list[curIdx].waimaiOrderId" class="btn_bots">补打小票</el-button>
- <el-button size="small" @click.native="orderBack(list[curIdx].id)" class="btn_bots btn">撤回订单</el-button>
- </div>
- <!-- 已取消 -->
- <div class="btns" v-if="buttonStatus === -1">
- <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId&&list[curIdx].cancelType===4" class="btn_bots">补打小票</el-button>
- <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" class="btn_bots btn">再来一单</el-button>
- </div>
- <!-- 已完成 -->
- <div class="btns" v-if="buttonStatus === 97">
- <el-button size='small' @click.native="againOrder(list[curIdx])" class="btn_bots btn">再来一单</el-button>
- </div>
- <!-- 其他平台已完成 -->
- <div class="btns" v-if="buttonStatus === 98">
- <el-button size='small' @click.native="againOrder(list[curIdx])" class="btn_bots btn">再来一单</el-button>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row class="list-info">
- <el-col :span="17">
- <div v-loading="isLoading" element-loading-text="正在计算中...">
- <div class="order_item" @click="chooseOrder(item, i)" v-for="(item, i) in list" :key="i">
- <div class="order_item_header">
- <div class="order_item_header_l">
- <div v-if="item.daySeq" class="Serial_number" :style="daySeqColor(item.orderType)">
- #{{ item.daySeq }}
- </div>
- <img :src="item.logo || item.waimaiLogo" class="logo" />
- <span class="name">{{ item.shopName }}</span>
- <div class="sign_time" v-if="item.waimaiOrderId && [1,2].includes(item.takeType)">
- {{ item.exceptTime.slice(5,16) }}前送达
- </div>
- <div class="sign_txt" v-if="item.buttonStatus === 0 && item.waimaiOrderId && item.takeType == 0">
- 立即送达,{{item.orderTime.slice(-8,-3)}}下单
- </div>
- <div class="sign_d" v-if="item.buttonStatus === 10 && item.timeTxt">{{item.timeTxt}}自动发起配送</div>
- <div v-if="item.buttonStatus === 10 && !item.waimaiOrderId" class="sign_d">{{item.deliveryTime.slice(5)}}自动发起配送</div>
- <!-- 近三日订单 -->
- <!-- <div class="sign_f" v-if="[-1,7].includes(tabNum) &&item.finishTime">{{item.finishTime && item.finishTime.slice(5)}}已完成</div> -->
- </div>
- <!-- 新订单 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 0">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">新订单</el-tag>
- <el-button size="small" class="btn" @click.stop="sendNow(item)">发起配送</el-button>
- </div>
- <!-- 预约单 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 10">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">预约单</el-tag>
- <!-- <el-button size='small' @click.stop="iGnoreOrder(item.id)">忽略订单</el-button> -->
- <!-- <el-button size='small' @click.stop="itemAddRemark(item.id, item)">添加备注</el-button> -->
- <el-button v-if="item.waimaiOrderId" size="small" class="btn" @click.stop="settingTime(item)">{{
- item.delayTime ? "修改定时" : "定时发单"
- }}</el-button>
- <el-button v-else size="small" class="btn" @click.stop="sendNow(item)">立即配送</el-button>
- </div>
- <!-- 待接单 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 1">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">待接单</el-tag>
- <span class="header_r">已发单{{ item.takeTimeTxt }}</span>
- <!-- <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button> -->
- <el-button size="small" class="btn" @click.stop="orderPrinter(item.waimaiOrderId,item.id)" v-if="item.waimaiOrderId">补打小票</el-button>
- <!-- <el-button size='small' class="btn" @click.stop="addTip(item.id)">加 小 费</el-button> -->
- </div>
- <!-- 取货中 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 2">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">取货中</el-tag>
- <!-- <span v-show="Number(item.riderArriveMinute)" class="header_r">预计{{Number(item.riderArriveMinute)}}分钟取件</span> -->
- <!-- <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button> -->
- <el-button size="small" class="btn" @click.stop="orderPrinter(item.waimaiOrderId,item.id)" v-if="item.waimaiOrderId">补打小票</el-button>
- </div>
- <!-- 配送中 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 3">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">配送中</el-tag>
- <!-- <span class="header_r" v-if="item.exceptTime">预计{{ item.exceptTime }}送达,{{item.surPlusMinute >= 0 ? '剩余'+item.surPlusMinute + '分钟' : '超时' +item.surPlusMinute +"分钟" }}</span> -->
- <el-button size="small" class="btn" @click.stop="orderPrinter(item.waimaiOrderId,item.id)" v-if="item.waimaiOrderId">补打小票</el-button>
- </div>
- <!-- 异常单 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === -2">
- <el-tag class="header_r">{{
- showCancelType(item.cancelType)
- }}</el-tag>
- <el-button size="small" class="btn" @click.stop="orderBack(item.id)">撤回订单</el-button>
- </div>
- <!-- 取消单 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === -1">
- <el-tag class="header_r">{{
- showCancelType(item.cancelType)
- }}</el-tag>
- <!-- <el-button v-if="item.cancelType===4&&item.waimaiOrderId" size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId,item.id)">补打小票</el-button> -->
- <el-button size="small" class="btn" @click.stop="againOrder(item)">再来一单</el-button>
- </div>
- <!-- 猎豹平台已完成 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 97">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">已完成</el-tag>
- <el-button size="small" class="btn" @click.stop="againOrder(item)">再来一单</el-button>
- </div>
- <!-- 其他平台已完成 -->
- <div class="order_item_header_r" v-if="item.buttonStatus === 98">
- <el-tag v-if="[-1,7].includes(tabNum)" class="header_r">其他平台已完成</el-tag>
- <el-button size="small" class="btn" @click.stop="againOrder(item)">再来一单</el-button>
- </div>
- </div>
- <div class="order_item_cont" :class="curIdx === i ? 'active_order_item_cont' : ''">
- <div class="address">
- {{ item.receiptAddress }}
- <div class="distance" @click.stop="checkMap(item)">
- <img class="img" src="../../../static/image/show-map-icon.png" alt="">
- <span class="show-map">查看地图</span>
- </div>
- </div>
- <div class="content">
- {{ item.receiptContactName
- }}<span>{{ item.receiptPhone }}{{item.receiptExtension ? "," + item.receiptExtension : ""}}</span>
- </div>
- <div v-if="item.caution" class="itme_r">
- 备注:{{ item.caution }}
- </div>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <!-- 发起配送 -->
- <send-order-popup :tabNum="tabNum" ref="sendOrderPopup"></send-order-popup>
- <!-- 骑手、商家、发件人地图 -->
- <order-map ref="orderMap"></order-map>
- <!-- 备注弹出层 -->
- <el-dialog width="580px" center title="新增备注" destroy-on-close :visible.sync="dialogTableVisible">
- <div>
- <el-input placeholder="请添加备注信息,最多输入20个字!" v-model="remark" clearable :maxlength="20" />
- </div>
- <div style="text-align: center; margin-top: 20px">
- <el-button @click.stop="dialogTableVisible = false">取消</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="commitRemark(orderId, item)">确定</el-button>
- </div>
- </el-dialog>
- <!-- 设置预约发单时间弹出层 -->
- <el-dialog width="580px" center :title="exceptTime" destroy-on-close :visible.sync="settingTimeStatus">
- <div>
- <span>提前多长时间发起配送:</span>
- <el-select size="small" style="width: 80px" v-model="timeValue" placeholder="请选择">
- <el-option v-for="(item, index) in timeList" :key="index" :label="item" :value="item"></el-option>
- </el-select>
- <span>小时</span>
- </div>
- <p style="color: #f74141">
- 提示:设置后系统将根据您设置的提前时间自动发单。{{delayTime ? '' : '如需骑手立即取件请点击立即配送!'}}
- </p>
- <div style="text-align: center; margin-top: 20px">
- <el-button v-if="delayTime" @click.stop="cancalSettingTime">取消预约发单</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="commitTimeValue(orderId)">{{delayTime ? '确定修改' : '保存'}}</el-button>
- </div>
- </el-dialog>
- <!-- 取消订单弹出层 -->
- <el-dialog width="680px" center title="取消原因" destroy-on-close :visible.sync="cancelStatus">
- <div class="cancel-list">
- <div class="item" @click.stop="changeReason(item)" :class="[
- (index + 1) % 3 == 0 ? 'no-margin' : '',
- item.id == reasonIndex ? 'active' : '',
- ]" v-for="(item, index) in cancelList" :key="index">
- {{ item.name }}
- </div>
- </div>
- <div class="text-area">
- <el-input show-word-limit :rows="4" type="textarea" resize="none" :maxlength="50" placeholder="请输入其他原因" v-model="cancelReason"></el-input>
- </div>
- <div style="text-align: center; margin-top: 20px">
- <el-button @click.stop="cancelStatus = false">取消</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="commitCancelReason(orderId)">确定</el-button>
- </div>
- </el-dialog>
- <!-- 加小费弹出层 -->
- <el-dialog width="580px" center title="加小费" destroy-on-close :visible.sync="addTipStatus">
- <div>
- <div class="tip-title">小费金额</div>
- <div class="tip-list">
- <div class="tip-item" @click.stop="tipActive = index" :class="tipActive == index ? 'tip-active' : ''" v-for="(item, index) in tipList" :key="index">
- {{ item }}元
- </div>
- <div class="tip-item" @click.stop="tipActive = -1" :class="tipActive == -1 ? 'tip-active' : ''">
- <el-input placeholder="其他金额" v-model="tipAmount" />
- </div>
- </div>
- <!-- 支付方式 -->
- <div class="choose-self" style="border: none">
- <div class="self-top">
- <span>支付方式</span>
- </div>
- <div class="pay-list">
- <div class="pay-item" @click.stop="paymentType = item.id" :class="paymentType == item.id ? 'pay-active' : ''" v-for="(item, index) in payList" :key="index">
- <img :src="item.icon" class="pay-icon" />
- <span>{{ item.name }}</span>
- </div>
- </div>
- </div>
- </div>
- <div style="text-align: center; margin-top: 20px">
- <el-button @click.stop="addTipStatus = false">取消</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="richMoney(orderId)">确定</el-button>
- </div>
- </el-dialog>
- <!-- 支付二维码弹出层 -->
- <qr-code v-if="showCode" @paySuccess="paySuccess" @refreshCode="recharge" @closeCode="showCode = false" ref="code" :payAmount="payAmount" :link="link" :paymentType="paymentType" :orderSn="orderSn"></qr-code>
- </div>
- </template>
- <script>
- import moment from "moment";
- import bus from "../../common/bus.js";
- import orderMap from "./orderAMap.vue";
- import OrderDetail from "./orderDetail.vue";
- import orderTrack from "./orderTrack.vue";
- import { mapState } from "vuex";
- import sendOrderPopup from "./sendOrderPopup.vue";
- import qrCode from "../../common/qrCode.vue";
- import {
- sendValuation,
- waimaiprinter,
- addRemark,
- ignoreOrder,
- rollOrder,
- setDeliveryTime,
- cancelTimingPublish,
- cancelOrder,
- trackOrder,
- detailOrder,
- tips,
- getRiderArriveTime,
- getPayResult,
- getMapData,
- } from "../../api/order.js";
- export default {
- name: "OrderList",
- data() {
- return {
- payAmount: 0,
- paymentType: 1, // 1 支付宝 0 微信
- payList: [
- {
- id: 1,
- name: "支付宝支付",
- icon: require("../../../static/image/alipay.png"),
- },
- {
- id: 2,
- name: "微信支付",
- icon: require("../../../static/image/we-chat.png"),
- },
- {
- id: 4,
- name: "余额/三方支付",
- icon: require("../../../static/image/yu-e.png"),
- },
- ],
- tipActive: 0,
- tipList: [1, 2, 5, 10, 15, 20, 30, 50],
- tipAmount: "", // 小费金额
- addTipStatus: false, // 加小费弹出层
- reasonIndex: null, // 取消原因索引
- chooseReason: "", // 选择取消原因
- cancelReason: "", // 输入取消原因
- cancelList: [
- { id: 1, name: "无骑手接单" },
- { id: 2, name: "骑手接单后不取货" },
- { id: 3, name: "骑手电车装不下" },
- { id: 4, name: "计划有变,无需配送" },
- { id: 5, name: "骑手服务态度恶劣" },
- { id: 6, name: "骑手要求取消订单" },
- { id: 7, name: "信息填写错误" },
- { id: 8, name: "其他原因" },
- ],
- timeList: [1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 11, 12],
- timeValue: 1, // 定时发单,默认1小时
- cancelStatus: false, // 取消订单弹出层
- settingTimeStatus: false, // 定时发单弹出层
- needTrack: false,
- orderDetailStutus: 1,
- isLoading: false,
- dialogTableVisible: false,
- remark: "",
- orderId: "",
- item: {},
- radio: "",
- needTrack: false,
- curIdx: 0,
- trackOrder: {},
- orderDetail: {},
- showDetail: false,
- showTrack: false,
- showCode: false,
- link: "",
- buttonStatus: 0,
- exceptTime: "",
- delayTime: "", // 预约延迟时间
- riderArriveTime: {}, //骑手预计取货送达时间
- };
- },
- props: {
- tabNum: Number,
- list: Array,
- },
- components: {
- sendOrderPopup,
- orderMap,
- OrderDetail,
- orderTrack,
- qrCode,
- },
- watch: {
- tabNum(newVal, oldVal) {
- this.curIdx = 0;
- },
- list: {
- handler(newVal, oldVal) {
- this.buttonStatus = newVal.length ? newVal[0].buttonStatus : 0;
- if (this.buttonStatus === 0 || this.buttonStatus === 10) {
- this.needTrack = false;
- this.orderDetailStutus = 1;
- } else {
- this.needTrack = true;
- this.orderDetailStutus = 0;
- }
- this.getDetailOrder();
- this.getTrackOrder();
- this.getRiderArriveTime();
- },
- immediate: true,
- },
- },
- destroyed() {},
- computed: {
- ...mapState(["userInfo"]),
- },
- methods: {
- daySeqColor(type) {
- let bgColor = "";
- switch (type) {
- case 1:
- bgColor = "#FDC502";
- break;
- case 2:
- bgColor = "#2491FF";
- break;
- case 3:
- bgColor = "#2491FF";
- break;
- case 5:
- bgColor = "#FDC502";
- break;
- case 6:
- bgColor = "#00A82D";
- break;
- case 7:
- bgColor = "#2788FE";
- break;
- case 8:
- bgColor = "#EE0000";
- break;
- default:
- bgColor = "#fc7200";
- break;
- }
- return { background: bgColor };
- },
- // 再来一单
- againOrder(order) {
- if ([97, 98].includes(order.buttonStatus)) {
- this.$confirm("当前订单已完成,确认要再次发起配送吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- center: true,
- })
- .then(() => {
- this.$router.push({
- name: "manualCreate",
- params: {
- orderId: order.id,
- },
- });
- })
- .catch(() => {});
- } else {
- this.$router.push({
- name: "manualCreate",
- params: {
- orderId: order.id,
- },
- });
- }
- },
- paySuccess() {
- this.showCode = false;
- this.addTipStatus = false;
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- },
- richMoney() {
- let reg = /(^[1-9]\d*$)/g;
- if (this.tipActive == -1) {
- if (!reg.test(this.tipAmount * 1)) {
- return this.$message({
- message: "请选择或输入正确的整数金额",
- type: "error",
- });
- }
- }
- let params = {
- orderId: this.orderId,
- tipAmount:
- this.tipActive == -1 ? this.tipAmount : this.tipList[this.tipActive],
- paymentType: this.paymentType,
- createType: 1,
- };
- tips(params).then((res) => {
- if (res.code == 200) {
- if (this.paymentType == 4) {
- // 余额支付
- this.$message({
- message: "小费添加成功",
- type: "success",
- });
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- this.addTipStatus = false;
- this.tipAmount = "";
- } else if (this.paymentType == 1 || this.paymentType == 2) {
- // 支付宝、微信支付
- this.payAmount = res.data.amount || 0;
- this.orderSn = res.data.orderSn;
- this.link = res.data.data;
- this.showCode = true;
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- addTip(orderId) {
- this.orderId = orderId;
- this.paymentType = 4;
- this.addTipStatus = true;
- },
- changeReason(item) {
- this.reasonIndex = item.id;
- this.chooseReason = item.name;
- },
- doCancelOrder() {
- cancelOrder({
- orderId: this.orderId,
- cancelReason:
- this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
- }).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "取消订单成功",
- type: "success",
- });
- this.orderId = "";
- this.cancelReason = "";
- this.chooseReason = "";
- this.reasonIndex = null;
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- this.cancelStatus = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 取消订单
- commitCancelReason() {
- if (!this.reasonIndex) {
- return this.$message({
- message: "请选择取消原因",
- type: "error",
- });
- }
- if (this.reasonIndex == 8 && !this.cancelReason.trim()) {
- return this.$message({
- message: "请填写其他取消原因",
- type: "error",
- });
- }
- if (this.buttonStatus !== 2) {
- this.doCancelOrder();
- return;
- }
- this.$confirm("取货中取消订单可能会存在违约金, 是否继续?", "提示", {
- confirmButtonText: "继续",
- showClose: false,
- closeOnClickModal: false,
- center: true,
- type: "warning",
- })
- .then(() => {
- this.doCancelOrder();
- })
- .catch(() => {
- this.cancelStatus = false;
- });
- },
- // 取消定时发单
- cancalSettingTime() {
- cancelTimingPublish({ orderId: this.item.id }).then((res) => {
- this.settingTimeStatus = false;
- if (res.code == 200) {
- this.$message({
- message: "取消定时发单成功",
- type: "success",
- });
- this.item = {};
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- commitTimeValue() {
- let timestamp = new Date().valueOf();
- let exT = moment(this.item.exceptTime).valueOf();
- let nowTime = moment(exT)
- .subtract(this.timeValue, "hours")
- .format("YYYY-MM-DD HH:mm:ss"); //当前时间的前n小时时间
- let t1 = moment(nowTime).valueOf(); // 时间戳
- console.log(nowTime, this.item, "-------------");
- if (t1 - timestamp < 0) {
- return this.$message({
- message: `设置发单时间超出当前时间`,
- type: "error",
- });
- }
- setDeliveryTime({
- orderId: this.item.id,
- delayTime: this.timeValue,
- }).then((res) => {
- this.settingTimeStatus = false;
- if (res.code == 200) {
- this.$message({
- message: "设置定时发单成功",
- type: "success",
- });
- this.item = {};
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 定时发单
- settingTime(item) {
- this.item = item;
- this.settingTimeStatus = true;
- this.delayTime = item.delayTime;
- this.timeValue = item.delayTime ? item.delayTime : 1;
- this.exceptTime = `预约期望${item.exceptTime.slice(5)}送达`;
- },
- // 取消订单
- cancelOrder(orderId) {
- this.orderId = orderId;
- this.cancelStatus = true;
- },
- chooseOrder(v, index) {
- this.buttonStatus = this.list[index].buttonStatus;
- if (this.buttonStatus === 0 || this.buttonStatus === 10) {
- this.needTrack = false;
- this.orderDetailStutus = 1;
- } else {
- this.needTrack = true;
- this.orderDetailStutus = 0;
- }
- this.curIdx = index;
- this.getDetailOrder();
- this.getTrackOrder();
- this.getRiderArriveTime();
- },
- // 忽略订单
- iGnoreOrder(orderId) {
- this.orderId = orderId;
- this.$confirm("确定要忽略此单?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- center: true,
- showClose: false,
- closeOnClickModal: false,
- type: "warning",
- })
- .then(() => {
- ignoreOrder({ orderId }).then((res) => {
- if (res.code == 200) {
- this.$message({
- type: "success",
- message: "已忽略!",
- });
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消",
- });
- });
- },
- itemAddRemark(orderId, item) {
- this.dialogTableVisible = true;
- this.orderId = orderId;
- this.item = item;
- this.remark = item.takeRemark || "";
- },
- // 一键发单备注
- commitRemark(orderId, item) {
- let params = {
- orderId,
- remark: this.remark.trim(),
- };
- addRemark(params).then((res) => {
- this.dialogTableVisible = false;
- if (res.code == 200) {
- this.$message({
- message: "添加备注成功",
- type: "success",
- });
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 查看地图
- checkMap(item) {
- this.$refs.orderMap.setDialogStatus(item);
- },
- sendNow(item) {
- this.getValuation(item);
- },
- // 撤回订单
- orderBack(orderId) {
- rollOrder({ orderId }).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- bus.$emit("refreshData");
- bus.$emit("refreshData2");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 补打小票
- orderPrinter(waimaiId, id) {
- if (id) {
- bus.$emit("startUsbPrint", id);
- }
- if (!waimaiId) return;
- waimaiprinter({ waimaiId }).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 计价
- getValuation(order) {
- let requestData = {
- productId: order.productId,
- transport: 0,
- productAmount: 50,
- sendAddress: {
- id: order.sendAddressId,
- provinceName: order.sendProvinceName,
- cityName: order.sendCityName,
- districtName: order.sendDistrictName,
- street: order.sendStreet,
- lat: order.sendLat,
- lng: order.sendLng,
- phone: order.sendPhone,
- extension: order.sendExtension,
- contact: order.sendContactName,
- address: order.sendAddress,
- cityCode: order.sendCityCode,
- },
- receiptAddress: {
- id: order.receiptAddressId,
- provinceName: order.receiptProvince,
- cityName: order.receiptCityName,
- districtName: order.receiptDistrictName,
- lat: order.receiptLat,
- lng: order.receiptLng,
- phone: order.receiptPhone,
- extension: order.receiptExtension,
- contact: order.receiptContactName,
- street: order.receiptStreet || "",
- address: order.receiptAddress,
- cityCode: order.receiptCityCode,
- },
- takeTime: order.takeTime,
- weight: order.weight,
- takeType: order.waimaiOrderId ? order.takeType : 0,
- type: this.userInfo.memberType == 1 ? 1 : 2,
- isWaimai: order.waimaiId ? true : false,
- waimaiOrderId: order.waimaiOrderId,
- takeRemark: order.takeRemark || "",
- orderId: order.id,
- };
- this.isLoading = true;
- sendValuation(requestData).then((res) => {
- console.log(res, "发起配送计算");
- this.isLoading = false;
- if (res.code == 200) {
- res.data.optionals.forEach((item) => {
- item.optionals = item.optionals ? item.optionals : [];
- item.lowOptionals = item.lowOptionals ? item.lowOptionals : [];
- item.supports = item.supports ? item.supports : [];
- });
- this.$refs.sendOrderPopup.init(res.data, {
- ...requestData,
- orderId: order.id,
- orderSn: order.orderSn,
- });
- }
- });
- },
- // 订单详情
- getDetailOrder() {
- this.showDetail = false;
- if (this.list.length) {
- this.orderId = this.list[this.curIdx].id;
- } else {
- return;
- }
- detailOrder({ orderId: this.orderId }).then((res) => {
- if (res.code === 200) {
- this.orderDetail = res.data;
- this.showDetail = true;
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 订单跟踪
- getTrackOrder() {
- if (this.buttonStatus === 0 || this.buttonStatus === 10) return;
- this.showTrack = false;
- if (this.list.length) {
- this.orderId = this.list[this.curIdx].id;
- } else {
- return;
- }
- trackOrder({ orderId: this.orderId }).then((res) => {
- if (res.code === 200) {
- this.trackOrder = res.data;
- this.showTrack = true;
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 获取骑手预计到达时间
- getRiderArriveTime() {
- // 只有取货中和配送中调用该接口
- if (![2, 3].includes(this.buttonStatus)) return;
- if (this.list.length) {
- this.orderId = this.list[this.curIdx].id;
- } else {
- return;
- }
- getRiderArriveTime({ orderId: this.orderId }).then((res) => {
- if (res.code === 200) {
- this.riderArriveTime = res.data;
- }
- });
- },
- showCancelType(type) {
- let name = "";
- switch (type) {
- case 1:
- name = "商家取消";
- break;
- case 2:
- name = "骑手取消";
- break;
- case 3:
- name = "系统取消";
- break;
- case 4:
- name = "用户取消";
- break;
- case 5:
- name = "平台取消";
- break;
- default:
- name = "已取消";
- break;
- }
- return name;
- },
- showDeliveryStatus(item) {
- let name = "";
- if (item.wmstatus === 4) {
- return (name = "其他平台完成");
- }
- if (item.deliveryStatus === 4) {
- return (name = "已完成");
- }
- if (item.deliveryStatus === -1) {
- return (name = "已取消");
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped="scoped">
- .el-row {
- position: absolute !important;
- width: 100%;
- left: 0;
- top: 0;
- }
- .track-detail {
- display: flex;
- justify-content: flex-end;
- height: calc(100vh - 210px);
- /deep/ .el-col {
- // margin-right: 15px;
- height: 100%;
- z-index: 2;
- }
- .order-detail {
- height: calc(100vh - 250px);
- overflow: auto;
- }
- .detail_cont {
- height: calc(100vh - 250px);
- overflow: auto;
- }
- }
- .list-info {
- height: calc(100vh - 210px);
- overflow-y: auto;
- }
- .choose-self {
- padding-top: 25px;
- border-bottom: 1px solid #eee;
- .self-top {
- display: flex;
- align-items: center;
- margin-bottom: 11px;
- .choose-self-icon {
- width: 4px;
- height: 15px;
- margin-right: 10px;
- }
- span {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #92959b;
- }
- }
- .pay-list {
- display: flex;
- align-items: center;
- padding-top: 10px;
- .pay-item {
- flex: 1;
- display: flex;
- justify-content: center;
- text-align: center;
- align-items: center;
- height: 51px;
- border: 1px solid #eee;
- border-radius: 8px;
- cursor: pointer;
- &.pay-active {
- border-color: #fc7200;
- }
- &:nth-child(2) {
- margin: 0 13px;
- }
- span {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: bold;
- color: #222222;
- }
- .pay-icon {
- margin-right: 6px;
- }
- .pay-icon:nth-child(1) {
- width: 25px;
- height: 24px;
- }
- }
- }
- }
- .tip-title {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #92959b;
- padding-bottom: 13px;
- }
- .tip-list {
- display: flex;
- flex-wrap: wrap;
- .tip-item {
- margin-right: 10px;
- margin-bottom: 10px;
- width: 93px;
- height: 38px;
- line-height: 38px;
- text-align: center;
- font-size: 13px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #222222;
- box-sizing: border-box;
- background: #f4f4f4;
- cursor: pointer;
- border-radius: 2px;
- border: 1px solid transparent;
- /deep/ .el-input__inner {
- border: none;
- height: 32px !important;
- background-color: #f4f4f4;
- font-size: 13px;
- padding: 0 15px !important;
- }
- }
- .tip-active {
- border-color: #fc7200;
- color: #fc7200;
- }
- }
- .text-area {
- /deep/ .el-textarea__inner {
- background-color: #f2f2f2;
- border: none;
- }
- }
- .cancel-list {
- display: flex;
- flex-wrap: wrap;
- .item {
- color: #222;
- width: 193px;
- height: 50px;
- line-height: 50px;
- box-sizing: border-box;
- text-align: center;
- font-size: 16px;
- border: 2px solid #d7d7d7;
- border-radius: 6px;
- margin-right: 20px;
- margin-bottom: 20px;
- cursor: pointer;
- &:last-child {
- color: #d7d7d7;
- }
- &.active {
- color: #fc7101;
- border-color: #fc7101;
- }
- }
- .no-margin {
- margin-right: 0 !important;
- }
- }
- .ignore-modal {
- .title {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #92959b;
- }
- .check-item {
- display: flex;
- align-items: center;
- margin-top: 20px;
- .radio {
- width: 14px;
- height: 14px;
- margin-right: 6px;
- }
- span {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #222222;
- }
- }
- }
- .submit-btn {
- border: none !important;
- background-color: #fc7200;
- }
- .order_item {
- width: 100%;
- height: 140px;
- background: #fff;
- margin-bottom: 10px;
- border-radius: 5px;
- overflow: hidden;
- cursor: pointer;
- .order_item_header {
- width: 100%;
- height: 49px;
- display: flex;
- align-items: center;
- border-bottom: 1px solid #f0f0f0;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 10px;
- box-sizing: border-box;
- background: rgba(254, 241, 233, 0.39);
- .order_item_header_l,
- .order_item_header_r {
- display: flex;
- align-items: center;
- }
- .Serial_number {
- width: 60px;
- height: 26px;
- border-radius: 0 30px 30px 0;
- font-size: 10px;
- font-weight: 500;
- color: #ffffff;
- text-align: center;
- line-height: 26px;
- }
- .logo {
- width: 21px;
- height: 21px;
- border-radius: 50%;
- margin-left: 23px;
- }
- .name {
- font-size: 14px;
- font-weight: 500;
- color: #333333;
- margin-left: 5px;
- }
- .sign_time {
- padding: 0 8px;
- height: 20px;
- border: 1px solid #fc7200;
- background: #fff;
- border-radius: 2px;
- text-align: center;
- line-height: 20px;
- font-size: 12px;
- font-weight: 600;
- color: #fc7200;
- margin-left: 15px;
- }
- .sign_txt {
- // width: 64px;
- height: 20px;
- border: 1px solid #009cff;
- background: #f2faff;
- border-radius: 2px;
- text-align: center;
- line-height: 20px;
- font-size: 12px;
- font-weight: 600;
- color: #009cff;
- margin-left: 10px;
- padding: 0 5px;
- }
- .sign_d {
- height: 20px;
- border: 1px solid #f74141;
- background: #fff5f5;
- border-radius: 2px;
- text-align: center;
- line-height: 20px;
- font-size: 12px;
- font-weight: 600;
- color: #f74141;
- margin-left: 10px;
- padding: 0 7px;
- }
- .sign_f {
- height: 20px;
- border: 1px solid #999;
- background: #fff;
- border-radius: 2px;
- text-align: center;
- line-height: 20px;
- font-size: 12px;
- font-weight: 600;
- color: #999;
- margin-left: 10px;
- padding: 0 7px;
- }
- .header_r {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- // margin-right: 22px;
- }
- .btn {
- background: #fc7200;
- border-color: #fc7200;
- color: #fff;
- margin-left: 20px;
- // position: absolute;
- // right: 10px;
- }
- }
- .active_order_item_cont {
- border-color: #fc7200 !important;
- }
- .order_item_cont {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- padding: 0 20px;
- height: calc(100% - 52px);
- border-bottom: 2px solid #ffffff;
- .address {
- display: flex;
- align-items: center;
- font-size: 16px;
- font-weight: bold;
- .distance {
- display: flex;
- align-items: center;
- margin-left: 10px;
- color: #fc7200;
- cursor: pointer;
- .img {
- width: 15px;
- height: 20px;
- margin-right: 5px;
- }
- .show-map {
- font-size: 12px;
- font-weight: bold;
- font-weight: 500;
- color: #fc7200;
- }
- }
- }
- .content {
- font-size: 14px;
- font-weight: 400;
- line-height: 20px;
- color: #999999;
- }
- .itme_r {
- font-size: 15px;
- font-weight: 400;
- color: #333333;
- word-wrap: break-word;
- }
- }
- }
- .order_detail {
- position: relative;
- width: 100%;
- height: 100%;
- border-left: 10px solid #f1f2f5;
- background: #fff;
- box-sizing: border-box;
- border-left: 10px solid #f1f2f5;
- .bottom-btns {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- border-top: 2px dotted #f0f0f0;
- background: #fff;
- }
- .detail_title {
- width: 100%;
- height: 44px;
- background: #fafafa;
- padding-left: 16px;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- font-size: 12px;
- font-weight: 600;
- display: flex;
- align-items: flex-end;
- .detail_txt {
- color: #b1b1b1;
- padding-bottom: 13px;
- border-bottom: 2px solid #fafafa;
- margin-right: 28px;
- cursor: pointer;
- z-index: 2;
- }
- .detail_txt_ac {
- color: #00152a;
- border-color: #00152a;
- }
- }
- .btns {
- margin: 10px 15px;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .btn {
- background: #fc7200;
- border-color: #fc7200;
- color: #fff !important;
- }
- .btn_bots {
- margin: 0 !important;
- margin-bottom: 10px !important;
- }
- .btn_bot {
- width: 74px;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #888888;
- margin-bottom: 10px !important;
- .el-dropdown-link {
- cursor: pointer;
- }
- }
- }
- .detail_cont {
- width: 100%;
- padding: 16px;
- box-sizing: border-box;
- .detail_title2 {
- width: 100%;
- font-size: 12px;
- font-weight: 600;
- color: #777777;
- margin-bottom: 15px;
- }
- .shop_detail {
- width: 100%;
- display: flex;
- margin-bottom: 10px;
- img {
- width: 47px;
- height: 47px;
- border-radius: 4px 4px 4px 4px;
- margin-right: 12px;
- }
- .info {
- flex-grow: 1;
- display: flex;
- justify-content: space-between;
- .shop_title {
- width: 70%;
- font-size: 14px;
- font-weight: 500;
- color: #333333;
- line-height: 18px;
- }
- .shop_num {
- color: #b1b1b1;
- }
- }
- }
- .detail_ine {
- width: 100%;
- height: 1px;
- border-top: 2px dotted #f0f0f0;
- margin: 16px 0;
- }
- .info2 {
- width: 100%;
- display: flex;
- .title {
- font-size: 14px;
- font-weight: 400;
- width: 80px;
- color: #b1b1b1;
- }
- .cont {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- }
- .cont2 {
- color: #fc7200;
- }
- }
- .info3 {
- margin-top: 10px;
- }
- .info4 {
- display: flex;
- justify-content: space-between;
- }
- .btns {
- margin-top: 30px;
- .btn {
- background: #fc7200;
- border-color: #fc7200;
- color: #fff;
- }
- }
- }
- }
- </style>
|