@@ -97,7 +97,7 @@
-
+
@@ -140,6 +140,7 @@
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var sysCustomerQuote = [[${sysCustomerQuote}]];
var prefix = ctx + "system/customerQuote"
+ var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-edit").validate({
focusCleanup: true,
});
@@ -169,7 +170,6 @@
$("input[name='customerFax']").change(function () {
if ($("input[name='customerFax']").val() == "1") {
var taxRate = $("input[name='rmbTax']").val();
- $("input[name='rmbTax']").val(taxRate / 100);
} else {
$("input[name='rmbTax']").val(0);
}
@@ -190,7 +190,6 @@
showColumns: false,
showPaginationSwitch: false,
model: "物料报价信息",
- onEditableSave: onEditableSave,
columns: [
{checkbox: true},
{title: '序号',align: 'center',
@@ -230,14 +229,14 @@
{title: '美元汇率',field: 'usdTax', align: 'center',editable: true},
{title: '对外售价',field: 'materialSole',editable: true},
{title: '物料的数量',field: 'materialNum',align: 'center',editable: true},
- {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,editable: true},
- {title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: true,editable: true},
- {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true},
- {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',editable: true},
- {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',editable: true},
- {title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',editable: true},
- {title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center',editable: true},
- {title: '物料的不含税总价(美元)', field: 'materialNoUsdSum',align: 'center',editable: true},
+ {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: commonCurrency==1?true:false},
+ {title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: commonCurrency==2?true:false},
+ {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'},
+ {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'},
+ {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'},
+ {title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'},
+ {title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'},
+ {title: '物料的不含税总价(美元)', field: 'materialNoUsdSum',align: 'center'},
{field: 'remark',align: 'center',title: '备注',visible: false},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
@@ -246,7 +245,34 @@
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);
});
@@ -374,39 +400,7 @@
$("#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()
- }
+