This commit is contained in:
Timer
2026-04-09 14:16:18 +08:00
parent f89ab0f90d
commit 5c576ddfcb
21 changed files with 137 additions and 130 deletions

View File

@ -89,11 +89,26 @@ public class KPIPointController {
// List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); // List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); // int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
for (int i=0; i < list.size(); i++) { for (int i=0; i < list.size(); i++) {
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid()); String rawBizId = list.get(i).getBizid();
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
if (processSection == null && list.get(i).getProcesssectionid() != null && !list.get(i).getProcesssectionid().isEmpty()) {
// KPI里历史数据存在按code保存工艺段的场景优先按厂区code匹配再回退到系统库
List<ProcessSection> processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + rawBizId + "' "
);
if (processSectionList == null || processSectionList.isEmpty()) {
processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + ProcessSection.UnitId_Sys + "' "
);
}
if (processSectionList != null && !processSectionList.isEmpty()) {
processSection = processSectionList.get(0);
}
}
if (processSection != null) { if (processSection != null) {
list.get(i).setProcessectionname(processSection.getName()); list.get(i).setProcessectionname(processSection.getName());
} }
Company company = this.unitService.getCompById(list.get(i).getBizid()); Company company = this.unitService.getCompById(rawBizId);
if (company != null) { if (company != null) {
list.get(i).setBizid(company.getName()); list.get(i).setBizid(company.getName());
} }

View File

@ -173,8 +173,8 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on('change', function () { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
//工艺段选择后,清空原有工艺段选择的设备 //工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val(""); $("#equipmentIds").val("");
$("#equipname").val(""); $("#equipname").val("");

View File

@ -159,8 +159,8 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('${abnormity.processSectionId}').trigger("change"); selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
},'json'); },'json');
}; };
var companyId = "${abnormity.bizId}"; var companyId = "${abnormity.bizId}";
$(function(){ $(function(){
@ -181,9 +181,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
if(data!=null && data.length>0){ if(data!=null && data.length>0){
selelct_.val('${abnormity.processSectionId}').trigger("change"); selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
} }
selelct_.on('change',function(){ selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
//工艺段选择后,清空原有工艺段选择的设备 //工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val(""); $("#equipmentIds").val("");
$("#equipname").val(""); $("#equipname").val("");

View File

@ -195,8 +195,8 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change",function(e){ selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(e){
dosearch(); dosearch();
}); });
},'json'); },'json');

View File

@ -156,8 +156,8 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
initAPPFun(); initAPPFun();
}); });
}, 'json'); }, 'json');
@ -493,8 +493,8 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
// dosearch(); // dosearch();
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}); });

View File

@ -170,16 +170,16 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');
var statusSelect = $("#statusSelect").select2({ var statusSelect = $("#statusSelect").select2({
minimumResultsForSearch: 10, minimumResultsForSearch: 10,
placeholder: '请选择', placeholder: '请选择',
}).val('').trigger("change"); }).val('').trigger("change.select2");
statusSelect.on("change", function (e) { statusSelect.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
$("#table").bootstrapTable({ // 对应table标签的id $("#table").bootstrapTable({ // 对应table标签的id

View File

@ -174,8 +174,8 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val("").trigger("change"); selelct_.val("").trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');

View File

@ -187,8 +187,8 @@
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
selelct_.val("").trigger("change"); selelct_.val("").trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');

View File

@ -271,8 +271,8 @@
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果 formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
}); });
selelct_.val("").trigger("change"); selelct_.val("").trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');

View File

@ -113,7 +113,7 @@ var selectMPint = function(pid) {
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
if(data!=null && data.length>0){ if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change"); selelct_.val(data[0].id).trigger("change.select2");
} }
},'json'); },'json');
}else{ }else{
@ -131,8 +131,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val(); var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) { $.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty(); $("#processsectionid").empty();
@ -147,8 +147,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('${kPIPoint.processsectionid}').trigger("change"); selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json'); },'json');
}); });
} }
},'json'); },'json');

View File

