Authored by 袁晋鹏

fix:工作日志厂商加载不出来的问题修改,cmdb厂商。机房信息加载优化

Showing 33 changed files with 508 additions and 227 deletions
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('bizupgrade', function () { 11 exports('bizupgrade', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var timeChart = echarts.init(document.getElementById('bizupgrade-chart-time-record')); 14 var timeChart = echarts.init(document.getElementById('bizupgrade-chart-time-record'));
15 var inspIsLoad = false; 15 var inspIsLoad = false;
@@ -144,17 +144,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -144,17 +144,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
144 field: 'upgradePerson', title: '升级人', align: 'center', 144 field: 'upgradePerson', title: '升级人', align: 'center',
145 },{ 145 },{
146 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { 146 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  147 + var manufacturerName = '';
147 if(d.manufacturerId == '0'){ 148 if(d.manufacturerId == '0'){
148 - return d.manufacturerOther; 149 + manufacturerName = d.manufacturerOther;
149 }else { 150 }else {
150 if(manufactureArr && manufactureArr.length>0){ 151 if(manufactureArr && manufactureArr.length>0){
151 $.each(manufactureArr, function (i, v) { 152 $.each(manufactureArr, function (i, v) {
152 if(d.manufacturerId==v.id) { 153 if(d.manufacturerId==v.id) {
153 - return v.name; 154 + manufacturerName = v.name;
154 } 155 }
155 }) 156 })
  157 + }else{
  158 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  159 + $.ajax({
  160 + url: url,
  161 + success: function(res){
  162 + if(res.data.cmdbSupplier){
  163 + manufacturerName = res.data.cmdbSupplier.shortName;
156 } 164 }
157 } 165 }
  166 + });
  167 + }
  168 + }
  169 + return manufacturerName;
158 } 170 }
159 },{ 171 },{
160 field: 'upgradePhone', title: '升级人电话', align: 'center', 172 field: 'upgradePhone', title: '升级人电话', align: 'center',
@@ -222,17 +234,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -222,17 +234,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
222 field: 'upgradePerson', title: '升级人', align: 'center', 234 field: 'upgradePerson', title: '升级人', align: 'center',
223 },{ 235 },{
224 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { 236 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  237 + var manufacturerName = '';
225 if(d.manufacturerId == '0'){ 238 if(d.manufacturerId == '0'){
226 - return d.manufacturerOther; 239 + manufacturerName = d.manufacturerOther;
227 }else { 240 }else {
228 if(manufactureArr && manufactureArr.length>0){ 241 if(manufactureArr && manufactureArr.length>0){
229 $.each(manufactureArr, function (i, v) { 242 $.each(manufactureArr, function (i, v) {
230 if(d.manufacturerId==v.id) { 243 if(d.manufacturerId==v.id) {
231 - return v.name; 244 + manufacturerName = v.name;
232 } 245 }
233 }) 246 })
  247 + }else{
  248 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  249 + $.ajax({
  250 + url: url,
  251 + success: function(res){
  252 + if(res.data.cmdbSupplier){
  253 + manufacturerName = res.data.cmdbSupplier.shortName;
234 } 254 }
235 } 255 }
  256 + });
  257 + }
  258 + }
  259 + return manufacturerName;
236 } 260 }
237 },{ 261 },{
238 field: 'upgradePhone', title: '升级人电话', align: 'center', 262 field: 'upgradePhone', title: '升级人电话', align: 'center',
@@ -283,20 +307,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -283,20 +307,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
283 common.bizTypeSelect("slt-bizupgrade-biz", function () { 307 common.bizTypeSelect("slt-bizupgrade-biz", function () {
284 form.render("select"); 308 form.render("select");
285 }); 309 });
286 - admin.req({  
287 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
288 - }).done(function (response) {  
289 - var options = "<option value=''>=升级单位=</option>";  
290 - $.each(response.data, function (i, v) { 310 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  311 + $.ajax({
  312 + url: url,
  313 + success: function (res) {
  314 + var options = "<option value=''>=工作单位=</option>";
  315 + $.each(res.data, function (i, v) {
291 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 316 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
292 var obj = {}; 317 var obj = {};
293 - obj[id] = v.id;  
294 - obj[name] = v.shortName; 318 + obj.id = v.id;
  319 + obj.name = v.shortName;
295 manufactureArr.push(obj); 320 manufactureArr.push(obj);
296 }); 321 });
297 options += "<option value='0'>其他</option>"; 322 options += "<option value='0'>其他</option>";
298 $('#slt-bizupgrade-group').html(options); 323 $('#slt-bizupgrade-group').html(options);
299 form.render(); 324 form.render();
  325 + }
300 }); 326 });
301 } 327 }
302 $("#bizupgrade-export-excel").on('click', function () { 328 $("#bizupgrade-export-excel").on('click', function () {
@@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
14 14
15 //对外暴露的接口 15 //对外暴露的接口
16 exports('bizupgradeAdd', function (data) { 16 exports('bizupgradeAdd', function (data) {
17 - var accessToken = localStorage.getItem("accessToken"); 17 + var accessToken = common.getMjToken();
18 var userSelect = ""; 18 var userSelect = "";
19 var currentDate = {} 19 var currentDate = {}
20 var hitDate = {} 20 var hitDate = {}
@@ -115,17 +115,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -115,17 +115,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
115 form.render("select"); 115 form.render("select");
116 116
117 }); 117 });
118 - admin.req({  
119 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
120 - }).done(function (response) { 118 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  119 + $.ajax({
  120 + url: url,
  121 + success: function (res) {
121 var options = "<option value=''>=工作单位=</option>"; 122 var options = "<option value=''>=工作单位=</option>";
122 - $.each(response.data, function (i, v) { 123 + $.each(res.data, function (i, v) {
123 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 124 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
124 }); 125 });
125 options += "<option value='0'>其他</option>"; 126 options += "<option value='0'>其他</option>";
126 $('#slt-upgradeadd-group').html(options); 127 $('#slt-upgradeadd-group').html(options);
127 form.render(); 128 form.render();
128 fromAssignment(); 129 fromAssignment();
  130 + }
129 }); 131 });
130 132
131 } 133 }
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("bizupgradeList", function (d) { 13 exports("bizupgradeList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#attachmentTable').show() 16 $('#attachmentTable').show()
17 createAttachmentTable() 17 createAttachmentTable()
@@ -9,10 +9,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' @@ -9,10 +9,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate'
9 var session = layui.sessions; 9 var session = layui.sessions;
10 var laydate = layui.laydate; 10 var laydate = layui.laydate;
11 11
12 - var domainName = common.domainName; 12 + var domainName = common.domainName;;
13 //对外暴露的接口 13 //对外暴露的接口
14 exports('deviceAdd', function (data) { 14 exports('deviceAdd', function (data) {
15 - var accessToken = localStorage.getItem("accessToken"); 15 + var accessToken = common.getMjToken();
  16 + //机房cmdb配置项类id
  17 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
16 var enterTime = {}; 18 var enterTime = {};
17 var outTime = {}; 19 var outTime = {};
18 var devicesBak = []; 20 var devicesBak = [];
@@ -241,29 +243,32 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' @@ -241,29 +243,32 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate'
241 loadSelect() 243 loadSelect()
242 initDatePlus() 244 initDatePlus()
243 } 245 }
244 -  
245 // 初始化下拉框 246 // 初始化下拉框
246 function loadSelect() { 247 function loadSelect() {
247 - admin.req({  
248 - url: domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=2BB920718F284CB38A2911BFAE5A97D'  
249 - }).done(function (response) { 248 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&accessToken='+accessToken
  249 + $.ajax({
  250 + url: url,
  251 + success: function(res) {
250 var options = "<option value=''>=归属机房=</option>"; 252 var options = "<option value=''>=归属机房=</option>";
251 - $.each(response.data, function (i, v) { 253 + $.each(res.data, function (i, v) {
252 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 254 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
253 }); 255 });
254 $('#slt-staffadd-machine').html(options); 256 $('#slt-staffadd-machine').html(options);
255 form.render(); 257 form.render();
  258 + }
256 }); 259 });
257 - admin.req({  
258 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
259 - }).done(function (response) { 260 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  261 + $.ajax({
  262 + url: url,
  263 + success: function (res) {
260 var options = "<option value=''>=工作单位=</option>"; 264 var options = "<option value=''>=工作单位=</option>";
261 - $.each(response.data, function (i, v) { 265 + $.each(res.data, function (i, v) {
262 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 266 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
263 }); 267 });
264 options += "<option value='0'>其他</option>"; 268 options += "<option value='0'>其他</option>";
265 $('#slt-staffadd-group').html(options); 269 $('#slt-staffadd-group').html(options);
266 form.render(); 270 form.render();
  271 + }
267 }); 272 });
268 } 273 }
269 274
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("deviceList", function (d) { 13 exports("deviceList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 createDeviceTable() 15 createDeviceTable()
16 function dateForm(time) { 16 function dateForm(time) {
17 var unixTimestamp = new Date(time); 17 var unixTimestamp = new Date(time);
@@ -9,7 +9,9 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,9 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('devicehitch', function () { 11 exports('devicehitch', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
  13 + //机房cmdb配置项类id
  14 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
13 var domainName = common.domainName; 15 var domainName = common.domainName;
14 var orgChart = echarts.init(document.getElementById('chart-devicehitch-report')); 16 var orgChart = echarts.init(document.getElementById('chart-devicehitch-report'));
15 var dateLimit = ""; 17 var dateLimit = "";
@@ -114,13 +116,25 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -114,13 +116,25 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
114 templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-devicehitch-title" >{{d.title}}</span></div>' 116 templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-devicehitch-title" >{{d.title}}</span></div>'
115 }, { 117 }, {
116 field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) { 118 field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) {
  119 + var machineRoomName = '';
117 if(machineArr && machineArr.length>0){ 120 if(machineArr && machineArr.length>0){
118 $.each(machineArr, function (i, v) { 121 $.each(machineArr, function (i, v) {
119 if(d.machineRoomId==v.id) { 122 if(d.machineRoomId==v.id) {
120 - return v.name; 123 + machineRoomName = v.name;
121 } 124 }
122 }) 125 })
  126 + }else {
  127 + var url =domainName +'/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&id='+d.machineRoomId+'&accessToken='+accessToken
  128 + $.ajax({
  129 + url: url,
  130 + success: function(res){
  131 + $.each(res.data, function (i, v) {
  132 + machineRoomName = v.shortName;
  133 + });
  134 + }
  135 + });
123 } 136 }
  137 + return machineRoomName;
124 } 138 }
125 }, { 139 }, {
126 field: 'deviceTypeName', title: '设备类型', align: 'center',width:88 140 field: 'deviceTypeName', title: '设备类型', align: 'center',width:88
@@ -201,6 +215,20 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -201,6 +215,20 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
201 215
202 // 加载查询条件下拉框 216 // 加载查询条件下拉框
203 function loadConditionSelect() { 217 function loadConditionSelect() {
  218 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&accessToken='+accessToken
  219 + $.ajax({
  220 + url: url,
  221 + success: function(res){
  222 + var options = "<option value=''>=归属机房=</option>";
  223 + $.each(res.data, function (i, v) {
  224 + options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
  225 + var obj = {};
  226 + obj.id = v.id;
  227 + obj.name = v.shortName;
  228 + machineArr.push(obj);
  229 + });
  230 + }
  231 + });
204 admin.req({ 232 admin.req({
205 url: domainName + '/api-web/bResource/getInfoByAssetsType', 233 url: domainName + '/api-web/bResource/getInfoByAssetsType',
206 }).done(function (response) { 234 }).done(function (response) {
@@ -14,7 +14,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -14,7 +14,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
14 14
15 //对外暴露的接口 15 //对外暴露的接口
16 exports('devicehitchAdd', function (data) { 16 exports('devicehitchAdd', function (data) {
17 - var accessToken = localStorage.getItem("accessToken"); 17 + var accessToken = common.getMjToken();
  18 + //机房cmdb配置项类id
  19 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
18 var userSelect = ""; 20 var userSelect = "";
19 var currentDate = {} 21 var currentDate = {}
20 var applyDate = {} 22 var applyDate = {}
@@ -120,28 +122,32 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -120,28 +122,32 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
120 form.render(); 122 form.render();
121 123
122 }); 124 });
123 - admin.req({  
124 - url: domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=2BB920718F284CB38A2911BFAE5A97D'  
125 - }).done(function (response) { 125 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&accessToken='+accessToken
  126 + $.ajax({
  127 + url: url,
  128 + success: function(res) {
126 var options = "<option value=''>=归属机房=</option>"; 129 var options = "<option value=''>=归属机房=</option>";
127 - $.each(response.data, function (i, v) { 130 + $.each(res.data, function (i, v) {
128 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 131 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
129 }); 132 });
130 $('#slt-devicehitch-machine').html(options); 133 $('#slt-devicehitch-machine').html(options);
131 form.render(); 134 form.render();
132 - fromAssignment() 135 + fromAssignment();
  136 + }
133 }); 137 });
134 - admin.req({  
135 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
136 - }).done(function (response) { 138 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  139 + $.ajax({
  140 + url: url,
  141 + success: function (res) {
137 var options = "<option value=''>=工作单位=</option>"; 142 var options = "<option value=''>=工作单位=</option>";
138 - $.each(response.data, function (i, v) { 143 + $.each(res.data, function (i, v) {
139 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 144 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
140 }); 145 });
141 options += "<option value='0'>其他</option>"; 146 options += "<option value='0'>其他</option>";
142 $('#slt-discoverMfId-group').html(options); 147 $('#slt-discoverMfId-group').html(options);
143 $('#slt-repairMfId-group').html(options); 148 $('#slt-repairMfId-group').html(options);
144 form.render(); 149 form.render();
  150 + }
145 }); 151 });
146 152
147 } 153 }
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("devicehitchList", function (d) { 13 exports("devicehitchList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#attachmentTable').show() 16 $('#attachmentTable').show()
17 17
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('emergency', function () { 11 exports('emergency', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var timeChart = echarts.init(document.getElementById('emergency-chart-time-record')); 14 var timeChart = echarts.init(document.getElementById('emergency-chart-time-record'));
15 var inspIsLoad = false; 15 var inspIsLoad = false;
@@ -17,7 +17,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -17,7 +17,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
17 var currSelect = 0; 17 var currSelect = 0;
18 var dateLimit = "" 18 var dateLimit = ""
19 var createTime = "month" 19 var createTime = "month"
20 - 20 + var manufactureArr = [];
21 21
22 //日期范围选择 22 //日期范围选择
23 laydate.render({ 23 laydate.render({
@@ -148,12 +148,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -148,12 +148,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
148 }, { 148 }, {
149 field: 'operationUser', title: '运维人', align: 'center', 149 field: 'operationUser', title: '运维人', align: 'center',
150 }, { 150 }, {
151 - field: 'manufacturerName', title: '所属单位', align: 'center', templet: function (d) {  
152 - if (d.manufacturerId == '0') {  
153 - return '其他';  
154 - } else {  
155 - return d.manufacturerName; 151 + field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  152 + var manufacturerName = '';
  153 + if(d.manufacturerId == '0'){
  154 + manufacturerName = d.manufacturerOther;
  155 + }else {
  156 + if(manufactureArr && manufactureArr.length>0){
  157 + $.each(manufactureArr, function (i, v) {
  158 + if(d.manufacturerId==v.id) {
  159 + manufacturerName = v.name;
156 } 160 }
  161 + })
  162 + }else{
  163 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  164 + $.ajax({
  165 + url: url,
  166 + success: function(res){
  167 + if(res.data.cmdbSupplier){
  168 + manufacturerName = res.data.cmdbSupplier.shortName;
  169 + }
  170 + }
  171 + });
  172 + }
  173 + }
  174 + return manufacturerName;
157 } 175 }
158 }, { 176 }, {
159 field: 'mphone', title: '运维电话', align: 'center', 177 field: 'mphone', title: '运维电话', align: 'center',
@@ -220,13 +238,31 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -220,13 +238,31 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
220 }, { 238 }, {
221 field: 'operationUser', title: '运维人', align: 'center', 239 field: 'operationUser', title: '运维人', align: 'center',
222 }, { 240 }, {
223 - field: 'manufacturerName', title: '所属单位', align: 'center', templet: function (d) {  
224 - if (d.manufacturerId == '0') {  
225 - return '其他';  
226 - } else {  
227 - return d.manufacturerName; 241 + field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  242 + var manufacturerName = '';
  243 + if(d.manufacturerId == '0'){
  244 + manufacturerName = d.manufacturerOther;
  245 + }else {
  246 + if(manufactureArr && manufactureArr.length>0){
  247 + $.each(manufactureArr, function (i, v) {
  248 + if(d.manufacturerId==v.id) {
  249 + manufacturerName = v.name;
  250 + }
  251 + })
  252 + }else{
  253 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  254 + $.ajax({
  255 + url: url,
  256 + success: function(res){
  257 + if(res.data.cmdbSupplier){
  258 + manufacturerName = res.data.cmdbSupplier.shortName;
  259 + }
  260 + }
  261 + });
228 } 262 }
229 } 263 }
  264 + return manufacturerName;
  265 + }
230 }, { 266 }, {
231 field: 'mphone', title: '运维电话', align: 'center', 267 field: 'mphone', title: '运维电话', align: 'center',
232 }, { 268 }, {
@@ -318,16 +354,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -318,16 +354,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
318 common.bizTypeSelect("slt-emergency-biz", function () { 354 common.bizTypeSelect("slt-emergency-biz", function () {
319 form.render("select"); 355 form.render("select");
320 }); 356 });
321 - admin.req({  
322 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
323 - }).done(function (response) {  
324 - var options = "<option value=''>=运维单位=</option>";  
325 - $.each(response.data, function (i, v) { 357 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  358 + $.ajax({
  359 + url: url,
  360 + success: function (res) {
  361 + var options = "<option value=''>=工作单位=</option>";
  362 + $.each(res.data, function (i, v) {
326 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 363 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
  364 + var obj = {};
  365 + obj.id = v.id;
  366 + obj.name = v.shortName;
  367 + manufactureArr.push(obj);
327 }); 368 });
328 options += "<option value='0'>其他</option>"; 369 options += "<option value='0'>其他</option>";
329 $('#slt-emergency-group').html(options); 370 $('#slt-emergency-group').html(options);
330 form.render(); 371 form.render();
  372 + }
331 }); 373 });
332 } 374 }
333 375
@@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
14 14
15 //对外暴露的接口 15 //对外暴露的接口
16 exports('emergencyAdd', function (data) { 16 exports('emergencyAdd', function (data) {
17 - var accessToken = localStorage.getItem("accessToken"); 17 + var accessToken = common.getMjToken();
18 var userSelect = ""; 18 var userSelect = "";
19 var currentDate = {} 19 var currentDate = {}
20 var hitDate = {} 20 var hitDate = {}
@@ -174,17 +174,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -174,17 +174,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
174 common.bizTypeSelect("slt-biz-add", function () { 174 common.bizTypeSelect("slt-biz-add", function () {
175 form.render("select"); 175 form.render("select");
176 }); 176 });
177 - admin.req({  
178 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
179 - }).done(function (response) {  
180 - var options = "<option value=''>=运维公司=</option>";  
181 - $.each(response.data, function (i, v) { 177 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  178 + $.ajax({
  179 + url: url,
  180 + success: function (res) {
  181 + var options = "<option value=''>=工作单位=</option>";
  182 + $.each(res.data, function (i, v) {
182 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 183 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
183 }); 184 });
184 options += "<option value='0'>其他</option>"; 185 options += "<option value='0'>其他</option>";
185 $('#slt-emergencyadd-group').html(options); 186 $('#slt-emergencyadd-group').html(options);
186 form.render(); 187 form.render();
187 fromAssignment(); 188 fromAssignment();
  189 + }
188 }); 190 });
189 191
190 } 192 }
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("emergencyList", function (d) { 13 exports("emergencyList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#attachmentTable').show() 16 $('#attachmentTable').show()
17 17
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('enterDevice', function () { 11 exports('enterDevice', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var timeChart = echarts.init(document.getElementById('device-chart-time-record')); 14 var timeChart = echarts.init(document.getElementById('device-chart-time-record'));
15 var inspIsLoad = false; 15 var inspIsLoad = false;
@@ -19,15 +19,16 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -19,15 +19,16 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
19 var createTime = "month" 19 var createTime = "month"
20 var manufactureArr = []; 20 var manufactureArr = [];
21 var machineArr = []; 21 var machineArr = [];
22 - 22 + //机房cmdb配置项类id
  23 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
23 //日期范围选择 24 //日期范围选择
24 laydate.render({ 25 laydate.render({
25 elem: '#devicedateLimit' 26 elem: '#devicedateLimit'
26 - ,range: '~', 27 + , range: '~',
27 trigger: 'click', 28 trigger: 'click',
28 - ready: function(date){ 29 + ready: function (date) {
29 $("#devicedateLimit").removeAttr("lay-key"); 30 $("#devicedateLimit").removeAttr("lay-key");
30 - $(this).attr("lay-key","1"); 31 + $(this).attr("lay-key", "1");
31 }, 32 },
32 done: function (value) { 33 done: function (value) {
33 dateLimit = value 34 dateLimit = value
@@ -101,6 +102,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -101,6 +102,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
101 } 102 }
102 currSelect = data.index; 103 currSelect = data.index;
103 }); 104 });
  105 +
104 // 加载配件更换表格 106 // 加载配件更换表格
105 function renderEnterDeviceListTable() { 107 function renderEnterDeviceListTable() {
106 var conditions = form.val('form-enterStaff-condition'); 108 var conditions = form.val('form-enterStaff-condition');
@@ -127,27 +129,53 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -127,27 +129,53 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
127 limits: common.limits, 129 limits: common.limits,
128 even: true, 130 even: true,
129 cols: [[ 131 cols: [[
130 - {type: 'checkbox'},{  
131 - field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) {  
132 - if(machineArr && machineArr.length>0){ 132 + {type: 'checkbox'}, {
  133 + field: 'machineRoomName', title: '机房', align: 'center', templet: function (d) {
  134 + var machineRoomName = '';
  135 + if (machineArr && machineArr.length > 0) {
133 $.each(machineArr, function (i, v) { 136 $.each(machineArr, function (i, v) {
134 - if(d.machineRoomId==v.id){}  
135 - return v.name; 137 + if (d.machineRoomId == v.id) {
  138 + machineRoomName = v.name;
  139 + }
136 }) 140 })
  141 + } else {
  142 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=' + objectId + '&id=' + d.machineRoomId + '&accessToken=' + accessToken
  143 + $.ajax({
  144 + url: url,
  145 + success: function (res) {
  146 + $.each(res.data, function (i, v) {
  147 + machineRoomName = v.shortName;
  148 + });
137 } 149 }
  150 + });
  151 + }
  152 + return machineRoomName;
138 } 153 }
139 }, { 154 }, {
140 - field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {  
141 - if(d.manufacturerId == '0'){  
142 - return d.manufacturerOther;  
143 - }else {  
144 - if(manufactureArr && manufactureArr.length>0){ 155 + field: 'manufacturerName', title: '工作单位', align: 'center', templet: function (d) {
  156 + var manufacturerName = '';
  157 + if (d.manufacturerId == '0') {
  158 + manufacturerName = d.manufacturerOther;
  159 + } else {
  160 + if (manufactureArr && manufactureArr.length > 0) {
145 $.each(manufactureArr, function (i, v) { 161 $.each(manufactureArr, function (i, v) {
146 - if(d.manufacturerId==v.id){}  
147 - return v.name; 162 + if (d.manufacturerId == v.id) {
  163 + manufacturerName = v.name;
  164 + }
148 }) 165 })
  166 + } else {
  167 + var url = domainName + '/cmdb-CI/supplier/find/' + d.manufacturerId + '?accessToken=' + accessToken
  168 + $.ajax({
  169 + url: url,
  170 + success: function (res) {
  171 + if (res.data.cmdbSupplier) {
  172 + manufacturerName = res.data.cmdbSupplier.shortName;
  173 + }
  174 + }
  175 + });
149 } 176 }
150 } 177 }
  178 + return manufacturerName;
151 } 179 }
152 }, { 180 }, {
153 field: 'applyUser', title: '申请人', align: 'center', 181 field: 'applyUser', title: '申请人', align: 'center',
@@ -204,6 +232,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -204,6 +232,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
204 } 232 }
205 }); 233 });
206 } 234 }
  235 +
207 // 加载设备出入表格 236 // 加载设备出入表格
208 function renderFittingFixListTable() { 237 function renderFittingFixListTable() {
209 var conditions = form.val('form-enterStaff-condition'); 238 var conditions = form.val('form-enterStaff-condition');
@@ -229,29 +258,53 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -229,29 +258,53 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
229 limit: common.limit, 258 limit: common.limit,
230 limits: common.limits, 259 limits: common.limits,
231 even: true, 260 even: true,
232 - cols: [[ {type: 'checkbox'},{  
233 - field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) {  
234 - if(machineArr && machineArr.length>0){ 261 + cols: [[{type: 'checkbox'}, {
  262 + field: 'machineRoomName', title: '机房', align: 'center', templet: function (d) {
  263 + var machineRoomName = '';
  264 + if (machineArr && machineArr.length > 0) {
235 $.each(machineArr, function (i, v) { 265 $.each(machineArr, function (i, v) {
236 - if(d.machineRoomId==v.id) {  
237 - return v.name; 266 + if (d.machineRoomId == v.id) {
  267 + machineRoomName = v.name;
238 } 268 }
239 }) 269 })
  270 + } else {
  271 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=' + objectId + '&id=' + d.machineRoomId + '&accessToken=' + accessToken
  272 + $.ajax({
  273 + url: url,
  274 + success: function (res) {
  275 + $.each(res.data, function (i, v) {
  276 + machineRoomName = v.shortName;
  277 + });
240 } 278 }
  279 + });
  280 + }
  281 + return machineRoomName;
241 } 282 }
242 }, { 283 }, {
243 - field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {  
244 - if(d.manufacturerId == '0'){  
245 - return d.manufacturerOther;  
246 - }else {  
247 - if(manufactureArr && manufactureArr.length>0){ 284 + field: 'manufacturerName', title: '工作单位', align: 'center', templet: function (d) {
  285 + var manufacturerName = '';
  286 + if (d.manufacturerId == '0') {
  287 + manufacturerName = d.manufacturerOther;
  288 + } else {
  289 + if (manufactureArr && manufactureArr.length > 0) {
248 $.each(manufactureArr, function (i, v) { 290 $.each(manufactureArr, function (i, v) {
249 - if(d.manufacturerId==v.id) {  
250 - return v.name; 291 + if (d.manufacturerId == v.id) {
  292 + manufacturerName = v.name;
251 } 293 }
252 }) 294 })
  295 + } else {
  296 + var url = domainName + '/cmdb-CI/supplier/find/' + d.manufacturerId + '?accessToken=' + accessToken
  297 + $.ajax({
  298 + url: url,
  299 + success: function (res) {
  300 + if (res.data.cmdbSupplier) {
  301 + manufacturerName = res.data.cmdbSupplier.shortName;
  302 + }
  303 + }
  304 + });
253 } 305 }
254 } 306 }
  307 + return manufacturerName;
255 } 308 }
256 }, { 309 }, {
257 field: 'applyUser', title: '申请人', align: 'center', 310 field: 'applyUser', title: '申请人', align: 'center',
@@ -308,6 +361,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -308,6 +361,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
308 } 361 }
309 }); 362 });
310 } 363 }
  364 +
311 //新增日报 365 //新增日报
312 $('#device_create').on('click', function () { 366 $('#device_create').on('click', function () {
313 openDeviceForm() 367 openDeviceForm()
@@ -319,7 +373,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -319,7 +373,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
319 common.openWin('machineroom/deviceAdd', title, {id: id}, ['保存', '取消'], function f() { 373 common.openWin('machineroom/deviceAdd', title, {id: id}, ['保存', '取消'], function f() {
320 $("#device-form-save-id").trigger("click"); 374 $("#device-form-save-id").trigger("click");
321 reloadAllChange(); 375 reloadAllChange();
322 - },null,null,null,{end: reloadAllChange()}) 376 + }, null, null, null, {end: reloadAllChange()})
323 } 377 }
324 378
325 //查看更换配件列表 379 //查看更换配件列表
@@ -329,6 +383,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -329,6 +383,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
329 383
330 common.openWin('machineroom/fittingList', title, {id: id}, ['确定', '取消']) 384 common.openWin('machineroom/fittingList', title, {id: id}, ['确定', '取消'])
331 } 385 }
  386 +
332 //查看进出设备列表 387 //查看进出设备列表
333 function openDeviceList(id) { 388 function openDeviceList(id) {
334 389
@@ -339,32 +394,36 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -339,32 +394,36 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
339 394
340 // 加载查询条件下拉框 395 // 加载查询条件下拉框
341 function loadConditionSelect() { 396 function loadConditionSelect() {
342 - admin.req({  
343 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
344 - }).done(function (response) { 397 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  398 + $.ajax({
  399 + url: url,
  400 + success: function (res) {
345 var options = "<option value=''>=工作单位=</option>"; 401 var options = "<option value=''>=工作单位=</option>";
346 - $.each(response.data, function (i, v) { 402 + $.each(res.data, function (i, v) {
347 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 403 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
348 var obj = {}; 404 var obj = {};
349 - obj[id] = v.id;  
350 - obj[name] = v.shortName; 405 + obj.id = v.id;
  406 + obj.name = v.shortName;
351 manufactureArr.push(obj); 407 manufactureArr.push(obj);
352 }); 408 });
353 options += "<option value='0'>其他</option>"; 409 options += "<option value='0'>其他</option>";
354 $('#slt-staff-group').html(options); 410 $('#slt-staff-group').html(options);
355 form.render(); 411 form.render();
  412 + }
356 }); 413 });
357 - admin.req({  
358 - url: domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=2BB920718F284CB38A2911BFAE5A97D'  
359 - }).done(function (response) { 414 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=' + objectId + '&accessToken=' + accessToken
  415 + $.ajax({
  416 + url: url,
  417 + success: function (res) {
360 var options = "<option value=''>=归属机房=</option>"; 418 var options = "<option value=''>=归属机房=</option>";
361 - $.each(response.data, function (i, v) { 419 + $.each(res.data, function (i, v) {
362 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 420 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
363 var obj = {}; 421 var obj = {};
364 - obj[id] = v.id;  
365 - obj[name] = v.shortName; 422 + obj.id = v.id;
  423 + obj.name = v.shortName;
366 machineArr.push(obj); 424 machineArr.push(obj);
367 }); 425 });
  426 + }
368 }); 427 });
369 } 428 }
370 429
@@ -377,29 +436,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -377,29 +436,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
377 window.open(href) 436 window.open(href)
378 }) 437 })
379 //下载 438 //下载
380 - $('#device_download').on('click', function (){ 439 + $('#device_download').on('click', function () {
381 var data = []; 440 var data = [];
382 - var attachmentId =""; 441 + var attachmentId = "";
383 var docType = ""; 442 var docType = "";
384 if (currSelect == 0) { 443 if (currSelect == 0) {
385 data = table.checkStatus('enterdevice_table_id').data; 444 data = table.checkStatus('enterdevice_table_id').data;
386 attachmentId = '2136d6a1709811edb49f005056aae0ca'; 445 attachmentId = '2136d6a1709811edb49f005056aae0ca';
387 docType = '1'; 446 docType = '1';
388 - }else if (currSelect == 1) { 447 + } else if (currSelect == 1) {
389 data = table.checkStatus('fitting-table').data; 448 data = table.checkStatus('fitting-table').data;
390 attachmentId = '713fc12f709811edb49f005056aae0ca'; 449 attachmentId = '713fc12f709811edb49f005056aae0ca';
391 docType = '2'; 450 docType = '2';
392 } 451 }
393 var ids = ''; 452 var ids = '';
394 - if(data.length<=0){  
395 - layer.msg("请至少选择一条下载", { offset: '15px' , icon: 7 , time: 1500 });  
396 - }else if(data.length>=1){ 453 + if (data.length <= 0) {
  454 + layer.msg("请至少选择一条下载", {offset: '15px', icon: 7, time: 1500});
  455 + } else if (data.length >= 1) {
397 var arr = []; 456 var arr = [];
398 - $.each(data,function (i,e) { 457 + $.each(data, function (i, e) {
399 arr.push(e.id) 458 arr.push(e.id)
400 }) 459 })
401 ids = arr.toString(); 460 ids = arr.toString();
402 - var url = domainName + `/api-web/machineRoom/downloadWordZipforDevice?accessToken=` + accessToken+"&ids="+ids+"&attachmentId="+ attachmentId+"&docType="+docType; 461 + var url = domainName + `/api-web/machineRoom/downloadWordZipforDevice?accessToken=` + accessToken + "&ids=" + ids + "&attachmentId=" + attachmentId + "&docType=" + docType;
403 window.open(url); 462 window.open(url);
404 } 463 }
405 }) 464 })
@@ -439,7 +498,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -439,7 +498,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
439 itemStyle: { 498 itemStyle: {
440 color: "#1e9fff" 499 color: "#1e9fff"
441 } 500 }
442 - },{ 501 + }, {
443 name: '配件更换', 502 name: '配件更换',
444 data: fittingList, 503 data: fittingList,
445 barWidth: 20, 504 barWidth: 20,
@@ -504,8 +563,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -504,8 +563,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
504 axisLabel: { 563 axisLabel: {
505 color: '#333', 564 color: '#333',
506 show: true, 565 show: true,
507 - interval:0,  
508 - rotate:15 566 + interval: 0,
  567 + rotate: 15
509 }, 568 },
510 axisLine: { 569 axisLine: {
511 lineStyle: { 570 lineStyle: {
@@ -9,14 +9,15 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,14 +9,15 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('enterStaff', function () { 11 exports('enterStaff', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var timeChart = echarts.init(document.getElementById('chart-time-record')); 14 var timeChart = echarts.init(document.getElementById('chart-time-record'));
15 var manufactureArr = []; 15 var manufactureArr = [];
16 var machineArr = []; 16 var machineArr = [];
17 var dateLimit = "" 17 var dateLimit = ""
18 var createTime = "month" 18 var createTime = "month"
19 - 19 + //机房cmdb配置项类id
  20 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
20 21
21 //日期范围选择 22 //日期范围选择
22 laydate.render({ 23 laydate.render({
@@ -110,27 +111,51 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -110,27 +111,51 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
110 cols: [[ 111 cols: [[
111 {type: 'checkbox'},{ 112 {type: 'checkbox'},{
112 field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) { 113 field: 'machineRoomName', title: '机房', align: 'center',templet: function (d) {
  114 + var machineRoomName = '';
113 if(machineArr && machineArr.length>0){ 115 if(machineArr && machineArr.length>0){
114 $.each(machineArr, function (i, v) { 116 $.each(machineArr, function (i, v) {
115 if(d.machineRoomId==v.id) { 117 if(d.machineRoomId==v.id) {
116 - return v.name; 118 + machineRoomName = v.name;
117 } 119 }
118 }) 120 })
  121 + }else {
  122 + var url =domainName +'/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&id='+d.machineRoomId+'&accessToken='+accessToken
  123 + $.ajax({
  124 + url: url,
  125 + success: function(res){
  126 + $.each(res.data, function (i, v) {
  127 + machineRoomName = v.shortName;
  128 + });
  129 + }
  130 + });
119 } 131 }
  132 + return machineRoomName;
120 } 133 }
121 }, { 134 }, {
122 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { 135 field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  136 + var manufacturerName = '';
123 if(d.manufacturerId == '0'){ 137 if(d.manufacturerId == '0'){
124 - return d.manufacturerOther; 138 + manufacturerName = d.manufacturerOther;
125 }else { 139 }else {
126 if(manufactureArr && manufactureArr.length>0){ 140 if(manufactureArr && manufactureArr.length>0){
127 $.each(manufactureArr, function (i, v) { 141 $.each(manufactureArr, function (i, v) {
128 if(d.manufacturerId==v.id) { 142 if(d.manufacturerId==v.id) {
129 - return v.name; 143 + manufacturerName = v.name;
130 } 144 }
131 }) 145 })
  146 + }else{
  147 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  148 + $.ajax({
  149 + url: url,
  150 + success: function(res){
  151 + if(res.data.cmdbSupplier){
  152 + manufacturerName = res.data.cmdbSupplier.shortName;
132 } 153 }
133 } 154 }
  155 + });
  156 + }
  157 + }
  158 + return manufacturerName;
134 } 159 }
135 }, { 160 }, {
136 field: 'applyUser', title: '申请人', align: 'center', 161 field: 'applyUser', title: '申请人', align: 'center',
@@ -211,32 +236,36 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -211,32 +236,36 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
211 236
212 // 加载查询条件下拉框 237 // 加载查询条件下拉框
213 function loadConditionSelect() { 238 function loadConditionSelect() {
214 - admin.req({  
215 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
216 - }).done(function (response) { 239 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  240 + $.ajax({
  241 + url: url,
  242 + success: function (res) {
217 var options = "<option value=''>=工作单位=</option>"; 243 var options = "<option value=''>=工作单位=</option>";
218 - $.each(response.data, function (i, v) { 244 + $.each(res.data, function (i, v) {
219 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 245 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
220 var obj = {}; 246 var obj = {};
221 - obj[id] = v.id;  
222 - obj[name] = v.shortName; 247 + obj.id = v.id;
  248 + obj.name = v.shortName;
223 manufactureArr.push(obj); 249 manufactureArr.push(obj);
224 }); 250 });
225 options += "<option value='0'>其他</option>"; 251 options += "<option value='0'>其他</option>";
226 $('#slt-staff-group').html(options); 252 $('#slt-staff-group').html(options);
227 form.render(); 253 form.render();
  254 + }
228 }); 255 });
229 - admin.req({  
230 - url: domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=2BB920718F284CB38A2911BFAE5A97D'  
231 - }).done(function (response) { 256 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&accessToken='+accessToken
  257 + $.ajax({
  258 + url: url,
  259 + success: function(res){
232 var options = "<option value=''>=归属机房=</option>"; 260 var options = "<option value=''>=归属机房=</option>";
233 - $.each(response.data, function (i, v) { 261 + $.each(res.data, function (i, v) {
234 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 262 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
235 var obj = {}; 263 var obj = {};
236 - obj[id] = v.id;  
237 - obj[name] = v.shortName; 264 + obj.id = v.id;
  265 + obj.name = v.shortName;
238 machineArr.push(obj); 266 machineArr.push(obj);
239 }); 267 });
  268 + }
240 }); 269 });
241 } 270 }
242 271
@@ -366,6 +395,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -366,6 +395,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
366 }], 395 }],
367 series: series 396 series: series
368 }; 397 };
  398 + option.xAxis.axisLabel.color = function (value, index) {
  399 + if (value === 'Thu' || value === 'Fri') {
  400 + return 'blue';
  401 + } else {
  402 + return '#333'; // 普通颜色
  403 + }
  404 + };
369 timeChart.setOption(option) 405 timeChart.setOption(option)
370 }); 406 });
371 } 407 }
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('extra', function () { 11 exports('extra', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var orgChart = echarts.init(document.getElementById('chart-extra-report')); 14 var orgChart = echarts.init(document.getElementById('chart-extra-report'));
15 var dateLimit = ""; 15 var dateLimit = "";
@@ -115,18 +115,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -115,18 +115,30 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
115 }, { 115 }, {
116 field: 'extraWorker', title: '加班人', align: 'center' 116 field: 'extraWorker', title: '加班人', align: 'center'
117 }, { 117 }, {
118 - field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) {  
119 - if(d.manufacturerId == '0'){  
120 - return d.manufacturerOther;  
121 - }else {  
122 - if(manufactureArr && manufactureArr.length>0){ 118 + field: 'manufacturerName', title: '工作单位', align: 'center', templet: function (d) {
  119 + var manufacturerName = '';
  120 + if (d.manufacturerId == '0') {
  121 + manufacturerName = d.manufacturerOther;
  122 + } else {
  123 + if (manufactureArr && manufactureArr.length > 0) {
123 $.each(manufactureArr, function (i, v) { 124 $.each(manufactureArr, function (i, v) {
124 - if(d.manufacturerId==v.id) {  
125 - return v.name; 125 + if (d.manufacturerId == v.id) {
  126 + manufacturerName = v.name;
126 } 127 }
127 }) 128 })
  129 + } else {
  130 + var url = domainName + '/cmdb-CI/supplier/find/' + d.manufacturerId + '?accessToken=' + accessToken
  131 + $.ajax({
  132 + url: url,
  133 + success: function (res) {
  134 + if (res.data.cmdbSupplier) {
  135 + manufacturerName = res.data.cmdbSupplier.shortName;
  136 + }
  137 + }
  138 + });
128 } 139 }
129 } 140 }
  141 + return manufacturerName;
130 } 142 }
131 }, { 143 }, {
132 field: 'extraPhone', title: '联系方式', align: 'center' 144 field: 'extraPhone', title: '联系方式', align: 'center'
@@ -191,20 +203,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -191,20 +203,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
191 203
192 // 加载查询条件下拉框 204 // 加载查询条件下拉框
193 function loadConditionSelect() { 205 function loadConditionSelect() {
194 - admin.req({  
195 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
196 - }).done(function (response) {  
197 - var options = "<option value=''>=单位=</option>";  
198 - $.each(response.data, function (i, v) { 206 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  207 + $.ajax({
  208 + url: url,
  209 + success: function (res) {
  210 + var options = "<option value=''>=工作单位=</option>";
  211 + $.each(res.data, function (i, v) {
199 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 212 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
200 var obj = {}; 213 var obj = {};
201 - obj[id] = v.id;  
202 - obj[name] = v.shortName; 214 + obj.id = v.id;
  215 + obj.name = v.shortName;
203 manufactureArr.push(obj); 216 manufactureArr.push(obj);
204 }); 217 });
205 options += "<option value='0'>其他</option>"; 218 options += "<option value='0'>其他</option>";
206 $('#slt-extra-group').html(options); 219 $('#slt-extra-group').html(options);
207 form.render(); 220 form.render();
  221 + }
208 }); 222 });
209 } 223 }
210 224
@@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -14,7 +14,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
14 14
15 //对外暴露的接口 15 //对外暴露的接口
16 exports('extraAdd', function (data) { 16 exports('extraAdd', function (data) {
17 - var accessToken = localStorage.getItem("accessToken"); 17 + var accessToken = common.getMjToken();
18 var userSelect = ""; 18 var userSelect = "";
19 var currentDate = {} 19 var currentDate = {}
20 var applyDate = {} 20 var applyDate = {}
@@ -108,17 +108,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -108,17 +108,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
108 108
109 // 初始化下拉框 109 // 初始化下拉框
110 function loadSelect() { 110 function loadSelect() {
111 - admin.req({  
112 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
113 - }).done(function (response) { 111 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  112 + $.ajax({
  113 + url: url,
  114 + success: function (res) {
114 var options = "<option value=''>=工作单位=</option>"; 115 var options = "<option value=''>=工作单位=</option>";
115 - $.each(response.data, function (i, v) { 116 + $.each(res.data, function (i, v) {
116 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 117 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
117 }); 118 });
118 options += "<option value='0'>其他</option>"; 119 options += "<option value='0'>其他</option>";
119 $('#slt-extraAdd-org').html(options); 120 $('#slt-extraAdd-org').html(options);
120 form.render(); 121 form.render();
121 fromAssignment() 122 fromAssignment()
  123 + }
122 }); 124 });
123 125
124 } 126 }
@@ -11,9 +11,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,9 +11,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("extraList", function (d) { 13 exports("extraList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 - $('#attachmentTable').show() 16 + $('#attachmentTable').show();
17 17
18 createAttachmentTable() 18 createAttachmentTable()
19 } 19 }
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("fittingList", function (d) { 13 exports("fittingList", function (d) {
14 - var accessToken = session.getToken()['access_token'] 14 + var accessToken = common.getMjToken();
15 15
16 createFittingTable() 16 createFittingTable()
17 17
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('meetingApply', function () { 11 exports('meetingApply', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken =common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var orgChart = echarts.init(document.getElementById('chart-MeetingApply-report')); 14 var orgChart = echarts.init(document.getElementById('chart-MeetingApply-report'));
15 var dateLimit = ""; 15 var dateLimit = "";
@@ -13,7 +13,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -13,7 +13,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
13 13
14 //对外暴露的接口 14 //对外暴露的接口
15 exports('meetingApplyAdd', function (data) { 15 exports('meetingApplyAdd', function (data) {
16 - var accessToken = localStorage.getItem("accessToken"); 16 + var accessToken =common.getMjToken();
17 var userSelect = ""; 17 var userSelect = "";
18 var currentDate = {} 18 var currentDate = {}
19 var hitDate = {} 19 var hitDate = {}
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("meetingApplyList", function (d) { 13 exports("meetingApplyList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#attachmentTable').show() 16 $('#attachmentTable').show()
17 17
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('meetingsummary', function () { 11 exports('meetingsummary', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var orgChart = echarts.init(document.getElementById('chart-meetingsummary-report')); 14 var orgChart = echarts.init(document.getElementById('chart-meetingsummary-report'));
15 var dateLimit = ""; 15 var dateLimit = "";
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail', 'sess @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail', 'sess
11 var domainName = common.domainName; 11 var domainName = common.domainName;
12 //对外暴露的接口 12 //对外暴露的接口
13 exports('meetingsummaryAdd', function (data) { 13 exports('meetingsummaryAdd', function (data) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 var id = data.id 15 var id = data.id
16 rendermeetingsummaryManuListTable(); 16 rendermeetingsummaryManuListTable();
17 17
@@ -8,14 +8,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -8,14 +8,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
8 var laydate = layui.laydate; 8 var laydate = layui.laydate;
9 var element = layui.element; 9 var element = layui.element;
10 exports('recoveryverify', function () { 10 exports('recoveryverify', function () {
11 - var sessions = layui.sessions;  
12 - var accessToken = localStorage.getItem("accessToken"); 11 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 12 var domainName = common.domainName;
14 var timeChart = echarts.init(document.getElementById('recoveryverify-chart-time-record')); 13 var timeChart = echarts.init(document.getElementById('recoveryverify-chart-time-record'));
15 14
16 var dateLimit = "" 15 var dateLimit = ""
17 var createTime = "year" 16 var createTime = "year"
18 - 17 + var manufactureArr = [];
19 18
20 //日期范围选择 19 //日期范围选择
21 laydate.render({ 20 laydate.render({
@@ -47,14 +46,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -47,14 +46,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
47 loadrecoveryverifyChart(); 46 loadrecoveryverifyChart();
48 loadConditionSelect(); 47 loadConditionSelect();
49 48
50 - //监听Esc事件  
51 - /* $(document).keyup(function (event) {  
52 - if (event.keyCode === 27) {  
53 - layer.closeAll();  
54 - }  
55 - });  
56 49
57 -*/  
58 // 日期方式选择 50 // 日期方式选择
59 $('#btns-recoveryverify-time button').click(function () { 51 $('#btns-recoveryverify-time button').click(function () {
60 $.each($("button.date"), function (i, e) { 52 $.each($("button.date"), function (i, e) {
@@ -132,13 +124,31 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -132,13 +124,31 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
132 }, { 124 }, {
133 field: 'operationUser', title: '运维负责人', align: 'center', 125 field: 'operationUser', title: '运维负责人', align: 'center',
134 }, { 126 }, {
135 - field: 'omanufacturerName', title: '所属单位', align: 'center', templet: function (d) {  
136 - if (d.omanufacturerId == '0') {  
137 - return '其他';  
138 - } else {  
139 - return d.omanufacturerName; 127 + field: 'omanufacturerName', title: '工作单位', align: 'center',templet: function (d) {
  128 + var manufacturerName = '';
  129 + if(d.manufacturerId == '0'){
  130 + manufacturerName = d.manufacturerOther;
  131 + }else {
  132 + if(manufactureArr && manufactureArr.length>0){
  133 + $.each(manufactureArr, function (i, v) {
  134 + if(d.omanufacturerId==v.id) {
  135 + manufacturerName = v.name;
  136 + }
  137 + })
  138 + }else{
  139 + var url = domainName + '/cmdb-CI/supplier/find/'+d.omanufacturerId+'?accessToken='+accessToken
  140 + $.ajax({
  141 + url: url,
  142 + success: function(res){
  143 + if(res.data.cmdbSupplier){
  144 + manufacturerName = res.data.cmdbSupplier.shortName;
140 } 145 }
141 } 146 }
  147 + });
  148 + }
  149 + }
  150 + return manufacturerName;
  151 + }
142 }, { 152 }, {
143 field: 'ophone', title: '联系方式', align: 'center', 153 field: 'ophone', title: '联系方式', align: 'center',
144 },{ 154 },{
@@ -226,16 +236,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -226,16 +236,22 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
226 common.bizTypeSelect("slt-recoveryverify-biz", function () { 236 common.bizTypeSelect("slt-recoveryverify-biz", function () {
227 form.render("select"); 237 form.render("select");
228 }); 238 });
229 - admin.req({  
230 - url: domainName + '/api-web/bWorkreportGroup/findManufacturerList'  
231 - }).done(function (response) {  
232 - var options = "<option value=''>=运维单位=</option>";  
233 - $.each(response.data, function (i, v) {  
234 - options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" 239 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  240 + $.ajax({
  241 + url: url,
  242 + success: function (res) {
  243 + var options = "<option value=''>=工作单位=</option>";
  244 + $.each(res.data, function (i, v) {
  245 + options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
  246 + var obj = {};
  247 + obj.id = v.id;
  248 + obj.name = v.shortName;
  249 + manufactureArr.push(obj);
235 }); 250 });
236 options += "<option value='0'>其他</option>"; 251 options += "<option value='0'>其他</option>";
237 $('#slt-recoveryverify-group').html(options); 252 $('#slt-recoveryverify-group').html(options);
238 form.render("select"); 253 form.render("select");
  254 + }
239 }); 255 });
240 } 256 }
241 257
@@ -13,7 +13,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi @@ -13,7 +13,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi
13 var commonDetail = layui.commonDetail; 13 var commonDetail = layui.commonDetail;
14 //对外暴露的接口 14 //对外暴露的接口
15 exports('recoveryverifyAdd', function (data) { 15 exports('recoveryverifyAdd', function (data) {
16 - var accessToken = localStorage.getItem("accessToken"); 16 + var accessToken = common.getMjToken();
17 var currentDate = {} 17 var currentDate = {}
18 var uploadInst = {} 18 var uploadInst = {}
19 var aAcknowledgingDate = {} 19 var aAcknowledgingDate = {}
@@ -226,18 +226,20 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi @@ -226,18 +226,20 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi
226 form.render("select"); 226 form.render("select");
227 fromAssignment() 227 fromAssignment()
228 }); 228 });
229 - admin.req({  
230 - url: domainName + '/api-web/bWorkreportGroup/findManufacturerList'  
231 - }).done(function (response) {  
232 - var options = "<option value=''>=所属公司=</option>";  
233 - $.each(response.data, function (i, v) {  
234 - options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" 229 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  230 + $.ajax({
  231 + url: url,
  232 + success: function (res) {
  233 + var options = "<option value=''>=工作单位=</option>";
  234 + $.each(res.data, function (i, v) {
  235 + options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
235 }); 236 });
236 options += "<option value='0'>其他</option>"; 237 options += "<option value='0'>其他</option>";
237 $('#slt-recoveryverifyadd-group').html(options); 238 $('#slt-recoveryverifyadd-group').html(options);
238 $('#slt-Irecoveryverify-group').html(options); 239 $('#slt-Irecoveryverify-group').html(options);
239 form.render(); 240 form.render();
240 fromAssignment(); 241 fromAssignment();
  242 + }
241 }); 243 });
242 244
243 } 245 }
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("recoveryverifyList", function (d) { 13 exports("recoveryverifyList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#attachmentTable').show() 16 $('#attachmentTable').show()
17 17
@@ -109,7 +109,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect @@ -109,7 +109,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect
109 } 109 }
110 }) 110 })
111 }*/ 111 }*/
112 - var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0&accessToken=${accessToken}`; 112 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
113 /* 113 /*
114 let url = `${domainName}/mj/sys/conf/getSelect/provider?accessToken=${accessToken}` 114 let url = `${domainName}/mj/sys/conf/getSelect/provider?accessToken=${accessToken}`
115 */ 115 */
@@ -16,7 +16,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -16,7 +16,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
16 let theirTypeOptions = []; 16 let theirTypeOptions = [];
17 let manufactureArr = []; 17 let manufactureArr = [];
18 loadConditionSelect(); 18 loadConditionSelect();
19 - // initGroupSelect()  
20 19
21 //回车搜索 20 //回车搜索
22 $('#adminName').keydown(function (e) { 21 $('#adminName').keydown(function (e) {
@@ -83,13 +82,29 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -83,13 +82,29 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
83 {field: 'name', title: '配置名称', align: 'center', width: 150,}, 82 {field: 'name', title: '配置名称', align: 'center', width: 150,},
84 { 83 {
85 field: 'manufacturerName', title: '厂商', align: 'center',templet: function (d) { 84 field: 'manufacturerName', title: '厂商', align: 'center',templet: function (d) {
  85 + var manufacturerName = '';
  86 + if(d.manufacturerId == '0'){
  87 + manufacturerName = d.manufacturerOther;
  88 + }else {
86 if(manufactureArr && manufactureArr.length>0){ 89 if(manufactureArr && manufactureArr.length>0){
87 $.each(manufactureArr, function (i, v) { 90 $.each(manufactureArr, function (i, v) {
88 if(d.manufacturerId==v.id) { 91 if(d.manufacturerId==v.id) {
89 - return v.name; 92 + manufacturerName = v.name;
90 } 93 }
91 }) 94 })
  95 + }else{
  96 + var url = domainName + '/cmdb-CI/supplier/find/'+d.manufacturerId+'?accessToken='+accessToken
  97 + $.ajax({
  98 + url: url,
  99 + success: function(res){
  100 + if(res.data.cmdbSupplier){
  101 + manufacturerName = res.data.cmdbSupplier.shortName;
  102 + }
  103 + }
  104 + });
  105 + }
92 } 106 }
  107 + return manufacturerName;
93 } 108 }
94 }, 109 },
95 { 110 {
@@ -194,7 +209,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -194,7 +209,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
194 }, function () { 209 }, function () {
195 admin.req({ 210 admin.req({
196 url: common.domainName + '/api-web/bWorkreportGroup/delete' 211 url: common.domainName + '/api-web/bWorkreportGroup/delete'
197 - , type: "delete" 212 + , type: "get"
198 , data: {ids: id} 213 , data: {ids: id}
199 }).done(function (res) { 214 }).done(function (res) {
200 layer.msg('删除成功', { 215 layer.msg('删除成功', {
@@ -239,15 +254,18 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -239,15 +254,18 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
239 }) 254 })
240 } 255 }
241 function loadConditionSelect() { 256 function loadConditionSelect() {
242 - admin.req({  
243 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
244 - }).done(function (response) {  
245 - $.each(response.data, function (i, v) { 257 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  258 + $.ajax({
  259 + url: url,
  260 + success: function (res) {
  261 + $.each(res.data, function (i, v) {
246 var obj = {}; 262 var obj = {};
247 - obj[id] = v.id;  
248 - obj[name] = v.shortName; 263 + obj.id = v.id;
  264 + obj.name = v.shortName;
249 manufactureArr.push(obj); 265 manufactureArr.push(obj);
250 }); 266 });
  267 +
  268 + }
251 }); 269 });
252 } 270 }
253 271
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -9,7 +9,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
9 var element = layui.element; 9 var element = layui.element;
10 10
11 exports('routeAdjust', function () { 11 exports('routeAdjust', function () {
12 - var accessToken = localStorage.getItem("accessToken"); 12 + var accessToken = common.getMjToken();
13 var domainName = common.domainName; 13 var domainName = common.domainName;
14 var orgChart = echarts.init(document.getElementById('chart-org-report')); 14 var orgChart = echarts.init(document.getElementById('chart-org-report'));
15 var adjustTypeChart = echarts.init(document.getElementById('chart-adjustType-report')); 15 var adjustTypeChart = echarts.init(document.getElementById('chart-adjustType-report'));
@@ -15,7 +15,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','commonDetail', 'sessi @@ -15,7 +15,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','commonDetail', 'sessi
15 15
16 //对外暴露的接口 16 //对外暴露的接口
17 exports('routeAdjustAdd', function (data) { 17 exports('routeAdjustAdd', function (data) {
18 - var accessToken = localStorage.getItem("accessToken"); 18 + var accessToken = common.getMjToken();
19 19
20 var adjustDate = {} 20 var adjustDate = {}
21 var uploadInst = {} 21 var uploadInst = {}
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("routeAdjustDetailList", function (d) { 13 exports("routeAdjustDetailList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 15
16 createStaffTable() 16 createStaffTable()
17 function dateForm(time) { 17 function dateForm(time) {
@@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -11,7 +11,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
11 11
12 //对外暴露的接口 12 //对外暴露的接口
13 exports("routeAttachmentList", function (d) { 13 exports("routeAttachmentList", function (d) {
14 - var accessToken = localStorage.getItem("accessToken"); 14 + var accessToken = common.getMjToken();
15 if (d.type == 'attachment') { 15 if (d.type == 'attachment') {
16 $('#routeAttachmentTable').show() 16 $('#routeAttachmentTable').show()
17 17
@@ -12,10 +12,11 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi @@ -12,10 +12,11 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi
12 var domainName = common.domainName; 12 var domainName = common.domainName;
13 //对外暴露的接口 13 //对外暴露的接口
14 exports('staffAdd', function (data) { 14 exports('staffAdd', function (data) {
15 - var accessToken = localStorage.getItem("accessToken"); 15 + var accessToken = common.getMjToken();
16 var enterTime = {} 16 var enterTime = {}
17 var outTime = {} 17 var outTime = {}
18 var staffsBak = [] 18 var staffsBak = []
  19 + var objectId = '5A130B5304C348BA98E7E3BDE765611';
19 // var tableBak = table.cache.identifying-table; 20 // var tableBak = table.cache.identifying-table;
20 //渲染表单 21 //渲染表单
21 form.render(null, 'add-staff-form') 22 form.render(null, 'add-staff-form')
@@ -186,26 +187,30 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi @@ -186,26 +187,30 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi
186 187
187 // 初始化下拉框 188 // 初始化下拉框
188 function loadSelect() { 189 function loadSelect() {
189 - admin.req({  
190 - url: domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId=2BB920718F284CB38A2911BFAE5A97D'  
191 - }).done(function (response) { 190 + var url = domainName + '/cmdb-CI/cmdbci/findList?page=1&limit=20&objId='+objectId+'&accessToken='+accessToken
  191 + $.ajax({
  192 + url: url,
  193 + success: function(res) {
192 var options = "<option value=''>=归属机房=</option>"; 194 var options = "<option value=''>=归属机房=</option>";
193 - $.each(response.data, function (i, v) { 195 + $.each(res.data, function (i, v) {
194 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 196 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
195 }); 197 });
196 $('#slt-staffadd-machine').html(options); 198 $('#slt-staffadd-machine').html(options);
197 form.render(); 199 form.render();
  200 + }
198 }); 201 });
199 - admin.req({  
200 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
201 - }).done(function (response) { 202 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  203 + $.ajax({
  204 + url: url,
  205 + success: function (res) {
202 var options = "<option value=''>=工作单位=</option>"; 206 var options = "<option value=''>=工作单位=</option>";
203 - $.each(response.data, function (i, v) { 207 + $.each(res.data, function (i, v) {
204 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 208 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
205 }); 209 });
206 options += "<option value='0'>其他</option>"; 210 options += "<option value='0'>其他</option>";
207 $('#slt-staffadd-group').html(options); 211 $('#slt-staffadd-group').html(options);
208 form.render(); 212 form.render();
  213 + }
209 }); 214 });
210 } 215 }
211 form.on('select(slt-staffadd-group)', function (data) { 216 form.on('select(slt-staffadd-group)', function (data) {
@@ -264,13 +264,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -264,13 +264,29 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
264 field: 'createUserNickName', title: '汇报人', align: 'center', 264 field: 'createUserNickName', title: '汇报人', align: 'center',
265 }, { 265 }, {
266 field: 'manufacturerName', title: '厂商', align: 'center',templet: function (d) { 266 field: 'manufacturerName', title: '厂商', align: 'center',templet: function (d) {
  267 + var manufacturerName = '';
  268 + if(d.manufacturerName == '0'){
  269 + manufacturerName = d.manufacturerOther;
  270 + }else {
267 if(manufactureArr && manufactureArr.length>0){ 271 if(manufactureArr && manufactureArr.length>0){
268 $.each(manufactureArr, function (i, v) { 272 $.each(manufactureArr, function (i, v) {
269 - if(d.manufacturerId==v.id) {  
270 - return v.name; 273 + if(d.manufacturerName==v.id) {
  274 + manufacturerName = v.name;
271 } 275 }
272 }) 276 })
  277 + }else{
  278 + var url = domainName + '/cmdb-CI/supplier/find/'+d.machineRoomId+'?accessToken='+accessToken
  279 + $.ajax({
  280 + url: url,
  281 + success: function(res){
  282 + if(res.data.cmdbSupplier){
  283 + manufacturerName = res.data.cmdbSupplier.shortName;
  284 + }
  285 + }
  286 + });
  287 + }
273 } 288 }
  289 + return manufacturerName;
274 } 290 }
275 }, { 291 }, {
276 field: 'createTime', title: '上报时间', align: 'center', 292 field: 'createTime', title: '上报时间', align: 'center',
@@ -321,22 +337,24 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat @@ -321,22 +337,24 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat
321 337
322 // 加载查询条件下拉框 338 // 加载查询条件下拉框
323 function loadConditionSelect() { 339 function loadConditionSelect() {
324 - admin.req({  
325 - url: domainName + '/cmdb-CI/supplier/list?page=1&limit=10&supplierType=0'  
326 - }).done(function (response) { 340 + var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
  341 + $.ajax({
  342 + url: url,
  343 + success: function (res) {
327 var options = "<option value=''>=选择厂商=</option>"; 344 var options = "<option value=''>=选择厂商=</option>";
328 - $.each(response.data, function (i, v) { 345 + $.each(res.data, function (i, v) {
329 options += "<option value='" + v.id + "'>" + v.shortName + "</option>" 346 options += "<option value='" + v.id + "'>" + v.shortName + "</option>"
330 var obj = {}; 347 var obj = {};
331 - obj[id] = v.id;  
332 - obj[name] = v.shortName;  
333 - manufactureArr.push(obj); }); 348 + obj.id = v.id;
  349 + obj.name = v.shortName;
  350 + manufactureArr.push(obj);
  351 + });
334 $('#slt-workreport-group').html(options); 352 $('#slt-workreport-group').html(options);
335 if (manufacturerId != '') { 353 if (manufacturerId != '') {
336 $('#slt-workreport-group').val(manufacturerId) 354 $('#slt-workreport-group').val(manufacturerId)
337 } 355 }
338 form.render(); 356 form.render();
339 - 357 + }
340 }); 358 });
341 $.ajax({ 359 $.ajax({
342 url: domainName + '/mj/user/page?username=&nickname=&enabled=&perPage=10000&page=1&accessToken=' + common.getMjToken(), 360 url: domainName + '/mj/user/page?username=&nickname=&enabled=&perPage=10000&page=1&accessToken=' + common.getMjToken(),