/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2022-03-02 10:37 * 描 述:教材库存表 */ var acceptClick; var keyValue = request('keyValue'); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); }, bind: function () { $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#TextBookName').lrGirdSelect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', param: { strWhere: " IsDel = '0' and IsValid ='true' " }, height: 800, width: 1100, selectWord: 'textbookname', value: 'textbookname', text: 'textbookname', headData: [ { label: "教材号", name: "publishno", width: 150, align: "left" }, { label: "教材编码", name: "textbookno", width: 150, align: "left" }, { label: "教材名称", name: "textbookname", width: 150, align: "left" }, { label: "作者", name: "firstauthor", width: 150, align: "left" }, { label: "其他作者", name: "otherauthor", width: 100, align: "left" }, { label: "出版日期", name: "pubdate", width: 100, align: "left" }, { label: "出版社", name: "publisher", width: 100, align: "left" }, { label: "教材类型", name: "textbooktype", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'TextBookType', callback: function (_data) { callback(_data.text); } }); } }, { label: "教材性质", name: "textbooknature", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'TextBookNature', callback: function (_data) { callback(_data.text); } }); } }, { label: "价格", name: "price", width: 50, align: "left" }, { label: "版次", name: "edition", width: 100, align: "left" }, { label: "印次", name: "impression", width: 100, align: "left" }, ], select: function (item) { ////赋值 $("#Price").val(item.price); $("#PublishNo").val(item.publishno); $("#TextBookNo").val(item.textbookno); $("#TextBookName").val(item.textbookname); $("#FirstAuthor").val(item.firstauthor); $("#OtherAuthor").val(item.otherauthor); $("#Publisher").val(item.publisher); $("#Edition").val(item.edition); $("#Impression").val(item.impression); } }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } }); } else { $("#BookCode").val(BookCode); } } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }