69 lines
2.4 KiB
Plaintext
69 lines
2.4 KiB
Plaintext
@model BaseOUDAL.SystemUser
|
|
@{
|
|
ViewBag.Title = "用户信息 | 编辑";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
}
|
|
|
|
@section JS{
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
SetAceDropDown(false);
|
|
});
|
|
|
|
//增加品种为空,也就是用户一个品种都不能操作的场景
|
|
//VarietyIds = "0"代表用户一个品种都不能操作
|
|
//VarietyIds为空代表客户默认全品种操作
|
|
function saveUserVarirty() {
|
|
var data = {
|
|
UserId: $("#UserNames").val(),
|
|
VarietyIds: $("#VarietyIds").val() && $("#VarietyIds").val().length ? $("#VarietyIds").val().join(',') : "0"
|
|
};
|
|
main.post("/system/SaveUserVarietyEdit", data).done(
|
|
function (res) {
|
|
window.parent.reloadcredit();
|
|
layer.closeMe();
|
|
});
|
|
}
|
|
|
|
function selallVariety(obj) {
|
|
var checkall = $(obj).prop("checked");
|
|
$("#VarietyIds").find("option").prop("selected", checkall);
|
|
$("#VarietyIds").trigger("chosen:updated");
|
|
}
|
|
|
|
</script>
|
|
}
|
|
<div class="yc-panel">
|
|
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel" for="UserNames">账号名称</label>
|
|
<select id="UserNames" name="UserNames">
|
|
@foreach (var item in SystemController.GetUserNames())
|
|
{
|
|
<option value="@(item.Value)" @(Model.Id == Convert.ToInt32(item.Value) ? "selected" : "")>@(item.Text)</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel" for="VarietyId"></label>
|
|
<label>
|
|
<input type="checkbox" onclick="selallVariety(this)" name="IsAll" id="IsAll" value="true" @(ViewBag.IsAll ? "checked": "") />
|
|
全部品种
|
|
</label>
|
|
</div>
|
|
<div class="form-group col-md-6" id="divVarietyIds">
|
|
<label class="formlabel" for="VarietyIds">品种</label>
|
|
<select class="chosen-select" id="VarietyIds" multiple>
|
|
@foreach (var item in varietyController.GetAllvariety())
|
|
{
|
|
<option value="@(item.Value)" @(Model.VarietyIdList.Contains(Convert.ToInt32(item.Value)) ? "selected" : "")>@(item.Text)</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="form-buttons">
|
|
@MyControls.Btn("保存", "saveUserVarirty()")
|
|
@MyControls.Btn("关闭", "layer.closeMe()")
|
|
</div>
|