|
|
@@ -0,0 +1,241 @@ |
|
|
|
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) |
|
|
|
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 |
|
|
|
* 创建人:超级管理员 |
|
|
|
* 日 期:2021-06-21 18:39 |
|
|
|
* 描 述:质量目标管理体系指标模块 |
|
|
|
*/ |
|
|
|
var refreshGirdData; |
|
|
|
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); |
|
|
|
$('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); |
|
|
|
$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', 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 + '/EducationalAdministration/FillinFrom/Form', |
|
|
|
width: 500, |
|
|
|
height: 400, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 编辑 |
|
|
|
$('#lr_edit').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var State = $('#gridtable').jfGridValue('State'); |
|
|
|
if (State !== 0) { |
|
|
|
learun.alert.warning("当前项目已提交不能修改!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
learun.layerForm({ |
|
|
|
id: 'form', |
|
|
|
title: '编辑', |
|
|
|
url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/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'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var State = $('#gridtable').jfGridValue('State'); |
|
|
|
if (State !== 0) { |
|
|
|
learun.alert.warning("当前项目已提交不能删除!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认删除该项!', function (res) { |
|
|
|
if (res) { |
|
|
|
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/DeleteForm', { keyValue: keyValue }, function () { |
|
|
|
refreshGirdData(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
//撤回 |
|
|
|
$('#lr_cancel').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var RStatus = $('#gridtable').jfGridValue('State'); |
|
|
|
if (RStatus == 1) { |
|
|
|
learun.alert.warning("已提交!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认提交该项!', function (res) { |
|
|
|
if (res) { |
|
|
|
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { |
|
|
|
refreshGirdData(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
//设置公式 |
|
|
|
$('#lr_formula').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var RStatus = $('#gridtable').jfGridValue('State'); |
|
|
|
if (RStatus == 1) { |
|
|
|
learun.alert.warning("已提交!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认提交该项!', function (res) { |
|
|
|
if (res) { |
|
|
|
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { |
|
|
|
refreshGirdData(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
//设置填报人 |
|
|
|
$('#lr_people').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var RStatus = $('#gridtable').jfGridValue('State'); |
|
|
|
if (RStatus !== 1) { |
|
|
|
learun.alert.warning("当前项不能设置填报人!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
learun.layerForm({ |
|
|
|
id: 'form', |
|
|
|
title: '设置填报人', |
|
|
|
url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/FormPeople?keyValue=' + keyValue, |
|
|
|
width: 600, |
|
|
|
height: 400, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
//隐藏撤下 |
|
|
|
$('#lr_hide').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
var RStatus = $('#gridtable').jfGridValue('State'); |
|
|
|
if (RStatus == 1) { |
|
|
|
learun.alert.warning("已提交!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认提交该项!', function (res) { |
|
|
|
if (res) { |
|
|
|
learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { |
|
|
|
refreshGirdData(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 初始化列表 |
|
|
|
initGird: function () { |
|
|
|
$('#gridtable').lrAuthorizeJfGrid({ |
|
|
|
url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetPageList', |
|
|
|
headData: [ |
|
|
|
{ label: "核心工作模块", name: "WorderModule", width: 300, align: "center" }, |
|
|
|
{ label: "序号", name: "SerialNo", width: 100, align: "center" }, |
|
|
|
{ label: "项目名称", name: "ProjectName", width: 300, align: "center" }, |
|
|
|
{ |
|
|
|
label: "填报周期", name: "FillingCycle", width: 100, align: "center", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'ThisCycle', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "填报时间", name: "FillingTime", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'CycleTime', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "填报部门", name: "FillingDept", width: 100, align: "center", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', |
|
|
|
key: value, |
|
|
|
keyId: 'id', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['name']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "填报人", name: "FillingPeople", width: 150, align: "center", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', |
|
|
|
key: value, |
|
|
|
keyId: 'f_userid', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['f_realname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "状态", name: "State", width: 150, align: "center", |
|
|
|
formatter: function (cellvalue) { |
|
|
|
if (cellvalue === 0) { |
|
|
|
return '<span class=\"label label-warning\">草稿</span>'; |
|
|
|
} else if (cellvalue === 1) { |
|
|
|
return '<span class=\"label label-success\">待设置填报人</span>'; |
|
|
|
} else if (cellvalue === 2) { |
|
|
|
return '<span class=\"label label-success\">待设置公式</span>'; |
|
|
|
} else { |
|
|
|
return '<span class=\"label label-default\">已完成</span>'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "备注", name: "Demo", width: 300, align: "center" }, |
|
|
|
], |
|
|
|
mainId: 'Id', |
|
|
|
isPage: true |
|
|
|
}); |
|
|
|
page.search(); |
|
|
|
}, |
|
|
|
search: function (param) { |
|
|
|
param = param || {}; |
|
|
|
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); |
|
|
|
} |
|
|
|
}; |
|
|
|
refreshGirdData = function () { |
|
|
|
$('#gridtable').jfGridSet('reload'); |
|
|
|
}; |
|
|
|
page.init(); |
|
|
|
} |