|
@@ -0,0 +1,380 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <title>导入</title>
|
|
|
+ <script src="../../js/min-loader-next.js"></script>
|
|
|
+ <script src="../../js/report.js"></script>
|
|
|
+ <link rel="stylesheet" href="../../plugins/layui/lay/modules/steps/style.css"></link>
|
|
|
+ <style>
|
|
|
+ .layui-input {
|
|
|
+ width : 200px;
|
|
|
+ }
|
|
|
+ .layui-upload-drag .layui-icon {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .layui-btn-sm {
|
|
|
+ height: 22px;
|
|
|
+ line-height: 22px;
|
|
|
+ padding: 0 10px;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body class="content">
|
|
|
+ <div id="step_demo" class="step-body" style = "margin-top : 20px; margin-left: 10%;">
|
|
|
+ <div class="step-header" style="width:80%;overflow: hidden;">
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ <span class="step-name">选择报告/报表</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span class="step-name">选择文件</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span class="step-name">数据预览</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span class="step-name">生成报告/报表</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="order-body" style = "width: 80%; margin-left : 10%;height : 450px" name = "step">
|
|
|
+ <form class="layui-form" style = "text-align : center;">
|
|
|
+ <div class="order-select" id="content" style = "background: #FFFFFF;border-radius: 8px;padding: 16px 1.4rem;">
|
|
|
+ <div class="layui-inline" style="margin-top: 150px;">
|
|
|
+ <label class="f12-gray4">请选择文件类型:</label>
|
|
|
+ <div id = "reportTypeDiv" class="layui-inline">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top : 200px;">
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(2)">下一步</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center;">
|
|
|
+ <div style = "width: 80%; margin-left : 0px; height : 200px" class = "layui-upload-drag" >
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" id = "firstButton" onclick = "chooseDataWareFile(this)">选择文件</button>
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" id = "secondButton" onclick = "chooseDataWareFile(this)">对比文件</button>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top : 50px;">
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" onclick = "tableYulan()">下一步</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div name = "step" style = "width: 80%; margin-left : 10%; height : 300px; display : none; text-align : center;">
|
|
|
+ <div style = "width: 100%; margin-left : 0px;" class = "layui-upload-drag" >
|
|
|
+ <p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
|
|
|
+ <table id = "reportTable" class="layui-table">
|
|
|
+ </table>
|
|
|
+ <p id = "content"></p>
|
|
|
+ <p>报表关联的工具表为《<a id = "utilName" onclick = "goUtilDetail(this)">2020年6月底低电压月报工具表</a>》 关联的报表算法为《<a id = "algorithmName" onclick = "goAlgorithmDetail(this)">国网泰安供电公司2020年8月份配网运行分析月报</a>》 的算法</p>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top : 50px;">
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(4)">下一步</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center; margin-top : 50px;">
|
|
|
+ <i class="layui-icon layui-icon-ok-circle" style="font-size: 100px; color: #009688;"></i>
|
|
|
+ <p style = "font-weight: 700;font-size: 25px;">报表生成成功!</p>
|
|
|
+ <p style = " color: #b2bbc2;">可在数据仓库-报表管理进行查看</p>
|
|
|
+ <div style="margin-top : 100px;">
|
|
|
+ <button type="button" class="layui-btn" style = "width : 214px" onclick = "finish()">完成</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ var pageId = getQueryString("pageId");
|
|
|
+ // 报告类型
|
|
|
+ var reportType = getQueryString("reportType");
|
|
|
+
|
|
|
+ var $step;
|
|
|
+ layui.config({
|
|
|
+ base: '../../plugins/layui/lay/modules/steps/'
|
|
|
+ }).use(['steps','jquery'],function(){
|
|
|
+ var $ = layui.$;
|
|
|
+ $step = $("#step_demo").step();
|
|
|
+ })
|
|
|
+
|
|
|
+ layui.use('laydate', function(){
|
|
|
+ var laydate = layui.laydate;
|
|
|
+ // 报告日报日期选择
|
|
|
+ laydate.render({
|
|
|
+ elem : '#dayRange'
|
|
|
+ ,format : 'yyyyMMdd'
|
|
|
+ ,done: function(value, date, endDate){
|
|
|
+ console.log(value); //得到日期生成的值,如:2017-08-18
|
|
|
+ var fileName = $("#fileName").html();
|
|
|
+ if (fileName.indexOf("-") != -1) {
|
|
|
+ $("#fileName").html(fileName.split("-")[0]+value);
|
|
|
+ } else {
|
|
|
+ $("#fileName").html(fileName+"-" + value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 报告日期范围选择
|
|
|
+ laydate.render({
|
|
|
+ elem : '#dateRange'
|
|
|
+ ,format : 'yyyyMMdd'
|
|
|
+ ,range : true
|
|
|
+ ,done: function(value, date, endDate){
|
|
|
+ console.log(value); //得到日期生成的值,如:2017-08-18
|
|
|
+ var fileName = $("#fileName").html();
|
|
|
+ if (fileName.indexOf("-") != -1) {
|
|
|
+ $("#fileName").html(fileName.split("-")[0]+value);
|
|
|
+ } else {
|
|
|
+ $("#fileName").html(fileName+"-" + value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //时间范围
|
|
|
+ laydate.render({
|
|
|
+ elem : '#timeRange'
|
|
|
+ ,type : 'time'
|
|
|
+ ,format : 'HHmmss'
|
|
|
+ ,value : '000000 - 235959'
|
|
|
+ ,range : true
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 范围类型
|
|
|
+ layui.use('form', function(){
|
|
|
+ var form = layui.form;
|
|
|
+ $.request({
|
|
|
+ action : 'BranchReportTypeAction/branchReportTypeQuery',
|
|
|
+ data : {
|
|
|
+ reportType : reportType
|
|
|
+ },
|
|
|
+ success : function(data) {
|
|
|
+ var html = '<select id = "reportType" lay-filter="reportTypeFilter"><option value = "">请选择</option>';
|
|
|
+ var fileTypeList = data.data;
|
|
|
+ for (var i = 0; i < fileTypeList.length; i ++) {
|
|
|
+ var fileTypeInf = fileTypeList[i];
|
|
|
+ html += '<option value = "' + fileTypeInf.id + '_' + fileTypeInf.type + '_' + fileTypeInf.timeType + '">' + fileTypeInf.name + '</option>';
|
|
|
+ }
|
|
|
+ html += '</select>';
|
|
|
+ $("#reportTypeDiv").html(html);
|
|
|
+ form.render();
|
|
|
+ },
|
|
|
+ error : function(data2) {
|
|
|
+ $.ErrorAlert(data2.MINErrorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on('select(reportTypeFilter)', function(data){
|
|
|
+ var value = data.value;
|
|
|
+ if (!isEmpty(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("reportTypeId", reportTypeId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ error : function(data2) {
|
|
|
+ $.ErrorAlert(data2.MINErrorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ function goStep (step) {
|
|
|
+ var reportInf = $("#reportTypeDiv").find("select option:selected").val();
|
|
|
+
|
|
|
+ if (step == 2) {
|
|
|
+ if (isEmpty(reportInf)) {
|
|
|
+ $.ErrorAlert("请选择上传文件类型!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var reportType = reportInf.split("_")[0];
|
|
|
+ // 台区停电日报
|
|
|
+ if ("TQTDRB" == reportType) {
|
|
|
+ $("body").find("[name='TQTDRB']").show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (step == 4) {
|
|
|
+ var firstFileId = $("#firstButton").attr("fileId");
|
|
|
+ var secondFileId = $("#secondButton").attr("fileId");
|
|
|
+ if (isEmpty(firstFileId)) {
|
|
|
+ $.ErrorAlert("请选择文件!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (isEmpty(secondFileId)) {
|
|
|
+ $.ErrorAlert("请选择对比文件!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var fileName = $("#fileName").html();
|
|
|
+ $.request({
|
|
|
+ action : 'ReportManageAction/fileInfReportSubmit',
|
|
|
+ data : {
|
|
|
+ reportData : JSON.stringify(excelList),
|
|
|
+ reportInf : reportInf,
|
|
|
+ fileName : fileName,
|
|
|
+ firstFileId : firstFileId,
|
|
|
+ secondFileId : secondFileId
|
|
|
+ },
|
|
|
+ success : function(data) {
|
|
|
+ if (data.code == 0) {
|
|
|
+ $step.goStep(step);
|
|
|
+ var stepDiv = $("div[name = 'step']");
|
|
|
+ for (var i = 0; i < stepDiv.length; i ++) {
|
|
|
+ if (step == (i + 1)) {
|
|
|
+ $(stepDiv[i]).show();
|
|
|
+ } else {
|
|
|
+ $(stepDiv[i]).hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $.ErrorAlert(res.MINErrorMessage);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : function(data2) {
|
|
|
+ $.ErrorAlert(data2.MINErrorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ $step.goStep(step);
|
|
|
+ var stepDiv = $("div[name = 'step']");
|
|
|
+ for (var i = 0; i < stepDiv.length; i ++) {
|
|
|
+ if (step == (i + 1)) {
|
|
|
+ $(stepDiv[i]).show();
|
|
|
+ } else {
|
|
|
+ $(stepDiv[i]).hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function finish() {
|
|
|
+ deleteTabPageParent(pageId);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 报表查询的明细数据
|
|
|
+ var chooseFileData;
|
|
|
+
|
|
|
+ function deleteChooseFile(index) {
|
|
|
+ chooseFileData.splice(index, 1);
|
|
|
+ tableInit();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查看工具表详情
|
|
|
+ function goUtilDetail(t) {
|
|
|
+ var fileName = $(t).attr("fileName");
|
|
|
+ var openPageId = pageId + "-01";
|
|
|
+ openMainTabPage(openPageId, "详情查看", "reprotManage/utilExcelDetail.html?pageId="+openPageId+"&fileName="+chineseUrlEncode(fileName), '', pageId, null);
|
|
|
+ }
|
|
|
+ // 查看算法详情
|
|
|
+ function goAlgorithmDetail(t) {
|
|
|
+ var reportTypeId = $(t).attr("reportTypeId");
|
|
|
+ var openPageId = pageId + "-02";
|
|
|
+ openMainTabPage(openPageId, "详情查看", "reprotManage/reportAlgorithm.html?pageId="+openPageId+"&reportTypeId="+reportTypeId, '', pageId, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 报表excel
|
|
|
+ var excelList = null;
|
|
|
+ // 预览
|
|
|
+ function tableYulan() {
|
|
|
+ var firstFileId = $("#firstButton").attr("fileId");
|
|
|
+ var secondFileId = $("#secondButton").attr("fileId");
|
|
|
+ if (isEmpty(firstFileId)) {
|
|
|
+ $.ErrorAlert("请选择文件!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (isEmpty(secondFileId)) {
|
|
|
+ $.ErrorAlert("请选择对比文件!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var reportInf = $("#reportTypeDiv").find("select option:selected").val();
|
|
|
+ // 查询符合条件的明细数据,生成预览数据
|
|
|
+ $.request({
|
|
|
+ action : 'ReportManageAction/reportNeedDataDetail',
|
|
|
+ data : {
|
|
|
+ firstFileId : firstFileId,
|
|
|
+ secondFileId : secondFileId,
|
|
|
+ reportInf : reportInf,
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 选择数据仓库文件
|
|
|
+ function chooseDataWareFile(t) {
|
|
|
+ var buttonId = $(t).attr("id");
|
|
|
+ setTempVal("buttonId",buttonId);
|
|
|
+ var openPageId = pageId + "-03";
|
|
|
+ openMainTabPage(openPageId, "选择数据仓库", "common/chooseDataWare.html?pageId="+openPageId+"&reportType="+reportType+"&chooseNum="+1, '', pageId, chooseComplete);
|
|
|
+ }
|
|
|
+ // 选择数据仓库文件返回
|
|
|
+ function chooseComplete() {
|
|
|
+ var dataWareData = getTempVal("dataWareData");
|
|
|
+ if (isEmpty(dataWareData) || dataWareData.length == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var buttonId = getTempVal("buttonId");
|
|
|
+ setTempVal("buttonId",null);
|
|
|
+ var buttonIdDom = $("#"+buttonId);
|
|
|
+ if (buttonId == "firstButton") {
|
|
|
+ $(buttonIdDom).html('<i class="layui-icon"></i>选择文件');
|
|
|
+ } else {
|
|
|
+ $(buttonIdDom).html('<i class="layui-icon"></i>对比文件');
|
|
|
+ }
|
|
|
+ $(buttonIdDom).attr("fileId", dataWareData[0].id);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+
|
|
|
+</html>
|