DOF2.js 26 KB

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