feat(financial): 充值不能输入负数
This commit is contained in:
parent
ec3435b678
commit
daf38b19fa
|
@ -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>
|
Loading…
Reference in New Issue