From ec060ce444cdd1c48a54686cadbc8950478eedcf Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 22 八月 2025 16:27:34 +0800
Subject: [PATCH] 网页内容修改

---
 kp_html/kp/js/page.js |  180 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 157 insertions(+), 23 deletions(-)

diff --git a/kp_html/kp/js/page.js b/kp_html/kp/js/page.js
index 196e371..bdab12e 100644
--- a/kp_html/kp/js/page.js
+++ b/kp_html/kp/js/page.js
@@ -825,7 +825,6 @@
 				},
 
 				get_big_order_deal_info: function(code) {
-
 					http_util.get_big_order_deal_info(code, function(res) {
 						res = JSON.parse(res);
 						if (res.code == 0) {
@@ -1091,7 +1090,7 @@
 							res.data.forEach(function(e) {
 								let date = new Date(e[2] * 1000);
 								let hours = String(date.getHours()).padStart(2,
-								'0');
+									'0');
 								let minutes = String(date.getMinutes()).padStart(2,
 									'0');
 								let seconds = String(date.getSeconds()).padStart(2,
@@ -1185,8 +1184,8 @@
 
 				get_l2_subscript_codes: function() {
 					http_util.get_l2_subscript_codes(function(res) {
-						res= JSON.parse(res);
-					
+						res = JSON.parse(res);
+
 						if (res.code == 0) {
 							console.log("璁㈤槄鐨勪唬鐮侊細", res.data);
 							try {
@@ -1273,6 +1272,55 @@
 						}
 					});
 				},
+				add_total_big_order_threshold: function() {
+					// 缂栬緫鎬诲ぇ鍗�
+					let threshold_money = app.big_order_deal_info[2][4] ? app.big_order_deal_info[2]
+						[4] : app.big_order_deal_info[2][2];
+					var threshold_money_number = 0;
+					if (threshold_money.indexOf("涓�") >= 0) {
+						threshold_money_number = (parseFloat(threshold_money.replace("涓�", "")) /
+							10000).toFixed(2)
+					} else if (threshold_money.indexOf("浜�") >= 0) {
+						threshold_money_number = (parseFloat(threshold_money.replace("浜�", "")))
+							.toFixed(2)
+					}
+					let money = threshold_money_number * 100000000 + 10000000;
+					http_util.set_total_deal_big_order_threshold_money(app.code, money,
+						function(res) {
+							if (res.code != 0) {
+								layer.msg(res.msg)
+								return;
+							}
+							layer.msg("淇敼鎴愬姛")
+							layer.close(index) // 鍏抽棴褰撳墠寮圭獥
+							app.get_big_order_deal_info(app.code);
+						});
+				},
+				sub_total_big_order_threshold: function() {
+					// 缂栬緫鎬诲ぇ鍗�
+					let threshold_money = app.big_order_deal_info[2][4] ? app.big_order_deal_info[2]
+						[4] : app.big_order_deal_info[2][2];
+					var threshold_money_number = 0;
+					if (threshold_money.indexOf("涓�") >= 0) {
+						threshold_money_number = (parseFloat(threshold_money.replace("涓�", "")) /
+							10000).toFixed(2)
+					} else if (threshold_money.indexOf("浜�") >= 0) {
+						threshold_money_number = (parseFloat(threshold_money.replace("浜�", "")))
+							.toFixed(2)
+					}
+					let money = threshold_money_number * 100000000 - 10000000;
+					http_util.set_total_deal_big_order_threshold_money(app.code, money,
+						function(res) {
+							if (res.code != 0) {
+								layer.msg(res.msg)
+								return;
+							}
+							layer.msg("淇敼鎴愬姛")
+							layer.close(index) // 鍏抽棴褰撳墠寮圭獥
+							app.get_big_order_deal_info(app.code);
+						});
+				},
+
 				edit_total_big_order_threshold: function() {
 					// 缂栬緫鎬诲ぇ鍗�
 					let threshold_money = app.big_order_deal_info[2][4] ? app.big_order_deal_info[2]
@@ -1312,13 +1360,15 @@
 													return;
 												}
 												layer.msg("淇敼鎴愬姛")
-												layer.close(prompt_index) // 鍏抽棴褰撳墠寮圭獥
+												layer.close(
+													prompt_index) // 鍏抽棴褰撳墠寮圭獥
 												app.get_big_order_deal_info(app
 													.code);
-												setTimeout(function(){
-													app.get_l2_subscript_codes();	
-												},100);	
-											
+												setTimeout(function() {
+													app
+														.get_l2_subscript_codes();
+												}, 100);
+
 											});
 								}
 							});
@@ -1341,21 +1391,105 @@
 								app.get_big_order_deal_info(app.code);
 							});
 					})
