caipin 5 年之前
父節點
當前提交
beddcc9a9d

+ 40 - 6
app/cloudAjaxRouter.js

@@ -4,9 +4,9 @@
 var express = require('express');
 var router = express.Router();
 var cloudAjaxController=require('./controller/cloudEditionAjaxController');
+var cloudBuildAjaxController=require('./controller/cloudBuildEditionAjaxController');
 
-
-
+/*---------------------养护相关---------------------*/
 //------------用户列表界面相关----------------
 /**
  * 编办筛选
@@ -30,7 +30,6 @@ router.get('/cloud/curing/ajax/getCuringBySsoid', function(req, res, next) {
  * 用户关联CLD客户
  */
 router.post('/cloud/curing/ajax/relevanceClientDo', function(req, res, next) {
-	console.log('2222');
     cloudAjaxController.relevanceClientDo(req, res);
 });
 /**
@@ -45,8 +44,42 @@ router.post('/cloud/curing/ajax/upCuringDo', function(req, res, next) {
 });
 
 
+/*---------------------建筑相关---------------------*/
+//------------用户列表界面相关----------------
+/**
+ * 编办筛选
+ */
+router.get('/cloud/curing/ajax/refreshCuringPage', function(req, res, next) {
+	cloudBuildAjaxController.refreshCuringPage(req, res);
+});
+//������ҳ
+router.get('/cloud/curing/ajax/getCuringPage/:currentPage', function(req, res, next) {
+	cloudBuildAjaxController.refreshCuringPage(req, res);
+});
 
-
+//------------用户详情页界面相关----------------
+/**
+ * 获得用户详情
+ */
+router.get('/cloud/curing/ajax/getCuringBySsoid', function(req, res, next) {
+	cloudBuildAjaxController.getCuringBySsoid(req, res);
+});
+/**
+ * 用户关联CLD客户
+ */
+router.post('/cloud/curing/ajax/relevanceClientDo', function(req, res, next) {
+	cloudBuildAjaxController.relevanceClientDo(req, res);
+});
+/**
+ * 用户取消关联CLD客户
+ */
+router.post('/cloud/curing/ajax/relieveClientDo', function(req, res, next) {
+	cloudBuildAjaxController.relieveClientDo(req, res);
+});
+//������д��CLD��������������Ʒ
+router.post('/cloud/curing/ajax/upCuringDo', function(req, res, next) {
+	cloudBuildAjaxController.upCuringDo(req, res);
+});
 
 
 
