| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- @using ContractService
- @using ContractService.Configuration
- @using ContractService.Authorization
- @using ContractService.Views.Shared.Modals
- @using ContractService.Views.Shared.SearchForm
- @using ContractService.Views.Shared.Query
- @using ContractService.Views.Shared.Table
- @{
- ViewBag.Title = "企业信息维护";
- string activeMenu = PermissionNames.PagesClientMgCompanyMg; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- var searchForm = new SearchFormViewModel(new List<SearchItem>()
- {
- new SearchItem("name","企业名称"),
- new SearchItem("displayName","系统显示名称"),
- }, "search-form", false);
- var table = new TableViewModel(IwbConsts.ApiAppUrl + "ClientCompany/GetAll", activeMenu, searchForm)
- .SetFields(new List<FieldItem>()
- {
- new FieldItem("name", "企业名称"),
- new FieldItem("displayName", "系统显示名称"),
- //new FieldItem("description", "企业描述"),
- new FieldItem("masterStaffName", "企业负责人"),
- });
- var inputs = new List<Input>()
- {
- new InputHide("id"),
- new Input("name", "企业名称").SetNotRequired(),
- new Input("displayName", "系统显示名称").SetNotRequired(),
- new InputTextarea("description", "企业描述").SetNotRequired(),
- };
- var inputs_staff = new List<Input>()
- {
- new Input("code", "员工编号").SetDivClass("form-group row req"),
- new Input("staffName", "员工姓名").SetDivClass("form-group row req"),
- new Input("email", "电子邮箱").SetDivClass("form-group row req"),
- new Input("phoneNumber", "联系号码").SetDivClass("form-group row req"),
- new InputDate("birthday", "出生日期").SetNotRequired(),
- new Input("idCard", "身份证号").SetNotRequired(),
- new Input("phoneNumber2", "备用号码").SetNotRequired(),
- new InputTextarea("profile", "员工描述").SetNotRequired(),
- };
- var modalBody = new ModalBodyViewModel()
- .AddTab("company", "企业信息", inputs)
- .AddTab("staff", "企业负责人", inputs_staff);
- var modal = new ModalViewModel("企业").SetBody(modalBody);
- var modal_master = new ModalViewModel("变更企业负责人", "", new ModalBodyViewModel(new List<Input>()
- {
- new InputHide("no"),
- new AjaxSelect("staffNo","企业负责人","MasterStaff","","query_staff","staffNo")
- }, "form-master"), "modal-master");
- }
- @section css{
- }
- @Html.Partial("Table/_Table", table)
- @section modal{
- <!--Modal Start-->
- @Html.Partial("Modals/_Modal", modal)
- @Html.Partial("Modals/_Modal", modal_master)
- @Html.Partial("Query/_Staff", new QuerySearchModel("query_staff", "staffNo").SetOriginField("id").SetSearchFun("SetCompanyQueryFun()").SetAjaxSelectName("name"))
- <!--Modal End-->
- }
- @section scripts
- {
- <script type="text/javascript">
- var $table;
- $(function () {
- $table = LoadTable();
- var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
- funs["btnCreate"] = function () {
- $('#modal #id_company').tab("show");
- $('#modal #id_staff').attr('data-toggle', 'tab').css("display", "block");
- $('#modal .req').find('label').addClass('iwb-label-required');
- $('#modal .req').find('.form-control').addClass('required');
- BtnCreate({ data: { id: "" } });
- }
- funs["btnUpdate"] = function () {
- $('#modal #id_company').tab("show");
- $('#modal #id_staff').removeAttr('data-toggle').css("display", "none");
- $('#modal .req').find('label').removeClass('iwb-label-required');
- $('#modal .req').find('.form-control').removeClass('required');
- BtnUpdate({ disabled: "" });
- };
- funs["btnMasterStaff"] = function (url) {
- var row = $table.bootstrapTable("getSelections")[0];
- if (row) {
- $('#staffNo').data('column-key', row.id)
- OpenModal({
- url: url,
- modal: "modal-master",
- data: { no: row.id },
- table: $table
- });
- }
- };
- });
- function SetCompanyQueryFun() {
- return { "KeyField": "company", "KeyWords": $('#modal-master #no').val() }
- }
- </script>
- <!--格式化-->
- <script id="formatter-script" type="text/javascript">
- function TypeFormatter(v) {
- var name = $('#hid-type option[value="' + v + '"]').text();
- switch (v) {
- case 0:
- return '<span class="label sm label-danger">' + name + '</span>';
- default:
- return '<span class="label sm label-info">' + name + '</span>';
- }
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-type">
- <option value=""></option>
- </select>
- @*@Html.DropDownList("hid-type", type)*@
- </section>
|