|
@@ -62,15 +62,11 @@
|
|
|
import bus from "../common/bus.js";
|
|
|
import sendOrderPopup from "./orderComponents/sendOrderPopup.vue";
|
|
|
import OrderList from "./orderComponents/orderList.vue";
|
|
|
-import {
|
|
|
- getOrderList,
|
|
|
- getOrderMarker,
|
|
|
- getRefreshOrder,
|
|
|
-} from "../api/order.js";
|
|
|
+import { getOrderList, getOrderMarker, getRefreshOrder } from "../api/order.js";
|
|
|
import { getShopList } from "../api/shop";
|
|
|
export default {
|
|
|
name: "HomeIndex",
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
isLoading: false,
|
|
|
total: 0,
|
|
@@ -142,7 +138,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
"$store.state.userInfo": {
|
|
|
- handler (newVal, oldVal) {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
if (newVal.memberType !== 1) {
|
|
|
this.getShopList();
|
|
|
}
|
|
@@ -151,7 +147,7 @@ export default {
|
|
|
immediate: true,
|
|
|
},
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
if (this.$route.params.tabNum === 2) {
|
|
|
this.changeTab(2, 1);
|
|
|
}
|
|
@@ -169,18 +165,17 @@ export default {
|
|
|
}
|
|
|
}, 5000);
|
|
|
},
|
|
|
- mounted () { },
|
|
|
- beforeDestroy () {
|
|
|
+ mounted() {},
|
|
|
+ beforeDestroy() {
|
|
|
clearInterval(this.timer);
|
|
|
this.timer = null;
|
|
|
},
|
|
|
- destroyed () {
|
|
|
+ destroyed() {
|
|
|
bus.$off("pullData");
|
|
|
bus.$off("refreshData");
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
- changeShopIds () {
|
|
|
+ changeShopIds() {
|
|
|
this.params.searchShopIdStr = String(this.searchShopIdStr);
|
|
|
localStorage.setItem("searchShopIdStr", this.params.searchShopIdStr);
|
|
|
this.params.pageNum = 1;
|
|
@@ -188,7 +183,7 @@ export default {
|
|
|
this.getOrder();
|
|
|
this.getMarker();
|
|
|
},
|
|
|
- getShopList () {
|
|
|
+ getShopList() {
|
|
|
getShopList().then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.shopList = res.data;
|
|
@@ -200,7 +195,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- init () {
|
|
|
+ init() {
|
|
|
bus.$on("pullData", (index) => {
|
|
|
this.tabNum = index;
|
|
|
this.params.status = this.tabList[index].status;
|
|
@@ -215,13 +210,13 @@ export default {
|
|
|
Promise.all([this.getOrder(), this.getMarker()]);
|
|
|
});
|
|
|
},
|
|
|
- seachEnterFun (e) {
|
|
|
+ seachEnterFun(e) {
|
|
|
var keyCode = window.event ? e.keyCode : e.which;
|
|
|
if (keyCode == 13) {
|
|
|
this.search();
|
|
|
}
|
|
|
},
|
|
|
- search () {
|
|
|
+ search() {
|
|
|
// this.$router.push({
|
|
|
// path: "/orderSearch",
|
|
|
// query: {
|
|
@@ -237,18 +232,18 @@ export default {
|
|
|
this.changeTab(7, 94);
|
|
|
}
|
|
|
},
|
|
|
- handleSizeChange (val) {
|
|
|
+ handleSizeChange(val) {
|
|
|
this.params.pageNum = 1;
|
|
|
this.params.pageSize = val;
|
|
|
this.orderList = [];
|
|
|
this.getOrder();
|
|
|
},
|
|
|
- handleCurrentChange (val) {
|
|
|
+ handleCurrentChange(val) {
|
|
|
this.params.pageNum = val;
|
|
|
this.orderList = [];
|
|
|
this.getOrder();
|
|
|
},
|
|
|
- getMarker () {
|
|
|
+ getMarker() {
|
|
|
getOrderMarker({ searchShopIdStr: this.params.searchShopIdStr }).then(
|
|
|
(res) => {
|
|
|
if (res.code === 200) {
|
|
@@ -269,10 +264,10 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- sendOrder () {
|
|
|
+ sendOrder() {
|
|
|
this.$refs.sendOrderPopup.init();
|
|
|
},
|
|
|
- changeTab (i, status) {
|
|
|
+ changeTab(i, status) {
|
|
|
// 切换状态不是近三天,搜索输入框清空
|
|
|
if (i !== 7) {
|
|
|
this.params.searchKey = "";
|
|
@@ -283,7 +278,7 @@ export default {
|
|
|
this.params.pageNum = 1;
|
|
|
this.getOrder();
|
|
|
},
|
|
|
- getOrder () {
|
|
|
+ getOrder() {
|
|
|
let _this = this;
|
|
|
var minute = 1000 * 60;
|
|
|
var hour = minute * 60;
|
|
@@ -318,8 +313,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getRefreshOrder () {
|
|
|
- let noRefresh = [93,94]
|
|
|
+ getRefreshOrder() {
|
|
|
+ let noRefresh = [93, 94];
|
|
|
if (noRefresh.includes(this.params.status)) {
|
|
|
return;
|
|
|
}
|
|
@@ -331,6 +326,7 @@ export default {
|
|
|
status: this.tabList[this.tabNum].status,
|
|
|
searchShopIdStr: this.params.searchShopIdStr,
|
|
|
};
|
|
|
+ console.log("订单:", params.orderIds);
|
|
|
getRefreshOrder(params).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
let newList = res.data.newList;
|