Browse Source

交易记录修改

main
niefei 1 month ago
parent
commit
93155c53c2
  1. 33
      config/language.js
  2. 130
      pages/account/ledger.vue
  3. 1
      pages/account/transactionRecord.vue

33
config/language.js

@ -131,6 +131,13 @@ export const LGC_data = {
payUti: '充值缴费',
qrcodeIn: '二维码收款',
refund: '退款',
transferAccounts: "转账",
proxyPayment: "代缴",
payment: "付款",
receivePayment: "收款",
withdrawal: "提现",
other: "其他",
recharge: "充值"
},
overview: {
NoMoreData: "没有更多",
@ -305,7 +312,7 @@ export const LGC_data = {
leName: '法人姓名',
lePhone: '法人联系电话',
leMail:'法人电子邮件',
leMail: '法人电子邮件',
signDate: '证件签发日期',
exTime: '证件到期日期',
leId: '法人身份证号',
@ -316,11 +323,11 @@ export const LGC_data = {
addrDetail: "经营详细地址",
runCode: "营业执照号码",
runImg: "营业执照照片",
guaImg:"保证金缴纳证明",
lspf:"批发和零售业",
guaImg: "保证金缴纳证明",
lspf: "批发和零售业",
manu: "制造业",
serv: "服务业",
cannotbeNUll: "不能为空",
cannotbeNUll: "不能为空",
idType: '证件类型',
area: '地区',
address: '详细地址',
@ -705,7 +712,14 @@ export const LGC_data = {
salIn: "Salary Income",
payUti: "Recharge and Payment",
qrcodeIn: "QR Code Payment Received",
refund: "Refund"
refund: "Refund",
transferAccounts: "transfer accounts",
proxyPayment: "Proxy payment",
payment: "payment",
receivePayment: "receive payment",
withdrawal: "Withdrawal",
other: "other",
recharge: "Recharge"
},
overview: {
@ -1279,7 +1293,14 @@ export const LGC_data = {
salIn: "ລາຍຮັບເງິນເດືອນ",
payUti: "ຊຳລະຄ່າໃຊ້ຈ່າຍ",
qrcodeIn: "ຮັບຊຳລະຜໍ QR Code",
refund: "ຄືນເງິນ"
refund: "ຄືນເງິນ",
transferAccounts: "ການໂອນເງິນ",
proxyPayment: "ການຈ່າຍເງິນ",
payment: "ການຊໍາລະເງິນ",
receivePayment: "ການຮັບເງິນ",
withdrawal: "ຖອນເງິນ",
other: "ອື່ນໆ",
recharge: "ເຕີມ"
},
overview: {
NoMoreData: "ບໍ່ມີຂໍ້ມູນເພີ່ມເຕີມ",

130
pages/account/ledger.vue

@ -3,7 +3,10 @@
<!-- 顶部Tabs -->
<view class="nav-bar" style="">
<!-- <text class="nav-title">{{this.$languageData.settings.transRecords}}</text> -->
<u-tabs @change="tabChg" scrollable :list="[{name:$languageData.tmp.all},{name:$languageData.tmp.salIn},{name:$languageData.tmp.payUti},{name:$languageData.tmp.qrcodeIn},{name:$languageData.tmp.refund}]"></u-tabs>
<u-tabs @change="tabChg" scrollable
:list="[{name:$languageData.tmp.all},{name:$languageData.tmp.transferAccounts},
{name:$languageData.tmp.proxyPayment},{name:$languageData.tmp.payment},
{name:$languageData.tmp.receivePayment},{name:$languageData.tmp.withdrawal}]"></u-tabs>
</view>
<!-- 搜索过滤区 -->
<view class="search-section">
@ -20,7 +23,8 @@
</view>
</picker>
</view>
<view style="display: flex; justify-content: space-around; padding: 16rpx 0; background-color: #f5f7fa; border-radius: 12rpx; margin-top: 14rpx;">
<view
style="display: flex; justify-content: space-around; padding: 16rpx 0; background-color: #f5f7fa; border-radius: 12rpx; margin-top: 14rpx;">
<view style="display: flex; flex-direction: column;">
<view style="color: #333;">{{$languageData.account.outcome}}</view>
<view style="display: flex; justify-content: baseline; align-items: baseline;">
@ -49,11 +53,11 @@
<!-- 交易记录列表 -->
<scroll-view class="record-list" scroll-y @scrolltolower="loadMore" refresher-enabled
:refresher-triggered="isRefreshing" @refresherrefresh="onRefresh">
<view v-if="showList.length > 0">
<view v-for="(item, index) in showList" :key="index" class="record-item" @tap="viewDetail(item)">
<view v-if="recordList.length > 0">
<view v-for="(item, index) in recordList" :key="index" class="record-item" @tap="viewDetail(item)">
<view class="record-header">
<!-- <text class="record-id">{{ item.senderName }}</text> -->
<text class="record-id">{{ item.remark }}</text>
<text class="record-id">{{ item.billCode.split("@")[0] }}</text>
<view class="record-amount">
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }">
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP)
@ -61,7 +65,7 @@
</view>
</view>
<view class="record-content">
<text class="record-time">{{ item.time }}</text>
<text class="record-time">{{ item.timeFormat }}</text>
<uni-tag :inverted="true" :text="item.typeStr" />
<!-- <uni-tag :inverted="true" :text="item.typeStr" :type="getStatusText(item.type)" /> -->
</view>
@ -80,14 +84,14 @@
</view>
</scroll-view>
<loading ref="loading" :custom="false" :shadeClick="false" :type="1" />
<!-- <loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> -->
</view>
</template>
<script>
import {
getRecordList
getTransRecord
} from '@/api/account/transactionRecord.js'
import {
getCurrentDate
@ -97,28 +101,7 @@
return {
searchText: '',
selectedDate: '',
recordList: [{
remark: 'salary',
changeBalance: 4106.32,
time: "2025/05/01",
typeStr: this.$languageData.tmp.salIn
},
{remark: 'Electricity bill payment',
changeBalance: -200.24,
time: "2025/05/02",
typeStr: this.$languageData.tmp.payUti,
},
{remark: 'Winning the lottery',
changeBalance: 2000,
time: "2025/05/03",
typeStr: this.$languageData.tmp.qrcodeIn,
},
{remark: 'Tax refund',
changeBalance: 106.32,
time: "2025/05/03",
typeStr: this.$languageData.tmp.refund,
}
],
recordList: [],
showList: [],
isLoading: false,
isRefreshing: false,
@ -131,21 +114,27 @@
phonenumber: '',
key: '',
key2: getCurrentDate(), //,
type: "1"
type: ""
},
}
},
computed: {
income(){
return this.showList.filter(i=>i.changeBalance > 0).reduce((tot, item)=>tot+item.changeBalance,0) || 0
income() {
return this.showList.filter(i => i.changeBalance > 0).reduce((tot, item) => tot + item.changeBalance, 0) ||
0
},
outcome(){
return -this.showList.filter(i=>i.changeBalance < 0).reduce((tot, item)=>tot+item.changeBalance,0) || 0
outcome() {
return -this.showList.filter(i => i.changeBalance < 0).reduce((tot, item) => tot + item.changeBalance,
0) || 0
}
},
created() {
this.selectRecordList();
},
onLoad(item) {
//TODO
this.showList = this.recordList
//this.showList = this.recordList
if (item.data) {
try {
let jsonString = decodeURIComponent(item.data); // JSON
@ -158,20 +147,32 @@
}
}
// uni.setNavigationBarTitle({title:"Ledger"})
this.selectRecordList();
},
methods: {
tabChg(e){
if(e.index!==0){
this.showList = [this.recordList[e.index-1]]
}else{
this.showList = [...this.recordList]
//tab
tabChg(e) {
if (e.index == 0) {
this.params.type = ""
} else if (e.index == 1) {
this.params.type = "BTR"; //
} else if (e.index == 2) {
this.params.type = "BPY"; //
} else if (e.index == 3) {
this.params.type = "BPT"; //
} else if (e.index == 4) {
this.params.type = "BRT"; //
} else if (e.index == 5) {
this.params.type = "BWL"; //
} else if (e.index == 6) {
this.params.type = "BRE"; //
}
this.selectRecordList();
},
searByName(name){
if(this.params.key.length !== 0)
this.showList = this.recordList.filter(i=>i.remark.includes(this.params.key))
searByName(name) {
if (this.params.key.length !== 0)
this.showList = this.recordList.filter(i => i.remark.includes(this.params.key))
},
getColor(value) {
if (value > 0) {
@ -183,19 +184,36 @@
}
},
selectRecordList() {
getTransRecord(this.params).then(res => {
this.recordList = res.data;
this.recordList.forEach(item => {
item.billCode = item.billCode.split("@")[0];
if (item.billCode == "BTR") {
item.billCode = this.$languageData.tmp.transferAccounts; //
} else if (item.billCode == "BPY") {
item.billCode = this.$languageData.tmp.proxyPayment; //
} else if (item.billCode == "BPT") {
item.billCode = this.$languageData.tmp.payment; //
} else if (item.billCode == "BRT") {
item.billCode = this.$languageData.tmp.receivePayment; //
} else if (item.billCode == "BWL") {
item.billCode = this.$languageData.tmp.withdrawal; //
} else if (item.billCode == "BRE") {
item.billCode = this.$languageData.tmp.recharge; //
} else {
item.billCode = this.$languageData.tmp.other; //
}
})
}).catch(e => {
//this.$refs.loading.close();
})
//this.$refs.loading.close();
//TODO
if (false) {
this.$nextTick(() => {
this.$refs.loading.open();
})
getRecordList(this.params).then(res => {
this.recordList = res.rows
setTimeout(() => {
this.$refs.loading.close();
}, 700)
}).catch(e => {
this.$refs.loading.close();
})
}
},
mockrecordList() {
@ -215,9 +233,9 @@
},
handleDateChange(e) {
//TODO
if(e.detail.value!=='2025-05'){
if (e.detail.value !== '2025-05') {
this.showList = []
}else{
} else {
this.showList = [...this.recordList]
}
this.params.key2 = e.detail.value

1
pages/account/transactionRecord.vue

@ -111,7 +111,6 @@
}
},
onLoad(item) {
console.log("item---", item)
// if(JSON.stringify(item) != "{}"){
// this.params.type = item.type
// this.params.id = item.id

Loading…
Cancel
Save