代码更新
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
ref="uFormRef"
|
||||
>
|
||||
<view class="card">
|
||||
|
||||
<up-form-item label="挂账人" prop="debtor" borderBottom="true" >
|
||||
<up-input v-model="pageData.formData.debtor" placeholder="请输入挂账人" border="none" ></up-input>
|
||||
</up-form-item>
|
||||
@@ -57,11 +56,12 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { debounce } from '@/commons/utils/debounce.js'
|
||||
import { addCreditBuyer, editCreditBuyer } from '@/http/yskApi/credit.js'
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { debounce } from '@/commons/utils/debounce.js'
|
||||
import { addCreditBuyer,editCreditBuyer } from '@/api/buyer.js';
|
||||
|
||||
const pageData = reactive({
|
||||
id: null,
|
||||
title: "",
|
||||
@@ -195,6 +195,8 @@
|
||||
background: #318AFE;
|
||||
}
|
||||
.cancel{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
<script setup>
|
||||
import { reactive,ref } from 'vue';
|
||||
import { debounce } from '@/commons/utils/debounce.js'
|
||||
import { creditRePayment, creditPayment } from '@/http/yskApi/credit.js'
|
||||
import { getCreditBuyerPage,creditBuyerRepayment,creditBuyerOrderPay } from '@/api/buyer.js';
|
||||
|
||||
const props=defineProps({
|
||||
show:{
|
||||
type:Boolean,
|
||||
@@ -156,7 +157,7 @@
|
||||
...pageData.formData
|
||||
}
|
||||
if ( !pageData.formData.orderId ) {
|
||||
creditRePayment(params).then((res) => {
|
||||
creditBuyerRepayment(params).then((res) => {
|
||||
console.log(res.repaymentCount > 0)
|
||||
if (res.repaymentCount > 0) {
|
||||
uni.$u.toast('还款成功')
|
||||
@@ -173,7 +174,7 @@
|
||||
|
||||
})
|
||||
} else {
|
||||
creditPayment(params).then((res) => {
|
||||
creditBuyerOrderPay(params).then((res) => {
|
||||
if (!res.repaymentMsg) {
|
||||
uni.$u.toast('付款成功')
|
||||
emits('affirm')
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
<view class="shade" v-show="pageData.showStatus" @tap="pageData.showStatus=false"></view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { reactive, ref, computed, getCurrentInstance } from 'vue';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import myRepayment from './components/my-repayment';
|
||||
import datePickerview from './components/my-date-pickerview.vue'
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { creditBuyerOrderList, creditBuyerOrderSummary } from '@/http/yskApi/credit.js'
|
||||
import { reactive, ref, computed, getCurrentInstance } from 'vue';
|
||||
import { creditBuyerOrderList, creditBuyerOrderSummary } from '@/api/buyer.js';
|
||||
const pageData = reactive({
|
||||
showStatus: false,
|
||||
statusList:[
|
||||
@@ -173,8 +173,8 @@
|
||||
params.endDate = endDate.substring(0, 10);
|
||||
}
|
||||
creditBuyerOrderList(params).then(res => {
|
||||
pageData.list = [...pageData.list,...res.content]
|
||||
pageData.totalElements = res.totalElements
|
||||
pageData.list = [...pageData.list,...res.records]
|
||||
pageData.totalElements = res.totalRow
|
||||
})
|
||||
creditBuyerOrderSummary(params).then(res => {
|
||||
pageData.payCountList[0].amount = res.payAmountTotal
|
||||
@@ -186,7 +186,6 @@
|
||||
}
|
||||
function changeTime(e) {
|
||||
pageData.selected = e
|
||||
console.log(e)
|
||||
if (e == 'custom') {
|
||||
currentInstance.ctx.$refs.datePicker.toggle()
|
||||
} else {
|
||||
@@ -198,9 +197,9 @@
|
||||
function datePickerConfirm(e) {
|
||||
pageData.start = e.start
|
||||
pageData.end = e.end
|
||||
pageData.query.page = 1;
|
||||
pageData.list = [];
|
||||
getList()
|
||||
// gettableData() day如日期不能是1 7 30 就回报错
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,6 +210,8 @@
|
||||
pageData.showStatus = false
|
||||
pageData.statusTitle = item.label
|
||||
pageData.query.status = item.value
|
||||
pageData.query.page = 1;
|
||||
pageData.list = [];
|
||||
getList()
|
||||
}
|
||||
let repaymentOpen = (item) => {
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
<text>{{pageData.title}}</text>
|
||||
<up-icon name="arrow-down-fill" size="12" style="margin-left: 12rpx;"></up-icon>
|
||||
</view>
|
||||
<!-- <view class="input">
|
||||
<input v-model="pageData.query.keywords" @input="inputEvent" type="text" placeholder="搜索挂账人或者手机号" />
|
||||
</view> -->
|
||||
<view class="input">
|
||||
<up-input
|
||||
shape='circle'
|
||||
@@ -82,25 +79,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { onShow, onReachBottom } from '@dcloudio/uni-app'
|
||||
|
||||
import myRepayment from './components/my-repayment';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
import {
|
||||
getCreditBuyerList,
|
||||
editCreditBuyer,
|
||||
delCreditBuyer
|
||||
} from '@/http/yskApi/credit.js';
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||
|
||||
import { getCreditBuyerPage,editCreditBuyer,delCreditBuyer } from '@/api/buyer.js';
|
||||
|
||||
let pageData = reactive({
|
||||
showStatus: false,
|
||||
@@ -141,15 +128,14 @@
|
||||
* 获取挂账人列表
|
||||
*/
|
||||
async function getList() {
|
||||
getCreditBuyerList({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
repaymentStatus: pageData.query.repaymentStatus,
|
||||
getCreditBuyerPage({
|
||||
keywords: pageData.query.keywords,
|
||||
repaymentStatus: pageData.query.repaymentStatus,
|
||||
size: pageData.query.size,
|
||||
page: pageData.query.page
|
||||
}).then(res => {
|
||||
pageData.list = res.content
|
||||
pageData.totalElements = res.totalElements
|
||||
pageData.list = res.records
|
||||
pageData.totalElements = res.totalRow
|
||||
})
|
||||
}
|
||||
|
||||
@@ -294,6 +280,7 @@
|
||||
background-color: #fff;
|
||||
>view{
|
||||
margin-bottom: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
}
|
||||
.debtor{
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import { creditRePaymentRecord } from '@/http/yskApi/credit.js'
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
|
||||
import { creditRePaymentRecord } from '@/api/buyer.js';
|
||||
const pageData = reactive({
|
||||
query: {
|
||||
page: 1,
|
||||
@@ -38,6 +39,7 @@
|
||||
orderId: null,
|
||||
paymentMethod: ''
|
||||
},
|
||||
totalElements: 0,
|
||||
list: []
|
||||
})
|
||||
|
||||
@@ -51,7 +53,14 @@
|
||||
}
|
||||
getList()
|
||||
})
|
||||
|
||||
// 监听,触底事件。 查询下一页
|
||||
onReachBottom(() => {
|
||||
console.log(pageData.query.page)
|
||||
if( pageData.query.page * pageData.query.size < pageData.totalElements) {
|
||||
pageData.query.page++
|
||||
getList();
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 获取还款记录列表
|
||||
*/
|
||||
@@ -66,7 +75,8 @@
|
||||
params.orderId = pageData.query.orderId
|
||||
}
|
||||
creditRePaymentRecord(params).then(res => {
|
||||
pageData.list = res.content
|
||||
pageData.list = [...pageData.list,...res.records]
|
||||
pageData.totalElements = res.totalRow
|
||||
})
|
||||
}
|
||||
|
||||
@@ -75,7 +85,8 @@
|
||||
*/
|
||||
function inputEvent(d) {
|
||||
pageData.query.paymentMethod = pageData.query.paymentMethod.replace(/\s*/g, "");
|
||||
console.log(pageData.query)
|
||||
pageData.query.size = 1;
|
||||
pageData.list = [];
|
||||
getList()
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user