add
This commit is contained in:
parent
fbff54a9ce
commit
75b4a99040
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\adminapi\controller\financial;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\financial\FinancialExpenseReimbursementLists;
|
||||
use app\adminapi\logic\financial\FinancialExpenseReimbursementLogic;
|
||||
use app\adminapi\validate\financial\FinancialExpenseReimbursementValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--费用报销单控制器
|
||||
* Class FinancialExpenseReimbursementController
|
||||
* @package app\adminapi\controller\financial
|
||||
*/
|
||||
class FinancialExpenseReimbursementController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--费用报销单列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FinancialExpenseReimbursementLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--费用报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new FinancialExpenseReimbursementValidate())->post()->goCheck('add');
|
||||
$result = FinancialExpenseReimbursementLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialExpenseReimbursementLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--费用报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new FinancialExpenseReimbursementValidate())->post()->goCheck('edit');
|
||||
$result = FinancialExpenseReimbursementLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialExpenseReimbursementLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--费用报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FinancialExpenseReimbursementValidate())->post()->goCheck('delete');
|
||||
FinancialExpenseReimbursementLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--费用报销单详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new FinancialExpenseReimbursementValidate())->goCheck('detail');
|
||||
$result = FinancialExpenseReimbursementLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\adminapi\controller\financial;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\financial\FinancialTravelReimbursementLists;
|
||||
use app\adminapi\logic\financial\FinancialTravelReimbursementLogic;
|
||||
use app\adminapi\validate\financial\FinancialTravelReimbursementValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--差旅费报销单控制器
|
||||
* Class FinancialTravelReimbursementController
|
||||
* @package app\adminapi\controller\financial
|
||||
*/
|
||||
class FinancialTravelReimbursementController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--差旅费报销单列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FinancialTravelReimbursementLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--差旅费报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new FinancialTravelReimbursementValidate())->post()->goCheck('add');
|
||||
$result = FinancialTravelReimbursementLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialTravelReimbursementLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--差旅费报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new FinancialTravelReimbursementValidate())->post()->goCheck('edit');
|
||||
$result = FinancialTravelReimbursementLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialTravelReimbursementLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--差旅费报销单
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FinancialTravelReimbursementValidate())->post()->goCheck('delete');
|
||||
FinancialTravelReimbursementLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--差旅费报销单详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new FinancialTravelReimbursementValidate())->goCheck('detail');
|
||||
$result = FinancialTravelReimbursementLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\financial;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\financial\FinancialExpenseReimbursement;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--费用报销单列表
|
||||
* Class FinancialExpenseReimbursementLists
|
||||
* @package app\adminapi\listsfinancial
|
||||
*/
|
||||
class FinancialExpenseReimbursementLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['contract_id', 'fee_application_id', 'pay_type'],
|
||||
'%like%' => ['theme', 'code', 'create_user'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--费用报销单列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return FinancialExpenseReimbursement::where($this->searchWhere)
|
||||
->field(['id', 'contract_id', 'fee_application_id', 'theme', 'code', 'bill_num', 'pay_type', 'content', 'create_user', 'create_time'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--费用报销单数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return FinancialExpenseReimbursement::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\financial;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\financial\FinancialTravelReimbursement;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--差旅费报销单列表
|
||||
* Class FinancialTravelReimbursementLists
|
||||
* @package app\adminapi\listsfinancial
|
||||
*/
|
||||
class FinancialTravelReimbursementLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['code', 'approve_dept', 'cost_type', 'pay_type', 'create_user'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--差旅费报销单列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return FinancialTravelReimbursement::where($this->searchWhere)
|
||||
->field(['id', 'code', 'approve_dept', 'cost_type', 'pay_type', 'tax_deductible_amount', 'bill_num', 'fee_application_id', 'content', 'create_user', 'create_time'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--差旅费报销单数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return FinancialTravelReimbursement::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\financial;
|
||||
|
||||
|
||||
use app\common\model\financial\FinancialExpenseReimbursement;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--费用报销单逻辑
|
||||
* Class FinancialExpenseReimbursementLogic
|
||||
* @package app\adminapi\logic\financial
|
||||
*/
|
||||
class FinancialExpenseReimbursementLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--费用报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialExpenseReimbursement::create([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'fee_application_id' => $params['fee_application_id'],
|
||||
'theme' => $params['theme'],
|
||||
'code' => $params['code'],
|
||||
'bill_num' => $params['bill_num'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'content' => $params['content'],
|
||||
'annex' => $params['annex'],
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => $params['create_time']
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--费用报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialExpenseReimbursement::where('id', $params['id'])->update([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'fee_application_id' => $params['fee_application_id'],
|
||||
'theme' => $params['theme'],
|
||||
'code' => $params['code'],
|
||||
'bill_num' => $params['bill_num'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'content' => $params['content'],
|
||||
'annex' => $params['annex'],
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => $params['create_time']
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--费用报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return FinancialExpenseReimbursement::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--费用报销单详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return FinancialExpenseReimbursement::findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\financial;
|
||||
|
||||
|
||||
use app\common\model\financial\FinancialTravelReimbursement;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--差旅费报销单逻辑
|
||||
* Class FinancialTravelReimbursementLogic
|
||||
* @package app\adminapi\logic\financial
|
||||
*/
|
||||
class FinancialTravelReimbursementLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--差旅费报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialTravelReimbursement::create([
|
||||
'code' => $params['code'],
|
||||
'approve_dept' => $params['approve_dept'],
|
||||
'cost_type' => $params['cost_type'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'tax_deductible_amount' => $params['tax_deductible_amount'],
|
||||
'bill_num' => $params['bill_num'],
|
||||
'fee_application_id' => $params['fee_application_id'],
|
||||
'content' => $params['content'],
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => $params['create_time']
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--差旅费报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialTravelReimbursement::where('id', $params['id'])->update([
|
||||
'code' => $params['code'],
|
||||
'approve_dept' => $params['approve_dept'],
|
||||
'cost_type' => $params['cost_type'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'tax_deductible_amount' => $params['tax_deductible_amount'],
|
||||
'bill_num' => $params['bill_num'],
|
||||
'fee_application_id' => $params['fee_application_id'],
|
||||
'content' => $params['content'],
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => $params['create_time']
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--差旅费报销单
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return FinancialTravelReimbursement::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--差旅费报销单详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return FinancialTravelReimbursement::findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\financial;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--费用报销单验证器
|
||||
* Class FinancialExpenseReimbursementValidate
|
||||
* @package app\adminapi\validate\financial
|
||||
*/
|
||||
class FinancialExpenseReimbursementValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'contract_id' => 'require',
|
||||
'fee_application_id' => 'require',
|
||||
'theme' => 'require',
|
||||
'code' => 'require',
|
||||
'bill_num' => 'require',
|
||||
'pay_type' => 'require',
|
||||
'content' => 'require',
|
||||
'create_user' => 'require',
|
||||
'create_time' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'contract_id' => '合同id',
|
||||
'fee_application_id' => '费用申请id',
|
||||
'theme' => '单据主题',
|
||||
'code' => '单据编号',
|
||||
'bill_num' => '单据张数',
|
||||
'pay_type' => '支付方式',
|
||||
'content' => '事由',
|
||||
'create_user' => '申请人员',
|
||||
'create_time' => '报销日期',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return FinancialExpenseReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['contract_id','fee_application_id','theme','code','bill_num','pay_type','content','create_user','create_time']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return FinancialExpenseReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','contract_id','fee_application_id','theme','code','bill_num','pay_type','content','create_user','create_time']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return FinancialExpenseReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return FinancialExpenseReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\financial;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--差旅费报销单验证器
|
||||
* Class FinancialTravelReimbursementValidate
|
||||
* @package app\adminapi\validate\financial
|
||||
*/
|
||||
class FinancialTravelReimbursementValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'code' => 'require',
|
||||
'approve_dept' => 'require',
|
||||
'cost_type' => 'require',
|
||||
'pay_type' => 'require',
|
||||
'tax_deductible_amount' => 'require',
|
||||
'bill_num' => 'require',
|
||||
'fee_application_id' => 'require',
|
||||
'content' => 'require',
|
||||
'create_user' => 'require',
|
||||
'create_time' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'code' => '单据编号',
|
||||
'approve_dept' => '审批部门',
|
||||
'cost_type' => '费用类别',
|
||||
'pay_type' => '支付方式',
|
||||
'tax_deductible_amount' => '可抵扣税额',
|
||||
'bill_num' => '附单据张数',
|
||||
'fee_application_id' => '关联费用申请',
|
||||
'content' => '事由',
|
||||
'create_user' => '申请人',
|
||||
'create_time' => '申请日期',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return FinancialTravelReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['code','approve_dept','cost_type','pay_type','tax_deductible_amount','bill_num','fee_application_id','content','create_user','create_time']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return FinancialTravelReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','code','approve_dept','cost_type','pay_type','tax_deductible_amount','bill_num','fee_application_id','content','create_user','create_time']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return FinancialTravelReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return FinancialTravelReimbursementValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/03/28 14:45
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\financial;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--费用报销单模型
|
||||
* Class FinancialExpenseReimbursement
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialExpenseReimbursement extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'financial_expense_reimbursement';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\financial;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--差旅费报销单模型
|
||||
* Class FinancialTravelReimbursement
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialTravelReimbursement extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'financial_travel_reimbursement';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
}
|
13
generate/sql/menu.sql
Normal file
13
generate/sql/menu.sql
Normal file
@ -0,0 +1,13 @@
|
||||
INSERT INTO `gc_system_menu`(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
VALUES (1551, 'C', '差旅费报销单', '', 1, 'financial.financial_travel_reimbursement/lists', 'financial_travel_reimbursement', 'financial_travel_reimbursement/index', '', '', 0, 1, 0, 1711608323, 1711608323);
|
||||
|
||||
SELECT @pid := LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO `gc_system_menu`(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
VALUES (@pid, 'A', '添加', '', 1, 'financial.financial_travel_reimbursement/add', '', '', '', '', 0, 1, 0, 1711608323, 1711608323);
|
||||
|
||||
INSERT INTO `gc_system_menu`(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
VALUES (@pid, 'A', '编辑', '', 1, 'financial.financial_travel_reimbursement/edit', '', '', '', '', 0, 1, 0, 1711608323, 1711608323);
|
||||
|
||||
INSERT INTO `gc_system_menu`(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
VALUES (@pid, 'A', '删除', '', 1, 'financial.financial_travel_reimbursement/delete', '', '', '', '', 0, 1, 0, 1711608323, 1711608323);
|
26
generate/vue/src/api/financial_expense_reimbursement.ts
Normal file
26
generate/vue/src/api/financial_expense_reimbursement.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 财务管理--费用报销单列表
|
||||
export function apiFinancialExpenseReimbursementLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_expense_reimbursement/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--费用报销单
|
||||
export function apiFinancialExpenseReimbursementAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_expense_reimbursement/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--费用报销单
|
||||
export function apiFinancialExpenseReimbursementEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_expense_reimbursement/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--费用报销单
|
||||
export function apiFinancialExpenseReimbursementDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_expense_reimbursement/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--费用报销单详情
|
||||
export function apiFinancialExpenseReimbursementDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_expense_reimbursement/detail', params })
|
||||
}
|
26
generate/vue/src/api/financial_travel_reimbursement.ts
Normal file
26
generate/vue/src/api/financial_travel_reimbursement.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 财务管理--差旅费报销单列表
|
||||
export function apiFinancialTravelReimbursementLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_travel_reimbursement/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--差旅费报销单详情
|
||||
export function apiFinancialTravelReimbursementDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_travel_reimbursement/detail', params })
|
||||
}
|
185
generate/vue/src/views/financial_expense_reimbursement/edit.vue
Normal file
185
generate/vue/src/views/financial_expense_reimbursement/edit.vue
Normal file
@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="合同id" prop="contract_id">
|
||||
<el-input v-model="formData.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用申请id" prop="fee_application_id">
|
||||
<el-input v-model="formData.fee_application_id" clearable placeholder="请输入费用申请id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="formData.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据张数" prop="bill_num">
|
||||
<el-input v-model="formData.bill_num" clearable placeholder="请输入单据张数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="事由" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入事由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人员" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入申请人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报销日期" prop="create_time">
|
||||
<el-input v-model="formData.create_time" clearable placeholder="请输入报销日期" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialExpenseReimbursementEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialExpenseReimbursementAdd, apiFinancialExpenseReimbursementEdit, apiFinancialExpenseReimbursementDetail } from '@/api/financial_expense_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--费用报销单' : '新增财务管理--费用报销单'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
fee_application_id: '',
|
||||
theme: '',
|
||||
code: '',
|
||||
bill_num: '',
|
||||
pay_type: '',
|
||||
content: '',
|
||||
annex: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_id: [{
|
||||
required: true,
|
||||
message: '请输入合同id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
fee_application_id: [{
|
||||
required: true,
|
||||
message: '请输入费用申请id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
theme: [{
|
||||
required: true,
|
||||
message: '请输入单据主题',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
code: [{
|
||||
required: true,
|
||||
message: '请输入单据编号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
bill_num: [{
|
||||
required: true,
|
||||
message: '请输入单据张数',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
pay_type: [{
|
||||
required: true,
|
||||
message: '请输入支付方式',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
content: [{
|
||||
required: true,
|
||||
message: '请输入事由',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入申请人员',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_time: [{
|
||||
required: true,
|
||||
message: '请输入报销日期',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialExpenseReimbursementDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialExpenseReimbursementEdit(data)
|
||||
: await apiFinancialExpenseReimbursementAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
153
generate/vue/src/views/financial_expense_reimbursement/index.vue
Normal file
153
generate/vue/src/views/financial_expense_reimbursement/index.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="合同id" prop="contract_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用申请id" prop="fee_application_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.fee_application_id" clearable placeholder="请输入费用申请id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input class="w-[280px]" v-model="queryParams.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人员" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入申请人员" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_expense_reimbursement/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_expense_reimbursement/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同id" prop="contract_id" show-overflow-tooltip />
|
||||
<el-table-column label="费用申请id" prop="fee_application_id" show-overflow-tooltip />
|
||||
<el-table-column label="单据主题" prop="theme" show-overflow-tooltip />
|
||||
<el-table-column label="单据编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="单据张数" prop="bill_num" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="事由" prop="content" show-overflow-tooltip />
|
||||
<el-table-column label="申请人员" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="报销日期" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['financial.financial_expense_reimbursement/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_expense_reimbursement/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialExpenseReimbursementLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialExpenseReimbursementLists, apiFinancialExpenseReimbursementDelete } from '@/api/financial_expense_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_id: '',
|
||||
fee_application_id: '',
|
||||
theme: '',
|
||||
code: '',
|
||||
pay_type: '',
|
||||
create_user: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialExpenseReimbursementLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialExpenseReimbursementDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
190
generate/vue/src/views/financial_travel_reimbursement/edit.vue
Normal file
190
generate/vue/src/views/financial_travel_reimbursement/edit.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批部门" prop="approve_dept">
|
||||
<el-input v-model="formData.approve_dept" clearable placeholder="请输入审批部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用类别" prop="cost_type">
|
||||
<el-input v-model="formData.cost_type" clearable placeholder="请输入费用类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="可抵扣税额" prop="tax_deductible_amount">
|
||||
<el-input v-model="formData.tax_deductible_amount" clearable placeholder="请输入可抵扣税额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附单据张数" prop="bill_num">
|
||||
<el-input v-model="formData.bill_num" clearable placeholder="请输入附单据张数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联费用申请" prop="fee_application_id">
|
||||
<el-input v-model="formData.fee_application_id" clearable placeholder="请输入关联费用申请" />
|
||||
</el-form-item>
|
||||
<el-form-item label="事由" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入事由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="create_time">
|
||||
<el-input v-model="formData.create_time" clearable placeholder="请输入申请日期" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialTravelReimbursementEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialTravelReimbursementAdd, apiFinancialTravelReimbursementEdit, apiFinancialTravelReimbursementDetail } from '@/api/financial_travel_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--差旅费报销单' : '新增财务管理--差旅费报销单'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
code: '',
|
||||
approve_dept: '',
|
||||
cost_type: '',
|
||||
pay_type: '',
|
||||
tax_deductible_amount: '',
|
||||
bill_num: '',
|
||||
fee_application_id: '',
|
||||
content: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
code: [{
|
||||
required: true,
|
||||
message: '请输入单据编号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
approve_dept: [{
|
||||
required: true,
|
||||
message: '请输入审批部门',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
cost_type: [{
|
||||
required: true,
|
||||
message: '请输入费用类别',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
pay_type: [{
|
||||
required: true,
|
||||
message: '请输入支付方式',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
tax_deductible_amount: [{
|
||||
required: true,
|
||||
message: '请输入可抵扣税额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
bill_num: [{
|
||||
required: true,
|
||||
message: '请输入附单据张数',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
fee_application_id: [{
|
||||
required: true,
|
||||
message: '请输入关联费用申请',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
content: [{
|
||||
required: true,
|
||||
message: '请输入事由',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入申请人',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_time: [{
|
||||
required: true,
|
||||
message: '请输入申请日期',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialTravelReimbursementDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialTravelReimbursementEdit(data)
|
||||
: await apiFinancialTravelReimbursementAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
150
generate/vue/src/views/financial_travel_reimbursement/index.vue
Normal file
150
generate/vue/src/views/financial_travel_reimbursement/index.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批部门" prop="approve_dept">
|
||||
<el-input class="w-[280px]" v-model="queryParams.approve_dept" clearable placeholder="请输入审批部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用类别" prop="cost_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.cost_type" clearable placeholder="请输入费用类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_travel_reimbursement/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="单据编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="审批部门" prop="approve_dept" show-overflow-tooltip />
|
||||
<el-table-column label="费用类别" prop="cost_type" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="可抵扣税额" prop="tax_deductible_amount" show-overflow-tooltip />
|
||||
<el-table-column label="附单据张数" prop="bill_num" show-overflow-tooltip />
|
||||
<el-table-column label="关联费用申请" prop="fee_application_id" show-overflow-tooltip />
|
||||
<el-table-column label="事由" prop="content" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="申请日期" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialTravelReimbursementLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialTravelReimbursementLists, apiFinancialTravelReimbursementDelete } from '@/api/financial_travel_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
code: '',
|
||||
approve_dept: '',
|
||||
cost_type: '',
|
||||
pay_type: '',
|
||||
create_user: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialTravelReimbursementLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialTravelReimbursementDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -23,4 +23,15 @@ export function apiFinancialExpenseReimbursementDelete(params: any) {
|
||||
// 财务管理--费用报销单详情
|
||||
export function apiFinancialExpenseReimbursementDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_expense_reimbursement/detail', params })
|
||||
}
|
||||
|
||||
// 财务管理--费用报销单列表
|
||||
export function apiFinancialExpenseReimbursementDetailLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_expense_reimbursement_detail/lists', params })
|
||||
}
|
||||
|
||||
|
||||
// 删除财务管理--费用报销单
|
||||
export function apiFinancialExpenseReimbursementDetailDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_expense_reimbursement_detail/delete', params })
|
||||
}
|
@ -2,25 +2,35 @@ import request from '@/utils/request'
|
||||
|
||||
// 财务管理--费用申请列表
|
||||
export function apiFinancialFeeApplicationLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_fee_application/lists', params })
|
||||
return request.get({ url: '/financial.financial_fee_applications/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--费用申请
|
||||
export function apiFinancialFeeApplicationAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_fee_application/add', params })
|
||||
return request.post({ url: '/financial.financial_fee_applications/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--费用申请
|
||||
export function apiFinancialFeeApplicationEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_fee_application/edit', params })
|
||||
return request.post({ url: '/financial.financial_fee_applications/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--费用申请
|
||||
export function apiFinancialFeeApplicationDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_fee_application/delete', params })
|
||||
return request.post({ url: '/financial.financial_fee_applications/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--费用申请详情
|
||||
export function apiFinancialFeeApplicationDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_fee_application/detail', params })
|
||||
return request.get({ url: '/financial.financial_fee_applications/detail', params })
|
||||
}
|
||||
|
||||
// 财务管理--费用申请列表
|
||||
export function apiFinancialFeeApplicationDetailLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_fee_application_detail/lists', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--费用申请
|
||||
export function apiFinancialFeeApplicationDetailDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_fee_application_detail/delete', params })
|
||||
}
|
26
src/api/financial_travel_reimbursement.ts
Normal file
26
src/api/financial_travel_reimbursement.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 财务管理--差旅费报销单列表
|
||||
export function apiFinancialTravelReimbursementLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_travel_reimbursement/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--差旅费报销单
|
||||
export function apiFinancialTravelReimbursementDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_travel_reimbursement/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--差旅费报销单详情
|
||||
export function apiFinancialTravelReimbursementDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_travel_reimbursement/detail', params })
|
||||
}
|
@ -607,3 +607,38 @@ export const financial_budget_doc: Iconfig = {
|
||||
{ issue_date: "下达日期" },
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
import { apiFinancialFeeApplicationLists } from '@/api/financial_fee_application'
|
||||
|
||||
|
||||
export const financial_fee_application: Iconfig = {
|
||||
fetchFn: apiFinancialFeeApplicationLists,
|
||||
serchList: [
|
||||
{
|
||||
label: "单据主题",
|
||||
value: "theme",
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code",
|
||||
},
|
||||
{
|
||||
label: "申请人",
|
||||
value: "create_user",
|
||||
},
|
||||
],
|
||||
tableList: [
|
||||
{ theme: "单据主题" },
|
||||
{ code: "单据编号" },
|
||||
{ days: "借款天数" },
|
||||
{ create_user: "申请人" },
|
||||
{ total_amount: "申请金额" },
|
||||
{ create_time: "申请日期" },
|
||||
{ total_bill_num: "票据总张数" },
|
||||
{ remark: "备注" },
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
||||
<span class="cursor-pointer">暂无数据,点击添加 <el-button @click="handleAdd">+</el-button></span>
|
||||
</template>
|
||||
</el-table>
|
||||
<slot name="accumulate"></slot>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
103
src/views/financial_expense_reimbursement/detail.js
Normal file
103
src/views/financial_expense_reimbursement/detail.js
Normal file
@ -0,0 +1,103 @@
|
||||
import { apiFinancialExpenseReimbursementDetailLists } from '@/api/financial_expense_reimbursement'
|
||||
|
||||
|
||||
const detailConfig = {
|
||||
title: "财务管理--费用报销单",
|
||||
config: [
|
||||
{
|
||||
label: "合同名称",
|
||||
value: "contract_name"
|
||||
},
|
||||
{
|
||||
label: "合同类型",
|
||||
value: "contract_type_text"
|
||||
},
|
||||
{
|
||||
label: "费用申请单",
|
||||
value: "fee_application_theme"
|
||||
},
|
||||
{
|
||||
label: "单据主题",
|
||||
value: "theme"
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code"
|
||||
},
|
||||
{
|
||||
label: "单据张数",
|
||||
value: "bill_num"
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code"
|
||||
},
|
||||
{
|
||||
label: "支付方式",
|
||||
value: "pay_type_text"
|
||||
},
|
||||
{
|
||||
label: "事由",
|
||||
value: "content",
|
||||
column: 1
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code"
|
||||
},
|
||||
|
||||
{
|
||||
label: "报销总金额",
|
||||
value: "total_amount"
|
||||
},
|
||||
|
||||
{
|
||||
label: "附件",
|
||||
value: "annex",
|
||||
column: 1
|
||||
},
|
||||
{
|
||||
label: "申请人",
|
||||
value: "create_user"
|
||||
},
|
||||
{
|
||||
label: "申请时间",
|
||||
value: "create_time"
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
table: {
|
||||
title: "报销明细",
|
||||
tableConfig: [
|
||||
{
|
||||
label: "部门",
|
||||
value: 'dept_name',
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
label: "发生日期",
|
||||
value: 'date'
|
||||
},
|
||||
{
|
||||
label: "科目名称",
|
||||
value: 'subject_name_text',
|
||||
},
|
||||
{
|
||||
label: "金额",
|
||||
value: 'amount',
|
||||
},
|
||||
{
|
||||
label: "摘要",
|
||||
value: 'abstract',
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
query: 'expense_reimbursement_id',
|
||||
fetchFun: apiFinancialExpenseReimbursementDetailLists,
|
||||
}
|
||||
|
||||
}
|
||||
export default detailConfig;
|
@ -1,45 +1,90 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="合同id" prop="contract_id">
|
||||
<el-input v-model="formData.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用申请id" prop="fee_application_id">
|
||||
<el-input v-model="formData.fee_application_id" clearable placeholder="请输入费用申请id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="formData.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据张数" prop="bill_num">
|
||||
<el-input v-model="formData.bill_num" clearable placeholder="请输入单据张数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="事由" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入事由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人员" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入申请人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报销日期" prop="create_time">
|
||||
<el-input v-model="formData.create_time" clearable placeholder="请输入报销日期" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同"
|
||||
@click="showDialog = true" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型">
|
||||
<el-input v-model="formData.contract_type_text" placeholder="系统自动生成" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="费用申请单">
|
||||
<el-input v-model="formData.fee_application_theme" clearable placeholder="点击选择费用申请单"
|
||||
@click="showDialog1 = true" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="formData.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="formData.code" clearable placeholder="系统自动生成" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据张数" prop="bill_num">
|
||||
<el-input v-model="formData.bill_num" clearable placeholder="请输入单据张数" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-select v-model="formData.pay_type" class=" flex-1">
|
||||
<el-option v-for="item in dictData.financial_pay_type" :key="item.value" :label="item.name"
|
||||
:value="parseInt(item.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="事由" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入事由" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<CreateUserLable :form-data="formData" flag name="申请"></CreateUserLable>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<UploadAnnex :form-data="formData"></UploadAnnex>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<FormTable :form-data="formData.detail" :config="tableConfig" :dict-data="dictData">
|
||||
<el-table-column label="部门">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.dept_id" placeholder="请选择部门">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #accumulate>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报销总金额:">
|
||||
{{ total_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
</FormTable>
|
||||
</el-form>
|
||||
|
||||
<el-dialog v-model="showDialog" title="选择合同" width="70%">
|
||||
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择费用申请单" width="70%">
|
||||
<dialogTable :config="financial_fee_application" @customEvent="customEvent1">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
@ -47,9 +92,12 @@
|
||||
<script lang="ts" setup name="financialExpenseReimbursementEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialExpenseReimbursementAdd, apiFinancialExpenseReimbursementEdit, apiFinancialExpenseReimbursementDetail } from '@/api/financial_expense_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { apiFinancialExpenseReimbursementAdd, apiFinancialExpenseReimbursementEdit, apiFinancialExpenseReimbursementDetail, apiFinancialExpenseReimbursementDetailLists, apiFinancialExpenseReimbursementDetailDelete } from '@/api/financial_expense_reimbursement'
|
||||
import type { PropType } from 'vue'
|
||||
import { cost_approved_projects, financial_fee_application } from "@/components/dialogTable/dialogTableConfig";
|
||||
import { deptLists } from "@/api/org/department"
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -60,6 +108,8 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
@ -71,7 +121,10 @@ const popupTitle = computed(() => {
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
contract_name: '',
|
||||
fee_application_id: '',
|
||||
contract_type_text: "",
|
||||
fee_application_theme: '',
|
||||
theme: '',
|
||||
code: '',
|
||||
bill_num: '',
|
||||
@ -80,9 +133,65 @@ const formData = reactive({
|
||||
annex: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
detail: [{
|
||||
"dept_id": '',
|
||||
"date": "",
|
||||
"subject_name": '',
|
||||
"amount": '',
|
||||
"abstract": ""
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
const total_amount = computed(() => {
|
||||
return (formData.detail.reduce(
|
||||
(accumulator, currentValue) => (accumulator) + Number(currentValue.amount), 0
|
||||
)).toFixed(2);
|
||||
})
|
||||
|
||||
|
||||
const tableConfig = reactive(
|
||||
{
|
||||
title: "报销明细",
|
||||
tableConfig: [
|
||||
{
|
||||
label: "发生日期",
|
||||
value: 'date',
|
||||
date: true
|
||||
|
||||
},
|
||||
{
|
||||
label: "科目名称",
|
||||
value: 'subject_name',
|
||||
select: "subject_category"
|
||||
},
|
||||
{
|
||||
label: "金额",
|
||||
value: 'amount',
|
||||
},
|
||||
{
|
||||
label: "摘要",
|
||||
value: 'abstract',
|
||||
},
|
||||
|
||||
],
|
||||
deleteApi: apiFinancialExpenseReimbursementDetailDelete,
|
||||
}
|
||||
)
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.contract_id = e.id
|
||||
formData.contract_name = e.contract_name
|
||||
formData.contract_type_text = e.contract_type_text
|
||||
showDialog.value = false
|
||||
}
|
||||
const customEvent1 = (e) => {
|
||||
formData.fee_application_id = e.id
|
||||
formData.fee_application_theme = e.theme
|
||||
showDialog1.value = false
|
||||
}
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_id: [{
|
||||
@ -141,8 +250,9 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let res = await apiFinancialExpenseReimbursementDetailLists({ expense_reimbursement_id: data.id })
|
||||
formData.detail = res.lists
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -156,9 +266,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialExpenseReimbursementEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialExpenseReimbursementEdit(data)
|
||||
: await apiFinancialExpenseReimbursementAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
@ -175,7 +285,13 @@ const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
const deptList = ref([])
|
||||
const getDeptList = async () => {
|
||||
let res = await deptLists()
|
||||
deptList.value = res.lists
|
||||
}
|
||||
|
||||
getDeptList()
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
|
@ -1,30 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同id" prop="contract_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用申请id" prop="fee_application_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.fee_application_id" clearable
|
||||
placeholder="请输入费用申请id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input class="w-[280px]" v-model="queryParams.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人员" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入申请人员" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="合同名称" prop="contract_id">
|
||||
<select-remote model="contract_id" :formData="queryParams"
|
||||
:api="apiCostApprovedProjectSerch"></select-remote>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="支付方式" prop="fee_application_id">
|
||||
<el-select v-model="queryParams.pay_type" class=" flex-1">
|
||||
<el-option v-for="item in dictData.financial_pay_type" :key="item.value" :label="item.name"
|
||||
:value="parseInt(item.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="queryParams.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="queryParams.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申请人员" prop="create_user">
|
||||
<el-input v-model="queryParams.create_user" clearable placeholder="请输入申请人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
@ -41,16 +63,18 @@
|
||||
<div class="mt-4">
|
||||
<el-table border :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同id" prop="contract_id" show-overflow-tooltip />
|
||||
<el-table-column label="费用申请id" prop="fee_application_id" show-overflow-tooltip />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="费用申请报销单" prop="fee_application_theme" show-overflow-tooltip />
|
||||
<el-table-column label="单据主题" prop="theme" show-overflow-tooltip />
|
||||
<el-table-column label="单据编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="单据张数" prop="bill_num" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="事由" prop="content" show-overflow-tooltip />
|
||||
<el-table-column label="报销总金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="申请人员" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="报销日期" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_expense_reimbursement/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
@ -60,6 +84,10 @@
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_expense_reimbursement/detail']" link
|
||||
@click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -69,21 +97,25 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialExpenseReimbursementLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialExpenseReimbursementLists, apiFinancialExpenseReimbursementDelete } from '@/api/financial_expense_reimbursement'
|
||||
import { apiFinancialExpenseReimbursementLists, apiFinancialExpenseReimbursementDelete, apiFinancialExpenseReimbursementDetail } from '@/api/financial_expense_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apiCostApprovedProjectSerch } from "@/api/cost_approved_project";
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
@ -104,7 +136,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
const { dictData } = useDictData('financial_pay_type,subject_category')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
@ -121,10 +153,11 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiFinancialExpenseReimbursementDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
@ -134,6 +167,16 @@ const handleDelete = async (id: number | any[]) => {
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiFinancialExpenseReimbursementDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
|
73
src/views/financial_fee_application/detail.js
Normal file
73
src/views/financial_fee_application/detail.js
Normal file
@ -0,0 +1,73 @@
|
||||
import { apiFinancialFeeApplicationDetailLists } from '@/api/financial_fee_application'
|
||||
|
||||
|
||||
const detailConfig = {
|
||||
title: "财务管理--费用申请",
|
||||
config: [
|
||||
{
|
||||
label: "单据主题",
|
||||
value: "theme"
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code"
|
||||
},
|
||||
{
|
||||
label: "单据编号",
|
||||
value: "code"
|
||||
},
|
||||
{
|
||||
label: "申请金额",
|
||||
value: "total_amount"
|
||||
},
|
||||
{
|
||||
label: "票据总张数",
|
||||
value: "total_bill_num"
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
value: "remark"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
label: "申请人",
|
||||
value: "create_user"
|
||||
},
|
||||
{
|
||||
label: "申请时间",
|
||||
value: "create_time"
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
table: {
|
||||
title: "申请明细",
|
||||
tableConfig: [
|
||||
{
|
||||
label: "科目类别",
|
||||
value: 'subject_category_text',
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
label: "票据张数",
|
||||
value: 'bill_num'
|
||||
},
|
||||
{
|
||||
label: "申请金额",
|
||||
value: 'amount',
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
value: 'remark',
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
query: 'fee_application_id',
|
||||
fetchFun: apiFinancialFeeApplicationDetailLists,
|
||||
}
|
||||
|
||||
}
|
||||
export default detailConfig;
|
@ -1,32 +1,48 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="formData.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="借款天数" prop="days">
|
||||
<el-input v-model="formData.days" clearable placeholder="请输入借款天数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="create_time">
|
||||
<el-input v-model="formData.create_time" clearable placeholder="请输入申请日期" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据主题" prop="theme">
|
||||
<el-input v-model="formData.theme" clearable placeholder="请输入单据主题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="formData.code" clearable placeholder="系统自动生成" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借款天数" prop="days">
|
||||
<el-input v-model="formData.days" clearable placeholder="请输入借款天数" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<create-user-lable flag :form-data='formData' name="申请"></create-user-lable>
|
||||
</el-row>
|
||||
<form-table :form-data="formData.detail" :config="tableConfig" :dict-data="dictData">
|
||||
<template #accumulate>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据总张数:">
|
||||
{{ total_bill_num }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请金额:">
|
||||
{{ total_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
</form-table>
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
@ -35,9 +51,10 @@
|
||||
<script lang="ts" setup name="financialFeeApplicationEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialFeeApplicationAdd, apiFinancialFeeApplicationEdit, apiFinancialFeeApplicationDetail } from '@/api/financial_fee_application'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { apiFinancialFeeApplicationAdd, apiFinancialFeeApplicationEdit, apiFinancialFeeApplicationDetail, apiFinancialFeeApplicationDetailLists, apiFinancialFeeApplicationDetailDelete } from '@/api/financial_fee_application'
|
||||
import type { PropType } from 'vue'
|
||||
import { computed } from "vue"
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -55,6 +72,20 @@ const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--费用申请' : '新增财务管理--费用申请'
|
||||
})
|
||||
|
||||
const total_amount = computed(() => {
|
||||
return (formData.detail.reduce(
|
||||
(accumulator, currentValue) => (accumulator) + Number(currentValue.amount), 0
|
||||
)).toFixed(2);
|
||||
})
|
||||
|
||||
const total_bill_num = computed(() => {
|
||||
return formData.detail.reduce(
|
||||
(accumulator, currentValue) => (accumulator) + Number(currentValue.bill_num), 0
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
@ -64,9 +95,46 @@ const formData = reactive({
|
||||
remark: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
detail: [
|
||||
{
|
||||
"subject_category": '',
|
||||
"bill_num": '',
|
||||
"amount": '',
|
||||
"remark": ""
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
const tableConfig = reactive(
|
||||
{
|
||||
title: "申请明细",
|
||||
tableConfig: [
|
||||
{
|
||||
label: "科目类别",
|
||||
value: 'subject_category',
|
||||
select: 'subject_category'
|
||||
|
||||
},
|
||||
{
|
||||
label: "票据张数",
|
||||
value: 'bill_num',
|
||||
},
|
||||
{
|
||||
label: "申请金额",
|
||||
value: 'amount',
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
value: 'remark',
|
||||
},
|
||||
|
||||
],
|
||||
deleteApi: apiFinancialFeeApplicationDetailDelete,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
theme: [{
|
||||
@ -105,8 +173,10 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let res = await apiFinancialFeeApplicationDetailLists({ fee_application_id: data.id })
|
||||
formData.detail = res.lists
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -120,9 +190,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialFeeApplicationEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialFeeApplicationEdit(data)
|
||||
: await apiFinancialFeeApplicationAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
@ -11,9 +11,6 @@
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="create_time">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_time" clearable placeholder="请输入申请日期" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
@ -37,10 +34,12 @@
|
||||
<el-table-column label="单据主题" prop="theme" show-overflow-tooltip />
|
||||
<el-table-column label="单据编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="借款天数" prop="days" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="申请金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="申请日期" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="票据总张数" prop="total_bill_num" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_fee_application/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
@ -50,6 +49,10 @@
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_fee_application/detail']" link
|
||||
@click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -59,20 +62,24 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig"
|
||||
:column="2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialFeeApplicationLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialFeeApplicationLists, apiFinancialFeeApplicationDelete } from '@/api/financial_fee_application'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { apiFinancialFeeApplicationLists, apiFinancialFeeApplicationDelete, apiFinancialFeeApplicationDetail } from '@/api/financial_fee_application'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
@ -92,7 +99,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
const { dictData } = useDictData('subject_category')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
@ -109,10 +116,11 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiFinancialFeeApplicationDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
@ -122,6 +130,15 @@ const handleDelete = async (id: number | any[]) => {
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiFinancialFeeApplicationDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
|
190
src/views/financial_travel_reimbursement/edit.vue
Normal file
190
src/views/financial_travel_reimbursement/edit.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批部门" prop="approve_dept">
|
||||
<el-input v-model="formData.approve_dept" clearable placeholder="请输入审批部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用类别" prop="cost_type">
|
||||
<el-input v-model="formData.cost_type" clearable placeholder="请输入费用类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="可抵扣税额" prop="tax_deductible_amount">
|
||||
<el-input v-model="formData.tax_deductible_amount" clearable placeholder="请输入可抵扣税额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附单据张数" prop="bill_num">
|
||||
<el-input v-model="formData.bill_num" clearable placeholder="请输入附单据张数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联费用申请" prop="fee_application_id">
|
||||
<el-input v-model="formData.fee_application_id" clearable placeholder="请输入关联费用申请" />
|
||||
</el-form-item>
|
||||
<el-form-item label="事由" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入事由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="create_time">
|
||||
<el-input v-model="formData.create_time" clearable placeholder="请输入申请日期" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialTravelReimbursementEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialTravelReimbursementAdd, apiFinancialTravelReimbursementEdit, apiFinancialTravelReimbursementDetail } from '@/api/financial_travel_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--差旅费报销单' : '新增财务管理--差旅费报销单'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
code: '',
|
||||
approve_dept: '',
|
||||
cost_type: '',
|
||||
pay_type: '',
|
||||
tax_deductible_amount: '',
|
||||
bill_num: '',
|
||||
fee_application_id: '',
|
||||
content: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
code: [{
|
||||
required: true,
|
||||
message: '请输入单据编号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
approve_dept: [{
|
||||
required: true,
|
||||
message: '请输入审批部门',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
cost_type: [{
|
||||
required: true,
|
||||
message: '请输入费用类别',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
pay_type: [{
|
||||
required: true,
|
||||
message: '请输入支付方式',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
tax_deductible_amount: [{
|
||||
required: true,
|
||||
message: '请输入可抵扣税额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
bill_num: [{
|
||||
required: true,
|
||||
message: '请输入附单据张数',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
fee_application_id: [{
|
||||
required: true,
|
||||
message: '请输入关联费用申请',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
content: [{
|
||||
required: true,
|
||||
message: '请输入事由',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入申请人',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_time: [{
|
||||
required: true,
|
||||
message: '请输入申请日期',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialTravelReimbursementDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialTravelReimbursementEdit(data)
|
||||
: await apiFinancialTravelReimbursementAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
150
src/views/financial_travel_reimbursement/index.vue
Normal file
150
src/views/financial_travel_reimbursement/index.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="单据编号" prop="code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批部门" prop="approve_dept">
|
||||
<el-input class="w-[280px]" v-model="queryParams.approve_dept" clearable placeholder="请输入审批部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="费用类别" prop="cost_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.cost_type" clearable placeholder="请输入费用类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_travel_reimbursement/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="单据编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="审批部门" prop="approve_dept" show-overflow-tooltip />
|
||||
<el-table-column label="费用类别" prop="cost_type" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="可抵扣税额" prop="tax_deductible_amount" show-overflow-tooltip />
|
||||
<el-table-column label="附单据张数" prop="bill_num" show-overflow-tooltip />
|
||||
<el-table-column label="关联费用申请" prop="fee_application_id" show-overflow-tooltip />
|
||||
<el-table-column label="事由" prop="content" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="申请日期" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['financial.financial_travel_reimbursement/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialTravelReimbursementLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialTravelReimbursementLists, apiFinancialTravelReimbursementDelete } from '@/api/financial_travel_reimbursement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
code: '',
|
||||
approve_dept: '',
|
||||
cost_type: '',
|
||||
pay_type: '',
|
||||
create_user: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialTravelReimbursementLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialTravelReimbursementDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user