$(function () { $('#divUpFile').dialog('close'); selShippingWay(); }); /**拼版相关*/ function selShippingWay() { $("#divCloseShippingWay").click(function () { $("#divShippingWay").hide() }); $("#selShippingWay").change(function () { var value = this.value; if (value == "2") { var width = $("#hidWidth").val(); var length = $("#hidLength").val(); var num = $("#hidNum").val(); if (!SingGooJS.checkNum(width)) { document.getElementById("hidWidth").focus(); alert("请正确填写板子宽度!"); return; } if (!SingGooJS.checkNum(length)) { document.getElementById("hidLength").focus(); alert("请正确填写板子长度!"); return; } var num = $("#hidNum").val(); if (!SingGooJS.isValidPositiveInteger(num)) { document.getElementById("hidNum").focus(); alert("板子数量必须输入正确的正整数!"); return; } $("#iframeShippingWay").attr("src", "http://www.dydpcb.com/js/puzzle.aspx"); setSivShippingWayHeight(); $("#divShippingWay").show(); } }); } function setShippingWay() { $("#selShippingWay option[value='1'] ").attr("selected", true); } function setSivShippingWayHeight() { $("#divShippingWay").width(document.getElementById("iframeShippingWay").contentDocument.body.scrollWidth).height(document.getElementById("iframeShippingWay").contentDocument.body.scrollHeight + 20); } /**拼版相关*/ // 增加日期 oldDate 原始日期 count 增加几天 function addDate(oldDate, count) { var lastDate = oldDate; var arys = new Array(); arys = lastDate.split('-'); //得到日期类型 var myDate = new Date(arys[0], arys[1], arys[2]); myDate = myDate.valueOf(); myDate = myDate + count * 24 * 60 * 60 * 1000; myDate = new Date(myDate); var newDate = (myDate.getFullYear() + "-" + (myDate.getMonth()) + "-" + myDate.getDate()); return newDate; } //第一步 计算订单价格 function btnPrice_onclick() { //验证数据准确性 var width = $("#hidWidth").val(); var length = $("#hidLength").val(); //$.ligerMessageBox.success({'标题','内容']); if (!SingGooJS.checkNum(width)) { document.getElementById("hidWidth").focus(); alert("请正确填写板子宽度!"); return false; } if (!SingGooJS.checkNum(length)) { document.getElementById("hidLength").focus(); alert("请正确填写板子长度!"); return false; } var num = $("#hidNum").val(); if (!SingGooJS.isValidPositiveInteger(num)) { document.getElementById("hidNum").focus(); alert("板子数量必须输入正确的正整数!"); return false; } var expressName = SingGooJS.GetSelectValue("selExpressName"); if (expressName == "") { alert("必须选择快递方式!"); return false; } $("#divStep1").hide(); $("#divStep2").show(); //第二步赋值 var today = new Date(); // 获取今天时间 var strTime = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate(); $("#spanTime").text(strTime); $("#spanWidth").text(width); $("#spanLength").text(length); $("#spanNum").text(num); $("#spanArea").text(parseInt(width * length * num)); var copperThickness = $('input[name="radCopperThickness"]:checked').val(); //铜厚 $("#spanCopperThickness").text(copperThickness); var layers = $('input[name="hidLayers"]:checked').val(); //板子层数 $("#spanLayers").text(layers); var solderColor = $('input[name="radSolderColor"]:checked').val(); //阻焊颜色 $("#spanSolderColor").text(solderColor); var boardThickness = $('input[name="radBoardThickness"]:checked').val(); //板子厚度 $("#spanBoardThickness").text(boardThickness); var fontColor = $('input[name="radFontColor"]:checked').val(); //字符颜色 $("#spanFontColor").text(fontColor); //$("#spanPingBan").text($("#txtPinBanNum").val()); //拼版款数 var pingBan = $('input[name="txtPinBanNum"]:checked').val(); //拼版款数 if (pingBan == 1) { $("#spanPingBan").text("(pcs)单片出货"); } else if (pingBan == 2) { $("#spanPingBan").text("(set)连片出货"); } else if (pingBan == 3) { $("#spanPingBan").text("(pnl)增加一款资料"); } var testType = $('input[name="radTestType"]:checked').val(); //飞针测试 $("#spanTestType").text(testType); var zhfg = $('input[name="radZhfg"]:checked').val(); //阻焊覆盖 $("#spanZhfg").text(zhfg); $("#spanTxtNote").text($("#txtNote").val()); //备注 //平方数 var pf = (parseFloat(width * length * num) / 10000); //一共多少平方 //特殊工艺 线宽线距 + 孔径孔数 var lineweight = $('input[name="lineweight"]:checked').val(); // 线宽线距 $("#spanLineweight").text(lineweight + "mm"); var visa = $('input[name="vias"]:checked').val(); // 孔径孔数 $("#spanVisa").text(visa + "mm"); var teishu = $('input[name="teishu"]:checked').val(); // 特殊工艺 //是否加急了,加急后需减少交货日期 today.setDate(today.getDate() + 3); // 系统会自动转换 $("#spanLastDate").text(today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate()); //交货时间 var jhsj = $("#radDeliveryType").val(); $("#spanJhsj").text(jhsj); var jjMoney = 0; if (jhsj == "样板8小时加急") { jjMoney = pf * 800; if (jjMoney < 800) jjMoney = 800; var today1 = new Date(); // 获取今天时间 today1.setDate(today1.getDate() + 1); // 系统会自动转换 $("#spanLastDate").text(today1.getFullYear() + "-" + (today1.getMonth() + 1) + "-" + today1.getDate()); } else if (jhsj == "样板12小时加急") { jjMoney = pf * 800; if (jjMoney < 800) jjMoney = 800; var today1 = new Date(); // 获取今天时间 today1.setDate(today1.getDate() + 1); // 系统会自动转换 $("#spanLastDate").text(today1.getFullYear() + "-" + (today1.getMonth() + 1) + "-" + today1.getDate()); } else if (jhsj == "样板24小时加急") { jjMoney = pf * 100; if (jjMoney < 100) jjMoney = 100; if (pf >= 0.2) { jjMoney = jjMoney * 3; } var today1 = new Date(); // 获取今天时间 today1.setDate(today1.getDate() + 1); // 系统会自动转换 $("#spanLastDate").text(today1.getFullYear() + "-" + (today1.getMonth() + 1) + "-" + today1.getDate()); } else if (jhsj == "样板48小时加急") { jjMoney = pf * 60; if (jjMoney < 60) jjMoney = 60; if (pf >= 0.2) { jjMoney = jjMoney * 3; } var today2 = new Date(); // 获取今天时间 today2.setDate(today2.getDate() + 2); // 系统会自动转换 $("#spanLastDate").text(today2.getFullYear() + "-" + (today2.getMonth() + 1) + "-" + today2.getDate()); } else if (jhsj == "多层板48小时加急") { jjMoney = pf * 300; if (jjMoney < 300) jjMoney = 300; var today3 = new Date(); // 获取今天时间 today3.setDate(today3.getDate() + 2); // 系统会自动转换 $("#spanLastDate").text(today3.getFullYear() + "-" + (today3.getMonth() + 1) + "-" + today3.getDate()); } else if (jhsj == "多层板72小时加急") { jjMoney = pf * 200; if (jjMoney < 200) jjMoney = 200; var today4 = new Date(); // 获取今天时间 today4.setDate(today4.getDate() + 3); // 系统会自动转换 $("#spanLastDate").text(today4.getFullYear() + "-" + (today4.getMonth() + 1) + "-" + today4.getDate()); } else if (jhsj == "多层板96小时加急") { jjMoney = pf * 100; if (jjMoney < 100) jjMoney = 100; var today5 = new Date(); // 获取今天时间 today5.setDate(today5.getDate() + 4); // 系统会自动转换 $("#spanLastDate").text(today5.getFullYear() + "-" + (today5.getMonth() + 1) + "-" + today5.getDate()); } else if (jhsj == "小批量24小时加急") { jjMoney = pf * 100; if (jjMoney < 100) jjMoney = 100; if (pf >= 0.2) { jjMoney = jjMoney * 3; } var today11 = new Date(); // 获取今天时间 today11.setDate(today11.getDate() + 2); // 系统会自动转换 $("#spanLastDate").text(today11.getFullYear() + "-" + (today11.getMonth() + 1) + "-" + today11.getDate()); } else if (jhsj == "小批量48小时加急") { jjMoney = pf * 150; if (jjMoney < 150) jjMoney = 150; var today11 = new Date(); // 获取今天时间 today11.setDate(today11.getDate() + 2); // 系统会自动转换 $("#spanLastDate").text(today11.getFullYear() + "-" + (today11.getMonth() + 1) + "-" + today11.getDate()); } else if (jhsj == "小批量72小时加急") { jjMoney = pf * 100; if (jjMoney < 100) jjMoney = 100; var today11 = new Date(); // 获取今天时间 today11.setDate(today11.getDate() + 3); // 系统会自动转换 $("#spanLastDate").text(today11.getFullYear() + "-" + (today11.getMonth() + 1) + "-" + today11.getDate()); } else if (jhsj == "小批量96小时加急") { jjMoney = pf * 50; if (jjMoney < 50) jjMoney = 50; var today11 = new Date(); // 获取今天时间 today11.setDate(today11.getDate() + 4); // 系统会自动转换 $("#spanLastDate").text(today11.getFullYear() + "-" + (today11.getMonth() + 1) + "-" + today11.getDate()); } else { jjMoney = 0 var today6 = new Date(); // 获取今天时间 if (pf <= 1) { today6.setDate(today6.getDate() + 3); // 系统会自动转换 } else if (pf > 1 && pf <= 5) { today6.setDate(today6.getDate() + 4); // 系统会自动转换 } else if (pf > 5 && pf <= 10) { today6.setDate(today6.getDate() + 5); // 系统会自动转换 } else if (pf > 10 && pf <= 20) { today6.setDate(today6.getDate() + 6); // 系统会自动转换 } $("#spanLastDate").text(today6.getFullYear() + "-" + (today6.getMonth() + 1) + "-" + today6.getDate()); } /******************* 超过19:00 下单,所有时间加1天 ******************/ //$("#spanLastDate").text($("#spanLastDate").text() + 1); var myDate = new Date(); var hours = myDate.getHours(); //获取当前小时数(0-23) //alert(hours); if (hours > 18) { var lastDate = $("#spanLastDate").text(); var newDate = addDate(lastDate, 1); $("#spanLastDate").text(newDate); } /**************** 多层板 加交货时间 *******************/ if (layers == 4) { var lastDate4 = $("#spanLastDate").text(); var newDate4 = addDate(lastDate4, 2); $("#spanLastDate").text(newDate4); } else if (layers == 6) { var lastDate6 = $("#spanLastDate").text(); var newDate6 = addDate(lastDate6, 4); $("#spanLastDate").text(newDate6); } else if (layers == 8) { var lastDate8 = $("#spanLastDate").text(); var newDate8 = addDate(lastDate8, 6); $("#spanLastDate").text(newDate8); } else if (layers == 10) { var lastDate10 = $("#spanLastDate").text(); var newDate10 = addDate(lastDate10, 8); $("#spanLastDate").text(newDate10); } else if (layers == 20) { var lastDate20 = $("#spanLastDate").text(); var newDate20 = addDate(lastDate20, 18); $("#spanLastDate").text(newDate20); } //有铅喷锡 无铅喷锡 沉金 var platingType = $('input[name="radPlatingType"]:checked').val(); //焊盘喷镀 $("#spanPlatingType").text(platingType); var billPoint = 0; //增加多少税费点 var bill = $('input[name="hidBill"]:checked').val(); //发票 if (bill == 0) { billPoint = parseFloat($("#Hidden49").val()); $("#spanBill").text("不需要"); } else if (bill == 1) { billPoint = parseFloat($("#Hidden50").val()); $("#spanBill").text("普通发票"); } else if (bill == 2) { billPoint = parseFloat($("#Hidden51").val()); $("#spanBill").text("增值税发票"); } //计算出价格 1板费 2拼版费 3工程费 4菲林费 5税费 6喷镀费 7测试费 8加急费 9颜色费 10附加费用 11快递费 21铜厚费 //22特殊工艺费(线宽线距 + 孔径孔数) var price = 0; //板费单价 (4层板 6层板 板费单价为900\1800) if (layers == 1) price = 400; else if (layers == 2) price = 500; else if (layers == 4) price = 895; else if (layers == 6) price = 1600; else if (layers == 8) price = 2200; else if (layers == 10) price = 3000; /**************** 板费 ****************/ var price1 = pf * price; //板费 = 平方数*板费单价 price1 = Math.round(price1 * 1000) / 1000; //长或宽超出520mm,板费翻倍计算 if (width >= 52 || length >= 52) price1 = price1 * 2; //板材厚度外加板材费 var price1_wj = 0; if (boardThickness == 0.2) { price1_wj += 500 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 500) { price1_wj = 500; } price1 = price1 + price1_wj; } else if (boardThickness == 0.4) { price1_wj += 100 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 100) { price1_wj = 100; } price1 = price1 + price1_wj; } else if (boardThickness == 2.2) { price1_wj += 150 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 150) { price1_wj = 150; } price1 = price1 + price1_wj; } else if (boardThickness == 2.4) { price1_wj += 200 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 200) { price1_wj = 200; } price1 = price1 + price1_wj; } else if (boardThickness == 2.6) { price1_wj += 250 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 250) { price1_wj = 250; } price1 = price1 + price1_wj; } else if (boardThickness == 2.8) { price1_wj += 300 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 300) { price1_wj = 300; } price1 = price1 + price1_wj; } else if (boardThickness == 3.0) { price1_wj += 350 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 350) { price1_wj = 350; } price1 = price1 + price1_wj; } else if (boardThickness == 3.2) { price1_wj += 400 * pf; price1_wj = Math.round(price1_wj * 1000) / 1000; if (price1_wj < 400) { price1_wj = 400; } price1 = price1 + price1_wj; } /**************** 拼板费 ****************/ var price2 = 0; var pbNum = parseInt($("#txtPinBanNum").val()) - 1; //拼板款数 if (pbNum > 0) { if (layers == 1) price2 = pbNum * 10; else if (layers == 2) price2 = pbNum * 10; else if (layers == 4) price2 = pbNum * 100; else if (layers == 6) price2 = pbNum * 200; else if (layers == 8) price2 = pbNum * 500; else if (layers == 10) price2 = pbNum * 1000; } price2 = Math.round(price2 * 1000) / 1000; /**************** 工程费 ****************/ var price3 = 0; if (layers == 1) price3 = 100; else if (layers == 2) price3 = 100; else if (layers == 4) price3 = 500; else if (layers == 6) price3 = 1600; else if (layers == 8) price3 = 2200; else if (layers == 10) price3 = 3000; // //2平方以上的小批量,免收工程费 // if (pf >= 2) // price3 = 0; price3 = Math.round(price3 * 1000) / 1000; // vincent 2016-07-17 大于5m2,免工程费 if (pf >= 5) { price3 = 0; } //拼板费 if (pingBan == 3) { price2 += price3 * 1; } /**************** 菲林费 ****************/ var price4 = 0; //菲林费 if (layers == 1) price4 = 0; //(parseFloat(width * length) / 10000) * 4 * parseFloat($("#Hidden55").val()); else if (layers == 2) price4 = 0; //(parseFloat(width * length) / 10000) * 6 * parseFloat($("#Hidden55").val()); else if (layers == 4) price4 = (parseFloat(width * length) / 10000) * 8 * parseFloat($("#Hidden55").val()); else if (layers == 6) price4 = (parseFloat(width * length) / 10000) * 10 * parseFloat($("#Hidden55").val()); else if (layers == 8) price4 = (parseFloat(width * length) / 10000) * 12 * parseFloat($("#Hidden55").val()); else if (layers == 10) price4 = (parseFloat(width * length) / 10000) * 14 * parseFloat($("#Hidden55").val()); price4 = Math.round(price4 * 1000) / 1000; /**************** 焊盘喷镀费 ****************/ var price6 = 0; // pf * 100; //焊盘喷镀 无铅\沉金加费 //20%以内的沉金面积 if (platingType == "沉金") { price6 = pf * 100; //最低消费 if (price6 < 100) price6 = 100; } else if (platingType == "无铅喷锡") { price6 = pf * 10; //最低消费 if (price6 < 10) price6 = 10; } else if (platingType == "沉镍" || platingType == "沉锡") price6 = 50; else if (platingType == "OSP") { price6 = 50; //最低消费 if (price6 < 50) price6 = 50; } price6 = Math.round(price6 * 1000) / 1000; /**************** 阻焊覆盖费 ****************/ if (zhfg == "过孔开窗") { price6 += (pf * 50); price6 = Math.round(price6 * 1000) / 1000; } /**************** 测试费 ****************/ var price7 = 0; //测试费 (0.2平方以下免收测试费) if (pf > 0.2 && testType == "电测") { if (layers == 1) price7 = pf * 5; else if (layers == 2) price7 = pf * 5; else if (layers == 4) price7 = pf * 100; else if (layers == 6) price7 = pf * 160; else if (layers == 8) price7 = pf * 220; else if (layers == 10) price7 = pf * 300; } else if (pf > 0.2 && testType == "飞测") { if (layers == 1) price7 = pf * 100; else if (layers == 2) price7 = pf * 100; else if (layers == 4) price7 = pf * 150; else if (layers == 6) price7 = pf * 200; else if (layers == 8) price7 = pf * 250; else if (layers == 10) price7 = pf * 500; } else if (testType == "客供") { price7 = 0; } //1平方以下免收测试费 // if (pf >= 1) // price7 = 0; price7 = Math.round(price7 * 1000) / 1000; /**************** 加急费 ****************/ var price8 = jjMoney; //加急费 price8 = Math.round(price8 * 1000) / 1000; /**************** 颜色费 ****************/ var price9 = 0; //颜色费 if (solderColor == "灰色" || solderColor == "哑光" || solderColor == "超白") price9 = 200; price9 = Math.round(price9 * 1000) / 1000; /**************** 铜厚 ****************/ var price21 = 0; if (copperThickness == "http://www.dydpcb.com/js/1.5/1.5oz") { price21 = (pf * 50); price21 = Math.round(price21 * 1000) / 1000; //铜厚最低消费 if (price21 < 50) price21 = 50; } else if (copperThickness == "2/2oz") { price21 = (pf * 120); price21 = Math.round(price21 * 1000) / 1000; //铜厚最低消费 if (price21 < 120) price21 = 120; } /************** 特殊工艺费 ***************/ var price22 = 0; // 线宽线距 if (lineweight == "http://www.dydpcb.com/js/0.12") { if (pf <= 2) price22 += 100; else price22 += (pf * 100); } else if (lineweight == "0.1") { if (pf <= 2) price22 += 200; else price22 += (pf * 200); } //孔径孔数 if (visa == "http://www.dydpcb.com/js/0.25") { if (pf <= 2) price22 += 100; else price22 += (pf * 100); } else if (visa == "0.2") { if (pf <= 2) price22 += 200; else price22 += (pf * 200); } if (layers == 4) { price22 = price22 * 1.5; } else if (layers == 6) { price22 = price22 * 2; } else if (layers == 8) { price22 = price22 * 2.5; } else if (layers == 10) { price22 = price22 * 3; } // 特殊工艺收费 2015-11-22 //2 阻抗 3埋孔 4盲孔 5半孔 var teishu_pf = pf; if (pf < 1) { teishu_pf = 1; } if (teishu == "2") { if (layers <= 2) { price22 += teishu_pf * 100; } else if (layers == 4) { price22 += teishu_pf * 200; } else if (layers == 6) { price22 += teishu_pf * 400; } else if (layers == 8) { price22 += teishu_pf * 800; } else if (layers == 10) { price22 += teishu_pf * 1500; } } else if (teishu == "3") { if (layers <= 2) { price22 += teishu_pf * 100; } else if (layers == 4) { price22 += teishu_pf * 200; } else if (layers == 6) { price22 += teishu_pf * 400; } else if (layers == 8) { price22 += teishu_pf * 800; } else if (layers == 10) { price22 += teishu_pf * 1500; } } else if (teishu == "4") { if (layers <= 2) { price22 += teishu_pf * 100; } else if (layers == 4) { price22 += teishu_pf * 200; } else if (layers == 6) { price22 += teishu_pf * 400; } else if (layers == 8) { price22 += teishu_pf * 800; } else if (layers == 10) { price22 += teishu_pf * 1500; } } else if (teishu == "5") { if (layers <= 2) { price22 += teishu_pf * 100; } else if (layers == 4) { price22 += teishu_pf * 200; } else if (layers == 6) { price22 += teishu_pf * 400; } else if (layers == 8) { price22 += teishu_pf * 800; } else if (layers == 10) { price22 += teishu_pf * 1500; } price22 += price22 * 1.5; } else if (teishu == "6") { if (layers <= 2) { price22 += teishu_pf * 100; } else if (layers == 4) { price22 += teishu_pf * 200; } else if (layers == 6) { price22 += teishu_pf * 400; } else if (layers == 8) { price22 += teishu_pf * 800; } else if (layers == 10) { price22 += teishu_pf * 1500; } } price22 = Math.round(price22 * 100) / 100; var price10 = 50; //附加费用,如特价板代收时,加收100元 var price11 = 0; //快递费 /**************** 特价板 ****************/ var isTeJia = 0; //0非特价 1特价 //检测是否属于两款特价板 (特价板需加收邮费,省内加10,省外加30) //单双板,长宽10cm以内,10pcs内,绿油白字 板厚0.6~1.6 铜厚1/1oz 有铅喷锡 拼板数<=1 if (layers < 3 && width <= 10 && length <= 10 && num <= 10 && solderColor == "绿色" && fontColor == "白色" && boardThickness >= 0.6 && boardThickness <= 1.6 && copperThickness == "1/1oz" && platingType == "有铅喷锡" && pingBan <= 2 && zhfg == "过孔盖油") { price1 = 45; price2 = 0; price3 = 0; price4 = 0; price6 = 0; if (platingType == "沉金") price6 = 100; price7 = 0; //price8 = 0; price9 = 0; isTeJia = 1; } //四层板,长宽5cm以内,10pcs内,绿油白字 if (layers == 4 && width <= 5 && length <= 5 && num <= 10 && solderColor == "绿色" && fontColor == "白色" && boardThickness >= 0.6 && boardThickness <= 1.6 && copperThickness == "1/1oz" && platingType == "有铅喷锡" && pingBan <= 2 && zhfg == "过孔盖油") { price1 = 500; price2 = 0; price3 = 0; price4 = 0; price6 = 0; if (platingType == "沉金") price6 = 300; price7 = 0; //price8 = 0; price9 = 0; isTeJia = 1; } /**************** 快递费 ****************/ if (document.getElementById("selExpressName").value == "顺丰到付" || document.getElementById("selExpressName").value == "EMS到付" || document.getElementById("selExpressName").value == "UPS" || document.getElementById("selExpressName").value == "TNT") { price11 = 0; } else { if (document.getElementById("selExpressType").value == "广东省内") { price11 = 0; if (document.getElementById("selExpressName").value == "顺丰" || document.getElementById("selExpressName").value == "跨越") { price11 += pf * 15; if (price11 < 15) price11 = 15; } else if (document.getElementById("selExpressName").value == "EMS") { price11 += pf * 15; if (price11 < 15) price11 = 15; } } else if (document.getElementById("selExpressType").value == "广东省外") { price11 = 25; if (document.getElementById("selExpressName").value == "顺丰" || document.getElementById("selExpressName").value == "跨越") { price11 = pf * price11; if (price11 < 25) price11 = 25; } else if (document.getElementById("selExpressName").value == "EMS") { price11 = pf * price11; if (price11 < 25) price11 = 25; } else if (document.getElementById("selExpressName").value == "德邦物流") { //price11 = 10; price11 = pf * price11; if (price11 < 25) price11 = 25; } else if (document.getElementById("selExpressName").value == "特快空运") { price11 = 30; price11 = pf * price11; if (price11 < 30) price11 = 30; } else { price11 = 20; price11 = pf * price11; if (price11 < 20) price11 = 20; } } } /*************** vip折扣 养老系统 ****************/ var vipzhekou = $("#hVipZheKou").val(); /**************** 税费 ****************/ var total = parseInt(price1 + price2 + price3 + price4 + price6 + price7 + price8 + price9 + price10 + price21 + price22); total = Math.round(total * 1000) / 1000; var price5 = Math.round((total * billPoint) * 1000) / 1000; //增值税 6个点 price5 = Math.round(price5 * 1000) / 1000; $("#Hidden11").val(price11); //快递费 $("#span11").text(price11); $("#span1").text(price1); $("#span2").text(price2); $("#span3").text(price3); $("#span4").text(price4); $("#span5").text(price5); $("#span6").text(price6); $("#span7").text(price7); $("#span8").text(price8); $("#span9").text(price9); $("#span21").text(price21); $("#span22").text(price22); total = parseInt(price1 + price2 + price3 + price4 + price5 + price6 + price7 + price8 + price9 + price10 + price21 + price22); //养老系统享受的折扣 if (parseFloat(vipzhekou) > 0) { total = Math.round((total * vipzhekou) * 1000) / 1000; } $("#spanTotal").text(total + price11); $("#Pay_Total").val(total + price11); //保留价格 if (width >= 500 || length >= 500) { $("#spanTotal").text((total + price11) * 2); $("#Pay_Total").val((total + price11) * 2); //保留价格 } //网上立即支付价格 if (isTeJia == 0) { if (pf <= 2 || total <= 1000) { $("#NetPay_Hidden1").val("0.6"); $("#NetPay_Hidden2").val("0.3"); $("#NetPay_Hidden3").val("0.5"); $("#NetPay_Hidden4").val("1"); $("#NetPay_Hidden5").val("1"); $("#NetPay_Hidden6").val("1"); $("#NetPay_Hidden7").val("0.5"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } else if ((pf > 2 && pf <= 5) || (total > 1000 && total <= 2500)) { $("#NetPay_Hidden1").val("0.6"); $("#NetPay_Hidden2").val("0.3"); $("#NetPay_Hidden3").val("0.5"); $("#NetPay_Hidden4").val("1"); $("#NetPay_Hidden5").val("1"); $("#NetPay_Hidden6").val("1"); $("#NetPay_Hidden7").val("0.5"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } else if ((pf > 5 && pf <= 10) || (total > 2500 && total <= 5000)) { $("#NetPay_Hidden1").val("0.6"); $("#NetPay_Hidden2").val("0.3"); $("#NetPay_Hidden3").val("0.5"); $("#NetPay_Hidden4").val("1"); $("#NetPay_Hidden5").val("1"); $("#NetPay_Hidden6").val("1"); $("#NetPay_Hidden7").val("0.5"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } else if ((pf > 10 && pf <= 20) || (total >= 5000 && total <= 10000)) { $("#NetPay_Hidden1").val("0.6"); $("#NetPay_Hidden2").val("0.3"); $("#NetPay_Hidden3").val("0.5"); $("#NetPay_Hidden4").val("1"); $("#NetPay_Hidden5").val("1"); $("#NetPay_Hidden6").val("1"); $("#NetPay_Hidden7").val("0.5"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } else { $("#NetPay_Hidden1").val("0.6"); $("#NetPay_Hidden2").val("0.3"); $("#NetPay_Hidden3").val("0.5"); $("#NetPay_Hidden4").val("1"); $("#NetPay_Hidden5").val("1"); $("#NetPay_Hidden6").val("1"); $("#NetPay_Hidden7").val("0.5"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } } else { if (layers == 4) $("#NetPay_Hidden1").val("0.4"); else $("#NetPay_Hidden1").val("0.9"); $("#NetPay_Hidden2").val("0.9"); $("#NetPay_Hidden3").val("0.9"); $("#NetPay_Hidden4").val("0.9"); $("#NetPay_Hidden5").val("0.9"); $("#NetPay_Hidden6").val("0.9"); $("#NetPay_Hidden7").val("0.9"); $("#NetPay_Hidden8").val("0.5"); $("#NetPay_Hidden9").val("0.9"); } if (isTeJia == 0) { //非特价板,工程费打5折 if (pf < 1) $("#NetPay_Hidden3").val("0.5"); } // 网络支付 1板费 2拼版费 3工程费 4菲林费 5税费 6喷镀费 7测试费 8加急费 9颜色费 10附加费用 11快递费 21铜厚费 var price1_net = price1 * parseFloat($("#NetPay_Hidden1").val()); price1_net = Math.round(price1_net * 1000) / 1000; var price2_net = price2 * parseFloat($("#NetPay_Hidden2").val()); price2_net = Math.round(price2_net * 1000) / 1000; var price3_net = price3 * parseFloat($("#NetPay_Hidden3").val()); price3_net = Math.round(price3_net * 1000) / 1000; var price4_net = price4 * parseFloat($("#NetPay_Hidden4").val()); price4_net = Math.round(price4_net * 1000) / 1000; var price5_net = price5 * parseFloat($("#NetPay_Hidden5").val()); price5_net = Math.round(price5_net * 1000) / 1000; var price6_net = price6 * parseFloat($("#NetPay_Hidden6").val()); price6_net = Math.round(price6_net * 1000) / 1000; var price7_net = price7 * parseFloat($("#NetPay_Hidden7").val()); price7_net = Math.round(price7_net * 1000) / 1000; var price8_net = price8; // * parseFloat($("#NetPay_Hidden8").val()); price8_net = Math.round(price8_net * 1000) / 1000; var price9_net = price9 * parseFloat($("#NetPay_Hidden9").val()); price9_net = Math.round(price9_net * 1000) / 1000; var price11_net = price11; //邮费不打折 price11_net = Math.round(price11_net * 1000) / 1000; var price21_net = price21 * parseFloat($("#NetPay_Hidden9").val()); price21_net = Math.round(price21_net * 1000) / 1000; var price22_net = price22 * parseFloat($("#NetPay_Hidden1").val()); price22_net = Math.round(price22_net * 1000) / 1000; //税费另计 1板费 2拼版费 3工程费 4菲林费 5税费 6喷镀费 7测试费 8加急费 9颜色费 10附加费用 11快递费 21铜厚费 var net_total = parseInt(price1_net + price2_net + price3_net + price4_net + price6_net + price7_net + price8_net + price9_net + price21_net + price22_net); net_total = Math.round(net_total * 1000) / 1000; price5_net = Math.round((net_total * billPoint) * 1000) / 1000; //增值税 12个点 price5_net = Math.round(price5_net * 1000) / 1000; $("#span1_Net").text(price1_net); $("#span2_Net").text(price2_net); $("#span3_Net").text(price3_net); $("#span4_Net").text(price4_net); $("#span5_Net").text(price5_net); $("#span6_Net").text(price6_net); $("#span7_Net").text(price7_net); $("#span8_Net").text(price8_net); $("#span9_Net").text(price9_net); $("#span11_Net").text(price11_net); //邮费 $("#span21_Net").text(price21_net); $("#span22_Net").text(price22_net); //工艺费 net_total = parseInt(price1_net + price2_net + price3_net + price4_net + price5_net + price6_net + price7_net + price8_net + price9_net + price21_net + price22_net); //养老系统享受的折扣 if (parseFloat(vipzhekou) > 0) { net_total = Math.round((net_total * vipzhekou) * 1000) / 1000; } $("#spanTotal_Net").text(Math.round((net_total + price11_net) * 1000) / 1000); $("#NetPay_Total").val(net_total + price11_net); //保留价格 //网络支付50% var price1_net_b = 0; if (isTeJia == 1) { price1_net_b = total * parseFloat(0.9); price1_net_b = Math.round(price1_net_b * 1000) / 1000; } else { price1_net_b = price1 * parseFloat(0.7); price1_net_b = Math.round(price1_net_b * 1000) / 1000; } var price2_net_b = price2 * parseFloat(0.5); price2_net_b = Math.round(price2_net_b * 1000) / 1000; var price3_net_b = price3 * parseFloat(0.7); price3_net_b = Math.round(price3_net_b * 1000) / 1000; var price7_net_b = price7 * parseFloat(0.7); price7_net_b = Math.round(price7_net_b * 1000) / 1000; var price8_net_b = price8 * parseFloat(1); price8_net_b = Math.round(price8_net_b * 1000) / 1000; var price11_net_b = price11; //邮费不打折 price11_net_b = Math.round(price11_net_b * 1000) / 1000; var price22_net_b = price22 * parseFloat(0.7); price22_net_b = Math.round(price22_net_b * 1000) / 1000; //税费另计 var net_total_b = parseInt(price1_net_b + price2_net_b + price3_net_b + price4_net + price6_net + price7_net_b + price8_net_b + price9_net + price21_net + price22_net); net_total_b = Math.round(net_total_b * 1000) / 1000; var price5_net_b = Math.round((net_total_b * billPoint) * 1000) / 1000; //增值税 6个点 price5_net_b = Math.round(price5_net_b * 1000) / 1000; $("#span1_Net_B").text(price1_net_b); $("#span2_Net_B").text(price2_net_b); $("#span3_Net_B").text(price3_net_b); $("#span4_Net_B").text(price4_net); $("#span5_Net_B").text(price5_net_b); $("#span6_Net_B").text(price6_net); $("#span7_Net_B").text(price7_net_b); $("#span8_Net_B").text(price8_net_b); $("#span9_Net_B").text(price9_net); $("#span11_Net_B").text(price11_net_b); //邮费 $("#span21_Net_B").text(price21_net); $("#span22_Net_B").text(price22_net_b); //工艺费 net_total_b = parseInt(price1_net_b + price2_net_b + price3_net_b + price4_net + price5_net_b + price6_net + price7_net_b + price8_net_b + price9_net + price21_net + price22_net_b); //养老系统享受的折扣 if (parseFloat(vipzhekou) > 0) { net_total_b = Math.round((net_total_b * vipzhekou) * 1000) / 1000; } $("#spanTotal_Net_B").text(Math.round((net_total_b + price11_net_b) * 1000) / 1000); //折上折 5~10m2 9.9折 10~20m2 9.8折 // if (pf > 5 && pf <= 10) { // $("#spanZsz").text("(您已享受了折上折 0.99折)"); // $("#spanTotal_Net").text(parseFloat((net_total + price11_net) * 0.99)); // } else if (pf > 10) { // $("#spanZsz").text("(您享受折了折上折 0.98折)"); // $("#spanTotal_Net").text(parseFloat((net_total + price11_net) * 0.98)); // } if (width >= 250 || length >= 250) { $("#spanTotal_Net").text((net_total + price11_net) * 2); $("#NetPay_Total").val((net_total + price11_net) * 2); //保留价格 } if (net_total > 20000) { $.messager.alert('温馨提示', '本公司线上下单暂只支持小于20000元的订单!'); return false; } //初始化数据 price1 = 0; price2 = 0; price3 = 0; price4 = 0; price5 = 0; price6 = 0; price7 = 0; price8 = 0; price9 = 0; price10 = 0; price21 = 0; price22 = 0; price11 = 0; total = 0; price1_net = 0; price2_net = 0; price3_net = 0; price4_net = 0; price5_net = 0; price6_net = 0; price7_net = 0; price8_net = 0; price9_net = 0; price10_net = 0; price21_net = 0; price22_net = 0; price11_net = 0; net_total = 0; price1_net_b = 0; price2_net_b = 0; price3_net_b = 0; price4_net_b = 0; price5_net_b = 0; price6_net_b = 0; price7_net_b = 0; price8_net_b = 0; price9_net_b = 0; price10_net_b = 0; price21_net_b = 0; price22_net_b = 0; price11_net_b = 0; net_total_b = 0; //不能享受5%的抵扣 //$("#divCoupon").hide(); } //第二步 提交 function btnOK() { $("#btnSubmitOK").attr("disabled", "disabled"); var fileIdAndName = $("#hFileUpload").val(); // if (fileIdAndName == "") { // $.messager.confirm('温馨提示', "您确定不上传文件,直接提交订单?", function (r) { // if (r) { // } // }); // } //下单详情 var width = $("#spanWidth").text(); var length = $("#spanLength").text(); var num = $("#spanNum").text(); var cailiao = $("#spanCailiao").text(); var area = $("#spanArea").text(); var copperThickness = $("#spanCopperThickness").text(); var layers = $("#spanLayers").text(); var solderColor = $("#spanSolderColor").text(); var boardThickness = $("#spanBoardThickness").text(); var fontColor = $("#spanFontColor").text(); var testType = $("#spanTestType").text(); var platingType = $("#spanPlatingType").text(); var bill = $("#spanBill").text(); var zhfg = $("#spanZhfg").text(); var Jhsj = $("#spanJhsj").text(); var pingBan = $("#spanPingBan").text(); var expressType = SingGooJS.GetSelectText("selExpressType"); var expressName = SingGooJS.GetSelectText("selExpressName"); var payType = SingGooJS.GetSelectValue("selPayType"); var txtNote = $("#txtNote").val(); var txtAddress = $("#txtAddress").val(); //收货地址 var lineweight = $("#spanLineweight").text(); //线宽线距 var visa = $("#spanVisa").text(); //孔径孔数 var totalNet = $("#spanTotal_Net").text(); //网络支付总价 var total = $("#spanTotal").text(); //代收总价 var zq_total = $("#Zq_Pay_Total").val(); //代金券抵消的费用 var lastDate = $("#spanLastDate").text(); //交货日期 var jhsj = $("#radDeliveryType").val(); //交货时间 如 正常样板(3-4)天 //价格 var totalPrice = $("#spanTotal").text(); var totalPriceNet = $("#spanTotal_Net").text(); var price1 = $("#span1").text(); var priceNet1 = $("#span1_Net").text(); var price2 = $("#span2").text(); var priceNet2 = $("#span2_Net").text(); var price3 = $("#span3").text(); var priceNet3 = $("#span3_Net").text(); var price4 = $("#span4").text(); var priceNet4 = $("#span4_Net").text(); var price5 = $("#span5").text(); var priceNet5 = $("#span5_Net").text(); var price6 = $("#span6").text(); var priceNet6 = $("#span6_Net").text(); var price7 = $("#span7").text(); var priceNet7 = $("#span7_Net").text(); var price8 = $("#span8").text(); var priceNet8 = $("#span8_Net").text(); var price9 = $("#span9").text(); var priceNet9 = $("#span9_Net").text(); var price10 = $("#span21").text(); var priceNet10 = $("#span21_Net").text(); var price22 = $("#span22").text(); var priceNet22 = $("#span22_Net").text(); var price11 = $("#Hidden11").val(); //快递费 var usedScore = $("#iUsedBeans").val(); //使用了多少积分 var totalPriceNetB = $("#spanTotal_Net_B").text(); //网络支付50%,总价 $.ajax({ type: 'POST', url: 'http://www.dydpcb.com/js/tools/registered.ashx', data: 'param=AddOrder&fileIdAndName=' + fileIdAndName + "&totalNet=" + totalNet + "&total=" + total + "&zq_total=" + zq_total + "&lastDate=" + lastDate + "&jhsjType=" + jhsj + "&width=" + width + "&length=" + length + "&num=" + num + "&cailiao=" + cailiao + "&area=" + area + "&copperThickness=" + copperThickness + "&layers=" + layers + "&solderColor=" + solderColor + "&boardThickness=" + boardThickness + "&fontColor=" + fontColor + "&testType=" + testType + "&platingType=" + platingType + "&bill=" + bill + "&zhfg=" + zhfg + "&Jhsj=" + Jhsj + "&pingBan=" + pingBan + "&expressType=" + expressType + "&expressName=" + expressName + "&payType=" + payType + "&txtNote=" + escape(txtNote) + "&txtAddress=" + escape(txtAddress) + "&lineweight=" + lineweight + "&visa=" + visa + "&totalPrice=" + Math.round(totalPrice * 100) / 100 + "&totalPriceNet=" + Math.round(totalPriceNet * 100) / 100 + "&price1=" + price1 + "&priceNet1=" + priceNet1 + "&price2=" + price2 + "&priceNet2=" + priceNet2 + "&price3=" + price3 + "&priceNet3=" + priceNet3 + "&price4=" + price4 + "&priceNet4=" + priceNet4 + "&price5=" + price5 + "&priceNet5=" + priceNet5 + "&price6=" + price6 + "&priceNet6=" + priceNet6 + "&price7=" + price7 + "&priceNet7=" + priceNet7 + "&price8=" + price8 + "&priceNet8=" + priceNet8 + "&price9=" + price9 + "&priceNet9=" + priceNet9 + "&price10=" + price10 + "&priceNet10=" + priceNet10 + "&price22=" + price22 + "&priceNet22=" + priceNet22 + "&price11=" + price11 + "&usedScore=" + usedScore + "&totalPriceNetB=" + Math.round(totalPriceNetB * 100) / 100, timeout: 30000, dataType: 'text', error: function () { //$.messager.alert('温馨提示', '系统繁忙,请稍候后试!', 'error'); }, success: function (outmsg) { if (parseInt(outmsg) > 0) { alert("恭喜您,下单成功!"); $('#divUpFile').dialog('close'); window.location.href = "../preset.aspx.htm"/*tpa=http://www.dydpcb.com/preset.aspx*/; } else { $("#btnSubmitOK").removeAttr("disabled"); $.messager.alert('温馨提示', outmsg); } } }); } //返回修改 function goBack() { $("#divStep1").show(); $("#divStep2").hide(); } //打开上传框,检测是否已登录 function uploadPcb_Onclick() { $.ajax({ type: 'POST', url: 'http://www.dydpcb.com/js/tools/registered.ashx', data: 'param=IsLogin', timeout: 30000, dataType: 'text', error: function () { //$.messager.alert('温馨提示', '系统繁忙,请稍候后试!', 'error'); }, success: function (outmsg) { if (outmsg != "您暂未登录,请登录后继续下单操作!") { $('#divUpFile').dialog('open'); $('#divUpFile').dialog('move', { top: 450 }); } else { $.messager.confirm('温馨提示', outmsg, function (r) { if (r) { window.open("http://www.dydpcb.com/js/login.aspx"); } }); } } }); } //是否使用代金券 function selectTicket() { var ticketBalance = $("#spanTicketBalance").text(); //代金券余额 var total = $("#spanTotal").text(); //代收价 var totalNet = $("#spanTotal_Net").text(); //网付价 if (totalNet > 10) { if (document.getElementById("cbIsUseTicket").checked) { if (parseFloat(ticketBalance) > 0) { var total_temp = total - Math.round((total * 0.02) * 1000) / 1000; $("#Zq_Pay_Total").val(Math.round((total * 0.02) * 1000) / 1000); //保存抵消的费用 var totalNet_temp = totalNet - Math.round((totalNet * 0.02) * 1000) / 1000; $("#spanTotal").text(total_temp); $("#spanTotal_Net").text(totalNet_temp); } } else { $("#spanTotal").text($("#Pay_Total").val()); $("#spanTotal_Net").text($("#NetPay_Total").val()); $("#spanScore").text($("#hScore").val()); } } } //打开积分抵现框 function showOrHideBean() { if ($("#Beans").css("display") == "none") { $("#Beans").show(); //查询出会员的积分 $.ajax({ type: 'POST', url: 'http://www.dydpcb.com/js/tools/registered.ashx', data: 'param=GetScore', timeout: 30000, dataType: 'text', error: function () { //$.messager.alert('温馨提示', '系统繁忙,请稍候后试!', 'error'); }, success: function (outmsg) { $("#hScore").val(outmsg); $("#spanScore").text(outmsg); } }); } else { $("#Beans").hide(); } } //确认使用积分 function usedBeansOnClick() { var usedScore = $("#iUsedBeans").val(); if (usedScore == "积分") usedScore = 0; usedScore = Math.round(usedScore * 100) / 100; if (usedScore <= 0 || isNaN(usedScore) == true || usedScore == "") { $.messager.alert('温馨提示', '暂无可用积分!', 'error'); return false; } var Score = $("#spanScore").text(); //可使用的积分 if (usedScore > Score) { $.messager.alert('温馨提示', '请正确使用您的可用积分!', 'error'); return false; } //保存可折现的金额 $("#hScoreToMoney").val(parseInt(usedScore / 10)); //减掉可用积分 $("#spanScore").text(Score - usedScore); //减掉总价 $("#spanTotal_Net").text(parseInt($("#spanTotal_Net").text() - $("#hScoreToMoney").val())); }