diff --git a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactAdd.js b/base-server/src/main/resources/template/js/contacts/contactsAdd.js similarity index 57% rename from base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactAdd.js rename to base-server/src/main/resources/template/js/contacts/contactsAdd.js index 0647be6f84aa4781f191fde4a286282eec20c3ec..130412652c6239951e8f1f42035b247e0ac436eb 100644 --- a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactAdd.js +++ b/base-server/src/main/resources/template/js/contacts/contactsAdd.js @@ -1,7 +1,4 @@ -// 已经选择的客户信息 -var customerMation = {}; - layui.config({ base: basePath, version: skyeyeVersion @@ -17,13 +14,10 @@ layui.config({ form.render(); form.on('submit(formAddBean)', function (data) { if (winui.verifyForm(data.elem)) { - if(isNull(customerMation.id)){ - winui.window.msg('请选择客户.', {icon: 2, time: 2000}); - return false; - } var params = { - customerId: customerMation.id, - contacts: $("#contacts").val(), + objectId: parent.objectId, + objectKey: parent.objectKey, + name: $("#name").val(), department: $("#department").val(), job: $("#job").val(), workPhone: $("#workPhone").val(), @@ -33,7 +27,7 @@ layui.config({ wechat: $("#wechat").val(), isDefault: $("input[name='isDefault']:checked").val() }; - AjaxPostUtil.request({url: flowableBasePath + "customercontact002", params: params, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "writeContactsMation", params: params, type: 'json', method: 'POST', callback: function (json) { parent.layer.close(index); parent.refreshCode = '0'; }}); @@ -41,18 +35,6 @@ layui.config({ return false; }); - // 客户选择 - $("body").on("click", "#customMationSel", function (e) { - _openNewWindows({ - url: "../../tpl/customerManage/customerChoose.html", - title: "选择客户", - pageId: "customerChoose", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - $("#customName").val(customerMation.customName); - }}); - }); - $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactEdit.js b/base-server/src/main/resources/template/js/contacts/contactsEdit.js similarity index 56% rename from base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactEdit.js rename to base-server/src/main/resources/template/js/contacts/contactsEdit.js index bf77ee4d7aa2543de7815b1164fcbcbdb49b63ed..f6606e72e095a32af5694ff0ff6e0f731a3dcb2b 100644 --- a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactEdit.js +++ b/base-server/src/main/resources/template/js/contacts/contactsEdit.js @@ -1,7 +1,4 @@ -// 已经选择的客户信息 -var customerMation = {}; - layui.config({ base: basePath, version: skyeyeVersion @@ -15,31 +12,25 @@ layui.config({ showGrid({ id: "showForm", - url: flowableBasePath + "customercontact003", - params: {contactId: parent.rowId}, + url: flowableBasePath + "queryContactsMationById", + params: {id: parent.rowId}, pagination: false, - template: getFileContent('tpl/crmCustomerContact/crmCustomerContactEditTemplate.tpl'), + method: 'GET', + template: $("#beanTemplate").html(), ajaxSendLoadBefore: function(hdb) { }, ajaxSendAfter: function (json) { - // 客户信息赋值 - customerMation = { - id: json.bean.customerId, - customName: json.bean.customerName - } $("input:radio[name=isDefault][value=" + json.bean.isDefault + "]").attr("checked", true); matchingLanguage(); form.render(); form.on('submit(formEditBean)', function (data) { if (winui.verifyForm(data.elem)) { - if(isNull(customerMation.id)){ - winui.window.msg('请选择客户.', {icon: 2, time: 2000}); - return false; - } var params = { - contactId: parent.rowId, - customerId: customerMation.id, + id: parent.rowId, + objectId: parent.objectId, + objectKey: parent.objectKey, + name: $("#name").val(), contacts: $("#contacts").val(), department: $("#department").val(), job: $("#job").val(), @@ -50,7 +41,7 @@ layui.config({ wechat: $("#wechat").val(), isDefault: $("input[name='isDefault']:checked").val() }; - AjaxPostUtil.request({url: flowableBasePath + "customercontact004", params: params, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "writeContactsMation", params: params, type: 'json', method: 'POST', callback: function (json) { parent.layer.close(index); parent.refreshCode = '0'; }}); @@ -60,18 +51,6 @@ layui.config({ } }); - // 客户选择 - $("body").on("click", "#customMationSel", function (e) { - _openNewWindows({ - url: "../../tpl/customerManage/customerChoose.html", - title: "选择客户", - pageId: "customerChoose", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - $("#customName").val(customerMation.customName); - }}); - }); - $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactList.js b/base-server/src/main/resources/template/js/contacts/contactsList.js similarity index 69% rename from base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactList.js rename to base-server/src/main/resources/template/js/contacts/contactsList.js index 5ea80eba9cb04950e0664c3224cce6fd9efe06bd..dd43b586cbdb101e0ab66fc3f6d61d6d607034e2 100644 --- a/base-server/src/main/resources/template/js/crmCustomerContact/crmCustomerContactList.js +++ b/base-server/src/main/resources/template/js/contacts/contactsList.js @@ -1,5 +1,8 @@ var rowId = ""; +var objectKey = ""; +var objectId = ""; + layui.config({ base: basePath, version: skyeyeVersion @@ -10,13 +13,20 @@ layui.config({ var $ = layui.$, form = layui.form, table = layui.table; + + objectKey = GetUrlParam("objectKey"); + objectId = GetUrlParam("id"); + if (isNull(objectKey) || isNull(objectId)) { + winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); + return false; + } authBtn('1596375844035'); table.render({ id: 'messageTable', elem: '#messageTable', method: 'post', - url: flowableBasePath + 'customercontact001', + url: reqBasePath + 'queryContactsList', where: getTableParams(), even: true, page: true, @@ -24,8 +34,7 @@ layui.config({ limit: getLimit(), cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'contacts', title: '联系人', align: 'left', width: 100 }, - { field: 'customerName', title: '所属客户', align: 'left', width: 180 }, + { field: 'name', title: '名称', align: 'left', width: 100 }, { field: 'department', title: '部门', align: 'left', width: 100 }, { field: 'job', title: '职位', align: 'left', width: 100 }, { field: 'workPhone', title: '办公电话', align: 'left', width: 100 }, @@ -41,26 +50,29 @@ layui.config({ ]], done: function(json) { matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称,移动电话", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); } }); table.on('tool(messageTable)', function (obj) { var data = obj.data; var layEvent = obj.event; - if (layEvent === 'edit') { //编辑 - edit(data); - } else if (layEvent === 'delete'){ //删除 - del(data); - } + if (layEvent === 'edit') { + edit(data); + } else if (layEvent === 'delete') { + del(data); + } }); // 新增 $("body").on("click", "#addBean", function() { _openNewWindows({ - url: "../../tpl/crmCustomerContact/crmCustomerContactAdd.html", + url: "../../tpl/contacts/contactsAdd.html", title: systemLanguage["com.skyeye.addPageTitle"][languageType], - pageId: "crmCustomerContactAdd", + pageId: "contactsAdd", area: ['90vw', '90vh'], callBack: function (refreshCode) { winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); @@ -72,9 +84,9 @@ layui.config({ function edit(data) { rowId = data.id; _openNewWindows({ - url: "../../tpl/crmCustomerContact/crmCustomerContactEdit.html", + url: "../../tpl/contacts/contactsEdit.html", title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "crmCustomerContactEdit", + pageId: "contactsEdit", area: ['90vw', '90vh'], callBack: function (refreshCode) { winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); @@ -86,41 +98,24 @@ layui.config({ function del(data, obj) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { layer.close(index); - AjaxPostUtil.request({url: flowableBasePath + "customercontact005", params: {contactId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "deleteContactsMationById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); }); } - + form.render(); - - $("body").on("click", "#formSearch", function() { - refreshTable(); - }); - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } - - function refreshTable(){ - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); - } - - function getTableParams() { - return { - customerName: $("#customerName").val(), - contacts: $("#contacts").val(), - mobilePhone: $("#mobilePhone").val(), - email: $("#email").val(), - qq: $("#qq").val(), - wechat: $("#wechat").val() - }; - } + loadTable(); + }); + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + return $.extend(true, {objectKey: objectKey, objectId: objectId}, initTableSearchUtil.getSearchValue("messageTable")); + } - exports('crmCustomerContactList', {}); + exports('contactsList', {}); }); \ No newline at end of file diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js similarity index 100% rename from common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js rename to base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js similarity index 98% rename from common/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js rename to base-server/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js index 957b313992969cb5dbb9dbd8a8bc6c6eed90f9bb..a683fc6cf60c9dc1b091bf74d960e1f76e45112e 100644 --- a/common/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js +++ b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateDetails.js @@ -98,11 +98,11 @@ layui.config({ } function loadAuthList(objectType) { - var data = $.extend(true, [], treeTableData); // 加载该受用类型的团队可以设置哪些权限 var colsList = teamObjectPermissionUtil.getAuthColsDetails(objectType); $('#authList').html(getDataUseHandlebars($('#authTableTemplate').html(), {list: colsList})); $.each(colsList, function (i, item) { + var data = $.extend(true, [], treeTableData); // 给数据设置权限组的key, $.each(data, function (j, bean) { bean.authGroupKey = item.id; diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js similarity index 99% rename from common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js rename to base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js index d058eea141e3048b74ea1ff5f9b54bf91d01493d..222405e03b1e6bebc00701373b7930e2d2e4d1a3 100644 --- a/common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js +++ b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js @@ -221,12 +221,12 @@ layui.config({ } function loadAuthList() { - var data = $.extend(true, [], treeTableData); var objectType = $('#objectType').val(); // 加载该受用类型的团队可以设置哪些权限 var colsList = teamObjectPermissionUtil.getAuthCols(objectType); $('#authList').html(getDataUseHandlebars($('#authTableTemplate').html(), {list: colsList})); $.each(colsList, function (i, item) { + var data = $.extend(true, [], treeTableData); // 给数据设置权限组的key, $.each(data, function (j, bean) { bean.authGroupKey = item.id; diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateList.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateList.js similarity index 100% rename from common/src/main/resources/template/js/teamTemplate/teamTemplateList.js rename to base-server/src/main/resources/template/js/teamTemplate/teamTemplateList.js diff --git a/base-server/src/main/resources/template/tpl/crmCustomerContact/crmCustomerContactAdd.html b/base-server/src/main/resources/template/tpl/contacts/contactsAdd.html similarity index 83% rename from base-server/src/main/resources/template/tpl/crmCustomerContact/crmCustomerContactAdd.html rename to base-server/src/main/resources/template/tpl/contacts/contactsAdd.html index 5c9b531abb9c3e843db32ecaa4a8de1939ac38e0..a12d48d52959e7123b2a9cc0f2bfea4f74913aba 100644 --- a/base-server/src/main/resources/template/tpl/crmCustomerContact/crmCustomerContactAdd.html +++ b/base-server/src/main/resources/template/tpl/contacts/contactsAdd.html @@ -9,17 +9,13 @@