<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8" />
|
<title>新增/编辑异常反馈类型</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
</head>
|
<body>
|
|
<div id="layout1" class="layui-fluid">
|
<div class="layui-row layui-col-space15">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
<form id="form" class="layui-form" lay-filter="component-form-group" action="">
|
<div class="layui-card-header">
|
<div class="layui-btn-group">
|
<button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
|
</div>
|
</div>
|
<div class="layui-card-body">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<h1 style="text-align:center;"><b>异常反馈类型</b></h1>
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
|
<li>其他信息</li>
|
</ul>
|
<div class="layui-tab-content">
|
<!--基本信息-->
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 120px">代码<label style="color:red"> * </label></label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="HNumber" lay-verify="HNumber" id="HNumber" autocomplete="off">
|
<input name="HItemID" id="HItemID" autocomplete="off" type="hidden">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 120px">名称<label style="color:red"> * </label></label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="HName" id="HName" autocomplete="off">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 120px">助记码:</label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="HHelpCode" id="HHelpCode" autocomplete="off">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width: 120px">使用组织:</label>
|
<div class="layui-input-inline">
|
<select name="HUSEORGID" id="HUSEORGID" lay-verify="HUSEORGID">
|
</select>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 120px">使用状态:</label>
|
<div class="layui-input-inline">
|
<select name="HUseFlag" id="HUseFlag" lay-verify="HUseFlag">
|
<option value="未检测" selected>未检测</option>
|
<option value="未使用">未使用</option>
|
<option value="已使用">已使用</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 120px"> 禁用标志:</label>
|
<div class="layui-input-inline">
|
<input type="checkbox" name="HStopflag" id="HStopflag" lay-skin="primary" title="" value="">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-col-xs11">
|
<label class="layui-form-label"> 备注:</label>
|
<div class="layui-input-block">
|
<input class="layui-input" name="HRemark" id="HRemark" autocomplete="off">
|
</div>
|
</div>
|
</div>
|
</div>
|
<!--其他信息-->
|
<div class="layui-tab-item">
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">创建人</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HMakeEmp" id="HMakeEmp" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">修改人</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HModifyEmp" id="HModifyEmp" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">禁用人</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HStopEmp" id="HStopEmp" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">审核人</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HCheckEmp" id="HCheckEmp" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">创建日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HMakeTime" id="HMakeTime" value="" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">修改日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HModifyTime" id="HModifyTime" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">禁用日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HStopTime" id="HStopTime" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">审核日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HCheckTime" id="HCheckTime" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script>
|
//获取参数
|
var params = get_UrlVars();
|
if (typeof (params[params[0]]) == "undefined") {
|
var OperationType = 1;//操作类型
|
} else {
|
var OperationType = params[params[0]];//操作类型
|
var linterid = params[params[1]];//源单id
|
var HSouceBillType = params[params[2]];//源单类型
|
}
|
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, laydate = layui.laydate
|
, element = layui.element;
|
//#endregion
|
//#region 进入页面即加载
|
|
//初始化界面
|
set_ClearBill();
|
//判断操作类型
|
if (OperationType == 1) {//无源单
|
set_AddFNew();
|
$("#HMakeEmp").val(sessionStorage["HUserName"]);
|
}
|
else if (OperationType == 2) {
|
set_EditFromGrid();
|
$("#HMakeEmp").val(sessionStorage["HUserName"]);
|
$("#HModifyEmp").val("");
|
$("#HStopEmp").val("");
|
$("#HCheckEmp").val("");
|
$("#HMakeTime").val("");
|
$("#HModifyTime").val("");
|
$("#HStopTime").val("");
|
$("#HCheckTime").val("");
|
$("#HNumber").val("");
|
$("#HItemID").val(0);
|
}
|
else if (OperationType == 3) {//编辑
|
set_EditFromGrid();
|
}
|
else {
|
layer.alert("未知操作类型!", { icon: 5 });
|
}
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
//保存
|
form.on('submit(Saver)', function (data) {//保存
|
if (AllowLoadData()) {
|
var isEndCheck = document.getElementById("HStopflag").checked;
|
isEndCheck == true ? data.field.HStopflag = 'true' : data.field.HStopflag = 'false';//将数组合并成字符串
|
|
var sMainStr = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"];
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "SaveGy_ErrMsgBackType", //方法所在页面和方法名
|
async: true,
|
data: { "msg": sMainStr },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { icon: 1 });
|
$('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
|
}
|
else {
|
f_alert(data.Message);
|
console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
f_alert("错误:" + err);
|
console.log("Reason" + sMainStr);
|
}
|
});
|
}
|
});
|
//退出
|
form.on('submit(Exit)', function (data) {//
|
if (linterid == undefined) {
|
//关闭页签
|
Pub_Close(2);
|
}
|
else {
|
//关闭页签
|
Pub_Close(1);
|
}
|
});
|
|
//监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
//#endregion
|
|
|
//#region 当前页面面所有的方法
|
|
//初始化界面
|
function set_ClearBill() {
|
Organ();
|
$("#HStopflag").attr("disabled", true);
|
$("#HUseFlag").attr("disabled", true);
|
layui.form.render('checkbox');
|
layui.form.render('select');
|
}
|
//无源单新增
|
function set_AddFNew() {
|
$("#HItemID").val("0");
|
$("#HNumber").val("");
|
}
|
//编辑
|
function set_EditFromGrid() {
|
$("#HItemID").val(linterid);
|
set_EditForm(linterid); //编辑获取表头
|
}
|
//编辑加载表头
|
function set_EditForm(linterid) {
|
//查询检验方案单是否存在
|
$.ajax({
|
url: GetWEBURL() + "GetGy_ErrMsgBackTypeDetail",
|
type: "GET",
|
async: false,
|
data: {
|
"HID": linterid
|
},
|
success: function (result) {
|
if (result.code == 1) { // 说明验证成功了,
|
var data = result.data.h_v_Gy_ErrMsgBackType[0];
|
$("#HItemID").val(data.HItemID);//代码ID
|
$("#HNumber").val(data.异常反馈类型代码);//代码
|
$("#HName").val(data.异常反馈类型名称);//名称
|
$("#HHelpCode").val(data.助记码);//助记码
|
$("#HUSEORGID").val(data.HUSEORGID);//使用组织
|
$("#HUseFlag ").val(data.使用状态);//使用状态
|
$("#HRemark").val(data.备注);//备注
|
|
$("#HMakeEmp").val(data.制单人);
|
$("#HMakeTime").val(data.创建日期 == null ? "" : Format(new Date(data.创建日期), "yyyy-MM-dd"));
|
$("#HCheckEmp").val(data.审核人);
|
$("#HCheckTime").val(data.审核日期 == null ? "" : Format(new Date(data.审核日期), "yyyy-MM-dd"));
|
$("#HModifyEmp").val(data.修改人);
|
$("#HModifyTime").val(data.修改日期 == null ? "" : Format(new Date(data.修改日期), "yyyy-MM-dd"));
|
$("#HStopEmp").val(data.禁用人);
|
$("#HStopTime").val(data.禁用日期 == null ? "" : Format(new Date(data.禁用日期), "yyyy-MM-dd"));
|
|
$("input[name='HStopflag']").attr("checked", data.禁用标志 == "是" ? true : false);//true:选中 false:不选中
|
layui.form.render();//实时渲染选中和不选中的样式,最好添加这句话
|
form.render("select");
|
} else {
|
layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
}, error: function () {
|
layer.alert("发生错误!", { icon: 5 });
|
}
|
});
|
}
|
|
//数据验证
|
function AllowLoadData() {
|
var HNumber = $("#HNumber").val() //代码
|
var HName = $("#HName").val() //名称
|
|
if (HNumber == null || HNumber == undefined || HNumber == "") {
|
layer.msg("请输入代码!", { icon: 5 });
|
return false;
|
}
|
if (HName == null || HName == undefined || HName == "") {
|
layer.msg("请输入名称!", { icon: 5 });
|
return false;
|
}
|
return true;
|
}
|
|
//
|
function f_alert(sMsg) {
|
layer.alert(sMsg, { icon: 5 });
|
|
}
|
//获取登录页组织列
|
function Organ() {
|
var Organization = '';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
async: false,
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
|
}
|
$("#HUSEORGID").append(Organization);
|
$("#HUSEORGID").val(sessionStorage["OrganizationID"])
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
//#endregion
|
});
|
|
</script>
|
</body>
|
</html>
|