Commit 37ba2033 authored by 刘杰's avatar 刘杰

企业微信前端

parent 3433fecb
...@@ -56,33 +56,28 @@ ...@@ -56,33 +56,28 @@
<!-- 右侧数据统计 --> <!-- 右侧数据统计 -->
<view class="statistics"> <view class="statistics" v-if="staffKind==='simulatedBoss'">
<!-- <view class="stat-row"> <view class="stat-row">
<view class="stat-item"> <view class="stat-item">
<view class="stat-block light-orange"> <view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.orderCount}}</text> <text class="number">{{currentSearchData.overview.stats.shippingCount}}</text>
<text class="rate">单量</text> <text class="rate">运输中</text>
</view> </view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-block green"> <view class="stat-block light-orange ">
<text class="number">{{currentSearchData.overview.stats.volumeCount}}</text> <text class="number">{{currentSearchData.overview.stats.positionCount}}</text>
<text class="rate">方量m³</text> <text class="rate">开启定位</text>
</view> </view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-block orange"> <view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.weightCount}}</text> <text class="number">{{currentSearchData.overview.stats.podCount}}</text>
<text class="rate">重量T</text> <text class="rate">回单</text>
</view> </view>
</view> </view>
<view class="stat-item">
<view class="stat-block orange"> </view>
<text class="number">{{currentSearchData.overview.stats.weightCount}}</text>
<text class="rate">重量T</text>
</view>
</view>
</view> -->
<view class="stat-row"> <view class="stat-row">
<view class="stat-item"> <view class="stat-item">
<view class="stat-block light-orange"> <view class="stat-block light-orange">
...@@ -205,7 +200,7 @@ ...@@ -205,7 +200,7 @@
</view> </view>
<!-- 模拟老板对比图表区域 --> <!-- 模拟老板对比图表区域 -->
<view class="chart-container"> <view class="chart-container" v-if="staffKind==='boss'">
<view class="chart-header"> <view class="chart-header">
<text class="chart-title">模拟老板对比</text> <text class="chart-title">模拟老板对比</text>
<view class="sort-buttons"> <view class="sort-buttons">
...@@ -357,7 +352,10 @@ ...@@ -357,7 +352,10 @@
}, },
async mounted() { async mounted() {
await this.initData() await this.initData()
this.initLeaderChart() this.staffKind = uni.getStorageSync(`uc_staff_kind`);
if (this.staffKind === 'boss') {
this.initLeaderChart()
}
this.initProjectChart() this.initProjectChart()
// 在 Vue 的下一个 DOM 更新循环中执行 // 在 Vue 的下一个 DOM 更新循环中执行
this.$nextTick(() => { this.$nextTick(() => {
...@@ -367,7 +365,9 @@ ...@@ -367,7 +365,9 @@
this.loading = false this.loading = false
} }
// 对领导图表进行排序,按应收数据排序 // 对领导图表进行排序,按应收数据排序
this.sortChart('receivable', 'myLeaderChart') if (this.staffKind === 'boss') {
this.sortChart('receivable', 'myLeaderChart')
}
// 对项目图表进行排序,按应收数据排序 // 对项目图表进行排序,按应收数据排序
this.sortProjectChart('receivable', 'myProjectChart') this.sortProjectChart('receivable', 'myProjectChart')
// 监听窗口的 resize 事件,调用 onResize 方法以适应图表大小 // 监听窗口的 resize 事件,调用 onResize 方法以适应图表大小
...@@ -377,7 +377,7 @@ ...@@ -377,7 +377,7 @@
methods: { methods: {
async initData() { async initData() {
this.staffCode = uni.getStorageSync(`staffCode`); this.staffCode = uni.getStorageSync(`staffCode`);
this.staffKind = uni.getStorageSync(`uc_staff_kind`);
const data = { const data = {
"aux": { "aux": {
"activeTime": this.activeTime, "activeTime": this.activeTime,
...@@ -662,6 +662,11 @@ ...@@ -662,6 +662,11 @@
// 更新图表数据 // 更新图表数据
this.updateChartSeries() this.updateChartSeries()
if (this.staffKind === 'boss') {
this.sortChart('receivable', 'myLeaderChart')
}
// 对项目图表进行排序,按应收数据排序
this.sortProjectChart('receivable', 'myProjectChart')
}, },
onResize() { onResize() {
if (this.myLeaderChart) { if (this.myLeaderChart) {
...@@ -794,19 +799,20 @@ ...@@ -794,19 +799,20 @@
} }
}, },
updateChartSeries() { updateChartSeries() {
if (this.staffKind === 'boss') {
this.myLeaderChart.setOption({ this.myLeaderChart.setOption({
series: [{ series: [{
data: this.currentData.leaderChartData.receivable data: this.currentData.leaderChartData.receivable
}, },
{ {
data: this.currentData.leaderChartData.payable data: this.currentData.leaderChartData.payable
}, },
{ {
data: this.currentData.leaderChartData.profitRate data: this.currentData.leaderChartData.profitRate
} }
] ]
}) })
}
this.myProjectChart.setOption({ this.myProjectChart.setOption({
series: [{ series: [{
data: this.currentData.projectChartData.receivable data: this.currentData.projectChartData.receivable
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
background: #fff; background: #fff;
border-radius: 8px; border-radius: 8px;
padding: 15px; padding: 15px;
margin-bottom: 15px; margin-top: 15px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease; transition: all 0.3s ease;
......
...@@ -48,25 +48,7 @@ ...@@ -48,25 +48,7 @@
isCarrier: false, isCarrier: false,
uc_staff_kind: '', uc_staff_kind: '',
currentShow: '', currentShow: '',
topUserList: [{ topUserList: []
name: '订单查询',
key: 'orderQuery',
url: '/pages/index/index'
},
{
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
}, {
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
}, {
name: '老板看板',
key: 'bossCard',
url: '/pages/index/index'
},
]
} }
}, },
onLoad() { onLoad() {
...@@ -89,6 +71,46 @@ ...@@ -89,6 +71,46 @@
uni.$off('executeChoiceItem'); uni.$off('executeChoiceItem');
}, },
methods: { methods: {
updateTopUserList() {
if (this.uc_staff_kind === 'boss') {
this.topUserList = [{
name: '订单查询',
key: 'orderQuery',
url: '/pages/index/index'
},
{
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
}, {
name: '老板看板',
key: 'bossCard',
url: '/pages/index/index'
},
];
} else {
this.topUserList = [{
name: '订单查询',
key: 'orderQuery',
url: '/pages/index/index'
},
{
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
}, {
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
}, {
name: '老板看板',
key: 'bossCard',
url: '/pages/index/index'
},
];
}
},
bindGroupChatCompany() { bindGroupChatCompany() {
const that = this const that = this
...@@ -137,7 +159,7 @@ ...@@ -137,7 +159,7 @@
uni.setStorageSync(`username`, data.username); uni.setStorageSync(`username`, data.username);
uni.setStorageSync(`commonName`, res.data.data.commonName); uni.setStorageSync(`commonName`, res.data.data.commonName);
console.log("commonName",res.data.data.commonName) console.log("commonName", res.data.data.commonName)
this.userInfo = { this.userInfo = {
...data ...data
} }
...@@ -151,6 +173,7 @@ ...@@ -151,6 +173,7 @@
uni.setStorageSync(`staffCode`, data2.staffCode); uni.setStorageSync(`staffCode`, data2.staffCode);
this.uc_staff_kind = data2.uc_staff_kind this.uc_staff_kind = data2.uc_staff_kind
uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind); uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
this.updateTopUserList();
}) })
// if (this.isCarrier) { // if (this.isCarrier) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment