MarketChartList.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>MarketChartList</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. <div id="BodyDiv">
  28. <section class="hidden">
  29. <input id="hid_Type" name="hid_Type" type="hidden" value="0"/>
  30. </section>
  31. <section style="height: 95vh; padding: 10px 20px;">
  32. <div class="row tbToolBar" id="tbToolBar">
  33. <div class="toolbar">
  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-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  37. </div>
  38. <div class="toolbar-search">
  39. <div id="Search" class="easyui-panel" title="请展开面板输入查询条件" style="width: 300px; height: 330px; padding: 10px;"
  40. data-options="iconCls:'icon-heart',collapsible:true,minimizable:false,maximizable:false,closable:false,collapsed:true,tools:[
  41. {
  42. iconCls:'icon-search',
  43. handler:function(){LoadTable(true)}
  44. }]">
  45. <table>
  46. <tr>
  47. <td><label for="SearchRegionID">辖区工商</label></td>
  48. <td>
  49. <select class="easyui-combobox" type="text" id="SearchRegionID" name="SearchRegionID" style="height: 25px; width: 150px" data-options="onSelect:function(){GetMarketSelStr()}">
  50. <option value="">全部</option>
  51. @Html.Raw(ViewBag.SelRegionInfo)
  52. </select>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td><label for="SearchMarketID">隶属市场</label></td>
  57. <td>
  58. <select class="easyui-combobox" type="text" id="SearchMarketID" name="SearchMarketID" style="height: 25px; width: 150px" data-options="">
  59. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  60. </select>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td><label for="SearchChartTypeID">图片类型</label></td>
  65. <td>
  66. <select class="easyui-combobox" type="text" id="SearchChartTypeID" name="SearchChartTypeID" style="height: 25px; width: 150px" data-options="">
  67. <option value="">全部</option>
  68. @Html.Raw(ViewBag.SelChartTypeInfo)
  69. </select>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td colspan="2" style="text-align: center; width: 100%">
  74. <a href="#" class="easyui-linkbutton" iconCls="icon-search" style="width: 100%; height: 25px" onclick="LoadTable(true);">查询</a>
  75. </td>
  76. </tr>
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  82. data-options="singleSelect: true,
  83. method: 'post',
  84. multiSort: false,
  85. toolbar: '#tbToolBar',
  86. fitColumns: true,
  87. @*rownumbers: true,*@
  88. remoteSort: false,
  89. @*loadFilter: pagerFilter,*@
  90. onDblClickRow: function () {
  91. btn_Detail();
  92. },
  93. pagination: true,
  94. pageSize: 50,
  95. pageList: [20, 50, 100]
  96. ">
  97. <thead>
  98. <tr>
  99. <th data-options="field:'ID',width:30">编号</th>
  100. <th data-options="field:'MarketName',width:150">市场名称</th>
  101. <th data-options="field:'ChartTypeID',width:100">图片类型</th>
  102. <th data-options="field:'UpdateTime',width:80">更新时间</th>
  103. </tr>
  104. </thead>
  105. </table>
  106. </section>
  107. <section>
  108. <div id="winModal_Upload" class="easyui-window winModal" title="市场管理网络及分布示意图上传" style="width: 450px; padding: 10px;"
  109. iconCls="icon-save" data-options="modal:true,closed:true">
  110. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  111. <div data-options="region:'center'" style="padding: 15px 25px 0;">
  112. <form id="form">
  113. @Html.Hidden("ID")
  114. <div class="panle-fluid">
  115. <div class="input-group">
  116. <label class="input-group-addon control-label" for="ChartTypeID">图片类型</label>
  117. <select class="form-control input-group-addon" type="text" id="ChartTypeID" name="ChartTypeID">
  118. @Html.Raw(ViewBag.SelChartTypeInfo)
  119. </select>
  120. </div>
  121. <div class="input-group">
  122. <label class="input-group-addon control-label" for="AttachFile">选择图片</label>
  123. <input class="form-control input-group-addon" aria-disabled="true" name="AttachFile" id="AttachFile" type="file" value="" placeholder="" onblur="CheckFileSize('AttachFile')"/>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  129. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width: 80px">上传</a>
  130. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Upload').window('close');" style="width: 80px">关闭</a>
  131. </div>
  132. </div>
  133. </div>
  134. <div id="winModal" class="easyui-window winModal" title="市场管理网络及分布示意图" style="width: 650px; padding: 10px;"
  135. iconCls="icon-save" data-options="modal:true,closed:true">
  136. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  137. <div data-options="region:'center'" style="padding: 15px 25px 0;">
  138. <!--StartPrint-->
  139. <div class="panle-fluid">
  140. <h4 class="text-center">
  141. <span id="DetailMarketName"></span>
  142. <span>——</span>
  143. <span id="DetailChartTypeID"></span>
  144. </h4>
  145. </div>
  146. <div class="panle-fluid">
  147. <img id="imgFile" src="" alt="" style="width: 100%; height: auto;"/>
  148. </div>
  149. <!--EndPrint-->
  150. <div class="" style="margin-bottom: 15px; text-align: center; display: @ViewBag.IsPrint; position: relative; z-index: 10000">
  151. <button type="button" style="margin-top: 15px;" onclick="Print();">直接打印</button>
  152. <button type="button" class="but5" onclick="PreView()">打印预览</button>
  153. </div>
  154. </div>
  155. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  156. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width: 80px">关闭</a>
  157. </div>
  158. </div>
  159. </div>
  160. </section>
  161. </div>
  162. <script>
  163. //加载表格数据
  164. function LoadTable(collapsed) {
  165. collapsed = collapsed || false;
  166. var marketId = $("input.textbox-value[name='SearchMarketID']").val(),
  167. chartTypeId = $("input.textbox-value[name='SearchChartTypeID']").val();
  168. if (collapsed === true) {
  169. $("#Search").panel("collapse", true);
  170. }
  171. $('#dgTable').datagrid({
  172. url: '@Url.Action("MarketChartQryResult", "GetResult")' +
  173. '?MarketID=' +
  174. escape(marketId) +
  175. '&ChartTypeID=' +
  176. escape(chartTypeId)
  177. });
  178. }
  179. function Save(type) {
  180. type = type || $("#hid_Type").val();
  181. $.ajaxFileUpload({
  182. url: "@Url.Action("MarketChartOper", "MarketSystem")",
  183. secureuri: false, //一般设置为false
  184. fileElementId: 'AttachFile',
  185. //contentType: "text/html",
  186. type: "post",
  187. dataType: "json",
  188. data: {
  189. Type: type,
  190. CurdType: type,
  191. UploadFile: "true",
  192. ID: $("#ID").val(),
  193. MarketID: $("#MarketID").val(),
  194. ChartTypeID: $("#ChartTypeID").val()
  195. },
  196. success: function(data) {
  197. if (CheckAajxData(data) === false) return;
  198. var msg = data.ErrorInfo;
  199. if (data.Success === true) {
  200. LoadTable();
  201. $("#winModal_Upload").window("close");
  202. layer.alert(msg, { icon: 1, title: '提示信息' });
  203. } else {
  204. layer.alert(msg, { icon: 7, title: '提示信息' });
  205. }
  206. }
  207. });
  208. }
  209. //添加
  210. function btn_Add() {
  211. $("#hid_Type").val("Add");
  212. $("#winModal input").val("");
  213. //$("#winModal textarea").val("");
  214. //$("#Save span.l-btn-text").html("添加");
  215. GetMarketSelStr();
  216. $("#winModal_Upload").window("open");
  217. }
  218. function btn_Detail() {
  219. var rows = $('#dgTable').datagrid('getSelections');
  220. if (rows.length === 1) {
  221. var row = rows[0];
  222. //GetSearchMarketSelStr();
  223. console.log(row);
  224. $("#ID").val(row.ID);
  225. $("#DetailMarketName").html(row.MarketName);
  226. $("#DetailChartTypeID").html(row.ChartTypeID);
  227. if (row.FilePath != null && row.FilePath !== "" && row.FileName != null && row.FileName !== "")
  228. $("#imgFile").attr({
  229. "src": "../" + row.FilePath + "/" + row.FileName,
  230. "alt": row.FileTitle
  231. });
  232. else
  233. $("#imgFile").attr({
  234. "src": "",
  235. "alt": "暂无" + row.ChartTypeID + "图片"
  236. });;
  237. $("#winModal").window("open");
  238. } else {
  239. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  240. }
  241. }
  242. //function FileDownload() {
  243. // var url = $("#FileDownload").attr("href");
  244. // if (url === "") {
  245. // layer.alert('当前没有附件可以下载查看!', { title: '提示信息' });
  246. // } else {
  247. // window.win = open(url);
  248. // setTimeout('win.document.execCommand("SaveAs")', 500);
  249. // }
  250. //}
  251. //根据辖区获取市场下拉框的option
  252. function GetMarketSelStr() {
  253. $.ajax({
  254. url: "/GetResult/GetMarketSelStrResult",
  255. type: "post",
  256. dataType: "json",
  257. data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  258. success: function(data) {
  259. //console.log(msg);
  260. if (CheckAajxData(data) === false) return;;
  261. var rows = data.rows;
  262. var first = "{\"MarketID\":\"";
  263. for (var i = 0; i < rows.length; i++) {
  264. first += (first === "{\"MarketID\":\"" ? "" : "@@|@@") + rows[i].MarketID;
  265. }
  266. first += "\",\"Names\":\"全部\"}";
  267. var firstJson = JSON.parse(first);
  268. rows.unshift(firstJson);
  269. console.log(rows);
  270. $('#SearchMarketID').combobox("clear").combobox({
  271. data: rows,
  272. valueField: 'MarketID',
  273. textField: 'Names',
  274. onLoadSuccess: function() {
  275. var val = $(this).combobox('getData');
  276. // ReSharper disable once MissingHasOwnPropertyInForeach
  277. for (var item in val[0]) {
  278. if (item === 'MarketID') {
  279. $(this).combobox('select', val[0][item]);
  280. }
  281. }
  282. }
  283. });
  284. }
  285. });
  286. }
  287. $(function() {
  288. GetMarketSelStr();
  289. //加载表格数据
  290. LoadTable();
  291. //加载日历控件
  292. });
  293. </script>
  294. </body>
  295. </html>