Commit 05b2beab by 孙龙

Merge branch 'master' of http://119.23.72.7/zhujilai/Order

parents 4454e9ae ba6a0201
......@@ -699,7 +699,7 @@ Class OrderController extends Controller
}
} else {
$perm = new PermController;
$info['buyers'] = $perm->getUserByCondition('', 39); // 获取采购员, ID - 39
$info['buyers'] = $perm->getUserByDepartmentId(8, 0); // 获取采购部人员
$perm = new PermController;
$sale_list = $perm->getUserByDepartmentId(Config('perm_args.sales_department_id'), 0); // 获取所有的销售
......@@ -894,9 +894,13 @@ Class OrderController extends Controller
$url = Config('website.api_domain').'order/tempSaveOrder';
} else {
$auditor_role = $request->input('auditor_role', 1); // 当前操作人角色
$auditor_role = $request->input('auditor_role', 1); // 当前操作人角色
$order_goods_type = $request->input('order_goods_type', 1);
$resData['status'] = $auditor_role == 3 ? 1 : 2; // 角色为‘查看自己’时,状态为待审核,否则为待付款
if ($order_goods_type == 1) {
// $resData['status'] = $auditor_role == 3 ? 1 : 2; // 角色为‘查看自己’时,状态为待审核,否则为待付款
$resData['is_manager'] = $auditor_role == 3 ? 0 : 1; // 角色为‘查看自己’时,is_manager = 0
}
$url = Config('website.api_domain').'order/changeOrder';
}
......@@ -907,6 +911,23 @@ Class OrderController extends Controller
}
}
// 申请主管审核
public function ajaxApplyManagerAudit(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', '');
$data['operator_id'] = $request->user->userId;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/applyManagerAudit';
$temp = json_decode(curlApi($url, $data, "POST"), true);
return array('errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']);
}
}
// 主管审核
public function ajaxAuditPass(Request $request)
{
......@@ -1014,10 +1035,10 @@ Class OrderController extends Controller
$info['online_sales_chief'] = $perm->getUserByCondition(33, 66, 0); // 线上销售-33 线上销售总监-66
$info['online_sales_mgr'] = $perm->getDepartmentUser(33, 63); // 线上销售-33 销售经理-63
$info['online_sales_kefu_1'] = $perm->getUserByCondition(34, '', 0); // 线上一组
$info['online_sales_kefu_2'] = $perm->getUserByCondition(35, '', 0); // 线上二组
$info['online_sales_kefu_3'] = $perm->getUserByCondition(36, '', 0); // 线上三组
$info['online_sales_kefu_4'] = $perm->getUserByCondition(37, '', 0); // 线上四组
$info['online_sales_kefu_1'] = $perm->getUserByCondition(34, 62, 0); // 线上一组销售
$info['online_sales_kefu_2'] = $perm->getUserByCondition(35, 62, 0); // 线上二组销售
$info['online_sales_kefu_3'] = $perm->getUserByCondition(36, 62, 0); // 线上三组销售
$info['online_sales_kefu_4'] = $perm->getUserByCondition(37, 62, 0); // 线上四组销售
$info['offline_sales_chief'] = $perm->getUserByCondition(40, 90, 0); // 线下销售-39 线下销售总监-90
$info['offline_sales_all'] = $perm->getDepartmentUser(40, 62); // 线下销售各组人员
......@@ -2066,68 +2087,53 @@ Class OrderController extends Controller
{
$id = $request->input('id');
$cc_email = $request->input('cc_email', ''); // 额外抄送人
$info = $this->orderDetail($request, $id);
$info = $this->orderDetail($request, $id);
$send_buyers = []; // 发送采购邮件数据
$CmsModel = new CmsModel();
$sale_name = $CmsModel->getUserName($info['order_info']['sale_id']); //获取业务员
$to_user_array = [];
//循环订单详情
foreach ($info['order_items_info'] as $key => $value) {
foreach ($info['order_items_info'] as $key => $value) {
if ($value['status'] == -1) continue;
if(empty($value['batch'])) return ['errcode'=>-1,'errmsg'=>'商品:'.$value['goods_name'].'缺少批次<br/>'.'请填写批次后再发送'];
if(empty($value['buyerName'])) return ['errcode'=>-1,'errmsg'=>'商品:'.$value['goods_name'].'缺少采购人员<br/>'.'请填写采购后再发送'];
$tmp = [];
$tmp['orderNum'] = $info['order_temp_info']['erp_sn'];
$tmp['goods'] = $value['goods_name'];
$tmp['purchasingPrice'] = $value['goods_price'];//采购价
$tmp['unitPrice'] = $value['goods_price'];//单价
$tmp['unitPrice'] = $value['single_pre_price'];//均摊单价
$tmp['brand'] = $value['brand_name'];
$tmp['nums'] = $value['goods_number'];
$tmp['currency'] = $info['order_info']['currency'] == 1?'人民币':'美元';
$tmp['totalPrice'] = $value['goods_amount'];
$tmp['totalPrice'] = number_format($value['goods_number'] * $value['single_pre_price'], 2, '.', '');
$tmp['remarks'] = $value['remarks'];
$tmp['material'] = $value['erp_rec_id'];
$tmp['purchasing'] = !empty($value['buyerName'])?$value['buyerName']:'';
$tmp['projectId'] = $key+1;
if(empty($value['batch'])){
$msg = '商品:'.$tmp['goods'].'缺少批次<br/>'.'请填写批次后再发送';
echo json_encode(['errcode'=>-1,'errmsg'=>$msg]);
exit;
}
$tmp['material'] = $value['material_number'];
$tmp['purchasing'] = !empty($value['buyerName'])?$value['buyerName']:'';
$tmp['deliveryTime'] = $value['batch']; //批次
$tmp['send_email'] = !empty($value['send_email'])?$value['send_email']:'';
if(empty($value['buyerName'])){
$msg = '商品:'.$tmp['goods'].'缺少采购人员<br/>'.'请填写采购后再发送';
echo json_encode(['errcode'=>-1,'errmsg'=>$msg]);
exit;
}
//批次
$tmp['deliveryTime'] = $value['batch'];
$tmp['send_email'] = !empty($value['send_email'])?$value['send_email']:'';
$data['data'][] = $tmp;
}
//循环出邮件接收人
foreach ($data['data'] as $key => $value) {
$send_mail_array[] = $value['send_email'];
}
$send_buyers[$value['buyer_id']]['data'][] = $tmp;
$send_buyers[$value['buyer_id']]['toUser'] = $value['send_email'];
$send_buyers[$value['buyer_id']]['date'] = date('Y-m-d',time());
$send_buyers[$value['buyer_id']]['date'] = intval($id);
$send_buyers[$value['buyer_id']]['id'] = $sale_name;
$send_mail_array = array_unique($send_mail_array);
$to_user_array[] = $value['send_email'];
if(empty($send_mail_array[0])){
echo json_encode(['errcode'=>-1,'errmsg'=>'没有填写采购人员,请至少填写一个采购人员']);
exit;
// $tmp['projectId'] = $key+1;
// $data['data'][] = $tmp;
}
$data['toUser'] = $send_mail_array; // 收件人
$cc_send_mail_array = Config('config.cc_email'); // 固定抄送人
$perm = new PermController;
$manager_email = $perm->getManager($request); // 获取上级主管邮箱
if ($manager_email) {
$cc_send_mail_array = array_merge($cc_send_mail_array, $manager_email); // 合并上级主管邮箱
}
$cc_send_mail_array[] = $request->user->email; // 默认抄送给自己
$cc_send_mail_array = array_unique($cc_send_mail_array); // 去重
$kefu_manager_email = $perm->getManager($request->user->userId, 63); // 获取当前客服的上级主管邮箱,63-销售经理
$kefu_manager_email && $cc_send_mail_array = array_merge($cc_send_mail_array, $kefu_manager_email); // 合并上级主管邮箱
$cc_email_arr = [];
......@@ -2139,49 +2145,69 @@ Class OrderController extends Controller
$email && $cc_email_arr[] = $email;
}
}
$cc_send_mail_array = array_unique(array_merge($cc_send_mail_array, $cc_email_arr));
$data['ccUser'] = array_unique(array_merge($cc_send_mail_array, $cc_email_arr));
$data['combined'] = $info['order_info']['order_amount'];
$data['order_amount'] = $info['order_info']['order_amount'];
$data['date'] = date('Y-m-d',time());
$data['kefu_remark'] = $info['order_temp_info']['kefu_remark']; // 客服备注
// 各个采购邮件推入队列
foreach ($send_buyers as $k => &$v) {
$v['combined'] = 0;
$CmsModel = new CmsModel();
$data['id'] = $CmsModel->getUserName($info['order_info']['sale_id']); //获取业务员
$data['order_id'] = intval($id);
$data['operator_id'] = intval($request->user->userId);
$data['operator_event'] = '发送邮件成功,收件人邮箱:'.json_encode($send_mail_array).',抄送人邮箱:'.json_encode($data['ccUser']);
foreach ($v['data'] as $item) {
$v['combined'] += $item['totalPrice'];
}
// 推入到邮件队列
$QueuedModel = new QueuedModel();
// 若不属于自营采购部,则添加联营采购管理人员
if (!$perm->checkUserDepartment($k, 51)) {
$joint_purchase_manager = Config('config.joint_purchase_manager');
$cc_send_mail_array = array_merge($cc_send_mail_array, $joint_purchase_manager);
}
$queued_name = 'send_buyer_mail';
array_push($cc_send_mail_array, $request->user->email); // 默认抄送给当前客服
$cc_send_mail_array = array_unique($cc_send_mail_array);
$v['ccUser'] = $cc_send_mail_array;
$QueuedModel->pushAmq('ichunt_order_msg', $queued_name, $queued_name, json_encode($data));
$this->pushQueue($v);
}
return ['errcode'=>0, 'errmsg'=>'推送到邮件队列成功,请稍等...'];
// $crm_url = Config('website.crm_domain').'/api/sendCaiGouEmailByOrderAdmin';
// $data = json_encode($data);
// $data['toUser'] = $request->user->email; // 收件人
// $data['ccUser'] = $cc_send_mail_array;
// $data['combined'] = $info['order_info']['order_amount'];
// $data['order_amount'] = $info['order_info']['order_amount'];
// $data['date'] = date('Y-m-d',time());
// $data['id'] = $sale_name;
// $data['order_id'] = intval($id);
// $data['operator_id'] = intval($request->user->userId);
// $data['operator_event'] = '发送邮件成功,收件人邮箱:'.json_encode($data['toUser']).',抄送人邮箱:'.json_encode($data['ccUser']);
// $this->pushQueue($data);
$event = '发送邮件成功,收件人邮箱:'.json_encode($to_user_array).',抄送人邮箱:'.json_encode($cc_send_mail_array);
// $crm_header = array('api-key: crm a1b2c3d4e5f6g7h8i9jk');
// 添加操作日志
$OrderActionLogModel = new OrderActionLogModel;
$OrderActionLogModel->addLog($id, $request->user->userId, 2, $event);
// $res = json_decode(post_curl($crm_url, $data,$crm_header));
// 同步到ERP
$url = Config('website.api_domain').'order/sysiteminfo';
// if(!empty($res->err_code) && $res->err_code == 0){
// // 操作日志
// $OrderActionLogModel = new OrderActionLogModel();
$resData['order_id'] = $id;
$resData['k1'] = time();
$resData['k2'] = md5(md5($resData['k1']).'fh6y5t4rr351d2c3bryi');
// $event = '发送邮件成功,收件人邮箱:'.json_encode($send_mail_array).',抄送人邮箱:'.json_encode($data['ccUser']);
// $actionLog = $OrderActionLogModel->addLog($id, $request->user->userId, 2, $event);
$temp = json_decode(curlApi($url, $resData, "POST"), true); // 连接API
// echo json_encode(['errcode'=>1,'errmsg'=>'发送成功']);
// exit;
// }else{
// echo json_encode(['errcode'=>-1,'errmsg'=>'邮件发送接口错误,邮件发送失败']);
// exit;
// }
if ($temp['err_code'] != 0) return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
return ['errcode'=>0, 'errmsg'=>'推送到邮件队列成功,请稍等...'];
}
public function pushQueue($data)
{
// 推入到邮件队列
$QueuedModel = new QueuedModel();
$queued_name = 'send_buyer_mail';
$QueuedModel->pushAmq('ichunt_order_msg', $queued_name, $queued_name, json_encode($data));
}
}
\ No newline at end of file
......@@ -344,29 +344,57 @@
// }
// 获取角色对应的主管邮箱
public function getManager($request)
{
$role = $this->getUserRole($request); // 当前用户角色
// public function getManager($request)
// {
// $role = $this->getUserRole($request); // 当前用户角色
$manager_key = array_search($role, Config('perm_args.manager_to_kefu')); // 获取对应的主管key
// $manager_key = array_search($role, Config('perm_args.manager_to_kefu')); // 获取对应的主管key
if (!$manager_key) return false;
// if (!$manager_key) return false;
$role_name = array_search($manager_key, Config('perm_args.roles')); // 获取主管对应的角色名称
// $role_name = array_search($manager_key, Config('perm_args.roles')); // 获取主管对应的角色名称
if (!$role_name) return false;
// if (!$role_name) return false;
$res = $this->getRoleUsers($request, $role_name); // 获取角色对应的用户
// $res = $this->getRoleUsers($request, $role_name); // 获取角色对应的用户
$email = [];
// $email = [];
if ($res) {
foreach ($res as $v) {
$email[] = $v->email;
}
// if ($res) {
// foreach ($res as $v) {
// $email[] = $v->email;
// }
// }
// return $email;
// }
/**
* 获取角色对应的主管邮箱
* @param [type] $userId [description]
* @param [type] $position_id [主管ID]
* @return [type] [description]
*/
public function getManager($userId, $position_id)
{
// 获取当前所在部门
$department_id = DB::table('user_info')->where('userId', $userId)->value('department_id');
if (!$department_id) return false;
$map = [];
$map['department_id'] = $department_id;
$map['position_id'] = $position_id;
$email = DB::table('user_info')->where($map)->select('email')->get();
if (empty($email)) return false;
foreach ($email as $v) {
$data[] = $v->email;
}
return $email;
return $data;
}
/* 订单系统权限调整 --- 20200511 */
......@@ -434,7 +462,7 @@
return DB::table('user_info')->where($map)->select('userId', 'name', 'position_id', 'position_name', 'department_id', 'department_name', 'status')->get();
}
// 获取下级所有人员
// 获取指定用户下级所有人员
public function getSubSaleId($userId)
{
$sale_ids = [];
......@@ -490,5 +518,15 @@
return $user;
}
// 检查用户是否属于某部门
public function checkUserDepartment($userId, $department_id)
{
$map = [];
$map['userId'] = $userId;
$map['department_id'] = $department_id;
return DB::table('user_info')->where($map)->select('userId')->first();
}
}
\ No newline at end of file
......@@ -126,7 +126,7 @@ class ReturnController extends Controller
$map['sale_id'] = $request->input('sale_id', '');
// 非管理员、查看下级,只能看到自己的退货单
if (!in_array($info['role'], [1, 2])) {
if ($info['role'] == 3) {
$map['create_uid'] = $request->user->userId;
}
......
......@@ -43,6 +43,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/sendSales/{id?}', 'OrderController@sendSales');
Route::post('/ajaxdeletegoods', 'OrderController@ajaxdeletegoods');
Route::post('/ajaxSaveChange', 'OrderController@ajaxSaveChange');
Route::post('/ajaxApplyManagerAudit', 'OrderController@ajaxApplyManagerAudit');
Route::post('/ajaxAuditPass', 'OrderController@ajaxAuditPass');
Route::post('/ajaxReAudit', 'OrderController@ajaxReAudit');
Route::get('/check/{id}', 'OrderController@check');
......
......@@ -335,6 +335,7 @@ class OrderModel extends Model
'1' => '自采',
'2' => '立创',
'3' => '京北',
'4' => '油柑网',
);
$tmp = array();
......@@ -461,7 +462,7 @@ class OrderModel extends Model
$tmp[$i]['sale_type'] = $order[$i]['sale_type'] == 1 ? '现卖' : '预售';
// 自营其他业务类型
$tmp[$i]['business_type'] = $order[$i]['business_type'] ? Config('params.business_type')[$order[$i]['business_type']] : '正常订单';
$tmp[$i]['self_supplier_type'] = $self_supplier_type[$order[$i]['self_supplier_type']]; // 自采标记
$tmp[$i]['self_supplier_type'] = isset($self_supplier_type[$order[$i]['self_supplier_type']]) ? $self_supplier_type[$order[$i]['self_supplier_type']] : '未知'; // 自采标记
$tmp[$i]['sample_demand_desc'] = $order[$i]['sample_demand_desc']; // 样片项目需求描述
//收货地址的电话
$tmp[$i]['receiving_address'] = isset($current_order_addr['mobile']) ? $current_order_addr['mobile'] : '';
......
......@@ -23,4 +23,9 @@ return [
// 'zoe@ichunt.com',
],
// 联营采购负责人
'joint_purchase_manager' => [
'zty@ichunt.com',
],
];
......@@ -4,6 +4,48 @@
$.extend($.lie, {
audit: {
index:function() {
// 申请主管审核
$('.apply-manager-audit').click(function() {
var order_id = $(this).data('id');
// 弹出提示
layer.open({
area: ['360px'],
title: '提示信息',
content: '确定申请主管审核吗?',
btn:['确定', '取消'],
yes: function(index, layero){
$.ajax({
url : '/ajaxApplyManagerAudit',
type: 'post',
data: {order_id: order_id},
dataType: 'json',
success: function (resp) {
if(resp.errcode === 0){
layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){
location.reload();
}, 1000);
return false;
}
layer.alert(resp.errmsg);
return false;
},
error: function (res) {
console.log(res);
}
})
layer.msg('申请中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2: function(index, layero){
layer.close(index);
}
});
})
// 主管审核
$('.manager-audit').click(function() {
var order_id = $(this).data('id');
......
......@@ -52,6 +52,8 @@
layer.alert('网络异常');
}
});
layer.msg('推送中...', {icon: 16, time: 0, shade: 0.3});
},
btn2:function(index){
layer.close(index);
......
......@@ -387,7 +387,7 @@
$('.return_num').keyup(function() {
var removal_number = parseInt($(this).parents('tr').find('.removal_number').val()); // 出库数量
var single_pre_price = parseFloat($(this).parents('tr').find('.single_pre_price').val()); // 均摊单价
var pay_amount = $('.pay_amount').val();
var pay_amount = parseFloat($('.pay_amount').val());
var val = $(this).val(); // 退货数量
if (val > removal_number) {
......
......@@ -15,7 +15,7 @@
<div class="tabs-box">
<div class="order-change-main">
@if (($order_info['order_goods_type'] == 1 && $order_info['status'] == 1) || ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2))
@if (($order_info['order_goods_type'] == 1 && in_array($order_info['status'], [1, 2]) && $order_temp_info['is_manager_audit'] != 3) || ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2))
<form id="checkOrderForm" class="form-horizontal table-responsive">
<input type="hidden" name="auditor_role" value="{{ $role }}" >
<input type="hidden" name="order_sn" value="{{$order_info['order_sn']}}">
......@@ -396,7 +396,7 @@
</form>
@endif
@if (($order_info['order_goods_type'] == 1 && $order_info['status'] == 2) || ($order_info['order_goods_type'] != 1 && $order_info['adjust_count'] == 2))
@if (($order_info['order_goods_type'] == 1 && $order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 3) || ($order_info['order_goods_type'] == 2 && $order_info['status'] == 2 && $order_info['adjust_count'] == 2))
<div class="checked_section">
<div class="checked_left">
<p>交易状态:&nbsp;审核通过,请联系客户及时付款!
......@@ -416,7 +416,7 @@
@if ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2)
<a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
@elseif ($order_info['order_goods_type'] == 1)
<a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a>
<!-- <a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a> -->
@endif
</div>
......@@ -486,7 +486,7 @@
@include('changeOrder.addGoodsNoSkuid')
<script>
var is_manager = "{{ in_array($role, [1, 2]) ? true : false }}";
var is_manager = "{{ in_array($role, [1, 2, 5]) ? true : false }}";
var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}";
// var order_amount = "{{$order_info['order_amount']}}";
......
......@@ -157,15 +157,20 @@
@endif
@if (in_array('check_order', $userPerms) && $order_info['sale_id'])
@if ($order_info['status'] == 1)
@if (isset($order_temp_info['is_manager_audit']) && $order_temp_info['is_manager_audit'] != 3 && in_array($order_info['status'], [1, 2]))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" target="_blank">人工审单</a>
@elseif ($order_info['status'] == 2 && in_array($role, [1, 2]))
@elseif ($order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 3 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$order_info['order_id']}}">反审</a>
@endif
@endif
<!-- 申请主管审核 -->
@if (isset($order_temp_info['is_manager_audit']) && $order_temp_info['is_manager_audit'] == 1 && $order_info['status'] == 2)
<a class="btn btn-info apply-manager-audit" data-id="{{$order_info['order_id']}}">申请主管审核</a>
@endif
<!-- 主管审核 -->
@if ($order_temp_info['is_manager_audit'] && in_array($role, [1, 2]) && $order_info['status'] == 1)
@if (isset($order_temp_info['is_manager_audit']) && (($order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 2) || ($order_info['status'] > 2 && $order_temp_info['is_manager_audit'] != 3)) && in_array($role, [1, 2]) && empty($order_temp_info['erp_sn']))
<a class="btn btn-danger manager-audit" data-id="{{$order_info['order_id']}}">主管审核</a>
@endif
......
<style>
.action_log_event{ word-break: break-all; }
</style>
<p>操作记录</p>
<div class="tabs-box table-responsive">
<table class="table table-bordered table-hover">
......@@ -14,13 +18,13 @@
<tr>
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type) ?></td>
<td><?= $v->event ?></td>
<td class="action_log_event"><?= $v->event ?></td>
</tr>
<?php } else { ?>
<tr class="other-infos">
<td width="15%"><?= date('Y-m-d H:i:s', $v->create_time) ?></td>
<td width="10%"><?= App\Http\Controllers\getOperatorName($v->operator_id, $v->operator_type) ?></td>
<td><?= $v->event ?></td>
<td class="action_log_event"><?= $v->event ?></td>
</tr>
<?php } ?>
......
......@@ -30,12 +30,12 @@
<th>发货状态</th>
<th>物流单号</th>
<th>京东订单编号</th>
<th width="8%">自动确认收货时间</th>
<th>自动确认收货时间</th>
</tr>
<tr>
<td>{{ $order_info['order_sn'] }}</td>
<td>{{ $order_temp_info['is_manager_audit'] ? '待主管审核' : Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ Config('params.order_status')[$order_info['status']] }}</td>
<td>{{ $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'] }}</td>
<td>
<?php
......
......@@ -143,7 +143,7 @@
<td>
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
<?php if (in_array($order_info['status'], [1, 2, 3]) && $v['status'] == 1) { ?>
<?php if (in_array($order_info['status'], [1, 2, 3, 4]) && $v['status'] == 1) { ?>
<button type="button" class="btn btn-success btn-xs edit-item" data-id="<?= $v['rec_id'] ?>" data-batch="<?= $v['batch'] ?>" data-bid="<?= $v['buyer_id'] ?>" data-remarks="<?= $v['remarks'] ?>">编辑</button>
<?php } ?>
</td>
......
......@@ -26,7 +26,7 @@
<th colspan="8" style="text-align: center; background: #f9f9f9;"> 发票信息
<?php
//<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
if (!isset($tags)) {
if (empty($tags)) {
if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms)) {
echo '<a href="/changeInvoice/'.$order_info['order_id'].'" class="btn btn-success btn-sm changeBtn">更改发票</a>';
}
......
......@@ -12,7 +12,7 @@
<script src="/js/md5.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/details.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_audit.js?v=<?= time() ?>"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.js"></script>
......
......@@ -250,12 +250,13 @@
<th class="pl30">ERP单号</th>
<th class="pl30">应付金额</th>
<th class="pl30">订单状态</th>
<th class="pl30">主管审核</th>
<th class="pl30">付款类型</th>
<th class="pl30">支付方式</th>
<th class="pl30">业务员</th>
@if ($username != 'vpadmin@ichunt.com')
<th class="pl30">订单来源</th>
<th class="pl30">同步状态</th>
<!-- <th class="pl30">同步状态</th> -->
<th class="pl30">收货人</th>
@endif
<th class="pl30">下单时间</th>
......@@ -288,24 +289,36 @@
?>
</td>
<td class="show-list">
<?php
if ($order_extend->is_manager_audit) {
echo '<span class="list-text-checking"><b>待主管审核</b></span>';
} else {
switch ($v['status']) {
case -2: echo '<span class="list-text-no-check"><b>审核未通过</b></span>';break;
case -1: echo '<span class="list-text-cancel"><b>已取消</b></span>';break;
case 1: echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 2: echo '<span class="list-text-pay"><b>待付款</b></span>';break;
case 3: echo '<span class="list-text-last-pay"><b>待付尾款</b></span>';break;
case 4: echo '<span class="list-text-send"><b>待发货</b></span>';break;
case 7: echo '<span class="list-text-send"><b>部分发货</b></span>';break;
case 8: echo '<span class="list-text-confirm"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>交易成功</b></span>';break;
}
}
<?php
switch ($v['status']) {
case -2: echo '<span class="list-text-no-check"><b>审核未通过</b></span>';break;
case -1: echo '<span class="list-text-cancel"><b>已取消</b></span>';break;
case 1: echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 2: echo '<span class="list-text-pay"><b>待付款</b></span>';break;
case 3: echo '<span class="list-text-last-pay"><b>待付尾款</b></span>';break;
case 4: echo '<span class="list-text-send"><b>待发货</b></span>';break;
case 7: echo '<span class="list-text-send"><b>部分发货</b></span>';break;
case 8: echo '<span class="list-text-confirm"><b>待收货</b></span>';break;
case 10: echo '<span class="list-text-success"><b>交易成功</b></span>';break;
}
?>
</td>
<td class="show-list">
<?php
if ($v['status'] >= 1 && isset($order_extend->is_manager_audit)) {
switch ($order_extend->is_manager_audit) {
case 1:
echo '<span class="list-text-checking"><b>未申请</b></span>';break;
case 2:
echo '<span class="list-text-checking"><b>待审核</b></span>';break;
case 3:
echo '<span class="list-text-success"><b>已审核</b></span>';break;
default:
echo ''; break;
}
}
?>
</td>
<td class="show-list"> {{ Config('params.order_pay_type')[$v['order_pay_type']] }} </td>
<td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
......@@ -314,40 +327,45 @@
@if ($username != 'vpadmin@ichunt.com')
<td class="show-list"><?php echo App\Http\Controllers\getOrderSource($v['order_id'], $v['order_type']); ?></td>
<td class="show-list">
<!-- <td class="show-list">
<?php
if (in_array($v['status'], [-1, 1])) {
echo '不需同步';
} else {
echo $v['erp_order_id'] != '' && $v['erp_order_id'] != '-' ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
}
// if (in_array($v['status'], [-1, 1])) {
// echo '不需同步';
// } else {
// echo $v['erp_order_id'] != '' && $v['erp_order_id'] != '-' ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
// }
?>
</td>
</td> -->
<td class="show-list"><?php echo App\Http\Controllers\getOrderAddress($v['order_id']); ?></td>
@endif
<td class="show-list">{{$username != 'vpadmin@ichunt.com' ? date('Y-m-d H:i:s', $v['create_time']) : date('Y-m-d', $v['create_time'])}}</td>
<td>
<div class="btn-group btn-group-xs" style="width: 260px;">
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
<div class="btn-group btn-group-xs" style="min-width: 200px;">
@if (in_array('check_order', $userPerms) && $v['sale_id'])
@if ($v['status'] == 1)
@if (isset($order_extend->is_manager_audit) && $order_extend->is_manager_audit != 3 && in_array($v['status'], [1, 2]))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$v['order_id']])}}" target="_blank">人工审单</a>
@elseif ($v['status'] == 2 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$v['order_id']}}">反审</a>
@elseif ($v['status'] == 2 && $order_extend->is_manager_audit == 3 && in_array($role, [1, 2]))
<a class="btn btn-success re-audit" data-id="{{$v['order_id']}}">反审</a>
@endif
@endif
<!-- 主管审核 -->
@if ($order_extend->is_manager_audit && in_array($role, [1, 2]) && $v['status'] == 1)
<!-- 申请主管审核 -->
@if (isset($order_extend->is_manager_audit) && $order_extend->is_manager_audit == 1 && $v['status'] == 2)
<a class="btn btn-info apply-manager-audit" data-id="{{$v['order_id']}}">申请主管审核</a>
@endif
<!-- 主管审核 (待付款且待主管审核 || 已付款且主管未审核) && 主管角色 && 未同步 -->
@if (isset($order_extend->is_manager_audit) && (($v['status'] == 2 && $order_extend->is_manager_audit == 2) || ($v['status'] > 2 && $order_extend->is_manager_audit != 3)) && in_array($role, [1, 2]) && empty($order_extend->erp_sn))
<a class="btn btn-danger manager-audit" data-id="{{$v['order_id']}}">主管审核</a>
@endif
@if (!empty($order_extend->erp_sn))
<a class="btn btn-primary send_mail" data-id="{{ $v['order_id'] }}">发送邮件</a>
<a class="btn btn-warning send_mail" data-id="{{ $v['order_id'] }}">发送邮件</a>
@endif
<a class="btn btn-primary" href="{{URL('details', ['order_id'=>$v['order_id']])}}" target="_blank">详情</a>
<!-- 管理员和经理或有推送权限显示 -->
@if ((in_array($role, [1, 2]) || in_array('send_salesman', $userPerms)))
......
......@@ -11,9 +11,9 @@
<script src="/js/common.js"></script>
<script src="/js/layui/layui.js"></script>
<script src="/js/list.js?v=<?= time() ?>"></script>
<script src="/js/order_audit.js"></script>
<script src="/js/order_audit.js?v=<?= time() ?>"></script>
<script src="/js/order_track.js"></script>
<script src="/js/order_cancel.js"></script>
<script src="/js/order_send_email.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
......@@ -143,8 +143,8 @@
</div>
</div>
<!-- 管理员、经理、自营客服主管及助理审核 && 待审核状态 -->
@if (in_array($role, [1, 2, 10, 11]) && $return['status'] == 1)
<!-- 管理员、经理、自营查看 && 待审核状态 -->
@if (in_array($role, [1, 2, 5]) && $return['status'] == 1)
<div class="text-center" style="margin-bottom: 10px;">
<button class="btn btn-info return-check" style="margin-right: 10px;" data-type="2" data-id="{{ $return['return_id'] }}">审核通过</button>
<button class="btn btn-danger return-check" data-type="-2" data-id="{{ $return['return_id'] }}">驳回</button>
......
......@@ -390,7 +390,7 @@
@endif
@if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}">填写取消原因</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-type="4">填写取消原因</a>
@endif
</div>
</td>
......
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