TZQCheckData.cshtml 13 KB

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