TG.WXCRM.V4/WEB/Views/Csvr/CustomerUC/FastMemo.cshtml

94 lines
3.7 KiB
Plaintext

@using WX.CRM.Model.QueryMap;
@{
Layout = null;
var info = ViewBag.CustomerInfo as CustomerInfo;
}
<div class="content_div">
<div id="fastmemotip" style="height:30px; line-height:30px; padding:10px; cursor:pointer; color:#ccc;"><span style="font-size:15px;">+</span><span>快速创建</span></div>
<div style="padding:10px;display:none;" id="fastmemodiv">
<input type="text" id="fastmemocontent" name="fastmemocontent" style="width:500px; height:30px; line-height:30px; vertical-align:top;" />
<select id="fastmemotype" style="height:30px; line-height:30px; vertical-align:top; margin:0 10px;"></select>
<input type="button" class="layui-btn layui-btn-sm layui-btn-normal" value="确定" id="fastmemosave" style="vertical-align:top" />
<input type="button" class="layui-btn layui-btn-sm layui-btn-primary" value="取消" id="fastmemoclose" style="vertical-align:top;" />
</div>
</div>
<script type="text/javascript">
$(function () {
//SaleMemoCreate,PurposeMemoCreate,ServiceMemoCreate,SpecialMemoCreate
//var fastMemoData = [{ TYPE: 'SaleMemoCreate', MEMONAME: '销售服务工单', MEMOTYPEID: 902, MEMOSUBTYPEID: 9021, MEMOSTYLEID: 600006344 }, { TYPE: 'ServiceMemoCreate', MEMONAME: '合规工单', MEMOTYPEID: 128, MEMOSUBTYPEID: 1288, MEMOSTYLEID: 600006344 }];
var fastMemoData = '@Html.Raw(ViewBag.fastmemo.ToString())';
if (fastMemoData == '')
return;
var fastMemoObj = jQuery.parseJSON(fastMemoData);
//console.log(fastMemoObj);
$.each(fastMemoObj, function (m, n) {
//console.log(n);
$("#fastmemotype").append(new Option(n.MEMONAME, n.MEMOSUBTYPEID));
});
$("#fastmemosave").click(function () {
var fastmemotypevalue = $("#fastmemotype").val();
//alert(fastmemotypevalue);
$.each(fastMemoObj, function (m, n) {
//console.log(n);
if (fastmemotypevalue == n.MEMOSUBTYPEID) {
n.BUSINESSID = 1;
n.RESID = '@info.RequsetResId';
n.STRCONTENT = $("#fastmemocontent").val();
if (n.STRCONTENT == '') {
$.messager.alert("错误", '工单内容不能为空!', "error")
return;
}
$.r_ajax({
url: "/Ord/Memo/" + n.TYPE,
type: "Post",
data: n,
dataType: "json",
success: function (data) {
if (data.type == 1) {
$("#fastmemoclose").click();
//$.messager.alert("提示", data.message, "info");
memoReload();
layui.use('layer', function () {
var layer = layui.layer;
layer.msg(data.message);
});
}
else {
$.messager.alert("错误", data.message, "error")
}
}
});
}
});
});
$("#fastmemotip").click(function () {
$(this).hide();
$("#fastmemodiv").show();
//document.getElementById("fastmemocontent").focus();
$("#fastmemocontent")[0].focus();
});
$("#fastmemoclose").click(function () {
$("#fastmemocontent").val('');
$("#fastmemodiv").hide();
$("#fastmemotip").show();
});
});
</script>