| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- @{
- ViewBag.Title = "设备管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- initControl();
- })
- //初始化控件
- function initControl() {
- //$.ajax({
- // type: "GET",
- // url: "../../WaterWellManage/EquipmentManagement/SearchOrganize",//路径
- // data: {},
- // success: function (result) {
- // if (result !== "") {
- // var data = JSON.parse(result);
- // var str = "<ul>";
- // $.map(data, function (item) {
- // if (item.ShortName.trim() !== "")
- // {
- // str += "<li data-value=" + item.EnCode + ">" + item.ShortName.trim() + "</li>";
- // }
- // })
- // str += "</ul>";
- // $("#ManufacturerCode").html(str);
- // $("#ManufacturerCode").ComboBox({
- // description: "==请选择区域(单位)==",
- // height: "170px"
- // });
- // }
- // }
- //});
- if (keyValue !== "") {
- // var WaterWellName = request('WaterWellName');
- var WaterWellName = $.currentIframe().$("#pointGridTable").jqGridRowValue("WaterWellName")
- var ManufacturerCode = $.currentIframe().$("#pointGridTable").jqGridRowValue("ManufacturerCode");
- var WaterWellCode = $.currentIframe().$("#pointGridTable").jqGridRowValue("WaterWellCode");
- var positon = $.currentIframe().$("#pointGridTable").jqGridRowValue("Lng") + "|" + $.currentIframe().$("#pointGridTable").jqGridRowValue("Lat");
- $("#WaterWellName").val(WaterWellName);
- $("#ManufacturerCode").val(ManufacturerCode);
- $("#WaterWellCode").val(WaterWellCode);
- $("#MapPosition").val(positon);
- }
- }
- //保存表单
- 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: "../../WaterWellManage/EquipmentManagement/SaveEMCForm",
- param: {"keyValue": keyValue, "data": JSON.stringify(postData) },
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#pointGridTable").resetSelection();
- $.currentIframe().$("#pointGridTable").trigger("reloadGrid");
- $.currentIframe().GetTree();
- }
- })
- }
- // 调出百度地图
- // 添加
- function btnMap() {
- dialogOpen({
- id: "BaiduMap",
- title: '添加测点',
- url: '/WaterWellManage/EquipmentManagement/BaiduMap',
- width:"1100px",
- height: "700px",
- callBack: function (iframeId) {
- top.frames[iframeId].AcceptClick(function callback(result) {
- $("#MapPosition").val(result);
- });
- }
- });
- }
- </script>
- <style type="text/css">
- .form .formTitle {
- width:100px;
- }
- </style>
- <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
- <table id="form1" class="form">
- <tr>
- <th class="formTitle">测点名称<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="WaterWellName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入测点名称" placeholder="请输入测点名称"/>
- </td>
- </tr>
- <tr>
- <th class="formTitle">厂商编码<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="ManufacturerCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入厂商编码" placeholder="请输入厂商编码"/>
- </td>
- </tr>
- <tr>
- <th class="formTitle">测点编号<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="WaterWellCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入测点编号" placeholder="请输入测点编号"/>
- </td>
- </tr>
- <tr>
- <th class="formTitle">地图坐标<font face="宋体">*</font></th>
- <td class="formValue" >
- <input id="MapPosition" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入地图坐标" placeholder="请输入地图坐标"/>
- </td>
- <td>
- <a id="lr-add" class="btn btn-primary" onclick="btnMap()"><i class="fa fa-plus"></i> 地图</a>
- </td>
- </tr>
- </table>
- </div>
|