1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270 |
- <template>
- <div>
- <el-row>
- <el-col :span="18">
- <div v-loading="isLoading">
- <div class="empty-data" v-if="list && list.length < 1">
- <img src="../../../static/image/empty-data.png" />
- </div>
- <div :class="curIdx === i ? 'order_item active-order-item' : '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">#{{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 && item.takeType==1">{{item.exceptTime}}前送达</div>
- <div class="sign_txt" v-if="item.waimaiOrderId && item.takeType==0">立即送达</div>
- <!-- <div class="sign_d">预约 09/10 17:30自动发起配送</div> -->
- </div>
- <!-- 订单查询 -->
- <div class="order_item_header_r" v-if="tabNum === -1">
- <span class="header_r">{{showDeliveryStatus(item)}}</span>
- <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
- </div>
- <!-- 新订单 -->
- <div class="order_item_header_r" v-if="tabNum === 0">
- <!-- <span class="header_r">已发单1分钟</span> -->
- <el-button size='small' class="btn" @click.stop="deleteItem(item)">发起配送</el-button>
- </div>
- <!-- 预约单 -->
- <div class="order_item_header_r" v-if="tabNum === 1">
- <!-- <span class="header_r">已发单1分钟</span> -->
- <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 size='small' class="btn" @click.stop="settingTime(item)">定时发单</el-button>
- <el-button size='small' class="btn" @click.stop="deleteItem(item)">发起配送</el-button>
- </div>
- <!-- 待接单 -->
- <div class="order_item_header_r" v-if="tabNum === 2">
- <span class="header_r">已发单{{item.takeTimeTxt}}</span>
- <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button>
- <el-button size='small' @click.stop="orderPrinter(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="tabNum === 3">
- <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)">补打发票</el-button>
- </div>
- <!-- 配送中 -->
- <div class="order_item_header_r" v-if="tabNum === 4">
- <span class="header_r" v-if="item.exceptTime">预计{{item.exceptTime}}送达</span>
- <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
- </div>
- <!-- 异常单 -->
- <div class="order_item_header_r" v-if="tabNum === 5">
- <span class="header_r">{{showCancelType(item.cancelType)}}</span>
- <el-button size='small' class="btn" @click.stop="orderBack(item.id)">撤回订单</el-button>
- </div>
- <!-- 取消单 -->
- <div class="order_item_header_r" v-if="tabNum === 6">
- <span class="header_r">{{showCancelType(item.cancelType)}}</span>
- <!-- <el-button size='small' class="btn" @click.stop="orderBack(item.id)">撤回订单</el-button> -->
- </div>
- </div>
- <div class="order_item_cont">
- <div class="content">{{item.receiptContactName}}<span>{{item.receiptPhone}}</span></div>
- <div class="address">
- {{item.receiptProvinceName}}
- {{item.receiptCityName}}
- {{item.receiptDistrictName}}
- {{item.receiptAddress}}
- <span v-if="item.orderDistance" @click.stop="checkMap(item)">
- <i class="el-icon-location"></i>
- <span v-if="item.orderDistance < 1000">
- {{item.orderDistance}}m
- </span>
- <span v-else>
- {{item.orderDistance / 1000}}km
- </span>
- </span>
- </div>
- <div v-if="item.caution" class="itme_r">备注:{{item.caution}}</div>
- </div>
- </div>
- <div v-if="item.caution" class="itme_r">备注:{{item.caution}}</div>
- </div>
- </el-col>
- <!-- 订单追踪、订单详情 -->
- <el-col :span="6">
- <div class="order_detail">
- <div class="detail_title">
- <div v-show="needTrack" 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" :tabNum="tabNum" :trackOrder="trackOrder" v-if="!orderDetailStutus && needTrack"></order-track>
- <order-detail v-show="showDetail" :tabNum="tabNum" :orderDetail="orderDetail" v-else></order-detail>
- <!-- 订单跟踪、订单详情底部按钮 -->
- <div v-show="showDetail || showTrack">
- <!-- 新订单 -->
- <div class="btns" v-if="tabNum === 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)" class="btn_bots">补打发票</el-button>
- <el-button size='small' @click.native="deleteItem(list[curIdx])" class="btn_bots btn">发起配送</el-button>
- </div>
- <!-- 预约单 -->
- <div class="btns" v-if="tabNum === 1">
- <div class="btn_bot">
- <el-dropdown>
- <span class="el-dropdown-link">更多</span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId)"><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 size='small' @click.native="settingTime(list[curIdx])" class="btn_bots btn">定时发单</el-button>
- <el-button size='small' @click.native="deleteItem(list[curIdx])" class="btn_bots btn">发起配送</el-button>
- </div>
- <!-- 订单查询 -->
- <div class="btns" v-if="tabNum === -1">
- <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">补打发票</el-button>
- </div>
- <!-- 待接单 -->
- <div class="btns" v-if="tabNum === 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)" 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="tabNum === 3">
- <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)" class="btn_bots btn">补打发票</el-button>
- </div>
- <!-- 配送中 -->
- <div class="btns" v-if="tabNum === 4">
- <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">补打发票</el-button>
- </div>
- <!-- 异常单 -->
- <div class="btns" v-if="tabNum === 5">
- <el-button size='small' @click.native="orderPrinter(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="tabNum === 6">
- <!-- <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">再来一单</el-button> -->
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <!-- 发起配送 -->
- <send-order-popup 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" :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="忽略订单" destroy-on-close :visible.sync="ignoreStatus">
- <div class="ignore-modal">
- <div class="title">请选择忽略该笔订单的原因</div>
- <div class="check-item">
- <img src="../../../static/image/check-radio.png" @click.stop="changeRadio(1)" v-if="radio != 1" class="radio" />
- <img src="../../../static/image/check-radio-active.png" v-if="radio == 1" class="radio" />
- <span>通过其他配送方式完成</span>
- </div>
- <div class="check-item">
- <img src="../../../static/image/check-radio.png" @click.stop="changeRadio(2)" v-if="radio != 2" class="radio" />
- <img src="../../../static/image/check-radio-active.png" v-if="radio == 2" class="radio" />
- <span>取消该笔订单(由于用户取消或其他原因)</span>
- </div>
- </div>
- <div style="text-align: center;margin-top: 20px;">
- <el-button @click.stop="ignoreStatus = false">取消</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="commitIGnore(orderId)">确定</el-button>
- </div>
- </el-dialog>
- <!-- 设置预约发单时间弹出层 -->
- <el-dialog width="580px" center title="设置预约时间" 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;">提示:设置后系统将根据您设置的提前时间自动发单。</p>
- <div style="text-align: center;margin-top: 20px;">
- <el-button @click.stop="settingTimeStatus = false">取消</el-button>
- <el-button type="primary" class="submit-btn" @click.stop="commitTimeValue(orderId)">确定</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,
- getPayResult,
- getMapData,
- } from "../../api/order.js";
- export default {
- name: "OrderList",
- data() {
- return {
- payAmount: 0,
- paymentType: 1, // 1 支付宝 0 微信
- payList: [
- {
- id: 1,
- name: "支付宝支付",
- icon: "../../../static/image/alipay.png",
- },
- {
- id: 2,
- name: "微信支付",
- icon: "../../../static/image/we-chat.png",
- },
- {
- id: 4,
- name: "余额支付",
- icon: "../../../static/image/yu-e.png",
- },
- ],
- tipActive: 0,
- tipList: [1, 2, 5, 10, 15, 20, 30, 50],
- tipAmount: "", // 小费金额
- addTipTimer: null, // 加小费刷新支付计时器
- 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: 0,
- isLoading: false,
- dialogTableVisible: false,
- ignoreStatus: false, // 忽略订单弹出层
- remark: "",
- orderId: "",
- item: {},
- radio: "",
- needTrack: false,
- curIdx: 0,
- trackOrder: {},
- orderDetail: {},
- showDetail: false,
- showTrack: false,
- showCode: false,
- link: "",
- };
- },
- props: {
- tabNum: Number,
- list: Array,
- },
- components: {
- sendOrderPopup,
- orderMap,
- OrderDetail,
- orderTrack,
- qrCode,
- },
- watch: {
- tabNum(newVal, oldVal) {
- if (newVal === 0 || newVal === 1) {
- this.needTrack = false;
- this.orderDetailStutus = 0;
- } else {
- this.needTrack = true;
- this.orderDetailStutus = 0;
- }
- this.curIdx = 0;
- },
- list(newVal, oldVal) {
- this.getDetailOrder();
- this.getTrackOrder();
- },
- addTipStatus(val) {
- if (!val) {
- clearTimeout(this.addTipTimer);
- this.addTipTimer = null;
- }
- },
- },
- destroyed() {
- clearTimeout(this.addTipTimer);
- this.addTipTimer = null;
- },
- computed: {
- ...mapState(["userInfo"]),
- },
- methods: {
- paySuccess() {
- this.showCode = false;
- this.addTipStatus = false;
- bus.$emit("refreshData");
- },
- 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");
- this.addTipStatus = false;
- this.tipAmount = "";
- clearTimeout(this.addTipTimer);
- this.addTipTimer = null;
- } 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.addTipStatus = true;
- },
- changeReason(item) {
- this.reasonIndex = item.id;
- this.chooseReason = item.name;
- },
- // 取消订单
- commitCancelReason() {
- if (!this.reasonIndex) {
- return this.$message({
- message: "请选择取消原因",
- type: "error",
- });
- }
- if (this.reasonIndex == 8 && !this.cancelReason.trim()) {
- return this.$message({
- message: "请填写其他取消原因",
- type: "error",
- });
- }
- cancelOrder({
- orderId: this.orderId,
- cancelReason:
- this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
- }).then((res) => {
- this.cancelStatus = false;
- if (res.code == 200) {
- this.$message({
- message: "取消订单成功",
- type: "success",
- });
- this.orderId = "";
- this.cancelReason = "";
- this.chooseReason = "";
- this.reasonIndex = null;
- bus.$emit("refreshData");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- cancalSettingTime() {
- cancelTimingPublish({ orderId: this.item.orderId }).then((res) => {
- this.settingTimeStatus = false;
- if (res.code == 200) {
- this.$message({
- message: "取消定时发单成功",
- type: "success",
- });
- this.item = {};
- bus.$emit("refreshData");
- } 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"); //当前时间的前1小时时间
- 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");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 定时发单
- settingTime(item) {
- this.item = item;
- this.settingTimeStatus = true;
- this.timeValue = item.delayTime ? item.delayTime : 1;
- },
- // 取消订单
- cancelOrder(orderId) {
- this.orderId = orderId;
- this.cancelStatus = true;
- },
- chooseOrder(v, index) {
- this.curIdx = index;
- this.getDetailOrder();
- this.getTrackOrder();
- },
- changeRadio(i) {
- this.radio = i;
- },
- // 忽略订单
- iGnoreOrder(orderId) {
- this.orderId = orderId;
- this.ignoreStatus = true;
- },
- commitIGnore(orderId) {
- if (!this.radio) {
- return this.$message({
- message: "请选择忽略原因",
- type: "error",
- });
- }
- let params = {
- orderId,
- ignoreReason: this.radio == 1 ? 0 : 1,
- };
- ignoreOrder(params).then((res) => {
- this.ignoreStatus = false;
- if (res.code == 200) {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- bus.$emit("refreshData");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- 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",
- });
- this.$set(
- this.list.find((v) => {
- return item.id == v.id;
- }),
- "takeRemark",
- this.remark
- );
- this.$forceUpdate();
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 查看地图
- checkMap(item) {
- getMapData({ orderId: item.id }).then((res) => {
- if (res.code === 200) {
- console.log(res.data);
- this.$refs.orderMap.setDialogStatus(item, res.data);
- } else {
- this.$message({
- type: "error",
- message: res.msg,
- });
- }
- });
- },
- deleteItem(item) {
- this.getValuation(item);
- },
- // 撤回订单
- orderBack(orderId) {
- rollOrder({ orderId }).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- bus.$emit("refreshData");
- } else {
- this.$message({
- message: res.msg,
- type: "error",
- });
- }
- });
- },
- // 补打发票
- orderPrinter(waimaiId) {
- 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.takeType,
- 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() {
- this.showTrack = false;
- if (this.list.length) {
- this.orderId = this.list[this.curIdx].id;
- } else {
- return;
- }
- if (this.tabNum < 2) 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",
- });
- }
- });
- },
- 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:
- break;
- }
- return name;
- },
- showDeliveryStatus(item) {
- let name = "";
- if (item.wmstatus === 4) {
- name = "其他平台完成";
- }
- if (item.deliveryStatus === 4) {
- name = "已完成";
- }
- if (item.deliveryStatus === -1) {
- name = "已取消";
- }
- return name;
- },
- },
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped="scoped">
- .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;
- }
- .empty-data {
- font-size: 0;
- text-align: center;
- background-color: #fff;
- padding: 100px 0;
- img {
- width: 349px;
- height: 222px;
- }
- }
- .active-order-item {
- border: 2px solid #fc7200;
- height: 136px !important;
- width: calc(100% - 4px) !important;
- }
- .order_item {
- width: 100%;
- height: 140px;
- background: #fff;
- margin-bottom: 10px;
- border-radius: 5px;
- .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;
- .order_item_header_l,
- .order_item_header_r {
- display: flex;
- align-items: center;
- }
- .Serial_number {
- width: 60px;
- height: 26px;
- background: #fc7200;
- 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 #009cff;
- background: #f2faff;
- border-radius: 2px;
- text-align: center;
- line-height: 20px;
- font-size: 12px;
- font-weight: 600;
- color: #009cff;
- 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;
- }
- .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;
- }
- .header_r {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- margin-right: 22px;
- }
- .btn {
- background: #fc7200;
- border-color: #fc7200;
- color: #fff;
- // position: absolute;
- // right: 10px;
- }
- }
- .order_item_cont {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- padding: 5px 20px;
- height: 80px;
- }
- .address span {
- cursor: pointer;
- font-size: 12px;
- color: #b1b1b1;
- }
- }
- .itme_r {
- font-size: 14px;
- font-weight: 400;
- color: #b1b1b1;
- }
- .order_detail {
- width: 100%;
- border-left: 10px solid #f1f2f5;
- background: #fff;
- box-sizing: border-box;
- border-left: 10px solid #f1f2f5;
- .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;
- }
- .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>
|