first commit
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
{layout name="layout2" /}
|
||||
<style>
|
||||
.img-content{
|
||||
height:80px;
|
||||
line-height:80px
|
||||
}
|
||||
.img-container {
|
||||
float: left;
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.img-src {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
padding: 4px;
|
||||
}
|
||||
.img-del-x {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: -4px;
|
||||
right: -2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: hsla(0, 0%, 60%, .6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" name="id" value="{$detail.id}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">快递公司:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="shipping_id" lay-filter="shipping_id">
|
||||
<option value="">快递公司</option>
|
||||
{foreach $express as $item}
|
||||
<option value="{$item.id}" {if $detail['shipping_id'] == $item.id} selected {/if}>{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">快递单号:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" value="{$detail.invoice_no}" name="invoice_no" type="text" placeholder="请输入快递单号" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="change_delivery-submit" id="change_delivery-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var goods_ids = [];
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form','laydate','like'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,laydate = layui.laydate
|
||||
,like = layui.like;
|
||||
laydate.render({
|
||||
elem: '#birthday'
|
||||
,format: 'yyyy-MM-dd'
|
||||
,trigger: 'click'
|
||||
});
|
||||
like.imageUpload('.img-add', function (uris, element) {
|
||||
if(uris.length>1){
|
||||
layer.msg('最多最能选中1张图片');
|
||||
return;
|
||||
}
|
||||
var html = '<div class="img-container">\n' +
|
||||
'<img class="img-src" ' +
|
||||
'src="' + uris[0] + '">' +
|
||||
'<a class="img-del-x">x</a>' +
|
||||
'</div>';
|
||||
element.prev().val(like.getUrlFileName(uris[0], '{$storageUrl}'));
|
||||
element.parent().append(html);
|
||||
element.css('display','none');
|
||||
}, true);
|
||||
//删除图片
|
||||
$(document).on('click', '.img-del-x', function () {
|
||||
$(this).parent().siblings('input').val('');
|
||||
$(this).parent().prev().css('display','block');
|
||||
$(this).parent().remove();
|
||||
});
|
||||
//显示图片
|
||||
$(document).on('click', '.img-src', function () {
|
||||
var image = $(this).attr('src');
|
||||
like.showImg(image, 600);
|
||||
});
|
||||
|
||||
form.on('select(category)', function(data){
|
||||
var level = $(data.elem).find("option:selected").attr("data-level");
|
||||
$('.alliance_ratio').hide();
|
||||
$('.autotrophy_ratio').hide();
|
||||
if(level == 2){
|
||||
$('.alliance_ratio').show();
|
||||
$('.autotrophy_ratio').show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
var callbackdata = function () {
|
||||
return goods_ids;
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,175 @@
|
||||
{layout name="layout2" /}
|
||||
<style>
|
||||
.div-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.layui-form-label {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.width-160 {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.layui-table th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-margin {
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image {
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="layui-card-body" >
|
||||
<!--基本信息-->
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-express" id="layuiadmin-form-express" >
|
||||
<input type="hidden" name="order_id" value="{$detail.id}">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>收货信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">收货人:</label>
|
||||
<div class="width-160">{$detail.consignee}</div>
|
||||
<label class="layui-form-label ">手机号:</label>
|
||||
<div class="width-160">{$detail.mobile}</div>
|
||||
<label class="layui-form-label ">收货地址:</label>
|
||||
<div class="width-160">{$detail.delivery_address}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>商品信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<col width="250">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品信息</th>
|
||||
<th>价格(元)</th>
|
||||
<th>数量</th>
|
||||
<th>小计(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $detail.order_goods as $k => $goods}
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align: left">
|
||||
<div class="layui-col-md3">
|
||||
<img src="{$goods.goods_image}" class="image-show image">
|
||||
</div>
|
||||
<div class="layui-col-md9">
|
||||
<p style="margin-top: 10px">{$goods.goods_name}</p>
|
||||
<br>
|
||||
<p>{$goods.spec_value}</p>
|
||||
{if $goods.refund_status > 0}
|
||||
<br>
|
||||
<p style="color: red;">{$goods.refund_status_desc}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>¥{$goods.goods_price}</td>
|
||||
<td>{$goods.goods_num}</td>
|
||||
<td>{$goods.total_price}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>快递配送</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">配送方式:</label>
|
||||
<div>
|
||||
<input type="radio" name="send_type" lay-filter="express" value="1" title="快递配送" checked>
|
||||
<input type="radio" name="send_type" lay-filter="express" value="2" title="无需快递">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex select-express">
|
||||
<label class="layui-form-label ">选择快递:</label>
|
||||
<div>
|
||||
<select name="shipping_id" lay-verify="required">
|
||||
{foreach $express as $k => $v}
|
||||
<option value="{$v.id}">{$v.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex select-express" >
|
||||
<label class="layui-form-label ">快递单号:</label>
|
||||
<div>
|
||||
<input type="text" name="invoice_no" placeholder="请输入快递单号" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="delivery-submit" id="delivery-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'element', 'jquery', 'like', 'form'], function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form;
|
||||
var like = layui.like;
|
||||
|
||||
//主图放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
|
||||
form.on('radio(express)', function (data) {
|
||||
var checked = data.value;
|
||||
if (checked == 1) {
|
||||
$('.select-express').show();
|
||||
} else {
|
||||
$('.select-express').hide();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,436 @@
|
||||
{layout name="layout2" /}
|
||||
<style>
|
||||
.div-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.width-160 {
|
||||
width: 200px;
|
||||
}
|
||||
.layui-table th {
|
||||
text-align: center;
|
||||
}
|
||||
.table-margin{
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
.image{
|
||||
height:80px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.mt50{
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="layui-card-body" >
|
||||
<!--基本信息-->
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-order" id="layuiadmin-form-order" >
|
||||
<input type="hidden" class="order_id" name="order_id" value="{$detail.id}">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>订单信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">订单编号:</label>
|
||||
<div class="width-160">{$detail.order_sn}</div>
|
||||
<label class="layui-form-label ">订单类型:</label>
|
||||
<div class="width-160">{$detail.order_type_text}({$detail.order_source_text})</div>
|
||||
<label class="layui-form-label ">下单时间:</label>
|
||||
<div class="width-160">{$detail.create_time}</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">支付时间:</label>
|
||||
<div class="width-160">{$detail.pay_time}</div>
|
||||
<label class="layui-form-label ">支付状态:</label>
|
||||
<div class="width-160">{$detail.pay_status_text}</div>
|
||||
<label class="layui-form-label ">订单状态:</label>
|
||||
<div class="width-160">{$detail.order_status_text}</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>会员信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">会员编号:</label>
|
||||
<div class="width-160">{$detail.user.sn}</div>
|
||||
<label class="layui-form-label ">会员昵称:</label>
|
||||
<div class="width-160">{$detail.user.nickname}</div>
|
||||
<label class="layui-form-label ">手机号码:</label>
|
||||
<div class="width-160">{$detail.user.mobile}</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">性别:</label>
|
||||
<div class="width-160">{$detail.user.sex}</div>
|
||||
<label class="layui-form-label ">注册时间:</label>
|
||||
<div class="width-160">{$detail.user.create_time}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>收货信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">收货人:</label>
|
||||
<div class="width-160">{$detail.consignee}</div>
|
||||
<label class="layui-form-label ">手机号:</label>
|
||||
<div class="width-160">{$detail.mobile}</div>
|
||||
{if $detail.delivery_type != 2}
|
||||
<label class="layui-form-label ">收货地址:</label>
|
||||
<div class="width-160">{$detail.delivery_address}</div>
|
||||
{/if}
|
||||
{if $detail.delivery_type == 2}
|
||||
<label class="layui-form-label ">自提门店:</label>
|
||||
<div class="width-160">{$detail.shop_name}</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>商品信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<col width="250">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品信息</th>
|
||||
<th>价格(元)</th>
|
||||
<th>数量</th>
|
||||
<th>小计(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $detail.order_goods as $k => $goods}
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align: left">
|
||||
<div class="layui-col-md3">
|
||||
<img src="{$goods.goods_image}" class="image-show image" >
|
||||
</div>
|
||||
<div class="layui-col-md9">
|
||||
<p style="margin-top: 10px">{$goods.goods_name}</p>
|
||||
<br>
|
||||
<p>{$goods.spec_value}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>¥{$goods.goods_price}</td>
|
||||
<td>{$goods.goods_num}</td>
|
||||
<td>¥{$goods.total_price}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
<td style="text-align: left">
|
||||
<p>商品金额:¥{$detail.goods_price}</p>
|
||||
<p>运费金额:¥{$detail.shipping_price}</p>
|
||||
<p style="color: red">优惠金额:¥{$detail.discount_amount}</p>
|
||||
<p style="color: red">积分抵扣:¥{$detail.integral_amount | default = 0}</p>
|
||||
<p>应付金额:¥{$detail.order_amount}</p>
|
||||
<p>支付方式:{$detail.pay_way_text}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>买家留言</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<textarea class="layui-textarea" disabled>{$detail.user_remark}</textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>订单操作</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item div-flex ">
|
||||
<div class="layui-input-block ">
|
||||
{if $detail.order_status <= 1}
|
||||
<button type="submit" class="layui-btn layui-btn-sm layui-btn-danger width_160 " id="cancel">取消订单</button>
|
||||
{/if}
|
||||
|
||||
{if $detail.order_status == 1 && $detail.delivery_type != 2}
|
||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm operation-btn" id="delivery">发货</button>
|
||||
{/if}
|
||||
{if $detail.order_status == 1 && $detail.delivery_type == 2 && $detail.verification_status == 0}
|
||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm operation-btn" id="verification">提货核销</button>
|
||||
{/if}
|
||||
|
||||
{if $detail.order_status == 2 && $detail.delivery_type != 2}
|
||||
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal width_160 " id="confirm">确认收货</button>
|
||||
{/if}
|
||||
|
||||
{if ($detail.order_status == 4) && ($detail.del == 0) }
|
||||
<button type="submit" class="layui-btn layui-btn-sm layui-btn-danger width_160 " id="del">删除订单</button>
|
||||
{/if}
|
||||
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>订单日志</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
<col width="250">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>动作类型</th>
|
||||
<th>日志内容</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{empty name= "$logs"}
|
||||
<tr>
|
||||
<td colspan="3">暂无记录</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{foreach $logs as $k => $log}
|
||||
<tr>
|
||||
<td>{$log.create_time}</td>
|
||||
<td>{$log.channel}</td>
|
||||
<td>{$log.content}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/empty}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'element', 'jquery', 'like'], function () {
|
||||
var $ = layui.$;
|
||||
var like = layui.like;
|
||||
|
||||
//主图放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
|
||||
$('#back').click(function () {
|
||||
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
|
||||
parent.layer.close(index);
|
||||
parent.layui.table.reload('order-lists');
|
||||
return true;
|
||||
});
|
||||
|
||||
//取消订单
|
||||
$('#cancel').click(function () {
|
||||
var order_id = $('.order_id').val();
|
||||
layer.confirm('确认取消订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/cancel")}'
|
||||
, data: {'order_id': order_id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//删除订单
|
||||
$('#del').click(function () {
|
||||
var order_id = $('.order_id').val();
|
||||
layer.confirm('删除后订单将消失,确认删除订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/del")}'
|
||||
, data: {'order_id': order_id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//退款
|
||||
$('#refund').click(function () {
|
||||
var order_id = $('.order_id').val();
|
||||
layer.msg('暂不可退');
|
||||
});
|
||||
|
||||
//发货
|
||||
$('#delivery').click(function () {
|
||||
var id = $('.order_id').val();
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: '订单发货'
|
||||
, content: '{:url("order/delivery")}?id='+id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window['layui-layer-iframe' + index]
|
||||
, submitID = 'delivery-submit'
|
||||
, submit = layero.find('iframe').contents().find('#' + submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
like.ajax({
|
||||
url: '{:url("order/deliveryHandle")}',
|
||||
data: field,
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
}, function() {
|
||||
layer.close(index); //关闭弹层
|
||||
location.reload();//刷新
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//确认收货
|
||||
$('#confirm').click(function () {
|
||||
var id = $('.order_id').val();
|
||||
layer.confirm('确认订单商品已收货吗??', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/confirm")}'
|
||||
, data: {'order_id': id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//提货核销
|
||||
$('#verification').click(function () {
|
||||
var id = $('.order_id').val();
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: '提货核销'
|
||||
, content: '{:url("verification/verification")}?id='+id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window['layui-layer-iframe' + index]
|
||||
, submitID = 'verification-submit'
|
||||
, submit = layero.find('iframe').contents().find('#' + submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
like.ajax({
|
||||
url: '{:url("verification/verification")}',
|
||||
data: field,
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
}, function() {
|
||||
layer.close(index); //关闭弹层
|
||||
location.reload();//刷新
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,229 @@
|
||||
{layout name="layout2" /}
|
||||
<style>
|
||||
.div-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.width-160 {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.layui-table th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-margin {
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image {
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.mt50 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="layui-card-body" >
|
||||
<!--基本信息-->
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-express" id="layuiadmin-form-express" >
|
||||
<input type="hidden" name="order_id" value="{$detail.id}">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>快递信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
{empty name="$detail.shipping"}
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="width-160">暂无物流信息</div>
|
||||
</div>
|
||||
{else/}
|
||||
<div class="layui-form-item div-flex">
|
||||
<label class="layui-form-label ">发货时间:</label>
|
||||
<div class="width-160">{$detail.shipping.create_time_text | default= "未知"}</div>
|
||||
{if condition = "$detail.shipping.send_type eq 1"}
|
||||
<label class="layui-form-label ">快递方式:</label>
|
||||
<div class="width-160">{$detail.shipping.shipping_name | default="未知"}</div>
|
||||
<label class="layui-form-label ">快递单号:</label>
|
||||
<div class="width-160">{$detail.shipping.invoice_no | default= "未知"}</div>
|
||||
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-normal " lay-submit
|
||||
lay-filter="change_delivery">修改物流信息
|
||||
</button>
|
||||
{else/}
|
||||
<label class="layui-form-label ">配送方式:</label>
|
||||
<div class="width-160">无需快递</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/empty}
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>商品信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<col width="250">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品信息</th>
|
||||
<th>价格(元)</th>
|
||||
<th>数量</th>
|
||||
<th>小计(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $detail.order_goods as $k => $goods}
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align: left">
|
||||
<div class="layui-col-md3">
|
||||
<img src="{$goods.goods_image}" class="image-show image">
|
||||
</div>
|
||||
<div class="layui-col-md9">
|
||||
<p style="margin-top: 10px">{$goods.goods_name}</p>
|
||||
<br>
|
||||
<p>{$goods.spec_value}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>¥{$goods.goods_price}</td>
|
||||
<td>{$goods.goods_num}</td>
|
||||
<td>{$goods.total_price}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>物流轨迹</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item table-margin">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr >
|
||||
<th colspan="3">轨迹</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $detail.shipping.traces as $k => $item}
|
||||
<tr>
|
||||
{if is_array($item)}
|
||||
{foreach $item as $k1 => $value}
|
||||
<td>{$value}</td>
|
||||
{/foreach}
|
||||
{else /}
|
||||
<td>{$item}</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item div-flex ">
|
||||
<div class="layui-input-block ">
|
||||
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary width_160 " id="back">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'element', 'jquery', 'like', 'form'], function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form;
|
||||
var like = layui.like;
|
||||
|
||||
//主图放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
// 修改快递单号
|
||||
form.on('submit(change_delivery)', function(data){
|
||||
var id = {$detail:id};
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '物流信息'
|
||||
,content: '{:url("order/change_delivery")}?id='+id
|
||||
,area: ['60%', '60%']
|
||||
,btn: ['保存', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'change_delivery-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID)
|
||||
,goods_ids = iframeWindow.callbackdata();
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field;
|
||||
field.goods_ids = goods_ids;
|
||||
like.ajax({
|
||||
url:'{:url("order/change_delivery")}',
|
||||
data:field,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#back').click(function () {
|
||||
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
|
||||
parent.layer.close(index);
|
||||
parent.layui.table.reload('order-lists');
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,703 @@
|
||||
{layout name="layout1" /}
|
||||
<style>
|
||||
.layui-table-cell {
|
||||
height:auto;
|
||||
}
|
||||
.goods-content>div:not(:last-of-type) {
|
||||
border-bottom:1px solid #DCDCDC;
|
||||
}
|
||||
.goods-data::after{
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
.goods_name_hide{
|
||||
overflow:hidden;
|
||||
white-space:nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.operation-btn {
|
||||
margin: 5px;
|
||||
}
|
||||
.table-operate{
|
||||
text-align: left;
|
||||
font-size:14px;
|
||||
padding:0 5px;
|
||||
height:auto;
|
||||
overflow:visible;
|
||||
text-overflow:inherit;
|
||||
white-space:normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-fluid">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
||||
|
||||
<ul class="layui-tab-title">
|
||||
<li data-type='' class="layui-this">全部</li>
|
||||
{foreach $order_status as $item => $val}
|
||||
<li data-type="{$item}">{$val}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-card">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-row">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单搜索:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="search_key">
|
||||
<option value="order_sn">订单编号</option>
|
||||
<option value="nickname">会员昵称</option>
|
||||
<option value="user_mobile">会员手机号码</option>
|
||||
<option value="user_sn">会员编号</option>
|
||||
<option value="consignee">收货人姓名</option>
|
||||
<option value="consignee_mobile">收货人手机号码</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">商品名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="goods_name" id="goods_name" placeholder="请输入商品名称"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="order_type" id="order_type">
|
||||
<option value="">全部</option>
|
||||
{foreach $order_type as $item => $val}
|
||||
<option value="{$item}">{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单来源:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="order_source" id="order_source">
|
||||
<option value="">全部</option>
|
||||
{foreach $order_source as $item => $val}
|
||||
<option value="{$item}">{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">付款方式:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="pay_way" id="pay_way">
|
||||
<option value="">全部</option>
|
||||
{foreach $pay_way as $item => $val}
|
||||
<option value="{$item}">{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">配送方式:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="delivery_type" id="delivery_type">
|
||||
<option value="">全部</option>
|
||||
{foreach $delivery_type as $item => $val}
|
||||
<option value="{$item}">{$val}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">下单时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="start_time" class="layui-input" id="start_time"
|
||||
placeholder="" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
|
||||
<label class="layui-form-mid">至</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="end_time" class="layui-input" id="end_time"
|
||||
placeholder="" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
|
||||
lay-filter="order-search">查询
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
|
||||
lay-filter="order-clear-search">清空查询
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
|
||||
lay-filter="export-file">导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<table id="order-lists" lay-filter="order-lists"></table>
|
||||
|
||||
<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){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm operation-btn" lay-event="cancel">取消订单</a>
|
||||
{{# } }}
|
||||
|
||||
|
||||
{{# if(d.order_status == 1 && d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="delivery">发货</a>
|
||||
{{# } }}
|
||||
{{# if(d.order_status == 1 && d.delivery_type == 2 && d.verification_status == 0){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="verification">提货核销</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 2 && d.delivery_type != 2){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm operation-btn" lay-event="express">物流查询</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="confirm">确认收货</a>
|
||||
{{# } }}
|
||||
{{# if(d.verification_status == 1 && d.delivery_type == 2){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm operation-btn" lay-event="verification_query">核销查询</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.order_status == 3 && d.delivery_type != 2){ }}
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="image">
|
||||
<img src="{{d.image}}" style="height:80px;width: 80px" class="image-show">
|
||||
</script>
|
||||
|
||||
<!--门店信息-->
|
||||
<script type="text/html" id="shop">
|
||||
<p>{{d.shop.name}}</p>
|
||||
</script>
|
||||
|
||||
<!--订单信息-->
|
||||
<script type="text/html" id="order">
|
||||
<div style="text-align: left">
|
||||
<p>订单编号:{{d.order_sn}}</p>
|
||||
<p>订单类型:{{d.order_type_text}}</p>
|
||||
<p>下单时间:{{d.create_time}}</p>
|
||||
<p>支付时间:{{d.pay_time}}</p>
|
||||
<p>订单来源:{{d.order_source_text}}</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--会员信息-->
|
||||
<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;">
|
||||
<p>会员编号:{{d.user.sn}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">会员昵称:{{d.user.nickname}}</p>
|
||||
<p>会员等级:{{d.user_level}}</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--收货信息-->
|
||||
<script type="text/html" id="delivery">
|
||||
<div style="text-align: left">
|
||||
{{# if(d.delivery_type != 2){ }}
|
||||
<p>收货人:{{d.consignee}}</p>
|
||||
<p>手机号码:{{d.mobile}}</p>
|
||||
<p>收货地址:{{d.delivery_address}}</p>
|
||||
<p>配送方式:{{d.delivery_type_desc}}</p>
|
||||
{{# } }}
|
||||
{{# if(d.delivery_type == 2){ }}
|
||||
<p>配送方式:{{d.delivery_type_desc}}</p>
|
||||
<p>自提门店:{{d.shop_name}}</p>
|
||||
<p>收货人:{{d.consignee}}</p>
|
||||
<p>手机号码:{{d.mobile}}</p>
|
||||
<p>提货码:{{d.pickup_code}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--金额信息-->
|
||||
<script type="text/html" id="amount">
|
||||
<div style="text-align: left">
|
||||
<p>运费金额:{{d.shipping_price}}</p>
|
||||
<p>商品金额:{{d.goods_price}}</p>
|
||||
<p>优惠金额:{{d.discount_amount}}</p>
|
||||
<p>应付金额:{{d.order_amount}}</p>
|
||||
<p>支付方式:{{d.pay_way_text}}</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--商品信息-->
|
||||
<script type="text/html" id="goods">
|
||||
<div class="goods-content">
|
||||
{{# 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">
|
||||
<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>
|
||||
<br>
|
||||
<span class="layui-col-md7 goods_name_hide">{{ item.spec_value }}</span>
|
||||
<span class="layui-col-md5">{{ item.goods_num }}件</span>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--商品数量-->
|
||||
<script type="text/html" id="goods_num">
|
||||
{{ d.total_num }}件
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'table', 'like', 'laydate'], function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, table = layui.table
|
||||
, like = layui.like
|
||||
, element = layui.element
|
||||
, laydate = layui.laydate;
|
||||
var listType = '';
|
||||
|
||||
//图片放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(order-search)', function (data) {
|
||||
var field = data.field;
|
||||
//执行重载
|
||||
table.reload('order-lists', {
|
||||
where: field,
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
//清空查询
|
||||
form.on('submit(order-clear-search)', function () {
|
||||
$('#keyword').val('');
|
||||
$('#order_status').val('');
|
||||
$('#goods_name').val('');
|
||||
$('#pay_way').val('');
|
||||
$('#order_type').val('');
|
||||
$('#order_source').val('');
|
||||
$('#start_time').val('');
|
||||
$('#end_time').val('');
|
||||
$('#delivery_type').val('');
|
||||
form.render('select');
|
||||
//刷新列表
|
||||
table.reload('order-lists', {
|
||||
where: [],
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 导出
|
||||
form.on('submit(export-file)', function(data){
|
||||
var field = data.field;
|
||||
$.ajax({
|
||||
url: '{:url("order/exportFile")}?type=' + listType,
|
||||
type: 'get',
|
||||
data: field,
|
||||
dataType: 'json',
|
||||
error: function() {
|
||||
layer.msg('导出超时,请稍后再试!');
|
||||
},
|
||||
success: function(res) {
|
||||
table.exportFile(res.data.exportTitle,res.data.exportData, res.data.exportExt, res.data.exportName);
|
||||
},
|
||||
timeout: 15000
|
||||
});
|
||||
layer.msg('导出中请耐心等待~');
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'datetime'
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
//获取列表
|
||||
getList(listType);
|
||||
//切换列表
|
||||
element.on('tab(tab-all)', function (data) {
|
||||
$('#keyword').val('');
|
||||
$('#order_status').val('');
|
||||
$('#goods_name').val('');
|
||||
$('#pay_way').val('');
|
||||
$('#order_type').val('');
|
||||
$('#start_time').val('');
|
||||
$('#end_time').val('');
|
||||
$('#delivery_type').val('');
|
||||
form.render('select');
|
||||
listType = $(this).attr('data-type');
|
||||
getList(listType);
|
||||
if (listType !== ''){
|
||||
$('.order_status').hide();
|
||||
}else {
|
||||
$('.order_status').show();
|
||||
}
|
||||
});
|
||||
|
||||
function getList(type) {
|
||||
table.render({
|
||||
elem: '#order-lists'
|
||||
, url: '{:url("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}
|
||||
, {fixed: 'right', title: '操作', width: 300, align: 'center', toolbar: '#order-operation'}
|
||||
]]
|
||||
, page: true
|
||||
, text: {none: '暂无数据!'}
|
||||
, parseData: function (res) {
|
||||
return {
|
||||
"code": res.code,
|
||||
"msg": res.msg,
|
||||
"count": res.data.count,
|
||||
"data": res.data.lists,
|
||||
};
|
||||
}
|
||||
,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());
|
||||
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(order-lists)', function (obj) {
|
||||
var id = obj.data.id;
|
||||
if(obj.event === 'detail'){
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '订单详情'
|
||||
,content: '{:url("order/detail")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
table.reload('order-lists');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//删除订单
|
||||
if(obj.event === 'del'){
|
||||
layer.confirm('删除后订单将消失,确认删除订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/del")}'
|
||||
, data: {'order_id': id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
table.reload('order-lists');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//取消订单
|
||||
if(obj.event === 'cancel'){
|
||||
layer.confirm('确认取消订单吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/cancel")}'
|
||||
, data: {'order_id': id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
table.reload('order-lists');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//发货
|
||||
if(obj.event === 'delivery'){
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: '订单发货'
|
||||
, content: '{:url("order/delivery")}?id='+id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window['layui-layer-iframe' + index]
|
||||
, submitID = 'delivery-submit'
|
||||
, submit = layero.find('iframe').contents().find('#' + submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
like.ajax({
|
||||
url: '{:url("order/deliveryHandle")}',
|
||||
data: field,
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
}, function() {
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('order-lists');//刷新
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//物流信息
|
||||
if(obj.event === 'express'){
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '订单发货'
|
||||
,content: '{:url("order/express")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//确认收货
|
||||
if(obj.event === 'confirm'){
|
||||
layer.confirm('确认订单商品已收货吗?', {
|
||||
btn: ['确认','取消'] //按钮
|
||||
}, function(){
|
||||
like.ajax({
|
||||
url: '{:url("order/confirm")}'
|
||||
, data: {'order_id': id}
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
},function () {
|
||||
table.reload('order-lists');
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//商家备注
|
||||
if(obj.event === 'remarks') {
|
||||
|
||||
like.ajax({
|
||||
url: '{:url("order/remarks")}'
|
||||
, data: {'id': id}
|
||||
, type: 'get'
|
||||
, success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layer.prompt({title: '备注信息', formType: 2, value: res.data.order_remarks}, function(value, index){
|
||||
layer.close(index);
|
||||
like.ajax({
|
||||
url: '{:url("order/remarks")}'
|
||||
, data: {'id': id, "order_remarks": value }
|
||||
, type: 'post'
|
||||
, success: function (res) {
|
||||
if (res.code === 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//小票打印
|
||||
if(obj.event ==='print'){
|
||||
layer.confirm('确定要打印订单吗?', function(index){
|
||||
like.ajax({
|
||||
url:'{:url("order/orderPrint")}',
|
||||
data:{id:id},
|
||||
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('printer-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
//提货核销
|
||||
if(obj.event === 'verification'){
|
||||
layer.open({
|
||||
type: 2
|
||||
, title: '提货核销'
|
||||
, content: '{:url("verification/verification")}?id='+id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window['layui-layer-iframe' + index]
|
||||
, submitID = 'verification-submit'
|
||||
, submit = layero.find('iframe').contents().find('#' + submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
like.ajax({
|
||||
url: '{:url("verification/verification")}',
|
||||
data: field,
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
}, function() {
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('order-lists');//刷新
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//核销查询
|
||||
if(obj.event === 'verification_query'){
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '核销查询'
|
||||
,content: '{:url("verification/verificationQuery")}?id='+id
|
||||
,area: ['90%', '90%']
|
||||
,yes: function(index, layero){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user