TZQMajorGoodsLog.cshtml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>TZQMajorGoodsLog</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="MarketNames">隶属市场</label></td>
  60. <td class="td-input">
  61. <select class="easyui-combobox" style="height:22px;width:200px" id="MarketNames" name="MarketNames" data-options="">
  62. @Html.Raw(ViewBag.SelMarketInfo)
  63. </select>
  64. </td>
  65. <td class="td-label"><label for="SearchStartTime">日期</label></td>
  66. <td class="td-input">
  67. <input class="laydate-icon layer-date" value="@ViewBag.StartTime" type="text" id="SearchStartTime" name="SearchStartTime" style="height:25px; width:200px" data-options="" placeholder="开始日期" />
  68. </td>
  69. <td class="td-label">到:</td>
  70. <td class="td-input">
  71. <input class="laydate-icon layer-date" type="text" value="@ViewBag.EndTime" id="SearchEndTime" name="SearchEndTime" style="height:25px; width:200px" data-options="" placeholder="截止日期" />
  72. </td>
  73. </tr>
  74. <tr>
  75. <td class="td-label"><label for="MajorGoodsTypeID">商品名称</label></td>
  76. <td class="td-input">
  77. <select class="easyui-combobox" style="height:22px;width:200px" id="MajorGoodsTypeID" name="MajorGoodsTypeID" data-options="">
  78. <option value="">全部</option>
  79. @Html.Raw(ViewBag.MajorGoodsTypeID)
  80. </select>
  81. </td>
  82. <td class="td-label"><label for="SellerNames">经销单位</label></td>
  83. <td class="td-input">
  84. <select class="easyui-combobox" style="height: 22px;width:200px" id="SellerNames" name="SellerNames" data-options="icons:[{
  85. iconCls:'icon-search_zoom',handler:function(){SearchModalSeller()}
  86. }]" >
  87. <option value="">全部</option>
  88. @Html.Raw(ViewBag.SelMarketSeller)
  89. </select>
  90. </td>
  91. <td colspan="2" style="width: 6%;text-align: right;">
  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. <tr>
  96. </tr>
  97. </table>
  98. </div>
  99. </section>
  100. <section>
  101. <div id="winModal" class="easyui-window winModal" title="市场查询" style="width: 700px; height: 450px;padding:10px;"
  102. iconCls="icon-save" data-options="modal:true,closed:true">
  103. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  104. <div data-options="region:'center'" style="padding:5px 5px 5px;">
  105. <table>
  106. <tr>
  107. <td style="padding-left:5px">辖区工商:</td>
  108. <td style="padding-left:5px">
  109. @*<input class="easyui-combotree" id="RegionID" data-options="url:/BaseInfo/GetTreeRegion',method:'post',required:true,loadFilter: function (rows) {
  110. return convert(rows);
  111. }" style="width:100px;" />*@
  112. <input class="easyui-combotree" id="RegionID" data-options="url:'/BaseInfo/GetTreeRegion',method:'post',loadFilter: function (rows) {
  113. return convert(rows);
  114. }" style="width:150px;height:20px" />
  115. </td>
  116. <td style="padding-left:5px">隶属市场:</td>
  117. <td style="padding-left:5px">
  118. <input class="easyui-textbox" id="MarketName" style="width:150px;height:20px" />
  119. </td>
  120. <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>
  121. </tr>
  122. </table>
  123. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 285px;"
  124. data-options="singleSelect: true,
  125. method: 'post',
  126. multiSort: false,
  127. fitColumns: true,
  128. remoteSort: false,
  129. onDblClickRow: function () {
  130. SetSearch();
  131. }">
  132. <thead>
  133. <tr>
  134. <th data-options="field:'RegionID',width:50">区域编号</th>
  135. <th data-options="field:'Names',width:150,">市场名称</th>
  136. <th data-options="field:'Principal',width:60,">负责人</th>
  137. <th data-options="field:'LinkTel',width:60">联系电话</th>
  138. <th data-options="field:'LinkMan',width:60,">日常联系人</th>
  139. <th data-options="field:'FrontForUnit',width:120,">主办单位</th>
  140. <th data-options="field:'ManageUnit',width:100">管理单位</th>
  141. <th data-options="field:'PractiseTime',width:60,">开业时间</th>
  142. </tr>
  143. </thead>
  144. </table>
  145. </div>
  146. <div data-options="region:'south',border:false" style="text-align:right; padding: 10px 20px;height:52px">
  147. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  148. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  149. </div>
  150. </div>
  151. </div>
  152. <div id="winModalSeller" class="easyui-window winModal" title="经营户查询" style="width: 700px; height: 450px;padding:10px;"
  153. iconCls="icon-save" data-options="modal:true,closed:true">
  154. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  155. <div data-options="region:'center'" style="padding:5px 5px 5px;">
  156. <table>
  157. <tr>
  158. <td style="padding-left:5px">辖区工商:</td>
  159. <td style="padding-left:5px">
  160. @*<input class="easyui-combotree" id="RegionID" data-options="url:/BaseInfo/GetTreeRegion',method:'post',required:true,loadFilter: function (rows) {
  161. return convert(rows);
  162. }" style="width:100px;" />*@
  163. <input class="easyui-combotree" id="RegionID2" data-options="url:'/BaseInfo/GetTreeRegion',method:'post',loadFilter: function (rows) {
  164. return convert(rows);
  165. },onClick:function(data){largetSelectMarket(data)}" style="width:150px;height:20px" />
  166. </td>
  167. <td style="padding-left:5px">隶属市场:</td>
  168. <td style="padding-left:5px">
  169. <select style="height: 22px;width:200px" id="MarketID" name="MarketID">
  170. <option value="">请选择...</option>
  171. @Html.Raw(ViewBag.SelMarketInfo)
  172. </select>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td style="padding-left:5px">姓名:</td>
  177. <td style="padding-left:5px">
  178. <input class="easyui-textbox" id="SellerName" style="width:150px;height:20px" />
  179. </td>
  180. <td style="padding-left:5px" colspan="2"><a class="easyui-linkbutton" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchSellerLoadTable()" style="width:100px;height:20px">搜索</a></td>
  181. </tr>
  182. </table>
  183. <table id="dgTable_SearchSeller" class="easyui-datagrid" style="width: 98%; height: 285px;"
  184. data-options="singleSelect: true,
  185. method: 'post',
  186. multiSort: false,
  187. fitColumns: true,
  188. remoteSort: false,
  189. onDblClickRow: function () {
  190. SetSearchSeller();
  191. }">
  192. <thead>
  193. <tr>
  194. <th data-options="field:'Name',width:50">姓名</th>
  195. <th data-options="field:'IdCard',width:150,">身份证号</th>
  196. <th data-options="field:'EnterMarketDate',width:100,">进场时间</th>
  197. <th data-options="field:'Tel',width:100">电话</th>
  198. </tr>
  199. </thead>
  200. </table>
  201. </div>
  202. <div data-options="region:'south',border:false" style="text-align:right; padding: 10px 20px;height:52px">
  203. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearchSeller()" style="width:80px">确认</a>
  204. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModalSeller').window('close');" style="width:80px">取消</a>
  205. </div>
  206. </div>
  207. </div>
  208. </section>
  209. <script>
  210. function largetSelectMarket(data) {
  211. var regionId = $('#RegionID2').combotree('getValue');
  212. refreshMarketList(regionId);
  213. }
  214. function refreshMarketList(regionId) {
  215. $("#MarketID").empty();
  216. $.post("/Reports/GetMarketJsons", { regionId: regionId }, function (data) {
  217. $("#MarketID").append("<option value=''>请选择...</option>");
  218. if (data.length > 0) {
  219. for (var i = 0; i < data.length; i++) {
  220. $("#MarketID").append("<option value=" + data[i].MarketID + ">" + data[i].Names + "</option>");
  221. }
  222. }
  223. }, "json")
  224. //$("#MarketID").combobox('reload', "/Reports/GetMarketJsons?regionId=" + regionId);
  225. }
  226. function SearchModalSeller() {
  227. $('#winModalSeller').window({ "title": "搜索被检单位" });
  228. $('#SellerName').textbox('setValue', "")
  229. DgSearchSellerLoadTable();
  230. $('#winModalSeller').window('open');
  231. }
  232. function SearchModal() {
  233. $('#winModal').window({ "title": "搜索被检单位" });
  234. $('#MarketName').textbox('setValue',"")
  235. DgSearchLoadTable();
  236. $('#winModal').window('open');
  237. }
  238. function DgSearchLoadTable() {
  239. $('#dgTable_Search').datagrid({
  240. url: '/Reports/GetMarkets?RegionId=' + $('#RegionID').combotree('getValue') + '&&MarketName=' + $('#MarketName').textbox('getValue')
  241. })
  242. }
  243. function DgSearchSellerLoadTable() {
  244. $('#dgTable_SearchSeller').datagrid({
  245. url: '/Reports/GetMarketSeller?RegionId=' + $('#RegionID2').combotree('getValue') + '&&MarketID=' + $('#MarketID').val() + '&&SellerName=' + $('#SellerName').textbox('getValue')
  246. })
  247. }
  248. function SetSearch() {
  249. var row = $('#dgTable_Search').datagrid('getSelected');
  250. if (row) {
  251. $('#MarketNames').combobox('setValue', row.MarketID);
  252. $('#winModal').window('close');
  253. }
  254. }
  255. function SetSearchSeller() {
  256. var row = $('#dgTable_SearchSeller').datagrid('getSelected');
  257. if (row) {
  258. $('#SellerNames').combobox('setValue', row.SellerID);
  259. $('#winModalSeller').window('close');
  260. }
  261. }
  262. function btn_Query() {
  263. window.open("/Taizhang/TZPMajorGoodsLog?MarketID=" + $('#MarketNames').combobox('getValue') + '&&SearchStartTime=' + $('#SearchStartTime').val() + '&&SearchEndTime=' + $('#SearchEndTime').val() +
  264. '&&MajorGoodsTypeID=' + $('#MajorGoodsTypeID').combobox('getValue') + '&&SellerID=' + $('#SellerNames').textbox('getValue'));
  265. }
  266. var start = {
  267. elem: "#SearchStartTime",
  268. format: "YYYY-MM-DD",
  269. min: "2010-01-01",
  270. event: "focus",
  271. choose: function (datas) {
  272. end.min = datas; //开始日选好后,重置结束日的最小日期
  273. end.start = datas; //将结束日的初始值设定为开始日
  274. $('#SearchStartTime').val(datas);
  275. }
  276. },
  277. end = {
  278. elem: "#SearchEndTime",
  279. format: "YYYY-MM-DD",
  280. min: "2010-01-01",
  281. event: "focus",
  282. choose: function (datas) {
  283. start.max = datas; //结束日选好后,重置开始日的最大日期
  284. $('#SearchEndTime').val(datas);
  285. }
  286. };
  287. $(function () {
  288. if ($("#hid_IsMarketSysAccount").val() == "0") {
  289. $('#MarketNames').combobox({ icons:[]})
  290. } else {
  291. $('#MarketNames').combobox({
  292. icons: [{
  293. iconCls: 'icon-search_zoom', handler: function () { SearchModal() }
  294. }]
  295. })
  296. }
  297. laydate(start);
  298. laydate(end);
  299. })
  300. function openwin(url) {
  301. var a = document.createElement("a");
  302. a.setAttribute("href", url);
  303. a.setAttribute("target", "_blank");
  304. a.setAttribute("id", "openwin");
  305. document.body.appendChild(a);
  306. a.click();
  307. }
  308. //弹出窗体居中
  309. function f_Center(ll_Width, ll_Height) {
  310. var ll_Left;
  311. var ll_Top;
  312. var ls_Str;
  313. ll_Left = (screen.width - ll_Width) / 2
  314. ll_Top = (screen.height - ll_Height) / 2
  315. if (ll_Left < 0) {
  316. ll_Left = 0;
  317. }
  318. if (ll_Top < 0) {
  319. ll_Top = 0;
  320. }
  321. ls_Str = "left = " + ll_Left + ",top = " + ll_Top + ",width = " + ll_Width + ",height = " + ll_Height;
  322. return ls_Str;
  323. }
  324. function convert(rows) {
  325. function exists(rows, parentId) {
  326. for (var i = 0; i < rows.length; i++) {
  327. if (rows[i].id == parentId) return true;
  328. }
  329. return false;
  330. }
  331. var nodes = [];
  332. // get the top level nodes
  333. for (var i = 0; i < rows.length; i++) {
  334. var row = rows[i];
  335. if (!exists(rows, row.parentId)) {
  336. nodes.push({
  337. id: row.id,
  338. text: row.name
  339. });
  340. }
  341. }
  342. var toDo = [];
  343. for (var i = 0; i < nodes.length; i++) {
  344. toDo.push(nodes[i]);
  345. }
  346. while (toDo.length) {
  347. var node = toDo.shift(); // the parent node
  348. // get the children nodes
  349. for (var i = 0; i < rows.length; i++) {
  350. var row = rows[i];
  351. if (row.parentId == node.id) {
  352. var child = { id: row.id, text: row.name };
  353. if (node.children) {
  354. node.children.push(child);
  355. } else {
  356. node.children = [child];
  357. }
  358. toDo.push(child);
  359. }
  360. }
  361. }
  362. return nodes;
  363. }
  364. </script>
  365. </body>
  366. </html >