Commit ea60ee9d authored by hujun's avatar hujun

费用报销-删除列表

parent c6f12c40
...@@ -16,6 +16,7 @@ use app\index\untils\ExportExcelUntil; ...@@ -16,6 +16,7 @@ use app\index\untils\ExportExcelUntil;
use app\model\AStore; use app\model\AStore;
use app\model\FApplyForFee; use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck; use app\model\FApplyForFeeCheck;
use app\model\FApplyForFeeLog;
use app\model\FImg; use app\model\FImg;
use app\model\FOffice; use app\model\FOffice;
use app\model\FSettingLog; use app\model\FSettingLog;
...@@ -308,6 +309,14 @@ class Cost extends Basic ...@@ -308,6 +309,14 @@ class Cost extends Basic
if ($is_ok) { if ($is_ok) {
$check_model = new FApplyForFeeCheck(); $check_model = new FApplyForFeeCheck();
$check_model->editData(['is_del'=>1], $this->params['id'], 'apply_for_id'); $check_model->editData(['is_del'=>1], $this->params['id'], 'apply_for_id');
$m_log = new FApplyForFeeLog();
$log_data['apply_id'] = $this->params['id'];
$log_data['agent_id'] = $this->userId;
$log_data['name'] = $this->userName;
$log_data['remark'] = '删除费用报销';
$log_data['type'] = 1;
$m_log->insertData($log_data);
$code = 200; $code = 200;
$msg = '删除成功'; $msg = '删除成功';
} else { } else {
...@@ -488,4 +497,44 @@ class Cost extends Basic ...@@ -488,4 +497,44 @@ class Cost extends Basic
} }
return $this->response(200, '', $data); return $this->response(200, '', $data);
} }
/**
* 删除费用报销列表
*
* @return \think\Response
*/
public function delCostList()
{
if (!$this->request->isAjax()) {
return view('cost/delCost');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$cost_service = new CostService();
$field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,';
$field .= 'b.name as agent_name,a.site_id';
$where['is_del'] = 1;
$list = $this->fee_model->getJoinAgentList($pageNo, $pageSize, 'a.id desc', $field, $where);
$data = [];
foreach($list as $v) {
$key = $fee_id[] = $v['id'];
$data[$key] = $v;
$data[$key]['type_name'] = $cost_service->getFeeType($v['type']);
$data[$key]['fee_item_name'] = $cost_service->getFeeItem($v['fee_item']);
$data[$key]['del_name'] = '';
}
if (isset($fee_id)) {
$m_log = new FApplyForFeeLog();
$log_where['apply_id'] = ['in', $fee_id];
$log_where['type'] = 1;
$log_data = $m_log->findColumn('apply_id,name', $log_where);
foreach($data as $k=>$v) {
$data[$k]['del_name'] = $log_data[$v['id']];
}
}
return $this->response(200, '', $data);
}
} }
\ No newline at end of file
<?php
namespace app\model;
use think\Db;
use think\Model;
class FApplyForFeeLog extends BaseModel
{
protected $table = 'f_apply_for_fee_log';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* 新增数据
* @param $data
* @return mixed
*/
public function insertData($data) {
return $this->db_->insert($data);
}
/**
* 查询单条数据
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|Model
*/
public function findByOne($field,$params) {
$result = $this->db_
->field($field)
->where($params)
->find();
return $result;
}
/**
* @param $field
* @param $params
* @return array
*/
public function findColumn($field,$params) {
return $this->db_
->where($params)
->column($field);
}
/**
* @param $field
* @param $params
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function findByOneOrder($field, $params, $order = 'id desc') {
return $this->db_->field($field)
->where($params)
->order($order)
->find();
}
/**
* 查询多条数据
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function selectData($field,$params) {
$params['is_del'] = 0;
$result = $this->db_
->field($field)
->where($params)
->select();
return $result;
}
/**
* @param $data
* @return int|string
*/
public function insertDataAll($data)
{
return $this->db_->insertAll($data);
}
}
...@@ -545,6 +545,7 @@ Route::group('index', [ ...@@ -545,6 +545,7 @@ Route::group('index', [
'getCostListFour/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 3]], //费用报销审核二审 'getCostListFour/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 3]], //费用报销审核二审
'getCostListFive/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 4]], //费用报销审核三审 'getCostListFive/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 4]], //费用报销审核三审
'getCostListSix/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 5]], //费用报销审核行政审核 'getCostListSix/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 5]], //费用报销审核行政审核
'delCostList' => ['index/Cost/delCostList', ['method' => 'GET']], //费用报销-删除列表
'delCost' => ['index/Cost/delCost', ['method' => 'POST']], //删除费用报销审核 'delCost' => ['index/Cost/delCost', ['method' => 'POST']], //删除费用报销审核
'checkCostTwo/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 1]], //费用报销审核总监 'checkCostTwo/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 1]], //费用报销审核总监
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审 'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
......
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