|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2020-11-06 14:08
- * 描 述:年度考核结果管理
- */
- var refreshGirdData;
- var empId = request('empId');
- var status = false;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.refreshStatus();
- page.initGird();
- page.bind();
- },
- refreshStatus: function () {
- //获取主表状态
- learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + empId, function (res) {
- if (res.code == 200) {
- if (res.data.EmpInfo != null) {
- status = res.data.EmpInfo.YearAssessStatus;
- }
- }
- });
- },
- 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 (status == 'true') {
- learun.alert.warning('已提交,不能再修改!');
- return;
- }
- learun.layerForm({
- id: 'formInPM_YearAssess',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Form?empId=' + empId,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- if (status == 'true') {
- learun.alert.warning('已提交,不能再修改!');
- return;
- }
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formInPM_YearAssess',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Form?keyValue=' + keyValue + '&empId=' + empId,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- if (status == 'true') {
- learun.alert.warning('已提交,不能再修改!');
- return;
- }
- var keyValue = $('#gridtable').jfGridValue('ID');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 提交
- $('#lr_check').on('click', function () {
- if (status == 'true') {
- learun.alert.warning('已提交,不能再修改!');
- return;
- }
- learun.layerConfirm('是否确认提交!', function (res) {
- if (res) {
- learun.postForm( top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Submit', { empId: empId, status: true }, function (info) {
- refreshGirdData();
- });
- }
- });
- });
- // 取消提交
- $('#lr_uncheck').on('click', function () {
- learun.layerConfirm('是否取消提交!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/Submit', { empId: empId, status: false }, function () {
- refreshGirdData();
- });
- }
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/PM_YearAssess/GetPageList',
- headData: [
- { label: "考核时间", name: "AssessTime", width: 100, align: "left" },
- { label: "考核年度", name: "AssessYear", width: 100, align: "left" },
- { label: "考核结果", name: "AssessResult", width: 100, align: "left" },
- { label: "备注", name: "Remark", width: 100, align: "left" },
- { label: "是否同步", name: "IsSync", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
- {
- label: "提交状态", name: "SubmitStatus", 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: 'ID',
- isPage: true,
- sidx:'UpdateTime desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.EmpId = empId;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- page.refreshStatus();
- };
- page.init();
- }
|