SellerViolationLogList.cshtml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>SellerViolationLogList_JN</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. <input id="hidSetSearch_Type" name="hidSetSearch_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"><a href="#" class="easyui-linkbutton" iconCls="icon-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  33. <span class="shuxian"></span>
  34. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  35. <span class="shuxian"></span>
  36. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  37. <span class="shuxian"></span>
  38. <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
  39. </div>
  40. <div class="toolbar-search">
  41. <span>【请选择查询条件】</span>
  42. <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
  43. <div id="search">
  44. <div data-options="name:'MarketSellerName'">经销单位</div>
  45. </div>
  46. </div>
  47. </div>
  48. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  49. data-options="singleSelect: true,
  50. method: 'post',
  51. multiSort: false,
  52. toolbar: '#tbToolBar',
  53. fitColumns: true,
  54. @*rownumbers: true,*@
  55. remoteSort: false,
  56. @*loadFilter: pagerFilter,*@
  57. onDblClickRow: function () {
  58. btn_Edit();
  59. },
  60. pagination: true,
  61. pageSize: 50,
  62. pageList: [20, 50, 100]
  63. ">
  64. <thead>
  65. <tr>
  66. <th data-options="field:'ID',width:20">编号</th>
  67. <th data-options="field:'MarketSellerName',width:180">经销单位</th>
  68. <th data-options="field:'MinusScore',width:80">扣分</th>
  69. <th data-options="field:'LogDate',width:80">记录日期</th>
  70. </tr>
  71. </thead>
  72. </table>
  73. </section>
  74. <section>
  75. <div id="winModal" class="easyui-window winModal" title="经营户经营行为信用状况维护" style="width: 450px; padding: 10px;"
  76. iconCls="icon-save" data-options="modal:true,closed:true">
  77. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  78. <div data-options="region:'center'" style="padding: 15px 25px 0;">
  79. <form id="form">
  80. @Html.Hidden("ID")
  81. <div class="panle-fluid">
  82. <div class="input-group">
  83. <label class="input-group-addon control-label" for="SellerID">经销单位</label>
  84. <select class="form-control input-group-addon" aria-disabled="true" name="SellerID" id="SellerID" type="text" value="" placeholder="选择经销单位">
  85. <option value="">请选择...</option>
  86. @Html.Raw(ViewBag.SelMarketSellersInfo)
  87. </select>
  88. <span class="input-group-addon" onclick="SearchModal('#Seller')" style="cursor: pointer;">
  89. <img src="~/easyui/themes/icons/zoom.bmp" />
  90. </span>
  91. </div>
  92. <div class="input-group">
  93. <label class="input-group-addon control-label" for="MinusScore">扣分</label>
  94. <input class="form-control input-group-addon" aria-disabled="true" name="MinusScore" id="MinusScore" type="text" value="" placeholder=""/>
  95. </div>
  96. <div class="input-group">
  97. <label class="input-group-addon control-label" for="Content">违规行为</label>
  98. <input class="form-control input-group-addon" aria-disabled="true" name="Content" id="Content" type="text" value="" placeholder="" />
  99. </div>
  100. <div class="input-group">
  101. <label class="input-group-addon control-label" for="LogDate">记录日期</label>
  102. <input class="form-control input-group-addon laydate-icon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder=""/>
  103. </div>
  104. <div class="input-group">
  105. <label class="input-group-addon control-label" for="Notes">备注信息</label>
  106. <textarea class="form-control input-group-addon" aria-disabled="true" name="Notes" id="Notes" type="text" value="" placeholder=""></textarea>
  107. </div>
  108. </div>
  109. </form>
  110. </div>
  111. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  112. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width: 80px">确认</a>
  113. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width: 80px">取消</a>
  114. </div>
  115. </div>
  116. </div>
  117. <div id="winModal_Detail" class="easyui-window winModal" title="经营户经营行为信用状况详情" style="width: 450px; padding: 10px;"
  118. iconCls="icon-save" data-options="modal:true,closed:true">
  119. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  120. <div data-options="region:'center'" style="padding: 15px 25px 0;">
  121. <form id="form_Detail">
  122. @Html.Hidden("ID")
  123. <div class="panle-fluid">
  124. <div class="input-group">
  125. <label class="input-group-addon control-label" for="SellerName_Detail">经销单位</label>
  126. <input class="form-control input-group-addon" aria-disabled="true" name="SellerName_Detail" id="SellerName_Detail" type="text" value="" placeholder="经销单位" />
  127. </div>
  128. <div class="input-group">
  129. <label class="input-group-addon control-label" for="MinusScore_Detail">扣分</label>
  130. <input class="form-control input-group-addon" aria-disabled="true" name="MinusScore_Detail" id="MinusScore_Detail" type="text" value="" placeholder="" />
  131. </div>
  132. <div class="input-group">
  133. <label class="input-group-addon control-label" for="Content_Detail">违规行为</label>
  134. <input class="form-control input-group-addon" aria-disabled="true" name="Content_Detail" id="Content_Detail" type="text" value="" placeholder="" />
  135. </div>
  136. <div class="input-group">
  137. <label class="input-group-addon control-label" for="LogDate_Detail">记录日期</label>
  138. <input class="form-control input-group-addon" aria-disabled="true" name="LogDate_Detail" id="LogDate_Detail" type="text" value="" placeholder="" />
  139. </div>
  140. <div class="input-group">
  141. <label class="input-group-addon control-label" for="Notes_Detail">备注信息</label>
  142. <textarea class="form-control input-group-addon" aria-disabled="true" name="Notes_Detail" id="Notes_Detail" type="text" value="" placeholder=""></textarea>
  143. </div>
  144. </div>
  145. </form>
  146. </div>
  147. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  148. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Detail').window('close');" style="width: 80px">取消</a>
  149. </div>
  150. </div>
  151. </div>
  152. <div id="winModal_Search" class="easyui-window winModal" title="" style="width: 750px; height: 600px; 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: 15px 5px 5px;">
  156. <div id="Search_Supplier">
  157. <div class="panle-half">
  158. <div class="input-group">
  159. <label class="input-group-addon control-label" for="dg_SearchHabitatID" style="min-width: 70px">省份</label>
  160. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchHabitatID" id="dg_SearchHabitatID" type="text" value="" placeholder="选择省份">
  161. <option value="">全部</option>
  162. @Html.Raw(ViewBag.SelHabitatInfo)
  163. </select>
  164. </div>
  165. </div>
  166. <div class="panle-half">
  167. <div class="input-group">
  168. <label class="input-group-addon control-label" for="dg_SearchSupplierName" style="min-width: 70px">供货商</label>
  169. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSupplierName" id="dg_SearchSupplierName" type="text" value="" placeholder=""/>
  170. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  171. </div>
  172. </div>
  173. </div>
  174. <div id="Search_Seller" style="display: none">
  175. <div class="panle-third">
  176. <div class="input-group">
  177. <label class="input-group-addon control-label" for="dg_SearchRegionID" style="min-width: 70px">所属辖区</label>
  178. <select class="form-control input-group-addon" type="text" id="dg_SearchRegionID" name="dg_SearchRegionID" onchange="GetMarketSelStr();">
  179. <option value="">全部</option>
  180. @Html.Raw(ViewBag.SelRegionInfo)
  181. </select>
  182. </div>
  183. </div>
  184. <div class="panle-third">
  185. <div class="input-group">
  186. <label class="input-group-addon control-label" for="dg_SearchMarketId" style="min-width: 70px">所属市场</label>
  187. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketId" id="dg_SearchMarketId" type="text" value="" placeholder="选择所属市场">
  188. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  189. </select>
  190. </div>
  191. </div>
  192. <div class="panle-third">
  193. <div class="input-group">
  194. <label class="input-group-addon control-label" for="dg_SearchSellerName" style="min-width: 70px">经营户名</label>
  195. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSellerName" id="dg_SearchSellerName" type="text" value="" placeholder=""/>
  196. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="panle-fluid" style="margin-top: 10px;">
  201. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 420px;"
  202. data-options="singleSelect: true,
  203. method: 'post',
  204. multiSort: false,
  205. toolbar: '#tbToolBar_Attach',
  206. fitColumns: true,
  207. @*rownumbers: true,*@
  208. remoteSort: false,
  209. @*loadFilter: pagerFilter,*@
  210. onDblClickRow: function () {
  211. SetSearch();
  212. },
  213. pagination: true,
  214. pageSize: 10,
  215. pageList: [10,20, 50, 100]
  216. ">
  217. <thead>
  218. <tr>
  219. @*<th data-options="field:'FileTitle',width:100">附件标题</th>
  220. <th data-options="field:'FileExt',width:60,">扩展名</th>
  221. <th data-options="field:'TimeLastMod',width:90,">上传日期</th>*@
  222. </tr>
  223. </thead>
  224. </table>
  225. </div>
  226. </div>
  227. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  228. <a class="easyui-linkbutton" id="Save_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width: 80px">确认</a>
  229. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width: 80px">搜索</a>
  230. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width: 80px">取消</a>
  231. </div>
  232. </div>
  233. </div>
  234. </section>
  235. <script>
  236. function Save(type) {
  237. type = type || $("#hid_Type").val();
  238. //var violationsNo = (type === "Add" || type === "Edit") ? $("#ID").val() : $('#dgTable').datagrid('getSelections')[0].ID;
  239. $.ajax({
  240. url: "@Url.Action("SellerViolationLogOper", "MarketSystemMg")",
  241. type: "post",
  242. dataType: "json",
  243. data: {
  244. Type: type,
  245. ID: $("#ID").val(),
  246. SellerID: $("#SellerID").val(),
  247. MinusScore: $("#MinusScore").val(),
  248. LogDate: $("#LogDate").val(),
  249. Content: $("#Content").val(),
  250. Notes: $("#Notes").val()
  251. },
  252. success: function(data) {
  253. if (CheckAajxData(data) === false) return;
  254. var msg = data.ErrorInfo;
  255. if (data.Success === true) {
  256. LoadTable();
  257. $("#winModal").window("close");
  258. layer.alert(msg, { icon: 1, title: '提示信息' });
  259. } else {
  260. layer.alert(msg, { icon: 7, title: '提示信息' });
  261. }
  262. }
  263. });
  264. }
  265. //添加
  266. function btn_Add() {
  267. $("#hid_Type").val("Add");
  268. $("#winModal input").val("");
  269. $("#winModal select").val("");
  270. $("#winModal textarea").val("");
  271. $("#Save span.l-btn-text").html("添加");
  272. GetMarketSellerSelStr();
  273. ClearFile("#AttachFile");
  274. $("#winModal").window("open");
  275. }
  276. //修改
  277. function btn_Edit() {
  278. $("#hid_Type").val("Edit");
  279. $("#Save span.l-btn-text").html("修改");
  280. SetModalVal();
  281. }
  282. function btn_Detail() {
  283. var rows = $('#dgTable').datagrid('getSelections');
  284. if (rows.length === 1) {
  285. var row = rows[0];
  286. //console.log(row);
  287. $("#ID").val(row.ID);
  288. $("#SellerName_Detail").val(row.MarketSellerName);
  289. $("#MinusScore_Detail").val(row.MinusScore);
  290. $("#LogDate_Detail").val(row.LogDate);
  291. $("#Content_Detail").val(row.Content);
  292. $("#Notes_Detail").val(row.Notes);
  293. $("#winModal_Detail").window("open");
  294. } else {
  295. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  296. }
  297. }
  298. //modal赋值
  299. function SetModalVal() {
  300. var rows = $('#dgTable').datagrid('getSelections');
  301. if (rows.length === 1) {
  302. var row = rows[0];
  303. //console.log(row);
  304. $("#ID").val(row.ID);
  305. $("#SellerID").val(row.SellerID);
  306. $("#MinusScore").val(row.MinusScore);
  307. $("#LogDate").val(row.LogDate);
  308. $("#Content").val(row.Content);
  309. $("#Notes").val(row.Notes);
  310. if ($("#hid_Type").val() === "Edit") {
  311. $("#winModal").window("open");
  312. }
  313. } else {
  314. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  315. }
  316. }
  317. function SearchModal(searchType) {
  318. if (searchType === "#Seller") {
  319. $('#winModal_Search').window({ "title": "搜索经销单位" });
  320. $("#hidSetSearch_Type").val("#SellerID");
  321. $("#Search_Supplier").hide();
  322. $("#Search_Seller").show();
  323. GetMarketSelStr();
  324. } else {
  325. $("#Search_Supplier").show();
  326. $("#hidSetSearch_Type").val("#SupplierID");
  327. $("#Search_Seller").hide();
  328. $('#winModal_Search').window({ "title": "搜索供货单位" });
  329. }
  330. DgSearchLoadTable();
  331. $('#winModal_Search').window('open');
  332. }
  333. function SetSearch(idStr) {
  334. idStr = idStr || $("#hidSetSearch_Type").val();
  335. var rows = $('#dgTable_Search').datagrid('getSelections');
  336. if (rows.length === 1) {
  337. var row = rows[0];
  338. console.log(row);
  339. if (idStr === "#SellerID") {
  340. $(idStr).val(row.SellerID);
  341. } else if (idStr === "#SupplierID") {
  342. $(idStr).val(row.SupplierID);
  343. }
  344. $('#winModal_Search').window('close');
  345. } else {
  346. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  347. }
  348. }
  349. //根据辖区获取市场下拉框的option
  350. function GetMarketSelStr() {
  351. $.ajax({
  352. url: "/GetResult/GetMarketSelStrResult",
  353. type: "post",
  354. dataType: "json",
  355. //data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  356. async: false,
  357. data: { RegionID: $("#dg_SearchRegionID").val() },
  358. success: function(data) {
  359. //console.log(msg);
  360. if (CheckAajxData(data) === false) return;
  361. var rows = data.rows;
  362. var str1 = "<option value=\"";
  363. var str2 = "";
  364. for (var i = 0; i < rows.length; i++) {
  365. str1 += (str1 === "<option value=\"" ? "" : "@@|@@") + rows[i].MarketID;
  366. str2 += "<option value=\"" + rows[i].MarketID + "\">" + rows[i].Names + "</option>";
  367. }
  368. str1 += "\">全部</option>";
  369. $('#dg_SearchMarketId').empty().html(str1 + str2);
  370. }
  371. });
  372. }
  373. function DgSearchLoadTable(searchType) {
  374. searchType = searchType || $("#hidSetSearch_Type").val();
  375. if (searchType === "#SellerID") {
  376. var marketId = $("#dg_SearchMarketId").val(),
  377. sellerName = $("#dg_SearchSellerName").val();
  378. $('#dgTable_Search').datagrid({
  379. url: '@Url.Action("SellerSearchResult", "GetResult")' + '?MarketID=' + marketId + '&MarketSellerName=' + sellerName,
  380. columns: [
  381. [
  382. { field: 'MarketSellerName', title: '经营户名', width: 150, align: 'center' },
  383. { field: 'IdCard', title: '身份证', width: 180, align: 'center' },
  384. { field: 'EnterMarketDate', title: '入场时间', width: 180, align: 'center' },
  385. { field: 'Tel', title: '联系电话', width: 180, align: 'center' }
  386. ]
  387. ]
  388. });
  389. } else {
  390. var habitatId = $("#dg_SearchHabitatID").val(),
  391. supplierName = $("#dg_SearchSupplierName").val();
  392. $('#dgTable_Search').datagrid({
  393. url: '@Url.Action("SupplierSearchResult", "GetResult")' +
  394. '?HabitatID=' +
  395. habitatId +
  396. '&SupplierName=' +
  397. supplierName,
  398. columns: [
  399. [
  400. { field: 'Name', title: '名称', width: 150, align: 'center' },
  401. { field: 'Linkman', title: '联系人', width: 100, align: 'center' },
  402. { field: 'Tel', title: '电话', width: 100, align: 'center' },
  403. { field: 'Address', title: '地址', width: 130, align: 'center' }
  404. ]
  405. ]
  406. });
  407. }
  408. }
  409. //加载表格数据
  410. function LoadTable(value, item) {
  411. $('#dgTable').datagrid({
  412. url: '@Url.Action("SellerViolationLogResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
  413. });
  414. }
  415. //根据市场获取经营户下拉框的option
  416. function GetMarketSellerSelStr() {
  417. $.ajax({
  418. url: "/GetResult/GetMarketSellerSelStrResult",
  419. type: "post",
  420. dataType: "json",
  421. async: false,
  422. data: { marketId: $("#MarketID").val() },
  423. success: function(data) {
  424. if (CheckAajxData(data) === false) return;
  425. var rows = data.rows;
  426. var str1 = "<option value=\"\">请选择...</option>";
  427. var str2 = "";
  428. for (var i = 0; i < rows.length; i++) {
  429. str2 += "<option value=\"" + rows[i].SellerID + "\">" + rows[i].Name + "</option>";
  430. }
  431. $('#MarketSellerID').empty().html(str1 + str2);
  432. }
  433. });
  434. }
  435. $(function() {
  436. //加载表格数据
  437. var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
  438. LoadTable(value, item);
  439. //加载日历控件
  440. laydate({
  441. elem: '#LogDate',
  442. format: "YYYY-MM-DD",
  443. min: "1980-01-01",
  444. event: "focus"
  445. });
  446. });
  447. </script>
  448. </body>
  449. </html>