...
|
...
|
@@ -15,7 +15,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
var companyChart = echarts.init(document.getElementById('chart-company-report'));
|
|
|
var noReadChart = echarts.init(document.getElementById('chart-noRead-report'));
|
|
|
var dateLimit = ""
|
|
|
var createTime = "today"
|
|
|
var createTime = "thisWeek"
|
|
|
var type = ''
|
|
|
var urlRepType = ''
|
|
|
var manufacturerId = ''
|
...
|
...
|
@@ -55,7 +55,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
done: function (value) {
|
|
|
dateLimit = value
|
|
|
if (dateLimit == '') {
|
|
|
$('[data-period="today"]').click()
|
|
|
$('[data-period="thisWeek"]').click()
|
|
|
} else {
|
|
|
$.each($("button.date"), function (i, e) {
|
|
|
var $dom = $(e);
|
...
|
...
|
@@ -166,13 +166,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
// 加载工作汇报表格
|
|
|
function loadWorkReportTable() {
|
|
|
var conditions = form.val('form-workreport-condition');
|
|
|
$.each($("button.isRead"), function (i, e) {
|
|
|
$.each($("button.isRead"),function (i,e) {
|
|
|
var $dom = $(e);
|
|
|
if ($dom.hasClass("active")) {
|
|
|
if($dom.hasClass("active")){
|
|
|
conditions["currIsRead"] = $dom.data("type")
|
|
|
}
|
|
|
})
|
|
|
if (manufacturerId != '') {
|
|
|
if(manufacturerId!=''){
|
|
|
conditions.manufacturerName = manufacturerId;
|
|
|
}
|
|
|
Object.assign(conditions, {
|
...
|
...
|
@@ -263,31 +263,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
}, {
|
|
|
field: 'createUserNickName', title: '汇报人', align: 'center',
|
|
|
}, {
|
|
|
field: 'manufacturerName', title: '厂商', align: 'center',templet: function (d) {
|
|
|
var manufacturerName = '';
|
|
|
if(d.manufacturerName == '0'){
|
|
|
manufacturerName = d.manufacturerOther;
|
|
|
}else {
|
|
|
if(manufactureArr && manufactureArr.length>0){
|
|
|
$.each(manufactureArr, function (i, v) {
|
|
|
if(d.manufacturerName==v.id) {
|
|
|
manufacturerName = v.name;
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
var url = domainName + '/cmdb-CI/supplier/find/'+d.machineRoomId+'?accessToken='+accessToken
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
success: function(res){
|
|
|
if(res.data.cmdbSupplier){
|
|
|
manufacturerName = res.data.cmdbSupplier.shortName;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
return manufacturerName;
|
|
|
}
|
|
|
field: 'manufacturerName', title: '厂商', align: 'center'
|
|
|
}, {
|
|
|
field: 'createTime', title: '上报时间', align: 'center',
|
|
|
}]],
|
...
|
...
|
@@ -307,8 +283,8 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
table.on('tool(table-workreport-view)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
if (obj.event === 'serRead') {
|
|
|
|
|
|
var id = data['id'];
|
|
|
var datas = layui.table.cache["table-workreport-view"];
|
|
|
var repType = data['repType'];
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/workreport/setRead',
|
...
|
...
|
@@ -318,20 +294,13 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
obj.update({
|
|
|
currIsRead: "1"
|
|
|
});
|
|
|
loadReadReport();
|
|
|
reloadAllChange();
|
|
|
}
|
|
|
});
|
|
|
common.openWin('workreport/add', '查看', {
|
|
|
id: id,
|
|
|
repType: repType,
|
|
|
viewType: 'view'
|
|
|
}, ['关闭'], function f() {
|
|
|
return true;
|
|
|
}, null, null, {
|
|
|
success: function () {
|
|
|
form.render();
|
|
|
}
|
|
|
})
|
|
|
common.openWin('workreport/add', '查看', {id: id, repType: repType, viewType: 'view',datas:datas}, ['下一条','关闭'], function f() {
|
|
|
$("#workReport-form-next-id").trigger("click");
|
|
|
reloadAllChange();
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -340,6 +309,7 @@ layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydat |
|
|
var url = `${domainName}/cmdb-CI/supplier/list?page=1&limit=20&supplierType=0&accessToken=${accessToken}`;
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
async: false,
|
|
|
success: function (res) {
|
|
|
var options = "<option value=''>=选择厂商=</option>";
|
|
|
$.each(res.data, function (i, v) {
|
...
|
...
|
|