155 lines
5.7 KiB
Plaintext
155 lines
5.7 KiB
Plaintext
@model WX.CRM.Model.Entity.EarlyWarningUser
|
|
@{ ViewBag.Title = "Edit";
|
|
Layout = "~/Views/Shared/_form.cshtml";
|
|
}
|
|
@{
|
|
string isok = ViewBag.isOk == null ? "1" : Convert.ToString(ViewBag.isOk);
|
|
}
|
|
<script>
|
|
var isOk = "@Html.Raw(isok)";
|
|
</script>
|
|
<div class="layui-form-item" style="margin-top:20px;">
|
|
<label class="layui-form-label">
|
|
企业微信
|
|
</label>
|
|
<div class="layui-input-block my_form_iterm">
|
|
<input id="Type" name="Type" value="2" style="display:none" />
|
|
<input id="Code" name="Code" value="@Model.Code" style="display:none" />
|
|
<input id="AppId" name="AppId" value="@Model.AppId" style="display:none" />
|
|
<input id="CropId" name="CropId" value="@Model.CropId" style="display:none" />
|
|
<input autocomplete="off" class="layui-input" data-val="true" id="CropName" lay-reqtext="名称不可为空!" lay-verify="required" name="CropName" type="text" value="@Model.CropName" readonly="readonly">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top:20px;">
|
|
<label class="layui-form-label">
|
|
业务线
|
|
</label>
|
|
<div class="layui-input-block my_form_iterm">
|
|
|
|
<select name="DeptId" id="DeptId" lay-verify="required" style="height: 35px; width: 100%" readonly ="readonly">
|
|
@foreach (var item in ViewBag.deptList as List<SelectListItem>)
|
|
{
|
|
<option value="@item.Value" selected="@item.Selected">@item.Text</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top:20px;">
|
|
<label class="layui-form-label">
|
|
被监控人员
|
|
</label>
|
|
<div class="layui-input-block my_form_iterm">
|
|
<div id="Participant" style="width: 100%; display: flex;"></div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top:20px;">
|
|
<label class="layui-form-label">
|
|
通知人员账户
|
|
</label>
|
|
<div class="layui-input-block my_form_iterm">
|
|
<textarea id="WxWorkId" cols="90" rows="6" name="WxWorkId" style="width:100%;height:300px;" lay-reqtext="通知人员账户不可为空!" lay-verify="required">@Model.WxWorkId</textarea>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block my_form_iterm">
|
|
<button class="layui-btn layui-btn-ok" lay-submit lay-filter="formDemo">保存</button>
|
|
<button onclick="parent.Closed()" type="button" class="layui-btn layui-btn-primary">取消</button>
|
|
</div>
|
|
</div>
|
|
@if (isok == "0")
|
|
{
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label erro_msg">错误提示:</label>
|
|
<div class="layui-input-block my_form_iterm erro_msg">
|
|
@Html.Raw(ViewBag.Msg)
|
|
</div>
|
|
</div>
|
|
}
|
|
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
|
|
<script>
|
|
var participantTree;
|
|
var form;
|
|
var participantIds = [];
|
|
layui.use('form', function () {
|
|
var form = layui.form;
|
|
var layer = layui.layer;
|
|
InitInneruserTree();
|
|
//监听提交
|
|
form.on('submit(formDemo)', function (data) {
|
|
var eid = '@ViewBag.eid';
|
|
if (isOk == "1") {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '@Html.Raw(ViewBag.webapi + "Api/Warnning/AddWarnUser?eid=")' + eid,
|
|
data: JSON.stringify(data.field),
|
|
dataType: "json",
|
|
contentType: "application/json",
|
|
success: function (da) {
|
|
if (da.code == 0) {
|
|
layer.msg("操作成功", { icon: 1 });
|
|
parent.TableReload();
|
|
parent.Closed();
|
|
} else {
|
|
layer.msg(da.message, { icon: 2 });
|
|
}
|
|
},
|
|
error: function () {
|
|
layer.msg('操作失败!', { icon: 2 });
|
|
}
|
|
});
|
|
return false;
|
|
} else {
|
|
layer.msg('系统错误!请关闭编辑页重试!', { icon: 2 });
|
|
return false;
|
|
}
|
|
});
|
|
//各种基于事件的操作,下面会有进一步介绍
|
|
});
|
|
function InitInneruserTree() {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: '/Inneruser/GetInneruserTree',
|
|
success: function (da) {
|
|
participantTree = $.extend(true, [], da);
|
|
renderSelectParticipant(participantTree, [@Html.Raw(Model.Participant)]);
|
|
}
|
|
});
|
|
}
|
|
function renderSelectParticipant(participantTree, check) {
|
|
var optionsParticipant = {
|
|
el: '#Participant',
|
|
name: 'Participant',//表单的name属性
|
|
//clickClose: true, //单选完关闭下拉框
|
|
filterable: true, //搜索
|
|
direction: 'down', // 展开方向 下
|
|
//radio: false, //单选
|
|
height: '400px',
|
|
tree: {
|
|
show: true,
|
|
showFolderIcon: true,
|
|
showLine: true,
|
|
expandedKeys: true
|
|
},
|
|
toolbar: {//工具条,全选,清空,反选,自定义
|
|
show: true,
|
|
list: [
|
|
'CLEAR'
|
|
]
|
|
},
|
|
on: function (data) {
|
|
var addids = [];
|
|
for (var i = 0; i < data.arr.length; i++) {
|
|
addids.push(data.arr[i].value);
|
|
}
|
|
participantIds = addids;
|
|
},
|
|
data: participantTree,
|
|
initValue: check
|
|
};
|
|
var selectParticipant = xmSelect.render(optionsParticipant);
|
|
return selectParticipant;
|
|
}
|
|
</script>
|
|
|
|
|