chore(web): 删除前端注释死代码——7个脚本文件的注释代码块及孤儿调用链
tradeEndConfirmList.js:两段被注释的main.open2弹窗(生成/批量下载确认书旧交互)、ModifyPayDate三函数簇(唯一入口按钮已被注释,cshtml的myModal弹窗同步删除,BatchDownLoadDoc中仅为死弹窗服务的tip/htmlContent变量一并清理);swapTradeList/SwapflowList/TradeMarketReport×2/structure:散落的注释代码行(旧日期校验/sortGrid/layer.open/表头分组等)。 保留swapTradeEdit.js 440-455的部署踩坑文档注释。行为零变更:node --check×7通过,fe-tests 319/319通过
This commit is contained in:
@@ -66,32 +66,4 @@
|
||||
@MyControls.Btn("重置确认书", "BatchDelDoc()")
|
||||
}
|
||||
</div>
|
||||
@Html.Raw(JqGridSimple.OutTable())
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- 模态框头部 -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">修改支付日期</h4>
|
||||
<button type="button" class="close" onclick="closeModifyDateModal()">×</button>
|
||||
</div>
|
||||
|
||||
<!-- 模态框主体 -->
|
||||
<div class="modal-body" style="height:180px;">
|
||||
<lable>支付日期</lable>
|
||||
<input class="search-input datepicker" id="payDateInput" type="text">
|
||||
<input type="hidden" id="hidflowId" />
|
||||
</div>
|
||||
|
||||
<!-- 模态框底部 -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary btn-default" onclick="saveModifyPayDate()">保存</button>
|
||||
<button type="button" class="btn btn-primary btn-default" onclick="closeModifyDateModal()">关闭</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@Html.Raw(JqGridSimple.OutTable())
|
||||
@@ -1927,7 +1927,6 @@ function createVue(index, baseVue, floating) {
|
||||
trade.TradeSinglePrice = notional ? pv / notional : 0;
|
||||
tradePricing.tradeCalc(trade, tradePricing.calcReason.TradeSinglePrice);
|
||||
}
|
||||
//result.Pv = (result.Pv < 0 ? -1 : 1) * trade.TradePrice;
|
||||
|
||||
if (pageObj.IsPVIncludePrincipal && trade.OriginalPrincipalSum > 0) {
|
||||
result.Pv += trade.OriginalPrincipalSum * (trade.BuySell === '卖出' ? -1 : 1);
|
||||
@@ -2870,7 +2869,6 @@ var groupVue = new Vue({
|
||||
} else {
|
||||
floatVue.hide();
|
||||
$('#modalTradeSave').modal('hide');
|
||||
//showTradeView(resp.obj);
|
||||
_.each(_tradeVues, x => x.remove(true));
|
||||
}
|
||||
$(".tag-context .tag-item").remove();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//window.otcformat.options.disableGrouping = true;
|
||||
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradeSinglePrice.precision, negative: true, append: '' });
|
||||
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradeSinglePrice.precision, negative: true, append: '' });
|
||||
const inputFormatSwapDeliveryPrice = Object.freeze({ precision: 9, negative: true, append: '' });
|
||||
const inputFormatSwapAmount = swapPricePrecision.getCommonInputFormat('amount', { negative: true, append: '' });
|
||||
const formatSwapAmount = value => swapPricePrecision.formatCommon('amount', value);
|
||||
@@ -767,11 +766,6 @@ function intiGrid(step) {
|
||||
numberOfColumns: 15, //合并几列
|
||||
titleText: "浮动收益",//合并后父列名
|
||||
}
|
||||
//, {
|
||||
//startColumnName: "swap_Position.Direction", //开始列
|
||||
//numberOfColumns: 4, //合并几列
|
||||
//titleText: "利息收益",//合并后父列名
|
||||
//}
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -1195,9 +1189,6 @@ var vue = new Vue({
|
||||
if (thisObj.swapflow.OccurTime == "" || thisObj.swapflow.OccurTime == null) {
|
||||
return main.alert("请选择交易时间");
|
||||
}
|
||||
//if (thisObj.swapflow.FundAccount == "" || thisObj.swapflow.FundAccount == null) {
|
||||
// return main.alert("请填写资金账号");
|
||||
//}
|
||||
if (thisObj.swapflow.ClientId ==0 || thisObj.swapflow.ClientId == null) {
|
||||
return main.alert("请选择交易对手方");
|
||||
}
|
||||
|
||||
@@ -104,10 +104,6 @@ function searchPositionDetials(isSearchclick) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if ($("#ValueDate").val() > page.valueDate) {
|
||||
// main.message("结束日期不能大于当前系统日期!");
|
||||
// return;
|
||||
//}
|
||||
if ($("#ValueDate").val() < $("#ValueDateFrom").val()) {
|
||||
main.message("起始日期不能大于结束日期!");
|
||||
return;
|
||||
@@ -343,7 +339,6 @@ function gridComplete() {
|
||||
jgrid.jqGrid('setRowData', datas[i], '', "data-error"); // 设置背景颜色为淡红色
|
||||
}
|
||||
}
|
||||
//jgrid.sortGrid(g_sort.name, g_sort.order);
|
||||
main.setcolumnChooser(jgrid, page.configcolumn);
|
||||
$(".selftooltip").tooltip({ html: true, show: 50000, trigger: "hover" });
|
||||
$(window).off('resize.jqGrid');
|
||||
|
||||
@@ -89,10 +89,6 @@ function searchPositionDetials(isSearchclick) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if ($("#ValueDate").val() > page.valueDate) {
|
||||
// main.message("结束日期不能大于当前系统日期!");
|
||||
// return;
|
||||
//}
|
||||
listGrid.appendPostData({ ValueDateFrom: $("#ValueDate").val() });
|
||||
listGrid.appendPostData({ ValueDate: $("#ValueDate").val() });
|
||||
listGrid.appendPostData({ StructureType: page.StructureType });
|
||||
@@ -372,7 +368,6 @@ function gridComplete() {
|
||||
jgrid.jqGrid('setRowData', datas[i], '', "data-error"); // 设置背景颜色为淡红色
|
||||
}
|
||||
}
|
||||
//jgrid.sortGrid(g_sort.name, g_sort.order);
|
||||
$.when(main.setcolumnChooser(jgrid, page.configcolumn)).always(function () {
|
||||
restoreDocumentColumnOrder(jgrid);
|
||||
ensureBusinessColumnsVisible(jgrid);
|
||||
|
||||
@@ -69,16 +69,12 @@ const consUnderlyingFlagBase = (function () {
|
||||
}());
|
||||
const consUnderlyingFlagNonBond = (function () {
|
||||
let unSelFlag = tradeHelper.UnderlyingSelectFlag;
|
||||
//临时注释,保证业务不受影响
|
||||
//return consUnderlyingFlagBase | unSelFlag.Stock | unSelFlag.StockIndex | unSelFlag.StockIF | unSelFlag.Fund | unSelFlag.CommodityFutures | unSelFlag.CommoditySpot;
|
||||
return consUnderlyingFlagBase;
|
||||
}());
|
||||
const consUnderlyingFlagBond = (function () {
|
||||
let unSelFlag = tradeHelper.UnderlyingSelectFlag;
|
||||
const consUnderlyingFlagNonBond = (function () {
|
||||
let unSelFlag = tradeHelper.UnderlyingSelectFlag;
|
||||
//临时注释,保证业务不受影响
|
||||
//return consUnderlyingFlagBase | unSelFlag.Stock | unSelFlag.StockIndex | unSelFlag.StockIF | unSelFlag.Fund | unSelFlag.CommodityFutures | unSelFlag.CommoditySpot;
|
||||
return consUnderlyingFlagBase;
|
||||
}());
|
||||
}());
|
||||
@@ -569,14 +565,6 @@ const vue = new Vue({
|
||||
changeStockEqvNotional() {
|
||||
this.trade.StockEqvNotional = swapPricePrecision.normalizeCommon('amount', this.trade.StockEqvNotional);
|
||||
this.refreshPayTradingFeesByUnit();
|
||||
//计算数量
|
||||
// if (this.paySwapList.length > 0) {
|
||||
// var item = this.paySwapList[0];
|
||||
// var notional = deliveryPrice * item.ContractSize;
|
||||
// item.PosiQuantity = notional == 0 ? 0 : _.round(this.trade.StockEqvNotional / notional, page.otcFormatConfig.StockEqvNotional.precision);
|
||||
// this.calcNotional();
|
||||
// }
|
||||
|
||||
},
|
||||
//变更初始预付金 为¥
|
||||
showAbsPrice() {
|
||||
@@ -961,9 +949,6 @@ const vue = new Vue({
|
||||
},
|
||||
//年化利率变更同步修改 同行观察日利率
|
||||
blurSwapRate(item) {
|
||||
//if (item.InterestRateDefault != 0) {
|
||||
// item.IsAnnualized = true;
|
||||
//}
|
||||
if (item.SwapIntervalList.length > 0) {
|
||||
var swapRate = item.InterestRateDefault;
|
||||
var same = true;
|
||||
@@ -1486,12 +1471,6 @@ const vue = new Vue({
|
||||
changeClient: function (client) {
|
||||
this.trade.ClientId = client.id;
|
||||
this.client = client;
|
||||
//if (this.client.SwapTradeType == 0) {//非DMA客户
|
||||
// this.trade.trade_extend.ExtendObj.FlowBookMode = 3;//流水簿记模式为重置
|
||||
//} else {
|
||||
// this.trade.trade_extend.ExtendObj.FlowBookMode = 2;//流水簿记模式为加权平均 暂定
|
||||
//}
|
||||
//this.initMarginRate();
|
||||
},
|
||||
initMarginRate() { //初始预付金 初始话
|
||||
_that = this;
|
||||
@@ -1653,10 +1632,6 @@ const vue = new Vue({
|
||||
if (thisObj.getSwapList.length == 0) {
|
||||
thisObj.addGetSwapRate();
|
||||
}
|
||||
//if (thisObj.marginSwapList.length == 0) {
|
||||
// thisObj.addMarginSwapRate();
|
||||
//}
|
||||
|
||||
},
|
||||
// A renewal opens as a new trade, so the underlying autocomplete only restores
|
||||
// its code and does not emit change. Historically fetched the initial price explicitly.
|
||||
|
||||
@@ -286,9 +286,6 @@ function gridComplete() {
|
||||
if (rowdata.ExerciseDate == page.systemDate && (rowdata.TradeStatus != "已平仓" && rowdata.TradeStatus != "已到期")) {
|
||||
$('#' + rowIds[i]).addClass("ExerciseDateBg");
|
||||
}
|
||||
//else if (rowdata['trade_swap.GetSwapTimeAndRate'].indexOf(page.systemDate) > -1 || rowdata['trade_swap.PaySwapTimeAndRate'].indexOf(page.systemDate) > -1) {
|
||||
// $('#' + rowIds[i]).addClass("SwapDateBg");
|
||||
//}
|
||||
if (rowdata.TradeStatus == "已平仓" && rowdata.UnwindDate == page.systemDate) {
|
||||
$('#' + rowIds[i]).addClass("UnwindTradeBg");
|
||||
}
|
||||
@@ -321,14 +318,6 @@ function rowdblclick(rowid) {
|
||||
|
||||
|
||||
function startAddtrade() {
|
||||
//layer.open({
|
||||
// type: 2,
|
||||
// title: "新增互换交易",
|
||||
// shadeClose: false,
|
||||
// shade: 0.4,
|
||||
// area: ['80%', '80%'],
|
||||
// content: "/swapTrade2/TradeEdit/0"
|
||||
//});
|
||||
main.open("新增互换交易", "/swapTrade2/TradeEdit/0", {area:["95%",'90%']});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@ function showToolName(cellValue, options, rowObject) {
|
||||
"<input type=\"button\" class=\"wentiEdit\" title='未生成结算确认书' disabled='disabled' style=\"width: 50px!important;\" value=\"{0}\" />"
|
||||
.template("下载");
|
||||
}
|
||||
//var disabled = pageData.canGenerate == true ? "" : "disabled";
|
||||
//html += "<input type=\"button\" class=\"wentiEdit\" title='修改支付日期' onclick=\"ModifyPayDate('{0}','{1}')\" style=\"width: 120px!important;\" value=\"{2}\" {3}/>"
|
||||
// .template(rowObject.swap_flow_event.EncryptId, rowObject.swap_flow_event.PayDate, "修改支付日期", disabled);
|
||||
if (rowObject.ContractDocUrl && pageData.canSendEmail) {
|
||||
html +=
|
||||
"<input type=\"button\" class=\"wentiEdit\" title='发送结算确认书邮件到客户' onclick=\"sendSettleEmail('{0}','{1}')\" value=\"{2}\" />"
|
||||
@@ -39,46 +36,6 @@ function DownLoadDoc(res) {
|
||||
window.open(res);
|
||||
}
|
||||
|
||||
function closeModifyDateModal() {
|
||||
$('#myModal').modal('hide');
|
||||
}
|
||||
|
||||
function saveModifyPayDate() {
|
||||
var id = $("#hidflowId").val();
|
||||
var payDate = $("#payDateInput").val();
|
||||
if (payDate == "" || payDate == undefined) {
|
||||
main.alert("请选择支付日期");
|
||||
return;
|
||||
}
|
||||
main.post("/swaptrade2/UpdatePayDate/", { Id: id, PayDate: payDate }, {
|
||||
success: function (resp) {
|
||||
if (resp.success) {
|
||||
main.message("更新成功");
|
||||
} else {
|
||||
main.alert("更新失败");
|
||||
}
|
||||
$('#myModal').modal('hide');
|
||||
SearchClick();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//修改支付日期
|
||||
function ModifyPayDate(id, oldPayDate) {
|
||||
|
||||
$("#myModal").modal("show");
|
||||
$("#hidflowId").val(id);
|
||||
$("#payDateInput").val(oldPayDate.replace(" 00:00:00",""));
|
||||
$("#payDateInput").datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showButtonPanel: true,
|
||||
showOtherMonths: true,
|
||||
selectOtherMonths: true
|
||||
});
|
||||
}
|
||||
|
||||
function GenetateEndBillByReqDate() {
|
||||
var jgrid = jQuery('#listGrid');
|
||||
var flowEventIds = main.GetGridIds(jgrid);
|
||||
@@ -101,32 +58,6 @@ function GenetateEndBillByReqDate() {
|
||||
|
||||
GenerateSettleBills("DOC", flowEventIds);
|
||||
});
|
||||
|
||||
|
||||
|
||||
//main.open2("生成结算确认书",
|
||||
// htmlContent,
|
||||
// {
|
||||
// area: ["300px", "165px"],
|
||||
// btn: ['生成', '取消'],
|
||||
// yes: function (index, layero) {
|
||||
// /*var docType = $('input[name="docType"]:checked').val();*/
|
||||
// GenerateSettleBills("DOC", flowEventIds);
|
||||
|
||||
|
||||
// },
|
||||
// cancel: function (index, layero) {
|
||||
// parent.layer.closeAll();
|
||||
// },
|
||||
// success: function (layero, index) {
|
||||
// $(".btn-group").on("click",
|
||||
// ".btn",
|
||||
// function (event) {
|
||||
// $('input[name="docType"]:checked').prop("checked", false);
|
||||
// $(this).children("input").prop("checked", true);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
function GenerateSettleBills(docType, flowEventIds) {
|
||||
@@ -237,45 +168,8 @@ function BatchDownLoadDoc() {
|
||||
|
||||
var jgrid = jQuery('#listGrid');
|
||||
var flowEventIds = main.GetGridIds(jgrid);
|
||||
var tip = "下载" + startDate + "至" + endDate + "的结算确认书";
|
||||
|
||||
batchDownload(startDate, endDate, clientIds, flowEventIds, ["DOCX"]);
|
||||
var htmlContent = '<form class="form-horizontal" role="form" style="padding:15px 12px 5px">' +
|
||||
'<div class="form-group">' +
|
||||
'<label style="padding:10px 12px 10px">' + tip + '</label><br />' +
|
||||
'<label class="col-sm-5 control-label">文档类型</label>' +
|
||||
'<label class="btn btn-sm btn-primary " style="border:none;display:none;"><input type="radio" name="docType" value="PDF"> PDF</label>' +
|
||||
'<label class="btn btn-sm btn-primary active" style="border:none"><input checked type="radio" name="docType" value="Excel"> Excel</label>';
|
||||
// main.open2("批量下载结算确认书",
|
||||
// htmlContent + '</div></form>',
|
||||
// {
|
||||
// area: ["400px", "250px"],
|
||||
// btn: ['下载', '取消'],
|
||||
// yes: function (index, layero) {
|
||||
// var docpdf = [];
|
||||
// $('input[name="docType"]:checked').each(function (i) {
|
||||
// docpdf.push($(this).val())
|
||||
// })
|
||||
// var isSeal = $("#SingleBookSeal").val() == '是' ? true : false;
|
||||
// var confirmBookPostData = { TradeDateStart: startDate, TradeDateEnd: endDate, ClientIds: clientIds, TradeIds: null, flowEventIds: tradeCashIdList, docpdf: docpdf, IsSeal: isSeal };
|
||||
// if (pageData.IsAutoSealAndUploadFiles) {
|
||||
// confirmBookPostData.SealResults = $("#SealResults").val();
|
||||
// //confirmBookPostData.SealDateStart = $("#DateFromSealDate").val();
|
||||
// //confirmBookPostData.SealDateEnd = $("#DateToSealDate").val();
|
||||
// }
|
||||
// openWindowWithPost("/swaptrade2/BatchDownLoadDoc/", confirmBookPostData);
|
||||
// parent.layer.closeAll();
|
||||
// },
|
||||
// cancel: function (index, layero) {
|
||||
// parent.layer.closeAll();
|
||||
// },
|
||||
// success: function (layero, index) {
|
||||
// $(".btn-group").on("click", ".btn", function (event) {
|
||||
// $('input[name="docType"]:checked').prop("checked", false);
|
||||
// $(this).children("input").prop("checked", true);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
function batchDownload(startDate, endDate, clientIds, flowEventIds, docpdf) {
|
||||
|
||||
Reference in New Issue
Block a user