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