TZQMarketSellers.cshtml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>市场经营户基本情况台帐 </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: 4%;
  34. text-align: right;
  35. padding: 3px 10px 3px 0;
  36. }
  37. #Search_Panel td.td-input {
  38. width: 8%;
  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:900px">
  58. <tr>
  59. <td ><label for="TradeTypeID">行业</label></td>
  60. <td>
  61. <select class="easyui-combobox" style="height: 22px;width:200px" id="TradeTypeID" name="TradeTypeID" >
  62. <option value="">全部</option>
  63. @Html.Raw(ViewBag.SelTradeType)
  64. </select>
  65. </td>
  66. <td ><label for="MarketNames">隶属市场</label></td>
  67. <td >
  68. <select class="easyui-combobox" style="height:22px;width:200px" id="MarketNames" name="MarketNames" data-options="">
  69. @Html.Raw(ViewBag.SelMarketInfo)
  70. </select>
  71. </td>
  72. <td style="width: 6%;text-align: left;">
  73. <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>
  74. </td>
  75. </tr>
  76. <tr></tr>
  77. </table>
  78. </div>
  79. </section>
  80. <section>
  81. <div id="winModal" class="easyui-window winModal" title="市场查询" style="width: 700px; height: 450px;padding:10px;"
  82. iconCls="icon-save" data-options="modal:true,closed:true">
  83. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  84. <div data-options="region:'center'" style="padding:5px 5px 5px;">
  85. <table>
  86. <tr>
  87. <td style="padding-left:5px">辖区工商:</td>
  88. <td style="padding-left:5px">
  89. @*<input class="easyui-combotree" id="RegionID" data-options="url:/BaseInfo/GetTreeRegion',method:'post',required:true,loadFilter: function (rows) {
  90. return convert(rows);
  91. }" style="width:100px;" />*@
  92. <input class="easyui-combotree" id="RegionID" data-options="url:'/BaseInfo/GetTreeRegion',method:'post',loadFilter: function (rows) {
  93. return convert(rows);
  94. }" style="width:150px;height:20px" />
  95. </td>
  96. <td style="padding-left:5px">隶属市场:</td>
  97. <td style="padding-left:5px">
  98. <input class="easyui-textbox" id="MarketName" style="width:150px;height:20px" />
  99. </td>
  100. <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>
  101. </tr>
  102. </table>
  103. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 285px;"
  104. data-options="singleSelect: true,
  105. method: 'post',
  106. multiSort: false,
  107. fitColumns: true,
  108. remoteSort: false,
  109. onDblClickRow: function () {
  110. SetSearch();
  111. }">
  112. <thead>
  113. <tr>
  114. <th data-options="field:'RegionID',width:50">区域编号</th>
  115. <th data-options="field:'Names',width:150,">市场名称</th>
  116. <th data-options="field:'Principal',width:60,">负责人</th>
  117. <th data-options="field:'LinkTel',width:60">联系电话</th>
  118. <th data-options="field:'LinkMan',width:60,">日常联系人</th>
  119. <th data-options="field:'FrontForUnit',width:120,">主办单位</th>
  120. <th data-options="field:'ManageUnit',width:100">管理单位</th>
  121. <th data-options="field:'PractiseTime',width:60,">开业时间</th>
  122. </tr>
  123. </thead>
  124. </table>
  125. </div>
  126. <div data-options="region:'south',border:false" style="text-align:right; padding: 10px 20px;height:52px">
  127. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  128. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  129. </div>
  130. </div>
  131. </div>
  132. </section>
  133. <script>
  134. function SearchModal() {
  135. $('#winModal').window({ "title": "搜索被检单位" });
  136. $('#MarketName').textbox('setValue',"")
  137. DgSearchLoadTable();
  138. $('#winModal').window('open');
  139. }
  140. function DgSearchLoadTable() {
  141. $('#dgTable_Search').datagrid({
  142. url: '/Reports/GetMarkets?RegionId=' + $('#RegionID').combotree('getValue') + '&&MarketName=' + $('#MarketName').textbox('getValue')
  143. })
  144. }
  145. function SetSearch() {
  146. var row = $('#dgTable_Search').datagrid('getSelected');
  147. if (row) {
  148. $('#MarketNames').combobox('setValue', row.MarketID);
  149. $('#winModal').window('close');
  150. }
  151. }
  152. function btn_Query() {
  153. window.open("/Taizhang/TZPMarketSellers?MarketID=" + $('#MarketNames').combobox('getValue') + '&&TradeTypeID=' + $('#TradeTypeID').combobox('getValue'));
  154. }
  155. $(function () {
  156. if ($("#hid_IsMarketSysAccount").val() == "0") {
  157. $('#MarketNames').combobox({ icons:[]})
  158. } else {
  159. $('#MarketNames').combobox({
  160. icons: [{
  161. iconCls: 'icon-search_zoom', handler: function () { SearchModal() }
  162. }]
  163. })
  164. }
  165. })
  166. function convert(rows) {
  167. function exists(rows, parentId) {
  168. for (var i = 0; i < rows.length; i++) {
  169. if (rows[i].id == parentId) return true;
  170. }
  171. return false;
  172. }
  173. var nodes = [];
  174. // get the top level nodes
  175. for (var i = 0; i < rows.length; i++) {
  176. var row = rows[i];
  177. if (!exists(rows, row.parentId)) {
  178. nodes.push({
  179. id: row.id,
  180. text: row.name
  181. });
  182. }
  183. }
  184. var toDo = [];
  185. for (var i = 0; i < nodes.length; i++) {
  186. toDo.push(nodes[i]);
  187. }
  188. while (toDo.length) {
  189. var node = toDo.shift(); // the parent node
  190. // get the children nodes
  191. for (var i = 0; i < rows.length; i++) {
  192. var row = rows[i];
  193. if (row.parentId == node.id) {
  194. var child = { id: row.id, text: row.name };
  195. if (node.children) {
  196. node.children.push(child);
  197. } else {
  198. node.children = [child];
  199. }
  200. toDo.push(child);
  201. }
  202. }
  203. }
  204. return nodes;
  205. }
  206. </script>
  207. </body>
  208. </html>