12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /// <reference path="../../easyui/jquery.easyui.min.js" />
- function initAddStatus() {
- $("#hid_UserType").val("add");
- $('#txtTableName').textbox("setValue","");
- $('#txtColName').textbox("setValue","");
- $("#txtCodeValue").textbox("setValue","");
- $("#txtDisplayValue").textbox("setValue","");
- $('#winSetSysStatusInfo').window('open');
- }
- function myformatter(date) {
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- var d = date.getDate();
- return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
- }
- function initEditStatus(row) {
- $("#hid_UserType").val("modify");
- $("#txtTableName").val(row.TableName);
- $("#txtColName").val(row.ColName);
- $("#txtCodeValue").val(row.CodeValue);
- $("#txtDisplayValue").val(row.DisplayValue);
- $('#winSetSysStatusInfo').window('open');
- }
- function submit() {
- if (!$('#txtTableName').val().trim()) {
- $.messager.alert('提醒', '表名不能为空', 'error');
- return;
- }
- if (!$('#txtColName').val().trim()) {
- $.messager.alert('提醒', '列名不能为空', 'error');
- return;
- }
- if (!$('#txtCodeValue').val().trim()) {
- $.messager.alert('提醒', '码值不能为空', 'error');
- return;
- }
- if (!$('#txtDisplayValue').val().trim()) {
- $.messager.alert('提醒', '显示值不能为空', 'error');
- return;
- }
- var SysStatusID;
- if($("#hid_UserType").val()=="modify"){
- var rows = $('#dg').datagrid('getSelections');
- if (rows.length == 1) {
- var row = rows[0];
- SysStatusID = row.SysStatusID;
- }
- }
- $.post("../SystemModuleAjax/SysStatusEditAjax.aspx", { SysStatusID:SysStatusID,TableName:$('#txtTableName').val().trim(), type: $('#hid_UserType').val(), ColName: $('#txtColName').val(),
- CodeValue: $('#txtCodeValue').val(), DisplayValue: $('#txtDisplayValue').val()
- }, function (msg) {
- if (msg == "true") {
- $.messager.alert('提示', '操作成功!');
- f_submit();
- $('#winSetSysStatusInfo').window('close');
- } else {
- $.messager.alert('提示', msg, 'error');
- }
- })
- }
|