DOF4.js 28 KB

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