/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-06-21 18:39 * 描 述:质量目标管理体系指标模块 */ 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 () { $('#Formula').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); //$('#Formula').lrGirdSelect({ // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain', // selectWord: 'name', // value: 'id', // text: 'name', // headData: // [ // { label: "公式", name: "result", width: 300, align: "left" }, // { label: "公式名称", name: "name", width: 300, align: "left" } // ], // select: function (item) { // } //}); $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name', select: function (item) { var DeptCode = $('#FillingDept').lrselectGet(); if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { $('#FillingPeople').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata', value: 'f_userid', text: 'f_realname', param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }, maxHeight: 200, }); } } }); $("#FillingPeople").lrselect(); //设置周期 $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle', select: function (item) { var Cycles = $("#FillingCycle").lrselectGet(); if (Cycles == 3) { $('#TimeHide').show(); $('#FillingTime1').show(); $('#FillingTime2').hide(); $('#FillingTime1').lrDataItemSelect({ code: 'CycleTime' }); } else if (Cycles == 2) { $('#TimeHide').show(); $('#FillingTime1').hide(); $('#FillingTime2').show(); } else if (Cycles == 1) { $('#TimeHide').hide(); //$('#FillingTime1').hide(); //$('#FillingTime2').hide(); } } }); $('#FillingTime1').lrselect(); $('#FillingTime2').lrDataItemSelect({ type: 'multiple', code: 'CycleTime' }); $('#FillingTime2').hide(); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/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]); } } }); } $('#State').val('0'); $('#IsFlag').val('0'); } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }