Commit a23aa2ca authored by 刘杰's avatar 刘杰

企业微信前端

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