GSSystem.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>StandardList</title>
  10. <link href="~/easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
  11. <link href="~/easyui/themes/icon.css" rel="stylesheet" />
  12. <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
  13. <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
  14. <script src="~/Content/js/jquery.min.js"></script>
  15. <script src="~/Content/js/bootstrap.min.js"></script>
  16. <script src="~/easyui/jquery.easyui.min.js"></script>
  17. <script src="~/easyui/jquery.easyui.mobile.js"></script>
  18. <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
  19. <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
  20. <script src="~/Content/js/plugins/layer/layer.min.js"></script>
  21. <script src="~/js/Utils.js"></script>
  22. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  23. <style>
  24. .td_1 {
  25. padding-bottom: 5px;
  26. padding-left: 5px;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <section class="hidden">
  32. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  33. <input id="hid_IsLock" name="IsLock" type="hidden" value="N" />
  34. <input id="hid_MarketType" name="hid_MarketType" type="hidden" value="0" />
  35. </section>
  36. @*<section class="text-center title">
  37. <h2>市场信息</h2>
  38. </section>*@
  39. <section class="container-fluid" style="height: 100vh; padding-top: 20px;">
  40. <div class="row tbToolBar" id="tbToolBar">
  41. <div class="toolbar">
  42. <label>
  43. <input type="checkbox" id="DataToggle"> 显示已删除记录
  44. </label>
  45. </div>
  46. <div class="toolbar" id="CurdTool" style="float:left">
  47. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  48. <span class="shuxian"></span>
  49. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  50. <span class="shuxian"></span>
  51. <a href="#" class="easyui-linkbutton" iconCls="icon-no" plain="true" onclick="DelOrRetore('Del')">删除</a>
  52. @*<input class="btn btn-primary" id="btn_back" type="button" value="返回" onclick="btn_Back()"/>*@
  53. </div>
  54. <div class="col-sm-3" id="ResetTool">
  55. <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="DelOrRetore('ReDel')">恢复删除</a>
  56. </div>
  57. @*<div class="col-sm-2 pull-right">
  58. <input class="btn btn-primary" id="btn_search" type="button" value="通用搜索" data-toggle="modal" data-target="#search_modal" />
  59. </div>*@
  60. </div>
  61. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  62. data-options="singleSelect: true,
  63. method: 'post',
  64. multiSort: false,
  65. toolbar: '#tbToolBar',
  66. fitColumns: true,
  67. rownumbers: true,
  68. remoteSort: false,
  69. loadFilter: pagerFilter,
  70. pagination: true,
  71. pageSize: 15,
  72. pageList: [15, 25, 50, 100]
  73. ">
  74. <thead>
  75. <tr>
  76. @*hid_IsLock<th data-options="field:'TradeTypeID'" class="hidden">行业类型</th>*@
  77. <th data-options="field:'SystemID',width:50">系统编号</th>
  78. <th data-options="field:'SystemName',width:50">系统名称</th>
  79. <th data-options="field:'shortName',width:80,">短名</th>
  80. <th data-options="field:'SysLongName',width:50,">系统长名称</th>
  81. <th data-options="field:'Description',width:50,">系统描述</th>
  82. </tr>
  83. </thead>
  84. </table>
  85. </section>
  86. <section>
  87. <div id="winGSSystemInfo" class="easyui-window" title="系统类型信息维护" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px;height:350px;padding:10px 10px;">
  88. <div class="easyui-layout" data-options="fit:true">
  89. <div data-options="region:'center'" style="padding:5px;height:250px">
  90. <table cellpadding="10" cellspacing="0" style="margin-left:10px">
  91. <tr>
  92. <td class="td_1">系统编号:</td>
  93. <td class="td_1"><input class="easyui-textbox" type="text" id="SystemID" name="SystemID" data-options="required:true" style="width:400px" /></td>
  94. </tr>
  95. <tr>
  96. <td class="td_1">系统名称:</td>
  97. <td class="td_1"><input class="easyui-textbox" type="text" id="SystemName" name="SystemName" data-options="required:true" style="width:400px" /></td>
  98. </tr>
  99. <tr>
  100. <td class="td_1">短名:</td>
  101. <td class="td_1">
  102. <input class="easyui-textbox" type="text" id="shortName" name="shortName" data-options="required:true" style="width:400px" />
  103. </td>
  104. </tr>
  105. <tr>
  106. <td class="td_1">系统长名称:</td>
  107. <td class="td_1">
  108. <input class="easyui-textbox" type="text" id="SysLongName" name="SysLongName" data-options="required:true" style="width:400px" />
  109. </td>
  110. </tr>
  111. <tr>
  112. <td class="td_1">系统描述:</td>
  113. <td class="td_1">
  114. <textarea id="Description" rows="4" style="width:400px"></textarea>
  115. </td>
  116. </tr>
  117. </table>
  118. </div>
  119. <div data-options="region:'south',border:false" style="text-align:right;height:50px;padding-top:5px">
  120. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save();" style="width:80px">确认</a>
  121. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winGSSystemInfo').window('close');" style="width:80px">取消</a>
  122. </div>
  123. </div>
  124. </div>
  125. </section>
  126. <script>
  127. //切换显示不同状态数据
  128. $("#DataToggle").on("click",
  129. function () {
  130. if ($('#hid_IsLock').val() === "N") {
  131. $('#hid_IsLock').val("Y");
  132. $("#CurdTool").hide();
  133. $("#ResetTool").show();
  134. } else {
  135. $('#hid_IsLock').val("N");
  136. $("#ResetTool").hide();
  137. $("#CurdTool").show();
  138. }
  139. window.LoadTable();
  140. });
  141. //添加
  142. function btn_Add() {
  143. $("#hid_Type").val("Add");
  144. $('#SystemID').textbox('enable');
  145. $('#SystemID').textbox('setValue', '');
  146. $('#SystemName').textbox('setValue','');
  147. $('#shortName').textbox('setValue', '');
  148. $('#SysLongName').textbox('setValue', '');
  149. $('#Description').val('');
  150. $("#winGSSystemInfo").window("open");
  151. }
  152. //修改
  153. function btn_Edit() {
  154. $("#hid_Type").val("Edit");
  155. var row = $('#dgTable').datagrid('getSelected');
  156. if (row) {
  157. $("#SystemID").textbox('disable');
  158. $("#SystemID").textbox('setValue', row.SystemID);
  159. $("#SystemName").textbox('setValue', row.SystemName);
  160. $("#shortName").textbox('setValue', row.shortName);
  161. $("#SysLongName").textbox('setValue', row.SysLongName);
  162. $("#Description").val(row.Description);
  163. $("#winGSSystemInfo").window("open");
  164. } else {
  165. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  166. }
  167. }
  168. function DelOrRetore(type) {
  169. var SystemID = $('#dgTable').datagrid('getSelections')[0].SystemID;
  170. if (!SystemID) {
  171. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  172. return;
  173. }
  174. if (type == 'Del' || type === "ReDel" ) {
  175. $.messager.confirm('删除或恢复', '确定删除或恢复这条记录?', function (r) {
  176. if (r) {
  177. $.ajax({
  178. url: "@Url.Action("GSSystemListOper", "BaseInfo")",
  179. type: "post",
  180. data: {
  181. Type: type,
  182. SystemID: SystemID
  183. },
  184. success: function (data) {
  185. if (CheckAajxData(data) == false) {
  186. return;
  187. }
  188. var msg = JSON.parse(data);
  189. if (msg != null && msg.Success == true) {
  190. LoadTable();
  191. layer.alert("操作成功!", { title: '提示信息' });
  192. } else {
  193. layer.alert(msg.ErrorInfo, { title: '提示信息' });
  194. }
  195. }
  196. });
  197. }
  198. })
  199. }
  200. }
  201. //提交
  202. function Save(type) {
  203. type = type || $("#hid_Type").val();
  204. var SystemID = (type === "Edit" || type === "Del" || type === "ReDel") ? $('#dgTable').datagrid('getSelections')[0].SystemID : $("#SystemID").textbox('getValue');
  205. $.ajax({
  206. url: "@Url.Action("GSSystemListOper", "BaseInfo")",
  207. type: "post",
  208. data: {
  209. Type: type,
  210. SystemID: SystemID,
  211. SystemName: $("#SystemName").textbox('getValue'),
  212. shortName: $("#shortName").textbox('getValue'),
  213. SysLongName: $("#SysLongName").textbox('getValue'),
  214. Description: $("#Description").val()
  215. },
  216. success: function (data) {
  217. if (CheckAajxData(data) == false) {
  218. return;
  219. }
  220. var msg = JSON.parse(data);
  221. if (msg != null && msg.Success == true) {
  222. LoadTable();
  223. $('#winGSSystemInfo').window('close');
  224. layer.alert("操作成功!", { title: '提示信息' });
  225. } else {
  226. layer.alert(data.ErrorInfo, { title: '提示信息' });
  227. }
  228. }
  229. });
  230. }
  231. //modal赋值
  232. function SetModalVal() {
  233. var rows = $('#dgTable').datagrid('getSelections');
  234. if (rows.length === 1) {
  235. var row = rows[0];
  236. //console.log(row);
  237. $("#SystemID").val(row.SystemID),
  238. $("#SystemName").val(row.SystemName),
  239. $("#shortName").val(row.shortName),
  240. $("#SysLongName").val(row.SysLongName),
  241. $("#Description").val(row.Description),
  242. $("#SystemType").val(row.SystemType),
  243. $("#modal").modal("show");
  244. } else {
  245. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  246. }
  247. }
  248. //加载表格数据
  249. function LoadTable() {
  250. $('#dgTable').datagrid({
  251. url: '@Url.Action("GetGSSystemList", "BaseInfo")' + '?IsLock=' + $('#hid_IsLock').val(),
  252. onDblClickRow: function () {
  253. if ($('#hid_IsLock').val() === "N") {
  254. btn_Edit();
  255. }
  256. },
  257. });
  258. }
  259. $(function () {
  260. //加载表格数据
  261. window.LoadTable();
  262. //加载日历控件
  263. //laydate({
  264. // elem: '#PractiseTime',
  265. // format: "YYYY-MM-DD",
  266. // min: "1980-01-01",
  267. // event: "focus"
  268. //});
  269. });
  270. </script>
  271. </body>
  272. </html>