1
0

invalid_report.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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: 180px;
  36. height: 28px;
  37. line-height: 26px;
  38. text-align: center;
  39. border: 1px solid #4479ba;
  40. vertical-align: top;
  41. }
  42. #searchbtn,
  43. #searchbtn1 {
  44. vertical-align: top;
  45. }
  46. .btn {
  47. cursor: pointer;
  48. color: #000;
  49. background: url(__STATIC__/img/btn_bg.gif) repeat-x;
  50. border: 1px solid #C0C0C0;
  51. padding: 0 12px;
  52. *padding: 0 6px;
  53. height: 28px;
  54. }
  55. .abouts {
  56. width: 99%;
  57. position: relative;
  58. margin-bottom: 15px;
  59. margin-top: 5px;
  60. }
  61. .wdatepicker {
  62. top: 15px;
  63. right: 69px;
  64. position: absolute;
  65. }
  66. .abouts h1 {
  67. text-align: center;
  68. margin-bottom: 20px;
  69. margin-top: 20px;
  70. letter-spacing: 2px;
  71. font-family: Arial, Helvetica, sans-serif;
  72. }
  73. .tableother {
  74. text-align: center;
  75. }
  76. .maintable {
  77. table-layout: fixed;
  78. _width: 100%;
  79. width: 100%;
  80. border: 1px solid #DFDFDF;
  81. border-collapse: separate !important;
  82. background-color: #FFF;
  83. border-right: 0;
  84. border-bottom: 2px solid #DFDFDF;
  85. }
  86. .maintable th {
  87. background-color: #F2F3F7;
  88. border-right: 1px solid #DFDFDF;
  89. border-bottom: 1px solid #DFDFDF;
  90. line-height: 25px;
  91. padding: 5px;
  92. text-align: center;
  93. font-family: Arial;
  94. font-size: 12px;
  95. letter-spacing: 1px;
  96. color: #333
  97. }
  98. .maintable td {
  99. border-right: 1px solid #DFDFDF;
  100. border-bottom: 1px solid #EAEAEC;
  101. padding: 7px;
  102. line-height: 25px;
  103. font-size: 13px;
  104. position: relative;
  105. }
  106. .tablelist th,
  107. .tablelist td {
  108. overflow: hidden;
  109. white-space: nowrap;
  110. text-overflow: ellipsis;
  111. word-wrap: break-word;
  112. }
  113. .tbcenter td {
  114. text-align: center
  115. }
  116. .maintable h2 {
  117. border-bottom: 1px solid #999;
  118. margin: 0;
  119. font-weight: bold;
  120. font-size: 15px;
  121. margin-bottom: 10px;
  122. margin-top: 5px;
  123. text-indent: 3px;
  124. font-family: Arial;
  125. letter-spacing: 1px;
  126. }
  127. .maintable td label {
  128. cursor: pointer
  129. }
  130. .baobaonum1 {
  131. color: #CCC
  132. }
  133. .baobaonum1 a {
  134. color: #CCC
  135. }
  136. .fontnormal {
  137. font-weight: normal;
  138. }
  139. .ablock td a {
  140. width: 100%;
  141. height: 28px;
  142. display: block;
  143. }
  144. .ablock2 {
  145. background-color: #d0af4c;
  146. font-weight: bold;
  147. }
  148. .ablock2 a {
  149. width: 100%;
  150. height: 100%;
  151. display: block;
  152. text-decoration: none
  153. }
  154. .ablock2 a:hover {
  155. color: #0000FF;
  156. text-decoration: underline
  157. }
  158. #loading-mask {
  159. position: fixed;
  160. top: 0;
  161. left: 0;
  162. width: 100%;
  163. height: 100%;
  164. background: rgba(0, 0, 0, 0.7);
  165. z-index: 15000;
  166. display: none
  167. }
  168. #loading-mask div {
  169. width: 25%;
  170. height: 179px;
  171. position: absolute;
  172. top: 40%;
  173. left: 50%;
  174. -webkit-transform: translate(-50%, -50%);
  175. transform: translate(-50%, -50%);
  176. border-radius: 10px;
  177. background-color: #FFFFFF;
  178. text-align: center
  179. }
  180. #loading-mask div img {
  181. padding-top: 40px;
  182. }
  183. #loading-mask div p {
  184. padding-top: 25px;
  185. color: #006600
  186. }
  187. .weekday {
  188. position: absolute;
  189. right: 0;
  190. bottom: -5px;
  191. text-decoration: none;
  192. font-size: 8px;
  193. color: #CCC;
  194. font-style: normal;
  195. }
  196. .wdatefast {
  197. width: 290px;
  198. height: 35px;
  199. line-height: 35px;
  200. top: 48px;
  201. right: 48px;
  202. position: absolute;
  203. background-color: #FCFCFC;
  204. text-indent: 20px;
  205. font-family: Arial;
  206. }
  207. .wdatefast a {
  208. padding-left: 6px;
  209. padding-right: 6px;
  210. }
  211. .wdatefast2 a {
  212. padding-left: 6px;
  213. padding-right: 6px;
  214. color: #0033CC;
  215. }
  216. </style>
  217. <body class="clearfix">
  218. <div class="dailybox">
  219. <div class="message_title " style="margin-bottom:8px;">
  220. 您当前的操作 · <b><span class="red2">各渠道账户无效数据报表</span></b>
  221. <div class="wdatepicker" style="display:none;">
  222. <input name="nowyear1" type="text" id="select_date1" class="wdatebtn left" readonly="readonly" placeholder="开始时间 到 结束时间">
  223. <button id="searchbtn1" class="btn left" type="button">查 看</button>
  224. </div>
  225. <div class="wdatefast" style="display:none;">
  226. 推荐检索:
  227. <a class="nowmonth" href="javascript:void(0)">本月度</a>
  228. <a class="lastmonth" href="javascript:void(0)">上个月</a>
  229. <a class="nowyearbtn" href="javascript:void(0)">本年度</a>
  230. </div>
  231. </div>
  232. <div class="wdatepicker2 tcenter">
  233. <div id="seafrom" class="inline-block clearfix" style="margin:0px">
  234. <input name="nowyear" type="text" id="select_date" class="wdatebtn left" readonly="readonly" placeholder="开始时间 到 结束时间">
  235. <button id="searchbtn" class="btn left" type="button">查 看</button>
  236. </div>
  237. <div class="wdatefast2">
  238. 推荐检索:
  239. <a class="nowmonth" href="javascript:void(0)">本月度</a>
  240. <a class="lastmonth" href="javascript:void(0)">上个月</a>
  241. <a class="nowyearbtn" href="javascript:void(0)">本年度</a>
  242. </div>
  243. </div>
  244. <div class="abouts tablemsgbox" style="display:none;">
  245. <h1>{$data.company_name}各渠道无效报表</h1>
  246. <table class="maintable tableother">
  247. <thead>
  248. <tr>
  249. <th rowspan="2" width="75">渠道</th>
  250. <th colspan="2">基本数据</th>
  251. <th colspan="10">无效理由</th>
  252. </tr>
  253. <tr>
  254. <th class="thtopline">线索</th>
  255. <th class="thtopline">无效线索</th>
  256. <th class="thtopline fontnormal">同行</th>
  257. <th class="thtopline fontnormal">空错号</th>
  258. <th class="thtopline fontnormal">不是本人</th>
  259. <th class="thtopline fontnormal">局部装修</th>
  260. <th class="thtopline fontnormal">超服务区域</th>
  261. <th class="thtopline fontnormal">与内部撞单</th>
  262. <th class="thtopline fontnormal">多次联系不上</th>
  263. <th class="thtopline fontnormal">装修预算太低</th>
  264. <th class="thtopline fontnormal">没有装修需求</th>
  265. <th class="thtopline fontnormal">精装修</th>
  266. </tr>
  267. </thead>
  268. <tbody class="tbodybox">
  269. </tbody>
  270. </table>
  271. </div>
  272. <div class="abouts" style="text-align:right; color:#999; padding-bottom:15px; line-height:23px;">
  273. 注:<br>
  274. 1、基本数据:线索是根据信息录入的报名认时间统计。<br>
  275. 2、基本数据:加微是根据信息录入的时报名时间统计。<br>
  276. 3、基本数据:见面到访是根据首次洽谈的时间统计。<br>
  277. 4、基本数据:预定合同是根据定金时间统计,和报名、见面到访时间无关。<br>
  278. 5、基本数据:施工合同是根据合同时间统计,和报名、见面到访时间无关。<br>
  279. 6、注销:线索是根据变更线索无效的默认时间统计,和线索报名无关。<br>
  280. 7、注销:见面到访是根据首次洽谈时间统计,和线索报名时间无关。
  281. </div>
  282. </div>
  283. <div id="loading-mask">
  284. <div><img src="__STATIC__/img/large-loading.gif" />
  285. <p>...加载中...</p>
  286. </div>
  287. </div>
  288. </body>
  289. <script src="__LAYUI__/layui/layui.js"></script>
  290. {/block}{block name="js"}
  291. <script type="text/html" id="designer_name">
  292. {{# if(d.designer){ }}
  293. <span>{{d.designer.name}}</span>
  294. {{# }else{ }}
  295. <span style="color: #cccccc;">无</span>
  296. {{# } }}
  297. </script>
  298. <script type="text/javascript">
  299. var reload = null, resizefun = null;
  300. layui.config({
  301. base: '__LAYUI__/',
  302. urlbase: '/sys'
  303. }).extend({
  304. index: 'lib/index' //主入口模块
  305. }).use(['table', 'laydate'], function () {
  306. var table = layui.table, laydate = layui.laydate,
  307. $ = layui.$;
  308. let date=new Date();
  309. let year=date.getFullYear();
  310. let month = date.getMonth()*1+1;
  311. let day= date.getDate();
  312. let time='';
  313. laydate.render({
  314. elem: '#select_date'
  315. , type: 'date'
  316. , range: '到'
  317. , trigger: 'click'//呼出事件改成click
  318. , max:0
  319. });
  320. laydate.render({
  321. elem: '#select_date1'
  322. , type: 'date'
  323. , range: '到'
  324. , trigger: 'click'//呼出事件改成click
  325. , max:0
  326. });
  327. $('.nowyearbtn').click(function () {
  328. let date = new Date();
  329. let year = date.getFullYear();
  330. time = year + '-1-1' + ' 到 ' + year+'-12-31';
  331. laydate.render({
  332. elem: '#select_date1'
  333. , type: 'date'
  334. , range: '到'
  335. , trigger: 'click'//呼出事件改成click
  336. , value: time
  337. , max:0
  338. });
  339. $('.wdatepicker2').hide();
  340. $('.wdatepicker').show();
  341. $('.tablemsgbox').show();
  342. $('.wdatefast').show();
  343. dailyfun(time);
  344. })
  345. $('.lastmonth').click(function () {
  346. // 2022-11-01 - 2022-11-26
  347. const getLastMonthLast = () => {
  348. const date = new Date()
  349. // 获取上个月的最后一天是几号day
  350. const day = new Date(date.getFullYear(), date.getMonth(), 0).getDate()
  351. const enddate = new Date(date.getFullYear(), date.getMonth() - 1, day)
  352. return enddate
  353. }
  354. $('.wdatefast').show();
  355. time = getPreMonth()+'-1 到 '+ getPreMonth()+'-'+ getLastMonthLast().getDate();
  356. laydate.render({
  357. elem: '#select_date1'
  358. , type: 'date'
  359. , range: '到'
  360. , trigger: 'click'//呼出事件改成click
  361. , value: time
  362. , max:0
  363. });
  364. $('.wdatepicker2').hide();
  365. $('.wdatepicker').show();
  366. $('.tablemsgbox').show();
  367. dailyfun(time);
  368. })
  369. $('.nowmonth').click(function () {
  370. // 2022-11-01 - 2022-11-26
  371. let date = new Date();
  372. let year = date.getFullYear();
  373. let month = date.getMonth() * 1 + 1;
  374. $('.wdatefast').show();
  375. time = year+'-'+ month+'-1'+ ' 到 ' + getLastDay();
  376. laydate.render({
  377. elem: '#select_date1'
  378. , type: 'date'
  379. , range: '到'
  380. , trigger: 'click'//呼出事件改成click
  381. , value: time
  382. , max:0
  383. });
  384. $('.wdatefast').show();
  385. $('.wdatepicker2').hide();
  386. $('.wdatepicker').show();
  387. $('.tablemsgbox').show();
  388. dailyfun(time);
  389. })
  390. $("#searchbtn1").click(function () {
  391. if (!$('#select_date1').val()) {
  392. alert('提示:请务必选择统计时间')
  393. return false;
  394. }
  395. time = $('#select_date1').val();
  396. laydate.render({
  397. elem: '#select_date'
  398. , type: 'date'
  399. , range: '到'
  400. , trigger: 'click'//呼出事件改成click
  401. , value: time
  402. , max:0
  403. });
  404. $('.wdatefast').show();
  405. $('.wdatepicker2').hide();
  406. $('.wdatepicker').show();
  407. $('.tablemsgbox').show();
  408. dailyfun(time);
  409. })
  410. $('#searchbtn').click(function(){
  411. if(!$('#select_date').val()){
  412. alert('提示:请务必选择统计时间')
  413. return false;
  414. }
  415. time= $('#select_date').val();
  416. laydate.render({
  417. elem: '#select_date1'
  418. , type: 'date'
  419. , range: '到'
  420. , trigger: 'click'//呼出事件改成click
  421. ,value: time
  422. , max:0
  423. });
  424. $('.wdatefast').show();
  425. $('.wdatepicker2').hide();
  426. $('.wdatepicker').show();
  427. $('.tablemsgbox').show();
  428. dailyfun();
  429. })
  430. resizefun = function () {
  431. dailyfun();
  432. };
  433. reload = function () {
  434. dailyfun();
  435. };
  436. function dailyfun() {
  437. $('#loading-mask').show();
  438. $.ajax({
  439. url: '{:url("empcrm/invalid_report")}'
  440. , data: {
  441. date: time,
  442. }
  443. , type: 'post'
  444. , success: function (res) {
  445. if (res.code == 0) {
  446. let str="";
  447. for(let i in res.data){
  448. str += `<tr>
  449. <td>${res.data[i].name}</td>
  450. <td class="${res.data[i].clue_cont ? '' : 'baobaonum1'}">${res.data[i].clue_cont}</td>
  451. <td class="${res.data[i].invalid_no ? '' : 'baobaonum1'}">${res.data[i].invalid_no}</td>
  452. <td class="${res.data[i].remark1 ? '' : 'baobaonum1'}">${res.data[i].remark1}</td>
  453. <td class="${res.data[i].remark2 ? '' : 'baobaonum1'}">${res.data[i].remark2}</td>
  454. <td class="${res.data[i].remark3 ? '' : 'baobaonum1'}">${res.data[i].remark3}</td>
  455. <td class="${res.data[i].remark4 ? '' : 'baobaonum1'}">${res.data[i].remark4}</td>
  456. <td class="${res.data[i].remark5 ? '' : 'baobaonum1'}">${res.data[i].remark5}</td>
  457. <td class="${res.data[i].remark6 ? '' : 'baobaonum1'}">${res.data[i].remark6}</td>
  458. <td class="${res.data[i].remark7 ? '' : 'baobaonum1'}">${res.data[i].remark7}</td>
  459. <td class="${res.data[i].remark8 ? '' : 'baobaonum1'}">${res.data[i].remark8}</td>
  460. <td class="${res.data[i].remark9 ? '' : 'baobaonum1'}">${res.data[i].remark9}</td>
  461. <td class="${res.data[i].remark10 ? '' : 'baobaonum1'}">${res.data[i].remark10}</td>
  462. </tr>`;
  463. }
  464. $('.tbodybox').html(str);
  465. }else if(res.code == 403){
  466. $(".exitbtn").trigger("click");
  467. } else {
  468. alert(res.msg)
  469. }
  470. $('#loading-mask').hide();
  471. }
  472. });
  473. }
  474. })
  475. // 本月最后一天
  476. function getLastDay() {
  477. var y = new Date().getFullYear(); //获取年份
  478. var m = new Date().getMonth() + 1; //获取月份
  479. var d = new Date(y, m, 0).getDate(); //获取当月最后一日
  480. m = m < 10 ? '0' + m : m; //月份补 0
  481. d = d < 10 ? '0' + d : d; //日数补 0
  482. return [y, m, d].join("-")
  483. }
  484. function getNowMonth() {
  485. var date = new Date();
  486. var year = date.getFullYear();
  487. var month = date.getMonth() + 1;
  488. month = month > 9 ? month : "0" + month;
  489. var nowMonth = year + "-" + month;
  490. return nowMonth;
  491. }
  492. /**获取上一个月 */
  493. function getPreMonth() {
  494. var arr = getNowMonth().split("-");
  495. var year = arr[0]; //获取当前日期的年份
  496. var month = arr[1]; //获取当前日期的月份
  497. var year2 = year;
  498. var month2 = parseInt(month) - 1;
  499. if (month2 == 0) {
  500. //1月的上一月是前一年的12月
  501. year2 = parseInt(year2) - 1;
  502. month2 = 12;
  503. }
  504. var preMonth = year2 + "-" + month2;
  505. return preMonth;
  506. }
  507. </script>
  508. {/block}