|
@@ -57,22 +57,20 @@
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center;">
|
|
<div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center;">
|
|
- <div style = "width: 80%; margin-left : 0px;" class = "layui-upload-drag" >
|
|
|
|
- <button type="button" class="layui-btn" style = "width : 214px" onclick = "chooseFile()"> <i class="layui-icon"></i> 选择文件</button>
|
|
|
|
- <table id = "chooseFileDataTable" class="layui-table">
|
|
|
|
- <tr><td>序号</td><td>时间</td><td>文件名称</td><td>导入人员</td><td>数据条数</td><td>操作</td></tr>
|
|
|
|
- <tr><td colspan = "6">无数据</td></tr>
|
|
|
|
- </table>
|
|
|
|
|
|
+ <div style = "width: 80%; margin-left : 0px; height : 200px" class = "layui-upload-drag" >
|
|
|
|
+ <input type="text" style = "display : inline-block" class="layui-input" id="dayRange" placeholder="请选择报表日期">
|
|
|
|
+ <input type="text" style = "display : inline-block" class="layui-input" id="dateRange" placeholder="请选择报表日期范围">
|
|
|
|
+ <input type="text" style = "display : inline-block" class="layui-input" id="timeRange" placeholder="请选择报表时间段">
|
|
|
|
+ <p><a id = "monthNum" style = "font-size: 18px; color: red;" onclick = "changeHtml(this)">2</a>个月内停电<a id = "countNum" style = "font-size: 18px; color: red;" onclick = "changeHtml(this)">3</a>次以上的台区数量</p>
|
|
</div>
|
|
</div>
|
|
<div style="margin-top : 50px;">
|
|
<div style="margin-top : 50px;">
|
|
- <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(3)">下一步</button>
|
|
|
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" onclick = "tableYulan()">下一步</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center;">
|
|
|
|
|
|
+ <div name = "step" style = "width: 80%; margin-left : 10%; height : 300px; display : none; text-align : center;">
|
|
<div style = "width: 80%; margin-left : 0px;" class = "layui-upload-drag" >
|
|
<div style = "width: 80%; margin-left : 0px;" class = "layui-upload-drag" >
|
|
<p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
|
|
<p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
|
|
<table id = "reportTable" class="layui-table">
|
|
<table id = "reportTable" class="layui-table">
|
|
-
|
|
|
|
</table>
|
|
</table>
|
|
<p>报表关联的工具表为《<a id = "utilName" onclick = "goUtilDetail(this)">2020年6月底低电压月报工具表</a>》 关联的报表算法为《<a id = "algorithmName" onclick = "goAlgorithmDetail(this)">国网泰安供电公司2020年8月份配网运行分析月报</a>》 的算法</p>
|
|
<p>报表关联的工具表为《<a id = "utilName" onclick = "goUtilDetail(this)">2020年6月底低电压月报工具表</a>》 关联的报表算法为《<a id = "algorithmName" onclick = "goAlgorithmDetail(this)">国网泰安供电公司2020年8月份配网运行分析月报</a>》 的算法</p>
|
|
</div>
|
|
</div>
|
|
@@ -100,6 +98,31 @@
|
|
$step = $("#step_demo").step();
|
|
$step = $("#step_demo").step();
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ layui.use('laydate', function(){
|
|
|
|
+ var laydate = layui.laydate;
|
|
|
|
+ // 报告日报日期选择
|
|
|
|
+ laydate.render({
|
|
|
|
+ elem : '#dayRange'
|
|
|
|
+ ,format : 'yyyyMMdd'
|
|
|
|
+ });
|
|
|
|
+ // 报告日期范围选择
|
|
|
|
+ laydate.render({
|
|
|
|
+ elem : '#dateRange'
|
|
|
|
+ ,format : 'yyyyMMdd'
|
|
|
|
+ ,range : true
|
|
|
|
+ });
|
|
|
|
+ //时间范围
|
|
|
|
+ laydate.render({
|
|
|
|
+ elem : '#timeRange'
|
|
|
|
+ ,type : 'time'
|
|
|
|
+ ,format : 'HHmmss'
|
|
|
|
+ ,value : '000000 - 235959'
|
|
|
|
+ ,range : true
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 范围类型
|
|
|
|
+ var timeType = null;
|
|
layui.use('form', function(){
|
|
layui.use('form', function(){
|
|
var form = layui.form;
|
|
var form = layui.form;
|
|
$.request({
|
|
$.request({
|
|
@@ -111,7 +134,7 @@
|
|
var fileTypeList = data.data;
|
|
var fileTypeList = data.data;
|
|
for (var i = 0; i < fileTypeList.length; i ++) {
|
|
for (var i = 0; i < fileTypeList.length; i ++) {
|
|
var fileTypeInf = fileTypeList[i];
|
|
var fileTypeInf = fileTypeList[i];
|
|
- html += '<option value = "' + fileTypeInf.id + '_' + fileTypeInf.type +'">' + fileTypeInf.name + '</option>';
|
|
|
|
|
|
+ html += '<option value = "' + fileTypeInf.id + '_' + fileTypeInf.type + '_' + fileTypeInf.timeType + '">' + fileTypeInf.name + '</option>';
|
|
}
|
|
}
|
|
html += '</select>';
|
|
html += '</select>';
|
|
$("#reportTypeDiv").html(html);
|
|
$("#reportTypeDiv").html(html);
|
|
@@ -123,44 +146,58 @@
|
|
});
|
|
});
|
|
|
|
|
|
form.on('select(reportTypeFilter)', function(data){
|
|
form.on('select(reportTypeFilter)', function(data){
|
|
- var value = data.value;
|
|
|
|
- var reportTypeId = value.split("_")[0];
|
|
|
|
- $("#fileName").html(data.elem.selectedOptions[0].text);
|
|
|
|
- if (!isEmpty(reportTypeId)) {
|
|
|
|
- $.request({
|
|
|
|
- action : 'BranchReportTypeAction/fileTypeOfReportType',
|
|
|
|
- data : {
|
|
|
|
- reportTypeId : reportTypeId
|
|
|
|
- },
|
|
|
|
- success : function(data) {
|
|
|
|
- fileType = data.data;
|
|
|
|
- setTempVal("fileType", fileType);
|
|
|
|
-
|
|
|
|
- var utilDataInf = data.utilDataInf;
|
|
|
|
- if (!isEmpty(utilDataInf)) {
|
|
|
|
- $("#utilName").html(utilDataInf.fileName);
|
|
|
|
- $("#utilName").attr("fileName", utilDataInf.fileName);
|
|
|
|
- setTempVal("utilExcelDataDetail", utilDataInf.excelData);
|
|
|
|
- var algorithmInf = data.algorithmInf;
|
|
|
|
- if (!isEmpty(algorithmInf)) {
|
|
|
|
- $("#algorithmName").html(utilDataInf.fileName+"算法");
|
|
|
|
- $("#algorithmName").attr("algorithmId", algorithmInf.id);
|
|
|
|
|
|
+ var value = data.value;
|
|
|
|
+ if (!isEmpty(value)) {
|
|
|
|
+ var reportTypeId = value.split("_")[0];
|
|
|
|
+ timeType = value.split("_")[2];
|
|
|
|
+ // 日报
|
|
|
|
+ if (timeType == '00') {
|
|
|
|
+ $("#dayRange").show();
|
|
|
|
+ $("#dateRange").hide();
|
|
|
|
+ } else {
|
|
|
|
+ $("#dayRange").hide();
|
|
|
|
+ $("#dateRange").show();
|
|
|
|
+ }
|
|
|
|
+ $("#fileName").html(data.elem.selectedOptions[0].text);
|
|
|
|
+
|
|
|
|
+ if (!isEmpty(reportTypeId)) {
|
|
|
|
+ $.request({
|
|
|
|
+ action : 'BranchReportTypeAction/fileTypeOfReportType',
|
|
|
|
+ data : {
|
|
|
|
+ reportTypeId : reportTypeId
|
|
|
|
+ },
|
|
|
|
+ success : function(data) {
|
|
|
|
+ fileType = data.data;
|
|
|
|
+ setTempVal("fileType", fileType);
|
|
|
|
+
|
|
|
|
+ var utilDataInf = data.utilDataInf;
|
|
|
|
+ if (!isEmpty(utilDataInf)) {
|
|
|
|
+ $("#utilName").html(utilDataInf.fileName);
|
|
|
|
+ $("#utilName").attr("fileName", utilDataInf.fileName);
|
|
|
|
+ setTempVal("utilExcelDataDetail", utilDataInf.excelData);
|
|
|
|
+ var algorithmInf = data.algorithmInf;
|
|
|
|
+ if (!isEmpty(algorithmInf)) {
|
|
|
|
+ $("#algorithmName").html(utilDataInf.fileName+"算法");
|
|
|
|
+ $("#algorithmName").attr("reportTypeId", reportTypeId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ error : function(data2) {
|
|
|
|
+ $.ErrorAlert(data2.MINErrorMessage);
|
|
}
|
|
}
|
|
-
|
|
|
|
- },
|
|
|
|
- error : function(data2) {
|
|
|
|
- $.ErrorAlert(data2.MINErrorMessage);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
|
|
- var fileType = null;
|
|
|
|
-
|
|
|
|
function goStep (step) {
|
|
function goStep (step) {
|
|
var reportInf = $("#reportTypeDiv").find("select option:selected").val();
|
|
var reportInf = $("#reportTypeDiv").find("select option:selected").val();
|
|
|
|
+
|
|
|
|
+ var dayRange = $("#dayRange").val();
|
|
|
|
+ var dateRange = $("#dateRange").val();
|
|
|
|
+ var timeRange = $("#timeRange").val();
|
|
if (step == 2) {
|
|
if (step == 2) {
|
|
if (isEmpty(reportInf)) {
|
|
if (isEmpty(reportInf)) {
|
|
$.ErrorAlert("请选择上传文件类型!");
|
|
$.ErrorAlert("请选择上传文件类型!");
|
|
@@ -168,24 +205,23 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (step == 3) {
|
|
|
|
- if (isEmpty(chooseFileData) || chooseFileData.length == 0) {
|
|
|
|
- $.ErrorAlert("请选择关联文件!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- reportInit(reportInf, chooseFileData);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (step == 4) {
|
|
if (step == 4) {
|
|
var reportData = getTempVal("reportData");
|
|
var reportData = getTempVal("reportData");
|
|
var fileName = $("#fileName").html();
|
|
var fileName = $("#fileName").html();
|
|
|
|
+ var range = null;
|
|
|
|
+ if (timeType == '00') {
|
|
|
|
+ range = dayRange + "-" + dayRange;
|
|
|
|
+ } else {
|
|
|
|
+ range = dateRange;
|
|
|
|
+ }
|
|
$.request({
|
|
$.request({
|
|
action : 'ReportManageAction/fileInfReportSubmit',
|
|
action : 'ReportManageAction/fileInfReportSubmit',
|
|
data : {
|
|
data : {
|
|
- reportData : JSON.stringify(reportData),
|
|
|
|
- chooseFileData : JSON.stringify(chooseFileData),
|
|
|
|
|
|
+ reportData : JSON.stringify(excelList),
|
|
reportInf : reportInf,
|
|
reportInf : reportInf,
|
|
- fileName : fileName
|
|
|
|
|
|
+ fileName : fileName,
|
|
|
|
+ range : range,
|
|
|
|
+ timeRange : timeRange
|
|
},
|
|
},
|
|
success : function(data) {
|
|
success : function(data) {
|
|
if (data.code == 0) {
|
|
if (data.code == 0) {
|
|
@@ -224,44 +260,9 @@
|
|
deleteTabPageParent(pageId);
|
|
deleteTabPageParent(pageId);
|
|
}
|
|
}
|
|
|
|
|
|
- // 选择原始文件
|
|
|
|
- function chooseFile() {
|
|
|
|
- setTempVal("chooseFileData", chooseFileData);
|
|
|
|
- var openPageId = pageId + "01";
|
|
|
|
- openMainTabPage(openPageId, "选择文件", "common/chooseDataWare.html?pageId="+openPageId, '', pageId, chooseFileDataBack);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ // 报表查询的明细数据
|
|
var chooseFileData;
|
|
var chooseFileData;
|
|
- // 选择原始数据后处理
|
|
|
|
- function chooseFileDataBack() {
|
|
|
|
- var dataWareData = getTempVal("dataWareData");
|
|
|
|
- if (!isEmpty(dataWareData)) {
|
|
|
|
- setTempVal("dataWareData", null);
|
|
|
|
- if (isEmpty(chooseFileData)) {
|
|
|
|
- chooseFileData = dataWareData;
|
|
|
|
- } else {
|
|
|
|
- for (var i = 0; i < dataWareData.length; i ++) {
|
|
|
|
- chooseFileData.push(dataWareData[i]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- tableInit();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function tableInit() {
|
|
|
|
- var html = '<tr><td>序号</td><td>时间</td><td>文件名称</td><td>导入人员</td><td>数据条数</td><td>操作</td></tr>';
|
|
|
|
-
|
|
|
|
- if (isEmpty(chooseFileData) || chooseFileData.length == 0) {
|
|
|
|
- html += '<tr><td colspan = "6">无数据</td></tr>';
|
|
|
|
- } else {
|
|
|
|
- for (var i = 0; i < chooseFileData.length; i ++) {
|
|
|
|
- var resMap = chooseFileData[i];
|
|
|
|
- html += '<tr><td>' + (i + 1) + '</td><td>' + resMap.uploadDate + '</td><td>' + resMap.fileName + '</td><td>' + resMap.userName + '</td><td>' + resMap.dataNum + '</td><td> <button onclick = "deleteChooseFile('+i+')" type="button" class="layui-btn-danger layui-btn-sm"><i class="layui-icon"></i></button></td></tr>';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $("#chooseFileDataTable").html(html);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
function deleteChooseFile(index) {
|
|
function deleteChooseFile(index) {
|
|
chooseFileData.splice(index, 1);
|
|
chooseFileData.splice(index, 1);
|
|
@@ -276,9 +277,80 @@
|
|
}
|
|
}
|
|
// 查看算法详情
|
|
// 查看算法详情
|
|
function goAlgorithmDetail(t) {
|
|
function goAlgorithmDetail(t) {
|
|
- var algorithmId = $(t).attr("algorithmId");
|
|
|
|
|
|
+ var reportTypeId = $(t).attr("reportTypeId");
|
|
var openPageId = pageId + "-02";
|
|
var openPageId = pageId + "-02";
|
|
- openMainTabPage(openPageId, "详情查看", "reprotManage/reportAlgorithm.html?pageId="+openPageId+"&algorithmId="+algorithmId, '', pageId, null);
|
|
|
|
|
|
+ openMainTabPage(openPageId, "详情查看", "reprotManage/reportAlgorithm.html?pageId="+openPageId+"&reportTypeId="+reportTypeId, '', pageId, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 报表excel
|
|
|
|
+ var excelList = null;
|
|
|
|
+ // 预览
|
|
|
|
+ function tableYulan() {
|
|
|
|
+ var reportInf = $("#reportTypeDiv").find("select option:selected").val();
|
|
|
|
+ var dayRange = $("#dayRange").val();
|
|
|
|
+ var dateRange = $("#dateRange").val();
|
|
|
|
+ var timeRange = $("#timeRange").val();
|
|
|
|
+
|
|
|
|
+ // 日报
|
|
|
|
+ if (timeType == '00') {
|
|
|
|
+ if (isEmpty(dayRange)) {
|
|
|
|
+ $.ErrorAlert("请选择报表日期!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (isEmpty(dateRange)) {
|
|
|
|
+ $.ErrorAlert("请选择报表日期范围!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 日报
|
|
|
|
+ var range = null;
|
|
|
|
+ if (timeType == '00') {
|
|
|
|
+ range = dayRange + "-" + dayRange;
|
|
|
|
+ } else {
|
|
|
|
+ range = dateRange;
|
|
|
|
+ }
|
|
|
|
+ var monthNum = $("#monthNum").html();
|
|
|
|
+ var countNum = $("#countNum").html();
|
|
|
|
+ // 查询符合条件的明细数据,生成预览数据
|
|
|
|
+ $.request({
|
|
|
|
+ action : 'ReportManageAction/reportNeedDataDetail',
|
|
|
|
+ data : {
|
|
|
|
+ range : range,
|
|
|
|
+ timeRange : timeRange,
|
|
|
|
+ reportInf : reportInf,
|
|
|
|
+ monthNum : monthNum,
|
|
|
|
+ countNum : countNum
|
|
|
|
+ },
|
|
|
|
+ success : function(data) {
|
|
|
|
+ if (data.code == 0) {
|
|
|
|
+ excelList = data.data.resList;
|
|
|
|
+ initExcelData(excelList, "reportTable", false);
|
|
|
|
+ goStep(3);
|
|
|
|
+ } else {
|
|
|
|
+ $.ErrorAlert(res.MINErrorMessage);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error : function(data2) {
|
|
|
|
+ $.ErrorAlert(data2.MINErrorMessage);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function changeHtml(t) {
|
|
|
|
+ var initValue = $(t).html();
|
|
|
|
+ layer.prompt({
|
|
|
|
+ formType: 2,
|
|
|
|
+ value: initValue,
|
|
|
|
+ title: '请输入',
|
|
|
|
+ area: ['200px', '33px'] //自定义文本域宽高
|
|
|
|
+ },
|
|
|
|
+ function(value, index, elem){
|
|
|
|
+ $(t).html(value);
|
|
|
|
+ layer.close(index);
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|