(function () { var page = { isScroll: false, init: function ($page) { //数据绑定 learun.layer.loading(true, '获取数据中'); learun.httpget(config.webapi + "StuInfoFresh/stuInfoFresh", {}, (data) => { if (data) { for (var id in data) { if (id == "StuInfoFreshEntity") { $page.find("#ID").val(data[id].ID); $page.find("#StudentLoanBLStatus").lrpickerSet(data[id].StudentLoanBLStatus); //$page.find("#StudentLoan").val(data[id].StudentLoan); if (data[id].StudentLoanStatus == "1") { learun.layer.loading(false); learun.layer.confirm('新生助学贷款已审核!', function (_index) { learun.nav.closeCurrent(); }, '智慧校园提示', ['确定']); return false; } } } page.bind($page); learun.layer.loading(false); } }); //保存 $page.find('#saveBtn').on('tap', function () { var postdata = { ID: $('#ID').val(), // StudentLoan: $('#StudentLoan').val(), StudentLoan: '', StudentLoanStatus: "0", StudentLoanBLStatus:$("#StudentLoanBLStatus").lrpickerGet() }; // if ($('#StudentLoan').val().trim() != null && $('#StudentLoan').val().trim() != "" && $('#StudentLoan').val().trim() != undefined) { // postdata.StudentLoanStatus = "1"; // } if ($('#StudentLoanBLStatus').lrpickerGet().trim() != null && $('#StudentLoanBLStatus').lrpickerGet().trim() != "" && $('#StudentLoanBLStatus').lrpickerGet().trim() != undefined) { postdata.StudentLoanBLStatus = "2"; } learun.httpget(config.webapi + "StuInfoFresh/saveLoan", postdata, (data) => { if (data) { learun.layer.toast('保存成功'); setTimeout(function () { learun.nav.closeCurrent(); learun.nav.go({ path: '/EducationalAdministration/StuInfoFresh/RegisterQRCode', title: '生成报到二维码', isBack: true, isHead: true, param: {}, type: 'right' }); }, 2000); } }); }); }, bind: function ($page) { $page.find('#StudentLoanBLStatus').lrpickerex({ code: 'StudentLoanBLStatus', type:'dataItem' }); } }; return page; })();