shish hace 2 años
padre
commit
4c2b754fb3

+ 66 - 13
ghsApp/src/admin/expend/addExpend.vue

@@ -6,6 +6,7 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">类型</view>
+            <button class="admin-button-com middle" @tap="form.type = 6" :class="form.type == 6? 'blue' : 'default'">物品</button>
             <button class="admin-button-com middle" @tap="form.type = 3" :class="form.type == 3? 'blue' : 'default'">伙食</button>
             <button class="admin-button-com middle" @tap="form.type = 0" :class="form.type == 0 ? 'blue' : 'default'">店租</button>
             <button class="admin-button-com middle" @tap="form.type = 1" :class="form.type == 1? 'blue' : 'default'">水电</button>
@@ -14,14 +15,6 @@
             <button class="admin-button-com middle" @tap="form.type = 5" :class="form.type == 5? 'blue' : 'default'">其它</button>
           </tui-list-cell>
 
-          <tui-list-cell class="line-cell" :arrow="true">
-            <view class="tui-title">支付</view>
-            <picker mode="selector" :value="form.payWay" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input" >
-              <input v-model="form.payWay" name="payWay" type="text" hidden />
-              <view style="padding:6upx 0 6upx 0;">{{payWayList[payWayindex].name}}</view>
-            </picker>
-          </tui-list-cell>
-
           <tui-list-cell class="line-cell" :hover="false">
               <view class="tui-title">金额</view>
               <input v-model="form.amount" type="digit" @focus="form.amount=''" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="amount" placeholder="请填写" />
@@ -33,6 +26,37 @@
               <textarea v-model="form.remark" @focus="form.remark=''" style="height:80upx;" class="tui-textarea remark" name="remark" placeholder-class="phcolor" placeholder="选填" />
             </view>
           </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :arrow="true">
+            <div class="tui-title">付款人</div>
+            <picker mode="selector" :value="form.getStaffId" :range="staffList" range-key="name" @change="kdChange" class="tui-input" >
+              <input v-model="form.getStaffId" name="getStaffId" type="text" hidden />
+              <div style="padding:6upx 0 6upx 0;">{{form.getStaffName}}</div>
+            </picker>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :arrow="true">
+            <view class="tui-title">付款方式</view>
+            <picker mode="selector" :value="form.payWay" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input" >
+              <input v-model="form.payWay" name="payWay" type="text" hidden />
+              <view style="padding:6upx 0 6upx 0;">{{payWayList[payWayindex].name}}</view>
+            </picker>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+          <div class="tui-title">报销</div>
+          <radio-group class="tui-input" @change="bxChange">
+            <label class="list" for="fixedLink">
+              <radio id="fixedLink" value="0" :checked="form.bx == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">未报销</span>
+            </label>
+            <label class="list" for="dimLink">
+              <radio id="dimLink" value="1" :checked="form.bx == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">已报销</span>
+            </label>
+          </radio-group>
+        </tui-list-cell>
+
         </view>
         <view class="confirm-btn">
           <view style="margin-bottom:20upx;font-size:33upx;color:red;font-weight:bold;">当前在:{{shopInfo.shopName}}</view>
@@ -45,7 +69,8 @@
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
 import { addExpend} from '@/api/expend'
