year_report.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. {extend name="public/layout"}
  2. {block name="body"}
  3. <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
  4. <link rel="stylesheet" " href=" /static/css/common.css">
  5. <script src="/static/js/jquery.min.js"></script>
  6. <style>
  7. body{
  8. background-color: #F3F3F3;
  9. padding-bottom: 40px;
  10. }
  11. .message_title{
  12. border: 1px solid #F0F0F0;
  13. background: #FCFCFC;
  14. margin-top: 5px;
  15. margin-bottom: 10px;
  16. position: relative;
  17. min-width: 800px;
  18. padding: 18px;
  19. }
  20. .wdatepicker2 {
  21. width: fit-content;
  22. margin: 50px auto;
  23. position: relative;
  24. }
  25. select {
  26. height: 26px;
  27. line-height: auto;
  28. vertical-align: middle;
  29. box-sizing: content-box;
  30. font-size: 13px;
  31. -webkit-appearance: menulist-button;
  32. border: #CCC solid 1px;
  33. }
  34. .wdatebtn {
  35. width: 84px;
  36. height: 28px;
  37. line-height: 26px;
  38. text-align: center;
  39. border: 1px solid #4479ba;
  40. vertical-align: top;
  41. }
  42. #searchbtn,#searchbtn1 {
  43. vertical-align: top;
  44. }
  45. .btn {
  46. cursor: pointer;
  47. color: #000;
  48. background: url(__STATIC__/img/btn_bg.gif) repeat-x;
  49. border: 1px solid #C0C0C0;
  50. padding: 0 12px;
  51. *padding: 0 6px;
  52. height: 28px;
  53. }
  54. .abouts {
  55. width: 99%;
  56. position: relative;
  57. margin-bottom: 15px;
  58. margin-top: 5px;
  59. }
  60. .wdatepicker {
  61. top: 15px;
  62. right: 69px;
  63. position: absolute;
  64. }
  65. .abouts h1 {
  66. text-align: center;
  67. margin-bottom: 20px;
  68. margin-top: 20px;
  69. letter-spacing: 2px;
  70. font-family: Arial, Helvetica, sans-serif;
  71. }
  72. .tableother {
  73. text-align: center;
  74. }
  75. .maintable{table-layout:fixed;_width:100%;width:100%; border:1px solid #DFDFDF;border-collapse: separate !important;background-color:#FFF; border-right:0; border-bottom:2px solid #DFDFDF;}
  76. .maintable th{ background-color:#F2F3F7; border-right:1px solid #DFDFDF; border-bottom:1px solid #DFDFDF; line-height:25px; padding:5px; text-align:center; font-family:Arial; font-size:12px; letter-spacing:1px; color:#333}
  77. .maintable td{border-right:1px solid #DFDFDF; border-bottom:1px solid #EAEAEC; padding:7px; line-height:25px; font-size:13px; position:relative;}
  78. .tablelist th,.tablelist td{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;word-wrap: break-word;}
  79. .tbcenter td{ text-align:center}
  80. .maintable h2{border-bottom:1px solid #999; margin:0; font-weight:bold; font-size:15px; margin-bottom:10px; margin-top:5px; text-indent:3px; font-family:Arial; letter-spacing:1px;}
  81. .maintable td label{ cursor:pointer}
  82. .baobaonum1{ color:#CCC}
  83. .baobaonum1 a{ color:#CCC}
  84. .fontnormal {
  85. font-weight: normal;
  86. }
  87. .ablock td a{ width:100%; height:28px; display:block;}
  88. .ablock2{ background-color:#d0af4c; font-weight:bold;}
  89. .ablock2 a{ width:100%; height:100%; display:block;text-decoration:none}
  90. .ablock2 a:hover{ color:#0000FF; text-decoration:underline}
  91. #loading-mask{position: fixed;top: 0;left: 0; width: 100%;height: 100%;background: rgba(0, 0, 0, 0.7);z-index: 15000; display:none}
  92. #loading-mask div{
  93. width: 25%;
  94. height: 179px;
  95. position: absolute;
  96. top: 40%;
  97. left: 50%;
  98. -webkit-transform: translate(-50%, -50%);
  99. transform: translate(-50%, -50%);
  100. border-radius: 10px;
  101. background-color:#FFFFFF;
  102. text-align:center
  103. }
  104. #loading-mask div img{ padding-top:40px;}
  105. #loading-mask div p{ padding-top:25px; color:#006600}
  106. .weekday {
  107. position: absolute;
  108. right: 0;
  109. bottom: -5px;
  110. text-decoration: none;
  111. font-size: 8px;
  112. color: #CCC;
  113. font-style: normal;
  114. }
  115. .wdatefast2 a {
  116. padding-left: 6px;
  117. padding-right: 6px;
  118. color: #0033CC;
  119. }
  120. table{table-layout:fixed;word-break:break-all;}
  121. td{word-wrap:break-word}
  122. </style>
  123. <body class="clearfix">
  124. <div class="dailybox">
  125. <div class="message_title " style="margin-bottom:8px;">
  126. 您当前的操作 · <b><span class="red2">{$data.company_name}各月份报表</span></b>
  127. <div class="wdatepicker" style="display:none;">
  128. <input name="nowyear" type="text" id="nowyear1" class="wdatebtn left" readonly="readonly" placeholder="选择年份">
  129. <button id="searchbtn1" class="btn left" type="button">查 看</button>
  130. </div>
  131. </div>
  132. <div class="wdatepicker2 tcenter">
  133. <div id="seafrom" class="inline-block clearfix" style="margin:0px">
  134. <input name="nowyear" type="text" id="nowyear" class="wdatebtn left" readonly="readonly" placeholder="选择年份">
  135. <button id="searchbtn" class="btn left" type="button">查 看</button>
  136. </div>
  137. <div class="wdatefast2">
  138. 推荐检索:
  139. <a class="nowmonth" href="javascript:void(0)"></a>
  140. </div>
  141. </div>
  142. <div class="abouts tablemsgbox" style="display:none;">
  143. <h1>{$data.company_name}各月份报表</h1>
  144. <table class="maintable tableother">
  145. <thead>
  146. <tr>
  147. <th rowspan="2" width="50">月份</th>
  148. <th rowspan="2" width='100'>推广<br>消费</th>
  149. <th colspan="4">推广数据</th>
  150. <th colspan="13">基本数据</th>
  151. <th rowspan="2">ROI</th>
  152. <th colspan="2">注销</th>
  153. </tr>
  154. <tr>
  155. <th class="thtopline">展现</th>
  156. <th class="thtopline">点击</th>
  157. <th class="thtopline">点击率</th>
  158. <th class="thtopline" title="线索转化比">转化比</th>
  159. <th class="thtopline">线索量</th>
  160. <th class="thtopline">线索单价</th>
  161. <th class="thtopline">有效量</th>
  162. <th class="thtopline">有效单价</th>
  163. <th class="thtopline">有效率</th>
  164. <th class="thtopline">见面量</th>
  165. <th class="thtopline">见面率</th>
  166. <th class="thtopline">见面单价</th>
  167. <th class="thtopline">预定合同</th>
  168. <th class="thtopline">成单率</th>
  169. <th class="thtopline">施工合同</th>
  170. <!-- <th class="thtopline" title="套餐整装或基础合同额">基本金额</th>
  171. <th class="thtopline" title="软装、电器、定制等合同额">其他金额</th> -->
  172. <th class="thtopline">业绩总额</th>
  173. <th class="thtopline">均单值</th>
  174. <th class="thtopline fontnormal">见面</th>
  175. <th class="thtopline fontnormal">定金</th>
  176. </tr>
  177. </thead>
  178. <tbody class="tbodybox">
  179. </tbody>
  180. </table>
  181. </div>
  182. <div class="abouts" style="text-align:right; color:#999; padding-bottom:15px; line-height:23px;">
  183. 注:<br>
  184. 1、基本数据:线索是根据信息录入的报名认时间统计。<br>
  185. 2、基本数据:加微是根据信息录入的时报名时间统计。<br>
  186. 3、基本数据:见面到访是根据首次洽谈的时间统计。<br>
  187. 4、基本数据:预定合同是根据定金时间统计,和报名、见面到访时间无关。<br>
  188. 5、基本数据:施工合同是根据签单时间统计,和报名、见面到访时间无关。<br>
  189. 6、注销:线索是根据变更线索无效的默认时间统计,和线索报名无关。<br>
  190. 7、注销:见面到访是根据首次洽谈时间统计,和线索报名时间无关。
  191. </div>
  192. </div>
  193. <div id="loading-mask">
  194. <div><img src="__STATIC__/img/large-loading.gif" />
  195. <p>...加载中...</p>
  196. </div>
  197. </div>
  198. </body>
  199. <script src="__LAYUI__/layui/layui.js"></script>
  200. {/block}{block name="js"}
  201. <script type="text/html" id="designer_name">
  202. {{# if(d.designer){ }}
  203. <span>{{d.designer.name}}</span>
  204. {{# }else{ }}
  205. <span style="color: #cccccc;">无</span>
  206. {{# } }}
  207. </script>
  208. <script type="text/javascript">
  209. var reload = null, resizefun = null;
  210. layui.config({
  211. base: '__LAYUI__/',
  212. urlbase: '/sys'
  213. }).extend({
  214. index: 'lib/index' //主入口模块
  215. }).use(['table', 'laydate'], function () {
  216. var table = layui.table, laydate = layui.laydate,
  217. $ = layui.$;
  218. let date=new Date();
  219. let year=date.getFullYear();
  220. let time='', validtype='', employee_id='';
  221. laydate.render({
  222. elem: '#nowyear', //指定元素
  223. type: 'year',
  224. value: year,
  225. max:0
  226. , trigger: 'click'
  227. });
  228. laydate.render({
  229. elem: '#nowyear1', //指定元素
  230. type: 'year',
  231. value: year,
  232. trigger: 'click'
  233. });
  234. $('.nowmonth').html(year+'年');
  235. $('.nowmonth').click(function () {
  236. if (!$('#nowyear').val()) {
  237. alert('提示:请务必选择统计时间')
  238. return false;
  239. }
  240. let date = new Date();
  241. let year = date.getFullYear();
  242. $('.wdatepicker2').hide();
  243. $('.wdatepicker').show();
  244. $('.tablemsgbox').show();
  245. time = year;
  246. dailyfun();
  247. })
  248. $("#searchbtn1").click(function () {
  249. if (!$('#nowyear').val()) {
  250. alert('提示:请务必选择统计时间')
  251. return false;
  252. }
  253. time = $('#nowyear1').val();
  254. $('.wdatepicker2').hide();
  255. $('.wdatepicker').show();
  256. $('.tablemsgbox').show();
  257. dailyfun();
  258. })
  259. $('#searchbtn').click(function(){
  260. if(!$('#nowyear').val()){
  261. alert('提示:请务必选择统计时间')
  262. return false;
  263. }
  264. time= $('#nowyear').val();
  265. laydate.render({
  266. elem: '#nowyear1', //指定元素
  267. type: 'year',
  268. value: time,
  269. trigger: 'click'
  270. });
  271. $('.wdatepicker2').hide();
  272. $('.wdatepicker').show();
  273. $('.tablemsgbox').show();
  274. dailyfun();
  275. })
  276. resizefun = function () {
  277. dailyfun();
  278. };
  279. reload = function () {
  280. dailyfun();
  281. };
  282. function dailyfun() {
  283. $('#loading-mask').show();
  284. $.ajax({
  285. url: '{:url("ManagerEmp/year_report")}'
  286. , data: {
  287. date: time
  288. }
  289. , type: 'post'
  290. , success: function (res) {
  291. if (res.code == 0) {
  292. let str="";
  293. for(let i in res.data){
  294. if(res.data[i].month!='求和'){
  295. if(!isNaN(res.data[i].exten_money)){
  296. numberflt = res.data[i].exten_money;
  297. }else{
  298. numberflt = res.data[i].exten_money.toFixed(2);
  299. }
  300. str+=`<tr>
  301. <td>${res.data[i].month=='求和'?res.data[i].month:(res.data[i].month+'月')}</td>
  302. <td title="推广消费" class="${res.data[i].exten_money ? '' : 'baobaonum1'}">${numberflt}</td>
  303. <td title="展现量" class="${res.data[i].exten_show ? '' : 'baobaonum1'}">${res.data[i].exten_show}</td>
  304. <td title="点击数" class="${res.data[i].exten_click ? '' : 'baobaonum1'}">${res.data[i].exten_click}</td>
  305. <td title="点击率" class="${res.data[i].click_percen ? '' : 'baobaonum1'}">${res.data[i].click_percen}</td>
  306. <td title="点击转化比例" class="${res.data[i].clue_conversion ? '' : 'baobaonum1'}">${res.data[i].clue_conversion}</td>
  307. <td title="线索量" class="${res.data[i].clue_cont ? '' : 'baobaonum1'}">${res.data[i].clue_cont}</td>
  308. <td title="线索单价" class="${res.data[i].clue_money ? '' : 'baobaonum1'}">${res.data[i].clue_money}</td>
  309. <td title="有效量" class="${res.data[i].valid_cont ? '' : 'baobaonum1'}">${res.data[i].valid_cont}</td>
  310. <td title="有效单价" class="${res.data[i].valid_money ? '' : 'baobaonum1'}">${res.data[i].valid_money}</td>
  311. <td title="有效率" class="youxiao_percent ${res.data[i].valid_percen ? '' : 'baobaonum1'}">${res.data[i].valid_percen}%</td>
  312. <td title="见面量" class="${res.data[i].meet_cont ? '' : 'baobaonum1'}">${res.data[i].meet_cont}</td>
  313. <td title="见面率" class="jianmian_percent ${res.data[i].meet_percen ? '' : 'baobaonum1'}">${res.data[i].meet_percen}%</td>
  314. <td title="见面单价" class="${res.data[i].meet_money ? '' : 'baobaonum1'}">${res.data[i].meet_money}</td>
  315. <td title="预定合同量" class="${res.data[i].deposit_cont ? '' : 'baobaonum1'}">${res.data[i].deposit_cont}</td>
  316. <td title="成单率" class="chengdan_percent ${res.data[i].deposit_percen ? '' : 'baobaonum1'}">${res.data[i].deposit_percen}%</td>
  317. <td title="施工合同量" class="${res.data[i].sign_cont ? '' : 'baobaonum1'}">${res.data[i].sign_cont}</td>
  318. <td title="业绩总额" class="${res.data[i].basic_money ? '' : 'baobaonum1'}">${res.data[i].basic_money}</td>
  319. <td title="均单值" class="${res.data[i].sign_agv_money ? '' : 'baobaonum1'}">${res.data[i].sign_agv_money}</td>
  320. <td title="ROI" class="${res.data[i].ROI ? '' : 'baobaonum1'}">${res.data[i].ROI}</td>
  321. <td title="见面注销量" class="${res.data[i].invalid_meet ? '' : 'baobaonum1'}">${res.data[i].invalid_meet}</td>
  322. <td title="定金注销量" class="${res.data[i].invalid_deposit ? '' : 'baobaonum1'}">${res.data[i].invalid_deposit}</td>
  323. </tr>`;
  324. }else{
  325. str+=`<tr>
  326. <td>${res.data[i].month}</td>
  327. <td title="推广消费" class="${res.data[i].exten_money ? '' : 'baobaonum1'}">${res.data[i].exten_money}</td>
  328. <td title="展现量" class="${res.data[i].exten_show ? '' : 'baobaonum1'}">${res.data[i].exten_show}</td>
  329. <td title="点击数" class="${res.data[i].exten_click ? '' : 'baobaonum1'}">${res.data[i].exten_click}</td>
  330. <td title="点击率" class="${res.data[i].click_percen ? '' : 'baobaonum1'}">${res.data[i].click_percen}</td>
  331. <td title="点击转化比例" class="${res.data[i].clue_conversion ? '' : 'baobaonum1'}">${res.data[i].clue_conversion}</td>
  332. <td title="线索量" class="${res.data[i].clue_cont ? '' : 'baobaonum1'}">${res.data[i].clue_cont}</td>
  333. <td title="线索单价" class="${res.data[i].clue_money ? '' : 'baobaonum1'}">${res.data[i].clue_money}</td>
  334. <td title="有效量" class="${res.data[i].valid_cont ? '' : 'baobaonum1'}">${res.data[i].valid_cont}</td>
  335. <td title="有效单价" class="${res.data[i].valid_money ? '' : 'baobaonum1'}">${res.data[i].valid_money}</td>
  336. <td title="有效率" class="youxiao_percent ${res.data[i].valid_percen ? '' : 'baobaonum1'}">${res.data[i].valid_percen}%</td>
  337. <td title="见面量" class="${res.data[i].meet_cont ? '' : 'baobaonum1'}">${res.data[i].meet_cont}</td>
  338. <td title="见面率" class="jianmian_percent ${res.data[i].meet_percen ? '' : 'baobaonum1'}">${res.data[i].meet_percen}%</td>
  339. <td title="见面单价" class="${res.data[i].meet_money ? '' : 'baobaonum1'}">${res.data[i].meet_money}</td>
  340. <td title="预定合同量" class="${res.data[i].deposit_cont ? '' : 'baobaonum1'}">${res.data[i].deposit_cont}</td>
  341. <td title="成单率" class="chengdan_percent ${res.data[i].deposit_percen ? '' : 'baobaonum1'}">${res.data[i].deposit_percen}%</td>
  342. <td title="施工合同量" class="${res.data[i].sign_cont ? '' : 'baobaonum1'}">${res.data[i].sign_cont}</td>
  343. <td title="业绩总额" class="${res.data[i].all_money ? '' : 'baobaonum1'}">${res.data[i].all_money}</td>
  344. <td title="均单值" class="${res.data[i].sign_agv_money ? '' : 'baobaonum1'}">${res.data[i].sign_agv_money}</td>
  345. <td title="ROI" class="${res.data[i].ROI ? '' : 'baobaonum1'}">${res.data[i].ROI}</td>
  346. <td title="见面注销量" class="${res.data[i].invalid_meet ? '' : 'baobaonum1'}">${res.data[i].invalid_meet}</td>
  347. <td title="定金注销量" class="${res.data[i].invalid_deposit ? '' : 'baobaonum1'}">${res.data[i].invalid_deposit}</td>
  348. </tr>`;
  349. }
  350. }
  351. $('.tbodybox').html(str);
  352. }else if(res.code == 403){
  353. $(".exitbtn").trigger("click");
  354. } else {
  355. alert(res.msg)
  356. }
  357. $('#loading-mask').hide();
  358. }
  359. });
  360. }
  361. })
  362. function getNowMonth() {
  363. var date = new Date();
  364. var year = date.getFullYear();
  365. var month = date.getMonth() + 1;
  366. month = month > 9 ? month : "0" + month;
  367. var nowMonth = year + "-" + month;
  368. return nowMonth;
  369. }
  370. /**获取上一个月 */
  371. function getPreMonth() {
  372. var arr = getNowMonth().split("-");
  373. var year = arr[0]; //获取当前日期的年份
  374. var month = arr[1]; //获取当前日期的月份
  375. var year2 = year;
  376. var month2 = parseInt(month) - 1;
  377. if (month2 == 0) {
  378. //1月的上一月是前一年的12月
  379. year2 = parseInt(year2) - 1;
  380. month2 = 12;
  381. }
  382. var preMonth = year2 + "-" + month2;
  383. return preMonth;
  384. }
  385. </script>
  386. {/block}