新增任务结果查询
This commit is contained in:
parent
92034c83c2
commit
21a3204d62
@ -15,6 +15,7 @@ import com.cm.inspection.enums.task.v2.TaskTypeSubEnum;
|
||||
import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO;
|
||||
import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO;
|
||||
import com.cm.inspection.pojo.dtos.taskcheck.v2.TaskCheckDTO;
|
||||
import com.cm.inspection.pojo.dtos.taskcheck.v2.TaskCheckReportCheckItemDTO;
|
||||
import com.cm.inspection.pojo.vos.taskcheck.v2.TaskCheckVO;
|
||||
import com.cm.inspection.service.taskcheck.v2.ITaskCheckService;
|
||||
import io.swagger.annotations.*;
|
||||
@ -197,4 +198,19 @@ public class TaskCheckController extends AbstractController {
|
||||
return taskCheckService.listCheckItem(checkItemListType, taskEnterpriseId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "检查结果列表", notes = "检查结果列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "checkItemListType", value = "检查项列表类型, 1:行业检查项,2:企业检查项", paramType = "path"),
|
||||
@ApiImplicitParam(name = "taskEnterpriseId", value = "检查任务企业ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listtaskcheckreport/{checkItemListType}/{taskEnterpriseId}")
|
||||
public List<TaskCheckReportCheckItemDTO> listTaskCheckReport(@PathVariable("checkItemListType") Integer checkItemListType,
|
||||
@PathVariable("taskEnterpriseId") String taskEnterpriseId) {
|
||||
if (ITaskCheckService.CHECK_ITEM_LIST_TYPE_RELATION != checkItemListType && ITaskCheckService.CHECK_ITEM_LIST_TYPE_CUSTOM != checkItemListType) {
|
||||
throw new ParamsException("参数错误");
|
||||
}
|
||||
return taskCheckService.listTaskCheckReport(checkItemListType, taskEnterpriseId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,135 @@
|
||||
<!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>
|
||||
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/listtaskcheckreport/{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) {
|
||||
var checkItemOptionArray = [];
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
if(item.checkItemOptions.length == 0) {
|
||||
continue;
|
||||
}
|
||||
for(var j = 0, jItem; jItem = item.checkItemOptions[j++];) {
|
||||
var obj = {
|
||||
checkItemId: jItem.checkItemOptionId,
|
||||
checkItemParentId: item.checkItemId,
|
||||
checkItemType: 3,
|
||||
checkItemOptionType: jItem.checkItemOptionType,
|
||||
checkItemOptionUnit: jItem.checkItemOptionUnit,
|
||||
};
|
||||
if(jItem.checkItemOptionType == 1) {
|
||||
obj.checkItemName = jItem.checkItemOptionName;
|
||||
} else {
|
||||
obj.checkItemName = jItem.checkItemOptionName +' '+ jItem.checkResult +' '+ jItem.checkItemOptionUnit;
|
||||
}
|
||||
checkItemOptionArray.push(obj);
|
||||
}
|
||||
}
|
||||
data = data.concat(checkItemOptionArray);
|
||||
console.log(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 '检查项';
|
||||
} else if(rowData == 3) {
|
||||
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>
|
@ -0,0 +1,66 @@
|
||||
<!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">
|
||||
<style>
|
||||
.layui-tab-item {height: 100%}
|
||||
.layui-tab-item iframe {width: 100%; height: 100%; border: 0px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="tabCard" class="layui-tab layui-tab-card" lay-filter="tabCardFilter" style="margin: 0px;">
|
||||
<ul class="layui-tab-title">
|
||||
<li id="card1" class="layui-this">检查项列表</li>
|
||||
<li id="card2">检查结果</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" id="tabContentTemplateBox"></div>
|
||||
<script id="tabContentTemplate" type="text/html">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<iframe class="card-iframe" src="route/taskcheck/v2/list-task-checkitem.html?taskEnterpriseId={{d.taskEnterpriseId}}&checkItemListType={{d.checkItemListType}}"></iframe>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<iframe class="card-iframe" src="route/taskcheck/v2/list-task-checkitem-report.html?taskEnterpriseId={{d.taskEnterpriseId}}&checkItemListType={{d.checkItemListType}}"></iframe>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index',
|
||||
}).use(['index', 'element'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var taskEnterpriseId = top.restAjax.params(window.location.href).taskEnterpriseId;
|
||||
var checkItemListType = top.restAjax.params(window.location.href).checkItemListType;
|
||||
var element = layui.element;
|
||||
var laytpl = layui.laytpl;
|
||||
|
||||
$('#tabCard').css({
|
||||
height: ($win.height() - 3) +'px'
|
||||
});
|
||||
$('#tabContentTemplateBox').css({
|
||||
height: ($win.height() - 63) +'px'
|
||||
})
|
||||
|
||||
laytpl(document.getElementById('tabContentTemplate').innerHTML).render({
|
||||
taskEnterpriseId: taskEnterpriseId,
|
||||
checkItemListType: checkItemListType
|
||||
}, function(html) {
|
||||
document.getElementById('tabContentTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -23,7 +23,6 @@
|
||||
</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/'
|
||||
|
@ -176,16 +176,16 @@
|
||||
var event = obj.event;
|
||||
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: '行业检查项',
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 1]),
|
||||
title: false,
|
||||
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: '企业检查项',
|
||||
url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 2]),
|
||||
title: false,
|
||||
width: '840px',
|
||||
height: '80%',
|
||||
onClose: function () {}
|
||||
|
Loading…
Reference in New Issue
Block a user