fish_total.html 38 KB

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