diff --git a/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js b/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js index 437fba425cfc2db7a9ee4b87d48c970b4b48adc8..4590663ef556839f92b38f25d9864f929e3fb180 100644 --- a/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js +++ b/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js @@ -48,33 +48,15 @@ layui.config({ systemCommonUtil.getSysAccountListByType(function(json){ // 加载账户数据 $("#accountId").html(getDataUseHandlebars(selOption, json)); - // 初始化会员 - initSupplierHtml(); }); - //初始化会员 - function initSupplierHtml() { - AjaxPostUtil.request({url: shopBasePath + "member009", params: {}, type: 'json', method: "GET", callback: function(json) { - if(json.returnCode == 0) { - //加载会员数据 - $("#supplierId").html(getDataUseHandlebars(selOption, json)); - // 初始化仓库 - initDepotHtml(); - } else { - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }, async: false}); - } - // 初始化仓库 - function initDepotHtml() { - erpOrderUtil.getDepotList(function (json){ - // 加载仓库数据 - $("#depotId").html(getDataUseHandlebars(selOption, json)); - // 初始化一行数据 - addRow(); - }); - } + erpOrderUtil.getDepotList(function (json){ + // 加载仓库数据 + $("#depotId").html(getDataUseHandlebars(selOption, json)); + // 初始化一行数据 + addRow(); + }); // 加载动态表单 dsFormUtil.loadPageByCode("dsFormShow", sysDsFormWithCodeType["outIsRetail"]["code"], null); @@ -239,7 +221,7 @@ layui.config({ } var params = { - supplierId: $("#supplierId").val(), + supplierId: sysMemberUtil.memberMation.id, operTime: $("#operTime").val(), accountId: $("#accountId").val(), payType: $("#payType").val(), @@ -322,7 +304,7 @@ layui.config({ } } - //商品选择 + // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); _openNewWindows({ @@ -349,6 +331,13 @@ layui.config({ }}); }); + // 会员选择 + $("body").on("click", ".chooseMemberBtn", function(e){ + sysMemberUtil.openSysMemberChoosePage(function (memberMation){ + $("#memberId").val(memberMation.contacts); + }); + }); + $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js b/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js index ab4ce41a131286b90b243e015c2e50dd3ac212cb..2bcd3137cdeb462df506a66f3fa65c488cc6bc05 100644 --- a/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js +++ b/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js @@ -47,48 +47,33 @@ layui.config({ trigger: 'click' }); orderObject = json; - initAccountHtml(); + initOtherMation(); } }); - // 初始化账户 - function initAccountHtml() { + function initOtherMation() { + // 初始化账户 systemCommonUtil.getSysAccountListByType(function(json){ - // 加载账户数据 $("#accountId").html(getDataUseHandlebars(selOption, json)); - // 初始化会员 - initSupplierHtml(); }); - } - //初始化会员 - function initSupplierHtml() { - AjaxPostUtil.request({url: shopBasePath + "member009", params: {}, type: 'json', method: "GET", callback: function(json) { - if(json.returnCode == 0) { - //加载会员数据 - $("#supplierId").html(getDataUseHandlebars(selOption, json)); - //初始化仓库 - initDepotHtml(); - } else { - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }}); - } - - // 初始化仓库 - function initDepotHtml() { + // 初始化仓库 erpOrderUtil.getDepotList(function (json){ - // 加载仓库数据 $("#depotId").html(getDataUseHandlebars(selOption, json)); - // 渲染数据到页面 - initDataToShow(); }); + + // 渲染数据到页面 + initDataToShow(); } //渲染数据到页面 function initDataToShow(){ submitType = orderObject.bean.submitType; - $("#supplierId").val(orderObject.bean.organId);//会员 + sysMemberUtil.memberMation = { + id: orderObject.bean.organId, + contacts: orderObject.bean.supplierName + }; + $("#memberId").val(sysMemberUtil.memberMation.contacts);//会员 $("#accountId").val(orderObject.bean.accountId);//账户 $("#payType").val(orderObject.bean.payType);//付款类型 //渲染列表项 @@ -296,7 +281,7 @@ layui.config({ } var params = { - supplierId: $("#supplierId").val(), + supplierId: sysMemberUtil.memberMation.id, operTime: $("#operTime").val(), accountId: $("#accountId").val(), payType: $("#payType").val(), @@ -380,7 +365,7 @@ layui.config({ } } - //商品选择 + // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); _openNewWindows({ @@ -407,6 +392,13 @@ layui.config({ }}); }); + // 会员选择 + $("body").on("click", ".chooseMemberBtn", function(e){ + sysMemberUtil.openSysMemberChoosePage(function (memberMation){ + $("#memberId").val(memberMation.contacts); + }); + }); + $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js b/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js index 934f1d76fd80b9f4149735dcddeec0a36259fa4f..5fe85e4aa3d7e3aa773aef862f8296d4773442cd 100644 --- a/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js +++ b/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js @@ -47,33 +47,14 @@ layui.config({ systemCommonUtil.getSysAccountListByType(function(json){ // 加载账户数据 $("#accountId").html(getDataUseHandlebars(selOption, json)); - // 初始化会员 - initSupplierHtml(); }); - //初始化会员 - function initSupplierHtml() { - AjaxPostUtil.request({url: shopBasePath + "member009", params: {}, type: 'json', method: "GET", callback: function(json) { - if(json.returnCode == 0) { - //加载会员数据 - $("#supplierId").html(getDataUseHandlebars(selOption, json)); - //初始化仓库 - initDepotHtml(); - } else { - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }, async: false}); - } - - // 初始化仓库 - function initDepotHtml() { - erpOrderUtil.getDepotList(function (json){ - // 加载仓库数据 - $("#depotId").html(getDataUseHandlebars(selOption, json)); - // 初始化一行数据 - addRow(); - }); - } + erpOrderUtil.getDepotList(function (json){ + // 加载仓库数据 + $("#depotId").html(getDataUseHandlebars(selOption, json)); + // 初始化一行数据 + addRow(); + }); // 加载动态表单 dsFormUtil.loadPageByCode("dsFormShow", sysDsFormWithCodeType["putIsRetailReturns"]["code"], null); @@ -238,7 +219,7 @@ layui.config({ } var params = { - supplierId: $("#supplierId").val(), + supplierId: sysMemberUtil.memberMation.id, operTime: $("#operTime").val(), accountId: $("#accountId").val(), payType: $("#payType").val(), @@ -321,7 +302,7 @@ layui.config({ } } - //商品选择 + // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); _openNewWindows({ @@ -348,6 +329,13 @@ layui.config({ }}); }); + // 会员选择 + $("body").on("click", ".chooseMemberBtn", function(e){ + sysMemberUtil.openSysMemberChoosePage(function (memberMation){ + $("#memberId").val(memberMation.contacts); + }); + }); + $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js b/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js index 3ad6b48cdec1f9a5b4c0285523a83ec743303db6..a4e739984e5adb7201126be3d7635eb19b3b895d 100644 --- a/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js +++ b/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js @@ -47,48 +47,31 @@ layui.config({ trigger: 'click' }); orderObject = json; - initAccountHtml(); + initOtherMation(); } }); - // 初始化账户 - function initAccountHtml() { + function initOtherMation() { + // 初始化账户 systemCommonUtil.getSysAccountListByType(function(json){ - // 加载账户数据 $("#accountId").html(getDataUseHandlebars(selOption, json)); - // 初始化会员 - initSupplierHtml(); }); - } - - //初始化会员 - function initSupplierHtml() { - AjaxPostUtil.request({url: shopBasePath + "member009", params: {}, type: 'json', method: "GET", callback: function(json) { - if(json.returnCode == 0) { - //加载会员数据 - $("#supplierId").html(getDataUseHandlebars(selOption, json)); - //初始化仓库 - initDepotHtml(); - } else { - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }}); - } - - // 初始化仓库 - function initDepotHtml() { + // 初始化仓库 erpOrderUtil.getDepotList(function (json){ - // 加载仓库数据 $("#depotId").html(getDataUseHandlebars(selOption, json)); - // 渲染数据到页面 - initDataToShow(); }); + // 渲染数据到页面 + initDataToShow(); } //渲染数据到页面 function initDataToShow(){ submitType = orderObject.bean.submitType; - $("#supplierId").val(orderObject.bean.organId);//会员 + sysMemberUtil.memberMation = { + id: orderObject.bean.organId, + contacts: orderObject.bean.supplierName + }; + $("#memberId").val(sysMemberUtil.memberMation.contacts);//会员 $("#accountId").val(orderObject.bean.accountId);//账户 $("#payType").val(orderObject.bean.payType);//付款类型 //渲染列表项 @@ -296,7 +279,7 @@ layui.config({ } var params = { - supplierId: $("#supplierId").val(), + supplierId: sysMemberUtil.memberMation.id, operTime: $("#operTime").val(), accountId: $("#accountId").val(), payType: $("#payType").val(), @@ -380,7 +363,7 @@ layui.config({ } } - //商品选择 + // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); _openNewWindows({ @@ -407,6 +390,13 @@ layui.config({ }}); }); + // 会员选择 + $("body").on("click", ".chooseMemberBtn", function(e){ + sysMemberUtil.openSysMemberChoosePage(function (memberMation){ + $("#memberId").val(memberMation.contacts); + }); + }); + $("body").on("click", "#cancle", function() { parent.layer.close(index); }); diff --git a/erp/src/main/resources/template/tpl/retailoutlet/retailoutletadd.html b/erp/src/main/resources/template/tpl/retailoutlet/retailoutletadd.html index 8aa476833ab40f187f34350a9a43c3a24212bf0b..40d35d7d51b8e7c1699a0af2582b8cb709feb3e6 100644 --- a/erp/src/main/resources/template/tpl/retailoutlet/retailoutletadd.html +++ b/erp/src/main/resources/template/tpl/retailoutlet/retailoutletadd.html @@ -15,7 +15,8 @@
- + +
diff --git a/erp/src/main/resources/template/tpl/retailoutlet/retailoutletedit.html b/erp/src/main/resources/template/tpl/retailoutlet/retailoutletedit.html index 567077ed8ca65b04203e0dbd97ecd55d6380f8dc..9586b288f38907d391a8640c0a799349bd372016 100644 --- a/erp/src/main/resources/template/tpl/retailoutlet/retailoutletedit.html +++ b/erp/src/main/resources/template/tpl/retailoutlet/retailoutletedit.html @@ -39,7 +39,8 @@
- + +
diff --git a/erp/src/main/resources/template/tpl/retailreturns/retailreturnsadd.html b/erp/src/main/resources/template/tpl/retailreturns/retailreturnsadd.html index 4f44249fdbe7458a6ebd3975a5e0623cd8464906..be4ee620dac2e0c9278c928478d4075fda74245b 100644 --- a/erp/src/main/resources/template/tpl/retailreturns/retailreturnsadd.html +++ b/erp/src/main/resources/template/tpl/retailreturns/retailreturnsadd.html @@ -15,7 +15,8 @@
- + +
@@ -82,7 +83,7 @@
- +
diff --git a/erp/src/main/resources/template/tpl/retailreturns/retailreturnsedit.html b/erp/src/main/resources/template/tpl/retailreturns/retailreturnsedit.html index a39c082e3202ce4483fb519600ae205ad91df5dc..e3954bfc775055587f73fe1bb49f783ce0ade04e 100644 --- a/erp/src/main/resources/template/tpl/retailreturns/retailreturnsedit.html +++ b/erp/src/main/resources/template/tpl/retailreturns/retailreturnsedit.html @@ -39,7 +39,8 @@
- + +
@@ -106,7 +107,7 @@
- +
diff --git a/member/src/main/resources/template/js/member/memberSearchChoose.js b/member/src/main/resources/template/js/member/memberSearchChoose.js index f62e856508e694c712960bfdb1eecc2a7eaf9b07..07fb148e8fac10f3aafcbc90a39bdea49fa34952 100644 --- a/member/src/main/resources/template/js/member/memberSearchChoose.js +++ b/member/src/main/resources/template/js/member/memberSearchChoose.js @@ -56,7 +56,7 @@ layui.config({ form.render(); var chooseIndex = JSON.stringify(dubClick.data('index')); var obj = res.rows[chooseIndex]; - parent.memberMation = obj; + parent.sysMemberUtil.memberMation = obj; parent.refreshCode = '0'; parent.layer.close(index); diff --git a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js b/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js index 15e8a03cb312660373d99056a02d69192009d6ab..298e3adb36ccab6dc8536bd6e613e828b3b5e0d5 100644 --- a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js +++ b/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js @@ -3,9 +3,6 @@ // 表格的序号 var rowNum = 1; -// 会员信息 -var memberMation = {}; - layui.config({ base: basePath, version: skyeyeVersion @@ -84,7 +81,7 @@ layui.config({ var params = { storeId: $("#storeId").val(), userType: userType, - memberId: userType == 1 ? "" : memberMation.id, + memberId: userType == 1 ? "" : sysMemberUtil.memberMation.id, memberCarId: userType == 1 ? "" : $("#memberCar").val(), memberCarPlate: userType == 1 ? $("#memberCarPlate").val() : $("#memberCar").find("option:selected").text(), mealOrderChildId: userType == 1 ? "" : $("#mealId").val(), @@ -165,30 +162,21 @@ layui.config({ // 会员选择 $("body").on("click", ".chooseMemberBtn", function(e){ - _openNewWindows({ - url: "../../tpl/member/memberSearchChoose.html", - title: "选择会员", - pageId: "memberSearchChoose", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#memberId").val(memberMation.contacts); - // 获取会员拥有的车辆信息 - AjaxPostUtil.request({url: shopBasePath + "memberCar001", params: {memberId: memberMation.id}, type: 'json', method: "POST", callback: function(json){ - if(json.returnCode == 0){ - $.each(json.rows, function (i, item){ - item.name = item.modelType + "(" + item.plate + ")"; - }); - $("#memberCar").html(getDataUseHandlebars(selOption, json)); - form.render('select'); - }else{ - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }, async: false}); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); + sysMemberUtil.openSysMemberChoosePage(function (memberMation){ + $("#memberId").val(memberMation.contacts); + // 获取会员拥有的车辆信息 + AjaxPostUtil.request({url: shopBasePath + "memberCar001", params: {memberId: memberMation.id}, type: 'json', method: "POST", callback: function(json){ + if(json.returnCode == 0){ + $.each(json.rows, function (i, item){ + item.name = item.modelType + "(" + item.plate + ")"; + }); + $("#memberCar").html(getDataUseHandlebars(selOption, json)); + form.render('select'); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); } - }}); + }, async: false}); + }); }); $("body").on("input", ".calcPrice", function() { diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index 2b69c8174f506a18c016fb56f3a096be4ee67e6d..8f23804e2756927b61c009c65a9f785f84fbb821 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -22,6 +22,7 @@ var customerJS = { "sysFileUtil": "../../assets/lib/layui/customer/sysFileUtil.js", // 系统文件相关处理工具 "publicKeyCode": "../../assets/lib/layui/customer/publicKeyCode.js", // 快捷键 "sysSupplierUtil": "../../assets/lib/layui/customer/sysSupplierUtil.js", // 供应商相关工具 + "sysMemberUtil": "../../assets/lib/layui/customer/sysMemberUtil.js", // 会员相关工具 "bossUtil": "../../assets/lib/layui/customer/bossUtil.js", // 招聘模块相关工具 "shopUtil": "../../assets/lib/layui/customer/shopUtil.js", // 商城模块相关工具 }; diff --git a/web/src/main/resources/template/assets/lib/layui/customer/sysMemberUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/sysMemberUtil.js new file mode 100644 index 0000000000000000000000000000000000000000..cd7dc8d52fe17a89f42b84eaf0b87f9467ceeae2 --- /dev/null +++ b/web/src/main/resources/template/assets/lib/layui/customer/sysMemberUtil.js @@ -0,0 +1,32 @@ + +// 会员工具类 +var sysMemberUtil = { + + /** + * 已经选的的会员信息 + */ + memberMation: {}, + + /** + * 会员选择页面 + * + * @param callback 回调函数 + */ + openSysMemberChoosePage: function (callback){ + _openNewWindows({ + url: "../../tpl/member/memberSearchChoose.html", + title: "选择会员", + pageId: "memberSearchChoose", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + if (refreshCode == '0') { + if(typeof(callback) == "function") { + callback(sysMemberUtil.memberMation); + } + } else if (refreshCode == '-9999') { + winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); + } + }}); + }, + +} \ No newline at end of file