将售后申请设置为商家手动允许售后
This commit is contained in:
parent
dda4187357
commit
7f81ee073b
@ -25,6 +25,8 @@ use app\admin\logic\LoginLogic;
|
||||
use app\admin\validate\LoginValidate;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\WeChatServer;
|
||||
use EasyWeChat\Factory;
|
||||
|
||||
class Login extends AdminBase
|
||||
{
|
||||
@ -36,6 +38,22 @@ class Login extends AdminBase
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
// $this->config = WeChatServer::getOaConfig();
|
||||
// $this->app = Factory::officialAccount($this->config);
|
||||
// $this->app->template_message->sendSubscription([
|
||||
// 'touser' => 'user-openid',
|
||||
// 'template_id' => 'template-id',
|
||||
// 'url' => 'https://easywechat.com',
|
||||
// 'scene' => 1000,
|
||||
// 'data' => [
|
||||
// 'key1' => 'VALUE',
|
||||
// 'key2' => 'VALUE2',
|
||||
// ...
|
||||
// ],
|
||||
// ]);
|
||||
// dump($this->config);
|
||||
// dump($this->app);
|
||||
// die;
|
||||
if ($this->request->isAjax()) {
|
||||
$post = request()->post();
|
||||
(new LoginValidate())->goCheck();
|
||||
|
||||
@ -56,7 +56,7 @@ class AfterSaleLogic extends Logic
|
||||
$where[] = ['o.order_status', 'in', [Order::STATUS_WAIT_RECEIVE, Order::STATUS_FINISH]];
|
||||
$order = new Order();
|
||||
$count = $order->alias('o')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.create_time,s.id as sid,s.name as shop_name,s.type as shop_type')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.create_time, o.allow_after_sale, s.id as sid,s.name as shop_name,s.type as shop_type')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->join('shop s', 'o.shop_id = s.id')
|
||||
->with(['order_goods' => function ($query) {
|
||||
@ -69,7 +69,7 @@ class AfterSaleLogic extends Logic
|
||||
|
||||
$lists = $order
|
||||
->alias('o')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.order_sn,o.create_time,s.id as sid,s.name as shop_name,s.logo as shop_logo,s.type as shop_type')
|
||||
->field('o.id,o.confirm_take_time,o.order_status,o.order_sn,o.create_time, o.allow_after_sale,s.id as sid,s.name as shop_name,s.logo as shop_logo,s.type as shop_type')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->join('shop s', 'o.shop_id = s.id')
|
||||
->with(['order_goods' => function ($query) {
|
||||
@ -115,6 +115,7 @@ class AfterSaleLogic extends Logic
|
||||
$result['order_goods'] = $order_goods;
|
||||
$result['order_sn'] = $item['order_sn'];
|
||||
$result['create_time'] = $item['create_time'];
|
||||
$result['allow_after_sale'] = $item['allow_after_sale'];
|
||||
$result['after_sale']['desc'] = '';
|
||||
$result['after_sale']['able_apply'] = 1;
|
||||
$result['after_sale']['sn'] = '';
|
||||
@ -132,6 +133,7 @@ class AfterSaleLogic extends Logic
|
||||
$result['time'] = $time;
|
||||
$data[] = $result;
|
||||
}
|
||||
|
||||
$list = ['list' => $data, 'page' => $page, 'size' => $size, 'count' => $count, 'more' => is_more($count, $page, $size)];
|
||||
return $list;
|
||||
break;
|
||||
@ -313,7 +315,7 @@ class AfterSaleLogic extends Logic
|
||||
$where = ['order_id' => $order_id, 'item_id' => $item_id];
|
||||
$info = $goods->where($where)->find()->toArray();
|
||||
$goods['image'] = isset($info['image']) ? UrlServer::getFileUrl($info['image']) : '';
|
||||
$data = [
|
||||
$data = [
|
||||
'goods' => $info,
|
||||
'reason' => AfterSale::getReasonLists(),
|
||||
];
|
||||
@ -500,7 +502,7 @@ class AfterSaleLogic extends Logic
|
||||
$user_id,
|
||||
AfterSaleLog::USER_AGAIN_REFUND
|
||||
);
|
||||
|
||||
|
||||
$order = Order::with('shop')->where(['id' => $post['order_id']])->find();
|
||||
if (!empty($order['shop']['mobile'])) {
|
||||
//通知商家
|
||||
|
||||
@ -349,4 +349,16 @@ class Order extends ShopBase
|
||||
}
|
||||
}
|
||||
|
||||
// 允许售后申请
|
||||
public function allowAfterSale()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->post();
|
||||
if (OrderLogic::allowAfterSale($params)) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
|
||||
return JsonServer::error('操作失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1090,4 +1090,14 @@ class OrderLogic extends Logic
|
||||
}
|
||||
}
|
||||
|
||||
// 允许售后申请
|
||||
public static function allowAfterSale($params)
|
||||
{
|
||||
$type = 1;
|
||||
if ($params['type'] == 1) {
|
||||
$type = 0;
|
||||
}
|
||||
|
||||
return Order::where('id', $params['id'])->update(['allow_after_sale' => $type, 'update_time' => time()]);
|
||||
}
|
||||
}
|
||||
@ -1,32 +1,37 @@
|
||||
{layout name="layout1" /}
|
||||
<style>
|
||||
.layui-table-cell {
|
||||
height:auto;
|
||||
height: auto;
|
||||
}
|
||||
.goods-content>div:not(:last-of-type) {
|
||||
border-bottom:1px solid #DCDCDC;
|
||||
|
||||
.goods-content > div:not(:last-of-type) {
|
||||
border-bottom: 1px solid #DCDCDC;
|
||||
}
|
||||
.goods-data::after{
|
||||
|
||||
.goods-data::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
.goods_name_hide{
|
||||
overflow:hidden;
|
||||
white-space:nowrap;
|
||||
|
||||
.goods_name_hide {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.operation-btn {
|
||||
margin: 5px;
|
||||
}
|
||||
.table-operate{
|
||||
|
||||
.table-operate {
|
||||
text-align: left;
|
||||
font-size:14px;
|
||||
padding:0 5px;
|
||||
height:auto;
|
||||
overflow:visible;
|
||||
text-overflow:inherit;
|
||||
white-space:normal;
|
||||
font-size: 14px;
|
||||
padding: 0 5px;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
text-overflow: inherit;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
@ -34,17 +39,18 @@
|
||||
<div class="wrapper">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>*会员商城下单列表。</p>
|
||||
<p>*订单状态有待付款,待发货,待收货,已完成,已关闭。</p>
|
||||
<p>*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。</p>
|
||||
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>*会员商城下单列表。</p>
|
||||
<p>*订单状态有待付款,待发货,待收货,已完成,已关闭。</p>
|
||||
<p>
|
||||
*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
||||
|
||||
<ul class="layui-tab-title">
|
||||
@ -173,54 +179,66 @@
|
||||
<div class="layui-card-body">
|
||||
<table id="order-lists" lay-filter="order-lists"></table>
|
||||
|
||||
<script type="text/html" id="order-operation" >
|
||||
<script type="text/html" id="order-operation">
|
||||
<div class="table-operate">
|
||||
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="detail">订单详情</a>
|
||||
|
||||
{{# if(d.order_status > 1 && d.shipping_status == 1 && d.delivery_type == 1){ }}
|
||||
{{# if(d.order_status > 1 && d.shipping_status == 1 && d.delivery_type == 1){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="detail">查看内容</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status <= 1){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="cancel">取消订单</a>
|
||||
{{# } }}
|
||||
{{# if(d.order_status <= 1){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn"
|
||||
lay-event="cancel">取消订单</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 1 && d.order_type != 2){ }}
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="change_address">修改地址</a>
|
||||
{{# if(d.order_status == 1 && d.order_type != 2){ }}
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="change_address">修改地址</a>
|
||||
{{# } else { }}
|
||||
{{# if(d.order_status == 1 && d.is_team_success){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# if(d.order_status == 1 && d.is_team_success){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 2){ }}
|
||||
{{# if(d.delivery_type == 0){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
|
||||
{{# } }}
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="confirm">确认收货</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# if(d.order_status == 2){ }}
|
||||
{{# if(d.delivery_type == 0){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
|
||||
{{# } }}
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="confirm">确认收货</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
|
||||
<!--提货核销-->
|
||||
{{# if(d.verification_btn){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="verification">订单核销</a>
|
||||
{{# } }}
|
||||
{{# if(d.verification_btn){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="verification">订单核销</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 3 && d.delivery_type == 0){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
|
||||
{{# } }}
|
||||
{{# if(d.order_status == 3 && d.delivery_type == 0){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 4){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="del">删除订单</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="print">小票打印</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="remarks">备注</a>
|
||||
{{# if(d.order_status == 4){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn"
|
||||
lay-event="del">删除订单</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="print">小票打印</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="remarks">备注</a>
|
||||
|
||||
{{# if(d.order_status > 1 && d.allow_after_sale == 0){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn"
|
||||
lay-event="allow">允许售后</a>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@ -235,11 +253,11 @@
|
||||
<p>订单类型:{{d.order_type_text}}</p>
|
||||
<p>下单时间:{{d.create_time}}</p>
|
||||
<p>支付时间:
|
||||
{{# if(d.pay_time == '0'){ }}
|
||||
未支付
|
||||
{{# } else { }}
|
||||
{{d.pay_time}}
|
||||
{{# } }}
|
||||
{{# if(d.pay_time == '0'){ }}
|
||||
未支付
|
||||
{{# } else { }}
|
||||
{{d.pay_time}}
|
||||
{{# } }}
|
||||
</p>
|
||||
<p>订单来源:{{d.order_source_text}}</p>
|
||||
</div>
|
||||
@ -248,9 +266,10 @@
|
||||
<!--会员信息-->
|
||||
<script type="text/html" id="user">
|
||||
<img src="{{d.user.avatar}}" style="height:80px;width: 80px" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align: left;">
|
||||
<div class="layui-input-inline" style="text-align: left;">
|
||||
<p>会员编号:{{d.user.sn}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">会员昵称:{{d.user.nickname}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">
|
||||
会员昵称:{{d.user.nickname}}</p>
|
||||
<p>会员等级:{{d.user_level}}</p>
|
||||
</div>
|
||||
</script>
|
||||
@ -279,9 +298,10 @@
|
||||
<!--商品信息-->
|
||||
<script type="text/html" id="goods">
|
||||
<div class="goods-content">
|
||||
{{# layui.each(d.order_goods, function(index, item){ }}
|
||||
{{# layui.each(d.order_goods, function(index, item){ }}
|
||||
<div style="text-align: left;" class="goods-data">
|
||||
<img src="{{ item.image }}" style="height:80px;width: 80px" class="image-show layui-col-md4">
|
||||
<img src="{{ item.image }}" style="height:80px;width: 80px"
|
||||
class="image-show layui-col-md4">
|
||||
<div class="layui-input-inline layui-col-md8">
|
||||
<span class="layui-col-md7 goods_name_hide">{{ item.goods_name }}</span>
|
||||
<span class="layui-col-md5">¥{{ item.goods_price }}</span>
|
||||
@ -290,7 +310,7 @@
|
||||
<span class="layui-col-md5">{{ item.goods_num }}件</span>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
{{# }); }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@ -306,10 +326,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
layui.config({
|
||||
version: "{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['form'], function(){
|
||||
}).use(['form'], function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, table = layui.table
|
||||
@ -319,7 +339,7 @@
|
||||
//图片放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
like.showImg(src, 600);
|
||||
});
|
||||
|
||||
//监听搜索
|
||||
@ -372,9 +392,9 @@
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
,done: function (value, date, endDate) {
|
||||
, type: 'datetime'
|
||||
, trigger: 'click'
|
||||
, done: function (value, date, endDate) {
|
||||
var startDate = new Date(value).getTime();
|
||||
var endTime = new Date($('#end_time').val()).getTime();
|
||||
if (endTime < startDate) {
|
||||
@ -386,9 +406,9 @@
|
||||
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
,done: function (value, date, endDate) {
|
||||
, type: 'datetime'
|
||||
, trigger: 'click'
|
||||
, done: function (value, date, endDate) {
|
||||
var startDate = new Date($('#start_time').val()).getTime();
|
||||
var endTime = new Date(value).getTime();
|
||||
if (endTime < startDate) {
|
||||
@ -413,9 +433,9 @@
|
||||
form.render('select');
|
||||
var type = $(this).attr('data-type');
|
||||
getList(type);
|
||||
if (type !== ''){
|
||||
if (type !== '') {
|
||||
$('.order_status').hide();
|
||||
}else {
|
||||
} else {
|
||||
$('.order_status').show();
|
||||
}
|
||||
});
|
||||
@ -425,22 +445,22 @@
|
||||
elem: '#order-lists'
|
||||
, url: '{:url("order.order/lists")}?type=' + type
|
||||
, cols: [[
|
||||
{field:'id',title: 'id',width:60,align: 'center'}
|
||||
, {field: 'order', title: '订单信息', align: 'center',templet:'#order',width:230}
|
||||
, {field: 'user', title: '会员信息', templet:'#user',width:300}
|
||||
, {field: 'order_goods', title: '商品信息', align: 'center',templet:'#goods',width:300}
|
||||
, {field: 'total_num', title: '商品数量', align: 'center',templet:'#goods_num',width:70}
|
||||
, {field: 'total_amount', title: '订单金额', align: 'center',templet:'#amount',width:150}
|
||||
, {field: 'delivery', title: '收货信息', align: 'center',templet:'#delivery',width:200}
|
||||
, {field: 'pay_status_text', title: '支付状态', align: 'center',width:100}
|
||||
, {field: 'order_status_text', title: '订单状态', align: 'center',width:100}
|
||||
{field: 'id', title: 'id', width: 60, align: 'center'}
|
||||
, {field: 'order', title: '订单信息', align: 'center', templet: '#order', width: 230}
|
||||
, {field: 'user', title: '会员信息', templet: '#user', width: 300}
|
||||
, {field: 'order_goods', title: '商品信息', align: 'center', templet: '#goods', width: 300}
|
||||
, {field: 'total_num', title: '商品数量', align: 'center', templet: '#goods_num', width: 70}
|
||||
, {field: 'total_amount', title: '订单金额', align: 'center', templet: '#amount', width: 150}
|
||||
, {field: 'delivery', title: '收货信息', align: 'center', templet: '#delivery', width: 200}
|
||||
, {field: 'pay_status_text', title: '支付状态', align: 'center', width: 100}
|
||||
, {field: 'order_status_text', title: '订单状态', align: 'center', width: 100}
|
||||
, {fixed: 'right', title: '操作', width: 300, align: 'center', toolbar: '#order-operation'}
|
||||
]]
|
||||
, page: true
|
||||
, text: {none: '暂无数据!'}
|
||||
,response: {
|
||||
statusCode: 1
|
||||
}
|
||||
, response: {
|
||||
statusCode: 1
|
||||
}
|
||||
, parseData: function (res) {
|
||||
return {
|
||||
"code": res.code,
|
||||
@ -449,7 +469,7 @@
|
||||
"data": res.data.lists,
|
||||
};
|
||||
}
|
||||
,done: function(res, curr, count){
|
||||
, done: function (res, curr, count) {
|
||||
// 解决操作栏因为内容过多换行问题
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
@ -462,23 +482,23 @@
|
||||
//监听工具条
|
||||
table.on('tool(order-lists)', function (obj) {
|
||||
var id = obj.data.id;
|
||||
if(obj.event === 'detail'){
|
||||
if (obj.event === 'detail') {
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '订单详情'
|
||||
,content: '{:url("order.order/detail")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
, title: '订单详情'
|
||||
, content: '{:url("order.order/detail")}?id=' + id
|
||||
, area: ['90%', '90%']
|
||||
, yes: function (index, layero) {
|
||||
table.reload('order-lists');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//删除订单
|
||||
if(obj.event === 'del'){
|
||||
if (obj.event === 'del') {
|
||||
layer.confirm('删除后订单将消失,确认删除订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
btn: ['确认', '取消'] //按钮
|
||||
}, function () {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/del")}'
|
||||
, data: {'order_id': id}
|
||||
@ -489,7 +509,7 @@
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
}, function () {
|
||||
updateTabNumber();
|
||||
table.reload('order-lists');
|
||||
});
|
||||
@ -500,10 +520,10 @@
|
||||
}
|
||||
|
||||
//取消订单
|
||||
if(obj.event === 'cancel'){
|
||||
if (obj.event === 'cancel') {
|
||||
layer.confirm('确认取消订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
btn: ['确认', '取消'] //按钮
|
||||
}, function () {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/cancel")}'
|
||||
, data: {'order_id': id}
|
||||
@ -514,7 +534,7 @@
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
}, function () {
|
||||
updateTabNumber();
|
||||
table.reload('order-lists');
|
||||
});
|
||||
@ -525,15 +545,14 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
//发货
|
||||
if(obj.event === 'delivery'){
|
||||
if (obj.event === 'delivery') {
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '订单发货'
|
||||
,content: '{:url("order.order/delivery")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
, title: '订单发货'
|
||||
, content: '{:url("order.order/delivery")}?id=' + id
|
||||
, area: ['90%', '90%']
|
||||
, yes: function (index, layero) {
|
||||
updateTabNumber();
|
||||
table.reload('order-lists');
|
||||
}
|
||||
@ -541,37 +560,37 @@
|
||||
}
|
||||
|
||||
//修改地址
|
||||
if(obj.event === 'change_address') {
|
||||
if (obj.event === 'change_address') {
|
||||
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '修改地址'
|
||||
,content: '{:url("order.order/change_address")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
, title: '修改地址'
|
||||
, content: '{:url("order.order/change_address")}?id=' + id
|
||||
, area: ['90%', '90%']
|
||||
, yes: function (index, layero) {
|
||||
table.reload('order-lists');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//物流信息
|
||||
if(obj.event === 'express'){
|
||||
if (obj.event === 'express') {
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '物流信息'
|
||||
,content: '{:url("order.order/express")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
, title: '物流信息'
|
||||
, content: '{:url("order.order/express")}?id=' + id
|
||||
, area: ['90%', '90%']
|
||||
, yes: function (index, layero) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//确认收货
|
||||
if(obj.event === 'confirm'){
|
||||
if (obj.event === 'confirm') {
|
||||
layer.confirm('确认订单商品已收货吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
btn: ['确认', '取消'] //按钮
|
||||
}, function () {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/confirm")}'
|
||||
, data: {'order_id': id}
|
||||
@ -582,7 +601,7 @@
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
}, function () {
|
||||
updateTabNumber();
|
||||
table.reload('order-lists');
|
||||
});
|
||||
@ -593,7 +612,7 @@
|
||||
}
|
||||
|
||||
//商家备注
|
||||
if(obj.event === 'remarks') {
|
||||
if (obj.event === 'remarks') {
|
||||
|
||||
like.ajax({
|
||||
url: '{:url("order.order/remarks")}'
|
||||
@ -601,11 +620,15 @@
|
||||
, type: 'get'
|
||||
, success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layer.prompt({title: '备注信息', formType: 2, value: res.data[0].order_remarks}, function(value, index){
|
||||
layer.prompt({
|
||||
title: '备注信息',
|
||||
formType: 2,
|
||||
value: res.data[0].order_remarks
|
||||
}, function (value, index) {
|
||||
layer.close(index);
|
||||
like.ajax({
|
||||
url: '{:url("order.order/remarks")}'
|
||||
, data: {'id': id, "order_remarks": value }
|
||||
, data: {'id': id, "order_remarks": value}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code === 1) {
|
||||
@ -625,17 +648,42 @@
|
||||
|
||||
}
|
||||
|
||||
//打印
|
||||
if(obj.event ==='print'){
|
||||
layer.confirm('确定要打印订单吗?', function(index){
|
||||
//允许售后
|
||||
if (obj.event === 'allow') {
|
||||
let msg = '是否开启售后?';
|
||||
if (obj.data.allow_after_sale == 1) {
|
||||
msg = '是否关闭售后'
|
||||
}
|
||||
layer.confirm(msg, function (index) {
|
||||
like.ajax({
|
||||
url:'{:url("order.order/orderPrint")}',
|
||||
data:{id:id},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
url: '{:url("order.order/allowAfterSale")}',
|
||||
data: {id: id, type: obj.data.allow_after_sale},
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('order-lists');
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
}
|
||||
|
||||
//打印
|
||||
if (obj.event === 'print') {
|
||||
layer.confirm('确定要打印订单吗?', function (index) {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/orderPrint")}',
|
||||
data: {id: id},
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
@ -647,16 +695,13 @@
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if(obj.event === 'verification'){
|
||||
layer.confirm('确定核销订单' + obj.data.order_sn +'吗?请谨慎操作', {
|
||||
btn: ['确认','取消']
|
||||
}, function(){
|
||||
if (obj.event === 'verification') {
|
||||
layer.confirm('确定核销订单' + obj.data.order_sn + '吗?请谨慎操作', {
|
||||
btn: ['确认', '取消']
|
||||
}, function () {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/verification")}'
|
||||
, data: {'order_id': id}
|
||||
@ -667,7 +712,7 @@
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
}, function () {
|
||||
updateTabNumber();
|
||||
table.reload('order-lists');
|
||||
});
|
||||
@ -680,27 +725,25 @@
|
||||
});
|
||||
|
||||
/**
|
||||
* 更新选项卡 统计数据
|
||||
*/
|
||||
* 更新选项卡 统计数据
|
||||
*/
|
||||
window.updateTabNumber = function updateTabNumber() {
|
||||
like.ajax({
|
||||
url: '{:url("order.order/totalCount")}',
|
||||
data: {},
|
||||
type: "GET",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
$(".layui-tab-title li[id=all]").html("全部(" + res.data.all + ")");
|
||||
$(".layui-tab-title li[data-type=0]").html("待付款(" + res.data.wait_pay + ")");
|
||||
$(".layui-tab-title li[data-type=1]").html("待发货(" + res.data.wait_delivery + ")");
|
||||
$(".layui-tab-title li[data-type=2]").html("待收货(" + res.data.wait_receipt + ")");
|
||||
$(".layui-tab-title li[data-type=3]").html("已完成(" + res.data.wait_complete + ")");
|
||||
$(".layui-tab-title li[data-type=4]").html("已关闭(" + res.data.wait_close + ")");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
like.ajax({
|
||||
url: '{:url("order.order/totalCount")}',
|
||||
data: {},
|
||||
type: "GET",
|
||||
success: function (res) {
|
||||
if (res.code === 1) {
|
||||
$(".layui-tab-title li[id=all]").html("全部(" + res.data.all + ")");
|
||||
$(".layui-tab-title li[data-type=0]").html("待付款(" + res.data.wait_pay + ")");
|
||||
$(".layui-tab-title li[data-type=1]").html("待发货(" + res.data.wait_delivery + ")");
|
||||
$(".layui-tab-title li[data-type=2]").html("待收货(" + res.data.wait_receipt + ")");
|
||||
$(".layui-tab-title li[data-type=3]").html("已完成(" + res.data.wait_complete + ")");
|
||||
$(".layui-tab-title li[data-type=4]").html("已关闭(" + res.data.wait_close + ")");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user