shish 2 tahun lalu
induk
melakukan
6ce49f3498
2 mengubah file dengan 83 tambahan dan 26 penghapusan
  1. 17 3
      ghsApp/src/admin/expend/addExpend.vue
  2. 66 23
      ghsApp/src/admin/expend/list.vue

+ 17 - 3
ghsApp/src/admin/expend/addExpend.vue

@@ -76,7 +76,7 @@
 </template>
 </template>
 <script>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
-import { addExpend} from '@/api/expend'
+import { addExpend,getTypeList } from '@/api/expend'
 import {currentShop} from "@/api/shop"
 import {currentShop} from "@/api/shop"
 import { getAllStaff } from "@/api/shop-admin"
 import { getAllStaff } from "@/api/shop-admin"
 export default {
 export default {
@@ -99,7 +99,8 @@ export default {
       payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
       payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
       payWayindex:0,
       payWayindex:0,
       shopInfo:{shopName:''},
       shopInfo:{shopName:''},
-      staffList:[]
+      staffList:[],
+      typeList:[]
     };
     };
   },
   },
   onLoad () {
   onLoad () {
@@ -125,7 +126,8 @@ export default {
     },
     },
     init(){
     init(){
 
 
-      //获取所有在职员工
+      let that = this
+
       getAllStaff().then(res=>{
       getAllStaff().then(res=>{
         if(res.code == 1){
         if(res.code == 1){
           this.staffList = res.data.list
           this.staffList = res.data.list
@@ -140,6 +142,18 @@ export default {
         }
         }
       })
       })
 
 
+			getTypeList().then(res=>{
+				if(res.code == 1){
+					that.typeList = res.data.list ? res.data.list : []
+          if(!that.$util.isEmpty(that.typeList)){
+            let current = that.typeList[0]
+            that.form.type = current.id
+            that.form.typeName = current.name
+            that.$forceUpdate()
+          }
+				}
+			})
+
     },
     },
 		payWayChange(e){
 		payWayChange(e){
 			let index = e.detail.value
 			let index = e.detail.value

+ 66 - 23
ghsApp/src/admin/expend/list.vue

@@ -3,8 +3,8 @@
 	<view style="padding:15upx 0 30upx 50upx;font-size:30upx;">
 	<view style="padding:15upx 0 30upx 50upx;font-size:30upx;">
 		<view>
 		<view>
 			<text @click="changeBx()">{{ bx == -1 ? '报销状态' : bx == 0 ? '待报销' : '已报销' }}</text>
 			<text @click="changeBx()">{{ bx == -1 ? '报销状态' : bx == 0 ? '待报销' : '已报销' }}</text>
-			<text style="margin-left:50upx;" @click="changeType()">类型</text>
-			<text style="margin-left:50upx;" @click="changePayMan()">付款人</text>
+			<text style="margin-left:50upx;" @click="changeType()">{{ typeName }}</text>
+			<text style="margin-left:50upx;" @click="changePayMan()">{{ getStaffName }}</text>
 		</view>
 		</view>
 	</view>
 	</view>
 	<view style="margin-left:50upx;margin-bottom:26upx;position:relative;">
 	<view style="margin-left:50upx;margin-bottom:26upx;position:relative;">
@@ -40,16 +40,18 @@
 			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
 			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
 				<button @click="getCurrentType(item)">{{ item.name }}</button>
 				<button @click="getCurrentType(item)">{{ item.name }}</button>
 			</view>
 			</view>
-			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
+			<view style="width:100vw;margin-top:30upx;"><button @click="resetTypeShow()">重置</button></view>
+			<view style="width:100vw;margin-bottom:70upx;margin-top:8upx;"><button @click="closeTypeShow()">取消</button></view>
 		</view>
 		</view>
 	</uni-popup>
 	</uni-popup>
 
 
 	<uni-popup ref="payShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
 	<uni-popup ref="payShowMore" 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 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 staffList" :key="index" style="width:100vw;margin-top:8upx;">
 			<view v-for="(item, index) in staffList" :key="index" style="width:100vw;margin-top:8upx;">
-				<button @click="">{{ item.name }}</button>
+				<button @click="getPayMan(item)">{{ item.name }}</button>
 			</view>
 			</view>
-			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closePayShow()">取消</button></view>
+			<view style="width:100vw;margin-top:30upx;"><button @click="resetPayShow()">重置</button></view>
+			<view style="width:100vw;margin-bottom:70upx;margin-top:8upx;"><button @click="closePayShow()">取消</button></view>
 		</view>
 		</view>
 	</uni-popup>
 	</uni-popup>
 
 
@@ -75,21 +77,74 @@ export default {
 			getStaffId:0,
 			getStaffId:0,
 			staffList:[],
 			staffList:[],
 			bx:-1,
 			bx:-1,
-			typeList:[]
+			typeList:[],
+			type:-1,
+			typeName:'类型',
+			searchTime:'',
+			startTime:'',
+			endTime:''
 		};
 		};
 	},
 	},
+	onLoad(){
+		getAllStaff().then(res=>{
+			if(res.code == 1){
+				this.staffList = res.data.list
+			}
+		})
+		getTypeList().then(res=>{
+			if(res.code == 1){
+				this.typeList = res.data.list ? res.data.list : []
+			}
+		})
+	},
+	onShow(){
+		this.resetList()
+		this.init()
+	},
 	methods: {
 	methods: {
+		selectDateFn(val) {
+			this.searchTime = val.searchTime
+			this.startTime = val.startTime
+			this.endTime = val.endTime
+			this.resetList()
+			this.init()
+		},
+		getPayMan(info){
+			this.getStaffId = info.id
+			this.getStaffName = info.name
+			this.closePayShow()
+			this.resetList();
+			this.init()
+		},
 		goToBxList(){
 		goToBxList(){
 			this.$util.pageTo({ url: "/admin/expend/bxList"})
 			this.$util.pageTo({ url: "/admin/expend/bxList"})
 		 },
 		 },
 		changePayMan(){
 		changePayMan(){
 			this.$refs.payShowMore.open('top')
 			this.$refs.payShowMore.open('top')
 		},
 		},
+		resetPayShow(){
+			this.getStaffName = '选付款人'
+			this.getStaffId = 0
+			this.closePayShow()
+			this.resetList();
+			this.init()
+		},
 		closePayShow(){
 		closePayShow(){
 			this.$refs.payShowMore.close()
 			this.$refs.payShowMore.close()
 		},
 		},
+		resetTypeShow(){
+			this.type = -1
+			this.typeName = '类型'
+			this.closeTypeShow()
+			this.resetList();
+			this.init()
+		},
 		getCurrentType(info){
 		getCurrentType(info){
-
+			this.type = info.id
+			this.typeName = info.name
+			this.closeTypeShow()
+			this.resetList();
+			this.init()
 		},
 		},
 		closeTypeShow(){
 		closeTypeShow(){
 			this.$refs.typeShowMore.close()
 			this.$refs.typeShowMore.close()
@@ -111,8 +166,8 @@ export default {
 					if(res.tapIndex == 2){
 					if(res.tapIndex == 2){
 						that.bx = -1
 						that.bx = -1
 					}
 					}
-					//that.resetList()
-					//that.getRefundData()
+					that.resetList();
+					that.init()
 				}
 				}
 			})
 			})
 		},
 		},
@@ -120,25 +175,13 @@ export default {
 			this.$util.pageTo({url: '/admin/expend/addExpend'})
 			this.$util.pageTo({url: '/admin/expend/addExpend'})
 		},
 		},
 		async init(){
 		async init(){
-			const res = await getExpendList({ page:this.list.page })
+			const res = await getExpendList({ page:this.list.page,bx:this.bx,type:this.type,staffId:this.getStaffId,searchTime: this.searchTime,
+				startTime: this.startTime,endTime: this.endTime,})
 			if (this.$util.isEmpty(res.data.list)){
 			if (this.$util.isEmpty(res.data.list)){
 				this.completes(res)
 				this.completes(res)
 				return
 				return
 			}
 			}
 			this.completes(res)
 			this.completes(res)
-
-			getAllStaff().then(res=>{
-				if(res.code == 1){
-					this.staffList = res.data.list
-				}
-			})
-
-			getTypeList().then(res=>{
-				if(res.code == 1){
-					this.typeList = res.data.list ? res.data.list : []
-				}
-			})
-
 		}
 		}
 	},
 	},
 	async onPullDownRefresh() {
 	async onPullDownRefresh() {