基础管理
This commit is contained in:
parent
877a520c8c
commit
5363d8e52e
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 用户相关接口
|
* 用户相关接口
|
||||||
*/
|
*/
|
||||||
@Api(tags = "班组")
|
@Api(tags = "用户")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/teams/")
|
@RequestMapping("/teams/")
|
||||||
public class TeamController {
|
public class TeamController {
|
||||||
|
|
@ -122,14 +122,10 @@ public class TeamController {
|
||||||
@PreAuthorize("@pms.hasPermission('base:team:del')")
|
@PreAuthorize("@pms.hasPermission('base:team:del')")
|
||||||
public ServerResponse delTeam(EncryptedReq<BaseTeam> data) {
|
public ServerResponse delTeam(EncryptedReq<BaseTeam> data) {
|
||||||
try {
|
try {
|
||||||
if(data.getData().getCountuser()!=0){
|
if (teamService.delTeam(data.getData().getTeamId())== 1){
|
||||||
return ServerResponse.createBySuccessMsg("该班组人数不为0,无法删除");
|
return ServerResponse.createBySuccessMsg("注销成功");
|
||||||
}else{
|
}else {
|
||||||
if (teamService.delTeam(data.getData().getTeamId())== 1){
|
return ServerResponse.createErroe("注销失败");
|
||||||
return ServerResponse.createBySuccessMsg("删除成功");
|
|
||||||
}else {
|
|
||||||
return ServerResponse.createErroe("删除失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(),e);
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,22 @@
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="list" parameterType="String" resultMap="BaseTeamResult">
|
<select id="list" parameterType="String" resultMap="BaseTeamResult">
|
||||||
select id,team_name,team_type_name,team_leader,team_leader_phone,create_time,update_time
|
select tt.id,tt.team_name,team_type_name,team_leader,team_leader_phone, count(su.team_id) as countuser,tt.create_time,tt.update_time
|
||||||
from tb_team
|
from tb_team tt
|
||||||
|
left join sys_user su on su.team_id = tt.id and su.del_flag = 0
|
||||||
<where>
|
<where>
|
||||||
del_flag = 0
|
tt.del_flag = 0
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (
|
and (
|
||||||
INSTR(team_name,#{keyWord}) > 0 OR
|
INSTR(tt.team_name,#{keyWord}) > 0 OR
|
||||||
INSTR(team_type_name,#{keyWord}) > 0 OR
|
INSTR(team_type_name,#{keyWord}) > 0 OR
|
||||||
INSTR(team_leader,#{keyWord}) > 0 OR
|
INSTR(team_leader,#{keyWord}) > 0 OR
|
||||||
INSTR(team_leader_phone,#{keyWord}) > 0
|
INSTR(team_leader_phone,#{keyWord}) > 0
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by id asc
|
group by tt.id
|
||||||
|
order by tt.id asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTeamId" parameterType="com.bonus.aqgqj.basis.entity.vo.BaseTeam" resultMap="BaseTeamResult">
|
<select id="getTeamId" parameterType="com.bonus.aqgqj.basis.entity.vo.BaseTeam" resultMap="BaseTeamResult">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,199 @@
|
||||||
|
let form, layer, table, tableIns;
|
||||||
|
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||||
|
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
||||||
|
form = layui.form;
|
||||||
|
layer = layui.layer;
|
||||||
|
table = layui.table;
|
||||||
|
layui.form.render();
|
||||||
|
pages(1, 10, 1);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function pages(pageNum, pageSize, typeNum) {
|
||||||
|
let params = getReqParams(pageNum, pageSize, typeNum);
|
||||||
|
let url = dataUrl + "/teamconfigs/getListTemp"
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
console.log(result);
|
||||||
|
if (result.code === 200) {
|
||||||
|
if (result.data) {
|
||||||
|
initTable(result.data, result.limit, result.curr)
|
||||||
|
laypages(result.count, result.curr, result.limit)
|
||||||
|
}
|
||||||
|
} else if (result.code === 500) {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function laypages(total, page, limit) {
|
||||||
|
layui.use(['laypage'], function () {
|
||||||
|
let laypage = layui.laypage;
|
||||||
|
laypage.render({
|
||||||
|
elem: 'voi-page',
|
||||||
|
count: total,
|
||||||
|
curr: page,
|
||||||
|
limit: limit,
|
||||||
|
limits: [10, 20, 50, 100, 200, 500],
|
||||||
|
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||||
|
groups: 5,
|
||||||
|
jump: function (obj, first) {
|
||||||
|
if (!first) {
|
||||||
|
pageNum = obj.curr, limitSize = obj.limit;
|
||||||
|
pages(obj.curr, obj.limit, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/*初始化表格*/
|
||||||
|
function initTable(dataList, limit, page) {
|
||||||
|
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||||
|
tableIns = table.render({
|
||||||
|
elem: "#table_data",
|
||||||
|
height: "full-130",
|
||||||
|
data: dataList,
|
||||||
|
limit: limit,
|
||||||
|
cols: [
|
||||||
|
[
|
||||||
|
{type: 'checkbox', width: '5%', fixed: 'left'},
|
||||||
|
//表头
|
||||||
|
{title: "序号", width: 80, unresize: true, align: "center",
|
||||||
|
templet: function (d) {
|
||||||
|
return (page - 1) * limit + d.LAY_INDEX;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: "teamConfigId", title: "ID", unresize: true, align: "center",hide:true},
|
||||||
|
{field: "teamConfigName", title: "姓名", unresize: true, align: "center"},
|
||||||
|
{field: "teamConfigJobNumber", title: "工号", unresize: true, align: "center"},
|
||||||
|
{field: "teamConfigSex", title: "性别", unresize: true, align: "center",
|
||||||
|
templet: function (d) {
|
||||||
|
if (d.teamConfigSex == 0) {
|
||||||
|
return "女";
|
||||||
|
} else if (d.teamConfigSex == 1) {
|
||||||
|
return "男";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {field: "teamConfigTeamId", title: "班组id", unresize: true, align: "center"},
|
||||||
|
{field: "teamConfigPhone", title: "联系电话", unresize: true, align: "center"},
|
||||||
|
{title: "操作", unresize: true, width: 300, align: "center",
|
||||||
|
templet: function (d) {
|
||||||
|
|
||||||
|
let html = '';
|
||||||
|
let add="<a class=\"layui-icon layui-icon-edit\" style='cursor:pointer;' title='添加到该班组' onclick=\"addData('" + areaIdParam + "','" + d.teamConfigId + "')\"></a>"
|
||||||
|
html=add;
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
done: function (res, curr, count) {
|
||||||
|
layer.close(loadingMsg);
|
||||||
|
table.resize("table_data");
|
||||||
|
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
||||||
|
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取参数
|
||||||
|
function getReqParams(page, limit, type) {
|
||||||
|
let obj = {};
|
||||||
|
if (!type) {
|
||||||
|
obj = {
|
||||||
|
page: page + "",
|
||||||
|
limit: limit + "",
|
||||||
|
keyWord: $('#keyWord').val(),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
obj = {
|
||||||
|
page: '1',
|
||||||
|
limit: '10',
|
||||||
|
keyWord: '',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
console.log(obj)
|
||||||
|
obj={
|
||||||
|
encryptedData:encryptCBC(JSON.stringify(obj))
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询/重置
|
||||||
|
function query() {
|
||||||
|
let pattern = new RegExp("[%_<>]");
|
||||||
|
pageNum = 1;
|
||||||
|
pages(1, limitSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
function reloadData() {
|
||||||
|
pages(pageNum, limitSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取选中的数据
|
||||||
|
function getCheckedValues() {
|
||||||
|
let data = table.checkStatus("table_data").data;
|
||||||
|
let ids = []
|
||||||
|
if (data.length === 0) {
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
ids.push(data[i].teamConfigId);
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量添加
|
||||||
|
function batchAddData() {
|
||||||
|
let ids = getCheckedValues();
|
||||||
|
console.log(ids);
|
||||||
|
let id = areaIdParam;
|
||||||
|
if (ids.length === 0) {
|
||||||
|
return layer.msg('至少添加一行数据', {icon: 7})
|
||||||
|
} else {
|
||||||
|
addTeamConfigData(ids.toString(),id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*修改用户*/
|
||||||
|
function addData(id,teamConfigId) {
|
||||||
|
layer.confirm("确定添加到该班组吗?", {
|
||||||
|
move: false
|
||||||
|
}, function () {
|
||||||
|
let loadingMsg = layer.msg('数据添加中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||||
|
let url = dataUrl + "/teamconfigs/addById";
|
||||||
|
let params = {
|
||||||
|
'id':id,
|
||||||
|
'teamConfigId': teamConfigId
|
||||||
|
}
|
||||||
|
console.log(params);
|
||||||
|
params={
|
||||||
|
encryptedData:encryptCBC(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
if (result.code === 200) {
|
||||||
|
parent.layer.msg(result.msg, {icon: 1})
|
||||||
|
query()
|
||||||
|
} else if (result.code === 500) {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setParams(params){
|
||||||
|
let obj = JSON.parse(params)
|
||||||
|
console.log(obj)
|
||||||
|
areaIdParam = obj.id
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
let form, layer, dtree, util, idParam, phoneParam,statusParam;
|
||||||
|
let arr = ['background', 'web', 'mobile', 'wx'];
|
||||||
|
let background, web, mobile, wx;
|
||||||
|
let data = [], appResList = [];
|
||||||
|
// 角色下拉选
|
||||||
|
let roleList;
|
||||||
|
getTeamSelected();
|
||||||
|
function setParams(params) {
|
||||||
|
idParam = JSON.parse(params).customId;
|
||||||
|
// statusParam = 0;
|
||||||
|
console.log(idParam)
|
||||||
|
layui.config({
|
||||||
|
base: "../../../js/layui-v2.6.8/dtree/", //此处路径请自行处理, 可以使用绝对路径
|
||||||
|
}).extend({
|
||||||
|
dtree: 'dtree'
|
||||||
|
}).use(['form', 'layer', 'util'], function () {
|
||||||
|
layer = layui.layer;
|
||||||
|
form = layui.form;
|
||||||
|
util = layui.util;
|
||||||
|
form.on('submit(formData)', function (data) {
|
||||||
|
data.field.id = $('#id').val();
|
||||||
|
// data.field.customStatus = $('#customStatus').val();
|
||||||
|
// data.field.type = !$('#id').val() ? '1' : '2';
|
||||||
|
saveData(data);
|
||||||
|
});
|
||||||
|
// form.on('switch',function(data){
|
||||||
|
// if(data.elem.checked==true){
|
||||||
|
// statusParam = 1;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
form.verify(
|
||||||
|
{
|
||||||
|
required: function (value, item) {
|
||||||
|
let customPhone = $('#customPhone').val();
|
||||||
|
if(customPhone){
|
||||||
|
if (!(/^1[3456789]\d{9}$/.test(customPhone))) {
|
||||||
|
return '请输入正确的手机号';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// if (idParam) {
|
||||||
|
// getFormbyId();
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id获取用户信息
|
||||||
|
function getFormbyId() {
|
||||||
|
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||||
|
let url = dataUrl + "/customs/getCustomId?token=" + tokens;
|
||||||
|
let params = {
|
||||||
|
customId: idParam
|
||||||
|
}
|
||||||
|
params={
|
||||||
|
encryptedData:encryptCBC(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
if (result.code === 200) {
|
||||||
|
setFormData(result.data);
|
||||||
|
} else {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置表单内容
|
||||||
|
function setFormData(data) {
|
||||||
|
if (data) {
|
||||||
|
form.val('formInfo',data)
|
||||||
|
// if(data.customStatus == 1){
|
||||||
|
// $("#customStatus").prop("checked", 1);
|
||||||
|
// }else{
|
||||||
|
// $("#customStatus").prop("checked", 0);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
deptId = data.deptId;
|
||||||
|
pid = data.pid
|
||||||
|
console.log(data)
|
||||||
|
form.render();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveData2() {
|
||||||
|
$('#formSubmit').trigger('click')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存数据
|
||||||
|
function saveData(data) {
|
||||||
|
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||||
|
|
||||||
|
let params = data.field;
|
||||||
|
params.customId = idParam;
|
||||||
|
// params.customStatus = statusParam;
|
||||||
|
let path_url = '';
|
||||||
|
path_url = 'addDeptCustom';
|
||||||
|
|
||||||
|
let url = dataUrl + "/customs/" + path_url + "?token=" + tokens;
|
||||||
|
|
||||||
|
params = {
|
||||||
|
encryptedData: encryptCBC(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
|
||||||
|
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
|
||||||
|
}, function (result) {
|
||||||
|
console.log(result)
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
if (result.code === 200) {
|
||||||
|
parent.layer.msg(result.msg, {icon: 1,time:1000},function (){
|
||||||
|
closePage(1);
|
||||||
|
})
|
||||||
|
// closePage(1);
|
||||||
|
// parent.layer.msg(result.data, {icon: 1});
|
||||||
|
} else if (result.code === 500) {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
} else if (result.code === 204) {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 关闭页面
|
||||||
|
function closePage(type) {
|
||||||
|
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
||||||
|
parent.layer.close(index); //再执行关闭
|
||||||
|
if (type === 1) {
|
||||||
|
parent.reloadData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getTeamSelected() {
|
||||||
|
debugger
|
||||||
|
let url = dataUrl + '/customs/all';
|
||||||
|
ajaxRequest(url, "POST", null, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
if (result.code === 200) {
|
||||||
|
setSelectValue(result.data, 'pid');
|
||||||
|
// return result.data
|
||||||
|
} else {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*下拉选表单赋值*/
|
||||||
|
// function setSelectValue(list, selectName) {
|
||||||
|
// let html = '<option value="" selected>请选择</option>';
|
||||||
|
// $.each(list, function (index, item) {
|
||||||
|
// html += '<option value="' + item.pid + '">' + item.customName + '</option>';
|
||||||
|
// })
|
||||||
|
// $('#' + selectName).empty().append(html);
|
||||||
|
// layui.form.render();
|
||||||
|
// }
|
||||||
|
|
@ -1,195 +0,0 @@
|
||||||
let form, layer, table, tableIns,idParam,customNumParam;
|
|
||||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
|
||||||
|
|
||||||
function setParams(params) {
|
|
||||||
idParam = JSON.parse(params).id;
|
|
||||||
customNumParam = JSON.parse(params).customNum;
|
|
||||||
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
|
||||||
form = layui.form;
|
|
||||||
layer = layui.layer;
|
|
||||||
table = layui.table;
|
|
||||||
layui.form.render();
|
|
||||||
getDevSelected();
|
|
||||||
pages(1, 10, 1);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function pages(pageNum, pageSize, typeNum) {
|
|
||||||
let params = getReqParams(pageNum, pageSize, typeNum);
|
|
||||||
let url = dataUrl + "/experimental/getDetailList"
|
|
||||||
ajaxRequest(url, "POST", params, true, function () {
|
|
||||||
}, function (result) {
|
|
||||||
if (result.code === 200) {
|
|
||||||
if (result.data) {
|
|
||||||
initTable(result.data, result.limit, result.curr)
|
|
||||||
laypages(result.count, result.curr, result.limit)
|
|
||||||
}
|
|
||||||
} else if (result.code === 500) {
|
|
||||||
layer.alert(result.msg, {icon: 2})
|
|
||||||
}
|
|
||||||
}, function (xhr) {
|
|
||||||
error(xhr)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function laypages(total, page, limit) {
|
|
||||||
layui.use(['laypage'], function () {
|
|
||||||
let laypage = layui.laypage;
|
|
||||||
laypage.render({
|
|
||||||
elem: 'voi-page',
|
|
||||||
count: total,
|
|
||||||
curr: page,
|
|
||||||
limit: limit,
|
|
||||||
limits: [10, 20, 50, 100, 200, 500],
|
|
||||||
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
|
||||||
groups: 5,
|
|
||||||
jump: function (obj, first) {
|
|
||||||
if (!first) {
|
|
||||||
pageNum = obj.curr, limitSize = obj.limit;
|
|
||||||
pages(obj.curr, obj.limit, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/*初始化表格*/
|
|
||||||
function initTable(dataList, limit, page) {
|
|
||||||
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
|
||||||
tableIns = table.render({
|
|
||||||
elem: "#table_data",
|
|
||||||
height: "full-130",
|
|
||||||
data: dataList,
|
|
||||||
limit: limit,
|
|
||||||
cols: [
|
|
||||||
[
|
|
||||||
//表头
|
|
||||||
{title: "序号", width: 80, unresize: true, align: "center",
|
|
||||||
templet: function (d) {
|
|
||||||
return (page - 1) * limit + d.LAY_INDEX;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{field: "devTypeName", title: "样品类型", unresize: true, align: "center"},
|
|
||||||
{field: "devModule", title: "规格型号", unresize: true, align: "center"},
|
|
||||||
{field: "sampleQuantity", title: "样品数量", unresize: true, align: "center"},
|
|
||||||
{field: "", title: "状态", unresize: true, align: "center"},
|
|
||||||
{field: "causeOfRejection", title: "驳回原因", unresize: true, align: "center"},
|
|
||||||
{title: "原始记录", unresize: true, width: 300, align: "center",
|
|
||||||
templet: function (d) {
|
|
||||||
var html = '';
|
|
||||||
let search="<a class=\"layui-icon \" style='cursor:pointer;' title='查看' style=\"color: blue;\" onclick=\"checkData('" + d.experId + "','" + d.sampleId + "','"+ d.devTypeCode+"')\">查看</a>";
|
|
||||||
if (d.status == "待试验" || d.status == "待提交" || d.status == "审阅不通过" || d.status == "审核不通过" || d.status == "审批不通过") {
|
|
||||||
let edit="<a class=\"layui-icon \" style='cursor:pointer;' title='编制' style=\"color: blue;\" onclick=\"addData('" + d.experId + "','" + d.sampleId + "','"+ d.devTypeCode+"')\">编制</a>";
|
|
||||||
html=search+edit;
|
|
||||||
} else {
|
|
||||||
html=search;
|
|
||||||
}
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
done: function (res, curr, count) {
|
|
||||||
layer.close(loadingMsg);
|
|
||||||
table.resize("table_data");
|
|
||||||
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
|
||||||
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 获取参数
|
|
||||||
function getReqParams(page, limit, type) {
|
|
||||||
// console.log(idParam)
|
|
||||||
let obj = {};
|
|
||||||
if (!type) {
|
|
||||||
obj = {
|
|
||||||
page: page + "",
|
|
||||||
limit: limit + "",
|
|
||||||
devTypeCode: $('#devId').val(),
|
|
||||||
id: idParam
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
obj = {
|
|
||||||
page: '1',
|
|
||||||
limit: '10',
|
|
||||||
devTypeCode: '',
|
|
||||||
id: idParam
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// console.log(obj)
|
|
||||||
obj={
|
|
||||||
encryptedData:encryptCBC(JSON.stringify(obj))
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询/重置
|
|
||||||
function query() {
|
|
||||||
pageNum = 1;
|
|
||||||
pages(1, limitSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
function reloadData() {
|
|
||||||
pages(pageNum, limitSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看
|
|
||||||
function checkData(experId,sampleId,devTypeCode) {
|
|
||||||
let param = {
|
|
||||||
'experId': experId,
|
|
||||||
'sampleId': sampleId,
|
|
||||||
'devTypeCode':devTypeCode,
|
|
||||||
'customNum':customNumParam
|
|
||||||
}
|
|
||||||
openIframeMax("testCheck.html", "查看试验", "testCheck.html", '80%', '100%', param);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 试验新增、修改
|
|
||||||
function addData(experId,sampleId,devTypeCode) {
|
|
||||||
let title = '新增试验'
|
|
||||||
if (experId!=null && experId!='null') {
|
|
||||||
title = '修改试验';
|
|
||||||
}
|
|
||||||
let param = {
|
|
||||||
'experId': experId,
|
|
||||||
'sampleId': sampleId,
|
|
||||||
'devTypeCode':devTypeCode,
|
|
||||||
'customNum':customNumParam
|
|
||||||
}
|
|
||||||
openIframeMax("testForm", title, "testForm.html", '80%', '100%', param);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDevSelected() {
|
|
||||||
let url = dataUrl + '/sys/select/getDicts';
|
|
||||||
let obj = {
|
|
||||||
'code':"dev_code"
|
|
||||||
}
|
|
||||||
let params = {
|
|
||||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
|
||||||
}
|
|
||||||
|
|
||||||
ajaxRequest(url, "POST", params, true, function () {
|
|
||||||
}, function (result) {
|
|
||||||
if (result.code === 200) {
|
|
||||||
setSelectValue(result.data, 'devId');
|
|
||||||
// return result.data
|
|
||||||
} else {
|
|
||||||
layer.alert(result.msg, {icon: 2})
|
|
||||||
}
|
|
||||||
}, function (xhr) {
|
|
||||||
error(xhr)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*下拉选表单赋值*/
|
|
||||||
function setSelectValue(list, selectName) {
|
|
||||||
let html = '<option value="" selected>请选设备类型</option>';
|
|
||||||
$.each(list, function (index, item) {
|
|
||||||
html += '<option value="' + item.value + '">' + item.name + '</option>';
|
|
||||||
})
|
|
||||||
$('#' + selectName).empty().append(html);
|
|
||||||
layui.form.render();
|
|
||||||
}
|
|
||||||
|
|
@ -2,15 +2,15 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/css/layui.css">
|
<link rel="stylesheet" href="../../../../js/layui-v2.6.8/css/layui.css">
|
||||||
<link rel="stylesheet" href="../../../css/table-common2.css">
|
<link rel="stylesheet" href="../../../../css/table-common2.css">
|
||||||
<script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
<script src="../../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
<script src="../../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
<script src="../../../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
<script src="../../../js/publicJs.js"></script>
|
<script src="../../../../js/publicJs.js"></script>
|
||||||
<script src="../../../js/commonUtils.js"></script>
|
<script src="../../../../js/commonUtils.js"></script>
|
||||||
<script src="../../../js/openIframe.js"></script>
|
<script src="../../../../js/openIframe.js"></script>
|
||||||
<script src="../../../js/my/aes.js"></script>
|
<script src="../../../../js/my/aes.js"></script>
|
||||||
<script src="../../../js/ajaxRequest.js"></script>
|
<script src="../../../../js/ajaxRequest.js"></script>
|
||||||
<title>试验</title>
|
<title>试验</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -38,5 +38,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script src="../../../js/primaryData/child/primaryDataList.js" charset="UTF-8" type="text/javascript"></script>
|
<script src="../../../../js/basis/standard/child/testList.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue