|
|
@@ -2,18 +2,8 @@
|
|
|
<view class="app-content">
|
|
|
<view class="ex-page">
|
|
|
<view class="top-bar">
|
|
|
- <DorpdownSelect class="bar"
|
|
|
- :menuObj="menuTimeObj"
|
|
|
- :selectItemId.sync="selectTimeId"
|
|
|
- :typeTime="true"
|
|
|
- :typeSelect="1" top="0upx"
|
|
|
- @selectSussess="selectSussess" />
|
|
|
-
|
|
|
- <DorpdownSelect class="bar"
|
|
|
- :menuObj.sync="menuObj"
|
|
|
- :selectItemId.sync="shopId"
|
|
|
- top="0"
|
|
|
- @selectSussess="selectShopSussess" />
|
|
|
+ <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
|
|
|
+ <ShopSelect class="bar" top="0" @selectShopFn="selectShopFn" />
|
|
|
</view>
|
|
|
<scroll-view scroll-y scroll-with-animation class="main-view">
|
|
|
<view class="space-view ex-table">
|
|
|
@@ -38,71 +28,27 @@
|
|
|
</block>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
- <!-- 时间段选择-->
|
|
|
- <rangeDatePick
|
|
|
- :show="isShow"
|
|
|
- start="2000-01-01"
|
|
|
- end="2200-12-01"
|
|
|
- :value="customizationTime"
|
|
|
- @change="timeChange"
|
|
|
- @cancel="timeCancel"
|
|
|
- themeColor="#4C83D6" fields="day"></rangeDatePick>
|
|
|
- <!-- <kd-entrance></kd-entrance> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
|
|
|
-const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
-
|
|
|
import SelectList from "@/components/plugin/selectList";
|
|
|
import { getStatYj } from "@/api/statistics/index";
|
|
|
-import { list,selectShop } from "@/mixins";
|
|
|
-import DorpdownSelect from "@/components/module/shopSelect";
|
|
|
-import rangeDatePick from '@/components/pyh-rdtpicker/pyh-rdtpicker.vue';
|
|
|
+import { list } from "@/mixins";
|
|
|
+import ShopSelect from "@/components/module/shopSelect";
|
|
|
+import DateSelect from "@/components/module/dateSelect";
|
|
|
import {mapActions, mapGetters} from "vuex";
|
|
|
export default {
|
|
|
- components: { SelectList, AppWrapperEmpty,DorpdownSelect,rangeDatePick },
|
|
|
- mixins: [list,selectShop],
|
|
|
+ components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect },
|
|
|
+ mixins: [list],
|
|
|
computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
|
|
|
data() {
|
|
|
return {
|
|
|
isShow:false,
|
|
|
customizationTime:'',
|
|
|
- menuTimeObj:'',//时间分类-类型
|
|
|
- menuShopObj:'',//门店分类-类型
|
|
|
- selectTimeId:'',//选择时间id
|
|
|
- shopId:'',//选择分店id
|
|
|
+ shopId:'',
|
|
|
itemId:'',
|
|
|
- selectListData: [
|
|
|
- {
|
|
|
- title: "时间",
|
|
|
- key: "time",
|
|
|
- default: "1",
|
|
|
- data: [
|
|
|
- {
|
|
|
- name: "下午",
|
|
|
- value: "1"
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: "全部",
|
|
|
- key: "shopId",
|
|
|
- default: "01",
|
|
|
- data: [
|
|
|
- {
|
|
|
- name: "瑞景店",
|
|
|
- value: "01"
|
|
|
- },
|
|
|
- {
|
|
|
- name: "加州店",
|
|
|
- value: "02"
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
nowTime: "",
|
|
|
showTimeDropdown: false,
|
|
|
nowShop: "",
|
|
|
@@ -139,60 +85,31 @@ export default {
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.resetList();
|
|
|
- this._list().then(res => {
|
|
|
+ this.yjList().then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
});
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.itemId = e.id;
|
|
|
this.params.itemId = e.id;
|
|
|
-
|
|
|
- let dateDefaultOption = [];
|
|
|
- let list = this.getDictionariesInfo.dateDefaultOption;
|
|
|
- for (let i=0;i<list.length;i++){
|
|
|
- dateDefaultOption.push({name:list[i].name,id:list[i].value})
|
|
|
- }
|
|
|
- this.menuTimeObj = {title:'今天',titleChild:'时间',list: dateDefaultOption};
|
|
|
-
|
|
|
this.shopId = this.getLoginInfo.shopId;
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['setUserShopAll']),
|
|
|
- // 选择分店
|
|
|
- selectShopSussess(val){
|
|
|
- this.params.shopId = val.selectItem.id;
|
|
|
+ //选择分店
|
|
|
+ selectShopFn(val){
|
|
|
+ this.params.shopId = val.id;
|
|
|
this.init();
|
|
|
},
|
|
|
//选择时间
|
|
|
- selectSussess(val) {
|
|
|
- this.params.selectTime = this.selectTimeId;
|
|
|
- if(val.select=='自定义'){
|
|
|
- this.selectTime();
|
|
|
- }else{
|
|
|
- this.init();
|
|
|
- }
|
|
|
-
|
|
|
+ selectDateFn(val) {
|
|
|
+ this.params = {...this.params,...val}
|
|
|
+ this.init();
|
|
|
},
|
|
|
- //选择时间-自定义时间
|
|
|
- selectTime(){
|
|
|
- this.customizationTime = [time,time],
|
|
|
- this.isShow = true;
|
|
|
- },
|
|
|
- //选择自定义时间确定
|
|
|
- timeChange(e){
|
|
|
- this.isShow = false;
|
|
|
- this.params.startTime = e[0]
|
|
|
- this.params.endTime = e[1]
|
|
|
- this.init();
|
|
|
- },
|
|
|
- //选择自定义时间取消
|
|
|
- timeCancel(e){this.isShow = false;},
|
|
|
-
|
|
|
async init() {
|
|
|
- this._list();
|
|
|
+ this.yjList();
|
|
|
},
|
|
|
- _list() {
|
|
|
+ yjList() {
|
|
|
return getStatYj(this.params).then(res => {
|
|
|
this.completes(res);
|
|
|
});
|
|
|
@@ -204,13 +121,13 @@ export default {
|
|
|
.ex-page {
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
+ background: white;
|
|
|
flex-direction: column;
|
|
|
.top-bar {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
|
- // box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
|
|
|
z-index: 20;
|
|
|
.bar{
|
|
|
width: 50%;
|
|
|
@@ -279,4 +196,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|