/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2022-03-01 17:26 * 描 述:教材征订管理 */ 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); }, 250, 400); $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', value: 'value', text: 'text' }); //学期 $('#Semester').lrselect({ placeholder: "请选择学年", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', value: 'value', text: 'text' }); // 刷新 $('#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/TextBookSolSub/Form?keyValue=' + keyValue, width: 1000, height: 700, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/DeleteForm', { keyValue: keyValue}, function () { refreshGirdData(); }); } }); } }); // 查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'formview', title: '查看', url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue, width: 1000, height: 700, btn: null, }); } }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetPageList', headData: [ //{ label: "主键", name: "ID", width: 200, align: "left" }, { 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: 120, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, keyId: 'majorname', callback: function (_data) { callback(_data['majorname']); } }); } }, { 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: "AcademicYearNo", width: 100, align: "left" }, { label: "学期", name: "Semester", width: 100, align: "left" }, { label: "教材名称", name: "TextBookName", width: 200, align: "left" }, { label: "书号(物料号)", name: "PublishNo", width: 150, align: "left" }, { label: "作者", name: "FirstAuthor", width: 100, align: "left" }, { label: "其他作者", name: "OtherAuthor", width: 150, align: "left" }, { label: "出版社", name: "Publisher", width: 100, align: "left" }, { label: "版次", name: "Edition", width: 100, align: "left" }, { label: "单价", name: "Price", width: 100, align: "left" }, { label: "订购数量", name: "OrderNum", width: 100, align: "left" }, { label: "备注", name: "Remark", width: 200, align: "left" }, //{ // label: "状态", name: "Status", width: 100, align: "left", // formatter: function (cellvalue) { // if (cellvalue == '0') { // return '草稿'; // } else if (cellvalue == '1') { // return '审批中'; // } else if (cellvalue == '2') { // return '审批通过'; // } // } //}, { label: "录入时间", name: "CreateTime", width: 100, align: "left" }, { label: "创建用户", name: "CreateUserID", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('user', { key: value, callback: function (_data) { callback(_data.name); } }); } }, ], mainId: 'ID', sidx: 'CreateTime desc,Status desc', isPage: true }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }