xuzhiheng 6 жил өмнө
parent
commit
0c970b31df

+ 1 - 1
src/web/templates/weixin/dataExport/dataExport_area.html

@@ -464,7 +464,7 @@
 					$('.result_name').empty()
 				});
 				//
-				 if(localStorage.area !== ""){
+				 if(localStorage.area !== "" && localStorage.area!==undefined){
 					 var area = localStorage.area.split(" ");
 					 for(var i in area){
 						 $(".tab_content").find(".city").each(function(){

+ 7 - 16
src/web/templates/weixin/dataExport/dataExport_buyer.html

@@ -15,24 +15,15 @@
 	</head>
 	<body>
 		<div class="win_bid" id="win_bid">
-			<!-- <header class="header">
-				<a href="" class="return pull-left">
-					<i class="icon iconfont">&#xe640;</i>
-				</a>
-				<h1 class="title">采购单位</h1>
-			</header> -->
 			<main class="main">
-				<form action="/front/wx_dataExport/buyerEdit" class="form">
-					<div class="form-item">
-						<input type="text" placeholder="采购单位名称">
-					</div>
-					<button class="btn">确认</button>
-					<a href="#" class="query">
-						疑问解答
-						<i class="iconfont icon-wenhao "></i>
-					</a>
-				</form>
+
 			</main>
+			<div class="form">
+				<div class="form-item">
+					<input type="text" placeholder="采购单位名称">
+				</div>
+				<button class="btn">确认</button>
+			</div>
 			<!-- 引用weui Dialog组件 -->
 			<div class="js_dialog" id="tipDialog" style="display: none;">
 				<div class="weui-mask"></div>

+ 89 - 85
src/web/templates/weixin/dataExport/dataExport_buyerEdit.html

@@ -12,7 +12,28 @@
 		<link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css" />
 		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/win_bid.css">
 		{{include "/common/weixin.html"}}
+		<script src="/js/jquery.js"></script>
 	</head>
+	<style>
+		.win_bid .buyer .form-buyer {
+			padding: .3rem;
+			margin: .2rem 0;
+			background: #fff;
+		}
+		.win_bid .buyer .form-buyer input {
+			width: 100%;
+			height: 100%;
+			font-size: .28rem;
+		}
+		.win_bid .buyer .btn {
+			width: 100%;
+			height: .94rem;
+			background: #2cb7ca;
+			color: #fff;
+			font-size: .34rem;
+			text-align: center;
+		}
+	</style>
 	<body>
 		<div class="win_bid" id="win_bid_edit">
 			<!-- <header class="header">
@@ -23,40 +44,21 @@
 			</header> -->
 			<main class="main">
 				<form action="" class="form-edit">
-					<div class="form-item">
-						<div class="item-control">
-							<input type="text" placeholder="采购单位名称" disabled="disabled" value="郑州市工商局">
-							<span class="edit">
-								<i class="icon iconfont">&#xe60e;</i>
-								修改
-							</span>
-						</div>
-						<div class="item-btn">
-							<button class="btn del">删除</button>
-							<button class="btn enter">确认</button>
-						</div>
-					</div>
-					<div class="form-item">
-						<div class="item-control">
-							<input type="text" placeholder="采购单位名称" disabled="disabled" value="郑州市工商局">
-							<span class="edit">
-								<i class="icon iconfont">&#xe60e;</i>
-								修改
-							</span>
-						</div>
-						<div class="item-btn">
-							<button class="btn del">删除</button>
-							<button class="btn enter">确认</button>
-						</div>
-					</div>
+
 				</form>
+				<div class="buyer" style="display: none">
+					<div class="form-buyer">
+						<input type="text" placeholder="采购单位名称">
+					</div>
+					<button class="btn">确认</button>
+				</div>
 				<a href="#" class="query">
 					疑问解答
 					<i class="icon iconfont">&#xe63b;</i>
 				</a>
-				<a href="/front/wx_dataExport/buyer" class="add">
+				<div class="add">
 					<img src="{{Msg "seo" "cdn"}}/wx_dataExport/images/icon_add.png" >
-				</a>
+				</div>
 			</main>
 			<!-- weui toast -->
 			<div id="toast" style="display: none;">
@@ -96,30 +98,29 @@
 		<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
 		<script>
 			$(function(){
-				//
-				var buyerarr = {{.T.data}};
-				// console.log(buyerarr);
-				var buyerHtml = "";
-				if(buyerarr === ""){
-					window.location.href="/front/wx_dataExport/buyer";
-				}
-				for (var i in buyerarr) {
-					buyerHtml += `
-					<div class="form-item">
-						<div class="item-control">
-							<input type="text" id="buy" placeholder="采购单位名称" disabled="disabled" value="${buyerarr[i]["buyer"]}">
-							<span class="edit">
-								<i class="icon iconfont">&#xe60e;</i>
-								修改
-							</span>
-						</div>
-						<div class="item-btn">
-							<button class="btn del">删除</button>
-							<button class="btn enter">确认</button>
-						</div>
-					</div>`;
-				}
-				$(".form-edit").html(buyerHtml);
+				// var buyerarr = {{.T.data}};
+				// // console.log(buyerarr);
+				// var buyerHtml = "";
+				// if(buyerarr === ""){
+				// 	window.location.href="/front/wx_dataExport/buyer";
+				// }
+				// for (var i in buyerarr) {
+				// 	buyerHtml += `
+				// 	<div class="form-item">
+				// 		<div class="item-control">
+				// 			<input type="text" id="buy" placeholder="采购单位名称" disabled="disabled" value="${buyerarr[i]["buyer"]}">
+				// 			<span class="edit">
+				// 				<i class="icon iconfont">&#xe60e;</i>
+				// 				修改
+				// 			</span>
+				// 		</div>
+				// 		<div class="item-btn">
+				// 			<button class="btn del">删除</button>
+				// 			<button class="btn enter">确认</button>
+				// 		</div>
+				// 	</div>`;
+				// }
+				// $(".form-edit").html(buyerHtml);
 				// 疑问解答
 				$('.query').click(function(){
 					$('#tipDialog').show(200);
@@ -130,34 +131,16 @@
 				// 修改
 				$('.edit').click(function(event){
 					$(this).siblings('input').removeAttr("disabled").parent().siblings('.item-btn').show(400);
-					var buyer = $(this).prev().val();
-					sessionStorage.buyer = buyer;
 				});
 				// 删除
 
 				$('.del').click(function(){
-					var buyer = $(this).parent().prev().find("input").val();
-					$.ajax({
-						type: 'post',
-						url: '/front/wx_dataExport/delBuyer',
-						data: {"buyer": buyer},
-						async: false,
-						dataType: 'json',
-					});
 					$(this).parent().parent().remove();
 				});
 				// 输入内容确认
 				$('.enter').click(function(){
-					var buyer = sessionStorage.buyer;
-					var buyerEdit = $(this).parent().prev().find("input").val();
+					// var buyerEdit = $(this).parent().prev().find("input").val();
 					var $toast = $('#toast');
-					$.ajax({
-						type: 'post',
-						url: '/front/wx_dataExport/editBuyer',
-						data: {"buyer": buyer, "buyerEdit": buyerEdit},
-						async: false,
-						dataType: 'json',
-					});
 					// console.log($(this).parent().siblings().children().val().length)
 					if($(this).parent().siblings().children().val().length > 15){
 						if ($toast.css('display') != 'none'){
@@ -170,20 +153,41 @@
 					}else{
 						$(this).parent().hide(600);
 					}
-				})
-				/* $('.add').click(function(){
-					$('.form-edit').append('<div class="form-item">\
-												<div class="item-control">\
-													<input type="text" placeholder="中标单位名称" disabled="disabled" value="郑州市工商局">\
-													<span class="edit"><i class="icon iconfont">&#xe60e;</i>修改</span>\
-												</div>\
-												<div class="item-btn">\
-													<button class="btn del">删除</button>\
-													<button class="btn enter">确认</button>\
-												</div>\
-											</div>')
-				}) */
-
+				});
+				//
+				$('.add').click(function(){
+					$(".buyer").show();
+					$(".form-item").hide();
+				});
+				//
+				var buyerarr = [];
+				var buyerHtml = "";
+				$(".btn").on('click', function () {
+					var buyer = $(".form-buyer input").val();
+					buyerarr.push(buyer);
+					$(".buyer").hide();
+					$(".form-item").show();
+					console.log(buyerarr)
+				});
+				if (buyerarr !== []){
+					for(var i in buyerarr){
+						buyerHtml += `
+					<div class="form-item">
+						<div class="item-control">
+							<input type="text" id="buy" placeholder="采购单位名称" disabled="disabled" value="${ i }">
+							<span class="edit">
+								<i class="icon iconfont">&#xe60e;</i>
+								修改
+							</span>
+						</div>
+						<div class="item-btn">
+							<button class="btn del">删除</button>
+							<button class="btn enter">确认</button>
+						</div>
+					</div>`;
+					}
+					$(".form-edit").html(buyerHtml);
+				}
 			})
 		</script>
 	</body>

+ 1 - 1
src/web/templates/weixin/dataExport/dataExport_industry.html

@@ -249,7 +249,7 @@
                 window.location.href = "/front/wx_dataExport/toSieve";
             });
             //
-            if(localStorage.industry !== ""){
+            if(localStorage.industry !== "" && localStorage.industry!==undefined){
                 var industry = localStorage.industry.split(" ");
                 for(var i in industry){
                     $(".list ul li").find("dd").each(function(){

+ 1 - 1
src/web/templates/weixin/dataExport/dataExport_price.html

@@ -65,7 +65,7 @@
             window.location.href = "/front/wx_dataExport/toSieve"
         });
         //
-        if(localStorage.price !== ""){
+        if(localStorage.price !== "" && localStorage.price!==undefined){
             var price = localStorage.price.replace("-","").split("万元");
             var prices = price.filter(function (e) {
                 return e !== "";

+ 1 - 1
src/web/templates/weixin/dataExport/dataExport_subType.html

@@ -176,7 +176,7 @@
                 window.location.href = "/front/wx_dataExport/toSieve";
             });
             //
-            if(localStorage.subType !== ""){
+            if(localStorage.subType !== "" && localStorage.subType!==undefined){
                 var subType = localStorage.subType.split(" ");
                 // var subTypes = subType.filter(function (e) {
                 //     return e !== "";

+ 13 - 0
src/web/templates/weixin/dataExport/dataExport_winnerEdit.html

@@ -96,6 +96,19 @@
 		<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
 		<script>
 			$(function(){
+				//强制返回到数据导出
+				$(document).ready(function (e) {
+					if (window.history && window.history.pushState) {
+						$(window).on('popstate', function () {
+							window.history.pushState('forward', null, '#');
+							window.history.forward(1);
+							// alert("不可回退");  //如果需在弹框就用它
+							self.location="/front/wx_dataExport/toSieve"; //如查需要跳转页面就用它
+						});
+					}
+					window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
+					window.history.forward(1);
+				});
 				//
 				var winnerarr = {{.T.data}};
 				// console.log(winnerarr);