'
+'
'
@@ -297,14 +365,17 @@
+'
'
+'
';
$(top.document.body).append(modal);
- }
-
+ }
+
+
+ /*
+ * 搜索栏表单
+ * (未实现)
+ */
var initSearch = function(){
//申请时间
DateCpt.init('search_app_start_time','yyyy-mm-dd');
- /* $("#search_app_start_time").val(Tools.DateUtils.getBeforeCurrentDate(6));*/
DateCpt.init('search_app_end_time','yyyy-mm-dd');
- /*$("#search_app_end_time").val(Tools.DateUtils.getCurrentDate());*/
//申请科室
renderDepartment_tousse("search_app_depart");
//申请人
@@ -334,7 +405,12 @@
initMoreSearch();
});
}
-
+
+
+ /*
+ * 搜索栏表单
+ * (未实现)
+ */
var initMoreSearch = function(){
//终止状态
renderDepartment_tousse("search_more_termination_status");
@@ -408,9 +484,8 @@
});
}
- parent.refreshTable = function(){
- initTable();
- }
+
+ initParent();
// initSearch();
initForm();
initTable();
Index: ssts-web/src/main/webapp/dx-disinfectsystem/js/recyclingApplication/applicationUtils.js
===================================================================
diff -u -r25015 -r25057
--- ssts-web/src/main/webapp/dx-disinfectsystem/js/recyclingApplication/applicationUtils.js (.../applicationUtils.js) (revision 25015)
+++ ssts-web/src/main/webapp/dx-disinfectsystem/js/recyclingApplication/applicationUtils.js (.../applicationUtils.js) (revision 25057)
@@ -1,3 +1,9 @@
+/**
+ * 所有下拉框的内容渲染函数等到下拉框插件
+ * 确定下来后再封装。
+ */
+var isIE=Tools.BrowserTypeUtils.isIE()==1 ? true:false;
+$.fn.modal.Constructor.prototype.enforceFocus = function () {};//解决select2 单选框无法输入的问题
var DateCpt = {
init:function(idStr,format){
@@ -89,9 +95,6 @@
}
-
-
-
//获取下拉框内容并渲染到页面--科室下拉框
function renderDepartment_tousse(elementId,placeholder,maximumSelectionLength,url,asyns){
@@ -315,6 +318,32 @@
}
+//“处理科室”下拉框初始化
+function renderSelect_handlerDpt(elementId,maximumSelectionLength,tousseType,applyDepartCode){
+
+ var result=[];
+ $.ajax({
+ url:WWWROOT + '/disinfectSystem/core/orgUnitController/searchHandleDepartmentByKeyWord.mhtml',
+ dataType: 'json',
+ contentType:"application/json;charset=utf-8",
+ type:'get',
+ async:false,
+ cache: true,
+ data:{applyDepartCode:applyDepartCode,tousseType:tousseType},
+ success:function(msg){
+ result=transformJsonArrToSelect2(msg.rows,"departmentCode","departmentName");
+ }
+ });
+
+ $("#"+elementId).select2({
+ minimumResultsForSearch: Infinity,
+ data: result
+ })
+
+ $("#"+elementId).next().attr('style','width:100%;');
+}
+
+
//“自定义”器械包下拉框
function renderSelect_customerTousse(elementId){
$.ajax({
@@ -374,4 +403,60 @@
}
+/**
+ * 清空表单
+ * @formId 表单ID
+ * @tableIds 表单中表格destroy(此处需是bootstrap-table)
+ *1.隐藏模态框
+ *2.清空表单各输入框内容,表格重置
+ *3.清空物品项数组appToussesArr
+ */
+function clearForm(isIE,formId,tableIds,appToussesArr){
+ //清除input/select/textarea元素
+ if(isIE == true){
+ $("#"+formId).filter('input[type=text],input[type=number],select,input[type=hidden],textarea').each(function() {
+ $(this).val('');
+ $(this).text('');
+ });
+ }else{
+ $("#"+formId).find('input[type=text],input[type=number],select,input[type=hidden],textarea').each(function() {
+ $(this).val('');
+ $(this).text('');
+ });
+ }
+
+ //清空物品列表所选择数据的缓存
+ if(appToussesArr != undefined && appToussesArr.length != 0){
+ appToussesArr=[];
+ }
+ return appToussesArr;
+}
+
+/*
+ *将json数组转换成select2特定的json格式
+ *@param jsonArray 需要转换的json数组
+ *@param idCorreFiled 与select2中id对应的属性
+ *@param textCorreFiled 与select2中text对应的属性
+ */
+function transformJsonArrToSelect2(jsonArray,idCorreFiled,textCorreFiled){
+ var result=[];
+ for(var i=0;i