Commit 3612bc13 authored by 刘杰's avatar 刘杰

企业微信前端

parent 512b328a
......@@ -9,9 +9,13 @@ import {
} from "../publicConfig/config";
export function searchBossCard(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCard`, data)
}
export function searchOrderEvent(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchOrderEvent`, data)
}
export function BindCompany(data) {
return Request(
......@@ -26,6 +30,9 @@ export function selectDailyReport(data) {
export function dailyReportSave(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.auxVoSave`, data)
}
export function selectReporter(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.selectReporter`, data)
}
export function selectStaffByUsername(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.selectStaffByUsername`, data)
......
......@@ -377,7 +377,7 @@
methods: {
async initData() {
this.staffCode = uni.getStorageSync(`staffCode`);
this.staffKind = uni.getStorageSync('uc_staff_kind');
const data = {
"aux": {
"activeTime": this.activeTime,
......@@ -706,7 +706,10 @@
if (chart === 'myLeaderChart') {
this.myLeaderChart.setOption({
xAxis: {
data: sortArray.map(item => item.name)
data: sortArray.map(item => item.name),
axisLabel: {
rotate: -20 // 设置横坐标标签旋转 45°
}
},
series: [{
name: '应收',
......@@ -722,7 +725,10 @@
} else if (chart === 'myProjectChart') {
this.myProjectChart.setOption({
xAxis: {
data: sortArray.map(item => item.name)
data: sortArray.map(item => item.name),
axisLabel: {
rotate: -20 // 设置横坐标标签旋转 45°
}
},
series: [{
name: '应收',
......@@ -767,7 +773,10 @@
if (chart === 'myLeaderChart') {
this.myLeaderChart.setOption({
xAxis: {
data: sortArray.map(item => item.name)
data: sortArray.map(item => item.name),
axisLabel: {
rotate: -20 // 设置横坐标标签旋转 45°
}
},
series: [{
name: '应收',
......@@ -783,7 +792,10 @@
} else if (chart === 'myProjectChart') {
this.myProjectChart.setOption({
xAxis: {
data: sortArray.map(item => item.name)
data: sortArray.map(item => item.name),
axisLabel: {
rotate: -20 // 设置横坐标标签旋转 45°
}
},
series: [{
name: '应收',
......
......@@ -2,15 +2,15 @@
<view class="daily-report">
<!-- 顶部统计 -->
<view class="report-stats">
<view class="stat-item">
<view class="stat-item" @click="selectReport('submit')">
<text class="number" style="color: #52c41a;">{{ searchDatas.submitted }}</text>
<text class="label">已提交</text>
</view>
<view class="stat-item">
<view class="stat-item" @click="selectReport('unSubmit')">
<text class="number" style="color: #ff4d4f;">{{ searchDatas.unSubmitted }}</text>
<text class="label">未提交</text>
</view>
<view class="stat-item">
<view class="stat-item" @click="selectReport('all')">
<text class="number" style="color: #1890ff;">{{ searchDatas.total }}</text>
<text class="label">总人数</text>
</view>
......@@ -19,7 +19,7 @@
<!-- 日报列表 -->
<scroll-view class="report-list" scroll-y :style="{ height: 'calc(100vh - 120px)' }">
<view class="report-card" v-for="(report, index) in searchDatas.dailyReportList" :key="index">
<view class="report-card" v-for="(report, index) in dailyReportList" :key="index">
<view class="card-header">
<view class="left">
<text class="name">{{ report.reporter }}</text>
......@@ -58,10 +58,13 @@
export default {
data() {
return {
searchStatus: "all",
staffCode: "",
staffKind: "",
searchDatas: {},
commonName: "",
dailyReportList: []
}
},
mounted() {
......@@ -72,30 +75,53 @@
this.onReload()
},
methods: {
selectReport(status) {
this.searchStatus = status
this.dailyReportList = []
this.initData()
},
initData() {
this.staffCode = uni.getStorageSync(`staffCode`);
this.staffKind = uni.getStorageSync(`uc_staff_kind`);
this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind');
this.commonName = uni.getStorageSync('commonName');
console.log('获取到的commonName:', this.commonName);
if (!this.staffCode || !this.staffKind) {
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
});
return;
}
const data = {
"aux": {
"staffCode": this.staffCode,
"staffKind": this.staffKind
aux: {
staffCode: this.staffCode,
staffKind: this.staffKind,
searchStatus: this.searchStatus
}
}
uni.showLoading({
title: '加载中...',
});
selectDailyReport(data).then(res => {
uni.showLoading({
title: '加载中...',
uni.stopPullDownRefresh();
const data = res.data.data;
this.searchDatas = data;
this.dailyReportList = this.searchDatas.dailyReportList
}).catch(err => {
console.error('获取日报数据失败:', err);
uni.showToast({
title: '获取数据失败',
icon: 'none'
});
uni.stopPullDownRefresh()
const data = res.data.data
this.searchDatas = data
setTimeout(function() {
uni.hideLoading();
}, 100);
})
}).finally(() => {
uni.hideLoading();
});
},
onReload() {
......@@ -125,6 +151,15 @@
padding: 15px 24px;
background: #f9f9f9;
border-radius: 6px;
transition: background 0.3s, transform 0.3s;
/* 添加过渡效果 */
&:hover {
background: #e6f7ff;
/* 鼠标悬停时的背景色 */
transform: scale(1.05);
/* 鼠标悬停时的放大效果 */
}
.number {
display: block;
......@@ -132,16 +167,6 @@
font-weight: bold;
color: #333;
margin-bottom: 8px;
&:after {
content: '';
display: block;
width: 24px;
height: 2px;
background: #1890ff;
margin: 8px auto 0;
border-radius: 1px;
}
}
.label {
......
......@@ -8,9 +8,10 @@
<view class="form-container">
<!-- 报告人 -->
<view class="form-item">
<text class="label"><text class="label-line"></text>报告人</text>
<input type="text" v-model="formData.reporter" placeholder="请输入报告人" class="input"
:disabled="!!formData.reporter" :style="formData.reporter ? 'background-color: #f5f5f5;' : ''" />
<text class="label"><text class="label-line"></text>汇报人</text>
<picker mode="selector" :range="reporterValues" @change="onReporterChange" class="picker">
<view class="picker-text">{{ selectedReporterValue || '请选择汇报人' }}</view>
</picker>
</view>
<!-- 日期 -->
......@@ -60,7 +61,8 @@
<script>
import {
dailyReportSave
dailyReportSave,
selectReporter
} from '../../api/apiList'
export default {
data() {
......@@ -76,6 +78,7 @@
return {
formData: {
reporterTo:'',
reporter: '',
date: formattedDate, // 使用带时间的日期格式
todayWork: '',
......@@ -84,12 +87,15 @@
leaveReason: ''
},
staffCode: "",
leaveOptions: ['是', '否']
staffKind: "",
leaveOptions: ['是', '否'],
reporterMap: {}, // key:value 形式的 map 数据
reporterValues: [], // 用于 picker 的显示值
selectedReporterValue: '' // 选中的报告人显示值
}
},
created() {
// 在组件创建时获取 commonName
this.getCommonName();
this.initReporter(); // 在组件创建时初始化报告人
},
mounted() {
// 如果 created 中没有获取到,在 mounted 中再次尝试
......@@ -98,6 +104,24 @@
}
},
methods: {
initReporter() {
this.staffKind = uni.getStorageSync('uc_staff_kind');
const data={
"aux":{
staffKind:this.staffKind
}
}
selectReporter(data).then(res => {
const data = res.data.data; // 假设返回的数据在这个路径
this.reporterMap = {}; // 清空之前的数据
this.reporterValues = data.map(item => {
this.reporterMap[item.staffId] = item.mame; // 将 staffId 作为 key,mame 作为 value
return item.mame; // 返回 mame 作为下拉框的显示值
});
}).catch(err => {
console.error('获取报告人失败:', err);
});
},
getCommonName() {
const commonName = uni.getStorageSync('commonName');
console.log('获取到的commonName:', commonName);
......@@ -111,11 +135,16 @@
});
}
},
onReporterChange(e) {
const selectedIndex = e.detail.value; // 获取选择的索引
this.selectedReporterValue = this.reporterValues[selectedIndex]; // 显示的值
// 获取对应的 key
this.formData.reporterTo = Object.keys(this.reporterMap)[selectedIndex]; // 存储的值为 key
},
dateChange(e) {
// 当用户选择新日期时,保留当前时间
const selectedDate = e.detail.value
const currentTime = this.formData.date.split(' ')[1] || '00:00:00'
this.formData.date = `${selectedDate} ${currentTime}`
const selectedDate = e.detail.value;
const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
this.formData.date = `${selectedDate} ${currentTime}`;
},
leaveChange(e) {
this.formData.isLeave = this.leaveOptions[e.detail.value]
......@@ -145,6 +174,7 @@
const data = {
"aux": {
reporter: this.formData.reporter,
reporterTo: this.formData.reporterTo,
date: this.formData.date,
todayWork: this.formData.todayWork,
weekWork: this.formData.weekWork,
......@@ -161,11 +191,11 @@
title: '保存成功',
icon: 'success',
duration: 2000,
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1500) // 等待提示显示 1.5 秒后返回
}
// success: () => {
// setTimeout(() => {
// uni.navigateBack()
// }, 1500) // 等待提示显示 1.5 秒后返回
// }
})
}
})
......
......@@ -79,32 +79,32 @@
"devServer" : {
"https" : false,
"disableHostCheck" : true,
"port" : 8089,
"port" : 8082,
"proxy" : {
"/api" : {
"target" : "http://122.112.220.204:8089",
// "target" : "http://localhost:8083",
// "target" : "http://122.112.220.204:8089",
"target" : "http://localhost:8083",
// "target" : "https://stms.bjzc-scs.com",
"changeOrigin" : true,
"secure" : false
},
"/handler" : {
"target" : "http://122.112.220.204:8089",
// "target" : "http://localhost:8083",
// "target" : "http://122.112.220.204:8089",
"target" : "http://localhost:8083",
// "target" : "https://stms.bjzc-scs.com",
"changeOrigin" : true,
"secure" : false
},
"/sandtable" : {
"target" : "http://122.112.220.204:8089",
// "target" : "http://localhost:8083",
// "target" : "http://122.112.220.204:8089",
"target" : "http://localhost:8083",
// "target" : "https://stms.bjzc-scs.com",
"changeOrigin" : true,
"secure" : false
},
"/tmsca" : {
"target" : "http://122.112.220.204:8089",
// "target" : "http://localhost:8083",
// "target" : "http://122.112.220.204:8089",
"target" : "http://localhost:8083",
// "target" : "https://stms.bjzc-scs.com",
"changeOrigin" : true,
"secure" : false
......
This diff is collapsed.
......@@ -74,40 +74,40 @@
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'
},
];
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'
},
];
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'
},
];
}
},
......@@ -174,7 +174,16 @@
this.uc_staff_kind = data2.uc_staff_kind
uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
this.updateTopUserList();
})
}).catch(err => {
// console.error('获取员工数据失败:', err);
uni.showToast({
title: "获取员工数据失败",
icon: 'none'
});
uni.redirectTo({
url: "/pages/login/login",
})
});
// if (this.isCarrier) {
// this.currentShow = "waybillQuery"
......
......@@ -9,8 +9,8 @@ let BASEURL = {
// url: 'http://192.168.1.199:7080' //唐浩然
// url: 'http://192.168.0.230:8080' // xiaohan
// url: "https://botms-demo.logwirecloud.com",
// url: "http://localhost:8083", //开发
url: "http://122.112.220.204:8089", //开发
url: "http://localhost:8083", //开发
// url: "http://122.112.220.204:8089", //开发/
// url: "https://stms.bjzc-scs.com", //生产
};
......
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