提交 501514f9 编写于 作者: doc_wei's avatar doc_wei

ERP与会员相关的整改完成

上级 03093258
......@@ -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);
});
......
......@@ -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);
});
......
......@@ -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);
});
......
......@@ -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);
});
......
......@@ -15,7 +15,8 @@
<div class="layui-form-item layui-col-xs3">
<label class="layui-form-label">会员<i class="red">*</i></label>
<div class="layui-input-block">
<select id="supplierId" lay-search win-verify="required"></select>
<input type="text" id="memberId" name="memberId" placeholder="请选择会员" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseMemberBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs3">
......
......@@ -39,7 +39,8 @@
<div class="layui-form-item layui-col-xs3">
<label class="layui-form-label">会员<i class="red">*</i></label>
<div class="layui-input-block">
<select id="supplierId" lay-search win-verify="required"></select>
<input type="text" id="memberId" name="memberId" placeholder="请选择会员" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseMemberBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs3">
......
......@@ -15,7 +15,8 @@
<div class="layui-form-item layui-col-xs3">
<label class="layui-form-label">会员<i class="red">*</i></label>
<div class="layui-input-block">
<select id="supplierId" lay-search win-verify="required"></select>
<input type="text" id="memberId" name="memberId" placeholder="请选择会员" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseMemberBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs3">
......@@ -82,7 +83,7 @@
</div>
</div>
<div class="layui-form-item layui-col-xs4">
<label class="layui-form-label">退款金额</label>
<label class="layui-form-label">退款金额<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="changeAmount" name="changeAmount" win-verify="required|money" class="layui-input" style="color: red; font-size: 17px;"/>
</div>
......
......@@ -39,7 +39,8 @@
<div class="layui-form-item layui-col-xs3">
<label class="layui-form-label">会员<i class="red">*</i></label>
<div class="layui-input-block">
<select id="supplierId" lay-search win-verify="required"></select>
<input type="text" id="memberId" name="memberId" placeholder="请选择会员" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseMemberBtn"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs3">
......@@ -106,7 +107,7 @@
</div>
</div>
<div class="layui-form-item layui-col-xs4">
<label class="layui-form-label">退款金额</label>
<label class="layui-form-label">退款金额<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="changeAmount" name="changeAmount" win-verify="required|money" value="{{changeAmount}}" class="layui-input" style="color: red; font-size: 17px;"/>
</div>
......
......@@ -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);
......
......@@ -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() {
......
......@@ -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", // 商城模块相关工具
};
......
// 会员工具类
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册