260 lines
11 KiB
Plaintext
260 lines
11 KiB
Plaintext
@{
|
|
ViewBag.Title = "资信等级有效期管理";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
var list = CurUser.Roles.Select(s => s.Id).ToList();
|
|
string rolesStr = string.Join(",", list);
|
|
}
|
|
@section CSS{
|
|
}
|
|
@section JS{
|
|
<script>
|
|
var roles = '@rolesStr';
|
|
var ClientType = "@CreditTable.ClientType";
|
|
var canOperate = '@CurUser.客户管理.资信评级修改';
|
|
var isZheQi = '@PS.Config.Is浙期';
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$(".datepicker").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true });
|
|
var PostData = { Type: ClientType };
|
|
@Html.Raw(JqGridSimple.OutGrid("/client_rating/Query"))
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
(e.keyCode == 13) && SearchClick(true);
|
|
} catch (e) { }
|
|
}
|
|
|
|
document.onkeydown = keyEnter;
|
|
//设置审批状态默认值
|
|
$("#ProcessStatus").val("");
|
|
SetAceDropDown();
|
|
|
|
$('#listGrid').jqGrid({ ondblClickRow: rowdblclick });
|
|
});
|
|
|
|
function isAuthorize(roleId) {
|
|
if (roleId === 'undefined') return false;
|
|
var roleIdStr = roleId + "";
|
|
if (roleIdStr === "") return false;
|
|
var rolesArr = roles.split(",");
|
|
var len = roles.length;
|
|
if (len <= 0) return false;
|
|
for (var i = 0; i < len; i++) {
|
|
if (rolesArr[i] === roleIdStr) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
var colModelGrid = [{
|
|
name: 'id', label: 'id', index: 'id', width: 1, align: 'center', hidden: true
|
|
}, {
|
|
name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', width: 0, align: 'left', hidden: true
|
|
}, {
|
|
name: 'ProcessStatus', label: '审批状态', index: 'ProcessStatus', width: 140, align: 'center'
|
|
}, {
|
|
name: 'ProcessStatus', label: '评级状态', index: 'ProcessStatus', width: 140, align: 'center', formatter: RatingStatusFormatter
|
|
}, {
|
|
name: 'ProcessRoleName', label: '审批角色', index: 'ProcessRoleName', width: 110, align: 'center',
|
|
},{
|
|
name: 'ClientNumber', label: '客户编号', index: 'ClientNumber', width: 200, align: 'center',
|
|
}, {
|
|
name: 'ClientName', label: '客户名称', index: 'ClientName', width: 220, align: 'center'
|
|
}, {
|
|
name: 'CreditRatingStr', label: '资信评级', index: 'CreditRatingStr', width: 110, align: 'center', sortable: false
|
|
}, {
|
|
name: 'RatingStartDate', label: '评级起始日', index: 'RatingStartDate', width: 110, align: 'center', formatter: 'date'
|
|
}, {
|
|
name: 'RatingDeadLine', label: '评级终止日', index: 'RatingDeadLine', width: 110, align: 'center', formatter: 'date'
|
|
}];
|
|
|
|
if (isZheQi === 'True') {
|
|
colModelGrid.push({
|
|
name: 'RatingAccording', label: '评估依据', index: 'RatingAccording', width: 110, align: 'center'
|
|
}, {
|
|
name: 'RatingPersonnel', label: '评估人员', index: 'RatingPersonnel', width: 110, align: 'center'
|
|
}, {
|
|
name: 'CheckPersonnel', label: '复核人员', index: 'CheckPersonnel', width: 110, align: 'center'
|
|
});
|
|
}
|
|
|
|
colModelGrid.push({
|
|
name: 'Comments', label: '说明', index: '', width: 160, align: 'center', sortable: false
|
|
}, {
|
|
name: 'OptName', label: '操作人', index: 'OptName', width: 110, align: 'center',
|
|
}, {
|
|
name: 'OptDate', label: '操作时间', index: 'OptDate', width: 140, align: 'center'
|
|
}, {
|
|
name: '', label: '操作', index: '', width: 200, align: 'center', formatter: showToolName, sortable: false
|
|
});
|
|
|
|
function gridComplete() {
|
|
$('.ui-jqgrid-bdiv', '#gbox_listGrid').floatingScroll();
|
|
}
|
|
|
|
//function deletecredit(encryptId) {
|
|
// debugger
|
|
// if (confirm("确定删除吗?")) {
|
|
// $.ajax({
|
|
// type: "Post",
|
|
// url: "/client_rating/delete",
|
|
// data: { id: encryptId, d: new Date() },
|
|
// success: function (data) {
|
|
// showmiddlemessage(data.obj.obj);
|
|
// if (data.success == true) {
|
|
// $('#listGrid').trigger('reloadGrid');
|
|
// }
|
|
// },
|
|
// error: function (msg) {
|
|
// alert("error:" + msg);
|
|
// }
|
|
// });
|
|
// }
|
|
//}
|
|
|
|
function RatingStatusFormatter(cellValue, options, rowObject) {
|
|
var systemDate = new Date('@ViewBag.SystemDate');
|
|
if (rowObject.ProcessStatus === "已审批") {
|
|
if (systemDate > new Date(rowObject.RatingDeadLine)) {
|
|
return "无效";
|
|
}
|
|
else {
|
|
return "有效";
|
|
}
|
|
}
|
|
else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
startcreditView(rowData.EncryptId);
|
|
}
|
|
|
|
function ProcessOptDateFilter(cellValue, options, rowObject) {
|
|
if (rowObject.ProcessStatus === '未审批') {
|
|
return '';
|
|
}
|
|
return rowObject.ProcessOptDate;
|
|
}
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
var html = "";
|
|
if (rowObject.ProcessStatus === '未审批' || rowObject.ProcessStatus === '已拒绝') {
|
|
if (canOperate === 'True') {
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='删除' onclick=\"deletecredit('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.EncryptId, "删除");
|
|
}
|
|
|
|
} else {
|
|
if (isAuthorize(rowObject.ProcessRoleId)) {
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='审批' onclick=\"passorreject('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.id, "审批");
|
|
} else {
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='审批' disabled='disabled' value=\"{1}\" />"
|
|
.template(rowObject.EncryptId, "审批");
|
|
}
|
|
}
|
|
|
|
if (canOperate === 'True') {
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='修改评级信息' onclick=\"startcreditEdit('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.EncryptId, "修改");
|
|
}
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='查看'onclick=\"clientrating('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.id, "查看");
|
|
|
|
return html;
|
|
}
|
|
function clientrating(id) {
|
|
var url = "/Client_Rating/ClientRatingLogList?id=" + id;
|
|
main.open("历史记录", url, { area: ['1300px', '85%'] });
|
|
}
|
|
function passorreject(eid) {
|
|
var url = "/processlog/processlogClientRatingListInner?eid=" + eid;
|
|
main.open("审批", url);
|
|
}
|
|
|
|
function deletecredit(encryptId) {
|
|
main.confirmPost("确定删除吗?", "/Client_Rating/Delete", { id: encryptId, d: new Date() }).done(function (resp) {
|
|
$('#listGrid').trigger('reloadGrid');
|
|
});
|
|
}
|
|
function startAddcredit() {
|
|
var addurl = "/Client_Rating/Edit/0";
|
|
main.infopage("新增资信等级有效期", addurl, { area: ['650px', '60%'] });
|
|
}
|
|
|
|
function startcreditEdit(id) {
|
|
var srcurl = "/Client_Rating/Edit/?enid=" + id;
|
|
main.infopage("修改资信等级有效期", srcurl, { area: ['650px', '60%'] });
|
|
}
|
|
|
|
function startcreditView(id) {
|
|
var srcurl = "/Client_Rating/Detail/?enid=" + id;
|
|
main.infopage("查看资信等级有效期", srcurl, { area: ['650px', '65%'] });
|
|
}
|
|
|
|
function reloadcredit() {
|
|
//重新加载
|
|
SearchClick();
|
|
window.layer.closeAll();
|
|
}
|
|
|
|
function reloadcredit2() {
|
|
//重新加载
|
|
SearchClick();
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
listGrid.appendPostData({ Credit: $("#Credit").val() });
|
|
listGrid.appendPostData({ ClientId: $("#ClientId").val() });
|
|
listGrid.appendPostData({ ClientName: $("#ClientName").val() });
|
|
listGrid.appendPostData({ RatingDeadLineStart: $("#DateFromRatingDeadLine").val() });
|
|
listGrid.appendPostData({ RatingDeadLineEnd: $("#DateToRatingDeadLine").val() });
|
|
listGrid.appendPostData({ ProcessStatuses: ($("#ProcessStatus").val() == null || $("#ProcessStatus").val().includes("全部")) ? "" : $("#ProcessStatus").val().join(",") });
|
|
listGrid.appendPostData({ OptDateStart: $("#DateFromOptDate").val() });
|
|
listGrid.appendPostData({ OptDateEnd: $("#DateToOptDate").val() });
|
|
listGrid.appendPostData({ VarietyId: $("#VarietyId").val() == null ? "" : $("#VarietyId").val().join() });
|
|
listGrid.appendPostData({ VarietyName: $("#VarietyName").val() });
|
|
listGrid.appendPostData({ Type: ClientType });
|
|
listGrid.appendPostData({ ShowExpiredRecords: $("#ShowExpiredRecords").prop("checked") });
|
|
|
|
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam', {page: 1});
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
|
|
function exportToCsv() {
|
|
var dateTemp = new Date().Format("yyyyMMdd");
|
|
var fileName = "评级清单" + dateTemp;
|
|
main.toExcel("listGrid", fileName, "csv", null, "操作时间,操作", [{ colName: "评级", formatter: "text" }]);
|
|
}
|
|
</script>
|
|
}
|
|
|
|
<div class="searchdiv">
|
|
@Html.MyAceDropdownInput("ClientId", "客户名称", CurUser.GetClientSelectItems(), true, true, null, false)
|
|
@Html.SearchDateRange("RatingDeadLine", "评级终止日")
|
|
@Html.MyAceDropdownInput("ProcessStatus", "审批状态", GlobalData.AllCreditProcessStatus())
|
|
只显示目前没有有效评级的客户: @Html.CheckBox("ShowExpiredRecords", false)
|
|
@MyControls.SearchBtn()
|
|
@if (CurUser.客户管理.资信评级修改)
|
|
{
|
|
@MyControls.Btn("新增", "startAddcredit()")
|
|
}
|
|
@MyControls.Btn("导出", "exportToCsv()")
|
|
</div>
|
|
@Html.Raw(JqGridSimple.OutTable()) |