diff --git a/src/views/record/OfficicalGoldView.vue b/src/views/record/OfficicalGoldView.vue index 0572cef..c7490ad 100644 --- a/src/views/record/OfficicalGoldView.vue +++ b/src/views/record/OfficicalGoldView.vue @@ -185,7 +185,81 @@ export default { $("#btnGive").click(function () { //校验 - check(); + if (isGiveBol) { + return; + } + var type = $('#type').val(); + var erBanNos = $("#ernos").val(); + var actualAmount = $('#actualAmount').val(); + var num = $('#num').val(); + var busType = $('#busType').val(); + if (!erBanNos) { + $("#tipMsg").text("请输入平台ID"); + $("#tipModal").modal('show'); + return; + } + if (type == 'COMPANY_ACCOUNT_DIAMOND') { + if (!actualAmount) { + $("#tipMsg").text("请输入实际充值金额数"); + $("#tipModal").modal('show'); + return; + } + var reg = actualAmount.match(/^[0-9]+(.[0-9]{1,3})?$/); + if (reg == null) { + $("#tipMsg").text("请输入合理的充值金额数"); + $("#tipModal").modal('show'); + return; + } + if (actualGold != parseInt(actualAmount * 1000)) { + $("#tipMsg").text("赠送钻石与充值金额兑换比例不正确!"); + $("#tipModal").modal('show'); + return; + } + } + if (type != 'CLEAR_USER_GOLD') { + if (busType == null || busType.trim() == '') { + $("#tipMsg").text("请填写分类"); + $("#tipModal").modal('show'); + return; + } + } if (isGiveBol) { + return; + } + var type = $('#type').val(); + var erBanNos = $("#ernos").val(); + var actualAmount = $('#actualAmount').val(); + var num = $('#num').val(); + var busType = $('#busType').val(); + if (!erBanNos) { + $("#tipMsg").text("请输入平台ID"); + $("#tipModal").modal('show'); + return; + } + if (type == 'COMPANY_ACCOUNT_DIAMOND') { + if (!actualAmount) { + $("#tipMsg").text("请输入实际充值金额数"); + $("#tipModal").modal('show'); + return; + } + var reg = actualAmount.match(/^[0-9]+(.[0-9]{1,3})?$/); + if (reg == null) { + $("#tipMsg").text("请输入合理的充值金额数"); + $("#tipModal").modal('show'); + return; + } + if (actualGold != parseInt(actualAmount * 1000)) { + $("#tipMsg").text("赠送钻石与充值金额兑换比例不正确!"); + $("#tipModal").modal('show'); + return; + } + } + if (type != 'CLEAR_USER_GOLD') { + if (busType == null || busType.trim() == '') { + $("#tipMsg").text("请填写分类"); + $("#tipModal").modal('show'); + return; + } + } //参数 var type = $('#type').val(); var erBanNos = $("#ernos").val();