|
|
@@ -20,19 +20,22 @@
|
|
|
<t-th><view @click="rankByFn('gross')">毛利<i class="iconfont iconsanjiao_xia"></i></view></t-th>
|
|
|
<t-th><view @click="rankByFn('mll')">毛利率<i class="iconfont iconsanjiao_xia"></i></view></t-th>
|
|
|
</t-tr>
|
|
|
- <view v-for="(item, index) in profile" :key="index">
|
|
|
- <t-tr>
|
|
|
- <t-td><view style="color:black;font-size:26upx;">{{item.name}}</view></t-td>
|
|
|
- <t-td><view style="color:black;font-size:28upx;">{{item.num ? parseFloat(item.num) : 0}}</view></t-td>
|
|
|
- <t-td><view style="color:black;font-size:28upx;">¥{{item.amount ? parseFloat(item.amount) : 0}}</view></t-td>
|
|
|
- <t-td>
|
|
|
- <view style="color:black;font-size:28upx;">¥{{item.gross ? parseFloat(item.gross) : 0}}</view>
|
|
|
- </t-td>
|
|
|
- <t-td>
|
|
|
- <view style="color:black;font-size:28upx;">{{item.mll ? item.mll : 0}}%</view>
|
|
|
- </t-td>
|
|
|
- </t-tr>
|
|
|
- </view>
|
|
|
+ <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:black;font-size:26upx;">{{item.name}}</view></t-td>
|
|
|
+ <t-td><view style="color:black;font-size:28upx;">{{item.num ? parseFloat(item.num) : 0}}</view></t-td>
|
|
|
+ <t-td><view style="color:black;font-size:28upx;">¥{{item.amount ? parseFloat(item.amount) : 0}}</view></t-td>
|
|
|
+ <t-td>
|
|
|
+ <view style="color:black;font-size:28upx;">¥{{item.gross ? parseFloat(item.gross) : 0}}</view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view style="color:black;font-size:28upx;">{{item.mll ? item.mll : 0}}%</view>
|
|
|
+ </t-td>
|
|
|
+ </t-tr>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <t-tr><t-td><view style="color:black;font-weight:bold;font-size:28upx;">{{profile.totalNum||0}}笔 ¥{{profile.totalAmount||0}}</view></t-td></t-tr>
|
|
|
</t-table>
|
|
|
</block>
|
|
|
</view>
|
|
|
@@ -47,34 +50,22 @@ import { getStatItemShow } from "@/api/stat";
|
|
|
import { list } from "@/mixins";
|
|
|
import ShopSelect 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,ShopSelect,DateSelect,AppSearchModule},
|
|
|
mixins: [list],
|
|
|
- computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- isShow:false,
|
|
|
- customizationTime:'',
|
|
|
- shopId:'',
|
|
|
- itemId:'',
|
|
|
- nowTime: "",
|
|
|
- showTimeDropdown: false,
|
|
|
- nowShop: "",
|
|
|
- showShopDropdown: false,
|
|
|
- dataList: [],
|
|
|
params:{
|
|
|
- itemId: '',
|
|
|
searchTime:'',
|
|
|
startTime: "",
|
|
|
endTime: "",
|
|
|
- shopId: "",
|
|
|
sort:"num"
|
|
|
},
|
|
|
- profile:[],
|
|
|
- storageData:[],
|
|
|
- searchContent:'',
|
|
|
+ profile:[]
|
|
|
};
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
@@ -83,39 +74,13 @@ 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()
|
|
|
- },
|
|
|
- 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();
|
|
|
@@ -132,12 +97,7 @@ export default {
|
|
|
this.params.sort = rank
|
|
|
getStatItemShow(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
|
|
|
});
|
|
|
}
|
|
|
}
|