123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- /**
- * Created by MyPC on 2019/11/11.
- */
- var mobile2InfoTimeout = null;
- var searchCuringTimeout = null;
- var mobile='';
- var getClentListTimeout = null;
- var clientname='';
- var columnLength=10;
- //获得CLD客户list数据
- function getClentList(){
- if(!isExistence(clientname)){
- console.log('参数错误');
- return ;
- }
- $.ajax({
- cache :false,
- type: 'GET',
- url: '/contacts/client/ajax/getClentList',
- data: { clientname: encodeURI(clientname) },
- dataType: 'json',
- success: function(data){
- if(data.status==1){
- var html=buildClientBySearch(data.list);
- $('div[searchClient] curingClient').html(html);
- }else {
- console.log(data.msg);
- }
- },
- error: function(xhr, type){
- console.log('Ajax error!')
- }
- })
- }
- $(document).ready(function(){
- init();
- })
- $(function() {
-
-
- //------用户列表界面相关----------
- /**
- * 绑定分页-点击事件-刷新用户列表和分页列表
- * parameter 传递参数
- * currentPage
- */
- $('div[pageDetail]').delegate( 'a','click', function(){
- // 只获取第一个选中的值
- var parameter = $(this).attr('parameter');
- var currentPage = $(this).attr('currentPage');
-
- $('button[closeRefresh]').attr('currentPage',currentPage);
- $('button[closeRefresh]').attr('parameter',parameter);
-
- refreshCuringPagination(parameter,currentPage);
- });
-
- /**
- * 编办下拉选择
- */
- $('select[curingByCompilation]').on('change', function(e){
- var compilation=$(this).val();
- var latestCompilation=$('select[curingByLatestCompilation]').val();
- refreshCuringPage(compilation,latestCompilation);
- });
- $('select[curingByLatestCompilation]').on('change', function(e){
- var latestCompilation=$(this).val();
- var compilation=$('select[curingByCompilation]').val();
- refreshCuringPage(compilation,latestCompilation);
- });
-
- /**
- * 用户列表排序相关
- */
- $('input[type=radio][name=sortField]').on('change', function(e){
- var sortField=$(this).attr('data');
- var latestCompilation=$('select[curingByLatestCompilation]').val();
- var compilation=$('select[curingByCompilation]').val();
-
- refreshCuringPage(compilation,latestCompilation,sortField);
- });
- $('input[type=radio][name=sort]').on('change', function(e){
- var sort=$(this).attr('data');
- var latestCompilation=$('select[curingByLatestCompilation]').val();
- var compilation=$('select[curingByCompilation]').val();
-
- refreshCuringPage(compilation,latestCompilation,'',sort);
- });
-
- /**
- * 通行证账号检索养护用户--缓冲300
- */
- $('input[mobile2Info]').on('keyup', function(e){
- if(mobile2InfoTimeout != null){
- clearTimeout(mobile2InfoTimeout);
- }
- mobile = $(this).val();
- //if((/^1[34578]\d{9}$/.test(mobile))) {
- mobile2InfoTimeout = setTimeout(fnMobile2Info, 300);
- //}
- });
-
-
- //--------------用户详情界面相关---------
- /**
- * 动态绑定养护用户列表 打开用户详情页面事件
- * ssoid
- * id
- * client_id
- */
- var coordinate = {};
- var ssoid='',client_id='';
- $('tbody[curingUser]').delegate( 'tr','mousedown', function(e){
- coordinate.x= e.pageX;
- coordinate.y= e.pageY;
- ssoid = $(this).attr('data');
- client_id=$(this).attr('dataCid');
- }).click(function(e){
- if(coordinate.x==e.pageX&&coordinate.y==e.pageY){
- $(this).attr('data-toggle',' ');
- refreshCuringPageDetail(ssoid,client_id);
- }
-
- });
-
-
- /**
- * 确定升级专业版--用户详情界面
- */
- $('button[upCuringDo]').on('click', function (e) {
- // 只获取第一个选中的值
- var compilationId = $('#_id').val();
- var name = $('#name').val();
- var curingSsoid = $('#curingSsoid').val();
- var mobile = $('#curingMobile').val();
- var client_id = $('#client_id').val();
- let deadline=$('#deadline').val();
- let smssend=$('input[smssend]').get(0).checked
- curingDo(compilationId,name,curingSsoid,1,mobile,client_id,deadline,smssend);
- });
- /**
- * 确定降级免费版--用户详情界面
- */
- $('button[downCuringDo]').on('click', function (e) {
- // 只获取第一个选中的值
- var compilationId = $('#_id').val();
- var name = $('#name').val();
- var curingSsoid = $('#curingSsoid').val();
- var mobile = $('#curingMobile').val();
- var client_id = $('#client_id').val();
- let deadline=$('#deadline').val();
- let smssend=$('input[downsmssend]').get(0).checked;
- curingDo(compilationId,name,curingSsoid,2,mobile,client_id,deadline,smssend);
- });
- $('button[deadlineCuringDo]').on('click', function (e) {
- // 只获取第一个选中的值
- var compilationId = $('#_id').val();
- var name = $('#name').val();
- var curingSsoid = $('#curingSsoid').val();
- var mobile = $('#curingMobile').val();
- var client_id = $('#client_id').val();
- let deadline=$('#deadlineInput').val();
- let smssend=$('input[deadlineSmssend]').get(0).checked;
- curingDo(compilationId,name,curingSsoid,3,mobile,client_id,deadline,smssend);
- });
-
- /**
- * 用户绑定CLD客户--用户详情页
- */
- $('div[relevanceClientDo]').delegate( 'span','click', function(){
- // 只获取第一个选中的值
- var cidKey = $(this).attr('data');
- var ssoId = $('#curingSsoid').val();
- //var id=$('#id').val();
- $.ajax({
- cache :false,
- type: 'POST',
- url: '/cloud/build/ajax/relevanceClientDo',
- data: {cidKey: encodeURI(cidKey),ssoId:encodeURI(ssoId)},
- dataType: 'json',
- success: function(data){
- if(data.status==1){
- refreshCuringPageDetail(ssoId,cidKey);
- $('#linkcld').modal('hide');
- }else{
- alert(data.msg);
- }
- },
- error: function(xhr, type){
- console.log('Ajax error!')
- }
- })
- });
-
- /**
- * 用户取消关联CLD客户--用户详情页
- */
- $('button[relieveClientDo]').on('click', function(e){
- // 只获取第一个选中的值
- var cid = $(this).attr('data');
- var ssoId = $('#curingSsoid').val();
- $('#unlinkcld').modal('hide');
- $.ajax({
- cache :false,
- type: 'POST',
- url: '/cloud/build/ajax/relieveClientDo',
- data: {cid: encodeURI(cid),ssoId:encodeURI(ssoId)},
- dataType: 'json',
- success: function(data){
- if(data.status==1){
- refreshCuringPageDetail(ssoId,cid);
-
- }else{
- alert(data.msg);
- }
- },
- error: function(xhr, type){
- console.log('Ajax error!')
- }
- })
- });
- /**
- * 关闭详情页--刷新用户列表
- */
- $('button[closeRefresh]').on('click', function(e){
- // 只获取第一个选中的值
-
- var parameter=$('button[closeRefresh]').attr('parameter');
- if(parameter!=''){
- var currentPage=$('button[closeRefresh]').attr('currentPage');
- refreshCuringPagination(parameter,currentPage);
- }else{
- var latestCompilation=$('select[curingByLatestCompilation]').val();
- var compilation=$('select[curingByCompilation]').val();
- refreshCuringPage(compilation,latestCompilation,'','',mobile);
-
- }
-
- });
- //
- /**
- * 检索cld用户
- */
- $('input[getClentList]').on('keyup', function(e){
- if(getClentListTimeout != null){
- clearTimeout(getClentListTimeout);
- }
- clientname = $(this).val();
- if(isExistence(clientname)){
- getClentListTimeout = setTimeout(getClentList, 500);
- }
- });
-
-
-
-
-
- //列表 号码检索事件绑定
- $('div[mobile2Info]').on('click', function(e){
- mobile=$('input[mobile2Info]').val();
- if(mobile==''){
- location.reload()
- }
- fnMobile2Info();
- });
-
-
-
-
-
-
- })
|