MarketSellerViolationsList.cshtml 15 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>MarketSellerViolationsList</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. <script src="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.js"></script>
  23. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  24. <script src="~/Content/js/js/MarketJs.js"></script>
  25. </head>
  26. <body >
  27. <section class="hidden">
  28. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  29. </section>
  30. <section style="height:95vh; padding: 10px 20px;">
  31. <div class="row tbToolBar" id="tbToolBar">
  32. <div class="toolbar" id="CurdTool">
  33. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  34. <span class="shuxian"></span>
  35. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  36. <span class="shuxian"></span>
  37. <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
  38. </div>
  39. <div class="toolbar-search">
  40. <span>【请选择查询条件】</span>
  41. <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
  42. <div id="search">
  43. <div data-options="name:'MarketSellerName'">经营户名</div>
  44. </div>
  45. </div>
  46. </div>
  47. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  48. data-options="singleSelect: true,
  49. method: 'post',
  50. multiSort: false,
  51. toolbar: '#tbToolBar',
  52. fitColumns: true,
  53. @*rownumbers: true,*@
  54. remoteSort: false,
  55. @*loadFilter: pagerFilter,*@
  56. onDblClickRow: function () {
  57. btn_Edit();
  58. },
  59. pagination: true,
  60. pageSize: 50,
  61. pageList: [20, 50, 100]
  62. ">
  63. <thead>
  64. <tr>
  65. <th data-options="field:'MarketSellerName',width:150">经营户名</th>
  66. <th data-options="field:'SellerViolationTypeName',width:120">违规行为</th>
  67. <th data-options="field:'SellerRewardTypeName',width:50">奖惩记录</th>
  68. <th data-options="field:'LogDate',width:80">记录日期</th>
  69. </tr>
  70. </thead>
  71. </table>
  72. </section>
  73. <section>
  74. <div id="winModal" class="easyui-window winModal" title="经营户违规行为录入维护" style="width: 450px;padding:10px;"
  75. iconCls="icon-save" data-options="modal:true,closed:true">
  76. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  77. <div data-options="region:'center'" style="padding:15px 25px 0;" >
  78. <form id="form">
  79. @Html.Hidden("ID")
  80. <div class="panle-fluid">
  81. <div class="input-group">
  82. <label class="input-group-addon control-label" for="MarketID">市场名称</label>
  83. <select class="form-control input-group-addon" aria-disabled="true" name="MarketID" id="MarketID" type="text" value="" placeholder="选择市场" onchange="GetMarketSellerSelStr();" >
  84. <option value="">请选择...</option>
  85. @Html.Raw(ViewBag.SelMarketInfo)
  86. </select>
  87. </div>
  88. <div class="input-group">
  89. <label class="input-group-addon control-label" for="MarketSellerID">经营户名</label>
  90. <select class="form-control input-group-addon" aria-disabled="true" name="MarketSellerID" id="MarketSellerID" type="text" value="" placeholder="选择经营户">
  91. <option value="">请选择...</option>
  92. </select>
  93. <span class="input-group-addon" onclick="SearchModal()" style="cursor: pointer;">
  94. <img src="~/easyui/themes/icons/zoom.bmp" />
  95. </span>
  96. </div>
  97. <div class="input-group">
  98. <label class="input-group-addon control-label" for="ViolationTypeID">违规行为</label>
  99. <select class="form-control input-group-addon" aria-disabled="true" name="ViolationTypeID" id="ViolationTypeID" type="text" value="" placeholder="选择行为内容">
  100. @*<option value="">请选择...</option>*@
  101. @Html.Raw(ViewBag.SelViolationTypeInfo)
  102. </select>
  103. </div>
  104. <div class="input-group">
  105. <label class="input-group-addon control-label" for="LogDate">记录日期</label>
  106. <input class="form-control input-group-addon laydate-icon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder="" />
  107. </div>
  108. <div class="input-group">
  109. <label class="input-group-addon control-label" for="LogContent">行为内容</label>
  110. <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="LogContent" id="LogContent" type="text" value="" placeholder=""></textarea>
  111. </div>
  112. <div class="input-group">
  113. <label class="input-group-addon control-label" for="SellerRewardTypeID">奖惩记录</label>
  114. <select class="form-control input-group-addon" aria-disabled="true" name="SellerRewardTypeID" id="SellerRewardTypeID" type="text" value="" placeholder="选择处理记录">
  115. @*<option value="">请选择...</option>*@
  116. @Html.Raw(ViewBag.SelSellerRewardTypeInfo)
  117. </select>
  118. </div>
  119. <div class="input-group">
  120. <label class="input-group-addon control-label" for="FileTitle">附件名称</label>
  121. <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder="" />
  122. </div>
  123. <div class="input-group">
  124. <label class="input-group-addon control-label" for="AttachFile">上传附件</label>
  125. <input class="form-control input-group-addon" aria-disabled="true" name="AttachFile" id="AttachFile" type="file" value="" placeholder="" onblur="CheckFileSize('AttachFile')" />
  126. </div>
  127. </div>
  128. </form>
  129. </div>
  130. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding: 13px 20px 0;">
  131. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>
  132. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  133. </div>
  134. </div>
  135. </div>
  136. <div id="winModal_Search" class="easyui-window winModal" title="" style="width: 750px; height: 600px;padding:10px;"
  137. iconCls="icon-save" data-options="modal:true,closed:true">
  138. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  139. <div data-options="region:'center'" style="padding: 15px 5px 5px;">
  140. <div class="panle-half">
  141. <div class="input-group">
  142. <label class="input-group-addon control-label" for="dg_SearchMarketId" style="min-width: 70px">所属市场</label>
  143. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketId" id="dg_SearchMarketId" type="text" value="" placeholder="选择所属市场" disabled="disabled">
  144. <option value="">全部</option>
  145. @Html.Raw(ViewBag.SelMarketInfo)
  146. </select>
  147. </div>
  148. </div>
  149. <div class="panle-half">
  150. <div class="input-group">
  151. <label class="input-group-addon control-label" for="dg_SearchSellerName" style="min-width: 70px">经营户名</label>
  152. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSellerName" id="dg_SearchSellerName" type="text" value="" placeholder=""/>
  153. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  154. </div>
  155. </div>
  156. <div class="panle-fluid" style="margin-top: 10px;">
  157. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 420px;"
  158. data-options="singleSelect: true,
  159. method: 'post',
  160. multiSort: false,
  161. toolbar: '#tbToolBar_Attach',
  162. fitColumns: true,
  163. @*rownumbers: true,*@
  164. remoteSort: false,
  165. @*loadFilter: pagerFilter,*@
  166. onDblClickRow: function () {
  167. SetSearch();
  168. },
  169. pagination: true,
  170. pageSize: 10,
  171. pageList: [10,20, 50, 100]
  172. ">
  173. <thead>
  174. <tr>
  175. @*<th data-options="field:'FileTitle',width:100">附件标题</th>
  176. <th data-options="field:'FileExt',width:60,">扩展名</th>
  177. <th data-options="field:'TimeLastMod',width:90,">上传日期</th>*@
  178. </tr>
  179. </thead>
  180. </table>
  181. </div>
  182. </div>
  183. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  184. <a class="easyui-linkbutton" id="Save_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  185. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:80px">搜索</a>
  186. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width:80px">取消</a>
  187. </div>
  188. </div>
  189. </div>
  190. </section>
  191. <script>
  192. function Save(type) {
  193. type = type || $("#hid_Type").val();
  194. //var violationsNo = (type === "Add" || type === "Edit") ? $("#ID").val() : $('#dgTable').datagrid('getSelections')[0].ID;
  195. $.ajaxFileUpload({
  196. url: "@Url.Action("MarketSellerViolationsOper", "MarketSystem")",
  197. secureuri: false, //一般设置为false
  198. fileElementId: 'AttachFile',
  199. type: "post",
  200. dataType: "json",
  201. data: {
  202. Type: type,
  203. UploadFile: "true",
  204. ID: $("#ID").val(),
  205. ViolationTypeID: $("#ViolationTypeID").val(),
  206. SellerRewardTypeID: $("#SellerRewardTypeID").val(),
  207. MarketID: $("#MarketID").val(),
  208. MarketSellerID: $("#MarketSellerID").val(),
  209. LogContent: $("#LogContent").val(),
  210. LogDate: $("#LogDate").val(),
  211. FileTitle: $("#FileTitle").val()
  212. },
  213. success: function (data) {
  214. if (CheckAajxData(data) === false) return;
  215. var msg = data.ErrorInfo;
  216. if (data.Success === true) {
  217. LoadTable();
  218. $("#winModal").window("close");
  219. layer.alert(msg, { icon: 1, title: '提示信息' });
  220. } else {
  221. layer.alert(msg, { icon: 7, title: '提示信息' });
  222. }
  223. }
  224. });
  225. }
  226. //添加
  227. function btn_Add() {
  228. $("#hid_Type").val("Add");
  229. $("#winModal input").val("");
  230. $("#winModal select").val("");
  231. $("#winModal textarea").val("");
  232. $("#Save span.l-btn-text").html("添加");
  233. GetMarketSellerSelStr();
  234. ClearFile("#AttachFile");
  235. $("#winModal").window("open");
  236. }
  237. //修改
  238. function btn_Edit() {
  239. $("#hid_Type").val("Edit");
  240. $("#Save span.l-btn-text").html("修改");
  241. SetModalVal();
  242. }
  243. //modal赋值
  244. function SetModalVal() {
  245. var rows = $('#dgTable').datagrid('getSelections');
  246. if (rows.length === 1) {
  247. var row = rows[0];
  248. //console.log(row);
  249. GetMarketSellerSelStr();
  250. //GetMarketSelStr();
  251. //SelectByText("#ViolationTypeID", row.ViolationTypeID);
  252. //SelectByText("#SellerRewardTypeID", row.SellerRewardTypeID);
  253. $("#MarketID").val(row.MarketID);
  254. $("#ID").val(row.ID);
  255. $("#MarketSellerID").val(row.SellerID);
  256. $("#ViolationTypeID").val(row.ViolationTypeID);
  257. $("#SellerRewardTypeID").val(row.SellerRewardTypeID);
  258. $("#LogContent").val(row.LogContent);
  259. $("#LogDate").val(row.LogDate);
  260. $("#FileTitle").val("");
  261. ClearFile("#AttachFile");
  262. if ($("#hid_Type").val()==="Edit") {
  263. $("#winModal").window("open");
  264. }
  265. } else {
  266. layer.alert('请选择一条记录进行设置', {title:'提示信息'});
  267. }
  268. }
  269. //加载表格数据
  270. function LoadTable(value, item) {
  271. $('#dgTable').datagrid({
  272. url: '@Url.Action("MarketSellerViolationsListResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
  273. });
  274. }
  275. function SearchModal() {
  276. $('#winModal_Search').window({ "title": "搜索经营户" });
  277. //GetMarketSelStr();
  278. $("#dg_SearchMarketId").val($("#MarketID").val());
  279. DgSearchLoadTable();
  280. $('#winModal_Search').window('open');
  281. }
  282. function SetSearch() {
  283. var rows = $('#dgTable_Search').datagrid('getSelections');
  284. if (rows.length === 1) {
  285. var row = rows[0];
  286. //console.log(row);
  287. $("#MarketSellerID").val(row.SellerID);
  288. $('#winModal_Search').window('close');
  289. } else {
  290. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  291. }
  292. }
  293. //根据辖区获取市场下拉框的option
  294. function GetMarketSelStr() {
  295. $.ajax({
  296. url: "/GetResult/GetMarketSelStrResult",
  297. type: "post",
  298. dataType: "json",
  299. //data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  300. data: { RegionID: $("#dg_SearchRegionID").val() },
  301. success: function (data) {
  302. //console.log(msg);
  303. if (CheckAajxData(data) === false) return;
  304. var rows = data.rows;
  305. var str1 = "<option value=\"";
  306. var str2 = "";
  307. for (var i = 0; i < rows.length; i++) {
  308. str1 += (str1 === "<option value=\"" ? "" : "@@|@@") + rows[i].MarketID;
  309. str2 += "<option value=\"" + rows[i].MarketID + "\">" + rows[i].Names + "</option>";
  310. }
  311. str1 += "\">全部</option>";
  312. $('#dg_SearchMarketId').empty().html(str1 + str2);
  313. }
  314. });
  315. }
  316. //根据市场获取经营户下拉框的option
  317. function GetMarketSellerSelStr() {
  318. $.ajax({
  319. url: "/GetResult/GetMarketSellerSelStrResult",
  320. type: "post",
  321. dataType: "json",
  322. async: false,
  323. data: { marketId: $("#MarketID").val() },
  324. success: function (data) {
  325. if (CheckAajxData(data) === false) return;
  326. var rows = data.rows;
  327. var str1 = "<option value=\"\">请选择...</option>";
  328. var str2 = "";
  329. for (var i = 0; i < rows.length; i++) {
  330. str2 += "<option value=\"" + rows[i].SellerID + "\">" + rows[i].Name + "</option>";
  331. }
  332. $('#MarketSellerID').empty().html(str1 + str2);
  333. }
  334. });
  335. }
  336. function DgSearchLoadTable() {
  337. var marketId = $("#dg_SearchMarketId").val(),
  338. sellerName = $("#dg_SearchSellerName").val();
  339. $('#dgTable_Search').datagrid({
  340. url: '@Url.Action("SellerSearchResult", "GetResult")' + '?MarketID=' + marketId + '&MarketSellerName=' + escape(sellerName),
  341. columns: [
  342. [
  343. { field: 'MarketSellerName', title: '经营户名', width: 150, align: 'center' },
  344. { field: 'IdCard', title: '身份证', width: 180, align: 'center' },
  345. { field: 'EnterMarketDate', title: '入场时间', width: 180, align: 'center' },
  346. { field: 'Tel', title: '联系电话', width: 180, align: 'center' }
  347. ]
  348. ]
  349. });
  350. }
  351. $(function () {
  352. //加载表格数据
  353. var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
  354. LoadTable(value, item);
  355. //加载日历控件
  356. laydate({
  357. elem: '#LogDate',
  358. format: "YYYY-MM-DD",
  359. min: "1980-01-01",
  360. event: "focus"
  361. });
  362. });
  363. </script>
  364. </body>
  365. </html>