CleansingCheckLogQry.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>CleansingCheckLogQry</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. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  23. <script src="~/Content/js/js/MarketJs.js"></script>
  24. </head>
  25. <body>
  26. <section class="hidden">
  27. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  28. </section>
  29. <section style="height:95vh; padding: 10px 20px;">
  30. <div class="row tbToolBar" id="tbToolBar">
  31. <div class="toolbar">
  32. <a href="#" class="easyui-linkbutton" iconCls="icon-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  33. </div>
  34. <div class="toolbar-search">
  35. <div id="Search" class="easyui-panel" title="请展开面板输入查询条件" style="width: 300px; height: 330px; padding: 10px;"
  36. data-options="iconCls:'icon-heart',collapsible:true,minimizable:false,maximizable:false,closable:false,collapsed:true,tools:[
  37. {
  38. iconCls:'icon-search',
  39. handler:function(){LoadTable(true)}
  40. }]">
  41. <table>
  42. <tr>
  43. <td><label for="SearchRegionID">辖区工商</label></td>
  44. <td>
  45. <select class="easyui-combobox" type="text" id="SearchRegionID" name="SearchRegionID" style="height: 25px; width: 150px" data-options="onSelect:function(){GetMarketSelStr()}">
  46. <option value="">全部</option>
  47. @Html.Raw(ViewBag.SelRegionInfo)
  48. </select>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td><label for="SearchMarketID">隶属市场</label></td>
  53. <td>
  54. <select class="easyui-combobox" type="text" id="SearchMarketID" name="SearchMarketID" style="height: 25px; width: 150px" data-options="">
  55. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  56. </select>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td><label for="SearchExecutor">检查员</label></td>
  61. <td>
  62. <input class="easyui-textbox" type="text" id="SearchExecutor" name="SearchExecutor" style="height: 25px; width: 150px" data-options="" />
  63. </td>
  64. </tr>
  65. <tr>
  66. <td><label for="SearchAssessLevelID">检查结果</label></td>
  67. <td>
  68. <select class="easyui-combobox" type="text" id="SearchAssessLevelID" name="SearchAssessLevelID" style="height: 25px; width: 150px" data-options="">
  69. <option value="">全部结果</option>
  70. @Html.Raw(ViewBag.SelAssessLevelInfo)
  71. </select>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td><label for="SearchSelfCheckFlag">是否自检</label></td>
  76. <td>
  77. <select class="easyui-combobox" type="text" id="SearchSelfCheckFlag" name="SearchSelfCheckFlag" style="height: 25px; width: 150px" data-options="">
  78. <option value="">全部</option>
  79. <option value="1">是</option>
  80. <option value="0">否</option>
  81. </select>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td><label for="SearchStartTime">开始时间</label></td>
  86. <td><input class="easyui-textbox" type="text" id="SearchStartTime" name="SearchStartTime" style="height: 25px; width: 150px" data-options="" /></td>
  87. </tr>
  88. <tr>
  89. <td><label for="SearchEndTime">结束时间</label></td>
  90. <td><input class="easyui-textbox" type="text" id="SearchEndTime" name="SearchEndTime" style="height: 25px; width: 150px" data-options="" /></td>
  91. </tr>
  92. <tr>
  93. <td colspan="2" style="text-align: center; width: 100%">
  94. <a href="#" class="easyui-linkbutton" iconCls="icon-search" style="width: 100%; height: 25px" onclick="LoadTable(true);">查询</a>
  95. </td>
  96. </tr>
  97. </table>
  98. </div>
  99. </div>
  100. </div>
  101. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  102. data-options="singleSelect: true,
  103. method: 'post',
  104. multiSort: false,
  105. toolbar: '#tbToolBar',
  106. fitColumns: true,
  107. @*rownumbers: true,*@
  108. remoteSort: false,
  109. @*loadFilter: pagerFilter,*@
  110. onDblClickRow: function () {
  111. btn_Detail();
  112. },
  113. pagination: true,
  114. pageSize: 50,
  115. pageList: [20, 50, 100]
  116. ">
  117. <thead>
  118. <tr>
  119. <th data-options="field:'MarketName',width:100">市场名称</th>
  120. <th data-options="field:'AssessLevelName',width:150">检查结果</th>
  121. <th data-options="field:'LogDate',width:80">检查日期</th>
  122. <th data-options="field:'Executor',width:50">检查员</th>
  123. </tr>
  124. </thead>
  125. </table>
  126. </section>
  127. <section>
  128. <div id="winModal" class="easyui-window winModal" title="卫生检查详情" style="width: 450px;padding:10px;"
  129. iconCls="icon-save" data-options="modal:true,closed:true">
  130. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  131. <div data-options="region:'center'" style="padding:15px 25px 0;">
  132. <form id="form">
  133. @Html.Hidden("ID")
  134. <div class="panle-fluid">
  135. <div class="input-group">
  136. <label class="input-group-addon control-label" for="RegionID">所属辖区</label>
  137. <select class="form-control input-group-addon" type="text" id="RegionID" name="RegionID" onchange="GetMarketSelStr();">
  138. <option value="">全部</option>
  139. @Html.Raw(ViewBag.SelRegionInfo)
  140. </select>
  141. </div>
  142. <div class="input-group">
  143. <label class="input-group-addon control-label" for="MarketName">市场名称</label>
  144. <input class="form-control input-group-addon" aria-disabled="true" name="MarketName" id="MarketName" type="text" value="" placeholder="" />
  145. </div>
  146. <div class="input-group">
  147. <label class="input-group-addon control-label" for="Executor">检查员</label>
  148. <input class="form-control input-group-addon" aria-disabled="true" name="Executor" id="Executor" type="text" value="" placeholder="" />
  149. </div>
  150. <div class="input-group">
  151. <label class="input-group-addon control-label" for="LogDate">检查日期</label>
  152. <input class="form-control input-group-addon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder=""/>
  153. </div>
  154. <div class="input-group">
  155. <label class="input-group-addon control-label" for="AssessLevelID">检查结果</label>
  156. <select class="form-control input-group-addon" aria-disabled="true" name="AssessLevelID" id="AssessLevelID" type="text" value="" placeholder="选择市场">
  157. @Html.Raw(ViewBag.SelAssessLevelInfo)
  158. </select>
  159. </div>
  160. <div class="input-group">
  161. <label class="input-group-addon control-label" for="SelfCheckFlag">是否自检</label>
  162. <select class="form-control input-group-addon" aria-disabled="true" name="SelfCheckFlag" id="SelfCheckFlag" type="text" value="" placeholder="">
  163. <option value="1">是</option>
  164. <option value="0">否</option>
  165. </select>
  166. </div>
  167. <div class="input-group">
  168. <label class="input-group-addon control-label" for="FileTitle">附件下载</label>
  169. <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder="" disabled="disabled" />
  170. <a id="FileDownload" class="input-group-addon control-label" href="#" data-src="" onclick="FileDownload('#FileDownload')" download="" style="cursor:pointer">点击下载</a>
  171. </div>
  172. <div class="input-group">
  173. <label class="input-group-addon control-label" for="Reason">备注</label>
  174. <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="Reason" id="Reason" type="text" value="" placeholder=""></textarea>
  175. </div>
  176. </div>
  177. </form>
  178. </div>
  179. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  180. @*<a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>*@
  181. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">关闭</a>
  182. </div>
  183. </div>
  184. </div>
  185. </section>
  186. <script>
  187. //加载表格数据
  188. function LoadTable(collapsed) {
  189. collapsed = collapsed || false;
  190. var marketId = $("input.textbox-value[name='SearchMarketID']").val(),
  191. startTime = $('#SearchStartTime').val(),
  192. endTime = $('#SearchEndTime').val(),
  193. executor = $("input.textbox-value[name='SearchExecutor']").val(),
  194. assessLevelId = $("input.textbox-value[name='SearchAssessLevelID']").val(),
  195. selfCheckFlag = $("input.textbox-value[name='SearchSelfCheckFlag']").val();
  196. if (collapsed === true) {
  197. $("#Search").panel("collapse", true);
  198. }
  199. $('#dgTable').datagrid({
  200. url: '@Url.Action("CleansingCheckLogQryResult", "GetResult")' + '?MarketID=' + escape(marketId) + '&StartTime=' + escape(startTime) + '&EndTime=' + escape(endTime) + '&Executor=' + escape(executor) + '&AssessLevelID=' + escape(assessLevelId) + '&SelfCheckFlag=' + escape(selfCheckFlag)
  201. });
  202. }
  203. function btn_Detail()
  204. {
  205. var rows = $('#dgTable').datagrid('getSelections');
  206. if (rows.length === 1) {
  207. var row = rows[0];
  208. //GetSearchMarketSelStr();
  209. //console.log(row);
  210. $("#ID").val(row.ID);
  211. $("#MarketName").val(row.MarketName);
  212. $("#AssessLevelID").val(row.AssessLevelID);
  213. $("#Executor").val(row.Executor);
  214. $("#SelfCheckFlag").val(row.SelfCheckFlag);
  215. $("#Reason").val(row.Reason);
  216. $("#LogDate").val(row.LogDate);
  217. $("#FileTitle").val(row.FileTitle);
  218. if (row.FilePath != null && row.FilePath !== "" && row.FileName != null && row.FileName !== "")
  219. $("#FileDownload").attr({
  220. "href": "../" + row.FilePath + "/" + row.FileName,
  221. "download": row.FileTitle,
  222. "onclick": "FileDownload('#FileDownload')"
  223. });
  224. else
  225. $("#FileDownload").removeAttr("href").removeAttr("onclick");
  226. $("#winModal input").attr("disabled", "disabled");
  227. $("#winModal textarea").attr("disabled", "disabled");
  228. $("#winModal").window("open");
  229. } else {
  230. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  231. }
  232. }
  233. //function FileDownload() {
  234. // var url = $("#FileDownload").attr("href");
  235. // if (url === "") {
  236. // layer.alert('当前没有附件可以下载查看!', { title: '提示信息' });
  237. // } else {
  238. // window.win = open(url);
  239. // setTimeout('win.document.execCommand("SaveAs")', 500);
  240. // }
  241. //}
  242. //function FileDownload() {
  243. // var url = $("#FileDownload").attr("href");
  244. // if (url === "") {
  245. // layer.alert('当前没有附件可以下载查看!', { title: '提示信息' });
  246. // } else {
  247. // window.win = open(url);
  248. // setTimeout('win.document.execCommand("SaveAs")', 500);
  249. // }
  250. //}
  251. //根据辖区获取市场下拉框的option
  252. function GetMarketSelStr() {
  253. $.ajax({
  254. url: "/GetResult/GetMarketSelStrResult",
  255. type: "post",
  256. dataType: "json",
  257. data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  258. success: function (data) {
  259. //console.log(msg);
  260. if (CheckAajxData(data) === false) return;;
  261. var rows = data.rows;
  262. var first = "{\"MarketID\":\"";
  263. for (var i = 0; i < rows.length; i++) {
  264. first += (first === "{\"MarketID\":\"" ? "" : "@@|@@") + rows[i].MarketID;
  265. }
  266. first += "\",\"Names\":\"全部\"}";
  267. var firstJson = JSON.parse(first);
  268. rows.unshift(firstJson);
  269. console.log(rows);
  270. $('#SearchMarketID').combobox("clear").combobox({
  271. data: rows,
  272. valueField: 'MarketID',
  273. textField: 'Names',
  274. onLoadSuccess: function () {
  275. var val = $(this).combobox('getData');
  276. // ReSharper disable once MissingHasOwnPropertyInForeach
  277. for (var item in val[0]) {
  278. if (item === 'MarketID') {
  279. $(this).combobox('select', val[0][item]);
  280. }
  281. }
  282. }
  283. });
  284. }
  285. });
  286. }
  287. var start = {
  288. elem: "#StartTime",
  289. format: "YYYY-MM-DD",
  290. min: "2010-01-01",
  291. event: "focus",
  292. choose: function (datas) {
  293. end.min = datas; //开始日选好后,重置结束日的最小日期
  294. end.start = datas; //将结束日的初始值设定为开始日
  295. $('#SearchStartTime').val(datas);
  296. }
  297. },
  298. end = {
  299. elem: "#EndTime",
  300. format: "YYYY-MM-DD",
  301. min: "2010-01-01",
  302. event: "focus",
  303. choose: function (datas) {
  304. start.max = datas; //结束日选好后,重置开始日的最大日期
  305. $('#SearchEndTime').val(datas);
  306. }
  307. };
  308. $(function () {
  309. $("#SearchStartTime").next("span").find("input").attr("id", "StartTime");
  310. $("#SearchEndTime").next("span").find("input").attr("id", "EndTime");
  311. $("#SearchStartTime").textbox("setValue", laydate.now(-7, 'YYYY-MM-DD'));
  312. $("#SearchEndTime").textbox("setValue", laydate.now(0, 'YYYY-MM-DD'));
  313. GetMarketSelStr();
  314. //加载表格数据
  315. setTimeout(LoadTable,100);
  316. //加载日历控件
  317. laydate(start);
  318. laydate(end);
  319. });
  320. </script>
  321. </body>
  322. </html>