| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- @using ShwasherSys
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Views.Shared.New.Modals
- @using ShwasherSys.Views.Shared.New.Table
- @{
- ViewBag.Title = "设备固定资产维护";
- string activeMenu = PermissionNames.PagesCompanyDieMaintenanceFixedAsset; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- List<SelectListItem> faType = ViewBag.FixedAssetType;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("no","资产编号"),
- new SearchItem("name","资产名称"),
- new SearchItem("model","资产类型",FiledType.S,ExpType.Equal).SetSearchItem(faType,isAddBlank:false),
- },"search-form",false);
- var table = new TableViewModel( "/api/services/app/FixedAsset/GetAll", activeMenu, searchForm)
- .SetFields(new List<FieldItem>()
- {
- new FieldItem("no", "资产编号"),
- new FieldItem("name", "资产名称"),
- new FieldItem("model", "资产类型","FaTypeFormatter"),
- });
- }
- @section css{
-
- }
- @Html.Partial("New/Table/_Table", table)
- @section modal{
- <!--Main Modal-->
- @{
- var modal = new ModalViewModel("资产", new ModalBodyViewModel(new List<Input>()
- {
- new InputHide("id"),
- new InputHide("no", "资产编号"),
- new Input("name", "资产名称"),
- new Input("model", "资产类型").SetSelectOptions(faType,isAddBlank:false),
- new InputTextarea("description", "资产描述").SetNotRequired(),
- }));
- }
- @Html.Partial("New/Modals/_Modal", modal)
- }
- @section scripts
- {
- <script type="text/javascript">
- var $table;
- $(function () {
- $table = LoadTable();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- funs["btnCreate"] = function() { BtnCreate({ data: { id: "" } }); }
- funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
- });
- </script>
- <!--格式化-->
- <script id="formatter-script" type="text/javascript">
- function FaTypeFormatter(v) {
- var name = $('#hid-type option[value="' + v + '"]').text();
- return name;
- //switch (v) {
- // case 0:
- // return '<span class="label label-danger">' + name +'</span>';
- // default:
- // return '<span class="label label-info">' + name +'</span>';
- //}
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-type">
- <option value=""></option>
- </select>
- @Html.DropDownList("hid-type", faType)
- </section>
|