123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- @{
- ViewBag.Title = "表具类型管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- initControl();
- })
- //初始化控件
- function initControl() {
- //表类型
- $("#NBDevManufacturerID").ComboBoxTree({
- url: "/NBManage/NBMeterTypeManage/GetDevManufacturer",
- id: "ItemValue",
- text: "ItemName",
- description: "==请选择==",
- height: "200px"
- });
- $("#NBDevManufacturerCodeID").val(keyValue == "" ? "0" : keyValue);
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "/NBManage/NBDevManufacturerCodeManage/GetEntity",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- }
- });
- }
- }
- //保存表单
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- //postData 格式化 将 替换为 ""
- for (var i in postData) {
- if (postData[i] == " ") {
- postData[i] = "";
- }
- }
- $.SaveForm({
- url: "/NBManage/NBDevManufacturerCodeManage/SaveForm?keyValue=" + keyValue,
- param: { "keyValue": keyValue, "strFrom": JSON.stringify(postData) },
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").resetSelection();
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <style type="text/css">
- .form .formTitle {
- width: 100px;
- }
- </style>
- <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <th class="formTitle">NB设备厂商名称<font face="宋体">*</font></th>
- <td class="formValue">
- <div id="NBDevManufacturerID" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull" errormsg="请选择设备厂商名称">
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle">NB设备厂商ID<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="NBDevManufacturerCodeName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入NB设备类型" placeholder="请输入NB设备厂商ID" />
- </td>
- <input id="NBDevManufacturerCodeID" class="form-control" type="hidden" />
- </tr>
- </table>
- </div>
|