feat(financial): 充值不能输入负数

This commit is contained in:
woody 2025-06-05 11:15:48 +08:00
parent ec3435b678
commit daf38b19fa
1 changed files with 160 additions and 159 deletions

View File

@ -31,19 +31,16 @@
<u-row gutter="10">
<u-col span="12">
<u-form-item :label="'充值方式'">
<u-radio-group
v-model="rechargeMethod"
placement="row"
<u-radio-group v-model="rechargeMethod" placement="row">
<u-radio
:customStyle="{ marginLeft: '20rpx' }"
v-for="(item, index) in czWayList"
:key="index"
:label="item.label"
:name="item.value"
>
<u-radio
:customStyle="{ marginLeft: '20rpx' }"
v-for="(item, index) in czWayList"
:key="index"
:label="item.label"
:name="item.value"
>
</u-radio>
</u-radio-group>
</u-radio>
</u-radio-group>
</u-form-item>
</u-col>
</u-row>
@ -91,14 +88,19 @@
<u-col span="12">
<u-form-item
:label="
item.pkTransactionKeyVal +
`${'变更'}(${isLocalSymbol()})`
item.pkTransactionKeyVal + `${'变更'}(${isLocalSymbol()})`
"
>
<u--input
fontSize="24rpx"
<u-number-box
:style="{
width: '100%',
}"
inputWidth="100%"
:min="0"
:showMinus="false"
:showPlus="false"
v-model="tableData[0].rechargeDetailMap[`${item.pkId}`]"
></u--input>
></u-number-box>
</u-form-item>
</u-col>
</u-row>
@ -130,7 +132,6 @@
@click="saveDate"
color="#C8161D"
text="充值"
v-hasButtons="['ChongzhiConfirm']"
class="btnn"
></u-button>
@ -140,157 +141,157 @@
</view>
</template>
<script>
import * as api from "@/api/financial";
import { isLocals, isLocalSymbol } from "@/util/numberToCurrency";
import * as api from '@/api/financial';
import { isLocals, isLocalSymbol } from '@/util/numberToCurrency';
export default {
data() {
return {
tableData: [],
select: {
memberCode: "",
},
rechargeMethod: 1,
czWayList: [], //
enumsAccountList: [], //
paymentTypeList: [], //
};
},
onLoad() {
//
this.getpaymentType();
//
this.getrechargeMethod();
},
methods: {
isLocalSymbol,
//
saveDate() {
export default {
data() {
return {
tableData: [],
select: {
memberCode: '',
},
rechargeMethod: 1,
czWayList: [], //
enumsAccountList: [], //
paymentTypeList: [], //
};
},
onLoad() {
//
this.getpaymentType();
//
this.getrechargeMethod();
},
methods: {
isLocalSymbol,
//
saveDate() {
let shouldTerminate = false;
let shouldTerminate = false;
this.tableData.forEach((ele) => {
if (!ele.paymentMethod) {
shouldTerminate = true;
uni.showToast({
title: '交款方式不能为空',
icon: "none",
this.tableData.forEach((ele) => {
if (!ele.paymentMethod) {
shouldTerminate = true;
uni.showToast({
title: '交款方式不能为空',
icon: 'none',
duration: 1500,
});
return;
}
});
if (!shouldTerminate) {
uni.navigateTo({
url:
"/pages/financial/czzxqc?czlx=1&rechargeMethod=" +
this.rechargeMethod +
"&detailParams=" +
JSON.stringify(this.tableData),
}
});
}
},
bindPickerChange1(e) {
this.$set(
this.tableData[0],
"paymentMethodName",
this.paymentTypeList[e.detail.value].label
);
this.$set(
this.tableData[0],
"paymentMethod",
this.paymentTypeList[e.detail.value].value
);
},
//
getenumsCzAccount() {
api.getenumsCzAccount({ accountProperty: 1 }).then((res) => {
this.enumsAccountList = res.rows;
});
},
//
getpaymentType() {
api.getpaymentType().then((res) => {
this.paymentTypeList = res.data;
});
},
//
getrechargeMethod() {
api.getrechargeMethod().then((res) => {
this.czWayList = res.data;
});
},
//
changeName() {
api.getMemberName({ memberCode: this.select.memberCode }).then((res) => {
this.$set(this.select, "memberName", res.memberName);
this.getList();
});
},
getList() {
api
.changeAccountType({
memberCode: this.select.memberCode,
memberName: this.select.memberName,
})
.then((res) => {
res.data.forEach((ele) => {
ele.rechargeDetailMap = {};
if (!shouldTerminate) {
uni.navigateTo({
url:
'/pages/financial/czzxqc?czlx=1&rechargeMethod=' +
this.rechargeMethod +
'&detailParams=' +
JSON.stringify(this.tableData),
});
this.tableData = res.data;
//
this.getenumsCzAccount();
}
},
bindPickerChange1(e) {
this.$set(
this.tableData[0],
'paymentMethodName',
this.paymentTypeList[e.detail.value].label
);
this.$set(
this.tableData[0],
'paymentMethod',
this.paymentTypeList[e.detail.value].value
);
},
//
getenumsCzAccount() {
api.getenumsCzAccount({ accountProperty: 1 }).then((res) => {
this.enumsAccountList = res.rows;
});
},
//
getpaymentType() {
api.getpaymentType().then((res) => {
this.paymentTypeList = res.data;
});
},
//
getrechargeMethod() {
api.getrechargeMethod().then((res) => {
this.czWayList = res.data;
});
},
//
changeName() {
api
.getMemberName({ memberCode: this.select.memberCode })
.then((res) => {
this.$set(this.select, 'memberName', res.memberName);
this.getList();
});
},
getList() {
api
.changeAccountType({
memberCode: this.select.memberCode,
memberName: this.select.memberName,
})
.then((res) => {
res.data.forEach((ele) => {
ele.rechargeDetailMap = {};
});
this.tableData = res.data;
//
this.getenumsCzAccount();
});
},
radioChange(n) {
this.rechargeMethod = n;
},
},
radioChange(n) {
this.rechargeMethod = n;
},
},
};
};
</script>
<style lang="scss" scoped>
::v-deep .u-form-item__body__left__content__label {
font-size: 24rpx;
font-weight: bold;
}
.content {
padding: 18rpx 24rpx 120rpx 24rpx;
background: #f9f9f9;
.footer {
background: #ffffff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx;
<style lang="scss" scoped>
::v-deep .u-form-item__body__left__content__label {
font-size: 24rpx;
font-weight: bold;
}
.top_view {
padding: 20rpx 22rpx;
background: #ffffff;
margin-bottom: 20rpx;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(204, 204, 204, 0.4);
border-radius: 20rpx;
.top_flex {
display: flex;
border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
padding-bottom: 22rpx;
.flex_view1 {
margin-right: 300rpx;
}
.text1 {
font-size: 20rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
margin-bottom: 10rpx;
}
.text2 {
font-size: 24rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
.content {
padding: 18rpx 24rpx 120rpx 24rpx;
background: #f9f9f9;
.footer {
background: #ffffff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx;
}
.top_view {
padding: 20rpx 22rpx;
background: #ffffff;
margin-bottom: 20rpx;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(204, 204, 204, 0.4);
border-radius: 20rpx;
.top_flex {
display: flex;
border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
padding-bottom: 22rpx;
.flex_view1 {
margin-right: 300rpx;
}
.text1 {
font-size: 20rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
margin-bottom: 10rpx;
}
.text2 {
font-size: 24rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
}
}
}
}
}
</style>