Commit fbbfd02c by 朱继来

Merge branch 'zjl_order_20200923'

parents 939e5655 9064e465
...@@ -12,10 +12,12 @@ use App\Model\Pcb\PcbPurchaseModel; ...@@ -12,10 +12,12 @@ use App\Model\Pcb\PcbPurchaseModel;
use App\Model\Pcb\PcbServerModel; use App\Model\Pcb\PcbServerModel;
use App\Model\KefuModel; use App\Model\KefuModel;
use App\Model\CmsModel; use App\Model\CmsModel;
use App\Model\OrderExtendModel;
use App\Model\OrderItemsModel;
use App\Model\OrderItemsTrackModel; use App\Model\OrderItemsTrackModel;
use App\Model\UserSampleApplyModel; use App\Model\UserSampleApplyModel;
use App\Model\OrderActionLogModel;
use App\Model\UserSampleInviteModel; use App\Model\UserSampleInviteModel;
use App\Model\OrderItemsModel;
use App\Model\UserGroupModel; use App\Model\UserGroupModel;
use App\Model\BrandBlackListModel; use App\Model\BrandBlackListModel;
use App\Model\PayExtendModel; use App\Model\PayExtendModel;
...@@ -369,4 +371,26 @@ class ApiController extends Controller ...@@ -369,4 +371,26 @@ class ApiController extends Controller
$this->Export(0, '成功', $res); $this->Export(0, '成功', $res);
} }
// 编辑ERP单号
public function edit_erp_sn($request)
{
$order_id = $request->input('order_id');
$erp_sn = $request->input('erp_sn');
$OrderExtendModel = new OrderExtendModel;
$OrderActionLogModel = new OrderActionLogModel;
$old_erp_sn = $OrderExtendModel->where('order_id', $order_id)->value('erp_sn');
$res = $OrderExtendModel->where('order_id', $order_id)->update(['erp_sn' => $erp_sn]);
if ($res === false) {
$this->Export(-1, '编辑ERP单号失败');
}
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '编辑ERP单号,修改前:'.$old_erp_sn);
$this->Export(0, '编辑ERP单号成功');
}
} }
...@@ -545,6 +545,48 @@ ...@@ -545,6 +545,48 @@
}) })
} }
// 竞调账号编辑ERP单号
$('.edit_erp_sn').click(function() {
var order_id = $(this).data('oid');
var erp_sn = $(this).data('erp_sn');
var content = '<div class="form-group"><input type="text" class="form-control new_erp_sn" name="new_erp_sn" value="'+ erp_sn +'" style="width: 260px;"></div>';
layer.open({
area: ['300px'],
title: '编辑ERP单号',
content: content,
btn:['确认', '取消'],
btn1: function(index) {
var new_erp_sn = $('.new_erp_sn').val();
if (!new_erp_sn) {
layer.tips('请输入ERP单号', $('.new_erp_sn'));
return false;
}
$.ajax({
url: '/api/edit_erp_sn',
type: 'post',
data: {order_id:order_id, erp_sn: new_erp_sn},
dataType: 'json',
success: function(resp) {
if (resp.errcode != 0) {
layer.msg(resp.msg);
return false;
}
location.reload();
}
})
layer.msg('提交中...', {icon:16, time: 0, shade: 0.3});
},
btn2: function(index) {
layer.close(index)
}
})
})
}, },
} }
......
...@@ -400,6 +400,10 @@ ...@@ -400,6 +400,10 @@
@if ($v['status'] == -1 && !$v['cancel_reason']) @if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a> <a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a>
@endif @endif
@if ($username == 'vpadmin@ichunt.com')
<a class="btn btn-info edit_erp_sn" data-oid="{{$v['order_id']}}" data-erp_sn="{{ $order_extend ? $order_extend->erp_sn : '' }}">编辑ERP单号</a>
@endif
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -401,6 +401,10 @@ ...@@ -401,6 +401,10 @@
@if ($v['status'] == -1 && !$v['cancel_reason']) @if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a> <a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a>
@endif @endif
@if ($username == 'vpadmin@ichunt.com')
<a class="btn btn-info edit_erp_sn" data-oid="{{$v['order_id']}}" data-erp_sn="{{ $order_extend ? $order_extend->erp_sn : '' }}">编辑ERP单号</a>
@endif
</div> </div>
</td> </td>
</tr> </tr>
......
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