Răsfoiți Sursa

结账功能

shish 4 ani în urmă
părinte
comite
1c8eb22bda

+ 73 - 0
ghsApp/src/admin/custom/debtChange.vue

@@ -0,0 +1,73 @@
+<template>
+<view class="app-content">
+		<block v-if="!$util.isEmpty(list.data)">
+			<t-table :headerBackgroundColor="'#F0F2F6'">
+				<t-tr header>
+					<t-th>日期</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 >{{ item.addTime.substr(5,11) }}</view></t-td>
+						<t-td align="center" color="info"><view style="width:230upx;">{{ 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 { debtChangeList } from '@/api/custom'
+import list from '@/mixins/list'
+export default {
+	name: "debtChange",
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+		};
+	},
+	methods: {
+		async init(){
+			const res = await debtChangeList({ page:this.list.page,customId:this.option.customId })
+			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>

+ 4 - 0
ghsApp/src/api/custom/index.js

@@ -17,4 +17,8 @@ export const changeDiscount = data => {
 
 
 export const changeLevel = data => {
 export const changeLevel = data => {
 	return https.get('/custom/change-level', data)
 	return https.get('/custom/change-level', data)
+}
+
+export const debtChangeList = data => {
+	return https.get('/custom-debt-change/list', data)
 }
 }

+ 1 - 1
ghsApp/src/pages.json

@@ -40,7 +40,7 @@
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级标准"}},
 				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级标准"}},
 				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}},
 				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}},
