shish 1 год назад
Родитель
Сommit
d882fa818e

+ 1 - 4
ghsApp/src/admin/expend/bxList.vue

@@ -1,8 +1,5 @@
 <template>
 <view class="app-content">
-	<view class="top-bar" style="margin:20upx 0 20upx 40upx;">
-		<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
-	</view>
 	<block v-if="!$util.isEmpty(bxList)">
 		<view v-for="(item, index) in bxList" :key="index">
 			<view style="background-color: white;margin-bottom:15upx;padding:20upx 0 20upx 20upx;">
@@ -12,7 +9,7 @@
 					<view><text>已报销:¥{{ item.hasAmount }}</text></view>
 					<view><text>待报销:¥{{ item.amount }}</text></view>
 				</view>
-				<button v-if="1==0" @tap="confirmBx(index,item.amount)" class="admin-button-com blue middle">确认报销</button>
+				<button @tap="confirmBx(index,item.amount)" class="admin-button-com blue middle">确认报销</button>
 			</view>
 		</view>
 	</block>

+ 13 - 6
ghsApp/src/admin/expend/list.vue

@@ -21,8 +21,8 @@
 				<view style="margin-top:8upx;">付款:<text>{{item.staffName?item.staffName:''}}</text></view>
 				<view style="margin-top:8upx;">时间:{{ item.addTime.substr(5,11) }}</view>
 				<view style="margin-top:8upx;">支付:{{item.payWay==0?'线下微信':item.payWay == 4 ? '现金':item.payWay == 1?'线下支付宝':item.payWay == 5 ? '银行卡':''}}</view>
-				<view v-if="item.bx == 0" style="color:blue;margin-top:8upx;">报销:待报销</view>
-				<view v-else style="color:green;margin-top:8upx;">报销:已报销</view>
+				<view v-if="item.bx == 0" style="margin-top:8upx;">报销:待报销</view>
+				<view v-else style="margin-top:8upx;">报销:已报销</view>
 			</view>
 		</view>
 	</block>
@@ -30,11 +30,12 @@
 		<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 	</block>
 	<view class="app-footer open_btn">
-		<text style="margin-right:80upx;color:blue;font-size:34upx;" @click="goToBxList()">汇总统计</text>
-		<view @click="addExpend" class="admin-button-com big blue" style="width:230upx;">新增支出</view>
+		<text style="margin-right:30upx;color:blue;font-size:34upx;" @click="goToStat()">汇总统计</text>
+		<text style="margin-right:30upx;color:blue;font-size:34upx;" @click="goToMayBx()">应报销</text>
+		<text style="margin-right:30upx;color:blue;font-size:34upx;" @click="goToBxList()">报销记录</text>
+		<view @click="addExpend" class="admin-button-com big blue" style="width:210upx;">新增支出</view>
 	</view>
 
-
 	<uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
 		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
 			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
@@ -112,9 +113,15 @@ export default {
 			this.resetList();
 			this.init()
 		},
+		goToStat(){
+			this.$util.pageTo({ url: "/admin/expend/stat"})
+		},
 		goToBxList(){
 			this.$util.pageTo({ url: "/admin/expend/bxList"})
-		 },
+		},
+		goToMayBx(){
+			this.$util.pageTo({ url: "/admin/expend/mayBx"})
+		},
 		changePayMan(){
 			this.$refs.payShowMore.open('top')
 		},

+ 70 - 0
ghsApp/src/admin/expend/mayBx.vue

@@ -0,0 +1,70 @@
+<template>
+<view class="app-content">
+	<block v-if="!$util.isEmpty(bxList)">
+		<view v-for="(item, index) in bxList" :key="index">
+			<view style="background-color: white;margin-bottom:15upx;padding:20upx 0 20upx 20upx;">
+				<view style="font-size:33upx;margin-bottom:20upx;">
+					<view><text style="font-weight:bold;">{{item.staffName?item.staffName:''}}</text></view>
+					<view><text>总支出:¥{{ item.totalAmount }}</text></view>
+					<view><text>已报销:¥{{ item.hasAmount }}</text></view>
+					<view><text>待报销:¥{{ item.amount }}</text></view>
+				</view>
+				<button @tap="confirmBx(index,item.amount)" class="admin-button-com blue middle">确认报销</button>
+			</view>
+		</view>
+	</block>
+	<block v-else>
+		<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(bxList)" />
+	</block>
+</view>
+</template>
+
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getUnBxList,bx } from '@/api/expend'
+import DateSelect from "@/components/module/dateSelect"
+export default {
+	name: "bxList",
+	components: {
+		AppWrapperEmpty,
+		DateSelect
+	},
+	mixins:[],
+	data() {
+		return {
+			bxList:[],
+			searchTime:'',
+			startTime:'',
+			endTime:''
+		};
+	},
+	methods: {
+		selectDateFn(val) {
+			this.searchTime = val.searchTime
+			this.startTime = val.startTime
+			this.endTime = val.endTime
+			this.init()
+		},
+		confirmBx(staffId,amount){
+			let that = this
+			that.$util.confirmModal({content:'确认已报销?'},() => {
+				bx({staffId,amount}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+						that.init()
+					}
+				})
+        	})
+		},
+		init(){
+			getUnBxList({searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime}).then(res=>{
+				if(res.code == 1){
+					this.bxList = res.data.list ? res.data.list : []
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 71 - 0
ghsApp/src/admin/expend/stat.vue

@@ -0,0 +1,71 @@
+<template>
+<view class="app-content">
+	<view class="top-bar" style="margin:20upx 0 20upx 40upx;padding-top:30upx;">
+		<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
+	</view>
+	<block v-if="!$util.isEmpty(bxList)">
+		<view v-for="(item, index) in bxList" :key="index">
+			<view style="background-color: white;margin-bottom:15upx;padding:20upx 0 20upx 20upx;">
+				<view style="font-size:33upx;margin-bottom:20upx;">
+					<view><text style="font-weight:bold;">{{item.staffName?item.staffName:''}}</text></view>
+					<view><text>总支出:¥{{ item.totalAmount }}</text></view>
+					<view><text>已报销:¥{{ item.hasAmount }}</text></view>
+					<view><text>待报销:¥{{ item.amount }}</text></view>
+				</view>
+			</view>
+		</view>
+	</block>
+	<block v-else>
+		<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(bxList)" />
+	</block>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getUnBxList,bx } from '@/api/expend'
+import DateSelect from "@/components/module/dateSelect"
+export default {
+	name: "bxList",
+	components: {
+		AppWrapperEmpty,
+		DateSelect
+	},
+	mixins:[],
+	data() {
+		return {
+			bxList:[],
+			searchTime:'',
+			startTime:'',
+			endTime:''
+		};
+	},
+	methods: {
+		selectDateFn(val) {
+			this.searchTime = val.searchTime
+			this.startTime = val.startTime
+			this.endTime = val.endTime
+			this.init()
+		},
+		confirmBx(staffId,amount){
+			let that = this
+			that.$util.confirmModal({content:'确认已报销?'},() => {
+				bx({staffId,amount}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+						that.init()
+					}
+				})
+        	})
+		},
+		init(){
+			getUnBxList({searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime}).then(res=>{
+				if(res.code == 1){
+					this.bxList = res.data.list ? res.data.list : []
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+</style>