Commit 53ad14b7 authored by hujun's avatar hujun

撤销成交报告

parent a5546a8f
......@@ -1269,4 +1269,46 @@ class OfficeBargain extends Basic
}
return $this->response($code, $msg);
}
/**
* 撤销列表-恢复成交报告
*
* @return \think\Response
*/
public function recoveryBargain() {
$code = 101;
if (empty($this->params['id'])) {
return $this->response($code, '参数错误');
}
$msg = '';
$where['a.status'] = ['in', '20,21'];
$where[] = ['EXP', 'a.id ='.$this->params['id'].' OR a.father_id='.$this->params['id']];
$agent_arr = $this->m_bargain->agentBargainAll('a.create_time,a.agent_id,b.store_id,b.district_id', $where);
if (empty($agent_arr)) {
return $this->response($code, '没有该记录');
}
$data['status'] = 10;
$data['audit_level'] = 0;
$where_2[] = ['EXP', 'id ='.$this->params['id'].' OR father_id='.$this->params['id']];
$where_2['status'] = ['in', '20,21'];
$is_ok = $this->m_bargain->updateBargainByWhere($data, $where_2);
if ($is_ok) {
foreach ($agent_arr as $k=>$v) {
try {
$this->totalOfficialReceipts($v['agent_id'], $v['district_id'], $v['store_id'], $v['create_time']);
$code = 200;
} catch (\Exception $e) {
$msg = '恢复失败:'.$e->getMessage();
break;
}
}
} else {
$code = 101;
$msg = '恢复成交报告状态失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -1064,7 +1064,13 @@ Route::group('office_index', [
'refundDetail' => ['index/officePayLog/refundDetail', ['method' => 'GET']], //退款详情
'checkRefund' => ['index/officePayLog/checkRefund', ['method' => 'GET']], //退款审核
'delRefund' => ['index/officePayLog/delRefund', ['method' => 'GET']], //删除退款
'reportListUndone/:check_status' => ['index/officePayLog/reportList', ['method' => 'get'], ['check_status' => 6]], //财务 成交报告-已撤销
'backOutThree/:check_status' => ['index/officePayLog/reportList', ['method' => 'get'], ['check_status' => 8]], //财务 成交报告-待撤销-第三级数据
'backOutTwo/:check_status' => ['index/officePayLog/reportList', ['method' => 'get'], ['check_status' => 7]], //财务 成交报告-待撤销-第二级数据
'backOutOne/:check_status' => ['index/officePayLog/reportList', ['method' => 'get'], ['check_status' => 5]], //财务 成交报告-待撤销-第一级数据
'checkBackOutOne/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核撤销成交报告-第一级审核
'checkBackOutTwo/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核撤销成交报告-第二级审核
'checkBackOutThree/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核撤销成交报告-第三级审核
'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看
'inspectionRecordDistrict/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 2]], //部门约带看
......@@ -1089,6 +1095,7 @@ Route::group('office_index', [
'getTaxesById' => ['index/OfficeBargain/getTaxesById', ['method' => 'POST|GET']], //财务结单
'delTaxes' => ['index/OfficeBargain/delTaxes', ['method' => 'POST']], //删除开票税费
'backOutToOne' => ['index/OfficeBargain/backOutToOne', ['method' => 'POST']], //财务 成交报告-撤销成交报告
'recoveryBargain' => ['index/OfficeBargain/recoveryBargain', ['method' => '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