Commit 5d098453 authored by 于广洋's avatar 于广洋

后台返回错误信息的时候,申报月份依然可以切换

parent 2d99544a
...@@ -141,22 +141,21 @@ ...@@ -141,22 +141,21 @@
} }
var companyInfo = data; var companyInfo = data;
companyInfo.config = config
if (companyInfo.success) { if (companyInfo.success) {
companyInfo.bean.config = config companyInfo.bean.config = config
companyInfo.bean.return = true;/* @Author ygy @Date 10:12 2020/7/8 @Description 前端判断接口成功返回数据标记用于区分是否执行初始化table方法*/
config.return = true;
initpage = initPage(companyInfo.bean); initpage = initPage(companyInfo.bean);
/*$("#getInputValue").on("focus", function() {
WdatePicker({
isShowClear:false,
dateFmt: 'yyyy-MM',
onpicking: function(dp){
initpage.changeDate(this, dp);
}
});
});*/
} else { } else {
initpage = initPage(""); hideLoading();
alertWarning(companyInfo.returnMessage); if(!companyInfo.bean){
companyInfo.bean={};
companyInfo.bean.djxh = getUrlParam("djxh");
companyInfo.bean.return = false;
}
alertWarning(companyInfo.errmsg);
companyInfo.bean.config = config
initpage = initPage(companyInfo.bean);
// 弹出错误对话框 // 弹出错误对话框
} }
$("#getInputValue").on("focus", function() { $("#getInputValue").on("focus", function() {
......
...@@ -139,11 +139,19 @@ ...@@ -139,11 +139,19 @@
$("#djxh").attr("value", companyInfo.djxh); $("#djxh").attr("value", companyInfo.djxh);
if (companyInfo.success) { if (companyInfo.success) {
companyInfo.bean.config = config companyInfo.bean.config = config
companyInfo.bean.return = true;
initpage = initPage(companyInfo.bean); initpage = initPage(companyInfo.bean);
} else { } else {
hideLoading(); hideLoading();
initpage = initPage(""); if(!companyInfo.bean){
companyInfo.bean={};
companyInfo.bean.djxh = getUrlParam("djxh");
companyInfo.bean.return = false;
}
alertWarning(companyInfo.errmsg);
companyInfo.bean.config = config
initpage = initPage(companyInfo.bean);
alertWarning(companyInfo.returnMessage); alertWarning(companyInfo.returnMessage);
// 弹出错误对话框 // 弹出错误对话框
} }
......
/** /**
* 按期申报填报列表页控制脚本 * 按期申报填报列表页控制脚本
* *
* @author 于广洋 * @author 于广洋
* @modify 王雷 * @modify 王雷
*/ */
// ------------------------------- // -------------------------------
/** /**
* 绘制税种填报页面 * 绘制税种填报页面
* *
* @param {*} companyInfo * @param {*} companyInfo
*/ */
function initPage(companyInfo) { function initPage(companyInfo) {
getIEVersion(); getIEVersion();
...@@ -59,11 +59,11 @@ function initPage(companyInfo) { ...@@ -59,11 +59,11 @@ function initPage(companyInfo) {
}; };
/** /**
* 税务申报table渲染 * 税务申报table渲染
* @param {*} id * @param {*} id
* @param {*} order * @param {*} order
* @param {*} headerList * @param {*} headerList
* @param {*} ddt * @param {*} ddt
* @param {*} buttonHtml * @param {*} buttonHtml
*/ */
var getTableDeclaration = function(id, order, headerList, ddt, buttonHtml,promptStatement) { var getTableDeclaration = function(id, order, headerList, ddt, buttonHtml,promptStatement) {
var tableObj = { var tableObj = {
...@@ -132,7 +132,7 @@ function initPage(companyInfo) { ...@@ -132,7 +132,7 @@ function initPage(companyInfo) {
declarationMethod("N") declarationMethod("N")
} }
} }
} //点击按钮后的回调函数 } //点击按钮后的回调函数
}; };
var object = tool.tableCreate(tableObj); var object = tool.tableCreate(tableObj);
// object.jsonReadyTo(ddt, { page: "1", pageSize: ddt.length }); // object.jsonReadyTo(ddt, { page: "1", pageSize: ddt.length });
...@@ -142,9 +142,9 @@ function initPage(companyInfo) { ...@@ -142,9 +142,9 @@ function initPage(companyInfo) {
* 税务申报 初始化数据获取 * 税务申报 初始化数据获取
* @param {*} mydate * @param {*} mydate
*/ */
//地址 //地址
//http://sbjs.tjsat.gov.cn:18090 //http://sbjs.tjsat.gov.cn:18090
//http://localhost:7070 //http://localhost:7070
var url; var url;
if(companyInfo){ if(companyInfo){
url = companyInfo.config.url; url = companyInfo.config.url;
...@@ -160,7 +160,6 @@ function initPage(companyInfo) { ...@@ -160,7 +160,6 @@ function initPage(companyInfo) {
pzzlDm:companyInfo.pzzlDm pzzlDm:companyInfo.pzzlDm
} }
$.ajax({ $.ajax({
// url: url + "/ssfwpt/declare/getPzzlList",
url: url + "/ssfwpt/declare/getPzzlList", url: url + "/ssfwpt/declare/getPzzlList",
data: param, data: param,
type: "POST", type: "POST",
...@@ -171,12 +170,11 @@ function initPage(companyInfo) { ...@@ -171,12 +170,11 @@ function initPage(companyInfo) {
if (data.bean.url == "error.jsp") { if (data.bean.url == "error.jsp") {
myAlert("提示", data.bean.errorInfo, "确定") myAlert("提示", data.bean.errorInfo, "确定")
return return
// window.location.href = "/jsp/error/index.html?falg="+param;
} }
drawGrid(data.bean); drawGrid(data.bean);
companyInfo = data.bean; companyInfo = data.bean;
} else { } else {
alertWarning(data.returnMessage); alertWarning(data.errmsg);
} }
}).always(function(data) { }).always(function(data) {
hideLoading(); hideLoading();
...@@ -194,9 +192,9 @@ function initPage(companyInfo) { ...@@ -194,9 +192,9 @@ function initPage(companyInfo) {
var drawGrid = function (bean) { var drawGrid = function (bean) {
//两个表合成一个表 //两个表合成一个表
  $.each(bean.financialInfos,function(i,item){ $.each(bean.financialInfos,function(i,item){
    bean.taxInfos.push(item); bean.taxInfos.push(item);
  }); });
console.log(bean) console.log(bean)
if(bean.taxInfos.length==0){ if(bean.taxInfos.length==0){
showTax(bean.taxInfos); showTax(bean.taxInfos);
...@@ -266,7 +264,7 @@ function initPage(companyInfo) { ...@@ -266,7 +264,7 @@ function initPage(companyInfo) {
}else if (data.url == "yearReportGLB.jsp") { }else if (data.url == "yearReportGLB.jsp") {
window.open(config.webUrl+"declare/yearReportGLB.html?falg="+falg+'&params=' + encodeURI(JSON.stringify(submitData))); window.open(config.webUrl+"declare/yearReportGLB.html?falg="+falg+'&params=' + encodeURI(JSON.stringify(submitData)));
}else { }else {
//因为后台不知道返回路径是什么样的就直接改成了else data.url == "error.jsp" //因为后台不知道返回路径是什么样的就直接改成了else data.url == "error.jsp"
window.open(config.webUrl+"error/index.html?falg="+falg+'&params=' + encodeURI(JSON.stringify(submitData))); window.open(config.webUrl+"error/index.html?falg="+falg+'&params=' + encodeURI(JSON.stringify(submitData)));
} }
}, },
...@@ -283,7 +281,7 @@ function initPage(companyInfo) { ...@@ -283,7 +281,7 @@ function initPage(companyInfo) {
} }
/** /**
* 重置调用方法 * 重置调用方法
* @param {} params * @param {} params
*/ */
$("#reset,#reset1").on("click", refresh); $("#reset,#reset1").on("click", refresh);
$("#goRecord").click(function() { $("#goRecord").click(function() {
......
...@@ -319,7 +319,7 @@ function initPage(companyInfo) { ...@@ -319,7 +319,7 @@ function initPage(companyInfo) {
//TODO 调用备案接口 //TODO 调用备案接口
}); });
// 格式化后台返回的时间 // 格式化后台返回的时间
if(companyInfo) { if(companyInfo.config.return) {
$("#getInputValue").val(tool.formatDate(companyInfo.sbsq)); $("#getInputValue").val(tool.formatDate(companyInfo.sbsq));
nowDate = tool.formatDate(companyInfo.sbsq); nowDate = tool.formatDate(companyInfo.sbsq);
drawGrid(companyInfo); drawGrid(companyInfo);
......
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