|
|
@ -116,10 +116,15 @@ |
|
|
|
<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}" th:field="*{commonCurrency}"> |
|
|
|
<label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}" ></label> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input type="checkbox" id="rmb" name="currency" value="1" th:field="*{currency}" th:checked="${currency != null and #lists.contains(currency, '1')}"/> rmb/含税 |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<div class="checkbox"> |
|
|
|
<label> |
|
|
|
<input type="checkbox" id="usd" name="currency" value="2" th:field="*{currency}" th:checked="${currency != null and #lists.contains(currency, '2')}"/> 美元/不含税 |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -132,18 +137,8 @@ |
|
|
|
</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}" th:field="*{confirmTax}"></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="taxLabel">国内税率:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="input-group"> |
|
|
|
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" required /> |
|
|
@ -281,6 +276,59 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
$(function(){ |
|
|
|
// 监听 change 事件 |
|
|
|
$('input[name=currency]').on('change', function() { |
|
|
|
var taxLable = $('#taxLabel')[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", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("#form-customer-edit").validate({ |
|
|
|
focusCleanup: true, |
|
|
|
//配置验证规则,key就是被验证的dom对象,value就是调用验证的方法(也是json格式) |
|
|
|
rules: { |
|
|
|
//这里的customerPurser 指的是上面标签的name属性 |
|
|
|
customerPurser: { |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
taxRate: { |
|
|
|
required: function () { |
|
|
|
if ($('input[value=1]:checked').length > 0) { |
|
|
|
console.log('选框 1 已经被选中'); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
// 验证失败的提示信息 |
|
|
|
messages: { |
|
|
|
customerPurser: { |
|
|
|
required: "必填" //自定义required的错误信息内容 |
|
|
|
}, |
|
|
|
taxRate: { |
|
|
|
required: "必填", |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
@ -298,7 +346,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
$("input[name='establishedTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|