Commit 52dbbb52 authored by hujun's avatar hujun

办公楼成交报告审核

parent 8ab014d5
......@@ -1526,4 +1526,76 @@ class OfficeBargain extends Basic
return $this->response(200, "", $data);
}
/**
* 财务结单
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function checkOver()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '参数错误');
}
$m_partial_commission = new OfficeOPartialCommission();
$confirm_status = $m_partial_commission->checkConfirmStatus($this->params['bargain_id']);
if ($confirm_status) {
return $this->response(101, '请确认分佣');
}
$insert_data['audit_id'] = $this->userId;
$insert_data['audit_name'] = $this->userName;
$insert_data['audit_level'] = 3;
$data = $this->m_bargain->addCheckBargain($this->params['bargain_id'], $insert_data, 1, 11);
$code = 200;
$msg = "";
if ($data) {
$this->editRecordLog($this->params['bargain_id'], '[财务结单]', 3); //日志记录
} else {
$code = 101;
$msg = '参数错误结单失败!';
}
return $this->response($code, $msg);
}
/**
* 回到一级审核
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function toReportListOne()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '参数错误');
}
$m_financial = new OfficeOFinancialAudit();
$data['status'] = 3;
$data['is_del'] = 1; //去除之前的审核记录
$data = $m_financial->editData($data, $this->params['bargain_id'], 'bargain_id');
$msg = '';
if ($data > 0) {
$update_data['status'] = 10;
$update_data['audit_level'] = 0;
$where[] = [ 'EXP', 'id=' . $this->params['bargain_id'] . ' or father_id=' . $this->params['bargain_id'] ];
$where['status'] = [ '<>', 30 ];
$this->m_bargain->updateBargainByWhere($update_data, $where);
$code = 200;
$this->editRecordLog($this->params['bargain_id'], '[转到一级审核]', 3); //日志记录
} else {
$code = 101;
$msg = '操作失败!';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -391,7 +391,7 @@ class OfficeOBargainModel extends Model
])->find();
if ($bargain_data != '') {
$audit = new OFinancialAudit();
$audit = new OfficeOFinancialAudit();
$audit_data = $audit->getLastStep($bargain_data['id'], $source); //获取最后一次审核等级
$save_data['bargain_id'] = $bargain_data['id'];
......
......@@ -1136,6 +1136,8 @@ Route::group('office_index', [
'checkReportAttache/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核成交报告-第一级审核
'checkReportManager/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核成交报告-第二级审核
'checkReportMajordomo/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核成交报告-第三级审核
'checkOver' => ['index/OfficeBargain/checkOver', ['method' => 'POST']], //财务结单
'toReportListOne' => ['index/OfficeBargain/toReportListOne', ['method' => 'POST']], //回到一级审核
'partialCommissionList' => ['index/OfficeFinance/partialCommissionList', ['method' => 'get']], //分佣提成明细表
'performanceInfo' => ['index/OfficePerformanceInfo/performanceInfo', ['method' => 'GET|POST']],//业绩明细办公楼
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment