| | |
| | | <form id="form0" class="layui-form" lay-filter="component-form-group" action=""> |
| | | <div class="layui-card-header"> |
| | | <div class="layui-btn-group"> |
| | | |
| | | <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">ä¿å</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">æ°å¢</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver" id="add-btn">ä¿å</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="view">é¢è§</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="print">æå°</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">éåº</button> |
| | | |
| | | </div> |
| | |
| | | var NewRow = TabRow1; |
| | | switch (obj.event) { |
| | | //æ°å¢ä¸è¡ |
| | | case 'btn-AddLine': btnAddLine1(NewRow); |
| | | case 'btn-AddLine1': btnAddLine1(NewRow); |
| | | break; |
| | | //å¤å¶ä¸è¡ |
| | | case 'btn-CopyLine': btnCopyLine1(data); |
| | | case 'btn-CopyLine1': btnCopyLine1(data); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | } |
| | | }); |
| | | }); |
| | | //æ°å¢ |
| | | form.on('submit(set_AddNew)', function (data) { |
| | | $("#component-form-group")[0].reset(); |
| | | layui.form.render(); |
| | | set_AddFNew(); |
| | | }); |
| | | //ä¿å |
| | | form.on('submit(Saver)', function (data) { |
| | | //debugger; |
| | |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | var sSubStr1 = JSON.stringify(table.cache['mainTable1']); |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr1; |
| | | //if (AllowLoadData(sSubStr, sSubStr1)) { |
| | | if (!AllowLoadData(sSubStr))//æ°æ®éªè¯ |
| | | { |
| | | return false; |
| | | } |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | |
| | | console.log("Reason" + sMainStr); |
| | | } |
| | | }); |
| | | //} |
| | | |
| | | }); |
| | | //é¢è§Printing |
| | | form.on("submit(view)", function (data) { |
| | | window.open("../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/HBarPlanPrint.html?linterid=" + linterid + "&Type=HEquipMaintainPlanBill&OpenTmp=设å¤ä¿å
»è®¡åæ¡ç "); |
| | | |
| | | }); |
| | | //æå°Printing |
| | | form.on("submit(print)", function (data) { |
| | | window.open("../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/HBarPlanPrint.html?linterid=" + linterid + "&Type=HEquipMaintainPlanBill&OpenTmp=设å¤ä¿å
»è®¡åæ¡ç "); |
| | | |
| | | }); |
| | | //éåº |
| | | form.on('submit(Exit)', function () { |
| | |
| | | //å¢å ä¸è¡ |
| | | function btnAddLine(NewRow) { |
| | | table.cache["mainTable"].push(NewRow); |
| | | option1.data = table.cache["mainTable"]; |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | } |
| | | //å¢å ä¸è¡ |
| | |
| | | }) |
| | | } |
| | | //é空éªè¯ |
| | | function AllowLoadData(sSubStr, sSubStr1) { |
| | | if ($("#HInnerBillNo").val() == '') { |
| | | layer.msg("è¯·éæ©å
é¨åæ®å·", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | function AllowLoadData(sSubStr) { |
| | | var Result = true; |
| | | if ($("#HEquipID").val() == '' || $("#HEquipName").val() == '') { |
| | | layer.msg("è¯·éæ©è®¾å¤", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | if ($("#HCheckCycle").val() == '' || $("#HCheckCycle").val() == '0') { |
| | | layer.msg("请è¾å
¥ä¿å
»å¨æ", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr == "[]") { |
| | | layer.msg("ä¿å
»é¡¹æç»è®°å½ä¸è½ä¸ºç©º", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") { |
| | | sSubStr = JSON.parse(sSubStr); |
| | | for (var i = 0; i < sSubStr.length; i++) { |
| | | if (sSubStr[i].HMaintainItemID == "") { |
| | | layer.msg("ä¿å
»é¡¹æç»è®°å½ç¬¬" + (i + 1) + "è¡,ä¿å
»é¡¹ç®ä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | if (sSubStr[i].HMaintainItem == "") { |
| | | layer.msg("ä¿å
»é¡¹æç»è®°å½ç¬¬" + (i + 1) + "è¡,ä¿å
»é¨ä½ä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | if (sSubStr[i].HManagerNumber == "") { |
| | | layer.msg("ä¿å
»é¡¹æç»è®°å½ç¬¬" + (i + 1) + "è¡,è´è´£äººä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | return Result = false; |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (typeof (sSubStr1) == "undefined" || sSubStr1 == "" || sSubStr1 == "[]") { |
| | | layer.msg("é
件项æç»è®°å½ä¸è½ä¸ºç©º", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | if (typeof (sSubStr1) != "undefined" && typeof (sSubStr1) != "") { |
| | | sSubStr1 = JSON.parse(sSubStr1); |
| | | for (var i = 0; i < sSubStr1.length; i++) { |
| | | if (sSubStr1[i].HMaterNumber == "") { |
| | | layer.msg("é
件项æç»è®°å½ç¬¬" + (i + 1) + "è¡,é
件代ç 为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | if (sSubStr1[i].HUnitNumber == "") { |
| | | layer.msg("é
件项æç»è®°å½ç¬¬" + (i + 1) + "è¡,åä½ä»£ç ä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | if (sSubStr[i].HManagerNumber == "") { |
| | | layer.msg("ä¿å
»é¡¹æç»è®°å½ç¬¬" + (i + 1) + "è¡,è´è´£äººä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | //if (typeof (sSubStr1) == "undefined" || sSubStr1 == "" || sSubStr1 == "[]") { |
| | | // layer.msg("é
件项æç»è®°å½ä¸è½ä¸ºç©º", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | // return false; |
| | | //} |
| | | //if (typeof (sSubStr1) != "undefined" && typeof (sSubStr1) != "") { |
| | | // sSubStr1 = JSON.parse(sSubStr1); |
| | | // for (var i = 0; i < sSubStr1.length; i++) { |
| | | // if (sSubStr1[i].HMaterNumber == "") { |
| | | // layer.msg("é
件项æç»è®°å½ç¬¬" + (i + 1) + "è¡,é
件代ç 为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | // return false; |
| | | // } |
| | | // if (sSubStr1[i].HUnitNumber == "") { |
| | | // layer.msg("é
件项æç»è®°å½ç¬¬" + (i + 1) + "è¡,åä½ä»£ç ä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | // return false; |
| | | // } |
| | | // if (sSubStr[i].HManagerNumber == "") { |
| | | // layer.msg("ä¿å
»é¡¹æç»è®°å½ç¬¬" + (i + 1) + "è¡,è´è´£äººä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | // return false; |
| | | // } |
| | | // } |
| | | //} |
| | | else { |
| | | return true; |
| | | return Result = true; |
| | | } |
| | | return Result; |
| | | } |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |