daily.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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. </style>
  121. <body class="clearfix">
  122. <div class="dailybox">
  123. <div class="message_title " style="margin-bottom:8px;">
  124. 您当前的操作 · <b><span class="red2">{$data.company_name}每天报表明细</span></b>
  125. <div class="wdatepicker" style="display:none;">
  126. {if $is_manager == 1}
  127. <select class="left validbox" name="org_id" id="org_id">
  128. <option value="">==部门==</option>
  129. {volist name="org_list" id="vo"}
  130. <option value="{$vo.id}">{$vo.name}</option>
  131. {/volist}
  132. </select>
  133. <select class="left validbox" name="employee_id" id="employee_id">
  134. <option value="">==业务员==</option>
  135. {volist name="employee_list" id="vo"}
  136. <option value="{$vo.id}">{$vo.name}</option>
  137. {/volist}
  138. </select>
  139. {/if}
  140. <select class="left validbox" name="wuxiao" id="valid">
  141. <option value="">==包含==</option>
  142. <option value="1">统计无效</option>
  143. </select>
  144. <input name="nowyear" type="text" id="nowyear1" class="wdatebtn left" readonly="readonly" autocomplete="off" placeholder="选择月份">
  145. <button id="searchbtn1" class="btn left" type="button">查 看</button>
  146. </div>
  147. </div>
  148. <div class="wdatepicker2 tcenter">
  149. <div id="seafrom" class="inline-block clearfix" style="margin:0px">
  150. {if $is_manager == 1}
  151. <select class="left validbox" name="org_ids" id="org_ids">
  152. <option value="">==部门==</option>
  153. {volist name="org_list" id="vo"}
  154. <option value="{$vo.id}">{$vo.name}</option>
  155. {/volist}
  156. </select>
  157. <select class="left validbox" name="employee_ids" id="employee_ids">
  158. <option value="">==业务员==</option>
  159. {volist name="employee_list" id="vo"}
  160. <option value="{$vo.id}">{$vo.name}</option>
  161. {/volist}
  162. </select>
  163. {/if}
  164. <select class="left" name="wuxiao" id="wuxiao">
  165. <option value="">==包含==</option>
  166. <option value="1">统计无效</option>
  167. </select>
  168. <input name="nowyear" type="text" id="nowyear" class="wdatebtn left" readonly="readonly" placeholder="选择月份">
  169. <button id="searchbtn" class="btn left" type="button">查 看</button>
  170. </div>
  171. <div class="wdatefast2">
  172. 推荐检索:
  173. <a class="nowmonth" href="javascript:void(0)">本月度</a>
  174. <a class="lastmonth" href="javascript:void(0)">上个月</a>
  175. </div>
  176. </div>
  177. <div class="abouts tablemsgbox" style="display:none;">
  178. <h1>{$data.company_name}{if $is_manager neq 1}{$data.empname}{/if}<span class="month"></span>月份日报</h1>
  179. <table class="maintable tableother">
  180. <thead>
  181. <tr>
  182. <th rowspan="2">日期</th>
  183. <th colspan="9">基本数据</th>
  184. <th colspan="3" class="validnumbox" style="display:none;">注销</th>
  185. </tr>
  186. <tr>
  187. <th class="thtopline">信息量</th>
  188. <th class="thtopline">加微量</th>
  189. <th class="thtopline">加微率</th>
  190. <th class="thtopline">进群量</th>
  191. <th class="thtopline">进群率</th>
  192. <th class="thtopline">见面量</th>
  193. <th class="thtopline">合同量</th>
  194. <th class="thtopline">定金量</th>
  195. <th class="thtopline">业绩总额</th>
  196. <th class="thtopline fontnormal validnumbox" style="display:none;">无效</th>
  197. <th class="thtopline fontnormal validnumbox" style="display:none;">有效</th>
  198. <th class="thtopline fontnormal validnumbox" style="display:none;">见面</th>
  199. </tr>
  200. </thead>
  201. <tbody class="tbodybox">
  202. </tbody>
  203. </table>
  204. </div>
  205. <div class="abouts" style="text-align:right; color:#999; padding-bottom:15px; line-height:23px;">
  206. 注:<br>
  207. 1、基本数据:线索是根据信息录入的报名认时间统计。<br>
  208. 2、基本数据:加微是根据信息录入的时报名时间统计。<br>
  209. 3、基本数据:见面到访是根据首次洽谈的时间统计。<br>
  210. 4、基本数据:预定合同是根据定金时间统计,和报名、见面到访时间无关。<br>
  211. 5、基本数据:施工合同是根据合同时间统计,和报名、见面到访时间无关。<br>
  212. 6、注销:线索是根据变更线索无效的默认时间统计,和线索报名无关。<br>
  213. 7、注销:见面到访是根据首次洽谈时间统计,和线索报名时间无关。
  214. </div>
  215. </div>
  216. <div id="loading-mask">
  217. <div><img src="__STATIC__/img/large-loading.gif" />
  218. <p>...加载中...</p>
  219. </div>
  220. </div>
  221. </body>
  222. <script src="__LAYUI__/layui/layui.js"></script>
  223. {/block}{block name="js"}
  224. <script type="text/html" id="designer_name">
  225. {{# if(d.designer){ }}
  226. <span>{{d.designer.name}}</span>
  227. {{# }else{ }}
  228. <span style="color: #cccccc;">无</span>
  229. {{# } }}
  230. </script>
  231. <script type="text/javascript">
  232. var reload = null, resizefun = null;
  233. layui.config({
  234. base: '__LAYUI__/',
  235. urlbase: '/sys'
  236. }).extend({
  237. index: 'lib/index' //主入口模块
  238. }).use(['table', 'laydate'], function () {
  239. var table = layui.table, laydate = layui.laydate,
  240. $ = layui.$;
  241. let date=new Date();
  242. let year=date.getFullYear();
  243. let month = date.getMonth()*1+1;
  244. let time='', validtype='', employee_id , org_id;
  245. let todayDate = year+'-'+ (month<10?'0'+month:month);
  246. laydate.render({
  247. elem: '#nowyear', //指定元素
  248. type: 'month',
  249. value: todayDate,
  250. min: -90,
  251. max:0
  252. ,trigger:'click'
  253. });
  254. $('.lastmonth').click(function () {
  255. if (!$('#nowyear').val()) {
  256. alert('提示:请务必选择统计时间')
  257. return false;
  258. }
  259. validtype = $('#wuxiao').val();
  260. time = getPreMonth();
  261. employee_id = $('#employee_ids').val();
  262. org_id = $('#org_ids').val();
  263. $('.month').html(time.split('-')[1]);
  264. laydate.render({
  265. elem: '#nowyear', //指定元素
  266. type: 'month',
  267. value: time,
  268. min: -90,
  269. max: 0
  270. ,trigger:'click'
  271. });
  272. laydate.render({
  273. elem: '#nowyear1', //指定元素
  274. type: 'month',
  275. value: time,
  276. min: -90,
  277. max: 0
  278. ,trigger:'click'
  279. });
  280. $('.wdatepicker2').hide();
  281. $('.wdatepicker').show();
  282. $('.tablemsgbox').show();
  283. dailyfun(time);
  284. })
  285. $('.nowmonth').click(function () {
  286. if (!$('#nowyear').val()) {
  287. alert('提示:请务必选择统计时间')
  288. return false;
  289. }
  290. let date = new Date();
  291. let year = date.getFullYear();
  292. let month = date.getMonth() * 1 + 1;
  293. validtype = $('#wuxiao').val();
  294. employee_id = $('#employee_ids').val();
  295. org_id = $('#org_ids').val();
  296. time = year+'-'+ (month<10?'0'+month:month);
  297. $('.month').html(time.split('-')[1]);
  298. laydate.render({
  299. elem: '#nowyear', //指定元素
  300. type: 'month',
  301. value: time,
  302. min: -90,
  303. max: 0
  304. ,trigger:'click'
  305. });
  306. laydate.render({
  307. elem: '#nowyear1', //指定元素
  308. type: 'month',
  309. value: time,
  310. min: -90,
  311. max: 0
  312. ,trigger:'click'
  313. });
  314. $('.wdatepicker2').hide();
  315. $('.wdatepicker').show();
  316. $('.tablemsgbox').show();
  317. dailyfun(time);
  318. })
  319. $("#searchbtn1").click(function () {
  320. if (!$('#nowyear').val()) {
  321. alert('提示:请务必选择统计时间')
  322. return false;
  323. }
  324. validtype= $('#valid').val();
  325. time = $('#nowyear1').val();
  326. employee_id = $('#employee_id').val();
  327. org_id = $('#org_id').val();
  328. $('.month').html(time.split('-')[1]);
  329. laydate.render({
  330. elem: '#nowyear', //指定元素
  331. type: 'month',
  332. value: time,
  333. min: -90,
  334. max: 0
  335. ,trigger:'click'
  336. });
  337. $('.wdatepicker2').hide();
  338. $('.wdatepicker').show();
  339. $('.tablemsgbox').show();
  340. dailyfun(time);
  341. })
  342. $('#searchbtn').click(function(){
  343. if(!$('#nowyear').val()){
  344. alert('提示:请务必选择统计时间')
  345. return false;
  346. }
  347. validtype = $('#wuxiao').val();
  348. time= $('#nowyear').val();
  349. employee_id = $('#employee_ids').val();
  350. org_id = $('#org_ids').val();
  351. $('.month').html(time.split('-')[1]);
  352. laydate.render({
  353. elem: '#nowyear1', //指定元素
  354. type: 'month',
  355. value: time,
  356. min: -90,
  357. max: 0
  358. ,trigger:'click'
  359. });
  360. $('.wdatepicker2').hide();
  361. $('.wdatepicker').show();
  362. $('.tablemsgbox').show();
  363. dailyfun(time);
  364. })
  365. resizefun = function () {
  366. dailyfun(time);
  367. };
  368. reload = function () {
  369. dailyfun(time);
  370. };
  371. function dailyfun(time) {
  372. $('#loading-mask').show();
  373. $.ajax({
  374. url: '{:url("community/daily")}'
  375. , data: {
  376. date: time,
  377. employee_id: employee_id,
  378. org_id: org_id
  379. }
  380. , type: 'post'
  381. , success: function (res) {
  382. if (res.code == 0) {
  383. let str="";
  384. if(!validtype){
  385. for(let j=0;j<$('.validnumbox').length;j++){
  386. $($('.validnumbox')[j]).hide();
  387. }
  388. }else{
  389. for (let j = 0; j < $('.validnumbox').length; j++) {
  390. $($('.validnumbox')[j]).show();
  391. }
  392. }
  393. for(let i in res.data){
  394. if(res.data[i].day!='求和'){
  395. str+=`<tr>
  396. <td>${res.data[i].day}<em class="weekday">${res.data[i].week}</em></td>
  397. <td title="信息量" class="${res.data[i].new_cus ? '' : 'baobaonum1'}">${res.data[i].new_cus?('<a class="divlayer" time="' + res.data[i].day +'" empid="'+res.data[i].nowempid+'" orgid="'+res.data[i].noworgid+'" text="addnew" title="' + res.data[i].day + '新增加客户数" href="javascript:void(0)">' + res.data[i].new_cus + '</a>') :res.data[i].new_cus}</td>
  398. <td title="加微量" class="${res.data[i].jv ? '' : 'baobaonum1'}">${res.data[i].jv}</td>
  399. <td title="加微率" class="${res.data[i].jv_percen ? '' : 'baobaonum1'}">${res.data[i].jv_percen}</td>
  400. <td title="进群量" class="${res.data[i].jq ? '' : 'baobaonum1'}">${res.data[i].jq}</td>
  401. <td title="进群率" class="${res.data[i].jq_percen ? '' : 'baobaonum1'}">${res.data[i].jq_percen}%</td>
  402. <td title="见面量" class="${res.data[i].meet_cont ? '' : 'baobaonum1'}">${res.data[i].meet_cont? ('<a class="divlayer" time="' + res.data[i].day +'" empid="'+res.data[i].nowempid+'" orgid="'+res.data[i].noworgid+'" text="到访" title="' + res.data[i].day + '见面线索明细" href="javascript:void(0)">' + res.data[i].meet_cont + '</a>') :res.data[i].meet_cont}</td>
  403. <td title="定金量" class="${res.data[i].deposit_cont ?'':'baobaonum1'}">${res.data[i].deposit_cont? ('<a class="divlayer" time="' + res.data[i].day +'" empid="'+res.data[i].nowempid+'" orgid="'+res.data[i].noworgid+'" text="交定" title="' + res.data[i].day + '定金客户明细" href="javascript:void(0)">' + res.data[i].deposit_cont + '</a>'): res.data[i].deposit_cont}</td>
  404. <td title="合同量" class="${res.data[i].sign_cont ?'':'baobaonum1'}">${res.data[i].sign_cont?('<a class="divlayer" time="' + res.data[i].day +'" empid="'+res.data[i].nowempid+'" orgid="'+res.data[i].noworgid+'" text="签单" title="' + res.data[i].day + '签单客户明细" href="javascript:void(0)">' + res.data[i].sign_cont + '</a>'): res.data[i].sign_cont}</td>
  405. <td title="业绩总额" class="${res.data[i].basic_money ?'':'baobaonum1'}">${res.data[i].basic_money}</td>
  406. <td title="无效线索注销量" class="validnumbox ${res.data[i].invalid_no ?'':'baobaonum1'}">${res.data[i].invalid_no}</td>
  407. <td title="有效线索注销量" class="validnumbox ${res.data[i].invalid_yes ?'':'baobaonum1'}">${res.data[i].invalid_yes}</td>
  408. <td title="见面注销量" class="validnumbox ${res.data[i].invalid_meet ?'':'baobaonum1'}">${res.data[i].invalid_meet}</td>
  409. </tr>`;
  410. }else{
  411. str+=`<tr id="totalRow">
  412. <td>${res.data[i].day}</td>
  413. <td class="${res.data[i].new_cus ? '' : 'baobaonum1'}">${res.data[i].new_cus}</td>
  414. <td class="${res.data[i].jv ? '' : 'baobaonum1'}">${res.data[i].jv}</td>
  415. <td class="${res.data[i].jv_percen ? '' : 'baobaonum1'}">${res.data[i].jv_percen}</td>
  416. <td class="sum_youxiao ${res.data[i].jq ? '' : 'baobaonum1'}">${res.data[i].jq}</td>
  417. <td class="sum_youxiao_percent ${res.data[i].jq_percen ? '' : 'baobaonum1'}">${res.data[i].jq_percen}%</td>
  418. <td class="sum_daofang ${res.data[i].meet_cont ? '' : 'baobaonum1'}">${res.data[i].meet_cont}</td>
  419. <td class="${res.data[i].deposit_cont ?'':'baobaonum1'}">${res.data[i].deposit_cont}</td>
  420. <td class="${res.data[i].sign_cont ?'':'baobaonum1'}">${res.data[i].sign_cont}</td>
  421. <td class="${res.data[i].basic_money ?'':'baobaonum1'}">${res.data[i].basic_money}</td>
  422. <td class="validnumbox ${res.data[i].invalid_no?'':'baobaonum1'}">${res.data[i].invalid_no}</td>
  423. <td class="validnumbox ${res.data[i].invalid_yes ?'':'baobaonum1'}">${res.data[i].invalid_yes}</td>
  424. <td class="validnumbox ${res.data[i].invalid_meet ?'':'baobaonum1'}">${res.data[i].invalid_meet}</td>
  425. </tr>`;
  426. }
  427. }
  428. $('.tbodybox').html(str);
  429. if (!validtype) {
  430. for (let j = 0; j < $('.validnumbox').length; j++) {
  431. $($('.validnumbox')[j]).hide();
  432. }
  433. } else {
  434. for (let j = 0; j < $('.validnumbox').length; j++) {
  435. $($('.validnumbox')[j]).show();
  436. }
  437. }
  438. $(".maintable td").mouseover(function () {
  439. if ($(this).text() == 0 || $(this).text() > 999999999) { $(this).html($(this).text()) }
  440. if ($(this).children("a").length > 0) { $(this).addClass("ablock2"); }
  441. }).mouseout(function () { $(this).removeClass("ablock2"); });
  442. $('.divlayer').on('click', function () {
  443. // date=>2022-11-14 - 2022-11-24
  444. let date= $(this).attr('time');
  445. if(!date){
  446. date= res.data[res.data.length-2].day +' 到 '+ res.data[0].day;
  447. }else{
  448. date= date + ' 到 ' + date;
  449. }
  450. layer.open({
  451. type: 2,
  452. title: $(this).attr('title'),
  453. shadeClose: true,
  454. scrollbar: false,
  455. shade: 0.8,
  456. area: ['99%', '96%'],
  457. content: "{:url('community/new_daily_detail')}?date="+ date +'&empid='+ $(this).attr('empid') +'&state='+ $(this).attr('text') +'&orgid='+ $(this).attr('orgid'),
  458. });
  459. });
  460. }else if(res.code == 403){
  461. $(".exitbtn").trigger("click");
  462. } else {
  463. alert(res.msg)
  464. }
  465. $('#loading-mask').hide();
  466. }
  467. });
  468. }
  469. })
  470. function getNowMonth() {
  471. var date = new Date();
  472. var year = date.getFullYear();
  473. var month = date.getMonth() + 1;
  474. month = month > 9 ? month : "0" + month;
  475. var nowMonth = year + "-" + month;
  476. return nowMonth;
  477. }
  478. /**获取上一个月 */
  479. function getPreMonth() {
  480. var arr = getNowMonth().split("-");
  481. var year = arr[0]; //获取当前日期的年份
  482. var month = arr[1]; //获取当前日期的月份
  483. var year2 = year;
  484. var month2 = parseInt(month) - 1;
  485. if (month2 == 0) {
  486. //1月的上一月是前一年的12月
  487. year2 = parseInt(year2) - 1;
  488. month2 = 12;
  489. }
  490. var preMonth = year2+'-'+ (month2<10?'0'+month2:month2);
  491. return preMonth;
  492. }
  493. </script>
  494. {/block}