Files
zszq-trs/YLErpWeb/Views/trade/_part/TradeAbstractInfoJs.cshtml
T
2024-05-09 14:06:26 +08:00

74 lines
2.9 KiB
Plaintext

@*交易编辑--交易简讯*@
@{
Layout = null;
}
<div class="modal" tabindex="-1" id="modalTradeAbstract" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">交易摘要</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="padding-left:27%;">
<pre style="line-height: 26px;white-space: pre-wrap;" ></pre>
</div>
<div class="modal-footer">
<div class="mx-auto">
<a download="Trade_交易摘要_@(DateTime.Now.ToString("yyyyMMddHHmmss")).txt"
href="#" class="btn btn-primary btn-save" onfocus="this.blur();"
onclick="return ;">保存</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
</div>
<script>
(function (global) {
function TradeAbstractInfo() {
}
function openLayer(showOptions) {
let url = "/trade/tradeview?enid=" + this.EncryptId;
main.open("查看交易", url, {
end: function () {
if (showOptions.next) {
TradeAbstractInfo.show(showOptions.next);
} else {
layer.closeAll();
}
}
});
}
function onModalHide(showOptions) {
$('#modalTradeAbstract').off("hide.bs.modal");
if (!this.showTradeView) return;
let url = "/trade/tradeview?enid=" + this.EncryptId;
if (!window.parent || window.parent === window) {
openLayer(showOptions);
} else {
window.location.href = "/trade/tradeview?enid=" + this.EncryptId;;
}
}
//options:{abstractInfo:string,EncryptId:string,showTradeView:boolean}
TradeAbstractInfo.show = function (showOptions) {
let text = showOptions.abstractInfo;
let index = text.indexOf('####')
var headText = text.substring(0, index);
var bodyText = text.substring(index + 4).trim();
let $content = $('#modalTradeAbstract').find('.modal-content:first');
$content.children('.modal-body').find("pre:first").text(bodyText);
$content.children('.modal-footer').find("a.btn-save").attr('href', "data:text/plain;charset=utf-8,\uFEFF" + encodeURIComponent(headText + bodyText));
$('#modalTradeAbstract').modal('show').on('hide.bs.modal', onModalHide.bind(showOptions));
};
global.TradeAbstractInfo = TradeAbstractInfo;
}(window));
</script>