|
@@ -4,10 +4,10 @@
|
|
|
|
|
|
var mobile2InfoTimeout = null;
|
|
|
var searchCuringTimeout = null;
|
|
|
-var mobile='';
|
|
|
+var mobile = '';
|
|
|
var getClentListTimeout = null;
|
|
|
-var clientname='';
|
|
|
-var columnLength=10;
|
|
|
+var clientname = '';
|
|
|
+var columnLength = 10;
|
|
|
|
|
|
|
|
|
|
|
@@ -45,121 +45,108 @@ var columnLength=10;
|
|
|
|
|
|
|
|
|
//获得CLD客户list数据
|
|
|
-function getClentList(){
|
|
|
- if(!isExistence(clientname)){
|
|
|
+function getClentList() {
|
|
|
+ if (!isExistence(clientname)) {
|
|
|
console.log('参数错误');
|
|
|
- return ;
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
- cache :false,
|
|
|
+ cache: false,
|
|
|
type: 'GET',
|
|
|
url: '/contacts/client/ajax/getClentList',
|
|
|
data: { clientname: encodeURI(clientname) },
|
|
|
dataType: 'json',
|
|
|
- async:false,
|
|
|
- success: function(data){
|
|
|
- if(data.status==1){
|
|
|
- var html=buildClientBySearch(data.list);
|
|
|
+ async: false,
|
|
|
+ success: function (data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ var html = buildClientBySearch(data.list);
|
|
|
$('div[searchClient] curingClient').html(html);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
console.log(data.msg);
|
|
|
}
|
|
|
},
|
|
|
- error: function(xhr, type){
|
|
|
+ error: function (xhr, type) {
|
|
|
console.log('Ajax error!')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 用户升级专业版 弹框提示--用户详情界面
|
|
|
- * @param name
|
|
|
- * @param _id
|
|
|
- * @param username
|
|
|
- * @returns
|
|
|
- */
|
|
|
-function upCuring(name,_id,username){
|
|
|
- $('#name').val(name);
|
|
|
- $('#_id').val(_id);
|
|
|
- var curingMobile=$('#curingMobile').val();
|
|
|
- var html='为用户 <b>'+curingMobile+','+username+'</b> 升级 <b>'+name+'</b>';
|
|
|
- $('div[upCuring] span').html(html);
|
|
|
-}
|
|
|
|
|
|
-$(document).ready(function(){
|
|
|
- init();
|
|
|
+
|
|
|
+$(document).ready(function () {
|
|
|
+ init();
|
|
|
})
|
|
|
|
|
|
|
|
|
-$(function() {
|
|
|
-
|
|
|
-
|
|
|
-//------用户列表界面相关----------
|
|
|
+$(function () {
|
|
|
+
|
|
|
+
|
|
|
+ //------用户列表界面相关----------
|
|
|
/**
|
|
|
* 绑定分页-点击事件-刷新用户列表和分页列表
|
|
|
* parameter 传递参数
|
|
|
* currentPage
|
|
|
*/
|
|
|
- $('div[pageDetail]').delegate( 'a','click', function(){
|
|
|
+ $('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);
|
|
|
+
|
|
|
+ $('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[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);
|
|
|
+ $('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=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);
|
|
|
+ $('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){
|
|
|
+ $('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);
|
|
|
+ mobile2InfoTimeout = setTimeout(fnMobile2Info, 300);
|
|
|
//}
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-//--------------用户详情界面相关---------
|
|
|
+
|
|
|
+
|
|
|
+ //--------------用户详情界面相关---------
|
|
|
/**
|
|
|
* 动态绑定养护用户列表 打开用户详情页面事件
|
|
|
* ssoid
|
|
@@ -167,116 +154,130 @@ $(function() {
|
|
|
* client_id
|
|
|
*/
|
|
|
var coordinate = {};
|
|
|
- var ssoid='',client_id='';
|
|
|
- $('tbody[curingUser]').delegate( 'tr','mousedown', function(e){
|
|
|
- coordinate.x= e.pageX;
|
|
|
- coordinate.y= e.pageY;
|
|
|
+ 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);
|
|
|
- }
|
|
|
-
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-// $('tbody[curingUser]').delegate( 'tr','mouseup', function(){
|
|
|
-// // 只获取第一个选中的值
|
|
|
-// var ssoid = $(this).attr('data');
|
|
|
-// var client_id=$(this).attr('dataCid')
|
|
|
-// $(this).attr('data-toggle',' ');
|
|
|
-//
|
|
|
-// refreshCuringPageDetail(ssoid,client_id);
|
|
|
-//
|
|
|
-// });
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ // $('tbody[curingUser]').delegate( 'tr','mouseup', function(){
|
|
|
+ // // 只获取第一个选中的值
|
|
|
+ // var ssoid = $(this).attr('data');
|
|
|
+ // var client_id=$(this).attr('dataCid')
|
|
|
+ // $(this).attr('data-toggle',' ');
|
|
|
+ //
|
|
|
+ // refreshCuringPageDetail(ssoid,client_id);
|
|
|
+ //
|
|
|
+ // });
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 确定升级专业版--用户详情界面
|
|
|
*/
|
|
|
- $('button[upCuringDo]').on('click', function(e){
|
|
|
+ $('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();
|
|
|
- if (curingSsoid != '' && compilationId != '') {
|
|
|
- $.ajax({
|
|
|
- cache :false,
|
|
|
- type: 'post',
|
|
|
- url: '/cloud/curing/ajax/upCuringDo',
|
|
|
- data: {ssoid: curingSsoid, compilationId: compilationId, mobile: mobile, client_id: client_id, name: name},
|
|
|
- dataType: 'json',
|
|
|
- success: function(data) {
|
|
|
- if (data.status == 1) {
|
|
|
- refreshCuringPageDetail(curingSsoid,client_id);
|
|
|
- } else {
|
|
|
- alert(data.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- alert('请选择需要升级的版本');
|
|
|
- }
|
|
|
+ var deadline1=$('#deadline').val();
|
|
|
+ var smssend=$('input[smssend]').get(0).checked
|
|
|
+ curingDo(compilationId,name,curingSsoid,1,mobile,client_id,deadline1,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();
|
|
|
+ var deadline1=$('#deadline').val();
|
|
|
+ var smssend=$('input[downsmssend]').get(0).checked;
|
|
|
+ curingDo(compilationId,name,curingSsoid,2,mobile,client_id,deadline1,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();
|
|
|
+
|
|
|
+ var deadline=$('#deadlineInput').val();
|
|
|
+ var smssend=$('input[deadlineSmssend]').get(0).checked;
|
|
|
+ curingDo(compilationId,name,curingSsoid,3,mobile,client_id,deadline,smssend);
|
|
|
});
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 用户绑定CLD客户--用户详情页
|
|
|
*/
|
|
|
- $('div[relevanceClientDo]').delegate( 'span','click', function(){
|
|
|
+ $('div[relevanceClientDo]').delegate('span', 'click', function () {
|
|
|
// 只获取第一个选中的值
|
|
|
var cidKey = $(this).attr('data');
|
|
|
var ssoId = $('#curingSsoid').val();
|
|
|
//var id=$('#id').val();
|
|
|
|
|
|
$.ajax({
|
|
|
- cache :false,
|
|
|
+ cache: false,
|
|
|
type: 'POST',
|
|
|
url: '/cloud/curing/ajax/relevanceClientDo',
|
|
|
- data: {cidKey: encodeURI(cidKey),ssoId:encodeURI(ssoId)},
|
|
|
+ data: { cidKey: encodeURI(cidKey), ssoId: encodeURI(ssoId) },
|
|
|
dataType: 'json',
|
|
|
- success: function(data){
|
|
|
- if(data.status==1){
|
|
|
- refreshCuringPageDetail(ssoId,cidKey);
|
|
|
+ success: function (data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ refreshCuringPageDetail(ssoId, cidKey);
|
|
|
$('#linkcld').modal('hide');
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
alert(data.msg);
|
|
|
}
|
|
|
},
|
|
|
- error: function(xhr, type){
|
|
|
+ error: function (xhr, type) {
|
|
|
console.log('Ajax error!')
|
|
|
}
|
|
|
})
|
|
|
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 用户取消关联CLD客户--用户详情页
|
|
|
*/
|
|
|
- $('button[relieveClientDo]').on('click', function(e){
|
|
|
+ $('button[relieveClientDo]').on('click', function (e) {
|
|
|
// 只获取第一个选中的值
|
|
|
var cid = $(this).attr('data');
|
|
|
var ssoId = $('#curingSsoid').val();
|
|
|
$('#unlinkcld').modal('hide');
|
|
|
$.ajax({
|
|
|
- cache :false,
|
|
|
+ cache: false,
|
|
|
type: 'POST',
|
|
|
url: '/cloud/curing/ajax/relieveClientDo',
|
|
|
- data: {cid: encodeURI(cid),ssoId:encodeURI(ssoId)},
|
|
|
+ data: { cid: encodeURI(cid), ssoId: encodeURI(ssoId) },
|
|
|
dataType: 'json',
|
|
|
- success: function(data){
|
|
|
- if(data.status==1){
|
|
|
- refreshCuringPageDetail(ssoId,cid);
|
|
|
-
|
|
|
- }else{
|
|
|
+ success: function (data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ refreshCuringPageDetail(ssoId, cid);
|
|
|
+
|
|
|
+ } else {
|
|
|
alert(data.msg);
|
|
|
}
|
|
|
},
|
|
|
- error: function(xhr, type){
|
|
|
+ error: function (xhr, type) {
|
|
|
console.log('Ajax error!')
|
|
|
}
|
|
|
})
|
|
@@ -286,32 +287,32 @@ $(function() {
|
|
|
/**
|
|
|
* 关闭详情页--刷新用户列表
|
|
|
*/
|
|
|
- $('button[closeRefresh]').on('click', function(e){
|
|
|
+ $('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);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ 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){
|
|
|
+ $('input[getClentList]').on('keyup', function (e) {
|
|
|
+ if (getClentListTimeout != null) {
|
|
|
clearTimeout(getClentListTimeout);
|
|
|
}
|
|
|
clientname = $(this).val();
|
|
|
- if(isExistence(clientname)){
|
|
|
+ if (isExistence(clientname)) {
|
|
|
|
|
|
getClentListTimeout = setTimeout(getClentList, 500);
|
|
|
}
|
|
@@ -319,74 +320,74 @@ $(function() {
|
|
|
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//列表 号码检索事件绑定
|
|
|
- $('div[mobile2Info]').on('click', function(e){
|
|
|
- mobile=$('input[mobile2Info]').val();
|
|
|
- if(mobile==''){
|
|
|
+ $('div[mobile2Info]').on('click', function (e) {
|
|
|
+ mobile = $('input[mobile2Info]').val();
|
|
|
+ if (mobile == '') {
|
|
|
location.reload()
|
|
|
}
|
|
|
fnMobile2Info();
|
|
|
});
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-/*
|
|
|
- $('a[upNewClient]').on('click', function(e){
|
|
|
- $('input[fnsearchcuring]').val('');
|
|
|
- $('div[upCuringBox]').hide();
|
|
|
- $('p[upCuringBox]').hide();
|
|
|
|
|
|
- });
|
|
|
- $('input[fnSearchCuring]').on('keyup', function(e){
|
|
|
- if(searchCuringTimeout != null){
|
|
|
- clearTimeout(searchCuringTimeout);
|
|
|
- }
|
|
|
- mobile=$(this).val();
|
|
|
- if((/^1[34578]\d{9}$/.test(mobile))) {
|
|
|
- searchCuringTimeout = setTimeout(fnSearchCuring, 500);
|
|
|
- }
|
|
|
- });
|
|
|
- $('a[upClient]').on('click', function(e){
|
|
|
- var mobile=$('b[curingMobile]').html();
|
|
|
- if(mobile==''){
|
|
|
- alert('参数错误');
|
|
|
- }
|
|
|
- $.ajax({
|
|
|
- cache :false,
|
|
|
- type: 'GET',
|
|
|
- url: '/cloud/curing/ajax/checkMobile/'+mobile,
|
|
|
- //data: { mobile: mobile },
|
|
|
- dataType: 'json',
|
|
|
-
|
|
|
- success: function(data){
|
|
|
- if(data.status==1||data.status==2){
|
|
|
- $('input[fnsearchcuring]').val(mobile);
|
|
|
- fnGetCuringDetail(data.data.id,data.data.client_id);
|
|
|
- }else if(data.status==3){
|
|
|
- $('div[upCuringBox]').hide();
|
|
|
- $('p[upCuringBox]').show();
|
|
|
- }
|
|
|
- },
|
|
|
- error: function(xhr, type){
|
|
|
- console.log('Ajax error!')
|
|
|
- }
|
|
|
- })
|
|
|
- });*/
|
|
|
|
|
|
+ /*
|
|
|
+ $('a[upNewClient]').on('click', function(e){
|
|
|
+ $('input[fnsearchcuring]').val('');
|
|
|
+ $('div[upCuringBox]').hide();
|
|
|
+ $('p[upCuringBox]').hide();
|
|
|
|
|
|
+ });
|
|
|
+ $('input[fnSearchCuring]').on('keyup', function(e){
|
|
|
+ if(searchCuringTimeout != null){
|
|
|
+ clearTimeout(searchCuringTimeout);
|
|
|
+ }
|
|
|
+ mobile=$(this).val();
|
|
|
+ if((/^1[34578]\d{9}$/.test(mobile))) {
|
|
|
+ searchCuringTimeout = setTimeout(fnSearchCuring, 500);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('a[upClient]').on('click', function(e){
|
|
|
+ var mobile=$('b[curingMobile]').html();
|
|
|
+ if(mobile==''){
|
|
|
+ alert('参数错误');
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ cache :false,
|
|
|
+ type: 'GET',
|
|
|
+ url: '/cloud/curing/ajax/checkMobile/'+mobile,
|
|
|
+ //data: { mobile: mobile },
|
|
|
+ dataType: 'json',
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ success: function(data){
|
|
|
+ if(data.status==1||data.status==2){
|
|
|
+ $('input[fnsearchcuring]').val(mobile);
|
|
|
+ fnGetCuringDetail(data.data.id,data.data.client_id);
|
|
|
+ }else if(data.status==3){
|
|
|
+ $('div[upCuringBox]').hide();
|
|
|
+ $('p[upCuringBox]').show();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(xhr, type){
|
|
|
+ console.log('Ajax error!')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
})
|
|
|
|
|
@@ -415,7 +416,7 @@ $(function() {
|
|
|
if(data.status==1||data.status==2){
|
|
|
$('div[upCuringBox]').show();
|
|
|
$('p[upCuringBox]').hide();
|
|
|
-
|
|
|
+
|
|
|
var objHtml=buildCuringInfo(data.detail.userInfo);
|
|
|
$('div[curingInfo] curing').html(objHtml);
|
|
|
|
|
@@ -442,13 +443,13 @@ $(function() {
|
|
|
* @param currentPage
|
|
|
* @returns
|
|
|
*/
|
|
|
-function refreshCuringPagination(parameter,currentPage){
|
|
|
- $.ajax({
|
|
|
- cache :false,
|
|
|
+function refreshCuringPagination(parameter, currentPage) {
|
|
|
+ $.ajax({
|
|
|
+ cache: false,
|
|
|
type: 'get',
|
|
|
- url: '/cloud/curing/ajax/getCuringPage/'+currentPage+parameter,
|
|
|
+ url: '/cloud/curing/ajax/getCuringPage/' + currentPage + parameter,
|
|
|
dataType: 'json',
|
|
|
- success: function(data) {
|
|
|
+ success: function (data) {
|
|
|
if (data.status == 1) {
|
|
|
fnStructureCuringUser(data.curingList);
|
|
|
fnPage(data.pageData);
|
|
@@ -464,16 +465,16 @@ function refreshCuringPagination(parameter,currentPage){
|
|
|
* 筛选-统一请求--刷新用户列表
|
|
|
* @returns
|
|
|
*/
|
|
|
-function refreshCuringPage(compilation,latestCompilation,sortField,sort,wd){
|
|
|
- $.ajax({
|
|
|
- cache :false,
|
|
|
+function refreshCuringPage(compilation, latestCompilation, sortField, sort, wd) {
|
|
|
+ $.ajax({
|
|
|
+ cache: false,
|
|
|
type: 'get',
|
|
|
- url: '/cloud/curing/ajax/refreshCuringPage?sortField='+sortField+'&sort='+sort+'&compilation='+compilation+'&latestCompilation='+latestCompilation+
|
|
|
- '&wd='+wd,
|
|
|
+ url: '/cloud/curing/ajax/refreshCuringPage?sortField=' + sortField + '&sort=' + sort + '&compilation=' + compilation + '&latestCompilation=' + latestCompilation +
|
|
|
+ '&wd=' + wd,
|
|
|
dataType: 'json',
|
|
|
- success: function(data) {
|
|
|
+ success: function (data) {
|
|
|
if (data.status == 1) {
|
|
|
- fnStructureCuringUser(data.curingList);
|
|
|
+ fnStructureCuringUser(data.curingList);
|
|
|
fnPage(data.pageData);
|
|
|
refreshColumn(columnLength);
|
|
|
} else {
|
|
@@ -481,18 +482,18 @@ function refreshCuringPage(compilation,latestCompilation,sortField,sort,wd){
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通行证账号检索用户--刷新列表和分页
|
|
|
* @returns
|
|
|
*/
|
|
|
-function fnMobile2Info(){
|
|
|
+function fnMobile2Info() {
|
|
|
mobile2InfoTimeout = null;
|
|
|
|
|
|
//if((/^1[34578]\d{9}$/.test(mobile))) {
|
|
|
- refreshCuringPage('','','','',mobile);
|
|
|
+ refreshCuringPage('', '', '', '', mobile);
|
|
|
//}
|
|
|
}
|
|
|
|
|
@@ -502,53 +503,53 @@ function fnMobile2Info(){
|
|
|
* @param client_id
|
|
|
* @returns
|
|
|
*/
|
|
|
-function refreshCuringPageDetail(ssoid,client_id){
|
|
|
- $.ajax({
|
|
|
- cache :false,
|
|
|
+function refreshCuringPageDetail(ssoid, client_id) {
|
|
|
+ $.ajax({
|
|
|
+ cache: false,
|
|
|
type: 'GET',
|
|
|
url: '/cloud/curing/ajax/getCuringBySsoid',
|
|
|
- data: {ssoid: encodeURI(ssoid),client_id:encodeURI(client_id)},
|
|
|
+ data: { ssoid: encodeURI(ssoid), client_id: encodeURI(client_id) },
|
|
|
dataType: 'json',
|
|
|
- success: function(data){
|
|
|
- if(data.status==1||data.status==2){
|
|
|
+ success: function (data) {
|
|
|
+ if (data.status == 1 || data.status == 2) {
|
|
|
//设置 养护用户信息
|
|
|
- var objHtml=buildCuringInfo(data.detail.userInfo);
|
|
|
+ var objHtml = buildCuringInfo(data.detail.userInfo);
|
|
|
$('div[curingInfo] curing').html(objHtml);
|
|
|
|
|
|
$('div[curingInfo] curingClient').html('');
|
|
|
//设置CLD客户信息
|
|
|
//if(data.detail.curingInfo.updateTotal!=0){
|
|
|
- //$("#id").val(id);
|
|
|
- var clientHtml=relevanceClient(data.detail.clientInfo);
|
|
|
- $('div[curingInfo] curingClient').html(clientHtml);
|
|
|
+ //$("#id").val(id);
|
|
|
+ var clientHtml = relevanceClient(data.detail.clientInfo);
|
|
|
+ $('div[curingInfo] curingClient').html(clientHtml);
|
|
|
//}
|
|
|
-
|
|
|
+
|
|
|
//设置养护详情页里产品升级信息
|
|
|
- var upMajorBoxHtml=buildCuringCompilation(data);
|
|
|
+ var upMajorBoxHtml = buildCuringCompilation(data);
|
|
|
$('tbody[upMajorBox]').html(upMajorBoxHtml);
|
|
|
-
|
|
|
+
|
|
|
//更新在线时长
|
|
|
- var onlineTimesHtml=buildCuringOnlineTimes(data.detail.userInfo.online_list);
|
|
|
+ var onlineTimesHtml = buildCuringOnlineTimes(data.detail.userInfo.online_list);
|
|
|
$('tbody[onlineTimes]').html(onlineTimesHtml);
|
|
|
-
|
|
|
+
|
|
|
//设置参数
|
|
|
$('#curingSsoid').val(data.detail.userInfo.ssoIdKey);
|
|
|
$('#curingMobile').val(data.detail.userInfo.mobile);
|
|
|
$('#client_id').val(data.detail.clientInfo.cidKey);
|
|
|
-
|
|
|
+
|
|
|
//设置养护日志
|
|
|
- var operateLogHtml=buildCuringOperateLog(data.detail.operateLog);
|
|
|
+ var operateLogHtml = buildCuringOperateLog(data.detail.operateLog);
|
|
|
$('div[operateLog] curingOperate').html(operateLogHtml);
|
|
|
|
|
|
setTimeout(autoHeight, 400);
|
|
|
|
|
|
//autoHeight();
|
|
|
$('#detail').modal('show');
|
|
|
- }else if(data.status==3){
|
|
|
+ } else if (data.status == 3) {
|
|
|
alert(data.msg);
|
|
|
}
|
|
|
},
|
|
|
- error: function(xhr, type){
|
|
|
+ error: function (xhr, type) {
|
|
|
console.log('Ajax error!')
|
|
|
}
|
|
|
})
|
|
@@ -558,13 +559,116 @@ function refreshCuringPageDetail(ssoid,client_id){
|
|
|
* DOM加载完毕后初始化
|
|
|
* @returns
|
|
|
*/
|
|
|
-function init(){
|
|
|
- refreshColumn(columnLength);
|
|
|
+function init() {
|
|
|
+ refreshColumn(columnLength);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 用户升级专业版 弹框提示--用户详情界面
|
|
|
+ * @param name
|
|
|
+ * @param _id
|
|
|
+ * @param username
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+function upCuring(name, _id, username) {
|
|
|
+ $('#name').val(name);
|
|
|
+ $('#_id').val(_id);
|
|
|
+ var curingMobile = $('#curingMobile').val();
|
|
|
+ var html = '<p>为用户 <b>' + curingMobile + ',' + username + '</b> 升级 <b>' + name + '</b></p>';
|
|
|
+ html += '<div class="form-group"><div class="custom-control custom-switch"><input type="checkbox" class="custom-control-input" deadline id="customSwitch2" ><label class="custom-control-label" deadlineLabel for="customSwitch2">限期</label></div></div>';
|
|
|
+
|
|
|
+ html += '<div class="form-group"><label class="form-label" for="example-date">到期时间</label><input class="form-control" id="deadline" type="date" name="deadline" disabled value=""></div>';
|
|
|
+
|
|
|
+ html += '<div class="form-group"><div class="custom-control custom-switch"><input type="checkbox" class="custom-control-input" smssend id="customSwitch22" ><label class="custom-control-label" for="customSwitch22">给客户发送短信通知</label></div></div>';
|
|
|
+
|
|
|
+ $('div[upCuring] span').html(html);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 养护产品降级
|
|
|
+ * @param {} name
|
|
|
+ * @param {*} _id
|
|
|
+ * @param {*} username
|
|
|
+ */
|
|
|
+function downCuring(name, _id, username) {
|
|
|
+ $('#name').val(name);
|
|
|
+ $('#_id').val(_id);
|
|
|
+ var curingMobile = $('#curingMobile').val();
|
|
|
+ // let html = `<p>为用户 <b>${curingMobile},${username}</b> <span class="text-danger">降级</span> <b>${name}免费版</b></p>
|
|
|
+ // <div class="form-group">
|
|
|
+ // <div class="custom-control custom-switch">
|
|
|
+ // <input type="checkbox" class="custom-control-input" downSmssend id="customSwitch23" >
|
|
|
+ // <label class="custom-control-label" for="customSwitch23">给客户发送短信通知</label>
|
|
|
+ // </div>
|
|
|
+ // </div>`;
|
|
|
+ var html = '<p>为用户 <b>'+curingMobile+','+username+'</b> <span class="text-danger">降级</span> <b>'+name+'免费版</b></p><div class="form-group"><div class="custom-control custom-switch"><input type="checkbox" class="custom-control-input" downSmssend id="customSwitch23" ><label class="custom-control-label" for="customSwitch23">给客户发送短信通知</label></div></div>';
|
|
|
+
|
|
|
+ $('div[downCuring] span').html(html);
|
|
|
+}
|
|
|
+
|
|
|
+function deadlineCuring(name, _id, username,deadline){
|
|
|
+ $('#name').val(name);
|
|
|
+ $('#_id').val(_id);
|
|
|
+ var curingMobile = $('#curingMobile').val();
|
|
|
+
|
|
|
+ var html = '<p>为用户 <b>'+curingMobile+','+username+'</b> <b>'+name+'</b> 设置延期</p><p>当前限期为:'+deadline+'</p>';
|
|
|
+
|
|
|
+ html +='<div class="form-group"><label class="form-label" for="example-date">到期时间</label><input class="form-control" id="deadlineInput" type="date" name="date" value=""></div><div class="form-group"><div class="custom-control custom-switch"><input type="checkbox" class="custom-control-input" deadlineSmssend id="customSwitch222" ><label class="custom-control-label" for="customSwitch222">给客户发送短信通知</label></div></div>';
|
|
|
+
|
|
|
+
|
|
|
+ // let html = `<p>为用户 <b>${curingMobile},${username}</b> <b>${name}</b> 设置延期</p>
|
|
|
+ // <p>当前限期为:${deadline}</p>
|
|
|
+ // <div class="form-group">
|
|
|
+ // <label class="form-label" for="example-date">到期时间</label>
|
|
|
+ // <input class="form-control" id="deadlineInput" type="date" name="date" value="">
|
|
|
+ // </div>
|
|
|
+ // <div class="form-group">
|
|
|
+ // <div class="custom-control custom-switch">
|
|
|
+ // <input type="checkbox" class="custom-control-input" deadlineSmssend id="customSwitch222" >
|
|
|
+ // <label class="custom-control-label" for="customSwitch222">给客户发送短信通知</label>
|
|
|
+ // </div>
|
|
|
+ // </div>`;
|
|
|
+
|
|
|
+ $('div[deadlineCuring] span').html(html);
|
|
|
}
|
|
|
|
|
|
+function curingDo(compilationId, name, curingSsoid, status, mobile, client_id, deadline, smssend) {
|
|
|
+ if (curingSsoid != '' && compilationId != '') {
|
|
|
+ $.ajax({
|
|
|
+ cache: false,
|
|
|
+ type: 'post',
|
|
|
+ url: '/cloud/curing/ajax/upCuringDo',
|
|
|
+ data: { ssoid: curingSsoid, compilationId: compilationId, mobile: mobile, client_id: client_id, name: name, deadline: deadline, smssend: smssend, status: status },
|
|
|
+ dataType: 'json',
|
|
|
+ success: function (data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ refreshCuringPageDetail(curingSsoid, client_id);
|
|
|
+ } else {
|
|
|
+ alert(data.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ alert('请选择需要升级的版本');
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+$(function () {
|
|
|
|
|
|
+ $('div[upcuring]').delegate('label[deadlineLabel]', 'click', function () {
|
|
|
+ $('#deadline').attr('disabled', 'disabled');
|
|
|
+
|
|
|
+ if($('input[deadline]').prop('checked')){
|
|
|
+ $('input[deadline]').prop("checked",false);
|
|
|
+ }else{
|
|
|
+ $('input[deadline]').prop("checked",true);
|
|
|
+ }
|
|
|
+ if ($('input[deadline]').get(0).checked) {
|
|
|
+ $('#deadline').removeAttr('disabled');
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+})
|
|
|
/**
|
|
|
* Created by cp on 2019/12/17.
|
|
|
*/
|
|
@@ -690,14 +794,29 @@ function buildCuringCompilation(data){
|
|
|
upMajorBoxHtml+='<td></td>';
|
|
|
upMajorBoxHtml+='<td>'+ v.name+'</td>';
|
|
|
upMajorBoxHtml+='<td>';
|
|
|
+
|
|
|
+ var deadline='';
|
|
|
+ data.detail.userInfo.upgrade_list.forEach(element => {
|
|
|
+ if(v._id===element.compilationID){
|
|
|
+ deadline=element.deadline;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
if(v.isUpgrade !== undefined && v.isUpgrade === true){
|
|
|
- upMajorBoxHtml+='已升级';
|
|
|
+ upMajorBoxHtml+='已升级<a href="#degrade-confirm" onclick=downCuring("'+ v.name+'","'+ v._id+'","'+data.detail.userInfo.username+'") class="btn btn-xs btn-outline-danger ml-2 waves-effect waves-themed" data-toggle="modal" data-target="#degrade-confirm">降级</a>';
|
|
|
}else{
|
|
|
upMajorBoxHtml+='<a onclick=upCuring("'+ v.name+'","'+ v._id+'","'+data.detail.userInfo.username+'") ' +
|
|
|
'href="#update-confirm" class="btn btn-xs btn-outline-primary waves-effect waves-themed" data-toggle="modal" data-target="#update-confirm">升级</a>';
|
|
|
}
|
|
|
upMajorBoxHtml+='</td>';
|
|
|
- upMajorBoxHtml+='</tr>';
|
|
|
+
|
|
|
+ if(v.isUpgrade !== undefined && v.isUpgrade === true){
|
|
|
+ upMajorBoxHtml+='<td>'+deadline+'<a href="#deadline-confirm" onclick=deadlineCuring("'+ v.name+'","'+ v._id+'","'+data.detail.userInfo.username+'","'+deadline+'") class="btn btn-xs btn-outline-primary ml-2 waves-effect waves-themed" data-toggle="modal" data-target="#deadline-confirm">限期</a></td>';
|
|
|
+ upMajorBoxHtml+='</tr>';
|
|
|
+ }else{
|
|
|
+ upMajorBoxHtml+=`<td></td>`;
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
return upMajorBoxHtml;
|