| | |
| | | <style type="text/css">
|
| | | html, body {
|
| | | height: 100%;
|
| | | min-width:auto;
|
| | | }
|
| | | |
| | | .layui-table-view {
|
| | | margin: 0;
|
| | | }
|
| | |
| | | <table>
|
| | | <tbody>
|
| | | <tr>
|
| | | <th>省</th>
|
| | | <!-- 省 -->
|
| | | <th>市</th>
|
| | | <!-- 市 -->
|
| | | <th>机房名称</th>
|
| | | <!-- 机房站点 -->
|
| | | <th>省</th> <!-- 省 -->
|
| | | <th>市</th> <!-- 市 -->
|
| | | <th>区/县</th> <!-- 区/县 -->
|
| | | <th>机房名称</th> <!-- 机房站点 -->
|
| | | </tr>
|
| | | <tr>
|
| | | <td><select name="station_name1" id="station_name1" lay-verify="">
|
| | | |
| | | </select></td>
|
| | | <td><select name="" id="city" lay-verify="">
|
| | | </select></td>
|
| | | <td><select name="" id="station_name3" lay-verify="">
|
| | | </select></td>
|
| | | <td>
|
| | | <select name="station_name1" id="station_name1"></select>、
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="city"></select>
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="county"></select>
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="station_name3" ></select>
|
| | | </td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | |
| | | <div class="layui-form-item layui-form-text">
|
| | | <label class="layui-form-label" style="text-align:center;">问题描述</label>
|
| | | <div class="layui-input-block">
|
| | | <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
|
| | | <textarea placeholder="请输入内容" id="faultcontex" class="layui-textarea"></textarea>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | |
| | | <div class="layui-form-item">
|
| | |
|
| | | <div class="layui-input-block tr" >
|
| | | <a class="layui-btn" lay-submit="" lay-filter="sub">立即提交</a>
|
| | | <a class="layui-btn" id="falutsubmit" lay-submit="" lay-filter="sub">立即提交</a>
|
| | | <a type="reset" class="layui-btn layui-btn-primary">重置</a>
|
| | | </div>
|
| | | </div>
|
| | |
| | |
|
| | | form.on('submit(sub)',function(data){
|
| | | $('#addtime').val(getNowFormatDate());
|
| | | console.warn(3333);
|
| | | console.info(data);
|
| | | //console.warn(3333);
|
| | | //console.info(data);
|
| | | return false;
|
| | | });
|
| | |
|
| | | |
| | | |
| | | function renderForm(){
|
| | | var form = layui.form;//高版本建议把括号去掉,有的低版本,需要加()
|
| | | form.render();
|
| | |
| | | $select.text('').html('<option>暂无可测市</option>');
|
| | | renderForm();
|
| | | }
|
| | | findStationNamebyStationname1();
|
| | | searchCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 查询区/县
|
| | | function searchCounty() {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val(),
|
| | | StationName2: $("#city").val()
|
| | | };
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'BattInfAction!serchStationName5',
|
| | | dataType: 'json',
|
| | | data: "json = "+JSON.stringify(tmp),
|
| | | success: function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#county'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择区/县', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = getLayuiSelect(_data.StationName5, _data.StationName5, {}, _data);
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无区/县', '', {}, undefined));
|
| | | }
|
| | | |
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'countyFilter');
|
| | | |
| | | // 查询机房
|
| | | findCity();
|
| | | }
|
| | | });
|
| | | }
|
| | | //当维护区的值变换时更新市
|
| | | $('#station_name1').change(function() {
|
| | | findCity();
|
| | | });
|
| | | //当维护区的值变换时更新机房站点
|
| | | $('#city').change(function() {
|
| | | findStationNamebyStationname1();
|
| | | searchCounty();
|
| | | });
|
| | | // 切换区/县-机房
|
| | | form.on('select(county)', function(data) {
|
| | | // 查询机房
|
| | | findCity(true);
|
| | | });
|
| | |
|
| | | //根据省,市查询站点
|
| | | function findStationNamebyStationname1() {
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | |
| | | function creatAddFaultAdd(){
|
| | | var date = new Date().format('yyyy-MM-dd');
|
| | | var id = 42000570;
|
| | | var temp = {
|
| | | stationId:id,
|
| | | record_time:date,
|
| | | error_descript:$('#faultcontex').val(),
|
| | | }
|
| | | console.info(temp);
|
| | | return temp;
|
| | | }
|
| | | |
| | | function searchFaultAdd(){
|
| | | var temp = creatAddFaultAdd();
|
| | | var loading = layer.load();
|
| | | // 根据查询条件,查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'Deverror_recordAction!add',
|
| | | data: "json="+JSON.stringify(temp),
|
| | | dataType: 'json',
|
| | | success: function(result) {
|
| | | layer.close(loading);
|
| | | console.info(result);
|
| | | var data = JSON.parse(result);
|
| | | if(data.code==1){
|
| | | layer.msg('添加成功!', {icon:0, shade: 0.1,shadeClose:true});
|
| | | }else{
|
| | | layer.msg('添加失败!', {icon:0, shade: 0.1,shadeClose:true});
|
| | | }
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | $('#falutsubmit').click(function(){
|
| | | searchFaultAdd();
|
| | | });
|
| | | });
|
| | | </script>
|
| | | </body>
|