From 2ed3ad168181ecf0a3cc05426791a960ad9dc9c8 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 22 九月 2025 13:20:47 +0800
Subject: [PATCH] 添加查看工资页面
---
pages.json | 7
pages/gongxuOut/moneystatistics.vue | 487 +++++++++++++++++++++++++++++++++++------------------
pages/index/mine.vue | 6
3 files changed, 333 insertions(+), 167 deletions(-)
diff --git a/pages.json b/pages.json
index 9278ef0..0fc05c8 100644
--- a/pages.json
+++ b/pages.json
@@ -188,6 +188,13 @@
"enablePullDownRefresh": true
}
},
+ {
+ "path": "pages/gongxuOut/moneystatistics",
+ "style": {
+ "navigationBarTitleText": "鎴戠殑宸ヨ祫(姹囨姤棰勪及)",
+ "enablePullDownRefresh": true
+ }
+ },
{
"path": "pages/shebeiguanli/form",
"style": {
diff --git a/pages/gongxuOut/moneystatistics.vue b/pages/gongxuOut/moneystatistics.vue
index 0f107a2..1e0fec2 100644
--- a/pages/gongxuOut/moneystatistics.vue
+++ b/pages/gongxuOut/moneystatistics.vue
@@ -1,151 +1,190 @@
<template>
<view class="content">
<view class="form">
- <view class="form-item">
+ <!-- <view class="form-item">
<view class="title">鏈堜唤:</view>
<view class="right">
- <picker :range="arrayHMonth" :value="hform.HMonth" @change="HMonthChange">
- <input name="HMonth" disabled :value="hform.HMonth" placeholder="璇烽�夋嫨鏈堜唤" />
- </picker>
+ <uni-combox :candidates="arrayHMonth" placeholder="璇烽�夋嫨鏈堜唤" v-model="hform.HMonth"
+ ></uni-combox>
</view>
- </view>
- <view class="form-item">
+ </view> -->
+ <view class="form-item" v-show="false">
<view class="title">鎿嶄綔鍛�:</view>
<view class="right">
- <picker :range="arrayHEmp" :value="hform.HEmp" @change="HEmpChange">
+ <picker :range="arrayHEmpName" :value="hform.HEmp" disabled>
<input name="HEmp" disabled :value="hform.HEmp" placeholder="璇烽�夋嫨" style="pointer-events: none;"/>
</picker>
</view>
</view>
<view class="buttons">
- <button class="btn-a" size="mini" type="default" @tap="clear">閲嶇疆</button>
- <button class="btn-c" size="mini" type="default" @tap="search">鏌ヨ</button>
+ <!-- <button class="btn-a" size="mini" type="default" @tap="clear">閲嶇疆</button> -->
+ <!-- <button class="btn-c" size="mini" type="default" @tap="search">鏌ヨ</button> -->
</view>
</view>
<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
<view class="tabs">
- <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">姹囨姤鍚堣</view>
- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">鏄庣粏淇℃伅</view>
+ <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">姹囨姤鍚堣(鎿嶄綔鍛�:{{hform.HEmp}})</view>
+ <!-- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">鏄庣粏淇℃伅</view> -->
</view>
- <view class="list" v-for="(item,index) in showList" :key="index">
- <uni-card :title="item.浠诲姟鍗�" :extra="item.鍗曟嵁鍙�" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
- <view class="card-detail">
- <view class="detail" v-if="item.宸ュ簭娴佽浆鍗″彿">
- <text>娴佽浆鍗″彿锛�</text>{{item.宸ュ簭娴佽浆鍗″彿}}
+ <view v-if="tabs == 0">
+ <view class="list" v-for="(item,index) in moneyList" :key="index">
+ <uni-card title="鏈堜唤" :extra="item.month" style="margin: 10px;">
+ <view class="card-detail">
+ <view class="detail" >
+ <text>鎬诲崟閲忥細</text>{{item.HBillQty}}
+ </view>
+ <view class="detail" >
+ <text>鎬诲嚭绔欐暟閲忥細</text>{{item.HOutQty}}
+ </view>
+ <view class="detail" >
+ <text>鎬昏浠跺嚭绔欐暟閲忥細</text>{{item.HPieceBillQty}}
+ </view>
+ <view class="detail" >
+ <text>鎬婚浼拌浠堕噾棰濓細</text>{{item.HMoney}}
+ </view>
+ <view class="detail" >
+ <text>璁℃椂鍗曢噺锛�</text>{{item.HTimingBillQty}}
+ </view>
+ <view class="detail" >
+ <text>鎬昏鏃讹細</text>{{item.HTime}}
+ </view>
</view>
- <view class="detail" v-if="item.浜у搧鍚嶇О">
- <text>浜у搧鍚嶇О锛�</text>{{item.浜у搧鍚嶇О}}
+ </uni-card>
+ </view>
+ </view>
+ <!-- <view v-if="tabs == 1">
+ <view class="list" v-for="(item,index) in showList" :key="index">
+ <uni-card :title="item.浠诲姟鍗�" :extra="item.鍗曟嵁鍙�" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
+ <view class="card-detail">
+ <view class="detail" v-if="item.宸ュ簭娴佽浆鍗″彿">
+ <text>娴佽浆鍗″彿锛�</text>{{item.宸ュ簭娴佽浆鍗″彿}}
+ </view>
+ <view class="detail" v-if="item.浜у搧鍚嶇О">
+ <text>浜у搧鍚嶇О锛�</text>{{item.浜у搧鍚嶇О}}
+ </view>
+ <view class="detail" v-if="item.浜у搧浠g爜">
+ <text>浜у搧浠g爜锛�</text>{{item.浜у搧浠g爜}}
+ </view>
+ <view class="detail" v-if="item.娆惧彿">
+ <text>娆惧彿锛�</text>{{item.娆惧彿}}
+ </view>
+ <view class="detail" v-if="item.褰撳墠宸ュ簭">
+ <text>褰撳墠宸ュ簭锛�</text>{{item.褰撳墠宸ュ簭}}
+ </view>
+ <view class="detail" v-if="item.褰撳墠宸ュ簭浠g爜">
+ <text>宸ュ簭浠g爜锛�</text>{{item.褰撳墠宸ュ簭浠g爜}}
+ </view>
+ <view class="detail" v-if="item.鏃ユ湡">
+ <text>鏃ユ湡锛�</text>{{item.鏃ユ湡.substr(0,10)}}
+ </view>
+ <!-- <view class="detail" v-if="item.璁′欢閲戦">
+ <text>璁′欢閲戦锛�</text>{{item.璁′欢閲戦}}
+ </view>
+ <view class="detail" v-if="item.璁′欢鍗曚环">
+ <text>璁′欢鍗曚环锛�</text>{{item.璁′欢鍗曚环}}
+ </view> -->
+ <!-- <view class="detail" v-if="item.宸ユ椂">
+ <text>宸ユ椂锛�</text>{{item.宸ユ椂}}
+ </view>
+ <view class="detail" v-if="item.鏄惁璁℃椂">
+ <text>鏄惁璁℃椂锛�</text>{{item.鏄惁璁℃椂}}
+ </view>
</view>
- <view class="detail" v-if="item.浜у搧浠g爜">
- <text>浜у搧浠g爜锛�</text>{{item.浜у搧浠g爜}}
- </view>
- <view class="detail" v-if="item.娆惧彿">
- <text>娆惧彿锛�</text>{{item.娆惧彿}}
- </view>
- <view class="detail" v-if="item.褰撳墠宸ュ簭">
- <text>褰撳墠宸ュ簭锛�</text>{{item.褰撳墠宸ュ簭}}
- </view>
- <view class="detail" v-if="item.褰撳墠宸ュ簭浠g爜">
- <text>宸ュ簭浠g爜锛�</text>{{item.褰撳墠宸ュ簭浠g爜}}
- </view>
- <view class="detail" v-if="item.鏃ユ湡">
- <text>鏃ユ湡锛�</text>{{item.鏃ユ湡.substr(0,10)}}
- </view>
- </view>
- <view class="card-detail" v-if="showDetail == index">
- <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
- <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
- </view>
- <view class="detail" v-if="item.娴佹按鍙�">
- <text>娴佹按鍙凤細</text>{{item.娴佹按鍙穧}
- </view>
- <view class="detail" v-if="item.鍑虹珯鏁伴噺">
- <text>鍑虹珯鏁伴噺锛�</text>{{item.鍑虹珯鏁伴噺}}
- </view>
- <view class="detail" v-if="item.涓嶈壇鏁伴噺">
- <text>涓嶈壇鏁伴噺锛�</text>{{item.涓嶈壇鏁伴噺}}
- </view>
- <view class="detail" v-if="item.鎶ュ簾鏁伴噺">
- <text>鎶ュ簾鏁伴噺锛�</text>{{item.鎶ュ簾鏁伴噺}}
- </view>
- <view class="detail" v-if="item.鍖呰鏍囪瘑">
- <text>鍖呰鏍囪瘑锛�</text>{{item.鍖呰鏍囪瘑}}
- </view>
- <view class="detail" v-if="item.鍖呰鏍囪瘑浠g爜">
- <text>鍖呰鏍囪瘑浠g爜锛�</text>{{item.鍖呰鏍囪瘑浠g爜}}
- </view>
- <view class="detail" v-if="item.鍑虹珯鏃堕棿">
- <text>鍑虹珯鏃堕棿锛�</text>{{item.鍑虹珯鏃堕棿.substr(0,19)}}
+ <view class="card-detail" v-if="showDetail == index">
+ <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
+ <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
+ </view>
+ <view class="detail" v-if="item.娴佹按鍙�">
+ <text>娴佹按鍙凤細</text>{{item.娴佹按鍙穧}
+ </view>
+ <view class="detail" v-if="item.鍑虹珯鏁伴噺">
+ <text>鍑虹珯鏁伴噺锛�</text>{{item.鍑虹珯鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.涓嶈壇鏁伴噺">
+ <text>涓嶈壇鏁伴噺锛�</text>{{item.涓嶈壇鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.鎶ュ簾鏁伴噺">
+ <text>鎶ュ簾鏁伴噺锛�</text>{{item.鎶ュ簾鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.鍖呰鏍囪瘑">
+ <text>鍖呰鏍囪瘑锛�</text>{{item.鍖呰鏍囪瘑}}
+ </view>
+ <view class="detail" v-if="item.鍖呰鏍囪瘑浠g爜">
+ <text>鍖呰鏍囪瘑浠g爜锛�</text>{{item.鍖呰鏍囪瘑浠g爜}}
+ </view>
+ <view class="detail" v-if="item.鍑虹珯鏃堕棿">
+ <text>鍑虹珯鏃堕棿锛�</text>{{item.鍑虹珯鏃堕棿.substr(0,19)}}
+ </view>
+
+ <view class="detail" v-if="item.鎿嶄綔鍛�">
+ <text>鎿嶄綔鍛橈細</text>{{item.鎿嶄綔鍛榼}
+ </view>
+ <view class="detail" v-if="item.鎿嶄綔鍛樹唬鐮�">
+ <text>鎿嶄綔鍛樹唬鐮侊細</text>{{item.鎿嶄綔鍛樹唬鐮亇}
+ </view>
+ <view class="detail" v-if="item.鐢熶骇璧勬簮">
+ <text>鐢熶骇璧勬簮锛�</text>{{item.鐢熶骇璧勬簮}}
+ </view>
+ <view class="detail" v-if="item.鐢熶骇璧勬簮浠g爜">
+ <text>鐢熶骇璧勬簮浠g爜锛�</text>{{item.鐢熶骇璧勬簮浠g爜}}
+ </view>
+ <view class="detail" v-if="item.鐢熶骇鐝粍">
+ <text>鐢熶骇鐝粍锛�</text>{{item.鐢熶骇鐝粍}}
+ </view>
+ <view class="detail" v-if="item.鐢熶骇鐝粍浠g爜">
+ <text>鐢熶骇鐝粍浠g爜锛�</text>{{item.鐢熶骇鐝粍浠g爜}}
+ </view>
+ <view class="detail" v-if="item.LOT鏁伴噺">
+ <text>LOT鏁伴噺锛�</text>{{item.LOT鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.鍒跺崟浜�">
+ <text>鍒跺崟浜猴細</text>{{item.鍒跺崟浜簘}
+ </view>
+ <view class="detail" v-if="item.鍒跺崟鏃ユ湡">
+ <text>鍒跺崟鏃ユ湡锛�</text>{{item.鍒跺崟鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.淇敼浜�">
+ <text>淇敼浜猴細</text>{{item.淇敼浜簘}
+ </view>
+ <view class="detail" v-if="item.淇敼鏃ユ湡">
+ <text>淇敼鏃ユ湡锛�</text>{{item.淇敼鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.瀹℃牳浜�">
+ <text>瀹℃牳浜猴細</text>{{item.瀹℃牳浜簘}
+ </view>
+ <view class="detail" v-if="item.瀹℃牳鏃ユ湡">
+ <text>瀹℃牳鏃ユ湡锛�</text>{{item.瀹℃牳鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.鍏抽棴浜�">
+ <text>鍏抽棴浜猴細</text>{{item.鍏抽棴浜簘}
+ </view>
+ <view class="detail" v-if="item.鍏抽棴鏃ユ湡">
+ <text>鍏抽棴鏃ユ湡锛�</text>{{item.鍏抽棴鏃ユ湡.substr(0,10)}}
+ </view>
+ <view class="detail" v-if="item.澶囨敞">
+ <text>澶囨敞锛�</text>{{item.澶囨敞}}
+ </view>
</view>
- <view class="detail" v-if="item.鎿嶄綔鍛�">
- <text>鎿嶄綔鍛橈細</text>{{item.鎿嶄綔鍛榼}
+ <view class="more" v-if="showDetail == index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏀惰捣
+ </view>
</view>
- <view class="detail" v-if="item.鎿嶄綔鍛樹唬鐮�">
- <text>鎿嶄綔鍛樹唬鐮侊細</text>{{item.鎿嶄綔鍛樹唬鐮亇}
+ <view class="more" v-if="showDetail != index">
+ <view class="part" style="border-right: 1px solid #eee;">
+ <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏇村淇℃伅
+ </view>
</view>
- <view class="detail" v-if="item.鐢熶骇璧勬簮">
- <text>鐢熶骇璧勬簮锛�</text>{{item.鐢熶骇璧勬簮}}
- </view>
- <view class="detail" v-if="item.鐢熶骇璧勬簮浠g爜">
- <text>鐢熶骇璧勬簮浠g爜锛�</text>{{item.鐢熶骇璧勬簮浠g爜}}
- </view>
- <view class="detail" v-if="item.鐢熶骇鐝粍">
- <text>鐢熶骇鐝粍锛�</text>{{item.鐢熶骇鐝粍}}
- </view>
- <view class="detail" v-if="item.鐢熶骇鐝粍浠g爜">
- <text>鐢熶骇鐝粍浠g爜锛�</text>{{item.鐢熶骇鐝粍浠g爜}}
- </view>
- <view class="detail" v-if="item.LOT鏁伴噺">
- <text>LOT鏁伴噺锛�</text>{{item.LOT鏁伴噺}}
- </view>
- <view class="detail" v-if="item.鍒跺崟浜�">
- <text>鍒跺崟浜猴細</text>{{item.鍒跺崟浜簘}
- </view>
- <view class="detail" v-if="item.鍒跺崟鏃ユ湡">
- <text>鍒跺崟鏃ユ湡锛�</text>{{item.鍒跺崟鏃ユ湡.substr(0,10)}}
- </view>
- <view class="detail" v-if="item.淇敼浜�">
- <text>淇敼浜猴細</text>{{item.淇敼浜簘}
- </view>
- <view class="detail" v-if="item.淇敼鏃ユ湡">
- <text>淇敼鏃ユ湡锛�</text>{{item.淇敼鏃ユ湡.substr(0,10)}}
- </view>
- <view class="detail" v-if="item.瀹℃牳浜�">
- <text>瀹℃牳浜猴細</text>{{item.瀹℃牳浜簘}
- </view>
- <view class="detail" v-if="item.瀹℃牳鏃ユ湡">
- <text>瀹℃牳鏃ユ湡锛�</text>{{item.瀹℃牳鏃ユ湡.substr(0,10)}}
- </view>
- <view class="detail" v-if="item.鍏抽棴浜�">
- <text>鍏抽棴浜猴細</text>{{item.鍏抽棴浜簘}
- </view>
- <view class="detail" v-if="item.鍏抽棴鏃ユ湡">
- <text>鍏抽棴鏃ユ湡锛�</text>{{item.鍏抽棴鏃ユ湡.substr(0,10)}}
- </view>
- <view class="detail" v-if="item.澶囨敞">
- <text>澶囨敞锛�</text>{{item.澶囨敞}}
- </view>
- </view>
-
- <view class="more" v-if="showDetail == index && operations != index">
- <view class="part" style="border-right: 1px solid #eee;">
- <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏀惰捣
- </view>
- </view>
- <view class="more" v-if="showDetail != index && operations != index">
- <view class="part" style="border-right: 1px solid #eee;">
- <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>鏇村淇℃伅
- </view>
- </view>
-
- </uni-card>
- </view>
+
+ </uni-card>
+ </view>
+ <view class="over" v-if="listData.length == 0">鏆傛棤鏁版嵁</view>
+ <view class="over" v-if="listData.length != 0 && listData.length != showList.length">鍔犺浇涓�...</view>
+ <view class="over" v-if="listData.length != 0 && listData.length == showList.length">宸插埌搴�</view>
+ </view> -->
- <view class="over" v-if="listData.length == 0">鏆傛棤鏁版嵁</view>
- <view class="over" v-if="listData.length != 0 && listData.length != showList.length">鍔犺浇涓�...</view>
- <view class="over" v-if="listData.length != 0 && listData.length == showList.length">宸插埌搴�</view>
</view>
</template>
@@ -156,38 +195,44 @@
return {
userInfo:getUserInfo(),
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
- showmore:false,
arrayHEmpName: [], //鎺ユ敹浜�
HEmpNameList: [],
+ arrayHMonth:[1,2,3,4,5,6,7,8,9,11,12],
+ tabs:0,
hform:{
- HMonth:'',
+ HMonth:new Date().getMonth()+1,
HEmp:'',
+ HEmpID:0,
},
sWhere:'',
+ moneyList:[],
listData:[],
showList:[],
showDetail:-1,
- operations:-1,
page:1,
}
},
onLoad() {
- this.getList()
this.getHEmpList()
+ this.getDefValByUser()
+
+ setTimeout(()=>{this.search();},200);
+
// console.log(this.userInfo,uni.getStorageSync('HUserName'))
},
onReachBottom: function() {
- this.page++
- setTimeout(() => {
- this.showList = this.showList.concat(this.getPage(this.page,this.listData))
- }, 100)
+ // this.page++
+ // setTimeout(() => {
+ // this.showList = this.showList.concat(this.getPage(this.page,this.listData))
+ // }, 100)
},
onPullDownRefresh: function() {
- this.clear()
+ //this.clear()
setTimeout(()=>{
uni.stopPullDownRefresh();
}, 1000);
+ this.search();
},
methods: {
getPage(page,list){
@@ -197,7 +242,7 @@
return newList
},
getList(){
- this.sWhere += ` and 鍒跺崟浜� like N'%${this.userInfo.Czymc}'`
+ //this.sWhere += ` and 鍒跺崟浜� like N'%${this.userInfo.Czymc}'`
uni.showLoading({
title:'鍔犺浇涓�...'
})
@@ -213,6 +258,7 @@
if(res.data.count == 1){
this.listData = res.data.data
this.showList = this.getPage(this.page,this.listData)
+ this.moneyList=this.getSumMoney();
setTimeout(()=>{
uni.hideLoading()
}, 1000)
@@ -243,48 +289,155 @@
this.showList = []
console.log(this.hform)
-
+ this.sWhere +=" and HEmpID = " + this.hform.HEmpID
+ this.sWhere +=" and YEAR(鏃ユ湡) = "+ new Date().getFullYear();
this.getList()
},
- //鏂板
- creat(){
- uni.navigateTo({
- url:'/pages/gongxuOut/form'
- })
+ //鎿嶄綔鍛樼瓑
+ getHEmpList() {
+ uni.request({
+ url: this.serverUrl + '/Web/GetEmployeeList_Json',
+ data: {
+ Employee: '',
+ HGroupID: 0
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.HEmpNameList = res.data.data
+ for (var i = 0; i < res.data.data.length; i++) {
+ this.arrayHEmpName[i] = res.data.data[i].HName
+ }
+ this.$forceUpdate();
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
},
- //閲嶇疆
- clear(){
- this.listData = []
- this.page = 1
- this.showList = []
-
- this.showmore = false
- this.sWhere = ''
- this.showDetail = -1,
- this.operations = -1,
- this.hform = {
- HStatus:'鍏ㄩ儴',
- HBeginDate:'',
- HEndDate:'',
- HWorkBillNo:'',
- HBillNo:'',
- HProcExchBillNo:'',
- HNumber:'',
- HName:'',
- checkHWasterQty:'',
-
- ColName:'',
- Comparator:'',
- ColContent:'',
- }
- this.getList()
+ //閫氳繃鐧诲綍鐢ㄦ埛鑾峰彇榛樿鍊�
+ getDefValByUser() {
+ uni.request({
+ url: this.serverUrl + '/Cj_StationInBill/GetDefValByUser',
+ type: "GET",
+ async: false,
+ data: {
+ "Czybm": this.userInfo.Czybm,
+ "Czymc": this.userInfo.Czymc
+ },
+ success: (res) => {
+ // console.log(res.data)
+ if (res.data.count == 1) {
+ var data = res.data.data[0]
+ this.hform.HEmp = data.鎿嶄綔鍛樺悕绉�
+ this.hform.HEmpID = data.HEmpID
+ } else {
+ uni.showToast({
+ title: '鑾峰彇鐢熶骇鐝粍淇℃伅澶辫触',
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鑾峰彇鐢熶骇鐝粍淇℃伅澶辫触',
+ icon: 'none'
+ })
+ },
+ });
},
-
- }
+ //璁$畻宸ヨ祫
+ getSumMoney(){
+ // 鍒濆鍖栫粨鏋滄暟缁勶紝12涓湀鐨勬暟鎹�
+ const monthlyData = Array(12).fill().map(() => ({
+ month: 0, // 鏈堜唤锛�1-12
+ HBillQty: 0, // 鎬诲崟閲�
+ HOutQty:0,//鎬诲嚭绔欐暟閲�
+ HPieceBillQty: 0, // 鎬诲嚭绔欐暟閲�
+ HTimingBillQty: 0, // 璁℃椂鍗曢噺
+ HMoney: 0, // 鎬婚噾棰�
+ HTime: 0 // 鎬昏鏃�
+ }));
+
+ const currentYear = new Date().getFullYear();
+ const currentMonth = new Date().getMonth() + 1; // JavaScript鏈堜唤鏄�0-11
+
+ // 鍒濆鍖栨暟缁勶紝浠庡綋鍓嶆湀寮�濮嬪線鍓嶅�掓暟12涓湀
+ for (let i = 0; i < 12; i++) {
+ const monthIndex = (currentMonth - 1 - i + 12) % 12;
+ monthlyData[i].month = (monthIndex + 1); // 杞崲涓�1-12鏈堜唤
+ }
+
+ this.listData.forEach(item => {
+ const itemDate = new Date(item.鏃ユ湡); // 鍋囪鏈夋棩鏈熷瓧娈碉紝鏍规嵁瀹為檯鏁版嵁璋冩暣
+ const itemYear = itemDate.getFullYear();
+ const itemMonth = itemDate.getMonth() + 1;
+
+ // 鍙鐞嗕粖骞寸殑鏁版嵁
+ if (itemYear === currentYear) {
+ // 璁$畻杩欎釜鏁版嵁搴旇灞炰簬鏁扮粍涓殑鍝釜浣嶇疆锛堜粠褰撴湀寮�濮嬪線鍓嶆暟锛�
+ const monthDiff = (currentMonth - itemMonth + 12) % 12;
+ const dataIndex = monthDiff;
+
+ // 鏇存柊缁熻鏁版嵁
+ monthlyData[dataIndex].HBillQty++;
+ monthlyData[dataIndex].HOutQty+=item.鍑虹珯鏁伴噺 || 0;
+ if (item.鏄惁璁℃椂 === "鍚�") {
+ monthlyData[dataIndex].HPieceBillQty += item.鍑虹珯鏁伴噺 || 0;
+ monthlyData[dataIndex].HMoney += item.璁′欢閲戦 || 0;
+ } else {
+ monthlyData[dataIndex].HTimingBillQty++;
+ monthlyData[dataIndex].HTime += item.宸ユ椂 || 0;
+ }
+ }
+ });
+
+ // 鏍煎紡鍖栭噾棰濅负涓や綅灏忔暟
+ monthlyData.forEach(item => {
+ item.HMoney = parseFloat(item.HMoney.toFixed(2));
+ });
+
+ // **杩囨护鎺夋�诲崟閲忎负0鐨勬湀浠�**
+ const filteredData = monthlyData.filter(item => item.HBillQty > 0);
+
+ // **濡傛灉甯屾湜浠嶇劧杩斿洖12涓湀锛堝嵆浣挎煇浜涙湀浠戒负0锛夛紝鍒欏幓鎺変笂闈㈢殑 filter**
+ return filteredData;
+ }
+ }
}
</script>
<style lang="scss" scoped>
+ .tabs {
+ width: 100%;
+ display: flex;
+ border-bottom: 1px solid #ddd;
+ margin: 20rpx 0;
+
+ view {
+ width: 100%;
+ font-size: 30rpx;
+ color: #555;
+ text-align: center;
+ padding: 16rpx 0;
+ }
+
+ .on {
+ color: #3a78ff;
+ font-weight: bold;
+ border-bottom: 3px solid #3a78ff;
+ }
+ }
.form{
width: 640rpx;
margin: 20rpx auto;
@@ -378,7 +531,7 @@
line-height: 120%;
.detail{
// width: 50%;
- font-size: 26rpx;
+ font-size: 30rpx;
margin-bottom: 12rpx;
color: #555;
margin-right: 20rpx;
diff --git a/pages/index/mine.vue b/pages/index/mine.vue
index fa5b753..736388b 100644
--- a/pages/index/mine.vue
+++ b/pages/index/mine.vue
@@ -59,6 +59,12 @@
text:'淇敼瀵嗙爜',
url:'/pages/xiugaimima/index',
id:4
+ },
+ {
+ img:'../../static/icon05.png',
+ text:'鎴戠殑宸ヨ祫锛堥浼帮級',
+ url:'/pages/gongxuOut/moneystatistics',
+ id:4
}
]
}
--
Gitblit v1.9.1