|
@@ -53,6 +53,7 @@ class OaService extends Service
|
|
|
{
|
|
|
|
|
|
$id = $data['id'];
|
|
|
+ $menu_id = Oa::where('id',$id)->value('menu_id');
|
|
|
$list = OaSub::where('oa_id',$id)->where('del_time',0)->get()->toArray();
|
|
|
$oa_sub_ids = [];
|
|
|
foreach ($list as $v){
|
|
@@ -66,16 +67,21 @@ class OaService extends Service
|
|
|
$oaRuleKey[$v['oa_sub_id']][] = [
|
|
|
'value' => $v['value'],
|
|
|
'key' => $v['key'],
|
|
|
- 'formula' => $v['formula'] == '==' ? '=' : $v['formula'] ,
|
|
|
+ 'opera' => $v['formula'] == '==' ? '=' : $v['formula'] ,
|
|
|
];
|
|
|
}
|
|
|
+ $employee_key_list = Employee::pluck('emp_name','id')->toArray();
|
|
|
foreach ($oaEmployee as $v){
|
|
|
- $oaEmployeeKey[$v['oa_sub_id']][] = $v['employee_id'];
|
|
|
+ $oaEmployeeKey[$v['oa_sub_id']][] = [
|
|
|
+ 'id'=>$v['employee_id'],
|
|
|
+ 'emp_name'=>$employee_key_list[$v['employee_id']],
|
|
|
+ ];
|
|
|
}
|
|
|
$return = [];
|
|
|
foreach ($list as $v){
|
|
|
$return[$v['sort']][] = [
|
|
|
'emp_id' => $oaEmployeeKey[$v['id']],
|
|
|
+ 'index' => $v['h5_key'],
|
|
|
'set' => isset($oaRuleKey[$v['id']])?$oaRuleKey[$v['id']] : [] ,
|
|
|
];
|
|
|
}
|
|
@@ -86,12 +92,12 @@ class OaService extends Service
|
|
|
$children[] = [
|
|
|
'set'=>$vv['set'],
|
|
|
'emp_id'=>$vv['emp_id'],
|
|
|
- 'index'=>$k,
|
|
|
+ 'index'=>$vv['index'],
|
|
|
];
|
|
|
}
|
|
|
$detail[] = ['children'=>$children];
|
|
|
}
|
|
|
- return [true, $detail];
|
|
|
+ return [true, ['data'=>$detail,'menu_id'=>$menu_id]];
|
|
|
|
|
|
}
|
|
|
|
|
@@ -212,7 +218,7 @@ class OaService extends Service
|
|
|
try {
|
|
|
DB::beginTransaction();
|
|
|
if(isset($data['id'])) $oa = Oa::where('id', $data['id'])->first();
|
|
|
- $oa = new Oa();
|
|
|
+ else $oa = new Oa();
|
|
|
$oa->menu_id = $data['menu_id'];
|
|
|
$oa->crt_employee_id = $user['id'];
|
|
|
$oa->type = $data['type']??0;
|