866 lines
33 KiB
JavaScript
866 lines
33 KiB
JavaScript
function initPage() {
|
|
initTree();
|
|
$("#notes").append('<div>' + $("#periodicReportQuarter").parent().html().replace(/periodicReportQuarter/g, 'fileDate') + '</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();
|
|
//$("#nafmiiReport").parent().hide();
|
|
//$("#isdaReport").parent().hide();
|
|
//$("#eventReport_A").parent().hide();
|
|
//$("#otherReport_A").parent().hide();
|
|
//$("#eventReport").parent().hide();
|
|
//$("#eventReportDesc").parent().hide();
|
|
//$("#otherReport").parent().hide();
|
|
//$("#otherReportDesc").parent().hide();
|
|
//$("#periodicReportQuarter_A").parent().hide();
|
|
//$("#periodicReportQuarter").parent().hide();
|
|
$(".datepicker").datepicker({
|
|
changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true,
|
|
});
|
|
$("#DateValueDate").datepicker({
|
|
onSelect: function (se) {
|
|
queryReportInfo();
|
|
}
|
|
});
|
|
$("#DateValueDate,#DateDataDate").val(page.sysdate);
|
|
$("#DateValueDate").change(queryReportInfo);
|
|
try {
|
|
SetAceDropDown();
|
|
} catch (e) {
|
|
}
|
|
queryReportInfo();
|
|
|
|
$("#LastMonthCash,#LatestMonthCash,#LatestNetAssets").on("change", (ev) => {
|
|
$(ev.target).val(main.toNumber($(ev.target).val()))
|
|
});
|
|
|
|
$("#OptionKey,#SwapKey").on("change", (ev) => {
|
|
var key = $(ev.target).attr("key");
|
|
var name = "", value = "";
|
|
switch (key) {
|
|
case "ReportDescOption":
|
|
name = $("#OptionKey").val();
|
|
$("#OptionValue").val(page.report[key] ? page.report[key][name] : "");
|
|
break;
|
|
case "ReportDescSwap":
|
|
name = $("#SwapKey").val();
|
|
$("#SwapValue").val(page.report[key] ? page.report[key][name] : "");
|
|
break;
|
|
}
|
|
});
|
|
|
|
$("#OptionValue,#SwapValue").change((ev) => {
|
|
var key = $(ev.target).attr("key");
|
|
var name = "", value = "";
|
|
switch (key) {
|
|
case "ReportDescOption":
|
|
name = $("#OptionKey").val();
|
|
value = $("#OptionValue").val();
|
|
break;
|
|
case "ReportDescSwap":
|
|
name = $("#SwapKey").val();
|
|
value = $("#SwapValue").val();
|
|
break;
|
|
}
|
|
if (!page.report[key]) {
|
|
page.report[key] = {};
|
|
}
|
|
page.report[key][name] = value;
|
|
});
|
|
}
|
|
|
|
function exportDetails(id, fileTag) {
|
|
if (page.isZhongjin) {
|
|
window.open("/supervise_report/exportDetailsForZhongJin?encryptId=" + id + "&fileTag=" + fileTag);
|
|
}
|
|
else {
|
|
window.open("/supervise_report/ExportDetailsV2?encryptId=" + id + "&fileTag=" + 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 = "【{0}】<i class='fa fa-arrow-right' aria-hidden='true'></i>{1}".template((++itemIndex), obj.Tag);
|
|
} else {
|
|
itemIndex = 0;
|
|
html = cellValue;
|
|
}
|
|
return html;
|
|
}
|
|
}, {
|
|
name: 'FileType', label: '报告类型', index: 'FileType', width: 120, align: 'center', sortable: false, formatter: (cellValue, options, rowObject) => {
|
|
return cellValue;
|
|
}
|
|
}, {
|
|
name: 'RetCode', label: '响应码', index: 'RetCode', width: 60, align: 'center', sortable: false, formatter: (cellValue, options, rowObject) => {
|
|
return cellValue;
|
|
}
|
|
}, {
|
|
name: 'RetMsg', label: '响应描述', index: 'RetMsg', width: 230, align: 'lift', sortable: false
|
|
}, {
|
|
name: 'ExceId', label: '报送文件预览/业务流水号', index: 'ExceId', width: 230, align: 'center', sortable: false, formatter: (cellValue, options, rowObject) => {
|
|
var html = cellValue;
|
|
if (cellValue == "-") {
|
|
html = ("<a href='javascript:;' title='预览报送文件' class='ratioSetting' onclick=\"showHtml('报送文件','/supervise_report/supervisePreview?fileType={1}&fileTag={0}');\">"
|
|
+ "<i class='fa fa-search' aria-hidden='true'></i></a>").template(rowObject.FileTag, "send");
|
|
}
|
|
return html;
|
|
}
|
|
}, {
|
|
name: 'BizID', label: '响应文件预览/报送业务编号', index: 'BizID', width: 230, align: 'center', sortable: false, formatter: (cellValue, options, rowObject) => {
|
|
var html = cellValue;
|
|
if (cellValue == "-") {
|
|
var onclick = "readonly";
|
|
if (rowObject.RetCode) {
|
|
onclick = "onclick=\"showHtml('响应文件','/supervise_report/supervisePreview?fileType={1}&fileTag={0}');\"".template(rowObject.FileTag, "recv");
|
|
}
|
|
html = "<a href='javascript:;' title='预览响应文件' class='ratioSetting' {0}><i class='fa fa-search' aria-hidden='true'></i></a>".template(onclick);
|
|
}
|
|
return html;
|
|
}
|
|
}];
|
|
var index = layer.open({
|
|
type: 1,
|
|
title: "报送详情",
|
|
closeBtn: false,
|
|
shade: 0.4,
|
|
area: [width, '680px'],
|
|
content: "<table id='detailsGrid' class='scroll' cellpadding='0' cellspacing='0' ></table>",
|
|
btn: ['关闭'],
|
|
yes: function () {
|
|
layer.close(index);
|
|
}
|
|
});
|
|
var obj = {
|
|
url: url,
|
|
datatype: 'json',
|
|
multiselect: false,
|
|
height: '550',
|
|
width: '96%',
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
caption: '',
|
|
mtype: 'GET',
|
|
colModel: colModel
|
|
};
|
|
jQuery('#detailsGrid').jqGrid(obj);
|
|
}
|
|
|
|
function jqGridInit(dataType) {
|
|
var width = "500px";
|
|
var url = "";
|
|
var colModel = [];
|
|
switch (dataType) {
|
|
case "查看附件":
|
|
width = "880px";
|
|
url = "/supervise_report/QueryEventReportFile";
|
|
colModel = page.uploadColumns;
|
|
break;
|
|
case "查看报告":
|
|
case "查看/发送报告":
|
|
width = "1280px";
|
|
url = "/supervise_report/QuyerSACReportHistory";
|
|
colModel = page.reportList;
|
|
break;
|
|
default:
|
|
}
|
|
layer.open({
|
|
type: 1,
|
|
title: dataType,
|
|
shadeClose: false,
|
|
shade: 0.4,
|
|
area: [width, '620px'],
|
|
content: "<table id='listGrid' class='scroll' cellpadding='0' cellspacing='0' ></table><div id='pagerGrid' ></div>",
|
|
});
|
|
var obj = {
|
|
url: url,
|
|
datatype: 'json',
|
|
multiselect: false,
|
|
height: 'auto',
|
|
width: '96%',
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
caption: '',
|
|
mtype: 'GET',
|
|
colModel: colModel,
|
|
pager: jQuery('#pagerGrid'),
|
|
pagerpos: 'left',
|
|
rowNum: 20,
|
|
rowList: [20, 30, 50, 200, 10000],
|
|
footerrow: false,
|
|
};
|
|
page.g_grid = jQuery('#listGrid').jqGrid(obj);
|
|
}
|
|
|
|
function DownLoadDoc(res) {
|
|
window.open(res);
|
|
}
|
|
|
|
function SendReportFile(res) {
|
|
var opt = {
|
|
url: "/supervise_report/SendReport",
|
|
data: { fileId: res },
|
|
success: function (res) {
|
|
if (res.Success) {
|
|
layer.closeAll();
|
|
main.message(res.Msg);
|
|
}
|
|
else {
|
|
main.alert(res.Msg);
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("error:" + res.msg);
|
|
}
|
|
};
|
|
main.ajax(opt);
|
|
}
|
|
|
|
function testSql() {
|
|
var opt = {
|
|
url: "/supervise_report/TestSql",
|
|
data: { sqlStr: $("#testsql").val() },
|
|
success: function (res) {
|
|
if (res.Success) {
|
|
|
|
main.message(res.Msg);
|
|
}
|
|
else {
|
|
main.alert(res.Msg);
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("error:" + res.msg);
|
|
}
|
|
};
|
|
main.ajax(opt);
|
|
}
|
|
|
|
function DeleteReportFile(res) {
|
|
var opt = {
|
|
url: "/supervise_report/DeleteReport",
|
|
data: { fileTag: res },
|
|
success: function (res) {
|
|
if (res) {
|
|
page.g_grid.trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert("删除失败");
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("error:" + res.msg);
|
|
}
|
|
};
|
|
main.ajax(opt);
|
|
}
|
|
|
|
function DelEventFile(encryptId) {
|
|
var opt = {
|
|
url: "/supervise_report/DelEventReportFile",
|
|
data: { encryptId: encryptId },
|
|
success: function (res) {
|
|
if (res.success) {
|
|
page.g_grid.trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert(res.msg);
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("error:" + res.msg);
|
|
}
|
|
};
|
|
main.ajax(opt);
|
|
}
|
|
|
|
function addDiyDom(treeId, treeNode) {
|
|
//if (treeNode.level == 0) { return; }
|
|
var radioArr = ["报送", "补正", "废止"];
|
|
var aObj = $("#" + treeNode.tId + page.IDMark_A);
|
|
var tagHtml = (treeNode.tag) ? "tag='" + treeNode.tag + "'" : "";
|
|
var parentId = treeNode.level > 0 ? treeNode.getParentNode().ckId : "";
|
|
if ($.inArray(treeNode.name, radioArr) >= 0) {
|
|
var editStr = "<input type='radio' class='radioBtn' id='" + treeNode.ckId + "' name='" + parentId + "' " + tagHtml + " onfocus='this.blur();'></input>";
|
|
aObj.before(editStr);
|
|
var btn = $("#" + treeNode.ckId);
|
|
if (btn) btn.bind("click", function () { checkParentNode(treeNode, btn.prop("checked")); });
|
|
} else {
|
|
var editStr = "<input type='checkbox' class='checkboxBtn' id='" + treeNode.ckId + "' name='" + parentId + "' " + tagHtml + " onfocus='this.blur();'></input>";
|
|
aObj.before(editStr);
|
|
var btn = $("#" + treeNode.ckId);
|
|
if (btn) btn.bind("change", function () { checkAccessories(treeNode, btn.prop("checked")); });
|
|
}
|
|
}
|
|
|
|
function getReportDesc() {
|
|
main.post("/supervise_report/QueryReportDesc", null, { async: false }).done(function (res) {
|
|
if (!res.Success) {
|
|
main.alert(res.Msg);
|
|
}
|
|
else {
|
|
page.report = res.Content;
|
|
}
|
|
});
|
|
}
|
|
|
|
function saveReportDesc() {
|
|
var postData = { obj: page.report };
|
|
main.post("/supervise_report/SaveReportDesc", postData).done(function (res) {
|
|
main.alert(res.Msg);
|
|
});
|
|
}
|
|
|
|
function checkAccessories(treeNode, checkedStatus) {
|
|
if (treeNode.children) {
|
|
var checkedRadio = getCheckedRadio("" + treeNode.ckId);
|
|
if (checkedStatus) {
|
|
if (checkedRadio !== false) {
|
|
$("#" + treeNode.children[0].ckId + "[type='radio'],[name='" + treeNode.ckId + "'][type='checkbox']").prop("checked", true);
|
|
}
|
|
} else {
|
|
$("[name='" + treeNode.ckId + "']").prop("checked", false);
|
|
}
|
|
$("[name='" + treeNode.ckId + "']").change()
|
|
}
|
|
checkParentNode(treeNode, checkedStatus);
|
|
}
|
|
|
|
function getReportType() {
|
|
var reportTypes = [];
|
|
_.forEach($("#reportTree input[tag]:checked"), (n) => {
|
|
reportTypes.push($(n).attr("tag"));
|
|
})
|
|
return reportTypes;
|
|
}
|
|
|
|
function checkParentNode(treeNode, checkedStatus) {
|
|
var obj = treeNode.getParentNode();
|
|
if (!obj) { return; }
|
|
var pObj = $("#" + treeNode.getParentNode().ckId);
|
|
if (checkedStatus) {
|
|
if (pObj.prop("checked") === false) {
|
|
pObj.prop("checked", true);
|
|
}
|
|
} else {
|
|
if (pObj.prop("checked") === true && !$("[name='" + treeNode.getParentNode().ckId + "']:checked")[0]) {
|
|
pObj.prop("checked", false);
|
|
}
|
|
}
|
|
changeInputStatus();
|
|
checkParentNode(obj, checkedStatus);
|
|
}
|
|
|
|
function changeInputStatus() {
|
|
if ($("#input_periodicReportSAC:checked")[0]) {
|
|
$("#LastMonthCash,#LatestMonthCash,#LatestNetAssets").parent().show();
|
|
$("#sacReport").parent().show();
|
|
} else {
|
|
$("#LastMonthCash,#LatestMonthCash,#LatestNetAssets").parent().hide();
|
|
$("#sacReport").parent().hide();
|
|
}
|
|
if ($("#input_periodicReportNAFMII:checked")[0]) {
|
|
$("#nafmiiReport").parent().show();
|
|
} else {
|
|
$("#nafmiiReport").parent().hide();
|
|
}
|
|
if ($("#input_periodicReportISDA:checked")[0]) {
|
|
$("#isdaReport").parent().show();
|
|
} else {
|
|
$("#isdaReport").parent().hide();
|
|
}
|
|
//if ($("#input_eventReport_U:checked,#input_eventReport_D:checked")[0]) {
|
|
// $("#eventReport").parent().show();
|
|
//} else {
|
|
// $("#eventReport").parent().hide();
|
|
//}
|
|
//if ($("#input_otherReport_U:checked,#input_otherReport_D:checked")[0]) {
|
|
// $("#otherReport").parent().show();
|
|
//} else {
|
|
// $("#otherReport").parent().hide();
|
|
//}
|
|
if ($("#input_eventReport:checked")[0]) {
|
|
$("#eventReport_A").parent().show();
|
|
$("#eventReportDesc").parent().show();
|
|
} else {
|
|
$("#eventReport_A").parent().hide();
|
|
$("#eventReportDesc").parent().hide();
|
|
}
|
|
if ($("#input_otherReport:checked")[0]) {
|
|
$("#otherReport_A").parent().show();
|
|
$("#otherReportDesc").parent().show();
|
|
} else {
|
|
$("#otherReport_A").parent().hide();
|
|
$("#otherReportDesc").parent().hide();
|
|
}
|
|
if ($("#input_periodicReportQuarter:checked")[0]) {
|
|
$("#periodicReportQuarter_A").parent().show();
|
|
$("#periodicReportQuarter").parent().show();
|
|
} else {
|
|
$("#periodicReportQuarter_A").parent().hide();
|
|
$("#periodicReportQuarter").parent().hide();
|
|
}
|
|
//if ($("#input_periodicReportQuarter_U:checked,#input_periodicReportQuarter_D:checked")[0]) {
|
|
// $("#periodicReportQuarter").parent().show();
|
|
//} else {
|
|
// $("#periodicReportQuarter").parent().hide();
|
|
//}
|
|
}
|
|
|
|
function getCheckedRadio(radioName) {
|
|
var r = document.getElementsByName(radioName);
|
|
for (var i = 0; i < r.length; i++) {
|
|
if (r[i].checked) {
|
|
return $(r[i]);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function onClick(treeId, treeNode, clickFlag) {
|
|
var obj = $("#" + treeNode.ckId);
|
|
obj.prop("checked", !obj.prop("checked"));
|
|
if (obj.prop("type") === "checkbox") {
|
|
obj.change();
|
|
} else {
|
|
obj.click();
|
|
}
|
|
return false;
|
|
}
|
|
function zTreeBeforeCollapse(treeId, treeNode) {
|
|
return false;
|
|
}
|
|
|
|
function initTree() {
|
|
var setting = {
|
|
view: {
|
|
showIcon: false,
|
|
addDiyDom: addDiyDom,
|
|
},
|
|
callback: {
|
|
beforeClick: onClick,
|
|
beforeCollapse: zTreeBeforeCollapse
|
|
},
|
|
data: {
|
|
simpleData: {
|
|
enable: true
|
|
}
|
|
}
|
|
|
|
};
|
|
var nodes =
|
|
[{
|
|
id: "reportInfo", ckId: "input_reportInfo", name: "报送信息", open: true, nocheck: true, children: [
|
|
{ id: "masterAgrmt", ckId: "input_masterAgrmt", tag: 1, name: "主协议" },
|
|
{ id: "masterAgrmtProduct", ckId: "input_masterAgrmtProduct", tag: 2, name: "主协议关联产品列表" },
|
|
{ id: "supAgrmt", ckId: "input_supAgrmt", tag: 3, name: "补充协议" },
|
|
{ id: "performanceGuaranteeAgrmt", ckId: "input_performanceGuaranteeAgrmt", tag: 4, name: "履约保证书" },
|
|
{
|
|
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: "互换交易确认书附件" },
|
|
]
|
|
},
|
|
{ id: "swapEquityPayment", ckId: "input_swapEquityPayment", tag: 16, name: "权益端支付" },
|
|
{
|
|
id: "termination", ckId: "input_termination", name: "交易存续期管理", open: true, children: [
|
|
{ id: "optionTermination", ckId: "input_optionTermination", tag: 7, pId: "termination", name: "期权交易存续期管理" },
|
|
{ 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: [
|
|
{
|
|
id: "periodicReportSAC", ckId: "input_periodicReportSAC", pId: "periodicReport", name: "SAC模板", children: [
|
|
{ id: "periodicReportSAC_A", ckId: "input_periodicReportSAC_A", tag: 9, pId: "periodicReportSAC", name: "报送" },
|
|
{ id: "periodicReportSAC_U", ckId: "input_periodicReportSAC_U", tag: 9, pId: "periodicReportSAC", name: "补正" },
|
|
{ id: "periodicReportSAC_D", ckId: "input_periodicReportSAC_D", tag: 9, pId: "periodicReportSAC", name: "废止" },
|
|
]
|
|
},
|
|
{
|
|
id: "periodicReportNAFMII", ckId: "input_periodicReportNAFMII", pId: "periodicReport", name: "NAFMII模板", children: [
|
|
{ id: "periodicReportNAFMII_A", ckId: "input_periodicReportNAFMII_A", tag: 10, pId: "periodicReportNAFMII", name: "报送" },
|
|
{ id: "periodicReportNAFMII_U", ckId: "input_periodicReportNAFMII_U", tag: 10, pId: "periodicReportNAFMII", name: "补正" },
|
|
{ id: "periodicReportNAFMII_D", ckId: "input_periodicReportNAFMII_D", tag: 10, pId: "periodicReportNAFMII", name: "废止" },
|
|
]
|
|
},
|
|
{
|
|
id: "periodicReportISDA", ckId: "input_periodicReportISDA", pId: "periodicReport", name: "ISDA模板", children: [
|
|
{ id: "periodicReportISDA_A", ckId: "input_periodicReportISDA_A", tag: 11, pId: "periodicReportISDA", name: "报送" },
|
|
{ id: "periodicReportISDA_U", ckId: "input_periodicReportISDA_U", tag: 11, pId: "periodicReportISDA", name: "补正" },
|
|
{ id: "periodicReportISDA_D", ckId: "input_periodicReportISDA_D", tag: 11, pId: "periodicReportISDA", name: "废止" },
|
|
]
|
|
},
|
|
]
|
|
},
|
|
{
|
|
id: "eventReport", ckId: "input_eventReport", name: "重大事项报告", open: true, children: [
|
|
{ id: "eventReport_A", ckId: "input_eventReport_A", tag: 12, pId: "eventReport", name: "报送" },
|
|
{ id: "eventReport_U", ckId: "input_eventReport_U", tag: 12, pId: "eventReport", name: "补正" },
|
|
{ id: "eventReport_D", ckId: "input_eventReport_D", tag: 12, pId: "eventReport", name: "废止" },
|
|
]
|
|
},
|
|
{
|
|
id: "otherReport", ckId: "input_otherReport", name: "其他事项报告", open: true, children: [
|
|
{ id: "otherReport_A", ckId: "input_otherReport_A", tag: 13, pId: "otherReport", name: "报送" },
|
|
{ id: "otherReport_U", ckId: "input_otherReport_U", tag: 13, pId: "otherReport", name: "补正" },
|
|
{ id: "otherReport_D", ckId: "input_otherReport_D", tag: 13, pId: "otherReport", name: "废止" },
|
|
]
|
|
},
|
|
{
|
|
id: "periodicReportQuarter", ckId: "input_periodicReportQuarter", name: "季度报告", open: true, children: [
|
|
{ id: "periodicReportQuarter_A", ckId: "input_periodicReportQuarter_A", tag: 14, pId: "periodicReportQuarter", name: "报送" },
|
|
{ id: "periodicReportQuarter_U", ckId: "input_periodicReportQuarter_U", tag: 14, pId: "periodicReportQuarter", name: "补正" },
|
|
{ id: "periodicReportQuarter_D", ckId: "input_periodicReportQuarter_D", tag: 14, pId: "periodicReportQuarter", name: "废止" },
|
|
]
|
|
},
|
|
{ id: "contractNumberProcess", ckId: "input_contractNumberProcess", tag: 15, name: "双方约定编号数据处理" },
|
|
]
|
|
}];
|
|
$.fn.zTree.init($("#reportTree"), setting, nodes);
|
|
var zTree = $.fn.zTree.getZTreeObj("reportTree");
|
|
zTree.expandAll(true);
|
|
$(".center_open").addClass("center_docu").removeClass("center_open");
|
|
$(".bottom_open").addClass("bottom_docu").removeClass("bottom_open");
|
|
$(".root_open").addClass("root_docu").removeClass("root_open");
|
|
var notes = zTree.getNodes()[0].children
|
|
var selectNotes = ["主协议", "主协议关联产品列表", "补充协议", "履约保证书", "交易确认书", "交易存续期管理", "权益端支付", "场外期权合约估值信息"];
|
|
_.forEach(notes, (v) => {
|
|
if ($.inArray(v.name, selectNotes) >= 0) {
|
|
onClick(null, v, null);
|
|
}
|
|
})
|
|
}
|
|
|
|
function queryReportInfo() {
|
|
var postData = { date: $("#DateValueDate").val() };
|
|
main.post("/supervise_report/QuerySACReportInfo", postData).done(function (res) {
|
|
if (!res.Success) {
|
|
main.alert(res.Msg);
|
|
}
|
|
else {
|
|
$("#SenderCode").val(res.Content.SenderCode);
|
|
$("#ReceiverCode").val(res.Content.ReceiverCode);
|
|
$("#LastMonthCash").val(res.Content.LastMonthCash);
|
|
$("#LatestMonthCash").val(res.Content.LatestMonthCash);
|
|
$("#LatestNetAssets").val(res.Content.LatestNetAssets);
|
|
}
|
|
});
|
|
}
|
|
|
|
//生成报告
|
|
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(),
|
|
SenderCode: $("#SenderCode").val(),
|
|
ReceiverCode: $("#ReceiverCode").val(),
|
|
LastMonthCash: $("#LastMonthCash").val(),
|
|
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')) {
|
|
case "input_periodicReportSAC_A":
|
|
postData.SACReportStatus = 1;
|
|
break;
|
|
case "input_periodicReportSAC_U":
|
|
postData.SACReportStatus = 2;
|
|
break;
|
|
case "input_periodicReportSAC_D":
|
|
postData.SACReportStatus = 3;
|
|
break;
|
|
}
|
|
postData.NAFMIIReportDate = $("#nafmiiReport").val();
|
|
switch ($("input[name='input_periodicReportNAFMII']:checked").attr('id')) {
|
|
case "input_periodicReportNAFMII_A":
|
|
postData.NAFMIIReportStatus = 1;
|
|
break;
|
|
case "input_periodicReportNAFMII_U":
|
|
postData.NAFMIIReportStatus = 2;
|
|
break;
|
|
case "input_periodicReportNAFMII_D":
|
|
postData.NAFMIIReportStatus = 3;
|
|
break;
|
|
}
|
|
postData.ISDAReportDate = $("#isdaReport").val();
|
|
switch ($("input[name='input_periodicReportISDA']:checked").attr('id')) {
|
|
case "input_periodicReportISDA_A":
|
|
postData.ISDAReportStatus = 1;
|
|
break;
|
|
case "input_periodicReportISDA_U":
|
|
postData.ISDAReportStatus = 2;
|
|
break;
|
|
case "input_periodicReportISDA_D":
|
|
postData.ISDAReportStatus = 3;
|
|
break;
|
|
}
|
|
postData.EventReportDesc = $("#eventReportDesc").val();
|
|
switch ($("input[name='input_eventReport']:checked").attr('id')) {
|
|
case "input_eventReport_A":
|
|
postData.EventReportStatus = 1;
|
|
break;
|
|
case "input_eventReport_U":
|
|
//postData.EventReportDate = $("#eventReport").val();
|
|
postData.EventReportStatus = 2;
|
|
break;
|
|
case "input_eventReport_D":
|
|
//postData.EventReportDate = $("#eventReport").val();
|
|
postData.EventReportStatus = 3;
|
|
break;
|
|
}
|
|
postData.OtherReportDesc = $("#otherReportDesc").val();
|
|
switch ($("input[name='input_otherReport']:checked").attr('id')) {
|
|
case "input_otherReport_A":
|
|
postData.OtherReportStatus = 1;
|
|
break;
|
|
case "input_otherReport_U":
|
|
//postData.OtherReportDate = $("#otherReport").val();
|
|
postData.OtherReportStatus = 2;
|
|
break;
|
|
case "input_otherReport_D":
|
|
//postData.OtherReportDate = $("#otherReport").val();
|
|
postData.OtherReportStatus = 3;
|
|
break;
|
|
}
|
|
postData.PeriodicReportQuarterDate = $("#periodicReportQuarter").val();
|
|
switch ($("input[name='input_periodicReportQuarter']:checked").attr('id')) {
|
|
case "input_periodicReportQuarter_A":
|
|
postData.PeriodicReportQuarterStatus = 1;
|
|
break;
|
|
case "input_periodicReportQuarter_U":
|
|
//postData.PeriodicReportQuarterDate = $("#periodicReportQuarter").val();
|
|
postData.PeriodicReportQuarterStatus = 2;
|
|
break;
|
|
case "input_periodicReportQuarter_D":
|
|
//postData.PeriodicReportQuarterDate = $("#periodicReportQuarter").val();
|
|
postData.PeriodicReportQuarterStatus = 3;
|
|
break;
|
|
}
|
|
var opt = {
|
|
url: "/supervise_report/superviseSACReportQuery",
|
|
data: postData,
|
|
success: function (res) {
|
|
if (res.Success) {
|
|
var html = "<div style='margin: 15px;'>成功生成" + res.Content.length + "个文件,标签:</br>";
|
|
_.forEach(res.Content, (t) => {
|
|
html += t + "</br>";
|
|
})
|
|
html += "</div><div class='right'><button class='btn btn-primary ' type='button' onclick=layer.closeAll();jqGridInit('查看/发送报告');>查看</button></div>";
|
|
layer.open({
|
|
type: 1,
|
|
title: "请选择报送方式",
|
|
shadeClose: false,
|
|
shade: 0.4,
|
|
area: ['366px'],
|
|
content: html,
|
|
});
|
|
}
|
|
else {
|
|
if (res.Content) {
|
|
showHtml(res.Msg, "/supervise_report/superviseErrorInfo?key=" + res.Content, '1500px');
|
|
} else {
|
|
main.alert(res.Msg);
|
|
}
|
|
}
|
|
},
|
|
error: function (res) {
|
|
main.alert("error:" + res.Msg);
|
|
}
|
|
};
|
|
main.ajax(opt);
|
|
}
|
|
|
|
function Upload(fileType, accept, templateFile) {
|
|
$("#modalFileUpload").modal('show');
|
|
$("#modalFileUpload .modal-title").text("上传" + fileType + "文件")
|
|
$("#modalFileUpload #uploadType").text(fileType)
|
|
$("#fileDate").val($("#DateValueDate").val())
|
|
$("#fileDate").parent().hide();
|
|
|
|
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);
|
|
}
|
|
else {
|
|
$("#uploadfile").prop("accept", "application/pdf");
|
|
}
|
|
if (templateFile) {
|
|
$("#templateFile").prop("href", templateFile);
|
|
$("#templateFile").show();
|
|
}
|
|
else {
|
|
$("#templateFile").hide();
|
|
}
|
|
$("#Content").width("400px")
|
|
}
|
|
|
|
function uploadOuterData() {
|
|
if (!$("#uploadfile").get(0).value.length) {
|
|
main.alert("请选择要上传的文件!");
|
|
return;
|
|
}
|
|
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) => {
|
|
if (page.maxRequestLength < f.size) {
|
|
main.alert("当前系统配置最大上传大小为" + (page.maxRequestLength / 1024 / 1024).toFixed(2) + "MB,小于要上传的文件,请联系管理员更改配置");
|
|
useSend = false;
|
|
return;
|
|
}
|
|
/*上传的文件file*/
|
|
fd.append("file", f);
|
|
});
|
|
if (!useSend) {
|
|
return;
|
|
}
|
|
main.ajax({
|
|
url: url,
|
|
type: "POST",
|
|
processData: false,
|
|
contentType: false,
|
|
data: fd,
|
|
success: function (res) {
|
|
var msg = res.Msg ? res.Msg : res.msg;
|
|
if (!res.Success || res.success) {
|
|
main.alert(msg);
|
|
} else {
|
|
$("#uploadfile").val("");
|
|
$("#uploadfileButton").val("请选择...");
|
|
$("#modalFileUpload").modal('hide');
|
|
main.message(msg);
|
|
}
|
|
},
|
|
beforeSend(jqXHR) {
|
|
main.waitMe(true);
|
|
},
|
|
complete(jqXHR, textStatus) {
|
|
main.waitMe(false);
|
|
}
|
|
});
|
|
}
|
|
function showWindow(obj, title, yesCallback) {
|
|
getReportDesc();
|
|
$('#OptionKey').prop('selectedIndex', 0);
|
|
$('#SwapKey').prop('selectedIndex', 0);
|
|
$("#OptionValue").val(page.report.ReportDescOption ? page.report.ReportDescOption["默认"] : "");
|
|
$("#SwapValue").val(page.report.ReportDescSwap ? page.report.ReportDescSwap["默认"] : "");
|
|
var btn = [];
|
|
if (typeof (yesCallback) == "function") {
|
|
btn.push("保存");
|
|
}
|
|
btn.push("取消");
|
|
layer.open({
|
|
type: 1,
|
|
title: title,
|
|
shadeClose: false,
|
|
shade: 0.4,
|
|
area: ['600px', '480px'],
|
|
content: obj,
|
|
btn: btn,
|
|
yes: function (index, layero) {
|
|
if (typeof (yesCallback) == "function") {
|
|
yesCallback();
|
|
}
|
|
layer.close(index);
|
|
},
|
|
cancel: function (index, layero) {
|
|
layer.close(index);
|
|
}
|
|
});
|
|
}
|
|
function showHtml(title, url, width) {
|
|
if (!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;
|
|
}
|
|
} |