Commit f0fdce6d authored by 刘杰's avatar 刘杰

企业微信前端

parent a179cdb5
......@@ -13,6 +13,9 @@ import {
export function searchBossCard(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCard`, data)
}
export function searchBossCardBySimulatedBoss(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCardBySimulatedBoss`, data)
}
export function searchOrderEvent(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchOrderEvent`, data)
}
......
......@@ -273,7 +273,6 @@
<!-- 项目运营表格 -->
<view class="table-container">
<text class="table-title">{{tableName}}运营情况</text>
<scroll-view scroll-x class="table-scroll" @touchmove.stop>
<view class="table">
......@@ -294,7 +293,51 @@
</view>
<view class="table-body">
<view class="table-row" v-for="(item, index) in currentData.tableData" :key="index">
<view class="table-cell fixed-column">{{ item.boss }}</view>
<view v-if="staffKind==='boss'" class="table-cell fixed-column" @click="clickSimulatedBoss(item.boss)">
<a :class="{'active': isActive(item.boss)}">{{ item.boss }}</a>
</view>
<view v-if="staffKind!=='boss'" class="table-cell fixed-column">
{{ item.boss }}
</view>
<view class="table-cell">{{ item.receivable }}</view>
<view class="table-cell">{{ item.payable }}</view>
<view class="table-cell">{{ item.cashPayable }}</view>
<view class="table-cell">{{ item.profitRate }}%</view>
<view class="table-cell">{{ item.orderCount }}</view>
<view class="table-cell">{{ item.volume }}</view>
<view class="table-cell">{{ item.weight }}</view>
<view class="table-cell">{{ item.manpower }}</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 模拟老板项目运营表格 -->
<view class="table-container" v-if="staffKind==='boss' && activeBoss !=='' ">
<text class="table-title">模拟老板项目运营情况</text>
<scroll-view scroll-x class="table-scroll" @touchmove.stop>
<view class="table">
<view class="table-header">
<view class="table-row">
<view class="table-cell-title fixed-column" style="background-color: #f5f5f5;">
项目
</view>
<view class="table-cell-title">应收(万)</view>
<view class="table-cell-title">应付(万)</view>
<view class="table-cell-title">应付现结(万)</view>
<view class="table-cell-title">毛利率(%)</view>
<view class="table-cell-title">单量</view>
<view class="table-cell-title">方(m³)</view>
<view class="table-cell-title">吨(T)</view>
<view class="table-cell-title">人力</view>
</view>
</view>
<view class="table-body">
<view class="table-row" v-for="(item, index) in bossProject.tableData" :key="index">
<view class="table-cell fixed-column">
{{ item.boss }}
</view>
<view class="table-cell">{{ item.receivable }}</view>
<view class="table-cell">{{ item.payable }}</view>
<view class="table-cell">{{ item.cashPayable }}</view>
......@@ -316,7 +359,8 @@
<script module="test" lang="renderjs">
import {
searchBossCard
searchBossCard,
searchBossCardBySimulatedBoss
} from '../../api/apiList'
import * as echarts from 'echarts'
import {
......@@ -347,7 +391,9 @@
projectSortType: 'receivable',
timeData: {},
showOrderEvent: false,
tableName: ""
tableName: "",
bossProject: [],
activeBoss: ''
}
},
computed: {
......@@ -413,6 +459,28 @@
orderEventClose() {
this.showOrderEvent = false
},
isActive(boss) {
return this.activeBoss === boss; // 判断当前 boss 是否为激活状态
},
clickSimulatedBoss(name) {
console.log("name" + name);
this.activeBoss = name;
this.staffKind = uni.getStorageSync('uc_staff_kind');
if (this.staffKind === 'boss') {
this.bossProject = []
const data = {
"aux": {
"activeTime": this.activeTime,
"commonName": name
}
}
searchBossCardBySimulatedBoss(data).then(res => {
console.log(res.data.data)
this.bossProject = res.data.data
})
}
},
async initData() {
this.staffCode = uni.getStorageSync(`staffCode`);
this.staffKind = uni.getStorageSync('uc_staff_kind');
......@@ -547,7 +615,7 @@
position: 'top', // 标签位置在柱子上方
formatter: '{c}', // 显示的内容,{c} 表示数据值
color: '#333', // 标签颜色
fontSize:10, // 标签字体大小
fontSize: 10, // 标签字体大小
},
},
......@@ -601,7 +669,7 @@
// 获取数据点数量
const dataCount = this.currentData.projectChartData.receivable.length;
// 计算所需的最小宽度(假设每个数据点需要100px)
const minWidth = Math.max(dataCount * 60, 400);
const minWidth = Math.max(dataCount * 60, 300);
// 设置容器宽度
const wrapper = document.getElementById('myProjectChart');
......@@ -985,13 +1053,21 @@
.fixed-column {
position: sticky;
/* 使用 sticky 定位 */
left: 0;
/* 固定在左侧 */
background-color: white;
/* 背景色 */
z-index: 1;
/* 确保在其他单元格之上 */
}
.table-cell a {
color: black;
text-decoration: underline;
}
.table-cell a.active {
color: red;
/* 点击后改变的颜色 */
font-weight: bold;
/* 可选:加粗 */
}
.shou {
......
......@@ -41,7 +41,8 @@
</view>
<view style="height: 10vh;"></view>
</scroll-view>
<!-- 新增按钮 -->
<button class="add-button" @click="addNewReport">新增</button>
</view>
</template>
......@@ -65,19 +66,26 @@
}
},
mounted() {
this.initData()
console.log("onShow")
this.onReload()
},
onShow() {
console.log("onShow")
this.onReload(); // 页面显示时调用数据加载方法
},
onPullDownRefresh: function() {
console.log("下拉刷新")
this.onReload()
},
onLoad() {
this.onReload(); // 页面加载时调用数据加载方法
},
methods: {
selectReport(status) {
this.searchStatus = status
this.dailyReportList = []
this.initData()
addNewReport() {
uni.navigateTo({
url: '/pages/dailyReportCreate/dailyReportCreate'
});
},
initData() {
this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind');
......@@ -88,7 +96,7 @@
console.log('获取到的commonName:', this.commonName);
if (!this.staffCode || !this.staffKind) {
if (!this.staffCode) {
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
......@@ -156,6 +164,7 @@
},
onReload() {
this.dailyReportList = []
this.initData()
}
}
......@@ -169,10 +178,34 @@
/* 确保 html 和 body 高度为 100% */
margin: 0;
/* 去掉默认的 margin */
overflow: hidden;
overfl: hidden;
/* 禁用滚动条 */
}
.add-button {
position: fixed;
bottom: 10px;
left: 0;
right: 0;
background-color: #2E75E6;
color: white;
border: none;
border-radius: 48rpx;
padding: 8px;
font-size: 16px;
font-weight: bolder;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
cursor: pointer;
z-index: 1000;
width: 90%;
}
.add-button:hover {
background-color: #40a9ff;
/* 悬停时的背景色 */
}
.daily-report {
// padding: 15px;
background: #f5f7fa;
......@@ -180,7 +213,10 @@
// max-height: 100vh;
padding: 10px;
padding-top: 45px;
position: relative;
/* 确保子元素可以绝对定位 */
padding-bottom: 60px;
/* 为底部按钮留出空间 */
.report-list {
......
......@@ -52,6 +52,14 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "pages/dailyReportCreate/dailyReportCreate",
"style": {
"navigationBarTitleText": "填写日报",
"enablePullDownRefresh": false,
"disableScroll": true
}
}
],
"subPackages": [{
......
......@@ -52,7 +52,7 @@
<!-- 按钮组 -->
<view class="button-group">
<!-- <button class="back-btn" @click="goBack">返回</button> -->
<button class="back-btn" @click="goBack">返回</button>
<button class="submit-btn" @click="submitReport">提交日报</button>
</view>
</view>
......@@ -191,17 +191,23 @@
title: '保存成功',
icon: 'success',
duration: 2000,
// success: () => {
// setTimeout(() => {
// uni.navigateBack()
// }, 1500) // 等待提示显示 1.5 秒后返回
// }
success: () => {
setTimeout(() => {
uni.$emit('executeChoiceItem', 'dailyReportList');
uni.navigateTo({
url: '/pages/index/index'
});
}, 1500) // 等待提示显示 1.5 秒后返回
}
})
}
})
},
goBack() {
uni.navigateBack()
uni.$emit('executeChoiceItem', 'dailyReport');
uni.navigateTo({
url: '/pages/index/index'
});
}
}
}
......@@ -212,7 +218,7 @@
// padding: 20px;
background-color: #f5f5f5;
min-height: 100vh;
padding-top: 45px;
// padding-top: 45px;
.page-title {
text-align: center;
......
......@@ -14,9 +14,9 @@
<view v-if="currentShow === 'bossCard' && uc_staff_kind!==''">
<bossCard></bossCard>
</view>
<view v-if="currentShow === 'dailyReportCreate' && uc_staff_kind!=='boss'">
<!-- <view v-if="currentShow === 'dailyReportCreate' && uc_staff_kind!=='boss'">
<dailyReportCreate></dailyReportCreate>
</view>
</view> -->
<view v-if="currentShow === 'dailyReport'">
<dailyReportList></dailyReportList>
</view>
......@@ -46,20 +46,15 @@
return {
isCarrier: false,
uc_staff_kind: '',
currentShow: 'bossCard',
currentShow: '',
topUserList: [],
}
},
onLoad() {
console.log('index页面加载'); // 调试日志
this.uc_staff_kind = uni.getStorageSync(`uc_staff_kind`);
this.updateTopUserList()
// this.getBindCompanyResult()
// this.bindGroupChatCompany()
},
onShow() {
uni.$on('executeChoiceItem', (component) => {
console.log('收到切换组件事件:', component); // 调试日志
this.choiceItem(component);
......@@ -72,40 +67,30 @@
updateTopUserList() {
if (this.uc_staff_kind === 'boss') {
this.currentShow = 'bossCard'
this.topUserList = [{
name: '运营监控',
key: 'bossCard',
url: '/pages/index/index'
},
// {
// name: '查看日报',
// key: 'dailyReport',
// url: '/pages/index/index'
// },
];
} else if (this.uc_staff_kind === 'simulatedBoss') {
this.currentShow = 'dailyReport'
this.topUserList = [{
name: '运营监控',
key: 'bossCard',
url: '/pages/index/index'
},
{
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
},
{
}, {
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
},
];
} else {
this.currentShow = 'dailyReport'
this.topUserList = [{
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
}, {
name: '查看日报',
key: 'dailyReport',
url: '/pages/index/index'
......
......@@ -95,7 +95,7 @@
initData() {
this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind');
if (!this.staffCode || !this.staffKind) {
if (!this.staffCode) {
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
......
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