|
|
@ -117,9 +117,19 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label is-required">报价币种:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}"> |
|
|
|
<input required type="radio" th:id="${'commonCurrency_' + dict.dictCode}" name="commonCurrency" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|
|
|
<label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
|
<!-- <div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}">--> |
|
|
|
<!-- <input required type="radio" th:id="${'commonCurrency_' + dict.dictCode}" name="commonCurrency" th:value="${dict.dictValue}" th:checked="${dict.default}">--> |
|
|
|
<!-- <label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>--> |
|
|
|
<!-- </div>--> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input type="checkbox" id="rmb" name="currency" value="1" /> rmb/含税 |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input type="checkbox" id="usd" name="currency" value="2" /> 美元/不含税 |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -133,17 +143,17 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="form-group">--> |
|
|
|
<!-- <label class="col-sm-6 control-label is-required">是否含税:</label>--> |
|
|
|
<!-- <div class="col-sm-6">--> |
|
|
|
<!-- <div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">--> |
|
|
|
<!-- <input required type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}">--> |
|
|
|
<!-- <label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </div>--> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label is-required">是否含税:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> |
|
|
|
<input required type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|
|
|
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label is-required" >国内税率:</label> |
|
|
|
<label class="col-sm-6 control-label is-required" id="taxLable">国内税率:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input name="taxRate" class="form-control" placeholder="%" type="text" required/> |
|
|
|
</div> |
|
|
@ -282,12 +292,31 @@ |
|
|
|
$("select[name='businessMembers']").append("<option value='" + loginName + "'>" + userName + "</option>"); |
|
|
|
//验证是否含税,含税的话税率要填写。 |
|
|
|
function isTaxRate() { |
|
|
|
if ($("#confirmTax").val() == 1) { |
|
|
|
if ($('input[value=1]:checked').length > 0) { |
|
|
|
console.log('选框 1 已经被选中'); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
// 监听 change 事件 |
|
|
|
$('input[name=currency]').on('change', function() { |
|
|
|
var taxLable = $('#taxLable')[0]; |
|
|
|
var oldClass = taxLable.className.split(' '); |
|
|
|
if ($('input[value=1]:checked').length > 0){ |
|
|
|
// $('input[name=taxRate]').prop('required',true); |
|
|
|
if (!oldClass.includes('is-required')) { |
|
|
|
taxLable.classList.add('is-required'); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
// $('input[name=taxRate]').prop('required',false); |
|
|
|
for (var i = 0; i < oldClass.length; i++) { |
|
|
|
if (oldClass[i].includes('is-required')) { |
|
|
|
taxLable.classList.remove(oldClass[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
$("input[name='establishedTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
@ -304,9 +333,15 @@ |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
taxRate: { |
|
|
|
required: isTaxRate(), |
|
|
|
required: function () { |
|
|
|
if ($('input[value=1]:checked').length > 0) { |
|
|
|
console.log('选框 1 已经被选中'); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 验证失败的提示信息 |
|
|
|
messages: { |
|
|
@ -322,6 +357,7 @@ |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
$("select[name='businessMembers']").removeAttr("disabled"); |
|
|
|
console.log( $('#form-customer-add').serialize()); |
|
|
|
$.operate.save(prefix + "/add", $('#form-customer-add').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|