| | |
| | | <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=""> |
| | | <form id="component-form-group" class="layui-form" lay-filter="component-form-group" action=""> |
| | | <div class="layui-card-header"> |
| | | <div class="layui-btn-group"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">æ°å¢</button> |
| | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">设å¤ä¿å
»è§ç¨<label style="color:red"></label></label> |
| | | <div class="layui-input-inline"> |
| | | <input type="hidden" name="HMouldMaintainRuleID" id="HMouldMaintainRuleID" class="layui-input" value="0" style="float:left;width:150px;"> |
| | | <input type="text" name="HMouldMaintainRuleNo" id="HMouldMaintainRuleNo" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="HEquipDotCheckRuleInterList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æè¦</label> |
| | | <div class="layui-input-inline"> |
| | | <textarea placeholder="请è¾å
¥æè¦" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea> |
| | |
| | | </div> |
| | | </div> |
| | | <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="barDemo1"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del1">å é¤</a> |
| | | </script> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../layuiadmin/Scripts/json2.js"></script> |
| | |
| | | var option = [];//ä¿å
» |
| | | var option1 = [];//é
ä»¶ |
| | | var sBillType = "3902"; |
| | | var TabRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };//ä¿å
» |
| | | var TabRow1 = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "", "HRemark": "" };//é
ä»¶ |
| | | //var TabRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };//ä¿å
» |
| | | //var TabRow1 = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "", "HRemark": "" };//é
ä»¶ |
| | | //#endregion |
| | | |
| | | |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data;; |
| | | var AddRow = table.cache['mainTable']; |
| | | var NewRow = TabRow; |
| | | var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }; |
| | | switch (obj.event) { |
| | | //æ°å¢ä¸è¡ |
| | | case 'btn-AddLine': btnAddLine(NewRow); |
| | |
| | | table.on('toolbar(mainTable1)', function (obj) { |
| | | var checkStatus = table.checkStatus('mainTable1') |
| | | , data = checkStatus.data; |
| | | var NewRow = TabRow1; |
| | | var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }; |
| | | switch (obj.event) { |
| | | //æ°å¢ä¸è¡ |
| | | case 'btn-AddLine1': btnAddLine1(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) { |
| | |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | var sSubStr1 = JSON.stringify(table.cache['mainTable1']); |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr1; |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr1 + ";" + sessionStorage["HUserName"]; |
| | | if (!AllowLoadData(sSubStr))//æ°æ®éªè¯ |
| | | { |
| | | return false; |
| | |
| | | }); |
| | | |
| | | }); |
| | | //表头信æ¯è®¾å¤ä¿å
»è§ç¨ |
| | | form.on('submit(HEquipDotCheckRuleInterList)', function () { |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: '设å¤ä¿å
»è§ç¨å表', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../设å¤ç®¡ç/设å¤è§ç¨å/Sb_EquipMaintainRuleList.html', 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | //æé®ãæé®ä¸ãçåè° |
| | | 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('è¯·éæ©æ°æ®'); |
| | | } |
| | | $("#HMouldMaintainRuleNo").val(checkStatus.data[0].åæ®å·); |
| | | $("#HMouldMaintainRuleID").val(checkStatus.data[0].hmainid); |
| | | get_DocCheckItem2(checkStatus.data[0].hmainid); |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //é¢è§Printing |
| | | form.on("submit(view)", function (data) { |
| | | window.open("../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/HBarPlanPrint.html?linterid=" + linterid + "&Type=HEquipMaintainPlanBill&OpenTmp=设å¤ä¿å
»è®¡åæ¡ç "); |
| | |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe" } |
| | | , { field: 'HMaintainItemID', title: 'ä¿å
»é¡¹ç®ID', edit: 'text', hide: true } |
| | | , { field: 'HMaintainItemNumber', title: 'ä¿å
»é¡¹ç®ä»£ç ', edit: 'text', event: 'HMaintainItemNumber' } |
| | | , { field: 'HMaintainItem', title: 'ä¿å
»é¡¹ç®', edit: 'text' } |
| | | , { field: 'HMaintainItem', title: 'ä¿å
»é¡¹ç®' } |
| | | , { field: 'HMaintainPart', title: 'ä¿å
»é¨ä½', edit: 'text' } |
| | | , { field: 'HClaim', title: 'å
·ä½è¦æ±', edit: 'text' } |
| | | , { field: 'HManagerID', title: 'è´è´£äººID', edit: 'text', hide: true } |
| | | , { field: 'HManagerNumber', title: 'è´è´£äººä»£ç ', edit: 'text', event: 'HManagerNumber' } |
| | | , { field: 'HManagerName', title: 'è´è´£äºº', edit: 'text' } |
| | | , { field: 'HManagerName', title: 'è´è´£äºº' } |
| | | , { field: 'HRemark', title: '夿³¨', edit: 'text' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo' } |
| | | ]; |
| | |
| | | , { field: 'HUnitID', title: 'åä½ID', edit: 'text', hide: true } |
| | | , { field: 'HUnitNumber', title: 'åä½ä»£ç ', edit: 'text', event: "HUnitCode" } |
| | | , { field: 'HUnitName', title: 'åä½åç§°', edit: 'text', event: "" } |
| | | , { field: 'HManagerID', title: 'è´è´£äººID', edit: 'text', hide: true } |
| | | , { field: 'HManagerNumber', title: 'è´è´£äººä»£ç ', edit: 'text', event: 'HManagerNumber' } |
| | | , { field: 'HManagerName', title: 'è´è´£äºº', edit: 'text' } |
| | | //, { field: 'HManagerID', title: 'è´è´£äººID', edit: 'text', hide: true } |
| | | //, { field: 'HManagerNumber', title: 'è´è´£äººä»£ç ', edit: 'text', event: 'HManagerNumber' } |
| | | //, { field: 'HManagerName', title: 'è´è´£äºº', edit: 'text' } |
| | | , { field: 'HQty', title: 'ç¨é', edit: 'text' } |
| | | , { field: 'HRemark', title: '夿³¨', edit: 'text' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 150 } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo1', width: 150 } |
| | | ]; |
| | | option1 = { |
| | | id: 'mainTable1' |
| | |
| | | function set_AddFNew() { |
| | | //è·åæå¤§åæ®å· |
| | | get_MAXNum(); |
| | | option.data = [TabRow]; |
| | | option1.data = [TabRow1]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | } |
| | |
| | | function set_EditFromGrid(linterid) { |
| | | set_EditForm(linterid); //ç¼è¾è·å表头 |
| | | set_EditGrid(linterid); //ç¼è¾è·åè¡¨ä½ |
| | | option.data = [TabRow]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | table.render(option); |
| | | option1.data = [TabRow1]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }]; |
| | | table.render(option1); |
| | | } |
| | | //ç¼è¾è·å表头 |
| | |
| | | , "HRemark": data.è¡¨å¤´å¤æ³¨ |
| | | , "HCycleUnit": data.卿åä½ |
| | | , "HCheckCycle": data.ä¿å
»å¨æ |
| | | , "HMouldMaintainRuleID": data.HMouldMaintainRuleID |
| | | , "HMouldMaintainRuleNo": data.设å¤ä¿å
»è§ç¨ |
| | | }); |
| | | |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿å
»ä¿¡æ¯ é
ä»¶ä¿¡æ¯ |
| | | function get_DocCheckItem2(data) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Sb_EquipMaintainRuleBill/Sb_EquipMaintainRuleBillSubAndSubItem", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HInterID": data }, |
| | | success: function (result) { |
| | | if (result != null) { |
| | | if (result.count == 1) { |
| | | var BYData = result.list[0];//ä¿å
» |
| | | 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": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | |
| | | if (BYData.length != 0) //è¡¨ä½æ°æ®ä¸ä¸ºç©ºæ¶ |
| | | { |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | | for (var i = 0; i < BYData.length; i++) { |
| | | var checkrow = { |
| | | "HMaintainItemID": BYData[i].HMaintainItemID, "HMaintainItemNumber": BYData[i].HMaintainItemNumber, "HMaintainItem": BYData[i].HMaintainItem, |
| | | "HMaintainPart": BYData[i].HMaintainPart, "HClaim": BYData[i].HClaim, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber, |
| | | "HManagerName": BYData[i].HManagerName, "HRemark": BYData[i].HRemark |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | } |
| | | |
| | | if (PJData.length != 0) //è¡¨ä½æ°æ®ä¸ä¸ºç©ºæ¶ |
| | | { |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | | for (var i = 0; i < PJData.length; i++) { |
| | | var checkrow = { |
| | | "HMaterID": PJData[i].HMaterID, "HMaterNumber": PJData[i].HMaterNumber, "HMaterName": PJData[i].HMaterName, |
| | | "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber, |
| | | "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty, "HRemark": PJData[i].HRemark |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable1", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //æ¥ææ ¼å¼å |
| | | function formatDate(date) { |
| | | var d = new Date(date), |
| | |
| | | if (rowIndex === '0') { |
| | | layer.msg('é¦è¡æ æ³å é¤ï¼ï¼ï¼'); |
| | | } else { |
| | | //obj.del(); |
| | | //layer.close(index); |
| | | var oldData = table.cache["mainTable"]; |
| | | oldData.splice(obj.tr.data('index'), 1); |
| | | table.reload('mainTable', { data: oldData }); |
| | |
| | | function set_GridDelete1(obj) { |
| | | var data = obj.data; |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | if (obj.event === 'del') { |
| | | if (obj.event === 'del1') { |
| | | layer.confirm('ççå é¤è¡ä¹', function (index) { |
| | | console.log("ç´¢å¼ä¸º:" + rowIndex); |
| | | if (rowIndex === '0') { |
| | | layer.msg('é¦è¡æ æ³å é¤ï¼ï¼ï¼'); |
| | | } else { |
| | | //obj.del(); |
| | | //layer.close(index); |
| | | var oldData = table.cache["mainTable1"]; |
| | | oldData.splice(obj.tr.data('index'), 1); |
| | | table.reload('mainTable1', { data: oldData }); |