Commit a29a6514 by 朱继来

Merge branch 'zjl_commit_20200526'

parents ba6a0201 55a02cd2
......@@ -2120,7 +2120,6 @@ Class OrderController extends Controller
$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;
$to_user_array[] = $value['send_email'];
......@@ -2132,6 +2131,11 @@ Class OrderController extends Controller
$cc_send_mail_array = Config('config.cc_email'); // 固定抄送人
$perm = new PermController;
$perm->getSubDepartmentId(33, $department_ids); // 获取线上销售部所有小组(包含自己)
$is_online = $perm->checkUserDepartment($request->user->userId, $department_ids); // 检查当前客服是否属于线上销售部
$is_online && $cc_send_mail_array = array_merge($cc_send_mail_array, Config('config.joint_online_manager')); // 合并联营线上主管邮箱
$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); // 合并上级主管邮箱
......@@ -2148,6 +2152,28 @@ Class OrderController extends Controller
$cc_send_mail_array = array_unique(array_merge($cc_send_mail_array, $cc_email_arr));
// $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);
// 同步到ERP
$url = Config('website.api_domain').'order/sysiteminfo';
$resData['order_id'] = $id;
$resData['k1'] = time();
$resData['k2'] = md5(md5($resData['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $resData, "POST"), true); // 连接API
if ($temp['err_code'] != 0) return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
// 各个采购邮件推入队列
foreach ($send_buyers as $k => &$v) {
$v['combined'] = 0;
......@@ -2170,35 +2196,12 @@ Class OrderController extends Controller
$this->pushQueue($v);
}
// $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);
// 添加操作日志
$OrderActionLogModel = new OrderActionLogModel;
$OrderActionLogModel->addLog($id, $request->user->userId, 2, $event);
// 同步到ERP
$url = Config('website.api_domain').'order/sysiteminfo';
$resData['order_id'] = $id;
$resData['k1'] = time();
$resData['k2'] = md5(md5($resData['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $resData, "POST"), true); // 连接API
if ($temp['err_code'] != 0) return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
return ['errcode'=>0, 'errmsg'=>'推送到邮件队列成功,请稍等...'];
}
......
......@@ -523,7 +523,13 @@
{
$map = [];
$map['userId'] = $userId;
$map['department_id'] = $department_id;
if (is_array($department_id)) {
$str = implode(',', $department_id);
$map[] = [DB::raw("department_id in ({$str})"), '1'];
} else {
$map['department_id'] = $department_id;
}
return DB::table('user_info')->where($map)->select('userId')->first();
}
......
......@@ -23,6 +23,13 @@ return [
// 'zoe@ichunt.com',
],
// 联营线上销售
'joint_online_manager' => [
'ysx@ichunt.com',
// 'zhengjf@ichunt.com',
// 'zoe@ichunt.com',
],
// 联营采购负责人
'joint_purchase_manager' => [
'zty@ichunt.com',
......
......@@ -140,6 +140,8 @@
layer.alert('网络异常');
}
});
layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2:function(index){
layer.close(index);
......
......@@ -175,7 +175,7 @@
@endif
<!-- 判断邮件发送时机 -->
@if (!empty($order_temp_info['erp_sn']) )
@if (!empty($order_temp_info['erp_sn']) && in_array($order_info['status'], [2, 3, 4]))
<a class="btn btn-primary send_mail" data-id="{{ $order_info['order_id'] }}">发送邮件</a>
@endif
<!-- 预付款 管理员完成首款对账后改变'对账'按钮 -->
......
......@@ -25,9 +25,9 @@
<tr class="caption">
<th colspan="8" style="text-align: center; background: #f9f9f9;"> 发票信息
<?php
//<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
//<!-- 发票状态小于2(已发货)且更改权限存在 且未同步ERP 显示按钮 -->
if (empty($tags)) {
if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms)) {
if(in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('update_invoice', $userPerms) && empty($order_temp_info['erp_sn'])) {
echo '<a href="/changeInvoice/'.$order_info['order_id'].'" class="btn btn-success btn-sm changeBtn">更改发票</a>';
}
} elseif ($order_info['status'] != -1 && isset($tags) && $tags == 'self' && isset($extend) && !$extend) {
......
......@@ -361,7 +361,7 @@
<a class="btn btn-danger manager-audit" data-id="{{$v['order_id']}}">主管审核</a>
@endif
@if (!empty($order_extend->erp_sn))
@if (!empty($order_extend->erp_sn) && in_array($v['status'], [2, 3, 4]))
<a class="btn btn-warning send_mail" data-id="{{ $v['order_id'] }}">发送邮件</a>
@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