|
@@ -724,6 +724,25 @@
|
|
|
$("#contactTbodyId").hide();
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ //制保留2位小数,如:2,会在2后面补上00.即2.00
|
|
|
+ function toDecimal2(x) {
|
|
|
+ var f = parseFloat(x);
|
|
|
+ if (isNaN(f)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var f = Math.round(x*100)/100;
|
|
|
+ var s = f.toString();
|
|
|
+ var rs = s.indexOf('.');
|
|
|
+ if (rs < 0) {
|
|
|
+ rs = s.length;
|
|
|
+ s += '.';
|
|
|
+ }
|
|
|
+ while (s.length <= rs + 2) {
|
|
|
+ s += '0';
|
|
|
+ }
|
|
|
+ return s;
|
|
|
+ }
|
|
|
/*保存客户销售信息到列表*/
|
|
|
function toAddChannelSaleInfo() {
|
|
|
var channelCategory = document.getElementById("channelCategory").value;
|
|
@@ -744,8 +763,8 @@
|
|
|
var supplyPrice = document.getElementById("supplyPrice").value;
|
|
|
var writeSupplyPrice = document.getElementById("writeSupplyPrice").value;//手动输入价格
|
|
|
if(writeSupplyPrice != null && writeSupplyPrice !=""){
|
|
|
- /*writeSupplyPrice = writeSupplyPrice.toFixed(2);
|
|
|
- alert(writeSupplyPrice);*/
|
|
|
+ writeSupplyPrice = toDecimal2(writeSupplyPrice);
|
|
|
+ alert(writeSupplyPrice);
|
|
|
supplyPrice = writeSupplyPrice;
|
|
|
}
|
|
|
var accountPeriod = document.getElementById("accountPeriod").value;
|