-
-
-					// layer.open({
-					//   type: 0, 
-					//   title:'淇敼澶у崟闃堝��',
-					//   content: "<input type='text' value = '"+ threshold_money_number +"' class='layui-input'>浜�", //杩欓噷content鏄竴涓櫘閫氱殑String
-					//   btn: ['纭淇敼', '鍙栨秷'],
-					//   yes: function(index, layero){
-					// 	      // 楠岃瘉閫氳繃鍚庣殑鍥炶皟
-					// 	     alert("123");
-					//   }
-
-					// });
-
 				},
+
+				edit_l_down_cancel_rate: function() {
+					let code = app.code;
+					let prompt_index = layer.prompt({
+						title: '淇敼L鍚庢挙鍗曟瘮渚�',
+						formType: 0, //杈撳叆妗嗙被鍨嬶紝鏀寔0锛堟枃鏈級榛樿1锛堝瘑鐮侊級2锛堝琛屾枃鏈級
+						value: "0.70", //鍒濆鏃剁殑鍊硷紝榛樿绌哄瓧绗�
+						maxlength: 20, //鍙緭鍏ユ枃鏈殑鏈�澶ч暱搴︼紝榛樿500
+						area: ['200px', '150px'], //鑷畾涔夋枃鏈煙瀹介珮
+						success: function(layero, index) {
+
+							// 鍦ㄨ緭鍏ユ鏃佽竟娣诲姞澧炲噺鎸夐挳
+							var input = layero.find('.layui-layer-input');
+							var btnContainer = $(
+								'<div style="margin-top: 10px;"></div>');
+
+							btnContainer.append(
+								$(
+									'<button class="layui-btn layui-btn-primary">-</button>'
+									)
+								.click(function() {
+									var val = parseFloat(input.val()) || 0;
+									if (val > 0.2) {
+										input.val((val - 0.2).toFixed(2));
+									} else {
+										input.val(0);
+									}
+								})
+							);
+
+							btnContainer.append(
+								$(
+									'<button class="layui-btn" style="margin-left: 10px;">+</button>'
+									)
+								.click(function() {
+									var val = parseFloat(input.val()) || 0;
+									input.val((val + 0.2).toFixed(2));
+								})
+							);
+
+							input.after(btnContainer);
+
+
+
+							$(layero).on('keydown', function(e) {
+								if (e.keyCode === 13) {
+									// 缁戝畾enter
+									var val = $('.layui-layer-input').val();
+									if (isNaN(val)) {
+										layer.msg("杈撳叆鏍煎紡鏈夎")
+										return;
+									}
+									let rate = parseFloat(val);
+
+									http_util.set_l_down_rate(code, rate,
+										function(res) {
+											if (res.code == 0) {
+												layer.msg("淇敼鎴愬姛")
+												layer.close(prompt_index)
+											} else {
+												layer.msg(res.msg)
+											}
+										});
+								}
+							});
+						}
+					}, function(val, index) {
+						// 鍙湁褰撶偣鍑荤‘璁ゆ椂鎵嶄細鎵ц杩欓噷
+						if (isNaN(val)) {
+							layer.msg("杈撳叆鏍煎紡鏈夎")
+							return;
+						}
+						let rate = parseFloat(val);
+
+						http_util.set_l_down_rate(code, rate,
+							function(res) {
+								if (res.code == 0) {
+									layer.msg("淇敼鎴愬姛")
+									layer.close(prompt_index)
+								} else {
+									layer.msg(res.msg)
+								}
+							});
+					})
+				},
+
+				reset_l_down_cancel_rate: function() {
+					let code = app.code;
+					http_util.remove_l_down_rate(code,
+						function(res) {
+							if (res.code == 0) {
+								layer.msg("璁剧疆鎴愬姛")
+							} else {
+								layer.msg(res.msg)
+							}
+						});
+				},
+
 				check_low_suction_white_plate: function(event, plate) {
 					if (event.target.checked) {
 						this.add_low_suction_white_plate(plate);

--
Gitblit v1.8.0