shish пре 4 година
родитељ
комит
315833b021
1 измењених фајлова са 43 додато и 3 уклоњено
  1. 43 3
      ghsApp/src/admin/statistics/customSale.vue

+ 43 - 3
ghsApp/src/admin/statistics/customSale.vue

@@ -1,6 +1,12 @@
 <template>
 	<view class="ex-page">
 
+		<view class="input-wrap_box">
+		<view>
+			<AppSearchModule placeholder="输入字母搜索" @input="searchFn"/>
+		</view>
+		</view>
+
 		<view class="top-bar">
 			<DorpdownSelect class="bar"
 				:menuObj="menuTimeObj"
@@ -60,9 +66,10 @@ import { changeLevel } from "@/api/custom";
 import { list,selectShop } from "@/mixins";
 import DorpdownSelect from "@/components/module/shopSelect";
 import rangeDatePick from '@/components/pyh-rdtpicker/pyh-rdtpicker.vue';
+import AppSearchModule from "@/components/module/app-search";
 import {mapActions, mapGetters} from "vuex";
 export default {
-	components: { SelectList, AppWrapperEmpty,DorpdownSelect,rangeDatePick },
+	components: { SelectList, AppWrapperEmpty,DorpdownSelect,rangeDatePick,AppSearchModule },
 	mixins: [list,selectShop],
 	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
 	data() {
@@ -135,6 +142,8 @@ export default {
 				shopId: "",
 			},
 			profile:[],
+			storageData:[],
+			searchContent:'',
 		};
 	},
 	onPullDownRefresh() {
@@ -156,6 +165,26 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
+		searchFn(e){
+			this.searchContent = e;
+			this.filterStat()
+		},
+		filterStat(){
+			let that = this
+			if(this.searchContent.length > 0){
+				that.profile = [];
+				that.storageData.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.profile.push(obj)
+					}
+				})
+			}else{
+				that.profile = that.storageData
+			}
+		},
 		// 选择分店
 		selectShopSussess(val){
 			this.params.shopId = val.selectItem.id;
@@ -183,14 +212,23 @@ export default {
 			this.init();
 		},
 		//选择自定义时间取消
-		timeCancel(e){this.isShow = false;},
+		timeCancel(e){
+			this.isShow = false
+		},
 		async init() {
 			this.getList();
 		},
 		getList() {
 			let that = this
+			uni.showLoading()
 			getStatKhCgProfile(this.params).then(res => {
-				that.profile = res.data.list
+				if (!this.$util.isEmpty(res.data.list)) {
+					uni.hideLoading()
+					that.storageData = res.data.list
+					that.filterStat()
+				}else{
+					that.storageData=[]
+				}
 			});
 		},
 		updateLevel(item){
@@ -218,12 +256,14 @@ export default {
 </script>
 <style lang="scss" scoped>
 .ex-page {
+	padding-top:20rpx;
 	height: 100%;
 	display: flex;
 	flex-direction: column;
 	.top-bar {
 		position: absolute;
 		left: 0;
+		top:110rpx;
 		display: flex;
 		width: 100%;
 		z-index: 20;