@@ -56,6 +89,7 @@ router.post('/cloud/curing/ajax/upCuringDo', function(req, res, next) {
 /**
  * 用户检索--废弃
  */
+/*
 router.get('/cloud/curing/ajax/curingInfo/:mobile', function(req, res, next) {
     cloudAjaxController.getCuringInfo(req, res);
 });
@@ -68,11 +102,11 @@ router.get('/cloud/curing/ajax/checkMobile/:mobile', function(req, res, next) {
 
 
 
-//��������ҳ ����
+//��������ҳ ����  ---预计废弃
 router.get('/cloud/curing/ajax/getCuringById/:sso_id', function(req, res, next) {
     cloudAjaxController.getCuringById(req, res);
 });
-
+*/
 
 
 module.exports = router;

+ 4 - 30
app/cloudRouter.js

@@ -4,47 +4,21 @@
 var express = require('express');
 var router = express.Router();
 var cloudController=require('./controller/cloudEditionController');
+var cloudBuildController=require('./controller/cloudBuildEditionController');
 
 /**
  * 养护云版
  */
 router.get('/cloud/curing/edition', function(req, res, next) {
-	
-	
-	
-	//测试�务�
-	//global.CLOUDURL= ="https://yhuat.smartcost.com.cn/cld"; 
-	//正��务�
-	//global.CLOUDURL= ='https://yhyun.smartcost.com.cn/cld';
-	//本地�
-	setCloudUrl("http://qa.smartcost.com.cn:2060/cld");
 
     cloudController.curingEdition(req, res);
 });
 /**
  * 大�空云计价
  */
-router.get('/cloud/building/edition', function(req, res, next) {
-	
-	//测试�务�
-	//setCloudUrl("https://yhuat.smartcost.com.cn/cld");
-	//global.CLOUDURL= ="https://yhuat.smartcost.com.cn/cld"; 
-	//正��务�
-	//global.CLOUDURL= ='https://yhyun.smartcost.com.cn/cld';
-	//本地�
-	setCloudUrl("http://qa.smartcost.com.cn:6060/cld");
-	
-	cloudController.curingEdition(req, res);
+router.get('/cloud/build/edition', function(req, res, next) {
+
+	cloudBuildController.curingEdition(req, res);
 });
 
 module.exports = router;
-
-
-/**
- * 设置云版接�地�
- */
-function setCloudUrl(url){
-
-	GCLOUDURL =url;
-
-}

+ 1 - 2
app/config/common.config.js

@@ -6,8 +6,7 @@ global.WEB_SITE_GLOBAL='/cloud/';
 global.CRYPTO_KEY='CLDV2_CP';
 
 global.STAFF='';
-//云版接口
-global.GCLOUDURL='';
+
 //global.curingInterfaceConfig={'sort':['latest_login','desc']};
 
 var d = new Date();

+ 205 - 0
app/controller/cloudBuildEditionAjaxController.js

@@ -0,0 +1,205 @@
+/**
+ * Created by MyPC on 2019/11/5.
+ */
+const hash=require('../class/hash');
+const cloudService=require('../service/cloudBuildEditionService');
+const url=require("url");
+//var models=require('../models');
+
+
+var cloudEditionAjaxController={
+		
+		//------------用户列表界面相关----------------
+		/**
+		 * 用户列表刷新
+		 */
+		refreshCuringPage: async function(req, res){
+		    var curingList= await cloudService.getCuringList(req, res);
+
+		    res.json({ 'status': 1,'curingList':curingList.curingList,'pageData':curingList.pageData });
+		},	
+		
+
+		//------------用户详情页界面相关----------------
+		/**
+		 * 获得养护用户信息详情
+		 */
+		getCuringBySsoid: async function(req, res){
+		    var params = url.parse(req.url, true).query;
+
+		    if(!hash.isExistence(params.ssoid)){
+		        res.json({ 'status': 0,'msg':'error ssoid' });
+		        return ;
+		    }
+
+		    var detail= await cloudService.getCuringBySsoid(params.ssoid,params.client_id);
+		    //console.log(detail);
+		    if(hash.isExistence(detail)) {
+		        res.json({ 'status': 1,'detail':detail });
+		    }else{
+		        res.json({ 'status': 3,'msg':'该号码未注册养护项目' });
+		    }
+		},
+		
+		/**
+		 * 升级用户使用的养护 为专业版本--根据编办
+		 */
+		upCuringDo: async function(req, res){
+		    //post数据获得
+		    var ssoid=req.body.ssoid;//通行证ID
+		    var compilationId=req.body.compilationId;//编办ID
+
+		    if(hash.isExistence(ssoid)&&hash.isExistence(compilationId)) {
+		        var flag= await cloudService.upCuringDo(req.body);
+
+		        if(flag){
+		            res.json({ 'status': 1,'msg':'升级成功' });
+		        }else{
+		            res.json({ 'status': 3,'msg':'升级失败' });
+		        }
+		    }else{
+		        res.json({ 'status': 3,'msg':'数据不正确' });
+		    }
+		},
+		
+		/**
+		 * 用户关联CLD客户
+		 */
+		relevanceClientDo: async function(req, res){
+		    //post数据获得
+		    var cidKey=req.body.cidKey;//客户ID
+		    var ssoId=req.body.ssoId;//养护用户ID
+
+		    if(hash.isExistence(cidKey)&&hash.isExistence(ssoId)) {
+		        var flag= await cloudService.relevanceClientDo(req.body);
+		        
+		        if(flag){
+		            res.json({ 'status': 1,'msg':'绑定CLD客户成功' });
+		        }else{
+		            res.json({ 'status': 2,'msg':'绑定失败' });
+		        }
+		    }else{
+		        res.json({ 'status': 3,'msg':'参数不正确' });
+		    }
+		},
+		
+		/**
+		 * 用户取消关联CLD客户
+		 */
+		relieveClientDo: async function(req, res){
+		    //post数据获得
+		    var ssoId=req.body.ssoId;//养护用户ID
+
+		    if(hash.isExistence(ssoId)) {
+		        var flag= await cloudService.relieveClientDo(req.body);
+		        if(flag){
+		            
+		            res.json({ 'status': 1,'msg':'解绑CLD客户成功' });
+		            
+		        }else{
+		            res.json({ 'status': 2,'msg':'解绑失败' });
+		        }
+		    }else{
+		        res.json({ 'status': 3,'msg':'参数不正确' });
+		    }
+		},
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		/**
+		 * 养护用户分页---废弃
+		 */
+/*		getCuringPage: async function(req, res){
+		    var currentPage=req.params.currentPage;
+		    if(!hash.isNotANumber(currentPage)){
+		        res.json({ 'status': 2,'msg':'currentPage error' });return ;
+		    }
+		    //get获得方式
+		    var params = url.parse(req.url, true).query;
+
+		    var curingList= await cloudService.getCuringList(req, res);
+
+		    res.json({ 'status': 1,'curingList':curingList.curingList,'pageData':curingList.pageData });
+		},	
+    //获得养护信息--废弃
+    getCuringInfo: async function(req, res){
+        if(!hash.isNotANumber(req.params.mobile)){
+            res.json({ 'status': 0,'msg':'error mobile' });
+            return ;
+        }
+        //获得本地绑定CLD客户用户
+        var bcDetail= await cloudService.getBindCuringByMobile(req.params.mobile);
+        var cDetail= await cloudService.getCuringByMobile(req.params.mobile);
+        
+
+        if(!hash.isExistence(bcDetail)){//没有绑定CLD客户
+            if(!hash.isExistence(cDetail)){
+                res.header("Content-Type", "application/json; charset=utf-8")
+                res.json({ 'status': 3,'msg':'该号码未注册养护项目' });
+                return ;
+            }
+            res.json({ 'status': 2,'msg':'已升级用户列表不存在' });//未绑定CLD客户
+        }else{
+            res.json({ 'status': 1,'detail':bcDetail });
+        }
+    },
+*/	
+
+
+//搜索手机号,防止由于改号码导致数据不全问题 ---废弃
+/*checkMobile: async function(req, res){
+    if(!hash.isNotANumber(req.params.mobile)){
+        res.json({ 'status': 0,'msg':'error mobile' });
+        return ;
+    }
+    var data= await cloudService.getCuringByMobile(req.params.mobile);
+
+    if(hash.isExistence(data)) {
+        var curingDetail=await models.cloud_curing.getCuringBySsoid(data['userInfo']['ssoId']);
+        var client_id='';
+        if(hash.isExistence(curingDetail)&&hash.isExistence(curingDetail['client_id'])){
+            client_id=curingDetail['client_id'];
+        }
+        res.json({ 'status': 1,'data':{'id':data['userInfo']['ssoId'],'client_id':client_id} });
+    }else{
+        res.json({ 'status': 3,'msg':'该号码未注册养护项目' });
+    }
+},*/
+
+
+
+
+
+
+//养护详情页 数据---可能废弃
+//getCuringById: async function(req, res){
+//
+//    if(!hash.isExistence(req.params.id)){
+//        res.json({ 'status': 0,'msg':'error id' });
+//        return ;
+//    }
+//    var id=hash.hashDecode(req.params.id);
+//    if(!hash.isNotANumber(id)){
+//        res.json({ 'status': 0,'msg':'error id' });
+//        return ;
+//    }
+//
+//    res.json({ 'status': 3,'msg':'数据不正确' });
+//},
+
+
+
+}
+module.exports = cloudEditionAjaxController;

+ 20 - 0
app/controller/cloudBuildEditionController.js

@@ -0,0 +1,20 @@
+/**
+ * Created by MyPC on 2019/11/5.
+ */
+const cloudService=require('../service/cloudBuildEditionService');
+const hash=require('../class/hash');
+
+//养护云板首页
+var curingEdition= async function (req, res){
+
+    var curingList=await cloudService.getCuringList(req, res);	//养护用户列表
+    var compilationList=await cloudService.getCompilationList(); //编办信息
+
+    var data={ 'curingList': curingList.curingList,'sortList':curingList.sortList,'pageData':curingList.pageData,'compilationList':compilationList };
+
+    res.render('cloud/build',data);
+}
+
+
+exports.curingEdition = curingEdition;
+

+ 32 - 22
app/controller/cloudEditionAjaxController.js

@@ -3,9 +3,8 @@
  */
 const hash=require('../class/hash');
 const cloudService=require('../service/cloudEditionService');
-const operateLogService=require('../service/operateLogService');
 const url=require("url");
-var models=require('../models');
+//var models=require('../models');
 
 
 var cloudEditionAjaxController={
@@ -94,9 +93,6 @@ var cloudEditionAjaxController={
 		    if(hash.isExistence(ssoId)) {
 		        var flag= await cloudService.relieveClientDo(req.body);
 		        if(flag){
-		            /*var operateLogList=await models.operate_log.findByCondition(1,hash.hashDecode(id));
-		            //获得绑定的CLD客户信息
-		            res.json({ 'status': 1,'operateLogList':operateLogList,'msg':'解绑CLD客户成功' });*/
 		            
 		            res.json({ 'status': 1,'msg':'解绑CLD客户成功' });
 		            
@@ -108,6 +104,20 @@ var cloudEditionAjaxController={
 		    }
 		},
 		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
 		/**
 		 * 养护用户分页---废弃
 		 */
@@ -148,8 +158,8 @@ var cloudEditionAjaxController={
 */	
 
 
-//搜索手机号,防止由于改号码导致数据不全问题
-checkMobile: async function(req, res){
+//搜索手机号,防止由于改号码导致数据不全问题 ---废弃
+/*checkMobile: async function(req, res){
     if(!hash.isNotANumber(req.params.mobile)){
         res.json({ 'status': 0,'msg':'error mobile' });
         return ;
@@ -166,7 +176,7 @@ checkMobile: async function(req, res){
     }else{
         res.json({ 'status': 3,'msg':'该号码未注册养护项目' });
     }
-},
+},*/
 
 
 
@@ -174,20 +184,20 @@ checkMobile: async function(req, res){
 
 
 //养护详情页 数据---可能废弃
-getCuringById: async function(req, res){
-
-    if(!hash.isExistence(req.params.id)){
-        res.json({ 'status': 0,'msg':'error id' });
-        return ;
-    }
-    var id=hash.hashDecode(req.params.id);
-    if(!hash.isNotANumber(id)){
-        res.json({ 'status': 0,'msg':'error id' });
-        return ;
-    }
-
-    res.json({ 'status': 3,'msg':'数据不正确' });
-},
+//getCuringById: async function(req, res){
+//
+//    if(!hash.isExistence(req.params.id)){
+//        res.json({ 'status': 0,'msg':'error id' });
+//        return ;
+//    }
+//    var id=hash.hashDecode(req.params.id);
+//    if(!hash.isNotANumber(id)){
+//        res.json({ 'status': 0,'msg':'error id' });
+//        return ;
+//    }
+//
+//    res.json({ 'status': 3,'msg':'数据不正确' });
+//},
 
 
 

+ 117 - 0
app/models/build.js

@@ -0,0 +1,117 @@
+/**
+ * Created by MyPC on 2019/11/5.
+ */
+'use strict';
+const hash= require('../class/hash');
+const Sequelize = require('sequelize');
+const Op = Sequelize.Op;
+
+module.exports = (sequelize, DataTypes) => {
+    const curing = sequelize.define('cloud_build', {
+
+        mobile: DataTypes.STRING,
+        sso_id: DataTypes.STRING,
+        compilation_id: DataTypes.STRING,
+        curingCompany: DataTypes.STRING,
+        sid: DataTypes.INTEGER,
+        cid: DataTypes.INTEGER,
+        status: DataTypes.INTEGER,
+        client_id: DataTypes.INTEGER,
+        addtime: DataTypes.STRING,
+        updateTotal:DataTypes.INTEGER,
+        upgradeDescribe: DataTypes.STRING,
+
+    }, {});
+    curing.associate = function(models) {
+        // associations can be defined here
+    };
+
+    
+    curing.getCuringInMobile=async function(mobile,compilation_id){
+    	
+    	if(!hash.isExistence(mobile)){
+    		return [];
+        }
+    	
+    
+    	var option={
+        		where: {
+        			mobile: {
+                        [Op.or]: [mobile]
+        					}
+        				},
+                raw:true,
+                };
+        if(hash.isExistence(compilation_id)){
+            option.where={compilation_id: compilation_id};
+        }
+    	
+        var curingList = await this.findAll(option);
+        return curingList;
+    };
+    
+
+    /*
+     * ����mobile����Ѱ������ư��û�
+     * */
+    curing.getCuringByMobile=async function(mobile){
+
+        if(mobile==undefined){
+            return [];
+        }
+        var condition={
+            raw:true,
+            where: {
+                mobile: mobile
+            }};
+        var curingList = await this.findOne(condition);
+        return curingList;
+    };
+
+    /*
+     * ����ssoid����Ѱ������ư��û�
+     * */
+    curing.getCuringBySsoid=async function(ssoid){
+        if(!hash.isExistence(ssoid)){
+            return [];
+        }
+
+        var condition={
+            raw:true,
+            where: {
+                sso_id: ssoid
+            }};
+        var detail = await this.findOne(condition);
+        if(!hash.isExistence(detail)){
+            return [];
+        }
+        detail.id=hash.hashEncode(detail.id.toString());
+        return detail;
+    };
+
+    /*
+     * ����id����Ѱ������ư��û�
+     * */
+    curing.getCuringById=async function(id){
+        if(!hash.isExistence(id)){
+            return [];
+        }
+        var condition={
+            raw:true,
+            where: {
+                id: id
+            }};
+        var detail = await this.findOne(condition);
+        return detail;
+    };
+
+    /*
+     * ��ñ��ر��
+     * */
+    curing.getCuringCompilationList=async function(){
+
+        return [];
+    };
+
+    return curing;
+};

+ 139 - 0
app/models/buildOperate_log.js

@@ -0,0 +1,139 @@
+/**
+ * Created by MyPC on 2019/11/5.
+ */
+'use strict';
+const hash= require('../class/hash');
+const Sequelize = require('sequelize');
+const Op = Sequelize.Op;
+
+var moment = require('moment');
+
+/*var d = new Date();
+var tableNameYear=d.getFullYear();
+ +OPERATELOGTABLE*/
+
+
+module.exports = (sequelize, DataTypes) => {
+
+    const operateLog = sequelize.define('operate_log', {
+        id : {type: DataTypes.INTEGER(11), primaryKey: true, autoIncrement: true},
+        logType: DataTypes.INTEGER,
+
+        dataId: DataTypes.INTEGER,
+        cid: DataTypes.INTEGER,
+        sid: DataTypes.STRING,
+
+        username: DataTypes.STRING,
+        category: DataTypes.STRING,
+        operation: DataTypes.STRING,
+        img: DataTypes.INTEGER(15),
+
+        createDate: DataTypes.DATE,
+
+    }, {tableName:'buildOperate_log_'+OPERATELOGTABLE});
+
+
+    /*
+     * 根据ID合集获得客户信息
+     * */
+    operateLog.findByCondition=async function(logType,dataId){
+
+        if(!hash.isExistence(logType)||!hash.isExistence(dataId)){
+            return []
+        }else if(!hash.isNotANumber(logType)||!hash.isNotANumber(dataId)){
+            return [];
+        }
+        //var idList = await this.findAll(condition);//获得idList
+        //var yearList= await this.findAll(condition);//获得yearList
+        //console.log(logType+'d'+dataId);
+        
+        var list=[];
+        var sqlQuery = 'select  CONVERT(GROUP_CONCAT(id) USING utf8)   as id,date_format(createDate,"%Y") as year FROM buildOperate_log where ' +
+        'logType=? and dataId=? GROUP BY Year(createDate) ';
+        await sequelize.query(sqlQuery,
+        		  { replacements: [logType,dataId], type: sequelize.QueryTypes.SELECT }
+        		).then(function(results) {
+        			list=results;
+        		})
+        
+        /*
+         .spread((results, metadata) => {
+                    list=results;
+                    
+                });
+         
+         .then(function(results) {
+    			list=results;
+    		})
+         */
+
+        var sqlArray=[];
+        list.forEach(function(v,i){
+            sqlArray.push(' SELECT *,DATE_FORMAT(createDate, "%Y-%m-%d %H:%m:%S") AS createDate FROM buildOperate_log_'+v.year+' WHERE id in ('+v.id+')   ');
+
+        });
+        if(!hash.isExistence(list)){
+            return [];
+        }
+
+        var sql=sqlArray.join(" UNION ");
+        sql+=' ORDER BY id desc';
+
+        await this.sequelize.query(sql).spread((results, metadata) => {
+            list=results;
+        });
+
+        list.forEach(function(v,i){
+            //list[i].createDate=moment(v.createDate, 'YYYY-MM-DD HH:mm');//moment.unix(v.createDate).format('YYYY-MM-DD HH:mm');
+            list[i].id=hash.hashEncode(v.id.toString());
+        });
+
+        return list;
+    };
+
+/*
+ * 新增操作日志
+ *
+ * */
+operateLog.createOperateLog=async function(logType,dataId,operation){
+
+    if(!hash.isExistence(logType)||!hash.isExistence(dataId)){
+        return false;
+    }
+
+    var sid=hash.hashDecode(STAFF.sid);
+    var createDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
+
+    var sql='INSERT INTO buildOperate_log (logType,sid,createDate,dataId,cid) values ('+logType+','+sid+',"'+createDate +'",'+dataId+','+STAFF.cid+')';
+    var id='';
+    await this.sequelize.query(sql).spread((results, metadata) => {
+        id=results;
+    });
+
+    var obj = {
+        id:id,
+        logType: logType,
+        username: STAFF.username,
+        sid: sid,
+        category: STAFF.category,
+        createDate: createDate,
+        operation: operation,
+        img: STAFF.avatar,
+
+        dataId: dataId,
+        cid: STAFF.cid,
+    };
+    await this.create(obj);
+    return true;
+};
+
+
+
+
+
+
+
+
+    return operateLog;
+};
+

+ 578 - 0
app/service/cloudBuildEditionService.js

@@ -0,0 +1,578 @@
+/**
+ * Created by MyPC on 2019/11/5.
+ */
+var models=require('../models');
+var moment = require('moment');
+const hash=require('../class/hash');
+const urlObj=require("url");
+
+//测试服务器
+//var curingUrl ='https://yhuat.smartcost.com.cn/cld';
+//正式服务器
+//var curingUrl ='https://yhyun.smartcost.com.cn/cld';
+//本地跑
+var curingUrl ="http://qa.smartcost.com.cn:6060/cld";
+
+
+
+
+var cloudService={
+
+    
+	/**
+	 * 获得养护列表
+	 * paramsCompilation	传参包含
+	 * -compilation			已升级编办	
+	 * -latestCompilation	最近使用编办
+	 */
+    getCuringList: async function(req, res){
+       
+    	//获得远程养护用户
+    	//分页数据
+    	var page=1;
+    	
+        var compilation='';
+    	var latestCompilation='';
+    	var sortField='create_time';
+        var sort='-1';
+        var wd='';	//检索内容
+
+    	//编办参数-排序参数-当前页
+        if(hash.isExistence(req.url)){
+        	var params = urlObj.parse(req.url, true).query;
+        	
+        	if(hash.isExistence(params.compilation)){
+        		compilation=params.compilation;
+        	}
+        	if(hash.isExistence(params.latestCompilation)){
+        		latestCompilation=params.latestCompilation;
+        	}
+        	//排序
+        	var mAge=1000*60*60*24*28;
+        	if(hash.isExistence(params.sortField)){
+        		res.cookie('sortField','create_time', {maxAge: mAge});
+        		sortField='create_time';
+        		if(params.sortField=='latest_login'){
+        			sortField='latest_login';
+        			res.cookie('sortField','latest_login', {maxAge: mAge});
+        		}
+        	}else if(hash.isExistence(req.cookies.sortField)){
+        		sortField=req.cookies.sortField;
+        	}
+        	if(hash.isExistence(params.sort)){
+        		res.cookie('sort','-1', {maxAge: mAge});
+        		sort=-1;
+        		if(params.sort=='1'){
+        			sort=1;
+        			res.cookie('sort','1', {maxAge: mAge});
+        		}
+        	}else if(hash.isExistence(req.cookies.sort)){
+        		sort=req.cookies.sort;
+        	}
+        	//当前页数
+        	var page=req.params.currentPage;
+    	    if(!hash.isNotANumber(page)){
+    	    	page=1;
+    	    }
+    	    //检索 内容
+    	    if(hash.isExistence(params.wd)){
+        		wd=params.wd;
+        	}
+        }
+
+        //分页参数
+        var limit=12;
+        var offset=0;
+        if(page!=1){
+            var pg=page-1;
+            offset=pg*limit;
+        }
+
+        //排序参数
+        //var sortField=curingInterfaceConfig.sort[0];
+        //var sort=curingInterfaceConfig.sort[1];
+    	var url= GCLOUDURL+'/getUserList'+
+    	'?page='+page+'&pageSize='+limit+'&latestUsed='+latestCompilation+'&upGrade='+compilation+'&sortField='+sortField+'&sortType='+sort+
+    	'&keyword='+wd;
+
+    	/*	接口请求获得的信息
+    	 *  userInfo	
+    	 *  pageData
+    	 *  compilationlist
+    	 */
+        var curingCloudData=await curlRequest(url);
+        var curingCloudList=curingCloudData.userInfo;
+        
+    	//组合数据以获得本地扩展数据
+        if(!hash.isExistence(curingCloudList)){
+        	curingCloudList=[];
+        }
+        var mobile=[];
+        curingCloudList.forEach(function(v,i){
+        	mobile.push(v.mobile);
+        });
+
+        
+        if(!hash.isExistence(mobile)){
+        	return {curingList:[],pageData:[],sortList:[]};
+        }
+
+        //获得指定数据
+        var curingList = await models.cloud_curing.getCuringInMobile(mobile);
+       
+        //组合同步云版数据
+        var falg=false;
+        curingCloudList.forEach(async function(cclValue,cclKey){
+        	curingCloudList[cclKey].client_id=0
+        	
+        	falg=true;
+        	for(var i=0;i<curingList.length;i++){
+        		if(cclValue.mobile==curingList[i].mobile){
+            		curingCloudList[cclKey].client_id=curingList[i].client_id;
+            		falg=false;
+            		break;
+            	}
+        	}
+        	
+        	if(falg){//新增本地扩展信息
+        		sid=hash.hashDecode(STAFF.sid);
+        		var obj = {
+                        mobile: cclValue.mobile,
+                        sso_id: cclValue.ssoId,
+                        sid: sid,
+                        cid: STAFF.cid,
+                        status: 2,
+                    };
+                var detail = await models.cloud_curing.create(obj);
+        	}
+        	
+        });
+    	
+        //获得编办数据
+        var compilationList=await this.getCompilationList(); //编办信息
+        
+        //console.log(compilationList);
+        
+        //数据组合--cld客户数据
+        var cid=[];
+        curingCloudList.forEach(function(v,i){
+        	if(v.client_id!=0){
+        		cid.push(v.client_id);
+        	}
+        });
+        var clientList =[];
+        if(hash.isExistence(cid)){
+        	 var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
+             clientList = await models.CLD_client.findAllInCid(cid,attributes);
+        }
+        
+        //组合页面需要展示的数据
+        curingCloudList.forEach(function(v,i){
+        	curingCloudList[i].clientInfo={};
+            clientList.forEach(function(clientVal,clientI){
+                if(v.client_id==clientVal.cid){
+                	curingCloudList[i].clientInfo=clientVal;
+                }
+            });
+
+            curingCloudList[i].addtime=moment(v.create_time).format('YYYY-MM-DD HH:mm');
+            curingCloudList[i].latest_login=moment(v.latest_login).format('YYYY-MM-DD HH:mm');
+            curingCloudList[i].client_id=hash.hashEncode(v.client_id.toString());
+            curingCloudList[i].ssoId=hash.hashEncode(v.ssoId.toString());
+            
+            //最后使用
+            curingCloudList[i].latest_usedName='';            
+            for(var ci=0;ci<compilationList.length;ci++){
+            	if(compilationList[ci]._id==v.latest_used){
+            		curingCloudList[i].latest_usedName=compilationList[ci].name;
+            		break;
+            	}
+            }
+            //登录时长
+            if(hash.isExistence(v.online_list)){
+            	var onlineTimeLength=v.online_list.length-1;
+            	curingCloudList[i].online_newest=v.online_list[onlineTimeLength].online_times+'('+v.online_list[onlineTimeLength].dateString+')';
+            }else{
+            	curingCloudList[i].online_newest='';
+            }
+            //已升级专业版
+            curingCloudList[i].upgradeListName='';
+            for(var gi=0;gi<v.upgrade_list.length;gi++){
+            	for(var ci=0;ci<compilationList.length;ci++){
+            		if( compilationList[ci]._id == v.upgrade_list[gi].compilationID&&v.upgrade_list[gi].isUpgrade) {
+            			curingCloudList[i].upgradeListName+='<span class="badge badge-primary">'+compilationList[ci].name+'</span>';
+            			break;
+            		}
+            	}
+            }
+           
+        });
+        
+        var parameter='?compilation='+compilation+'&latestCompilation='+latestCompilation+'&sortField='+sortField+'&sort='+sort;
+        //分页计算
+        var pageData = await getPage('','',page,limit,parameter,curingCloudData.pageData.total);
+
+        return {curingList:curingCloudList,pageData:pageData,sortList:[sortField,sort]};
+    },
+
+    /**
+     * 获得养护编办--接口拉取
+     */
+    getCompilationList:async function (){
+        var url= GCLOUDURL+'/getCompilationList';
+        var data= await curlRequest(url);
+        return data;
+    },
+    
+    /**
+     * 用户详情页-数据
+     */
+    getCuringBySsoid: async function(ssoid,client_id){
+        
+        if(!hash.isNotANumber(ssoid)){
+            ssoid=hash.hashDecode(ssoid);
+            if(!hash.isNotANumber(ssoid)){
+                return [];
+            }
+        }
+
+        var url= GCLOUDURL+'/getUsersAndCompilation?ssoID='+ ssoid;
+        var userData= await curlRequest(url);
+        if(!hash.isExistence(userData)){
+            return [];
+        }
+        
+        //最后使用          
+        userData['userInfo']['latest_usedName']='';
+
+                
+        //本地养护用户
+        userData['curingInfo']=await models.cloud_curing.getCuringBySsoid(ssoid);
+        client_id=userData['curingInfo']['client_id'];
+
+        var detail =[];
+        if(hash.isExistence(client_id)){
+                 detail = await models.CLD_client.findById(client_id);
+        }
+
+        userData['clientInfo']=detail;
+
+        //组合数据升级产品数据
+        userData['compilationList'].forEach(function(value,key){
+            userData['userInfo']['upgrade_list'].forEach(function(v,k){
+                if(v['compilationID']==value['_id']){
+                    userData['compilationList'][key]['isUpgrade']=v['isUpgrade'];
+                }
+            });
+            
+            if(value['_id']==userData['userInfo']['latest_used']){
+        		userData['userInfo']['latest_usedName']=value['name'];
+        	}
+            
+        });
+        userData['userInfo']['ssoIdKey']=hash.hashEncode(userData['userInfo']['ssoId'].toString());
+
+        //获得操作日志
+        userData['operateLog']=[];
+        if(hash.isExistence(userData['curingInfo'])){
+            userData['operateLog']=await models.operate_log.findByCondition(1,hash.hashDecode(userData['curingInfo']['id']));
+        }
+
+        return userData;
+    },
+    
+    /**
+     * 用户升级专业版
+     */
+    upCuringDo: async function(data){
+        var url =  GCLOUDURL+'/setUserUpgrade';
+        var ssoid=hash.hashDecode(data.ssoid);
+        var postData ={'ssoId':ssoid,'cid':data.compilationId};
+        var result= await postRequest(url,postData);
+        result=JSON.parse(result);
+
+        if(result.error==0){   //接口更新成
+            var curingDetail=await models.cloud_curing.getCuringByMobile(data.mobile);
+            var id='';
+            if(hash.isExistence(curingDetail)){ //是否需要同步同步到本地库中
+                var url= GCLOUDURL+'/getUsersAndCompilation?ssoID='+ ssoid;
+                var userData= await curlRequest(url);
+                //获得更新数量updateTotal
+                var updateTotal=0;
+                userData['userInfo']['upgrade_list'].forEach(function(value,key){
+                    if(value['isUpgrade']){
+                        updateTotal++;
+                    }
+                });
+                //更新数量
+                var values = {
+                    updateTotal: updateTotal
+                }
+                var where={
+                    where: {id: curingDetail['id']}
+                };
+                await models.cloud_curing.update(values,where);
+                id=curingDetail['id'];
+            }else{
+            	sid=hash.hashDecode(STAFF.sid);
+                //获得登陆用户相关信息
+                var obj = {
+                    mobile: data.mobile,
+                    sso_id: data.ssoid,
+                    compilation_id: data.compilationId,
+                    //curingCompany: data.name,
+                    sid: sid,
+                    cid: STAFF.cid,
+                    status: 1,
+                    //addtime: new Date().getTime(),
+                    updateTotal: 1
+                };
+                var detail=await models.cloud_curing.create(obj);
+                id=detail['cloud_curing']['id'];
+            }
+
+            var operation=STAFF.username+'升级'+data.name;
+            //记录锁日志
+            await models.operate_log.createOperateLog(1,id,operation);
+
+            return true;
+        }else{
+            return false;
+        }
+    },
+
+    /**
+     * 用户关联CLD客户
+     */
+    relevanceClientDo: async function(data){
+
+        var cid=hash.hashDecode(data.cidKey);
+        var ssoId=hash.hashDecode(data.ssoId);
+   
+        if(!hash.isNotANumber(cid)||!hash.isNotANumber(ssoId)){
+            return false;
+        }
+
+        var curingDetail=await models.cloud_curing.getCuringBySsoid(ssoId);
+        if(hash.isExistence(curingDetail)) {
+
+            var clientDetail=await models.CLD_client.findById(cid);
+            if(hash.isExistence(clientDetail)){
+            	
+            	var id=hash.hashDecode(curingDetail['id']);
+                //更新数量
+                var values = {
+                    client_id: cid
+                }
+                var where={
+                    where: {id: id}
+                };
+                await models.cloud_curing.update(values,where);
+
+                //记录操作日志
+                var operation=STAFF.username+'关联CLD联系人'+clientDetail.clientname;
+                await models.operate_log.createOperateLog(1,id,operation);
+                return true;
+            }else{
+                return false;
+            }
+        }else{
+            return false;
+        }
+    },
+    
+	/**
+	 * 用户取消关联CLD客户
+	 */
+    relieveClientDo: async function(data){
+
+        var ssoId=hash.hashDecode(data.ssoId);
+        if(!hash.isNotANumber(ssoId)){
+            return false;
+        }
+
+        var curingDetail=await models.cloud_curing.getCuringBySsoid(ssoId);
+        if(hash.isExistence(curingDetail)) {
+        	var id=hash.hashDecode(curingDetail['id']);
+        	//更新数量
+            var values = {
+                client_id: ''
+            }
+            var where={
+                where: {id: id}
+            };
+            await models.cloud_curing.update(values,where);
+
+            var clientDetail=await models.CLD_client.findById(curingDetail['client_id']);
+            //记录操作日志
+            var operation=STAFF.username+'移除CLD联系人'+clientDetail.clientname;
+            await models.operate_log.createOperateLog(1,id,operation);
+
+            return true;
+        }else{
+            return false;
+        }
+    },
+    
+    
+    
+    /**
+     * 获得本地编办列表--废弃
+     */
+    /*getCuringCompilationList:async function (){
+        var compilationList = await models.cloud_curing.getCuringCompilationList();
+        return compilationList;
+    },*/
+
+    
+
+    //获取本地养护数据--可能废弃
+    getBindCuringByMobile:async function (mobile){
+        var curingList = await models.cloud_curing.getCuringByMobile(mobile);
+        if (curingList!=null){
+            var cid=[curingList['client_id']];
+            var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
+            var clientList = await models.CLD_client.findAllInCid(cid,attributes);
+            curingList.clientInfo={};
+            clientList.forEach(function(clientVal,clientI){
+                if(curingList.client_id==clientVal.cid){
+                    curingList.clientInfo=clientVal;
+
+                }
+            });
+            curingList.addtime=moment.unix(curingList.addtime).format('YYYY-MM-DD HH:mm');
+        }
+        return curingList;
+    },
+
+    //根据手机号码获得养护用户信息--可能废弃
+    getCuringByMobile: async function(mobile){
+        var url= GCLOUDURL+'/getUsersAndCompilation?mobile='+ mobile;
+        var userData= await curlRequest(url);
+        return userData;
+    },
+
+    
+    
+    
+
+}
+module.exports = cloudService;
+
+
+
+//接口调用
+var curlRequest = async function(url){
+    var got = require('got');
+    var data=[];
+    await got(url, { json: true,timeout:300 }).then(response => {
+        data= response.body.data;
+}).catch(error => {
+    console.log('GET调用接口超时');
+});
+return data;
+}
+
+var postRequest= async function(url,data){
+
+    //var fs = require('fs');
+    var got = require('got');
+    var qs = require('querystring');
+    var keysList=Object.keys(data);
+    var content = qs.stringify(data);
+    result= await got.post(url, {
+            body: content,
+            timeout:300,
+            headers: {
+                'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
+            }
+        }).catch(error => {
+            console.log('POST调用接口超时');
+    });
+    return result.body;
+
+//var FormData = require('form-data');
+//var form = new FormData();
+/* keysList.forEach(function(v,i){
+ console.log(v);
+ form.append(v, data[v]);
+ });*/
+
+//form.append('ssoId', data.ssoId);
+//form.append('cid', data.cid);
+
+//console.log(form);
+//console.log(keysList);
+//form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+
+//?longle=12
+//url='http://cld.com/longle/list/add';
+
+//var content = qs.stringify({'longle':125});
+
+
+//console.log(data);
+
+}
+
+var modelsQuery= async function(sql){
+    var data=[];
+    await models.sequelize.query(sql).spread((results, metadata) => {
+        // 结果将是一个空数组,元数据将包含受影响的行数。
+        data=results;
+
+    });
+    return data;
+}
+
+/**
+ * 分页相关数据计算
+ * modelsTable 数据表对象
+ * parameter 设置传的参数
+ */
+var getPage= async function(modelsTable,where,currentPage,pageSize,parameter,totalCount){
+	
+	if(!hash.isExistence(totalCount)){
+		if(hash.isExistence(where)){
+	        totalCount=await modelsTable.count({where});
+	    }else{
+	    	totalCount=await modelsTable.count();
+	    }
+	}
+    currentPage=parseInt(currentPage);
+    var total =0;
+    if(totalCount!=0){
+    	total = Math.trunc ( totalCount / pageSize );
+    }
+    var totalPage = (totalCount % pageSize) == 0 ? total : total + 1;
+
+    var pageMax=1;
+    var pageWidth=15;
+    //开始页数
+    var startPage=1;
+    if (currentPage >= pageWidth) {
+    	pageMax = parseInt ( currentPage / pageWidth ) + 1;
+    	startPage = parseInt ( currentPage / pageWidth ) * pageWidth - 1;
+	}
+    
+    //结束页数
+    var endPage=pageWidth * pageMax;
+    if(endPage>totalPage){
+    	endPage=totalPage;
+    }
+    
+    var page={
+        'currentPage':currentPage,  //当前页
+        'previousPage':currentPage!=0?currentPage-1:currentPage,    //上一页
+        'nextPage': currentPage==totalPage ? totalPage:currentPage+1,
+        'totalPage':totalPage,
+        'startPage':startPage,
+        'endPage':endPage,
+        'pageWidth':pageWidth,
+        'parameter':encodeURI(parameter)
+    };
+    
+    return page;
+}
+
+

+ 7 - 4
app/service/cloudEditionService.js

@@ -1,19 +1,22 @@
 /**
  * Created by MyPC on 2019/11/5.
  */
-var models=require('../models');
+var modelsCuring=require('../models/curing');
+
+//  models
+
 var moment = require('moment');
 const hash=require('../class/hash');
 const urlObj=require("url");
 
 //测试服务器
-var curingUrl =GCLOUDURL;
+//var curingUrl ='https://yhuat.smartcost.com.cn/cld';
 //正式服务器
 //var curingUrl ='https://yhyun.smartcost.com.cn/cld';
 //本地跑
-//var curingUrl ="http://qa.smartcost.com.cn:2060/cld";
+var curingUrl ="http://qa.smartcost.com.cn:2060/cld";
+
 
-//var buildUrl = 'https://yun.smartcost.com.cn/cld';
 
 
 

+ 1 - 2
app/service/operateLogService.js

@@ -16,8 +16,7 @@ var setOperateLog = async function (data){
         };
 
     var list = await models.operate_log.findAll(condition);
-    console.log(list);
-
+ 
 
     return true;
 }

+ 437 - 0
global/js/cloud/build.js

@@ -0,0 +1,437 @@
+/**
+ * Created by MyPC on 2019/11/11.
+ */
+
+var mobile2InfoTimeout = null;
+var searchCuringTimeout = null;
+var mobile='';
+var getClentListTimeout = null;
+var clientname='';
+var columnLength=7;
+
+
+
+function fnSearchCuring(){
+    searchCuringTimeout = null;
+    if((/^1[34578]\d{9}$/.test(mobile))){
+        $.ajax({
+            cache :false,
+            type: 'GET',
+            url: '/cloud/curing/ajax/checkMobile/'+mobile,
+            //data: { mobile: mobile },
+            dataType: 'json',
+
+            context: $('body'),
+            success: function(data){
+                if(data.status==1||data.status==2){
+                    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!')
+            }
+        })
+    }
+}
+
+
+
+
+
+
+
+
+//获得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!')
+        }
+    })
+}
+
+/**
+ * 用户升级专业版 弹框提示--用户详情界面
+ * @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();
+})
+
+
+$(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);
+    	}
+        
+    });
+
+    
+    
+//    $('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){
+        // 只获取第一个选中的值
+        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('请选择需要升级的版本');
+        }
+    });
+    
+    /**
+     * 用户绑定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/curing/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/curing/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();
+    });
+
+    $('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[upNewClient]').on('click', function(e){
+        $('input[fnsearchcuring]').val('');
+        $('div[upCuringBox]').hide();
+        $('p[upCuringBox]').hide();
+
+    });
+
+    $('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!')
+            }
+        })
+    });
+
+    
+    
+    
+    
+    
+    
+
+})
+
+
+
+
+
+
+//构建升级用户信息--预计废弃
+function fnGetCuringDetail(ssoid,client_id){
+
+    $('tbody[upMajorBox]').html('');
+    $('#curingSsoid').val('');
+    $('#curingMobile').val('');
+    $('#client_id').val('');
+    $('#name').val('');
+    $('#_id').val('');
+    $.ajax({
+        cache :false,
+        type: 'GET',
+        url: '/cloud/curing/ajax/getCuringBySsoid',
+        data: {ssoid: ssoid, client_id: client_id},
+        dataType: 'json',
+        context: $('body'),
+        success: function(data){
+            if(data.status==1||data.status==2){
+                $('div[upCuringBox]').show();
+                $('p[upCuringBox]').hide();
+                
+                var objHtml=buildCuringInfo(data.detail.userInfo);
+                $('div[curingInfo] curing').html(objHtml);
+
+                var upMajorBoxHtml=buildCuringCompilation(data);
+                $('tbody[upMajorBox]').html(upMajorBoxHtml);
+
+                var operateLogHtml=buildCuringOperateLog(data.detail.operateLog);
+                $('div[operateLog] curingOperate').html(operateLogHtml);
+
+            }else if(data.status==3){
+                $('div[upCuringBox]').hide();
+                $('p[upCuringBox]').show();
+            }
+        },
+        error: function(xhr, type){
+            console.log('Ajax error!')
+        }
+    })
+}

+ 128 - 0
global/js/cloud/buildFN.js

@@ -0,0 +1,128 @@
+
+/**
+ * 分页列表--刷新用户列表
+ * @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);
+}
+
+
+

+ 20 - 21
global/js/cloud/curing.js

@@ -11,7 +11,7 @@ var columnLength=7;
 
 
 
-function fnSearchCuring(){
+/*function fnSearchCuring(){
     searchCuringTimeout = null;
     if((/^1[34578]\d{9}$/.test(mobile))){
         $.ajax({
@@ -35,7 +35,7 @@ function fnSearchCuring(){
             }
         })
     }
-}
+}*/
 
 
 
@@ -299,15 +299,12 @@ $(function() {
     		
     	}
         
-        
-        
-        
     });
 
-    
-    
-    
-    //检索cld用户
+    //
+    /**
+     * 检索cld用户
+     */
     $('input[getClentList]').on('keyup', function(e){
         if(getClentListTimeout != null){
             clearTimeout(getClentListTimeout);
@@ -337,7 +334,17 @@ $(function() {
         fnMobile2Info();
     });
 
-    $('input[fnSearchCuring]').on('keyup', function(e){
+    
+
+    
+/*
+ 	$('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);
         }
@@ -346,14 +353,6 @@ $(function() {
             searchCuringTimeout = setTimeout(fnSearchCuring, 500);
         }
     });
-
-    $('a[upNewClient]').on('click', function(e){
-        $('input[fnsearchcuring]').val('');
-        $('div[upCuringBox]').hide();
-        $('p[upCuringBox]').hide();
-
-    });
-
     $('a[upClient]').on('click', function(e){
         var mobile=$('b[curingMobile]').html();
         if(mobile==''){
@@ -379,7 +378,7 @@ $(function() {
                 console.log('Ajax error!')
             }
         })
-    });
+    });*/
 
     
     
@@ -396,7 +395,7 @@ $(function() {
 
 
 //构建升级用户信息--预计废弃
-function fnGetCuringDetail(ssoid,client_id){
+/*function fnGetCuringDetail(ssoid,client_id){
 
     $('tbody[upMajorBox]').html('');
     $('#curingSsoid').val('');
@@ -434,4 +433,4 @@ function fnGetCuringDetail(ssoid,client_id){
             console.log('Ajax error!')
         }
     })
-}
+}*/

文件差異過大導致無法顯示
+ 179 - 0
global/js/cloud/curingHtml.js


+ 778 - 0
views/cloud/build.html

@@ -0,0 +1,778 @@
+<% include ../header.html %>
+<script src="<%= WEB_SITE_GLOBAL %>js/pagination/page.js"></script>
+<script src="<%= WEB_SITE_GLOBAL %>js/cloud/curingFN.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/tools.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/jquery-3.4.1.min.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/contacts/buildHtml.js"></script>
+<script src="<%= WEB_SITE_GLOBAL %>js/cloud/buildHtml.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/contacts/client.js"></script>
+<script src="<%= WEB_SITE_GLOBAL %>js/cloud/curing.min.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/columnShow/columnShow.js"></script>
+
+<style>
+    input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
+        -webkit-appearance: none !important;
+    }
+    input[type="number"]{-moz-appearance:textfield;}
+</style>
+
+
+
+
+
+
+
+
+
+
+<body class="mod-bg-1 nav-function-fixed header-function-fixed">
+<!-- DOC: script to save and load page settings -->
+<% include ../themeSettingJS.html %>
+<!-- BEGIN Page Wrapper -->
+<div class="page-wrapper">
+    <div class="page-inner">
+        <!-- BEGIN Left Aside -->
+        <aside class="page-sidebar">
+            <% include ../menu.html %>
+            <!-- 侧栏主菜单 -->
+            <% include cloudMenu.html %>
+            <!-- END 侧栏主菜单 -->
+            <!--侧栏底部菜单-->
+            <div class="nav-footer shadow-top">
+                <a href="#" onclick="return false;" data-action="toggle" data-class="nav-function-minify" class="hidden-md-down">
+                    <i class="ni ni-chevron-right"></i>
+                    <i class="ni ni-chevron-right"></i>
+                </a>
+                <ul class="list-table m-auto nav-footer-buttons">
+                    <li>
+                        <a href="javascript:void(0);" data-toggle="tooltip" data-placement="top" title="" data-original-title="Chat logs">
+                            <i class="fal fa-comments"></i>
+                        </a>
+                    </li>
+                    <li>
+                        <a href="javascript:void(0);" data-toggle="tooltip" data-placement="top" title="" data-original-title="Support Chat">
+                            <i class="fal fa-life-ring"></i>
+                        </a>
+                    </li>
+                    <li>
+                        <a href="javascript:void(0);" data-toggle="tooltip" data-placement="top" title="" data-original-title="Make a call">
+                            <i class="fal fa-phone"></i>
+                        </a>
+                    </li>
+                </ul>
+            </div>
+        </aside>
+        <!-- END 侧栏主菜单 -->
+        <div class="page-content-wrapper">
+            <!-- BEGIN 页面头部 -->
+            <header class="page-header" role="banner">
+                <!-- DOC: 侧栏收起工具 -->
+                <div class="hidden-md-down dropdown-icon-menu position-relative" >
+                    <a href="#" class="header-btn btn js-waves-off" data-action="toggle" data-class="nav-function-hidden" title="隐藏侧栏">
+                        <i class="ni ni-menu"></i>
+                    </a>
+                    <ul>
+                        <li>
+                            <a href="#" class="btn js-waves-off" data-action="toggle" data-class="nav-function-minify" title="迷你侧栏">
+                                <i class="ni ni-minify-nav"></i>
+                            </a>
+                        </li>
+                    </ul>
+                </div>
+                <div class="hidden-lg-up">
+                    <a href="#" class="header-btn btn press-scale-down waves-effect waves-themed" data-action="toggle" data-class="mobile-nav-on">
+                        <i class="ni ni-menu"></i>
+                    </a>
+                </div>
+                <!--页面标题-->
+                <h1 class="subheader-title">
+                    云版管理
+                </h1>
+                <!--顶部右栏-->
+                <% include ../userInfo.html %>
+            </header>
+            <!-- END 页面头部 -->
+            <!-- BEGIN 页面内容 -->
+            <!-- the #js-page-content id is needed for some plugins to initialize -->
+            <main id="js-page-content" role="main" class="page-content">
+                <div class="subheader">
+                    <h1 class="subheader-title">
+                        <i class='subheader-icon fal fa-'></i> 养护云造价</span>
+                    </h1>
+                </div>
+                <div class="row">
+                    <div class="col-xl-12">
+                        <div id="panel-1" class="panel">
+                            <div class="panel-hdr">
+                                <!-- 废弃 <div class="col-auto pr-0">
+                                    <a href="#search-new" upNewClient class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#search-new">升级新用户</a>
+                                </div>  -->
+                                <div class="col-auto pr-0">
+                                    <div class="input-group input-group-sm bg-white shadow-inset-2">
+<input type="number" mobile2Info  value="" class="form-control bg-transparent" placeholder="请输入通行账号(手机)">
+                                        <div class="input-group-append" mobile2Info >
+                                            <button  class="btn btn-default waves-effect waves-themed" type="button"><i class="fal fa-search"></i></button>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="col-auto pr-0">
+                                    <select curingByCompilation class="custom-select form-control custom-select-sm">
+										<option value="">已升级专业版</option>
+                                        <% compilationList.forEach(function(compilation) { %>
+                                        <option value="<%= compilation._id %>"><%= compilation.name %></option>
+                                        <% }); %>
+                                    </select>
+                                </div>
+                                <div class="col-auto pr-0">
+                                    <select curingByLatestCompilation class="custom-select form-control custom-select-sm">
+										<option value="">最近使用</option>
+                                        <% compilationList.forEach(function(compilation) { %>
+                                        <option value="<%= compilation._id %>"><%= compilation.name %></option>
+                                        <% }); %>
+                                    </select>
+                                </div>
+                                
+                                
+                                <div class="col-auto ml-auto"  >
+                                              <button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">显示列</button>
+                                              <div class="dropdown-menu">
+                                                <ul class="list-unstyled px-3 pt-2 mb-0">
+                                                	<li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="1" class="custom-control-input"  id="lie1">
+                                                      <label class="custom-control-label" for="lie1">QQ</label>
+                                                    </div>
+                                                  </li>
+                                                	
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="2" class="custom-control-input"  id="lie1">
+                                                      <label class="custom-control-label" for="lie1">企业名称</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="3" class="custom-control-input" id="lie2">
+                                                      <label class="custom-control-label" for="lie2">CLD联系人</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="4" class="custom-control-input" id="lie3">
+                                                      <label class="custom-control-label" for="lie3">公司</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="5" class="custom-control-input" id="lie4" checked="">
+                                                      <label class="custom-control-label" for="lie4">最近登录</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="6" class="custom-control-input" id="lie5">
+                                                      <label class="custom-control-label" for="lie5">最近使用</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="7" class="custom-control-input" id="lie6">
+                                                      <label class="custom-control-label" for="lie6">登录时长</label>
+                                                    </div>
+                                                  </li>
+                                                  <li class="mb-2">
+                                                    <div class="custom-control custom-switch">
+                                                      <input type="checkbox" name="columnShow" column="8" class="custom-control-input" id="lie7">
+                                                      <label class="custom-control-label" for="lie7">注册时间</label>
+                                                    </div>
+                                                  </li>
+                                                </ul>
+                                              </div>
+                                          </div>
+                                          
+                                          
+                                          <div class="col-auto pl-0">
+                                            <button class="btn btn-sm btn-default" data-toggle="dropdown"><i class="fal fa-sort-amount-down"></i> 排序</button>
+                                            <div class="dropdown-menu dropdown-menu-right"  id="paixu">
+                                              <ul class="list-unstyled px-3 pt-2 mb-0">
+                                                <li class="mb-2">
+                                                  <div class="custom-control custom-radio">
+                                                    <input type="radio" <% if( sortList[0] == 'latest_login') {  %>  checked  <% }; %>
+                                                     class="custom-control-input" id="pai1" data="latest_login" name="sortField" >
+                                                    <label class="custom-control-label" for="pai1">最近登录</label>
+                                                  </div>
+                                                </li>
+                                                <li class="mb-2">
+                                                  <div class="custom-control custom-radio">
+                                                    <input type="radio" <% if( sortList[0] == 'create_time') {  %>  checked  <% }; %>
+                                                     class="custom-control-input" id="pai3" data="addtime" name="sortField">
+                                                    <label class="custom-control-label" for="pai3">注册时间</label>
+                                                  </div>
+                                                </li>
+                                              </ul>
+                                              <ul class="list-unstyled px-3 pt-2 mb-0 border-top">
+                                                <li class="mb-2">
+                                                  <div class="custom-control custom-radio">
+                                                    <input type="radio" <% if( sortList[1] == -1) {  %>  checked  <% }; %>
+                                                     class="custom-control-input" id="pdown" data="-1" name="sort" >
+                                                    <label class="custom-control-label" for="pdown">降序</label>
+                                                  </div>
+                                                </li>
+                                                <li class="mb-2">
+                                                  <div class="custom-control custom-radio">
+                                                    <input type="radio" <% if( sortList[1] == 1) {  %>  checked  <% }; %>
+                                                     class="custom-control-input" id="pup" data="1" name="sort">
+                                                    <label class="custom-control-label" for="pup">升序</label>
+                                                  </div>
+                                                </li>
+                                              </ul>
+                                            </div>
+                                          </div>
+                                
+                                
+                                
+                                
+                            </div>
+                            <div class="panel-container " >
+                                <div class="panel-content" >
+                                    <div curingListBox>
+                                    <table columnShow class="table table-bordered table-hover table-striped">
+                                        <thead><tr><th>通行账号</th>
+                                        	<th>QQ</th>
+                                            <th>企业名称</th>
+                                            <th>CLD客户</th>
+                                            <th>公司</th>
+                                            <th>最近登录</th>
+                                            <th>最近使用</th>
+                                            <th>登录时长</th>
+                                            <th>注册时间</th>
+                                            <th>已升级专业版</th>
+                                            </tr></thead>
+                                        <tbody curingUser >
+                                        <% curingList.forEach(function(curing) { %>
+                                        <tr curingInfoEdi dataCid="<%= curing.client_id %>" data="<%= curing.ssoId %>" dataId="<%= curing._id %>"
+                                         data-toggle="modal" data-target="">
+                                            <td><%= curing.mobile %> </td>
+                                            <td><%= curing.qq %></td>
+                                            <td><%= curing.company %></td>
+                                            <td><%= curing.clientInfo.clientname %></td>
+                                            <td><%= curing.clientInfo.companyname %></td>
+                                            
+                                            <td><%= curing.latest_login %></td>
+                                            <td><%= curing.latest_usedName %></td>
+                                            <td><%= curing.online_newest %></td>
+                                            <td><%= curing.addtime %></td>
+                                            <td><%- curing.upgradeListName %></td>
+                                        </tr>
+                                        <% }); %>
+
+                                        </tbody>
+                                    </table>
+                                    <!--翻页-->
+                                    <div page class="d-flex justify-content-center">
+                                    	<div pageDetail >
+                                        <ul  class="pagination pagination-sm">
+
+                                            <% if( pageData.previousPage == 0||pageData.previousPage==undefined) {  %>
+                                            <li class="page-item disabled">
+                                                <span class="page-link" aria-label="Previous">
+                                                    <span aria-hidden="true"><i class="fal fa-chevron-left"></i></span>
+                                                </span>
+                                            </li>
+                                            <% }else{ %>
+                                            <li class="page-item ">
+                                                <a parameter="<%= pageData.parameter %>" currentPage="<%= pageData.previousPage %>" class="page-link" href="javascript:void(0)" aria-label="Previous">
+                                                    <span aria-hidden="true"><i class="fal fa-chevron-left"></i></span>
+                                                </a>
+                                            </li>
+                                            <% }; %>
+
+						<% if( pageData.currentPage>=pageData.pageWidth ) {  %>
+								
+	  							<li class="page-item">
+                                   <a parameter="<%= pageData.parameter %>" currentPage="1" class="page-link" href="javascript:void(0)">1</a>
+                                </li>
+	  							<li class="page-item ">
+	                                                <span >
+	                                                    <span aria-hidden="true">...</span>
+	                                                </span>
+	                             </li>
+ 						<% }; %>
+
+                                            <% for (i = pageData.startPage; i <= pageData.endPage; i++) {  %>
+                                                <% if( pageData.currentPage == i) {  %>
+                                                <li class="page-item active" aria-current="page">
+                                                    <span class="page-link">
+                                                        <%= i %><span class="sr-only">(current)</span>
+                                                    </span>
+                                                </li>
+                                                <% }else{ %>
+                                                <li class="page-item">
+                                                    <a parameter="<%= pageData.parameter %>" currentPage="<%= i %>" class="page-link" href="javascript:void(0)"><%= i %></a>
+                                                </li>
+                                                <% }; %>
+                                            <% }; %>
+
+
+
+ 											<% if( pageData.totalPage >pageData.pageWidth && pageData.totalPage!= pageData.currentPage ) {  %>
+												<li class="page-item ">
+	                                                <span >
+	                                                    <span aria-hidden="true">...</span>
+	                                                </span>
+	                                            </li>
+											  <% }; %>
+
+                                            <% if( pageData.currentPage == pageData.nextPage) {  %>
+                                            <li class="page-item disabled">
+                                                <span class="page-link"  aria-label="Next">
+                                                    <span aria-hidden="true"><i class="fal fa-chevron-right"></i></span>
+                                                </span>
+                                            </li>
+                                            <% }else{ %>
+                                            <li class="page-item">
+                                                <a parameter="<%= pageData.parameter %>" currentPage="<%= pageData.nextPage %>" class="page-link" href="#" aria-label="Next"  >
+                                                    <span aria-hidden="true"><i class="fal fa-chevron-right"></i></span>
+                                                </a>
+                                            </li>
+                                            <% }; %>
+
+                                        </ul>
+                                        </div>
+                                    </div>
+                                    
+                                    
+                                    
+                                    
+                                    </div>
+                                    <!--已升级列表不存在-->
+                                    <p upClientBox class="text-center" style="display:none">已升级用户列表不存在&nbsp;"<b curingMobile ></b>"&nbsp;,您可以尝试<a href="#search-new" upClient class="btn btn-sm btn-outline-primary ml-3" data-toggle="modal" data-target="#search-new">升级新用户</a></p>
+                                </div>
+                            </div>
+
+
+                        </div>
+                    </div>
+                </div>
+            </main>
+            <!-- END Page Content -->
+        </div>
+    </div>
+</div>
+
+
+
+<!-- END Page Wrapper -->
+<!-- BEGIN 账号弹窗-->
+<div class="modal fade" id="detail" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+<input type="hidden" id="curingSsoid" value="">
+                        <input type="hidden" id="curingMobile" value="">
+                        <input type="hidden" id="client_id" value="">
+                        <input type="hidden" id="name" value="">
+                        <input type="hidden" id="_id" value="">
+    <div class="modal-dialog modal-xl">
+        <div class="modal-content">
+            <div class="dialog-sheet">
+                <button type="button" closeRefresh parameter="" currentPage=""  class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+                <div class="sheet-box row m-0">
+                    <div class="sheet-left-panel">
+                        <div class="sheet-panel-header d-flex justify-content-between mx-4">
+                            <div>
+                                <a href="#" data-toggle="tooltip" data-placement="top" title="" data-original-title="上一条记录" class="mr-2 disabled"><i class="fal fa-angle-up fa-2x"></i></a>
+                                <a href="#" data-toggle="tooltip" data-placement="top" title="" data-original-title="下一条记录"><i class="fal fa-angle-down fa-2x"></i></a>
+                            </div>
+                            <div></div>
+                        </div>
+                        <div class="sheet-panel-content">
+                            <div curingInfo class="sheet-panel-form slimScroll1 mx-4">
+                                <input type="hidden" name="id" id="id" value="">
+                                <curing>
+                                </curing>
+                                <curingClient>
+                                </curingClient>
+
+
+
+
+
+                            </div>
+                        </div>
+                    </div>
+                    <div class="sheet-right-panel col p-0">
+                        <div class="sheet-panel-tabs mx-4 mt-4">
+                            <ul class="nav nav-tabs sheet-nav-tabs" role="tablist">
+                                <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#tab-yun" role="tab" aria-selected="true">养护云造价</a></li>
+                                <li class="nav-item"><a class="nav-link " data-toggle="tab" href="#tab-online" role="tab" aria-selected="false">在线时长</a></li>
+                                <!-- <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-lock" role="tab" aria-selected="false">软件锁</a></li>
+                                <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-server" role="tab" aria-selected="false">服务记录</a></li> -->
+                            </ul>
+                            <div class="tab-content">
+                                <div class="tab-pane fade active show sheet-panel-righttop" id="tab-yun" role="tabpanel" aria-labelledby="tab-yun">
+                                    <div class="slimScrol3">
+                                        <table class="table">
+                                            <thead><tr><th class="border-0"></th><th class="border-0">产品</th><th class="border-0">专业版</th></tr></thead>
+                                            <tbody upMajorBox >
+
+                                            </tbody>
+
+                                        </table>
+                                    </div>
+                                </div>
+
+								<div class="tab-pane fade sheet-panel-righttop" id="tab-online" role="tabpanel" aria-labelledby="tab-server">
+                                            <div class="slimScrol3">
+                                                <table class="table">
+                                                    <thead><tr><th class="border-0"></th><th class="border-0">日期</th><th class="border-0">时长</th></tr></thead>
+                                                    <tbody onlineTimes>
+                                                    <tr><td width="20">1</td><td width="140">2019-02-03</td><td>3小时</td></tr>
+                                                    </tbody>
+                                                    
+                                                </table>
+                                                <p class="text-center text-muted">仅显示最近30天时长</p>
+                                            </div>
+                                        </div>
+
+
+                            </div>
+
+
+                            </div>
+
+                            <!--
+                            <div class="sheet-btns mt-3">
+                                <a href="#add-server" class="btn btn-xs btn-outline-primary" data-toggle="modal" data-target="#add-server"><i class="far fa-plus"></i> 添加服务记录</a>
+                                <a href="#add-lock" class="btn btn-xs btn-outline-primary" data-toggle="modal" data-target="#add-lock"><i class="far fa-link"></i> 绑定加密锁</a></div>
+                            </div>
+                            -->
+                        <div class="sheet-panel-record" operateLog >
+                            <ul class="nav nav-tabs nav-tabs-clean sheet-nav-tabs" role="tablist">
+                                <li class="nav-item ml-4"><a class="nav-link text-center active" data-toggle="tab" href="#tab-log" role="tab" aria-selected="true">日志</a></li>
+                            </ul>
+                            <div class="tab-content p-3">
+                                <div class="tab-pane fade active show sheet-panel-log" id="tab-log" role="tabpanel" aria-labelledby="tab-log">
+                                    <div class="slimScrol4">
+                                        <curingOperate></curingOperate>
+
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                    </div>
+
+
+                </div>
+            </div>
+        </div>
+    </div>
+        </div>
+
+
+
+
+
+
+</div>
+<!--BEGIN 关联CLD客户-->
+<div class="modal fade" id="linkcld" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content clearfix">
+            <div class="dialog-sheet">
+                <button type="button"  class="close"  data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+                <div class="m-4">
+                    <div class="input-group bg-white shadow-inset-2">
+                        <div class="input-group-prepend">
+                                    <span class="input-group-text bg-transparent border-right-0">
+                                        <i class="fal fa-search"></i>
+                                    </span>
+                        </div>
+                        <input type="text" getClentList class="form-control border-left-0 bg-transparent pl-0" placeholder="搜索客户">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-search-height border-top border-bottom">
+                <div relevanceClientDo searchClient class="slimScrol2 p-4 modal-search-result">
+                   <curingClient></curingClient>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+<!--BEGIN 关联单位-->
+<div class="modal fade" id="link-com" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content clearfix">
+            <div class="dialog-sheet">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+                <div class="m-4">
+                    <div class="input-group bg-white shadow-inset-2">
+                        <div class="input-group-prepend">
+                                    <span class="input-group-text bg-transparent border-right-0">
+                                        <i class="fal fa-search"></i>
+                                    </span>
+                        </div>
+                        <input type="text" class="form-control border-left-0 bg-transparent pl-0" placeholder="搜索单位">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-search-height border-top border-bottom">
+                <div class="slimScrol2 p-4 modal-search-result">
+                    <div class="card pointer-hover p-3 mb-3" data-toggle="tooltip" data-placement="bottom" title="点击关联该单位" data-original-title="点击关联该单位">
+                        <div class="row"><div class="col-7 pr-0">珠海纵横创新软件有限公司</div><div class="col-5 pr-0">广东省,珠海市,香洲区</div></div>
+                    </div>
+                </div>
+            </div>
+            <div class="m-4">
+                <a href="#" class="btn btn-sm btn-outline-primary"><i class="far fa-plus"></i> 添加新单位</a>
+            </div>
+        </div>
+    </div>
+</div>
+<!--BEGIN 检索云版客户-->
+<!-- <div class="modal fade" id="search-new" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content clearfix">
+            <div class="dialog-sheet">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+                <div class="m-4">
+                    <div class="input-group bg-white shadow-inset-2">
+                        <div class="input-group-prepend">
+                                    <span class="input-group-text bg-transparent border-right-0">
+                                        <i class="fal fa-search"></i>
+                                    </span>
+                        </div>
+                        <input type="text" fnSearchCuring class="form-control border-left-0 bg-transparent pl-0" placeholder="输入通行账号(手机)检索" value="">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-search-height border-top border-bottom "  >
+                <div class="slimScrol2 p-4 modal-search-result" >
+                    <div curingInfo class="card p-3 mb-3" upCuringBox style="display:none">
+                        
+
+                        <curing></curing>
+
+                        <table class="table">
+                            <thead>
+                            <tr>
+                                <th class="border-0"></th>
+                                <th class="border-0">产品</th>
+                                <th class="border-0">专业版</th>
+                            </tr>
+                            </thead>
+                            <tbody upMajorBox id="upMajorBox" >
+
+                            </tbody>
+                        </table>
+                    </div>
+                    没结果
+                    <p class="text-center" upCuringBox style="display:none">该号码未注册养护项目</p>
+                </div>
+            </div>
+        </div>
+    </div>
+</div> -->
+
+
+<!--BEGIN 升级确认-->
+<div class="modal fade" id="update-confirm" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-dialog-centered" >
+        <div class="modal-content">
+            <div class="modal-header">
+                <h4 class="modal-title">
+                    确认升级
+                </h4>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+            </div>
+            <div class="modal-body" upCuring>
+                <span></span>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary waves-effect waves-themed" data-dismiss="modal">关闭</button>
+                <button type="button" data-dismiss="modal" upCuringDo class="btn btn-primary waves-effect waves-themed">确认升级</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--BEGIN 移除单位确认-->
+<div class="modal fade" id="remover-com" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-dialog-centered">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h4 class="modal-title">
+                    确认移除
+                </h4>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+            </div>
+            <div class="modal-body">
+                为客户 <b>张三</b> 移除 <b>珠海纵横创新软件有限公司</b>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary waves-effect waves-themed" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary waves-effect waves-themed">确认移除</button>
+            </div>
+        </div>
+    </div>
+</div>
+
+<!--BEGIN 移除CLD客户-->
+<div class="modal fade" id="unlinkcld" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-dialog-centered">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h4 class="modal-title">
+                    确认移除
+                </h4>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+            </div>
+
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary waves-effect waves-themed" data-dismiss="modal">关闭</button>
+                <button type="button" relieveClientDo class="btn btn-primary waves-effect waves-themed">确认移除</button>
+            </div>
+        </div>
+    </div>
+</div>
+
+<!--BEGIN 添加服务记录-->
+<div class="modal fade" id="add-server" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-dialog-centered">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h4 class="modal-title">
+                    添加服务记录
+                </h4>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <div class="custom-control custom-radio custom-control-inline">
+                        <input type="radio" class="custom-control-input" id="defaultInline1Radio" name="inlineDefaultRadiosExample">
+                        <label class="custom-control-label" for="defaultInline1Radio">上门服务</label>
+                    </div>
+                    <div class="custom-control custom-radio custom-control-inline">
+                        <input type="radio" class="custom-control-input" id="defaultInline2Radio" name="inlineDefaultRadiosExample" checked="">
+                        <label class="custom-control-label" for="defaultInline2Radio">电话拜访</label>
+                    </div>
+                    <div class="custom-control custom-radio custom-control-inline">
+                        <input type="radio" class="custom-control-input" id="defaultInline3Radio" name="inlineDefaultRadiosExample" checked="">
+                        <label class="custom-control-label" for="defaultInline3Radio">其他事项</label>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label class="form-label" for="example-date">时间</label>
+                    <input class="form-control" id="example-date" type="date" name="date" value="">
+                </div>
+                <div class="form-group">
+                    <label class="form-label" for="example-date">内容</label>
+                    <textarea class="form-control" id="example-textarea" rows="3" placeholder="填写详细服务内容"> </textarea>
+                </div>
+                <div class="form-group">
+                    <div class="custom-control custom-switch">
+                        <input type="checkbox" class="custom-control-input" id="customSwitch2" checked="">
+                        <label class="custom-control-label" for="customSwitch2">添加提醒</label>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label class="form-label" for="example-date">提醒限期</label>
+                    <input class="form-control" id="example-date" type="date" name="date" value="">
+                </div>
+                <div class="form-group">
+                    <label class="form-label" for="example-date">备注</label>
+                    <textarea class="form-control" id="example-textarea" rows="1"> </textarea>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary waves-effect waves-themed" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary waves-effect waves-themed">确认添加</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--BEGIN 关联软件锁-->
+<div class="modal fade" id="add-lock" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content clearfix">
+            <div class="dialog-sheet">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true"><i class="fal fa-times"></i></span>
+                </button>
+                <div class="m-4 row">
+                    <div class="input-group bg-white shadow-inset-2 col-6 p-0">
+                        <div class="input-group-prepend">
+                                    <span class="input-group-text bg-transparent border-right-0">
+                                        <i class="fal fa-boxes"></i>
+                                    </span>
+                        </div>
+                        <select class="form-control" id="example-select">
+                            <option>不限产品</option>
+                            <option>全国专业</option>
+                            <option>全国标准</option>
+                            <option>全国招投标</option>
+                            <option>全国三算</option>
+                        </select>
+                    </div>
+                    <div class="input-group bg-white shadow-inset-2 col-6 pr-0">
+                        <div class="input-group-prepend">
+                                    <span class="input-group-text bg-transparent border-right-0">
+                                        <i class="fal fa-search"></i>
+                                    </span>
+                        </div>
+                        <input type="text" class="form-control border-left-0 bg-transparent pl-0" placeholder="搜索锁号">
+                    </div>
+                </div>
+            </div>
+            <div class="p-4 border-top d-flex justify-content-center">
+                <ul class="nav nav-pills" role="tablist">
+                    <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#">借出</a></li>
+                    <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#2">销售</a></li>
+                    <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#">赠送</a></li>
+                </ul>
+            </div>
+            <div class="modal-search-height border-top">
+                <div class="slimScrol2 p-4 modal-search-result">
+                    <div class="card pointer-hover p-3 mb-3" data-toggle="tooltip" data-placement="bottom" title="点击「借出」该锁" data-original-title="点击「借出」该锁">
+                        <div class="row"><div class="col-2 pr-0">ZH-03876</div><div class="col-7 pr-0">固化清单全功能+全国专业+全国专业(新定额)</div><div class="col-3 pr-0">2019-10-29 张三 接收</div></div>
+                    </div>
+                    <div class="card pointer-hover p-3 mb-3" data-toggle="tooltip" data-placement="bottom" title="点击「借出」该锁" data-original-title="点击「借出」该锁">
+                        <div class="row"><div class="col-2 pr-0">ZH-03877</div><div class="col-7 pr-0">固化清单全功能+全国专业+全国专业(新定额)</div><div class="col-3 pr-0">2019-10-29 张三 接收</div></div>
+                    </div>
+                    <div class="card pointer-hover p-3 mb-3" data-toggle="tooltip" data-placement="bottom" title="点击「借出」该锁" data-original-title="点击「借出」该锁">
+                        <div class="row"><div class="col-2 pr-0">ZH-03878</div><div class="col-7 pr-0">固化清单全功能+全国专业+全国专业(新定额)</div><div class="col-3 pr-0">2019-10-29 张三 接收</div></div>
+                    </div>
+                    <div class="card pointer-hover p-3 mb-3" data-toggle="tooltip" data-placement="bottom" title="点击「借出」该锁" data-original-title="点击「借出」该锁">
+                        <div class="row"><div class="col-2 pr-0">ZH-03879</div><div class="col-7 pr-0">固化清单全功能+全国专业+全国专业(新定额)</div><div class="col-3 pr-0">2019-10-29 张三 接收</div></div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+</body>
+
+
+<div autoHeight ></div>
+
+<% include ../footer.html %>

+ 2 - 2
views/cloud/cloudMenu.html

@@ -16,12 +16,12 @@
             </a>
             <ul>
                 <li class="active" >
-                    <a href="/cloud/curing/edition" title="Analytics Dashboard" data-filter-tags="application intel analytics dashboard">
+                    <a href="/cloud/curing/edition" title="养护云造价" data-filter-tags="application intel analytics dashboard">
                         <span class="nav-link-text">养护云造价</span>
                     </a>
                 </li>
                 <li  >
-                    <a href="/cloud/building/edition" title="Marketing Dashboard" data-filter-tags="application intel marketing dashboard">
+                    <a href="/cloud/build/edition" title="大司空云计价" data-filter-tags="application intel marketing dashboard">
                         <span class="nav-link-text">大司空云计价</span>
                     </a>
                 </li>

+ 1 - 1
views/cloud/curing.html

@@ -7,7 +7,7 @@
 <script src="<%= WEB_SITE_GLOBAL %>js/jquery-3.4.1.min.js"></script>
 
 <script src="<%= WEB_SITE_GLOBAL %>js/contacts/buildHtml.js"></script>
-<script src="<%= WEB_SITE_GLOBAL %>js/cloud/buildHtml.js"></script>
+<script src="<%= WEB_SITE_GLOBAL %>js/cloud/curingHtml.js"></script>
 
 <script src="<%= WEB_SITE_GLOBAL %>js/contacts/client.js"></script>
 <script src="<%= WEB_SITE_GLOBAL %>js/cloud/curing.min.js"></script>

文件差異過大導致無法顯示
+ 0 - 1191
views/cloud/t2.html