| | |
| | | , element = layui.element; |
| | | //æ¥è¯¢æ¡ä»¶ |
| | | var option = []; |
| | | var option1 = []; |
| | | var sWhere = ""; |
| | | var sBillType = "3801"; |
| | | //#endregion |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data;; |
| | | var AddRow = table.cache['mainTable']; |
| | | var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }; |
| | | var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "","HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }; |
| | | console.log(NewRow); |
| | | switch (obj.event) { |
| | | //æ°å¢ä¸è¡ |
| | |
| | | , { field: 'HMaterName', title: 'å¨å
·åç§°', edit: 'text', width: 100 } |
| | | , { field: 'HMaterSpec', title: 'è§æ ¼åå·', edit: 'text', width: 100 } |
| | | , { field: 'HBatchNo', title: 'æ¹æ¬¡', edit: 'text', width: 100 } |
| | | , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HUnitCode', title: '计éåä½ä»£ç ', edit: 'text', event: 'HUnitCode', width: 100 } |
| | | , { field: 'HUnitName', title: '计éåä½', edit: 'text', width: 100 } |
| | | , { field: 'HDesignLife', title: '设计寿å½', edit: 'text', width: 100 } |
| | | , { field: 'HLeaveLife', title: 'å©ä½å¯¿å½', edit: 'text', width: 100 } |
| | | , { field: 'HUseLife', title: '使ç¨å¯¿å½', edit: 'text', width: 100 } |
| | |
| | | columns = [ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe", width: 100 } |
| | | , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HMaterCode', title: 'ç©æä»£ç ', edit: 'text', event: 'HMaterCode', width: 100 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', edit: 'text', width: 100 } |
| | | , { field: 'HMaterSpec', title: 'è§æ ¼åå·', edit: 'text', width: 100 } |
| | | , { field: 'HBatchNo', title: 'æ¹æ¬¡', edit: 'text', width: 100 } |
| | | , { field: 'HQty', title: '宿¶æ°é', edit: 'text', width: 100 } |
| | | , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HWHCode', title: 'æ¶æä»åºä»£ç ', edit: 'text', event: 'HWHCode', width: 120 } |
| | | , { field: 'HWHName', title: 'æ¶æä»åºåç§°', edit: 'text', width: 120 } |
| | | , { field: 'HRemark', title: '夿³¨', edit: 'text', width: 100 } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', edit: 'text', event: 'HMaterCode', width: 100 } |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', edit: 'text', width: 100 } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', edit: 'text', width: 100 } |
| | | , { field: 'åæ®å·', title: 'åæ®å·', edit: 'text', width: 100 } |
| | | , { field: 'æ¹æ¬¡', title: 'æ¹æ¬¡', edit: 'text', width: 100 } |
| | | , { field: '宿¶æ°é', title: '宿¶æ°é', edit: 'text', width: 100 } |
| | | , { field: 'hwhid1', title: 'HWHID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'æ¶æä»åºä»£ç ', title: 'æ¶æä»åºä»£ç ', edit: 'text', event: 'HWHCode', width: 120 } |
| | | , { field: 'æ¶æä»åº', title: 'æ¶æä»åºåç§°', edit: 'text', width: 120 } |
| | | , { field: '表ä½å¤æ³¨', title: '夿³¨', edit: 'text', width: 100 } |
| | | ]; |
| | | option1 = { |
| | | id: 'mainTable1' |
| | |
| | | function set_AddFNew() { |
| | | //è·åæå¤§åæ®å· |
| | | get_MAXNum(); |
| | | option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }]; |
| | | option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "","HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }]; |
| | | table.render(option); |
| | | } |
| | | //è·åæå¤§åæ®å· |
| | |
| | | function set_EditFromGrid(linterid) { |
| | | set_EditForm(linterid); //ç¼è¾è·å表头 |
| | | set_EditGrid(linterid); //ç¼è¾è·åè¡¨ä½ |
| | | option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }]; |
| | | option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "","HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }]; |
| | | table.render(option); |
| | | } |
| | | //ç¼è¾è·å表头 |
| | |
| | | data: { "sqlWhere": "and hmainid=" + linterid }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | option.data = result.data; |
| | | option.data = result.list[0]; |
| | | table.render(option); |
| | | option1.data = result.list[1]; |
| | | table.render(option1); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | |
| | | } |
| | | }); |
| | | } |
| | | //è¾
å©è®¡éåä½ä»£ç |
| | | if (obj.event === 'HSecUnitCode') //è¾
å©è®¡éåä½ä»£ç |
| | | { |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: 'è¾
å©è®¡éåä½å表', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../../PublicPage/UnitInformation.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('è¯·éæ©æ°æ®'); |
| | | } |
| | | |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | | HSecUnitID: checkStatus.data[0].HItemID, |
| | | HSecUnitCode: checkStatus.data[0].HNumber, |
| | | HSecUnitName: checkStatus.data[0].HName, |
| | | }); |
| | | |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { |
| | | //æé®ãæé®äºãçåè° |
| | | //return false å¼å¯è¯¥ä»£ç å¯ç¦æ¢ç¹å»è¯¥æé®å
³é |
| | | }, |
| | | end: function () { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //计éåä½ä»£ç |
| | | if (obj.event === 'HUnitCode') //计éåä½ä»£ç |
| | | { |
| | |
| | | layer.msg("æç»è®°å½ç¬¬" + (i + 1) + "è¡,å¨å
·ä¿¡æ¯ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | if (sSubStr[i].HUnitID == "") { |
| | | layer.msg("æç»è®°å½ç¬¬" + (i + 1) + "è¡,计éåä½ä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | if (sSubStr[i].HWHID == "") { |
| | | layer.msg("æç»è®°å½ç¬¬" + (i + 1) + "è¡,æ¶æä»åºä¸ºç©º!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |