|
@@ -10,6 +10,11 @@ const hash=require('../class/hash');
|
|
|
var curingUrl ="https://yhuat.smartcost.com.cn/cld"; //'https://yhyun.smartcost.com.cn/cld';
|
|
|
var buildUrl = 'https://yun.smartcost.com.cn/cld';
|
|
|
|
|
|
+/**
|
|
|
+ * 分页相关数据计算
|
|
|
+ * modelsTable 数据表对象
|
|
|
+ * parameter 设置传的参数
|
|
|
+ */
|
|
|
var getPage= async function(modelsTable,where,currentPage,pageSize,parameter){
|
|
|
var totalCount=await modelsTable.count();
|
|
|
currentPage=parseInt(currentPage);
|
|
@@ -31,9 +36,27 @@ var getPage= async function(modelsTable,where,currentPage,pageSize,parameter){
|
|
|
|
|
|
var cloudService={
|
|
|
|
|
|
- //获得养护列表
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得养护列表
|
|
|
+ * compilation_id 编办ID
|
|
|
+ */
|
|
|
getCuringList: async function(compilation_id,page=1){
|
|
|
- var limit=12;
|
|
|
+
|
|
|
+ //获得远程养护用户
|
|
|
+ //数据组合
|
|
|
+ var cid=[];
|
|
|
+ curingList.forEach(function(v,i){
|
|
|
+ cid.push(v.client_id);
|
|
|
+ });
|
|
|
+ var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
|
|
|
+ var clientList = await models.CLD_client.findAllInCid(cid,attributes);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //获得本地用户
|
|
|
+ var limit=12;
|
|
|
var offset=0;
|
|
|
if(page!=1){
|
|
|
var pg=page-1;
|
|
@@ -51,14 +74,12 @@ var cloudService={
|
|
|
var curingList = await models.cloud_curing.findAll(option);
|
|
|
var parameter='?compilation_id='+compilation_id;
|
|
|
var pageData = await getPage(models.cloud_curing,option.where,page,limit,parameter);
|
|
|
- //数据组合
|
|
|
- var cid=[];
|
|
|
- curingList.forEach(function(v,i){
|
|
|
- cid.push(v.client_id);
|
|
|
- });
|
|
|
- var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
|
|
|
- var clientList = await models.CLD_client.findAllInCid(cid,attributes);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+ //组合页面需要展示的数据
|
|
|
curingList.forEach(function(v,i){
|
|
|
curingList[i].clientInfo={};
|
|
|
clientList.forEach(function(clientVal,clientI){
|