| | |
| | | <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> |
| | | <style type="text/css"> |
| | | .layui-form-label { |
| | | width: 85px; |
| | | width: 95px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div id="layout1" class="layui-fluid"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <form id="form0" class="layui-form" lay-filter="component-form-group" action=""> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">维修人</label> |
| | | <label class="layui-form-label">维修人<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;"> |
| | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ç»´ä¿®å¼å§</label> |
| | | <label class="layui-form-label">ç»´ä¿®å¼å§<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HRepairBeginDate" id="HRepairBeginDate" autocomplete="off" timeFormat="yyyy-MM-dd"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">设å¤</label> |
| | | <label class="layui-form-label">设å¤<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HEquipName" id="HEquipName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HEquipID" id="HEquipID" class="layui-input" value="" style="float:left;width:150px;"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">è´è´£äºº</label> |
| | | <label class="layui-form-label">è´è´£äºº<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="" style="float:left;width:150px;"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ç»´ä¿®ç»æ</label> |
| | | <label class="layui-form-label">ç»´ä¿®ç»æ<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HRepairEndDate" id="HRepairEndDate" autocomplete="off" timeFormat="yyyy-MM-dd"> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">维修项ç®</label> |
| | | <label class="layui-form-label">维修项ç®<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HRepairName" id="HRepairName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HRepairID" id="HRepairID" class="layui-input" value="" style="float:left;width:150px;"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ç»´ä¿®é¨é¨</label> |
| | | <label class="layui-form-label">ç»´ä¿®é¨é¨<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">å®é
维修工æ¶</label> |
| | | <label class="layui-form-label">å®é
维修工æ¶<label style="color:red"> * </label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HTimes" id="HTimes" class="layui-input" value=""> |
| | | <input type="text" name="HTimes" id="HTimes" class="layui-input" value="" style="margin-left:5px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æºåç±»å</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="HMainSourceBillType" lay-filter="HMainSourceBillType" id="HMainSourceBillType"> |
| | | <option value="设å¤ç»´ä¿®ç»è®°å" selected="selected">设å¤ç»´ä¿®ç»è®°å</option> |
| | | <option value="æå·¥å½å
¥">æå·¥å½å
¥</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">ç»´ä¿®å
容</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | |
| | | var option; |
| | | var sBillType = "3910"; |
| | | var TabRow = { "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }; |
| | | //var TabRow = { "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }; |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //è·å䏿éä¸å¼ |
| | | form.on('select(HMainSourceBillType)', function (data) { |
| | | Sctag = data.value; |
| | | form.render('select'); |
| | | switch (Sctag) { |
| | | //æ æºåæ°å¢ |
| | | case '1': |
| | | $('#HMainSourceBillNo').attr("disabled", false); |
| | | $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true); |
| | | break; |
| | | //ææºåæ°å¢Â  |
| | | case '2': |
| | | $('#HMainSourceBillNo').attr("disabled", true); |
| | | $('#XDHList').removeClass("layui-btn-disabled").attr("disabled", false); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data;; |
| | | var NewRow = TabRow; |
| | | var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */}; |
| | | switch (obj.event) { |
| | | //å¢å ä¸è¡ |
| | | case 'btn-AddLine': set_AddLine(NewRow); |
| | |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | $("#HEquipName").val(checkStatus.data[0].HName); |
| | | $("#HEquipID").val(checkStatus.data[0].HItemID); |
| | | $("#HEquipID").val(checkStatus.data[0].HInterID); |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { |
| | |
| | | }); |
| | | }); |
| | | |
| | | //表头信æ¯éæ©åæ®å¼¹çª |
| | | form.on('submit(XDHList)', function () { |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: '设å¤ç»´ä¿®ç»è®°å', |
| | | shift: 2, |
| | | area: ['90%', '90%'], |
| | | content: ['../设å¤ç®¡ç/Sb_EqpConkBookBillList.html', 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " }; |
| | | ////æé®ãæé®ä¸ãçåè° |
| | | var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©åæ®æ°æ®'); |
| | | } |
| | | $("#HMainSourceBillNo").val(checkStatus.data[0].åæ®å·); |
| | | $("#HMainSourceInterID").val(checkStatus.data[0].hmainid); |
| | | $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid); |
| | | ////æéåå·å è½½è¡¨ä½æ°æ® |
| | | //$.ajax({ |
| | | // url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo', |
| | | // type: "GET", |
| | | // data: { "HMainSourceBillNo": checkStatus.data[0].åæ®å· }, |
| | | // success: function (result) { |
| | | // if (result.count == 1) { |
| | | // var EndData = result.data; |
| | | // var rowdate = layui.table.cache["mainTable"]; |
| | | // if (rowdate.length == 0) //è¡¨ä½æ°æ®ä¸ºç©ºæ¶ |
| | | // { |
| | | // buttonArr = [];//æ¸
空æ°ç» |
| | | // for (var i = 0; i < checkStatus.data.length; i++) { |
| | | // var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].åæ®å·, "HSourceBillType": EndData[i].HBillType }; |
| | | // buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | // } |
| | | // table.reload("mainTable", { |
| | | // data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | // }) |
| | | // } |
| | | // else { |
| | | // buttonArr = [];//æ¸
空æ°ç» |
| | | // for (var i = 0; i < EndData.length; i++) { |
| | | // var checkrow = { |
| | | // "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName, |
| | | // "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode, |
| | | // "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark, |
| | | // "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, |
| | | // "HSourceBillNo": EndData[i].åæ®å·, "HSourceBillType": EndData[i].HBillType |
| | | // }; |
| | | // buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | // } |
| | | // table.reload("mainTable", { |
| | | // data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | // }) |
| | | // } |
| | | // } else { |
| | | // layer.alert(result.code + result.Message, { icon: 5 }); |
| | | // } |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | //}); |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { |
| | | //æé®ãæé®äºãçåè° |
| | | //return false å¼å¯è¯¥ä»£ç å¯ç¦æ¢ç¹å»è¯¥æé®å
³é |
| | | }, |
| | | end: function () { |
| | | |
| | | }, |
| | | success: function (layero, index) { |
| | | //layer.full(index); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //ä¿å |
| | | form.on('submit(Saver)', function (data) { |
| | | //debugger; |
| | |
| | | layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); |
| | | var index = parent.layer.getFrameIndex(window.name); //å
å¾å°å½åiframeå±çç´¢å¼ |
| | | parent.layer.close(index); //åæ§è¡å
³é           |
| | | parent.layer.close(index); //åæ§è¡å
³é |
| | | }); |
| | | } |
| | | else { |
| | | f_alert(data.Message); |
| | | layui.alert("ä¿å失败") |
| | | console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable)); |
| | | } |
| | | layer.closeAll("loading"); |
| | |
| | | columns = [ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe" } |
| | | , { field: 'HRepairID1', title: 'HRepairID1', edit: 'text', event: "", hide: true } |
| | | , { field: 'HRepairID', title: 'HRepairID', edit: 'text', event: "", hide: true } |
| | | , { field: 'HRepairCode', title: '维修项ç®ä»£ç ', edit: 'text', event: "", event: "HRepairCode" } |
| | | , { field: 'HRepairName', title: '维修项ç®', edit: 'text', event: "" } |
| | | , { field: 'HManagerID1', title: 'HManagerID1', edit: 'text', hide: true } |
| | | , { field: 'HManagerID', title: 'HManagerID', edit: 'text', hide: true } |
| | | , { field: 'HManagerCode', title: 'è´è´£äººä»£ç ', edit: 'text', event: "HManagerCode" } |
| | | , { field: 'HManagerName', title: 'è´è´£äºº', edit: 'text' } |
| | | , { field: 'HRepairExplanation', title: 'ç»´ä¿®è¦æ±', edit: 'text' } |
| | | , { field: 'HRemark', title: '夿³¨', event: "", edit: 'text' } |
| | | //, { field: 'HSourceInterID', title: 'æºå主å
ç ' } |
| | | //, { field: 'HSourceEntryID', title: 'æºååå
ç ' } |
| | | //, { field: 'HSourceBillNo', title: 'æºååå·' } |
| | | //, { field: 'HSourceBillType', title: 'æºåç±»å' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 150 } |
| | | ]; |
| | | option = { |
| | |
| | | function set_AddFNew() { |
| | | //è·åæå¤§åæ®å· |
| | | get_MAXNum(); |
| | | option.data = [TabRow]; |
| | | option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }]; |
| | | table.render(option); |
| | | } |
| | | |
| | |
| | | function set_EditFromGrid() { |
| | | set_EditForm(linterid); //ç¼è¾è·å表头 |
| | | set_EditGrid(linterid); //ç¼è¾è·åè¡¨ä½ |
| | | option.data = [TabRow]; |
| | | option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */}]; |
| | | table.render(option); |
| | | } |
| | | |
| | |
| | | , "HRepairContent": data.ç»´ä¿®å
容 //ç»´ä¿®å
容 |
| | | , "HExplanation": data.ç»´ä¿®è¦æ± //ç»´ä¿®è¦æ± |
| | | , "HRemark": data.è¡¨å¤´å¤æ³¨ //夿³¨ |
| | | , "HMainSourceBillType": data.HMainSourceBillType |
| | | , "HMainSourceBillNo": data.HMainSourceBillNo |
| | | , "HMainSourceInterID": data.HMainSourceInterID |
| | | , "HMainSourceEntryID": data.HMainSourceEntryID |
| | | }); |
| | | |
| | | } else { |
| | |
| | | } |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | | HRepairID1: checkStatus.data[0].HItemID, |
| | | HRepairID: checkStatus.data[0].HItemID, |
| | | HRepairCode: checkStatus.data[0].HNumber, |
| | | HRepairName: checkStatus.data[0].HName, |
| | | }); |
| | |
| | | |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | | HManagerID1: checkStatus.data[0].HItemID, |
| | | HManagerID: checkStatus.data[0].HItemID, |
| | | HManagerCode: checkStatus.data[0].HNumber, |
| | | HManagerName: checkStatus.data[0].HName |
| | | }); |
| | |
| | | } |
| | | } |
| | | |
| | | //夿æºåå¸¦åæ°æ®æ°ç»ä¸ç弿¯å¦ç¸å |
| | | function isAllEqual(array) { |
| | | if (array.length > 0) { |
| | | return !array.some(function (value, index) { |
| | | return value !== array[0]; |
| | | }); |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //æ°æ®éªè¯ |
| | | function AllowLoadData(sSubStr) { //sSubStr |
| | | |
| | |
| | | if ($("#HRepairName").val() == '') { |
| | | layer.msg("ç»´ä¿®é¡¹ç®æ²¡æéæ©", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return false; |
| | | } |
| | | } |
| | | //æ°åæ£å(å
å«å°æ°) |
| | | var reg = /^\d+(\.\d+)?$/; |
| | | if (reg.test($("#HPlanTimes").val()) == false || $("#HPlanTimes").val() == '') { |
| | |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | //#endregion |