Showing
26 changed files
with
3228 additions
and
19 deletions
@@ -54,7 +54,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -54,7 +54,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
54 | delete data['select'] | 54 | delete data['select'] |
55 | params.workReport = JSON.stringify(data) | 55 | params.workReport = JSON.stringify(data) |
56 | admin.req({ | 56 | admin.req({ |
57 | - url: domainName + '/api-web/bResource/assetsrepair/save?access_token=' + accessToken, | 57 | + url: domainName + '/api-room/assetsrepair/save?access_token=' + accessToken, |
58 | data: JSON.stringify(params), | 58 | data: JSON.stringify(params), |
59 | type: 'post', | 59 | type: 'post', |
60 | contentType: "application/json; charset=utf-8", | 60 | contentType: "application/json; charset=utf-8", |
@@ -94,7 +94,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -94,7 +94,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
94 | // 初始化下拉框 | 94 | // 初始化下拉框 |
95 | function loadSelect() { | 95 | function loadSelect() { |
96 | admin.req({ | 96 | admin.req({ |
97 | - url: domainName + '/api-web/bResource/findAssetsRepairList' | 97 | + url: domainName + '/api-room/assetsrepair/findAssetsRepairList' |
98 | }).done(function (response) { | 98 | }).done(function (response) { |
99 | var options = "<option value=''>=归属单位=</option>"; | 99 | var options = "<option value=''>=归属单位=</option>"; |
100 | $.each(response.data, function (i, v) { | 100 | $.each(response.data, function (i, v) { |
@@ -114,7 +114,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -114,7 +114,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
114 | form.render(); | 114 | form.render(); |
115 | }); | 115 | }); |
116 | admin.req({ | 116 | admin.req({ |
117 | - url: domainName + '/api-web/bResource/getInfoByAssetsType', | 117 | + url: domainName + '/api-room/assetsrepair/getInfoByAssetsType', |
118 | }).done(function (response) { | 118 | }).done(function (response) { |
119 | var options = "<option value=''>=设备类型=</option>"; | 119 | var options = "<option value=''>=设备类型=</option>"; |
120 | $.each(response.data, function (i, v) { | 120 | $.each(response.data, function (i, v) { |
@@ -124,7 +124,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -124,7 +124,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
124 | form.render(); | 124 | form.render(); |
125 | }) | 125 | }) |
126 | $.ajax({ | 126 | $.ajax({ |
127 | - url: domainName + '/api-web/bResource/getGroupByAdmin?theirType=1&access_token=' + accessToken, | 127 | + url: domainName + '/api-web/workreport/getGroupByAdmin?theirType=1&access_token=' + accessToken, |
128 | success: function (res) { | 128 | success: function (res) { |
129 | if (!res.map) { | 129 | if (!res.map) { |
130 | layer.msg("没有上传权限,请去添加权限") | 130 | layer.msg("没有上传权限,请去添加权限") |
@@ -148,14 +148,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -148,14 +148,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
148 | value: new Date(), | 148 | value: new Date(), |
149 | type: 'datetime', | 149 | type: 'datetime', |
150 | isInitValue: true, | 150 | isInitValue: true, |
151 | - max: 0, | ||
152 | }); | 151 | }); |
153 | hitDate = laydate.render({ | 152 | hitDate = laydate.render({ |
154 | elem: '#hitchtime', //指定元素 | 153 | elem: '#hitchtime', //指定元素 |
155 | value: new Date(), | 154 | value: new Date(), |
156 | type: 'datetime', | 155 | type: 'datetime', |
157 | isInitValue: true, | 156 | isInitValue: true, |
158 | - max: 0, | ||
159 | }); | 157 | }); |
160 | } | 158 | } |
161 | 159 | ||
@@ -165,7 +163,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -165,7 +163,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
165 | var fileName = [] | 163 | var fileName = [] |
166 | uploadInst = upload.render({ | 164 | uploadInst = upload.render({ |
167 | elem: '#attachment', //绑定元素 | 165 | elem: '#attachment', //绑定元素 |
168 | - url: common.domainName + '/api-web/bResource/assetsrepair/upload', | 166 | + url: common.domainName + '/api-room/assetsrepair/upload', |
169 | data: param, | 167 | data: param, |
170 | multiple: true, | 168 | multiple: true, |
171 | auto: false, //选择文件后不自动上传 | 169 | auto: false, //选择文件后不自动上传 |
@@ -274,14 +272,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | @@ -274,14 +272,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'xmSelect | ||
274 | if (data && data.id) { | 272 | if (data && data.id) { |
275 | $('#add-repair-form-atta').show() | 273 | $('#add-repair-form-atta').show() |
276 | //编辑表单时禁用日志类型修改和时间选择 | 274 | //编辑表单时禁用日志类型修改和时间选择 |
277 | - $('#add-repair-form').find("select[name='hitchtime']").attr("disabled", "disabled") | ||
278 | - $('#add-repair-form').find("input[name='createtime']").attr("disabled", "disabled") | 275 | + // $('#add-repair-form').find("select[name='hitchtime']").attr("disabled", "disabled") |
276 | + // $('#add-repair-form').find("input[name='createtime']").attr("disabled", "disabled") | ||
279 | //编辑表单时取消显示默认值 | 277 | //编辑表单时取消显示默认值 |
280 | currentDate.config.isInitValue = false | 278 | currentDate.config.isInitValue = false |
281 | hitDate.config.isInitValue = false | 279 | hitDate.config.isInitValue = false |
282 | initDatePlus() | 280 | initDatePlus() |
283 | admin.req({ | 281 | admin.req({ |
284 | - url: domainName + `/api-web/bResource/assetsrepair/getById`, | 282 | + url: domainName + `/api-room/assetsrepair/getById`, |
285 | data: {id: data.id}, | 283 | data: {id: data.id}, |
286 | async: false, | 284 | async: false, |
287 | }).done(function (res) { | 285 | }).done(function (res) { |
@@ -16,7 +16,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -16,7 +16,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
16 | var resTypeChart = echarts.init(document.getElementById('chart-restype-report')); | 16 | var resTypeChart = echarts.init(document.getElementById('chart-restype-report')); |
17 | 17 | ||
18 | var dateLimit = "" | 18 | var dateLimit = "" |
19 | - var createTime = "" | 19 | + var createTime = "thisMonth" |
20 | var currentResourceTypeTreeNodeId = "" | 20 | var currentResourceTypeTreeNodeId = "" |
21 | var resTypeSelect; | 21 | var resTypeSelect; |
22 | 22 | ||
@@ -28,7 +28,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -28,7 +28,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
28 | done: function (value) { | 28 | done: function (value) { |
29 | dateLimit = value | 29 | dateLimit = value |
30 | if (dateLimit == '') { | 30 | if (dateLimit == '') { |
31 | - $('[data-period="thisWeek"]').click() | 31 | + $('[data-period="thisMonth"]').click() |
32 | } else { | 32 | } else { |
33 | $.each($("button.date"),function (i,e) { | 33 | $.each($("button.date"),function (i,e) { |
34 | var $dom = $(e); | 34 | var $dom = $(e); |
@@ -50,7 +50,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -50,7 +50,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
50 | 50 | ||
51 | //监听Esc事件 | 51 | //监听Esc事件 |
52 | $(document).keyup(function(event){ | 52 | $(document).keyup(function(event){ |
53 | - if(event.keyCode === 27 || event.keyCode === 96){ | 53 | + if(event.keyCode === 27){ |
54 | layer.closeAll(); | 54 | layer.closeAll(); |
55 | } | 55 | } |
56 | }); | 56 | }); |
@@ -92,7 +92,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -92,7 +92,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
92 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: 'true',dateLimit:dateLimit}); | 92 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: 'true',dateLimit:dateLimit}); |
93 | table.render({ | 93 | table.render({ |
94 | elem: '#table-repair-view', | 94 | elem: '#table-repair-view', |
95 | - url: domainName + '/api-web/bResource/getAssetsRepairForPage', | 95 | + url: domainName + '/api-room/assetsrepair/getAssetsRepairForPage', |
96 | where: conditions, | 96 | where: conditions, |
97 | height: 'full-360', | 97 | height: 'full-360', |
98 | page: { | 98 | page: { |
@@ -166,11 +166,25 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -166,11 +166,25 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
166 | 166 | ||
167 | common.openWin('assets/repairlist', title, {id: id, type: type}, ['确定', '取消']) | 167 | common.openWin('assets/repairlist', title, {id: id, type: type}, ['确定', '取消']) |
168 | } | 168 | } |
169 | - | 169 | + //监听单元格事件 |
170 | + // table.on('tool(table-repair-view)', function(obj){ | ||
171 | + // var data = obj.data; | ||
172 | + // if(obj.event === 'serRead'){ | ||
173 | + // | ||
174 | + // var id = data['id']; | ||
175 | + // common.openWin('assets/add', '查看', {id: id, viewType: 'view'}, ['关闭'], function f() { | ||
176 | + // return true; | ||
177 | + // }, null, null, { | ||
178 | + // success: function () { | ||
179 | + // form.render(); | ||
180 | + // } | ||
181 | + // }) | ||
182 | + // } | ||
183 | + // }); | ||
170 | // 加载查询条件下拉框 | 184 | // 加载查询条件下拉框 |
171 | function loadConditionSelect() { | 185 | function loadConditionSelect() { |
172 | admin.req({ | 186 | admin.req({ |
173 | - url: domainName + '/api-web/bResource/findAssetsRepairList' | 187 | + url: domainName + '/api-room/assetsrepair/findAssetsRepairList' |
174 | }).done(function (response) { | 188 | }).done(function (response) { |
175 | var options = "<option value=''>=归属单位=</option>"; | 189 | var options = "<option value=''>=归属单位=</option>"; |
176 | console.log(response.data) | 190 | console.log(response.data) |
@@ -250,7 +264,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -250,7 +264,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
250 | var conditions = form.val('form-repair-condition'); | 264 | var conditions = form.val('form-repair-condition'); |
251 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',dateLimit:dateLimit,groupBy: 'orgName'}); | 265 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',dateLimit:dateLimit,groupBy: 'orgName'}); |
252 | admin.req({ | 266 | admin.req({ |
253 | - url: domainName + '/api-web/bResource/getAssetsRepairForGroup', | 267 | + url: domainName + '/api-room/assetsrepair/getAssetsRepairForGroup', |
254 | data: conditions | 268 | data: conditions |
255 | }).done(function (response) { | 269 | }).done(function (response) { |
256 | var chartData = response.map; | 270 | var chartData = response.map; |
@@ -388,7 +402,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | @@ -388,7 +402,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts','laydate | ||
388 | var conditions = form.val('form-repair-condition'); | 402 | var conditions = form.val('form-repair-condition'); |
389 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',dateLimit:dateLimit,groupBy: 'resTypeName'}); | 403 | Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',dateLimit:dateLimit,groupBy: 'resTypeName'}); |
390 | admin.req({ | 404 | admin.req({ |
391 | - url: domainName + '/api-web/bResource/getAssetsRepairForGroup', | 405 | + url: domainName + '/api-room/assetsrepair/getAssetsRepairForGroup', |
392 | data: conditions | 406 | data: conditions |
393 | }).done(function (response) { | 407 | }).done(function (response) { |
394 | var chartData = response.map; | 408 | var chartData = response.map; |
@@ -3410,6 +3410,68 @@ debugger | @@ -3410,6 +3410,68 @@ debugger | ||
3410 | }); | 3410 | }); |
3411 | }); | 3411 | }); |
3412 | }, | 3412 | }, |
3413 | + validatorPhone: function (phone) { | ||
3414 | + if (/^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])d{8}$/.test(phone)) { | ||
3415 | + return { | ||
3416 | + code: 1, | ||
3417 | + msg: "验证通过" | ||
3418 | + } | ||
3419 | + }else if(/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(phone)){ | ||
3420 | + return { | ||
3421 | + code: 1, | ||
3422 | + msg: "验证通过" | ||
3423 | + } | ||
3424 | + }else{ | ||
3425 | + return { | ||
3426 | + code: -1, | ||
3427 | + msg: "手机或者座机号码格式错误" | ||
3428 | + } | ||
3429 | + } | ||
3430 | + | ||
3431 | + | ||
3432 | + }, | ||
3433 | + //身份证号码验证 | ||
3434 | + validatorIDCard: function (idcode) { | ||
3435 | + if (typeof idcode !== 'string') { | ||
3436 | + return { | ||
3437 | + code: -1, | ||
3438 | + msg: "为了避免javascript数值范围误差,idcode 必须是字符串" | ||
3439 | + } | ||
3440 | + } | ||
3441 | + const idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/; | ||
3442 | + // 判断格式是否正确 | ||
3443 | + const format = idcard_patter.test(idcode); | ||
3444 | + if (!format) { | ||
3445 | + return { | ||
3446 | + code: -1, | ||
3447 | + msg: "身份证号码格式错误" | ||
3448 | + } | ||
3449 | + } | ||
3450 | + // 加权因子 | ||
3451 | + const weight_factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; | ||
3452 | + // 校验码 | ||
3453 | + const check_code = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; | ||
3454 | + const last = idcode[17];//最后一位 | ||
3455 | + const seventeen = idcode.substring(0, 17); | ||
3456 | + // ISO 7064:1983.MOD 11-2 | ||
3457 | + // 判断最后一位校验码是否正确 | ||
3458 | + const arr = seventeen.split(""); | ||
3459 | + const len = arr.length; | ||
3460 | + let num = 0; | ||
3461 | + for (let i = 0; i < len; i++) { | ||
3462 | + num += arr[i] * weight_factor[i]; | ||
3463 | + } | ||
3464 | + // 获取余数 | ||
3465 | + const resisue = num % 11; | ||
3466 | + const last_no = check_code[resisue]; | ||
3467 | + // 返回验证结果,校验码和格式同时正确才算是合法的身份证号码 | ||
3468 | + const result = last === last_no ? true : false; | ||
3469 | + return { | ||
3470 | + code: result ? 1 : -1, | ||
3471 | + msg: !result ? "身份证号码格式错误" : "" | ||
3472 | + } | ||
3473 | + | ||
3474 | + }, | ||
3413 | //获取维保信息 | 3475 | //获取维保信息 |
3414 | renderMaintenanceInfo: function (targetId, resId, resType, fn) { | 3476 | renderMaintenanceInfo: function (targetId, resId, resType, fn) { |
3415 | var flag = false; //默认没有父级 | 3477 | var flag = false; //默认没有父级 |
1 | +//工作汇报表单 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions; | ||
10 | + var laydate = layui.laydate; | ||
11 | + | ||
12 | + var domainName = common.domainName; | ||
13 | + //对外暴露的接口 | ||
14 | + exports('deviceAdd', function (data) { | ||
15 | + var accessToken = session.getToken()['access_token'] | ||
16 | + var enterTime = {}; | ||
17 | + var outTime = {}; | ||
18 | + var devicesBak = []; | ||
19 | + var fittingsBak = []; | ||
20 | + //渲染表单 | ||
21 | + form.render(null, 'add-device-form') | ||
22 | + searchEvent();//检索条件事件 | ||
23 | + init() | ||
24 | + //检索事件 | ||
25 | + function searchEvent() { | ||
26 | + //发送状态 | ||
27 | + form.on('select(slt-docType)', function (data) { | ||
28 | + var html =""; | ||
29 | + if(data.value==1){ | ||
30 | + html+= "<option value='1'>迁入</option><option value='2'>迁出</option><option value='3'>转移</option>" | ||
31 | + $("#device_card").css("display","block"); | ||
32 | + $("#fiting_card").css("display","none"); | ||
33 | + devicesBak = []; | ||
34 | + fittingsBak = []; | ||
35 | + }else{ | ||
36 | + html+= "<option value='4'>更换</option><option value='5'>新增</option><option value='6'>带走维修</option>" | ||
37 | + $("#device_card").css("display","none"); | ||
38 | + $("#fiting_card").css("display","block"); | ||
39 | + devicesBak = []; | ||
40 | + fittingsBak = []; | ||
41 | + } | ||
42 | + $("#slt-actionType").html(html); | ||
43 | + form.render(); | ||
44 | + }); | ||
45 | + } | ||
46 | + //发送状态 | ||
47 | + form.on('select(slt-docType)', function (data) { | ||
48 | + var html =""; | ||
49 | + if(data.value==1){ | ||
50 | + html+= "<option value='1'>迁入</option><option value='2'>迁出</option><option value='3'>转移</option>" | ||
51 | + $("#device_card").css("display","block"); | ||
52 | + $("#fiting_card").css("display","none"); | ||
53 | + }else{ | ||
54 | + html+= "<option value='4'>更换</option><option value='5'>新增</option><option value='6'>带走维修</option>" | ||
55 | + $("#device_card").css("display","none"); | ||
56 | + $("#fiting_card").css("display","block"); | ||
57 | + } | ||
58 | + $("#slt-actionType").html(html); | ||
59 | + form.render(); | ||
60 | + }); | ||
61 | + | ||
62 | + form.on('select(slt-actionType)', function (data) { | ||
63 | + if(data.value=="3"){ | ||
64 | + $("#lastPlace").removeAttribute("readOnly"); | ||
65 | + }else { | ||
66 | + $("#lastPlace").attr("readOnly","readOnly"); | ||
67 | + } | ||
68 | + }) | ||
69 | + | ||
70 | + //保存 | ||
71 | + form.on('submit(device-form-save-id)', function (res) { | ||
72 | + | ||
73 | + if (devicesBak.length == 0 && fittingsBak.length == 0) { | ||
74 | + layer.msg("请先添加设备信息") | ||
75 | + } else { | ||
76 | + saveForm() | ||
77 | + } | ||
78 | + }) | ||
79 | + | ||
80 | + //保存 | ||
81 | + function saveForm() { | ||
82 | + layer.load(2) | ||
83 | + var data = form.val('add-device-form') | ||
84 | + var params = {} | ||
85 | + params.deviceList = devicesBak; | ||
86 | + params.fittingList = fittingsBak; | ||
87 | + params.deviceRecord = JSON.stringify(data); | ||
88 | + console.log(params) | ||
89 | + admin.req({ | ||
90 | + url: domainName + '/api-room/machineRoom/machineRoomEnterDevice/save?access_token=' + accessToken, | ||
91 | + data: JSON.stringify(params), | ||
92 | + type: 'post', | ||
93 | + contentType: "application/json; charset=utf-8", | ||
94 | + done: function (res) { | ||
95 | + if (res.success) { | ||
96 | + layer.msg(res.msg, { | ||
97 | + offset: '15px', | ||
98 | + icon: 1, | ||
99 | + time: 1000, | ||
100 | + }, function () { | ||
101 | + layer.closeAll() | ||
102 | + | ||
103 | + }) | ||
104 | + } else { | ||
105 | + layer.msg(res.msg, { | ||
106 | + offset: '15px', | ||
107 | + icon: 7, | ||
108 | + time: 1000, | ||
109 | + }) | ||
110 | + } | ||
111 | + } | ||
112 | + }) | ||
113 | + return false | ||
114 | + }; | ||
115 | + | ||
116 | + $("#device_card :button#device_create").on("click",function () { | ||
117 | + var html = "<tr><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'/></td><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'/></td><td><input type='text' class='layui-input' width='40px' lay-verify = 'required'/></td><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'/></td><td><input type='button' value='保存' class='edit' style='background-color: #b71010;line-height: 18px'/></td></tr>" | ||
118 | + $("#device-table").append(html); | ||
119 | + | ||
120 | + $("#table-device :button.edit").click(function () { | ||
121 | + var toEdit = this.value == '保存'; | ||
122 | + this.value = toEdit ? '删除' : '保存'; | ||
123 | + var tdArr = [] | ||
124 | + $(this).closest('tr').find('td').not(':last').each(function (t, index) { | ||
125 | + if (toEdit) { | ||
126 | + this.innerHTML = this.firstChild.value.replace(/</g, '<').replace(/>/g, '>'); | ||
127 | + if(this.innerHTML=='' || this.innerHTML == undefined){ | ||
128 | + layer.msg("请注意填写完整") | ||
129 | + tdArr = []; | ||
130 | + $(this).closest('tr').remove(); | ||
131 | + return; | ||
132 | + } | ||
133 | + tdArr.push(this.innerHTML); | ||
134 | + } | ||
135 | + }) | ||
136 | + if(!toEdit){ | ||
137 | + var snCode = $(this).closest('tr').find('td')[0].innerHTML; | ||
138 | + if(snCode!=''&& snCode!=undefined){ | ||
139 | + for (let i = 0; i < devicesBak.length; i++) { | ||
140 | + if(devicesBak[i].snCode == snCode){ | ||
141 | + devicesBak.pop(devicesBak[i]); | ||
142 | + } | ||
143 | + } | ||
144 | + } | ||
145 | + $(this).closest('tr').remove(); | ||
146 | + }else { | ||
147 | + if(tdArr.length>0) { | ||
148 | + var deviceObj = { | ||
149 | + 'id': '', | ||
150 | + 'snCode': tdArr[0], | ||
151 | + 'deviceType': tdArr[1], | ||
152 | + 'deviceModel': tdArr[2], | ||
153 | + 'brand': tdArr[3] | ||
154 | + } | ||
155 | + devicesBak.push(deviceObj) | ||
156 | + } | ||
157 | + } | ||
158 | + }); | ||
159 | + }); | ||
160 | + $("#fiting_card :button#fiting_create").on("click",function () { | ||
161 | + var html = "<tr><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='40px' class='layui-input' lay-verify = 'required'></td><td><input type='text' class='layui-input' width='50px' lay-verify = 'required'></td><td><input type='button' value='保存' class='edit' style='background-color: #b71010;line-height: 18px'/></td></tr>" | ||
162 | + $("#fiting-table").append(html); | ||
163 | + | ||
164 | + $("#table-fiting :button.edit").click(function () { | ||
165 | + var toEdit = this.value == '保存'; | ||
166 | + this.value = toEdit ? '删除' : '保存'; | ||
167 | + var tdArr = [] | ||
168 | + $(this).closest('tr').find('td').not(':last').each(function (t, index) { | ||
169 | + if (toEdit) { | ||
170 | + this.innerHTML = this.firstChild.value.replace(/</g, '<').replace(/>/g, '>'); | ||
171 | + if(this.innerHTML=='' || this.innerHTML == undefined){ | ||
172 | + layer.msg("请注意填写完整") | ||
173 | + tdArr = []; | ||
174 | + $(this).closest('tr').remove(); | ||
175 | + return; | ||
176 | + } | ||
177 | + tdArr.push(this.innerHTML); | ||
178 | + } | ||
179 | + }) | ||
180 | + if(!toEdit){ | ||
181 | + var fittingSN = $(this).closest('tr').find('td')[0].innerHTML; | ||
182 | + if(fittingSN!=''&& fittingSN!=undefined){ | ||
183 | + for (let i = 0; i < fittingsBak.length; i++) { | ||
184 | + if(fittingsBak[i].fittingSN == fittingSN){ | ||
185 | + fittingsBak.pop(fittingsBak[i]); | ||
186 | + } | ||
187 | + } | ||
188 | + } | ||
189 | + $(this).closest('tr').remove(); | ||
190 | + }else { | ||
191 | + if(tdArr.length>0) { | ||
192 | + var fittingObj = { | ||
193 | + 'id': '', | ||
194 | + 'fittingSN': tdArr[0], | ||
195 | + 'newfittingSN': tdArr[1], | ||
196 | + 'fittingName': tdArr[2], | ||
197 | + 'deviceModel': tdArr[3] | ||
198 | + } | ||
199 | + fittingsBak.push(fittingObj) | ||
200 | + } | ||
201 | + } | ||
202 | + }); | ||
203 | + }); | ||
204 | + //页面初始化 | ||
205 | + function init() { | ||
206 | + loadSelect() | ||
207 | + initDatePlus() | ||
208 | + } | ||
209 | + | ||
210 | + // 初始化下拉框 | ||
211 | + function loadSelect() { | ||
212 | + admin.req({ | ||
213 | + url: domainName + '/api-room/machineRoom/getMachineRoomInfo' | ||
214 | + }).done(function (response) { | ||
215 | + var options = "<option value=''>=归属机房=</option>"; | ||
216 | + $.each(response.data, function (i, v) { | ||
217 | + options += "<option value='" + v.machineRoomId + "'>" + v.machineRoomName + "</option>" | ||
218 | + }); | ||
219 | + $('#slt-staffadd-machine').html(options); | ||
220 | + form.render(); | ||
221 | + }); | ||
222 | + admin.req({ | ||
223 | + url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' | ||
224 | + }).done(function (response) { | ||
225 | + var options = "<option value=''>=工作单位=</option>"; | ||
226 | + $.each(response.data, function (i, v) { | ||
227 | + options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" | ||
228 | + }); | ||
229 | + options += "<option value='0'>其他</option>"; | ||
230 | + $('#slt-staffadd-group').html(options); | ||
231 | + form.render(); | ||
232 | + }); | ||
233 | + } | ||
234 | + form.on('select(slt-staffadd-group)', function (data) { | ||
235 | + if(data.value== '0'){ | ||
236 | + $("#slt-staffadd-group").css("display","none"); | ||
237 | + $("#manufacturerOther").css("display","block"); | ||
238 | + }else { | ||
239 | + $("#manufacturerOther").css("display","none"); | ||
240 | + } | ||
241 | + }); | ||
242 | + | ||
243 | + //初始化日期插件 | ||
244 | + function initDatePlus() { | ||
245 | + enterTime = laydate.render({ | ||
246 | + elem: '#enterTime', //指定元素 | ||
247 | + value: new Date(), | ||
248 | + type: 'datetime', | ||
249 | + isInitValue: true, | ||
250 | + | ||
251 | + }); | ||
252 | + outTime = laydate.render({ | ||
253 | + elem: '#outTime', //指定元素 | ||
254 | + value: new Date(), | ||
255 | + type: 'datetime', | ||
256 | + isInitValue: true, | ||
257 | + | ||
258 | + }); | ||
259 | + } | ||
260 | + | ||
261 | + | ||
262 | + }) | ||
263 | +}) |
1 | +//备份失败列表 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports("deviceList", function (d) { | ||
14 | + var accessToken = session.getToken()['access_token'] | ||
15 | + | ||
16 | + createDeviceTable() | ||
17 | + function dateForm(time) { | ||
18 | + var unixTimestamp = new Date(time); | ||
19 | + var commonTime = unixTimestamp.toLocaleString(); | ||
20 | + return commonTime | ||
21 | + } | ||
22 | + //渲染附件表格 | ||
23 | + function createDeviceTable() { | ||
24 | + var deviceTable = table.render({ | ||
25 | + elem: '#deviceTable', | ||
26 | + url: domainName + '/api-room/machineRoom/findDeviceByRecordId', | ||
27 | + where: { | ||
28 | + access_token: accessToken, | ||
29 | + recordId: d.id | ||
30 | + }, | ||
31 | + height: 'full', | ||
32 | + end: function (e) { | ||
33 | + form.render() | ||
34 | + }, | ||
35 | + even: true, | ||
36 | + cols: [[ | ||
37 | + {type: 'numbers', title: '序号'}, | ||
38 | + { | ||
39 | + field: 'deviceType', title: '设备类型', align: 'center', | ||
40 | + }, { | ||
41 | + field: 'deviceModel', title: '设备型号', align: 'center', | ||
42 | + }, { | ||
43 | + field: 'brand', title: '品牌', align: 'center', | ||
44 | + }, { | ||
45 | + field: 'snCode', title: '设备sn码', align: 'center', | ||
46 | + } | ||
47 | + ]], | ||
48 | + done: function () { | ||
49 | + } | ||
50 | + }) | ||
51 | + } | ||
52 | + | ||
53 | + }) | ||
54 | +}) |
1 | +/** 资产维修记录查看 */ | ||
2 | +layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydate', 'element'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var table = layui.table; | ||
6 | + var admin = layui.admin; | ||
7 | + var common = layui.common; | ||
8 | + var laydate = layui.laydate; | ||
9 | + var element = layui.element; | ||
10 | + | ||
11 | + exports('enterDevice', function () { | ||
12 | + var sessions = layui.sessions; | ||
13 | + var accessToken = sessions.getToken().access_token; | ||
14 | + var domainName = common.domainName; | ||
15 | + var timeChart = echarts.init(document.getElementById('device-chart-time-record')); | ||
16 | + var inspIsLoad = false; | ||
17 | + var businessIsLoad = false; | ||
18 | + var currSelect = 0; | ||
19 | + var dateLimit = "" | ||
20 | + var createTime = "month" | ||
21 | + | ||
22 | + | ||
23 | + //日期范围选择 | ||
24 | + laydate.render({ | ||
25 | + elem: '#dateLimit' | ||
26 | + , range: '~', | ||
27 | + done: function (value) { | ||
28 | + dateLimit = value | ||
29 | + if (dateLimit == '') { | ||
30 | + $('[data-period="month"]').click() | ||
31 | + } else { | ||
32 | + $.each($("button.date"), function (i, e) { | ||
33 | + var $dom = $(e); | ||
34 | + if ($dom.hasClass("active")) { | ||
35 | + $dom.removeClass("active") | ||
36 | + } | ||
37 | + }) | ||
38 | + reloadAllChange() | ||
39 | + } | ||
40 | + } | ||
41 | + }); | ||
42 | + | ||
43 | + form.render(); | ||
44 | + renderEnterDeviceListTable(); | ||
45 | + renderFittingFixListTable() | ||
46 | + loadEnterDeviceChart(); | ||
47 | + loadConditionSelect(); | ||
48 | + | ||
49 | + | ||
50 | + //监听Esc事件 | ||
51 | + $(document).keyup(function (event) { | ||
52 | + if (event.keyCode === 27) { | ||
53 | + layer.closeAll(); | ||
54 | + } | ||
55 | + }); | ||
56 | + | ||
57 | + | ||
58 | + // 日期方式选择 | ||
59 | + $('#btns-staff-time button').click(function () { | ||
60 | + $.each($("button.date"), function (i, e) { | ||
61 | + var $dom = $(e); | ||
62 | + if ($dom.hasClass("active")) { | ||
63 | + $dom.removeClass("active") | ||
64 | + } | ||
65 | + }) | ||
66 | + $("#dateLimit").val('') | ||
67 | + dateLimit = '' | ||
68 | + $("#btns-staff-time button").removeClass("active"); | ||
69 | + $(this).addClass("active"); | ||
70 | + createTime = ($(this).data("period")) | ||
71 | + reloadAllChange(); | ||
72 | + }); | ||
73 | + | ||
74 | + // 回车搜索 | ||
75 | + $('[lay-filter="form-enterStaff-condition"] input').keydown(function (e) { | ||
76 | + if (e.keyCode === 13) { | ||
77 | + reloadAllChange(); | ||
78 | + } | ||
79 | + }); | ||
80 | + | ||
81 | + // 下拉框改变搜索 | ||
82 | + form.on('select(slt-staff-group)', reloadAllChange); | ||
83 | + | ||
84 | + // tab页切换事件 | ||
85 | + element.on('tab(enterdevice-tab)', function (data) { | ||
86 | + if (data.index == 0) { | ||
87 | + if (!inspIsLoad) { | ||
88 | + renderEnterDeviceListTable(); | ||
89 | + inspIsLoad = true; | ||
90 | + } | ||
91 | + } else if (data.index == 1) { | ||
92 | + if (!businessIsLoad) { | ||
93 | + renderFittingFixListTable(); | ||
94 | + businessIsLoad = true; | ||
95 | + } | ||
96 | + } | ||
97 | + currSelect = data.index; | ||
98 | + }); | ||
99 | + // 加载配件更换表格 | ||
100 | + function renderEnterDeviceListTable() { | ||
101 | + var conditions = form.val('form-enterStaff-condition'); | ||
102 | + | ||
103 | + Object.assign(conditions, { | ||
104 | + access_token: accessToken, | ||
105 | + createtime: createTime, | ||
106 | + viewMode: 'true', | ||
107 | + dateLimit: dateLimit | ||
108 | + }); | ||
109 | + table.render({ | ||
110 | + elem: '#enterdevice_table_id', | ||
111 | + url: domainName + '/api-room/machineRoom/findMachineRoomEnterDeviceRecords?docType=1', | ||
112 | + where: conditions, | ||
113 | + height: 'full-360', | ||
114 | + page: { | ||
115 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
116 | + theme: '#1E9FFF' | ||
117 | + }, | ||
118 | + end: function (e) { | ||
119 | + form.render() | ||
120 | + }, | ||
121 | + limit: common.limit, | ||
122 | + limits: common.limits, | ||
123 | + even: true, | ||
124 | + cols: [[{ | ||
125 | + field: 'machineRoomName', title: '机房', align: 'center', | ||
126 | + }, { | ||
127 | + field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { | ||
128 | + if(d.manufacturerId == '0'){ | ||
129 | + return d.manufacturerOther; | ||
130 | + }else { | ||
131 | + return d.manufacturerName; | ||
132 | + } | ||
133 | + } | ||
134 | + }, { | ||
135 | + field: 'applyUser', title: '申请人', align: 'center', | ||
136 | + }, { | ||
137 | + field: 'phone', title: '联系方式', align: 'center', | ||
138 | + }, { | ||
139 | + field: 'actionType', title: '设备出入类型', align: 'center', | ||
140 | + templet: ` | ||
141 | + <div> | ||
142 | + {{# | ||
143 | + var actionTypeEnum = { | ||
144 | + '1': '迁入', | ||
145 | + '2': '迁出', | ||
146 | + '3': '转移', | ||
147 | + '4': '更换', | ||
148 | + '5': '新增', | ||
149 | + '6': '带走维修' | ||
150 | + }; | ||
151 | + var actionTypeStr = actionTypeEnum[d.actionType]; | ||
152 | + actionTypeStr = actionTypeStr ? actionTypeStr : d.actionType; | ||
153 | + }} | ||
154 | + {{actionTypeStr}} | ||
155 | + </div> | ||
156 | + ` | ||
157 | + }, { | ||
158 | + field: 'enterDevices', title: '设备数量', align: 'center', | ||
159 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-device">{{d.enterDevices.length}}</span></div>' | ||
160 | + }, { | ||
161 | + field: 'reason', title: '进入事由', align: 'center', | ||
162 | + }, { | ||
163 | + field: 'lastPlace', title: '原物理位置', align: 'center', | ||
164 | + }, { | ||
165 | + field: 'localPlace', title: '现物理位置', align: 'center', | ||
166 | + }, { | ||
167 | + field: 'enterTime', title: '进入时间', align: 'center', | ||
168 | + }, { | ||
169 | + field: 'outTime', title: '出来时间', align: 'center', | ||
170 | + }, { | ||
171 | + field: 'machineRoomLeader', title: '设备负责人', align: 'center', | ||
172 | + }, { | ||
173 | + field: 'integration', title: '总集成', align: 'center', | ||
174 | + }, { | ||
175 | + field: 'operationUser', title: '运维负责人', align: 'center', | ||
176 | + }, { | ||
177 | + field: 'watchkeeper', title: '机房值班人', align: 'center', | ||
178 | + } | ||
179 | + ]], | ||
180 | + done: function () { | ||
181 | + //获取人员列表 | ||
182 | + $('.view-device').on('click', function () { | ||
183 | + openDeviceList($(this).data('id')) | ||
184 | + }) | ||
185 | + | ||
186 | + } | ||
187 | + }); | ||
188 | + } | ||
189 | + // 加载设备出入表格 | ||
190 | + function renderFittingFixListTable() { | ||
191 | + var conditions = form.val('form-enterStaff-condition'); | ||
192 | + | ||
193 | + Object.assign(conditions, { | ||
194 | + access_token: accessToken, | ||
195 | + createtime: createTime, | ||
196 | + viewMode: 'true', | ||
197 | + dateLimit: dateLimit | ||
198 | + }); | ||
199 | + table.render({ | ||
200 | + elem: '#fitting-table', | ||
201 | + url: domainName + '/api-room/machineRoom/findMachineRoomEnterDeviceRecords?docType=2', | ||
202 | + where: conditions, | ||
203 | + height: 'full-360', | ||
204 | + page: { | ||
205 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
206 | + theme: '#1E9FFF' | ||
207 | + }, | ||
208 | + end: function (e) { | ||
209 | + form.render() | ||
210 | + }, | ||
211 | + limit: common.limit, | ||
212 | + limits: common.limits, | ||
213 | + even: true, | ||
214 | + cols: [[{ | ||
215 | + field: 'machineRoomName', title: '机房', align: 'center', | ||
216 | + }, { | ||
217 | + field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { | ||
218 | + if(d.manufacturerId == '0'){ | ||
219 | + return d.manufacturerOther; | ||
220 | + }else { | ||
221 | + return d.manufacturerName; | ||
222 | + } | ||
223 | + } | ||
224 | + }, { | ||
225 | + field: 'applyUser', title: '申请人', align: 'center', | ||
226 | + }, { | ||
227 | + field: 'phone', title: '联系方式', align: 'center', | ||
228 | + }, { | ||
229 | + field: 'actionType', title: '更换配件类型', align: 'center', | ||
230 | + templet: ` | ||
231 | + <div> | ||
232 | + {{# | ||
233 | + var actionTypeEnum = { | ||
234 | + '1': '迁入', | ||
235 | + '2': '迁出', | ||
236 | + '3': '转移', | ||
237 | + '4': '更换', | ||
238 | + '5': '新增', | ||
239 | + '6': '带走维修' | ||
240 | + }; | ||
241 | + var actionTypeStr = actionTypeEnum[d.actionType]; | ||
242 | + actionTypeStr = actionTypeStr ? actionTypeStr : d.actionType; | ||
243 | + }} | ||
244 | + {{actionTypeStr}} | ||
245 | + </div> | ||
246 | + ` | ||
247 | + }, { | ||
248 | + field: 'deviceModel', title: '设备型号', align: 'center', | ||
249 | + }, { | ||
250 | + field: 'localPlace', title: '设备物理位置', align: 'center', | ||
251 | + }, { | ||
252 | + field: 'fixFittings', title: '配件数量', align: 'center', | ||
253 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-fitting">{{d.enterFittings.length}}</span></div>' | ||
254 | + }, { | ||
255 | + field: 'reason', title: '更换事由', align: 'center', | ||
256 | + }, { | ||
257 | + field: 'enterTime', title: '进入时间', align: 'center', | ||
258 | + }, { | ||
259 | + field: 'outTime', title: '出来时间', align: 'center', | ||
260 | + }, { | ||
261 | + field: 'machineRoomLeader', title: '设备负责人', align: 'center', | ||
262 | + }, { | ||
263 | + field: 'integration', title: '总集成', align: 'center', | ||
264 | + }, { | ||
265 | + field: 'operationUser', title: '运维负责人', align: 'center', | ||
266 | + }, { | ||
267 | + field: 'watchkeeper', title: '机房值班人', align: 'center', | ||
268 | + } | ||
269 | + ]], | ||
270 | + done: function () { | ||
271 | + //获取人员列表 | ||
272 | + $('.view-fitting').on('click', function () { | ||
273 | + openFittingList($(this).data('id')) | ||
274 | + }) | ||
275 | + | ||
276 | + } | ||
277 | + }); | ||
278 | + } | ||
279 | + //新增日报 | ||
280 | + $('#device_create').on('click', function () { | ||
281 | + openDeviceForm() | ||
282 | + }) | ||
283 | + | ||
284 | + //新增/编辑表单 | ||
285 | + function openDeviceForm(id) { | ||
286 | + var title = id ? '编辑' : '新增' | ||
287 | + common.openWin('machineroom/deviceAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
288 | + $("#device-form-save-id").trigger("click"); | ||
289 | + },null,null,function done() { | ||
290 | + reloadAllChange(); | ||
291 | + }) | ||
292 | + } | ||
293 | + | ||
294 | + //查看更换配件列表 | ||
295 | + function openFittingList(id) { | ||
296 | + | ||
297 | + var title = '更换配件列表' | ||
298 | + | ||
299 | + common.openWin('machineroom/fittingList', title, {id: id}, ['确定', '取消']) | ||
300 | + } | ||
301 | + //查看进出设备列表 | ||
302 | + function openDeviceList(id) { | ||
303 | + | ||
304 | + var title = '出入设备列表' | ||
305 | + | ||
306 | + common.openWin('machineroom/deviceList', title, {id: id}, ['确定', '取消']) | ||
307 | + } | ||
308 | + | ||
309 | + // 加载查询条件下拉框 | ||
310 | + function loadConditionSelect() { | ||
311 | + admin.req({ | ||
312 | + url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' | ||
313 | + }).done(function (response) { | ||
314 | + var options = "<option value=''>=工作单位=</option>"; | ||
315 | + $.each(response.data, function (i, v) { | ||
316 | + options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" | ||
317 | + }); | ||
318 | + options += "<option value='0'>其他</option>"; | ||
319 | + $('#slt-staff-group').html(options); | ||
320 | + form.render(); | ||
321 | + }); | ||
322 | + } | ||
323 | + | ||
324 | + | ||
325 | + // 各单位维修情况 | ||
326 | + function loadEnterDeviceChart() { | ||
327 | + var conditions = {}; | ||
328 | + Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: ''}); | ||
329 | + admin.req({ | ||
330 | + url: domainName + '/api-room/machineRoom/findMachineRoomEnterDeviceRecordsForGroup', | ||
331 | + data: conditions | ||
332 | + }).done(function (response) { | ||
333 | + var chartData = response.map; | ||
334 | + var groupList = chartData.groupList; | ||
335 | + var deviceList = chartData.deviceList; | ||
336 | + var fittingList = chartData.fittingList; | ||
337 | + var totalList = chartData.totalList; | ||
338 | + var xData = []; | ||
339 | + var groupData = []; | ||
340 | + $.each(groupList, function (i, v) { | ||
341 | + xData.push(v); | ||
342 | + groupData.push({ | ||
343 | + name: v, | ||
344 | + value: 1 | ||
345 | + }); | ||
346 | + }); | ||
347 | + var series = [{ | ||
348 | + | ||
349 | + name: '设备进出', | ||
350 | + data: deviceList, | ||
351 | + barWidth: 20, | ||
352 | + type: 'bar', | ||
353 | + stack: 'alarm', | ||
354 | + emphasis: { | ||
355 | + focus: 'series' | ||
356 | + }, | ||
357 | + itemStyle: { | ||
358 | + color: "#1e9fff" | ||
359 | + } | ||
360 | + },{ | ||
361 | + name: '配件更换', | ||
362 | + data: fittingList, | ||
363 | + barWidth: 20, | ||
364 | + type: 'bar', | ||
365 | + stack: 'alarm', | ||
366 | + emphasis: { | ||
367 | + focus: 'series' | ||
368 | + }, | ||
369 | + itemStyle: { | ||
370 | + color: "#FF7E00" | ||
371 | + }, | ||
372 | + label: { | ||
373 | + show: true, | ||
374 | + position: 'top', | ||
375 | + textStyle: { | ||
376 | + color: '#555' | ||
377 | + }, | ||
378 | + formatter: function (data) { | ||
379 | + return totalList[data.dataIndex] | ||
380 | + } | ||
381 | + } | ||
382 | + | ||
383 | + }]; | ||
384 | + /** | ||
385 | + 双X轴标签对应,伪实现思路: | ||
386 | + 底部的标签也是柱状图,对应包含的区域为上方X轴条数占总数的比例,设为宽度即可 | ||
387 | + */ | ||
388 | + var option = { | ||
389 | + title: { | ||
390 | + text: '设备出入和配件更换图示', | ||
391 | + textStyle: { | ||
392 | + color: '#00D81E06', | ||
393 | + fontSize: 5 | ||
394 | + } | ||
395 | + }, | ||
396 | + tooltip: { | ||
397 | + trigger: 'axis', | ||
398 | + axisPointer: { | ||
399 | + type: 'shadow' | ||
400 | + } | ||
401 | + }, | ||
402 | + toolbox: { | ||
403 | + show: true, | ||
404 | + feature: { | ||
405 | + saveAsImage: {} | ||
406 | + }, | ||
407 | + right: 10 | ||
408 | + }, | ||
409 | + legend: { | ||
410 | + data: ['设备进出', '配件更换'], | ||
411 | + selectedMode: false | ||
412 | + }, | ||
413 | + grid: [{ | ||
414 | + top: 40, | ||
415 | + bottom: 70, | ||
416 | + left: 50, | ||
417 | + right: 5 | ||
418 | + }], | ||
419 | + xAxis: [{ | ||
420 | + type: 'category', | ||
421 | + data: xData, | ||
422 | + axisLabel: { | ||
423 | + color: '#333', | ||
424 | + show: true, | ||
425 | + interval:0, | ||
426 | + rotate:15 | ||
427 | + }, | ||
428 | + axisLine: { | ||
429 | + lineStyle: { | ||
430 | + color: '#e7e7e7' | ||
431 | + } | ||
432 | + }, | ||
433 | + axisTick: { | ||
434 | + lineStyle: { | ||
435 | + color: '#e7e7e7' | ||
436 | + } | ||
437 | + }, | ||
438 | + zlevel: 1 | ||
439 | + }], | ||
440 | + yAxis: [{ | ||
441 | + type: 'value', | ||
442 | + gridIndex: 0, | ||
443 | + axisLabel: { | ||
444 | + color: '#333' | ||
445 | + }, | ||
446 | + splitLine: { | ||
447 | + lineStyle: { | ||
448 | + type: 'dashed' | ||
449 | + } | ||
450 | + }, | ||
451 | + axisLine: { | ||
452 | + lineStyle: { | ||
453 | + color: '#ccc' | ||
454 | + } | ||
455 | + }, | ||
456 | + axisTick: { | ||
457 | + lineStyle: { | ||
458 | + color: '#ccc' | ||
459 | + } | ||
460 | + } | ||
461 | + }], | ||
462 | + series: series | ||
463 | + }; | ||
464 | + timeChart.setOption(option) | ||
465 | + }); | ||
466 | + } | ||
467 | + | ||
468 | + | ||
469 | + // 图表,表格重新加载 | ||
470 | + function reloadAllChange() { | ||
471 | + renderEnterDeviceListTable(); | ||
472 | + renderFittingFixListTable() | ||
473 | + loadEnterDeviceChart(); | ||
474 | + } | ||
475 | + }); | ||
476 | +}); |
1 | +/** 资产维修记录查看 */ | ||
2 | +layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydate', 'element'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var table = layui.table; | ||
6 | + var admin = layui.admin; | ||
7 | + var common = layui.common; | ||
8 | + var laydate = layui.laydate; | ||
9 | + var element = layui.element; | ||
10 | + | ||
11 | + exports('enterStaff', function () { | ||
12 | + var sessions = layui.sessions; | ||
13 | + var accessToken = sessions.getToken().access_token; | ||
14 | + var domainName = common.domainName; | ||
15 | + var timeChart = echarts.init(document.getElementById('chart-time-record')); | ||
16 | + | ||
17 | + var dateLimit = "" | ||
18 | + var createTime = "month" | ||
19 | + | ||
20 | + | ||
21 | + //日期范围选择 | ||
22 | + laydate.render({ | ||
23 | + elem: '#dateLimit' | ||
24 | + , range: '~', | ||
25 | + done: function (value) { | ||
26 | + dateLimit = value | ||
27 | + if (dateLimit == '') { | ||
28 | + $('[data-period="month"]').click() | ||
29 | + } else { | ||
30 | + $.each($("button.date"), function (i, e) { | ||
31 | + var $dom = $(e); | ||
32 | + if ($dom.hasClass("active")) { | ||
33 | + $dom.removeClass("active") | ||
34 | + } | ||
35 | + }) | ||
36 | + reloadAllChange() | ||
37 | + } | ||
38 | + } | ||
39 | + }); | ||
40 | + | ||
41 | + form.render(); | ||
42 | + loadEnterStaffChart(); | ||
43 | + loadWorkReportTable(); | ||
44 | + loadConditionSelect(); | ||
45 | + | ||
46 | + | ||
47 | + //监听Esc事件 | ||
48 | + $(document).keyup(function (event) { | ||
49 | + if (event.keyCode === 27) { | ||
50 | + layer.closeAll(); | ||
51 | + } | ||
52 | + }); | ||
53 | + | ||
54 | + | ||
55 | + // 日期方式选择 | ||
56 | + $('#btns-staff-time button').click(function () { | ||
57 | + $.each($("button.date"), function (i, e) { | ||
58 | + var $dom = $(e); | ||
59 | + if ($dom.hasClass("active")) { | ||
60 | + $dom.removeClass("active") | ||
61 | + } | ||
62 | + }) | ||
63 | + $("#dateLimit").val('') | ||
64 | + dateLimit = '' | ||
65 | + $("#btns-staff-time button").removeClass("active"); | ||
66 | + $(this).addClass("active"); | ||
67 | + createTime = ($(this).data("period")) | ||
68 | + reloadAllChange(); | ||
69 | + }); | ||
70 | + | ||
71 | + // 回车搜索 | ||
72 | + $('[lay-filter="form-enterStaff-condition"] input').keydown(function (e) { | ||
73 | + if (e.keyCode === 13) { | ||
74 | + reloadAllChange(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + // 下拉框改变搜索 | ||
79 | + form.on('select(slt-staff-group)', reloadAllChange); | ||
80 | + // 加载工作汇报表格 | ||
81 | + function loadWorkReportTable() { | ||
82 | + var conditions = form.val('form-enterStaff-condition'); | ||
83 | + | ||
84 | + Object.assign(conditions, { | ||
85 | + access_token: accessToken, | ||
86 | + createtime: createTime, | ||
87 | + viewMode: 'true', | ||
88 | + dateLimit: dateLimit | ||
89 | + }); | ||
90 | + table.render({ | ||
91 | + elem: '#table-staff-view', | ||
92 | + url: domainName + '/api-room/machineRoom/findMachineRoomEnterRecords', | ||
93 | + where: conditions, | ||
94 | + height: 'full-360', | ||
95 | + page: { | ||
96 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
97 | + theme: '#1E9FFF' | ||
98 | + }, | ||
99 | + end: function (e) { | ||
100 | + form.render() | ||
101 | + }, | ||
102 | + limit: common.limit, | ||
103 | + limits: common.limits, | ||
104 | + even: true, | ||
105 | + cols: [[{ | ||
106 | + field: 'machineRoomName', title: '机房', align: 'center', | ||
107 | + }, { | ||
108 | + field: 'manufacturerName', title: '工作单位', align: 'center',templet: function (d) { | ||
109 | + if(d.manufacturerId == '0'){ | ||
110 | + return d.manufacturerOther; | ||
111 | + }else { | ||
112 | + return d.manufacturerName; | ||
113 | + } | ||
114 | + } | ||
115 | + }, { | ||
116 | + field: 'applyUser', title: '申请人', align: 'center', | ||
117 | + }, { | ||
118 | + field: 'phone', title: '联系方式', align: 'center', | ||
119 | + }, { | ||
120 | + field: 'enterStaffs', title: '进入人数', align: 'center', | ||
121 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-staff">{{d.enterStaffs.length}}</span></div>' | ||
122 | + }, { | ||
123 | + field: 'reason', title: '进入事由', align: 'center', | ||
124 | + }, { | ||
125 | + field: 'belongings', title: '携带物品', align: 'center', | ||
126 | + }, { | ||
127 | + field: 'enterTime', title: '进入时间', align: 'center', | ||
128 | + }, { | ||
129 | + field: 'outTime', title: '出来时间', align: 'center', | ||
130 | + }, { | ||
131 | + field: 'machineRoomLeader', title: '机房负责人', align: 'center', | ||
132 | + } | ||
133 | + , { | ||
134 | + field: 'projectLeader', title: '项目管理员', align: 'center', | ||
135 | + }, { | ||
136 | + field: 'operationUser', title: '运维负责人', align: 'center', | ||
137 | + }, { | ||
138 | + field: 'watchkeeper', title: '值班人', align: 'center', | ||
139 | + } | ||
140 | + ]], | ||
141 | + done: function () { | ||
142 | + //获取人员列表 | ||
143 | + $('.view-staff').on('click', function () { | ||
144 | + openStaffList($(this).data('id')) | ||
145 | + }) | ||
146 | + | ||
147 | + } | ||
148 | + }); | ||
149 | + } | ||
150 | + | ||
151 | + //新增日报 | ||
152 | + $('#staff_create').on('click', function () { | ||
153 | + openWorkReportForm() | ||
154 | + }) | ||
155 | + | ||
156 | + //新增/编辑表单 | ||
157 | + function openWorkReportForm(id) { | ||
158 | + var title = id ? '编辑' : '新增' | ||
159 | + common.openWin('machineroom/staffAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
160 | + $("#staff-form-save-id").trigger("click"); | ||
161 | + },null,null,function done() { | ||
162 | + reloadAllChange(); | ||
163 | + }) | ||
164 | + } | ||
165 | + | ||
166 | + //查看附件/接收人列表 | ||
167 | + function openStaffList(id) { | ||
168 | + | ||
169 | + var title = '进入人员列表' | ||
170 | + | ||
171 | + common.openWin('machineroom/staffList', title, {id: id}, ['确定', '取消']) | ||
172 | + } | ||
173 | + | ||
174 | + // 加载查询条件下拉框 | ||
175 | + function loadConditionSelect() { | ||
176 | + admin.req({ | ||
177 | + url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' | ||
178 | + }).done(function (response) { | ||
179 | + var options = "<option value=''>=工作单位=</option>"; | ||
180 | + $.each(response.data, function (i, v) { | ||
181 | + options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" | ||
182 | + }); | ||
183 | + options += "<option value='0'>其他</option>"; | ||
184 | + $('#slt-staff-group').html(options); | ||
185 | + form.render(); | ||
186 | + }); | ||
187 | + } | ||
188 | + | ||
189 | + | ||
190 | + // 各单位维修情况 | ||
191 | + function loadEnterStaffChart() { | ||
192 | + var conditions = {}; | ||
193 | + Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: ''}); | ||
194 | + admin.req({ | ||
195 | + url: domainName + '/api-room/machineRoom/findMachineRoomEnterRecordsForGroup', | ||
196 | + data: conditions | ||
197 | + }).done(function (response) { | ||
198 | + var chartData = response.map; | ||
199 | + var groupList = chartData.groupList; | ||
200 | + var countList = chartData.countList; | ||
201 | + var xData = []; | ||
202 | + var groupData = []; | ||
203 | + $.each(groupList, function (i, v) { | ||
204 | + xData.push(v); | ||
205 | + groupData.push({ | ||
206 | + name: v, | ||
207 | + value: 1 | ||
208 | + }); | ||
209 | + }); | ||
210 | + var series = [{ | ||
211 | + name: '进入人数', | ||
212 | + data: countList, | ||
213 | + barWidth: 20, | ||
214 | + type: 'bar', | ||
215 | + label: { | ||
216 | + show: true, | ||
217 | + position: 'top', | ||
218 | + textStyle: { | ||
219 | + color: '#555' | ||
220 | + }, | ||
221 | + formatter: function (data) { | ||
222 | + return countList[data.dataIndex] | ||
223 | + } | ||
224 | + }, | ||
225 | + itemStyle: { | ||
226 | + normal: { | ||
227 | + color: (params) => { | ||
228 | + var colors = ['#b6c2ff', '#96edc1', '#fcb75b']; | ||
229 | + return colors[params.dataIndex % 3] | ||
230 | + } | ||
231 | + } | ||
232 | + } | ||
233 | + | ||
234 | + }]; | ||
235 | + /** | ||
236 | + 双X轴标签对应,伪实现思路: | ||
237 | + 底部的标签也是柱状图,对应包含的区域为上方X轴条数占总数的比例,设为宽度即可 | ||
238 | + */ | ||
239 | + var option = { | ||
240 | + title: { | ||
241 | + text: '设备出入和配件更换图示', | ||
242 | + textStyle: { | ||
243 | + color: '#00D81E06', | ||
244 | + fontSize: 5 | ||
245 | + } | ||
246 | + }, | ||
247 | + tooltip: { | ||
248 | + trigger: 'axis', | ||
249 | + axisPointer: { | ||
250 | + type: 'shadow' | ||
251 | + } | ||
252 | + }, | ||
253 | + toolbox: { | ||
254 | + show: true, | ||
255 | + feature: { | ||
256 | + saveAsImage: {} | ||
257 | + }, | ||
258 | + right: 10 | ||
259 | + }, | ||
260 | + legend: { | ||
261 | + data: ['人员进出'], | ||
262 | + selectedMode: false | ||
263 | + }, | ||
264 | + grid: [{ | ||
265 | + top: 40, | ||
266 | + bottom: 70, | ||
267 | + left: 50, | ||
268 | + right: 5 | ||
269 | + }], | ||
270 | + xAxis: [{ | ||
271 | + type: 'category', | ||
272 | + data: xData, | ||
273 | + axisLabel: { | ||
274 | + color: '#333', | ||
275 | + show: true, | ||
276 | + interval:0, | ||
277 | + rotate:15 | ||
278 | + }, | ||
279 | + axisLine: { | ||
280 | + lineStyle: { | ||
281 | + color: '#e7e7e7' | ||
282 | + } | ||
283 | + }, | ||
284 | + axisTick: { | ||
285 | + lineStyle: { | ||
286 | + color: '#e7e7e7' | ||
287 | + } | ||
288 | + }, | ||
289 | + zlevel: 1 | ||
290 | + }], | ||
291 | + yAxis: [{ | ||
292 | + type: 'value', | ||
293 | + gridIndex: 0, | ||
294 | + axisLabel: { | ||
295 | + color: '#333' | ||
296 | + }, | ||
297 | + splitLine: { | ||
298 | + lineStyle: { | ||
299 | + type: 'dashed' | ||
300 | + } | ||
301 | + }, | ||
302 | + axisLine: { | ||
303 | + lineStyle: { | ||
304 | + color: '#ccc' | ||
305 | + } | ||
306 | + }, | ||
307 | + axisTick: { | ||
308 | + lineStyle: { | ||
309 | + color: '#ccc' | ||
310 | + } | ||
311 | + } | ||
312 | + }], | ||
313 | + series: series | ||
314 | + }; | ||
315 | + timeChart.setOption(option) | ||
316 | + }); | ||
317 | + } | ||
318 | + | ||
319 | + | ||
320 | + // 图表,表格重新加载 | ||
321 | + function reloadAllChange() { | ||
322 | + loadWorkReportTable(); | ||
323 | + loadEnterStaffChart(); | ||
324 | + | ||
325 | + | ||
326 | + } | ||
327 | + }); | ||
328 | +}); |
1 | +//备份失败列表 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports("fittingList", function (d) { | ||
14 | + var accessToken = session.getToken()['access_token'] | ||
15 | + | ||
16 | + createFittingTable() | ||
17 | + function dateForm(time) { | ||
18 | + var unixTimestamp = new Date(time); | ||
19 | + var commonTime = unixTimestamp.toLocaleString(); | ||
20 | + return commonTime | ||
21 | + } | ||
22 | + //渲染附件表格 | ||
23 | + function createFittingTable() { | ||
24 | + var fittingTable = table.render({ | ||
25 | + elem: '#fittingTable', | ||
26 | + url: domainName + '/api-room/machineRoom/findFittingByRecordId', | ||
27 | + where: { | ||
28 | + access_token: accessToken, | ||
29 | + recordId: d.id | ||
30 | + }, | ||
31 | + height: 'full', | ||
32 | + end: function (e) { | ||
33 | + form.render() | ||
34 | + }, | ||
35 | + even: true, | ||
36 | + cols: [[ | ||
37 | + {type: 'numbers', title: '序号'}, | ||
38 | + { | ||
39 | + field: 'fittingName', title: '配件名称', align: 'center', | ||
40 | + }, { | ||
41 | + field: 'fittingSN', title: '配件snCode', align: 'center', | ||
42 | + }, { | ||
43 | + field: 'newfittingSN', title: '新配件snCode', align: 'center', | ||
44 | + }, { | ||
45 | + field: 'deviceModel', title: '所属设备型号', align: 'center', | ||
46 | + } | ||
47 | + ]], | ||
48 | + done: function () { | ||
49 | + } | ||
50 | + }) | ||
51 | + } | ||
52 | + | ||
53 | + }) | ||
54 | +}) |
@@ -23,7 +23,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | @@ -23,7 +23,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function | ||
23 | function createAttachmentTable() { | 23 | function createAttachmentTable() { |
24 | var attachmentTable = table.render({ | 24 | var attachmentTable = table.render({ |
25 | elem: '#attachmentTable', | 25 | elem: '#attachmentTable', |
26 | - url: domainName + '/api-web/bResource/assetsrepair/getAttaById', | 26 | + url: domainName + '/api-room/assetsrepair/getAttaById', |
27 | where: { | 27 | where: { |
28 | access_token: accessToken, | 28 | access_token: accessToken, |
29 | id: d.id | 29 | id: d.id |
1 | +/** 线路调整记录查看 */ | ||
2 | +layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydate', 'element'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var table = layui.table; | ||
6 | + var admin = layui.admin; | ||
7 | + var common = layui.common; | ||
8 | + var laydate = layui.laydate; | ||
9 | + var element = layui.element; | ||
10 | + | ||
11 | + exports('routeAdjust', function () { | ||
12 | + var sessions = layui.sessions; | ||
13 | + var accessToken = sessions.getToken().access_token; | ||
14 | + var domainName = common.domainName; | ||
15 | + var companyChart = echarts.init(document.getElementById('chart-company-report')); | ||
16 | + var adjustTypeChart = echarts.init(document.getElementById('chart-adjustType-report')); | ||
17 | + var dateLimit = ""; | ||
18 | + var createTime = ""; | ||
19 | + | ||
20 | + //日期范围选择 | ||
21 | + laydate.render({ | ||
22 | + elem: '#dateLimit' | ||
23 | + , range: '~', | ||
24 | + done: function (value) { | ||
25 | + dateLimit = value | ||
26 | + if (dateLimit == '') { | ||
27 | + $('[data-period="month"]').click() | ||
28 | + } else { | ||
29 | + $.each($("button.date"), function (i, e) { | ||
30 | + var $dom = $(e); | ||
31 | + if ($dom.hasClass("active")) { | ||
32 | + $dom.removeClass("active") | ||
33 | + } | ||
34 | + }) | ||
35 | + reloadAllChange() | ||
36 | + } | ||
37 | + } | ||
38 | + }); | ||
39 | + | ||
40 | + form.render(); | ||
41 | + loadOrgRouteAdjustmentChart(); | ||
42 | + loadRouteAdjustTypeChart(); | ||
43 | + loadWorkReportTable(); | ||
44 | + loadConditionSelect(); | ||
45 | + | ||
46 | + | ||
47 | + //监听Esc事件 | ||
48 | + $(document).keyup(function (event) { | ||
49 | + if (event.keyCode === 27) { | ||
50 | + layer.closeAll(); | ||
51 | + } | ||
52 | + }); | ||
53 | + | ||
54 | + | ||
55 | + // 日期方式选择 | ||
56 | + $('#btns-routeAdjust-time button').click(function () { | ||
57 | + $.each($("button.date"), function (i, e) { | ||
58 | + var $dom = $(e); | ||
59 | + if ($dom.hasClass("active")) { | ||
60 | + $dom.removeClass("active") | ||
61 | + } | ||
62 | + }) | ||
63 | + $("#dateLimit").val('') | ||
64 | + dateLimit = '' | ||
65 | + $("#btns-routeAdjust-time button").removeClass("active"); | ||
66 | + $(this).addClass("active"); | ||
67 | + createTime = ($(this).data("period")) | ||
68 | + reloadAllChange(); | ||
69 | + }); | ||
70 | + | ||
71 | + // 回车搜索 | ||
72 | + $('[lay-filter="form-routeAdjust-condition"] input').keydown(function (e) { | ||
73 | + if (e.keyCode === 13) { | ||
74 | + reloadAllChange(); | ||
75 | + } | ||
76 | + }); | ||
77 | + | ||
78 | + // 下拉框改变搜索 | ||
79 | + form.on('select(slt-route-group)', reloadAllChange); | ||
80 | + form.on('select(slt-route-org)', reloadAllChange); | ||
81 | + | ||
82 | + // 加载工作汇报表格 | ||
83 | + function loadWorkReportTable() { | ||
84 | + var conditions = form.val('form-routeAdjust-condition'); | ||
85 | + | ||
86 | + Object.assign(conditions, { | ||
87 | + access_token: accessToken, | ||
88 | + createtime: createTime, | ||
89 | + viewMode: 'true', | ||
90 | + dateLimit: dateLimit | ||
91 | + }); | ||
92 | + table.render({ | ||
93 | + elem: '#table-routeAdjust-view', | ||
94 | + url: domainName + '/api-room/machineRoom/findMachineRoomRouteAdjustmentRecords', | ||
95 | + where: conditions, | ||
96 | + height: 'full-360', | ||
97 | + page: { | ||
98 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], | ||
99 | + theme: '#1E9FFF' | ||
100 | + }, | ||
101 | + end: function (e) { | ||
102 | + form.render() | ||
103 | + }, | ||
104 | + limit: common.limit, | ||
105 | + limits: common.limits, | ||
106 | + even: true, | ||
107 | + cols: [[ { | ||
108 | + type: 'numbers', title: '序号' | ||
109 | + }, { | ||
110 | + field: 'contractId', title: '合同编号', align: 'center' | ||
111 | + }, { | ||
112 | + field: 'adjustTypeName', title: '调整要求', align: 'center' | ||
113 | + }, { | ||
114 | + field: 'localCityName', title: '城市A', align: 'center' | ||
115 | + }, { | ||
116 | + field: 'targetCityName', title: '城市Z', align: 'center' | ||
117 | + },{ | ||
118 | + field: 'applyCity', title: '申请单位', align: 'center' | ||
119 | + }, { | ||
120 | + field: 'attachmentList', title: '附件', align: 'center', | ||
121 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-attachment">{{d.attachmentList.length}}</span></div>' | ||
122 | + }, { | ||
123 | + field: 'busyType', title: '业务类型', align: 'center' | ||
124 | + }, { | ||
125 | + field: 'portSpeed', title: '端口速率', align: 'center' | ||
126 | + }, { | ||
127 | + field: 'electricSpeed', title: '线路速率', align: 'center' | ||
128 | + }, { | ||
129 | + field: 'routeAdjustList', title: '线路数量', align: 'center', | ||
130 | + templet: '<div><span data-id="{{d.id}}" class="layui-table-link view-routeAdjust">{{d.routeAdjustList.length}}</span></div>' | ||
131 | + }, { | ||
132 | + field: 'portCount', title: '端口数量', align: 'center', | ||
133 | + templet: '<div><span data-id="{{d.id}}">{{d.routeAdjustList.length*2}}</span></div>' | ||
134 | + }, { | ||
135 | + field: 'adjustTime', title: '时间', align: 'center' | ||
136 | + } | ||
137 | + ]], | ||
138 | + done: function () { | ||
139 | + //获取线路列表 | ||
140 | + $('.view-routeAdjust').on('click', function () { | ||
141 | + openRouteAdjustList("",$(this).data('id')) | ||
142 | + }) | ||
143 | + //获取线路列表 | ||
144 | + $('.view-attachment').on('click', function () { | ||
145 | + openRouteAdjustList("attachment",$(this).data('id')) | ||
146 | + }) | ||
147 | + | ||
148 | + } | ||
149 | + }); | ||
150 | + } | ||
151 | + | ||
152 | + //新增日报 | ||
153 | + $('#routeAdjust_create').on('click', function () { | ||
154 | + openWorkReportForm() | ||
155 | + }) | ||
156 | + | ||
157 | + //新增/编辑表单 | ||
158 | + function openWorkReportForm(id) { | ||
159 | + var title = id ? '编辑' : '新增' | ||
160 | + common.openWin('machineroom/routeAdjustAdd', title, {id: id}, ['保存', '取消'], function f() { | ||
161 | + $("#routeAdjust-form-save-id").trigger("click"); | ||
162 | + },null,null,function done() { | ||
163 | + reloadAllChange(); | ||
164 | + }) | ||
165 | + } | ||
166 | + | ||
167 | + //查看附件/调整信息列表 | ||
168 | + function openRouteAdjustList(type,id) { | ||
169 | + var title = '线路调整信息列表'; | ||
170 | + if(type!='') { | ||
171 | + title = "附件"; | ||
172 | + common.openWin('machineroom/routeAttachmentList', title, {id: id,type:type}, ['确定', '取消']) | ||
173 | + }else { | ||
174 | + common.openWin('machineroom/routeAdjustDetailList', title, {id: id}, ['确定', '取消']) | ||
175 | + } | ||
176 | + } | ||
177 | + | ||
178 | + // 加载查询条件下拉框 | ||
179 | + function loadConditionSelect() { | ||
180 | + admin.req({ | ||
181 | + url: domainName + '/api-room/machineRoom/findRouteAjustType' | ||
182 | + }).done(function (response) { | ||
183 | + var options = "<option value=''>=调整要求=</option>"; | ||
184 | + | ||
185 | + $.each(response.data, function (i, v) { | ||
186 | + | ||
187 | + options += "<option value='" + v.adjustCode + "'>" + v.adjustType + "</option>" | ||
188 | + }); | ||
189 | + $('#slt-route-group').html(options); | ||
190 | + form.render(); | ||
191 | + }); | ||
192 | + admin.req({ | ||
193 | + url: domainName + '/api-room/assetsrepair/findAssetsRepairList' | ||
194 | + }).done(function (response) { | ||
195 | + var options = "<option value=''>=城市A选择=</option>"; | ||
196 | + $.each(response.data, function (i, v) { | ||
197 | + | ||
198 | + options += "<option value='" + v.orgCode + "'>" + v.orgName + "</option>" | ||
199 | + }); | ||
200 | + $('#slt-route-org').html(options); | ||
201 | + form.render(); | ||
202 | + }); | ||
203 | + } | ||
204 | + function loadRouteAdjustTypeChart(){ | ||
205 | + var conditions = {}; | ||
206 | + Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',groupBy:'adjustTypeName'}); | ||
207 | + admin.req({ | ||
208 | + url: domainName + '/api-room/machineRoom/findMachineRoomRouteAdjustmentRecordsForGroup', | ||
209 | + data: conditions | ||
210 | + }).done(function (response) { | ||
211 | + | ||
212 | + var chartData = response.map; | ||
213 | + let echartData = []; | ||
214 | + let total = 0 | ||
215 | + if(chartData){ | ||
216 | + $.map(chartData, function (v, i) { | ||
217 | + total+=v; | ||
218 | + echartData.push({ | ||
219 | + name: i, | ||
220 | + value: v | ||
221 | + }); | ||
222 | + }); | ||
223 | + } | ||
224 | + var formatNumber = function (num) { | ||
225 | + let reg = /(?=(\B)(\d{3})+$)/g; | ||
226 | + return num.toString().replace(reg, ','); | ||
227 | + }; | ||
228 | + | ||
229 | + var option = { | ||
230 | + color: ['#367bec', '#00cefc'], | ||
231 | + title: [{ | ||
232 | + text: '{val|' + total + '}', | ||
233 | + top: 'center', | ||
234 | + left: 'center', | ||
235 | + textStyle: { | ||
236 | + rich: { | ||
237 | + name: { | ||
238 | + fontSize: 14, | ||
239 | + fontWeight: 'normal', | ||
240 | + color: '#666666', | ||
241 | + padding: [10, 0] | ||
242 | + }, | ||
243 | + val: { | ||
244 | + fontSize: 32, | ||
245 | + fontWeight: 'bold', | ||
246 | + color: '#333333', | ||
247 | + } | ||
248 | + } | ||
249 | + } | ||
250 | + }], | ||
251 | + series: [{ | ||
252 | + type: 'pie', | ||
253 | + radius: ['45%', '60%'], | ||
254 | + center: ['50%', '50%'], | ||
255 | + data: echartData, | ||
256 | + hoverAnimation: false, | ||
257 | + itemStyle: { | ||
258 | + normal: { | ||
259 | + borderWidth: 2 | ||
260 | + } | ||
261 | + }, | ||
262 | + labelLine: { | ||
263 | + normal: { | ||
264 | + length: 20, | ||
265 | + length2: 120, | ||
266 | + lineStyle: { | ||
267 | + color: '#e6e6e6' | ||
268 | + } | ||
269 | + } | ||
270 | + }, | ||
271 | + label: { | ||
272 | + normal: { | ||
273 | + formatter: params => { | ||
274 | + return ( | ||
275 | + '{icon|●}{name|' + params.name + '}{value|' + | ||
276 | + formatNumber(params.value) + '}' | ||
277 | + ); | ||
278 | + }, | ||
279 | + padding: [0, -100, 25, -100], | ||
280 | + rich: { | ||
281 | + icon: { | ||
282 | + fontSize: 16 | ||
283 | + }, | ||
284 | + name: { | ||
285 | + fontSize: 14, | ||
286 | + padding: [0, 10, 0, 4], | ||
287 | + color: '#666666' | ||
288 | + }, | ||
289 | + value: { | ||
290 | + fontSize: 18, | ||
291 | + fontWeight: 'bold', | ||
292 | + color: '#333333' | ||
293 | + } | ||
294 | + } | ||
295 | + } | ||
296 | + }, | ||
297 | + }] | ||
298 | + }; | ||
299 | + adjustTypeChart.setOption(option) | ||
300 | + }); | ||
301 | + } | ||
302 | + | ||
303 | + // 各单位维修情况 | ||
304 | + function loadOrgRouteAdjustmentChart() { | ||
305 | + var conditions = {}; | ||
306 | + Object.assign(conditions, {access_token: accessToken, createtime: createTime, viewMode: '',groupBy:'orgName'}); | ||
307 | + admin.req({ | ||
308 | + url: domainName + '/api-room/machineRoom/findMachineRoomRouteAdjustmentRecordsForGroup', | ||
309 | + data: conditions | ||
310 | + }).done(function (response) { | ||
311 | + var chartData = response.map; | ||
312 | + var groupList = chartData.groupList; | ||
313 | + var countList = chartData.countList; | ||
314 | + var xData = []; | ||
315 | + var groupData = []; | ||
316 | + $.each(groupList, function (i, v) { | ||
317 | + xData.push(v); | ||
318 | + groupData.push({ | ||
319 | + name: v, | ||
320 | + value: 1 | ||
321 | + }); | ||
322 | + }); | ||
323 | + var series = [{ | ||
324 | + name: '线路调整数', | ||
325 | + data: countList, | ||
326 | + barWidth: 20, | ||
327 | + type: 'bar', | ||
328 | + label: { | ||
329 | + show: true, | ||
330 | + position: 'top', | ||
331 | + textStyle: { | ||
332 | + color: '#555' | ||
333 | + }, | ||
334 | + formatter: function (data) { | ||
335 | + return countList[data.dataIndex] | ||
336 | + } | ||
337 | + }, | ||
338 | + itemStyle: { | ||
339 | + normal: { | ||
340 | + color: (params) => { | ||
341 | + var colors = ['#b6c2ff', '#96edc1', '#fcb75b']; | ||
342 | + return colors[params.dataIndex % 3] | ||
343 | + } | ||
344 | + } | ||
345 | + } | ||
346 | + | ||
347 | + }]; | ||
348 | + /** | ||
349 | + 双X轴标签对应,伪实现思路: | ||
350 | + 底部的标签也是柱状图,对应包含的区域为上方X轴条数占总数的比例,设为宽度即可 | ||
351 | + */ | ||
352 | + var option = { | ||
353 | + title: { | ||
354 | + text: '线路调整图示', | ||
355 | + textStyle: { | ||
356 | + color: '#00D81E06', | ||
357 | + fontSize: 5 | ||
358 | + } | ||
359 | + }, | ||
360 | + tooltip: { | ||
361 | + trigger: 'axis', | ||
362 | + axisPointer: { | ||
363 | + type: 'shadow' | ||
364 | + } | ||
365 | + }, | ||
366 | + toolbox: { | ||
367 | + show: true, | ||
368 | + feature: { | ||
369 | + saveAsImage: {} | ||
370 | + }, | ||
371 | + right: 10 | ||
372 | + }, | ||
373 | + legend: { | ||
374 | + data: ['线路调整'], | ||
375 | + selectedMode: false | ||
376 | + }, | ||
377 | + grid: [{ | ||
378 | + top: 40, | ||
379 | + bottom: 70, | ||
380 | + left: 50, | ||
381 | + right: 5 | ||
382 | + }], | ||
383 | + xAxis: [{ | ||
384 | + type: 'category', | ||
385 | + data: xData, | ||
386 | + axisLabel: { | ||
387 | + color: '#333', | ||
388 | + show: true, | ||
389 | + interval:0, | ||
390 | + rotate:15 | ||
391 | + }, | ||
392 | + axisLine: { | ||
393 | + lineStyle: { | ||
394 | + color: '#e7e7e7' | ||
395 | + } | ||
396 | + }, | ||
397 | + axisTick: { | ||
398 | + lineStyle: { | ||
399 | + color: '#e7e7e7' | ||
400 | + } | ||
401 | + }, | ||
402 | + zlevel: 1 | ||
403 | + }], | ||
404 | + yAxis: [{ | ||
405 | + type: 'value', | ||
406 | + gridIndex: 0, | ||
407 | + axisLabel: { | ||
408 | + color: '#333' | ||
409 | + }, | ||
410 | + splitLine: { | ||
411 | + lineStyle: { | ||
412 | + type: 'dashed' | ||
413 | + } | ||
414 | + }, | ||
415 | + axisLine: { | ||
416 | + lineStyle: { | ||
417 | + color: '#ccc' | ||
418 | + } | ||
419 | + }, | ||
420 | + axisTick: { | ||
421 | + lineStyle: { | ||
422 | + color: '#ccc' | ||
423 | + } | ||
424 | + } | ||
425 | + }], | ||
426 | + series: series | ||
427 | + }; | ||
428 | + companyChart.setOption(option) | ||
429 | + }); | ||
430 | + } | ||
431 | + | ||
432 | + | ||
433 | + // 图表,表格重新加载 | ||
434 | + function reloadAllChange() { | ||
435 | + loadWorkReportTable(); | ||
436 | + loadOrgRouteAdjustmentChart(); | ||
437 | + loadRouteAdjustTypeChart(); | ||
438 | + } | ||
439 | + }); | ||
440 | +}); |
1 | +//工作汇报表单 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common','commonDetail', 'sessions', 'xmSelect', 'laydate', 'upload'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions; | ||
10 | + var laydate = layui.laydate; | ||
11 | + var upload = layui.upload; | ||
12 | + var domainName = common.domainName; | ||
13 | + var xmSelect = layui.xmSelect; | ||
14 | + var commonDetail =layui.commonDetail; | ||
15 | + | ||
16 | + //对外暴露的接口 | ||
17 | + exports('routeAdjustAdd', function (data) { | ||
18 | + var accessToken = session.getToken()['access_token'] | ||
19 | + | ||
20 | + var adjustDate = {} | ||
21 | + var uploadInst = {} | ||
22 | + | ||
23 | + var attachmentIds = [] | ||
24 | + var adjustBak = [] | ||
25 | + | ||
26 | + var routeAdjustDetailId = 0; | ||
27 | + | ||
28 | + | ||
29 | + //渲染表单 | ||
30 | + form.render(null, 'add-routeAdjust-form') | ||
31 | + init() | ||
32 | + | ||
33 | + //保存 | ||
34 | + form.on('submit(routeAdjust-form-save-id)', function (res) { | ||
35 | + var value = $('#attachmentInput').val(); | ||
36 | + var adjustArr = adjustBak; | ||
37 | + if (value != '') { | ||
38 | + $('#upload_btn').click(); | ||
39 | + } | ||
40 | + console.log(adjustArr); | ||
41 | + if(adjustArr.length == 0){ | ||
42 | + layer.msg("请先添加线路详细信息"); | ||
43 | + return; | ||
44 | + }else{ | ||
45 | + saveForm() | ||
46 | + } | ||
47 | + }) | ||
48 | + | ||
49 | + //保存 | ||
50 | + function saveForm() { | ||
51 | + layer.load(2) | ||
52 | + var data = form.val('add-routeAdjust-form') | ||
53 | + var params = {} | ||
54 | + params.attachmentIds = attachmentIds.toString() | ||
55 | + delete data['file'] | ||
56 | + delete data['select'] | ||
57 | + params.routeAdjust = JSON.stringify(data) | ||
58 | + params.routeDetailList = adjustBak | ||
59 | + admin.req({ | ||
60 | + url: domainName + '/api-room/machineRoom/routeAdjust/save?access_token=' + accessToken, | ||
61 | + data: JSON.stringify(params), | ||
62 | + type: 'post', | ||
63 | + contentType: "application/json; charset=utf-8", | ||
64 | + done: function (res) { | ||
65 | + if (res.success) { | ||
66 | + layer.msg(res.msg, { | ||
67 | + offset: '15px', | ||
68 | + icon: 1, | ||
69 | + time: 1000, | ||
70 | + }, function () { | ||
71 | + layer.closeAll() | ||
72 | + }) | ||
73 | + } else { | ||
74 | + layer.msg(res.msg, { | ||
75 | + offset: '15px', | ||
76 | + icon: 7, | ||
77 | + time: 1000, | ||
78 | + }) | ||
79 | + } | ||
80 | + } | ||
81 | + }) | ||
82 | + return false | ||
83 | + } | ||
84 | + $("#routeAdjustDetail_create").on("click",function () { | ||
85 | + routeAdjustDetailId+=1; | ||
86 | + var html = "<tr><td id='"+routeAdjustDetailId+"'><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' class='layui-input' width='50px' lay-verify = 'required|phone'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required|phone'></td><td><input type='button' value='保存' class='edit' style='background-color: #b71010;line-height: 16px'/></td></tr>" | ||
87 | + $("#routeAdjustDetail-table").append(html); | ||
88 | + | ||
89 | + $("#table-routeAdjustDetail :button.edit").click(function () { | ||
90 | + var toEdit = this.value == '保存'; | ||
91 | + this.value = toEdit ? '删除' : '保存'; | ||
92 | + var tdArr = [] | ||
93 | + tdArr.push(routeAdjustDetailId); | ||
94 | + $(this).closest('tr').find('td').not(':last').each(function (t, index) { | ||
95 | + if (toEdit) { | ||
96 | + this.innerHTML = this.firstChild.value.replace(/</g, '<').replace(/>/g, '>'); | ||
97 | + if(this.innerHTML=='' || this.innerHTML == undefined){ | ||
98 | + layer.msg("请注意填写完整") | ||
99 | + tdArr = []; | ||
100 | + $(this).closest('tr').remove(); | ||
101 | + return; | ||
102 | + } | ||
103 | + tdArr.push(this.innerHTML); | ||
104 | + } | ||
105 | + }) | ||
106 | + | ||
107 | + if(!toEdit){ | ||
108 | + // console.log($(this).closest('tr').find('td')[0]) | ||
109 | + var id = $(this).closest('tr').find('td')[0].getAttribute("id"); | ||
110 | + // console.log(id) | ||
111 | + if(id>0&& id!=undefined){ | ||
112 | + for (let i = 0; i < adjustBak.length; i++) { | ||
113 | + if(adjustBak[i].id == id){ | ||
114 | + adjustBak.pop(adjustBak[i]); | ||
115 | + } | ||
116 | + } | ||
117 | + }else { | ||
118 | + console.log(id) | ||
119 | + } | ||
120 | + $(this).closest('tr').remove(); | ||
121 | + }else { | ||
122 | + if(tdArr.length>0) { | ||
123 | + var adjustObj = { | ||
124 | + 'id': routeAdjustDetailId, | ||
125 | + 'localPort': tdArr[1], | ||
126 | + 'localInterface': tdArr[2], | ||
127 | + 'localContact': tdArr[3], | ||
128 | + // 'localPhone': tdArr[4], | ||
129 | + 'targetPort': tdArr[5], | ||
130 | + 'targetInterface': tdArr[6], | ||
131 | + 'targetContact': tdArr[7], | ||
132 | + // 'targetPhone': tdArr[8] | ||
133 | + } | ||
134 | + if(tdArr[4]!=''&& tdArr[4]!=undefined){ | ||
135 | + var resdata = commonDetail.validatorPhone(tdArr[4]); | ||
136 | + if(resdata.code==-1){ | ||
137 | + layer.msg(resdata.msg) | ||
138 | + tdArr = []; | ||
139 | + $(this).closest('tr').remove(); | ||
140 | + return; | ||
141 | + }else { | ||
142 | + adjustObj.localPhone = tdArr[4] | ||
143 | + } | ||
144 | + } | ||
145 | + if(tdArr[8]!=''&& tdArr[8]!=undefined){ | ||
146 | + var resdata = commonDetail.validatorPhone(tdArr[8]); | ||
147 | + if(resdata.code==-1){ | ||
148 | + layer.msg(resdata.msg) | ||
149 | + tdArr = []; | ||
150 | + $(this).closest('tr').remove(); | ||
151 | + return; | ||
152 | + }else { | ||
153 | + adjustObj.targetPhone = tdArr[8] | ||
154 | + } | ||
155 | + } | ||
156 | + adjustBak.push(adjustObj) | ||
157 | + } | ||
158 | + } | ||
159 | + }); | ||
160 | + }); | ||
161 | + //页面初始化 | ||
162 | + function init() { | ||
163 | + loadSelect() | ||
164 | + initDatePlus() | ||
165 | + initUploadPlus() | ||
166 | + | ||
167 | + } | ||
168 | + // 初始化下拉框 | ||
169 | + function loadSelect() { | ||
170 | + admin.req({ | ||
171 | + url: domainName + '/api-room/assetsrepair/findAssetsRepairList' | ||
172 | + }).done(function (response) { | ||
173 | + var options = "<option value=''>=城市选择=</option>"; | ||
174 | + $.each(response.data, function (i, v) { | ||
175 | + options += "<option value='" + v.orgCode + "'>" + v.orgName + "</option>" | ||
176 | + }); | ||
177 | + $('#slt-localCity-group').html(options); | ||
178 | + $('#slt-targetCity-group').html(options); | ||
179 | + form.render(); | ||
180 | + }); | ||
181 | + admin.req({ | ||
182 | + url: domainName + '/api-room/machineRoom/findRouteAjustType' | ||
183 | + }).done(function (response) { | ||
184 | + var options = "<option value=''>=调整要求=</option>"; | ||
185 | + | ||
186 | + $.each(response.data, function (i, v) { | ||
187 | + | ||
188 | + options += "<option value='" + v.adjustCode + "'>" + v.adjustType + "</option>" | ||
189 | + }); | ||
190 | + $('#slt-adjustType-group').html(options); | ||
191 | + form.render(); | ||
192 | + }); | ||
193 | + } | ||
194 | + | ||
195 | + | ||
196 | + //初始化日期插件 | ||
197 | + function initDatePlus() { | ||
198 | + adjustDate = laydate.render({ | ||
199 | + elem: '#adjustTime', //指定元素 | ||
200 | + value: new Date(), | ||
201 | + type: 'datetime', | ||
202 | + isInitValue: true, | ||
203 | + }); | ||
204 | + } | ||
205 | + | ||
206 | + //初始化上传插件 | ||
207 | + function initUploadPlus() { | ||
208 | + var param = {"access_token": accessToken} | ||
209 | + var fileName = [] | ||
210 | + uploadInst = upload.render({ | ||
211 | + elem: '#attachment', //绑定元素 | ||
212 | + url: common.domainName + '/api-room/machineRoom/routeAdjust/upload', | ||
213 | + data: param, | ||
214 | + multiple: true, | ||
215 | + auto: false, //选择文件后不自动上传 | ||
216 | + bindAction: '#upload_btn',//指定按钮触发上传 | ||
217 | + accept: 'file', | ||
218 | + exts: 'xls|doc|pdf|docx|xlsx|jpg|png', | ||
219 | + choose: function (obj) { | ||
220 | + //选择文件后回调 | ||
221 | + var files = this.files = obj.pushFile(); | ||
222 | + obj.preview(function (index, file, result) { | ||
223 | + fileName.push(file.name) | ||
224 | + $('#attachmentInput').val(fileName.toString()) | ||
225 | + }) | ||
226 | + }, | ||
227 | + done: function (res) { | ||
228 | + //单次上传成功 | ||
229 | + attachmentIds.push(res.str) | ||
230 | + }, | ||
231 | + allDone: function (obj) { | ||
232 | + //全部上传成功后 | ||
233 | + saveForm() | ||
234 | + }, | ||
235 | + error: function (index, upload) { | ||
236 | + // 上传失败 | ||
237 | + layer.msg('文件上传时发生故障,请稍后再试!', { | ||
238 | + icon: 7, time: 3000 | ||
239 | + }); | ||
240 | + } | ||
241 | + }); | ||
242 | + } | ||
243 | + | ||
244 | + }) | ||
245 | +}) |
1 | +//备份失败列表 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports("routeAdjustDetailList", function (d) { | ||
14 | + var accessToken = session.getToken()['access_token'] | ||
15 | + | ||
16 | + createStaffTable() | ||
17 | + function dateForm(time) { | ||
18 | + var unixTimestamp = new Date(time); | ||
19 | + var commonTime = unixTimestamp.toLocaleString(); | ||
20 | + return commonTime | ||
21 | + } | ||
22 | + //渲染附件表格 | ||
23 | + function createStaffTable() { | ||
24 | + var staffTable = table.render({ | ||
25 | + elem: '#routeAdjustDetailTable', | ||
26 | + url: domainName + '/api-room/machineRoom/getRouteAdjustDetailsByRecordId', | ||
27 | + where: { | ||
28 | + access_token: accessToken, | ||
29 | + recordId: d.id | ||
30 | + }, | ||
31 | + height: 'full', | ||
32 | + end: function (e) { | ||
33 | + form.render() | ||
34 | + }, | ||
35 | + even: true, | ||
36 | + cols: [[ | ||
37 | + {type: 'numbers', title: '序号'}, | ||
38 | + { | ||
39 | + field: 'localPort', title: '端点A', align: 'center', | ||
40 | + }, { | ||
41 | + field: 'localInterface', title: '接口类型', align: 'center', | ||
42 | + }, { | ||
43 | + field: 'localContact', title: '联系人', align: 'center', | ||
44 | + }, | ||
45 | + { | ||
46 | + field: 'localPhone', title: '电话', align: 'center', | ||
47 | + }, { | ||
48 | + field: 'targetPort', title: '端点Z', align: 'center', | ||
49 | + }, | ||
50 | + { | ||
51 | + field: 'targetInterface', title: '接口类型', align: 'center', | ||
52 | + },{ | ||
53 | + field: 'targetContact', title: '联系人', align: 'center', | ||
54 | + },{ | ||
55 | + field: 'targetPhone', title: '电话', align: 'center', | ||
56 | + } | ||
57 | + ]], | ||
58 | + done: function () { | ||
59 | + } | ||
60 | + }) | ||
61 | + } | ||
62 | + | ||
63 | + }) | ||
64 | +}) |
1 | +//工作汇报 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports("routeAttachmentList", function (d) { | ||
14 | + var accessToken = session.getToken()['access_token'] | ||
15 | + if (d.type == 'attachment') { | ||
16 | + $('#routeAttachmentTable').show() | ||
17 | + | ||
18 | + createAttachmentTable() | ||
19 | + } | ||
20 | + | ||
21 | + | ||
22 | + //渲染附件表格 | ||
23 | + function createAttachmentTable() { | ||
24 | + var attachmentTable = table.render({ | ||
25 | + elem: '#routeAttachmentTable', | ||
26 | + url: domainName + '/api-room/machineRoom/routeAdjust/getAttaById', | ||
27 | + where: { | ||
28 | + access_token: accessToken, | ||
29 | + id: d.id | ||
30 | + }, | ||
31 | + height: 'full', | ||
32 | + page: { | ||
33 | + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'] | ||
34 | + , theme: '#1E9FFF'//自定义分页主题颜色 | ||
35 | + }, | ||
36 | + end: function (e) { | ||
37 | + form.render() | ||
38 | + }, | ||
39 | + limit: common.limit, | ||
40 | + limits: common.limits, | ||
41 | + even: true, | ||
42 | + cols: [[ | ||
43 | + {type: 'numbers', title: '序号'}, | ||
44 | + { | ||
45 | + field: 'name', title: '文件名称', align: 'center', minWith: 200, | ||
46 | + }, { | ||
47 | + field: 'originalName', title: '原始名称', align: 'center', minWith: 200, | ||
48 | + }, { | ||
49 | + field: 'suffix', title: '文件后缀', align: 'center', minWith: 150, | ||
50 | + }, | ||
51 | + { | ||
52 | + field: 'size', title: '文件大小', align: 'center', minWith: 150, | ||
53 | + templet: function (d) { | ||
54 | + var str = (d.size / 1000).toFixed(2) | ||
55 | + return `<div><span>${str}KB</span></div>` | ||
56 | + } | ||
57 | + }, | ||
58 | + { | ||
59 | + title: '操作', align: "center", width: 120, | ||
60 | + templet: '<div><span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link preview-attachment-btn">预览</span>' + | ||
61 | + '<span data-id="{{d.id}}" data-suffix="{{d.suffix}}" class="layui-table-link attachment-download-btn" style="margin-left: 10px">下载</span></div>' | ||
62 | + } | ||
63 | + ]], | ||
64 | + done: function () { | ||
65 | + $('.preview-attachment-btn').on('click', function () { | ||
66 | + var id = $(this).data('id') | ||
67 | + var suffix = $(this).data('suffix') | ||
68 | + if (suffix == 'jpg' || suffix == 'png' || suffix == 'JPG' || suffix == 'PNG') { //图片类型 | ||
69 | + var srcUrl = domainName + `/api-web/openoffice/readImage/${id}?access_token=` + accessToken | ||
70 | + layer.open({ | ||
71 | + type: 1, | ||
72 | + content: `<div><img src="${srcUrl}" width="100%" height="100%" /></div>`, | ||
73 | + title: '图片预览', | ||
74 | + area: ['60%', '90%'] | ||
75 | + }) | ||
76 | + } else { | ||
77 | + //附件为文档类型 | ||
78 | + common.openReport(id) | ||
79 | + } | ||
80 | + }) | ||
81 | + | ||
82 | + $('.attachment-download-btn').on('click',function () { | ||
83 | + var id = $(this).data('id') | ||
84 | + var suffix = $(this).data('suffix') | ||
85 | + var url = domainName + `/api-web/openoffice/download/${id}?access_token=` + accessToken | ||
86 | + window.open(url) | ||
87 | + }) | ||
88 | + } | ||
89 | + }) | ||
90 | + } | ||
91 | + | ||
92 | + }) | ||
93 | +}) |
1 | +//工作汇报表单 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessions', 'laydate'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions; | ||
10 | + var laydate = layui.laydate; | ||
11 | + var commonDetail = layui.commonDetail; | ||
12 | + var domainName = common.domainName; | ||
13 | + //对外暴露的接口 | ||
14 | + exports('staffAdd', function (data) { | ||
15 | + var accessToken = session.getToken()['access_token'] | ||
16 | + var enterTime = {} | ||
17 | + var outTime = {} | ||
18 | + var staffsBak = [] | ||
19 | + // var tableBak = table.cache.identifying-table; | ||
20 | + //渲染表单 | ||
21 | + form.render(null, 'add-staff-form') | ||
22 | + init() | ||
23 | + | ||
24 | + // for (var i=0;i<tableBak.length;i++) { | ||
25 | + // staffsBak.push(tableBak[i]) | ||
26 | + // } | ||
27 | + | ||
28 | + //保存 | ||
29 | + form.on('submit(staff-form-save-id)', function (res) { | ||
30 | + var value = staffsBak | ||
31 | + if (value.length == 0) { | ||
32 | + layer.msg("请先添加实名信息") | ||
33 | + } else { | ||
34 | + saveForm() | ||
35 | + } | ||
36 | + }) | ||
37 | + | ||
38 | + //保存 | ||
39 | + function saveForm() { | ||
40 | + layer.load(2) | ||
41 | + var data = form.val('add-staff-form') | ||
42 | + var params = {} | ||
43 | + params.staffList = staffsBak | ||
44 | + params.staffRecord = JSON.stringify(data) | ||
45 | + console.log(params) | ||
46 | + admin.req({ | ||
47 | + url: domainName + '/api-room/machineRoom/machineRoomEnterStaff/save?access_token=' + accessToken, | ||
48 | + data: JSON.stringify(params), | ||
49 | + type: 'post', | ||
50 | + contentType: "application/json; charset=utf-8", | ||
51 | + done: function (res) { | ||
52 | + if (res.success) { | ||
53 | + layer.msg(res.msg, { | ||
54 | + offset: '15px', | ||
55 | + icon: 1, | ||
56 | + time: 1000, | ||
57 | + }, function () { | ||
58 | + layer.closeAll() | ||
59 | + }) | ||
60 | + } else { | ||
61 | + layer.msg(res.msg, { | ||
62 | + offset: '15px', | ||
63 | + icon: 7, | ||
64 | + time: 1000, | ||
65 | + }) | ||
66 | + } | ||
67 | + } | ||
68 | + }) | ||
69 | + return false | ||
70 | + } | ||
71 | + $("#identifying_create").on("click",function () { | ||
72 | + var html = "<tr><td><input type='text' width='50px' class='layui-input' lay-verify = 'required'></td><td><input type='text' class='layui-input' width='50px' lay-verify = 'required|phone'></td><td><input type='text' width='50px' class='layui-input' lay-verify = 'required|identify'></td><td><input type='button' value='保存' class='edit' style='background-color: #b71010;line-height: 16px'/></td></tr>" | ||
73 | + $("#identifying-table").append(html); | ||
74 | + | ||
75 | + $("#table-identifying :button.edit").click(function () { | ||
76 | + var toEdit = this.value == '保存'; | ||
77 | + this.value = toEdit ? '删除' : '保存'; | ||
78 | + var tdArr = [] | ||
79 | + $(this).closest('tr').find('td').not(':last').each(function (t, index) { | ||
80 | + if (toEdit) { | ||
81 | + this.innerHTML = this.firstChild.value.replace(/</g, '<').replace(/>/g, '>'); | ||
82 | + if(this.innerHTML=='' || this.innerHTML == undefined){ | ||
83 | + layer.msg("请注意填写完整") | ||
84 | + tdArr = []; | ||
85 | + $(this).closest('tr').remove(); | ||
86 | + return; | ||
87 | + } | ||
88 | + tdArr.push(this.innerHTML); | ||
89 | + } | ||
90 | + }) | ||
91 | + if(!toEdit){ | ||
92 | + var name = $(this).closest('tr').find('td')[0].innerHTML; | ||
93 | + if(name!=''&& name!=undefined){ | ||
94 | + for (let i = 0; i < staffsBak.length; i++) { | ||
95 | + if(staffsBak[i].name == name){ | ||
96 | + staffsBak.pop(staffsBak[i]); | ||
97 | + } | ||
98 | + } | ||
99 | + } | ||
100 | + $(this).closest('tr').remove(); | ||
101 | + }else { | ||
102 | + if(tdArr.length>0) { | ||
103 | + var staffObj = { | ||
104 | + 'id': '', | ||
105 | + 'userName': tdArr[0] | ||
106 | + } | ||
107 | + if(tdArr[1]!=''&& tdArr[1]!=undefined){ | ||
108 | + var resdata = commonDetail.validatorPhone(tdArr[1]); | ||
109 | + if(resdata.code==-1){ | ||
110 | + layer.msg(resdata.msg) | ||
111 | + tdArr = []; | ||
112 | + $(this).closest('tr').remove(); | ||
113 | + return; | ||
114 | + }else { | ||
115 | + staffObj.phone = tdArr[1] | ||
116 | + } | ||
117 | + } | ||
118 | + if(tdArr[2]!=''&& tdArr[2]!=undefined){ | ||
119 | + var res = commonDetail.validatorIDCard(tdArr[2]); | ||
120 | + if(res.code==-1){ | ||
121 | + layer.msg(res.msg) | ||
122 | + tdArr = []; | ||
123 | + $(this).closest('tr').remove(); | ||
124 | + return; | ||
125 | + }else { | ||
126 | + staffObj.idCard = tdArr[2] | ||
127 | + } | ||
128 | + } | ||
129 | + console.log(staffObj) | ||
130 | + staffsBak.push(staffObj) | ||
131 | + | ||
132 | + } | ||
133 | + } | ||
134 | + }); | ||
135 | + }); | ||
136 | + | ||
137 | + //页面初始化 | ||
138 | + function init() { | ||
139 | + loadSelect() | ||
140 | + initDatePlus() | ||
141 | + } | ||
142 | + | ||
143 | + // 初始化下拉框 | ||
144 | + function loadSelect() { | ||
145 | + admin.req({ | ||
146 | + url: domainName + '/api-web/machineRoom/getMachineRoomInfo' | ||
147 | + }).done(function (response) { | ||
148 | + var options = "<option value=''>=归属机房=</option>"; | ||
149 | + $.each(response.data, function (i, v) { | ||
150 | + options += "<option value='" + v.machineRoomId + "'>" + v.machineRoomName + "</option>" | ||
151 | + }); | ||
152 | + $('#slt-staffadd-machine').html(options); | ||
153 | + form.render(); | ||
154 | + }); | ||
155 | + admin.req({ | ||
156 | + url: domainName + '/api-web/bWorkreportGroup/findManufacturerList' | ||
157 | + }).done(function (response) { | ||
158 | + var options = "<option value=''>=工作单位=</option>"; | ||
159 | + $.each(response.data, function (i, v) { | ||
160 | + options += "<option value='" + v.id + "'>" + v.manufacturerName + "</option>" | ||
161 | + }); | ||
162 | + options += "<option value='0'>其他</option>"; | ||
163 | + $('#slt-staffadd-group').html(options); | ||
164 | + form.render(); | ||
165 | + }); | ||
166 | + } | ||
167 | + form.on('select(slt-staffadd-group)', function (data) { | ||
168 | + if(data.value== '0'){ | ||
169 | + $("#slt-staffadd-group").css("display","none"); | ||
170 | + $("#manufacturerOther").css("display","block"); | ||
171 | + }else { | ||
172 | + $("#manufacturerOther").css("display","none"); | ||
173 | + } | ||
174 | + }); | ||
175 | + | ||
176 | + //初始化日期插件 | ||
177 | + function initDatePlus() { | ||
178 | + enterTime = laydate.render({ | ||
179 | + elem: '#enterTime', //指定元素 | ||
180 | + value: new Date(), | ||
181 | + type: 'datetime', | ||
182 | + isInitValue: true, | ||
183 | + | ||
184 | + }); | ||
185 | + outTime = laydate.render({ | ||
186 | + elem: '#outTime', //指定元素 | ||
187 | + value: new Date(), | ||
188 | + type: 'datetime', | ||
189 | + isInitValue: true, | ||
190 | + | ||
191 | + }); | ||
192 | + } | ||
193 | + | ||
194 | + | ||
195 | + }) | ||
196 | +}) |
1 | +//备份失败列表 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var layer = layui.layer; | ||
6 | + var admin = layui.admin; | ||
7 | + var table = layui.table; | ||
8 | + var common = layui.common; | ||
9 | + var session = layui.sessions | ||
10 | + var domainName = common.domainName; | ||
11 | + | ||
12 | + //对外暴露的接口 | ||
13 | + exports("staffList", function (d) { | ||
14 | + var accessToken = session.getToken()['access_token'] | ||
15 | + | ||
16 | + createStaffTable() | ||
17 | + function dateForm(time) { | ||
18 | + var unixTimestamp = new Date(time); | ||
19 | + var commonTime = unixTimestamp.toLocaleString(); | ||
20 | + return commonTime | ||
21 | + } | ||
22 | + //渲染附件表格 | ||
23 | + function createStaffTable() { | ||
24 | + var staffTable = table.render({ | ||
25 | + elem: '#staffTable', | ||
26 | + url: domainName + '/api-room/machineRoom/findStaffByRecordId', | ||
27 | + where: { | ||
28 | + access_token: accessToken, | ||
29 | + recordId: d.id | ||
30 | + }, | ||
31 | + height: 'full', | ||
32 | + end: function (e) { | ||
33 | + form.render() | ||
34 | + }, | ||
35 | + even: true, | ||
36 | + cols: [[ | ||
37 | + {type: 'numbers', title: '序号'}, | ||
38 | + { | ||
39 | + field: 'userName', title: '姓名', align: 'center', | ||
40 | + }, { | ||
41 | + field: 'phone', title: '联系方式', align: 'center', | ||
42 | + }, { | ||
43 | + field: 'idCard', title: '身份证号', align: 'center', | ||
44 | + } | ||
45 | + ]], | ||
46 | + done: function () { | ||
47 | + } | ||
48 | + }) | ||
49 | + } | ||
50 | + | ||
51 | + }) | ||
52 | +}) |
1 | +<!--工作汇报表单--> | ||
2 | +<article> | ||
3 | + <div class="layui-card-body"> | ||
4 | + <fieldset class="layui-elem-field layui-field-title"> | ||
5 | + <legend>设备记录新增</legend> | ||
6 | + </fieldset> | ||
7 | + <form class="layui-form layui-form-pane" lay-filter="add-device-form" | ||
8 | + id="add-device-form" onsubmit="return false;"> | ||
9 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
10 | + <div class="layui-form-item" > | ||
11 | + <div class="layui-inline inline-onethird"> | ||
12 | + <label class="layui-form-label">报表类型</label> | ||
13 | + <div class="layui-input-inline"> | ||
14 | + <select name="docType" id="slt-docType" | ||
15 | + lay-filter="slt-docType" > | ||
16 | + <option value="1">设备出入</option> | ||
17 | + <option value="2">配件更换</option> | ||
18 | + </select> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + <div class="layui-inline inline-onethird"> | ||
22 | + <label class="layui-form-label">操作类型</label> | ||
23 | + <div class="layui-input-inline"> | ||
24 | + <select name="actionType" id="slt-actionType" | ||
25 | + lay-filter="slt-actionType" > | ||
26 | + <option value="1">迁入</option> | ||
27 | + <option value="2">迁出</option> | ||
28 | + <option value="3">转移</option> | ||
29 | + </select> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + <div class="layui-inline inline-onethird"> | ||
33 | + <label class="layui-form-label">设备型号</label> | ||
34 | + <div class="layui-input-inline"> | ||
35 | + <input type="text" class="layui-input" name="deviceModel" id="deviceModel" lay-verify="required"> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + <div class="layui-form-item"> | ||
40 | + <div class="layui-inline inline-onethird"> | ||
41 | + <label class="layui-form-label">机房</label> | ||
42 | + <div class="layui-input-inline"> | ||
43 | + <select name="machineRoomId" id="slt-staffadd-machine" | ||
44 | + lay-filter="slt-staffadd-machine"> | ||
45 | + <option value="">=选择机房=</option> | ||
46 | + </select> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + <div class="layui-inline inline-onethird"> | ||
50 | + <label class="layui-form-label">选择单位</label> | ||
51 | + <div class="layui-input-inline"> | ||
52 | + <select name="manufacturerId" id="slt-staffadd-group" | ||
53 | + lay-filter="slt-staffadd-group" > | ||
54 | + <option value="">=工作单位=</option> | ||
55 | + </select> | ||
56 | + <input type="text" name="manufacturerOther" id="manufacturerOther" lay-filter="manufacturerOther" class="layui-input" style="display: none"> | ||
57 | + </div> | ||
58 | + </div> | ||
59 | + <div class="layui-inline inline-onethird"> | ||
60 | + <label class="layui-form-label">申请人</label> | ||
61 | + <div class="layui-input-inline"> | ||
62 | + <input type="text" class="layui-input" name="applyUser" id="applyUser" lay-verify="required"> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + <div class="layui-form-item"> | ||
67 | + <div class="layui-inline inline-onethird"> | ||
68 | + <label class="layui-form-label">联系方式</label> | ||
69 | + <div class="layui-input-inline"> | ||
70 | + <input type="text" class="layui-input" name="phone" id="phone" lay-verify="required|phone"> | ||
71 | + </div> | ||
72 | + </div> | ||
73 | + <div class="layui-inline inline-onethird"> | ||
74 | + <label class="layui-form-label">进入时间</label> | ||
75 | + <div class="layui-input-inline"> | ||
76 | + <input type="text" class="layui-input" name="enterTime" id="enterTime" lay-verify="required"> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + <div class="layui-inline inline-onethird"> | ||
80 | + <label class="layui-form-label">出来时间</label> | ||
81 | + <div class="layui-input-inline"> | ||
82 | + <input type="text" class="layui-input" name="outTime" id="outTime" lay-verify="required"> | ||
83 | + </div> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + <div class="layui-form-item" > | ||
87 | + <div class="layui-inline inline-onethird"> | ||
88 | + <label class="layui-form-label">现物理位置</label> | ||
89 | + <div class="layui-input-inline"> | ||
90 | + <input type="text" class="layui-input" name="localPlace" id= "localPlace" lay-verify="required"> | ||
91 | + </div> | ||
92 | + </div> | ||
93 | + <div class="layui-inline inline-onethird"> | ||
94 | + <label class="layui-form-label">原物理位置</label> | ||
95 | + <div class="layui-input-inline"> | ||
96 | + <input type="text" class="layui-input" name="lastPlace" id= "lastPlace" readonly="readonly" value="" placeholder="只有设备转移需要填写,默认只读"> | ||
97 | + </div> | ||
98 | + </div> | ||
99 | + <div class="layui-inline inline-onethird"> | ||
100 | + <label class="layui-form-label">值班人</label> | ||
101 | + <div class="layui-input-inline"> | ||
102 | + <input type="text" class="layui-input" name="watchkeeper" id= "watchkeeper" lay-verify="required"> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | + </div> | ||
106 | + <div class="layui-form-item"> | ||
107 | + <div class="layui-inline inline-onethird"> | ||
108 | + <label class="layui-form-label">设备负责人(甲方)</label> | ||
109 | + <div class="layui-input-inline"> | ||
110 | + <input type="text" class="layui-input" name="machineRoomLeader" id="machineRoomLeader" lay-verify="required"> | ||
111 | + </div> | ||
112 | + </div> | ||
113 | + <div class="layui-inline inline-onethird"> | ||
114 | + <label class="layui-form-label">总集成</label> | ||
115 | + <div class="layui-input-inline"> | ||
116 | + <input type="text" class="layui-input" name="integration" id="integration" lay-verify="required"> | ||
117 | + </div> | ||
118 | + </div> | ||
119 | + <div class="layui-inline inline-onethird"> | ||
120 | + <label class="layui-form-label">运维负责人</label> | ||
121 | + <div class="layui-input-inline"> | ||
122 | + <input type="text" class="layui-input" name="operationUser" id="operationUser" lay-verify="required"> | ||
123 | + </div> | ||
124 | + </div> | ||
125 | + </div> | ||
126 | + <div class="layui-form-item"> | ||
127 | + <label class="layui-form-label textarea-label">进入事由</label> | ||
128 | + <div class="layui-input-block"> | ||
129 | + <textarea class="layui-textarea" name="reason" id="reason" lay-verify="required"></textarea> | ||
130 | + </div> | ||
131 | + </div> | ||
132 | + <button type="submit" lay-submit lay-filter="device-form-save-id" class="layui-btn hide" | ||
133 | + id="device-form-save-id">保存 | ||
134 | + </button> | ||
135 | + </form> | ||
136 | + </div> | ||
137 | + <div class="layui-card-body" id="device_card" style="display: block"> | ||
138 | + <fieldset class="layui-elem-field layui-field-title"> | ||
139 | + <legend>设备信息</legend> | ||
140 | + </fieldset> | ||
141 | + <div style="display: flex;float: right"> | ||
142 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="device_create" style="float: right"> | ||
143 | + 添加 | ||
144 | + </button> | ||
145 | + </div> | ||
146 | + <table id="table-device" class="layui-table"> | ||
147 | + <thead> | ||
148 | + <tr> | ||
149 | + <th>设备sn码</th> | ||
150 | + <th>设备类型</th> | ||
151 | + <th>设备型号</th> | ||
152 | + <th>品牌</th> | ||
153 | + <th>操作</th> | ||
154 | + </tr> | ||
155 | + </thead> | ||
156 | + <tbody id="device-table"> | ||
157 | + </tbody> | ||
158 | + </table> | ||
159 | + </div> | ||
160 | + <div class="layui-card-body" id="fiting_card" style="display: none"> | ||
161 | + <fieldset class="layui-elem-field layui-field-title"> | ||
162 | + <legend>配件信息</legend> | ||
163 | + </fieldset> | ||
164 | + <div style="display: flex;float: right"> | ||
165 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="fiting_create" style="float: right"> | ||
166 | + 添加 | ||
167 | + </button> | ||
168 | + </div> | ||
169 | + <table id="table-fiting" class="layui-table"> | ||
170 | + <thead> | ||
171 | + <tr> | ||
172 | + <th>配件snCode</th> | ||
173 | + <th>新配件snCode</th> | ||
174 | + <th>配件名称</th> | ||
175 | + <th>所属设备</th> | ||
176 | + <th>操作</th> | ||
177 | + </tr> | ||
178 | + </thead> | ||
179 | + <tbody id="fiting-table"> | ||
180 | + </tbody> | ||
181 | + </table> | ||
182 | + </div> | ||
183 | +</article> | ||
184 | +<script> | ||
185 | + layui.use('deviceAdd', function (fn) { | ||
186 | + fn({{d}}) | ||
187 | + }) | ||
188 | +</script> | ||
189 | + | ||
190 | +<style> | ||
191 | + #add-repair-form .layui-form-label { | ||
192 | + width: 120px; | ||
193 | + /* padding: 8px 12px; */ | ||
194 | + text-align: left !important; | ||
195 | + } | ||
196 | + #add-repair-form .layui-input-block{ | ||
197 | + margin-left: 120px !important; | ||
198 | + } | ||
199 | + .tags{ | ||
200 | + margin-top:5px; | ||
201 | + } | ||
202 | + .tags span { | ||
203 | + height: 20px; | ||
204 | + margin-right: 10px; | ||
205 | + margin-bottom: 3px; | ||
206 | + padding: 5px 10px 5px 10px; | ||
207 | + float: left; | ||
208 | + white-space: nowrap; | ||
209 | + color:#fff; | ||
210 | + background-color:#009688; | ||
211 | + text-shadow: 1px 1px 1px rgba(0, 0, 0, .15); | ||
212 | + } | ||
213 | + .tags .close { | ||
214 | + font-weight: bold; | ||
215 | + line-height: 20px; | ||
216 | + margin-left:10px; | ||
217 | + cursor: pointer; | ||
218 | + text-align: center; | ||
219 | + color: #fff; | ||
220 | + border: 0 none; | ||
221 | + background: transparent none repeat scroll 0 0; | ||
222 | + } | ||
223 | +</style> |
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body"> | ||
8 | + <table id="deviceTable" lay-filter="deviceTable"></table> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </div> | ||
13 | +</article> | ||
14 | + | ||
15 | +<script> | ||
16 | + layui.use('deviceList', function (fn) { | ||
17 | + fn({{d}}) | ||
18 | + }); | ||
19 | +</script> |
1 | +<title>设备进出机房登记</title> | ||
2 | +<article class="page-container"> | ||
3 | + <div class="page-panel "> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card"> | ||
6 | + <div class="layui-card-header"> | ||
7 | + <div class="layui-btn-group time-group" id="btns-staff-time" style="float: right;"> | ||
8 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs date" | ||
9 | + data-period="lastMonth">上月 | ||
10 | + </button> | ||
11 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs active date" | ||
12 | + data-period="month">本月 | ||
13 | + </button> | ||
14 | + </div> | ||
15 | + </div> | ||
16 | + <div style="display: flex" class="layui-card-echart"> | ||
17 | + <div style="flex-grow: 1"> | ||
18 | + <div class="pie-chart" id="device-chart-time-record"></div> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
22 | + <div style="display: flex"> | ||
23 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
24 | + lay-filter="form-enterStaff-condition"> | ||
25 | + <div class="layui-form-item"> | ||
26 | + <div class="layui-inline"> | ||
27 | + <div class="layui-input-inline layui-input-inline--long"> | ||
28 | + <input type="text" id="applyUser" name="applyUser" | ||
29 | + placeholder="申请人" autocomplete="off" class="layui-input"> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + <div class="layui-inline"> | ||
33 | + <div class="layui-input-inline"> | ||
34 | + <select name="manufacturerId" id="slt-staff-group" | ||
35 | + lay-filter="slt-staff-group" lay-search> | ||
36 | + <option value="">=工作单位=</option> | ||
37 | + </select> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + <div class="layui-inline" style="margin-left: 10px"> | ||
41 | + <div class="layui-input-inline" style="width: auto"> | ||
42 | + <input type="text" name="dateLimit" id="dateLimit" autocomplete="off" | ||
43 | + class="layui-input" readonly placeholder="其他日期范围"> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </form> | ||
48 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="device_create" style="float: right"> | ||
49 | + 新增 | ||
50 | + </button> | ||
51 | + </div> | ||
52 | + <div class="layui-tab layui-tab-card" lay-filter="enterdevice-tab"> | ||
53 | + <ul class="layui-tab-title"> | ||
54 | + <li class="layui-this">设备出入记录</li> | ||
55 | + <li>配件更换记录</li> | ||
56 | + </ul> | ||
57 | + <div class="layui-tab-content"> | ||
58 | + <div class="layui-tab-item layui-show"> | ||
59 | + <div id="enterdevice-head-info" class="statistics-top-head"></div> | ||
60 | + <table id="enterdevice_table_id" class="layui-table" lay-filter = "enterdevice_table_id"></table> | ||
61 | + </div> | ||
62 | + <div class="layui-tab-item"> | ||
63 | + <div id="fitting-head-info" class="statistics-top-head"></div> | ||
64 | + <table id="fitting-table" class="layui-table" lay-filter="fitting-table"></table> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + </div> | ||
71 | + </div> | ||
72 | +</article> | ||
73 | +<script> | ||
74 | + layui.use('enterDevice', function (fn) { | ||
75 | + fn(); | ||
76 | + }); | ||
77 | +</script> |
1 | +<title>人员进出机房登记</title> | ||
2 | +<article class="page-container"> | ||
3 | + <div class="page-panel "> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card"> | ||
6 | + <div class="layui-card-header"> | ||
7 | + <div class="layui-btn-group time-group" id="btns-staff-time" style="float: right;"> | ||
8 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs date" | ||
9 | + data-period="lastMonth">上月 | ||
10 | + </button> | ||
11 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs active date" | ||
12 | + data-period="month">本月 | ||
13 | + </button> | ||
14 | + </div> | ||
15 | + </div> | ||
16 | + <div style="display: flex" class="layui-card-echart"> | ||
17 | + <div style="flex-grow: 1"> | ||
18 | + <div class="pie-chart" id="chart-time-record"></div> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
22 | + <div style="display: flex"> | ||
23 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
24 | + lay-filter="form-enterStaff-condition"> | ||
25 | + <div class="layui-form-item"> | ||
26 | + <div class="layui-inline"> | ||
27 | + <div class="layui-input-inline layui-input-inline--long"> | ||
28 | + <input type="text" id="applyUser" name="applyUser" | ||
29 | + placeholder="申请人" autocomplete="off" class="layui-input"> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + <div class="layui-inline"> | ||
33 | + <div class="layui-input-inline"> | ||
34 | + <select name="manufacturerId" id="slt-staff-group" | ||
35 | + lay-filter="slt-staff-group" lay-search> | ||
36 | + <option value="">=工作单位=</option> | ||
37 | + </select> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + <div class="layui-inline" style="margin-left: 10px"> | ||
41 | + <div class="layui-input-inline" style="width: auto"> | ||
42 | + <input type="text" name="dateLimit" id="dateLimit" autocomplete="off" | ||
43 | + class="layui-input" readonly placeholder="其他日期范围"> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </form> | ||
48 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="staff_create" style="float: right"> | ||
49 | + 新增 | ||
50 | + </button> | ||
51 | + </div> | ||
52 | + <table id="table-staff-view" lay-filter="table-staff-view"></table> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | +</article> | ||
58 | +<script> | ||
59 | + layui.use('enterStaff', function (fn) { | ||
60 | + fn(); | ||
61 | + }); | ||
62 | +</script> |
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body"> | ||
8 | + <table id="fittingTable" lay-filter="fittingTable"></table> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </div> | ||
13 | +</article> | ||
14 | + | ||
15 | +<script> | ||
16 | + layui.use('fittingList', function (fn) { | ||
17 | + fn({{d}}) | ||
18 | + }); | ||
19 | +</script> |
1 | +<title>线路调整登记</title> | ||
2 | +<article class="page-container"> | ||
3 | + <div class="page-panel "> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card"> | ||
6 | + <div class="layui-card-header"> | ||
7 | + <div class="layui-btn-group time-group" id="btns-routeAdjust-time" style="float: right;"> | ||
8 | + | ||
9 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs active date" | ||
10 | + data-period="month">本月 | ||
11 | + </button> | ||
12 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs date" | ||
13 | + data-period="querter">本季度 | ||
14 | + </button> | ||
15 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs date" | ||
16 | + data-period="year">今年 | ||
17 | + </button> | ||
18 | + </div> | ||
19 | + </div> | ||
20 | + <div style="display: flex" class="layui-card-echart"> | ||
21 | + <div style="flex-grow: 3;width: 65%!important;"> | ||
22 | + <h5 class="lay-row-title">按城市A统计</h5> | ||
23 | + <div class="pie-chart" id="chart-company-report" style="min-height: 240px"></div> | ||
24 | + </div> | ||
25 | + <div style="flex-grow: 3;width: 35%!important;"> | ||
26 | + <h5 class="lay-row-title">按调整要求统计</h5> | ||
27 | + <div class="pie-chart" id="chart-adjustType-report" style="min-height: 240px"></div> | ||
28 | + </div> | ||
29 | + </div> | ||
30 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
31 | + <div style="display: flex"> | ||
32 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
33 | + lay-filter="form-routeAdjust-condition"> | ||
34 | + <div class="layui-form-item"> | ||
35 | + <div class="layui-inline"> | ||
36 | + <div class="layui-input-inline layui-input-inline--long"> | ||
37 | + <input type="text" id="contractId" name="contractId" | ||
38 | + placeholder="合同编号" autocomplete="off" class="layui-input"> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + <div class="layui-inline"> | ||
42 | + <div class="layui-input-inline"> | ||
43 | + <select name="adjustType" id="slt-route-group" | ||
44 | + lay-filter="slt-route-group" lay-search> | ||
45 | + <option value="">=调整要求=</option> | ||
46 | + </select> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + <div class="layui-inline"> | ||
50 | + <div class="layui-input-inline"> | ||
51 | + <select name="localCity" id="slt-route-org" | ||
52 | + lay-filter="slt-route-org" lay-search> | ||
53 | + <option value="">=城市A=</option> | ||
54 | + </select> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + <div class="layui-inline" style="margin-left: 10px"> | ||
58 | + <div class="layui-input-inline" style="width: auto"> | ||
59 | + <input type="text" name="dateLimit" id="dateLimit" autocomplete="off" | ||
60 | + class="layui-input" readonly placeholder="日期范围"> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + </form> | ||
65 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="routeAdjust_create" style="float: right"> | ||
66 | + 新增 | ||
67 | + </button> | ||
68 | + </div> | ||
69 | + <table id="table-routeAdjust-view" lay-filter="table-routeAdjust-view"></table> | ||
70 | + </div> | ||
71 | + </div> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | +</article> | ||
75 | +<script> | ||
76 | + layui.use('routeAdjust', function (fn) { | ||
77 | + fn(); | ||
78 | + }); | ||
79 | +</script> |
1 | +<!--工作汇报表单--> | ||
2 | +<article> | ||
3 | + <div class="layui-card-body"> | ||
4 | + <fieldset class="layui-elem-field layui-field-title"> | ||
5 | + <legend>线路调整新增</legend> | ||
6 | + </fieldset> | ||
7 | + <form class="layui-form layui-form-pane" lay-filter="add-routeAdjust-form" | ||
8 | + id="add-routeAdjust-form" onsubmit="return false;"> | ||
9 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
10 | + <div class="layui-form-item"> | ||
11 | + <div class="layui-inline inline-onethird"> | ||
12 | + <label class="layui-form-label">合同编号</label> | ||
13 | + <div class="layui-input-inline"> | ||
14 | + <input type="text" class="layui-input" name="contractId" id="contractId" lay-verify="required"> | ||
15 | + </div> | ||
16 | + </div> | ||
17 | + <div class="layui-inline inline-onethird"> | ||
18 | + <label class="layui-form-label">调整要求</label> | ||
19 | + <div class="layui-input-inline"> | ||
20 | + <select name="adjustType" id="slt-adjustType-group" | ||
21 | + lay-filter="slt-adjustType-group" > | ||
22 | + <option value="">=调整要求=</option> | ||
23 | + </select> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + <div class="layui-inline inline-onethird"> | ||
27 | + <label class="layui-form-label">城市A</label> | ||
28 | + <div class="layui-input-inline"> | ||
29 | + <select name="localCity" id="slt-localCity-group" | ||
30 | + lay-filter="slt-localCity-group"> | ||
31 | + <option value="">=城市选择=</option> | ||
32 | + </select> | ||
33 | + </div> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + <div class="layui-form-item"> | ||
37 | + <div class="layui-inline inline-onethird"> | ||
38 | + <label class="layui-form-label">城市Z</label> | ||
39 | + <div class="layui-input-inline"> | ||
40 | + <select name="targetCity" id="slt-targetCity-group" | ||
41 | + lay-filter="slt-targetCity-group"> | ||
42 | + <option value="">=城市选择=</option> | ||
43 | + </select> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + <div class="layui-inline inline-onethird"> | ||
47 | + <label class="layui-form-label">申请单位</label> | ||
48 | + <div class="layui-input-inline"> | ||
49 | + <input type="text" class="layui-input" name="applyCity" id="applyCity" lay-verify="required"> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | + <div class="layui-inline inline-onethird"> | ||
53 | + <label class="layui-form-label">业务类型</label> | ||
54 | + <div class="layui-input-inline"> | ||
55 | + <input type="text" class="layui-input" name="busyType" id="busyType" lay-verify="required"> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + </div> | ||
59 | + <div class="layui-form-item"> | ||
60 | + <div class="layui-inline inline-onethird"> | ||
61 | + <label class="layui-form-label">端口速率</label> | ||
62 | + <div class="layui-input-inline"> | ||
63 | + <input type="text" class="layui-input" name="portSpeed" id="portSpeed" lay-verify="required"> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + <div class="layui-inline inline-onethird"> | ||
67 | + <label class="layui-form-label">线路速率</label> | ||
68 | + <div class="layui-input-inline"> | ||
69 | + <input type="text" class="layui-input" name="electricSpeed" id="electricSpeed" lay-verify="required"> | ||
70 | + </div> | ||
71 | + </div> | ||
72 | + <div class="layui-inline inline-onethird"> | ||
73 | + <label class="layui-form-label">调整时间</label> | ||
74 | + <div class="layui-input-inline"> | ||
75 | + <input type="text" class="layui-input" name="adjustTime" id="adjustTime" lay-verify="required"> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + <div class="layui-form-item"> | ||
80 | + <div class="layui-inline" style="width: 90%"> | ||
81 | + <label class="layui-form-label">选择附件</label> | ||
82 | + <div class="layui-input-block attachment"> | ||
83 | + <input type="text" class="layui-input" readonly id="attachmentInput"> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + <div class="layui-inline"> | ||
87 | + <button class="layui-btn layui-btn-normal" id="attachment">附件</button> | ||
88 | + <button id="upload_btn" hidden>附件</button> | ||
89 | + </div> | ||
90 | + </div> | ||
91 | + <div class="layui-form-item" style="display: none" id="add-repair-form-atta"> | ||
92 | + <label class="layui-form-label">已存附件</label> | ||
93 | + <div class="layui-input-inline" | ||
94 | + style="width: 90% !important;max-height: 130px;overflow-y: auto;margin-left: 10px;"> | ||
95 | + <div class="tags" id="selecte_content_id"></div> | ||
96 | + </div> | ||
97 | + </div> | ||
98 | + <button type="submit" lay-submit lay-filter="routeAdjust-form-save-id" class="layui-btn hide" | ||
99 | + id="routeAdjust-form-save-id">保存 | ||
100 | + </button> | ||
101 | + </form> | ||
102 | + </div> | ||
103 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
104 | + <fieldset class="layui-elem-field layui-field-title"> | ||
105 | + <legend>线路调整详细信息</legend> | ||
106 | + </fieldset> | ||
107 | + <div style="display: flex;float: right"> | ||
108 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="routeAdjustDetail_create" style="float: right"> | ||
109 | + 添加 | ||
110 | + </button> | ||
111 | + </div> | ||
112 | + <table id="table-routeAdjustDetail" class="layui-table"> | ||
113 | + <thead> | ||
114 | + <tr> | ||
115 | + <th>端点A</th> | ||
116 | + <th>接口类型</th> | ||
117 | + <th>联系人</th> | ||
118 | + <th>电话</th> | ||
119 | + <th>端点Z</th> | ||
120 | + <th>接口类型</th> | ||
121 | + <th>联系人</th> | ||
122 | + <th>电话</th> | ||
123 | + <th>操作</th> | ||
124 | + </tr> | ||
125 | + </thead> | ||
126 | + <tbody id="routeAdjustDetail-table"> | ||
127 | + </tbody> | ||
128 | + </table> | ||
129 | + </div> | ||
130 | +</article> | ||
131 | +<script> | ||
132 | + layui.use('routeAdjustAdd', function (fn) { | ||
133 | + fn({{d}}) | ||
134 | + }) | ||
135 | +</script> | ||
136 | + | ||
137 | +<style> | ||
138 | + #add-repair-form .layui-form-label { | ||
139 | + width: 120px; | ||
140 | + /* padding: 8px 12px; */ | ||
141 | + text-align: left !important; | ||
142 | + } | ||
143 | + #add-repair-form .layui-input-block{ | ||
144 | + margin-left: 120px !important; | ||
145 | + } | ||
146 | + .tags{ | ||
147 | + margin-top:5px; | ||
148 | + } | ||
149 | + .tags span { | ||
150 | + height: 20px; | ||
151 | + margin-right: 10px; | ||
152 | + margin-bottom: 3px; | ||
153 | + padding: 5px 10px 5px 10px; | ||
154 | + float: left; | ||
155 | + white-space: nowrap; | ||
156 | + color:#fff; | ||
157 | + background-color:#009688; | ||
158 | + text-shadow: 1px 1px 1px rgba(0, 0, 0, .15); | ||
159 | + } | ||
160 | + .tags .close { | ||
161 | + font-weight: bold; | ||
162 | + line-height: 20px; | ||
163 | + margin-left:10px; | ||
164 | + cursor: pointer; | ||
165 | + text-align: center; | ||
166 | + color: #fff; | ||
167 | + border: 0 none; | ||
168 | + background: transparent none repeat scroll 0 0; | ||
169 | + } | ||
170 | +</style> |
hg-monitor-web-base/src/main/resources/static/src/views/machineroom/routeAdjustDetailList.html
0 → 100644
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body"> | ||
8 | + <table id="routeAdjustDetailTable" lay-filter="routeAdjustDetailTable"></table> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </div> | ||
13 | +</article> | ||
14 | + | ||
15 | +<script> | ||
16 | + layui.use('routeAdjustDetailList', function (fn) { | ||
17 | + fn({{d}}) | ||
18 | + }); | ||
19 | +</script> |
hg-monitor-web-base/src/main/resources/static/src/views/machineroom/routeAttachmentList.html
0 → 100644
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body"> | ||
8 | + <table id="routeAttachmentTable" lay-filter="routeAttachmentTable"></table> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </div> | ||
13 | +</article> | ||
14 | + | ||
15 | +<script> | ||
16 | + layui.use('routeAttachmentList', function (fn) { | ||
17 | + fn({{d}}) | ||
18 | + }); | ||
19 | +</script> |
1 | +<!--工作汇报表单--> | ||
2 | +<article> | ||
3 | + <div class="layui-card-body"> | ||
4 | + <fieldset class="layui-elem-field layui-field-title"> | ||
5 | + <legend>人员新增</legend> | ||
6 | + </fieldset> | ||
7 | + <form class="layui-form layui-form-pane" lay-filter="add-staff-form" | ||
8 | + id="add-staff-form" onsubmit="return false;"> | ||
9 | + <input hidden name="id" id="id" lay-verify="checkReportIsExist"> | ||
10 | + <div class="layui-form-item"> | ||
11 | + <div class="layui-inline inline-onethird"> | ||
12 | + <label class="layui-form-label">机房</label> | ||
13 | + <div class="layui-input-inline"> | ||
14 | + <select name="machineRoomId" id="slt-staffadd-machine" | ||
15 | + lay-filter="slt-staffadd-machine"> | ||
16 | + <option value="">=选择机房=</option> | ||
17 | + </select> | ||
18 | + </div> | ||
19 | + </div> | ||
20 | + <div class="layui-inline inline-onethird"> | ||
21 | + <label class="layui-form-label">选择单位</label> | ||
22 | + <div class="layui-input-inline"> | ||
23 | + <select name="manufacturerId" id="slt-staffadd-group" | ||
24 | + lay-filter="slt-staffadd-group" > | ||
25 | + <option value="">=工作单位=</option> | ||
26 | + </select> | ||
27 | + <input type="text" name="manufacturerOther" id="manufacturerOther" lay-filter="manufacturerOther" class="layui-input" style="display: none"> | ||
28 | + </div> | ||
29 | + </div> | ||
30 | + <div class="layui-inline inline-onethird"> | ||
31 | + <label class="layui-form-label">申请人</label> | ||
32 | + <div class="layui-input-inline"> | ||
33 | + <input type="text" class="layui-input" name="applyUser" id="applyUser" lay-verify="required"> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + <div class="layui-form-item"> | ||
38 | + <div class="layui-inline inline-onethird"> | ||
39 | + <label class="layui-form-label">联系方式</label> | ||
40 | + <div class="layui-input-inline"> | ||
41 | + <input type="text" class="layui-input" name="phone" id="phone" lay-verify="required|phone"> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + <div class="layui-inline inline-onethird"> | ||
45 | + <label class="layui-form-label">进入时间</label> | ||
46 | + <div class="layui-input-inline"> | ||
47 | + <input type="text" class="layui-input" name="enterTime" id="enterTime" lay-verify="required"> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + <div class="layui-inline inline-onethird"> | ||
51 | + <label class="layui-form-label">出来时间</label> | ||
52 | + <div class="layui-input-inline"> | ||
53 | + <input type="text" class="layui-input" name="outTime" id="outTime" lay-verify="required"> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + <div class="layui-form-item"> | ||
58 | + <div class="layui-inline inline-onethird"> | ||
59 | + <label class="layui-form-label">机房负责人(甲方)</label> | ||
60 | + <div class="layui-input-inline"> | ||
61 | + <input type="text" class="layui-input" name="machineRoomLeader" id="machineRoomLeader" lay-verify="required"> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + <div class="layui-inline inline-onethird"> | ||
65 | + <label class="layui-form-label">项目管理员(甲方)</label> | ||
66 | + <div class="layui-input-inline"> | ||
67 | + <input type="text" class="layui-input" name="projectLeader" id="projectLeader" lay-verify="required"> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + <div class="layui-inline inline-onethird"> | ||
71 | + <label class="layui-form-label">运维负责人</label> | ||
72 | + <div class="layui-input-inline"> | ||
73 | + <input type="text" class="layui-input" name="operationUser" id="operationUser" lay-verify="required"> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + <div class="layui-form-item" > | ||
78 | + <div class="layui-inline inline-half"> | ||
79 | + <label class="layui-form-label">携带物品</label> | ||
80 | + <div class="layui-input-inline"> | ||
81 | + <input type="text" class="layui-input" name="belongings" id="belongings" lay-verify="required"> | ||
82 | + </div> | ||
83 | + </div> | ||
84 | + <div class="layui-inline inline-half"> | ||
85 | + <label class="layui-form-label">值班人</label> | ||
86 | + <div class="layui-input-inline"> | ||
87 | + <input type="text" class="layui-input" name="watchkeeper" id= "watchkeeper" lay-verify="required"> | ||
88 | + </div> | ||
89 | + </div> | ||
90 | + </div> | ||
91 | + <div class="layui-form-item"> | ||
92 | + <label class="layui-form-label textarea-label">进入事由</label> | ||
93 | + <div class="layui-input-block"> | ||
94 | + <textarea class="layui-textarea" name="reason" id="reason" lay-verify="required"></textarea> | ||
95 | + </div> | ||
96 | + </div> | ||
97 | + <button type="submit" lay-submit lay-filter="staff-form-save-id" class="layui-btn hide" | ||
98 | + id="staff-form-save-id">保存 | ||
99 | + </button> | ||
100 | + </form> | ||
101 | + </div> | ||
102 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
103 | + <fieldset class="layui-elem-field layui-field-title"> | ||
104 | + <legend>实名登记</legend> | ||
105 | + </fieldset> | ||
106 | + <div style="display: flex;float: right"> | ||
107 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" data-type="" id="identifying_create" style="float: right"> | ||
108 | + 添加 | ||
109 | + </button> | ||
110 | + </div> | ||
111 | + <table id="table-identifying" class="layui-table"> | ||
112 | + <thead> | ||
113 | + <tr> | ||
114 | + <th>姓名</th> | ||
115 | + <th>联系方式</th> | ||
116 | + <th>身份证号</th> | ||
117 | + <th>操作</th> | ||
118 | + </tr> | ||
119 | + </thead> | ||
120 | + <tbody id="identifying-table"> | ||
121 | + </tbody> | ||
122 | + </table> | ||
123 | + </div> | ||
124 | +</article> | ||
125 | +<script> | ||
126 | + layui.use('staffAdd', function (fn) { | ||
127 | + fn({{d}}) | ||
128 | + }) | ||
129 | +</script> | ||
130 | + | ||
131 | +<style> | ||
132 | + #add-repair-form .layui-form-label { | ||
133 | + width: 120px; | ||
134 | + /* padding: 8px 12px; */ | ||
135 | + text-align: left !important; | ||
136 | + } | ||
137 | + #add-repair-form .layui-input-block{ | ||
138 | + margin-left: 120px !important; | ||
139 | + } | ||
140 | + .tags{ | ||
141 | + margin-top:5px; | ||
142 | + } | ||
143 | + .tags span { | ||
144 | + height: 20px; | ||
145 | + margin-right: 10px; | ||
146 | + margin-bottom: 3px; | ||
147 | + padding: 5px 10px 5px 10px; | ||
148 | + float: left; | ||
149 | + white-space: nowrap; | ||
150 | + color:#fff; | ||
151 | + background-color:#009688; | ||
152 | + text-shadow: 1px 1px 1px rgba(0, 0, 0, .15); | ||
153 | + } | ||
154 | + .tags .close { | ||
155 | + font-weight: bold; | ||
156 | + line-height: 20px; | ||
157 | + margin-left:10px; | ||
158 | + cursor: pointer; | ||
159 | + text-align: center; | ||
160 | + color: #fff; | ||
161 | + border: 0 none; | ||
162 | + background: transparent none repeat scroll 0 0; | ||
163 | + } | ||
164 | +</style> |
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body"> | ||
8 | + <table id="staffTable" lay-filter="staffTable"></table> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </div> | ||
13 | +</article> | ||
14 | + | ||
15 | +<script> | ||
16 | + layui.use('staffList', function (fn) { | ||
17 | + fn({{d}}) | ||
18 | + }); | ||
19 | +</script> |
-
Please register or login to post a comment