Commit a23aa2ca authored by 刘杰's avatar 刘杰

企业微信前端

parent 8a2c1ef9
...@@ -20,8 +20,8 @@ export function BindCompany(data) { ...@@ -20,8 +20,8 @@ export function BindCompany(data) {
); );
} }
export function dailyReportSearch(data) { export function selectDailyReport(data) {
return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_search/paging`, data) return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.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)
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<view class="stats-card" @click="navigateToAbnormalReport"> <view class="stats-card" @click="navigateToAbnormalReport">
<view class="circle-wrapper"> <view class="circle-wrapper">
<view class="progress-ring" :style="{ <view class="progress-ring" :style="{
background: `conic-gradient(#FF4D4F 0% ${currentData.overview.submitRate}%, #f5f5f5 ${currentData.overview.submitRate}% 100%)` background: `conic-gradient(#FF4D4F 0% ${currentSearchData.overview.eventRate}%, #f5f5f5 ${currentSearchData.overview.eventRate}% 100%)`
}"> }">
<view class="inner-circle"> <view class="inner-circle">
<view class="submit-info"> <view class="submit-info">
<view class="count-row"> <view class="count-row">
<text class="submitted error">{{currentData.overview.submitCount}}</text> <text class="submitted error">{{currentSearchData.overview.unHandled}}</text>
<text class="should-submitted">/{{currentData.overview.totalCount}}</text> <text class="should-submitted">/{{currentSearchData.overview.totalEvent}}</text>
</view> </view>
<text class="label">异常统计</text> <text class="label">异常统计</text>
</view> </view>
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
<view class="stats-card" @click="navigateToDailyReport"> <view class="stats-card" @click="navigateToDailyReport">
<view class="circle-wrapper"> <view class="circle-wrapper">
<view class="progress-ring" :style="{ <view class="progress-ring" :style="{
background: `conic-gradient(#52C41A 0% ${currentData.overview.submitRate}%, #f5f5f5 ${currentData.overview.submitRate}% 100%)` background: `conic-gradient(#52C41A 0% ${currentSearchData.overview.submitRate}%, #f5f5f5 ${currentSearchData.overview.submitRate}% 100%)`
}"> }">
<view class="inner-circle"> <view class="inner-circle">
<view class="submit-info"> <view class="submit-info">
<view class="count-row"> <view class="count-row">
<text class="submitted">{{currentData.overview.submitCount}}</text> <text class="submitted">{{currentSearchData.overview.submitCount}}</text>
<text class="should-submitted">/{{currentData.overview.totalCount}}</text> <text class="should-submitted">/{{currentSearchData.overview.totalCount}}</text>
</view> </view>
<text class="label">日报提交</text> <text class="label">日报提交</text>
</view> </view>
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
<text class="rate">单量</text> <text class="rate">单量</text>
</view> </view>
</view> </view>
</view>
<view class="stat-row">
<view class="stat-item"> <view class="stat-item">
<view class="stat-block green"> <view class="stat-block green">
<text class="number">{{currentSearchData.overview.stats.volumeCount}}</text> <text class="number">{{currentSearchData.overview.stats.volumeCount}}</text>
...@@ -79,6 +77,7 @@ ...@@ -79,6 +77,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -97,17 +96,17 @@ ...@@ -97,17 +96,17 @@
<view class="right-section"> <view class="right-section">
<view class="main-info"> <view class="main-info">
<view class="amount-section"> <view class="amount-section">
<text class="amount">{{currentData.finance.receivable.total}}</text> <text class="amount">{{currentSearchData.finance.receivable.total}}</text>
<text class="label">应收</text> <text class="label">应收</text>
</view> </view>
<view class="extra-info"> <view class="extra-info">
<view class="info-row"> <view class="info-row">
<text class="label">预计毛利</text> <text class="label">预计毛利</text>
<text class="value">{{currentData.finance.receivable.profit}}</text> <text class="value">{{currentSearchData.finance.receivable.profit}}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">毛利率</text> <text class="label">毛利率</text>
<text class="value">{{currentData.finance.receivable.profitRate}}%</text> <text class="value">{{currentSearchData.finance.receivable.profitRate}}%</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -117,7 +116,7 @@ ...@@ -117,7 +116,7 @@
<view class="progress" :style="{ <view class="progress" :style="{
backgroundColor: '#FF4D4F', backgroundColor: '#FF4D4F',
opacity:0.9, opacity:0.9,
width: 100-currentData.finance.receivable.profitRate + '%', width: 100-currentSearchData.finance.receivable.profitRate + '%',
position: 'absolute', position: 'absolute',
height: '100%', height: '100%',
left: 0, left: 0,
...@@ -141,17 +140,17 @@ ...@@ -141,17 +140,17 @@
<view class="right-section"> <view class="right-section">
<view class="main-info"> <view class="main-info">
<view class="amount-section"> <view class="amount-section">
<text class="amount">{{currentData.finance.payable.total}}</text> <text class="amount">{{currentSearchData.finance.payable.total}}</text>
<text class="label">应付</text> <text class="label">应付</text>
</view> </view>
<view class="extra-info"> <view class="extra-info">
<view class="info-row"> <view class="info-row">
<text class="label">现结</text> <text class="label">现结</text>
<text class="value cash">{{currentData.finance.payable.cash}}</text> <text class="value cash">{{currentSearchData.finance.payable.cash}}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">月结</text> <text class="label">月结</text>
<text class="value monthly">{{currentData.finance.payable.monthly}}</text> <text class="value monthly">{{currentSearchData.finance.payable.monthly}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -290,6 +289,7 @@ ...@@ -290,6 +289,7 @@
}, },
data() { data() {
return { return {
staffCode: "",
loading: true, loading: true,
activeTime: 'today', activeTime: 'today',
myLeaderChart: null, myLeaderChart: null,
...@@ -723,10 +723,11 @@ ...@@ -723,10 +723,11 @@
}, },
methods: { methods: {
initData() { initData() {
this.staffCode = uni.getStorageSync(`staffCode`);
const data = { const data = {
"aux": { "aux": {
"activeTime": this.activeTime "activeTime": this.activeTime,
"staffCode": this.staffCode
} }
} }
searchBossCard(data).then(res => { searchBossCard(data).then(res => {
...@@ -737,6 +738,7 @@ ...@@ -737,6 +738,7 @@
}, },
initLeaderChart() { initLeaderChart() {
// 获取数据点数量 // 获取数据点数量
const dataCount = this.currentData.leaderChartData.receivable.length; const dataCount = this.currentData.leaderChartData.receivable.length;
// 计算所需的最小宽度(假设每个数据点需要100px) // 计算所需的最小宽度(假设每个数据点需要100px)
...@@ -1100,12 +1102,10 @@ ...@@ -1100,12 +1102,10 @@
}) })
}, },
navigateToDailyReport() { navigateToDailyReport() {
// 使用uni-app的导航方法跳转到日报查看页面 console.log('点击了日报跳转按钮');
console.log("日报填写") // 直接触发父组件的 choiceItem
uni.navigateTo({ uni.$emit('executeChoiceItem', 'dailyReport');
url: '/pages/dailyReport/dailyReportCreate' },
});
}
}, },
beforeDestroy() { beforeDestroy() {
if (this.myLeaderChart) { if (this.myLeaderChart) {
......
...@@ -3,62 +3,54 @@ ...@@ -3,62 +3,54 @@
<!-- 顶部统计 --> <!-- 顶部统计 -->
<view class="report-stats"> <view class="report-stats">
<view class="stat-item"> <view class="stat-item">
<text class="number" style="color: #52c41a;">{{ stats.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">
<text class="number" style="color: #ff4d4f;">{{ stats.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">
<text class="number" style="color: #1890ff;">{{ stats.total }}</text> <text class="number" style="color: #1890ff;">{{ searchDatas.total }}</text>
<text class="label">总人数</text> <text class="label">总人数</text>
</view> </view>
</view> </view>
<!-- 日报列表 --> <!-- 日报列表 -->
<scroll-view class="report-list" scroll-y :style="{ height: 'calc(100vh - 190px)' }"> <scroll-view class="report-list" scroll-y :style="{ height: 'calc(100vh - 120px)' }">
<view class="report-card" v-for="(report, index) in searchDatas" :key="index"> <view class="report-card" v-for="(report, index) in searchDatas.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>
<text class="status" :class="report.status ? 'submitted' : 'unsubmitted'"> <text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status ? '已提交' : '未提交' }} {{ report.status==='submitted' ? '已提交' : '未提交' }}
</text> </text>
</view> </view>
<text class="time">{{ report.date || '-' }}</text> <text class="time">{{ report.date || '-' }}</text>
</view> </view>
<!-- v-if="report.status" --> <view class="card-content" v-if="report.status==='submitted'">
<view class="card-content">
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">今日重点工作</text> <text class="work-title">今日重点工作</text>
</view> </view>
<view class="work-content">{{ report.today_work }}</view> <view class="work-content">{{ report.todayWork }}</view>
</view> </view>
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">本周重点工作</text> <text class="work-title">本周重点工作</text>
</view> </view>
<view class="work-content">{{ report.week_work }}</view> <view class="work-content">{{ report.weekWork }}</view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<!-- 分页器 -->
<view class="pagination">
<view class="page-btn" :class="{ disabled: pageNum <= 1 }" @click="prevPage">上一页</view>
<text class="page-info">{{pageNum}}/{{totalPages}} 页,共 {{totalCount}}</text>
<view class="page-btn" :class="{ disabled: !hasNextPage }" @click="nextPage">下一页</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import { import {
dailyReportSearch selectDailyReport
} from '../../api/apiList' } from '../../api/apiList'
import { import {
formatGMT formatGMT
...@@ -66,22 +58,10 @@ ...@@ -66,22 +58,10 @@
export default { export default {
data() { data() {
return { return {
pageNum: 1, staffCode: "",
pageSize: 5, staffKind: "",
hasNextPage: true, // 是否有下一页 searchDatas: {},
totalCount: 0, // 添加总条数
searchDatas: [],
stats: {
total: 20,
submitted: 15,
unsubmitted: 5
}
}
},
computed: {
// 计算总页数
totalPages() {
return Math.ceil(this.totalCount / this.pageSize)
} }
}, },
mounted() { mounted() {
...@@ -92,66 +72,23 @@ ...@@ -92,66 +72,23 @@
this.onReload() this.onReload()
}, },
methods: { methods: {
// 上一页 initData() {
prevPage() { this.staffCode = uni.getStorageSync(`staffCode`);
if (this.pageNum > 1) { this.staffKind = uni.getStorageSync(`uc_staff_kind`);
this.pageNum--
this.initData()
}
},
// 下一页 const data = {
nextPage() { "aux": {
if (this.hasNextPage) { "staffCode": this.staffCode,
this.pageNum++ "staffKind": this.staffKind
this.initData()
} }
},
initData() {
const {
pageNum,
pageSize
} = this
let data = {
"getTotalBy": "count",
"fields": [],
"keyword": {
"value": "",
"exact": false,
"partialMatchMode": "contain",
"caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"tableHeaderFilter": {
"relationDataset": "zcgyl_dailyreport_search__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": pageNum,
"pageSize": pageSize,
"aggregation": {}
} }
dailyReportSearch(data).then(res => { selectDailyReport(data).then(res => {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
}); });
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
const data = res.data.data.datas const data = res.data.data
this.totalCount = res.data.data.total // 获取总条数
// 判断是否还有下一页
this.hasNextPage = this.pageNum < this.totalPages
if (data.length > 0) {
data.map(item => {
item.date = formatGMT(item.date, 'T')
})
}
this.searchDatas = data this.searchDatas = data
...@@ -162,9 +99,6 @@ ...@@ -162,9 +99,6 @@
}, },
onReload() { onReload() {
this.pageNum = 1
this.totalCount = 0
this.hasNextPage = true
this.initData() this.initData()
} }
} }
...@@ -217,42 +151,9 @@ ...@@ -217,42 +151,9 @@
} }
} }
.pagination {
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
background: #fff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
.page-btn {
padding: 6px 15px;
background: #2E75E6;
color: #fff;
border-radius: 4px;
font-size: 14px;
&.disabled {
background: #ccc;
cursor: not-allowed;
}
}
.page-info {
margin: 0 20px;
font-size: 14px;
color: #666;
white-space: nowrap; // 防止文字换行
}
}
.report-list { .report-list {
// 移除固定高度设置,改用 template 中的 style 绑定 // 调整高度,移除分页器的空间
// height: calc(100vh - 120px); height: calc(100vh - 120px);
.report-card { .report-card {
display: block; display: block;
...@@ -310,7 +211,7 @@ ...@@ -310,7 +211,7 @@
border: 1px solid rgba(82, 196, 26, 0.2); border: 1px solid rgba(82, 196, 26, 0.2);
} }
&.unsubmitted { &.unSubmitted {
background: rgba(255, 77, 79, 0.1); background: rgba(255, 77, 79, 0.1);
color: #ff4d4f; color: #ff4d4f;
border: 1px solid rgba(255, 77, 79, 0.2); border: 1px solid rgba(255, 77, 79, 0.2);
......
...@@ -86,13 +86,30 @@ ...@@ -86,13 +86,30 @@
leaveOptions: ['是', '否'] leaveOptions: ['是', '否']
} }
}, },
onLoad() { created() {
const commonName = uni.getStorageSync('commonName') // 在组件创建时获取 commonName
if (commonName) { this.getCommonName();
this.formData.reporter = commonName },
mounted() {
// 如果 created 中没有获取到,在 mounted 中再次尝试
if (!this.formData.reporter) {
this.getCommonName();
} }
}, },
methods: { methods: {
getCommonName() {
const commonName = uni.getStorageSync('commonName');
console.log('获取到的commonName:', commonName);
if (commonName) {
this.formData.reporter = commonName;
} else {
console.warn('未获取到commonName');
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
});
}
},
dateChange(e) { dateChange(e) {
// 当用户选择新日期时,保留当前时间 // 当用户选择新日期时,保留当前时间
const selectedDate = e.detail.value const selectedDate = e.detail.value
......
...@@ -28,14 +28,6 @@ ...@@ -28,14 +28,6 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
},
{
"path": "pages/dailyReport/dailyReportCreate",
"style": {
"navigationBarTitleText": "填写日报",
"enablePullDownRefresh": false,
"disableScroll": true
}
} }
], ],
"subPackages": [{ "subPackages": [{
......
...@@ -3,63 +3,32 @@ ...@@ -3,63 +3,32 @@
<view class="top"> <view class="top">
<view v-for="item in isCarrier ? topCarrierList : topUserList" :key="item.key" @click="choiceItem(item.key)" <view v-for="item in topUserList" :key="item.key" @click="choiceItem(item.key)"
:class="['top-item', item.key === currentShow ? 'active' : '']"> :class="['top-item', item.key === currentShow ? 'active' : '']">
{{ item.name }} {{ item.name }}
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view v-if="currentShow === 'orderQuery'"> <view v-if="currentShow === 'orderQuery'">
<orderQueryContent></orderQueryContent> <orderQueryContent></orderQueryContent>
</view> </view>
<view v-if="currentShow === 'dailyReport'"> <view v-if="currentShow === 'dailyReport'">
<dailyReport></dailyReport> <dailyReport></dailyReport>
</view> </view>
<view v-if="currentShow === 'bossCard' && uc_simulated_boss"> <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 === 'orderCreate'"> <dailyReportCreate></dailyReportCreate>
<scroll-view scroll-y="true" style="height: calc(100vh - 50px);">
<orderInsertContent></orderInsertContent>
</scroll-view>
</view>
<view v-if="currentShow === 'orderImport'">
<orderImportContent></orderImportContent>
</view>
<view v-if="currentShow === 'bill'">
<scroll-view scroll-y="true" style="height: calc(100vh - 50px);">
<billContent></billContent>
</scroll-view>
</view>
<view v-if="currentShow === 'invoice'">
<scroll-view scroll-y="true" style="height: calc(100vh - 50px);">
<invoiceContent></invoiceContent>
</scroll-view>
</view>
<!-- 承运商 -->
<view v-if="currentShow === 'wayBillQuery'">
<wayBillQuery></wayBillQuery>
</view>
<view v-if="currentShow === 'wayTransit'">
<wayTransit></wayTransit>
</view> </view>
<view v-if="currentShow === 'wayInvoice'">
<wayInvoice></wayInvoice>
</view> </view>
<view v-if="currentShow === 'wayDashboard'">
<wayDashboard></wayDashboard>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import bossCard from '@/components/bossCard/bossCard.vue'
import dailyReport from '@/components/dailyReport/dailyReport.vue'
import { import {
GetBindCompanyResult, GetBindCompanyResult,
GetBindCompanyInfo, GetBindCompanyInfo,
...@@ -77,70 +46,47 @@ ...@@ -77,70 +46,47 @@
data() { data() {
return { return {
isCarrier: false, isCarrier: false,
uc_simulated_boss:false, uc_staff_kind: '',
currentShow: '', currentShow: '',
topUserList: [{ topUserList: [{
name: '订单查询', name: '订单查询',
key: 'orderQuery', key: 'orderQuery',
url: '/pages/index/index' url: '/pages/index/index'
}, },
// {
// name: '订单创建',
// key: 'orderCreate',
// url: '/pages/index/index'
// },
// {
// name: '订单导入',
// key: 'orderImport',
// url: '/pages/index/index'
// }, {
// name: '账单',
// key: 'bill',
// url: '/pages/index/index'
// },
{ {
name: '查看日报', name: '查看日报',
key: 'dailyReport', key: 'dailyReport',
url: '/pages/index/index' url: '/pages/index/index'
}, {
name: '填写日报',
key: 'dailyReportCreate',
url: '/pages/index/index'
}, { }, {
name: '老板看板', name: '老板看板',
key: 'bossCard', key: 'bossCard',
url: '/pages/index/index' url: '/pages/index/index'
}, },
// {
// name: '发票',
// key: 'invoice',
// url: '/pages/index/index'
// },
],
topCarrierList: [{
name: '运单查询',
key: 'wayBillQuery',
url: '/pages/index/index'
},
{
name: '在途导入',
key: 'wayTransit',
url: '/pages/index/index'
},
{
name: '月度账单',
key: 'wayInvoice',
url: '/pages/index/index'
},
{
name: '统计看板',
key: 'wayDashboard',
url: '/pages/index/index'
},
] ]
}; }
}, },
onLoad() { onLoad() {
console.log('index页面加载'); // 调试日志
this.getUserInfo() this.getUserInfo()
this.getBindCompanyResult() this.getBindCompanyResult()
this.bindGroupChatCompany() this.bindGroupChatCompany()
},
onShow() {
uni.$on('executeChoiceItem', (component) => {
console.log('收到切换组件事件:', component); // 调试日志
this.choiceItem(component);
});
},
onUnload() {
uni.$off('executeChoiceItem');
}, },
methods: { methods: {
...@@ -191,7 +137,7 @@ ...@@ -191,7 +137,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)
this.userInfo = { this.userInfo = {
...data ...data
} }
...@@ -203,8 +149,8 @@ ...@@ -203,8 +149,8 @@
selectStaffByUsername(staffData).then(res => { selectStaffByUsername(staffData).then(res => {
let data2 = res.data.data let data2 = res.data.data
uni.setStorageSync(`staffCode`, data2.staffCode); uni.setStorageSync(`staffCode`, data2.staffCode);
this.uc_simulated_boss=data2.uc_staff_kind this.uc_staff_kind = data2.uc_staff_kind
uni.setStorageSync(`uc_simulated_boss`, data2.uc_staff_kind); uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
}) })
// if (this.isCarrier) { // if (this.isCarrier) {
...@@ -213,8 +159,12 @@ ...@@ -213,8 +159,12 @@
}) })
}, },
choiceItem(key) { choiceItem(item) {
this.currentShow = key; console.log('执行choiceItem方法:', item); // 调试日志
this.currentShow = item;
this.$nextTick(() => {
console.log('视图更新后的currentShow:', this.currentShow);
});
}, },
getBindCompanyResult() { getBindCompanyResult() {
......
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