2024-09-23 13:41:19 +08:00
|
|
|
<template>
|
|
|
|
<view class="content">
|
|
|
|
<view class="container">
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class="">副卡额度</view>
|
|
|
|
<view class="dis">
|
2024-09-28 18:04:43 +08:00
|
|
|
{{memberInfo.secondaryCardLimit || 0}}
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class="">已用额度</view>
|
|
|
|
<view class="dis">
|
2024-09-28 18:04:43 +08:00
|
|
|
{{memberInfo.usedCreditLimit}}
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class="">剩余额度</view>
|
|
|
|
<view class="dis">
|
2024-09-28 18:04:43 +08:00
|
|
|
{{memberInfo.remainingCreditLimit}}
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
2024-09-28 18:04:43 +08:00
|
|
|
<view class="box-hang" @click="show = !show">
|
2024-09-23 13:41:19 +08:00
|
|
|
<view class=""><span style="color: red;">*</span>调整类型</view>
|
2024-09-28 18:04:43 +08:00
|
|
|
<view class="dis">
|
|
|
|
<text v-if="memberInfo.adjustType==0">增加</text>
|
|
|
|
<text v-if="memberInfo.adjustType==1">扣除</text>
|
2024-09-23 13:41:19 +08:00
|
|
|
<uni-icons type="right" size="16"></uni-icons>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class=""><span style="color: red;">*</span>调整额度</view>
|
|
|
|
<view class="dis">
|
2024-09-28 18:04:43 +08:00
|
|
|
<input v-model="memberInfo.adjustLimit" style="text-align: right;" placeholder="请输入"></input>
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class="">备注</view>
|
|
|
|
<view class="dis">
|
2024-09-28 18:04:43 +08:00
|
|
|
<input v-model="memberInfo.remark" style="text-align: right;" placeholder="请输入"></input>
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
2024-09-28 18:04:43 +08:00
|
|
|
<view class="but-sub" @click="submitFrom()">确认</view>
|
2024-09-23 13:41:19 +08:00
|
|
|
|
2024-09-30 16:54:06 +08:00
|
|
|
<u-picker :show="show" :columns="columns" keyName="label" @cancel="cancel" @confirm="confirm"></u-picker>
|
2024-09-23 13:41:19 +08:00
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import request from '../../utils/request';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
title: '',
|
|
|
|
List: [],
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
totalPage: '',
|
|
|
|
value: 0.00,
|
|
|
|
value1: true,
|
|
|
|
show: false,
|
|
|
|
columns: [
|
2024-09-30 16:54:06 +08:00
|
|
|
[{
|
|
|
|
label:'增加',
|
|
|
|
value: 0
|
|
|
|
}, {
|
|
|
|
label:'扣除',
|
|
|
|
value: 1
|
|
|
|
}]
|
2024-09-23 13:41:19 +08:00
|
|
|
],
|
2024-09-28 18:04:43 +08:00
|
|
|
memberInfo: {},
|
|
|
|
memberId: ''
|
2024-09-23 13:41:19 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onPullDownRefresh() {
|
|
|
|
//下拉刷新
|
|
|
|
|
|
|
|
},
|
|
|
|
onReachBottom() {
|
|
|
|
// 触底加载
|
|
|
|
if (this.pageNo >= this.totalPage) {
|
2024-09-28 18:04:43 +08:00
|
|
|
|
2024-09-23 13:41:19 +08:00
|
|
|
} else {
|
|
|
|
this.pageNo++
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
2024-09-28 18:04:43 +08:00
|
|
|
onLoad(e) {
|
|
|
|
this.memberId = e.memberId
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.getInfo()
|
|
|
|
},
|
2024-09-23 13:41:19 +08:00
|
|
|
components: {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
2024-09-30 16:54:06 +08:00
|
|
|
submitFrom() {
|
2024-10-08 14:09:45 +08:00
|
|
|
console.log('调整类型',this.memberInfo.adjustType);
|
|
|
|
console.log('判断',this.memberInfo.adjustType === '');
|
|
|
|
if (this.memberInfo.adjustType === '') {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '请选择调整类型',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
2024-09-30 16:54:06 +08:00
|
|
|
if (!this.memberInfo.adjustLimit) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '请输入调整额度',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
request({
|
|
|
|
url: 'fleetMember/editLimitPC',
|
|
|
|
method: 'put',
|
2024-09-30 16:54:06 +08:00
|
|
|
data: this.memberInfo
|
2024-09-28 18:04:43 +08:00
|
|
|
}).then(res => {
|
2024-09-30 16:54:06 +08:00
|
|
|
if (res.data == 1) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.navigateBack()
|
2024-09-30 16:54:06 +08:00
|
|
|
} else if (res.data == 2) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '共享副卡-不限额,暂不支持修改',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
2024-09-30 16:54:06 +08:00
|
|
|
} else if (res.data == 3) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '当前车队卡剩余额度不足,无法扣除',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
2024-09-30 16:54:06 +08:00
|
|
|
} else if (res.data == 4) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '当前车队卡剩余额度不足,无法扣除',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
2024-09-30 16:54:06 +08:00
|
|
|
} else if (res.data == 5) {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '当前副卡剩余额度不足,无法扣除',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
2024-09-30 16:54:06 +08:00
|
|
|
} else {
|
2024-09-28 18:04:43 +08:00
|
|
|
uni.showToast({
|
2024-09-30 16:54:06 +08:00
|
|
|
title: '修改失败,请联系管理员',
|
|
|
|
icon: 'none'
|
2024-09-28 18:04:43 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getInfo() {
|
|
|
|
request({
|
|
|
|
url: '/fleetMember/' + this.memberId,
|
|
|
|
method: 'get',
|
|
|
|
}).then(res => {
|
|
|
|
this.memberInfo = res.data
|
|
|
|
})
|
|
|
|
},
|
2024-09-23 13:41:19 +08:00
|
|
|
cancel() {
|
|
|
|
this.show = false
|
|
|
|
},
|
2024-09-28 18:04:43 +08:00
|
|
|
confirm(e) {
|
2024-09-30 16:54:06 +08:00
|
|
|
// this.memberInfo.adjustType = e.indexs[0]
|
|
|
|
this.memberInfo.adjustType = e.value[0].value
|
|
|
|
console.log("this.memberInfo.adjustType",this.memberInfo.adjustType);
|
|
|
|
console.log(this.memberInfo.adjustType, e.indexs[0], e, 130);
|
2024-09-23 13:41:19 +08:00
|
|
|
this.show = false
|
|
|
|
},
|
|
|
|
goback() {
|
|
|
|
uni.navigateBack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.content {
|
|
|
|
background: #f4f5f6;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container {
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.my-header {
|
|
|
|
width: 100%;
|
|
|
|
height: 88px;
|
|
|
|
background: #ffffff;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
color: #000;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 0px 15px;
|
|
|
|
padding-top: 40px;
|
|
|
|
z-index: 99999;
|
|
|
|
|
|
|
|
.my-icons {
|
|
|
|
width: 20px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
top: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box-hang {
|
|
|
|
background-color: white;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 15px 15px;
|
|
|
|
border-bottom: 1px solid #f4f5f6;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dis {
|
|
|
|
color: #a69999;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box-end {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.but-sub {
|
|
|
|
width: 305px;
|
|
|
|
height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
margin: 0 auto;
|
|
|
|
background-color: #FF9655;
|
|
|
|
color: white;
|
|
|
|
border-radius: 50px;
|
|
|
|
text-align: center;
|
2024-09-23 17:39:15 +08:00
|
|
|
position: absolute;
|
2024-09-24 08:52:56 +08:00
|
|
|
bottom: 40px;
|
|
|
|
left: 11%;
|
2024-09-23 13:41:19 +08:00
|
|
|
}
|
|
|
|
</style>
|