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

419 lines
31 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@using BaseOUDAL
@model Dictionary<string, List<Dictionary>>
@{
ViewBag.Title = "数据字典";
ViewBag.FullTitle = "系统管理";
Layout = "~/Views/Shared/_MainLayout.cshtml";
var pageObj = new
{
allowOption = CurUser.系统管理.数据字典,
IsSecuritiesEnvironment = PS.Config.ErpElement.SecuritiesEnvironment,
};
}
@section CSS{
}
@section Js{
<script language="JavaScript">
const page = @Json.Serialize(pageObj);
var selectName = "";
var unModifiable = page.IsSecuritiesEnvironment ? ["主协议附件(PDF)", "补充协议附件(PDF)", "履约协议附件(PDF)", "代签产品附件(PDF)", "适当性文件", "双录视频文件"] : [];
function ShowItems(items) {
if (selectName == "行业") {
var str = "<ol><span style='min-width:180px;display: inline-block;'>行业名称</span><span style='width:180px;display: inline-block;'>客户性质1</span><span style='width:180px;display: inline-block;'>客户性质2</span>";
$.each(items, function (i) {
this.CustomerNature1 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName.split(',')[0];
this.CustomerNature2 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName.split(',')[1];
str += "<li><span id='nameSpan" + this.Id + "' style='width:180px;display: inline-block;'>" + this.Name
+ "</span><span id='customerNatureSpan1" + this.Id + "' style='min-width:180px;display: inline-block;'>" + (this.CustomerNature1 == undefined ? "" : this.CustomerNature1)
+ "</span><span id='customerNatureSpan2" + this.Id + "' style='min-width:180px;display: inline-block;'>" + (this.CustomerNature2 == undefined ? "" : this.CustomerNature2)
+ "</span><input type='text' id='nameText" + this.Id + "' style='display:none' value='"
+ this.Name + "'/><input type='text' id='customerNatureText1" + this.Id + "' style='display:none' value='"
+ (this.CustomerNature1 == undefined ? "" : this.CustomerNature1) + "'/><input type='text' id='customerNatureText2" + this.Id + "' style='display:none' value='";
if (page.allowOption) {
str += (this.CustomerNature2 == undefined ? "" : this.CustomerNature2) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' onclick='edititem(this);' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' onclick='UpItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' onclick='DownItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' onclick='DeleteItem(" + this.Id + ")'><span class='glyphicon glyphicon-remove'></span></a>";
} else {
str += (this.CustomerNature2 == undefined ? "" : this.CustomerNature2) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' disabled='disabled' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-remove'></span></a>";
}
str += "</li>";
});
if (page.allowOption) {
str += "<li><input type='text' id='newItemName' class='mr-4'/><input type='text' id='newItemCustomerNature1' class='mr-4'/><input type='text' id='newItemCustomerNature2' class='mr-5' /><input type='button' class='btn btn-sm btn-outline-danger' onclick='addnewitem();' value='添加'/></li><ol>";
}
$("#divItems").html(str);
} else if (selectName == "资金用途") {
var str = "<ol><span style='min-width:180px;display: inline-block;'>资金用途</span><span style='width:180px;display: inline-block;'>账户类型</span>";
$.each(items, function (i) {
str += "<li><span id='nameSpan" + this.Id + "' style='width:180px;display: inline-block;'>" + this.Name
+ "</span><span id='shortNameSpan" + this.Id + "' style='min-width:180px;display: inline-block;'>" + (this.ShortName == undefined ? "" : this.ShortName)
+ "</span><input type='text' id='nameText" + this.Id + "' style='display:none' value='"
+ this.Name + "'/><select id='shortNameText" + this.Id + "' style='display:none' value='";
if (page.allowOption) {
str += (this.ShortName == undefined ? "" : this.ShortName) + "'><option value='全部' "+ ((this.ShortName == undefined ? "" : this.ShortName) == "全部" ? "selected" : "") + ">全部</option> <option value='付款账户' " + ((this.ShortName == undefined ? "" : this.ShortName) == "付款账户" ? "selected" : "") + ">付款账户</option> <option value='收款账户' " + ((this.ShortName == undefined ? "" : this.ShortName) == "收款账户" ? "selected" : "") + ">收款账户</option></select> <input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' onclick='edititem(this);' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' onclick='UpItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' onclick='DownItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' onclick='DeleteItem(" + this.Id + ")'><span class='glyphicon glyphicon-remove'></span></a>";
} else {
str += (this.ShortName == undefined ? "" : this.ShortName) + "'><option value='全部' " + ((this.ShortName == undefined ? "" : this.ShortName) == "全部" ? "selected" : "") + ">全部</option> <option value='付款账户' " + ((this.ShortName == undefined ? "" : this.ShortName) == "付款账户" ? "selected" : "") + ">付款账户</option> <option value='收款账户' " + ((this.ShortName == undefined ? "" : this.ShortName) == "收款账户" ? "selected" : "") + ">收款账户</option></select> <input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' disabled='disabled' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-remove'></span></a>";
}
str += "</li>";
});
if (page.allowOption) {
str += "<li><input type='text' id='newItemName' class='mr-4' /> <select id='newItemShortName' class='mr-4' > <option value='全部'>全部</option> <option value='付款账户'>付款账户</option> <option value='收款账户'>收款账户</option></select><input type='button' class='btn btn-sm btn-outline-danger ml-3' onclick='addnewitem();' value='添加'/></li><ol>";
}
$("#divItems").html(str);
}
else if (selectName == "累计转远期到期日类型") {
var str = "<ol><span style='min-width:140px;display: inline-block;'>前【 】月</span><span style='width:140px;display: inline-block;'>倒数第【 】个 </span><span style='width:140px;display: inline-block;'>交易日/星期【】</span><span style='width:140px;display: inline-block;'>前后调整</span>";
$.each(items, function (i) {
this.CustomerNature1 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName.split(',')[0];
this.CustomerNature2 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName.split(',')[1];
this.CustomerNature3 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName.split(',')[2];
this.isWeek=this.CustomerNature2!=0;
str += "<li><span id='nameSpan" + this.Id + "' style='width:140px;display: inline-block;'>" + this.Name
+ "</span><span id='customerNatureSpan1" + this.Id + "' style='min-width:140px;display: inline-block;'>" + (this.CustomerNature1 == undefined ? "" : this.CustomerNature1)
+ "</span><span id='customerNatureSpan2" + this.Id + "' style='min-width:140px;display: inline-block;'>" + (this.CustomerNature2 == undefined ? "" : this.CustomerNature2=="0"?"交易日":this.CustomerNature2=="1"?"星期一":this.CustomerNature2=="2"?"星期二":this.CustomerNature2=="3"?"星期三":this.CustomerNature2=="4"?"星期四":this.CustomerNature2=="5"?"星期五":this.CustomerNature2=="6"?"星期六":"星期日")
+ "</span><span id='customerNatureSpan3" + this.Id + "' style='min-width:140px;display: inline-block;'>" + (this.CustomerNature3 == undefined ? "" : (this.CustomerNature3=="0"?"向前":this.CustomerNature3=="1"?"向后":""))
+ "</span><input type='text' id='nameText" + this.Id + "' style='display:none' value='"
+ this.Name + "'/><input type='text' id='customerNatureText1" + this.Id + "' style='display:none' value='"
+ (this.CustomerNature1 == undefined ? "" : this.CustomerNature1) + "'/><select id='customerNatureText2" + this.Id + "' onchange='selectitem(" + this.Id + ")' style='display:none' value='";
if (page.allowOption) {
str += (this.CustomerNature2 == undefined ? "" : this.CustomerNature2) + "'> <option value='0' "+ ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "0" ? "selected" : "") + ">交易日</option> <option value='1' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "1" ? "selected" : "") + ">星期一</option> <option value='2' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "2" ? "selected" : "") + ">星期二</option><option value='3' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "3" ? "selected" : "") + ">星期三</option><option value='4' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "4" ? "selected" : "") + ">星期四</option><option value='5' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "5" ? "selected" : "") + ">星期五</option><option value='6' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "6" ? "selected" : "") + ">星期六</option><option value='7' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "7" ? "selected" : "") + ">星期日</option></select>"+EditRadio(this.Id,page.allowOption,this.isWeek,this.CustomerNature3)+" <input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' onclick='CheckDictionaryItem(this);' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' onclick='UpItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' onclick='DownItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' onclick='DeleteItem(" + this.Id + ")'><span class='glyphicon glyphicon-remove'></span></a>";
} else {
str += (this.CustomerNature2 == undefined ? "" : this.CustomerNature2) + "'> <option value='0' "+ ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "0" ? "selected" : "") + ">交易日</option> <option value='1' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "1" ? "selected" : "") + ">星期一</option> <option value='2' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "2" ? "selected" : "") + ">星期二</option><option value='3' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "3" ? "selected" : "") + ">星期三</option><option value='4' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "4" ? "selected" : "") + ">星期四</option><option value='5' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "5" ? "selected" : "") + ">星期五</option><option value='6' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "6" ? "selected" : "") + ">星期六</option><option value='7' " + ((this.CustomerNature2 == undefined ? "" : this.CustomerNature2) == "7" ? "selected" : "") + ">星期日</option></select>"+EditRadio(this.Id,page.allowOption,this.isWeek,this.CustomerNature3)+"<input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' disabled='disabled' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-remove'></span></a>";
}
str += "</li>";
});
if (page.allowOption) {
str += "<li><input type='text' id='newItemName' class='mr-4'/><input type='text' id='newItemCustomerNature1' class='mr-4'/><select id='newItemCustomerNature2' onchange='selectM()' class='mr-5' ><option value='0'>交易日</option> <option value='1'>星期一</option> <option value='2'>星期二</option><option value='3'>星期三</option><option value='4'>星期四</option><option value='5'>星期五</option><option value='6'>星期六</option><option value='7' >星期日</option></select> <label id='addRadio'></label> <input type='button' class='btn btn-sm btn-outline-danger' onclick='addnewitem();' value='添加'/></li><ol>";
}
$("#divItems").html(str);
}
else if (selectName == "标的资产分类") {
var str = "<ol><span style='min-width:180px;display: inline-block;'>标的代码</span><span style='width:180px;display: inline-block;'>标的资产品种</span>";
$.each(items, function (i) {
this.CustomerNature1 = this.ShortName == undefined || this.ShortName == "" ? "" : this.ShortName;
str += "<li><span id='nameSpan" + this.Id + "' style='width:180px;display: inline-block;'>" + this.Name
+ "</span><span id='customerNatureSpan1" + this.Id + "' style='min-width:180px;display: inline-block;'>" + (this.CustomerNature1 == undefined ? "" : this.CustomerNature1)
+ "</span><input type='text' id='nameText" + this.Id + "' style='display:none' value='"
+ this.Name + "'/><input type='text' id='customerNatureText1" + this.Id + "' style='display:none' value='";
if (page.allowOption) {
str += (this.CustomerNature1 == undefined ? "" : this.CustomerNature1) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' onclick='edititem(this);' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' onclick='UpItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' onclick='DownItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' onclick='DeleteItem(" + this.Id + ")'><span class='glyphicon glyphicon-remove'></span></a>";
} else {
str += (this.CustomerNature1 == undefined ? "" : this.CustomerNature1) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' disabled='disabled' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-remove'></span></a>";
}
str += "</li>";
});
if (page.allowOption) {
str += "<li><input type='text' id='newItemName' class='mr-4'/><input type='text' id='newItemCustomerNature1' class='mr-5' /><input type='button' class='btn btn-sm btn-outline-danger' onclick='addnewitem();' value='添加'/></li><ol>";
}
$("#divItems").html(str);
}
else {
var str = "<ol><span style='min-width:180px;display: inline-block;'>名称</span><span style='width:180px;display: inline-block;'>简称</span>";
if (selectName == "自定义交易要素") {
str = "<ol><span style='min-width:180px;display: inline-block;'>名称</span><span style='width:180px;display: inline-block;'>默认值</span>";
}
$.each(items, function (i) {
str += "<li><span id='nameSpan" + this.Id + "' style='width:180px;display: inline-block;'>" + this.Name
+ "</span><span id='shortNameSpan" + this.Id + "' style='min-width:180px;display: inline-block;'>" + (this.ShortName == undefined ? "" : this.ShortName)
+ "</span><input type='text' id='nameText" + this.Id + "' style='display:none' value='"
+ this.Name + "'/><input type='text' id='shortNameText" + this.Id + "' style='display:none' value='";
if (page.allowOption) {
str += (this.ShortName == undefined ? "" : this.ShortName) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' onclick='edititem(this);' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' onclick='UpItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' onclick='DownItem(" + this.Id + ")'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' onclick='DeleteItem(" + this.Id + ")'><span class='glyphicon glyphicon-remove'></span></a>";
} else {
str += (this.ShortName == undefined ? "" : this.ShortName) + "'/><input class='btn btn-sm btn-outline-danger' type='button' id='" + this.Id + "' disabled='disabled' value='修改'/>"
+ "<a href='#' id='up" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-up'></span></a> "
+ "<a href='#' id='down" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-arrow-down'></span></a> "
+ "<a href='#' id='delete" + this.Id + "' disabled='disabled'><span class='glyphicon glyphicon-remove'></span></a>";
}
str += "</li>";
});
if (page.allowOption) {
str += "<li><input type='text' id='newItemName' class='mr-4' /><input type='text' id='newItemShortName' class='mr-4' /> <input type='button' class='btn btn-sm btn-outline-danger ml-3' onclick='addnewitem();' value='添加'/></li><ol>";
}
$("#divItems").html(str);
}
CheckUnModifiableItem();
}
function EditRadio(id,allowOption,isWeek,value)
{
if(allowOption){
var s=" <label style='display:none' id='customerNatureText3"+id+"'> <input type='radio' name='r"+id+"' value='0' "+(value=='0'?'checked':'')+" />向前<input type='radio' name='r"+id+"' value='1' "+(value=='1'?'checked':'')+"/>向后</label>"
return s;
}else{
var s=" <label style='display:none' id='customerNatureText3"+id+"'> <input type='radio' name='r"+id+"' value='0' "+(value=='0'?'checked':'')+" disabled='disabled' />向前<input type='radio' name='r"+id+"' value='1' "+ (value=='1'?'checked':'')+" disabled='disabled'/>向后</label>"
return s;
}
}
function SelectDict(id, name) {
selectName = name;
$("#dictId").val(id);
$("#spanDict").html(name);
$.post("getDictionaryItems", { dictId: id }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.obj);
return;
}
ShowItems(data.obj);
});
}
function selectitem(id)
{
if ($("#customerNatureText2" + id).val()!="0"){
$("#customerNatureText3" + id).show();
}else{
$("#customerNatureText3" + id).hide();
}
}
function selectM(){
var isWeek =$("#newItemCustomerNature2").val();
if (isWeek!="0"){
$("#addRadio").html("<input type='radio' name='r' value='0' checked />向前<input type='radio' name='r' value='1'/>向后");
}else{
$("#addRadio").html("");
}
}
function addnewitem() {
var shortName = $("#newItemShortName").val();
if (selectName == "行业") {
if ($("#newItemCustomerNature1").val() == '' || $("#newItemCustomerNature2").val() == '') {
main.alert("客户性质不可为空");
return;
}
shortName = $("#newItemCustomerNature1").val() + "," + $("#newItemCustomerNature2").val();
}else if(selectName == "累计转远期到期日类型") {
if ($("#newItemCustomerNature1").val() == '' || $("#newItemName").val() == '') {
main.alert("所有值不可为空");
return;
}
if(!$.isNumeric($("#newItemCustomerNature1").val())||!$.isNumeric($("#newItemName").val())){
main.alert("填入值应为正整数");
return;
}
if($("#newItemCustomerNature2").val()==0 && (parseInt($("#newItemCustomerNature1").val()) < 1))
{
main.alert("类型为交易日时,倒数值为必须大于0!");
return;
}
if($("#newItemCustomerNature2").val()!=0 && (parseInt($("#newItemCustomerNature1").val()) <= 0 || parseInt($("#newItemCustomerNature1").val()) >= 8))
{
main.alert("类型为星期时,倒数值为1-7");
return;
}
shortName = $("#newItemCustomerNature1").val() + "," + $("#newItemCustomerNature2").val()+ ($("#newItemCustomerNature2").val()!=0 ? (","+ $("input[name='r']:checked").val()):"");
} else if (selectName == "标的资产分类") {
if ($("#newItemCustomerNature1").val() == '') {
main.alert("标的资产品种不可为空");
return;
}
shortName = $("#newItemCustomerNature1").val();
}
$.post("addDictionaryItem", { dictId: $("#dictId").val(), name: $("#newItemName").val(), shortName: shortName }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.msg);
return;
}
ShowItems(data.obj);
});
}
function edititem(obj) {
if (obj.value == "修改") {
$("#nameText" + obj.id).show();
$("#shortNameText" + obj.id).show();
$("#customerNatureText1" + obj.id).show();
$("#customerNatureText2" + obj.id).show();
if ($("#customerNatureText2" + obj.id).val()!="0"){
$("#customerNatureText3" + obj.id).show();
}
$("#nameSpan" + obj.id).hide();
$("#shortNameSpan" + obj.id).hide();
$("#customerNatureSpan1" + obj.id).hide();
$("#customerNatureSpan2" + obj.id).hide();
$("#customerNatureSpan3" + obj.id).hide();
obj.value = "提交";
} else {
var shortName = $("#shortNameText" + obj.id).val();
if (selectName == "行业") {
if ($("#customerNatureText1" + obj.id).val() == '' || $("#customerNatureText2" + obj.id).val() == '') {
main.alert("客户性质不可为空");
return;
}
shortName = $("#customerNatureText1" + obj.id).val() + "," + $("#customerNatureText2" + obj.id).val();
}else if(selectName == "累计转远期到期日类型") {
if ($("#customerNatureText1" + obj.id).val() == '' || $("#nameText" + obj.id).val() == '') {
main.alert("所有值不可为空");
return;
}
if(!$.isNumeric($("#customerNatureText1" + obj.id).val())||!$.isNumeric($("#nameText" + obj.id).val())){
main.alert("填入值应为正整数");
return;
}
if($("#customerNatureText2" + obj.id).val()==0 && (parseInt($("#customerNatureText1" + obj.id).val()) < 1))
{
main.alert("类型为交易日时,倒数值为必须大于0!");
return;
}
if($("#customerNatureText2" + obj.id).val()!=0 && (parseInt($("#customerNatureText1" + obj.id).val()) <= 0 || parseInt($("#customerNatureText1" + obj.id).val()) >= 8))
{
main.alert("类型为星期时,倒数值为1-7");
return;
}
shortName = $("#customerNatureText1" + obj.id).val() + "," + $("#customerNatureText2" + obj.id).val() +($("#customerNatureText2" + obj.id).val()!=0 ? (","+ $("input[name='r"+obj.id+"']:checked").val()):"");
}else if (selectName == "标的资产分类") {
if ($("#customerNatureText1" + obj.id).val() == '') {
main.alert("标的资产品种不可为空");
return;
}
shortName = $("#customerNatureText1" + obj.id).val();
}
$.post("editDictionaryItem", { itemId: obj.id, name: $("#nameText" + obj.id).val(), shortName: shortName }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.msg);
return;
}
$("#nameText" + obj.id).hide();
$("#shortNameText" + obj.id).hide();
$("#customerNatureText1" + obj.id).hide();
$("#customerNatureText2" + obj.id).hide();
$("#customerNatureText3" + obj.id).hide();
$("#nameSpan" + obj.id).show();
$("#shortNameSpan" + obj.id).show();
$("#customerNatureSpan1" + obj.id).show();
$("#customerNatureSpan2" + obj.id).show();
$("#customerNatureSpan3" + obj.id).show();
obj.value = "修改";
$("#nameSpan" + obj.id).html($("#nameText" + obj.id).val());
$("#shortNameSpan" + obj.id).html($("#shortNameText" + obj.id).val());
$("#customerNatureSpan1" + obj.id).html($("#customerNatureText1" + obj.id).val());
if(selectName == "累计转远期到期日类型"){
$("#customerNatureSpan2" + obj.id).html($("#customerNatureText2" + obj.id).val()=="0"?"交易日":$("#customerNatureText2" + obj.id).val()=="1"?"星期一":$("#customerNatureText2" + obj.id).val()=="2"?"星期二":$("#customerNatureText2" + obj.id).val()=="3"?"星期三":$("#customerNatureText2" + obj.id).val()=="4"?"星期四":$("#customerNatureText2" + obj.id).val()=="5"?"星期五":$("#customerNatureText2" + obj.id).val()=="6"?"星期六":"星期日");
$("#customerNatureSpan3" + obj.id).html($("#customerNatureText2" + obj.id).val()=="0" ? "" : $("input[name='r"+obj.id+"']:checked").val()=="0"?"向前":$("input[name='r"+obj.id+"']:checked").val()=="1"?"向后":"");
}else{
$("#customerNatureSpan2" + obj.id).html($("#customerNatureText2" + obj.id).val());
}
});
}
}
function CheckDictionaryItem(obj){
if(selectName == "累计转远期到期日类型"){
$.post("CheckDictionaryItem", { itemId: obj.id }, function (data, textStatus) {
if (data.success) {
main.confirm("已有交易配置该选项是否继续更改?", function () {
edititem(obj);
});
}else{
edititem(obj);
}
});
}else{
edititem(obj);
}
}
function DeleteItem(id) {
if (confirm('删除后不可恢复,确定要删除吗?')) {
$.post("DeleteDictionaryItem", { itemId: id }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.obj);
return;
}
ShowItems(data.obj);
});
}
}
function UpItem(id) {
$.post("UpDictionaryItem", { itemId: id }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.msg);
return;
}
ShowItems(data.obj);
});
}
function DownItem(id) {
$.post("DownDictionaryItem", { itemId: id }, function (data, textStatus) {
this;
if (data.success == false) {
alert(data.msg);
return;
}
ShowItems(data.obj);
});
}
function CheckUnModifiableItem() {
for (var i = 0; i < unModifiable.length; i++) {
var selector = "li > span:contains(" + unModifiable[i] + ")";
if ($(selector).length == 0) {
continue;
}
var itemId = $(selector).attr("id").replace("nameSpan","");
var modifySeletor = "#" + itemId;
var deleteSeletor = "#delete" + itemId;
$(modifySeletor).prop("disabled", true);
$(deleteSeletor).hide();
}
}
</script>
}
<div class="container">
<div class="row m-0">
<div class="col-auto" style="width:300px;min-height: 450px; ">
<h3>数据字典维护</h3>
<div class="yc-panel">
@foreach (string s in Model.Keys)
{
foreach (Dictionary dict in Model[s])
{
<a href="#" class="list-group-item" onclick="SelectDict(@dict.Id, '@dict.Name');">@dict.Name</a>
}
}
</div>
</div>
<div class="col" style="min-height: 450px; ">
<input type="hidden" id="dictId" /><h3 id="spanDict"></h3>
<div id="divItems" class="yc-panel"></div>
</div>
</div>
</div>