|
@@ -138,12 +138,14 @@ class ApproveInfoService
|
|
|
$info_id = $info->id;
|
|
|
|
|
|
// 添加对应模块
|
|
|
- $module_data = self::create_module($module, $params, $info_id, [], 'create');
|
|
|
- $info->module_id = $module_data['module_id'];
|
|
|
+ $result = self::create_module($module, $params, $info_id, [], 'create');
|
|
|
+ $info->module_id = $result['module_id'];
|
|
|
$info->save();
|
|
|
|
|
|
// 添加审批抄送
|
|
|
self::create_approve($approve_user, $copy_user, $userid, $info_id, 'create');
|
|
|
+
|
|
|
+ user_log('approve',json_encode($result,JSON_UNESCAPED_UNICODE));
|
|
|
}
|
|
|
Db::commit();
|
|
|
} catch (Exception $e) {
|
|
@@ -152,9 +154,14 @@ class ApproveInfoService
|
|
|
except('出现错误:' . $e->getMessage());
|
|
|
}
|
|
|
|
|
|
+ // 4=领用申请 冻结库存
|
|
|
+ if ($module == CommonConstant::MODULE_4) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if ($way == CommonConstant::create) {
|
|
|
+ // 9=合同呈批申请 生成合同编号
|
|
|
if ($module == CommonConstant::MODULE_9) {
|
|
|
- // 生成合同编号
|
|
|
$contract_no = CommonService::get_contract_no($params['type']);
|
|
|
$info->save(['reason' => $contract_no]);
|
|
|
}
|
|
@@ -311,9 +318,8 @@ class ApproveInfoService
|
|
|
$module_result = $model::create($data);
|
|
|
$module_id = $module_result->id;
|
|
|
}
|
|
|
- $module_data = $data;
|
|
|
- $result = compact("module_id", "module_data", "other");
|
|
|
- return $result;
|
|
|
+ $module_info = $data;
|
|
|
+ return compact("module_id", "module_info", "other");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -323,6 +329,7 @@ class ApproveInfoService
|
|
|
* @param integer $module 模块类型
|
|
|
* @param array $params 数据
|
|
|
* @param string $type 类型:create=申请,update=重新发起
|
|
|
+ * @return array
|
|
|
**/
|
|
|
public static function create_goods($info_id, $module, $params, $type)
|
|
|
{
|
|
@@ -1175,29 +1182,16 @@ class ApproveInfoService
|
|
|
}
|
|
|
// TODO 没有判断评价状态
|
|
|
|
|
|
+ // 更新维修信息
|
|
|
$params['comment_status'] = CommonConstant::IS_WHO_1;
|
|
|
- self::comment($info, $params);
|
|
|
+ try {
|
|
|
+ ApproveMaintain::where('info_id', $info->id)->update($params);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ except('出现错误:' . $e->getMessage());
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 评分
|
|
|
- *
|
|
|
- * @param mixed $info 申请信息
|
|
|
- * @param array $params 数组
|
|
|
- **/
|
|
|
- public static function comment($info, $params)
|
|
|
- {
|
|
|
- try {
|
|
|
- $data = $params;
|
|
|
- // 更新维修信息
|
|
|
- ApproveMaintain::where('info_id', $info->id)->update($data);
|
|
|
- } catch (Exception $e) {
|
|
|
- except('出现错误:' . $e->getMessage());
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
}
|