Commit f0fdce6d authored by 刘杰's avatar 刘杰

企业微信前端

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