| | |
| | | <div class="layui-tab-item layui-show"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 120px">代ç ï¼</label> |
| | | <label class="layui-form-label" style="width: 120px">代ç <label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HNumber" lay-verify="HNumber" id="HNumber" autocomplete="off"> |
| | | <input name="HItemID" id="HItemID" autocomplete="off" type="hidden"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 120px">åç§°ï¼</label> |
| | | <label class="layui-form-label" style="width: 120px">åç§°<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HName" id="HName" autocomplete="off"> |
| | | </div> |
| | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | //ä¿å |
| | | form.on('submit(Saver)', function (data) {//ä¿å |
| | | if (AllowLoadData()) { |
| | | var isEndCheck = document.getElementById("HStopflag").checked; |
| | | isEndCheck == true ? data.field.HStopflag = 'true' : data.field.HStopflag = 'false';//å°æ°ç»åå¹¶æå符串 |
| | | |
| | | var isEndCheck = document.getElementById("HStopflag").checked; |
| | | isEndCheck == true ? data.field.HStopflag = 'true' : data.field.HStopflag = 'false';//å°æ°ç»åå¹¶æå符串 |
| | | var sMainStr = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"]; |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SaveGy_ErrMsgBackType", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | async: true, |
| | | data: { "msg": sMainStr }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说æéªè¯æåäºï¼ |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); |
| | | } |
| | | else { |
| | | f_alert(data.Message); |
| | | console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable)); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | |
| | | var sMainStr = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"]; |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SaveGy_ErrMsgBackType", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | async: true, |
| | | data: { "msg": sMainStr }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说æéªè¯æåäºï¼ |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); |
| | | f_alert("é误:" + err); |
| | | console.log("Reason" + sMainStr); |
| | | } |
| | | else { |
| | | f_alert(data.Message); |
| | | console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable)); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | |
| | | f_alert("é误:" + err); |
| | | console.log("Reason" + sMainStr); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | //éåº |
| | | form.on('submit(Exit)', function (data) {// |
| | |
| | | $("#HNumber").val(data.å¼å¸¸åé¦ç±»å代ç );//代ç |
| | | $("#HName").val(data.å¼å¸¸åé¦ç±»ååç§°);//åç§° |
| | | $("#HHelpCode").val(data.å©è®°ç );//å©è®°ç |
| | | $("#HUSEORGID").val(data.å建ç»ç»);//使ç¨ç»ç» |
| | | $("#HUSEORGID").val(data.HUSEORGID);//使ç¨ç»ç» |
| | | $("#HUseFlag ").val(data.使ç¨ç¶æ);//使ç¨ç¶æ |
| | | $("#HRemark").val(data.夿³¨);//夿³¨ |
| | | $("input[name='HStopflag']").attr("checked", data.ç¦ç¨æ å¿ == "æ¯" ? true : false);//true:éä¸ false:ä¸éä¸ |
| | | layui.form.render();//宿¶æ¸²æéä¸åä¸éä¸çæ ·å¼,æå¥½æ·»å è¿å¥è¯ |
| | | |
| | | form.render("select"); |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | //æ°æ®éªè¯ |
| | | function AllowLoadData() { |
| | | var HNumber = $("#HNumber").val() //代ç |
| | | var HName = $("#HName").val() //åç§° |
| | | |
| | | if (HNumber == null || HNumber == undefined || HNumber == "") { |
| | | layer.msg("请è¾å
¥ä»£ç ï¼", { icon: 5 }); |
| | | return false; |
| | | } |
| | | if (HName == null || HName == undefined || HName == "") { |
| | | layer.msg("请è¾å
¥åç§°ï¼", { icon: 5 }); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |