TZQGoodsRecallLog.cshtml 18 KB

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