You've already forked guangan
控价
This commit is contained in:
@ -6,6 +6,7 @@ use plugin\inspection\model\InspectionStaff;
|
||||
use plugin\ticket\model\ApprovalInstance;
|
||||
use plugin\ticket\model\ApprovalProcess;
|
||||
use plugin\ticket\model\ApprovalStep;
|
||||
use plugin\ticket\model\TicketRepair;
|
||||
use plugin\ticket\model\TicketReply;
|
||||
use plugin\ticket\model\TicketTicket;
|
||||
use plugin\ticket\model\TicketTicketInter;
|
||||
@ -251,16 +252,56 @@ class TicketInter extends Controller
|
||||
$adminInfo = $this->request->session('user');
|
||||
$instance_data = $this->_vali([
|
||||
'staff_id.require'=>'请指定维修人员!',
|
||||
'kj_user_id.default'=>'0',
|
||||
]);
|
||||
$staff = InspectionStaff::query()->where('id', '=', $instance_data['staff_id'])->findOrEmpty();
|
||||
if ($staff->isEmpty()) {
|
||||
$this->error('未找到维修人员信息');
|
||||
}
|
||||
$view = $ticket->repairs()->save([
|
||||
'staff_id'=>$instance_data['staff_id'],
|
||||
'status'=>0,
|
||||
'create_id'=>$adminInfo['id'],
|
||||
]);
|
||||
$staff->messages()->save([
|
||||
'status'=>0,
|
||||
'title'=>'您有新的维修工单需要处理',
|
||||
'content'=>'您有新的维修工单需要处理,请及时处理。',
|
||||
]);
|
||||
$ticket->kj_user_id = $instance_data['kj_user_id'];
|
||||
$this->success('创建成功!', $view);
|
||||
} else {
|
||||
$this->vo = $ticket;
|
||||
$this->staffs = $staffs;
|
||||
$this->users = SystemUser::query()->field('id,username,nickname')->select();
|
||||
$this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function repair_ticket_modify()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'ticket_id.require'=>'请指定工单ID!',
|
||||
]);
|
||||
$repair = TicketRepair::query()->where('id', '=', $data['ticket_id'])->findOrEmpty();
|
||||
if ($repair->isEmpty()) {
|
||||
$this->error('未找到工单信息');
|
||||
}
|
||||
if ($repair->ticket === null) {
|
||||
$this->error('未找到主工单信息');
|
||||
}
|
||||
if ($repair->status === 1) {
|
||||
$this->error('该工单已维修完成,无法操作!');
|
||||
}
|
||||
$adminInfo = $this->request->session('user');
|
||||
if ($repair->ticket->kj_user_id != $adminInfo['id']) {
|
||||
$this->error('您不是该工单的控价人员,无法操作!');
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
|
||||
} else {
|
||||
$this->vo = $repair;
|
||||
$this->fetch();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user