112 lines
3.4 KiB
PHP
112 lines
3.4 KiB
PHP
<?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\contract;
|
||
|
||
|
||
use app\adminapi\controller\BaseAdminController;
|
||
use app\adminapi\lists\contract\ProcurementContractLists;
|
||
use app\adminapi\logic\contract\ProcurementContractLogic;
|
||
use app\adminapi\validate\contract\ProcurementContractValidate;
|
||
use app\common\model\oa\Flow;
|
||
use app\common\model\oa\FlowType;
|
||
|
||
|
||
/**
|
||
* 采购合同控制器
|
||
* Class ProcurementContractController
|
||
* @package app\adminapi\controller\contract
|
||
*/
|
||
class ProcurementContractController extends BaseAdminController
|
||
{
|
||
|
||
|
||
/**
|
||
* @notes 获取采购合同列表
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2023/12/04 22:08
|
||
*/
|
||
public function lists()
|
||
{
|
||
return $this->dataLists(new ProcurementContractLists());
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 添加采购合同
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2023/12/04 22:08
|
||
*/
|
||
public function add()
|
||
{
|
||
$params = (new ProcurementContractValidate())->post()->goCheck('add');
|
||
$result = ProcurementContractLogic::add($params);
|
||
if (true === $result) {
|
||
return $this->success('添加成功', [], 1, 1);
|
||
}
|
||
return $this->fail(ProcurementContractLogic::getError());
|
||
}
|
||
|
||
/**
|
||
* @notes 编辑采购合同
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2023/12/02 17:19
|
||
*/
|
||
public function edit()
|
||
{
|
||
$params = (new ProcurementContractValidate())->post()->goCheck('edit');
|
||
$result = ProcurementContractLogic::edit($params);
|
||
if (true === $result) {
|
||
return $this->success('编辑成功', [], 1, 1);
|
||
}
|
||
return $this->fail(ProcurementContractLogic::getError());
|
||
}
|
||
|
||
/**
|
||
* @notes 获取采购合同详情
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2023/12/04 22:08
|
||
*/
|
||
public function detail()
|
||
{
|
||
$params = (new ProcurementContractValidate())->goCheck('detail');
|
||
$result = ProcurementContractLogic::detail($params);
|
||
return $this->data($result);
|
||
}
|
||
|
||
public function flows(): \think\response\Json
|
||
{
|
||
$flow_type = FlowType::where('type',2)->where('name','cght')->findOrEmpty();
|
||
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
|
||
return $this->success('请求成功',$data->toArray());
|
||
}
|
||
|
||
//添加审批
|
||
public function approve(): \think\response\Json
|
||
{
|
||
$params = (new ProcurementContractValidate())->post()->goCheck('approve');
|
||
$result = ProcurementContractLogic::approve($params,$this->adminId);
|
||
if (true === $result) {
|
||
return $this->success('提交审核信息成功', [], 1, 1);
|
||
}
|
||
return $this->fail(ProcurementContractLogic::getError());
|
||
}
|
||
|
||
|
||
} |