Browse Source

[fix]

销售管理 销售订单
修改编辑销售订单页面,新增选择币种下拉框监听方法,设置两种汇率输入框标签必填样式;
新增根据币种选择设置汇率必填验证方法;
修改业务经理审批页面汇率字段为非必填;
修改业务主管审批页面汇率字段为非必填;
修改总经理助理审批页面汇率字段为非必填;
dev
王晓迪 4 months ago
parent
commit
288f646e0c
  1. 89
      ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html
  2. 4
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html
  3. 4
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html
  4. 4
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

89
ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html

@ -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();

4
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

@ -151,9 +151,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<label class="col-sm-3 control-label">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required readonly/>
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" readonly/>
</div>
</div>
<div class="form-group">

4
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html

@ -151,9 +151,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<label class="col-sm-3 control-label">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required readonly/>
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" readonly/>
</div>
</div>
<div class="form-group">

4
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

@ -151,9 +151,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<label class="col-sm-3 control-label">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required readonly/>
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" readonly/>
</div>
</div>
<div class="form-group">

Loading…
Cancel
Save