完善任务下派详情
This commit is contained in:
parent
6b71f2bac8
commit
807ac8a792
@ -0,0 +1,111 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/inspection/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index',
|
||||
treeTable: 'treeTable/treeTable',
|
||||
}).use(['index', 'treeTable'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var treeTable = layui.treeTable;
|
||||
var resizeTimeout = null;
|
||||
var taskEnterpriseId = top.restAjax.params(window.location.href).taskEnterpriseId;
|
||||
var checkItemListType = top.restAjax.params(window.location.href).checkItemListType;
|
||||
var tableUrl = 'api/taskcheck/v2/listcheckitem/{checkItemListType}/{taskEnterpriseId}';
|
||||
var treeTableObj;
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function initData() {}
|
||||
|
||||
function initTable() {
|
||||
top.restAjax.get(top.restAjax.path(tableUrl, [checkItemListType, taskEnterpriseId]), {}, null, function(code, data) {
|
||||
treeTableObj = treeTable.render({
|
||||
elem: '#dataTable',
|
||||
data: data,
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: ($win.height() - 80) +'px',
|
||||
tree: {
|
||||
iconIndex: 2,
|
||||
isPidData: true,
|
||||
idName: 'checkItemId',
|
||||
pidName: 'checkItemParentId',
|
||||
},
|
||||
cols: [
|
||||
{type: 'numbers'},
|
||||
{type: 'checkbox'},
|
||||
{field: 'checkItemName', title: '名称', width: 600},
|
||||
{field: 'checkItemType', title: '类型', width: 100,
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '目录';
|
||||
} else if(rowData == 2) {
|
||||
return '检查项';
|
||||
}
|
||||
}
|
||||
},
|
||||
]
|
||||
});
|
||||
treeTableObj.expandAll();
|
||||
initData();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable() {
|
||||
treeTableObj.reload({
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: ($win.height() - 80) +'px',
|
||||
});
|
||||
treeTableObj.expandAll();
|
||||
initData();
|
||||
}
|
||||
|
||||
initTable();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -39,23 +39,26 @@
|
||||
var laytpl = layui.laytpl;
|
||||
var resizeTimeout = null;
|
||||
var taskId = top.restAjax.params(window.location.href).taskId;
|
||||
var checkItemListType = top.restAjax.params(window.location.href).checkItemListType;
|
||||
var tableUrl = 'api/taskcheck/v2/listpagetaskenterprise/{taskId}';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [taskId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 22,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
function addContactOption(col) {
|
||||
col.push({field: 'contactOption', width: 120, title: '行业检查项', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="contactOptionEvent">行业检查项</button>';
|
||||
}
|
||||
})
|
||||
}
|
||||
function addCustomOption(col) {
|
||||
col.push({field: 'customOption', width: 120, title: '企业检查项', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="customOptionEvent">企业检查项</button>';
|
||||
}
|
||||
})
|
||||
}
|
||||
var cols = [[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'enterpriseName', width: 240, title: '企业名称', align:'center',
|
||||
templet: function(row) {
|
||||
@ -123,12 +126,28 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'operation', width: 90, title: '操作', fixed: 'right', align:'center',
|
||||
templet: function(row) {
|
||||
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="checkItemEvent">检查项</button>';
|
||||
]];
|
||||
if(checkItemListType && checkItemListType == '2') {
|
||||
addContactOption(cols[0]);
|
||||
} else if(checkItemListType && checkItemListType == '3') {
|
||||
addCustomOption(cols[0]);
|
||||
} else {
|
||||
addContactOption(cols[0]);
|
||||
addCustomOption(cols[0]);
|
||||
}
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [taskId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 22,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
]],
|
||||
cols: cols,
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
@ -148,14 +167,29 @@
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
height: $win.height() - 22,
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'pollutionEvent') {
|
||||
if(event === 'contactOptionEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 1]),
|
||||
title: '行业检查项',
|
||||
width: '840px',
|
||||
height: '80%',
|
||||
onClose: function () {}
|
||||
});
|
||||
} else if(event === 'customOptionEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 2]),
|
||||
title: '企业检查项',
|
||||
width: '840px',
|
||||
height: '80%',
|
||||
onClose: function () {}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -368,7 +368,7 @@
|
||||
});
|
||||
} else if(event === 'taskEnterpriseEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-enterprise.html?taskId={taskId}', [data.taskId]),
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-enterprise.html?taskId={taskId}&checkItemListType={checkItemListType}', [data.taskId, data.checkItemListType]),
|
||||
title: '检查企业列表',
|
||||
width: '70%',
|
||||
height: '80%',
|
||||
|
Loading…
Reference in New Issue
Block a user