-import {currentShop} from "@/api/shop";
+import {currentShop} from "@/api/shop"
+import { getAllStaff } from "@/api/shop-admin"
 export default {
   name: "addExpend",
   components: {
@@ -54,15 +79,18 @@ export default {
   data() {
     return {
       form:{
-        //0店租 1水电 2物业 3伙食 4房租 5其它
-        type:3,
+        type:6,
         amount:'',
         remark:'',
-        payWay:0
+        payWay:0,
+        getStaffId:0,
+        getStaffName:'',
+        bx:-1
       },
       payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
       payWayindex:0,
-      shopInfo:{shopName:''}
+      shopInfo:{shopName:''},
+      staffList:[]
     };
   },
   onLoad () {
@@ -71,6 +99,27 @@ export default {
 			})
   },
   methods: {
+    bxChange(e) {
+      this.form.bx = e.detail.value;
+    },
+    init(){
+
+      //获取所有在职员工
+      getAllStaff().then(res=>{
+        if(res.code == 1){
+          this.staffList = res.data.list
+          if(!this.$util.isEmpty(this.staffList)){
+            for(const ele of this.staffList){
+              if(this.getLoginInfo.shopAdminId == ele.id){
+                this.form.getStaffId = ele.id
+                this.form.getStaffName = ele.name
+              }
+            }
+          }
+        }
+      })
+
+    },
 		payWayChange(e){
 			let index = e.detail.value
 			this.payWayindex = index
@@ -80,6 +129,10 @@ export default {
       if(Number(this.form.amount) <= 0){
         this.$msg('请填写金额')
         return false
+      }
+      if(this.form.bx == -1){
+        this.$msg('请选择报销状态')
+        return false
       }
 			this.$util.confirmModal({content:'确认提交?'},() => {
         addExpend(this.form).then(res=>{

+ 56 - 0
ghsApp/src/admin/expend/bxList.vue

@@ -0,0 +1,56 @@
+<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;">
+					<text style="font-weight:bold;">{{item.staffName?item.staffName:''}}</text><text style="margin-left:20upx;">待报销:¥{{ item.amount }}</text>
+				</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'
+export default {
+	name: "bxList",
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[],
+	data() {
+		return {
+			bxList:[]
+		};
+	},
+	methods: {
+		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().then(res=>{
+				if(res.code == 1){
+					this.bxList = res.data.list ? res.data.list : []
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 111 - 31
ghsApp/src/admin/expend/list.vue

@@ -1,54 +1,118 @@
 <template>
 <view class="app-content">
-		<block v-if="!$util.isEmpty(list.data)">
-			<t-table :headerBackgroundColor="'#F0F2F6'">
-				<t-tr header>
-					<t-th><view>时间</view></t-th>
-					<t-th><view>登记人</view></t-th>
-					<t-th><view>支付</view></t-th>
-					<t-th><view>事项</view></t-th>
-					<t-th>金额</t-th>
-				</t-tr>
-				<view v-for="(item, index) in list.data" :key="index">
-					<t-tr>
-						<t-td align="center" color="info">{{ item.addTime.substr(5,11) }}</t-td>
-						<t-td align="center" color="info">{{item.staffName}}</t-td>
-						<t-td align="center" color="info">{{item.payWay==0?'线下微信':item.payWay == 4 ? '现金':item.payWay == 1?'线下支付宝':item.payWay == 5 ? '银行卡':''}}</t-td>
-						<t-td align="center" color="info">{{item.type == 0 ? '店租':item.type==1?'水电':item.type==2?'物业':item.type==3?'伙食':item.type==4?'房租':'其它'}}</t-td>
-						<t-td align="center" color="info">{{item.amount?parseFloat(item.amount):0}}</t-td>
-					</t-tr>
-					<block v-if="!$util.isEmpty(item.remark)">
-						<t-tr>
-							<t-td align="center" color="info">{{ item.remark }}</t-td>
-						</t-tr>
-					</block>
+	<view style="padding:15upx 0 30upx 50upx;font-size:30upx;">
+		<view>
+			<text @click="changeBx()">{{ bx == -1 ? '报销状态' : bx == 0 ? '待报销' : '已报销' }}</text>
+			<text style="margin-left:50upx;" @click="changeType()">类型</text>
+			<text style="margin-left:50upx;" @click="changePayMan()">付款人</text>
+		</view>
+	</view>
+	<view style="margin-left:50upx;margin-bottom:26upx;position:relative;">
+        <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
+      </view>
+	<block v-if="!$util.isEmpty(list.data)">
+		<view v-for="(item, index) in list.data" :key="index">
+			<view style="background-color: white;margin-bottom:15upx;padding:10upx 0 10upx 20upx;">
+				<view style="color:red;font-weight:bold;font-size:30upx;">
+					<text>{{item.type == 0 ? '店租':item.type==1?'水电':item.type==2?'物业':item.type==3?'伙食':item.type==4?'房租':item.type==6?'物品':'其它'}}</text>
+					<text style="margin-left:20upx;">¥{{item.amount?parseFloat(item.amount):0}}</text>
 				</view>
-			</t-table>
-		</block>
-		<block v-else>
-			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-		</block>
-		<view class="app-footer open_btn">
-			<view @click="addExpend" class="admin-button-com big blue" style="width:230upx;">新增支出</view>
+				<view v-if="item.remark!=''" style="color:red;">备注:{{ item.remark }}</view>
+				<view>付款:<text style="font-weight:bold;">{{item.staffName?item.staffName:''}}</text></view>
+				<view>时间:{{ item.addTime.substr(5,11) }}</view>
+				<view>支付:{{item.payWay==0?'线下微信':item.payWay == 4 ? '现金':item.payWay == 1?'线下支付宝':item.payWay == 5 ? '银行卡':''}}</view>
+				<view v-if="item.bx == 0" style="color:blue;">报销:待报销</view>
+				<view v-else style="color:green;">报销:已报销</view>
+			</view>
 		</view>
+	</block>
+	<block v-else>
+		<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+	</block>
+	<view class="app-footer open_btn">
+		<text style="margin-right:80upx;color:blue;font-size:29upx;" @click="goToBxList()">待报销列表</text>
+		<view @click="addExpend" class="admin-button-com big blue" style="width:230upx;">新增支出</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;">
+				<button @click="">{{ item }}</button>
+			</view>
+			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
+		</view>
+	</uni-popup>
+
+	<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 v-for="(item, index) in staffList" :key="index" style="width:100vw;margin-top:8upx;">
+				<button @click="">{{ item.name }}</button>
+			</view>
+			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closePayShow()">取消</button></view>
+		</view>
+	</uni-popup>
+
+</view>
 </template>
 
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getExpendList } from '@/api/expend'
+import { getExpendList,getTypeList } from '@/api/expend'
 import list from '@/mixins/list'
+import { getAllStaff } from "@/api/shop-admin"
+import DateSelect from "@/components/module/dateSelect"
 export default {
 	name: "cashList",
 	components: {
-		AppWrapperEmpty
+		AppWrapperEmpty,
+		DateSelect
 	},
 	mixins:[list],
 	data() {
 		return {
+			getStaffName:'选付款人',
+			getStaffId:0,
+			staffList:[],
+			bx:-1,
+			typeList:[]
 		};
 	},
 	methods: {
+		goToBxList(){
+			this.$util.pageTo({ url: "/admin/expend/bxList"})
+		 },
+		changePayMan(){
+			this.$refs.payShowMore.open('top')
+		},
+		closePayShow(){
+			this.$refs.payShowMore.close()
+		},
+		closeTypeShow(){
+			this.$refs.typeShowMore.close()
+		},
+		changeType(){
+			this.$refs.typeShowMore.open('top')
+		},
+		changeBx(){
+			let that = this
+			uni.showActionSheet({
+				itemList: ['待报销', '已报销', '重置选择'],
+				success: function (res) {
+					if(res.tapIndex == 0){
+						that.bx = 0
+					}
+					if(res.tapIndex == 1){
+						that.bx = 1
+					}
+					if(res.tapIndex == 2){
+						that.bx = -1
+					}
+					//that.resetList()
+					//that.getRefundData()
+				}
+			})
+		},
 		addExpend(){
 			this.$util.pageTo({url: '/admin/expend/addExpend'})
 		},
@@ -59,6 +123,19 @@ export default {
 				return
 			}
 			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() {
@@ -81,4 +158,7 @@ export default {
 .app-content{
 	padding-bottom:120upx;
 }
+.class-popup-style{
+	z-index:99999;
+}
 </style>

+ 12 - 0
ghsApp/src/api/expend/index.js

@@ -1,5 +1,17 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const bx = data => {
+	return https.get('/expend/bx', data)
+}
+
+export const getUnBxList = data => {
+	return https.get('/expend/un-bx-list', data)
+}
+
+export const getTypeList = data => {
+	return https.get('/expend/get-type-list', data)
+}
+
 export const getSalaryList = data => {
 	return https.get('/salary/list', data)
 }

+ 2 - 1
ghsApp/src/pages.json

@@ -480,7 +480,8 @@
 				{"path": "addExpend","style": {"navigationBarTitleText": "支出登记"}},
 				{"path": "addSalary","style": {"navigationBarTitleText": "发工资"}},
 				{"path": "salary","style": {"navigationBarTitleText": "发工资记录","enablePullDownRefresh": true}},
-				{"path": "list","style": {"navigationBarTitleText": "支出记录","enablePullDownRefresh": true}}
+				{"path": "list","style": {"navigationBarTitleText": "支出记录","enablePullDownRefresh": true}},
+				{"path": "bxList","style": {"navigationBarTitleText": "待报销","enablePullDownRefresh": false}}
 			]
 		}
 	],