From 1f45ad16be64f34a6b6d1c448df27798012c36d5 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 14 May 2022 10:55:57 +0800 Subject: [PATCH] =?UTF-8?q?CRM=E5=95=86=E6=9C=BA=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/crmOpportunity/crmopportunityadd.js | 43 ++++++------------ .../js/crmOpportunity/crmopportunityedit.js | 45 +++++++------------ .../crmopportunityfromlist.js | 7 ++- .../lib/layui/customer/sysCustomerUtil.js | 17 +++++++ 4 files changed, 49 insertions(+), 63 deletions(-) diff --git a/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js b/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js index d07ca113a..d7645d745 100644 --- a/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js +++ b/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js @@ -26,9 +26,6 @@ layui.config({ textool = layui.textool; var selOption = getFileContent('tpl/template/select-option.tpl'); - var partId = ""; // 商机参与人id - var followId = ""; // 商机关注人id - textool.init({ eleId: 'businessNeed', maxlength: 1000, @@ -40,32 +37,18 @@ layui.config({ elem: '#estimateEndTime', range: false }); - - fromSelect(); - // 商机来源选择 - function fromSelect(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmopportunityfrom008", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter: function(json){ - departmentsSelect(); - form.render('select'); - } - }); - } - - function departmentsSelect(){ - // 获取当前登录用户所属企业的所有部门信息 - systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data){ - $("#subDepartments").html(getDataUseHandlebars(selOption, data)); - form.render('select'); - }); - } + + // 获取已经上线的商机来源信息 + sysCustomerUtil.queryCustomerOpportunityFromIsUpList(function(data){ + $("#fromId").html(getDataUseHandlebars(selOption, data)); + form.render('select'); + }); + + // 获取当前登录用户所属企业的所有部门信息 + systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data){ + $("#subDepartments").html(getDataUseHandlebars(selOption, data)); + form.render('select'); + }); skyeyeEnclosure.init('enclosureUpload'); matchingLanguage(); @@ -127,6 +110,7 @@ layui.config({ if(partIdList.length == 0 || isNull($('#partId').tagEditor('getTags')[0].tags)){ params.partId = ""; }else{ + var partId = ""; $.each(partIdList, function (i, item) { partId += item.id + ','; }); @@ -136,6 +120,7 @@ layui.config({ if(followIdList.length == 0 || isNull($('#followId').tagEditor('getTags')[0].tags)){ params.followId = ""; }else{ + var followId = ""; $.each(followIdList, function (i, item) { followId += item.id + ','; }); diff --git a/crm/src/main/resources/template/js/crmOpportunity/crmopportunityedit.js b/crm/src/main/resources/template/js/crmOpportunity/crmopportunityedit.js index fa80f1bb4..47bf1517d 100644 --- a/crm/src/main/resources/template/js/crmOpportunity/crmopportunityedit.js +++ b/crm/src/main/resources/template/js/crmOpportunity/crmopportunityedit.js @@ -56,36 +56,21 @@ layui.config({ }else{ $(".typeOne").removeClass("layui-hide"); } - - fromSelect(); - // 商机来源选择 - function fromSelect(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmopportunityfrom008", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter: function(j){ - $("#fromId").val(json.bean.fromId); - departmentsSelect(); - form.render('select'); - } - }); - } - - // 商机所属部门选择 - function departmentsSelect(){ - // 获取当前登录用户所属企业的所有部门信息 - systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data){ - $("#subDepartments").html(getDataUseHandlebars(selOption, data)); - $("#subDepartments").val(json.bean.subDepartments); - form.render('select'); - }); - } - + + // 获取已经上线的商机来源信息 + sysCustomerUtil.queryCustomerOpportunityFromIsUpList(function(data){ + $("#fromId").html(getDataUseHandlebars(selOption, data)); + $("#fromId").val(json.bean.fromId); + form.render('select'); + }); + + // 获取当前登录用户所属企业的所有部门信息 + systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data){ + $("#subDepartments").html(getDataUseHandlebars(selOption, data)); + $("#subDepartments").val(json.bean.subDepartments); + form.render('select'); + }); + // 选择入职时间 laydate.render({ elem: '#estimateEndTime', diff --git a/crm/src/main/resources/template/js/crmopportunityfrom/crmopportunityfromlist.js b/crm/src/main/resources/template/js/crmopportunityfrom/crmopportunityfromlist.js index 79d4596f0..c0c503a0f 100644 --- a/crm/src/main/resources/template/js/crmopportunityfrom/crmopportunityfromlist.js +++ b/crm/src/main/resources/template/js/crmopportunityfrom/crmopportunityfromlist.js @@ -6,7 +6,6 @@ layui.config({ window: 'js/winui.window' }).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { winui.renderColor(); - var $ = layui.$, form = layui.form, table = layui.table; @@ -20,8 +19,8 @@ layui.config({ where: {typeName: $("#typeName").val(), state: $("#state").val()}, even: true, page: true, - limits: [8, 16, 24, 32, 40, 48, 56], - limit: 8, + limits: getLimits(), + limit: getLimit(), cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'}, { field: 'typeName', title: '类型名称', align: 'center', width: 120 }, @@ -36,7 +35,7 @@ layui.config({ return "参数错误"; } }}, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 200}, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150}, { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#tableBar'} ]], done: function(){ diff --git a/web/src/main/resources/template/assets/lib/layui/customer/sysCustomerUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/sysCustomerUtil.js index 2966e08b1..d984d0f4a 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/sysCustomerUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/sysCustomerUtil.js @@ -29,6 +29,23 @@ var sysCustomerUtil = { }}); }, + /** + * 获取已经上线的商机来源信息 + * + * @param callback 回执函数 + */ + queryCustomerOpportunityFromIsUpList: function (callback){ + AjaxPostUtil.request({url: flowableBasePath + "crmopportunityfrom008", params: {}, type: 'json', method: "GET", callback: function(json) { + if(json.returnCode == 0) { + if(typeof(callback) == "function") { + callback(json); + } + } else { + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, async: false}); + }, + /** * 获取客户类型状态为上线的所有记录 * -- GitLab