-
{{item.title}}
+
{{ item.title }}
-
@@ -66,6 +66,29 @@ export default {
searchType: "LAST_THIRTY",
},
],
+ originDateList: [
+ // 筛选条件
+ {
+ title: "今天",
+ selected: false,
+ searchType: "TODAY",
+ },
+ {
+ title: "昨天",
+ selected: false,
+ searchType: "YESTERDAY",
+ },
+ {
+ title: "过去7天",
+ selected: true,
+ searchType: "LAST_SEVEN",
+ },
+ {
+ title: "过去30天",
+ selected: false,
+ searchType: "LAST_THIRTY",
+ },
+ ],
shopTotal: "", // 店铺总数
shopsData: [], // 店铺数据
@@ -126,8 +149,8 @@ export default {
this.dates = dates.reverse();
},
// 改变已选店铺
- changeSelect() {
- console.log(this.month);
+ changeSelect(e) {
+ this.month = e
if (this.month) {
this.dateList.forEach((res) => {
res.selected = false;
@@ -138,29 +161,36 @@ export default {
this.$emit("selected", this.selectedWay);
} else {
+
+ const current = this.dateList.find(item => { return item.selected })
+ this.selectedWay = current
+ this.clickBreadcrumb(current)
+ this.$emit("selected", this.selectedWay);
+
+
}
},
// 变更时间
clickBreadcrumb(item) {
- this.dateList.forEach((res) => {
+
+ let currentIndex;
+ this.dateList.forEach((res,index) => {
res.selected = false;
+ if(res.title === item.title){
+ currentIndex = index
+ }
});
item.selected = true;
item.storeId = this.storeId;
this.month = "";
-
if (item.searchType == "") {
- if (
- dateList.some((date) => {
- return date.title == item.title;
- })
- ) {
- item.searchType = date.searchType;
+ let currentDate = this.originDateList[currentIndex].searchType
+ if (currentDate) {
+ item.searchType = currentDate
} else {
item.searchType = "LAST_SEVEN";
}
}
-
this.selectedWay = item;
this.selectedWay.year = new Date().getFullYear();
this.selectedWay.month = "";
@@ -174,17 +204,19 @@ export default {
.breadcrumb {
display: flex;
align-items: center;
- > span {
+ >span {
margin-right: 15px;
cursor: pointer;
}
}
+
.active {
color: $theme_color;
position: relative;
}
-.date-picker {
-}
+
+.date-picker {}
+
.active:before {
content: "";
position: absolute;
diff --git a/manager/src/components/lili-dialog/goods-dialog.vue b/manager/src/components/lili-dialog/goods-dialog.vue
index 9d87e1fa..f5530563 100644
--- a/manager/src/components/lili-dialog/goods-dialog.vue
+++ b/manager/src/components/lili-dialog/goods-dialog.vue
@@ -46,10 +46,8 @@