Commit 065302d1 by 朱继来

详情页添加操作按钮

parent d4eb98dd
...@@ -416,11 +416,11 @@ class WebController extends Controller ...@@ -416,11 +416,11 @@ class WebController extends Controller
$order_service->erp_sn = $OrderExtendModel->where('order_id', $order_service->order_id)->value('erp_sn'); $order_service->erp_sn = $OrderExtendModel->where('order_id', $order_service->order_id)->value('erp_sn');
$data['order_service'] = $order_service; $data['order_service'] = $order_service;
$data['order_service_log'] = $OrderServiceLogModel->where('service_id', $service_id)->get(); $data['order_service_log'] = $OrderServiceLogModel->where('service_id', $service_id)->orderBy('id', 'desc')->get();
// 获取收款信息 // 获取收款信息
$PayLogModel = new PayLogModel; $PayLogModel = new PayLogModel;
$data['pay_log'] = $PayLogModel->where('order_id', $order_service->order_id)->get(); $data['pay_log'] = $PayLogModel->where('order_id', $order_service->order_id)->orderBy('pay_log_id', 'desc')->get();
return view('web', $data); return view('web', $data);
} }
......
...@@ -29,32 +29,17 @@ layui.use(['form', 'table', 'element'], function(){ ...@@ -29,32 +29,17 @@ layui.use(['form', 'table', 'element'], function(){
,limit: 10 ,limit: 10
,limits: [10, 20, 50,] ,limits: [10, 20, 50,]
}); });
// tool操作
table.on('tool(list)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性lay-filter="对应的值"
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var tr = obj.tr; //获得当前行 tr 的DOM对象
var title = '';
var content = '';
var url = '/api/ApiOrderServiceAction';
var datax = [];
if(layEvent === 'submit'){ // 提交
title = '提交申请';
content = '确定提交该申请吗?';
datax = {id: data.id, service_status: 2}; $('.act_submit').click(function() {
} else if(layEvent === 'audit'){ // 审核 var id = $(this).data('id');
title = '审核申请'; var service_status = $(this).data('type');
content = '确定审核该申请吗?'; var title = '';
var content = '';
datax = {id: data.id, service_status: 3}; switch (service_status) {
}else if(layEvent === 'cancel'){ // 取消 case -1: title = '取消申请'; content = '确定取消申请吗?'; break;
title = '取消申请'; case 2: title = '提交申请'; content = '确定提交申请吗?'; break;
content = '确定取消该申请吗?'; case 3: title = '审核申请'; content = '确定审核通过申请吗?'; break;
datax = {id: data.id, service_status: -1};
} }
layer.open({ layer.open({
...@@ -63,16 +48,15 @@ layui.use(['form', 'table', 'element'], function(){ ...@@ -63,16 +48,15 @@ layui.use(['form', 'table', 'element'], function(){
btn: ['确认', '取消'], btn: ['确认', '取消'],
yes: function(index) { yes: function(index) {
$.ajax({ $.ajax({
url : url, url : '/api/ApiOrderServiceAction',
type: 'post', type: 'post',
data: datax, data: {id: id, service_status: service_status},
dataType: 'json', dataType: 'json',
success: function(resp) { success: function(resp) {
console.log(resp) console.log(resp)
if (resp.errcode == 0) { if (resp.errcode == 0) {
layer.msg(resp.errmsg); layer.msg(resp.errmsg);
renderTable(); // 重新加载table window.location.reload();
$('.search').trigger("click"); // 触发搜索按钮
return false; return false;
} }
...@@ -92,7 +76,7 @@ layui.use(['form', 'table', 'element'], function(){ ...@@ -92,7 +76,7 @@ layui.use(['form', 'table', 'element'], function(){
layer.close(index); layer.close(index);
} }
}) })
}); })
}); });
\ No newline at end of file
...@@ -88,10 +88,15 @@ ...@@ -88,10 +88,15 @@
</div> </div>
</div> </div>
@if ( $order_service->status == 1) @if ($order_service->service_status == 1)
<div class="layui-btn-container" style="text-align: center; margin: 20px 0;"> <div class="layui-btn-container" style="text-align: center; margin: 20px 0;">
<button lay-submit lay-filter="save" class="layui-btn layui-btn-normal save" data-type="1">保存</button> <a class="layui-btn layui-btn-normal act_submit" data-id="{{ $order_service->id }}" data-type="2">提交</a>
<button lay-submit lay-filter="save" class="layui-btn layui-btn-info submit_audit" data-type="2">提交审核</button> <a class="layui-btn layui-btn-danger act_submit" data-id="{{ $order_service->id }}" data-type="-1">取消</a>
</div>
@elseif ($order_service->service_status == 2)
<div class="layui-btn-container" style="text-align: center; margin: 20px 0;">
<a class="layui-btn layui-btn-normal act_submit" data-id="{{ $order_service->id }}" data-type="3">审核</a>
<a class="layui-btn layui-btn-danger act_submit" data-id="{{ $order_service->id }}" data-type="-1">取消</a>
</div> </div>
@endif @endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment