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

168 lines
6.7 KiB
Plaintext

@{
ViewBag.Title = "查看记录";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
var pageObj = new
{
code = ViewBag.code,
type = ViewBag.type
};
}
<style>
.ui-jqgrid {
margin: 0 !important;
}
.ui-jqgrid tr.jqgrow td {
white-space: pre-line;
line-height: 1.2rem;
}
</style>
@section JS
{
<script type="text/javascript">
const page = @Json.Serialize(pageObj);
$(() => {
var postData = {
type: page.type,
OptDateStart: "2000-01-01",
OptDateEnd: "9999-12-31"
}
var obj = {
url: "/trade/QueryInterfaceApproval",
datatype: 'json',
//multiselect: true,
height: 'auto',
width: '96%',
autowidth: false,
viewrecords: true,
jsonReader: { repeatitems: false },
cmTemplate: { align: 'center', width: 120 },
caption: '',
mtype: 'POST',
postData: postData,
colModel: colModelGrid,
ondblClickRow: rowdblclick,
pager: jQuery('#pagerGrid'),
pagerpos: 'left',
rowNum: 20,
rowList: [20, 30, 50, 200, 10000],
loadComplete: gridComplete,
footerrow: false,
};
var g_grid = jQuery('#listGrid').jqGrid(obj);
})
function gridComplete() {
$("#listGrid").setGridWidth($("#infopage").width() - 30);
}
function SentData(id, code, processType = "") {
var ajaxopt = {
type: "Post",
url: "/trade/LinkApprovalResult",
data: { interfaceId: id, code: code, additionalProcessing: processType },
dataType: "json",
success: function (data) {
if (data.success) {
window.parent.showmiddlemessage("成功更新本条数据");
layer.closeSelf()
}
else if (data.proccessType === "AdditionalProcessing") {
if (data.type === "LackOfMoney") {
var htmlContent = `<div style="padding:10px">${data.message}</div>`;
var lackMoneyConfirmLayer = main.open2("提示",
htmlContent,
{
area: ["430px", "175px"],
btn: ['交易特批', '取消'],
yes: function (index, layero) {
main.confirm("客户资金或授信不足,强制审批会导致本机构产生风险!要继续?", function () {
SentData(id, code, "LackOfMoney");
layer.closeAll();
});
},
cancel: function (index, layero) {
layer.closeSelf()
}
});
}
}
else {
main.alert(data.message ? data.message : data.msg);
}
},
error: function (msg) {
main.alert("error:" + msg);
},
beforeSend(jqXHR) {
main.waitMe(true);
},
complete(jqXHR, textStatus) {
main.waitMe(false);
},
}
main.ajax(ajaxopt);
}
var colModelGrid = [
{
name: 'id', label: 'id', index: 'id', align: 'center', hidden: true, optionHide: true,
}, {
name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', align: 'center', hidden: true, optionHide: true,
}, {
name: 'Opt', label: '操作', index: 'Opt', width: 80, formatter: function (cellValue, options, rowObject) {
var text = "未知";
switch (rowObject.type) {
case 1:
text = "交易";
break;
case 2:
text = "客户";
break;
case 3:
text = "资金";
break;
}
var html = "<input type='button' class='wentiEdit' title='关联{1}记录' onclick='SentData({0},\"{1}\")' value='匹配' />"
.template(rowObject.id, page.code);
return html;
}
}, {
name: 'type', label: '业务类型', index: 'type', width: 80, align: 'center', formatter: function (cellValue, options, rowObject) {
var text = "未知";
switch (cellValue) {
case 1:
text = "交易";
break;
case 2:
text = "客户";
break;
case 3:
text = "资金";
break;
}
return text;
}
}, {
name: 'LinkCode', label: '业务编号', index: 'LinkCode', width: 160, align: 'center'
}, {
name: 'linkStatus', label: '匹配结果', index: 'linkStatus', width: 80, align: 'center', sortable: false, formatter: function (cellValue, options, rowObject) {
return rowObject.LinkCode ? "成功" : "失败";
}
}, {
name: 'OptDate', label: '操作时间', index: 'OptDate', width: 160, align: 'center'
}, {
name: 'OptName', label: '操作人', index: 'OptName', width: 160, align: 'center'
}, {
name: 'remark', label: '信息', index: 'remark', width: 250, align: 'left', formatter: function (cellValue, options, rowObject) {
if (cellValue.startsWith("http://")) {
return "<a href='{0}' target='_blank'>{0}</a>".template(cellValue);
}
return cellValue;
}
}];
</script>
}
<div id="ruleList">
@Html.Raw(JqGridSimple.OutTable())
</div>