DFMAll.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. var acceptClick;
  2. var selectBomInfo;
  3. var calQty;
  4. var BillBomInfo = [];
  5. var BillBomSetInfos = [];
  6. var BomsetCode = '';
  7. var keyValue = request('keyValue');
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var classnames = ['yellowCircle', 'purpleCircle', 'lightgreenCircle'];
  11. var reg = /^(\-|\+)?\d+(\.\d+)?$/;
  12. var regex = /^[1-9]\d*$/;
  13. const IsEmptys = ["有"];//["", "有", "无"]; //是否放置物料
  14. const SpoolTypes = ["WS34", "WS50"]; //工字轮型号
  15. const SpoolTypes2 = ["WS18", "WS34", "WS50"]; //工字轮型号
  16. const SideNums = ["", "正面朝上", "反面朝上"]; //工字轮朝向
  17. const IsCores = ["", "是", "否"]; //是否芯股
  18. const SilkTypes = ["", "单丝", "双丝", "三丝"]; //单双丝
  19. const mattypes = ["第一种", "第二种", "第三种"];
  20. const StampChildTypes = ["DFMAll-01"];
  21. var selectedRow = learun.frameTab.currentIframe().selectedRow;
  22. var page = {
  23. init: function () {
  24. page.bind();
  25. page.initData();
  26. },
  27. bind: function () {
  28. // 设置小圆圈的点击事件
  29. //$('.circle').click(function () {
  30. // $(this).toggleClass('selectedactive');
  31. //});
  32. for (var i = 0; i < StampChildTypes.length; i++) {
  33. let id = i + 1;
  34. $("#StampChildType").append($("<option value='" + id + "'>" + StampChildTypes[i] + "</option>"));
  35. }
  36. $("#StampChildType").on('change', function () {
  37. for (var i = 0; i < StampChildTypes.length; i++) {
  38. let id = i + 1;
  39. if ($(this).val() == id) {
  40. $("#StampChildType" + id).show();
  41. }
  42. else {
  43. $("#StampChildType" + id).hide();
  44. }
  45. }
  46. for (var i = 0; i < 3; i++) {
  47. $("#SpoolType" + i).empty();
  48. for (var j = 0; j <= SpoolTypes2.length; j++) {
  49. if (j == 0) {
  50. $("#SpoolType" + i).append($("<option value=''>请选择</option>"));
  51. }
  52. else {
  53. $("#SpoolType" + i).append($("<option value='" + SpoolTypes2[j - 1] + "'>" + SpoolTypes2[j - 1] + "</option>"));
  54. }
  55. }
  56. }
  57. });
  58. $("#StampChildType").val(1).change();
  59. for (var i = 0; i < 3; i++) {
  60. for (var j = 0; j < IsEmptys.length; j++) {
  61. if (IsEmptys[j] == '') {
  62. $("#IsEmpty" + i).append($("<option value=''>请选择</option>"));
  63. }
  64. else {
  65. var value = j;
  66. $("#IsEmpty" + i).append($("<option value='" + value + "'>" + IsEmptys[j] + "</option>"));
  67. }
  68. }
  69. //for (var j = 0; j <= SpoolTypes.length; j++) {
  70. // $("#SpoolType" + i).empty();
  71. // if (j == 0) {
  72. // $("#SpoolType" + i).append($("<option value=''>请选择</option>"));
  73. // }
  74. // else {
  75. // $("#SpoolType" + i).append($("<option value='" + SpoolTypes[j - 1] + "'>" + SpoolTypes[j - 1] + "</option>"));
  76. // }
  77. //}
  78. for (var j = 0; j < SideNums.length; j++) {
  79. if (SideNums[j] == '') {
  80. $("#SideNum" + i).append($("<option value=''>请选择</option>"));
  81. }
  82. else {
  83. $("#SideNum" + i).append($("<option value='" + j + "'>" + SideNums[j] + "</option>"));
  84. }
  85. }
  86. for (var j = 0; j < IsCores.length; j++) {
  87. if (IsCores[j] == '') {
  88. $("#IsCore" + i).append($("<option value=''>请选择</option>"));
  89. }
  90. else {
  91. $("#IsCore" + i).append($("<option value='" + j + "'>" + IsCores[j] + "</option>"));
  92. }
  93. }
  94. for (var j = 0; j < SilkTypes.length; j++) {
  95. if (SilkTypes[j] == '') {
  96. $("#SilkType" + i).append($("<option value=''>请选择</option>"));
  97. }
  98. else {
  99. $("#SilkType" + i).append($("<option value='" + j + "'>" + SilkTypes[j] + "</option>"));
  100. }
  101. }
  102. }
  103. //$('#ProMaterCode').lrselect({
  104. // url: top.$.rootUrl + "/FJManager/BaseMatinfo/GetList",
  105. // allowSearch: true,
  106. // width: 280,
  107. //});
  108. //$("#HWCountQty").on('change', function () {
  109. // calQty();
  110. //});
  111. $('#SelectBomCode').on('click', function () {
  112. let selurl = top.$.rootUrl + '/FJManager/BillBomInfo/SelectForm?SpoolType=' + SpoolTypes;
  113. if ($("#StampChildType").val() == "4") {
  114. selurl = top.$.rootUrl + '/FJManager/BillBomInfo/SelectForm?SpoolType=' + SpoolTypes2;
  115. }
  116. learun.layerForm({
  117. id: 'SelectBomCodeform',
  118. title: '查询',
  119. url: selurl,
  120. width: 1150,
  121. height: 690,
  122. callBack: function (id) {
  123. return top[id].acceptClick(selectBomInfo);
  124. },
  125. });
  126. });
  127. // 设置小圆圈的点击事件
  128. $('.clickcircle').click(function () {
  129. for (var i = 0; i < classnames.length; i++) {
  130. if ($(this).attr('class').indexOf(classnames[i]) >= 0) {
  131. $(this).removeClass(classnames[i]);
  132. page.DelBoardCircleClass($(this));
  133. $(this).addClass('selectedactive');
  134. page.DelBillBomsetinfo($(this).text());
  135. }
  136. }
  137. $(this).removeProp("data-geo");
  138. $(this).toggleClass('selectedactive');
  139. });
  140. $("#SaveOne").on('click', function () {
  141. if ($('#MatCode0').val() == '') {
  142. learun.alert.info("请输入第一种湿拉物料!");
  143. return;
  144. }
  145. if ($("#IsEmpty0").val() == '') {
  146. learun.alert.info("请选择是否有货物!");
  147. return;
  148. }
  149. if (page.CheckData(0)) {
  150. $("#allcontainer > div").children().each(function () {
  151. var classname = $(this).attr('class');
  152. if (classname.indexOf('selectedactive') >= 0) {
  153. $(this).removeClass('selectedactive');
  154. $(this).addClass(classnames[0]);
  155. page.AddBoardCircleClass($(this), 0);
  156. page.AddBillBomsetinfo(0, $(this).text());
  157. $(this).prop("data-geo", "工字轮型号: " + $("#SpoolType0").val() + ",工字轮朝向:" + SideNums[$("#SideNum0").val()] + ",是否芯股:" + IsCores[$("#IsCore0").val()] + ",单双丝:" + SilkTypes[$("#SilkType0").val()]);
  158. }
  159. });
  160. }
  161. });
  162. $("#SaveTwo").on('click', function () {
  163. if ($('#MatCode1').val() == '') {
  164. learun.alert.info("请输入第二种湿拉物料!");
  165. return;
  166. }
  167. if ($("#IsEmpty1").val() == '') {
  168. learun.alert.info("请选择是否有货物!");
  169. return;
  170. }
  171. if (page.CheckData(1)) {
  172. $("#allcontainer > div").children().each(function () {
  173. var classname = $(this).attr('class');
  174. if (classname.indexOf('selectedactive') >= 0) {
  175. $(this).removeClass('selectedactive');
  176. $(this).addClass(classnames[1]);
  177. page.AddBoardCircleClass($(this), 1);
  178. page.AddBillBomsetinfo(1, $(this).text());
  179. $(this).prop("data-geo", "工字轮型号: " + $("#SpoolType1").val() + ",工字轮朝向:" + SideNums[$("#SideNum1").val()] + ",是否芯股:" + IsCores[$("#IsCore1").val()] + ",单双丝:" + SilkTypes[$("#SilkType1").val()]);
  180. }
  181. });
  182. }
  183. });
  184. $("#SaveThree").on('click', function () {
  185. if ($('#MatCode2').val() == '') {
  186. learun.alert.info("请输入第三种湿拉物料!");
  187. return;
  188. }
  189. if ($("#IsEmpty2").val() == '') {
  190. learun.alert.info("请选择是否有货物!");
  191. return;
  192. }
  193. if (page.CheckData(2)) {
  194. $("#allcontainer > div").children().each(function () {
  195. var classname = $(this).attr('class');
  196. if (classname.indexOf('selectedactive') >= 0) {
  197. $(this).removeClass('selectedactive');
  198. $(this).addClass(classnames[2]);
  199. page.AddBoardCircleClass($(this), 2);
  200. page.AddBillBomsetinfo(2, $(this).text());
  201. $(this).prop("data-geo", "工字轮型号: " + $("#SpoolType1").val() + ",工字轮朝向:" + SideNums[$("#SideNum1").val()] + ",是否芯股:" + IsCores[$("#IsCore1").val()] + ",单双丝:" + SilkTypes[$("#SilkType1").val()]);
  202. }
  203. });
  204. }
  205. });
  206. //$(".left [dfm]").on('click', function () {
  207. // $("#dialog").show();
  208. // let circleid = $(this).attr('dfm');
  209. // layer.open({
  210. // type: 1,
  211. // area: ['600px', '360px'],
  212. // shadeClose: true,
  213. // //modal: true,
  214. // content: $("#dialog"),
  215. // btns: 2,
  216. // btn: ['确定', '取消'],
  217. // modal: true,
  218. // success: function () {
  219. // },
  220. // end: function () {
  221. // $("#dialog").hide();
  222. // },
  223. // //close: function (index) {
  224. // // $("#dialog").hide();
  225. // //},
  226. // yes: function (index) {
  227. // //layer.msg('您选择了重要。', 2, 1);
  228. // //$(this).dialog("close");
  229. // /* $(this).closeAll("dialog");*/
  230. // if (circleid==1)
  231. // $("#" + circleid).addClass("havegoods");
  232. // if (circleid == 5)
  233. // $("#" + circleid).addClass("Sideout");
  234. // $("#5").removeClass("Sideout");
  235. // layer.closeAll();
  236. // },
  237. // //no: function (index) {
  238. // //}
  239. // });
  240. //});
  241. },
  242. AddBillBomsetinfo: function (i, xyno) {
  243. var setinfo = {};
  244. setinfo["XYNo"] = xyno;
  245. setinfo["CategoryId"] = i;
  246. setinfo["MatCode"] = $("#MatCode" + i).val();
  247. setinfo["SilkDiam"] = $("#SilkDiam" + i).val();
  248. setinfo["QtyMaxCount"] = $("#QtyMaxCount" + i).val();
  249. setinfo["IsEmpty"] = $("#IsEmpty" + i).val();
  250. setinfo["SpoolType"] = $("#SpoolType" + i).val();
  251. setinfo["SideNum"] = $("#SideNum" + i).val();
  252. setinfo["IsCore"] = $("#IsCore" + i).val();
  253. setinfo["SilkType"] = $("#SilkType" + i).val();
  254. if ($("#StampChildType").val() == '1') {
  255. BillBomSetInfos.push(setinfo);
  256. }
  257. },
  258. DelBillBomsetinfo: function (xyno) {
  259. if ($("#StampChildType").val() == '1') {
  260. for (let j = 0; j < BillBomSetInfos.length; j++) {
  261. if (xyno == BillBomSetInfos[j].XYNo) {
  262. BillBomSetInfos.splice(j, 1);
  263. }
  264. }
  265. }
  266. },
  267. AddBoardCircleClass(jqobject, i) {
  268. var classname = $(jqobject).attr('class');
  269. if (classname.indexOf('34') >= 0 && $("#SideNum" + i).val() == "2") {
  270. $(jqobject).removeClass('circle34');
  271. $(jqobject).addClass('bordercircle34');
  272. }
  273. else if (classname.indexOf('18') >= 0 && $("#SideNum" + i).val() == "2") {
  274. $(jqobject).removeClass('circle18');
  275. $(jqobject).addClass('bordercircle18');
  276. }
  277. else if ($("#SideNum" + i).val() == "2") {
  278. $(jqobject).removeClass('circle');
  279. $(jqobject).addClass('bordercircle');
  280. }
  281. },
  282. DelBoardCircleClass(jqobject) {
  283. var classname = $(jqobject).attr('class');
  284. if (classname.indexOf('34') >= 0) {
  285. $(jqobject).removeClass('bordercircle34');
  286. $(jqobject).addClass('circle34');
  287. }
  288. else if (classname.indexOf('18') >= 0) {
  289. $(jqobject).removeClass('bordercircle18');
  290. $(jqobject).addClass('circle18');
  291. }
  292. else {
  293. $(jqobject).removeClass('bordercircle');
  294. $(jqobject).addClass('circle');
  295. }
  296. },
  297. CheckData: function (i) {
  298. if ($('#MatCode' + i).val() != '') {
  299. //let qty2 = $('#SilkDiam' + i).val();
  300. //if (!reg.test(qty2) || parseFloat(qty2) == 0) {
  301. // learun.alert.error('请输入' + mattypes[i] +'湿拉物料的钢丝直径上限');
  302. // return false;
  303. //}
  304. //let count = $('#QtyMaxCount' + i).val();
  305. //if (!reg.test(count) || parseInt(count) == 0) {
  306. // learun.alert.error('请输入' + mattypes[i] +'湿拉物料的数量');
  307. // return false;
  308. //}
  309. let empty = $('#IsEmpty' + i).val();
  310. if (empty == '') {
  311. learun.alert.error('请选择' + mattypes[i] + '湿拉物料是否放置物料');
  312. return false;
  313. }
  314. let SpoolType = $('#SpoolType' + i).val();
  315. if (SpoolType == '') {
  316. learun.alert.error('请选择' + mattypes[i] + '湿拉物料工字轮型号');
  317. return false;
  318. }
  319. let SideNum = $('#SideNum' + i).val();
  320. if (SideNum == '') {
  321. learun.alert.error('请选择' + mattypes[i] + '湿拉物料工字轮朝向');
  322. return false;
  323. }
  324. let IsCore = $('#IsCore' + i).val();
  325. if (IsCore == '') {
  326. learun.alert.error('请选择' + mattypes[i] + '湿拉物料是否芯股');
  327. return false;
  328. }
  329. let SilkType = $('#SilkType' + i).val();
  330. if (SilkType == '') {
  331. learun.alert.error('请选择' + mattypes[i] + '湿拉物料单双丝');
  332. return false;
  333. }
  334. }
  335. return true;
  336. },
  337. change: function (classname) {
  338. $("#allcontainer > div").children().each(function () {
  339. var classname = $(this).attr('class');
  340. if (classname.indexOf('selectedactive') >= 0) {
  341. $(this).removeClass('selectedactive');
  342. $(this).addClass(classname);
  343. }
  344. });
  345. },
  346. initData: function () {
  347. if (!!keyValue) {
  348. learun.httpAsync('GET', top.$.rootUrl + '/FJManager/BillBomSet/GetBillBomsetinfo', { id: keyValue }, function (res) {
  349. if (res.code > 0) {
  350. let BomsetInfo = res.data;
  351. if (BomsetInfo.StampChildType == 1) {
  352. BillBomSetInfos = BomsetInfo.Bomsetinfos;
  353. }
  354. //$('#ProMaterCode').lrselectRefresh({
  355. // url: top.$.rootUrl + "/FJManager/BaseMatinfo/GetListByBomCode",
  356. // param: { queryJson: JSON.stringify({ Code: BomsetInfo.BomCode }) },
  357. // allowSearch: true,
  358. // width: 280,
  359. //});
  360. $("#StampChildType").val(BomsetInfo.StampChildType).change();
  361. $("#StampChildType" + BomsetInfo.StampChildType).show();
  362. for (var i = 0; i < BomsetInfo.Bomsetinfos.length; i++) {
  363. var item = BomsetInfo.Bomsetinfos[i];
  364. $("#MatCode" + item.CategoryId).val(item.MatCode);
  365. $("#SilkDiam" + item.CategoryId).val(item.SilkDiam);
  366. $("#QtyMaxCount" + item.CategoryId).val(item.QtyMaxCount);
  367. $("#IsEmpty" + item.CategoryId).val(item.IsEmpty);
  368. $("#SpoolType" + item.CategoryId).val(item.SpoolType);
  369. $("#SideNum" + item.CategoryId).val(item.SideNum);
  370. $("#IsCore" + item.CategoryId).val(item.IsCore);
  371. $("#SilkType" + item.CategoryId).val(item.SilkType);
  372. $("#StampChildType" + BomsetInfo.StampChildType).children().each(function () {
  373. var id = $(this).text();
  374. if (item.XYNo == id) {
  375. page.AddBoardCircleClass($(this), item.CategoryId);
  376. $(this).removeClass('selectedactive');
  377. $(this).addClass(classnames[item.CategoryId]);
  378. $(this).prop("data-geo", "工字轮型号: " + item.SpoolType + ",工字轮朝向:" + SideNums[item.SideNum] + ",是否芯股:" + IsCores[item.IsCore] + ",单双丝:" + SilkTypes[item.SilkType]);
  379. }
  380. });
  381. //$("#allcontainer > div").children().each(function () {
  382. // var id = $(this).text();
  383. // if (item.XYNo == id) {
  384. // $(this).removeClass('selectedactive');
  385. // $(this).addClass(classnames[item.CategoryId]);
  386. // }
  387. //});
  388. }
  389. BomsetCode = BomsetInfo.BomCode;
  390. $("#BomName").val(BomsetInfo.BomName);
  391. setTimeout($('#form').lrSetFormData(res.data), 300);
  392. //learun.httpAsync('GET', top.$.rootUrl + '/FJManager/BillBomInfo/GetList', { queryJson: JSON.stringify({ Code: BomsetInfo.BomCode, SpoolType: SpoolTypes }) }, function (res) {
  393. // if (res.code > 0) {
  394. // $("#BomName").val(res.data[0].Name);
  395. // }
  396. //});
  397. }
  398. });
  399. }
  400. }
  401. };
  402. calQty = function () {
  403. //var totalQty = 0;
  404. //for (var i = 0; i < BillBomInfo.length; i++) {
  405. // totalQty += parseInt(BillBomInfo[i].HWCountQty);
  406. //}
  407. //var HWCountQty = $("#HWCountQty").val();
  408. for (var i = 0; i < BillBomInfo.length; i++) {
  409. $("#MatCode" + i).val(BillBomInfo[i].MatCode);
  410. $("#SpoolType" + i).val(BillBomInfo[i].SpoolType);
  411. //if (HWCountQty != "" && reg.test(HWCountQty)) {
  412. // var qty = Math.round(parseInt(HWCountQty) / totalQty);
  413. // $("#QtyMaxCount" + i).val(qty * parseInt(BillBomInfo[i].HWCountQty));
  414. //}
  415. }
  416. }
  417. selectBomInfo = function (rowData) {
  418. if (!!rowData) {
  419. $("#BomName").val('');
  420. let jsondata = JSON.stringify({
  421. ProCode: rowData.ProCode, SpoolType: SpoolTypes, Code: rowData.Code
  422. });
  423. if ($("#StampChildType").val() == "4") {
  424. jsondata = JSON.stringify({
  425. ProCode: rowData.ProCode, SpoolType: SpoolTypes2, Code: rowData.Code
  426. });
  427. }
  428. //$("#BomName").val(code);
  429. learun.httpAsync('GET', top.$.rootUrl + '/FJManager/BillBomInfo/GetList', { queryJson: jsondata }, function (res) {
  430. if (res.code > 0) {
  431. $(".lr-select-placeholder").empty();
  432. //$("#learun_select_option_contentProMaterCode").children().empty();
  433. //$('#ProMaterCode').lrselectRefresh({
  434. // url: top.$.rootUrl + "/FJManager/BaseMatinfo/GetListByBomCode",
  435. // param: { queryJson: JSON.stringify({ Code: code }) },
  436. // allowSearch: true,
  437. // width: 280,
  438. //});
  439. for (var i = 0; i < 3; i++) {
  440. $("#MatCode" + i).val('');
  441. }
  442. $("#BomName").val(res.data[0].Name);
  443. $("#ProMaterCode").val(res.data[0].ProMatCode);
  444. BomsetCode = res.data[0].ProCode;
  445. BillBomInfo = res.data;
  446. calQty();
  447. }
  448. });
  449. }
  450. };
  451. // 保存数据
  452. acceptClick = function (callBack) {
  453. if (!$('#form').lrValidform()) {
  454. return false;
  455. }
  456. if ($("#BomName").val() == '') {
  457. learun.alert.error('请输入投料信息');
  458. return false;
  459. }
  460. let checkdata = false;
  461. for (var i = 0; i < mattypes.length; i++) {
  462. checkdata = page.CheckData(i);
  463. }
  464. if (!checkdata) {
  465. return;
  466. }
  467. var postData = $('#form').lrGetFormData();
  468. postData.StampChildType = $("#StampChildType").val();
  469. //var setInfos = [];
  470. //$("#allcontainer > div").children().each(function () {
  471. //$("#StampChildType" + postData.StampChildType).children().each(function () {
  472. // for (var i = 0; i < classnames.length; i++) {
  473. // var setinfo = {};
  474. // if ($(this).attr('class').indexOf(classnames[i]) >= 0) {
  475. // setinfo["XYNo"] = $(this).text();
  476. // setinfo["CategoryId"] = i;
  477. // setinfo["MatCode"] = $("#MatCode" + i).val();
  478. // setinfo["SilkDiam"] = $("#SilkDiam" + i).val();
  479. // setinfo["QtyMaxCount"] = $("#QtyMaxCount" + i).val();
  480. // setinfo["IsEmpty"] = $("#IsEmpty" + i).val();
  481. // setinfo["SpoolType"] = $("#SpoolType" + i).val();
  482. // setinfo["SideNum"] = $("#SideNum" + i).val();
  483. // setinfo["IsCore"] = $("#IsCore" + i).val();
  484. // setinfo["SilkType"] = $("#SilkType" + i).val();
  485. // setInfos.push(setinfo);
  486. // }
  487. // }
  488. //});
  489. if (!$('#form').lrValidform()) {
  490. return false;
  491. }
  492. if ($("#StampChildType").val() == '1' && BillBomSetInfos.length == 0) {
  493. learun.alert.error('请选择跺型编号。');
  494. return false;
  495. }
  496. postData.BomName = $("#BomName").val();
  497. postData.ProCode = BomsetCode;
  498. postData.Category = 1;
  499. postData.StampType = 7;
  500. if ($("#StampChildType").val() == '1') {
  501. postData.Bomsetinfos = BillBomSetInfos;
  502. postData.TotalQty = $("#StampChildType1 .clickcircle").length;
  503. }
  504. // postData.TotalQty = $("#StampChildType" + postData.StampChildType + " .clickcircle").length;
  505. $.lrSaveForm(top.$.rootUrl + '/FJManager/BillBomSet/SaveForm?keyValue=' + keyValue, postData, function (res) {
  506. // 保存成功后才回调
  507. if (!!callBack) {
  508. callBack();
  509. }
  510. });
  511. };
  512. page.init();
  513. }
  514. $(document).tooltip({
  515. items: "img, [data-geo], [title]",
  516. content: function () {
  517. var element = $(this);
  518. if (element.is("[data-geo]")) {
  519. return element.prop("data-geo");
  520. }
  521. if (element.is("[title]")) {
  522. return element.prop("title");
  523. }
  524. if (element.is("img")) {
  525. return element.prop("alt");
  526. }
  527. }
  528. });