123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- /**
- * 分页列表--刷新用户列表
- * @param parameter
- * @param currentPage
- * @returns
- */
- function refreshCuringPagination(parameter, currentPage) {
- $.ajax({
- cache: false,
- type: 'get',
- url: '/cloud/curing/ajax/getCuringPage/' + currentPage + parameter,
- dataType: 'json',
- success: function (data) {
- if (data.status == 1) {
- fnStructureCuringUser(data.curingList);
- fnPage(data.pageData);
- refreshColumn(columnLength);
- } else {
- alert(data.msg);
- }
- }
- })
- }
- /**
- * 筛选-统一请求--刷新用户列表
- * @returns
- */
- 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,
- dataType: 'json',
- success: function (data) {
- if (data.status == 1) {
- fnStructureCuringUser(data.curingList);
- fnPage(data.pageData);
- refreshColumn(columnLength);
- } else {
- alert(data.msg);
- }
- }
- })
- }
- /**
- * 通行证账号检索用户--刷新列表和分页
- * @returns
- */
- function fnMobile2Info() {
- mobile2InfoTimeout = null;
- //if((/^1[34578]\d{9}$/.test(mobile))) {
- refreshCuringPage('', '', '', '', mobile);
- //}
- }
- /**
- * 刷新用户详情页
- * @param ssoid
- * @param client_id
- * @returns
- */
- function refreshCuringPageDetail(ssoid, client_id) {
- $.ajax({
- cache: false,
- type: 'GET',
- url: '/cloud/curing/ajax/getCuringBySsoid',
- data: { ssoid: encodeURI(ssoid), client_id: encodeURI(client_id) },
- dataType: 'json',
- success: function (data) {
- if (data.status == 1 || data.status == 2) {
- //设置 养护用户信息
- 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);
- //}
- //设置养护详情页里产品升级信息
- var upMajorBoxHtml = buildCuringCompilation(data);
- $('tbody[upMajorBox]').html(upMajorBoxHtml);
- //更新在线时长
- 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);
- $('div[operateLog] curingOperate').html(operateLogHtml);
- setTimeout(autoHeight, 400);
- //autoHeight();
- $('#detail').modal('show');
- } else if (data.status == 3) {
- alert(data.msg);
- }
- },
- error: function (xhr, type) {
- console.log('Ajax error!')
- }
- })
- }
- /**
- * DOM加载完毕后初始化
- * @returns
- */
- 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>`;
- $('div[downCuring] span').html(html);
- }
- function deadlineCuring(name, _id, username,deadline){
- $('#name').val(name);
- $('#_id').val(_id);
- var curingMobile = $('#curingMobile').val();
- 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');
- }
- });
- })
|