戴余标 2 years ago
commit fc563cd389

@ -295,7 +295,7 @@ class ExamineFlow extends ApiCommon
$flow_id = $param['flow_id']; $flow_id = $param['flow_id'];
$types = $param['types']; $types = $param['types'];
$types_id = $param['types_id']; $types_id = $param['types_id'];
$typesArr = ['crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory']; $typesArr = ['crm_customer_check','crm_business','crm_contract', 'crm_receivables', 'crm_invoice', 'oa_examine', 'jxc_purchase', 'jxc_retreat', 'jxc_sale', 'jxc_salereturn', 'jxc_payment', 'jxc_collection', 'jxc_allocation', 'jxc_inventory'];
if (!$types || !in_array($types, $typesArr)) { if (!$types || !in_array($types, $typesArr)) {
return resultArray(['error' => '参数错误']); return resultArray(['error' => '参数错误']);
} }

@ -188,6 +188,8 @@ class ExamineStep extends Common
case 'jxc_collection': $dataInfo = db('jxc_collection')->where(['collection_note_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; case 'jxc_collection': $dataInfo = db('jxc_collection')->where(['collection_note_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break;
case 'jxc_inventory': $dataInfo = db('jxc_inventory')->where(['inventory_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; case 'jxc_inventory': $dataInfo = db('jxc_inventory')->where(['inventory_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break;
case 'jxc_allocation': $dataInfo = db('jxc_allocation')->where(['allocation_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break; case 'jxc_allocation': $dataInfo = db('jxc_allocation')->where(['allocation_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break;
case 'crm_customer_check': $dataInfo = db('crm_customer_check')->where(['customer_check_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break;
case 'crm_business': $dataInfo = db('crm_business')->where(['business_id' => intval($types_id)])->field('create_user_id,owner_user_id,check_user_id,flow_id,order_id,check_status,update_time')->find(); break;
} }
$stepInfo = []; $stepInfo = [];
if ($dataInfo['flow_id'] && !in_array($dataInfo['check_status'],['5'])) { if ($dataInfo['flow_id'] && !in_array($dataInfo['check_status'],['5'])) {

@ -410,11 +410,11 @@ class Business extends ApiCommon
if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) { if (($examineStatus != false && $examineStatus != 'false') || $examineStatus == 1) {
// 审核判断(是否有符合条件的审批流) // 审核判断(是否有符合条件的审批流)
$examineFlowModel = new \app\admin\model\ExamineFlow(); $examineFlowModel = new \app\admin\model\ExamineFlow();
if (!$examineFlowModel->checkExamine($userInfo['user_id'], 'crm_business')) { if (!$examineFlowModel->checkExamine($userInfo['id'], 'crm_business')) {
return '暂无审批人,无法创建'; return '暂无审批人,无法创建';
} }
//添加审批相关信息 //添加审批相关信息
$examineFlowData = $examineFlowModel->getFlowByTypes($userInfo['user_id'], 'crm_business'); $examineFlowData = $examineFlowModel->getFlowByTypes($userInfo['id'], 'crm_business');
if (!$examineFlowData) { if (!$examineFlowData) {
return '无可用审批流,请联系管理员'; return '无可用审批流,请联系管理员';
} }
@ -422,7 +422,7 @@ class Business extends ApiCommon
//获取审批人信息 //获取审批人信息
if ($examineFlowData['config'] == 1) { if ($examineFlowData['config'] == 1) {
//固定审批流 //固定审批流
$nextStepData = $examineStepModel->nextStepUser($userInfo['user_id'], $examineFlowData['flow_id'], 'crm_business', 0, 0, 0); $nextStepData = $examineStepModel->nextStepUser($userInfo['id'], $examineFlowData['flow_id'], 'crm_business', 0, 0, 0);
$next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: ''; $next_user_ids = arrayToString($nextStepData['next_user_ids']) ?: '';
$check_user_id = $next_user_ids ?: []; $check_user_id = $next_user_ids ?: [];
$data['order_id'] = 1; $data['order_id'] = 1;

@ -127,6 +127,7 @@ class Customer extends ApiCommon
$customerCheck = db('crm_customer_check')->where(['customer_id' => $param['id']])->where(['check_status' => 0])->find(); $customerCheck = db('crm_customer_check')->where(['customer_id' => $param['id']])->where(['check_status' => 0])->find();
if (!empty($customerCheck)) { if (!empty($customerCheck)) {
$data['flow_id'] = $customerCheck['flow_id']; $data['flow_id'] = $customerCheck['flow_id'];
$data['owner_user_id']=$customerCheck['user_id'];
} }
return resultArray(['data' => $data]); return resultArray(['data' => $data]);
} }

@ -164,6 +164,8 @@ class CustomerCheck extends Common
$createData[$key]['check_user_id'] = $param['check_user_id'] ?? 0; $createData[$key]['check_user_id'] = $param['check_user_id'] ?? 0;
$createData[$key]['flow_user_id'] = $param['flow_user_id'] ?? 0; $createData[$key]['flow_user_id'] = $param['flow_user_id'] ?? 0;
$createData[$key]['user_id'] = $param['user_id'] ?? 0; $createData[$key]['user_id'] = $param['user_id'] ?? 0;
$createData[$key]['create_user_id'] = $param['user_id'] ?? 0;
$createData[$key]['owner_user_id'] = $param['user_id'] ?? 0;
} }
$this->startTrans(); $this->startTrans();

Loading…
Cancel
Save