|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2018 上海力软信息技术有限公司
- * 创建人:超级管理员
- * 日 期:2019-09-24 15:37
- * 描 述:质量目标管理计划
- */
- var refreshGirdData;
- var isUser = request('isUser');
- 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);
- //学年
- $('#MPAcademicYearNo').lrselect({
- placeholder: "请选择学年",
- allowSearch: true,
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
- value: 'value',
- text: 'text'
- });
- //学期
- $('#MPSemester').lrselect({
- placeholder: "请选择学期",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterDataTwo',
- value: 'value',
- text: 'text'
- });
- $('#MPMonth').lrDataItemSelect({ code: 'MPMonth' });
- $('#MPDepartment').lrselect({
- type: 'tree',
- // 展开最大高度
- maxHeight: 200,
- // 是否允许搜索
- allowSearch: true,
- // 访问数据接口地址
- url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
- select: function (val) {
- console.log(val);
- var departmentIds = val.id;
- $('#MPReceiveUser').lrselectRefresh({
- url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentIds?departmentId=' + departmentIds
- })
- }
- });
-
- $('#MPReceiveUser').lrselect({ type: 'default', allowSearch: true, value: 'F_UserId', text: 'F_RealName' })
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 查看提交材料
- $('#lr_uploadView').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerFormForPercent({
- id: 'form',
- title: '提交材料',
- url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/IndexChildren?ParentId=' + keyValue,
- width: '80%',
- height: '80%',
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
-
- //访问情况统计
- $("#lr_statistics").on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerFormForPercent({
- id: 'form',
- title: '访问情况统计',
- url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/Index?keyValue=' + keyValue,
- width: '70%',
- height: '70%',
- btn: null
- });
- }
- });
-
- // 合格
- $('#lr_qualified').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认合格!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: true }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 不合格
- $('#lr_noqualified').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认不合格!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: false }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/GetPageList',
- headData: [
- { label: "学年", name: "MPAcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "MPSemester", width: 100, align: "left" },
- {
- label: "月份", name: "MPMonth", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'MPMonth',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "部门", name: "MPDepartment", width: 250, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
- console.log(res);
- if (res.code == learun.httpCode.success) {
- callback(res.data);
- }
- });
- }
- },
- {
- label: "接收人", name: "MPReceiveUser", width: 250, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
- if (res.code == learun.httpCode.success) {
- callback(res.data);
- }
- });
- }
- },
- { label: "材料名称", name: "MPProjectName", width: 100, align: "left" },
- {
- label: "上传文件",
- name: "MPFileTwo",
- width: 200,
- align: "left",
- 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 += '<span onclick="downLoad(\'' +
- item.F_Id +
- '\',)" style="color:blue">' +
- item.F_FileName +
- '</span>, ';
- })
- callback(bb);
- }
- });
- }
- },
- {
- label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
-
- if (val === 1) {
- return "合格";
- } else if (val === 0) {
- return "不合格";
- } else {
- return "";
- }
- }
- },
- ],
- mainId: 'ID',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- if (isUser) {
- param.isUser = 'true';
- }
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- 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' });
- }
|