|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-06-01 11:49
- * 描 述:收文报告
- */
- 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);
- }, 100, 400);
- $('#WorkName').lrDataItemSelect({ code: 'Dispatch' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- //查阅
- $('#lr_read').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- var reader = $('#gridtable').jfGridValue('Reader');
- if (learun.checkrow(keyValue)) {
- var FlowNo = $('#gridtable').jfGridValue('FlowNo');
- if (FlowNo != 2) {
- learun.alert.warning("当前项目不能查阅!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '查阅',
- url: top.$.rootUrl + '/EducationalAdministration/Dispatch/ReadForm?keyValue=' + keyValue +'&reader='+reader,
- width: 800,
- height: 380,
- callBack: function (id) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Dispatch/Read', { keyValue: keyValue ,reader: reader }, function (res) {
- });
- }
- });
-
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/Dispatch/GetPageList',
- headData: [
- {
- label: "来源",name: "WorkName",width: 300,align: "center",
- formatterAsync: function(callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'Dispatch',
- callback: function(_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "来文单位", name: "DisFrom", width: 300, align: "center" },
- { label: "字", name: "DisWork", width: 100, align: "center" },
- { label: "号", name: "DisMark", width: 100, align: "center" },
- //{ label: "份数", name: "Copies", width: 100, align: "center" },
- { label: "年", name: "DisYear", width: 100, align: "center" },
- { label: "月", name: "DisMonth", width: 100, align: "center" },
- { label: "日", name: "DisDay", width: 100, align: "center" },
- { label: "事由", name: "Reasons", width: 400, align: "center" ,
- formatterAsync: function (callback, value, row, op, $cell) {
- $.ajax({
- url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
- data: { folderId: value },
- type: 'GET',
- dataType: "json",
- async: false,
- cache: false,
- success: function (res) {
- var bb = '';
- $.each(res.data, function (i, item) {
- bb += item.F_FileName.substring(0, item.F_FileName.indexOf("."))
- })
- callback(bb);
- }
- });
- }},
- { label: "传阅人员", name: "Reader", width: 100, align: "center",hidden:true},
- //{ label: "呈送意见", name: "Render", width: 200, align: "center" },
- //{ label: "呈送时间", name: "RenderDate", width: 100, align: "center" },
- //{
-
- {
- label: "审批状态", name: "FlowNo", width: 100, align: "center",
- formatter: function (cellvalue, row) {
- if (cellvalue == 0) {
- return '<span class=\"label label-warning\">草稿</span>';
- } if (cellvalue == 1) {
- return '<span class=\"label label-warning\">审批中</span>';
- } else if (cellvalue == 2) {
- return '<span class=\"label label-success\">审批通过</span>';
- }
- }
- }
- ],
- mainId: 'Id',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.userId = userId;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- },
- downLoad: function (fileId) {
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
- }
- };
- refreshGirdData = function (res, postData) {
- if (res.code == 200) {
- // 发起流程
- var postData = {
- //schemeCode: 'Dispatch',// 本地
- schemeCode: 'DBSW',//线上
- processId: processId,
- level: '1',
- };
- learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
- learun.loading(false);
- });
- page.search();
- }
- };
- page.init();
- }
- function downLoad(fileId, fileTwo) {
- if (fileTwo) {
-
- top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
-
- });
- }
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
- }
|