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

企业微信前端

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