fuwei il y a 5 ans
Parent
commit
868d483a07

+ 3 - 0
ghs/src/api/store/index.js

@@ -6,6 +6,9 @@ export const applyList = data => {
 export const withdrawCashList = data => {
 export const withdrawCashList = data => {
 	return https.get('/cash/list', data)
 	return https.get('/cash/list', data)
 }
 }
+export const capitaList = data => {
+	return https.get('/sj-capital/list', data)
+}
 
 
 // export const mainMy = async (data) => {
 // export const mainMy = async (data) => {
 // 	return https.get("/main/my", data);
 // 	return https.get("/main/my", data);

+ 1 - 0
ghs/src/mixins/list.js

@@ -42,6 +42,7 @@ export default {
         this.list.finished = true
         this.list.finished = true
       }
       }
       let listArr = res.data.list || res.data.data || res.data[listKey]
       let listArr = res.data.list || res.data.data || res.data[listKey]
+      console.log(listArr,111)
       this.list.data =
       this.list.data =
         this.list.page === 1 ? listArr : this.list.data.concat(listArr)
         this.list.page === 1 ? listArr : this.list.data.concat(listArr)
       this.list.total = res.data.totalPage * this.list.pageSize
       this.list.total = res.data.totalPage * this.list.pageSize

+ 2 - 1
ghs/src/pagesArrears/details.vue

@@ -79,7 +79,8 @@ export default {
 			isBatch: false,
 			isBatch: false,
 			totalAmount: "",
 			totalAmount: "",
 			num: "",
 			num: "",
-			detailsList: []
+			detailsList: [],
+			listLoading: false
 		};
 		};
 	},
 	},
 	onPullDownRefresh() {
 	onPullDownRefresh() {

+ 1 - 1
ghs/src/pagesStatistics/business.vue

@@ -9,7 +9,7 @@
 						class="amount-btn">
 						class="amount-btn">
 						<DorpdownSelect 
 						<DorpdownSelect 
 							:menuObj.sync="menuObj"  
 							:menuObj.sync="menuObj"  
-							top="40px"
+							top="0px"
 							:selectItemId.sync="shopId"
 							:selectItemId.sync="shopId"
 							@selectSussess="selectSussess"></DorpdownSelect>	
 							@selectSussess="selectSussess"></DorpdownSelect>	
 					</view>
 					</view>

+ 77 - 12
ghs/src/pagesStore/me/incomeExpenses.vue

@@ -1,13 +1,21 @@
 <template>
 <template>
 	<div>
 	<div>
-		<block v-if="!$util.isEmpty(list.data)">
+		<app-tabs
+		:tabs="tabs"
+		:isFixed="true"
+		:currentTab="tabIndex"
+		:height="100"
+		@change="changeIncome"
+		itemWidth="50%"
+		/>
+		<div class="list-by_box" v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
 				<t-tr header>
 					<t-th v-for="(item, index) in columns" :key="index" :align="item.align">
 					<t-th v-for="(item, index) in columns" :key="index" :align="item.align">
 						{{ item.name }}
 						{{ item.name }}
 					</t-th>
 					</t-th>
 				</t-tr>
 				</t-tr>
-				<t-tr v-for="(item, index) in list" :key="index">
+				<t-tr v-for="(item, index) in list.data" :key="index">
 					<t-td
 					<t-td
 						v-for="(column, colIndex) in columns"
 						v-for="(column, colIndex) in columns"
 						:key="colIndex"
 						:key="colIndex"
@@ -20,7 +28,7 @@
 					</t-td>
 					</t-td>
 				</t-tr>
 				</t-tr>
 			</t-table>
 			</t-table>
-		</block>
+		</div>
 		<block v-else>
 		<block v-else>
 			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 		</block>
 		</block>
@@ -29,29 +37,34 @@
 
 
 <script>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import AppTabs from "@/components/plugin/tabs";
+import { list } from "@/mixins";
+import { capitaList } from '@/api/store'
 export default {
 export default {
 	name: "IncomeExpenses", //收支记录
 	name: "IncomeExpenses", //收支记录
 	components: {
 	components: {
-		AppWrapperEmpty
+		AppWrapperEmpty,
+		AppTabs
 	},
 	},
+	mixins: [list],
 	data() {
 	data() {
 		return {
 		return {
 			columns: [
 			columns: [
 				{
 				{
 					name: "事项",
 					name: "事项",
-					dataIndex: "typeName",
+					dataIndex: "event",
 					color: "info",
 					color: "info",
 					align: "center"
 					align: "center"
 				},
 				},
 				{
 				{
 					name: "收支金额",
 					name: "收支金额",
-					dataIndex: "typeName",
+					dataIndex: "amount",
 					color: "info",
 					color: "info",
 					align: "center"
 					align: "center"
 				},
 				},
 				{
 				{
 					name: "余额",
 					name: "余额",
-					dataIndex: "typeName",
+					dataIndex: "balance",
 					color: "info",
 					color: "info",
 					align: "center"
 					align: "center"
 				},
 				},
@@ -62,14 +75,66 @@ export default {
 					align: "center"
 					align: "center"
 				}
 				}
 			],
 			],
-			list: [{ time: "1221", typeName: "hahah", stock: "121255" }]
+			// list: [{ time: "1221", typeName: "hahah", stock: "121255" }],
+			tabIndex: 0,
+			tabs: [
+				{
+				name: "收入",
+				key:1
+				// value: 1
+				},
+				{
+				name: "支出",
+				key:0
+				// value: 0
+				}
+			]
 		};
 		};
 	},
 	},
-	methods: {},
-	onPullDownRefresh() {
+	methods: {
+		 init() {
+		this._list();
+		},
+		changeIncome(e){
+			 if (this.tabIndex == e.index) {
+				return false;
+			} else {
+				this.tabIndex = e.index;
+				this.resetList();
+				this._list();
+				}
 
 
-	}
+			
+		},
+		_list(){
+			return capitaList({
+				page: this.list.page,
+				io: this.tabs[this.tabIndex].key
+			}).then(res=>{
+				 this.completes(res);
+			})
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this._list().then(res => {
+		uni.stopPullDownRefresh();
+		});
+	},
+	onReachBottom() {
+    if (!this.list.finished) {
+      this._list().then(res => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
 };
 };
 </script>
 </script>
 
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+	.list-by_box {
+		padding-top: 100px;
+	}
+</style>

+ 2 - 2
ghs/src/pagesStore/me/withdraw.vue

@@ -7,7 +7,7 @@
 						{{ item.name }}
 						{{ item.name }}
 					</t-th>
 					</t-th>
 				</t-tr>
 				</t-tr>
-				<t-tr v-for="(item, index) in list" :key="index">
+				<t-tr v-for="(item, index) in list.data" :key="index">
 					<t-td
 					<t-td
 						v-for="(column, colIndex) in columns"
 						v-for="(column, colIndex) in columns"
 						:key="colIndex"
 						:key="colIndex"
@@ -70,7 +70,7 @@ export default {
 				const res = await withdrawCashList({
 				const res = await withdrawCashList({
 					page:this.list.page
 					page:this.list.page
 				})
 				})
-				res.data  = res.data.list.map(i=>({
+				res.data.list  = res.data.list.map(i=>({
 					...i,
 					...i,
 					statusText: i.status ==1?'待处理':i.status ==2?'处理中':'已完成'				  
 					statusText: i.status ==1?'待处理':i.status ==2?'处理中':'已完成'				  
 				}))
 				}))