|
@ -43,7 +43,7 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-4 control-label">报价币种:</label> |
|
|
<label class="col-sm-4 control-label">报价币种:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<select class="form-control" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required> |
|
|
<select class="form-control" id="commonCurrency_edit" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required> |
|
|
<option value="">请选择</option> |
|
|
<option value="">请选择</option> |
|
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> |
|
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> |
|
|
</select> |
|
|
</select> |
|
@ -52,7 +52,7 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-4 control-label">美元汇率:</label> |
|
|
<label class="col-sm-4 control-label">美元汇率:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<input name="usdTax" th:field="*{usdTax}" class="form-control" type="text" placeholder="美元对人民币汇率"> |
|
|
<input name="usdTax" th:field="*{usdTax}" id="usdTax_edit" class="form-control" type="number" placeholder="美元对人民币汇率"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
@ -68,7 +68,7 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-4 control-label">国内税率:</label> |
|
|
<label class="col-sm-4 control-label">国内税率:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<input name="rmbTax" th:field="*{rmbTax}" class="form-control" type="text" placeholder="13%" /> |
|
|
<input name="rmbTax" th:field="*{rmbTax}" id="rmbTax_edit" class="form-control" type="number" placeholder="13%" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
@ -97,7 +97,7 @@ |
|
|
<div class="col-xs-12 form-row"> |
|
|
<div class="col-xs-12 form-row"> |
|
|
<label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-1" name="noRmb" id="noRmb" th:field="*{noRmb}" type="number" disabled /> |
|
|
<label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-1" name="noRmb" id="noRmb" th:field="*{noRmb}" type="number" disabled /> |
|
|
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-1" name="noRmbSum" id="noRmbSum" th:field="*{noRmbSum}" type="number" disabled/> |
|
|
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-1" name="noRmbSum" id="noRmbSum" th:field="*{noRmbSum}" type="number" disabled/> |
|
|
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-1" name="rmb" id="rmb" type="text" th:field="*{rmb}" disabled/> |
|
|
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-1" name="rmb" id="rmb" type="number" th:field="*{rmb}" disabled/> |
|
|
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-1" name="rmbSum" id="rmbSum" th:field="*{rmbSum}" type="number" disabled/> |
|
|
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-1" name="rmbSum" id="rmbSum" th:field="*{rmbSum}" type="number" disabled/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="col-xs-12"> |
|
|
<div class="col-xs-12"> |
|
@ -140,6 +140,7 @@ |
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
var sysCustomerQuote = [[${sysCustomerQuote}]]; |
|
|
var sysCustomerQuote = [[${sysCustomerQuote}]]; |
|
|
var prefix = ctx + "system/customerQuote" |
|
|
var prefix = ctx + "system/customerQuote" |
|
|
|
|
|
var commonCurrency = $("#commonCurrency_edit option:selected").val(); |
|
|
$("#form-customerQuote-edit").validate({ |
|
|
$("#form-customerQuote-edit").validate({ |
|
|
focusCleanup: true, |
|
|
focusCleanup: true, |
|
|
}); |
|
|
}); |
|
@ -169,7 +170,6 @@ |
|
|
$("input[name='customerFax']").change(function () { |
|
|
$("input[name='customerFax']").change(function () { |
|
|
if ($("input[name='customerFax']").val() == "1") { |
|
|
if ($("input[name='customerFax']").val() == "1") { |
|
|
var taxRate = $("input[name='rmbTax']").val(); |
|
|
var taxRate = $("input[name='rmbTax']").val(); |
|
|
$("input[name='rmbTax']").val(taxRate / 100); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
$("input[name='rmbTax']").val(0); |
|
|
$("input[name='rmbTax']").val(0); |
|
|
} |
|
|
} |
|
@ -190,7 +190,6 @@ |
|
|
showColumns: false, |
|
|
showColumns: false, |
|
|
showPaginationSwitch: false, |
|
|
showPaginationSwitch: false, |
|
|
model: "物料报价信息", |
|
|
model: "物料报价信息", |
|
|
onEditableSave: onEditableSave, |
|
|
|
|
|
columns: [ |
|
|
columns: [ |
|
|
{checkbox: true}, |
|
|
{checkbox: true}, |
|
|
{title: '序号',align: 'center', |
|
|
{title: '序号',align: 'center', |
|
@ -230,14 +229,14 @@ |
|
|
{title: '美元汇率',field: 'usdTax', align: 'center',editable: true}, |
|
|
{title: '美元汇率',field: 'usdTax', align: 'center',editable: true}, |
|
|
{title: '对外售价',field: 'materialSole',editable: true}, |
|
|
{title: '对外售价',field: 'materialSole',editable: true}, |
|
|
{title: '物料的数量',field: 'materialNum',align: 'center',editable: true}, |
|
|
{title: '物料的数量',field: 'materialNum',align: 'center',editable: true}, |
|
|
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,editable: true}, |
|
|
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: commonCurrency==1?true:false}, |
|
|
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: true,editable: true}, |
|
|
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: commonCurrency==2?true:false}, |
|
|
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true}, |
|
|
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, |
|
|
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',editable: true}, |
|
|
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, |
|
|
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',editable: true}, |
|
|
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, |
|
|
{title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',editable: true}, |
|
|
{title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'}, |
|
|
{title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center',editable: true}, |
|
|
{title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'}, |
|
|
{title: '物料的不含税总价(美元)', field: 'materialNoUsdSum',align: 'center',editable: true}, |
|
|
{title: '物料的不含税总价(美元)', field: 'materialNoUsdSum',align: 'center'}, |
|
|
{field: 'remark',align: 'center',title: '备注',visible: false}, |
|
|
{field: 'remark',align: 'center',title: '备注',visible: false}, |
|
|
{title: '操作', align: 'center', |
|
|
{title: '操作', align: 'center', |
|
|
formatter: function (value, row, index) { |
|
|
formatter: function (value, row, index) { |
|
@ -246,7 +245,34 @@ |
|
|
return actions.join(''); |
|
|
return actions.join(''); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
] |
|
|
], |
|
|
|
|
|
onEditableSave:function(field, row, oldValue, $el){ |
|
|
|
|
|
commonCurrency = $("#commonCurrency_add option:selected").val(); |
|
|
|
|
|
var Double = function(value) { |
|
|
|
|
|
this.value = Number(value).toFixed(2); |
|
|
|
|
|
}; |
|
|
|
|
|
var rmb1 = new Double($("#rmbTax_edit").val()); |
|
|
|
|
|
var rmb = rmb1 / 100; |
|
|
|
|
|
var usd = new Double($("#usdTax_edit").val()); |
|
|
|
|
|
console.log(commonCurrency); |
|
|
|
|
|
if(commonCurrency == 1){ |
|
|
|
|
|
row.materialRmb = Number(row.materialNoRmb * (1 + rmb)).toFixed(2); |
|
|
|
|
|
row.materialNoUsd = Number(row.materialNoRmb / rmb).toFixed(2); |
|
|
|
|
|
row.materialNoUsdSum = Number(row.materialNum * row.materialNoUsd).toFixed(2); |
|
|
|
|
|
row.materialUsd = Number(row.materialNoUsd).toFixed(2); |
|
|
|
|
|
row.materialUsdSum = Number(row.materialNum * row.materialUsd).toFixed(2); |
|
|
|
|
|
row.materialNoRmbSum = Number(row.materialNum* row.materialNoRmb).toFixed(2); |
|
|
|
|
|
} |
|
|
|
|
|
else if( commonCurrency == 2){ |
|
|
|
|
|
row.materialUsd = Number(row.materialNoUsd).toFixed(2); |
|
|
|
|
|
row.materialUsdSum = Number(row.materialNum * row.materialUsd).toFixed(2); |
|
|
|
|
|
row.materialNoUsdSum = Number(row.materialNoUsd * row.materialNum).toFixed(2); |
|
|
|
|
|
row.materialNoRmb = Number(usd * row.materialNoUsd).toFixed(2); |
|
|
|
|
|
row.materialRmb = usd * Number(row.materialNoUsd * (1 + rmb)).toFixed(2); |
|
|
|
|
|
row.materialNoRmbSum = Number(row.materialNoRmb * row.materialNum).toFixed(2); |
|
|
|
|
|
} |
|
|
|
|
|
getTotalAmount() |
|
|
|
|
|
}, |
|
|
}; |
|
|
}; |
|
|
$.table.init(options); |
|
|
$.table.init(options); |
|
|
}); |
|
|
}); |
|
@ -374,39 +400,7 @@ |
|
|
$("#usdSum").val(usdSum); |
|
|
$("#usdSum").val(usdSum); |
|
|
} |
|
|
} |
|
|
// 结算金额 |
|
|
// 结算金额 |
|
|
function onEditableSave(field, row, oldValue, $el){ |
|
|
|
|
|
const commonCurrency = $("#commonCurrency:checked").val(); |
|
|
|
|
|
if(field =="materialNum" && row.materialNum != "" && commonCurrency =="1"){ |
|
|
|
|
|
$("#bootstrap-table-Quote-child").bootstrapTable('updateByUniqueId', { |
|
|
|
|
|
id: row.id, |
|
|
|
|
|
row: { |
|
|
|
|
|
materialNoRmb : row.materialNoRmb, |
|
|
|
|
|
materialRmb : row.materialNoRmb * (1 + $("#rmbTax").val()), |
|
|
|
|
|
materialNoUsd : row.materialNoRmb / $("#rmbTax").val(), |
|
|
|
|
|
materialNoUsdSum : row.materialNoRmb / $("#rmbTax").val(), |
|
|
|
|
|
materialUsd : row.materialNum * (row.materialNoRmb / $("#rmbTax").val()), |
|
|
|
|
|
materialUsdSum : row.materialNum * (row.materialNoRmb / $("#rmbTax").val()), |
|
|
|
|
|
materialNoRmbSum : row.materialNum * row.materialNoRmb, |
|
|
|
|
|
materialRmbSum : row.materialNum * row.materialRmb |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else if(field =="materialNum" && row.materialNum != "" && commonCurrency =="2"){ |
|
|
|
|
|
$("#bootstrap-table-Quote-child").bootstrapTable('updateByUniqueId', { |
|
|
|
|
|
id: row.id, |
|
|
|
|
|
row: { |
|
|
|
|
|
materialUsd : row.materialNoUsd, |
|
|
|
|
|
materialUsdSum : row.materialNum * row.materialUsd, |
|
|
|
|
|
materialNoUsdSum : row.materialNoUsd * row.materialNum, |
|
|
|
|
|
materialNoRmb : $("#usdTax").val() * row.materialNoUsd, |
|
|
|
|
|
materialRmb : $("#usdTax").val() * row.materialNoUsd * (1 + $("#rmbTax").val()), |
|
|
|
|
|
materialNoRmbSum : row.materialNoRmb * row.materialNum, |
|
|
|
|
|
materialRmbSum : row.materialRmb * row.materialNum |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
getTotalAmount() |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |