Commit a5913a1a authored by zqm's avatar zqm

1.解决bug28886,测试环境财务报表申报无法开表的问题

parent 813a9e56
var showLoading, hideLoading, myAlert, myConfirm
window.console = window.console || (function () {
var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () { };
window.console = window.console || (function() {
var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function() {};
return c;
})();
......@@ -10,40 +10,40 @@ function getIEVersion() {
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if(isIE) {
if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if(fIEVersion == 7) {
if (fIEVersion == 7) {
alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return 7;
} else if(fIEVersion == 8) {
} else if (fIEVersion == 8) {
alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return 8;
} else if(fIEVersion == 9) {
// alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
} else if (fIEVersion == 9) {
// alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return 9;
} else if(fIEVersion == 10) {
} else if (fIEVersion == 10) {
return 10;
} else {
alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return 6;//IE版本<=7
return 6; //IE版本<=7
}
} else if(isEdge) {
return 'edge';//edge
} else if(isIE11) {
} else if (isEdge) {
return 'edge'; //edge
} else if (isIE11) {
return 11; //IE11
}else{
return -1;//不是ie浏览器
} else {
return -1; //不是ie浏览器
}
if(!isEdge){
if (!isEdge) {
alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
}
}
//封装等待框
(function($) {
(function($) {
var renderHtml = function() {
var _html = '<div id="loadingDiv" style="display: none; cursor:progress;"><div id="over" style=" position: absolute;top: 0;left: 0; width: 100%;height: 100%; background-color: #f5f5f5;opacity:0.5;z-index: 9999991;"></div><div id="layout" style="position: absolute;top: 40%; left: 40%;width: 20%; height: 20%; z-index: 9999999;text-align:center;"><img id="showloading" src="../../static/tools/images/loading2.gif" /></div></div>';
$("body").append(_html);
......@@ -73,7 +73,7 @@ function getIEVersion() {
hideLoading = function() {
$.show.hideLoading();
}
})(jQuery);
})(jQuery);
/**
* 重写确认框 fun:函数对象 params:参数列表, 可以是数组
*/
......@@ -119,29 +119,29 @@ function getIEVersion() {
switch (type) {
case 'alert':
$("#mb_btn_ok").click(function () {
$("#mb_btn_ok").click(function() {
$.alerts._hide();
callback(true);
});
$("#mb_btn_no").focus().keypress(function (e) {
$("#mb_btn_no").focus().keypress(function(e) {
if (e.keyCode == 13 || e.keyCode == 27) $("#mb_btn_no").trigger('click');
});
break;
case 'confirm':
$("#mb_btn_ok").click(function () {
$("#mb_btn_ok").click(function() {
$.alerts._hide();
if (callback) callback(true);
});
$("#mb_btn_no").click(function () {
$("#mb_btn_no").click(function() {
$.alerts._hide();
//if (callback) callback(false);
});
$("#mb_img").click(function () {
$("#mb_img").click(function() {
$.alerts._hide();
//if (callback) callback(false);
});
$("#mb_btn_no").focus();
$("#mb_btn_ok, #mb_btn_no").keypress(function (e) {
$("#mb_btn_ok, #mb_btn_no").keypress(function(e) {
if (e.keyCode == 13) $("#mb_btn_ok").trigger('click');
if (e.keyCode == 27) $("#mb_btn_no").trigger('click');
});
......@@ -152,7 +152,8 @@ function getIEVersion() {
$("#mb_box,#mb_con").remove();
}
// Shortuct functions
};myAlert = function myAlert(title, message, btnOk, callback) {
};
myAlert = function myAlert(title, message, btnOk, callback) {
$.alerts.alert(title, message, btnOk, callback);
};
......@@ -207,9 +208,9 @@ function getIEVersion() {
$("#mb_img").css({
width: '19px',
height: '20px',
top:'10px',
right:'10px',
position:'absolute'
top: '10px',
right: '10px',
position: 'absolute'
});
$("#mb_img_span").css({
float: 'left',
......@@ -305,7 +306,7 @@ function getIEVersion() {
$("#mb_btn_ok").css({
backgroundColor: '#53ACF3',
marginRight: '6px',
right:'105px',
right: '105px',
bottom: '10px',
});
}
......@@ -318,12 +319,12 @@ function getIEVersion() {
});
//右上角关闭按钮hover样式
$("#mb_ico").hover(function () {
$("#mb_ico").hover(function() {
$(this).css({
backgroundColor: 'Red',
color: 'White'
});
}, function () {
}, function() {
$(this).css({
backgroundColor: '#DDD',
color: 'black'
......@@ -442,7 +443,7 @@ function alertBoxHide() {
setTimeout(function() {
alertBox(alertBoxArr[0].type, alertBoxArr[0].msg, alertBoxArr[0].showTime, alertBoxArr[0].callBack);
}, 500);
}else{
} else {
// window.close();
}
}
......@@ -806,30 +807,30 @@ function box(jqObj) {
* 工具
*/
var JSTOOL = function() {
this.getMonthBefore=function(date){
this.getMonthBefore = function(date) {
var nowdays = new Date(date);
var year = nowdays.getFullYear();
var month = nowdays.getMonth();
if(month==0){
if (month == 0) {
month = 12;
year = year-1;
year = year - 1;
}
if(month<10){
month = '0'+month;
if (month < 10) {
month = '0' + month;
}
var myDate = new Date(year,month,0);
var startDate = year+'-'+month+'-01'; // 上个月第一天
var endDate = year+'-'+month+'-'+myDate.getDate();//上个月最后一天
return startDate+'&&'+endDate;
var myDate = new Date(year, month, 0);
var startDate = year + '-' + month + '-01'; // 上个月第一天
var endDate = year + '-' + month + '-' + myDate.getDate(); //上个月最后一天
return startDate + '&&' + endDate;
}
/**
* 格式化日期
* 将000000格式化为0000-00-00
*/
this.formatDate = function(date) {
if(date){
if (date) {
return date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3");
}else{
} else {
return ""
}
......@@ -945,7 +946,11 @@ var JSTOOL = function() {
for (var m = 0, lenM = tableObj.buttonControlArr.length; m < lenM; m++) {
$div = $("<div></div>");
$div.addClass(tableObj.buttonControlArr[m].classA);
if (commonJson[i][tableObj.onlyId] != null) {
$div.attr("alt", commonJson[i][tableObj.onlyId]);
} else {
$div.attr("alt", commonJson[i].zsxmDm + commonJson[i].bblxDm + commonJson[i].sksssjq + commonJson[i].sksssjz);
}
$div.addClass("btn btn-primary tdDong-btn");
$div.html(tableObj.buttonControlArr[m].html);
$td.addClass("tdDoing-contain");
......@@ -953,24 +958,32 @@ var JSTOOL = function() {
}
} else {
/* @Author GyYu @Date 16:15 2020/11/20 @Description 应对小偷,加几个隐藏的按钮*/
for(var ll =0;ll<3;ll++){
if(ll==1){
for (var ll = 0; ll < 3; ll++) {
if (ll == 1) {
if (tableObj.buttonHtml == "") {
if (json[i].do.indexOf(",") > -1) {
var buttonHtmlArr = json[i].do.split(",");
for (var cxi=0; cxi<buttonHtmlArr.length; cxi++) {
for (var cxi = 0; cxi < buttonHtmlArr.length; cxi++) {
var div = document.createElement("div");
$div = $(div);
if (commonJson[i][tableObj.onlyId] != null) {
$div.attr("alt", commonJson[i][tableObj.onlyId]);
} else {
$div.attr("alt", commonJson[i].zsxmDm + commonJson[i].bblxDm + commonJson[i].sksssjq + commonJson[i].sksssjz);
}
$div.addClass("btn btn-primary tdDong-btn");
$div.html(buttonHtmlArr[cxi]);
$td.addClass("tdDoing-contain");
$td.append(div);
}
}else {
} else {
var div = document.createElement("div");
$div = $(div);
if (commonJson[i][tableObj.onlyId] != null) {
$div.attr("alt", commonJson[i][tableObj.onlyId]);
} else {
$div.attr("alt", commonJson[i].zsxmDm + commonJson[i].bblxDm + commonJson[i].sksssjq + commonJson[i].sksssjz);
}
$div.addClass("btn btn-primary tdDong-btn");
$div.html(json[i].do);
$td.addClass("tdDoing-contain");
......@@ -1013,17 +1026,21 @@ var JSTOOL = function() {
} else {
var div = document.createElement("div");
$div = $(div);
if (commonJson[i][tableObj.onlyId] != null) {
$div.attr("alt", commonJson[i][tableObj.onlyId]);
} else {
$div.attr("alt", commonJson[i].zsxmDm + commonJson[i].bblxDm + commonJson[i].sksssjq + commonJson[i].sksssjz);
}
$div.addClass("btn btn-primary tdDong-btn");
$div.html(tableObj.buttonHtml);
$td.addClass("tdDoing-contain");
$td.append(div);
}
}else{
} else {
var div = document.createElement("div");
$div = $(div);
$div.attr("alt", ll+'anniu');
$div.attr("alt", ll + 'anniu');
$div.addClass("hiddBtn btn btn-primary tdDong-btn ");
$div.html('');
$td.addClass("tdDoing-contain");
......@@ -1085,10 +1102,10 @@ var JSTOOL = function() {
}
if (!json.length) {
if(!tableObj.promptStatement){
if (!tableObj.promptStatement) {
var html = "<div class='notHasList'>暂无数据</div>";
}else{
var html = "<div class='notHasList'>"+tableObj.promptStatement+"</div>";
} else {
var html = "<div class='notHasList'>" + tableObj.promptStatement + "</div>";
}
$(mainId + ' .tbody').append(html);
......@@ -1109,7 +1126,7 @@ var JSTOOL = function() {
}
function reSetScroll() {
if(tableObj.promptStatement||tableObj.jsonReady.length<1){
if (tableObj.promptStatement || tableObj.jsonReady.length < 1) {
tableObj.height = 75;
}
$(mainId + " .table-body-container").css("height", tableObj.height + "px");
......@@ -1141,7 +1158,12 @@ var JSTOOL = function() {
json.length = 0;
for (var i in data) {
var obj = {};
if (data[i][tableObj.onlyId] != null) {
tableMap[data[i][tableObj.onlyId]] = data[i];
} else {
var onlyId = data[i].zsxmDm + data[i].bblxDm + data[i].sksssjq + data[i].sksssjz
tableMap[onlyId] = data[i];
}
for (var r = 0, len = sum.length; r < len; r++) {
if ([sum[r]] == 'do') {
obj[sum[r]] = data[i].buttonHtml; //yyx 操作里面的按钮赋值
......@@ -1188,7 +1210,12 @@ var JSTOOL = function() {
json.length = 0;
for (var i in data) {
var obj = {};
if (data[i][tableObj.onlyId] != null) {
tableMap[data[i][tableObj.onlyId]] = data[i];
} else {
var onlyId = data[i].zsxmDm + data[i].bblxDm + data[i].sksssjq + data[i].sksssjz
tableMap[onlyId] = data[i];
}
for (var r = 0, len = sum.length; r < len; r++) {
obj[sum[r]] = data[i][sum[r]];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment