MarketViolationsList.cshtml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>MarketViolationsList</title>
  10. <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
  11. <link rel="stylesheet" type="text/css" href="~/easyui/themes/icon.css" />
  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. <script src="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.js"></script>
  23. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  24. <script src="~/Content/js/js/MarketJs.js"></script>
  25. </head>
  26. <body >
  27. <section class="hidden">
  28. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  29. </section>
  30. <section style="height:95vh; padding: 10px 20px;">
  31. <div class="row tbToolBar" id="tbToolBar">
  32. <div class="toolbar" id="CurdTool">
  33. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  34. <span class="shuxian"></span>
  35. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  36. <span class="shuxian"></span>
  37. <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
  38. </div>
  39. <div class="toolbar-search">
  40. <span>【请选择查询条件】</span>
  41. <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
  42. <div id="search">
  43. <div data-options="name:'MarketName'">市场名称</div>
  44. <div data-options="name:'Checher'">检查人</div>
  45. </div>
  46. </div>
  47. </div>
  48. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  49. data-options="singleSelect: true,
  50. method: 'post',
  51. multiSort: false,
  52. toolbar: '#tbToolBar',
  53. fitColumns: true,
  54. @*rownumbers: true,*@
  55. remoteSort: false,
  56. @*loadFilter: pagerFilter,*@
  57. onDblClickRow: function () {
  58. btn_Edit();
  59. },
  60. pagination: true,
  61. pageSize: 50,
  62. pageList: [20, 50, 100]
  63. ">
  64. <thead>
  65. <tr>
  66. <th data-options="field:'MarketName',width:150">市场名称</th>
  67. <th data-options="field:'LogType',width:120">违规行为</th>
  68. <th data-options="field:'Result',width:50">处理记录</th>
  69. <th data-options="field:'LogDate',width:80">记录日期</th>
  70. <th data-options="field:'Checher',width:80">检查人</th>
  71. <th data-options="field:'IsRead',width:80">是否阅读</th>
  72. </tr>
  73. </thead>
  74. </table>
  75. </section>
  76. <section>
  77. <div id="winModal" class="easyui-window winModal" title="市场违规行为录入维护" style="width: 450px;padding:10px;"
  78. iconCls="icon-save" data-options="modal:true,closed:true">
  79. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  80. <div data-options="region:'center'" style="padding:15px 25px 0;" >
  81. <form id="form">
  82. @Html.Hidden("ViolationsNo")
  83. <div class="panle-fluid">
  84. <div class="input-group">
  85. <label class="input-group-addon control-label" for="MarketID">市场名称</label>
  86. <select class="form-control input-group-addon" aria-disabled="true" name="MarketID" id="MarketID" type="text" value="" placeholder="选择市场">
  87. @Html.Raw(ViewBag.SelMarketInfo)
  88. </select>
  89. </div>
  90. <div class="input-group">
  91. <label class="input-group-addon control-label" for="LogType">违规行为</label>
  92. <select class="form-control input-group-addon" aria-disabled="true" name="LogType" id="LogType" type="text" value="" placeholder="选择行为内容">
  93. @Html.Raw(ViewBag.SelLogTypeInfo)
  94. </select>
  95. </div>
  96. <div class="input-group">
  97. <label class="input-group-addon control-label" for="LogDate">记录日期</label>
  98. <input class="form-control input-group-addon laydate-icon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder="" />
  99. </div>
  100. <div class="input-group">
  101. <label class="input-group-addon control-label" for="LogContent">行为内容</label>
  102. <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="LogContent" id="LogContent" type="text" value="" placeholder=""></textarea>
  103. </div>
  104. <div class="input-group">
  105. <label class="input-group-addon control-label" for="Result">处理记录</label>
  106. <select class="form-control input-group-addon" aria-disabled="true" name="Result" id="Result" type="text" value="" placeholder="选择处理记录">
  107. @Html.Raw(ViewBag.SelResultInfo)
  108. </select>
  109. </div>
  110. <div class="input-group">
  111. <label class="input-group-addon control-label" for="Checher">检查人</label>
  112. <input class="form-control input-group-addon" aria-disabled="true" name="Checher" id="Checher" type="text" value="" placeholder=""/>
  113. </div>
  114. <div class="input-group">
  115. <label class="input-group-addon control-label" for="FileTitle">附件名称</label>
  116. <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder="" />
  117. </div>
  118. <div class="input-group">
  119. <label class="input-group-addon control-label" for="AttachFile">上传附件</label>
  120. <input class="form-control input-group-addon" aria-disabled="true" name="AttachFile" id="AttachFile" type="file" value="" placeholder="" onblur="CheckFileSize('AttachFile')" />
  121. </div>
  122. </div>
  123. </form>
  124. </div>
  125. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding: 13px 20px 0;">
  126. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>
  127. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  128. </div>
  129. </div>
  130. </div>
  131. </section>
  132. <script>
  133. function Save(type) {
  134. type = type || $("#hid_Type").val();
  135. //var violationsNo = (type === "Add" || type === "Edit") ? $("#ViolationsNo").val() : $('#dgTable').datagrid('getSelections')[0].ID;
  136. $.ajaxFileUpload({
  137. url: "@Url.Action("MarketViolationsOper", "MarketSystem")",
  138. secureuri: false, //一般设置为false
  139. fileElementId: 'AttachFile',
  140. type: "post",
  141. dataType: "json",
  142. data: {
  143. Type: type,
  144. UploadFile: "true",
  145. ViolationsNo: $("#ViolationsNo").val(),
  146. LogType: $("#LogType").find("option:selected").text(),
  147. Result: $("#Result").find("option:selected").text(),
  148. MarketID: $("#MarketID").val(),
  149. LogContent: $("#LogContent").val(),
  150. Checher: $("#Checher").val(),
  151. LogDate: $("#LogDate").val(),
  152. FileTitle: $("#FileTitle").val()
  153. },
  154. success: function (data) {
  155. if (CheckAajxData(data) === false) return;
  156. var msg = data.ErrorInfo;
  157. if (data.Success === true) {
  158. LoadTable();
  159. $("#winModal").window("close");
  160. layer.alert(msg, { icon: 1, title: '提示信息' });
  161. } else {
  162. layer.alert(msg, { icon: 7, title: '提示信息' });
  163. }
  164. }
  165. });
  166. }
  167. //添加
  168. function btn_Add() {
  169. $("#hid_Type").val("Add");
  170. $("#winModal input").val("");
  171. $("#winModal textarea").val("");
  172. $("#Save span.l-btn-text").html("添加");
  173. //GetMarketSelStr();
  174. ClearFile("#AttachFile");
  175. $("#winModal").window("open");
  176. }
  177. //修改
  178. function btn_Edit() {
  179. $("#hid_Type").val("Edit");
  180. $("#Save span.l-btn-text").html("修改");
  181. SetModalVal();
  182. }
  183. //modal赋值
  184. function SetModalVal() {
  185. var rows = $('#dgTable').datagrid('getSelections');
  186. if (rows.length === 1) {
  187. var row = rows[0];
  188. console.log(row);
  189. //GetMarketSelStr();
  190. $("#ViolationsNo").val(row.ViolationsNo);
  191. SelectByText("#LogType", row.LogType);
  192. SelectByText("#Result", row.Result);
  193. $("#MarketID").val(row.MarketID);
  194. $("#LogContent").val(row.LogContent);
  195. $("#Checher").val(row.Checher);
  196. $("#LogDate").val(row.LogDate);
  197. $("#FileTitle").val("");
  198. ClearFile("#AttachFile");
  199. if ($("#hid_Type").val()==="Edit") {
  200. $("#winModal").window("open");
  201. }
  202. } else {
  203. layer.alert('请选择一条记录进行设置', {title:'提示信息'});
  204. }
  205. }
  206. //加载表格数据
  207. function LoadTable(value, item) {
  208. $('#dgTable').datagrid({
  209. url: '@Url.Action("MarketViolationsListResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
  210. });
  211. }
  212. $(function () {
  213. //加载表格数据
  214. var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
  215. LoadTable(value, item);
  216. //加载日历控件
  217. laydate({
  218. elem: '#LogDate',
  219. format: "YYYY-MM-DD",
  220. min: "1980-01-01",
  221. event: "focus"
  222. });
  223. });
  224. </script>
  225. </body>
  226. </html>