12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- function WorktimeRate_Add() {
- var d = validChoose();
- var windowDiv;
- if (d.length == 0) {
- windowDiv = $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?MNU=' + mnu, 600, 210);
- } else {
- windowDiv = $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?SourceID=' + d[0] + '&MNU=' + mnu, 600, 210);
- }
- windowDiv.panel({
- onBeforeClose: function () {
- //windowDiv.dialog("close");
- reload();
- }
- });
- }
- function WorktimeRate_Update() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的工作量系数。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行修改。");
- return;
- }
- $.popupTopWindow('工作量系数', CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Edit?MNU=' + mnu + "&WorktimeRateID=" + d[0], 600, 210);
- }
- //删除
- function WorktimeRate_Delete() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要删除的工作量系数。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除该工作量系数?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/WorktimeRate/Delete', { worktimeRateIDs: d.join(',') }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgWorktimeRateList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- function reload() {
- $("#dgWorktimeRateList").cmsXDataTable("load", $.getDataGridParams("dgWorktimeRateList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgWorktimeRateList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.WorktimeRateID);
- });
- return d;
- }
|