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 @@