TG.WXCRM.V4/WEB/Views/Ord/Memo/SaleMemoAdd.cshtml

140 lines
5.1 KiB
Plaintext

@using WX.CRM.Model.Enum;
@model WX.CRM.Model.Entity.ORD_SALEMEMO
@{
ViewBag.Title = "添加工单";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<link href="~/Content/main.css" rel="stylesheet" />
<div style="height:100%;width:100%; overflow-y:auto;">
@Html.Action("CustomerInfo", "CustomerUC", new { CustomerId = Request.QueryString["resid"] })
<form id="CreateForm">
@Html.ValidationSummary(true)
<table class="layui-table normaltable">
<thead>
<tr>
<td colspan="3" class="style1">
销售工单
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
业务类型
</td>
<td>
@Html.DropDownList("BUSINESSID", ViewBag.SaleMemoType as IList<SelectListItem>, new { })
@Html.Hidden("RESID", Request.QueryString["resid"])
</td>
<td width="70px">&nbsp;</td>
</tr>
@Html.Action("MemoTypeAllUC", "Control", new { bunissId = (int)WX.CRM.Model.Enum.EnumMemoType.销售工单 })
<tr style="display:none">
<td>
是否添加任务
</td>
<td>
<input type="checkbox" name="CKTask" id="CKTask"><label for="CKTask">&nbsp;是</label>
&nbsp;&nbsp;&nbsp;
@Html.Action("TimeUC", "Control", "")
</td>
<td></td>
</tr>
<tr>
<td>
工单
</td>
<td>
@Html.TextAreaFor(m => m.STRCONTENT, new { style = "width:500px;height:60px;" })
</td>
<td>
@Html.ValidationMessageFor(m => m.STRCONTENT)
</td>
</tr>
<tr>
<td class="tdCenter" colspan="3">
<input type="submit" id="BtnAdd" value=" 添加工单 " class="btn btn-primary" name="BtnAdd">
&nbsp;&nbsp;&nbsp;
<input type="button" id="BtnClose" value=" 关 闭 " class="btn btn-danger">
</td>
</tr>
</tbody>
</table>
</form>
</div>
<input type="hidden" id="hidsubTypeId" value="" />
<script>
$(function () {
var _memotypeid = "";
var _memoSubtypeid ="";
var type='@Request.QueryString["CallType"]';
if (type == "0")
{
_memotypeid = $("#MEMOTYPEID option:contains('销售服务工单')").val();
$("#BUSINESSID").val("0");
}
else
{
_memotypeid = $("#MEMOTYPEID option:contains('销售服务工单')").val();
$("#BUSINESSID").val("1");
}
if (_memotypeid != null)
{
$("#MEMOTYPEID").val(_memotypeid);
BindSub();
if (type == "0") {
_memoSubtypeid = $("#MEMOSUBTYPEID option:contains('销售服务工单')").val();
}
else {
_memoSubtypeid = $("#MEMOSUBTYPEID option:contains('销售服务工单')").val();
}
if (_memoSubtypeid != null) {
$("#MEMOSUBTYPEID").val(_memoSubtypeid);
}
}
$("#BtnClose").click(function () {
window.parent.$("#modalwindow").window('close');
});
$("#BtnAdd").click(function () {
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "/Ord/Memo/SaleMemoCreate",
type: "Post",
data: $("#CreateForm").serialize(),
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
window.parent.frameReturnByMes(data.message);
window.parent.$("#modalwindow").window('close');
TopWindowReload();
}
else {
$.messager.alert("错误", data.message, "error")
}
}
});
}
return false;
});
});
function TopWindowReload() {
var act = getQueryString("act");
if (act == "callend") {
var resid = getQueryString("resid");
var iframes = window.parent.$("iframe");
var reloadUrl = "/Csvr/CustomerInfo/CustomerDetail?resid=" + resid;
$(iframes).each(function (m, n) {
if (n.src.indexOf(reloadUrl) >= 0) {
$(n)[0].contentWindow.location.reload(true);
}
});
}
else {
window.parent.MemoloadAll(1);
}
}
</script>