|
@@ -58,6 +58,7 @@
|
|
|
<!-- 配送中 -->
|
|
|
<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">
|
|
@@ -66,7 +67,15 @@
|
|
|
</div>
|
|
|
<!-- 已取消 -->
|
|
|
<div class="btns" v-if="buttonStatus === -1">
|
|
|
- <!-- <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" class="btn_bots btn">再来一单</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>
|
|
@@ -150,14 +159,17 @@
|
|
|
showCancelType(item.cancelType)
|
|
|
}}</el-tag>
|
|
|
<!-- <el-button size='small' class="btn" @click.stop="orderBack(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">
|
|
@@ -295,7 +307,7 @@ import {
|
|
|
} from "../../api/order.js";
|
|
|
export default {
|
|
|
name: "OrderList",
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
payAmount: 0,
|
|
|
paymentType: 1, // 1 支付宝 0 微信
|
|
@@ -371,11 +383,11 @@ export default {
|
|
|
qrCode,
|
|
|
},
|
|
|
watch: {
|
|
|
- tabNum (newVal, oldVal) {
|
|
|
+ tabNum(newVal, oldVal) {
|
|
|
this.curIdx = 0;
|
|
|
},
|
|
|
list: {
|
|
|
- handler (newVal, oldVal) {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
this.buttonStatus = newVal.length ? newVal[0].buttonStatus : 0;
|
|
|
if (this.buttonStatus === 0 || this.buttonStatus === 10) {
|
|
|
this.needTrack = false;
|
|
@@ -391,18 +403,44 @@ export default {
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
- destroyed () { },
|
|
|
+ destroyed() {},
|
|
|
computed: {
|
|
|
...mapState(["userInfo"]),
|
|
|
},
|
|
|
methods: {
|
|
|
- paySuccess () {
|
|
|
+ // 再来一单
|
|
|
+ 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 () {
|
|
|
+ richMoney() {
|
|
|
let reg = /(^[1-9]\d*$)/g;
|
|
|
if (this.tipActive == -1) {
|
|
|
if (!reg.test(this.tipAmount * 1)) {
|
|
@@ -446,16 +484,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- addTip (orderId) {
|
|
|
+ addTip(orderId) {
|
|
|
this.orderId = orderId;
|
|
|
this.paymentType = 4;
|
|
|
this.addTipStatus = true;
|
|
|
},
|
|
|
- changeReason (item) {
|
|
|
+ changeReason(item) {
|
|
|
this.reasonIndex = item.id;
|
|
|
this.chooseReason = item.name;
|
|
|
},
|
|
|
- doCancelOrder () {
|
|
|
+ doCancelOrder() {
|
|
|
cancelOrder({
|
|
|
orderId: this.orderId,
|
|
|
cancelReason:
|
|
@@ -482,7 +520,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 取消订单
|
|
|
- commitCancelReason () {
|
|
|
+ commitCancelReason() {
|
|
|
if (!this.reasonIndex) {
|
|
|
return this.$message({
|
|
|
message: "请选择取消原因",
|
|
@@ -514,7 +552,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 取消定时发单
|
|
|
- cancalSettingTime () {
|
|
|
+ cancalSettingTime() {
|
|
|
cancelTimingPublish({ orderId: this.item.id }).then((res) => {
|
|
|
this.settingTimeStatus = false;
|
|
|
if (res.code == 200) {
|
|
@@ -533,7 +571,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- commitTimeValue () {
|
|
|
+ commitTimeValue() {
|
|
|
let timestamp = new Date().valueOf();
|
|
|
let exT = moment(this.item.exceptTime).valueOf();
|
|
|
let nowTime = moment(exT)
|
|
@@ -569,7 +607,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 定时发单
|
|
|
- settingTime (item) {
|
|
|
+ settingTime(item) {
|
|
|
this.item = item;
|
|
|
this.settingTimeStatus = true;
|
|
|
this.delayTime = item.delayTime;
|
|
@@ -577,11 +615,11 @@ export default {
|
|
|
this.exceptTime = `预约期望${item.exceptTime.slice(5)}送达`;
|
|
|
},
|
|
|
// 取消订单
|
|
|
- cancelOrder (orderId) {
|
|
|
+ cancelOrder(orderId) {
|
|
|
this.orderId = orderId;
|
|
|
this.cancelStatus = true;
|
|
|
},
|
|
|
- chooseOrder (v, index) {
|
|
|
+ chooseOrder(v, index) {
|
|
|
this.buttonStatus = this.list[index].buttonStatus;
|
|
|
if (this.buttonStatus === 0 || this.buttonStatus === 10) {
|
|
|
this.needTrack = false;
|
|
@@ -596,7 +634,7 @@ export default {
|
|
|
this.getRiderArriveTime();
|
|
|
},
|
|
|
// 忽略订单
|
|
|
- iGnoreOrder (orderId) {
|
|
|
+ iGnoreOrder(orderId) {
|
|
|
this.orderId = orderId;
|
|
|
this.$confirm("确定要忽略此单?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -630,14 +668,14 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- itemAddRemark (orderId, item) {
|
|
|
+ itemAddRemark(orderId, item) {
|
|
|
this.dialogTableVisible = true;
|
|
|
this.orderId = orderId;
|
|
|
this.item = item;
|
|
|
this.remark = item.takeRemark || "";
|
|
|
},
|
|
|
// 一键发单备注
|
|
|
- commitRemark (orderId, item) {
|
|
|
+ commitRemark(orderId, item) {
|
|
|
// if(!this.remark.trim()){
|
|
|
// return this.$message({
|
|
|
// message: '请输入发单备注再确认!',
|
|
@@ -674,14 +712,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 查看地图
|
|
|
- checkMap (item) {
|
|
|
+ checkMap(item) {
|
|
|
this.$refs.orderMap.setDialogStatus(item);
|
|
|
},
|
|
|
- sendNow (item) {
|
|
|
+ sendNow(item) {
|
|
|
this.getValuation(item);
|
|
|
},
|
|
|
// 撤回订单
|
|
|
- orderBack (orderId) {
|
|
|
+ orderBack(orderId) {
|
|
|
rollOrder({ orderId }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
@@ -699,7 +737,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 补打小票
|
|
|
- orderPrinter (waimaiId, id) {
|
|
|
+ orderPrinter(waimaiId, id) {
|
|
|
if (id) {
|
|
|
bus.$emit("startUsbPrint", id);
|
|
|
}
|
|
@@ -719,7 +757,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 计价
|
|
|
- getValuation (order) {
|
|
|
+ getValuation(order) {
|
|
|
let requestData = {
|
|
|
productId: order.productId,
|
|
|
transport: 0,
|
|
@@ -780,7 +818,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 订单详情
|
|
|
- getDetailOrder () {
|
|
|
+ getDetailOrder() {
|
|
|
this.showDetail = false;
|
|
|
if (this.list.length) {
|
|
|
this.orderId = this.list[this.curIdx].id;
|
|
@@ -800,7 +838,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 订单跟踪
|
|
|
- getTrackOrder () {
|
|
|
+ getTrackOrder() {
|
|
|
if (this.buttonStatus === 0 || this.buttonStatus === 10) return;
|
|
|
this.showTrack = false;
|
|
|
if (this.list.length) {
|
|
@@ -821,7 +859,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 获取骑手预计到达时间
|
|
|
- getRiderArriveTime () {
|
|
|
+ getRiderArriveTime() {
|
|
|
// 只有取货中和配送中调用该接口
|
|
|
if (![2, 3].includes(this.buttonStatus)) return;
|
|
|
if (this.list.length) {
|
|
@@ -835,7 +873,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- showCancelType (type) {
|
|
|
+ showCancelType(type) {
|
|
|
let name = "";
|
|
|
switch (type) {
|
|
|
case 1:
|
|
@@ -859,7 +897,7 @@ export default {
|
|
|
}
|
|
|
return name;
|
|
|
},
|
|
|
- showDeliveryStatus (item) {
|
|
|
+ showDeliveryStatus(item) {
|
|
|
let name = "";
|
|
|
if (item.wmstatus === 4) {
|
|
|
return (name = "其他平台完成");
|