| | |
| | | .layui-form-label { |
| | | width: 85px; |
| | | } |
| | | |
| | | /* 鲿¢ä¸ææ¡ç䏿å表被éè---å¿
须设置--- */ |
| | | .layui-table-cell { |
| | | overflow: visible !important; |
| | | } |
| | | /* 使å¾ä¸ææ¡ä¸åå
æ ¼å好åé */ |
| | | td .layui-form-select { |
| | | margin-top: -10px; |
| | | margin-left: -15px; |
| | | margin-right: -15px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æç»ç»è®º</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="radio" name="HLastResult" id="HLastResult" value="OK" title="OK" checked> |
| | | <input type="radio" name="HLastResult" id="HLastResult" value="NG" title="NG"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-tab layui-tab-card" lay-filter="TabTest"> |
| | | <div class="layui-tab layui-tab-card" lay-filter="TabTest"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">ä¿å
»é¡¹ä¿¡æ¯</li> |
| | | <li>é
ä»¶ä¿¡æ¯</li> |
| | |
| | | <script type="text/html" id="barDemo"> |
| | | <!--<a class="layui-btn layui-btn-xs" lay-event="edit">ç¼è¾</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> |
| | | </script> |
| | | <!--è¡ä¸æéæ©(ä¿å
ȍȾ)--> |
| | | <script type="text/html" id="HMaintainResult"> |
| | | <select name="HMaintainResult" lay-filter="HMaintainResult" id="HMaintainResult{{d.LAY_TABLE_INDEX+1}}"> |
| | | <!--<option value="">è¯·éæ©</option>--> |
| | | <option value="Y" selected>Y</option> |
| | | <option value="X">X</option> |
| | | </select> |
| | | </script> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../layuiadmin/Scripts/json2.js"></script> |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data;; |
| | | var AddRow = table.cache['mainTable']; |
| | | var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": " " }; |
| | | var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": " ", "HMaintainResult": "Y" }; |
| | | switch (obj.event) { |
| | | //æ°å¢ä¸è¡ |
| | | case 'btn-AddLine': btnAddLine(NewRow); |
| | |
| | | table.on('tool(mainTable1)', function (obj) { |
| | | set_GridDelete1(obj); //è¡å
å é¤ |
| | | set_GridCellCheck1(obj); //è¡å
å¿«æ·é®çé |
| | | }); |
| | | |
| | | //è¡éæ©å¤çï¼ç¹æ£ç»æï¼ |
| | | form.on('select(HMaintainResult)', function (data) { |
| | | //è·å䏿æ¡éä¸çå¼ |
| | | var elem = data.othis.parents('tr'); |
| | | var dataindex = elem.attr("data-index"); |
| | | $.each(option.data, function (index, value) { |
| | | if (value.LAY_TABLE_INDEX == dataindex) { |
| | | value.HMaintainResult = data.value;//æéä¸ä¸ææ¡idå¼èµå¼ç»è¡¨æ ¼ç¼å |
| | | } |
| | | }); |
| | | |
| | | console.log(table.cache['mainTable']); |
| | | |
| | | var HQty = 0;//表ä½è¡ä¸åæ ¼æ°é |
| | | for (let i = 0; i < table.cache['mainTable'].length; i++) { |
| | | if (table.cache['mainTable'][i].HMaintainResult == "X") { |
| | | HQty++; |
| | | } |
| | | } |
| | | if (HQty > 0) { |
| | | document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } else { |
| | | document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } |
| | | form.render('radio'); |
| | | }); |
| | | |
| | | //表头信æ¯è®¾å¤å¼¹çª |
| | |
| | | var PJData = result.list[1];//é
ä»¶ |
| | | var rowdate1 = layui.table.cache["mainTable"]; |
| | | var rowdate2 = layui.table.cache["mainTable1"]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " ", "HMaintainResult": "Y" }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | |
| | | $("#HEquipMaintainRuleInterID").val(BYData[0].HInterID); |
| | | $("#HEquipMaintainRuleInterNo").val(BYData[0].HBillNo) |
| | | } |
| | | |
| | | |
| | | if (BYData.length != 0) //è¡¨ä½æ°æ®ä¸ºç©ºæ¶ |
| | | { |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | |
| | | var checkrow = { |
| | | "HMaintainItemID": BYData[i].HMaintainItemID, "HMaintainItemNumber": BYData[i].HMaintainItemNumber, "HMaintainItem": BYData[i].HMaintainItem, |
| | | "HMaintainPart": BYData[i].HMaintainPart, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber, |
| | | "HManagerName": BYData[i].HManagerName, "HClaim": rowdate1[i].HClaim, "HRemark": rowdate1[i].HRemark |
| | | "HManagerName": BYData[i].HManagerName, "HClaim": rowdate1[i].HClaim, "HRemark": rowdate1[i].HRemark, "HMaintainResult": "Y" |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | |
| | | var rowdate1 = layui.table.cache["mainTable"]; |
| | | var rowdate2 = layui.table.cache["mainTable1"]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y"}]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | |
| | |
| | | var checkrow = { |
| | | "HMaintainItemID": BYData[i].HMaintainItemID, "HMaintainItemNumber": BYData[i].ä¿å
»é¡¹ç®ä»£ç , "HMaintainItem": BYData[i].ä¿å
»é¡¹ç®åç§°, |
| | | "HMaintainPart": BYData[i].ä¿å
»é¨ä½, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].è´è´£äººä»£ç , |
| | | "HManagerName": BYData[i].è´è´£äººåç§°, "HClaim": BYData[i].å
·ä½è¦æ±, "HRemark": BYData[i].表ä½å¤æ³¨ |
| | | "HManagerName": BYData[i].è´è´£äººåç§°, "HClaim": BYData[i].å
·ä½è¦æ±, "HRemark": BYData[i].表ä½å¤æ³¨, "HMaintainResult": "Y" |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | option.data = buttonArr; |
| | | table.render(option); |
| | | //table.reload("mainTable", { |
| | | // data: option.data //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | //}) |
| | | } |
| | | |
| | | |
| | |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable1", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | option1.data = buttonArr; |
| | | table.render(option1); |
| | | //table.reload("mainTable1", { |
| | | // data: option1.data //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | //}) |
| | | } |
| | | |
| | | } else { |
| | |
| | | url: GetWEBURL() + "/Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBill_PlanList", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HInterID": HPlanID, "HDate": HDate }, |
| | | data: { "HInterID": HPlanID, "HDate": HDate }, |
| | | success: function (result) { |
| | | if (result != null) { |
| | | if (result.count == 1) { |
| | |
| | | var rowdate1 = layui.table.cache["mainTable"]; |
| | | var rowdate2 = layui.table.cache["mainTable1"]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y"}]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | |
| | |
| | | var checkrow = { |
| | | "HMaintainItemID": BYData[i].HMaintainRuleID, "HMaintainItemNumber": BYData[i].ä¿å
»é¡¹ç®ä»£ç , "HMaintainItem": BYData[i].ä¿å
»é¡¹ç®, |
| | | "HMaintainPart": BYData[i].ä¿å
»é¨ä½, "HManagerID": BYData[i].HEmployeeID, "HManagerNumber": BYData[i].è´è´£äººä»£ç , |
| | | "HManagerName": BYData[i].è´è´£äººåç§°, "HClaim": BYData[i].å
·ä½è¦æ±, "HRemark": BYData[i].HRemark |
| | | "HManagerName": BYData[i].è´è´£äººåç§°, "HClaim": BYData[i].å
·ä½è¦æ±, "HRemark": BYData[i].HRemark, "HMaintainResult": "Y" |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | |
| | | } |
| | | $("#HPlanName").val(checkStatus.data[0].åæ®å·); |
| | | $("#HPlanNo").val(checkStatus.data[0].åæ®å·); |
| | | $("#HEquipMaintainPlanInterID").val(checkStatus.data[0].hmainid); |
| | | $("#HEquipMaintainPlanInterID").val(checkStatus.data[0].hmainid); |
| | | $("#HEquipName").val(checkStatus.data[0].设å¤åç§°); |
| | | $("#HEquipID").val(checkStatus.data[0].HEquipID); |
| | | $("#HEquipMaintainRuleInterID").val(checkStatus.data[0].HMouldMaintainRuleID); |
| | |
| | | $("#HMaintainLevID").val(checkStatus.data[0].HMaintainLevID); |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | get_MaintainItem3(); |
| | | |
| | | |
| | | } |
| | | }); |
| | | }); |
| | |
| | | function Table() { |
| | | //表头 |
| | | columns = [ |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计è¡'} |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计è¡' } |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe" } |
| | | , { field: 'HMaintainItemID', title: 'ä¿å
»é¡¹ç®ID', edit: 'text', hide: true } |
| | | , { field: 'HMaintainItemNumber', title: 'ä¿å
»é¡¹ç®ä»£ç ', hide: true ,edit: 'text' } |
| | | , { field: 'HMaintainItemNumber', title: 'ä¿å
»é¡¹ç®ä»£ç ', hide: true, edit: 'text' } |
| | | , { field: 'HMaintainItem', title: 'ä¿å
»é¡¹ç®', edit: 'text', event: 'HMaintainItemNumber' } |
| | | , { field: 'HMaintainResult', title: 'ä¿å
ȍȾ', templet: '#HMaintainResult', event: 'HMaintainResult' } |
| | | , { field: 'HMaintainPart', title: 'ä¿å
»é¨ä½', edit: 'text' } |
| | | , { field: 'HClaim', title: 'å
·ä½è¦æ±', edit: 'text' } |
| | | , { field: 'HManagerID', title: 'è´è´£äººID', edit: 'text', hide: true } |
| | |
| | | function Table1() { |
| | | //表头 |
| | | columns = [ |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计è¡'} |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计è¡' } |
| | | , { templet: '#xuhao1', title: 'åºå·', sort: true, fixed: 'left', event: "qwe" } |
| | | , { field: 'HMaterID', title: 'é
ä»¶ID', edit: 'text', hide: true } |
| | | , { field: 'HMaterNumber', title: 'é
件代ç ', edit: 'text', event: "HMaterCode" } |
| | |
| | | //è·åæå¤§åæ®å· |
| | | get_MAXNum(); |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | } |
| | |
| | | $('#HPlanList').addClass("layui-btn-disabled").attr("disabled", true); |
| | | set_EditForm(linterid); //ç¼è¾è·å表头 |
| | | set_EditGrid(linterid); //ç¼è¾è·åè¡¨ä½ |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " ", "HMaintainResult": "Y" }]; |
| | | table.render(option); |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | table.render(option1); |
| | |
| | | , "HExplanation": data.æè¦ //æè¦ |
| | | , "HBeginDate": data.å¼å§æ¥æ // |
| | | , "HEndDate": data.ç»ææ¥æ // |
| | | , "HPlanName": data.ä¿å
»è®¡å |
| | | , "HPlanName": data.ä¿å
»è®¡å |
| | | , "HPlanNo": data.ä¿å
»è®¡åç¼å· // |
| | | , "HPlanName": data.ä¿å
»è®¡åç¼å· // |
| | | , "HRemark": data.è¡¨å¤´å¤æ³¨ //夿³¨ |
| | |
| | | , "HMaintainLevID": data.HMaintainLevID |
| | | , "HMaintainLevName": data.ä¿å
»çº§å«åç§° |
| | | }); |
| | | |
| | | if (data.æç»ç»è®º == "ä¸åæ ¼") { |
| | | document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } else { |
| | | document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } |
| | | form.render('radio'); |
| | | |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | |
| | | //console.log('gouba' + result); |
| | | if (result.count == 1) { |
| | | option.data = result.list[0]; |
| | | for (let i = 0; i < option.data.length; i++) { |
| | | if (option.data[i].HMaintainResult == "åæ ¼") { |
| | | option.data[i].HMaintainResult = "Y"; |
| | | } else { |
| | | option.data[i].HMaintainResult = "X"; |
| | | } |
| | | } |
| | | table.render(option); |
| | | option1.data = result.list[1]; |
| | | table.render(option1); |
| | | |
| | | for (let j = 0; j < result.list[0].length; j++) { |
| | | $("#HMaintainResult" + (j + 1)).val(result.list[0][j].HMaintainResult == "åæ ¼" ? 'Y' : (result.list[0][j].HMaintainResult == 'Y' ? 'Y' : 'X')) |
| | | } |
| | | form.render('select'); |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | |
| | | } |
| | | //å¢å ä¸è¡ |
| | | function btnAddLine(NewRow) { |
| | | var tableBak = table.cache["mainTable"]; //è·åä¹åç¼è¾è¿çè¡¨æ ¼æ°æ® |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | | for (var i = 0; i < tableBak.length; i++) { |
| | | buttonArr.push(tableBak[i]); //å°ä¹åçæ°æ®åå¨ |
| | | table.cache["mainTable"].push(NewRow); |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | | $('#HMaintainResult' + i + '').find("option[value='" + option.data[i - 1].HMaintainResult + "']").attr("selected", true); |
| | | } |
| | | buttonArr.push(NewRow); //å¨å°¾é¨å ä¸è¡ |
| | | table.reload("mainTable", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | form.render('select'); |
| | | } |
| | | //å¢å ä¸è¡1 |
| | | function btnAddLine1(NewRow) { |
| | |
| | | table.cache["mainTable"].push(JSON.parse(copyrow));//å°å¤å¶çè¡å¼ºè½¬æjson追å å°è¡¨æ ¼ä¸ |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.render(option);//å°æ°æ®æ¸²æå°è¡¨æ ¼ä¸ |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | | $('#HMaintainResult' + i + '').find("option[value='" + option.data[i - 1].HMaintainResult + "']").attr("selected", true); |
| | | } |
| | | form.render('select'); |
| | | } |
| | | } |
| | | //å¤å¶ä¸è¡1 |
| | |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | |
| | | |
| | | if (checkStatus.data.length === 1) { |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | |
| | | } |
| | | //å°æ¹ééæ©çæ°æ®åå
¥æ°ç»ï¼å¤éè¡ï¼ |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | buttonArr.push({ "HMaintainItemID": checkStatus.data[i].HItemID, "HMaintainItemNumber": checkStatus.data[i].ä¿å
»é¡¹ç®ä»£ç , "HMaintainItem": checkStatus.data[i].ä¿å
»é¡¹ç®åç§°, "HMaintainPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" }); |
| | | buttonArr.push({ "HMaintainItemID": checkStatus.data[i].HItemID, "HMaintainItemNumber": checkStatus.data[i].ä¿å
»é¡¹ç®ä»£ç , "HMaintainItem": checkStatus.data[i].ä¿å
»é¡¹ç®åç§°, "HMaintainPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HMaintainResult": "Y" }); |
| | | } |
| | | |
| | | table.reload("mainTable", { |