shish 6 месяцев назад
Родитель
Сommit
4e1988b7b6

+ 77 - 0
ghsApp/src/admin/ghs/debtChange.vue

@@ -0,0 +1,77 @@
+<template>
+<view class="app-content">
+		<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:230upx;">事项</view></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)">
+					<t-tr>
+						<t-td align="center" color="info">
+							<view style="width:150upx;">
+								<view style="width:100%;">{{ item.addTime.substr(5,11) }}</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 >{{ item.amount }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
+					</t-tr>
+				</view>
+			</t-table>
+		</block>
+		<block v-else>
+			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+		</block>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getGhsDebtRecord } from '@/api/ghs'
+import list from '@/mixins/list'
+export default {
+	name: "debtChange",
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+		};
+	},
+	methods: {
+		async init(){
+			const res = await getGhsDebtRecord({ page:this.list.page,ghsId:this.option.ghsId })
+			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 ? '-'+parseFloat(item.amount) : '+'+parseFloat(item.amount)
+			});
+			res.data.list = currentList
+			this.completes(res)
+		},
+		goDetail(item){
+		}
+	},
+	async onPullDownRefresh() {
+		this.resetList();
+		await this.init()
+		uni.stopPullDownRefresh();
+	},
+	async onReachBottom() {
+		if (!this.list.finished) {
+			await this.init()
+			uni.stopPullDownRefresh();;
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	
+};
+</script>
+<style lang="scss" scoped></style>

+ 5 - 0
ghsApp/src/api/ghs/index.js

@@ -21,3 +21,8 @@ export const getList = data => {
  export const ghsAdd = data => {
 	return https.post('/ghs/add', data)
 }
+
+
+export const getGhsDebtRecord = data => {
+	return https.get('/ghs-debt-record/list', data)
+}

+ 2 - 1
ghsApp/src/pages.json

@@ -160,7 +160,8 @@
 		{
 			"root": "admin/ghs",
 			"pages": [
-				{"path": "shop","style": {"navigationBarTitleText": "供货商"}}
+				{"path": "shop","style": {"navigationBarTitleText": "供货商"}},
+				{"path": "debtChange","style": {"navigationBarTitleText": "挂账变动明细"}}
 			]
 		},
 		{

+ 3 - 3
ghsApp/src/pagesPurchase/supplier.vue

@@ -30,7 +30,7 @@
             </view>
             <view class="store_btn">
               <view class="btn_entrance" @click.stop="pageTo({ url: '/admin/clear/list?ghsId='+item.id})"> 结账记录</view>
-              <view class="btn_entrance" @click.stop="getDebtList()"> 挂账变动明细 </view>
+              <view class="btn_entrance" @click.stop="getDebtList(item)"> 挂账变动明细 </view>
               <view class="btn_entrance" @click.stop="cgList(item)">采购记录</view>
               <view class="cg-button" @click="goToCg(item)">采购</view>
               <!-- <view class="my-cg-button" @click.stop="goToMyCg(item)">我的</view> -->
@@ -177,8 +177,8 @@ export default {
 		addGhs(){
 			this.pageTo({url:'/pagesPurchase/suppAdd'})
 		},
-    getDebtList(){
-      this.$msg('开发中')
+    getDebtList(item){
+      this.pageTo({url:'/admin/ghs/debtChange?ghsId='+item.id})
     },
     init() {
       this.getGhsList()