|
@@ -225,6 +225,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
}
|
|
|
// 记录状态
|
|
|
if (res.data.recordStatusList !=null) {
|
|
|
+ sessionStorage.setItem('groudBool','false');
|
|
|
for (var i = 0; i < res.data.recordStatusList.length; i++) {
|
|
|
if (res.data.recordStatusList[i].isEchart == false) {
|
|
|
var str =`
|
|
@@ -248,6 +249,8 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
body.find('.a_inputs').append(str);
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ sessionStorage.setItem('groudBool','true');
|
|
|
}
|
|
|
// 特殊记录项和记录项
|
|
|
var num =0;
|
|
@@ -270,10 +273,10 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
}
|
|
|
</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" value="${res.data.inputList[j].inputName}">
|
|
|
+ <input type="text" placeholder="请输入字段名称" class="layui-input fieldName ${j == 0?'fieldName1' : ""}" value="${res.data.inputList[j].inputName}">
|
|
|
</div>
|
|
|
<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 ${j ==0?"fieldType1":""}" value="${res.data.inputList[j].remark}">
|
|
|
</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++}" lay-filter="inputType">
|
|
@@ -370,6 +373,14 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
|
return false;
|
|
|
}
|
|
|
+ if (sessionStorage.getItem("groudBool") == 'true' && body.find(".textContent").val() =="" && body.find(".textName").val() == "") {
|
|
|
+ layer.msg('请输入文本状态', {icon: 8});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (body.find('.fieldName1').val() == "" && body.find('.fieldType1').val() == "") {
|
|
|
+ layer.msg('请填写记录项', {icon: 8});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
var inputs = body.find('.a_inputs .a_input');
|
|
|
// 记录状态
|
|
|
var stateIDArray = [],
|
|
@@ -411,15 +422,16 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
}else {
|
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
|
recordStatusObj = {};
|
|
|
- recordStatusObj.isEchart = cheackboxBoolArray[i];
|
|
|
- recordStatusObj.statusContent = valArray[i];
|
|
|
- recordStatusObj.statusId = stateIDArray[i];
|
|
|
- recordStatusObj.id = inputStateID[i];
|
|
|
- recordStatusObj.deleteFlag = deleteFlagBool[i];
|
|
|
- recordStatusList.push(recordStatusObj)
|
|
|
+ if (valArray[i] != ""){
|
|
|
+ recordStatusObj.isEchart = cheackboxBoolArray[i];
|
|
|
+ recordStatusObj.statusContent = valArray[i];
|
|
|
+ recordStatusObj.statusId = stateIDArray[i];
|
|
|
+ recordStatusObj.id = inputStateID[i];
|
|
|
+ recordStatusObj.deleteFlag = deleteFlagBool[i];
|
|
|
+ recordStatusList.push(recordStatusObj)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- console.log(recordStatusList,'recordStatusList222')
|
|
|
// 记录项
|
|
|
var inputList = {businessType:'',inputItems:[],inputName:'',inputType:'',isEchart:'',isOptional:'',remark:'',special:'',zIndex:'',id:'',deleteFlag:''},
|
|
|
value,fieldType,inputItems,mandatory,isEchart,inputType,businessType,id,deleteFlag;
|
|
@@ -462,19 +474,20 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
}else {
|
|
|
inputItems =[]
|
|
|
}
|
|
|
- console.log(inputItems == "",'inputItems');
|
|
|
- inputList.businessType = businessType == undefined ? "" : businessType;
|
|
|
- inputList.inputItems = inputItems == "" ? [] : JSON.parse(inputItems);
|
|
|
- inputList.inputName = value;
|
|
|
- inputList.inputType = inputType;
|
|
|
- inputList.isEchart = isEchart;
|
|
|
- inputList.isOptional = mandatory;
|
|
|
- inputList.remark = fieldType;
|
|
|
- inputList.special = 'false';
|
|
|
- inputList.id = id;
|
|
|
- inputList.zIndex = n++ +1;
|
|
|
- inputList.deleteFlag = deleteFlag;
|
|
|
- recordArray.push(inputList)
|
|
|
+ if (value != "" && fieldType !="") {
|
|
|
+ inputList.businessType = businessType == undefined ? "" : businessType;
|
|
|
+ inputList.inputItems = inputItems == "" ? [] : JSON.parse(inputItems);
|
|
|
+ inputList.inputName = value;
|
|
|
+ inputList.inputType = inputType;
|
|
|
+ inputList.isEchart = isEchart;
|
|
|
+ inputList.isOptional = mandatory;
|
|
|
+ inputList.remark = fieldType;
|
|
|
+ inputList.special = 'false';
|
|
|
+ inputList.id = id;
|
|
|
+ inputList.zIndex = n++ +1;
|
|
|
+ inputList.deleteFlag = deleteFlag;
|
|
|
+ recordArray.push(inputList)
|
|
|
+ }
|
|
|
});
|
|
|
// 检查项
|
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
@@ -494,15 +507,17 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
term_nameTextarea = $(this).parent().parent().find('.term_nameTextarea').val();
|
|
|
inspect_select = $(this).parent().parent().find('.inspect_select').val();
|
|
|
inspectInfo = $(this).find('.inspectInfo').val();
|
|
|
- id = $(this).attr("inspect-id");
|
|
|
- deleteFlag = $(this).attr('deleteFlag');
|
|
|
- checkItemList.checkType = inspect_select;
|
|
|
- checkItemList.groupName = term_nameTextarea;
|
|
|
- checkItemList.itemValue = inspectInfo;
|
|
|
- checkItemList.id = id;
|
|
|
- checkItemList.deleteFlag = deleteFlag;
|
|
|
- checkItemList.zIndex = num++ +1;
|
|
|
- checkItemArray.push(checkItemList)
|
|
|
+ if (inspectInfo != "") {
|
|
|
+ id = $(this).attr("inspect-id");
|
|
|
+ deleteFlag = $(this).attr('deleteFlag');
|
|
|
+ checkItemList.checkType = inspect_select;
|
|
|
+ checkItemList.groupName = term_nameTextarea;
|
|
|
+ checkItemList.itemValue = inspectInfo;
|
|
|
+ checkItemList.id = id;
|
|
|
+ checkItemList.deleteFlag = deleteFlag;
|
|
|
+ checkItemList.zIndex = num++ +1;
|
|
|
+ checkItemArray.push(checkItemList)
|
|
|
+ }
|
|
|
});
|
|
|
var updateStetaInfo = {
|
|
|
templateName:body.find(".TemplateName").val(),
|
|
@@ -585,6 +600,7 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
content: addTemplateHtml,
|
|
|
success: function (layero, index) {
|
|
|
var body = layer.getChildFrame('body', index);
|
|
|
+ sessionStorage.getItem("addgroudBool") == 'false'
|
|
|
},
|
|
|
yes: function (index, layero) {
|
|
|
var body = layer.getChildFrame('body', index);
|
|
@@ -592,6 +608,18 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
layer.msg('请输入模版名称', {icon: 8});
|
|
|
return false;
|
|
|
}
|
|
|
+ if (sessionStorage.getItem("addgroudBool") == 'true' && body.find(".textContent").val() =="" && body.find(".textName").val() == "") {
|
|
|
+ layer.msg('请输入文本状态', {icon: 8});
|
|
|
+ return false;
|
|
|
+ }else if (sessionStorage.getItem("addgroudBool") == 'false' && body.find('.a_stateName1').val() == "") {
|
|
|
+ layer.msg('请选择状态组', {icon: 8});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // console.log(body.find('.fieldName1'))
|
|
|
+ if (body.find('.fieldName1').val() == "" && body.find('.fieldType1').val() == "") {
|
|
|
+ layer.msg('请填写记录项', {icon: 8});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
var inputs = body.find('.a_inputs .a_input');
|
|
|
// 记录状态
|
|
|
var stateIDArray = [],
|
|
@@ -614,6 +642,9 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
recordStatusObj.statusId = stateIDArray[i];
|
|
|
recordStatusList.push(recordStatusObj)
|
|
|
};
|
|
|
+ if (sessionStorage.getItem("addgroudBool") == 'true') {
|
|
|
+ recordStatusList = [];
|
|
|
+ }
|
|
|
// 记录项
|
|
|
var inputList = {businessType:'',inputItems:[],inputName:'',inputType:'',isEchart:'',isOptional:'',remark:'',special:'',zIndex:''},
|
|
|
value,fieldType,inputItems,mandatory,isEchart,inputType,businessType;
|
|
@@ -646,17 +677,18 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
}else {
|
|
|
inputItems = []
|
|
|
}
|
|
|
- console.log(inputItems == [],'inputItems');
|
|
|
- inputList.businessType = businessType == undefined ? "" : businessType;
|
|
|
- inputList.inputItems = inputItems == [] ? [] : JSON.parse(inputItems);
|
|
|
- inputList.inputName = value;
|
|
|
- inputList.inputType = inputType;
|
|
|
- inputList.isEchart = isEchart;
|
|
|
- inputList.isOptional = mandatory;
|
|
|
- inputList.remark = fieldType;
|
|
|
- inputList.special = 'false';
|
|
|
- inputList.zIndex = n++ +1;
|
|
|
- recordArray.push(inputList)
|
|
|
+ if (value != "" && fieldType != "") {
|
|
|
+ inputList.businessType = businessType == undefined ? "" : businessType;
|
|
|
+ inputList.inputItems = inputItems == [] ? [] : JSON.parse(inputItems);
|
|
|
+ inputList.inputName = value;
|
|
|
+ inputList.inputType = inputType;
|
|
|
+ inputList.isEchart = isEchart;
|
|
|
+ inputList.isOptional = mandatory;
|
|
|
+ inputList.remark = fieldType;
|
|
|
+ inputList.special = 'false';
|
|
|
+ inputList.zIndex = n++ +1;
|
|
|
+ recordArray.push(inputList)
|
|
|
+ }
|
|
|
});
|
|
|
// 检查项
|
|
|
var inspect_terms = body.find(".inspect_terms");
|
|
@@ -669,18 +701,22 @@ layui.use(['jquery','eleTree','table','laypage','form','admin'], function(){
|
|
|
term_nameTextarea = $(this).parent().parent().find('.term_nameTextarea').val();
|
|
|
inspect_select = $(this).parent().parent().find('.inspect_select').val();
|
|
|
inspectInfo = $(this).find('.inspectInfo').val();
|
|
|
- checkItemList.checkType = inspect_select;
|
|
|
- checkItemList.groupName = term_nameTextarea;
|
|
|
- checkItemList.itemValue = inspectInfo;
|
|
|
- checkItemList.zIndex = num++ +1;
|
|
|
- checkItemArray.push(checkItemList)
|
|
|
+ if (inspectInfo != "") {
|
|
|
+ checkItemList.checkType = inspect_select;
|
|
|
+ checkItemList.groupName = term_nameTextarea;
|
|
|
+ checkItemList.itemValue = inspectInfo;
|
|
|
+ checkItemList.zIndex = num++ +1;
|
|
|
+ checkItemArray.push(checkItemList)
|
|
|
+ }
|
|
|
});
|
|
|
- console.log(checkItemArray,'00')
|
|
|
+ if (sessionStorage.getItem("addgroudBool") == 'true') {
|
|
|
+ recordStatusList = [];
|
|
|
+ }
|
|
|
var addStetaInfo = {
|
|
|
templateName:body.find(".TemplateName").val() == ""? "":body.find(".TemplateName").val(),
|
|
|
remark:body.find(".Templatereamk").val() == "" ? "":body.find(".Templatereamk").val(),
|
|
|
- statusContent:body.find(".textContent").val() == ""?"":body.find(".textContent").val(),
|
|
|
- statusName:body.find(".textName").val() == "" ? "" :body.find(".textName").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,
|