|
|
@@ -1,18 +1,25 @@
|
|
|
<template>
|
|
|
<view class="ex-page">
|
|
|
- <view class="top-bar">
|
|
|
- <DateSelect class="bar"
|
|
|
- :menuObj="menuTimeObj"
|
|
|
- :selectItemId.sync="selectTimeId"
|
|
|
- :typeTime="true"
|
|
|
- :typeSelect="1" top="0px"
|
|
|
- @selectSussess="selectSussess" />
|
|
|
- <DorpdownSelect class="bar"
|
|
|
- :menuObj.sync="menuObj"
|
|
|
- :selectItemId.sync="shopId"
|
|
|
- top="0"
|
|
|
- @selectSussess="selectShopSussess" />
|
|
|
- </view>
|
|
|
+
|
|
|
+ <view class="input-wrap_box">
|
|
|
+ <view>
|
|
|
+ <AppSearchModule placeholder="输入字母搜索" @input="searchFn"/>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="top-bar">
|
|
|
+ <DateSelect class="bar"
|
|
|
+ :menuObj="menuTimeObj"
|
|
|
+ :selectItemId.sync="selectTimeId"
|
|
|
+ :typeTime="true"
|
|
|
+ :typeSelect="1" top="0"
|
|
|
+ @selectSussess="selectSussess" />
|
|
|
+ <DorpdownSelect class="bar"
|
|
|
+ :menuObj.sync="menuObj"
|
|
|
+ :selectItemId.sync="shopId"
|
|
|
+ top="0"
|
|
|
+ @selectSussess="selectShopSussess" />
|
|
|
+ </view>
|
|
|
|
|
|
<scroll-view scroll-y scroll-with-animation class="main-view">
|
|
|
<view class="space-view ex-table">
|
|
|
@@ -42,8 +49,9 @@ import { list,selectShop } from "@/mixins";
|
|
|
import DorpdownSelect from "@/components/module/shopSelect";
|
|
|
import DateSelect from "@/components/module/dateSelect";
|
|
|
import {mapActions, mapGetters} from "vuex";
|
|
|
+import AppSearchModule from "@/components/module/app-search";
|
|
|
export default {
|
|
|
- components: { SelectList, AppWrapperEmpty,DorpdownSelect,DateSelect},
|
|
|
+ components: { SelectList, AppWrapperEmpty,DorpdownSelect,DateSelect,AppSearchModule},
|
|
|
mixins: [list,selectShop],
|
|
|
computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
|
|
|
data() {
|
|
|
@@ -116,11 +124,12 @@ export default {
|
|
|
shopId: "",
|
|
|
},
|
|
|
profit:[],
|
|
|
+ searchContent:'',
|
|
|
};
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.resetList();
|
|
|
- this._list().then(res => {
|
|
|
+ this.getStatList().then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
});
|
|
|
},
|
|
|
@@ -137,6 +146,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['setUserShopAll']),
|
|
|
+ searchFn(e){
|
|
|
+ this.searchContent = e;
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
// 选择分店
|
|
|
selectShopSussess(val){
|
|
|
this.params.shopId = val.selectItem.id;
|
|
|
@@ -157,14 +170,30 @@ export default {
|
|
|
//选择自定义时间取消
|
|
|
timeCancel(e){this.isShow = false;},
|
|
|
async init() {
|
|
|
- this._list();
|
|
|
+ this.getStatList();
|
|
|
},
|
|
|
- _list() {
|
|
|
+ getStatList() {
|
|
|
let that = this
|
|
|
uni.showLoading()
|
|
|
getStatItemProfit(this.params).then(res => {
|
|
|
uni.hideLoading()
|
|
|
- that.profit = res.data.list
|
|
|
+ if (!this.$util.isEmpty(res.data.list)) {
|
|
|
+ if(this.searchContent.length > 0){
|
|
|
+ that.profit = [];
|
|
|
+ res.data.list.forEach(obj => {
|
|
|
+ let hasName = obj.name && obj.name.indexOf(this.searchContent) >= 0;
|
|
|
+ let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
|
|
|
+ let hasPy = elePy.indexOf(this.searchContent.toLocaleUpperCase()) >= 0;
|
|
|
+ if (hasName || hasPy) {
|
|
|
+ that.profit.push(obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ that.profit = res.data.list
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ that.profit=[]
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -181,7 +210,7 @@ export default {
|
|
|
left: 0;
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
|
- // box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
|
|
|
+ top:110rpx;
|
|
|
z-index: 20;
|
|
|
.bar{
|
|
|
width: 50%;
|
|
|
@@ -193,7 +222,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.main-view {
|
|
|
- margin-top: 60upx;
|
|
|
+ margin-top: 80upx;
|
|
|
flex: 1;
|
|
|
background-color: #f9fbfc;
|
|
|
.space-view {
|