| | |
| | | |
| | | $("#experienceName").val('') |
| | | $("#experienceName").attr('disabled', 'disabled'); |
| | | $("#goods").attr('disabled', 'disabled'); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | $("#experienceName").val('') |
| | | $("#experienceName").attr('disabled', 'disabled'); |
| | | $("#goods").attr('disabled', 'disabled'); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | $("#voucherAmount").val('') |
| | | $("#voucherAmount").attr('disabled', 'disabled'); |
| | | $("#goods").attr('disabled', 'disabled'); |
| | | |
| | | } |
| | | function radio4() { |
| | | $("#goods").removeAttr("disabled"); |
| | | |
| | | $("#conditionalAmount").val('') |
| | | $("#deductionAmount").val('') |
| | | $("#deductionAmount").attr('disabled', 'disabled'); |
| | | $("#conditionalAmount").attr('disabled', 'disabled'); |
| | | |
| | | $("#voucherAmount").val('') |
| | | $("#voucherAmount").attr('disabled', 'disabled'); |
| | | $("#experienceName").val('') |
| | | $("#experienceName").attr('disabled', 'disabled'); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | couponInfoDlg.audit = function () { |
| | | var id = $("#id").val(); |
| | | var state = $("#state").val(); |
| | | console.log("让我看看state") |
| | | console.log(state) |
| | | if (state == "未通过"){ |
| | | Feng.error("当前优惠券不可再次审核!"); |
| | | return ; |
| | | } |
| | | let audit = document.querySelector('input[name="r1"]:checked').value; |
| | | let text = $("#text").val() |
| | | if(audit==3){ |
| | |
| | | let voucherAmount = $('#voucherAmount').val(); |
| | | // 体验券名称 |
| | | let experienceName = $('#experienceName').val(); |
| | | let goods = $('#goods').val(); |
| | | if (prescription === '1'){ |
| | | if (conditionalAmount === undefined || conditionalAmount === '' || conditionalAmount === null){ |
| | | return Feng.error('条件金额不能为空'); |
| | |
| | | if (prescription === '3'){ |
| | | if (experienceName === undefined || experienceName === '' || experienceName === null){ |
| | | return Feng.error('体验券名称不能为空'); |
| | | } |
| | | } |
| | | if (prescription === '4'){ |
| | | if (goods === undefined || goods === '' || goods === null){ |
| | | return Feng.error('请选择抵扣商品'); |
| | | } |
| | | } |
| | | |
| | |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("periodOfValidity",periodOfValidity); |
| | | if (prescription === '4'){ |
| | | ajax.set("goodsId",goods); |
| | | }else{ |
| | | ajax.set("goodsId",0); |
| | | } |
| | | |
| | | if ($('#userType').val()==2) { |
| | | ajax.set("exchangeMethod",1); |
| | |
| | | distributionMethodOptions[i].addEventListener('change', function() { |
| | | // 获取选中的distributionMethod值 |
| | | const selectedDistributionMethod = document.querySelector('input[name="distributionMethod"]:checked').value; |
| | | |
| | | console.log("看看选择") |
| | | console.log(selectedDistributionMethod); |
| | | // 判断选中的值是否不等于1 |
| | | if (selectedDistributionMethod !== '1') { |
| | | console.log("已经选择1") |
| | |
| | | document.getElementById('needAmount').style.display = 'block'; |
| | | document.getElementById('needIntegral').style.display = 'block'; |
| | | } |
| | | // 如果选择发放方式为注册赠送 |
| | | if (selectedDistributionMethod == "2"){ |
| | | const userGroupRadios = document.querySelectorAll('input[name="userGroup"][value="1"], input[name="userGroup"][value="3"]'); |
| | | console.log("看看要隐藏的") |
| | | console.log(userGroupRadios) |
| | | // 隐藏值为 1 或 2 的 radio 按钮,并显示值为 2 的 radio 按钮 |
| | | userGroupRadios.forEach(userRadio => { |
| | | console.log("隐藏啊") |
| | | userRadio.style.display = 'none'; |
| | | }); |
| | | $('#u1').hide(); |
| | | $('#u3').hide(); |
| | | const userGroupTwo = document.querySelector('input[name="userGroup"][value="2"]'); |
| | | userGroupTwo.style.display = 'inline-block'; |
| | | userGroupTwo.checked = true; |
| | | }else{ |
| | | // 如果选择的不是值为 2 的 radio 按钮,则显示所有的 userGroup radio 按钮 |
| | | const userGroupRadios = document.querySelectorAll('input[name="userGroup"]'); |
| | | userGroupRadios.forEach(userRadio => { |
| | | userRadio.style.display = 'inline-block'; |
| | | }); |
| | | const userGroupTwo = document.querySelector('input[name="userGroup"][value="1"]'); |
| | | userGroupTwo.style.display = 'inline-block'; |
| | | userGroupTwo.checked = true; |
| | | $('#u1').show(); |
| | | $('#u3').show(); |
| | | } |
| | | }); |
| | | } |
| | | |