123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- @{
- ViewBag.Title = "分类管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- var parentId = request('parentId');
- $(function () {
- initControl();
- })
- //初始化控件
- function initControl() {
- //上级
- $("#ParentId").ComboBoxTree({
- url: "../../SystemManage/DataItem/GetTreeJson",
- description: "==请选择==",
- height: "230px"
- });
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "../../SystemManage/DataItem/GetFormJson",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- }
- });
- } else {
- $("#ParentId").ComboBoxTreeSetValue(parentId);
- }
- }
- //保存表单
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- if (postData["ParentId"] == "") {
- postData["ParentId"] = 0;
- }
- $.SaveForm({
- url: "../../SystemManage/DataItem/SaveForm?keyValue=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- top.DataItemSort.$("#gridTable").resetSelection();
- top.DataItemSort.$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <div style="margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <th class="formTitle">上级</th>
- <td class="formValue">
- <div id="ParentId" type="selectTree" class="ui-select"></div>
- </td>
- </tr>
- <tr>
- <td class="formTitle">名称<font face="宋体">*</font></td>
- <td class="formValue">
- <input id="ItemName" type="text" onblur="$.ExistField(this.id,'../../SystemManage/DataItem/ExistItemName')" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">编号<font face="宋体">*</font></td>
- <td class="formValue">
- <input id="ItemCode" type="text" onblur="$.ExistField(this.id,'../../SystemManage/DataItem/ExistItemCode')" class="form-control" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">排序<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="SortCode" type="text" class="form-control" isvalid="yes" checkexpession="Num" />
- </td>
- </tr>
- <tr>
- <th class="formTitle" style="height: 37px;"></th>
- <td class="formValue">
- <div class="checkbox">
- <label>
- <input id="IsTree" type="checkbox" />
- 树型
- </label>
- <label>
- <input id="EnabledMark" type="checkbox" checked="checked" />
- 有效
- </label>
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle" valign="top" style="padding-top: 4px;">备注
- </th>
- <td class="formValue">
- <textarea id="Description" class="form-control" style="height: 70px;"></textarea>
- </td>
- </tr>
- </table>
- </div>
|