ComplianceServer/oldcode/WEB/Views/Csvr/RelationCustomer/Add.cshtml

92 lines
3.7 KiB
Plaintext

@model WX.CRM.Model.Entity.CSVR_RELATIONCUSTOMER
@{
ViewBag.Title = "Add";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<div class="formContent">
@Html.Action("CustomerInfo", "CustomerUC", new { resId = Model.map_RESID })
@using (Html.BeginForm("Add", "RelationCustomer", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable setTextWidth300" style="margin:10px 0 10px 0; border-top:2px solid #E2EDFE; border-bottom:2px solid #E2EDFE;">
<tbody>
<tr>
<td width="60px" style="width:100px;">@Html.LabelFor(m => m.map_RELATIONRESID)</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.map_RELATIONRESID)
@Html.HiddenFor(m => m.map_RESID)
</td>
<td width="120px">@Html.ValidationMessageFor(m => m.map_RELATIONRESID)</td>
</tr>
<tr>
<td width="60px" style="width:100px;">@Html.LabelFor(m => m.map_MEMO)</td>
<td style="width:310px">@Html.TextAreaFor(m => m.map_MEMO)</td>
<td width="120px">@Html.ValidationMessageFor(m => m.map_MEMO)</td>
</tr>
<tr>
<td style="width:200px;"><input id="btnSearch" type="button" value="查询" /></td>
<td style="width:200px;"><input id="relation" type="button" value="关联" disabled="disabled" /></td>
<td></td>
</tr>
</tbody>
</table>
}
<div id="showInfo" style="display:none;">
@*@Html.Action("CustomerInfo", "CustomerUC", new { resId = Model.map_RESID })*@
</div>
</div>
<script type="text/javascript">
$(function () {
$("#btnSearch").click(function () {
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "/Csvr/RelationCustomer/checkResid",
type: "Post",
data: { resid: $("#map_RELATIONRESID").val() },
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
$('#relation').removeAttr("disabled");
$.post("/Csvr/CustomerUC/CustomerInfo", { ResId: data.value }, function (gdata) {
$("#showInfo").show().html(gdata);
}, "text");
}
else {
$('#relation').attr('disabled', "true");
$.messageBox5s('提示', data.message);
// window.parent.frameReturnByMes(data.message);
}
}
});
}
return false;
});
$("#map_RELATIONRESID").keyup(function () {
$('#relation').attr('disabled', "true");
})
$("#relation").click(function () {
//var userId = $("#uc_org_ids").val();
//$("#map_RECEIVEDUSERID").val(userId);
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "/Csvr/RelationCustomer/Add",
type: "Post",
data: $("#CreateForm").serialize(),
dataType: "json",
loading: true,
success: function (data) {
$.messageBox5s('提示', data.message);
}
});
}
return false;
});
});
</script>