building-index.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <!-- include 'header' -->
  2. <body>
  3. <div class="mainLayout">
  4. <div class="mainMenu">
  5. <div class="menuItem">
  6. <a href="#" class="mLogo">CLD</a>
  7. <ul>
  8. <!-- include 'menu' -->
  9. </ul>
  10. </div>
  11. </div>
  12. <div class="warpContent">
  13. <div class="contactTab">
  14. <a class="now" href="#">建筑计价</a>
  15. <div class="searchItem">
  16. <input type="text" placeholder="输入建筑用户手机号进行搜索" id="search_mobile">
  17. <input type="hidden" id="hidden_search" value="0">
  18. <input type="button" class="subBtn search-build" value="搜索">
  19. </div>
  20. </div>
  21. <div class="contactDatabase fL">
  22. <div class="contactCate">
  23. <ul class="cateList">
  24. <li class="clearfix filter">
  25. <select id="compilation_select">
  26. <option value="0">所有建筑版本</option>
  27. <!-- if !empty({{compilationList}}) -->
  28. <!-- loop compilationList -->
  29. <option value="{{compilationList' value.compilation_id}}">{{compilationList' value.cname}}专业版</option>
  30. <!-- endloop -->
  31. <!-- endif -->
  32. </select>&nbsp;
  33. <select id="year_select">
  34. {{year_option}}
  35. </select>&nbsp;
  36. <select id="month_select">
  37. <option value="0">所有月份</option>
  38. <option value="1">1月</option>
  39. <option value="2">2月</option>
  40. <option value="3">3月</option>
  41. <option value="4">4月</option>
  42. <option value="5">5月</option>
  43. <option value="6">6月</option>
  44. <option value="7">7月</option>
  45. <option value="8">8月</option>
  46. <option value="9">9月</option>
  47. <option value="10">10月</option>
  48. <option value="11">11月</option>
  49. <option value="12">12月</option>
  50. </select>&nbsp;
  51. <select id="category_select">
  52. <!-- loop categoryList -->
  53. <option value="{{categoryList' value.cid}}" <!-- if {{categoryList' value.cid}} == {{staff.0.cid}} -->selected<!-- endif -->>{{categoryList' value.title}}</option>
  54. <!-- endloop -->
  55. </select>&nbsp;
  56. <select id="staff_select">
  57. <option value="0">负责人</option>
  58. <!-- loop staffList -->
  59. <option value="{{staffList' value.sid}}">{{staffList' value.username}}</option>
  60. <!-- endloop -->
  61. </select>
  62. </li>
  63. </ul>
  64. <div class="contactTableHead">
  65. <table class="buildingUl">
  66. <tbody>
  67. <tr>
  68. <td width="150">通行帐号手机号</td>
  69. <td width="180">激活产品</td>
  70. <td width="100">办事处</td>
  71. <td width="75">责任人</td>
  72. <td width="90">状态</td>
  73. <td width="90">cld客户</td>
  74. <td>激活时间</td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <div class="contactList autoHeightL2">
  81. <table class="contactTable" id="build_list">
  82. <!-- if !empty({{blist}}) -->
  83. <!-- loop blist -->
  84. <tr>
  85. <td width="150"><a href="javascript:void(0);" class="getBuildingMsg" data-id="{{blist' value.sso_id}}" data-cid="{{blist' value.client_id}}">{{blist' value.mobile}}</a></td>
  86. <td width="180">{{blist' value.cname}}专业版</td>
  87. <td width="100">{{blist' value.categoryname}}</td>
  88. <td width="75"><a href="javascript:void(0);" class="getStaffMsg" data-sid="{{blist' value.sid}}">{{blist' value.staffname}}</a></td>
  89. <td width="90"><!-- if {{blist' value.status}} == 1 -->已激活<!-- endif --></td>
  90. <td width="90"><!-- if {{blist' value.client_id}} != 0 --><a href="javascript:void(0);" class="getClientMsg" data-cid="{{blist' value.client_id}}">{{blist' value.clientname}}</a><!-- endif --></td>
  91. <td>{{blist' value.addtime}}</td>
  92. </tr>
  93. <!-- endloop -->
  94. <!-- endif -->
  95. </table>
  96. </div>
  97. </div>
  98. <div class="lockDetil fL">
  99. <div class="lockRecord autoHeightR2">
  100. <!--build建筑信息页-->
  101. <div id="build_msg" style="display:none;">
  102. <div class="toolItem clearfix">
  103. <div class="contactInfo">
  104. <div class="contactPanel">
  105. <h1>建筑用户信息</h1>
  106. <table>
  107. <tbody id="buildUserInfo_msg">
  108. </tbody>
  109. </table>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="toolItem clearfix">
  114. <div class="contactPanel">
  115. <div class="subNav">
  116. <ul class="navTabs">
  117. <li class="active tabChange" data-tab="build"><a href="#">建筑激活版本</a></li>
  118. <li class="tabChange" data-tab="cld"><a href="#">cld客户信息</a></li>
  119. </ul>
  120. </div>
  121. <table class="versionTabale" id="compilation_msg">
  122. <input type="hidden" id="build_ssoid" value="">
  123. <input type="hidden" id="build_mobile" value="">
  124. <input type="hidden" id="client_id" value="">
  125. <tr>
  126. <th>产品</th><th>免费版</th><th>专业版</th>
  127. </tr>
  128. <tbody id="compilation_list">
  129. </tbody>
  130. <tr id="activation_btn" style="display: none">
  131. <td colspan="2">
  132. <a href="javascript:void(0)" class="button">确定</a>
  133. </td><td></td>
  134. </tr>
  135. </table>
  136. <table id="clientInfo_msg" style="display: none;">
  137. <tr><th>姓名</th><td><a href="#">周乃君</a></td><th>昵称</th><td>周工</td></tr>
  138. <tr><th>性别</th><td>女</td><th>办事处</th><td>广东办</td></tr>
  139. <tr><th>手机</th><td>12345678910</td><th>电话</th><td>0000-564645654</td></tr>
  140. <tr><th>QQ</th><td>12345678</td><th>邮箱</th><td>123456@qq.com</td></tr>
  141. <tr><th>单位全称</th><td><a href="#">广东长誉公路工程有限公司</a></td></tr>
  142. </table>
  143. </div>
  144. </div>
  145. <div class="toolItem clearfix" id="add_client" style="display: none">
  146. <div class="contactInfo">
  147. <div class="contactPanel">
  148. <h1>绑定cld客户</h1>
  149. <div>
  150. <span data-placement="right" data-toggle="ctooltip" data-original-title="只允许填写库中存在的客户,若输入客户不存在,请先添加该客户。">
  151. <input type="text" id="client_result" value="">
  152. </span>
  153. </div>
  154. <a href="javascript:void(0)" class="button" id="addclient_btn">确定绑定</a>
  155. </div>
  156. </div>
  157. </div>
  158. <div id="activation_list">
  159. </div>
  160. </div>
  161. <!--end build-->
  162. <!--staff员工信息页-->
  163. <div class="toolItem clearfix" style="display: none;" id="staff_msg">
  164. <div class="contactPanel">
  165. <h1>刘飞</h1>
  166. <table>
  167. <tbody>
  168. <tr>
  169. <th>性别</th><td>男</td>
  170. <th>办事处</th><td>广东办</td>
  171. </tr>
  172. <tr>
  173. <th>手机</th><td>12345678910</td>
  174. <th>电话</th><td>0000-564645654</td>
  175. </tr>
  176. <tr>
  177. <th>QQ</th><td>12345678</td>
  178. <th>邮箱</th><td>123456@qq.com</td>
  179. </tr>
  180. </tbody>
  181. </table>
  182. </div>
  183. </div>
  184. <!--end staff-->
  185. <!--client客户信息页-->
  186. <div class="toolItem clearfix" style="display: none;" id="clientInfo">
  187. <!--<div class="toolItem clearfix" style="display: none;" id="client_msg">-->
  188. <div class="contactPanel">
  189. <h1><p class="fR">总部-<a href="javascript:void(0)" onclick="getStaffInfo('温秀娟')">温秀娟</a></p>周乃君<i class="icon- sport">5</i><a data-original-title="编辑客户" data-toggle="ctooltip" data-placement="right" href="javascript:clientEdit(80171)" class="icon- edit">I</a></h1>
  190. <table>
  191. <tbody><tr><th>性别</th><td>女</td><th>昵称</th><td>庄(青美):</td></tr>
  192. <tr><th>手机</th><td>18299400510</td><th>QQ</th><td>409764520</td></tr>
  193. <tr><th>电话</th><td>0794-8223829</td><th>邮箱</th><td>409764520@qq.com</td></tr>
  194. <tr><th>备注</th><td colspan="3"></td></tr>
  195. <tr><td colspan="4"></td></tr>
  196. </tbody></table>
  197. </div>
  198. <div class="contactPanel">
  199. <table>
  200. <tbody>
  201. <tr><th>单位全称</th><td colspan="3"><a href="javascript:void(0)" onclick="getCompany('8668')">昆明苇杭科技有限公司</a></td></tr>
  202. <tr><th>单位主页</th><td colspan="3">http://www.xfxsoft.cn/</td></tr>
  203. <tr><th>客户地区</th><td>云南省,昆明市,西山区</td><th>部门/职位</th><td>/</td></tr>
  204. <tr><th>客户传真</th><td></td><th>办公室</th><td></td></tr>
  205. <tr><th>客户地址</th><td colspan="3">云南省昆明市盘龙区东风东路47号建业商务中心A2202</td></tr>
  206. <tr><th>客户乘车</th><td colspan="3"></td></tr>
  207. <tr><th>客户地标</th><td colspan="3">建业商务中心</td></tr>
  208. <tr><th>客户住宿</th><td colspan="3"></td></tr>
  209. </tbody></table>
  210. </div>
  211. </div>
  212. <!--end client-->
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <script type="text/javascript">autoFlashHeight();</script>
  218. <link rel="stylesheet" href="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.css" />
  219. <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.js"></script>
  220. <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.core.js"></script>
  221. <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
  222. <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>
  223. <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.autocomplete.js"></script>
  224. <script>
  225. $(function(){
  226. // 建筑激活页面cld客户搜索
  227. $("#client_result").blur(function(){
  228. var url="/checkClient";
  229. var name=$(this).val();
  230. $.ajax({
  231. url:url,
  232. type: "post",
  233. cache: false,
  234. dataType: "json",
  235. data: {
  236. name:name
  237. },
  238. global: true,
  239. success: function(data){
  240. if(data.success){
  241. $("#client_result").css("background-color","#fff");
  242. }else{
  243. $("#client_result").css("background-color","#f15b6c");
  244. $('#client_id').val('');
  245. }
  246. },
  247. error:function(err){
  248. $("#client_result").css("background-color","#f15b6c");
  249. $('#client_id').val('');
  250. }
  251. });
  252. });
  253. $("#client_result").autocomplete({
  254. source: function( request, response ) {
  255. $.ajax({
  256. url: "/searchClient",
  257. dataType: "json",
  258. data:{
  259. searchDbInforItem: request.term
  260. },
  261. success: function( data ) {
  262. response( $.map( data, function( item ) {
  263. return {
  264. name:item.cid,
  265. value: item.clientname+"-"+item.companyname
  266. }
  267. }));
  268. }
  269. });
  270. },
  271. minLength: 1,
  272. select: function( event, ui ) {
  273. $("#client_result").val(ui.item.dbId);
  274. $('#client_id').val(ui.item.name);
  275. }
  276. });
  277. })
  278. </script>
  279. <script>
  280. $(function(){
  281. // 获取建筑用户信息
  282. $('body').on('click', '.getBuildingMsg', function(){
  283. var id = $(this).attr('data-id');
  284. var cid = $(this).attr('data-cid');
  285. getBuildMsg(id, cid);
  286. });
  287. // 获取cld客户信息
  288. $('body').on('click', '.getClientMsg', function(){
  289. var cid = $(this).attr('data-cid');
  290. $.ajax({
  291. type: 'get',
  292. url: '/building/getClientMsg?cid=' + cid,
  293. dataType: 'json',
  294. success: function(result) {
  295. if (result.code == '200') {
  296. var data = result.data;
  297. // 获取cld客户信息
  298. var clientInfo = data.clientInfo;
  299. var staffInfo = data.staffInfo;
  300. var clienthtml = '<div class="contactPanel"><h1><p class="fR">' + staffInfo.category + '-<a href="javascript:void(0)" class="getStaffMsg" data-sid="' + staffInfo.sid + '">' + staffInfo.username + '</a></p>' +
  301. clientInfo.clientname + '<i class="icon- sport">' + clientInfo.priority + '</i><a data-original-title="编辑客户" data-toggle="ctooltip" data-placement="right" href="javascript:clientEdit(' + clientInfo.cid + ')" class="icon- edit">I</a></h1> ' +
  302. '<table><tbody>' +
  303. '<tr><th>性别</th><td>' + clientInfo.gender + '</td><th>昵称</th><td>' + clientInfo.nicename + '</td></tr> ' +
  304. '<tr><th>手机</th><td>' + clientInfo.telephone + '</td><th>QQ</th><td>' + clientInfo.qq + '</td></tr> ' +
  305. '<tr><th>电话</th><td>' + clientInfo.phone + '</td><th>邮箱</th><td>' + clientInfo.email + '</td></tr> ' +
  306. '<tr><th>备注</th><td colspan="3">' + clientInfo.mark + '</td></tr> ' +
  307. '<tr><td colspan="4"></td></tr> ' +
  308. '</tbody></table></div>';
  309. $('#clientInfo_result').html(clienthtml);
  310. // 获取单位信息
  311. var companyInfo = data.companyInfo;
  312. var local = data.local;
  313. var companyhtml = '<div class="contactPanel"><table> <tbody> ' +
  314. '<tr><th>单位全称</th><td colspan="3"><a href="javascript:void(0)" onclick="getCompany(' + companyInfo.cid + ')">' + companyInfo.companyname + '</a></td></tr> ' +
  315. '<tr><th>单位主页</th><td colspan="3">' + clientInfo.webservice + '</td></tr> ' +
  316. '<tr><th>客户地区</th><td>' + local[0].name + ',' + local[1].name + ',' + local[2].name + '</td><th>部门/职位</th><td>' + clientInfo.department + '</td></tr> ' +
  317. '<tr><th>客户传真</th><td>' + clientInfo.fax + '</td><th>办公室</th><td>' + clientInfo.office + '</td></tr> ' +
  318. '<tr><th>客户地址</th><td colspan="3">' + clientInfo.address + '</td></tr> ' +
  319. '<tr><th>客户乘车</th><td colspan="3">' + clientInfo.ride + '</td></tr> ' +
  320. '<tr><th>客户地标</th><td colspan="3">' + clientInfo.landmarks + '</td></tr> ' +
  321. '<tr><th>客户住宿</th><td colspan="3">' + clientInfo.stay + '</td></tr> ' +
  322. '</tbody></table></div>';
  323. var html = clienthtml + companyhtml;
  324. $('#clientInfo').html(html);
  325. $('#clientInfo').show();
  326. $('#staff_msg').hide();
  327. $('#build_msg').hide();
  328. }
  329. }
  330. })
  331. });
  332. // 获取cld责任人信息
  333. $('body').on('click', '.getStaffMsg', function(){
  334. var sid = $(this).attr('data-sid');
  335. $.ajax({
  336. type: 'get',
  337. url: '/building/getStaffMsg?sid=' + sid,
  338. dataType: 'json',
  339. success: function(result) {
  340. if (result.code == '200') {
  341. var userinfo = result.data;
  342. var html = '<div class="contactPanel"><h1>' + userinfo.username + '</h1> ' +
  343. '<table> <tbody> ' +
  344. '<tr> ' +
  345. '<th>性别</th><td>' + userinfo.gender + '</td> ' +
  346. '<th>办事处</th><td>' + userinfo.category + '</td> ' +
  347. '</tr> ' +
  348. '<tr> ' +
  349. '<th>手机</th><td>' + userinfo.telephone + '</td> ' +
  350. '<th>电话</th><td>' + userinfo.phone + '</td> ' +
  351. '</tr> ' +
  352. '<tr> ' +
  353. '<th>QQ</th><td>' + userinfo.qq + '</td> ' +
  354. '<th>邮箱</th><td>' + userinfo.email + '</td> ' +
  355. '</tr> ' +
  356. '</tbody> ' +
  357. '</table></div>';
  358. $('#staff_msg').html(html);
  359. $('#staff_msg').show();
  360. $('#build_msg').hide();
  361. $('#clientInfo').hide();
  362. }
  363. }
  364. })
  365. });
  366. // 搜索建筑用户信息
  367. $('.search-build').on('click', function(){
  368. var mobile = $('#search_mobile').val();
  369. if (mobile == '') {
  370. alert('请输入建筑用户手机号');
  371. } else {
  372. $.ajax({
  373. type: 'get',
  374. url: '/building/checkMobile?mobile=' + mobile,
  375. dataType: 'json',
  376. success: function(result) {
  377. if (result.code == '200') {
  378. var data = result.data;
  379. getBuildList(data.id);
  380. getBuildMsg(data.id, data.cid);
  381. } else {
  382. alert(result.msg);
  383. }
  384. }
  385. })
  386. }
  387. });
  388. // 激活建筑产品
  389. $('#activation_btn a').click(function() {
  390. // 只获取第一个选中的值
  391. var cid = $('#compilation_list input:checked').attr('data-cid');
  392. var cname = $('#compilation_list input:checked').attr('data-cname');
  393. var id = $('#build_ssoid').val();
  394. var mobile = $('#build_mobile').val();
  395. var client_id = $('#client_id').val();
  396. if (cid !== undefined && id !== '') {
  397. $.ajax({
  398. type: 'post',
  399. url: '/building/setUserCompilation',
  400. data: {id: id, cid: cid, mobile: mobile, client_id: client_id, cname: cname},
  401. dataType: 'json',
  402. success: function(result) {
  403. if (result.code == '200') {
  404. $('#hidden_search').val() != 0 ? getBuildList(id) : getBuildList('');
  405. getBuildMsg(id, client_id);
  406. } else {
  407. alert('激活失败');
  408. }
  409. }
  410. })
  411. } else {
  412. alert('请选择需要激活的版本');
  413. }
  414. });
  415. // 绑定cld客户
  416. $('#addclient_btn').click(function() {
  417. var cid = $('#client_id').val();
  418. var id = $('#build_ssoid').val();
  419. if (cid == '' || id == '') {
  420. alert('请根据要求填入cld客户');
  421. } else {
  422. $.ajax({
  423. type: 'post',
  424. url: '/building/setUserClient',
  425. data: {id: id, cid: cid},
  426. dataType: 'json',
  427. success: function(result) {
  428. if (result.code == '200') {
  429. $('#hidden_search').val() != 0 ? getBuildList(id) : getBuildList('');
  430. getBuildMsg(id, cid);
  431. } else {
  432. alert('绑定失败');
  433. }
  434. }
  435. })
  436. }
  437. });
  438. // ajax 获取建筑信息方法
  439. function getBuildMsg(id, cid) {
  440. $.ajax({
  441. type: 'get',
  442. url: '/building/getBuildMsg',
  443. data: {id: id, cid: cid},
  444. dataType: 'json',
  445. success: function(result) {
  446. if (result.code == '200') {
  447. var data = result.data;
  448. var builduserinfo = data.userInfo;
  449. var buildmsghtml =
  450. '<tr><th>称呼</th><td>' + builduserinfo.real_name + '</td><th>使用时间</th><td>' + builduserinfo.create_time + '</td></tr> ' +
  451. '<tr><th>手机</th><td>' + builduserinfo.mobile + '</td><th>邮箱</th><td>' + builduserinfo.email + '</td></tr> ' +
  452. '<tr><th>企业名称</th><td>' + builduserinfo.company + '</td><th>企业规模</th><td>' + builduserinfo.company_scale + '</td></tr> ' +
  453. '<tr><th colspan="2" width="50">企业所在地区</th><td colspan="2">' + builduserinfo.province + '</td></tr> ';
  454. $('#buildUserInfo_msg').html(buildmsghtml);
  455. $('#build_ssoid').val(builduserinfo.ssoId);
  456. $('#build_mobile').val(builduserinfo.mobile);
  457. var compilationhtml = '';
  458. var addCompilation = false;
  459. $.each(data.compilationList, function(k, v) {
  460. compilationhtml += '<tr> <th>' + v.name + '</th>' +
  461. '<td>' + (v.isUpgrade !== undefined && v.isUpgrade === false ? '<img src="<?= WEB_SITE_GLOBAL ?>css/checkmark.png" width="20" height="20">' : '') + '</td>' +
  462. '<td>' + (v.isUpgrade !== undefined && v.isUpgrade === true ? '<img src="<?= WEB_SITE_GLOBAL ?>css/checkmark.png" width="20" height="20">' : '<input type="checkbox" data-cid="' + v._id + '" data-cname="' + v.name + '" >') + '</td> ' +
  463. '</tr>';
  464. if (v.isUpgrade === undefined || v.isUpgrade === false) {
  465. addCompilation = true;
  466. }
  467. });
  468. if (addCompilation) {
  469. $('#activation_btn').show();
  470. } else {
  471. $('#activation_btn').hide();
  472. }
  473. $('#compilation_list').html(compilationhtml);
  474. var addclienthtml = '';
  475. $('#add_client').hide();
  476. if (data.clientInfo != '') {
  477. var clientinfo = data.clientInfo;
  478. var clientInfohtml = '' +
  479. '<tr><th>姓名</th><td><a href="#" class="getClientMsg" data-cid="' + clientinfo.cid + '">' + clientinfo.clientname + '</a></td><th>昵称</th><td>' + clientinfo.nicename + '</td></tr> ' +
  480. '<tr><th>性别</th><td>' + clientinfo.gender + '</td><th>办事处</th><td>' + clientinfo.department + '</td></tr> ' +
  481. '<tr><th>手机</th><td>' + clientinfo.telephone + '</td><th>电话</th><td>' + clientinfo.phone + '</td></tr> ' +
  482. '<tr><th>QQ</th><td>' + clientinfo.qq + '</td><th>邮箱</th><td>' + clientinfo.email + '</td></tr> ' +
  483. '<tr><th>单位全称</th><td><a href="#">' + clientinfo.companyname + '</a></td></tr>';
  484. $('#clientInfo_msg').html(clientInfohtml);
  485. $('#client_id').val(clientinfo.cid);
  486. } else {
  487. $('#clientInfo_msg').html('暂未添加cld客户信息');
  488. $('#add_client input').val('');
  489. $('#add_client').show();
  490. $('#client_id').val('');
  491. $('#clientInfo').val('');
  492. }
  493. // 激活时间轴
  494. var activationListhtml = '';
  495. var activationList = data.buildActivationList;
  496. $.each(activationList, function(k, v) {
  497. activationListhtml += '<div class="infoFlowList"> <div class="dateTitle"> ' +
  498. '<em class="month"><span class="num">' + v.month + '</span><span class="text">-' + v.day + '</span></em> ' +
  499. '<span class="year">' + v.year + '</span> </div> ' +
  500. '<ul class="flowList"> ' +
  501. '<li class="item iconUpdate">激活 &lt; ' + v.categoryname + '<a href="#" class="getStaffMsg" data-sid="' + v.sid + '">' + v.staffname + '</a></li> ' +
  502. '<li class="item">' + v.cname + '专业版</li> </ul> </div>';
  503. });
  504. $('#activation_list').html(activationListhtml);
  505. $('#build_msg').show();
  506. $('#staff_msg').hide();
  507. $('#clientInfo').hide();
  508. } else {
  509. alert('没有此用户');
  510. }
  511. }
  512. })
  513. }
  514. // ajax 获取列表方法
  515. function getBuildList(ssoid) {
  516. if (ssoid != '') {
  517. $('#compilation_select').val(0);
  518. $('#year_select').val(0);
  519. $('#month_select').val(0);
  520. $('#category_select').val('{{staff.0.cid}}');
  521. $('#staff_select').val(0);
  522. $('#hidden_search').val(1);
  523. } else {
  524. $('#search_mobile').val('');
  525. $('#hidden_search').val(0);
  526. }
  527. var postData = {
  528. compilation_id: $('#compilation_select').val(),
  529. year: $('#year_select').val(),
  530. month: $('#year_select').val() != 0 ? $('#month_select').val() : 0,
  531. category: $('#category_select').val(),
  532. staff_id: $('#staff_select').val(),
  533. sso_id: ssoid
  534. };
  535. $.ajax({
  536. type: 'post',
  537. url: '/building/getBuildList',
  538. data: postData,
  539. dataType: 'json',
  540. success: function(result) {
  541. if (result.code == '200') {
  542. var data = result.data;
  543. var html = '';
  544. $.each(data, function(k,v) {
  545. html += '<tr> ' +
  546. '<td width="150"><a href="javascript:void(0);" class="getBuildingMsg" data-id="' + v.sso_id + '" data-cid="' + v.client_id + '">' + v.mobile + '</a></td> ' +
  547. '<td width="180">' + v.cname + '专业版</td> ' +
  548. '<td width="100">' + v.categoryname + '</td>' +
  549. '<td width="75"><a href="javascript:void(0);" class="getStaffMsg" data-sid="' + v.sid + '">' + v.staffname + '</a></td> ' +
  550. '<td width="90">' + (v.status == 1 ? '已激活' : '') + '</td> ' +
  551. '<td width="90">' + (v.client_id != 0 ? '<a href="javascript:void(0);" class="getClientMsg" data-cid="' + v.client_id + '">' + v.clientname + '</a>' : '') + '</td> ' +
  552. '<td>' + v.addtime + '</td> ' +
  553. '</tr>';
  554. });
  555. $('#build_list').html(html);
  556. } else {
  557. alert('获取列表数据失败');
  558. }
  559. }
  560. })
  561. }
  562. // 获取列表各种条件筛选方法
  563. $('#compilation_select').change(function() {
  564. getBuildList('');
  565. });
  566. $('#year_select').change(function() {
  567. getBuildList('');
  568. });
  569. $('#month_select').change(function() {
  570. getBuildList('');
  571. });
  572. $('#category_select').change(function() {
  573. getBuildList('');
  574. });
  575. $('#staff_select').change(function() {
  576. getBuildList('');
  577. });
  578. // tab切换
  579. $('.tabChange').click(function() {
  580. var tab = $(this).attr('data-tab');
  581. if (tab == 'build') {
  582. $('#compilation_msg').show();
  583. $('#clientInfo_msg').hide();
  584. } else {
  585. $('#compilation_msg').hide();
  586. $('#clientInfo_msg').show();
  587. }
  588. $(this).addClass('active');
  589. $(this).siblings().removeClass('active');
  590. })
  591. })
  592. </script>
  593. </body>