You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
4.1 KiB
90 lines
4.1 KiB
layui.use(['form', 'layer', 'table', 'laytpl', 'laydate', 'upload'], function () {
|
|
var form = layui.form,
|
|
layer = parent.layer === undefined ? layui.layer : top.layer,
|
|
$ = layui.jquery,
|
|
laytpl = layui.laytpl,
|
|
table = layui.table,
|
|
upload = layui.upload,
|
|
laydate = layui.laydate;
|
|
var UserId = JSON.parse(window.sessionStorage.getItem("userInfo")).UserCode;
|
|
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
|
|
|
|
form.verify({
|
|
//纬度,整数部分为0-90小数部分为0到6位
|
|
lon: [/^[-]?[0-9]+\.?[0-9]+?$/ || /^[0-9]+$/, '请输入正确的格式']
|
|
});
|
|
|
|
//初始化表单
|
|
$(function () {
|
|
//部件完整情况、防锈漆(栓体)、锈死漏水、井内污水、有无冻损、标识情况、井盖刷漆 下拉框(字典表)
|
|
var modtypes = ["ISCOMTYPE", "ISANTTYPE", "ISLEAKTYPE", "ISIMPTYPE", "ISDAMTYPE", "ISIDTYPE", "ISPAINTTYPE"];
|
|
$.post("../../ashx/CommonHandler.ashx", {
|
|
Action: "getModsDicList",
|
|
modtypes: modtypes.join(","),
|
|
random: new Date().getTime() //随机参数
|
|
}, function (res) {
|
|
if (res && res.data) {
|
|
var iscomStr = "", isantStr = "", isleakStr = "", isimpStr = "", isdamStr = "", isidStr = "", ispainStr = "";
|
|
res.data.forEach(function (obj, index, arr) {
|
|
if (obj.MOD_CODE == "ISCOMTYPE") {
|
|
iscomStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISANTTYPE") {
|
|
isantStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISLEAKTYPE") {
|
|
isleakStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISIMPTYPE") {
|
|
isimpStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISDAMTYPE") {
|
|
isdamStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISIDTYPE") {
|
|
isidStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
} else if (obj.MOD_CODE == "ISPAINTTYPE") {
|
|
ispainStr += "<option value='" + obj.DIC_VALUE + "'>" + obj.DIC_TEXT + "</option>";
|
|
}
|
|
});
|
|
$("#IS_COM").append(iscomStr);
|
|
$("#IS_ANT").append(isantStr)
|
|
$("#IS_LEAK").append(isleakStr);
|
|
$("#IS_IMP").append(isimpStr);
|
|
$("#IS_DAM").append(isdamStr);
|
|
$("#IS_ID").append(isidStr);
|
|
$("#IS_PAINT").append(ispainStr);
|
|
form.render('select');
|
|
}
|
|
});
|
|
|
|
//获取消防机构列表
|
|
var orgStr = "";
|
|
$.ajax({
|
|
type: "post",
|
|
url: "../../ashx/FireOrgHandler.ashx",
|
|
data: { Action: "OrgList2", OrgId: OrgId },
|
|
dataType: "json",
|
|
success: function (result) {
|
|
console.log(result);
|
|
result.data.forEach(function (obj, index, arr) {
|
|
orgStr += "<option value='" + obj.ORG_ID + "'>" + obj.ORG_NAME + "</option>";
|
|
});
|
|
$("#ORG_ID").append(orgStr);
|
|
form.render('select');
|
|
}
|
|
});
|
|
|
|
//获取行政区列表
|
|
var areaStr = "";
|
|
$.ajax({
|
|
type: "post",
|
|
url: "../../ashx/FireOrgHandler.ashx",
|
|
data: { Action: "AreaList2", OrgId: OrgId },
|
|
dataType: "json",
|
|
success: function (result) {
|
|
result.data.forEach(function (obj, index, arr) {
|
|
areaStr += "<option value='" + obj.ID + "'>" + obj.NAME + "</option>";
|
|
});
|
|
$("#CITY").append(areaStr);
|
|
form.render('select');
|
|
}
|
|
});
|
|
});
|
|
|
|
})
|