123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/DictionaryItem/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgDictionaryItemList").cmsXDataTable("load", $.getDataGridParams("dgDictionaryItemList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgDictionaryItemList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.DictionaryItemID);
- });
- return d;
- }
- //新增
- function DictionaryItem_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('数据字典复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/DictionaryItem/CopyAdd?dictionaryItemID=' + d[0] + '&isCodeAdd=1&MNU=' + mnu, 650, 245, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('数据字典新增', redirectTo, 650, 245, null, null);
- }
- }
- //修改
- function DictionaryItem_Update() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?dictionaryItemID=" + d + "&MNU=" + mnu;
- $.popupTopWindow('数据字典修改', redirectTo, 650, 245, null, null);
- }
- //删除
- function DictionaryItem_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/DictionaryItem/Delete', { dictionaryItemIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgDictionaryItemList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //查看明细
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?dictionaryItemID=" + rowdata.DictionaryItemID + "&MNU=" + mnu + "&Type=1";
- $.popupTopWindow('数据字典信息', redirectTo, 650, 245, null, null);
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //Excel导出
- function DictionaryItem_Export() {
- $("#formQuery").submit();
- }
|