|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-08-11 09:51
- * 描 述:新生在线咨询
- */
- var refreshGirdData;
- var selectedRow;
- 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);
- }, 220, 400);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- if (selectedRow.QuestionStatus == 1) {
- learun.alert.warning("当前咨询问题已提交,不能编辑!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- if (selectedRow.QuestionStatus == 1) {
- learun.alert.warning("当前咨询问题已提交,不能删除!");
- return false;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '查看',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/FormView?keyValue=' + keyValue,
- width: 600,
- height: 400,
- btn: null
- });
- }
- });
- // 提交
- $('#lr_sumbit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- if (selectedRow.QuestionStatus == 1) {
- learun.alert.warning("当前咨询问题已提交!");
- return false;
- }
- learun.layerConfirm('是否确认提交该咨询问题!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/SubmitQuestion', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
-
- }
- });
- // 回复信息
- $('#lr_answer').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- if (selectedRow.QuestionStatus != 1) {
- learun.alert.warning("当前咨询问题未提交,无法查看回复!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '回复信息',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/AnswerFormView?keyValue=' + keyValue,
- width: 600,
- height: 400,
- btn: null
- });
- }
- });
- // 常见咨询问题
- $('#lr_questList').on('click', function () {
- learun.layerForm({
- id: 'IndexList',
- title: '常见咨询问题',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/IndexList',
- width: 1000,
- height: 800,
- btn: null
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoFreshOnlineService/GetPageList',
- headData: [
- { label: "咨询编号", name: "QuestionCode", width: 200, align: "left" },
- { label: "咨询主题", name: "QuestionTitle", width: 200, align: "left" },
- {
- label: "提交状态", name: "QuestionStatus", width: 100, align: "left", formatter: function (value) {
- return value == 1 ? "<span class=\"label label-success\">已提交</span>" : "<span class=\"label label-warning\">未提交</span>";
- }
- },
- { label: "提交时间", name: "QuestionSubmitTime", width: 130, align: "left" },
- {
- label: "回复状态", name: "AnswerStatus", width: 100, align: "left", formatter: function (value) {
- return value == 1 ? "<span class=\"label label-success\">已回复</span>" : "<span class=\"label label-warning\">未回复</span>";
- }
- },
- ],
- mainId: 'Id',
- isPage: true,
- sidx: 'QuestionCreateTime',
- sord: 'desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.QuestionUserId = learun.clientdata.get(['userinfo']).userId;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|