**编号 ****
交易方式 化品竞价销售
当前状态 交易中
报价开始时间 2026-09-02 16:44:57
报价结束时间 2026-09-03 11:30:00
= 'TP-10001') { if (price < parseFloat(sku.originPrice)) { layoututils.msg("我的报价需要大于等于起拍价", 2); $(_this).val(""); return false; } if (!isNaN(parseFloat(sku.ltPriceMax)) price > parseFloat(sku.ltPriceMax)) { layoututils.msg("我的报价不可高于最高限价", 2); $(_this).val(""); return false; } // if ((price*1000 - parseFloat(sku.originPrice*1000)) % parseFloat(sku.ltPriceUnit*1000) != 0) { if (floatMod(floatSub(price, parseFloat(sku.originPrice)), parseFloat(sku.ltPriceUnit)) != 0) { layoututils.msg("我的报价需要为起拍价与最小变价幅度整数倍的和", 2); $(_this).val(""); return false; } } // 校验报价金额是否异常 checkPrice(price, sku); /*计算金额*/ // 需要追加的保证金金额 var marginDpstV = 0; // 保证金类型 var dpstTp = $("input[name=dpstTp]").val(); // 保证金金额或者百分比 var dpstV = $("input[name=dpstV]").val(); // 已交保证金金额 var dpstAmount = parseFloat($("input[name=depositPaidAmount]").val()); // 总报价金额 var totalBidAmount = parseFloat($("#totalBidAmount").text()); if (dpstTp == "TD-D100****0002") { marginDpstV = floatSub(totalBidAmount parseFloat(dpstV) / 100, dpstAmount); } else if (dpstTp == "TD-D100****0003") { marginDpstV = floatSub(parseFloat(dpstV), dpstAmount); } else { return false } if (parseFloat(marginDpstV) > 0) { $("#addMarginText").text((parseFloat(marginDpstV)).toFixed(2)); } else { if (!dpstTp == "TD-D100****0004") { $("#addMarginText").text(0); } } } /* 数量修改 */ function changeAmount(_this) { console.log(11) var dataTitle = $(".chn-count-down-title").find("span").text() if (dataTitle.indexOf("已流拍") > -1 || dataTitle.indexOf("交易结束") > -1) { return false; } var amount = parseFloat($(_this).val()); if (isNaN(amount)) { return; } var skuJson = $(_this).parent().parent().attr("skuJsonData"); var sku = JSON.parse(skuJson); if (amount < parseFloat(sku.ltQtyMin)) { layoututils.msg("我的交易量不可小于最小交易量", 2); $(_this).val(""); return false; } if (amount > parseFloat(sku.ltQtyMax)) { layoututils.msg("我的交易量不能超过所选产品的最大交易量", 2); $(_this).val(""); return false; } if (floatMod(floatSub(amount, parseFloat(sku.ltQtyMin)), parseFloat(sku.ltQtyUnit)) != 0) { layoututils.msg("我的交易量需要为最小交易量与最小变量单位整数倍的和", 2); $(_this).val(""); return false; } checkPriceConfirm(sku) /*计算金额*/ // 需要追加的保证金金额 var marginDpstV = 0; // 保证金类型 var dpstTp = $("input[name=dpstTp]").val(); // 保证金类型值 var dpstV = $("input[name=dpstV]").val(); // 已交保证金金额 var dpstAmount = parseFloat($("input[name=depositPaidAmount]").val()); // 总报价金额 var totalBidAmount = parseFloat($("#totalBidAmount").text()); if (dpstTp == "TD-D100****0002") { marginDpstV = floatSub(totalBidAmount parseFloat(dpstV) / 100, dpstAmount); } else if (dpstTp == "TD-D100****0003") { marginDpstV = floatSub(parseFloat(dpstV), dpstAmount); } else if (dpstTp == "TD-D100****0004") { marginDpstV = floatSub(parseFloat(dpstV) amount, dpstAmount); } else { return false } if (parseFloat(marginDpstV) > 0) { $("#addMarginText").text(parseFloat(marginDpstV).toFixed(2)); } else { $("#addMarginText").text(0); } } /** 变量单位加减 */ function changeNum(_this, ltUnitNum, type, th, defaultMin) { var skuJson = $(_this).parent().parent().attr("skuJsonData"); var sku = JSON.parse(skuJson); var tdTp = 'TP-10001'; //递减 if (type == 0) { var amount = $(_this).next().val(); if (isNaN(amount)) { return; } if (amount == "") { amount = 0; } var num = floatSub(parseFloat(amount), parseFloat(ltUnitNum)); //超过阈值 不做递减 if (th != "" !isNaN(parseFloat(th)) num < parseFloat(th)) { return; } $(_this).next().val(num); //采购场景 校验报价是否异常 if (tdTp == 'TP-10002') { checkPrice(num, sku) } } else { //递增 var amount = $(_this).prev().val(); if (isNaN(amount)) { return; } if (amount == "") { amount = defaultMin; } var num = floatAdd(parseFloat(amount), parseFloat(ltUnitNum)); //超过阈值 不做递增 if (th != "" !isNaN(parseFloat(th)) num > parseFloat(th)) { return; } $(_this).prev().val(num); //销售场景 校验报价是否异常 if (tdTp == 'TP-10001') { checkPrice(num, sku) } } } /** 校验报价金额是否异常 */ function checkPrice(price, sku) { var reminderMultiple = parseInt(sku.reminderMultiple); var ltPriceUnit = parseFloat(sku.ltPriceUnit); var bidPriceStr = parseFloat(); var tdTp = 'TP-10001'; //销售 校验报价金额是否过高 if (tdTp == 'TP-10001') { if (!isNaN(reminderMultiple) !isNaN(ltPriceUnit)) { if (isNaN(bidPriceStr)) { // 首次报价过高 var originPrice = parseFloat(sku.originPrice); if (price - originPrice > ltPriceUnit reminderMultiple) { checkPriceConfirm(sku); } } else { // 非首次报价 if (price - bidPriceStr > ltPriceUnit reminderMultiple) { checkPriceConfirm(sku); } } } } //采购 校验报价金额是否过低 if (tdTp == 'TP-10002') { if (!isNaN(reminderMultiple) !isNaN(ltPriceUnit)) { var floorPrice = parseFloat(sku.floorPrice); if (isNaN(bidPriceStr)) { // 首次报价过低 if (floorPrice - price > ltPriceUnit reminderMultiple) { checkPriceConfirm(sku); } } else { // 非首次报价 if (bidPriceStr - price > ltPriceUnit reminderMultiple) { checkPriceConfirm(sku); } } } } } /** 异常报价确认 */ function checkPriceConfirm(sku) { var tdTp = 'TP-10001'; let quantity = $("input[name='bidItems[0].quantity']").val() //交易量 let price = $("input[name='bidItems[0].price']").val() //报价 let multiple = 0; //采购 if (tdTp=='TP-10002') { multiple = Math.abs((price - sku.floorPrice) / sku.ltPriceUnit) //(报价-拦标价)/变价幅度 }else{ //销售 multiple = (price - sku.originPrice) / sku.ltPriceUnit //(报价-起拍价)/变价幅度 } if(quantity price multiple!=0){ $('#ID-test-layer-wrapper .quantity').text(quantity + '吨') $('#ID-test-layer-wrapper .price').text(price + '元/吨') $('#ID-test-layer-wrapper .multiple').text(formatNumber(multiple) + '倍') layer.open({ type: 1, title: '重要提示', area: ['400px', '200px'], closeBtn: 1, content: $('#ID-test-layer-wrapper'), // 捕获的元素 btn: ['我已知晓'], btn1:function (index, layero, that){ layer.close(index); }, btn2:function (index, layero, that){ layer.closeAll(); } }); } } function formatNumber(num) { let formattedNum = num.toFixed(1); // 保留一位小数 if (/\.0$/.test(formattedNum)) { // 如果小数部分为0,则去掉小数点后面的数字 formattedNum = formattedNum.replace(/\.0$/, ''); } return formattedNum; }