/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2020-03-04 16:01 * 描 述:岗位申请 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); $('#StuId').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuid', text: 'stuname' }); $('#PositionId').lrselect({ allowSearch: true, url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/GetList', value: "Id", text: "Name" }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPositionApply/Form', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); if (CheckStatus == 1 || CheckStatus == 2) { learun.alert.warning("当前项目已审核!"); return false; } learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPositionApply/Form?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); if (CheckStatus == 1 || CheckStatus == 2) { learun.alert.warning("当前项目已审核!"); return false; } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/WorkStudyPositionApply/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPositionApply/GetPageList', headData: [ { label: "学生姓名", name: "StuName", width: 100, align: "left" }, { label: "学生学号", name: "StuNo", width: 100, align: "left" }, { label: "所属专业", name: "MajorName", width: 100, align: "left" }, { label: "所属班级", name: "ClassName", width: 100, align: "left" }, { label: "岗位名称", name: "Name", width: 100, align: "left" }, { label: "薪资(元/月)", name: "Salary", width: 100, align: "left" }, { label: "学期", name: "Semester", width: 100, align: "left" }, { label: "申请时间", name: "ApplyTime", width: 130, align: "left" }, { label: "申请状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "通过" : cellvalue == 2 ? "未通过" : "待审核"; } }, ], mainId: 'Id', isPage: true, sidx: 'CreateTime desc' }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }