|
|
@ -189,7 +189,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">美元汇率:</label> |
|
|
|
<label class="col-sm-3 control-label is-required" id="usdLabel">美元汇率:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required /> |
|
|
|
</div> |
|
|
@ -205,7 +205,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">国内税率:</label> |
|
|
|
<label class="col-sm-3 control-label is-required" id="rmbLabel">国内税率:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="number" required> |
|
|
|
</div> |
|
|
@ -332,7 +332,7 @@ |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var sysSalesOrder = [[${sysSalesOrder}]]; |
|
|
|
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; |
|
|
|
$("#form-salesOrder-edit").validate({focusCleanup: true}); |
|
|
|
// $("#form-salesOrder-edit").validate({focusCleanup: true}); |
|
|
|
$(function() { |
|
|
|
var options = { |
|
|
|
id:'bootstrap-table-editOrder', |
|
|
@ -598,7 +598,53 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
var rmbLabel = $('#rmbLabel')[0]; |
|
|
|
var rmbClass = rmbLabel.className.split(' '); |
|
|
|
var usdLabel = $('#usdLabel')[0]; |
|
|
|
var usdClass = usdLabel.className.split(' '); |
|
|
|
var commonCurrency = [[${sysSalesOrder.commonCurrency}]]; |
|
|
|
if(commonCurrency==="1"){ |
|
|
|
for (var i = 0; i < usdClass.length; i++) { |
|
|
|
if (usdClass[i].includes('is-required')) { |
|
|
|
usdLabel.classList.remove(usdClass[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(commonCurrency==="2"){ |
|
|
|
for (var i = 0; i < rmbClass.length; i++) { |
|
|
|
if (rmbClass[i].includes('is-required')) { |
|
|
|
rmbLabel.classList.remove(rmbClass[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
// 选择币种 |
|
|
|
$("#commonCurrency_edit").on('change', function() { |
|
|
|
var selectedValue = $(this).val(); |
|
|
|
var rmbLabel = $('#rmbLabel')[0]; |
|
|
|
var rmbClass = rmbLabel.className.split(' '); |
|
|
|
var usdLabel = $('#usdLabel')[0]; |
|
|
|
var usdClass = usdLabel.className.split(' '); |
|
|
|
console.log(usdLabel); |
|
|
|
console.log(usdClass); |
|
|
|
if(selectedValue ==="1"){ |
|
|
|
if (!rmbClass.includes('is-required')) { |
|
|
|
rmbLabel.classList.add('is-required'); |
|
|
|
} |
|
|
|
for (var i = 0; i < usdClass.length; i++) { |
|
|
|
if (usdClass[i].includes('is-required')) { |
|
|
|
usdLabel.classList.remove(usdClass[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(selectedValue ==="2"){ |
|
|
|
if (!usdClass.includes('is-required')) { |
|
|
|
usdLabel.classList.add('is-required'); |
|
|
|
} |
|
|
|
for (var i = 0; i < rmbClass.length; i++) { |
|
|
|
if (rmbClass[i].includes('is-required')) { |
|
|
|
rmbLabel.classList.remove(rmbClass[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#customerContact_edit').on('select2:select', function (e) { |
|
|
|
var data = e.params.data; |
|
|
@ -706,6 +752,41 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
$("#form-salesOrder-edit").validate({ |
|
|
|
focusCleanup: true, |
|
|
|
//配置验证规则,key就是被验证的dom对象,value就是调用验证的方法(也是json格式) |
|
|
|
rules: { |
|
|
|
//这里的customerPurser 指的是上面标签的name属性 |
|
|
|
taxRate: { |
|
|
|
required: function () { |
|
|
|
if ($("#commonCurrency_edit").val() === "1") { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
usdTax: { |
|
|
|
required: function () { |
|
|
|
if ($("#commonCurrency_edit").val() === "2") { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
// 验证失败的提示信息 |
|
|
|
messages: { |
|
|
|
taxRate: { |
|
|
|
required: "必填", |
|
|
|
}, |
|
|
|
usdTax: { |
|
|
|
required: "必填", |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
var formData = $("#form-salesOrder-edit").serializeArray(); |
|
|
|