WeightCheckLogQry.cshtml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>WeightCheckLogQry</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. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  23. <script src="~/Content/js/js/MarketJs.js"></script>
  24. </head>
  25. <body >
  26. <section class="hidden">
  27. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  28. </section>
  29. <section style="height:95vh; padding: 10px 20px;">
  30. <div class="row tbToolBar" id="tbToolBar">
  31. <div class="toolbar">
  32. <a href="#" class="easyui-linkbutton" iconCls="icon-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  33. </div>
  34. <div class="toolbar-search">
  35. <div id="Search" class="easyui-panel" title="请展开面板输入查询条件" style="width: 300px; height: 330px; padding: 10px;"
  36. data-options="iconCls:'icon-heart',collapsible:true,minimizable:false,maximizable:false,closable:false,collapsed:true,tools:[
  37. {
  38. iconCls:'icon-search',
  39. handler:function(){LoadTable(true)}
  40. }]">
  41. <table>
  42. <tr>
  43. <td><label for="SearchRegionID">辖区工商</label></td>
  44. <td><select class="easyui-combobox" type="text" id="SearchRegionID" name="SearchRegionID" style="height: 25px; width: 150px" data-options="onSelect:function(){GetMarketSelStr()}">
  45. <option value="">全部</option>
  46. @Html.Raw(ViewBag.SelRegionInfo)
  47. </select></td>
  48. </tr>
  49. <tr>
  50. <td><label for="SearchMarketID">隶属市场</label></td>
  51. <td>
  52. <select class="easyui-combobox" type="text" id="SearchMarketID" name="SearchMarketID" style="height: 25px; width: 150px" data-options="">
  53. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  54. </select>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td><label for="SearchMarketSellerID">经营户名</label></td>
  59. <td>
  60. <select class="easyui-combobox" type="text" id="SearchMarketSellerID" name="SearchMarketSellerID" style="height: 25px; width: 150px" data-options="icons:[{
  61. iconCls:'icon-search_zoom',handler:function(){SearchModal()}
  62. }]">
  63. <option value="">全部</option>
  64. @Html.Raw(ViewBag.SelMarketSellersInfo)
  65. </select>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td><label for="SearchFoodName">商品名称</label></td>
  70. <td>
  71. <input class="easyui-textbox" type="text" id="SearchFoodName" name="SearchFoodName" style="height: 25px; width: 150px" data-options="" />
  72. </td>
  73. </tr>
  74. <tr>
  75. <td><label for="SearchStartTime">开始时间</label></td>
  76. <td><input class="easyui-textbox" type="text" id="SearchStartTime" name="SearchStartTime" style="height: 25px; width: 150px" data-options=""/></td>
  77. </tr>
  78. <tr>
  79. <td><label for="SearchEndTime">结束时间</label></td>
  80. <td><input class="easyui-textbox" type="text" id="SearchEndTime" name="SearchEndTime" style="height: 25px; width: 150px" data-options=""/></td>
  81. </tr>
  82. <tr>
  83. <td colspan="2" style="text-align: center; width: 100%">
  84. <a href="#" class="easyui-linkbutton" iconCls="icon-search" style="width: 100%; height: 25px" onclick="LoadTable(true);">查询</a>
  85. </td>
  86. </tr>
  87. </table>
  88. </div>
  89. </div>
  90. </div>
  91. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  92. data-options="singleSelect: true,
  93. method: 'post',
  94. multiSort: false,
  95. toolbar: '#tbToolBar',
  96. fitColumns: true,
  97. @*rownumbers: true,*@
  98. remoteSort: false,
  99. @*loadFilter: pagerFilter,*@
  100. onDblClickRow: function () {
  101. btn_Detail();
  102. },
  103. pagination: true,
  104. pageSize: 50,
  105. pageList: [20, 50, 100]
  106. ">
  107. <thead>
  108. <tr>
  109. <th data-options="field:'FoodName',width:80">商品名称</th>
  110. <th data-options="field:'Executor',width:80">执行人</th>
  111. <th data-options="field:'LogDate',width:80">记录日期</th>
  112. <th data-options="field:'Result',width:250">处理情况</th>
  113. <th data-options="field:'MarketSellerName',width:180">经营户名</th>
  114. <th data-options="field:'MarketName',width:180">市场名称</th>
  115. </tr>
  116. </thead>
  117. </table>
  118. </section>
  119. <section>
  120. <div id="winModal" class="easyui-window winModal" title="复称情况详情" style="width: 450px;padding:10px;"
  121. iconCls="icon-save" data-options="modal:true,closed:true">
  122. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  123. <div data-options="region:'center'" style="padding:15px 25px 0;">
  124. <form id="form">
  125. @Html.Hidden("ID")
  126. <div class="panle-fluid">
  127. <div class="input-group">
  128. <label class="input-group-addon control-label" for="SellerID">经营户</label>
  129. <select class="form-control input-group-addon" aria-disabled="true" name="SellerID" id="SellerID" type="text" value="" placeholder="选择经营户">
  130. @Html.Raw(ViewBag.SelMarketSellersInfo)
  131. </select>
  132. @*<span class="input-group-addon" onclick="SearchModal()">
  133. <img src="~/easyui/themes/icons/zoom.bmp" />
  134. </span>*@
  135. </div>
  136. <div class="input-group">
  137. <label class="input-group-addon control-label" for="FoodName">商品名称</label>
  138. <input class="form-control input-group-addon" aria-disabled="true" name="FoodName" id="FoodName" type="text" value="" placeholder="" />
  139. </div>
  140. <div class="input-group">
  141. <label class="input-group-addon control-label" for="LogDate">复称日期</label>
  142. <input class="form-control input-group-addon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder="" />
  143. </div>
  144. <div class="input-group">
  145. <label class="input-group-addon control-label" for="TotalCount">过秤笔数</label>
  146. <input class="form-control input-group-addon " aria-disabled="true" name="TotalCount" id="TotalCount" type="text" value="" placeholder="" />
  147. </div>
  148. <div class="input-group">
  149. <label class="input-group-addon control-label" for="AccurateCount">准确笔数</label>
  150. <input class="form-control input-group-addon" aria-disabled="true" name="AccurateCount" id="AccurateCount" type="text" value="" placeholder="" />
  151. </div>
  152. <div class="input-group">
  153. <label class="input-group-addon control-label" for="Executor">执行人</label>
  154. <input class="form-control input-group-addon" aria-disabled="true" name="Executor" id="Executor" type="text" value="" placeholder="" />
  155. </div>
  156. <div class="input-group">
  157. <label class="input-group-addon control-label" for="FileTitle">附件下载</label>
  158. <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder="" disabled="disabled" />
  159. <a id="FileDownload" class="input-group-addon control-label" href="#" data-src="" onclick="FileDownload('#FileDownload')" download="" style="cursor:pointer">点击下载</a>
  160. </div>
  161. <div class="input-group">
  162. <label class="input-group-addon control-label" for="Result">处理情况</label>
  163. <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="Result" id="Result" type="text" value="" placeholder=""></textarea>
  164. </div>
  165. </div>
  166. </form>
  167. </div>
  168. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  169. @*<a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>*@
  170. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">关闭</a>
  171. </div>
  172. </div>
  173. </div>
  174. <div id="winModal_Search" class="easyui-window winModal" title="搜索经营户" style="width: 750px;padding:10px;"
  175. iconCls="icon-save" data-options="modal:true,closed:true">
  176. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  177. <div data-options="region:'center'" style="padding:15px 5px 5px;">
  178. <div class="panle-third">
  179. <div class="input-group">
  180. <label class="input-group-addon control-label" for="dg_SearchRegionID" style="min-width:70px">所属辖区</label>
  181. <select class="form-control input-group-addon" type="text" id="dg_SearchRegionID" name="dg_SearchRegionID" onchange="GetSearchMarketSelStr();">
  182. <option value="">全部</option>
  183. @Html.Raw(ViewBag.SelRegionInfo)
  184. </select>
  185. </div>
  186. </div>
  187. <div class="panle-third">
  188. <div class="input-group">
  189. <label class="input-group-addon control-label" for="dg_SearchMarketId" style="min-width:70px">所属市场</label>
  190. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketId" id="dg_SearchMarketId" type="text" value="" placeholder="选择所属市场">
  191. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  192. </select>
  193. </div>
  194. </div>
  195. <div class="panle-third">
  196. <div class="input-group">
  197. <label class="input-group-addon control-label" for="dg_SearchSellerName" style="min-width:70px">经营户名</label>
  198. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSellerName" id="dg_SearchSellerName" type="text" value="" placeholder="" />
  199. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  200. </div>
  201. </div>
  202. <div class="panle-fluid" style="margin-top:10px;">
  203. <table id="dgTable_Search" class="easyui-datagrid" style="width:98%; height: 420px;"
  204. data-options="singleSelect: true,
  205. method: 'post',
  206. multiSort: false,
  207. @*toolbar: '#tbToolBar_Attach',*@
  208. fitColumns: true,
  209. @*rownumbers: true,*@
  210. remoteSort: false,
  211. @*loadFilter: pagerFilter,*@
  212. onDblClickRow: function () {
  213. SetSearch('#SearchMarketSellerID');
  214. },
  215. pagination: true,
  216. pageSize: 10,
  217. pageList: [10,20, 50, 100]
  218. ">
  219. <thead>
  220. </thead>
  221. </table>
  222. </div>
  223. </div>
  224. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  225. <a class="easyui-linkbutton" id="Save_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch('#SearchMarketSellerID')" style="width:80px">确认</a>
  226. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:80px">搜索</a>
  227. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width:80px">取消</a>
  228. </div>
  229. </div>
  230. </div>
  231. </section>
  232. <script>
  233. //加载表格数据
  234. function LoadTable(collapsed) {
  235. collapsed = collapsed || false;
  236. var marketId = escape( $("input.textbox-value[name= 'SearchMarketID']").val()),
  237. startTime = escape( $('#SearchStartTime').val()),
  238. endTime = escape( $('#SearchEndTime').val()),
  239. foodName = escape( $("input.textbox-value[name= 'SearchFoodName']").val()),
  240. sellerId = escape( $("input.textbox-value[name= 'SearchMarketSellerID']").val());
  241. if (collapsed === true) {
  242. $("#Search").panel("collapse", true);
  243. }
  244. $('#dgTable').datagrid({
  245. url: '@Url.Action("WeightCheckLogQryResult", "GetResult")' + '?MarketID=' + marketId + '&StartTime=' + startTime + '&EndTime=' + endTime + '&FoodName=' + foodName + '&MarketSellerID=' + sellerId
  246. });
  247. }
  248. function btn_Detail()
  249. {
  250. var rows = $('#dgTable').datagrid('getSelections');
  251. if (rows.length === 1) {
  252. var row = rows[0];
  253. console.log(row);
  254. $("#ID").val(row.ID);
  255. $("#FoodName").val(row.FoodName);
  256. $("#TotalCount").val(row.TotalCount);
  257. $("#AccurateCount").val(row.AccurateCount);
  258. $("#SellerID").val(row.SellerID);
  259. $("#Result").val(row.Result);
  260. $("#Executor").val(row.Executor);
  261. $("#LogDate").val(row.LogDate);
  262. $("#FileTitle").val(row.FileTitle);
  263. if (row.FilePath != null && row.FilePath !== "" && row.FileName != null && row.FileName !== "")
  264. $("#FileDownload").attr({
  265. "href": "../" + row.FilePath + "/" + row.FileName,
  266. "download": row.FileTitle,
  267. "onclick": "FileDownload('#FileDownload')"
  268. });
  269. else
  270. $("#FileDownload").removeAttr("href").removeAttr("onclick");
  271. $("#winModal input").attr("disabled", "disabled");
  272. $("#winModal textarea").attr("disabled", "disabled");
  273. $("#winModal").window("open");
  274. } else {
  275. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  276. }
  277. }
  278. //根据辖区获取市场下拉框的option
  279. function GetMarketSelStr() {
  280. $.ajax({
  281. url: "/GetResult/GetMarketSelStrResult",
  282. type: "post",
  283. dataType: "json",
  284. data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  285. success: function (data) {
  286. //console.log(msg);
  287. if (CheckAajxData(data) === false) return;
  288. var rows = data.rows;
  289. var first = "{\"MarketID\":\"";
  290. for (var i = 0; i < rows.length; i++) {
  291. first += (first === "{\"MarketID\":\"" ? "" : "@@|@@") + rows[i].MarketID;
  292. }
  293. first += "\",\"Names\":\"全部\"}";
  294. var firstJson = JSON.parse(first);
  295. rows.unshift(firstJson);
  296. console.log(rows);
  297. $('#SearchMarketID').combobox("clear").combobox({
  298. data: rows,
  299. valueField: 'MarketID',
  300. textField: 'Names',
  301. onLoadSuccess: function () {
  302. var val = $(this).combobox('getData');
  303. // ReSharper disable once MissingHasOwnPropertyInForeach
  304. for (var item in val[0]) {
  305. if (item === 'MarketID') {
  306. $(this).combobox('select', val[0][item]);
  307. }
  308. }
  309. }
  310. });
  311. }
  312. });
  313. }
  314. function GetSearchMarketSelStr() {
  315. $.ajax({
  316. url: "/GetResult/GetMarketSelStrResult",
  317. type: "post",
  318. dataType: "json",
  319. //data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  320. data: { RegionID: $("#dg_SearchRegionID").val() },
  321. success: function (data) {
  322. //console.log(msg);
  323. if (CheckAajxData(data) === false) return;
  324. var rows = data.rows;
  325. var str1 = "<option value=\"";
  326. var str2 = "";
  327. for (var i = 0; i < rows.length; i++) {
  328. str1 += (str1 === "<option value=\"" ? "" : "@@|@@") + rows[i].MarketID;
  329. str2 += "<option value=\"" + rows[i].MarketID + "\">" + rows[i].Names + "</option>";
  330. }
  331. str1 += "\">全部</option>";
  332. $('#dg_SearchMarketId').empty().html(str1 + str2);
  333. }
  334. });
  335. }
  336. function SearchModal() {
  337. GetSearchMarketSelStr();
  338. console.log($("#dg_SearchMarketId").val());
  339. setTimeout(DgSearchLoadTable, 500);
  340. $('#winModal_Search').window('open');
  341. }
  342. function SetSearch(idStr) {
  343. var rows = $('#dgTable_Search').datagrid('getSelections');
  344. if (rows.length === 1) {
  345. var row = rows[0];
  346. console.log(row);
  347. //$(idStr).val(row.SellerID);
  348. $(idStr).combobox('setValue', row.SellerID);
  349. $('#winModal_Search').window('close');
  350. } else {
  351. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  352. }
  353. }
  354. function DgSearchLoadTable() {
  355. var marketId = $("#dg_SearchMarketId").val(),
  356. sellerName = $("#dg_SearchSellerName").val();
  357. $('#dgTable_Search').datagrid({
  358. url: '@Url.Action("SellerSearchResult", "GetResult")' + '?MarketID=' + escape(marketId) + '&MarketSellerName=' + escape(sellerName),
  359. columns: [[
  360. { field: 'MarketSellerName', title: '经营户名', width: 150, align: 'center' },
  361. { field: 'IdCard', title: '身份证', width: 180, align: 'center' },
  362. { field: 'EnterMarketDate', title: '入场时间', width: 180, align: 'center' },
  363. { field: 'Tel', title: '联系电话', width: 180, align: 'center' }
  364. //{ field: 'StallName', title: '摊位号', width: 250, align: 'center' },
  365. //{ field: 'MarketName', title: '隶属市场', width: 180, align: 'center' },
  366. //{ field: 'TradeTypeName', title: '所在行业', width: 200, align: 'center' },
  367. ]]
  368. });
  369. }
  370. var start = {
  371. elem: "#StartTime",
  372. format: "YYYY-MM-DD",
  373. min: "2010-01-01",
  374. event: "focus",
  375. choose: function (datas) {
  376. end.min = datas; //开始日选好后,重置结束日的最小日期
  377. end.start = datas; //将结束日的初始值设定为开始日
  378. $('#SearchStartTime').val(datas);
  379. }
  380. },
  381. end = {
  382. elem: "#EndTime",
  383. format: "YYYY-MM-DD",
  384. min: "2010-01-01",
  385. event: "focus",
  386. choose: function (datas) {
  387. start.max = datas; //结束日选好后,重置开始日的最大日期
  388. $('#SearchEndTime').val(datas);
  389. }
  390. };
  391. $(function () {
  392. $("#SearchStartTime").next("span").find("input").attr("id", "StartTime");
  393. $("#SearchEndTime").next("span").find("input").attr("id", "EndTime");
  394. $("#SearchStartTime").textbox("setValue", laydate.now(-7, 'YYYY-MM-DD'));
  395. $("#SearchEndTime").textbox("setValue", laydate.now(0, 'YYYY-MM-DD'));
  396. GetMarketSelStr();
  397. //加载表格数据
  398. setTimeout(LoadTable,100);
  399. //加载日历控件
  400. laydate(start);
  401. laydate(end);
  402. });
  403. </script>
  404. </body>
  405. </html>