var eidtorGridObject=undefined;var eidtorGridIndex=undefined;var vDepositRowsData;var vDebtRowsData;$(function(){_myPage.prototype.initDataOne({code:"formatdesign_libcode",key:"libcode"})});function bindPageFormatDesignDataGridList(){var b=base_path+"lib/design/page.do";var c={};var a=jsonFormatDesign.code;c.code=a;c.rows=100;c.page=1;$.post(b,c,function(d){if(d.status=="0"){initFormatDesignComboboxByCode(d,a)}else{openMessageDlg(d.message)}},"json")}function initFormatDesignComboboxByCode(b,a){$("#formatdesign_index").combobox({data:b.rows,valueField:"keycode",textField:"name",onChange:function(d,c){if(d!=undefined&&d!=c&&d.length>0){bindAcceptFormatDesignDataByKeyCode(d)}}});if(a=="E_PRINTTICKET"){if(getValue("page_acceptDepositFormatDesignIndex")){setValue("formatdesign_index",getValue("page_acceptDepositFormatDesignIndex"))}else{setValue("formatdesign_index",b.rows[0].keycode)}}if(a=="E_PRINTTICKETDEBT"){if(getValue("page_acceptDebtFormatDesignIndex")){setValue("formatdesign_index",getValue("page_acceptDebtFormatDesignIndex"))}else{setValue("formatdesign_index",b.rows[0].keycode)}}}function bindPrintFDByCode(d,a,c){var b=base_path+"lib/design/page.do";var e={};e.code=a;e.rows=100;e.page=1;$.post(b,e,function(f){if(f.status=="0"){if("E_PRINTTICKET"==a){vDepositRowsData=f.rows}if("E_PRINTTICKETDEBT"==a){vDebtRowsData=f.rows}$("#"+d).combobox({data:f.rows,valueField:"keycode",textField:"name",onChange:function(h,g){}});if(c){c()}}else{openMessageDlg(f.message)}},"json")}function bindAcceptFormatDesignDataByKeyCode(a){var b=base_path+"lib/design/get.do";var c={};c.pk=a;$.post(b,c,function(d){if(d.status=="0"){var e=d.rows[0];setDataToPageElement(e)}else{openMessageDlg(d.message)}},"json")}function setDataToPageElement(g){var h=JSON.parse(g.paramjson);setJsonData("formatdesign_",g);eidtorGridObject.datagrid("loadData",h.grid);var a=h.propertygrid;var f=jsonPropertyGridData.rows;var d=[];for(var c=0;c0){c=base_path+"lib/design/update.do"}$.post(c,b,function(i){if(i.status=="0"){bindPageFormatDesignDataGridList();if(jsonFormatDesign.code=="E_PRINTTICKET"){bindPrintFDByCode("page_acceptDepositFormatDesignIndex","E_PRINTTICKET")}if(jsonFormatDesign.code=="E_PRINTTICKETDEBT"){bindPrintFDByCode("page_acceptDebtFormatDesignIndex","E_PRINTTICKETDEBT")}openMessageDlg(i.message,5000)}else{openMessageDlg(i.message)}},"json")}function deleteFormatDesignRecord(){var a=getValue("formatdesign_keycode");if(a.length==0){return openMessageDlg("请先选择要删除格式")}openConfirmDlg("您确定要删除当前选中的格式吗?",null,deleteFormatDesignRecordResult,null)}function deleteFormatDesignRecordResult(){var a=getValue("formatdesign_keycode");var c={};c.pk=a;var b=base_path+"lib/design/delete.do";$.post(b,c,function(d){if(d.status=="0"){openMessageDlg(d.message,5000);bindPageFormatDesignDataGridList()}else{openMessageDlg(d.message)}},"json")}function setFormatDesignLayout(){}function onSearchData(){var a=getJsonDataByTypeHandler();var b=getValue("acceptFormatDesignIndex");if(b.length==0){return openMessageDlg("请选择输出的格式")}a.keycode=b;a.count=99999;openPostWindow("exportlabelresult.jsp",a)};