shish 4 лет назад
Родитель
Сommit
82cc7a4253

+ 23 - 7
ghsApp/src/admin/expend/addExpend.vue

@@ -6,12 +6,12 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">类型</view>
-            <button class="admin-button-com middle" :class="form.type == 3? 'blue' : 'default'">伙食</button>
-            <button class="admin-button-com middle" :class="form.type == 0 ? 'blue' : 'default'">店租</button>
-            <button class="admin-button-com middle" :class="form.type == 1? 'blue' : 'default'">水电</button>
-            <button class="admin-button-com middle" :class="form.type == 2? 'blue' : 'default'">物业</button>
-            <button class="admin-button-com middle" :class="form.type == 4? 'blue' : 'default'">房租</button>
-            <button class="admin-button-com middle" :class="form.type == 5? '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>
+            <button class="admin-button-com middle" @tap="form.type = 2" :class="form.type == 2? 'blue' : 'default'">物业</button>
+            <button class="admin-button-com middle" @tap="form.type = 4" :class="form.type == 4? 'blue' : 'default'">房租</button>
+            <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" :hover="false">
@@ -36,6 +36,7 @@
 </template>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
+import { addExpend} from '@/api/expend'
 export default {
   name: "addExpend",
   components: {
@@ -52,7 +53,22 @@ export default {
     };
   },
   methods: {
- 
+    formSubmit(){
+      if(Number(this.form.amount) <= 0){
+        this.$msg('请填写金额')
+        return false
+      }
+			this.$util.confirmModal({content:'确认提交?'},() => {
+        addExpend(this.form).then(res=>{
+          if(res.code == 1){
+              this.$msg("提交成功");
+              setTimeout(function(){
+                uni.navigateBack({ delta: 1 })
+              },1000)
+          }
+        })
+			})
+    }
   }
 };
 </script>

+ 10 - 26
ghsApp/src/admin/expend/list.vue

@@ -3,24 +3,17 @@
 		<block v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
-					<t-th><view style="width:150upx;">来源</view></t-th>
-					<t-th><view style="width:200upx;">事项</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-th>余额</t-th>
-					<t-th>可提现</t-th>
 				</t-tr>
-				<view v-for="(item, index) in list.data" :key="index" @click="goDetail(item)">
+				<view v-for="(item, index) in list.data" :key="index">
 					<t-tr>
-						<t-td align="center" color="info">
-							<view style="width:150upx;">
-								<view>{{ item.addTime.substr(5,11) }}</view>
-								<view>{{item.ptStyle==1?'零售':'批发'}}-{{ item.fromType ==1 ? '门店' : item.fromType == 2 ? '商城' : item.fromType ==3 ? '朋友圈' : '其它' }}</view>
-							</view>
-						</t-td>
-						<t-td align="center" color="info"><view style="width:200upx;">{{ item.event }}</view></t-td>
-						<t-td align="center" color="info"><view >{{ parseFloat(item.amount) }}</view></t-td>
-						<t-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
-						<t-td align="center" color="info"><view >{{ parseFloat(item.txBalance) }}</view></t-td>
+						<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.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>
 				</view>
 			</t-table>
@@ -38,7 +31,7 @@
 
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { changeList } from '@/api/shop-ye-change'
+import { getExpendList } from '@/api/expend'
 import list from '@/mixins/list'
 export default {
 	name: "cashList",
@@ -55,21 +48,12 @@ export default {
 			this.$util.pageTo({url: '/admin/expend/addExpend'})
 		},
 		async init(){
-			const res = await changeList({
-				page:this.list.page,tx:0
-			})
+			const res = await getExpendList({ page:this.list.page })
 			if (this.$util.isEmpty(res.data.list)){
 				this.completes(res)
 				return
 			}
-			let currentList = res.data.list
-			currentList.forEach(function(item,index,array){
-				array[index].amount = item.io ==0 ? '-'+item.amount : '+'+item.amount
-			});
-			res.data.list = currentList
 			this.completes(res)
-		},
-		goDetail(item){
 		}
 	},
 	async onPullDownRefresh() {

+ 0 - 6
ghsApp/src/admin/home/workbench.vue

@@ -76,12 +76,6 @@
 				<image @click="customKd()" :src="isScanEnv ? pfSrc3 : pfSrc" mode="widthFix" ></image>				
 			</view>
 			
-			<!-- 使用教程 -->
-			<view v-if="loginInfo.showBook == 1" style="text-align:center;position:relative;padding:0 22upx;" @click="pageTo({ url: '/admin/book/index'})">
-				<view @click.stop="closeBook" style="position:absolute;right:30upx;top:10upx;z-index:9999;"><image style="width:38upx;" :src="`${constant.imgUrl}/book/close1.png`" mode="widthFix"></image></view>
-				<image style="border:4upx solid #DDDDDD;margin:0 auto;border-radius:15upx;" :src="`${constant.imgUrl}/book/book5.png`" mode="widthFix"></image>
-			</view>
-
 			<!-- 小按钮 -->
 			<view class="tabs-wrap">
 				<view class="tabs-list" v-for="(item, index) in tabsData" :key="index">

+ 8 - 1
ghsApp/src/api/expend/index.js

@@ -1,10 +1,17 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-
 export const getSalaryList = data => {
 	return https.get('/salary/list', data)
 }
 
 export const addSalary = data => {
 	return https.post('/salary/add-salary', data)
+}
+
+export const addExpend = data => {
+	return https.post('/expend/add-expend', data)
+}
+
+export const getExpendList = data => {
+	return https.get('/expend/list', data)
 }