|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-03-05 11:17
- * 描 述:TextBookOut
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var startTime;
- var endTime;
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 时间搜索框
- $('#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();
- }
- });
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 100, 400);
- $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
- $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' });
- $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
- $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 出库
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '出库',
- url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue,
- width: 1000,
- height: 800,
- callBack: function (id) {
- var res = false;
- // 验证数据
- res = top[id].validForm();
- // 保存数据
- if (res) {
- res = top[id].save('', function () {
- page.search();
- });
- }
- return res;
- }
- });
- }
- });
-
- // 查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formview',
- title: '查看',
- url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue,
- width: 1000,
- height: 700,
- btn: null,
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formdelete',
- title: '删除明细',
- url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue,
- width: 1000,
- height: 700,
- btn: null,
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
- headData: [
- { label: '库存单号', name: 'BookCode', width: 200, align: "left" },
- {
- label: "课程", name: "LessonNo", width: 150, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
- key: value,
- keyId: 'lessonno',
- callback: function (_data) {
- callback(_data['lessonname']);
- }
- });
- }
- },
- { label: '教材名称', name: 'TextBookName', width: 200, align: "left" },
- { label: '教材号', name: 'TextBookNo', width: 200, align: "left" },
- { label: '出版号', name: 'PublishNo', width: 200, align: "left" },
- { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" },
- { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" },
- { label: '出版社', name: 'Publisher', width: 200, align: "left" },
- { label: '版次', name: 'Edition', width: 200, align: "left" },
- { label: '印次', name: 'Impression', width: 200, align: "left" },
- { label: '创建人', name: 'CreateTime', width: 200, align: "left" },
- { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" },
- { label: '修改人', name: 'UpTime', width: 200, align: "left" },
- { label: '修改用户', name: 'UpUserID', width: 200, align: "left" },
- { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" },
- { label: '备注', name: 'Remark', width: 200, align: "left" },
- ],
- mainId: 'ID',
- isPage: true,
- sidx: 'CreateTime desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.StartTime = startTime;
- param.EndTime = endTime;
- param.SqlParameter = ' and IsSubmit =1 ';
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|