Browse Source

驾校统计

master
unknown 4 months ago
parent
commit
a265b2daf7
  1. 12
      components/UserTab/UserTab.vue
  2. 7
      config/api.js
  3. 2
      manifest.json
  4. 10
      pages.json
  5. 4
      pages/login/comp/privacyRadion.vue
  6. 8
      pages/login/login.vue
  7. 4
      pages/tabbar/mine/index.vue
  8. 5
      pages/tabbar/statistics/comp/columnChart.vue
  9. 10
      pages/tabbar/statistics/comp/comp.scss
  10. 1
      pages/tabbar/statistics/comp/tabDate.vue
  11. 77
      pages/tabbar/statistics/index.vue
  12. 22
      pages/tabbar/student/index.vue
  13. 19
      pages/userCenter/personaInfo/personaInfo.vue
  14. 2
      pages/userCenter/signature/signature.vue

12
components/UserTab/UserTab.vue

@ -46,12 +46,12 @@
if (this.identity == '实操教练') {
//
this.list = [
{
"pagePath": "/pages/tabbar/statistics/index",
"text": "统计",
"iconPath": require("../../static/images/tabbar/tj.png"),
"selectedIconPath": require("../../static/images/tabbar/tjActive.png")
},
// {
// "pagePath": "/pages/tabbar/statistics/index",
// "text": "",
// "iconPath": require("../../static/images/tabbar/tj.png"),
// "selectedIconPath": require("../../static/images/tabbar/tjActive.png")
// },
{
"pagePath": "/pages/tabbar/student/index",
"text": "学员",

7
config/api.js
File diff suppressed because it is too large
View File

2
manifest.json

@ -86,7 +86,7 @@
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "http://192.168.1.40:8318/",
"target" : "http://192.168.1.43:8318/",
// "target" : "http://123.6.232.1:8099",
"changeOrigin" : true,
"secure" : true,

10
pages.json

@ -10,6 +10,16 @@
}
},
{
"path": "pages/login/privacyAgreement/privacyAgreement",
"style": {
"navigationBarTitleText": "",
// "navigationStyle": "custom",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}
},
{
"path": "pages/tabbar/statistics/index",
"style": {
"navigationBarTitleText": "首页",

4
pages/login/comp/privacyRadion.vue

@ -17,8 +17,8 @@
console.log(val)
this.$emit('changeRadio', val)
},
async goPage(type) {
this.$goPage('/pages/userCenter/login/privacyAgreement/privacyAgreement?type='+ type)
goPage(type) {
this.$goPage('/pages/login/privacyAgreement/privacyAgreement?type='+ type)
}
}

8
pages/login/login.vue

@ -111,8 +111,8 @@
mobile: this.FormData.phone,
code: this.FormData.code
}
const res = await coachSmsLogin(obj)
this.$store.commit('update_vuex_loginInfo',res.data)
const {data: res} = await coachSmsLogin(obj)
this.$store.commit('update_vuex_loginInfo',res)
await this.$store.dispatch('getUserInfo')
if(res.userType==5) {
this.showRole = true
@ -120,7 +120,7 @@
if(res.userType==3) this.$store.commit('upDateIdentity', '实操教练')
if(res.userType==4) this.$store.commit('upDateIdentity', '校长')
uni.switchTab({
url: '/pages/tabbar/statistics/index'
url: '/pages/tabbar/student/index'
})
}
},
@ -128,7 +128,7 @@
this.showRole = false
this.$store.commit('upDateIdentity', item.name)
uni.switchTab({
url: '/pages/tabbar/statistics/index'
url: '/pages/tabbar/student/index'
})
// alert(item.name)
}

4
pages/tabbar/mine/index.vue

