|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-03-19 10:52
- * 描 述:教师证书信息
- */
- 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 () {
- $('#TCTypeID').lrDataItemSelect({ code: 'jszgzl' });
- $('#FilePath').lrUploader();
- $('#TCClass').lrDataItemSelect({ code: 'xkfl' });
- $('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' });
- $('#TCName').lrGirdSelect({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
- height: 500,
- width: 400,
- selectWord: 'f_realname',
- value: 'f_realname',
- text: 'f_realname',
- headData:
- [
- { label: "编号", name: "f_encode", width: 100, align: "left" },
- { label: "姓名", name: "f_realname", width: 100, align: "left" },
- {
- label: "部门", name: "f_departmentid", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'id',
- callback: function (_data) {
- callback(_data['name']);
- }
- });
- }
- },
- ],
- select: function (item) {
- ////赋值
- $("#TCNo").val(item.f_encode);
- $("#TCName").val(item.f_realname);
- $("#Department").lrselectSet(item.f_departmentid);
- }
- });
- },
- initData: function () {
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/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]);
- }
- }
- });
- }
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- $("#TCName").val($("#TCNo").find(".lr-select-placeholder").text());
- var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
- };
- $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|