From 5299682ae9a532502f08cf5c6200e2ffef9853c4 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 17 Apr 2022 22:26:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B7=B2=E4=B8=8A=E7=BA=BF?= =?UTF-8?q?=E7=9A=84=E5=AE=A2=E6=88=B7=E6=9D=A5=E6=BA=90=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/customermanage/customerChoose.js | 25 +++++----------- .../customerInternationalList.js | 25 +++++----------- .../template/js/customermanage/customeradd.js | 25 +++++----------- .../js/customermanage/customeredit.js | 29 +++++++------------ .../js/customermanage/customerlist.js | 25 +++++----------- .../js/customermanage/myConscientiousList.js | 25 +++++----------- .../js/customermanage/myCreateList.js | 25 +++++----------- .../lib/layui/customer/sysCustomerUtil.js | 17 +++++++++++ 8 files changed, 69 insertions(+), 127 deletions(-) diff --git a/crm/src/main/resources/template/js/customermanage/customerChoose.js b/crm/src/main/resources/template/js/customermanage/customerChoose.js index 7ea03dcc9..ec9f81188 100644 --- a/crm/src/main/resources/template/js/customermanage/customerChoose.js +++ b/crm/src/main/resources/template/js/customermanage/customerChoose.js @@ -18,26 +18,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selOption, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: getFileContent('tpl/template/select-option.tpl'), - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selOption, data)); + form.render('select'); + customerIndustry(); + }); + //行业 function customerIndustry(){ showGrid({ diff --git a/crm/src/main/resources/template/js/customermanage/customerInternationalList.js b/crm/src/main/resources/template/js/customermanage/customerInternationalList.js index 1d0c718b8..91171151d 100644 --- a/crm/src/main/resources/template/js/customermanage/customerInternationalList.js +++ b/crm/src/main/resources/template/js/customermanage/customerInternationalList.js @@ -16,26 +16,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selectOption, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectOption, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectOption, data)); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ diff --git a/crm/src/main/resources/template/js/customermanage/customeradd.js b/crm/src/main/resources/template/js/customermanage/customeradd.js index d6e09d984..e7aa7f035 100644 --- a/crm/src/main/resources/template/js/customermanage/customeradd.js +++ b/crm/src/main/resources/template/js/customermanage/customeradd.js @@ -23,26 +23,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selectMust, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectMust, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(json){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectMust, data)); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ diff --git a/crm/src/main/resources/template/js/customermanage/customeredit.js b/crm/src/main/resources/template/js/customermanage/customeredit.js index 2c3c2e0b4..4dfc2e796 100644 --- a/crm/src/main/resources/template/js/customermanage/customeredit.js +++ b/crm/src/main/resources/template/js/customermanage/customeredit.js @@ -32,25 +32,16 @@ layui.config({ $("#typeId").html(getDataUseHandlebars(selectMust, data)); $("#typeId").val(json.bean.typeId); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectMust, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - $("#fromId").val(json.bean.fromId); - form.render('select'); - customerIndustry(); - } - }); - } + + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectMust, data)); + $("#fromId").val(json.bean.fromId); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ @@ -79,7 +70,7 @@ layui.config({ template: selectMust, ajaxSendLoadBefore: function(hdb){ }, - ajaxSendAfter:function(json){ + ajaxSendAfter:function(data){ $("#groupId").val(json.bean.groupId); form.render('select'); } diff --git a/crm/src/main/resources/template/js/customermanage/customerlist.js b/crm/src/main/resources/template/js/customermanage/customerlist.js index 1be436680..f20bb1c4a 100644 --- a/crm/src/main/resources/template/js/customermanage/customerlist.js +++ b/crm/src/main/resources/template/js/customermanage/customerlist.js @@ -19,26 +19,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selectOption, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectOption, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectOption, data)); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ diff --git a/crm/src/main/resources/template/js/customermanage/myConscientiousList.js b/crm/src/main/resources/template/js/customermanage/myConscientiousList.js index c7f460a81..dac66397f 100644 --- a/crm/src/main/resources/template/js/customermanage/myConscientiousList.js +++ b/crm/src/main/resources/template/js/customermanage/myConscientiousList.js @@ -17,26 +17,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selectOption, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectOption, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectOption, data)); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ diff --git a/crm/src/main/resources/template/js/customermanage/myCreateList.js b/crm/src/main/resources/template/js/customermanage/myCreateList.js index 5210fe27c..dc2b9fde9 100644 --- a/crm/src/main/resources/template/js/customermanage/myCreateList.js +++ b/crm/src/main/resources/template/js/customermanage/myCreateList.js @@ -19,26 +19,15 @@ layui.config({ sysCustomerUtil.queryCustomerTypeIsUpList(function (data){ $("#typeId").html(getDataUseHandlebars(selectOption, data)); form.render('select'); - customerFrom(); }); - // 来源 - function customerFrom(){ - showGrid({ - id: "fromId", - url: flowableBasePath + "crmcustomerfrom008", - params: {}, - pagination: false, - template: selectOption, - ajaxSendLoadBefore: function(hdb){ - }, - ajaxSendAfter:function(j){ - form.render('select'); - customerIndustry(); - } - }); - } - + // 获取已上线的客户来源类型 + sysCustomerUtil.queryCustomerFromIsUpList(function (data){ + $("#fromId").html(getDataUseHandlebars(selectOption, data)); + form.render('select'); + customerIndustry(); + }); + // 行业 function customerIndustry(){ showGrid({ 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 3ed2e2682..2052187c7 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 @@ -46,4 +46,21 @@ var sysCustomerUtil = { }, async: false}); }, + /** + * 获取已上线的客户来源类型 + * + * @param callback 回执函数 + */ + queryCustomerFromIsUpList: function (callback){ + AjaxPostUtil.request({url: flowableBasePath + "crmcustomerfrom008", 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}); + }, + } \ No newline at end of file -- GitLab