diff --git a/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js b/crm/src/main/resources/template/js/crmOpportunity/crmopportunityadd.js index d07ca113a2cc4d459777a7609e7749347ba230f8..d7645d745ff0922a970ef929e818de5a50a742dd 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 fa80f1bb41d1bdd5bf6ad62fb9b928366e87fe7c..47bf1517d6172be6a74786199d8812492126ed69 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 79d4596f0e8a3ce33ed335bb52b739d31f5ad1b9..c0c503a0f97d5e783ab56cd880764b76b01429b5 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 2966e08b1941011c384b09264e375c95ce8f69fc..d984d0f4a0be1dd6bd75e6b4ca0438a8285d8033 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}); + }, + /** * 获取客户类型状态为上线的所有记录 *