diff --git a/erp/src/main/resources/template/js/storehouse/storehouseadd.js b/erp/src/main/resources/template/js/storehouse/storehouseadd.js index 8fda9b93ab70012f03be3855886995b58c9d88d5..aaca2ed34b638997cf03131575e6deaa147ba556 100644 --- a/erp/src/main/resources/template/js/storehouse/storehouseadd.js +++ b/erp/src/main/resources/template/js/storehouse/storehouseadd.js @@ -1,9 +1,4 @@ -var userReturnList = new Array();//选择用户返回的集合或者进行回显的集合 -var chooseOrNotMy = "1";//人员列表中是否包含自己--1.包含;其他参数不包含 -var chooseOrNotEmail = "1";//人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 -var checkType = "1";//人员选择类型,1.多选;其他。单选 - layui.config({ base: basePath, version: skyeyeVersion @@ -48,7 +43,7 @@ layui.config({ } AjaxPostUtil.request({url: flowableBasePath + "storehouse002", params: params, type: 'json', callback: function(json){ - if(json.returnCode == 0){ + if(json.returnCode == 0) { parent.layer.close(index); parent.refreshCode = '0'; }else{ @@ -78,30 +73,17 @@ layui.config({ } }); - //仓库负责人选择 - $("body").on("click", "#principalUserIdSelPeople", function(e){ - userReturnList = [].concat(chooseUser); - _openNewWindows({ - url: "../../tpl/common/sysusersel.html", - title: "人员选择", - pageId: "sysuserselpage", - area: ['80vw', '80vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //移除所有tag - var tags = $('#principal').tagEditor('getTags')[0].tags; - for (i = 0; i < tags.length; i++) { - $('#principal').tagEditor('removeTag', tags[i]); - } - chooseUser = [].concat(userReturnList); - //添加新的tag - $.each(chooseUser, function(i, item){ - $('#principal').tagEditor('addTag', item.name); - }); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + // 仓库负责人选择 + $("body").on("click", "#principalUserIdSelPeople", function(e) { + systemCommonUtil.userReturnList = [].concat(chooseUser); + systemCommonUtil.chooseOrNotMy = "1"; // 人员列表中是否包含自己--1.包含;其他参数不包含 + systemCommonUtil.chooseOrNotEmail = "1"; // 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 + systemCommonUtil.checkType = "1"; // 人员选择类型,1.多选;其他。单选 + systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList) { + chooseUser = [].concat(staffChooseList); + // 重置数据 + systemCommonUtil.tagEditorResetData('principal', chooseUser); + }); }); $("body").on("click", "#cancle", function(){ diff --git a/erp/src/main/resources/template/js/storehouse/storehouseedit.js b/erp/src/main/resources/template/js/storehouse/storehouseedit.js index 39de99e3191dd05e2cced9832ce14c143e4c0a00..ca4e3ca56ea0d6fc13c8b7ff350c3519294fb5ea 100644 --- a/erp/src/main/resources/template/js/storehouse/storehouseedit.js +++ b/erp/src/main/resources/template/js/storehouse/storehouseedit.js @@ -1,9 +1,4 @@ -var userReturnList = new Array();//选择用户返回的集合或者进行回显的集合 -var chooseOrNotMy = "1";//人员列表中是否包含自己--1.包含;其他参数不包含 -var chooseOrNotEmail = "1";//人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 -var checkType = "1";//人员选择类型,1.多选;其他。单选 - layui.config({ base: basePath, version: skyeyeVersion @@ -23,17 +18,18 @@ layui.config({ url: flowableBasePath + "storehouse003", params: {rowId: parent.rowId}, pagination: false, + method: 'GET', template: $("#beanTemplate").html(), - ajaxSendLoadBefore: function(hdb){ + ajaxSendLoadBefore: function(hdb) { }, - ajaxSendAfter:function(json){ + ajaxSendAfter: function(json) { //设置是否默认 $("input:radio[name=isDefault][value=" + json.bean.isDefault + "]").attr("checked", true); //仓库负责人 var userNames = []; chooseUser = [].concat(json.bean.chooseUser); - $.each(chooseUser, function(i, item){ + $.each(chooseUser, function(i, item) { userNames.push(item.name); }); @@ -78,7 +74,7 @@ layui.config({ }; //仓库负责人 - if(chooseUser.length > 0 && !isNull($('#principal').tagEditor('getTags')[0].tags)){ + if(chooseUser.length > 0 && !isNull($('#principal').tagEditor('getTags')[0].tags)) { var userId = ""; $.each(chooseUser, function (i, item) { userId += item.id + ','; @@ -86,11 +82,11 @@ layui.config({ params.principal = userId; } - AjaxPostUtil.request({url: flowableBasePath + "storehouse005", params: params, type: 'json', callback: function(json){ - if(json.returnCode == 0){ + AjaxPostUtil.request({url: flowableBasePath + "storehouse005", params: params, type: 'json', callback: function(json) { + if(json.returnCode == 0) { parent.layer.close(index); parent.refreshCode = '0'; - }else{ + } else { winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); } }}); @@ -100,30 +96,16 @@ layui.config({ } }); - //仓库负责人选择 - $("body").on("click", "#principalUserIdSelPeople", function(e){ - userReturnList = [].concat(chooseUser); - _openNewWindows({ - url: "../../tpl/common/sysusersel.html", - title: "人员选择", - pageId: "sysuserselpage", - area: ['80vw', '80vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //移除所有tag - var tags = $('#principal').tagEditor('getTags')[0].tags; - for (i = 0; i < tags.length; i++) { - $('#principal').tagEditor('removeTag', tags[i]); - } - chooseUser = [].concat(userReturnList); - //添加新的tag - $.each(chooseUser, function(i, item){ - $('#principal').tagEditor('addTag', item.name); - }); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + // 仓库负责人选择 + $("body").on("click", "#principalUserIdSelPeople", function(e) { + systemCommonUtil.userReturnList = [].concat(chooseUser); + systemCommonUtil.chooseOrNotMy = "1"; // 人员列表中是否包含自己--1.包含;其他参数不包含 + systemCommonUtil.chooseOrNotEmail = "1"; // 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 + systemCommonUtil.checkType = "1"; // 人员选择类型,1.多选;其他。单选 + systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList) { + // 重置数据 + chooseUser = [].concat(systemCommonUtil.tagEditorResetData('principal', staffChooseList)); + }); }); $("body").on("click", "#cancle", function(){ diff --git a/erp/src/main/resources/template/tpl/storehouse/storehouseinfo.html b/erp/src/main/resources/template/tpl/storehouse/storehouseinfo.html index 3b60f0855fae4ced0a0e81c3dead283f589cab1b..6f7b929663531822702dc0bf94e05dc192635469 100644 --- a/erp/src/main/resources/template/tpl/storehouse/storehouseinfo.html +++ b/erp/src/main/resources/template/tpl/storehouse/storehouseinfo.html @@ -41,7 +41,7 @@
{{#each chooseUser}} - {{name}}, + {{name}} {{/each}}
diff --git a/erp/src/main/resources/template/tpl/storehouse/storehouselist.html b/erp/src/main/resources/template/tpl/storehouse/storehouselist.html index 46433d6ef362ba75ed2ab97d990b5cd64cb0d3d3..bd47d7f92792b991701c6150c544c7305e9f8407 100644 --- a/erp/src/main/resources/template/tpl/storehouse/storehouselist.html +++ b/erp/src/main/resources/template/tpl/storehouse/storehouselist.html @@ -7,45 +7,45 @@ -
-
-
-
- -
- +
+ +
+
+ +
+ +
+ +
- -
+ +
+
+
+ +
- -
-
-
- -
-
-
-
+
+
- +
+ + + -
- - - \ No newline at end of file diff --git a/web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js index 7bda8a9d54e54a7706b4818e2d6738c1afe728e6..be321d777334611ed142061ce279e9e25bafc746 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js @@ -283,13 +283,28 @@ var systemCommonUtil = { * * @param id 对象id */ - tagEditorRemoveAll: function(id){ + tagEditorRemoveAll: function(id) { var tags = $('#' + id).tagEditor('getTags')[0].tags; for (i = 0; i < tags.length; i++) { $('#' + id).tagEditor('removeTag', tags[i]); } }, + /** + * tagEditor组件重置数据 + * + * @param id 对象id + */ + tagEditorResetData: function(id, data) { + // 移除所有tag + systemCommonUtil.tagEditorRemoveAll(id); + // 添加新的tag + $.each(data, function(i, item){ + $('#' + id).tagEditor('addTag', item.name); + }); + return data; + }, + /** * 表格禁止指定行数据选择 *