提交表单信息成功

This commit is contained in:
WindowBird 2025-08-20 15:45:08 +08:00
parent d25fae6eea
commit 5c2c7c483f
2 changed files with 18 additions and 23 deletions

View File

@ -18,13 +18,16 @@ export function addBankAccount(params) {
return request({ return request({
url: '/app/account', url: '/app/account',
method: 'POST', method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
},
data: { data: {
type: params.type || 'BANK', type: params.type || 'BANK',
no: params.no, no: params.no,
name: params.name, name: params.name,
idCard: params.idCard, idCard: params.idCard,
mobile: params.mobile mobile: params.mobile,
} },
}) })
} }
@ -36,10 +39,10 @@ export function addBankAccount(params) {
export function deleteBankAccount(ids) { export function deleteBankAccount(ids) {
// 如果传入的是数组,转换为逗号分隔的字符串 // 如果传入的是数组,转换为逗号分隔的字符串
const idString = Array.isArray(ids) ? ids.join(',') : ids const idString = Array.isArray(ids) ? ids.join(',') : ids
return request({ return request({
url: `/app/account/${idString}`, url: `/app/account/${idString}`,
method: 'DELETE' method: 'DELETE',
}) })
} }
@ -50,7 +53,7 @@ export function deleteBankAccount(ids) {
export function getBankAccountList() { export function getBankAccountList() {
return request({ return request({
url: '/app/account', url: '/app/account',
method: 'GET' method: 'GET',
}) })
} }
@ -74,7 +77,7 @@ export function updateBankAccount(params) {
no: params.no, no: params.no,
name: params.name, name: params.name,
idCard: params.idCard, idCard: params.idCard,
mobile: params.mobile mobile: params.mobile,
} },
}) })
} }

View File

@ -9,12 +9,7 @@
<view class="modal-body"> <view class="modal-body">
<view class="form-item"> <view class="form-item">
<text class="form-label">账户类型</text> <text class="form-label">账户类型</text>
<picker <picker :range="typeOptions" :value="typeIndex" range-key="label" @change="onTypeChange">
:range="typeOptions"
:value="typeIndex"
range-key="label"
@change="onTypeChange"
>
<view class="picker-value">{{ typeOptions[typeIndex].label }}</view> <view class="picker-value">{{ typeOptions[typeIndex].label }}</view>
</picker> </picker>
</view> </view>
@ -63,9 +58,9 @@
<view class="modal-footer"> <view class="modal-footer">
<view class="modal-btn cancel-btn" @click="handleClose">取消</view> <view class="modal-btn cancel-btn" @click="handleClose">取消</view>
<view <view
:class="{ 'loading-btn': loading }" :class="{ 'loading-btn': loading }"
class="modal-btn confirm-btn" class="modal-btn confirm-btn"
@click="handleSubmit" @click="handleSubmit"
> >
{{ loading ? '添加中...' : '确认添加' }} {{ loading ? '添加中...' : '确认添加' }}
@ -83,8 +78,8 @@ export default {
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() { data() {
return { return {
@ -118,7 +113,7 @@ export default {
if (newVal) { if (newVal) {
this.resetForm() this.resetForm()
} }
} },
}, },
methods: { methods: {
// //
@ -256,6 +251,7 @@ export default {
} }
.modal-content { .modal-content {
padding: 30rpx;
width: 90%; width: 90%;
max-width: 600rpx; max-width: 600rpx;
background: #fff; background: #fff;
@ -288,8 +284,6 @@ export default {
} }
.modal-body { .modal-body {
padding: 30rpx;
.form-item { .form-item {
margin-bottom: 30rpx; margin-bottom: 30rpx;
@ -302,7 +296,6 @@ export default {
} }
.form-input { .form-input {
width: 100%;
height: 80rpx; height: 80rpx;
border: 1rpx solid #e0e0e0; border: 1rpx solid #e0e0e0;
border-radius: 10rpx; border-radius: 10rpx;
@ -318,7 +311,6 @@ export default {
} }
.picker-value { .picker-value {
width: 100%;
height: 80rpx; height: 80rpx;
border: 1rpx solid #e0e0e0; border: 1rpx solid #e0e0e0;
border-radius: 10rpx; border-radius: 10rpx;