RptQAgriFoodCheck.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>RptQAgriFoodCheck</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. <style>
  23. #Search_Panel .panel-header {
  24. height: 30px;
  25. padding-top: 8px;
  26. text-align: center;
  27. font-size: 14px;
  28. }
  29. #Search_Panel table.panel-table {
  30. width: 900px;
  31. }
  32. #Search_Panel td.td-label {
  33. width: 5%;
  34. text-align: right;
  35. padding: 3px 10px 3px 0;
  36. }
  37. #Search_Panel td.td-input {
  38. width: 10%;
  39. text-align: left;
  40. }
  41. #Search_Panel .td-input input,
  42. #Search_Panel .td-input select {
  43. width: 150px;
  44. height: 22px;
  45. }
  46. #Search_Panel .panel.easyui-fluid {
  47. margin-bottom: 5px;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <section id="Search_Panel">
  53. <div id="" class="easyui-panel" title=""
  54. style="width: 100%; height: 120px; padding: 10px;"
  55. data-options="collapsible:true">
  56. <table class="panel-table">
  57. <tr>
  58. <td class="td-label"><label for="MarketNames">被检单位</label></td>
  59. <td class="td-input">
  60. <select class="easyui-combobox" style="height: 22px;width:200px" id="MarketNames" name="MarketNames" data-options="icons:[{
  61. iconCls:'icon-search_zoom',handler:function(){SearchModal()}
  62. }]">
  63. <option value="">请选择...</option>
  64. @Html.Raw(ViewBag.SelMarketInfo)
  65. </select>
  66. </td>
  67. <td class="td-label"><label for="StartTime">开始日期</label></td>
  68. <td class="td-input">
  69. <input class="laydate-icon layer-date" type="text" id="StartTime" name="StartTime" placeholder="" style="width:200px" value="@ViewBag.StartTime" />
  70. </td>
  71. <td class="td-label"><label for="EndTime">结束日期</label></td>
  72. <td class="td-input">
  73. <input class="laydate-icon layer-date" type="text" id="EndTime" name="EndTime" placeholder="" style="width:200px" value="@ViewBag.EndTime"/>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td class="td-label"><label for="CheckUnit">检测单位</label></td>
  78. <td class="td-input">
  79. <select class="easyui-combobox" style="height: 22px;width:200px" id="CheckUnit" name="CheckUnit" data-options="">
  80. <option value="">全部</option>
  81. @Html.Raw(ViewBag.SelCheckUnit)
  82. </select>
  83. </td>
  84. <td class="td-label"><label for="CheckMethod">检测方法</label></td>
  85. <td class="td-input">
  86. <select class="easyui-combobox" style="height: 22px;width:200px" id="CheckMethod" name="CheckMethod" data-options="">
  87. <option value="">全部</option>
  88. @Html.Raw(ViewBag.SelCheckMethod)
  89. </select>
  90. </td>
  91. <td colspan="2" style="width: 6%;text-align: left;">
  92. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="btn_Query()" style="width:120px;margin-right:110px">显示打印结果</a>
  93. </td>
  94. </tr>
  95. </table>
  96. </div>
  97. </section>
  98. <section>
  99. <div id="winModal" class="easyui-window winModal" title="市场查询" style="width: 700px; height: 450px;padding:10px;"
  100. iconCls="icon-save" data-options="modal:true,closed:true">
  101. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  102. <div data-options="region:'center'" style="padding:5px 5px 5px;">
  103. <table>
  104. <tr>
  105. <td style="padding-left:5px">辖区工商:</td>
  106. <td style="padding-left:5px">
  107. @*<input class="easyui-combotree" id="RegionID" data-options="url:/BaseInfo/GetTreeRegion',method:'post',required:true,loadFilter: function (rows) {
  108. return convert(rows);
  109. }" style="width:100px;" />*@
  110. <input class="easyui-combotree" id="RegionID" data-options="url:'/BaseInfo/GetTreeRegion',method:'post',loadFilter: function (rows) {
  111. return convert(rows);
  112. }" style="width:150px;height:20px" />
  113. </td>
  114. <td style="padding-left:5px">隶属市场:</td>
  115. <td style="padding-left:5px">
  116. <input class="easyui-textbox" id="MarketName" style="width:150px;height:20px" />
  117. </td>
  118. <td style="padding-left:5px"><a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:100px;height:20px">搜索</a></td>
  119. </tr>
  120. </table>
  121. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 285px;"
  122. data-options="singleSelect: true,
  123. method: 'post',
  124. multiSort: false,
  125. fitColumns: true,
  126. remoteSort: false,
  127. onDblClickRow: function () {
  128. SetSearch();
  129. }">
  130. <thead>
  131. <tr>
  132. <th data-options="field:'RegionID',width:50">区域编号</th>
  133. <th data-options="field:'Names',width:150,">市场名称</th>
  134. <th data-options="field:'Principal',width:60,">负责人</th>
  135. <th data-options="field:'LinkTel',width:60">联系电话</th>
  136. <th data-options="field:'LinkMan',width:60,">日常联系人</th>
  137. <th data-options="field:'FrontForUnit',width:120,">主办单位</th>
  138. <th data-options="field:'ManageUnit',width:100">管理单位</th>
  139. <th data-options="field:'PractiseTime',width:60,">开业时间</th>
  140. </tr>
  141. </thead>
  142. </table>
  143. </div>
  144. <div data-options="region:'south',border:false" style="text-align:right; padding: 10px 20px;height:52px">
  145. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  146. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  147. </div>
  148. </div>
  149. </div>
  150. </section>
  151. <script>
  152. function SearchModal() {
  153. $('#winModal').window({ "title": "搜索被检单位" });
  154. $('#MarketName').textbox('setValue',"")
  155. DgSearchLoadTable();
  156. $('#winModal').window('open');
  157. }
  158. function DgSearchLoadTable() {
  159. $('#dgTable_Search').datagrid({
  160. url: '/Reports/GetMarkets?RegionId=' + $('#RegionID').combotree('getValue') + '&&MarketName=' + $('#MarketName').textbox('getValue')
  161. })
  162. }
  163. function SetSearch() {
  164. var row = $('#dgTable_Search').datagrid('getSelected');
  165. if (row) {
  166. $('#MarketNames').combobox('setValue', row.MarketID);
  167. $('#winModal').window('close');
  168. }
  169. }
  170. function btn_Query() {
  171. window.open("/Reports/RptPAgriFoodCheck?MarketID=" + $('#MarketNames').combobox('getValue') + '&&StartTime=' + $('#StartTime').val() +
  172. '&&EndTime=' + $('#EndTime').val() + '&&CheckUnit=' + $('#CheckUnit').combobox('getValue') + '&&CheckMethod=' + $('#CheckMethod').combobox('getValue'));
  173. }
  174. $(function () {
  175. //加载日历控件
  176. laydate({
  177. elem: '#StartTime',
  178. format: "YYYY-MM-DD",
  179. min: "2000-01-01",
  180. event: "focus"
  181. });
  182. //加载日历控件
  183. laydate({
  184. elem: '#EndTime',
  185. format: "YYYY-MM-DD",
  186. min: "2000-01-01",
  187. event: "focus"
  188. });
  189. })
  190. function openwin(url) {
  191. var a = document.createElement("a");
  192. a.setAttribute("href", url);
  193. a.setAttribute("target", "_blank");
  194. a.setAttribute("id", "openwin");
  195. document.body.appendChild(a);
  196. a.click();
  197. }
  198. //弹出窗体居中
  199. function f_Center(ll_Width, ll_Height) {
  200. var ll_Left;
  201. var ll_Top;
  202. var ls_Str;
  203. ll_Left = (screen.width - ll_Width) / 2
  204. ll_Top = (screen.height - ll_Height) / 2
  205. if (ll_Left < 0) {
  206. ll_Left = 0;
  207. }
  208. if (ll_Top < 0) {
  209. ll_Top = 0;
  210. }
  211. ls_Str = "left = " + ll_Left + ",top = " + ll_Top + ",width = " + ll_Width + ",height = " + ll_Height;
  212. return ls_Str;
  213. }
  214. function convert(rows) {
  215. function exists(rows, parentId) {
  216. for (var i = 0; i < rows.length; i++) {
  217. if (rows[i].id == parentId) return true;
  218. }
  219. return false;
  220. }
  221. var nodes = [];
  222. // get the top level nodes
  223. for (var i = 0; i < rows.length; i++) {
  224. var row = rows[i];
  225. if (!exists(rows, row.parentId)) {
  226. nodes.push({
  227. id: row.id,
  228. text: row.name
  229. });
  230. }
  231. }
  232. var toDo = [];
  233. for (var i = 0; i < nodes.length; i++) {
  234. toDo.push(nodes[i]);
  235. }
  236. while (toDo.length) {
  237. var node = toDo.shift(); // the parent node
  238. // get the children nodes
  239. for (var i = 0; i < rows.length; i++) {
  240. var row = rows[i];
  241. if (row.parentId == node.id) {
  242. var child = { id: row.id, text: row.name };
  243. if (node.children) {
  244. node.children.push(child);
  245. } else {
  246. node.children = [child];
  247. }
  248. toDo.push(child);
  249. }
  250. }
  251. }
  252. return nodes;
  253. }
  254. </script>
  255. </body>
  256. </html>