@ -96,7 +96,7 @@
{text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
{text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
// {text: '', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/signature/signature'},
{text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
// {text: '退', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
]
}else if(this.identity=='校长'||this.identity=='驾校财务') {
@ -104,7 +104,7 @@
{text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
{text: '驾校场地', icon: require('../../../static/images/coach/site.png'), id: 7, url: '/pages/userCenter/schoolSite/schoolSite'},
{text: '驾校教练', icon: require('../../../static/images/coach/coach.png'), id: 7, url: '/pages/userCenter/schoolCoach/schoolCoach'},
{text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
// {text: '', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
{text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
{text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},

5
pages/tabbar/statistics/comp/columnChart.vue

@ -10,9 +10,10 @@
<script>
export default {
props: ['chartData'],
data() {
return {
chartData: {},
// chartData: {},
// opts type="column" config-ucharts.js ['column'] opts
opts: {
timing: "easeOut",
@ -142,7 +143,7 @@ export default {
};
},
mounted() {
this.getServerData();
// this.getServerData();
},
methods: {
getServerData() {

10
pages/tabbar/statistics/comp/comp.scss

@ -114,18 +114,20 @@
.tabs {
display: flex;
justify-content: space-between;
justify-content: flex-start;
padding-bottom: 24rpx;
.tab {
width: 96rpx;
height: 60rpx;
// width: 96rpx;
padding: 12rpx 16rpx;
// height: 60rpx;
background: rgba(25,137,250,0.1);
border-radius: 8rpx;
border: 2rpx solid #1989FA;
font-size: 28rpx;
text-align: center;
line-height: 60rpx;
// line-height: 60rpx;
color: $themC;
margin-right: 30rpx;
&.active {
color: #fff;
background-color: $themC;

1
pages/tabbar/statistics/comp/tabDate.vue

@ -6,7 +6,6 @@
<!-- <view class="tab" @click="tabClick(3)" :class="{active: currentTab==3}">按年</view> -->
<!-- <view class="tab long" @click="tabClick(4)" :class="{active: currentTab==4}">{{ customDate }}</view> -->
</view>
</view>
</template>

77
pages/tabbar/statistics/index.vue

@ -7,7 +7,7 @@
<view class="status_bar"></view>
<view class="" style="height: 30rpx;"></view>
<view class="userInfo">
<view class="tit">Hi,{{ vuex_userInfo.name }}教练</view>
<view class="tit">Hi,{{ vuex_userInfo.name }} {{identity}}</view>
<view class="flex userRow">
<view class="schoolIcon">
<image src="@/static/images/index/ic_jiaxiao.png" mode=""></image>
@ -31,12 +31,18 @@
</view>
<view class="h1"> 结算统计</view>
<view class="tab_box">
<tabDate />
<!-- <view class="tab_box"> -->
<view class="tabBox">
<view class="tabs">
<view class="tab" @click="tabClick(1)" :class="{active: currentTab==1}">最近五天</view>
<view class="tab" @click="tabClick(2)" :class="{active: currentTab==2}">最近半年</view>
</view>
</view>
<!-- <tabDate /> -->
<!-- </view> -->
<view class="card">
<view class="chart">
<columnChart />
<columnChart :chartData="chartData"/>
</view>
</view>
<view class="flex-b">
@ -53,12 +59,7 @@
<UserTab name ='统计'></UserTab>
<u-popup :show="show" mode="center" round="20rpx">
<view class="box">
<view class="tit">您还未上传签名请尽快上传!</view>
<view class="btnBg" @click="goPage">去签名</view>
</view>
</u-popup>
</view>
</template>
@ -68,10 +69,11 @@
import columnChart from './comp/columnChart'
import tabDate from './comp/tabDate'
import { imgUrl } from '@/config/site.config'
import { needSign } from '@/config/api.js'
import {
getSettlementStatistics,
settle_list
settle_list,
getDaySettlement,
getMonthSettlement
} from '@/config/api.js'
export default {
components: {
@ -88,34 +90,62 @@
imgUrl: imgUrl+'indexTopBanner.png',
backgroundSize: '100% 492rpx',
show: false,
chartData: []
}
},
onShow() {
uni.hideTabBar();
this.getSettlementStatisticsFn()
this.settle_listFn()
this.getDaySettlement()
},
onLoad() {
this.needSignFn()
},
mounted() {
},
methods: {
//
async needSignFn() {
const {data: res} = await needSign()
if(res) {
this.show = true
//
async getDaySettlement() {
let obj = {
// startDate: 20240406,
// endDate: 20240605,
// coachId: this.vuex_coachId,
schoolId: this.vuex_schoolId
}
},
goPage() {
this.show = false
this.$goPage('/pages/userCenter/signature/signature')
},
let data = {}
let categories = []
if(this.currentTab==1) {
data = await getDaySettlement(obj)
categories = data.data.map(item=> {
let str = item.refreshDate.slice(2,8)
return str.slice(0, 2) + '-' + str.slice(2, 4) + '-' + str.slice(4, 6)
})
}else {
data = await getMonthSettlement(obj)
categories = data.data.map(item=> {
return item.refreshDate.slice(0, 4) + '-' + item.refreshDate.slice(4)
})
}
let res = data.data
let amount = res.map(item=>item.amount)
let chartData = {
categories: categories,
series: [
{
name: "目标值",
data: amount
}
]
};
this.chartData = chartData
},
tabClick(num) {
if(num==this.currentTab) return
this.currentTab = num
this.getDaySettlement()
},
async getSettlementStatisticsFn() {
let obj = {
@ -160,5 +190,6 @@
margin: auto;
}
}
</style>

22
pages/tabbar/student/index.vue

@ -101,12 +101,18 @@
<u-picker :show="showCar" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker>
<u-picker :show="showClass" :columns="classArr" keyName="name" @confirm="confirmClass" @cancel="showClass=false"></u-picker>
</view>
<u-popup :show="showSign" mode="center" round="20rpx">
<view class="box">
<view class="tit">您还未上传签名请尽快上传!</view>
<view class="btnBg" @click="goSignPage">去签名</view>
</view>
</u-popup>
</view>
</template>
<script>
import { imgUrl } from '@/config/site.config'
import { studentRecordPage, schoolClass, studentOwner } from '@/config/api.js'
import { studentRecordPage, schoolClass, studentOwner, needSign } from '@/config/api.js'
// import topUserInfo from '../statistics/comp/topUserInfo.vue'
export default {
// components: { topUserInfo },
@ -122,6 +128,7 @@
showDatePicker: false,
showCar: false,
showClass: false,
showSign: false,
carArr: [
[
{lab: '全部车型',id: 0},
@ -152,7 +159,7 @@
this.params.schoolId = this.vuex_schoolId
this.studentRecordPageFn()
this.schoolClass()
this.needSignFn()
let nowTime = new Date()*1
//
const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
@ -165,6 +172,17 @@
this.listInit()
},
methods: {
goSignPage() {
this.showSign = false
this.$goPage('/pages/userCenter/signature/signature')
},
//
async needSignFn() {
const {data: res} = await needSign()
if(res) {
this.showSign = true
}
},
searchFn(val) {
this.params.name = val
this.listInit()

19
pages/userCenter/personaInfo/personaInfo.vue

@ -30,12 +30,18 @@
</view>
</view> -->
<!-- <view class="card">
<view class="row">
<view class="lab">收款银行卡</view>
<view class="val">48372*****03928</view>
<view class="card">
<view class="row" @click="goPage(2)">
<view class="lab">用户协议</view>
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
<view class="card">
<view class="row" @click="goPage(1)">
<view class="lab">隐私政策</view>
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
</view> -->
<view class="btnBox">
<view class="logout" @click="loginOut">退出登录</view>
@ -76,6 +82,9 @@
},
loginOut() {
this.$store.commit('goLogin')
},
async goPage(type) {
this.$goPage('/pages/login/privacyAgreement/privacyAgreement?type='+ type)
}
}
}

2
pages/userCenter/signature/signature.vue

@ -178,7 +178,7 @@
this.$u.toast('签名成功啦')
setTimeout(()=>{
uni.switchTab({
url: '/pages/tabbar/statistics/index'
url: '/pages/tabbar/student/index'
})
},1000)
}

Loading…
Cancel
Save