search_list.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. {extend name="public/layout"}
  2. {block name="body"}
  3. <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
  4. <script src="/static/js/jquery.min.js"></script>
  5. <style>
  6. .searchtitlebox{
  7. display: block;
  8. padding: 15px 10px;
  9. border: 1px solid #F0F0F0;
  10. background: #FCFCFC;
  11. margin-top: 5px;
  12. margin-bottom: 10px;
  13. position: relative;
  14. min-width: 800px;
  15. }
  16. .searchbox{
  17. display: block;
  18. text-align: center;
  19. }
  20. .searchbox input{
  21. display: inline-block;
  22. height: 26px;
  23. line-height: 26px;
  24. padding-left: 3px;
  25. vertical-align: middle;
  26. border: 2px solid #4479ba;
  27. }
  28. body{
  29. font-size: 12px;
  30. font-family: "宋体";
  31. padding-bottom: 40px;
  32. }
  33. .searchbox button{
  34. display: inline-block;
  35. border: none;
  36. width: 98px;
  37. height: 30px;
  38. color: #fff;
  39. font-size: 14px;
  40. font-weight: bold;
  41. text-align: center;
  42. background: url(__STATIC__/img/icon-sub.png) no-repeat;
  43. cursor: pointer;
  44. vertical-align: middle;
  45. }
  46. .tablebox{
  47. max-height: 760px;
  48. cursor: pointer;
  49. }
  50. .tablebox .layui-form.layui-border-box.layui-table-view{
  51. max-height: 760px !important;
  52. height: auto !important;
  53. }
  54. .layui-table-body{
  55. max-height: 670px !important;
  56. height: auto !important;
  57. }
  58. .tablebox,.layui-table td, .layui-table th{
  59. font-size: 13px !important;
  60. }
  61. .dingjingorder {
  62. height: 25px;
  63. width: 40px;
  64. background-color: #65c001;
  65. color: #FFF;
  66. text-align: center;
  67. line-height: 25px;
  68. z-index: 100;
  69. display: block;
  70. position: absolute;
  71. top: 1px;
  72. right: 3px;
  73. border-radius: 11px;
  74. font-size: 12px;
  75. }
  76. .addvx{
  77. position: absolute;
  78. top: -5px;
  79. right: 1px;
  80. height: 14px;
  81. line-height: 14px;
  82. font-size: 16px;
  83. color: #666;
  84. font-family: "宋体";
  85. }
  86. .statebox{
  87. width: 40px;
  88. text-align: center;
  89. z-index: 100;
  90. display: block;
  91. position: absolute;
  92. font-size: 12px;
  93. top: -5px;
  94. right: 0px;
  95. border-radius: 0px;
  96. background: #4285f4;
  97. color: #efefef;
  98. height: 20px;
  99. line-height: 20px;
  100. cursor: pointer;
  101. }
  102. .layui-table-cell{
  103. overflow: initial;
  104. }
  105. .state1box{
  106. display: block;
  107. border: 1px solid #a5c2f4;
  108. background: none;
  109. height: 20px;
  110. line-height: 20px;
  111. width: 40px;
  112. color: #a5c2f4;
  113. text-align: center;
  114. z-index: 100;
  115. display: block;
  116. position: absolute;
  117. top: 3px;
  118. right: 3px;
  119. border-radius: 11px;
  120. font-size: 12px;
  121. cursor: pointer;
  122. }
  123. .layui-table-view .layui-table td{
  124. cursor: pointer;
  125. overflow: hidden;
  126. }
  127. </style>
  128. <body>
  129. <div class="searchtitlebox">
  130. <div style="margin-bottom:8px;">您当前的操作 · <b>系统公共查询接口</b> · 记录管理&nbsp;&nbsp;</div>
  131. <div class="searchbox">
  132. <input type="text" placeholder="请输入手机号或者小区名" autocomplete="off" size="45" autocomplete="off"/>
  133. <button class="searchbtn" type="button">快速搜索</button>
  134. </div>
  135. </div>
  136. <div class="tablebox">
  137. <table lay-filter="crmsearchlist" id="crmsearchlist"></table>
  138. </div>
  139. </body>
  140. <script src="__LAYUI__/layui/layui.js"></script>
  141. {/block}{block name="js"}
  142. <script type="text/html" id="community">
  143. {{d.community_name?d.community_name:''}}
  144. {{# if(d.jiaoding_time){ }}
  145. <span class="dingjingorder">定金</span>
  146. {{# }else{ }}
  147. {{# } }}
  148. </script>
  149. <script type="text/html" id="designername">
  150. {{d.designer?d.designer.name:''}}
  151. {{# if(d.signorder_time){ }}
  152. <span class="dingjingorder" style="background-color: #ff6600;">合同</span>
  153. {{# }else{ }}
  154. {{# } }}
  155. </script>
  156. <script type="text/html" id="empname">
  157. {{# if(d.employee){ }}
  158. {{d.employee.name}}
  159. {{# if(d.add_wechat=='是'){ }}
  160. <span class="addvx">v</span>
  161. {{# }else{ }}
  162. {{# } }}
  163. {{# }else{ }}
  164. <span style="color: #cccccc;">无</span>
  165. {{# if(d.add_wechat=='是'){ }}
  166. <span class="addvx">v</span>
  167. {{# }else{ }}
  168. {{# } }}
  169. {{# } }}
  170. </script>
  171. <script type="text/html" id="contact_date">
  172. {{d.last_contact_date?d.last_contact_date:0}}
  173. {{# if(d.state=='无效'){ }}
  174. <span class="state1box" onclick="getcrmtap('{{=d.id}}')">获取</span>
  175. {{# }else{ }}
  176. {{# } }}
  177. </script>
  178. <script type="text/html" id="addtimebox">
  179. {{d.addtime}}
  180. {{# if(d.state!='无效'){ }}
  181. <span class="statebox">{{d.state}}</span>
  182. {{# }else{ }}
  183. <span class="statebox">{{d.state}}</span>
  184. {{# } }}
  185. </script>
  186. <script type="text/javascript">
  187. var reload = null;
  188. layui.config({
  189. base: '__LAYUI__/',
  190. urlbase: '/sys'
  191. }).extend({
  192. index: 'lib/index' //主入口模块
  193. }).use(['table'], function () {
  194. var table = layui.table,
  195. $ = layui.$;
  196. // <!-- 搜索列表页面 接口 参数 keyname=>手机号或小区名称 -->
  197. $('.searchbtn').click(function(){
  198. searchfun($('.searchbox input').val());
  199. })
  200. //
  201. function searchfun(keyname) {
  202. table.render({
  203. elem: '#crmsearchlist',
  204. url: '{:url("community/search_list")}?keyname=' + keyname,
  205. page: true //是否显示分页
  206. , even: true
  207. ,limits: [17]
  208. ,limit: 17, //每页默认显示的数量,
  209. cols: [
  210. [
  211. {
  212. title: '客户姓名',
  213. field: 'name',
  214. align: 'center',
  215. },
  216. {
  217. title: '小区名',
  218. field: 'community_name',
  219. align: 'center',
  220. width:240,
  221. templet: '#community',
  222. },
  223. {
  224. title: '手机号',
  225. field: 'phone',
  226. align: 'center',
  227. },
  228. {
  229. title: '面积',
  230. field: 'square',
  231. align: 'center',
  232. },
  233. {
  234. title: '业务员',
  235. field: 'employee',
  236. align: 'center',
  237. templet: '#empname'
  238. },
  239. {
  240. title: '设计师',
  241. field: 'designer',
  242. align: 'center',
  243. templet: '#designername'
  244. },
  245. {
  246. title: '报名时间',
  247. field: 'sign_time',
  248. align: 'center',
  249. },
  250. {
  251. title: '首次见面',
  252. field: 'fisttime',
  253. align: 'center',
  254. },
  255. {
  256. title: '录入时间',
  257. field: 'addtime',
  258. align: 'center',
  259. width:256,
  260. templet: '#addtimebox'
  261. },
  262. {
  263. title: '最后回访',
  264. field: 'last_contact_date',
  265. align: 'center',
  266. width: 230,
  267. templet: '#contact_date'
  268. },
  269. {
  270. title: '重要级别',
  271. field: 'level',
  272. align: 'center',
  273. }
  274. ]
  275. ],
  276. page: true,
  277. limit: 17,
  278. height: 'full-120',
  279. text: '对不起,加载出现异常!'
  280. });
  281. table.on('row(crmsearchlist)', function (obj) {
  282. let data=obj.data;
  283. if (data.state != '无效') {
  284. if (data.signorder_time || data.jiaoding_time) {
  285. $.ajax({
  286. url: '{:url("community/checkCustomer")}'
  287. , data: {
  288. id: data.id,
  289. }
  290. , type: 'post'
  291. , success: function (rs) {
  292. if(rs.code==0){
  293. window.parent.signmsg(data.id,'community')
  294. }else{
  295. alert(rs.msg)
  296. }
  297. }
  298. })
  299. }
  300. }
  301. });
  302. }
  303. reload = function () {
  304. table.reload('crmsearchlist', { }, true);
  305. };
  306. })
  307. function getcrmtap(cid) {
  308. if(confirm('确定要获取到我的客户列表?') == true){
  309. window.parent.getinvalid(cid, 'search_list.html');
  310. // $.ajax({
  311. // url: '{:url("empcrm/fetchpoolitem")}'
  312. // , data: {
  313. // cid: cid,
  314. // }
  315. // , type: 'post'
  316. // , success: function (res) {
  317. // console.log(res)
  318. // if (res.code == 0) {
  319. // } else {
  320. // alert(res.msg)
  321. // }
  322. // }
  323. // });
  324. }
  325. }
  326. </script>
  327. {/block}