Commit ad0240d3 by 朱继来

调整售后编辑、详情页

parent f0bb5e86
......@@ -29,6 +29,7 @@ use App\Model\OrderServiceItemsModel;
use App\Model\OrderServiceLogModel;
use App\Model\OrderExtendModel;
use App\Model\PayLogModel;
use App\Model\OrderInvoiceModel;
class WebController extends Controller
{
......@@ -423,6 +424,10 @@ class WebController extends Controller
$PayLogModel = new PayLogModel;
$data['pay_log'] = $PayLogModel->where('order_id', $order_service->order_id)->orderBy('pay_log_id', 'desc')->get();
// 订单发票信息
$OrderInvoiceModel = new OrderInvoiceModel;
$data['order_invoice'] = $OrderInvoiceModel->where('order_id', $order_service->order_id)->first();
return view('web', $data);
}
......
......@@ -35,8 +35,9 @@ class OrderServiceItemsModel extends Model
continue;
}
$v['amount'] = number_format($v['adjust_number'] * $v['adjust_price'], 2);
$v['refund_amount'] = number_format($v['goods_number'] * $v['single_pre_price'], 2);
$v['amount'] = number_format($v['adjust_number'] * $v['adjust_price'], 2);
$v['refund_amount'] = number_format($v['goods_number'] * $v['single_pre_price'], 2);
$v['apply_reason_val'] = array_get(Config('order_service.apply_reason'), $v['apply_reason'], '');
}
return $data;
......
......@@ -192,10 +192,20 @@ class OrderServiceModel extends Model
$event = '编辑售后单';
$info = $this->find($id);
$event .= ',修改前---申请理由:'.array_get(Config('order_service.apply_reason'), $info['apply_reason'], '').',备注:'.$info['remark'];
$order_service['apply_reason'] = $request->input('apply_reason');
$order_service['remark'] = $request->input('remark');
$event .= ',修改前---售后类型:'.array_get(Config('order_service.service_type'), $info['service_type'], '').',退款方式:'.array_get(Config('order_service.refund_type'), $info['refund_type'], '');
$order_service['service_type'] = $request->input('service_type');
$order_service['refund_type'] = $request->input('refund_type');
if ($order_service['refund_type'] == 2) { // 支付宝
$order_service['customer_name'] = $request->input('ali_customer_name');
$order_service['refund_account'] = $request->input('ali_refund_account');
} else if ($order_service['refund_type'] == 3) { // 银行
$order_service['customer_name'] = $request->input('bank_customer_name');
$order_service['refund_account'] = $request->input('bank_refund_account');
$order_service['bank_name'] = $request->input('bank_name');
$order_service['bank_sub_name'] = $request->input('bank_sub_name');
}
$res = $this->where('id', $id)->update($order_service);
......@@ -208,7 +218,7 @@ class OrderServiceModel extends Model
$event .= ',售后明细:';
foreach ($service_items as $k=>$v) {
$item = $OrderServiceItemsModel->find($k);
$event .= '['.$item['goods_name'].' | '.$item['adjust_number'].' | '.$item['adjust_price'].'] ';
$event .= '['.$item['goods_name'].' | '.$item['adjust_number'].' | '.$item['adjust_price'].' | '.'申请原因:'.array_get(Config('order_service.apply_reason'), $item['apply_reason'], '').' | '.'备注:'.$item['remark'].'] ';
$v['update_time'] = time();
......
......@@ -141,5 +141,20 @@
3 => '尾款',
4 => '账期',
],
'order_inv_type' => [ // 订单发票类型
1 => '不开发票',
2 => '普通发票',
3 => '增值税专用发票',
4 => '增值税普通发票',
],
'order_invoice_status' => [ // 订单发票状态
-1 => '待确认',
1 => '已开票',
2 => '已发货',
3 => '已签收',
],
];
\ No newline at end of file
......@@ -16,8 +16,8 @@
content: $('.order_service_info'),
btn:['确定', '取消'],
yes: function(index, layero){
var service_type = $('.service_type').val();
var refund_type = $('.refund_type').val();
var service_type = $('.service_type').val();
var refund_type = $('.refund_type').val();
if (!service_type) {
layer.tips('请选择售后类型', $('.service_type'));
......@@ -291,7 +291,7 @@
$(this).val(val.slice(0, 12));
}
var single_pre_price = $(this).parents('tr').find('.single_pre_price').val();
var single_pre_price = $(this).parents('tr').find('.single_pre_price').text();
if (parseFloat(val) > parseFloat(single_pre_price)) {
layer.tips('不能超过均摊单价', $(this));
......
......@@ -25,6 +25,8 @@ layui.use(['form', 'table', 'element'], function(){
,{field: 'refund_amount', title: '可退款金额', width: 120}
,{field: 'removal_number', title: '已出库数量', width: 120}
,{field: 'put_warehouse_number', title: '退货入库数量', width: 120}
,{field: 'apply_reason_val', title: '申请原因', width: 120}
,{field: 'remark', title: '原因备注', width: 200}
]]
,limit: 10
,limits: [10, 20, 50,]
......
<style>
.order_service_info{ display: none; }
.orderServiceForm{ padding: 20px; }
.apply_reason{ width: 300px; }
.service_type, .refund_type{ width: 300px; }
.orderServiceForm textarea{ width: 300px; padding: 6px 5px; border: 1px solid #ccc; border-radius: 4px; resize: none; }
.orderServiceForm input{ width: 120px; height: 34px; }
.order-service-table input{ width: 100px; height: 34px; }
.order-service-table .apply_reason{ width: 120px; }
.alipay-info, .bank-info{ display: none; }
.alipay-info .label-prompt, .bank-info .label-prompt{ width: 120px !important; padding-top: 7px; }
.col-sm-2{ width: 14%; }
</style>
<div class="order_service_info">
<form class="form-horizontal orderServiceForm">
<div class="form-group">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 申请原因</label>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 售后类型</label>
<div class="col-sm-9">
<select class="form-control apply_reason" name="apply_reason">
<option value=""></option>
@if (Config('order_service.apply_reason'))
@foreach (Config('order_service.apply_reason') as $k=>$v)
<select class="form-control service_type" name="service_type">
<option value="">请选择</option>
@if (Config('order_service.service_type'))
@foreach (Config('order_service.service_type') as $k=>$v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 原因备注</label>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 退款方式</label>
<div class="col-sm-9">
<textarea class="form-control remark" name="remark" placeholder="请填写备注" cols="60" rows="3"></textarea>
<select class="form-control refund_type" name="refund_type">
<option value="">请选择</option>
@if (Config('order_service.refund_type'))
@foreach (Config('order_service.refund_type') as $k=>$v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="form-group alipay-info">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 客户/公司:</label>
<div class="col-sm-4">
<input class="form-control ali_customer_name" name="ali_customer_name" placeholder="请填写客户/公司">
</div>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 支付账号:</label>
<div class="col-sm-4">
<input class="form-control ali_refund_account" name="ali_refund_account" placeholder="请填写支付账号">
</div>
</div>
<div class="bank-info">
<div class="form-group">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 客户/公司:</label>
<div class="col-sm-4">
<input class="form-control bank_customer_name" name="bank_customer_name" placeholder="请填写客户/公司">
</div>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 银行账号:</label>
<div class="col-sm-4">
<input class="form-control bank_refund_account" name="bank_refund_account" placeholder="请填写银行账号">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 银行名称:</label>
<div class="col-sm-4">
<input class="form-control bank_name" name="bank_name" placeholder="请填写银行名称">
</div>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 银行支行:</label>
<div class="col-sm-4">
<input class="form-control bank_sub_name" name="bank_sub_name" placeholder="请填写银行支行">
</div>
</div>
</div>
<div class="form-group">
<a class="btn btn-info select-all">全退</a>
</div>
......@@ -33,15 +81,26 @@
<table class="table table-bordered order-service-table">
<thead>
<tr>
<th width="5%"></th>
<th width="20%">型号</th>
<th width="20%">品牌</th>
<th width="4%"></th>
<th width="18%">型号</th>
<th width="18%">品牌</th>
<th width="8%">订单数量</th>
<th width="8%">出库数量</th>
<th width="8%">单价</th>
<th width="8%">均摊单价</th>
<th width="10%">已售后数量</th>
<th width="8%">申请数量</th>
<th width="8%">售后单价</th>
<th width="8%">
<select class="form-control batch_apply_reason" name="batch_apply_reason">
<option value="">请选择</option>
@if (Config('order_service.apply_reason'))
@foreach (Config('order_service.apply_reason') as $key=>$val)
<option value="{{ $key }}">{{ $val }}</option>
@endforeach
@endif
</select>
</th>
<th width="8%"><input type="text" class="form-control batch_remark" name="batch_remark" placeholder="原因备注"></th>
</tr>
</thead>
<tbody>
......
......@@ -37,10 +37,10 @@
<tr>
<td class="td-title">是否需要退货</td>
<td class="td-txt">{{ $order_service->is_return == 1 ? '是' : '否' }}</td>
<td class="td-title">申请原因</td>
<td class="td-txt">{{ array_get(Config('order_service.apply_reason'), $order_service->apply_reason, '') }}</td>
<td class="td-title">备注</td>
<td class="td-txt">{{ $order_service->remark }}</td>
<td class="td-title">售后类型</td>
<td class="td-txt">{{ array_get(Config('order_service.service_type'), $order_service->service_type, '') }}</td>
<td class="td-title">退款方式</td>
<td class="td-txt">{{ array_get(Config('order_service.refund_type'), $order_service->refund_type, '') }}</td>
</tr>
<tr>
<td class="td-title">关联销售单</td>
......@@ -82,6 +82,58 @@
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">订单发票信息</h2>
<div class="layui-colla-content layui-show">
<table class="layui-table">
<tr>
<td width="20%">发票类型</td>
<td width="20%">发票抬头</td>
<td width="20%">公司地址</td>
<td width="20%">税务登记号</td>
<td width="20%">开票状态</td>
</tr>
@if ( $order_invoice->inv_type == 1)
<tr>
<td colspan="5">不开发票</td>
</tr>
@else
<tr>
<td>{{ array_get(Config('params.order_inv_type'), $order_invoice->inv_type, '') }}</td>
<td>{{ $order_invoice->tax_title }}</td>
<td>{{ $order_invoice->company_address }}</td>
<td>{{ $order_invoice->tax_no }}</td>
<td>{{ array_get(Config('params.order_invoice_status'), $order_invoice->invoice_status, '') }}</td>
</tr>
@endif
</table>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">退款信息</h2>
<div class="layui-colla-content layui-show">
<table class="layui-table">
<tr>
<td width="20%">退款类型</td>
<td width="20%">客户/公司</td>
<td width="20%">账号</td>
<td width="20%">银行名称</td>
<td width="20%">支行名称</td>
</tr>
<tr>
<td>{{ array_get(Config('order_service.refund_type'), $order_service->refund_type, '') }}</td>
<td>{{ $order_service->customer_name }}</td>
<td>{{ $order_service->refund_account }}</td>
<td>{{ $order_service->bank_name }}</td>
<td>{{ $order_service->bank_sub_name }}</td>
</tr>
</table>
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">售后明细</h2>
<div class="layui-colla-content layui-show">
<table id="order-service-items" lay-filter="order-service-items"></table>
......
......@@ -134,4 +134,10 @@
@{{# } }}
</script>
<script>
var apply_reason = eval('('+'{!! json_encode(Config("order_service.apply_reason")) !!}'+')');
console.log(apply_reason)
console.log(apply_reason.length)
</script>
@include('common.order_service')
\ No newline at end of file
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