@ -89,8 +89,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('${kPIPoint.processsectionid}').trigger("change"); selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json'); },'json');
}; };
$(function(){ $(function(){
@ -116,8 +116,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('${kPIPoint.processsectionid}').trigger("change"); selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json'); },'json');
}else{ }else{
$("#hidden_bizid").attr("disabled","disabled"); $("#hidden_bizid").attr("disabled","disabled");
$("#input_bizid").css("display", "none"); $("#input_bizid").css("display", "none");
@ -133,8 +133,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct.val('${kPIPoint.bizid}').trigger("change"); selelct.val('${kPIPoint.bizid}').trigger("change.select2");
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val(); var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) { $.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty(); $("#processsectionid").empty();
@ -149,8 +149,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
},'json'); },'json');
}); });
} }
},'json'); },'json');

View File

@ -179,9 +179,14 @@
} }
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}); $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
selelct_.val('').trigger("change"); // 初始化时仅刷新控件显示,不触发查询
selelct_.off("change").on("change", function () { selelct_.val('').trigger("change.select2");
dosearch(); // 用select2事件触发查询避免普通change导致选中文本被立即重置
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
// 让select2先完成渲染再执行查询
setTimeout(function () {
dosearch();
}, 0);
}); });
}, 'json'); }, 'json');
}; };
@ -239,9 +244,9 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
refreshSelect(); refreshSelect();
selelct.on("change", function (e) { selelct.off("select2:select select2:clear").on("select2:select select2:clear", function () {
companyId = $(this).val(); companyId = $(this).val();
dosearch(); dosearch();
refreshSelect(); refreshSelect();

View File

@ -139,6 +139,34 @@ var companyId = "";
var dosearch = function() { var dosearch = function() {
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}; };
var loadProcessSectionSelect = function(companyId) {
if (!companyId) {
refreshSelect();
return;
}
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',
allowClear: true,
escapeMarkup: function (markup) { return markup; },
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,
formatResult: function formatRepo(repo){return repo.text;},
formatSelection: function formatRepoSelection(repo){return repo.text;}
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
setTimeout(function(){
dosearch();
},0);
});
},'json');
};
var refreshSelect = function() { var refreshSelect = function() {
var selelct_ =$("#processSection").select2({ var selelct_ =$("#processSection").select2({
data: null, data: null,
@ -163,27 +191,7 @@ var companyId = "";
$("#company").text(data[0].text); $("#company").text(data[0].text);
companyId=data[0].id; companyId=data[0].id;
dosearch(); dosearch();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) { loadProcessSectionSelect(companyId);
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
}else{ }else{
$("#company").css("display", "none"); $("#company").css("display", "none");
var selelct=$("#search_code").select2({ var selelct=$("#search_code").select2({
@ -198,33 +206,14 @@ var companyId = "";
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
refreshSelect(); refreshSelect();
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val(); companyId= $(this).val();
dosearch(); dosearch();
refreshSelect(); refreshSelect();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) { loadProcessSectionSelect(companyId);
$("#processSection").empty(); });
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
});
} }
},'json'); },'json');

View File

@ -366,8 +366,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');
@ -394,9 +394,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
//refreshSelect(); selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
selelct.on("change", function (e) {
companyId = $(this).val(); companyId = $(this).val();
//dosearch(); //dosearch();
//refreshSelect(); //refreshSelect();
@ -422,8 +421,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');

View File

@ -325,8 +325,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');
@ -353,9 +353,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
//refreshSelect(); selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
selelct.on("change", function (e) {
companyId = $(this).val(); companyId = $(this).val();
//dosearch(); //dosearch();
//refreshSelect(); //refreshSelect();
@ -381,8 +380,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch(); dosearch();
}); });
}, 'json'); }, 'json');

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' }) $(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}); });

View File