-				{"path": "debtChangeDetail","style": {"navigationBarTitleText": "变化明细"}}
+				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}}
 			]
 			]
 		},
 		},
 		{
 		{

+ 7 - 2
ghsApp/src/pagesClient/member/detail.vue

@@ -24,7 +24,7 @@
 
 
               <view class="total-list" @click="pageTo({url:'/pagesArrears/details',query: {id: userInfo.id}})">
               <view class="total-list" @click="pageTo({url:'/pagesArrears/details',query: {id: userInfo.id}})">
                 <view class="app-color-3">欠款</view>
                 <view class="app-color-3">欠款</view>
-                <view class="list-num">{{ parseFloat(userInfo.debtAmount) || 0 }}</view>
+                <view class="list-num" style="color:red;">{{ parseFloat(userInfo.debtAmount) || 0 }}</view>
               </view>
               </view>
 
 
               <view class="total-list">
               <view class="total-list">
@@ -72,9 +72,15 @@
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/pagesArrears/details',query: {id: userInfo.id}})">
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/pagesArrears/details',query: {id: userInfo.id}})">
               <div class="tui-title">欠款订单</div>
               <div class="tui-title">欠款订单</div>
             </tui-list-cell>
             </tui-list-cell>
+
+            <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/custom/debtChange',query: {customId: userInfo.id}})">
+              <div class="tui-title">欠款变动明细</div>
+            </tui-list-cell>
+
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/clear/customList',query: {customId: userInfo.id}})">
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/clear/customList',query: {customId: userInfo.id}})">
               <div class="tui-title">结账记录</div>
               <div class="tui-title">结账记录</div>
             </tui-list-cell>
             </tui-list-cell>
+
             <tui-list-cell class="line-cell" :hover="false">
             <tui-list-cell class="line-cell" :hover="false">
               <div class="tui-title">欠款开关</div>
               <div class="tui-title">欠款开关</div>
               <div class="switch_bx">
               <div class="switch_bx">
@@ -102,7 +108,6 @@
     </templete>
     </templete>
   </view>
   </view>
 </template>
 </template>
-
 <script>
 <script>
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 import AppAvatarModule from "@/components/module/app-avatar";
 import AppAvatarModule from "@/components/module/app-avatar";

+ 11 - 15
ghsApp/src/admin/custom/debtChangeDetail.vue → hdApp/src/admin/ghs/debtChange.vue

@@ -3,16 +3,16 @@
 		<block v-if="!$util.isEmpty(list.data)">
 		<block v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
 				<t-tr header>
-					<t-th>事项</t-th>
-					<t-th>金额</t-th>
-					<t-th>可提现余额</t-th>
-					<t-th>总余额</t-th>
+					<t-th>日期</t-th>
+					<t-th><view style="width:230upx;">事项</view></t-th>
+					<t-th>变动</t-th>
+					<t-th>欠款</t-th>
 				</t-tr>
 				</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" @click="goDetail(item)">
 					<t-tr>
 					<t-tr>
-						<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.txBalance) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ item.addTime.substr(5,11) }}</view></t-td>
+						<t-td align="center" color="info"><view style="width:230upx;">{{ 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-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
 					</t-tr>
 					</t-tr>
 				</view>
 				</view>
@@ -23,13 +23,12 @@
 		</block>
 		</block>
 	</view>
 	</view>
 </template>
 </template>
-
 <script>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { changeList } from '@/api/shop-ye-change'
+import { debtChangeList } from '@/api/ghs'
 import list from '@/mixins/list'
 import list from '@/mixins/list'
 export default {
 export default {
-	name: "debtChangeDetail",
+	name: "debtChange",
 	components: {
 	components: {
 		AppWrapperEmpty
 		AppWrapperEmpty
 	},
 	},
@@ -40,16 +39,14 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		async init(){
 		async init(){
-			const res = await changeList({
-				page:this.list.page,tx:0
-			})
+			const res = await debtChangeList({ page:this.list.page,ghsId:this.option.ghsId })
 			if (this.$util.isEmpty(res.data.list)){
 			if (this.$util.isEmpty(res.data.list)){
 				this.completes(res)
 				this.completes(res)
 				return
 				return
 			}
 			}
 			let currentList = res.data.list
 			let currentList = res.data.list
 			currentList.forEach(function(item,index,array){
 			currentList.forEach(function(item,index,array){
-				array[index].amount = item.io ==0 ? '-'+item.amount : '+'+item.amount
+				array[index].amount = item.io == 0 ? '-'+parseFloat(item.amount) : '+'+parseFloat(item.amount)
 			});
 			});
 			res.data.list = currentList
 			res.data.list = currentList
 			this.completes(res)
 			this.completes(res)
@@ -73,5 +70,4 @@ export default {
 	
 	
 };
 };
 </script>
 </script>
-
 <style lang="scss" scoped></style>
 <style lang="scss" scoped></style>

+ 4 - 0
hdApp/src/api/ghs/index.js

@@ -27,4 +27,8 @@ export const visitMall = data => {
 //补充未加入的供货商
 //补充未加入的供货商
 export const bcGhs = data => {
 export const bcGhs = data => {
 	return https.get('/ghs/bc-ghs', data)
 	return https.get('/ghs/bc-ghs', data)
+}
+
+export const debtChangeList = data => {
+	return https.get('/ghs-debt-change/list', data)
 }
 }

+ 2 - 6
hdApp/src/pages.json

@@ -130,12 +130,8 @@
 		{
 		{
 			"root": "admin/ghs",
 			"root": "admin/ghs",
 			"pages": [
 			"pages": [
-				{
-					"path": "shop",
-					"style": {
-						"navigationBarTitleText": "供应商"
-					}
-				}
+				{ "path": "shop", "style": {"navigationBarTitleText": "供应商"}},
+				{ "path": "debtChange", "style": {"navigationBarTitleText": "欠款变动明细"}}
 			]
 			]
 		},
 		},
 		{
 		{

+ 1 - 1
hdApp/src/pagesPurchase/order.vue

@@ -14,7 +14,7 @@
               <view class="btn_entrance" @click="pageTo({ url: '/admin/clear/list',query: {ghsId: ghsInfo.id}})">结账记录</view>
               <view class="btn_entrance" @click="pageTo({ url: '/admin/clear/list',query: {ghsId: ghsInfo.id}})">结账记录</view>
               <view class="btn_entrance" @click="settleAccounts(ghsInfo)" > 欠款订单 </view>
               <view class="btn_entrance" @click="settleAccounts(ghsInfo)" > 欠款订单 </view>
               <view class="btn_entrance" @click="pageTo({url:'/pagesPurchase/shopping'})" > 采购记录 </view>
               <view class="btn_entrance" @click="pageTo({url:'/pagesPurchase/shopping'})" > 采购记录 </view>
-              <view class="btn_entrance" style="text-decoration:none;color:red;font-size:25upx;"> 欠账 ¥{{parseFloat(ghsInfo.debtAmount)}} </view>
+              <view class="btn_entrance" @click="pageTo({ url: '/admin/ghs/debtChange',query: {ghsId: ghsInfo.id}})" style="text-decoration:none;color:red;font-size:25upx;"> 欠账 ¥{{parseFloat(ghsInfo.debtAmount)}} </view>
             </view>
             </view>
           </view>
           </view>
         </block>
         </block>