|
@@ -1,57 +1,59 @@
|
|
-
|
|
|
|
layui.config({
|
|
layui.config({
|
|
base: '../../lib/layui/lay/mymodules/'
|
|
base: '../../lib/layui/lay/mymodules/'
|
|
- ,version: '101100'
|
|
|
|
|
|
+ , version: '101100'
|
|
}).use('eleTree');
|
|
}).use('eleTree');
|
|
layui.extend({
|
|
layui.extend({
|
|
admin: '{/}../../static/js/admin'
|
|
admin: '{/}../../static/js/admin'
|
|
});
|
|
});
|
|
-layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
|
- var $= layui.jquery,
|
|
|
|
- eleTree = layui.eleTree,
|
|
|
|
- laypage = layui.laypage,
|
|
|
|
|
|
+layui.use(['jquery', 'eleTree', 'table', 'laypage', 'form', 'admin'], function () {
|
|
|
|
+ var $ = layui.jquery,
|
|
|
|
+ eleTree = layui.eleTree,
|
|
|
|
+ laypage = layui.laypage,
|
|
form = layui.form,
|
|
form = layui.form,
|
|
- table = layui.table;
|
|
|
|
|
|
+ table = layui.table;
|
|
var addTemplateHtml = '../../pages/admin/addrecordTemplate.html';
|
|
var addTemplateHtml = '../../pages/admin/addrecordTemplate.html';
|
|
var updateRecordTemplate = '../../pages/admin/updateRecordTemplate.html';
|
|
var updateRecordTemplate = '../../pages/admin/updateRecordTemplate.html';
|
|
/*
|
|
/*
|
|
* @todo 重新计算iframe高度
|
|
* @todo 重新计算iframe高度
|
|
*/
|
|
*/
|
|
FrameWH();
|
|
FrameWH();
|
|
|
|
+
|
|
function FrameWH() {
|
|
function FrameWH() {
|
|
- var h = $(window).height()-36-46-40;
|
|
|
|
- var h1 = $(window).height()-36-25;
|
|
|
|
|
|
+ var h = $(window).height() - 36 - 46 - 40;
|
|
|
|
+ var h1 = $(window).height() - 36 - 25;
|
|
$(".weIframe").css("height", h + "px");
|
|
$(".weIframe").css("height", h + "px");
|
|
- $(".left").css("height",h1 +"px");
|
|
|
|
- $(".right_main").css("height",h1 -20+ "px");
|
|
|
|
|
|
+ $(".left").css("height", h1 + "px");
|
|
|
|
+ $(".right_main").css("height", h1 - 20 + "px");
|
|
}
|
|
}
|
|
- $(window).resize(function() {
|
|
|
|
|
|
+
|
|
|
|
+ $(window).resize(function () {
|
|
FrameWH();
|
|
FrameWH();
|
|
});
|
|
});
|
|
var belpID = 'root';
|
|
var belpID = 'root';
|
|
- sessionStorage.setItem("ztreeDepid",'root');
|
|
|
|
|
|
+ sessionStorage.setItem("ztreeDepid", 'root');
|
|
delpFun();
|
|
delpFun();
|
|
- function delpFun(){
|
|
|
|
- sessionStorage.setItem("departmentId",'root');
|
|
|
|
|
|
+
|
|
|
|
+ function delpFun() {
|
|
|
|
+ sessionStorage.setItem("departmentId", 'root');
|
|
$.ajax({
|
|
$.ajax({
|
|
- url:'http://apptest.jieweizhineng.com/api/section/getlist?userStaffNum='+getUserStaffNum(),
|
|
|
|
- method:'get',
|
|
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/section/getlist?userStaffNum=' + parent.getUserStaffNum(),
|
|
|
|
+ method: 'get',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
- success:function (res) {
|
|
|
|
- if(res.code === 0){
|
|
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.code === 0) {
|
|
var data = [res.data];
|
|
var data = [res.data];
|
|
eleTree.render({
|
|
eleTree.render({
|
|
elem: '.ele1',
|
|
elem: '.ele1',
|
|
- data:data ,
|
|
|
|
- defaultExpandAll:true,
|
|
|
|
|
|
+ data: data,
|
|
|
|
+ defaultExpandAll: true,
|
|
// showCheckbox: true,
|
|
// showCheckbox: true,
|
|
});
|
|
});
|
|
- eleTree.on("nodeClick(data)",function(d) {
|
|
|
|
- belpID = d.data.currentData.id;
|
|
|
|
- sessionStorage.setItem("departmentId",d.data.currentData.id);
|
|
|
|
- sessionStorage.setItem("ztreeDepid",d.data.currentData.id);
|
|
|
|
|
|
+ eleTree.on("nodeClick(data)", function (d) {
|
|
|
|
+ belpID = d.data.currentData.id;
|
|
|
|
+ sessionStorage.setItem("departmentId", d.data.currentData.id);
|
|
|
|
+ sessionStorage.setItem("ztreeDepid", d.data.currentData.id);
|
|
$('.stetaName').val("");
|
|
$('.stetaName').val("");
|
|
- var info={
|
|
|
|
|
|
+ var info = {
|
|
statusContent: '',
|
|
statusContent: '',
|
|
departmentId: d.data.currentData.id,
|
|
departmentId: d.data.currentData.id,
|
|
deleteStatus: 'false',
|
|
deleteStatus: 'false',
|
|
@@ -60,16 +62,17 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
};
|
|
};
|
|
getStateList(info);
|
|
getStateList(info);
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
layer.msg('请检查网路', {icon: 2});
|
|
layer.msg('请检查网路', {icon: 2});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error:function (err) {
|
|
|
|
|
|
+ error: function (err) {
|
|
layer.msg('请检查网路', {icon: 2});
|
|
layer.msg('请检查网路', {icon: 2});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- var info={
|
|
|
|
|
|
+
|
|
|
|
+ var info = {
|
|
templateName: $('.stetaName').val(),
|
|
templateName: $('.stetaName').val(),
|
|
departmentId: 'root',
|
|
departmentId: 'root',
|
|
deleteStatus: 'false',
|
|
deleteStatus: 'false',
|
|
@@ -77,6 +80,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
pageSize: '1',
|
|
pageSize: '1',
|
|
};
|
|
};
|
|
getStateList(info);
|
|
getStateList(info);
|
|
|
|
+
|
|
function getStateList(res) {
|
|
function getStateList(res) {
|
|
var index = layer.load(2);
|
|
var index = layer.load(2);
|
|
table.render({
|
|
table.render({
|
|
@@ -85,7 +89,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
id: 'recordTemplateID',
|
|
id: 'recordTemplateID',
|
|
method: 'get',
|
|
method: 'get',
|
|
loading: true,
|
|
loading: true,
|
|
- page:true,
|
|
|
|
|
|
+ page: true,
|
|
cols: [[
|
|
cols: [[
|
|
{field: 'templateName', title: '模版名称', align: 'center'}
|
|
{field: 'templateName', title: '模版名称', align: 'center'}
|
|
, {field: 'createDate', title: '创建日期', align: 'center'}
|
|
, {field: 'createDate', title: '创建日期', align: 'center'}
|
|
@@ -98,8 +102,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
},
|
|
},
|
|
request: {
|
|
request: {
|
|
pageName: 'pageNumber' //页码的参数名称,默认:page
|
|
pageName: 'pageNumber' //页码的参数名称,默认:page
|
|
- ,limitName: 'pageSize' //每页数据量的参数名,默认:limit
|
|
|
|
- },
|
|
|
|
|
|
+ , limitName: 'pageSize' //每页数据量的参数名,默认:limit
|
|
|
|
+ },
|
|
response: {
|
|
response: {
|
|
// pageNumber: 'pageNumber', //页码的参数名称,默认:page
|
|
// pageNumber: 'pageNumber', //页码的参数名称,默认:page
|
|
// pageSize : 'limitName', //每页数据量的参数名,默认:limit
|
|
// pageSize : 'limitName', //每页数据量的参数名,默认:limit
|
|
@@ -111,27 +115,28 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
done: function (res, curr, count) {
|
|
done: function (res, curr, count) {
|
|
layer.close(index);
|
|
layer.close(index);
|
|
if (res.code === '200') {
|
|
if (res.code === '200') {
|
|
- $('.fr').html('共有数据:'+res.count+' 条')
|
|
|
|
|
|
+ $('.fr').html('共有数据:' + res.count + ' 条')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
// 查询
|
|
// 查询
|
|
$(".seachSteta").click(function () {
|
|
$(".seachSteta").click(function () {
|
|
var checkbox = $("#checkboxT").prop('checked'),
|
|
var checkbox = $("#checkboxT").prop('checked'),
|
|
- root='',
|
|
|
|
|
|
+ root = '',
|
|
info;
|
|
info;
|
|
- if(checkbox == true){
|
|
|
|
|
|
+ if (checkbox == true) {
|
|
root = '';
|
|
root = '';
|
|
- info={
|
|
|
|
|
|
+ info = {
|
|
statusContent: $('.stetaName').val(),
|
|
statusContent: $('.stetaName').val(),
|
|
departmentId: root,
|
|
departmentId: root,
|
|
deleteStatus: 'false',
|
|
deleteStatus: 'false',
|
|
pageNumber: '1',
|
|
pageNumber: '1',
|
|
pageSize: '1',
|
|
pageSize: '1',
|
|
};
|
|
};
|
|
- }else {
|
|
|
|
- info={
|
|
|
|
|
|
+ } else {
|
|
|
|
+ info = {
|
|
statusContent: $('.stetaName').val(),
|
|
statusContent: $('.stetaName').val(),
|
|
departmentId: belpID,
|
|
departmentId: belpID,
|
|
deleteStatus: 'false',
|
|
deleteStatus: 'false',
|
|
@@ -142,43 +147,43 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
getStateList(info)
|
|
getStateList(info)
|
|
});
|
|
});
|
|
// 监听状态table
|
|
// 监听状态table
|
|
- table.on('tool(recordTemplateID)', function(obj) {
|
|
|
|
- if( obj.event === "move"){
|
|
|
|
- sessionStorage.setItem("statusId",obj.data.id);
|
|
|
|
- moveDep('选择部门信息','http://apptest.jieweizhineng.com/api/swagger/api/template/v1/moveRecordTemplate/','400','500',table,'recordTemplateID');
|
|
|
|
- } else if (obj.event === "copy"){
|
|
|
|
- var content ={
|
|
|
|
- _method:'put'
|
|
|
|
|
|
+ table.on('tool(recordTemplateID)', function (obj) {
|
|
|
|
+ if (obj.event === "move") {
|
|
|
|
+ sessionStorage.setItem("statusId", obj.data.id);
|
|
|
|
+ moveDep('选择部门信息', 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/moveRecordTemplate/', '400', '500', table, 'recordTemplateID');
|
|
|
|
+ } else if (obj.event === "copy") {
|
|
|
|
+ var content = {
|
|
|
|
+ _method: 'put'
|
|
};
|
|
};
|
|
- layer.alert('确认要复制记录模板吗?',{icon: 8}, function(index){
|
|
|
|
|
|
+ layer.alert('确认要复制记录模板吗?', {icon: 8}, function (index) {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/copyRecordTemplate/'+obj.data.id,
|
|
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/copyRecordTemplate/' + obj.data.id,
|
|
method: 'post',
|
|
method: 'post',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
data: content,
|
|
data: content,
|
|
success: function (res) {
|
|
success: function (res) {
|
|
- if (res.code === '200'){
|
|
|
|
|
|
+ if (res.code === '200') {
|
|
layer.msg('复制成功', {icon: 1});
|
|
layer.msg('复制成功', {icon: 1});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
- } else{
|
|
|
|
|
|
+ } else {
|
|
layer.msg('复制失败', {icon: 2});
|
|
layer.msg('复制失败', {icon: 2});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
}
|
|
}
|
|
layer.close(index);
|
|
layer.close(index);
|
|
},
|
|
},
|
|
- error:function () {
|
|
|
|
|
|
+ error: function () {
|
|
layer.msg('请检查网络', {icon: 2});
|
|
layer.msg('请检查网络', {icon: 2});
|
|
layer.close(index);
|
|
layer.close(index);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- } else if (obj.event === "edit"){
|
|
|
|
|
|
+ } else if (obj.event === "edit") {
|
|
layer.open({
|
|
layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
id: 'updateTemplate',
|
|
id: 'updateTemplate',
|
|
- title:'修改记录模版',
|
|
|
|
|
|
+ title: '修改记录模版',
|
|
shadeClose: true,
|
|
shadeClose: true,
|
|
- scrollbar:true,
|
|
|
|
|
|
+ scrollbar: true,
|
|
shade: 0.3,
|
|
shade: 0.3,
|
|
maxmin: true,
|
|
maxmin: true,
|
|
skin: 'oaBtn',
|
|
skin: 'oaBtn',
|
|
@@ -188,26 +193,26 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
success: function (layero, index) {
|
|
success: function (layero, index) {
|
|
var body = layer.getChildFrame('body', index);
|
|
var body = layer.getChildFrame('body', index);
|
|
body.find('#stetaName').val(obj.data.statusContent);
|
|
body.find('#stetaName').val(obj.data.statusContent);
|
|
- var iframeWindow = window['layui-layer-iframe'+ index];
|
|
|
|
- var selectVal =[];
|
|
|
|
|
|
+ var iframeWindow = window['layui-layer-iframe' + index];
|
|
|
|
+ var selectVal = [];
|
|
iframeWindow.layui.form.render();
|
|
iframeWindow.layui.form.render();
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/getRecordTemplate/'+obj.data.id,
|
|
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/getRecordTemplate/' + obj.data.id,
|
|
method: 'get',
|
|
method: 'get',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
success: function (res) {
|
|
success: function (res) {
|
|
body.find(".TemplateName").val(res.data.templateName);
|
|
body.find(".TemplateName").val(res.data.templateName);
|
|
body.find(".Templatereamk").val(res.data.remark);
|
|
body.find(".Templatereamk").val(res.data.remark);
|
|
// body.find(".inputCheckbox").attr("checked",'checked')
|
|
// body.find(".inputCheckbox").attr("checked",'checked')
|
|
- if (res.data.statusContent == ''&& res.data.statusName == ''){
|
|
|
|
- body.find(".changeSteta").attr("checked",'checked');
|
|
|
|
|
|
+ if (res.data.statusContent == '' && res.data.statusName == '') {
|
|
|
|
+ body.find(".changeSteta").attr("checked", 'checked');
|
|
body.find(".textSteta").removeAttr('checked');
|
|
body.find(".textSteta").removeAttr('checked');
|
|
body.find('.a_inputs').show();
|
|
body.find('.a_inputs').show();
|
|
body.find(".a_text").addClass("a_hide");
|
|
body.find(".a_text").addClass("a_hide");
|
|
body.find(".layui-input-block1").removeClass("a_hide");
|
|
body.find(".layui-input-block1").removeClass("a_hide");
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
body.find(".changeSteta").removeAttr("checked");
|
|
body.find(".changeSteta").removeAttr("checked");
|
|
- body.find(".textSteta").attr('checked','checked');
|
|
|
|
|
|
+ body.find(".textSteta").attr('checked', 'checked');
|
|
body.find('.a_inputs').hide();
|
|
body.find('.a_inputs').hide();
|
|
body.find(".a_text").removeClass("a_hide");
|
|
body.find(".a_text").removeClass("a_hide");
|
|
body.find(".layui-input-block1").addClass("a_hide");
|
|
body.find(".layui-input-block1").addClass("a_hide");
|
|
@@ -215,12 +220,12 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
body.find(".textName").val(res.data.statusName);
|
|
body.find(".textName").val(res.data.statusName);
|
|
}
|
|
}
|
|
// 记录状态
|
|
// 记录状态
|
|
- if (res.data.recordStatusList !=null) {
|
|
|
|
- sessionStorage.setItem('groudBool','false');
|
|
|
|
- sessionStorage.setItem("addgroudBool",'false');
|
|
|
|
|
|
+ if (res.data.recordStatusList != null) {
|
|
|
|
+ sessionStorage.setItem('groudBool', 'false');
|
|
|
|
+ sessionStorage.setItem("addgroudBool", 'false');
|
|
for (var i = 0; i < res.data.recordStatusList.length; i++) {
|
|
for (var i = 0; i < res.data.recordStatusList.length; i++) {
|
|
if (res.data.recordStatusList[i].isEchart == false) {
|
|
if (res.data.recordStatusList[i].isEchart == false) {
|
|
- var str =`
|
|
|
|
|
|
+ var str = `
|
|
<div class="a_input" inputState-id="${res.data.recordStatusList[i].id}" deleteFlag="false">
|
|
<div class="a_input" inputState-id="${res.data.recordStatusList[i].id}" deleteFlag="false">
|
|
<input type="text" value="${res.data.recordStatusList[i].statusContent}" state-id="${res.data.recordStatusList[i].statusId}" style="width: 80%;" placeholder="请输入状态名称" checkbox-boole="${res.data.recordStatusList[i].isEchart}" name="number" autocomplete="off" class="layui-input a_stateName">
|
|
<input type="text" value="${res.data.recordStatusList[i].statusContent}" state-id="${res.data.recordStatusList[i].statusId}" style="width: 80%;" placeholder="请输入状态名称" checkbox-boole="${res.data.recordStatusList[i].isEchart}" name="number" autocomplete="off" class="layui-input a_stateName">
|
|
<div class="operation_trem">
|
|
<div class="operation_trem">
|
|
@@ -229,8 +234,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
</div>`;
|
|
body.find('.a_inputs').append(str);
|
|
body.find('.a_inputs').append(str);
|
|
- }else {
|
|
|
|
- var str =`
|
|
|
|
|
|
+ } else {
|
|
|
|
+ var str = `
|
|
<div class="a_input" inputState-id="${res.data.recordStatusList[i].id}" deleteFlag="false">
|
|
<div class="a_input" inputState-id="${res.data.recordStatusList[i].id}" deleteFlag="false">
|
|
<input type="text" value="${res.data.recordStatusList[i].statusContent}" state-id="${res.data.recordStatusList[i].statusId}" style="width: 80%;" placeholder="请输入状态名称" checkbox-boole="${res.data.recordStatusList[i].isEchart}" name="number" autocomplete="off" class="layui-input a_stateName">
|
|
<input type="text" value="${res.data.recordStatusList[i].statusContent}" state-id="${res.data.recordStatusList[i].statusId}" style="width: 80%;" placeholder="请输入状态名称" checkbox-boole="${res.data.recordStatusList[i].isEchart}" name="number" autocomplete="off" class="layui-input a_stateName">
|
|
<div class="operation_trem">
|
|
<div class="operation_trem">
|
|
@@ -241,61 +246,61 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
body.find('.a_inputs').append(str);
|
|
body.find('.a_inputs').append(str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- sessionStorage.setItem('groudBool','true');
|
|
|
|
- sessionStorage.setItem("addgroudBool",'true');
|
|
|
|
|
|
+ } else {
|
|
|
|
+ sessionStorage.setItem('groudBool', 'true');
|
|
|
|
+ sessionStorage.setItem("addgroudBool", 'true');
|
|
}
|
|
}
|
|
// 特殊记录项和记录项
|
|
// 特殊记录项和记录项
|
|
- var num =0;
|
|
|
|
|
|
+ var num = 0;
|
|
for (var j = 0; j < res.data.inputList.length; j++) {
|
|
for (var j = 0; j < res.data.inputList.length; j++) {
|
|
- if(res.data.inputList[j].special == true){
|
|
|
|
|
|
+ if (res.data.inputList[j].special == true) {
|
|
body.find(".specialName").val(res.data.inputList[j].inputName);
|
|
body.find(".specialName").val(res.data.inputList[j].inputName);
|
|
body.find(".specialRemarks").val(res.data.inputList[j].remark);
|
|
body.find(".specialRemarks").val(res.data.inputList[j].remark);
|
|
body.find(".specialSelect").val(res.data.inputList[j].inputType);
|
|
body.find(".specialSelect").val(res.data.inputList[j].inputType);
|
|
- body.find(".T_recordterm").attr("recordterm-id",res.data.inputList[j].id);
|
|
|
|
- }else {
|
|
|
|
|
|
+ body.find(".T_recordterm").attr("recordterm-id", res.data.inputList[j].id);
|
|
|
|
+ } else {
|
|
selectVal.push(res.data.inputList[j].inputType);
|
|
selectVal.push(res.data.inputList[j].inputType);
|
|
var json = JSON.stringify(res.data.inputList[j].inputItemList);
|
|
var json = JSON.stringify(res.data.inputList[j].inputItemList);
|
|
- var str =`
|
|
|
|
|
|
+ var str = `
|
|
<div class="record_term border_t_n" record-id="${res.data.inputList[j].id}" deleteFlag="false">
|
|
<div class="record_term border_t_n" record-id="${res.data.inputList[j].id}" deleteFlag="false">
|
|
- <div class="a_T a_checkbox1" style="width: ${res.data.inputList[j].inputType == "photo"?"10%":"11%"}">
|
|
|
|
- ${res.data.inputList[j].isOptional== false?
|
|
|
|
- "<input type=\"checkbox\" title=\"必选\" class=\"mandatory\" lay-filter=\"mandatory\" checkbox-mandatory=\"false\">\n"
|
|
|
|
- :
|
|
|
|
- "<input type=\"checkbox\" title=\"必选\" class=\"mandatory\" checked lay-filter=\"mandatory\" checkbox-mandatory=\"true\">\n"
|
|
|
|
- }
|
|
|
|
|
|
+ <div class="a_T a_checkbox1" style="width: ${res.data.inputList[j].inputType == "photo" ? "10%" : "11%"}">
|
|
|
|
+ ${res.data.inputList[j].isOptional == false ?
|
|
|
|
+ "<input type=\"checkbox\" title=\"必选\" class=\"mandatory\" lay-filter=\"mandatory\" checkbox-mandatory=\"false\">\n"
|
|
|
|
+ :
|
|
|
|
+ "<input type=\"checkbox\" title=\"必选\" class=\"mandatory\" checked lay-filter=\"mandatory\" checkbox-mandatory=\"true\">\n"
|
|
|
|
+ }
|
|
</div>
|
|
</div>
|
|
- <div class="a_T record_term_name" style="width:${res.data.inputList[j].inputType == "photo"?"17%":"20%"}">
|
|
|
|
- <input type="text" placeholder="请输入字段名称" class="layui-input fieldName ${j == 0?'fieldName1' : ""}" value="${res.data.inputList[j].inputName}">
|
|
|
|
|
|
+ <div class="a_T record_term_name" style="width:${res.data.inputList[j].inputType == "photo" ? "17%" : "20%"}">
|
|
|
|
+ <input type="text" placeholder="请输入字段名称" class="layui-input fieldName ${j == 0 ? 'fieldName1' : ""}" value="${res.data.inputList[j].inputName}">
|
|
</div>
|
|
</div>
|
|
- <div class="a_T record_term_remarks" style="width: ${res.data.inputList[j].inputType == "photo"?"17%":"20%"}">
|
|
|
|
|
|
+ <div class="a_T record_term_remarks" style="width: ${res.data.inputList[j].inputType == "photo" ? "17%" : "20%"}">
|
|
<input type="text" placeholder="请输入字段备注" class="layui-input fieldType"value="${res.data.inputList[j].remark}">
|
|
<input type="text" placeholder="请输入字段备注" class="layui-input fieldType"value="${res.data.inputList[j].remark}">
|
|
</div>
|
|
</div>
|
|
- <div class="a_T record_term_select" style="width: ${res.data.inputList[j].inputType == "photo"?"13%":"15%"}">
|
|
|
|
- <select name="inputType" class="select-box select-box${num++} ${j ==0?"select-boxsa":""}" " lay-filter="inputType">
|
|
|
|
|
|
+ <div class="a_T record_term_select" style="width: ${res.data.inputList[j].inputType == "photo" ? "13%" : "15%"}">
|
|
|
|
+ <select name="inputType" class="select-box select-box${num++} ${j == 0 ? "select-boxsa" : ""}" " lay-filter="inputType">
|
|
<option value="">--请选择--</option>
|
|
<option value="">--请选择--</option>
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
- <div class="a_T record_term_select1 ${res.data.inputList[j].inputType == "photo"?"":"a_hide"}" style="width: 10%">
|
|
|
|
|
|
+ <div class="a_T record_term_select1 ${res.data.inputList[j].inputType == "photo" ? "" : "a_hide"}" style="width: 10%">
|
|
<select name="interest" lay-filter="photo" class="businessType">
|
|
<select name="interest" lay-filter="photo" class="businessType">
|
|
- ${res.data.inputList[j].businessType == "remote"?
|
|
|
|
- "<option value=\"\">--请选择--</option>"+"<option value=\"local\">本地</option>"+" <option value=\"remote\" selected>拍照</option>"
|
|
|
|
- :
|
|
|
|
- "<option value=\"\">--请选择--</option>"+"<option value=\"local\" selected>本地</option>"+" <option value=\"remote\">拍照</option>"
|
|
|
|
- }
|
|
|
|
|
|
+ ${res.data.inputList[j].businessType == "remote" ?
|
|
|
|
+ "<option value=\"\">--请选择--</option>" + "<option value=\"local\">本地</option>" + " <option value=\"remote\" selected>拍照</option>"
|
|
|
|
+ :
|
|
|
|
+ "<option value=\"\">--请选择--</option>" + "<option value=\"local\" selected>本地</option>" + " <option value=\"remote\">拍照</option>"
|
|
|
|
+ }
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="a_T a_checkbox" style="width: 15%">
|
|
<div class="a_T a_checkbox" style="width: 15%">
|
|
${res.data.inputList[j].isEchart == false ?
|
|
${res.data.inputList[j].isEchart == false ?
|
|
- "<input type=\"checkbox\" title=\"统计标识\" class=\"isEchart\" lay-filter=\"isEchart\" checkbox-isEchart=\"false\">\n"
|
|
|
|
- :
|
|
|
|
- "<input type=\"checkbox\" title=\"统计标识\" class=\"isEchart\" checked lay-filter=\"isEchart\" checkbox-isEchart=\"true\">\n"
|
|
|
|
- }
|
|
|
|
|
|
+ "<input type=\"checkbox\" title=\"统计标识\" class=\"isEchart\" lay-filter=\"isEchart\" checkbox-isEchart=\"false\">\n"
|
|
|
|
+ :
|
|
|
|
+ "<input type=\"checkbox\" title=\"统计标识\" class=\"isEchart\" checked lay-filter=\"isEchart\" checkbox-isEchart=\"true\">\n"
|
|
|
|
+ }
|
|
</div>
|
|
</div>
|
|
<div class="a_T a_operation" style="width: 15%">
|
|
<div class="a_T a_operation" style="width: 15%">
|
|
<span class="moveUp">上移</span>
|
|
<span class="moveUp">上移</span>
|
|
<span class="moveDown">下移</span>
|
|
<span class="moveDown">下移</span>
|
|
- <span class="edit_record ${res.data.inputList[j].inputType == "checkbox" || res.data.inputList[j].inputType == "radio"? "" : "a_hide"}">编辑</span>
|
|
|
|
|
|
+ <span class="edit_record ${res.data.inputList[j].inputType == "checkbox" || res.data.inputList[j].inputType == "radio" ? "" : "a_hide"}">编辑</span>
|
|
<span class="delete_record_term">删除</span>
|
|
<span class="delete_record_term">删除</span>
|
|
</div>
|
|
</div>
|
|
<!--<input type="text" class="inputJson" style="display: none;" value="${json}">-->
|
|
<!--<input type="text" class="inputJson" style="display: none;" value="${json}">-->
|
|
@@ -307,7 +312,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
// sessionStorage.setItem("inputItemList",JSON.stringify(res.data.inputList[j].inputItemList))
|
|
// sessionStorage.setItem("inputItemList",JSON.stringify(res.data.inputList[j].inputItemList))
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
// 检查项
|
|
// 检查项
|
|
var selectNum = 0;
|
|
var selectNum = 0;
|
|
for (var r = 0; r < res.data.checkItemList.length; r++) {
|
|
for (var r = 0; r < res.data.checkItemList.length; r++) {
|
|
@@ -319,9 +325,9 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
</div>
|
|
</div>
|
|
<div class="a_T inspect_term_select border_t_n" style="width: 30%">
|
|
<div class="a_T inspect_term_select border_t_n" style="width: 30%">
|
|
<select name="interest" class="inspect_select" lay-filter="inspect_select">
|
|
<select name="interest" class="inspect_select" lay-filter="inspect_select">
|
|
- ${res.data.checkItemList[r].group.checkType=="checkbox"?
|
|
|
|
- "<option value=\"checkbox\" selected=\"selected\">多选</option>"+"<option value=\"radio\">单选</option>"
|
|
|
|
- :"<option value=\"checkbox\">多选</option>"+"<option value=\"radio\" selected=\"selected\">单选</option>"}
|
|
|
|
|
|
+ ${res.data.checkItemList[r].group.checkType == "checkbox" ?
|
|
|
|
+ "<option value=\"checkbox\" selected=\"selected\">多选</option>" + "<option value=\"radio\">单选</option>"
|
|
|
|
+ : "<option value=\"checkbox\">多选</option>" + "<option value=\"radio\" selected=\"selected\">单选</option>"}
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -339,8 +345,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
|
|
|
body.find(".inspect_termList").append(str);
|
|
body.find(".inspect_termList").append(str);
|
|
var arrSlice = res.data.checkItemList[r].checkItemList.slice(1);
|
|
var arrSlice = res.data.checkItemList[r].checkItemList.slice(1);
|
|
- for (var q=0;q<arrSlice.length; q++){
|
|
|
|
- var html =`<div class="inspect_term_info" inspect-id="${arrSlice[q].id}" deleteFlag="false">
|
|
|
|
|
|
+ for (var q = 0; q < arrSlice.length; q++) {
|
|
|
|
+ var html = `<div class="inspect_term_info" inspect-id="${arrSlice[q].id}" deleteFlag="false">
|
|
<div class="inspect_term_input border_t_n" style="width: 70%;">
|
|
<div class="inspect_term_input border_t_n" style="width: 70%;">
|
|
<input type="text" class="layui-input inspectInfo" placeholder="请输入检查项信息" value="${arrSlice[q].itemValue}">
|
|
<input type="text" class="layui-input inspectInfo" placeholder="请输入检查项信息" value="${arrSlice[q].itemValue}">
|
|
</div>
|
|
</div>
|
|
@@ -349,13 +355,13 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
<span class="delete_inspectInfo">删除</span>
|
|
<span class="delete_inspectInfo">删除</span>
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
</div>`;
|
|
- body.find(".inspect_term_infoss"+r).append(html);
|
|
|
|
|
|
+ body.find(".inspect_term_infoss" + r).append(html);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- getInputType(body,iframeWindow,selectVal);
|
|
|
|
|
|
+ getInputType(body, iframeWindow, selectVal);
|
|
iframeWindow.layui.form.render();
|
|
iframeWindow.layui.form.render();
|
|
},
|
|
},
|
|
- error:function () {
|
|
|
|
|
|
+ error: function () {
|
|
layer.msg('请检查网络', {icon: 2});
|
|
layer.msg('请检查网络', {icon: 2});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -367,14 +373,14 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (sessionStorage.getItem("groudBool") == 'true' && !reg.test(body.find(".textContent").val())&&!reg.test(body.find(".textName").val())) {
|
|
|
|
|
|
+ if (sessionStorage.getItem("groudBool") == 'true' && !reg.test(body.find(".textContent").val()) && !reg.test(body.find(".textName").val())) {
|
|
layer.msg('请输入文本状态', {icon: 8});
|
|
layer.msg('请输入文本状态', {icon: 8});
|
|
return false;
|
|
return false;
|
|
- }else if (sessionStorage.getItem("addgroudBool") == 'false' && !reg.test(body.find(".a_stateName1").val())) {
|
|
|
|
|
|
+ } else if (sessionStorage.getItem("addgroudBool") == 'false' && !reg.test(body.find(".a_stateName1").val())) {
|
|
layer.msg('请选择状态组', {icon: 8});
|
|
layer.msg('请选择状态组', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (!reg.test(body.find(".fieldName1").val())|| body.find('.select-boxsa').val() == "") {
|
|
|
|
|
|
+ if (!reg.test(body.find(".fieldName1").val()) || body.find('.select-boxsa').val() == "") {
|
|
layer.msg('请填写记录项字段或类型', {icon: 8});
|
|
layer.msg('请填写记录项字段或类型', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -384,13 +390,13 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
valArray = [],
|
|
valArray = [],
|
|
cheackboxBoolArray = [],
|
|
cheackboxBoolArray = [],
|
|
recordStatusList = [],
|
|
recordStatusList = [],
|
|
- inputStateID =[],
|
|
|
|
|
|
+ inputStateID = [],
|
|
deleteFlagBool = [],
|
|
deleteFlagBool = [],
|
|
deleteStateGroup = body.find(".deleteStateGroup").val(),
|
|
deleteStateGroup = body.find(".deleteStateGroup").val(),
|
|
- recordStatusObj ={isEchart:"",statusContent:'',statusId:'',id:'',deleteFlag:''};
|
|
|
|
|
|
+ recordStatusObj = {isEchart: "", statusContent: '', statusId: '', id: '', deleteFlag: ''};
|
|
if (deleteStateGroup != "") {
|
|
if (deleteStateGroup != "") {
|
|
- var deleteStateGroups=JSON.parse(deleteStateGroup);
|
|
|
|
- for (var o =0;o<deleteStateGroups.length;o++) {
|
|
|
|
|
|
+ var deleteStateGroups = JSON.parse(deleteStateGroup);
|
|
|
|
+ for (var o = 0; o < deleteStateGroups.length; o++) {
|
|
recordStatusList.push(deleteStateGroups[o])
|
|
recordStatusList.push(deleteStateGroups[o])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -416,10 +422,10 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
recordStatusObj.deleteFlag = true;
|
|
recordStatusObj.deleteFlag = true;
|
|
recordStatusList.push(recordStatusObj)
|
|
recordStatusList.push(recordStatusObj)
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
recordStatusObj = {};
|
|
recordStatusObj = {};
|
|
- if (reg.test(valArray[i])){
|
|
|
|
|
|
+ if (reg.test(valArray[i])) {
|
|
recordStatusObj.isEchart = cheackboxBoolArray[i];
|
|
recordStatusObj.isEchart = cheackboxBoolArray[i];
|
|
recordStatusObj.statusContent = valArray[i];
|
|
recordStatusObj.statusContent = valArray[i];
|
|
recordStatusObj.statusId = stateIDArray[i];
|
|
recordStatusObj.statusId = stateIDArray[i];
|
|
@@ -430,23 +436,50 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 记录项
|
|
// 记录项
|
|
- var inputList = {businessType:'',inputItems:[],inputName:'',inputType:'',isEchart:'',isOptional:'',remark:'',special:'',zIndex:'',id:'',deleteFlag:''},
|
|
|
|
- value,fieldType,inputItems,mandatory,isEchart,inputType,businessType,id,deleteFlag;
|
|
|
|
|
|
+ var inputList = {
|
|
|
|
+ businessType: '',
|
|
|
|
+ inputItems: [],
|
|
|
|
+ inputName: '',
|
|
|
|
+ inputType: '',
|
|
|
|
+ isEchart: '',
|
|
|
|
+ isOptional: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ special: '',
|
|
|
|
+ zIndex: '',
|
|
|
|
+ id: '',
|
|
|
|
+ deleteFlag: ''
|
|
|
|
+ },
|
|
|
|
+ value, fieldType, inputItems, mandatory, isEchart, inputType, businessType, id, deleteFlag;
|
|
var record_term = body.find(".record_term");
|
|
var record_term = body.find(".record_term");
|
|
- var recordArray =[];
|
|
|
|
|
|
+ var recordArray = [];
|
|
var n;
|
|
var n;
|
|
// 特殊记录项
|
|
// 特殊记录项
|
|
- var specialObj= {businessType:'',inputItems:[],inputName:"",inputType:'',isEchart:'false',isOptional:'false',remark:'',special:'true',zIndex:1,id:'',deleteFlag:'false'};
|
|
|
|
- var specialName = body.find(".specialName").val(),specialRemarks = body.find(".specialRemarks").val(),specialSelect = body.find(".specialSelect").val(),specialID= body.find(".T_recordterm").attr("recordterm-id");
|
|
|
|
|
|
+ var specialObj = {
|
|
|
|
+ businessType: '',
|
|
|
|
+ inputItems: [],
|
|
|
|
+ inputName: "",
|
|
|
|
+ inputType: '',
|
|
|
|
+ isEchart: 'false',
|
|
|
|
+ isOptional: 'false',
|
|
|
|
+ remark: '',
|
|
|
|
+ special: 'true',
|
|
|
|
+ zIndex: 1,
|
|
|
|
+ id: '',
|
|
|
|
+ deleteFlag: 'false'
|
|
|
|
+ };
|
|
|
|
+ var specialName = body.find(".specialName").val(),
|
|
|
|
+ specialRemarks = body.find(".specialRemarks").val(),
|
|
|
|
+ specialSelect = body.find(".specialSelect").val(),
|
|
|
|
+ specialID = body.find(".T_recordterm").attr("recordterm-id");
|
|
if (specialName != "" && specialRemarks != "" && specialSelect != "") {
|
|
if (specialName != "" && specialRemarks != "" && specialSelect != "") {
|
|
specialObj.inputName = specialName;
|
|
specialObj.inputName = specialName;
|
|
specialObj.remark = specialRemarks;
|
|
specialObj.remark = specialRemarks;
|
|
specialObj.inputType = specialSelect;
|
|
specialObj.inputType = specialSelect;
|
|
specialObj.id = specialID;
|
|
specialObj.id = specialID;
|
|
recordArray.push(specialObj);
|
|
recordArray.push(specialObj);
|
|
- n= 1;
|
|
|
|
- }else {
|
|
|
|
- n= 0;
|
|
|
|
|
|
+ n = 1;
|
|
|
|
+ } else {
|
|
|
|
+ n = 0;
|
|
}
|
|
}
|
|
record_term.each(function () {
|
|
record_term.each(function () {
|
|
inputList = {};
|
|
inputList = {};
|
|
@@ -461,10 +494,10 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
if (inputType == 'checkbox' || inputType == 'radio') {
|
|
if (inputType == 'checkbox' || inputType == 'radio') {
|
|
inputItems = $(this).find(".inputJson").val();
|
|
inputItems = $(this).find(".inputJson").val();
|
|
|
|
|
|
- }else {
|
|
|
|
- inputItems =[]
|
|
|
|
|
|
+ } else {
|
|
|
|
+ inputItems = []
|
|
}
|
|
}
|
|
- if (reg.test(value) && inputType !="") {
|
|
|
|
|
|
+ if (reg.test(value) && inputType != "") {
|
|
inputList.businessType = businessType == undefined ? "" : businessType;
|
|
inputList.businessType = businessType == undefined ? "" : businessType;
|
|
inputList.inputItems = inputItems == "" ? [] : JSON.parse(inputItems);
|
|
inputList.inputItems = inputItems == "" ? [] : JSON.parse(inputItems);
|
|
inputList.inputName = value;
|
|
inputList.inputName = value;
|
|
@@ -474,7 +507,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
inputList.remark = fieldType;
|
|
inputList.remark = fieldType;
|
|
inputList.special = 'false';
|
|
inputList.special = 'false';
|
|
inputList.id = id;
|
|
inputList.id = id;
|
|
- inputList.zIndex = n++ +1;
|
|
|
|
|
|
+ inputList.zIndex = n++ + 1;
|
|
inputList.deleteFlag = deleteFlag;
|
|
inputList.deleteFlag = deleteFlag;
|
|
recordArray.push(inputList)
|
|
recordArray.push(inputList)
|
|
}
|
|
}
|
|
@@ -492,13 +525,20 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
}
|
|
}
|
|
// 检查项
|
|
// 检查项
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
- var term_nameTextarea,inspect_select,inspectInfo,checkItemArray=[],id,deleteFlag;
|
|
|
|
- var checkItemList = {checkType:'',groupName:'',itemValue:'',zIndex:'',id:'',deleteFlag:''};
|
|
|
|
|
|
+ var term_nameTextarea, inspect_select, inspectInfo, checkItemArray = [], id, deleteFlag;
|
|
|
|
+ var checkItemList = {
|
|
|
|
+ checkType: '',
|
|
|
|
+ groupName: '',
|
|
|
|
+ itemValue: '',
|
|
|
|
+ zIndex: '',
|
|
|
|
+ id: '',
|
|
|
|
+ deleteFlag: ''
|
|
|
|
+ };
|
|
var inspect_term_info = body.find(".inspect_term_info");
|
|
var inspect_term_info = body.find(".inspect_term_info");
|
|
var num = 0;
|
|
var num = 0;
|
|
var deletecheckItemArray = body.find(".deletecheckItemArray").val();
|
|
var deletecheckItemArray = body.find(".deletecheckItemArray").val();
|
|
if (deletecheckItemArray != "") {
|
|
if (deletecheckItemArray != "") {
|
|
- var deletecheckItemArrays= JSON.parse(deletecheckItemArray);
|
|
|
|
|
|
+ var deletecheckItemArrays = JSON.parse(deletecheckItemArray);
|
|
for (var r = 0; r < deletecheckItemArrays.length; r++) {
|
|
for (var r = 0; r < deletecheckItemArrays.length; r++) {
|
|
checkItemArray.push(deletecheckItemArrays[r])
|
|
checkItemArray.push(deletecheckItemArrays[r])
|
|
}
|
|
}
|
|
@@ -509,78 +549,78 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
inspect_select = $(this).parent().parent().find('.inspect_select').val();
|
|
inspect_select = $(this).parent().parent().find('.inspect_select').val();
|
|
inspectInfo = $(this).find('.inspectInfo').val();
|
|
inspectInfo = $(this).find('.inspectInfo').val();
|
|
if (reg.test(inspectInfo)) {
|
|
if (reg.test(inspectInfo)) {
|
|
- id = $(this).attr("inspect-id");
|
|
|
|
|
|
+ id = $(this).attr("inspect-id");
|
|
deleteFlag = $(this).attr('deleteFlag');
|
|
deleteFlag = $(this).attr('deleteFlag');
|
|
checkItemList.checkType = inspect_select;
|
|
checkItemList.checkType = inspect_select;
|
|
checkItemList.groupName = term_nameTextarea;
|
|
checkItemList.groupName = term_nameTextarea;
|
|
checkItemList.itemValue = inspectInfo;
|
|
checkItemList.itemValue = inspectInfo;
|
|
checkItemList.id = id;
|
|
checkItemList.id = id;
|
|
checkItemList.deleteFlag = deleteFlag;
|
|
checkItemList.deleteFlag = deleteFlag;
|
|
- checkItemList.zIndex = num++ +1;
|
|
|
|
|
|
+ checkItemList.zIndex = num++ + 1;
|
|
checkItemArray.push(checkItemList)
|
|
checkItemArray.push(checkItemList)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
var updateStetaInfo = {
|
|
var updateStetaInfo = {
|
|
- templateName:body.find(".TemplateName").val(),
|
|
|
|
- remark:body.find(".Templatereamk").val() == ""? " ":body.find(".Templatereamk").val(),
|
|
|
|
- statusContent:sessionStorage.getItem("groudBool") == 'true'?body.find(".textContent").val():"",
|
|
|
|
- statusName:sessionStorage.getItem("groudBool") == 'true'?body.find(".textName").val():"",
|
|
|
|
- departmentId:belpID,
|
|
|
|
- checkItemList:checkItemArray,
|
|
|
|
- inputList:recordArray,
|
|
|
|
- recordStatusList:recordStatusList,
|
|
|
|
- _method:'put',
|
|
|
|
- id:obj.data.id
|
|
|
|
|
|
+ templateName: body.find(".TemplateName").val(),
|
|
|
|
+ remark: body.find(".Templatereamk").val() == "" ? " " : body.find(".Templatereamk").val(),
|
|
|
|
+ statusContent: sessionStorage.getItem("groudBool") == 'true' ? body.find(".textContent").val() : "",
|
|
|
|
+ statusName: sessionStorage.getItem("groudBool") == 'true' ? body.find(".textName").val() : "",
|
|
|
|
+ departmentId: belpID,
|
|
|
|
+ checkItemList: checkItemArray,
|
|
|
|
+ inputList: recordArray,
|
|
|
|
+ recordStatusList: recordStatusList,
|
|
|
|
+ _method: 'put',
|
|
|
|
+ id: obj.data.id
|
|
|
|
|
|
};
|
|
};
|
|
$.ajax({
|
|
$.ajax({
|
|
- url:'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/updateRecordTemplate',
|
|
|
|
- method:'POST',
|
|
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/updateRecordTemplate',
|
|
|
|
+ method: 'POST',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
data: updateStetaInfo,
|
|
data: updateStetaInfo,
|
|
- success:function (res) {
|
|
|
|
- if(res.code === '200'){
|
|
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.code === '200') {
|
|
layer.msg('修改成功', {icon: 1});
|
|
layer.msg('修改成功', {icon: 1});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
layer.close(index);
|
|
layer.close(index);
|
|
- }else if (res.code === '438') {
|
|
|
|
|
|
+ } else if (res.code === '438') {
|
|
layer.msg(res.msg, {icon: 2});
|
|
layer.msg(res.msg, {icon: 2});
|
|
table.reload('recordTemplateID')
|
|
table.reload('recordTemplateID')
|
|
- }else if (res.code === '422') {
|
|
|
|
|
|
+ } else if (res.code === '422') {
|
|
layer.msg(res.data[0].error, {icon: 2});
|
|
layer.msg(res.data[0].error, {icon: 2});
|
|
table.reload('recordTemplateID')
|
|
table.reload('recordTemplateID')
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
layer.msg("添加失败,请检查信息", {icon: 2});
|
|
layer.msg("添加失败,请检查信息", {icon: 2});
|
|
table.reload('recordTemplateID')
|
|
table.reload('recordTemplateID')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error:function (err) {
|
|
|
|
|
|
+ error: function (err) {
|
|
layer.close(index);
|
|
layer.close(index);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- } else if (obj.event === "delete"){
|
|
|
|
- var content ={
|
|
|
|
- _method:'DELETE'
|
|
|
|
|
|
+ } else if (obj.event === "delete") {
|
|
|
|
+ var content = {
|
|
|
|
+ _method: 'DELETE'
|
|
};
|
|
};
|
|
- layer.alert('确认要删除吗?',{icon: 8}, function(index){
|
|
|
|
|
|
+ layer.alert('确认要删除吗?', {icon: 8}, function (index) {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/reomveRecordTemplate/'+obj.data.id,
|
|
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/reomveRecordTemplate/' + obj.data.id,
|
|
method: 'post',
|
|
method: 'post',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
data: content,
|
|
data: content,
|
|
success: function (res) {
|
|
success: function (res) {
|
|
- if (res.code === '200'){
|
|
|
|
|
|
+ if (res.code === '200') {
|
|
layer.msg('删除成功', {icon: 1});
|
|
layer.msg('删除成功', {icon: 1});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
- } else{
|
|
|
|
|
|
+ } else {
|
|
layer.msg('删除失败', {icon: 2});
|
|
layer.msg('删除失败', {icon: 2});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
}
|
|
}
|
|
layer.close(index);
|
|
layer.close(index);
|
|
},
|
|
},
|
|
- error:function () {
|
|
|
|
|
|
+ error: function () {
|
|
layer.msg('请检查网络', {icon: 2});
|
|
layer.msg('请检查网络', {icon: 2});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -593,9 +633,9 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
layer.open({
|
|
layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
id: 'addTemplate',
|
|
id: 'addTemplate',
|
|
- title:'添加记录模版',
|
|
|
|
|
|
+ title: '添加记录模版',
|
|
shadeClose: true,
|
|
shadeClose: true,
|
|
- scrollbar:true,
|
|
|
|
|
|
+ scrollbar: true,
|
|
shade: 0.3,
|
|
shade: 0.3,
|
|
maxmin: true,
|
|
maxmin: true,
|
|
skin: 'oaBtn',
|
|
skin: 'oaBtn',
|
|
@@ -604,8 +644,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
content: addTemplateHtml,
|
|
content: addTemplateHtml,
|
|
success: function (layero, index) {
|
|
success: function (layero, index) {
|
|
var body = layer.getChildFrame('body', index);
|
|
var body = layer.getChildFrame('body', index);
|
|
- sessionStorage.setItem("addgroudBool",'false');
|
|
|
|
- sessionStorage.setItem('groudBool','false');
|
|
|
|
|
|
+ sessionStorage.setItem("addgroudBool", 'false');
|
|
|
|
+ sessionStorage.setItem('groudBool', 'false');
|
|
},
|
|
},
|
|
yes: function (index, layero) {
|
|
yes: function (index, layero) {
|
|
var body = layer.getChildFrame('body', index);
|
|
var body = layer.getChildFrame('body', index);
|
|
@@ -614,14 +654,14 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (sessionStorage.getItem("groudBool") == 'true' && !reg.test(body.find(".textContent").val())&&!reg.test(body.find(".textName").val())) {
|
|
|
|
|
|
+ if (sessionStorage.getItem("groudBool") == 'true' && !reg.test(body.find(".textContent").val()) && !reg.test(body.find(".textName").val())) {
|
|
layer.msg('请输入文本状态', {icon: 8});
|
|
layer.msg('请输入文本状态', {icon: 8});
|
|
return false;
|
|
return false;
|
|
- }else if (sessionStorage.getItem("addgroudBool") == 'false' && !reg.test(body.find(".a_stateName1").val())) {
|
|
|
|
|
|
+ } else if (sessionStorage.getItem("addgroudBool") == 'false' && !reg.test(body.find(".a_stateName1").val())) {
|
|
layer.msg('请选择状态组', {icon: 8});
|
|
layer.msg('请选择状态组', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (!reg.test(body.find(".fieldName1").val())|| body.find('.select-boxsa').val() == "") {
|
|
|
|
|
|
+ if (!reg.test(body.find(".fieldName1").val()) || body.find('.select-boxsa').val() == "") {
|
|
layer.msg('请填写记录项字段或类型', {icon: 8});
|
|
layer.msg('请填写记录项字段或类型', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -631,14 +671,14 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
valArray = [],
|
|
valArray = [],
|
|
cheackboxBoolArray = [],
|
|
cheackboxBoolArray = [],
|
|
recordStatusList = [],
|
|
recordStatusList = [],
|
|
- recordStatusObj ={isEchart:"",statusContent:'',statusId:''};
|
|
|
|
|
|
+ recordStatusObj = {isEchart: "", statusContent: '', statusId: ''};
|
|
inputs.each(function () {
|
|
inputs.each(function () {
|
|
var value = $(this).find('input').val(),
|
|
var value = $(this).find('input').val(),
|
|
stateId = $(this).find("input").attr("state-id"),
|
|
stateId = $(this).find("input").attr("state-id"),
|
|
cheackboxBool = $(this).find("input").attr("checkbox-boole");
|
|
cheackboxBool = $(this).find("input").attr("checkbox-boole");
|
|
- valArray.push(value);
|
|
|
|
- stateIDArray.push(stateId);
|
|
|
|
- cheackboxBoolArray.push(cheackboxBool);
|
|
|
|
|
|
+ valArray.push(value);
|
|
|
|
+ stateIDArray.push(stateId);
|
|
|
|
+ cheackboxBoolArray.push(cheackboxBool);
|
|
});
|
|
});
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
recordStatusObj = {};
|
|
recordStatusObj = {};
|
|
@@ -648,33 +688,55 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
recordStatusObj.statusId = stateIDArray[i];
|
|
recordStatusObj.statusId = stateIDArray[i];
|
|
recordStatusList.push(recordStatusObj)
|
|
recordStatusList.push(recordStatusObj)
|
|
}
|
|
}
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
if (sessionStorage.getItem("addgroudBool") == 'true') {
|
|
if (sessionStorage.getItem("addgroudBool") == 'true') {
|
|
recordStatusList = [];
|
|
recordStatusList = [];
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if (recordStatusList == "") {
|
|
if (recordStatusList == "") {
|
|
layer.msg('至少填写一个记录状态', {icon: 8});
|
|
layer.msg('至少填写一个记录状态', {icon: 8});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 记录项
|
|
// 记录项
|
|
- var inputList = {businessType:'',inputItems:[],inputName:'',inputType:'',isEchart:'',isOptional:'',remark:'',special:'',zIndex:''},
|
|
|
|
- value,fieldType,inputItems,mandatory,isEchart,inputType,businessType;
|
|
|
|
|
|
+ var inputList = {
|
|
|
|
+ businessType: '',
|
|
|
|
+ inputItems: [],
|
|
|
|
+ inputName: '',
|
|
|
|
+ inputType: '',
|
|
|
|
+ isEchart: '',
|
|
|
|
+ isOptional: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ special: '',
|
|
|
|
+ zIndex: ''
|
|
|
|
+ },
|
|
|
|
+ value, fieldType, inputItems, mandatory, isEchart, inputType, businessType;
|
|
var record_term = body.find(".record_term");
|
|
var record_term = body.find(".record_term");
|
|
- var recordArray =[];
|
|
|
|
|
|
+ var recordArray = [];
|
|
var n;
|
|
var n;
|
|
// 特殊记录项
|
|
// 特殊记录项
|
|
- var specialObj= {businessType:'',inputItems:[],inputName:"",inputType:'',isEchart:'false',isOptional:'false',remark:'',special:'true',zIndex:1};
|
|
|
|
- var specialName = body.find(".specialName").val(),specialRemarks = body.find(".specialRemarks").val(),specialSelect = body.find(".specialSelect").val();
|
|
|
|
|
|
+ var specialObj = {
|
|
|
|
+ businessType: '',
|
|
|
|
+ inputItems: [],
|
|
|
|
+ inputName: "",
|
|
|
|
+ inputType: '',
|
|
|
|
+ isEchart: 'false',
|
|
|
|
+ isOptional: 'false',
|
|
|
|
+ remark: '',
|
|
|
|
+ special: 'true',
|
|
|
|
+ zIndex: 1
|
|
|
|
+ };
|
|
|
|
+ var specialName = body.find(".specialName").val(), specialRemarks = body.find(".specialRemarks").val(),
|
|
|
|
+ specialSelect = body.find(".specialSelect").val();
|
|
if (specialName != "" && specialRemarks != "" && specialSelect != "") {
|
|
if (specialName != "" && specialRemarks != "" && specialSelect != "") {
|
|
specialObj.inputName = specialName;
|
|
specialObj.inputName = specialName;
|
|
specialObj.remark = specialRemarks;
|
|
specialObj.remark = specialRemarks;
|
|
specialObj.inputType = specialSelect;
|
|
specialObj.inputType = specialSelect;
|
|
recordArray.push(specialObj)
|
|
recordArray.push(specialObj)
|
|
- n= 1;
|
|
|
|
- }else {
|
|
|
|
- n= 0;
|
|
|
|
|
|
+ n = 1;
|
|
|
|
+ } else {
|
|
|
|
+ n = 0;
|
|
}
|
|
}
|
|
// if (recordArray == "") {
|
|
// if (recordArray == "") {
|
|
// layer.msg('至少填写一个记录项', {icon: 8});
|
|
// layer.msg('至少填写一个记录项', {icon: 8});
|
|
@@ -693,19 +755,19 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
if (inputType == 'checkbox' || inputType == 'radio') {
|
|
if (inputType == 'checkbox' || inputType == 'radio') {
|
|
inputItems = $(this).find(".inputJson").val();
|
|
inputItems = $(this).find(".inputJson").val();
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
inputItems = []
|
|
inputItems = []
|
|
}
|
|
}
|
|
if (reg.test(value) && inputType != "") {
|
|
if (reg.test(value) && inputType != "") {
|
|
inputList.businessType = businessType == undefined ? "" : businessType;
|
|
inputList.businessType = businessType == undefined ? "" : businessType;
|
|
- inputList.inputItems = inputItems == ""? [] : JSON.parse(inputItems);
|
|
|
|
|
|
+ inputList.inputItems = inputItems == "" ? [] : JSON.parse(inputItems);
|
|
inputList.inputName = value;
|
|
inputList.inputName = value;
|
|
inputList.inputType = inputType;
|
|
inputList.inputType = inputType;
|
|
inputList.isEchart = isEchart;
|
|
inputList.isEchart = isEchart;
|
|
inputList.isOptional = mandatory;
|
|
inputList.isOptional = mandatory;
|
|
inputList.remark = fieldType;
|
|
inputList.remark = fieldType;
|
|
inputList.special = 'false';
|
|
inputList.special = 'false';
|
|
- inputList.zIndex = n++ +1;
|
|
|
|
|
|
+ inputList.zIndex = n++ + 1;
|
|
recordArray.push(inputList)
|
|
recordArray.push(inputList)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -715,8 +777,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
}
|
|
}
|
|
// 检查项
|
|
// 检查项
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
- var term_nameTextarea,inspect_select,inspectInfo,checkItemArray=[];
|
|
|
|
- var checkItemList = {checkType:'',groupName:'',itemValue:'',zIndex:''};
|
|
|
|
|
|
+ var term_nameTextarea, inspect_select, inspectInfo, checkItemArray = [];
|
|
|
|
+ var checkItemList = {checkType: '', groupName: '', itemValue: '', zIndex: ''};
|
|
var inspect_term_info = body.find(".inspect_term_info");
|
|
var inspect_term_info = body.find(".inspect_term_info");
|
|
var num = 0;
|
|
var num = 0;
|
|
inspect_term_info.each(function () {
|
|
inspect_term_info.each(function () {
|
|
@@ -728,7 +790,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
checkItemList.checkType = inspect_select;
|
|
checkItemList.checkType = inspect_select;
|
|
checkItemList.groupName = term_nameTextarea;
|
|
checkItemList.groupName = term_nameTextarea;
|
|
checkItemList.itemValue = inspectInfo;
|
|
checkItemList.itemValue = inspectInfo;
|
|
- checkItemList.zIndex = num++ +1;
|
|
|
|
|
|
+ checkItemList.zIndex = num++ + 1;
|
|
checkItemArray.push(checkItemList)
|
|
checkItemArray.push(checkItemList)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -736,65 +798,66 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
recordStatusList = [];
|
|
recordStatusList = [];
|
|
}
|
|
}
|
|
var addStetaInfo = {
|
|
var addStetaInfo = {
|
|
- templateName:body.find(".TemplateName").val() == ""? "":body.find(".TemplateName").val(),
|
|
|
|
- remark:body.find(".Templatereamk").val() == "" ? "":body.find(".Templatereamk").val(),
|
|
|
|
- statusContent:sessionStorage.getItem("addgroudBool") == 'true'? body.find(".textContent").val() :"",
|
|
|
|
- statusName:sessionStorage.getItem("addgroudBool") == 'true'? body.find(".textName").val() :"",
|
|
|
|
- departmentId:belpID,
|
|
|
|
- checkItemList:checkItemArray,
|
|
|
|
- inputList:recordArray,
|
|
|
|
- recordStatusList:recordStatusList,
|
|
|
|
|
|
+ templateName: body.find(".TemplateName").val() == "" ? "" : body.find(".TemplateName").val(),
|
|
|
|
+ remark: body.find(".Templatereamk").val() == "" ? "" : body.find(".Templatereamk").val(),
|
|
|
|
+ statusContent: sessionStorage.getItem("addgroudBool") == 'true' ? body.find(".textContent").val() : "",
|
|
|
|
+ statusName: sessionStorage.getItem("addgroudBool") == 'true' ? body.find(".textName").val() : "",
|
|
|
|
+ departmentId: belpID,
|
|
|
|
+ checkItemList: checkItemArray,
|
|
|
|
+ inputList: recordArray,
|
|
|
|
+ recordStatusList: recordStatusList,
|
|
};
|
|
};
|
|
$.ajax({
|
|
$.ajax({
|
|
- method:'post',
|
|
|
|
- url:'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/addRecordTemplate',
|
|
|
|
- data:addStetaInfo,
|
|
|
|
- dataType:'json',
|
|
|
|
- success:function (res) {
|
|
|
|
- if(res.code === '200'){
|
|
|
|
|
|
+ method: 'post',
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/addRecordTemplate',
|
|
|
|
+ data: addStetaInfo,
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.code === '200') {
|
|
layer.msg('添加成功', {icon: 1});
|
|
layer.msg('添加成功', {icon: 1});
|
|
table.reload('recordTemplateID');
|
|
table.reload('recordTemplateID');
|
|
layer.close(index);
|
|
layer.close(index);
|
|
- }else if (res.code === '438') {
|
|
|
|
|
|
+ } else if (res.code === '438') {
|
|
layer.msg(res.code.msg, {icon: 2});
|
|
layer.msg(res.code.msg, {icon: 2});
|
|
table.reload('recordTemplateID')
|
|
table.reload('recordTemplateID')
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
layer.msg("添加失败,请检查信息", {icon: 2});
|
|
layer.msg("添加失败,请检查信息", {icon: 2});
|
|
table.reload('recordTemplateID')
|
|
table.reload('recordTemplateID')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error:function (err) {
|
|
|
|
|
|
+ error: function (err) {
|
|
layer.msg('网络错误', {icon: 2});
|
|
layer.msg('网络错误', {icon: 2});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
+
|
|
// 记录类型
|
|
// 记录类型
|
|
- function getInputType(body,iframeWin,arr){
|
|
|
|
|
|
+ function getInputType(body, iframeWin, arr) {
|
|
// select-box
|
|
// select-box
|
|
$.ajax({
|
|
$.ajax({
|
|
- method:'get',
|
|
|
|
- url:'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/getInputTypeList',
|
|
|
|
- data:'',
|
|
|
|
- dataType:'json',
|
|
|
|
- success:function (res) {
|
|
|
|
|
|
+ method: 'get',
|
|
|
|
+ url: 'http://apptest.jieweizhineng.com/api/swagger/api/template/v1/getInputTypeList',
|
|
|
|
+ data: '',
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (res) {
|
|
if (res.code === '200') {
|
|
if (res.code === '200') {
|
|
var str;
|
|
var str;
|
|
- for (key in res.data){
|
|
|
|
|
|
+ for (key in res.data) {
|
|
for (var k = 0; k < arr.length; k++) {
|
|
for (var k = 0; k < arr.length; k++) {
|
|
if (key == arr[k]) {
|
|
if (key == arr[k]) {
|
|
str = `<option value="${key}" selected>${res.data[key]}</option>`;
|
|
str = `<option value="${key}" selected>${res.data[key]}</option>`;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
str = `<option value="${key}">${res.data[key]}</option>`;
|
|
str = `<option value="${key}">${res.data[key]}</option>`;
|
|
}
|
|
}
|
|
- body.find(".select-box"+k).append(str);
|
|
|
|
|
|
+ body.find(".select-box" + k).append(str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
iframeWin.layui.form.render();
|
|
iframeWin.layui.form.render();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error:function (err) {
|
|
|
|
|
|
+ error: function (err) {
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|