Нет описания

marketInformationBriefing.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>市场信息简报</title>
  7. <!--[if lt IE 9]>
  8. <meta http-equiv="refresh" content="0;ie.html" />
  9. <![endif]-->
  10. <script src="../Script/Common/huayi.load.js"></script>
  11. <script src="../Script/Common/huayi.config.js"></script>
  12. <link rel="stylesheet" href="../js/layui/css/layui.css" />
  13. <link rel="stylesheet" href="../css/init.css" />
  14. <script src="../js/laydate/laydate.js"></script>
  15. <style>
  16. .zxt-top {
  17. background: #fefefe;
  18. height: 60px;
  19. padding: 10px 20px;
  20. }
  21. .topCon {
  22. float: right;
  23. margin-right: 45px;
  24. }
  25. .zxt-content {
  26. width: 90%;
  27. margin: 20px auto 0 auto;
  28. }
  29. .select2-container--default .select2-selection--single{
  30. border-color: #e5e6e7;
  31. }
  32. .time-box select{
  33. height: 32px;
  34. line-height: 32px;
  35. }
  36. .time-box select option{
  37. line-height: 32px;
  38. }
  39. .Shows {
  40. display: block !important;
  41. }
  42. .complain {
  43. display: none;
  44. }
  45. .daoHang {
  46. margin-bottom: 15px;
  47. }
  48. #main {
  49. width: 788.8px;
  50. margin: 0 auto;
  51. margin-top: 20px;
  52. -webkit-box-shadow: 1px 1px 9px 2px #D2D2D2;
  53. box-shadow: 1px 1px 9px 2px #D2D2D2;
  54. background-color: #fff;
  55. padding: 30px 60px 80px 60px;
  56. }
  57. .alignC {
  58. text-align: center;
  59. }
  60. .alignC h2 {
  61. font-family: "宋体";
  62. font-weight: bold;
  63. font-size: 22pt;
  64. letter-spacing: -1px;
  65. }
  66. .headerAlign h3 div:nth-of-type(1) {
  67. font-size: 14pt;
  68. padding-top: 20px;
  69. text-align: left;
  70. font-weight: normal;
  71. margin-left: 48px;
  72. }
  73. #main table {
  74. margin: 0 auto;
  75. width: 600px;
  76. border-collapse: collapse;
  77. font-size: 13pt;
  78. font-family: "仿宋";
  79. }
  80. #main table tr {
  81. min-height: 49px;
  82. }
  83. tbody td {
  84. min-width: 10%;
  85. padding: 6px 0 6px 0;
  86. }
  87. .alignC .tableHead {
  88. text-align: center;
  89. padding-left: 10px;
  90. font-weight: 600;
  91. }
  92. .btn {
  93. margin-top: 4px;
  94. margin-bottom: 4px;
  95. background: #00a1cb;
  96. color: #fff;
  97. }
  98. .time-box {
  99. display: inline-block;
  100. position: relative;
  101. }
  102. .toolLeft input {
  103. padding-right: 30px;
  104. width: 150px;
  105. }
  106. .tub {
  107. position: absolute;
  108. right: 8px;
  109. top: 5px;
  110. font-size: 18px;
  111. color: #00a0ca;
  112. }
  113. </style>
  114. </head>
  115. <body class="gray-bg">
  116. <div class="daoHang clearfix">
  117. <div class="dhLeft">
  118. <sapn>
  119. <i class="syIcon"></i>位置:
  120. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  121. <a href="javaScript:;">报表分析</a>&gt;
  122. <a href="javaScript:;">业务数据分析</a>&gt;
  123. <a href="" class="nowPosition">市场信息简报</a>
  124. </sapn>
  125. </div>
  126. <div class="dhRight">
  127. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  128. </div>
  129. </div>
  130. <div class="wrapper wrapper-content">
  131. <div class="Content_box">
  132. <div class="complain Shows">
  133. <div class="tab-content">
  134. <div class="tab-pane fade active in">
  135. <div class="zxt-top clearfix">
  136. <div class="topCon">
  137. <div class="form-inline th-bar clearfix">
  138. <div class="time-box form-group">
  139. <i class="tub fa fa-calendar"></i>
  140. <input class="form-control" type="text" id="startTime" placeholder="请选择时间" style="width: 228px;">
  141. </div>
  142. <div class="form-group tool_bars pull-right">
  143. <button class="btns sear">搜索</button>
  144. <a class="btns export">导出</a>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <!--startprint1-->
  150. <div id="main">
  151. <div class="alignC headerAlign">
  152. <br />
  153. <h2 style="margin-bottom: 15px;">市场信息简报</h2>
  154. </div>
  155. <table id="weeklist" class="alignC" border="1" cellpadding="4" cellspacing="0" bordercolor="#cbcbcb">
  156. </table>
  157. </div><!--endprint1-->
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <script>
  164. $(document).ready(function () {
  165. laydate.render({
  166. elem: '#startTime',
  167. range: '~',
  168. theme: '#1ab394',
  169. calendar: 'true'
  170. });
  171. initTableBrief();
  172. var myDate = new Date();
  173. $('#startTime').val(myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + "01" + " ~ " + myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()));
  174. function turn(aa) {
  175. if(aa < 10) {
  176. aa = "0" + aa;
  177. }
  178. return aa;
  179. }
  180. })
  181. //表格
  182. function initTableBrief(brieftype) {
  183. $.getJSON(huayi.config.callcenter_url + 'Business/MarketInformation', {
  184. sdate: $('#startTime').val() ? $('#startTime').val().split('~')[0]:"",
  185. edate: $('#startTime').val() ? $('#startTime').val().split('~')[1]:"",
  186. token: $.cookie("token")
  187. }, function (result) {
  188. if (result.state.toLowerCase() == "success") {
  189. var content = result.rows;
  190. $('#weeklist').html('');
  191. $("#weeklist").append(
  192. '<tr><td colspan="8"><h3>时间:<span class="startTimeBrief">-</span><span>至</span><span class="endTimeBrief">-</span></h3></td></tr>'+
  193. '<tr><td colspan="8" class="tableHead">产品投诉情况</td></tr>'
  194. )
  195. // 产品投诉
  196. for (var i=0; i < content.product.length; i+=2) {
  197. if(content.product[i+1] == undefined) {
  198. $("#weeklist").append(
  199. '<tr>'+
  200. '<td width="20%">'+
  201. content.product[i].name +
  202. '</td>'+
  203. '<td width="15%">'+
  204. '<span>'+
  205. content.product[i].number +
  206. '</span>'+
  207. '</td>'+
  208. '<td width="15%">'+
  209. '<span>'+
  210. content.product[i].Proportion +
  211. '</span>'+
  212. '</td>'+
  213. '<td width="20%">'+
  214. '</td>'+
  215. '<td width="15%">'+
  216. '<span>'+
  217. '</span>'+
  218. '</td>'+
  219. '<td width="15%">'+
  220. '<span>'+
  221. '</span>'+
  222. '</td>'+
  223. '</tr>'
  224. )
  225. } else {
  226. $("#weeklist").append(
  227. '<tr>'+
  228. '<td width="20%">'+
  229. content.product[i].name +
  230. '</td>'+
  231. '<td width="15%">'+
  232. '<span>'+
  233. content.product[i].number +
  234. '</span>'+
  235. '</td>'+
  236. '<td width="15%">'+
  237. '<span>'+
  238. content.product[i].Proportion +
  239. '</span>'+
  240. '</td>'+
  241. '<td width="20%">'+
  242. content.product[i+1].name +
  243. '</td>'+
  244. '<td width="15%">'+
  245. '<span>'+
  246. content.product[i+1].number +
  247. '</span>'+
  248. '</td>'+
  249. '<td width="15%">'+
  250. '<span>'+
  251. content.product[i+1].Proportion +
  252. '</span>'+
  253. '</td>'+
  254. '</tr>'
  255. )
  256. }
  257. }
  258. $("#weeklist").append(
  259. '<tr><td colspan="8">服务投诉情况</td></tr>'+
  260. '<tr><td colspan="8">涉媒投诉</td></tr>'+
  261. '<tr><td>'+ content.sediainvolved.name + '</td><td><span>'+ content.sediainvolved.number + '</span></td><td><span>'+content.sediainvolved.Proportion + '</span></td><td colspan="4"></td></tr>'+
  262. '<tr><td colspan="8" class="tableHead">市场抽检</td></tr>'+
  263. '<tr><td colspan="8" class="tableHead">其他信息</td></tr>'
  264. )
  265. addTime();
  266. }
  267. })
  268. }
  269. //搜索
  270. $(".sear").click(function () {
  271. initTableBrief();
  272. });
  273. //按回车搜索
  274. document.onkeydown = function (e) { // 回车提交表单
  275. var theEvent = window.event || e;
  276. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  277. if (code == 13) {
  278. initTableBrief();
  279. }
  280. }
  281. //导出
  282. $(".export").click(function () {
  283. var url = huayi.config.callcenter_url + "Business/MarketInformation?token=" + $.cookie("token");
  284. url += "&sdate=" + ($('#startTime').val() ? $('#startTime').val().split('~')[0] : '') + "&edate=" + ($('#startTime').val() ? $('#startTime').val().split('~')[1] : '') + "&isdc=1";
  285. $(".export").attr('href', url);
  286. });
  287. //添加时间
  288. function addTime() {
  289. var addStartTime = $('#startTime').val() ? $('#startTime').val().split('~')[0] : '';
  290. var addEndTime = $('#startTime').val() ? $('#startTime').val().split('~')[1] : '';
  291. $('.startTimeBrief' + '').html(addStartTime);
  292. $('.endTimeBrief' + '').html(addEndTime);
  293. }
  294. </script>
  295. </body>
  296. </html>