提交 345eea8f 编写于 作者: Skyeye云's avatar Skyeye云

退款订单完成

上级 efa5e909
var rowId = "";
var dataMation = {};
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -80,6 +82,8 @@ layui.config({
complatePay(data)
}else if(layEvent == 'cancleOrder'){ // 取消订单
cancleOrder(data)
}else if(layEvent == 'refundMealOrder'){ // 退款
refundMealOrder(data)
}
});
......@@ -126,6 +130,24 @@ layui.config({
});
}
// 退款
function refundMealOrder(data){
dataMation = data;
_openNewWindows({
url: "../../tpl/refundMealOrder/refundMealOrder.html",
title: '退款',
pageId: "refundMealOrder",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000});
loadTable();
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
}
}});
}
// 完成支付
function complatePay(data){
rowId = data.id;
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
var selOption = getFileContent('tpl/template/select-option.tpl');
// 加载套餐订单退款原因
shopUtil.queryRefundMealOrderReasonList(function (json){
$("#mealRefundReasonId").html(getDataUseHandlebars(selOption, json));
});
var mealSinglePrice = division(parent.dataMation.mealPrice, parent.dataMation.mealNum);
var refundPrice = multiplication(mealSinglePrice, parent.dataMation.remainMealNum);
$("#refundPrice").val(refundPrice);
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
mealOrderChildId: parent.dataMation.mealOrderChildId,
mealRefundReasonId: $("#mealRefundReasonId").val(),
refundPrice: $("#refundPrice").val(),
};
AjaxPostUtil.request({url: shopBasePath + "refundMealOrder", params: params, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: true});
}
return false;
});
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
var selOption = getFileContent('tpl/template/select-option.tpl');
// 加载我所在的门店
shopUtil.queryStaffBelongStoreList(function (json){
$("#storeId").html(getDataUseHandlebars($("#selectTemplate").html(), json));
});
form.on('select(storeId)', function(data) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()})
});
// 加载套餐订单性质
shopUtil.queryMealOrderNatureList(function (json){
$("#natureId").html(getDataUseHandlebars(selOption, json));
});
laydate.render({
elem: '#refundTime',
range: '~'
});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: shopBasePath + 'queryRefundMealOrderList',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers'},
{ field: 'orderNum', title: '订单号', align: 'left', width: 180, fixed: 'left', templet: function(d){
return '<a lay-event="select" class="notice-title-click">' + d.orderNum + '</a>';
}},
{ field: 'contacts', title: '会员名称', width: 100 },
{ field: 'phone', title: '会员手机号', width: 100, align: "center"},
{ field: 'createName', title: '专属顾问', width: 130, align: "left"},
{ field: 'natureName', title: '订单性质', width: 100, align: "left"},
{ field: 'modelType', title: '车型', width: 100, align: "left"},
{ field: 'plate', title: '车牌', width: 100, align: "left"},
{ field: 'vinCode', title: 'VIN码', width: 150, align: "left"},
{ field: 'state', title: '审核状态', width: 80, align: "center", templet: function(d){
if(d.state == 1){
return "待审核";
}else if(d.state == 2){
return "退款驳回";
}else {
return "已退款";
}
}},
{ field: 'storeName', title: '缴费门店', width: 150, align: "left"},
{ field: 'mealTitle', title: '套餐名称', width: 150, align: "left"},
{ field: 'mealPrice', title: '套餐费用', width: 120, align: "left"},
{ field: 'mealNum', title: '总保养次数', width: 120, align: "left"},
{ field: 'remainMealNum', title: '剩余保养次数', width: 120, align: "left"},
{ field: 'mealSinglePrice', title: '单次保养金额', width: 120, align: "left"},
{ field: 'refundPrice', title: '退款金额', width: 120, align: "left"},
{ field: 'whetherGive', title: '是否赠送', width: 100, align: "center", templet: function(d){
return shopUtil.getMealOrderWhetherGiveName(d);
}},
{ field: 'refundTime', title: '申请退款时间', align: 'center', width: 150 },
{ field: 'refundReasonName', title: '退款原因', width: 120, align: "left"},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
]],
done: function(){
matchingLanguage();
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'rejection') { // 驳回
rejection(data);
}else if(layEvent == 'select'){ // 详情
select(data)
}else if(layEvent == 'pass'){ // 退款
pass(data)
}
});
// 驳回
function rejection(data){
var msg = '确定驳回退款金额为:' + data.refundPrice + '元的退款申请吗';
layer.confirm(msg, {icon: 3, title: '驳回'}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "approvelRefundMealOrder", params: {id: data.id, state: 2}, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
winui.window.msg('驳回成功', {icon: 1, time: 2000});
loadTable();
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: true});
});
}
// 退款
function pass(data){
var msg = '此次退款金额为:' + data.refundPrice + '';
layer.confirm(msg, {icon: 3, title: '退款'}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "approvelRefundMealOrder", params: {id: data.id, state: 3}, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
winui.window.msg('退款成功.', {icon: 1, time: 2000});
loadTable();
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: true});
});
}
// 详情
function select(data){
rowId = data.mealOrderId;
_openNewWindows({
url: "../../tpl/mealOrder/storeMealOrderDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "storeMealOrderDetails",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
}
});
}
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()})
}
return false;
});
$("body").on("click", "#reloadTable", function() {
loadTable();
});
// 刷新
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams(){
var storeId = $("#storeId").val();
if(isNull(storeId)){
storeId = "-";
}
var startTime = "", endTime = "";
if(!isNull($("#refundTime").val())){
startTime = $("#refundTime").val().split('~')[0].trim() + ' 00:00:00';
endTime = $("#refundTime").val().split('~')[1].trim() + ' 23:59:59';
}
return {
memberName: $("#memberName").val(),
memberPhone: $("#memberPhone").val(),
plate: $("#plate").val(),
vinCode: $("#vinCode").val(),
consultantName: $("#consultantName").val(),
state: $("#state").val(),
whetherGive: $("#whetherGive").val(),
natureId: $("#natureId").val(),
storeId: storeId,
startTime: startTime,
endTime: endTime
};
}
exports('refundMealOrderList', {});
});
......@@ -72,6 +72,9 @@
{{# if(d.cancleState == 1 && d.state == 1 && auth('1644842735595')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="cancleOrder">取消订单</a>
{{# } }}
{{# if((d.state == 2 || d.state == 3 || d.state == 6) && auth('1647059493157')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="refundMealOrder">退款</a>
{{# } }}
</script>
</div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">退款原因<i class="red">*</i></label>
<div class="layui-input-block">
<select lay-filter="mealRefundReasonId" lay-search="" win-verify="required" id="mealRefundReasonId">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">退款金额<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="refundPrice" name="refundPrice" win-verify="required|money" placeholder="请输入退款金额" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean">提交</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/refundMealOrder/'}).use('refundMealOrder');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane layui-col-xs12" action="" autocomplete="off">
<div class="winui-toolbar layui-col-xs12">
<div class="winui-tool layui-col-xs3">
<select id="storeId" name="storeId" lay-filter="storeId" lay-search="">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12" style="margin-top: 10px;">
<div class="layui-inline">
<label class="layui-form-label">会员名称</label>
<div class="layui-input-inline">
<input type="text" id="memberName" name="memberName" placeholder="请输入会员名称" class="layui-input" />
</div>
<label class="layui-form-label">会员手机号</label>
<div class="layui-input-inline">
<input type="text" id="memberPhone" name="memberPhone" placeholder="请输入会员手机号" class="layui-input" />
</div>
<label class="layui-form-label">车牌号</label>
<div class="layui-input-inline">
<input type="text" id="plate" name="plate" placeholder="请输入车牌号" class="layui-input" />
</div>
<label class="layui-form-label">VIN码</label>
<div class="layui-input-inline">
<input type="text" id="vinCode" name="vinCode" placeholder="请输入VIN码" class="layui-input" />
</div>
<label class="layui-form-label">专属顾问</label>
<div class="layui-input-inline">
<input type="text" id="consultantName" name="consultantName" placeholder="请输入专属顾问" class="layui-input" />
</div>
<label class="layui-form-label">审核状态</label>
<div class="layui-input-inline">
<select id="state" name="state" lay-filter="state" lay-search="">
<option value="">全部</option>
<option value="1">待确认</option>
<option value="2">退款驳回</option>
<option value="3">已退款</option>
</select>
</div>
<label class="layui-form-label">是否赠送</label>
<div class="layui-input-inline">
<select id="whetherGive" name="whetherGive" lay-filter="whetherGive" lay-search="">
<option value="">全部</option>
<option value="1"></option>
<option value="2"></option>
</select>
</div>
<label class="layui-form-label">订单性质</label>
<div class="layui-input-inline">
<select id="natureId" name="natureId" lay-filter="natureId" lay-search="">
</select>
</div>
<label class="layui-form-label">退款时间</label>
<div class="layui-input-inline">
<input type="text" id="refundTime" name="refundTime" placeholder="请选择退款时间范围" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar layui-col-xs12">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.state == 1 && auth('1647062128499')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="rejection">驳回</a>
{{# } }}
{{# if(d.state == 1 && auth('1647062128499')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="pass">退款</a>
{{# } }}
</script>
</div>
<script type="text/x-handlebars-template" id="selectTemplate">
{{#each rows}}
<option value="{{id}}">{{name}}</option>
{{/each}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/refundMealOrder/'}).use('refundMealOrderList');
</script>
</body>
</html>
\ No newline at end of file
......@@ -41,6 +41,23 @@ var shopUtil = {
}, async: false});
},
/**
* 获取套餐订单已启用的退款原因列表
*
* @param callback 回执函数
*/
queryRefundMealOrderReasonList: function (callback){
AjaxPostUtil.request({url: shopBasePath + "queryUseingMealRefundOrderReasonList", 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});
},
/**
* 获取套餐订单是否赠送的字段信息
*
......@@ -77,6 +94,10 @@ var shopUtil = {
return "<span class=''>已退款</span>";
} else if (data.state == 0) {
return "<span class=''>已提交订单</span>";
} else if (data.state == 51) {
return "<span class=''>退款中</span>";
} else if (data.state == 6) {
return "<span class=''>退款驳回</span>";
}
} else {
return '已取消';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册