|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-04-23 15:50
- * 描 述:教师问卷管理
- */
- var refreshGirdData;
- var ATId;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.inittree();
- 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_add').on('click', function () {
- if (!ATId) {
- learun.alert.warning('请选择分类!');
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?ATId=' + ATId,
- width: 780,
- height: 560,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status === true || Status == 'true') {
- learun.alert.warning("当前项目已审核不能修改!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/Form?keyValue=' + keyValue,
- width: 780,
- height: 560,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status === true || Status == 'true') {
- learun.alert.warning("当前项目已审核不能删除!");
- return;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 管理问题
- $('#lr_question').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status === true || Status == 'true') {
- learun.alert.warning("当前项目已审核不能修改!");
- return;
- }
- learun.layerForm({
- id: 'formquestion',
- title: '管理问题',
- url: top.$.rootUrl + '/Ask/Ask_Question/Index?VID=' + keyValue,
- width: 980,
- height: 760,
- btn:null
- });
- }
- });
- // 答题情况
- $('#lr_answer').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formanswer',
- title: '答题情况',
- url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/AnswerIndex?VID=' + keyValue,
- width: 980,
- height: 760,
- btn:null
- });
- }
- });
- // 审核
- $('#lr_submit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status === true || Status == 'true') {
- learun.alert.warning("当前项目已审核!");
- return;
- }
- learun.layerConfirm('是否确认审核该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/SubmitForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 去审核
- $('#lr_unsubmit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('VID');
- if (learun.checkrow(keyValue)) {
- var Status = $('#gridtable').jfGridValue('Status');
- if (Status !== true && Status !== 'true') {
- learun.alert.warning("当前项目已去审核!");
- return;
- }
- learun.layerConfirm('是否确认去审核该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/UnSubmitForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- inittree: function () {
- $('#companyTree').lrtree({
- url: top.$.rootUrl + '/Ask/Ask_Type/GetAllTree',
- nodeClick: page.treeNodeClick
- });
- },
- treeNodeClick: function (item) {
- ATId = item.id;
- $('#titleinfo').text(item.text);
- page.search();
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/Ask/Ask_MainOfTeacher/GetPageList',
- headData: [
- { label: "问卷编号", name: "VSerial", width: 180, align: "left" },
- { label: "标题", name: "VTitle", width: 200, align: "left" },
- {
- label: "类别", name: "ATId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ask_Type',
- key: value,
- keyId: 'atid',
- callback: function (_data) {
- callback(_data['atname']);
- }
- });
- }
- },
- { label: "开始时间", name: "VStartTime", width: 100, align: "left" },
- { label: "结束时间", name: "VStopTime", width: 100, align: "left" },
- { label: "考核部门", name: "DepartmentIdsName", width: 150, align: "left" },
- { label: "考核人数", name: "SPVNum", width: 80, align: "left" },
- { label: "填写人数", name: "SPNum", width: 80, align: "left" },
- { label: "点击热度", name: "SClick", width: 80, align: "left" },
- { label: "排序", name: "VOrder", width: 80, align: "left" },
- {
- label: "是否匿名", name: "VHide", width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- {
- label: "审核标志", name: "Status", width: 100, align: "left", formatter: function (cellvalue) {
- return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- }
- ],
- mainId: 'VID',
- isPage: true,
- sidx:'VOrder'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.ATId = ATId;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|