Browse Source

客户下单统计

shish 3 years ago
parent
commit
51280211a7
1 changed files with 15 additions and 103 deletions
  1. 15 103
      ghsApp/src/admin/stat/customSale.vue

+ 15 - 103
ghsApp/src/admin/stat/customSale.vue

@@ -15,25 +15,23 @@
 			<view class="space-view ex-table">
 				<block>
 					<t-table :headerBackgroundColor="'#F0F2F6'">
-
-						<t-tr header><t-th>客户</t-th><t-th>等级</t-th><t-th>数量</t-th><t-th>金额</t-th><t-th>操作</t-th></t-tr>
-
-						<view v-for="(item, index) in profile" :key="index">
-							<t-tr>
-								<t-td><view>{{item.customName}}</view></t-td>
-								<t-td><view>{{item.levelName}}</view></t-td>
-								<t-td><view>{{parseFloat(item.num)}}</view></t-td>
-								<t-td><view>{{parseFloat(item.amount)}}</view></t-td>
-								<t-td> </t-td>
-							</t-tr>
-						</view>
-
+						<t-tr header><t-th>客户</t-th><t-th>数量</t-th><t-th>金额</t-th><t-th>操作</t-th></t-tr>
+							<block v-if="profile.list && !$util.isEmpty(profile.list)">
+								<view v-for="(item, index) in profile.list" :key="index">
+									<t-tr>
+										<t-td><view style="color:#333333;">{{item.customName?item.customName:'-'}}</view></t-td>
+										<t-td><view style="color:#333333;">{{parseFloat(item.num)}}</view></t-td>
+										<t-td><view style="color:#333333;">¥{{parseFloat(item.amount)}}</view></t-td>
+										<t-td> </t-td>
+									</t-tr>
+								</view>
+							</block>
+							<t-tr><t-td><view style="color:black;font-weight:bold;">{{profile.totalNum}}笔 ¥{{profile.totalAmount}}</view></t-td></t-tr>
 					</t-table>
 				</block>
 			</view>
 		</view>
 
-
 	</view>
 </view>
 </template>
@@ -41,7 +39,6 @@
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import SelectList from "@/components/plugin/selectList";
 import { getStatKhCgProfile } from "@/api/stat/index";
-import { changeLevel } from "@/api/custom";
 import { list } from "@/mixins";
 import ShopSelect from "@/components/module/shopSelect";
 import DateSelect from "@/components/module/dateSelect";
@@ -53,45 +50,13 @@ export default {
 	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
 	data() {
 		return {
-			isShow:false,
-			customizationTime:[],
-			shopId:'',
-			itemId:'',
-			nowTime: "",
-			showTimeDropdown: false,
-			nowShop: "",
-			showShopDropdown: false,
-			columns: [
-				{
-					name: "姓名",
-					dataIndex: "name",
-					color: "info"
-				},
-				{
-					name: "开单额",
-					dataIndex: "amount",
-					color: "info",
-					width: 120,
-					align: "center"
-				},
-				{
-					name: "开单数",
-					dataIndex: "num",
-					color: "info",
-					align: "center"
-				}
-			],
-			dataList: [],
 			params:{
-				itemId: '',
 				searchTime:'',
 				startTime: "",
 				endTime: "",
-				shopId: "",
 			},
 			profile:[],
-			storageData:[],
-			searchContent:'',
+			searchText:'',
 		};
 	},
 	onPullDownRefresh() {
@@ -100,39 +65,11 @@ export default {
 			uni.stopPullDownRefresh();
 		});
 	},
-	onLoad(e) {
-		this.itemId = e.id;
-		this.params.itemId = e.id;
-		this.shopId = this.getLoginInfo.shopId;
-	},
 	methods: {
 		...mapActions(['setUserShopAll']),
 		searchFn(e){
-			this.searchContent = e;
-			this.filterStat()
+			this.searchText = e;
 		},
-		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
-			}
-		},
-		//选择分店
-		selectShopFn(val){
-			this.params.shopId = val.id;
-			this.init();
-		},
-		//选择时间
 		selectDateFn(val) {
 			this.params = {...this.params,...val}
 			this.init();			
@@ -145,33 +82,8 @@ export default {
 			uni.showLoading()
 			getStatKhCgProfile(this.params).then(res => {
 				uni.hideLoading()
-				if (!this.$util.isEmpty(res.data.list)) {
-					that.storageData = res.data.list
-					that.filterStat()
-				}else{
-					that.storageData=[]
-				}
+				that.profile = res.data
 			});
-		},
-		updateLevel(item){
-			let customId = item.customId
-			let self = this
-			let levelList = ['个人', '普店', '银店', '金店']
-			uni.showActionSheet({
-				itemList: levelList,
-				success: function (respond) {
-					let currentIndex = respond.tapIndex
-					changeLevel({customId:customId,level:currentIndex}).then(res => {
-						if(res.code == 1) {
-							item.levelName = res.data.levelName
-							self.$msg(res.msg)
-						}
-					}).catch(err => {
-						console.log('err', err)
-					})
-				}
-			})
-
 		}
 	}
 };