@ -149,8 +149,8 @@
minimumInputLength: 0, minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框 minimumResultsForSearch: 10,//数据超过十个启用搜索框
}); });
select.val('').trigger("change"); select.val('').trigger("change.select2");
select.on("change", function (e) { select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}); });
@ -166,8 +166,8 @@
minimumInputLength: 0, minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框 minimumResultsForSearch: 10,//数据超过十个启用搜索框
}); });
select.val("").trigger("change"); select.val("").trigger("change.select2");
select.on("change", function (e) { select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}); });
@ -196,8 +196,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh'); $("#table").bootstrapTable('refresh');
}); });

View File

@ -181,8 +181,8 @@
minimumInputLength: 0, minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框 minimumResultsForSearch: 10,//数据超过十个启用搜索框
}); });
select.val('').trigger("change"); select.val('').trigger("change.select2");
select.on("change", function (e) { select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1}); $("#table").bootstrapTable('refresh', {pageNumber: 1});
}); });
@ -200,8 +200,8 @@
minimumInputLength: 0, minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框 minimumResultsForSearch: 10,//数据超过十个启用搜索框
}); });
select.val("").trigger("change"); select.val("").trigger("change.select2");
select.on("change", function (e) { select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1}); $("#table").bootstrapTable('refresh', {pageNumber: 1});
}); });
@ -231,8 +231,8 @@
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}) $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change", function (e) { selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1}); $("#table").bootstrapTable('refresh', {pageNumber: 1});
}); });

View File

@ -108,7 +108,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
if(data!=null && data.length>0){ if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change"); selelct_.val(data[0].id).trigger("change.select2");
} }
},'json'); },'json');
}else{ }else{
@ -126,7 +126,7 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果 formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val(); companyId= $(this).val();
//重新选择厂区后清空设备和工艺段数据 //重新选择厂区后清空设备和工艺段数据
$("#equipname").val(""); $("#equipname").val("");
@ -134,7 +134,7 @@
$("#processSectionId").val(""); $("#processSectionId").val("");
$("#processectionname").val(""); $("#processectionname").val("");
}); });
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
} }
},'json'); },'json');
@ -149,9 +149,9 @@
.updateStatus('plannedenddt', 'NOT_VALIDATED',null) .updateStatus('plannedenddt', 'NOT_VALIDATED',null)
.validateField('plannedenddt'); .validateField('plannedenddt');
}); });
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change"); $("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change.select2");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change"); $("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change.select2");
}); });
//选择设备根据厂区id选择厂内设备 //选择设备根据厂区id选择厂内设备
var selectEquipmentCard = function() { var selectEquipmentCard = function() {
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipid").val()} , function(data) { $.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipid").val()} , function(data) {

View File

@ -101,7 +101,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
if(data!=null && data.length>0){ if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change"); selelct_.val(data[0].id).trigger("change.select2");
} }
},'json'); },'json');
}else{ }else{
@ -119,7 +119,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear", function(e){
companyId = $(this).val(); companyId = $(this).val();
//重新选择厂区后清空设备和工艺段数据 //重新选择厂区后清空设备和工艺段数据
if(companyId != "${maintenanceDetail.companyid}"){ if(companyId != "${maintenanceDetail.companyid}"){
@ -129,10 +129,10 @@
$("#processectionname").val(""); $("#processectionname").val("");
} }
}); });
selelct.val('${maintenanceDetail.companyid}').trigger("change"); selelct.val('${maintenanceDetail.companyid}').trigger("change.select2");
} }
},'json'); },'json');
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change"); $("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change.select2");
//选择时间 //选择时间
$('#startDate').datepicker({ $('#startDate').datepicker({
language: 'zh-CN', language: 'zh-CN',

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change",function(e){ selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch(); dosearch();
}); });
@ -153,9 +153,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change"); selelct.val('').trigger("change.select2");
refreshSelect(); refreshSelect();
selelct.on("change",function(e){ selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val(); companyId= $(this).val();
dosearch(); dosearch();
refreshSelect(); refreshSelect();
@ -174,8 +174,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择 formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
}); });
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'}) $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change"); selelct_.val('').trigger("change.select2");
selelct_.on("change",function(e){ selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch(); dosearch();
}); });
},'json'); },'json');