|
@@ -288,8 +288,8 @@
|
|
<div v-show="needTrack" class="detail_txt" @click="orderDetailStutus=0" :class="{'detail_txt_ac':!orderDetailStutus}">订单跟踪</div>
|
|
<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 class="detail_txt" @click="orderDetailStutus=1" :class="{'detail_txt_ac':!!orderDetailStutus}">订单详情</div>
|
|
</div>
|
|
</div>
|
|
- <order-track :tabNum="tabNum" :orderInfo="orderInfo" v-if="!orderDetailStutus && needTrack"></order-track>
|
|
|
|
- <order-detail :tabNum="tabNum" :orderInfo="orderInfo" v-else></order-detail>
|
|
|
|
|
|
+ <order-track :tabNum="tabNum" :trackOrder="trackOrder" v-if="!orderDetailStutus && needTrack"></order-track>
|
|
|
|
+ <order-detail @showSend="showSend" @showPriter="showPriter" @showIgnore="ignoreStatus = true" @showRemark="dialogTableVisible = true" :tabNum="tabNum" :orderDetail="orderDetail" v-else></order-detail>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -359,13 +359,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<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 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 {
|
|
import {
|
|
sendValuation,
|
|
sendValuation,
|
|
waimaiprinter,
|
|
waimaiprinter,
|
|
@@ -375,23 +375,25 @@ import {
|
|
setDeliveryTime,
|
|
setDeliveryTime,
|
|
cancelTimingPublish,
|
|
cancelTimingPublish,
|
|
cancelOrder,
|
|
cancelOrder,
|
|
-} from '../../api/order.js';
|
|
|
|
|
|
+ trackOrder,
|
|
|
|
+ detailOrder,
|
|
|
|
+} from "../../api/order.js";
|
|
export default {
|
|
export default {
|
|
- name: 'OrderList',
|
|
|
|
|
|
+ name: "OrderList",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
reasonIndex: null,
|
|
reasonIndex: null,
|
|
- chooseReason: '',
|
|
|
|
- cancelReason: '',
|
|
|
|
|
|
+ chooseReason: "",
|
|
|
|
+ cancelReason: "",
|
|
cancelList: [
|
|
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: '其他原因' },
|
|
|
|
|
|
+ { 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],
|
|
timeList: [1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
timeValue: 1,
|
|
timeValue: 1,
|
|
@@ -402,13 +404,14 @@ export default {
|
|
isLoading: false,
|
|
isLoading: false,
|
|
dialogTableVisible: false,
|
|
dialogTableVisible: false,
|
|
ignoreStatus: false,
|
|
ignoreStatus: false,
|
|
- remark: '',
|
|
|
|
- orderId: '',
|
|
|
|
|
|
+ remark: "",
|
|
|
|
+ orderId: "",
|
|
item: {},
|
|
item: {},
|
|
- radio: '',
|
|
|
|
|
|
+ radio: "",
|
|
needTrack: false,
|
|
needTrack: false,
|
|
curIdx: 0,
|
|
curIdx: 0,
|
|
- orderInfo: {},
|
|
|
|
|
|
+ trackOrder: {},
|
|
|
|
+ orderDetail: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
@@ -419,14 +422,18 @@ export default {
|
|
tabNum(newVal, oldVal) {
|
|
tabNum(newVal, oldVal) {
|
|
if (newVal === 0 || newVal === 1) {
|
|
if (newVal === 0 || newVal === 1) {
|
|
this.needTrack = false;
|
|
this.needTrack = false;
|
|
|
|
+ this.orderDetailStutus = 0;
|
|
} else {
|
|
} else {
|
|
this.needTrack = true;
|
|
this.needTrack = true;
|
|
|
|
+ this.orderDetailStutus = 0;
|
|
}
|
|
}
|
|
this.curIdx = 0;
|
|
this.curIdx = 0;
|
|
},
|
|
},
|
|
list(newVal, oldVal) {
|
|
list(newVal, oldVal) {
|
|
if (newVal.length) {
|
|
if (newVal.length) {
|
|
- this.orderInfo = newVal[0];
|
|
|
|
|
|
+ this.orderId = newVal[0].id;
|
|
|
|
+ this.getDetailOrder(newVal[0].id);
|
|
|
|
+ this.getTrackOrder(newVal[0].id);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -437,7 +444,7 @@ export default {
|
|
orderTrack,
|
|
orderTrack,
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapState(['userInfo']),
|
|
|
|
|
|
+ ...mapState(["userInfo"]),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
changeReason(item) {
|
|
changeReason(item) {
|
|
@@ -448,35 +455,36 @@ export default {
|
|
commitCancelReason() {
|
|
commitCancelReason() {
|
|
if (!this.reasonIndex) {
|
|
if (!this.reasonIndex) {
|
|
return this.$message({
|
|
return this.$message({
|
|
- message: '请选择取消原因',
|
|
|
|
- type: 'error',
|
|
|
|
|
|
+ message: "请选择取消原因",
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if (this.reasonIndex == 8 && !this.cancelReason.trim()) {
|
|
if (this.reasonIndex == 8 && !this.cancelReason.trim()) {
|
|
return this.$message({
|
|
return this.$message({
|
|
- message: '请填写其他取消原因',
|
|
|
|
- type: 'error',
|
|
|
|
|
|
+ message: "请填写其他取消原因",
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
cancelOrder({
|
|
cancelOrder({
|
|
orderId: this.orderId,
|
|
orderId: this.orderId,
|
|
- cancelReason: this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
|
|
|
|
|
|
+ cancelReason:
|
|
|
|
+ this.reasonIndex != 8 ? this.chooseReason : this.cancelReason,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
this.cancelStatus = false;
|
|
this.cancelStatus = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '取消订单成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "取消订单成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
- this.orderId = '';
|
|
|
|
- this.cancelReason = '';
|
|
|
|
- this.chooseReason = '';
|
|
|
|
|
|
+ this.orderId = "";
|
|
|
|
+ this.cancelReason = "";
|
|
|
|
+ this.chooseReason = "";
|
|
this.reasonIndex = null;
|
|
this.reasonIndex = null;
|
|
- bus.$emit('refreshData');
|
|
|
|
|
|
+ bus.$emit("refreshData");
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -486,15 +494,15 @@ export default {
|
|
this.settingTimeStatus = false;
|
|
this.settingTimeStatus = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '取消定时发单成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "取消定时发单成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.item = {};
|
|
this.item = {};
|
|
- bus.$emit('refreshData');
|
|
|
|
|
|
+ bus.$emit("refreshData");
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -502,28 +510,33 @@ export default {
|
|
commitTimeValue() {
|
|
commitTimeValue() {
|
|
let timestamp = new Date().valueOf();
|
|
let timestamp = new Date().valueOf();
|
|
let exT = moment(this.item.exceptTime).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 nowTime = moment(exT)
|
|
|
|
+ .subtract(this.timeValue, "hours")
|
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"); //当前时间的前1小时时间
|
|
let t1 = moment(nowTime).valueOf(); // 时间戳
|
|
let t1 = moment(nowTime).valueOf(); // 时间戳
|
|
- console.log(nowTime, this.item, '-------------');
|
|
|
|
|
|
+ console.log(nowTime, this.item, "-------------");
|
|
if (t1 - timestamp < 0) {
|
|
if (t1 - timestamp < 0) {
|
|
return this.$message({
|
|
return this.$message({
|
|
message: `设置发单时间超出当前时间`,
|
|
message: `设置发单时间超出当前时间`,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- setDeliveryTime({ orderId: this.item.id, delayTime: this.timeValue }).then((res) => {
|
|
|
|
|
|
+ setDeliveryTime({
|
|
|
|
+ orderId: this.item.id,
|
|
|
|
+ delayTime: this.timeValue,
|
|
|
|
+ }).then((res) => {
|
|
this.settingTimeStatus = false;
|
|
this.settingTimeStatus = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '设置定时发单成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "设置定时发单成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.item = {};
|
|
this.item = {};
|
|
- bus.$emit('refreshData');
|
|
|
|
|
|
+ bus.$emit("refreshData");
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -541,7 +554,9 @@ export default {
|
|
},
|
|
},
|
|
chooseOrder(v, index) {
|
|
chooseOrder(v, index) {
|
|
this.curIdx = index;
|
|
this.curIdx = index;
|
|
- this.orderInfo = v;
|
|
|
|
|
|
+ this.orderId = v.id;
|
|
|
|
+ this.getDetailOrder(v.id);
|
|
|
|
+ this.getTrackOrder(v.id);
|
|
},
|
|
},
|
|
changeRadio(i) {
|
|
changeRadio(i) {
|
|
this.radio = i;
|
|
this.radio = i;
|
|
@@ -554,8 +569,8 @@ export default {
|
|
commitIGnore(orderId) {
|
|
commitIGnore(orderId) {
|
|
if (!this.radio) {
|
|
if (!this.radio) {
|
|
return this.$message({
|
|
return this.$message({
|
|
- message: '请选择忽略原因',
|
|
|
|
- type: 'error',
|
|
|
|
|
|
+ message: "请选择忽略原因",
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
let params = {
|
|
let params = {
|
|
@@ -566,14 +581,14 @@ export default {
|
|
this.ignoreStatus = false;
|
|
this.ignoreStatus = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '操作成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
- bus.$emit('refreshData');
|
|
|
|
|
|
+ bus.$emit("refreshData");
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -582,7 +597,7 @@ export default {
|
|
this.dialogTableVisible = true;
|
|
this.dialogTableVisible = true;
|
|
this.orderId = orderId;
|
|
this.orderId = orderId;
|
|
this.item = item;
|
|
this.item = item;
|
|
- this.remark = item.takeRemark || '';
|
|
|
|
|
|
+ this.remark = item.takeRemark || "";
|
|
},
|
|
},
|
|
// 一键发单备注
|
|
// 一键发单备注
|
|
commitRemark(orderId, item) {
|
|
commitRemark(orderId, item) {
|
|
@@ -594,21 +609,21 @@ export default {
|
|
this.dialogTableVisible = false;
|
|
this.dialogTableVisible = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '添加备注成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "添加备注成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.$set(
|
|
this.$set(
|
|
this.list.find((v) => {
|
|
this.list.find((v) => {
|
|
return item.id == v.id;
|
|
return item.id == v.id;
|
|
}),
|
|
}),
|
|
- 'takeRemark',
|
|
|
|
- this.remark,
|
|
|
|
|
|
+ "takeRemark",
|
|
|
|
+ this.remark
|
|
);
|
|
);
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -625,14 +640,14 @@ export default {
|
|
rollOrder({ orderId }).then((res) => {
|
|
rollOrder({ orderId }).then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '操作成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
- bus.$emit('refreshData');
|
|
|
|
|
|
+ bus.$emit("refreshData");
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -643,17 +658,25 @@ export default {
|
|
waimaiprinter({ waimaiId }).then((res) => {
|
|
waimaiprinter({ waimaiId }).then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '操作成功',
|
|
|
|
- type: 'success',
|
|
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
- type: 'error',
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 订单详情补打发票
|
|
|
|
+ showPriter() {
|
|
|
|
+ this.orderPrinter(this.list[this.curIdx].waimaiId);
|
|
|
|
+ },
|
|
|
|
+ // 订单详情发起配送
|
|
|
|
+ showSend() {
|
|
|
|
+ this.getValuation(this.list[this.curIdx]);
|
|
|
|
+ },
|
|
// 计价
|
|
// 计价
|
|
getValuation(order) {
|
|
getValuation(order) {
|
|
let requestData = {
|
|
let requestData = {
|
|
@@ -684,7 +707,7 @@ export default {
|
|
phone: order.receiptPhone,
|
|
phone: order.receiptPhone,
|
|
extension: order.receiptExtension,
|
|
extension: order.receiptExtension,
|
|
contact: order.receiptContactName,
|
|
contact: order.receiptContactName,
|
|
- street: order.receiptStreet || '',
|
|
|
|
|
|
+ street: order.receiptStreet || "",
|
|
address: order.receiptAddress,
|
|
address: order.receiptAddress,
|
|
cityCode: order.receiptCityCode,
|
|
cityCode: order.receiptCityCode,
|
|
},
|
|
},
|
|
@@ -694,12 +717,12 @@ export default {
|
|
type: this.userInfo.memberType == 1 ? 1 : 2,
|
|
type: this.userInfo.memberType == 1 ? 1 : 2,
|
|
isWaimai: order.waimaiId ? true : false,
|
|
isWaimai: order.waimaiId ? true : false,
|
|
waimaiOrderId: order.waimaiOrderId,
|
|
waimaiOrderId: order.waimaiOrderId,
|
|
- takeRemark: order.takeRemark || '',
|
|
|
|
|
|
+ takeRemark: order.takeRemark || "",
|
|
orderId: order.id,
|
|
orderId: order.id,
|
|
};
|
|
};
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
sendValuation(requestData).then((res) => {
|
|
sendValuation(requestData).then((res) => {
|
|
- console.log(res, '发起配送计算');
|
|
|
|
|
|
+ console.log(res, "发起配送计算");
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
res.data.optionals.forEach((item) => {
|
|
res.data.optionals.forEach((item) => {
|
|
@@ -715,6 +738,33 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 订单详情
|
|
|
|
+ getDetailOrder(orderId) {
|
|
|
|
+ detailOrder({ orderId }).then((res) => {
|
|
|
|
+ console.log("object", res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.orderDetail = res.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 订单跟踪
|
|
|
|
+ getTrackOrder(orderId) {
|
|
|
|
+ trackOrder({ orderId }).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.trackOrder = res.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|