Browse Source

【个人信息】学术领域和应用行业里空数据及重复数据不能添加

jack 8 years ago
parent
commit
e597725a7f
2 changed files with 36 additions and 6 deletions
  1. 34 6
      js/newsciresource.js
  2. 2 0
      js/popup.js

+ 34 - 6
js/newsciresource.js

@ -67,7 +67,7 @@ $(function(){
67 67
					{
68 68
						for (var i = 0; i < subs.length; i++) 
69 69
						{
70
							$("#"+industryList+"").append("<div class='"+deleteIndustry+"'>"+ subs[i] +"<span class='removeNu'><img src='images/move.png'></span></div>");																
70
							$("#"+industryList+"").append("<div class='"+deleteIndustry+"'><em>"+ subs[i] +"</em><span class='removeNu'><img src='images/move.png'></span></div>");																
71 71
						};
72 72
					}	
73 73
				}			
@ -79,15 +79,43 @@ $(function(){
79 79
			});	
80 80
		$("#industryAdd").click(function(){
81 81
			var val=$("#industry").val();
82
			$("#industryList").append("<div class='deleteIndustry'>"+ val +"<span class='removeNu'><img src='images/move.png'></span></div>")							
83
			});
82
			if(!val.trim()){
83
				$(".workmsg5").text("请填写应用行业");
84
				return;
85
			}else{
86
				$(".workmsg5").text("");
87
			}
88
			var vallist1 = $("#industryList .deleteIndustry em");
89
			for(var i=0;i<vallist1.length;i++){
90
				if(vallist1[i].innerText==val){
91
					$(".workmsg5").text("不能添加重复内容");
92
					return;
93
				}
94
			}
95
			$("#industryList").append("<div class='deleteIndustry'><em>"+ val +"</em><span class='removeNu'><img src='images/move.png'></span></div>")							
96
			$("#industry").val("");
97
		});
84 98
		$("#SubjectList").on("click",".removeNu",function(){					
85 99
			$(this).parent().remove();
86 100
			});	
87 101
		$("#subjectAdd").click(function(){				
88
			var val=$("#subject").val();
89
			$("#SubjectList").append("<div class='deleteSubject'>"+ val +"<span class='removeNu'><img src='images/move.png'></span></div>")							
90
			});
102
			var va=$("#subject").val();
103
			if(!va.trim()){
104
				$(".workmsg4").text("请填写学术领域");
105
				return;
106
			}else{
107
				$(".workmsg4").text("");
108
			}
109
			var vallist2 = $("#SubjectList .deleteSubject em");
110
			for(var i=0;i<vallist2.length;i++){
111
				if(vallist2[i].innerText==va){
112
					$(".workmsg4").text("不能添加重复内容");
113
					return;
114
				}
115
			}
116
			$("#SubjectList").append("<div class='deleteSubject'><em>"+ va +"</em><span class='removeNu'><img src='images/move.png'></span></div>")							
117
			$("#subject").val("");
118
		});
91 119
	}
92 120
//我的资源的删除,修改
93 121
	$("#workmysrc").on("click",".resoumag",function()

+ 2 - 0
js/popup.js

@ -22,8 +22,10 @@ function ResourceInfo() {
22 22
		PopHtml += '<tr class="workmsgbox"><th></th><td><div class="resouinforcon"><div class="workmsg workmsg3"></div></div></td></tr>  ';
23 23
		PopHtml += '<tr><th class="resouinfotype"  scope="row">学术领域</th><td><div class="resouinforcon"><input type="text" class="frmtype subCla" id="subject"><input type="button" value="添加" class="addIndusry" id="subjectAdd"></div></td></tr>';
24 24
		PopHtml += '<tr><th></th><td><div class="addlist" id="SubjectList"></div></td></tr>'
25
		PopHtml += '<tr class="workmsgbox"><th></th><td><div class="resouinforcon"><div class="workmsg workmsg4"></div></div></td></tr>  ';
25 26
		PopHtml += '<tr><th class="resouinfotype"  scope="row">应用行业</th><td><div class="resouinforcon" id="resouinforcon"><input type="text" class="frmtype" id="industry"><input type="button" value="添加" class="addIndusry" id="industryAdd"></div></td></tr>'; 	
26 27
		PopHtml += '<tr><th></th><td><div class="addlist" id="industryList"></div></td></tr>';
28
		PopHtml += '<tr class="workmsgbox"><th></th><td><div class="resouinforcon"><div class="workmsg workmsg5"></div></div></td></tr>  ';
27 29
		//PopHtml += '<tr><th class="resouinfotype"  scope="row">期望付款方式</th><td><div class="resouinforcon"><input type="text" class="frmtype" placeholder="例:一次性付款"  id="hopePayMethod"></div></td></tr>';
28 30
		PopHtml += '<tr class="limitBox"><th class="resouinfotype" scope="row">合作备注</th><td class="limitwordbox"><div class="resouinforcon limitwords"><textarea class="frmtype" id="cooperationNotes"></textarea></div></td></tr>';
29 31
		//PopHtml += '<tr class="limitBox"><th class="resouinfotype"  scope="row">详细描述</th><td class="limitwordbox"><div class="resouinforcon limitwords"><textarea class="frmtype" id="descp"></textarea></div></td></tr>';