|
@@ -52,7 +52,7 @@ class ApproveInfoService
|
|
|
$department = $apply_user['department'];
|
|
|
}
|
|
|
|
|
|
- // 编辑
|
|
|
+ // 重新发起
|
|
|
if ($id > 0) {
|
|
|
$info = ApproveInfo::field('is_deleted', true)
|
|
|
->where('module', $module)
|
|
@@ -71,6 +71,18 @@ class ApproveInfoService
|
|
|
if ($info->status != CommonConstant::STATUS_4) {
|
|
|
except('非审批驳回状态无法操作');
|
|
|
}
|
|
|
+ } else{
|
|
|
+ // 合同呈批申请 判断申购申请单
|
|
|
+ if ($module==CommonConstant::MODULE_9 && $params['apply_id'] > 0) {
|
|
|
+ $apply = ApproveInfo::field('id')
|
|
|
+ ->where('module', CommonConstant::MODULE_1)
|
|
|
+ ->where('status', CommonConstant::STATUS_3)
|
|
|
+ ->where('is_deleted', CommonConstant::IS_DELETED_0)
|
|
|
+ ->find($id);
|
|
|
+ if (!$apply) {
|
|
|
+ except('申购申请单不存在或已删除');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$order_no = get_order_sn($user['id']);
|
|
@@ -114,7 +126,6 @@ class ApproveInfoService
|
|
|
// 添加审批申请
|
|
|
$info = ApproveInfo::create($data);
|
|
|
$info_id = $info->id;
|
|
|
-// $info_id = 0;
|
|
|
|
|
|
// 添加对应模块
|
|
|
$module_data = self::create_module($module, $params, $info_id, [], 'create');
|
|
@@ -794,9 +805,17 @@ class ApproveInfoService
|
|
|
$department_data = Department::field('dept_id,name')
|
|
|
->where('dept_id', 'in', $info['department'])
|
|
|
->select();
|
|
|
+ // 关联的合同呈批申请
|
|
|
+ $contract = ApproveInfo::field('id,reason')
|
|
|
+ ->where('module', CommonConstant::MODULE_9)
|
|
|
+ ->where('status', CommonConstant::STATUS_3)
|
|
|
+ ->where('is_deleted', CommonConstant::IS_DELETED_0)
|
|
|
+ ->where('apply_id',$id)
|
|
|
+ ->select();
|
|
|
$info['create_user'] = $create_user;
|
|
|
$info['apply_user'] = $apply_user;
|
|
|
$info['department_data'] = $department_data;
|
|
|
+ $info['contract'] = $contract;
|
|
|
}
|
|
|
} else {
|
|
|
// 信息
|