|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-02-21 10:07
- * 描 述:会议管理
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var processId = '';
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- $('#MeetingPlace').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/PersonnelManagement/ConferenceRoom/GetList',
- value: "ID",
- text: "Name"
- });
- $('#CreateUser').lrUserSelect(0);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'addform',
- title: '新增',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/Form',
- width: 1000,
- height: 800,
- callBack: function (id) {
- var res = false;
- // 验证数据
- res = top[id].validForm();
- // 保存数据
- if (res) {
- res = top[id].save('', function () {
- page.search();
- });
- }
- return res;
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
- if (CheckStatus == "1") {
- learun.alert.warning("当前项已审核通过!");
- return false;
- } else if (CheckStatus == "3") {
- learun.alert.warning("当前项审核中!");
- return false;
- }
- learun.layerForm({
- id: 'editform',
- title: '编辑',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/Form?keyValue=' + keyValue,
- width: 1000,
- height: 800,
- callBack: function (id) {
- var res = false;
- // 验证数据
- res = top[id].validForm();
- // 保存数据
- if (res) {
- res = top[id].save('', function () {
- page.search();
- });
- }
- return res;
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
- if (CheckStatus != "0") {
- learun.alert.warning("当前项已审核或审核中!");
- return false;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'viewform',
- title: '查看会议工作',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/FormView?keyValue=' + keyValue,
- width: 1000,
- height: 800,
- btn: null
- });
- }
- });
- //提交
- $('#lr_submit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
- if (CheckStatus == "1") {
- learun.alert.warning("当前项已审核通过!");
- return false;
- } else if (CheckStatus == "3") {
- learun.alert.warning("当前项审核中!");
- return false;
- }
- learun.layerConfirm('是否确认提交该项!', function (res) {
- if (res) {
- processId = learun.newGuid();
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoSubmit', { keyValue: keyValue, status: '3', processId: processId }, function (res) {
- refreshGirdData(res, {});
- });
- }
- });
- }
- });
- // 纪要
- $('#lr_minutes').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'MeetingMinutesIndex',
- title: '会议纪要',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingMinutes/Index?MeetID=' + keyValue,
- width: 1000,
- height: 800,
- btn: null
- });
- }
- });
- // 通知
- $('#lr_notice').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'MeetingNoticeIndex',
- title: '会议通知',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingNotice/Index?MeetID=' + keyValue,
- width: 1000,
- height: 800,
- btn: null
- });
- }
- });
- // 审核通过
- $('#lr_checkyes').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
- if (CheckStatus == '1') {
- learun.alert.warning("该项已审核通过!");
- return false;
- }
- learun.layerConfirm('是否确认审核通过该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '1' }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 审核不通过
- $('#lr_checkno').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
- if (CheckStatus == '2') {
- learun.alert.warning("该项已审核不通过!");
- return false;
- }
- learun.layerConfirm('是否确认审核不通过该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/MeetingManagement/DoCheck', { keyValue: keyValue, status: '2' }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 会议签到情况
- $('#lr_case').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'viewform',
- title: '签到情况',
- url: top.$.rootUrl + '/PersonnelManagement/MeetingSignInRecord/Index?MeetID=' + keyValue,
- width: 1000,
- height: 800,
- btn: null
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/MeetingManagement/GetPageList',
- headData: [
- { label: "会议主题", name: "MeetingTitle", width: 150, align: "left" },
- { label: "会议场地", name: "ConferenceRoomName", width: 100, align: "left" },
- { label: "开始时间", name: "BeginTime", width: 120, align: "left" },
- { label: "结束时间", name: "EndTime", width: 120, align: "left" },
- {
- label: "会议记录者", name: "RecordPerson", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('user', {
- key: value,
- callback: function (_data) {
- callback(_data.name);
- }
- });
- }
- },
- { label: "联系人", name: "Linkman", width: 100, align: "left" },
- { label: "联系电话", name: "LinkPhone", width: 100, align: "left" },
- {
- label: "申请人", name: "CreateUser", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('user', {
- key: value,
- callback: function (_data) {
- callback(_data.name);
- }
- });
- }
- },
- { label: "申请时间", name: "CreateTime", width: 120, align: "left" },
- {
- label: "会议状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) {
- return cellvalue == "1" ? "<span class=\"label label-success\">已通过</span>" : cellvalue == "2" ? "<span class=\"label label-danger\">未通过</span>" : cellvalue == "3" ? "<span class=\"label label-warning\">审核中</span>" : "<span class=\"label label-default\">未审核</span>";
- }
- },
- {
- label: "审核人", name: "CheckUser", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('user', {
- key: value,
- callback: function (_data) {
- //callback(_data.name);
- return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : callback(_data.name);
- }
- });
- }
- },
- {
- label: "审核时间", name: "CheckTime", width: 120, align: "left", formatter: function (value, row) {
- return row.CheckStatus != "1" && row.CheckStatus != "2" ? "" : value;
- }
- },
- ],
- mainId: 'Id',
- isPage: true,
- sidx: 'CreateTime desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.InternalParticipants = learun.clientdata.get(['userinfo']).userId;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function (res, postData) {
- if (res && res.code && res.code == 200) {
- // 发起流程
- var postData = {
- schemeCode: 'MeetingManagementApply',// 填写流程对应模板编号
- processId: processId,
- level: '1',
- };
- learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
- learun.loading(false);
- });
- }
- page.search();
- };
- page.init();
- }
|