tips.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <include file="public@header"/>
  2. </head>
  3. <style>
  4. .form-inline .form-control {
  5. margin: 10px 0;
  6. vertical-align: middle;
  7. }
  8. .form-inline span {
  9. margin-left: 5px;
  10. vertical-align: middle;
  11. }
  12. .margin-left-10 {
  13. margin-left: 10px;
  14. }
  15. .profile em {
  16. font-style: normal;
  17. color: #0b6cbc;
  18. }
  19. .profile em.red {
  20. color: red;
  21. }
  22. span.sort {
  23. color: red;
  24. display: inline-block;
  25. margin-left: 2px;
  26. vertical-align: middle;
  27. }
  28. td img.avatar, td img.sex {
  29. width: 24px;
  30. height: 24px;
  31. vertical-align: middle;
  32. border-radius: 100%;
  33. }
  34. .form .form-control {
  35. margin-bottom: 20px;
  36. }
  37. .form .control-label {
  38. text-align: center;
  39. }
  40. .form label {
  41. text-align: left;
  42. margin-bottom: 10px;
  43. margin-right: 10px;
  44. }
  45. .radio-inline+.radio-inline, .checkbox-inline+.checkbox-inline {
  46. margin-left: 0;
  47. }
  48. .table-actions span {
  49. margin-right: 10px;
  50. font-weight: bold;
  51. }
  52. .table-actions span em {
  53. font-style: normal;
  54. color: red;
  55. }
  56. .layui-layer-page .layui-layer-content {
  57. overflow: hidden !important;
  58. }
  59. span.expired {
  60. color: red;
  61. }
  62. </style>
  63. <body>
  64. <div class="wrap js-check-wrap">
  65. <ul class="nav nav-tabs">
  66. <li class="active"><a>标签分类资源</a>
  67. </li>
  68. </ul>
  69. <form id="search" class="well form-inline margin-top-20" method="post" action="{:url('admin/sales/tips')}">
  70. <span>会员ID:</span>
  71. <input class="form-control" type="text" name="uid" style="width: 150px;" value="{:input('request.uid')}"
  72. placeholder="会员ID">
  73. <span>用户昵称:</span>
  74. <input class="form-control" type="text" name="user_nickname" style="width: 200px;"
  75. value="{:input('request.user_nickname')}" placeholder="用户昵称"><br>
  76. <span>用户姓名:</span>
  77. <input class="form-control" type="text" name="real_name" style="width: 200px;"
  78. value="{:input('request.real_name')}" placeholder="用户姓名">
  79. <span>手机号:</span>
  80. <input class="form-control" type="text" name="mobile" style="width: 200px;" value="{:input('request.mobile')}"
  81. placeholder="手机号">
  82. <input id="sort" type="hidden" name="sort" value="{$params.sort?$params.sort: 1}">
  83. <input id="sortType" type="hidden" name="sort_type" value="{$params.sort_type?$params.sort_type: 'desc'}">
  84. <input type="submit" class="btn btn-primary margin-left-10 " value="搜索"/>
  85. <a class="btn btn-default margin-left-10" href="{:url('admin/sales/tips')}">清空</a>
  86. <!-- <a class="btn btn-warning margin-left-10" href="{:url('admin/sales/export')}">导出</a>-->
  87. </form>
  88. <form class="form-horizontal js-ajax-form margin-top-20" role="form">
  89. <div class="table-actions tags">
  90. <foreach name="tagCounts" item="vo" key="k">
  91. <if condition="$k gt 0">
  92. <a href="{:url('admin/sales/tips',['intention'=> $k])}" <if condition="$k eq $params.intention">class="btn btn-primary margin-left-10"<else>class="btn btn-default margin-left-10"</if>>{$vo.name}({$vo.num})</a>
  93. <else>
  94. <a href="{:url('admin/sales/tips',['intention'=> $k])}" <if condition="$k eq $params.intention">class="btn btn-primary margin-left-10"<else>class="btn btn-default margin-left-10"</if>>全部({$total})</a>
  95. </if>
  96. </foreach>
  97. </div>
  98. <table class="table table-hover table-bordered">
  99. <thead>
  100. <tr>
  101. <!-- <th width="60"><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>-->
  102. <th>ID</th>
  103. <th width="120">用户名</th>
  104. <th>基本资料</th>
  105. <th>姓名</th>
  106. <th>手机号</th>
  107. <th width="100">VIP会员</th>
  108. <th width="100">充值过</th>
  109. <th width="100">消费过</th>
  110. <th width="100">跟进</th>
  111. <th width="100">意向标签</th>
  112. <th width="180">加入时间 <span class="row sort join-time" data-status="{$params.sort == 1? $params.sort_type : 'desc'}" onclick="sort(this,1)"><if condition="$params.sort eq 1 && $params.sort_type eq 'asc'">&#8595;<else>&#8593;</if></span></th>
  113. <th width="140">坠海倒计时 <span class="row sort pool-time" data-status="{$params.sort == 2? $params.sort_type : 'desc'}" onclick="sort(this,2)"><if condition="$params.sort eq 2 && $params.sort_type eq 'asc'">&#8595;<else>&#8593;</if></span></th>
  114. <th width="150">最后联系<span class="row sort last-time" data-status="{$params.sort == 3? $params.sort_type : 'desc'}" onclick="sort(this,3)"><if condition="$params.sort eq 3 && $params.sort_type eq 'asc'">&#8595;<else>&#8593;</if></span></th>
  115. <th>操作</th>
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <foreach name="list" item="vo">
  120. <tr>
  121. <!-- <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>-->
  122. <td>{$vo.user_id}</td>
  123. <td>
  124. <img class="avatar" src="{$vo.avatar}"> <if condition="$vo['sex'] eq 1"><img class="sex" src="/static/images/male.png" alt=""><else><img class="sex" src="/static/images/fmale.png" alt=""></if> <span>{$vo['user_nickname']}</span>
  125. </td>
  126. <td>
  127. <p class="profile">{$vo.profile_text}</p>
  128. </td>
  129. <td>{$vo['real_name']}</td>
  130. <td><span <if condition="$vo.is_expired">class="expired"</if>>{$vo['mobile']? $vo['mobile']:'无'}</span></td>
  131. <td>
  132. <if condition="$vo['is_vip'] eq 1">
  133. <span style="color: green;">是</span>
  134. <else>
  135. <span style="color: red;">否</span>
  136. </if>
  137. </td>
  138. <td>
  139. <if condition="$vo['is_recharge'] eq 1">
  140. <span style="color: green;">是</span>
  141. <else>
  142. <span style="color: red;">否</span>
  143. </if>
  144. </td>
  145. <td>
  146. <if condition="$vo['is_cost'] eq 1">
  147. <span style="color: green;">是</span>
  148. <else>
  149. <span style="color: red;">否</span>
  150. </if>
  151. </td>
  152. <td><span id="follow-num{$vo.pool_id}">{$vo['followup_num']}</span></td>
  153. <td>
  154. <a onclick="setTag('{$vo.pool_id}','{$vo.real_name}','{$vo.intention}')" >{$vo.intention_text? $vo.intention_text: '设置'}</a>
  155. </td>
  156. <td>{$vo['create_time']}</td>
  157. <td><span <if condition="$vo.is_expired">class="expired"</if>>{$vo['expire_text']}</span></td>
  158. <td><span id="follow-time{$vo.pool_id}">{$vo['last_follow_time']? $vo['last_follow_time'] : '-'}</span></td>
  159. <td>
  160. <a onclick="setAgency('{$vo.pool_id}','{$vo.real_name}','{$vo.remark}','{$vo.agency}')" >跟进</a>
  161. </td>
  162. </foreach>
  163. </tbody>
  164. </table>
  165. <div class="pagination">{$page}</div>
  166. <div id="tag" class="dialog" style="display: none; margin-top: 20px;">
  167. <div class="form">
  168. <form method="post" class="form-horizontal js-ajax-form margin-top-20" >
  169. <div class="form-group">
  170. <label class="col-sm-3 control-label"><span class="form-required">*</span>选择标签</label>
  171. <div class="col-sm-8">
  172. <foreach name="tags" item="vo" key="k">
  173. <label for="input-tag{$k}" class="radio-inline">
  174. <input type="radio" id="input-tag{$k}" name="tag" onchange="selectTag(this)" value="{$k}" data-name="{$vo}">{$vo}
  175. </label>
  176. </foreach>
  177. </div>
  178. </div>
  179. </form>
  180. </div>
  181. </div>
  182. <div id="agency" class="dialog" style="display: none; margin-top: 20px;">
  183. <div class="form">
  184. <form method="post" class="form-horizontal js-ajax-form margin-top-20" >
  185. <div class="form-group">
  186. <label class="col-sm-3 control-label"><span class="form-required"></span>真实姓名</label>
  187. <div class="col-sm-8">
  188. <input type="text" class="form-control" id="real_name" name="real_name" readonly value="">
  189. </div>
  190. </div>
  191. <div class="form-group">
  192. <label class="col-sm-3 control-label"><span class="form-required">*</span>跟进情况</label>
  193. <div class="col-sm-8">
  194. <foreach name="agencys" item="vo" key="k">
  195. <label for="input-agency{$k}" class="radio-inline">
  196. <input type="radio" id="input-agency{$k}" name="agency" onchange="selectAgency(this)" value="{$k}">{$vo}
  197. </label>
  198. </foreach>
  199. </div>
  200. </div>
  201. <div class="form-group">
  202. <label class="col-sm-3 control-label"><span class="form-required"></span>备注</label>
  203. <div class="col-sm-8">
  204. <textarea class="form-control" id="remark" name="content" maxlength="150" style="height: 80px;" placeholder="跟进备注"></textarea>
  205. </div>
  206. </div>
  207. </form>
  208. </div>
  209. </div>
  210. </form>
  211. </div>
  212. <script src="__STATIC__/js/admin.js"></script>
  213. <script src="__STATIC__/js/clipboard.min.js"></script>
  214. <script src="__STATIC__/js/layer/layer.js"></script>
  215. <script src="__STATIC__/js/position/position1.js" type="text/javascript"></script>
  216. <script src="__STATIC__/js/height/height.js" type="text/javascript"></script>
  217. <script>
  218. var tagId = 0;
  219. var agencyId = 0;
  220. /**
  221. * 排序
  222. * @param type
  223. */
  224. function sort(ele,type){
  225. $("#sort").val(type);
  226. var status = $(ele).attr('data-status');
  227. $("#sortType").val(status=='desc'? 'asc': 'desc');
  228. $(ele).html(status == 'desc'? '&#8595;' : '&#8593;');
  229. $(ele).attr('data-status', status=='desc'? 'asc': 'desc');
  230. $("#search").submit();
  231. }
  232. /**
  233. * 选择销售用户
  234. * @param ele
  235. */
  236. function selectTag(ele){
  237. tagId = $(ele).val();
  238. }
  239. /**
  240. * 跟进
  241. * */
  242. function selectAgency(ele){
  243. agencyId = $(ele).val();
  244. }
  245. /**
  246. * 设置标签
  247. * @returns {boolean}
  248. */
  249. function setTag(pool_id,real_name,tagId){
  250. $("input[name=tag]").attr('checked', false);
  251. $("#input-tag"+tagId).attr('checked', "checked");
  252. layer.open({
  253. type: 1, //1:页面层,2:iframe层,3:加载层,4:tips层。
  254. title: '设置[ID:'+pool_id+'-'+real_name+']用户资源的标签',
  255. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  256. shade: 0.8, //遮罩
  257. offset: 'auto',
  258. area: ['600px', '260px'],
  259. content: $("#tag"),
  260. btn: ['确定设置','取消'],
  261. btnAlign: 'c',
  262. yes: function(){
  263. if(tagId<=0){
  264. layer.msg('请选择标签')
  265. return false;
  266. }
  267. if (confirm('确定设置标签吗?请谨慎操作')) {
  268. $.post('/admin/sales/setTag', {pool_id: pool_id, tagId: tagId}, function (res) {
  269. if (res.code == 1) {
  270. layer.msg(res.msg)
  271. var tagName = $("input-tag"+tagId).attr('data-name');
  272. $("#tag-row"+pool_id).text(tagName);
  273. /*setTimeout(function () {
  274. location.reload();
  275. }, 2000)*/
  276. } else {
  277. layer.msg(res.msg);
  278. }
  279. }, "json")
  280. }
  281. },
  282. cancel: function(){
  283. }
  284. });
  285. return false;
  286. }
  287. /**
  288. * 设置跟进情况
  289. * @returns {boolean}
  290. */
  291. function setAgency(pool_id,real_name,remark,agencyId){
  292. console.log(5346)
  293. $("input[name=agency]").attr('checked', false);
  294. $("#input-agency"+agencyId).prop('checked', "true");
  295. console.log(agency)
  296. console.log($("#real_name"))
  297. $("#real_name").val(real_name);
  298. $("#remark").text(remark);
  299. layer.open({
  300. type: 1, //1:页面层,2:iframe层,3:加载层,4:tips层。
  301. title: '设置[ID:'+pool_id+'-'+real_name+']用户跟进情况',
  302. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  303. shade: 0.8, //遮罩
  304. offset: 'auto',
  305. area: ['780px', '480px'],
  306. content: $("#agency"),
  307. btn: ['确定设置','取消'],
  308. btnAlign: 'c',
  309. yes: function(){
  310. if(agencyId<=0){
  311. layer.msg('请选择跟进情况')
  312. return false;
  313. }
  314. remark = $("#remark").val();
  315. console.log(remark)
  316. if (confirm('确定设置跟进情况吗?请谨慎操作')) {
  317. $.post('/admin/sales/setAgency', {pool_id: pool_id, agencyId: agencyId, remark: remark}, function (res) {
  318. if (res.code == 1) {
  319. layer.msg(res.msg)
  320. $("#follow-num"+pool_id).text(res.data.num);
  321. $("#follow-time"+pool_id).text(res.data.time);
  322. } else {
  323. layer.msg(res.msg);
  324. }
  325. }, "json")
  326. }
  327. },
  328. cancel: function(){
  329. }
  330. });
  331. return false;
  332. }
  333. /**
  334. * 清除
  335. * @returns {boolean}
  336. */
  337. function doDelete() {
  338. var ids = [];
  339. $(".js-check:checked").each(function () {
  340. var id = $(this).val();
  341. if (id > 0) {
  342. ids.push(id);
  343. }
  344. });
  345. if (ids.length <= 0) {
  346. layer.msg('请先选择操作项');
  347. return false;
  348. }
  349. if (confirm('确定批量清除选择项?不可恢复')) {
  350. $.post('/admin/pools/clear', {ids: ids}, function (res) {
  351. if (res.code == 1) {
  352. layer.msg(res.msg);
  353. setTimeout(function () {
  354. location.reload();
  355. }, 800)
  356. } else {
  357. layer.msg(res.msg);
  358. }
  359. }, "json")
  360. }
  361. }
  362. </script>
  363. </body>
  364. </html>