找回证券业报送的逻辑,仅支持Excel模板报送
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
function initPage() {
|
||||
initTree();
|
||||
$("#notes").append('<div>' + $("#periodicReportQuarter").parent().html().replace(/periodicReportQuarter/g, 'fileDate') + '</div>');
|
||||
$("#notes").append('<div><span>注意:<span id="tip">重大事项,其他事项和季度报告的相关文件不包含在模板文件中,请到相应功能点上传.<br/></span>单个文件不应超过30MB,周期内有效文件总大小,不应超过200MB,若超过限制,请考虑分批报送或精简文件</span></div>');
|
||||
$("#notes").append('<div><span>注意:<span id="tip"></span></span></div>');
|
||||
$("#buttons").prepend('<a id="templateFile" href="">下载模板</a>')
|
||||
//$("#LastMonthCash,#LatestMonthCash,#LatestNetAssets").parent().hide();
|
||||
//$("#sacReport").parent().hide();
|
||||
@@ -75,7 +75,7 @@ function exportDetails(id, fileTag) {
|
||||
window.open("/supervise_report/exportDetailsForZhongJin?encryptId=" + id + "&fileTag=" + fileTag);
|
||||
}
|
||||
else {
|
||||
window.open("/supervise_report/exportDetails?encryptId=" + id + "&fileTag=" + fileTag);
|
||||
window.open("/supervise_report/ExportDetailsV2?encryptId=" + id + "&fileTag=" + fileTag);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -83,14 +83,17 @@ function exportDetails(id, fileTag) {
|
||||
function showDetails(id) {
|
||||
var width = "1260px";
|
||||
var url = "/supervise_report/QueryDetails?encryptId=" + id;
|
||||
var itemIndex = 0;
|
||||
var colModel = [
|
||||
{
|
||||
name: 'FileTag', label: '报告标识', index: 'FileTag', width: 340, align: 'left', sortable: false, formatter: (cellValue, options, rowObject) => {
|
||||
var html = "";
|
||||
if (cellValue.startsWith("{")) {
|
||||
cellValue = cellValue.replace(/\s/g, "");
|
||||
var obj = JSON.parse(cellValue);
|
||||
html = "<i class='fa fa-arrow-right' aria-hidden='true'></i>" + obj.Tag;
|
||||
html = "【{0}】<i class='fa fa-arrow-right' aria-hidden='true'></i>{1}".template((++itemIndex), obj.Tag);
|
||||
} else {
|
||||
itemIndex = 0;
|
||||
html = cellValue;
|
||||
}
|
||||
return html;
|
||||
@@ -208,8 +211,6 @@ function DownLoadDoc(res) {
|
||||
window.open(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SendReportFile(res) {
|
||||
var opt = {
|
||||
url: "/supervise_report/SendReport",
|
||||
@@ -236,7 +237,7 @@ function testSql() {
|
||||
data: { sqlStr: $("#testsql").val() },
|
||||
success: function (res) {
|
||||
if (res.Success) {
|
||||
|
||||
|
||||
main.message(res.Msg);
|
||||
}
|
||||
else {
|
||||
@@ -471,6 +472,7 @@ function initTree() {
|
||||
{
|
||||
id: "confirmation", ckId: "input_confirmation", name: "交易确认书", open: true, children: [
|
||||
{ id: "optionConfirmation", ckId: "input_optionConfirmation", tag: 5, pId: "confirmation", name: "期权交易确认书" },
|
||||
{ id: "optionConfirmationAtt", ckId: "input_optionConfirmationAtt", tag: 19, pId: "confirmation", name: "场外期权交易确认书附件" },
|
||||
{ id: "swapConfirmation", ckId: "input_swapConfirmation", tag: 6, pId: "confirmation", name: "互换交易确认书" },
|
||||
{ id: "confirmationAtt", ckId: "input_confirmationAtt", tag: 17, pId: "confirmation", name: "互换交易确认书附件" },
|
||||
]
|
||||
@@ -482,6 +484,7 @@ function initTree() {
|
||||
{ id: "swapTermination", ckId: "input_swapTermination", tag: 8, pId: "termination", name: "互换交易存续期管理" },
|
||||
]
|
||||
},
|
||||
{ id: "valuationInformation", ckId: "input_valuationInformation", tag: 18, name: "场外期权合约估值信息" },
|
||||
{
|
||||
id: "periodicReport", ckId: "input_periodicReport", name: "定期报告", open: true, children: [
|
||||
{
|
||||
@@ -538,7 +541,7 @@ function initTree() {
|
||||
$(".bottom_open").addClass("bottom_docu").removeClass("bottom_open");
|
||||
$(".root_open").addClass("root_docu").removeClass("root_open");
|
||||
var notes = zTree.getNodes()[0].children
|
||||
var selectNotes = ["主协议", "主协议关联产品列表", "补充协议", "履约保证书", "交易确认书", "交易存续期管理", "权益端支付"];
|
||||
var selectNotes = ["主协议", "主协议关联产品列表", "补充协议", "履约保证书", "交易确认书", "交易存续期管理", "权益端支付", "场外期权合约估值信息"];
|
||||
_.forEach(notes, (v) => {
|
||||
if ($.inArray(v.name, selectNotes) >= 0) {
|
||||
onClick(null, v, null);
|
||||
@@ -562,7 +565,29 @@ function queryReportInfo() {
|
||||
});
|
||||
}
|
||||
|
||||
//生成报告
|
||||
function generateReportFile() {
|
||||
//历史正常逻辑
|
||||
if (isExist(getReportType()) && page.dataSourceMode != 2) {
|
||||
//判断是否手工上传过文件
|
||||
$.get("/supervise_report/IsUploadFile?ReportDate=" + $("#DateValueDate").val()).done(function (res) {
|
||||
if (res && typeof (res) === 'boolean') {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '生成报告',
|
||||
content: $('#reportTpl').html(),
|
||||
area: ["350px", "350px"]
|
||||
});
|
||||
} else {
|
||||
GenerateReport(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GenerateReport(false);
|
||||
}
|
||||
}
|
||||
|
||||
function GenerateReport(isUploaded) {
|
||||
var postData = {
|
||||
ReportDate: $("#DateValueDate").val(),
|
||||
DataDate: $("#DateDataDate").val(),
|
||||
@@ -572,6 +597,7 @@ function generateReportFile() {
|
||||
LatestMonthCash: $("#LatestMonthCash").val(),
|
||||
LatestNetAssets: $("#LatestNetAssets").val(),
|
||||
ReportTypes: getReportType(),
|
||||
DataSource: isUploaded ? 2 : page.dataSourceMode
|
||||
};
|
||||
postData.SACReportDate = $("#sacReport").val();
|
||||
switch ($("input[name='input_periodicReportSAC']:checked").attr('id')) {
|
||||
@@ -666,7 +692,7 @@ function generateReportFile() {
|
||||
title: "请选择报送方式",
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
area: ['300px'],
|
||||
area: ['366px'],
|
||||
content: html,
|
||||
});
|
||||
}
|
||||
@@ -691,14 +717,21 @@ function Upload(fileType, accept, templateFile) {
|
||||
$("#modalFileUpload #uploadType").text(fileType)
|
||||
$("#fileDate").val($("#DateValueDate").val())
|
||||
$("#fileDate").parent().hide();
|
||||
$("#tip").hide();
|
||||
|
||||
if (fileType == "季度报告") {
|
||||
$("#fileDate option:eq(1)").prop('selected', 'selected');
|
||||
$("#fileDate").parent().show();
|
||||
} else if (fileType == "报送模板") {
|
||||
$("#tip").show();
|
||||
var tip = "单个文件不应超过30MB,周期内有效文件总大小,不应超过200MB,若超过限制,请考虑分批报送或精简文件";
|
||||
switch (fileType) {
|
||||
case "报送模板":
|
||||
tip = "重大事项,其他事项和季度报告的相关文件不包含在模板文件中,请到相应功能点上传.<br/>" + tip;
|
||||
break;
|
||||
case "修改编号":
|
||||
tip = "修改编号功能仅适用于双方约定编号或产品名的修改,该功能仅修改镒链系统内数据,修改后须另外以补正的方式将修改后的数据报送给协会;<br/>修改数据可能需要废止相关报告,请遵循协会要求,废止成功后再操作.";
|
||||
break;
|
||||
case "季度报告":
|
||||
$("#fileDate option:eq(1)").prop('selected', 'selected');
|
||||
$("#fileDate").parent().show();
|
||||
break;
|
||||
}
|
||||
$("#tip").html(tip);
|
||||
if (accept) {
|
||||
$("#uploadfile").prop("accept", accept);
|
||||
}
|
||||
@@ -720,11 +753,17 @@ function uploadOuterData() {
|
||||
main.alert("请选择要上传的文件!");
|
||||
return;
|
||||
}
|
||||
var date = '0001-01-01';
|
||||
if ($("#fileDate").val()) {
|
||||
date = $("#fileDate").val();
|
||||
}
|
||||
var url = "";
|
||||
var fileType = $("#modalFileUpload #uploadType").text();
|
||||
if (fileType == "修改编号") {
|
||||
url = "/supervise_report/UploadFile?fileType=" + fileType;
|
||||
} else {
|
||||
var date = '0001-01-01';
|
||||
if ($("#fileDate").val()) {
|
||||
date = $("#fileDate").val();
|
||||
}
|
||||
url = "/supervise_report/UploadSACReportFile?fileType=" + fileType + "&date=" + date;
|
||||
}
|
||||
var fd = new FormData();
|
||||
var useSend = true;
|
||||
_.forEach($("#uploadfile")[0].files, (f, i) => {
|
||||
@@ -740,7 +779,7 @@ function uploadOuterData() {
|
||||
return;
|
||||
}
|
||||
main.ajax({
|
||||
url: "/supervise_report/UploadSACReportFile?fileType=" + fileType + "&date=" + date,
|
||||
url: url,
|
||||
type: "POST",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
@@ -799,4 +838,29 @@ function showHtml(title, url, width) {
|
||||
width = '1250px';
|
||||
}
|
||||
main.open(title, url, { area: [width, '800px'] });
|
||||
}
|
||||
|
||||
function generateReportFromFile() {
|
||||
var val = $('#generateReport option:selected').val();
|
||||
if (val == "0") {
|
||||
GenerateReport(false);
|
||||
} else {
|
||||
GenerateReport(true);
|
||||
}
|
||||
}
|
||||
//用jquery写一个方法,判断传入的数组中是否存在0~8和16~19范围的数字
|
||||
function isExist(arr) {
|
||||
var arr = arr;
|
||||
var arr2 = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
//只有日报和SAC月报才需要展示数据源选项
|
||||
if (arr[i] >= 0 && arr[i] <= 9 || arr[i] >= 16 && arr[i] <= 19) {
|
||||
arr2.push(arr[i]);
|
||||
}
|
||||
}
|
||||
if (arr2.length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user