/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2022-03-03 10:15 * 描 述:教材入库 */ 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); // 刷新 $('#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/TextBookIn/Form?keyValue=' + keyValue, width: 800, 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/TextBookIn/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/TextBookIn/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.SqlParameter = ' and IsSubmit =1 '; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }