/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2020-01-05 11:38 * 描 述:社团签到 */ var acceptClick; var keyValue = request('keyValue'); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); if (!!keyValue) { $("#CommunityId").attr("readonly", "readonly"); $("#StuNo").attr("readonly", "readonly"); } else { $("#CommunityId").removeAttr("readonly"); $("#StuNo").removeAttr("readonly"); } }, bind: function () { $('#CommunityId').lrDataSourceSelect({ code: 'CommunityInfo', value: 'id', text: 'communityname', select: function (item) { if (!keyValue) { if (!!item) { $('#StuNo').lrselectRefresh({ url: "/PersonnelManagement/CommunityMember/GetList", param: { communityId: item.id }, value: 'StuNo', text: 'StuName' }); } } } }); $('#StuNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic', param: { strWhere: "1=1 order by stuno" }, value: "stuno", text: "stuname" }); $('#Type').lrDataItemSelect({ code: 'CommunityAttendanceType' }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/CommunityAttendance/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } }); } } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/CommunityAttendance/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }