account_report.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  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. z-index:99;
  66. }
  67. .abouts h1 {
  68. text-align: center;
  69. margin-bottom: 20px;
  70. margin-top: 20px;
  71. letter-spacing: 2px;
  72. font-family: Arial, Helvetica, sans-serif;
  73. }
  74. .tableother {
  75. text-align: center;
  76. }
  77. .maintable {
  78. table-layout: fixed;
  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. position: relative;
  98. }
  99. .maintable td {
  100. border-right: 1px solid #DFDFDF;
  101. border-bottom: 1px solid #EAEAEC;
  102. padding: 7px;
  103. line-height: 25px;
  104. font-size: 13px;
  105. position: relative;
  106. }
  107. .tablelist th,
  108. .tablelist td {
  109. overflow: hidden;
  110. white-space: nowrap;
  111. text-overflow: ellipsis;
  112. word-wrap: break-word;
  113. }
  114. .tbcenter td {
  115. text-align: center
  116. }
  117. .maintable h2 {
  118. border-bottom: 1px solid #999;
  119. margin: 0;
  120. font-weight: bold;
  121. font-size: 15px;
  122. margin-bottom: 10px;
  123. margin-top: 5px;
  124. text-indent: 3px;
  125. font-family: Arial;
  126. letter-spacing: 1px;
  127. }
  128. .maintable td label {
  129. cursor: pointer
  130. }
  131. .baobaonum1 {
  132. color: #CCC
  133. }
  134. .baobaonum1 a {
  135. color: #CCC
  136. }
  137. .fontnormal {
  138. font-weight: normal;
  139. }
  140. .ablock td a {
  141. width: 100%;
  142. height: 28px;
  143. display: block;
  144. }
  145. .ablock2 {
  146. background-color: #d0af4c;
  147. font-weight: bold;
  148. }
  149. .ablock2 a {
  150. width: 100%;
  151. height: 100%;
  152. display: block;
  153. text-decoration: none
  154. }
  155. .ablock2 a:hover {
  156. color: #0000FF;
  157. text-decoration: underline
  158. }
  159. #loading-mask {
  160. position: fixed;
  161. top: 0;
  162. left: 0;
  163. width: 100%;
  164. height: 100%;
  165. background: rgba(0, 0, 0, 0.7);
  166. z-index: 15000;
  167. display: none
  168. }
  169. #loading-mask div {
  170. width: 25%;
  171. height: 179px;
  172. position: absolute;
  173. top: 40%;
  174. left: 50%;
  175. -webkit-transform: translate(-50%, -50%);
  176. transform: translate(-50%, -50%);
  177. border-radius: 10px;
  178. background-color: #FFFFFF;
  179. text-align: center
  180. }
  181. #loading-mask div img {
  182. padding-top: 40px;
  183. }
  184. #loading-mask div p {
  185. padding-top: 25px;
  186. color: #006600
  187. }
  188. .weekday {
  189. position: absolute;
  190. right: 0;
  191. bottom: -5px;
  192. text-decoration: none;
  193. font-size: 8px;
  194. color: #CCC;
  195. font-style: normal;
  196. }
  197. .wdatefast2 a {
  198. padding-left: 6px;
  199. padding-right: 6px;
  200. color: #0033CC;
  201. }
  202. .wdatefast {
  203. width: 290px;
  204. height: 35px;
  205. line-height: 35px;
  206. top: 38px;
  207. right: 48px;
  208. position: absolute;
  209. background-color: #FCFCFC;
  210. text-indent: 20px;
  211. font-family: Arial;
  212. }
  213. .wdatefast a {
  214. padding-left: 6px;
  215. padding-right: 6px;
  216. }
  217. .psinput{top:73px;left:0;width:236px;background: #fff;z-index: 999;position: absolute;box-shadow: 0 1px 10px #999;display: none;border-radius: 6px;overflow: visible;padding-top: 10px;}
  218. .dsa{width:100%;height: 100%;display:block;}
  219. .pdl12{padding-left:12px;}
  220. .search_btns{margin-top:11px;border-top:1px solid #ccc;}
  221. .search_btns div.button_{display: flex;width:80%;overflow: hidden;margin:0 auto;justify-content:space-between;padding: 5px 0;}
  222. .search_btns div.button_ a{cursor:pointer;}
  223. .scroll_body{overflow-x:auto;width:calc(100% - -17px)}
  224. .layui-table-body{overflow: visible;}
  225. .layui-form-select dl{z-index: 100;}
  226. .kwovsint{width:90%;height: 40px;display: block;border:1px solid #409EFF;border-radius: 6px;margin: 0 auto 6px;}
  227. .checkbox{width:20px;height: 20px;margin-top:15px;display: block;float:left;}
  228. .checkdeta{width:20px;height: 20px;margin-top:15px;display: block;float:left;}
  229. .psinput .layui-form-checkbox{display:block;float:left;width:20px;height: 20px;padding:0;}
  230. .psinput .layui-form-checkbox .layui-icon{display:block;float:left;width:20px !important;height: 20px !important;border: 1px solid #d2d2d2 !important;top:1px;position: unset !important;}
  231. .psinput .layui-form-checkbox .layui-icon::before{position: absolute;top:-4px;left:3px;font-size:14px;}
  232. .check_ul_list{max-height: 300px;overflow-y: auto;}
  233. .check_li{width:90%;margin:0 auto;overflow: hidden;}
  234. .check_li li{overflow: hidden;margin-bottom: 15px;}
  235. .check_name{float:left;line-height: 20px;font-size: 14px;margin-left:8px;}
  236. .dsnone .layui-form-checkbox{position: absolute;width: 25px;height: 28px;margin-top: 8px;visibility: hidden;}
  237. .button_ a{position:relative;}
  238. .triangle{width: 0; height: 0;float: left;border-bottom: 10px solid #fff;border-left: 10px solid transparent;border-right: 10px solid transparent;position: absolute;top: -10px;left: 14%;margin-left: -10px;}
  239. .psinput02{width:330px !important;margin-left: -165px !important;}
  240. .psinput02 .selecstDateBox{position: inherit !important;box-shadow:none;margin-top:5px;height: 80px !important;}
  241. .mapps{position: absolute;right:3%;top:13px;width:16px;}
  242. .checkAlls,.nocheckAlls,.btnbtn5,.mapps{cursor: pointer;}
  243. .mapps{position: absolute;right:3%;top:15px;width:12px;}
  244. ::-webkit-scrollbar {
  245. width: 4px;
  246. height: auto;
  247. }
  248. ::-webkit-scrollbar-thumb {
  249. border-radius: 1px;
  250. -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  251. background: #DFDFDF;
  252. }
  253. ::-webkit-scrollbar-track {
  254. -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
  255. border-radius: 1px;
  256. background: #f5f5f5;
  257. }
  258. /* #fixedHeader {
  259. position: sticky;
  260. top: 0px !important;
  261. background-color: #F2F3F7 !important;
  262. z-index: 9999;
  263. } */
  264. .tableBoxStyle {
  265. width: 100%;
  266. height: calc(100vh - 300px);
  267. overflow-y: auto;
  268. position: relative;
  269. margin-top: -75px;
  270. }
  271. .fixedTopPosition {
  272. position: absolute !important;
  273. top: 0px !important;
  274. }
  275. </style>
  276. <body class="clearfix">
  277. <div class="dailybox">
  278. <div class="message_title " style="margin-bottom:8px;">
  279. 您当前的操作 · <b><span class="red2">{$data.company_name}各客户来源报表</span></b>
  280. <div class="wdatepicker" style="display:none;">
  281. <select class="left validbox" name="org_id1" id="org_id1" >
  282. <option value="">==部门==</option>
  283. {volist name="org_list" id="vo"}
  284. <option value="{$vo.id}">{$vo.name}</option>
  285. {/volist}
  286. </select>
  287. <select class="left" name="employee_id" id="employee_id1">
  288. <option value="">==业务员==</option>
  289. {volist name="emplist" id="vo"}
  290. <option value="{$vo.id}">{$vo.name}</option>
  291. {/volist}
  292. </select>
  293. <select class="left validbox" name="wuxiao" id="valid">
  294. <option value="">==包含==</option>
  295. <option value="1">统计无效</option>
  296. <option value="2">统计推广</option>
  297. </select>
  298. <input name="nowyear" type="text" id="nowyear1" class="wdatebtn left" readonly="readonly" placeholder="开始时间 到 结束时间">
  299. <button id="searchbtn1" class="btn left" type="button">查 看</button>
  300. <div class="wdatefast">
  301. 推荐检索:
  302. <a class="nowmonth" href="javascript:void(0)">本月度</a>
  303. <a class="lastmonth" href="javascript:void(0)">上个月</a>
  304. </div>
  305. </div>
  306. </div>
  307. <div class="wdatepicker2 tcenter">
  308. <div id="seafrom" class="inline-block clearfix" style="margin:0px">
  309. <select class="left validbox" name="org_id" id="org_id">
  310. <option value="">==部门==</option>
  311. {volist name="org_list" id="vo"}
  312. <option value="{$vo.id}">{$vo.name}</option>
  313. {/volist}
  314. </select>
  315. <select class="left" name="employee_id" id="employee_id" lay-search>
  316. <option value="">==业务员==</option>
  317. {volist name="emplist" id="vo"}
  318. <option value="{$vo.id}">{$vo.name}</option>
  319. {/volist}
  320. </select>
  321. <select class="left" name="wuxiao" id="wuxiao">
  322. <option value="">==包含==</option>
  323. <option value="1">统计无效</option>
  324. <option value="2">统计推广</option>
  325. </select>
  326. <input name="nowyear" type="text" id="nowyear" class="wdatebtn left" readonly="readonly" placeholder="开始时间 到 结束时间">
  327. <button id="searchbtn" class="btn left" type="button">查 看</button>
  328. </div>
  329. <div class="wdatefast2">
  330. 推荐检索:
  331. <a class="nowmonth" href="javascript:void(0)">本月度</a>
  332. <a class="lastmonth" href="javascript:void(0)">上个月</a>
  333. </div>
  334. </div>
  335. <div class="abouts tablemsgbox" style="display:none;">
  336. <h1>{$data.company_name}各客户来源报表</h1>
  337. <table class="maintable tableother" style="position: relative;z-index: 999;padding-right: 4px !important;">
  338. <thead id="fixedHeader1">
  339. <tr>
  340. <th class="names" rowspan="2" width="70"></th>
  341. <th rowspan="2">推广<br>消费</th>
  342. <th class="extendbox" colspan="4" style="display:none;">推广数据</th>
  343. <th colspan="13">基本数据</th>
  344. <th rowspan="2" width="65" class="hidetd">ROI</th>
  345. <th colspan="3" class="validnumbox" style="display:none;">注销</th>
  346. </tr>
  347. <tr>
  348. <th style="display:none;" class="thtopline extendbox">展现</th>
  349. <th style="display:none;" class="thtopline extendbox">点击</th>
  350. <th style="display:none;" class="thtopline extendbox">点击率</th>
  351. <th style="display:none;" class="thtopline extendbox" title="线索转化比">转化比</th>
  352. <th class="thtopline">线索量</th>
  353. <th class="thtopline">线索单价</th>
  354. <th class="thtopline">有效线索</th>
  355. <th class="thtopline">有效单价</th>
  356. <th class="thtopline">有效率</th>
  357. <th class="thtopline">见面量</th>
  358. <th class="thtopline">见面率</th>
  359. <th class="thtopline">见面单价</th>
  360. <th class="thtopline">预定合同</th>
  361. <th class="thtopline">成单率</th>
  362. <th class="thtopline">施工合同</th>
  363. <th class="thtopline">业绩总额</th>
  364. <th class="thtopline">均单值</th>
  365. <th style="display:none;" class="thtopline fontnormal validnumbox" title="有效线索">无效</th>
  366. <th style="display:none;" class="thtopline fontnormal validnumbox">见面</th>
  367. <th style="display:none;" class="thtopline fontnormal validnumbox">定金</th>
  368. </tr>
  369. </thead>
  370. <tbody id="tbodybox1" style="display: none;">
  371. </tbody>
  372. </table>
  373. <div class="tableBoxStyle">
  374. <table class="maintable tableother">
  375. <thead id="fixedHeader">
  376. <tr>
  377. <th class="names" rowspan="2" width="70"></th>
  378. <th rowspan="2">推广<br>消费</th>
  379. <th class="extendbox" colspan="4" style="display:none;">推广数据</th>
  380. <th colspan="13">基本数据</th>
  381. <th rowspan="2" width="65" class="hidetd">ROI</th>
  382. <th colspan="3" class="validnumbox" style="display:none;">注销</th>
  383. </tr>
  384. <tr>
  385. <th style="display:none;" class="thtopline extendbox">展现</th>
  386. <th style="display:none;" class="thtopline extendbox">点击</th>
  387. <th style="display:none;" class="thtopline extendbox">点击率</th>
  388. <th style="display:none;" class="thtopline extendbox" title="线索转化比">转化比</th>
  389. <th class="thtopline">线索量</th>
  390. <th class="thtopline">线索单价</th>
  391. <th class="thtopline">有效线索</th>
  392. <th class="thtopline">有效单价</th>
  393. <th class="thtopline">有效率</th>
  394. <th class="thtopline">见面量</th>
  395. <th class="thtopline">见面率</th>
  396. <th class="thtopline">见面单价</th>
  397. <th class="thtopline">预定合同</th>
  398. <th class="thtopline">成单率</th>
  399. <th class="thtopline">施工合同</th>
  400. <th class="thtopline">业绩总额</th>
  401. <th class="thtopline">均单值</th>
  402. <th style="display:none;" class="thtopline fontnormal validnumbox" title="有效线索">无效</th>
  403. <th style="display:none;" class="thtopline fontnormal validnumbox">见面</th>
  404. <th style="display:none;" class="thtopline fontnormal validnumbox">定金</th>
  405. </tr>
  406. </thead>
  407. <tbody id="tbodybox">
  408. </tbody>
  409. </table>
  410. </div>
  411. </div>
  412. <div class="abouts" style="text-align:right; color:#999; padding-bottom:15px; line-height:23px;">
  413. 注:<br>
  414. 1、基本数据:线索是根据信息录入的报名认时间统计。<br>
  415. 2、基本数据:加微是根据信息录入的时报名时间统计。<br>
  416. 3、基本数据:见面到访是根据首次洽谈的时间统计。<br>
  417. 4、基本数据:预定合同是根据定金时间统计,和报名、见面到访时间无关。<br>
  418. 5、基本数据:施工合同是根据合同时间统计,和报名、见面到访时间无关。<br>
  419. 6、注销:线索是根据变更线索无效的默认时间统计,和线索报名无关。<br>
  420. 7、注销:见面到访是根据首次洽谈时间统计,和线索报名时间无关。
  421. </div>
  422. </div>
  423. <div id="loading-mask">
  424. <div><img src="__STATIC__/img/large-loading.gif" />
  425. <p>...加载中...</p>
  426. </div>
  427. </div>
  428. </body>
  429. <script src="__LAYUI__/layui/layui.js"></script>
  430. {/block}{block name="js"}
  431. <script type="text/html" id="designer_name">
  432. {{# if(d.designer){ }}
  433. <span>{{d.designer.name}}</span>
  434. {{# }else{ }}
  435. <span style="color: #cccccc;">无</span>
  436. {{# } }}
  437. </script>
  438. <script type="text/javascript">
  439. var reload = null, resizefun = null;
  440. layui.config({
  441. base: '__LAYUI__/',
  442. urlbase: '/sys'
  443. }).extend({
  444. index: 'lib/index' //主入口模块
  445. }).use(['table', 'laydate',"form"], function () {
  446. var table = layui.table, laydate = layui.laydate,
  447. form=layui.form,$ = layui.$;
  448. let date=new Date();
  449. let year=date.getFullYear();
  450. let month = date.getMonth()*1+1;
  451. let time='', validtype='',employee_id='',org_id='';
  452. var field = {
  453. 'names' : ''
  454. };
  455. laydate.render({
  456. elem: '#nowyear' //指定元素
  457. , type: 'date'
  458. , range: '到'
  459. , trigger: 'click'//呼出事件改成click
  460. , max:0
  461. });
  462. if (window.performance) {
  463. localStorage.setItem('data','');
  464. }
  465. $('.nowyearbtn').click(function () {
  466. let date = new Date();
  467. let year = date.getFullYear();
  468. time = year + '-1-1' + ' 到 ' + year+'-12-31';
  469. employee_id=$('#employee_id').val();
  470. validtype = $('#wuxiao').val();
  471. org_id = $('#orgid').val();
  472. laydate.render({
  473. elem: '#nowyear1'
  474. , type: 'date'
  475. , range: '到'
  476. , trigger: 'click'//呼出事件改成click
  477. , value: time
  478. , max:0
  479. });
  480. $('.wdatepicker2').hide();
  481. $('.wdatepicker').show();
  482. $('.tablemsgbox').show();
  483. dailyfun(time);
  484. })
  485. //监听部门选项
  486. $('#org_id1').change(function(){
  487. let org_id = $(this).val();
  488. $.ajax({
  489. url: '{:url("ManagerEmp/seL_emplist")}'
  490. , data: {
  491. org_id: org_id
  492. }
  493. , type: 'post'
  494. , success: function (res) {
  495. if(res.code === 0) {
  496. setHtml(res.data,1)
  497. }else if(res.code == 403){
  498. $(".exitbtn").trigger("click");
  499. } else {
  500. }
  501. }
  502. })
  503. });
  504. //监听部门选项
  505. $('#org_id').change(function(){
  506. let org_id = $(this).val();
  507. $.ajax({
  508. url: '{:url("ManagerEmp/seL_emplist")}'
  509. , data: {
  510. org_id: org_id
  511. }
  512. , type: 'post'
  513. , success: function (res) {
  514. if(res.code === 0) {
  515. setHtml(res.data,'')
  516. }else if(res.code == 403){
  517. $(".exitbtn").trigger("click");
  518. } else {
  519. }
  520. }
  521. })
  522. });
  523. function setHtml(emplist,type)
  524. {
  525. $("#employee_id"+type).empty();
  526. let html = '<option value="">==业务员==</option>';
  527. emplist.map((v, i) => {
  528. html+=`<option value="${v.id}">${v.name}</option>`;
  529. })
  530. $("#employee_id"+type).append(html);
  531. }
  532. $('.lastmonth').click(function () {
  533. employee_id=$('#employee_id').val();
  534. validtype = $('#wuxiao').val();
  535. org_id = $("#org_id").val();
  536. const getLastMonthLast = () => {
  537. const date = new Date()
  538. // 获取上个月的最后一天是几号day
  539. const day = new Date(date.getFullYear(), date.getMonth(), 0).getDate()
  540. const enddate = new Date(date.getFullYear(), date.getMonth() - 1, day)
  541. return enddate
  542. }
  543. $('.wdatefast').show();
  544. time = getPreMonth()+'-1 到 '+ getPreMonth()+'-'+ getLastMonthLast().getDate();
  545. laydate.render({
  546. elem: '#nowyear1' //指定元素
  547. , type: 'date'
  548. , range: '到'
  549. , trigger: 'click'//呼出事件改成click
  550. , value: time
  551. , max:0
  552. });
  553. $('.wdatepicker2').hide();
  554. $('.wdatepicker').show();
  555. $('.tablemsgbox').show();
  556. dailyfun(time);
  557. })
  558. $('.nowmonth').click(function () {
  559. employee_id=$('#employee_id').val();
  560. validtype = $('#wuxiao').val();
  561. org_id = $("#org_id").val();
  562. let date = new Date();
  563. let year = date.getFullYear();
  564. let month = date.getMonth() * 1 + 1;
  565. time = year+'-'+ month+'-1'+ ' 到 ' + getLastDay();
  566. laydate.render({
  567. elem: '#nowyear1' //指定元素
  568. , type: 'date'
  569. , range: '到'
  570. , value: time
  571. , trigger: 'click'//呼出事件改成click
  572. , max:0
  573. });
  574. $('.wdatepicker2').hide();
  575. $('.wdatepicker').show();
  576. $('.tablemsgbox').show();
  577. dailyfun(time);
  578. })
  579. $("#searchbtn1").click(function () {
  580. if (!$('#nowyear1').val()) {
  581. alert('提示:请务必选择统计时间')
  582. return false;
  583. }
  584. validtype= $('#valid').val();
  585. time = $('#nowyear1').val();
  586. employee_id=$('#employee_id1').val();
  587. org_id = $('#org_id1').val();
  588. $('.month').html(time.split('-')[1]);
  589. laydate.render({
  590. elem: '#nowyear1' //指定元素
  591. , type: 'date'
  592. , range: '到'
  593. , value: time
  594. , trigger: 'click'//呼出事件改成click
  595. , max:0
  596. });
  597. $('.wdatepicker2').hide();
  598. $('.wdatepicker').show();
  599. $('.tablemsgbox').show();
  600. dailyfun(time);
  601. })
  602. $('#searchbtn').click(function(){
  603. if(!$('#nowyear').val()){
  604. alert('提示:请务必选择统计时间')
  605. return false;
  606. }
  607. validtype = $('#wuxiao').val();
  608. time= $('#nowyear').val();
  609. employee_id=$('#employee_id').val();
  610. org_id = $('#org_id').val();
  611. laydate.render({
  612. elem: '#nowyear1' //指定元素
  613. , type: 'date'
  614. , range: '到'
  615. , value: time
  616. , trigger: 'click'//呼出事件改成click
  617. , max:0
  618. });
  619. $('.wdatepicker2').hide();
  620. $('.wdatepicker').show();
  621. $('.tablemsgbox').show();
  622. dailyfun(time);
  623. })
  624. resizefun = function () {
  625. dailyfun(time);
  626. };
  627. reload = function () {
  628. dailyfun(time);
  629. };
  630. // select
  631. var selHtml = `<div class="wpsa psinput">
  632. <div class="triangle"></div>
  633. <form class="layui-form">
  634. <input class="pdl12 kwovsint" id="select_check" placeholder="输入关键字....." type="text" id=""/>
  635. <div class="check_li">
  636. <div style="overflow:hidden;padding-bottom:5px;text-align: left;">
  637. <span class="checkAlls href">全选</span>
  638. <span style="margin:0 10px;">/</span>
  639. <span class="nocheckAlls href">清除</span>
  640. </div>
  641. <ul class="check_ul_list">
  642. {volist name="source_list" id="vo"}
  643. <li class="check_li_">
  644. <input class="checkbox" type="checkbox" name="check_m" lay-filter="checkall02" value="{$vo.id}">
  645. <p class="check_name">{$vo.source}</p>
  646. </li>
  647. {/volist}
  648. </ul>
  649. </div>
  650. <div class="search_btns">
  651. <div class="button_">
  652. <a class="submitbtn">确定</a>
  653. <a class="dsnonebtn">取消</a>
  654. </div>
  655. </div>
  656. </form>
  657. </div>`;
  658. function localS(){
  659. if(localStorage.getItem('data')){
  660. var bodyjson = JSON.parse(localStorage.getItem('data'));
  661. if(bodyjson){
  662. if(bodyjson['names']){
  663. $('.names').find('img.mapps').attr('src','__STATIC__/img/search_ico02.png');
  664. var checkarrs = bodyjson['names'].split(',');
  665. $.each(checkarrs,function(iiii,vvvv){
  666. $('.names').find('.check_ul_list li').each(function(ii,vvv){
  667. if(vvvv==$(this).find('input').val()){
  668. $('.names').find('.check_ul_list li').eq(ii).find('input[type="checkbox"]').prop('checked',true)
  669. }
  670. })
  671. })
  672. }else{
  673. $('.names').find('img.mapps').attr('src','__STATIC__/img/search_ico01.png');
  674. }
  675. }
  676. form.render('checkbox');
  677. }
  678. }
  679. function searchHtmlBody(){
  680. setTimeout(function(){
  681. apphtml02($('.names'),selHtml);
  682. localS();
  683. },100)
  684. function apphtml02(this_,htmlbox){
  685. this_.html('');
  686. this_.addClass('is_show');
  687. this_.prepend('<span class="btnbtn5 dsa" data-isshow="1">客户<br>来源</span><img class="mapps" src="__STATIC__/img/search_ico01.png"/>');
  688. this_.append(htmlbox);
  689. form.render();
  690. setTimeout(function(){
  691. var search_input = this_.find("#select_check"),
  692. search_content =this_.find(".check_li_");
  693. $(search_input).on("keyup", function() {
  694. this_.find(".check_li_").hide().filter(":contains("+ search_input.val().trim() +")").show();
  695. });
  696. function stopPropagation(e) {
  697. if (e.stopPropagation)
  698. e.stopPropagation();
  699. else
  700. e.cancelBubble = true;
  701. }
  702. this_.find('.dsnonebtn').on('click',function(){
  703. this_.find('.psinput').hide();
  704. this_.find('.btnbtn5').attr('data-isshow',1);
  705. this_.find('input').val('');
  706. })
  707. var isradio = 1;
  708. this_.find('.btnbtn5,.mapps').on('click',function(e){
  709. $('.is_show').find('.psinput').hide();
  710. if($(this).attr('data-isshow')==1){
  711. $(this).siblings('.psinput').show();
  712. $(this).attr('data-isshow',0)
  713. }else{
  714. $(this).siblings('.psinput').hide();
  715. $(this).attr('data-isshow',1)
  716. }
  717. })
  718. this_.find('.checkAlls').on('click',function(){
  719. this_.find('.checkbox').each(function (index, item) {
  720. this_.find('.checkbox').eq(index).prop('checked','checked')
  721. });
  722. form.render('checkbox');
  723. })
  724. this_.find('.nocheckAlls').on('click',function(){
  725. this_.find('.checkbox').each(function (index, item) {
  726. this_.find('.checkbox').eq(index).prop('checked','')
  727. });
  728. form.render('checkbox');
  729. })
  730. this_.find('.submitbtn').on('click',function(){
  731. var arr = new Array();
  732. this_.find("input:checkbox:checked").each(function(i){
  733. arr[i] = $(this).val();
  734. });
  735. var datastr = arr.join(",");
  736. field['names'] = datastr;
  737. dailyfun(time,datastr);
  738. if (this_.find('input.kwovsint').val() && !field['names']) {
  739. layer.msg('请选择内容', {anim: 1000,time: 1000,});
  740. return;
  741. }
  742. var datas=JSON.stringify(field);
  743. localStorage.setItem('data',datas);
  744. localS();
  745. $(this).parents('.psinput').hide();
  746. this_.find('.btnbtn5').attr('data-isshow',1);
  747. })
  748. // $(document).bind('click',function(){
  749. // this_.find('.psinput').hide();
  750. // this_.find('.btnbtn5').attr('data-isshow',1);
  751. // });
  752. this_.find('th').on('click',function(e){
  753. stopPropagation(e);
  754. })
  755. },100)
  756. }
  757. }
  758. // select
  759. function dailyfun(time,names) {
  760. $('#loading-mask').show();
  761. $.ajax({
  762. url: '{:url("ManagerEmp/account_report")}'
  763. , data: {
  764. date: time,
  765. source_id:names,
  766. employee_id:employee_id,
  767. org_id:org_id
  768. }
  769. , type: 'post'
  770. , success: function (res) {
  771. if (res.code == 0) {
  772. let str="";
  773. if(validtype==1){
  774. for (let j = 0; j < $('.validnumbox').length; j++) {
  775. $($('.validnumbox')[j]).show();
  776. }
  777. for (let j = 0; j < $('.extendbox').length; j++) {
  778. $($('.extendbox')[j]).hide();
  779. }
  780. }else if(validtype==2){
  781. for(let j=0;j<$('.validnumbox').length;j++){
  782. $($('.validnumbox')[j]).hide();
  783. }
  784. for (let j = 0; j < $('.extendbox').length; j++) {
  785. $($('.extendbox')[j]).show();
  786. }
  787. }else{
  788. for(let j=0;j<$('.validnumbox').length;j++){
  789. $($('.validnumbox')[j]).hide();
  790. }
  791. for (let j = 0; j < $('.extendbox').length; j++) {
  792. $($('.extendbox')[j]).hide();
  793. }
  794. }
  795. for(let i in res.data){
  796. if(res.data[i].name!='求和'){
  797. str+=`<tr>
  798. <td>${res.data[i].name}</td>
  799. <td title="推广消费" class="${res.data[i].exten_money?'':'baobaonum1'}">${res.data[i].exten_money}</td>
  800. <td style="display:none;" title="展现量" class="${res.data[i].exten_show?'':'baobaonum1'} extendbox">${res.data[i].exten_show}</td>
  801. <td style="display:none;" title="点击量" class="${res.data[i].exten_click?'':'baobaonum1'} extendbox">${res.data[i].exten_click}</td>
  802. <td style="display:none;" title="点击率" class="${res.data[i].click_percen?'':'baobaonum1'} extendbox">${res.data[i].click_percen}</td>
  803. <td style="display:none;" title="点击转化比例" class="${res.data[i].clue_conversion?'':'baobaonum1'} extendbox">${res.data[i].clue_conversion}</td>
  804. <td title="线索量" class="${res.data[i].clue_cont?'':'baobaonum1'}">
  805. ${res.data[i].clue_cont?'<a class="divlayer" text="线索" org_id="'+res.data[i].org_id+'" employee_id="'+res.data[i].employee_id+'" source_id="'+res.data[i].id+'" title="'+time+'客户线索明细" href="javascript:void(0)" >'+res.data[i].clue_cont+'</a>':'0'}
  806. </td>
  807. <td title="线索单价" class="${res.data[i].clue_money?'':'baobaonum1'}">${res.data[i].clue_money}</td>
  808. <td title="有效线索量" class="${res.data[i].valid_cont?'':'baobaonum1'}">
  809. ${res.data[i].valid_cont?'<a class="divlayer" text="有效" org_id="'+res.data[i].org_id+'" employee_id="'+res.data[i].employee_id+'" source_id="'+res.data[i].id+'" title="'+time+'有效线索明细" href="javascript:void(0)" >'+res.data[i].valid_cont+'</a>':'0'}
  810. </td>
  811. <td title="有效单价" class="${res.data[i].valid_money?'':'baobaonum1'}">${res.data[i].valid_money}</td>
  812. <td title="有效率" class="${res.data[i].valid_percen?'':'baobaonum1'} youxiao_percent">${res.data[i].valid_percen}%</td>
  813. <td title="见面量" class="${res.data[i].meet_cont?'':'baobaonum1'}">
  814. ${res.data[i].meet_cont?'<a class="divlayer" org_id="'+res.data[i].org_id+'" employee_id="'+res.data[i].employee_id+'" source_id="'+res.data[i].id+'" text="到访" title="'+time+'见面线索客户明细" href="javascript:void(0)" >'+res.data[i].meet_cont+'</a>':'0'}
  815. </td>
  816. <td title="见面率" class="${res.data[i].meet_percen?'':'baobaonum1'} jianmian_percent">${res.data[i].meet_percen}%</td>
  817. <td title="见面单价" class="${res.data[i].meet_money?'':'baobaonum1'}">${res.data[i].meet_money}</td>
  818. <td title="预定合同量" class="${res.data[i].deposit_cont?'':'baobaonum1'}">
  819. ${res.data[i].deposit_cont?'<a class="divlayer" org_id="'+res.data[i].org_id+'" employee_id="'+res.data[i].employee_id+'" source_id="'+res.data[i].id+'" text="交定" title="'+time+'定金客户明细" href="javascript:void(0)" >'+res.data[i].deposit_cont+'</a>':'0'}
  820. </td>
  821. <td title="成单率" class="${res.data[i].deposit_percen?'':'baobaonum1'} chengdan_percent">${res.data[i].deposit_percen}%</td>
  822. <td title="施工合同量" class="${res.data[i].sign_cont?'':'baobaonum1'}">
  823. ${res.data[i].sign_cont?'<a class="divlayer" org_id="'+res.data[i].org_id+'" employee_id="'+res.data[i].employee_id+'" source_id="'+res.data[i].id+'" text="签单" title="'+time+'签单客户明细" href="javascript:void(0)" >'+res.data[i].sign_cont+'</a>':'0'}
  824. </td>
  825. <td class="${res.data[i].basic_money?'':'baobaonum1'}" title="业绩总额">${res.data[i].basic_money}</td>
  826. <td class="${res.data[i].sign_agv_money?'':'baobaonum1'}" title="均单值">${res.data[i].sign_agv_money}</td>
  827. <td title="ROI" class="hidetd ${res.data[i].ROI?'':'baobaonum1'}">${res.data[i].ROI}%</td>
  828. <td style="display:none;" class="validnumbox ${res.data[i].invalid_no?'':'baobaonum1'}" title="无效注销量" >${res.data[i].invalid_no}</td>
  829. <td style="display:none;" class="validnumbox ${res.data[i].invalid_meet?'':'baobaonum1'}" title="见面注销量" >${res.data[i].invalid_meet}</td>
  830. <td style="display:none;" class="validnumbox ${res.data[i].invalid_deposit?'':'baobaonum1'}" title="定金注销量" >${res.data[i].invalid_deposit}</td>
  831. </tr>`;
  832. }else{
  833. str+=`<tr>
  834. <td >${res.data[i].name}</td>
  835. <td title="推广消费" class="${res.data[i].invalid_meet?'':'exten_money'}">${res.data[i].exten_money}</td>
  836. <td style="display:none;" title="展现量" class="${res.data[i].exten_show?'':'exten_money'} extendbox">${res.data[i].exten_show}</td>
  837. <td style="display:none;" title="点击量" class="${res.data[i].exten_click?'':'exten_money'} extendbox">${res.data[i].exten_click}</td>
  838. <td style="display:none;" title="点击率" class="${res.data[i].click_percen?'':'exten_money'} extendbox">${res.data[i].click_percen}</td>
  839. <td style="display:none;" title="点击转化比例" class="${res.data[i].clue_conversion?'':'exten_money'} extendbox">${res.data[i].clue_conversion}</td>
  840. <td title="线索量" class="${res.data[i].clue_cont?'':'baobaonum1'}" >${res.data[i].clue_cont}</td>
  841. <td title="线索单价" class="${res.data[i].clue_money?'':'baobaonum1'}">${res.data[i].clue_money}</td>
  842. <td title="有效线索量" class="${res.data[i].valid_cont?'':'baobaonum1'}">${res.data[i].valid_cont}</td>
  843. <td title="有效单价" class="${res.data[i].valid_money?'':'baobaonum1'}">${res.data[i].valid_money}</td>
  844. <td title="有效率" class="youxiao_percent ${res.data[i].valid_percen?'':'baobaonum1'}">${res.data[i].valid_percen}%</td>
  845. <td title="见面量" class="${res.data[i].meet_cont?'':'baobaonum1'}">${res.data[i].meet_cont}</td>
  846. <td title="见面率" class="jianmian_percent ${res.data[i].meet_percen?'':'baobaonum1'}">${res.data[i].meet_percen}%</td>
  847. <td title="见面单价" class="${res.data[i].meet_money?'':'baobaonum1'}">${res.data[i].meet_money}</td>
  848. <td title="预定合同量" class="${res.data[i].deposit_cont?'':'baobaonum1'}">${res.data[i].deposit_cont}</td>
  849. <td title="成单率" class="chengdan_percent ${res.data[i].deposit_percen?'':'baobaonum1'}">${res.data[i].deposit_percen}%</td>
  850. <td title="施工合同量" class="${res.data[i].sign_cont?'':'baobaonum1'}">${res.data[i].sign_cont}</td>
  851. <td title="业绩总额" class="${res.data[i].basic_money?'':'baobaonum1'}">${res.data[i].basic_money}</td>
  852. <td title="均单值" class="${res.data[i].sign_agv_money?'':'baobaonum1'}">${res.data[i].sign_agv_money}</td>
  853. <td title="ROI" class="hidetd ${res.data[i].ROI?'':'baobaonum1'}">${res.data[i].ROI}%</td>
  854. <td style="display:none;" class="validnumbox ${res.data[i].invalid_no?'':'baobaonum1'}" title="无效注销量">${res.data[i].invalid_no}</td>
  855. <td style="display:none;" class="validnumbox ${res.data[i].invalid_meet?'':'baobaonum1'}" title="见面注销量">${res.data[i].invalid_meet}</td>
  856. <td style="display:none;" class="validnumbox ${res.data[i].invalid_deposit?'':'baobaonum1'}" title="定金注销量">${res.data[i].invalid_deposit}</td>
  857. </tr>`;
  858. }
  859. }
  860. $('#tbodybox').html(str);
  861. $('#tbodybox1').html(str);
  862. searchHtmlBody();
  863. if(validtype==1){
  864. for (let j = 0; j < $('.validnumbox').length; j++) {
  865. $($('.validnumbox')[j]).show();
  866. }
  867. for (let j = 0; j < $('.extendbox').length; j++) {
  868. $($('.extendbox')[j]).hide();
  869. }
  870. }else if(validtype==2){
  871. for(let j=0;j<$('.validnumbox').length;j++){
  872. $($('.validnumbox')[j]).hide();
  873. }
  874. for (let j = 0; j < $('.extendbox').length; j++) {
  875. $($('.extendbox')[j]).show();
  876. }
  877. }else{
  878. for(let j=0;j<$('.validnumbox').length;j++){
  879. $($('.validnumbox')[j]).hide();
  880. }
  881. for (let j = 0; j < $('.extendbox').length; j++) {
  882. $($('.extendbox')[j]).hide();
  883. }
  884. }
  885. $(".maintable td").mouseover(function () {
  886. //if ($(this).text() == 0 || $(this).text() > 500) { $(this).html($(this).text()) }
  887. if ($(this).children("a").length > 0) { $(this).addClass("ablock2"); }
  888. }).mouseout(function () { $(this).removeClass("ablock2"); });
  889. $('.divlayer').on('click', function () {
  890. let date= time;
  891. layer.open({
  892. type: 2,
  893. title: $(this).attr('title'),
  894. shadeClose: true,
  895. scrollbar: false,
  896. shade: 0.8,
  897. area: ['99%', '96%'],
  898. content: "{:url('manager_emp/account_detail')}?date="+ date +'&source_id='+$(this).attr('source_id')+'&state='+ $(this).attr('text')+'&employee_id='+ $(this).attr('employee_id')+'&org_id='+$(this).attr('org_id'),
  899. });
  900. });
  901. }else if(res.code == 403){
  902. $(".exitbtn").trigger("click");
  903. } else {
  904. alert(res.msg)
  905. }
  906. $('#loading-mask').hide();
  907. }
  908. });
  909. }
  910. })
  911. // 本月最后一天
  912. function getLastDay() {
  913. var y = new Date().getFullYear(); //获取年份
  914. var m = new Date().getMonth() + 1; //获取月份
  915. var d = new Date(y, m, 0).getDate(); //获取当月最后一日
  916. m = m < 10 ? '0' + m : m; //月份补 0
  917. d = d < 10 ? '0' + d : d; //日数补 0
  918. return [y, m, d].join("-")
  919. }
  920. function getNowMonth() {
  921. var date = new Date();
  922. var year = date.getFullYear();
  923. var month = date.getMonth() + 1;
  924. month = month > 9 ? month : "0" + month;
  925. var nowMonth = year + "-" + month;
  926. return nowMonth;
  927. }
  928. /**获取上一个月 */
  929. function getPreMonth() {
  930. var arr = getNowMonth().split("-");
  931. var year = arr[0]; //获取当前日期的年份
  932. var month = arr[1]; //获取当前日期的月份
  933. var year2 = year;
  934. var month2 = parseInt(month) - 1;
  935. if (month2 == 0) {
  936. //1月的上一月是前一年的12月
  937. year2 = parseInt(year2) - 1;
  938. month2 = 12;
  939. }
  940. var preMonth = year2 + "-" + month2;
  941. return preMonth;
  942. }
  943. </script>
  944. {/block}