portal html css js resource

articalIssue.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. $(function() {
  2. var experarray = [];
  3. var resourcesarray = [];
  4. var $data = {};
  5. var articleId;
  6. var fa = false;
  7. var orgId = $.cookie("orgId");
  8. var colMgr = $.cookie("colMgr");
  9. var hbur,hburEnd;
  10. var pr,prEnd;
  11. var re,reEnd;
  12. var orgr,orgrEnd;
  13. if(orgId == "" || orgId == null || orgId == "null"){
  14. location.href = "cmp-settled-log.html";
  15. }
  16. //校验标题
  17. $("#newstitle").on({
  18. focus: function() {
  19. $(this).prev().find("span").text("50字以内");
  20. },
  21. blur: function() {
  22. $(this).prev().find("span").text("");
  23. },
  24. keyup: function() {
  25. if($(this).val().length > 50) {
  26. $(this).val($(this).val().substr(0, 50));
  27. }
  28. }
  29. })
  30. hotKey(".oinput");
  31. //校验关键字
  32. $("#KeyWord").on({
  33. focus: function() {
  34. $("#keyPrompt").text("最多可添加5个关键词,每个关键词15字以内");
  35. },
  36. blur: function() {
  37. $("#keyPrompt").text("");
  38. }
  39. })
  40. $("#keyWordlist").on("click", ".closeThis", function() {
  41. $(this).parent().remove();
  42. var liNum = $("#keyWordlist").find("li").length;
  43. if(liNum < 5) {
  44. $("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
  45. }
  46. })
  47. //校验右侧专家和资源
  48. $("#checkZj").on("focus", function() {
  49. $(this).prev().find("span").text("最多选择5位专家");
  50. })
  51. $("#checkZy").on("focus", function() {
  52. $(this).prev().find("span").text("最多选择5个资源");
  53. })
  54. $("#checkZj,#checkZy").on("blur", function() {
  55. $(this).prev().find("span").text("");
  56. //$(this).val("");
  57. //$(this).parents(".otherBlock").find(".form-drop").addClass("displayNone");
  58. })
  59. $("#checkZj").on("keyup", function() {
  60. var _this = this;
  61. var ti=$(this).val();
  62. pr=ti;
  63. if($(this).val()=="") {
  64. return;
  65. }
  66. setTimeout(function(){
  67. if( ti===pr && ti!== prEnd) {
  68. checkZj(_this,ti);
  69. }
  70. },500)
  71. })
  72. $("#checkZy").on("keyup", function() {
  73. var ti=$(this).val();
  74. re=ti;
  75. if($(this).val()=="") {
  76. return;
  77. }
  78. var _this = this;
  79. setTimeout(function(){
  80. if( ti===re && ti!== reEnd) {
  81. checkZy(_this,ti);
  82. }
  83. },500)
  84. })
  85. $("#expertlist").on("click", "li", function() {
  86. var _this = this;
  87. expertlist(_this, "该专家已选择");
  88. });
  89. $("#resouselist").on("click", "li", function() {
  90. var _this = this;
  91. expertlist(_this, "该资源已选择");
  92. });
  93. //点击右侧搜索出的专家和资源列表
  94. function expertlist(_this, title) {
  95. var liId = $(_this).html();
  96. var plength = $(_this).parents(".otherBlock").find(".addexpert li");
  97. for(var i = 0; i < plength.length; i++) {
  98. if(plength[i].innerHTML == liId) {
  99. $(_this).parents(".otherBlock").find(".aboutTit span").text(title);
  100. $(_this).parents(".otherBlock").find(".form-drop").addClass("displayNone");
  101. $(_this).parents(".otherBlock").find("input").val("");
  102. return;
  103. }
  104. }
  105. if(plength.length > 3) {
  106. $(_this).parents(".otherBlock").find("input").hide();
  107. $(_this).parents(".otherBlock").find(".addexpert").append($(_this).clone());
  108. $(_this).parents(".otherBlock").find("input").val("");
  109. $(_this).parents(".otherBlock").find(".form-drop").addClass("displayNone");
  110. } else {
  111. $(_this).parents(".otherBlock").find(".addexpert").append($(_this).clone());
  112. $(_this).parents(".otherBlock").find("input").val("");
  113. $(_this).parents(".otherBlock").find(".form-drop").addClass("displayNone");
  114. }
  115. }
  116. //删除右侧搜索出的专家和资源
  117. $(".addexpert").on("click", ".deleteThis", function() {
  118. var plength = $(this).parent().parent().find("li").length;
  119. if(plength < 6) {
  120. $(this).parents(".otherBlock").find("input").show();
  121. }
  122. $(this).parent().remove();
  123. })
  124. function checkZj(_this,prd) {
  125. prEnd=prd;
  126. $.ajax({
  127. "url": "/ajax/professor/qaByName",
  128. "type": "get",
  129. "data": {
  130. "name": $("#checkZj").val(),
  131. "total": 3
  132. },
  133. "success": function(data) {
  134. console.log(data);
  135. if(data.success) {
  136. if(data.data != "") {
  137. if(prEnd == prd){
  138. $(_this).next().removeClass("displayNone");
  139. var itemlist = '';
  140. $("#expertlist").html("");
  141. for(var i = 0; i < data.data.length; i++) {
  142. var itemlist = '<li id="usid" class="flexCenter">';
  143. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  144. itemlist += '<div class="madiaInfo">';
  145. itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
  146. itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
  147. itemlist += '</div><div class="deleteThis"></div></li>';
  148. $itemlist = $(itemlist);
  149. $("#expertlist").append($itemlist);
  150. var datalist = data.data[i];
  151. $itemlist.attr("data-id", datalist.id);
  152. $itemlist.find("#name").text(datalist.name);
  153. $itemlist.find("#title").text(datalist.title);
  154. $itemlist.find("#orgName").text(datalist.orgName);
  155. if(datalist.hasHeadImage == 1) {
  156. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
  157. }
  158. }
  159. }
  160. } else {
  161. $(_this).next().addClass("displayNone");
  162. }
  163. } else {
  164. $(_this).next().addClass("displayNone");
  165. }
  166. },
  167. "error": function() {
  168. $.MsgBox.Alert('提示', '链接服务器超时')
  169. }
  170. });
  171. }
  172. function checkZy(_this,prd) {
  173. reEnd=prd;
  174. $.ajax({
  175. "url": "/ajax/resource/qaByName",
  176. "type": "get",
  177. "data": {
  178. "resourceName": $("#checkZy").val(),
  179. "rows": 3
  180. },
  181. "success": function(data) {
  182. console.log(data);
  183. if(data.success) {
  184. if(data.data != "") {
  185. if(reEnd==prd) {
  186. $(_this).next().removeClass("displayNone");
  187. var itemlist = '';
  188. $("#resouselist").html("");
  189. for(var i = 0; i < data.data.length; i++) {
  190. var itemlist = '<li id="usid" class="flexCenter">';
  191. itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
  192. itemlist += '<div class="madiaInfo">';
  193. itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
  194. itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
  195. itemlist += '</div><div class="deleteThis"></div></li>';
  196. $itemlist = $(itemlist);
  197. $("#resouselist").append($itemlist);
  198. var datalist = data.data[i];
  199. $itemlist.attr("data-id", datalist.resourceId);
  200. $itemlist.find("#resourceName").text(datalist.resourceName);
  201. if(datalist.resourceType==1){
  202. $itemlist.find("#name").text(datalist.professor.name);
  203. }else{
  204. $itemlist.find("#name").text(datalist.organization.name);
  205. }
  206. if(datalist.images.length > 0) {
  207. $itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
  208. }
  209. }
  210. }
  211. } else {
  212. $(_this).next().addClass("displayNone");
  213. }
  214. } else {
  215. $(_this).next().addClass("displayNone");
  216. }
  217. },
  218. "error": function() {
  219. $.MsgBox.Alert('提示', '链接服务器超时')
  220. }
  221. });
  222. }
  223. var titleflase = false;
  224. var imgflase = false;
  225. //交验图片和标题不能为空
  226. function noTitleImg() {
  227. var ImageKey = $("#uploader").attr("data-id");
  228. var newstitle = $("#newstitle").val();
  229. if(ImageKey == "") {
  230. //$(".imgtis").text("请上传封面图片");
  231. $.MsgBox.Alert('提示', '请上传封面图片');
  232. return;
  233. } else {
  234. $(".imgtis").text("");
  235. imgflase = true;
  236. }
  237. if(newstitle == "") {
  238. //$("#aboutTit span").text("请输入文章标题");
  239. $.MsgBox.Alert('提示', '请输入文章标题');
  240. return;
  241. } else {
  242. $("#aboutTit span").text("");
  243. titleflase = true;
  244. }
  245. }
  246. //获取相关专家
  247. function expertli() {
  248. experarray=[];
  249. $("#expertli li").each(function(i) {
  250. var liid = $(this).attr("data-id");
  251. experarray.push(liid);
  252. });
  253. return $.unique(experarray);
  254. }
  255. //获取相关资源
  256. function resourcesli() {
  257. resourcesarray=[];
  258. $("#resources li").each(function(i) {
  259. var liid = $(this).attr("data-id");
  260. resourcesarray.push(liid);
  261. });
  262. return $.unique(resourcesarray);
  263. }
  264. var seleClum ='<div class="mb-list mb-listL"><p>请选择文章发布的栏目:</p>'+
  265. '<select class="form-control form-column" id="seletColum"></select></div>';
  266. var seleTime = '<div class="mb-list mb-listR"><p>请设置文章发布的时间:</p>'+
  267. '<div class="formTime"><div class="form-group">'+
  268. '<input size="16" type="text" value="" readonly class="form-control form_datetime">'+
  269. '</div></div></div>';
  270. //文章发布
  271. $("#release").on("click", function() {
  272. if($(this).hasClass("disableLi")){
  273. return;
  274. }
  275. noTitleImg();
  276. if(imgflase && titleflase) {
  277. console.log(colMgr)
  278. if(colMgr=="true"){
  279. $(".blackcover2").fadeIn();
  280. var btnOk='<input class="mb_btn mb_btnOk mb_btnOkpub" type="button" value="确定">'
  281. $(".mb_btnOk").remove(); $("#promotGt").prepend(btnOk);
  282. $(".modelContain").show(); $("body").addClass("modelOpen");
  283. $(".mb-listR").remove();
  284. $(".mb-listL").remove();
  285. $("#promotTh").prepend(seleClum);
  286. fillColum(7);//填充select栏目
  287. $(".mb_btnOkpub").on("click", function() {
  288. $(".blackcover2").fadeOut();
  289. $(".modelContain").hide();
  290. $("body").removeClass("modelOpen");
  291. $.MsgBox.Confirm("提示", "确认发布该文章?", newsAdd);
  292. })
  293. }else{
  294. $.MsgBox.Confirm("提示", "确认发布该文章?", newsAdd);
  295. }
  296. }
  297. })
  298. //定时文章发布
  299. $("#setTimeIssue").on("click", function() {
  300. if($(this).hasClass("disableLi")){
  301. return;
  302. }
  303. noTitleImg();
  304. if(imgflase && titleflase) {
  305. $(".blackcover2").fadeIn();
  306. var btnOk='<input class="mb_btn mb_btnOk mb_btnOkset" type="button" value="确定">'
  307. $(".mb_btnOk").remove(); $("#promotGt").prepend(btnOk);
  308. $(".modelContain").show(); $("body").addClass("modelOpen");
  309. $(".mb-listR").remove(); $("#promotTh").append(seleTime);//时间选择器
  310. $(".mb-listR .form_datetime").datetimepicker({
  311. format: 'yyyy-mm-dd hh:ii',
  312. forceParse: true,
  313. autoclose: true,
  314. });
  315. $(".mb-listR .form_datetime").val(getNowFormatDate());
  316. if(colMgr=="true"){
  317. $(".mb-listL").remove();
  318. $("#promotTh").prepend(seleClum);
  319. fillColum(7);//填充select栏目
  320. }
  321. $(".mb_btnOkset").on("click", function() {
  322. var publishTime = $(".form_datetime").val();
  323. console.log(st6(publishTime));
  324. setTimeIssue(st6(publishTime));
  325. })
  326. }
  327. })
  328. //文章存草稿
  329. $("#draft").on("click", function() {
  330. if($(this).hasClass("disableLi")){
  331. return;
  332. }
  333. noTitleImg();
  334. if(imgflase && titleflase) {
  335. draftAdd(1);
  336. }
  337. })
  338. //文章预览
  339. $("#preview").on("click", function() {
  340. if($(this).hasClass("disableLi")){
  341. return;
  342. }
  343. noTitleImg();
  344. if(imgflase && titleflase) {
  345. draftAdd(2);
  346. }
  347. })
  348. function getAttrId() {
  349. var arr=[];
  350. this.each(function(){
  351. arr.push( $(this).attr("data-id"));
  352. });
  353. return arr;
  354. }
  355. /*获取数据*/
  356. function getdata(publishTime) {
  357. var industrys = $("#keyWordlist li");
  358. var industryAll = "";
  359. if(industrys.size() > 0) {
  360. for(var i = 0; i < industrys.size(); i++) {
  361. industryAll += industrys[i].innerText.trim();
  362. industryAll += ',';
  363. };
  364. industryAll = industryAll.substring(0, industryAll.length - 1);
  365. }
  366. expertli(); //相关专家
  367. resourcesli(); //相关咨询
  368. $data.orgId = orgId;
  369. if($("#companys li").length) {
  370. $data.orgs = getAttrId.call($("#companys li"));
  371. }
  372. $data.articleTitle = $("#newstitle").val();
  373. $data.subject = industryAll;
  374. $data.articleImg = $("#uploader").attr("data-id");
  375. $data.articleContent = ue.getContent();
  376. $data.professors = experarray;
  377. $data.resources = resourcesarray;
  378. if(colMgr=="true"){
  379. $data.colNum = $("#seletColum").val();
  380. if(publishTime!="") {
  381. $data.publishTime = publishTime;
  382. }
  383. }else{
  384. if(publishTime!="") {
  385. $data.publishTime = publishTime;
  386. }
  387. $data.colNum=2;
  388. }
  389. if($("#hidearticleId").val().length != 0) {
  390. $data.articleId = $("#hidearticleId").val();
  391. }
  392. console.log($data);
  393. }
  394. /*文章发布*/
  395. function newsAdd() {
  396. getdata();
  397. $(".operateBlock").find("li").addClass("disableLi");
  398. $.ajax({
  399. "url": "/ajax/article/save",
  400. "type": "post",
  401. "dataType": "json",
  402. "data": $data,
  403. "traditional": true, //传数组必须加这个
  404. "complete":function(){
  405. $(".operateBlock").find("li").removeClass("disableLi");
  406. },
  407. "success": function(data) {
  408. console.log(data);
  409. if(data.success) {
  410. $("#hidearticleId").val(data.data);
  411. $.MsgBox.Alert("提示", "文章发表成功!", function articalList() {
  412. location.href = "cmp-articalList.html";
  413. });
  414. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  415. } else {
  416. if(data.code==90) {
  417. $.MsgBox.Alert('提示', '由于操作时间过久,上传图片已失效,请重新上传。');
  418. }else{
  419. $.MsgBox.Alert("提示", "文章发表失败!");
  420. }
  421. }
  422. },
  423. "error": function() {
  424. $.MsgBox.Alert('提示', '链接服务器超时')
  425. }
  426. });
  427. }
  428. /*文章定时发布*/
  429. function setTimeIssue(publishTime) {
  430. var opublishTime=publishTime+"01";
  431. getdata(opublishTime);
  432. $(".operateBlock").find("li").addClass("disableLi");
  433. $.ajax({
  434. "url": "/ajax/article/timing",
  435. "type": "post",
  436. "dataType": "json",
  437. "data": $data,
  438. "traditional": true, //传数组必须加这个
  439. "complete":function(){
  440. $(".operateBlock").find("li").removeClass("disableLi");
  441. },
  442. "success": function(data) {
  443. console.log(data);
  444. if(data.success) {
  445. $("#hidearticleId").val(data.data);
  446. location.href = "cmp-articalList.html";
  447. } else {
  448. if(data.code==90) {
  449. $.MsgBox.Alert('提示', '由于操作时间过久,上传图片已失效,请重新上传。');
  450. }else{
  451. $.MsgBox.Alert("提示", "文章发表失败!");
  452. }
  453. }
  454. },
  455. "error": function() {
  456. $.MsgBox.Alert('提示', '链接服务器超时')
  457. }
  458. });
  459. }
  460. /*文章添加草稿和文章预览*/
  461. function draftAdd(num) {
  462. getdata();
  463. $(".operateBlock").find("li").addClass("disableLi");
  464. $.ajax({
  465. "url": "/ajax/article/draft",
  466. "type": "post",
  467. "dataType": "json",
  468. "data": $data,
  469. "traditional": true, //传数组必须加这个
  470. "complete":function(){
  471. $(".operateBlock").find("li").removeClass("disableLi");
  472. },
  473. "success": function(data) {
  474. console.log(data);
  475. if(num == 1) {
  476. if(data.success) {
  477. $("#hidearticleId").val(data.data);
  478. articleId = data.data;
  479. $.MsgBox.Alert("提示", "文章已保存草稿。");
  480. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  481. $("#delete").removeClass("disableLi").addClass("odele");
  482. }else{
  483. if(data.code==90) {
  484. $.MsgBox.Alert('提示', '由于操作时间过久,上传图片已失效,请重新上传。');
  485. }else{
  486. $.MsgBox.Alert("提示", "文章发表失败!");
  487. }
  488. }
  489. }
  490. if(num == 2) {
  491. if(data.success) {
  492. $("#hidearticleId").val(data.data);
  493. articleId = data.data;
  494. $("#delete").removeClass("disableLi").addClass("odele");
  495. fa = true;
  496. }else{
  497. if(data.code==90) {
  498. $.MsgBox.Alert('提示', '由于操作时间过久,上传图片已失效,请重新上传。');
  499. }else{
  500. $.MsgBox.Alert("提示", "文章发表失败!");
  501. }
  502. }
  503. if(fa) {
  504. window.open("../articalPreview.html?articleId=" + articleId)
  505. }
  506. }
  507. },
  508. "error": function() {
  509. $.MsgBox.Alert('提示', '链接服务器超时')
  510. }
  511. });
  512. }
  513. function st6(osr) {
  514. var tim = osr.substring(0, 4) + osr.substring(5, 7) + osr.substring(8, 10) + osr.substring(11, 13) + osr.substring(14, 16);
  515. return tim;
  516. }
  517. /*删除文章*/
  518. $(".operateBlock").on("click",".odele",function(){
  519. $.MsgBox.Confirm("提示","确认删除该文章?",newsDelet);
  520. })
  521. /*文章删除*/
  522. function newsDelet() {
  523. $.ajax({
  524. "url" : "/ajax/article/deleteArticle",
  525. "type" : "POST",
  526. "dataType" : "json",
  527. "data": {
  528. "articleId": articleId
  529. },
  530. "success" : function($data) {
  531. if ($data.success) {
  532. location.href = "cmp-articalList.html";
  533. }
  534. },
  535. "error":function(){
  536. $.MsgBox.Alert('提示','链接服务器超时')
  537. }
  538. })
  539. }
  540. relatCompanies("#company");
  541. /*添加相关企业*/
  542. function relatCompanies(sel) {
  543. $(sel).bind({
  544. paste: function(e) {
  545. var pastedText;
  546. if (window.clipboardData  &&  window.clipboardData.getData)  {  // IE
  547.             
  548. pastedText  = $(this).val() +  window.clipboardData.getData('Text');          
  549. else  {            
  550. pastedText  = $(this).val() +  e.originalEvent.clipboardData.getData('Text'); //e.clipboardData.getData('text/plain');
  551.           
  552. }
  553. $(this).val(pastedText);
  554. e.preventDefault();
  555. },
  556. cut: function(e) {
  557. var $this = $(this);
  558. },
  559. blur: function() {
  560. var $this = $(this);
  561. $(this).siblings(".aboutTit").find("span").text("");
  562. setTimeout(function() {
  563. $this.siblings(".form-drop").hide();
  564. }, 500)
  565. },
  566. focus: function() {
  567. $(this).siblings(".form-drop").show();
  568. $(this).siblings(".aboutTit").find("span").text("最多选择5家企业");
  569. },
  570. keyup: function(e) {
  571. var ti=$(this).val();
  572. orgr=ti;
  573. var $this=$(this);
  574. if($(this).val().trim()) {
  575. var lNum = $.trim($(this).val()).length;
  576. if(0 < lNum) {
  577. setTimeout(function(){
  578. if( ti===orgr && ti!== orgrEnd) {
  579. var tt=ti;
  580. orgrEnd=tt;
  581. $("#companylist").parent().show();
  582. $.ajax({
  583. "url": "/ajax/org/qr",
  584. "type": "GET",
  585. "data":{
  586. kw: $this.val(),
  587. limit:3
  588. },
  589. "success": function(data) {
  590. console.log(data);
  591. if(data.success) {
  592. if(orgrEnd==tt) {
  593. if(data.data.length == 0) {
  594. $this.siblings(".form-drop").addClass("displayNone");
  595. $this.siblings(".form-drop").find("ul").html("");
  596. } else {
  597. $this.siblings(".form-drop").removeClass("displayNone");
  598. var oSr = "";
  599. for(var i = 0; i < data.data.length; i++) {
  600. var busName=(data.data[i].forShort)?data.data[i].forShort:data.data[i].name;
  601. oSr += '<li style="min-height:40px;position:static;"data-id="'+data.data[i].id+'">' + busName + '</li>';
  602. }
  603. $this.siblings(".form-drop").find("ul").html(oSr);
  604. }
  605. }
  606. } else {
  607. $this.siblings(".form-drop").addClass("displayNone");
  608. $this.siblings(".form-drop").find("ul").html("");
  609. }
  610. },
  611. dataType: "json",
  612. 'error': function() {
  613. $.MsgBox.Alert('提示', '服务器连接超时!');
  614. }
  615. });
  616. }
  617. },500)
  618. }
  619. } else {
  620. $(this).siblings(".form-drop").addClass("displayNone");
  621. $(this).siblings(".form-drop").find("ul").html("");
  622. }
  623. }
  624. })
  625. $("#company").siblings(".form-drop").on("click", "li", function() {
  626. var oValue = $(this).text();
  627. var oJudge = $(this).parents(".form-drop").siblings(".form-result").find("ul li");
  628. for(var i = 0; i < oJudge.length; i++) {
  629. if(oValue == oJudge[i].innerText) {
  630. $.MsgBox.Alert('提示', '该企业已选择.');
  631. return;
  632. }
  633. }
  634. $(this).parents(".form-drop").siblings(".form-result").find("ul").append('<li class="ellipsisSty" style="min-height:40px;padding-right:42px;" data-id="'+$(this).attr("data-id")+'">' + oValue + '<div class="deleteThis"></div></li>');
  635. $(this).parents(".form-drop").siblings("input").val("");
  636. if(oJudge.length == 4) {
  637. $(this).parents(".form-drop").siblings("input").val("");
  638. $("#company").hide();
  639. }
  640. $(this).parent("ul").html("")
  641. })
  642. }
  643. });