123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- @{
- ViewBag.Title = "表设备管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- initControl();
- })
- //初始化控件
- function initControl() {
-
- //厂商编号
- $("#ManufacturerCode").ComboBoxTree({
- url: "/PipeNetworkManage/Meter/GetManufacturerCode",
- id: "ItemValue",
- text: "ItemName",
- description: "==请选择==",
- height: "200px"
- });
- $("#SecondaryWaterSupplyId").val(keyValue == "" ? "0" : keyValue);
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "/SecondaryWaterSupply/Device/GetDeviceById",
- param: { deviceId: 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: "/SecondaryWaterSupply/Device/SaveDevice?keyValue=" + keyValue,
- param: { "keyValue": keyValue, "strDevice": JSON.stringify(postData) },
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").resetSelection();
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- };
- // 调出百度地图
- // 添加
- function btnMap() {
- dialogOpen({
- id: "BaiduMap",
- title: '添加测点',
- url: '/SecondaryWaterSupply/Device/BaiduMap',
- width: "1100px",
- height: "700px",
- callBack: function (iframeId) {
- top.frames[iframeId].AcceptClick(function callback(result) {
- $("#Longitude").val(result.split('|')[0]);
- $("#Latitude").val(result.split('|')[1]);
- });
- }
- });
- }
- </script>
- <style type="text/css">
- .form .formTitle {
- width: 80px;
- }
- </style>
- <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <th class="formTitle">泵房名称<font face="宋体">*</font></th>
- <td class="formValue" colspan="3">
- <input id="PumpHouseName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="泵房名称不能为空" placeholder="请输入泵房名称" />
- </td>
- </tr>
- <tr>
- <input id="SecondaryWaterSupplyId" class="form-control" type="hidden" />
- <th class="formTitle">泵站编码<font face="宋体">*</font></th>
- <td class="formValue" colspan="3">
- <input id="PumpingStationNumber" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="泵站编码不能为空" placeholder="请输入泵站编码" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">厂商编码<font face="宋体">*</font></th>
- <td class="formValue" colspan="3">
- <div id="ManufacturerCode" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull" errormsg="请选择厂商编码">
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle">经纬度</th>
- <td class="formValue">
- <input id="Longitude" type="text" class="form-control" readonly/>
- </td>
- <td>
- <input id="Latitude" type="text" class="form-control" readonly/>
- </td>
- <td>
-
- <a id="lr-add" class="btn btn-primary " onclick="btnMap()"><i class="fa fa-plus"></i> 地图</a>
- </td>
- </tr>
- </table>
- </div>
|