<!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/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<style type="text/css">
|
|
/*begin 此样式用于消除行元素中布局宽度不够的问题*/
|
.layui-form-item .layui-inline {
|
margin-top: 5px;
|
margin-bottom: 5px;
|
margin-right: 0px;
|
}
|
/*end*/
|
|
</style>
|
</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="form0" class="layui-form" lay-filter="component-form-group" action="">
|
<div class="layui-card-header">
|
<div class="layui-btn-group">
|
<button type="button" id="addnew-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>
|
<div class="layui-tab-content">
|
<div class="layui-tab layui-tab-card">
|
<ul class="layui-tab-title">
|
<li style="padding:1px;" class="layui-this">基本信息</li>
|
<li style="padding:1px;">对应金蝶信息</li>
|
<li style="padding:1px;">CLOUD账号设置</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">编码</label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="Czybm" lay-verify="Czybm" id="Czybm" autocomplete="off" style="float:left;width:150px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="CzybmList" style="width:40px;">
|
<i style="margin-left:-9px;">重置</i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">用户名</label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="Czymc" id="Czymc" autocomplete="off" style="float:left;width:150px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="CzymcList" style="width:40px;">
|
<i style="margin-left:-9px;">重置</i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">密码</label>
|
<div class="layui-input-inline">
|
<input type="password" class="layui-input" name="Czmm" id="Czmm" value="">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">确认密码</label>
|
<div class="layui-input-inline">
|
<input type="password" name="Czyyz" id="Czyyz" class="layui-input" value="" style="float:left;width:150px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="CzyyzList" style="width:40px;">
|
<i class="layui-icon layui-icon-edit layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">说明</label>
|
<div class="layui-input-inline">
|
<textarea placeholder="请输入摘要" class="layui-textarea" name="Explain" id="Explain"></textarea>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应职员</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HEmpName" id="HEmpName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab-item">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">对应组织</label>
|
<div class="layui-input-inline">
|
<select name="HOrgID" id="HOrgID">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应K3用户</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HK3UserName" id="HK3UserName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HK3UserID" id="HK3UserID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HK3UserList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应班组</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HGroupName" id="HGroupName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HGroupID" id="HGroupID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="btnHGroup" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">对应保管</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HKeeper" id="HKeeper" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HKeeperID" id="HKeeperID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应验收</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HSecManager" id="HSecManager" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HSecManagerID" id="HSecManagerID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应生产资源</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HSourceName" id="HSourceName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HSourceID" id="HSourceID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="btnHSource" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">对应业务员</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HSellMan" id="HSellMan" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HSellManID" id="HSellManID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HSellManList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应部门</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HDept" id="HDept" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HDeptID" id="HDeptID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">检验员</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HCheckEmpName" id="HCheckEmpName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HCheckEmpID" id="HCheckEmpID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="btnHCheckEmp" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">对应仓库</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HWHName" id="HWHName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HWhID" id="HWhID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HWhList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">调入仓库</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HSCWHName" id="HSCWHName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HSCWHID" id="HSCWHID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HSCWHList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">对应供应商</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HSupName" id="HSupName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HSupID" id="HSupID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">对应工序</label>
|
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
<input type="text" name="HProcName" id="HProcName" readonly class="layui-input" value="" style="float:left;width:150px;">
|
<input type="text" name="HProcID" id="HProcID" value="0" hidden>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="btnHProc" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab-item">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width:110px;">对应CLOUD账号</label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="HCloudUserName" lay-verify="" id="HCloudUserName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width:110px;">对应CLOUD密码</label>
|
<div class="layui-input-inline">
|
<input class="layui-input" name="HCloudUserPsd" id="HCloudUserPsd">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab-item layui-show">
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script>
|
var Sav = ""; //提交类型
|
var Psv = ""; //是否修改密码
|
var linterid;
|
//获取参数
|
var params = get_UrlVars();
|
if (typeof (params[params[0]]) == "undefined") {
|
linterid = 0
|
var OperationType = 1;//操作类型
|
var closeType = 2; //关闭类型
|
} else {
|
debugger;
|
var OperationType = params[params[0]];//操作类型
|
linterid = params[params[1]];//源单id
|
var HSouceBillType = params[params[2]];//源单类型
|
var closeType = params[params[3]]; //关闭类型
|
}
|
|
|
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
|
, formSelects = layui.formSelects
|
var option = [];
|
//#endregion
|
|
//将url参数中的中文乱码重新转换成中文。 注:linterid 是参数命名,不是值
|
linterid = getParams("linterid");
|
|
//#region 进入页面既加载
|
Organ();//加载组织
|
set_ClearBill();
|
|
//判断操作类型
|
if (OperationType == 1) {//无源新增
|
Sav = "Add";
|
$('#Czybm').attr("disabled", false);
|
$('#Czymc').attr("disabled", false);
|
$('#Czmm').attr("disabled", false);
|
$('#Czyyz').attr("disabled", false);
|
$('#Explain').attr("disabled", false);
|
|
}
|
else if (OperationType == 3) {//编辑
|
Sav = "Update";
|
$('#Czybm').attr("disabled", true);
|
$('#Czymc').attr("disabled", true);
|
$('#Czmm').attr("disabled", true);
|
$('#Czyyz').attr("disabled", true);
|
$('#Explain').attr("disabled", false);
|
|
set_EditFromGrid(linterid);//编辑获取表头信息
|
}
|
else {
|
layer.alert("未知操作类型!", { icon: 5 });
|
}
|
//#endregion
|
|
|
//#region 点击事件,包括on和form事件
|
//确认密码弹窗
|
form.on('submit(CzyyzList)', function () {
|
$('#Czmm').val("");
|
$('#Czyyz').val("");
|
$('#Czmm').attr("disabled", false);
|
$('#Czyyz').attr("disabled", false);
|
Psv="Update"
|
});
|
|
//编码弹窗
|
form.on('submit(CzybmList)', function () {
|
//$('#Czybm').val("");
|
$('#Czybm').attr("disabled", false);
|
});
|
|
//用户名弹窗
|
form.on('submit(CzymcList)', function () {
|
//$('#Czymc').val("");
|
$('#Czymc').attr("disabled", false);
|
});
|
|
|
//表头信息 职员弹窗
|
form.on('submit(HEmpList)', function () {
|
Gy_Employee(1);
|
});
|
|
//表头信息 保管弹窗
|
form.on('submit(HKeeperList)', function () {
|
Gy_Employee(2);
|
});
|
|
//表头信息 验收弹窗
|
form.on('submit(HSecManagerList)', function () {
|
Gy_Employee(3);
|
});
|
|
//表头信息 业务员弹窗
|
form.on('submit(HSellManList)', function () {
|
Gy_Employee(4);
|
});
|
|
//表头信息 部门弹窗
|
form.on('submit(HDeptList)', function () {
|
Gy_DepartmentList();
|
});
|
|
//表头信息 仓库弹窗
|
form.on('submit(HWhList)', function () {
|
Gy_Warehouse(1);
|
});
|
|
//表头信息 调入仓库弹窗
|
form.on('submit(HSCWHList)', function () {
|
Gy_Warehouse(2);
|
});
|
|
//表头信息 供应商弹窗
|
form.on('submit(HSupList)', function () {
|
Gy_Supplier();
|
});
|
|
//表头信息 工序
|
form.on('submit(btnHProc)', function () {
|
btnHProc();
|
});
|
|
//表头信息 班组
|
form.on('submit(btnHGroup)', function () {
|
btnHGroup();
|
});
|
|
//表头信息 生产资源
|
form.on('submit(btnHSource)', function () {
|
btnHSource();
|
});
|
|
//表头信息 检验员
|
form.on('submit(btnHCheckEmp)', function () {
|
btnHCheckEmp();
|
});
|
|
|
//保存
|
form.on('submit(Saver)', function (data) {
|
var num = [];
|
for (var i = 0; i < table.checkStatus('mainTable').data.length; i++) {
|
num.push(table.checkStatus('mainTable').data[i]["HGroupID"]);
|
}
|
|
var sSubStr = num.toString() == "" ? "-1" : num.toString();
|
|
var sMainStr = JSON.stringify(data.field) + ';' + Sav + ';' + sSubStr;
|
if (!AllowLoadData())//数据验证
|
{
|
return false;
|
}
|
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "/Xt_User/SaveUser", //方法所在页面和方法名
|
async: true,
|
data: { "msg": sMainStr },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
|
$('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
parent.layer.close(index); //再执行关闭
|
});
|
}
|
else {
|
|
layer.msg(data.Message);
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
layer.msg("错误:" + err);
|
}
|
});
|
});
|
|
//退出
|
form.on('submit(Exit)', function (data) {
|
if (linterid == undefined) {
|
//关闭页签
|
Pub_Close(2);
|
}
|
else {
|
//关闭页签
|
Pub_Close(1);
|
}
|
});
|
|
//#endregion
|
|
//将url参数中的中文乱码重新转换成中文
|
function getParams(key) {
|
var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
|
//如果地址栏中出现中文则进行编码
|
var r = encodeURI(window.location.search).substr(1).match(reg);
|
if (r != null) {
|
//将中文编码的字符重新变成中文
|
return decodeURI(unescape(r[2]));
|
}
|
return null;
|
};
|
|
//初始化表格
|
function set_ClearBill() {
|
set_InitGrid();
|
get_Display();
|
}
|
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, height: 340
|
, cellMinWidth: 90
|
, limit: 500
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'HGroupID', title: 'HGroupID', sort: true, hide: true }
|
, { field: '角色', title: '角色' }
|
, { field: '级别', title: '级别' }
|
, { field: '说明', title: '说明' }
|
]]
|
}
|
}
|
|
//加载数据到网格
|
function get_Display() {
|
var wait = layer.load();//遮罩
|
$.ajax({
|
url: GetWEBURL() + '/Xt_UserGroup/list',
|
type: "GET",
|
data: { "sWhere": "" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option.data = data1.data;
|
table.render(option);
|
layer.close(wait);
|
get_DisplayUserGroupInfoList();
|
} else {
|
layer.close(wait);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//加载绑定角色数据
|
function get_DisplayUserGroupInfoList() {
|
var sWhere = "and UserId='" + linterid+"'";
|
var wait = layer.load();//遮罩
|
$.ajax({
|
url: GetWEBURL() + '/Xt_UserGroup/UserGroupInfoList',
|
type: "GET",
|
data: { "sWhere": sWhere },
|
success: function (data1) {
|
layer.close(wait);
|
if (data1.count == 1) {
|
if (data1.data.length > 0) {
|
for (var i = 0; i < data1.data.length; i++) {
|
for (var j = 0; j < option.data.length; j++) {
|
if (data1.data[i].GroupId == option.data[j]["HGroupID"]) {
|
option.data[j]["LAY_CHECKED"] = true;
|
break;
|
}
|
}
|
}
|
table.render(option);
|
}
|
} else {
|
layer.close(wait);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//获取组织
|
function Organ() {
|
//获取登录页组织列
|
var Organization = '<option style="color:blue;" value="0">组织</option>';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
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>';
|
}
|
$("#HOrgID").append(Organization);
|
$("#HOrgID").val(sessionStorage["OrganizationID"])
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//职员列表
|
function Gy_Employee(num) {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '职员列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../PublicPage/UserInformation.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
switch (num) {
|
case 1:
|
$("#HEmpName").val(checkStatus.data[0].HName);
|
$("#HEmpID").val(checkStatus.data[0].HItemID);
|
break;
|
case 2:
|
$("#HKeeper").val(checkStatus.data[0].HName);
|
$("#HKeeperID").val(checkStatus.data[0].HItemID);
|
break;
|
case 3:
|
$("#HSecManager").val(checkStatus.data[0].HName);
|
$("#HSecManagerID").val(checkStatus.data[0].HItemID);
|
break;
|
case 4:
|
$("#HSellMan").val(checkStatus.data[0].HName);
|
$("#HSellManID").val(checkStatus.data[0].HItemID);
|
break;
|
}
|
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
});
|
}
|
|
//部门列表
|
function Gy_DepartmentList() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '部门列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HDept").val(checkStatus.data[0].HName);
|
$("#HDeptID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
});
|
}
|
|
//仓库列表
|
function Gy_Warehouse(num) {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '仓库列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
switch (num) {
|
case 1:
|
$("#HWHName").val(checkStatus.data[0].HName);
|
$("#HWhID").val(checkStatus.data[0].HItemID);
|
break;
|
case 2:
|
$("#HSCWHName").val(checkStatus.data[0].HName);
|
$("#HSCWHID").val(checkStatus.data[0].HItemID);
|
break;
|
}
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
});
|
}
|
|
//供应商列表
|
function Gy_Supplier() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '供应商列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/基础资料/采购基础资料/Gy_Supplier.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HSupName").val(checkStatus.data[0].供应商名称);
|
$("#HSupID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
});
|
}
|
|
//工序列表
|
function btnHProc() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '工序列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/基础资料/生产基础资料/Gy_Process.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HProcName").val(checkStatus.data[0].工序名称);
|
$("#HProcID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
});
|
}
|
|
//班组列表
|
function btnHGroup() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '班组列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/基础资料/工资基础资料/Gy_Group.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HGroupName").val(checkStatus.data[0].班组名称);
|
$("#HGroupID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
});
|
}
|
|
//生产资源列表
|
function btnHSource() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '生产资源列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/基础资料/生产基础资料/Gy_Source.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HSourceName").val(checkStatus.data[0].生产资源名称);
|
$("#HSourceID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
});
|
}
|
|
//检验员列表
|
function btnHCheckEmp() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '检验员列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../../views/基础资料/公用基础资料/Gy_EmployeeList.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
|
$("#HCheckEmpName").val(checkStatus.data[0].职员名称);
|
$("#HCheckEmpID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
});
|
}
|
|
//编辑获取表头信息
|
function set_EditFromGrid(linterid)
|
{
|
$.ajax({
|
url: GetWEBURL() + "/Xt_User/EditUser",
|
type: "GET",
|
data: {
|
"HID": linterid
|
},
|
success: function (result) {
|
if (result.code == 1) { // 说明验证成功了,
|
var data = result.data.h_v_IF_UserList_Edit[0];
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"Czybm": data.用户编码 //用户编码
|
, "Czymc": data.用户名称 //用户名称
|
, "Czmm": data.密码 //密码
|
, "Czyyz": data.密码 //确认密码
|
, "Explain": data.说明 //说明
|
, "HEmpID": data.HEmpID //
|
, "HEmpName": data.对应职员 //
|
, "HK3UserName": data.HK3UserID
|
, "HK3UserID": data.HK3UserID
|
, "HKeeper": data.HKeeper
|
, "HKeeperID": data.HKeeperID
|
, "HSecManager": data.HSecManager
|
, "HSecManagerID": data.HSecManagerID
|
, "HSellManID": data.HSellManID
|
, "HSellMan": data.HSellMan
|
, "HDept": data.HDept
|
, "HDeptID": data.HDeptID
|
, "HWHName": data.HWHName
|
, "HWhID": data.HWhID
|
, "HSCWHName": data.HSCWHName
|
, "HSCWHID": data.HSCWHID
|
, "HSupName": data.HSupName
|
, "HSupID": data.HSupID
|
, "HCloudUserName": data.对应CLOUD账号
|
, "HCloudUserPsd": data.HCloudUserPsd
|
, "HOrgID": data.HUSEORGID
|
, "HProcID": data.HProcID
|
, "HProcName": data.工序
|
, "HGroupID": data.HGroupID
|
, "HGroupName": data.班组
|
, "HSourceID": data.HSourceID
|
, "HSourceName": data.生产资源
|
, "HCheckEmpID": data.HCheckEmpID
|
, "HCheckEmpName": data.检验员
|
});
|
|
} else {
|
layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
}, error: function () {
|
layer.alert("发生错误!", { icon: 5 });
|
}
|
});
|
}
|
|
//提交验证
|
function AllowLoadData()
|
{
|
var Result = true;
|
if (Sav == "Add")
|
{
|
if ($("#Czmm").val() == '' || $("#Czmm").val() == null) {
|
layer.msg("密码不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#Czyyz").val() == '' || $("#Czyyz").val() == null) {
|
layer.msg("确认密码不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#Czyyz").val()!= $("#Czmm").val()) {
|
layer.msg("两次密码不一样!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
}
|
if (Sav == "Update")
|
{
|
if ($("#Czmm").val() == '' || $("#Czmm").val() == null) {
|
layer.msg("密码不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if (Psv == "Update")
|
{
|
if ($("#Czyyz").val()== '' || $("#Czyyz").val()== null) {
|
layer.msg("确认密码不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#Czyyz").val()!= $("#Czmm").val()) {
|
layer.msg("两次密码不一样!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
}
|
|
}
|
if ($("#Czybm").val() == '' || $("#Czybm").val() == null) {
|
layer.msg("编码不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#Czymc").val() == '' || $("#Czymc").val() == null) {
|
layer.msg("用户名不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HWHName").val() == $("#HSCWHName").val() && $("#HWHName").val() != "" && $("#HSCWHName").val() != "") {
|
layer.msg("对应仓库和调入仓库不能相同!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
else {
|
return Result = true;
|
}
|
return Result;
|
}
|
|
});
|
</script>
|
</body>
|
</html>
|