| | |
| | | </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> |
| | |
| | | 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'); |
| | | }); |
| | | |
| | | //表头信æ¯è®¾å¤å¼¹çª |
| | |
| | | }; |
| | | 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 { |
| | |
| | | , "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.length; j++) { |
| | | $("#HMaintainResult" + (j + 1)).val(result.list[j].ä¿å
»ç»æ == "åæ ¼" ? 'Y' : 'X') |
| | | 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 { |
| | |
| | | } |
| | | //å¢å ä¸è¡ |
| | | 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 |