/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2020-08-11 16:55 * 描 述:寝室日常考核管理 */ var selectedRow; var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var startTime; var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 300, 400); // 时间搜索框 $('#datesearch').lrdate({ dfdata: [ { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } ], // 月 mShow: false, premShow: false, // 季度 jShow: false, prejShow: false, // 年 ysShow: false, yxShow: false, preyShow: false, yShow: false, // 默认 dfvalue: '1', selectfn: function (begin, end) { startTime = begin; endTime = end; page.search(); } }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); $('#Dormitory').lrDataSourceSelect({ code: 'Acc_DormitoryData', value: 'id', text: 'name', select: function (item) { if (item) { $('#Unit').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: 'Acc_UnitData', strWhere: "ParentID='" + item.id + "' order by name" } }); } } }); $('#Unit').lrselect({ text: 'name', value: 'id', select: function (item) { if (item) { $('#Floor').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: 'Acc_FloorData', strWhere: "ParentID='" + item.id + "' order by name" } }); } } }); $('#Floor').lrselect({ text: 'name', value: 'id', select: function (item) { if (item) { $('#RId').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: 'Acc_RoomData', strWhere: "ParentID='" + item.id + "' order by name" } }); } } }); $('#RId').lrselect({ text: 'name', value: 'id', allowSearch: true }); $('#DeptNo').lrselect({ allowSearch: true, value: "deptno", text: "deptname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', select: function (item) { if (item) { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } }); } else { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "1=1 AND CheckMark=1" } }); } } }); $('#MajorNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', value: "majorno", text: "majorname", param: { strWhere: "1=1 AND CheckMark=1" }, select: function (item) { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1" } }); } } }); $('#ClassNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1" }, value: "classno", text: "classname" }); // 快速新增 $('#lr_addQuickly').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { selectedRow = $('#gridtable').jfGridGet('rowdata'); //console.log(selectedRow); learun.layerForm({ id: 'form', title: '快速新增', url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/Form', width: 800, height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LogisticsManagement/Acc_DailyAssess/GetPageList', headData: [ { label: "专业部", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', key: value, keyId: 'deptno', callback: function (_data) { callback(_data['deptname']); } }); } }, { label: "专业", name: "MajorNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } }); } }, { label: "班级", name: "ClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', key: value, keyId: 'classno', callback: function (_data) { callback(_data['classname']); } }); } }, { label: "宿舍楼", name: "Dormitory", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_DormitoryData', key: value, keyId: 'id', callback: function (_data) { callback(_data['name']); } }); } }, { label: "单元", name: "Unit", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_UnitData', key: value, keyId: 'id', callback: function (_data) { callback(_data['name']); } }); } }, { label: "楼层", name: "Floor", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_FloorData', key: value, keyId: 'id', callback: function (_data) { callback(_data['name']); } }); } }, { label: "寝室号", name: "RId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Acc_RoomData', key: value, keyId: 'id', callback: function (_data) { callback(_data['name']); } }); } }, { label: "学生姓名", name: "StuNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', key: value, keyId: 'stuno', callback: function (_data) { callback(_data['stuname']); } }); } }, { label: "日期", name: "Date", width: 130, align: "left" }, { label: "卫生奖分", name: "AddScoreHealth", width: 100, align: "left" }, { label: "卫生扣分", name: "MinusScoreHealth", width: 100, align: "left" }, { label: "纪律奖分", name: "AddScore", width: 100, align: "left" }, { label: "纪律扣分", name: "MinusScore", width: 100, align: "left" }, { label: "奖扣分原因", name: "Reason", width: 200, align: "left" }, ], mainId: 'Id', isPage: true, sidx: 'Date desc' }); page.search(); }, search: function (param) { param = param || {}; param.StartTime = startTime; param.EndTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }