This commit is contained in:
mkm 2023-12-04 23:29:12 +08:00
parent ff98e33472
commit edd2c619b9
15 changed files with 1329 additions and 0 deletions

View File

@ -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\contract;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\contract\ContractNegotiationLists;
use app\adminapi\logic\contract\ContractNegotiationLogic;
use app\adminapi\validate\contract\ContractNegotiationValidate;
/**
* 合同洽商控制器
* Class ContractNegotiationController
* @package app\adminapi\controller\contract
*/
class ContractNegotiationController extends BaseAdminController
{
/**
* @notes 获取合同洽商列表
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function lists()
{
return $this->dataLists(new ContractNegotiationLists());
}
/**
* @notes 添加合同洽商
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function add()
{
$params = (new ContractNegotiationValidate())->post()->goCheck('add');
$result = ContractNegotiationLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ContractNegotiationLogic::getError());
}
/**
* @notes 编辑合同洽商
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function edit()
{
$params = (new ContractNegotiationValidate())->post()->goCheck('edit');
$result = ContractNegotiationLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ContractNegotiationLogic::getError());
}
/**
* @notes 删除合同洽商
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function delete()
{
$params = (new ContractNegotiationValidate())->post()->goCheck('delete');
ContractNegotiationLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取合同洽商详情
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function detail()
{
$params = (new ContractNegotiationValidate())->goCheck('detail');
$result = ContractNegotiationLogic::detail($params);
return $this->data($result);
}
}

View File

@ -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\contract;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\contract\ProcurementContractLists;
use app\adminapi\logic\contract\ProcurementContractLogic;
use app\adminapi\validate\contract\ProcurementContractValidate;
/**
* 采购合同控制器
* 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/04 22:08
*/
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 delete()
{
$params = (new ProcurementContractValidate())->post()->goCheck('delete');
ProcurementContractLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @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);
}
}

View File

@ -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\contract;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\contract\ProcurementContractDetailLists;
use app\adminapi\logic\contract\ProcurementContractDetailLogic;
use app\adminapi\validate\contract\ProcurementContractDetailValidate;
/**
* 采购明细控制器
* Class ProcurementContractDetailController
* @package app\adminapi\controller\contract
*/
class ProcurementContractDetailController extends BaseAdminController
{
/**
* @notes 获取采购明细列表
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function lists()
{
return $this->dataLists(new ProcurementContractDetailLists());
}
/**
* @notes 添加采购明细
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function add()
{
$params = (new ProcurementContractDetailValidate())->post()->goCheck('add');
$result = ProcurementContractDetailLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ProcurementContractDetailLogic::getError());
}
/**
* @notes 编辑采购明细
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function edit()
{
$params = (new ProcurementContractDetailValidate())->post()->goCheck('edit');
$result = ProcurementContractDetailLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ProcurementContractDetailLogic::getError());
}
/**
* @notes 删除采购明细
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function delete()
{
$params = (new ProcurementContractDetailValidate())->post()->goCheck('delete');
ProcurementContractDetailLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取采购明细详情
* @return \think\response\Json
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function detail()
{
$params = (new ProcurementContractDetailValidate())->goCheck('detail');
$result = ProcurementContractDetailLogic::detail($params);
return $this->data($result);
}
}

View File

@ -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\contract;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\contract\ContractNegotiation;
use app\common\lists\ListsSearchInterface;
/**
* 合同洽商列表
* Class ContractNegotiationLists
* @package app\adminapi\listscontract
*/
class ContractNegotiationLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function setSearch(): array
{
return [
'=' => ['contract_id', 'negotiation_name'],
];
}
/**
* @notes 获取合同洽商列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function lists(): array
{
return ContractNegotiation::where($this->searchWhere)
->field(['id', 'contract_id', 'approve_id', 'negotiation_name', 'negotiation_no', 'negotiation_amount', 'negotiation_type', 'labor_costs', 'material_costs', 'warranty_amount', 'Warranty_expire_date', 'profit', 'profit_rate'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取合同洽商数量
* @return int
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function count(): int
{
return ContractNegotiation::where($this->searchWhere)->count();
}
}

View File

@ -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\contract;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\contract\ProcurementContractDetail;
use app\common\lists\ListsSearchInterface;
/**
* 采购明细列表
* Class ProcurementContractDetailLists
* @package app\adminapi\listscontract
*/
class ProcurementContractDetailLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function setSearch(): array
{
return [
'=' => ['procurement_contract_id', 'material_procurement_application_id'],
];
}
/**
* @notes 获取采购明细列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function lists(): array
{
return ProcurementContractDetail::where($this->searchWhere)
->field(['id', 'procurement_contract_id', 'material_procurement_application_id', 'num', 'unit_price_including_tax', 'tax_rate', 'amount_excluding_tax', 'amount_including_tax'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取采购明细数量
* @return int
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function count(): int
{
return ProcurementContractDetail::where($this->searchWhere)->count();
}
}

View File

@ -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\contract;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\contract\ProcurementContract;
use app\common\lists\ListsSearchInterface;
/**
* 采购合同列表
* Class ProcurementContractLists
* @package app\adminapi\listscontract
*/
class ProcurementContractLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function setSearch(): array
{
return [
'=' => ['supplier_id', 'project_id'],
];
}
/**
* @notes 获取采购合同列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function lists(): array
{
return ProcurementContract::where($this->searchWhere)
->field(['id', 'supplier_id', 'approve_id', 'project_id', 'contract_no', 'supplier_contract_no', 'contract_type', 'signing_date', 'pay_type', 'account_period', 'amount', 'amount_excluding_tax', 'amount_daxie', 'retention_money_rate', 'retention_money'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取采购合同数量
* @return int
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function count(): int
{
return ProcurementContract::where($this->searchWhere)->count();
}
}

View File

@ -0,0 +1,136 @@
<?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\contract;
use app\common\model\contract\ContractNegotiation;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 合同洽商逻辑
* Class ContractNegotiationLogic
* @package app\adminapi\logic\contract
*/
class ContractNegotiationLogic extends BaseLogic
{
/**
* @notes 添加合同洽商
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 21:26
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
ContractNegotiation::create([
'contract_id' => $params['contract_id'],
'approve_id' => $params['approve_id'],
'negotiation_name' => $params['negotiation_name'],
'negotiation_no' => $params['negotiation_no'],
'negotiation_amount' => $params['negotiation_amount'],
'negotiation_type' => $params['negotiation_type'],
'labor_costs' => $params['labor_costs'],
'material_costs' => $params['material_costs'],
'warranty_amount' => $params['warranty_amount'],
'Warranty_expire_date' => strtotime($params['Warranty_expire_date']),
'profit' => $params['profit'],
'profit_rate' => $params['profit_rate'],
'negotiation_content' => $params['negotiation_content'],
'negotiation_detail' => $params['negotiation_detail'],
'negotiation_quotation' => $params['negotiation_quotation'],
'negotiation_basis' => $params['negotiation_basis']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑合同洽商
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 21:26
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
ContractNegotiation::where('id', $params['id'])->update([
'contract_id' => $params['contract_id'],
'approve_id' => $params['approve_id'],
'negotiation_name' => $params['negotiation_name'],
'negotiation_no' => $params['negotiation_no'],
'negotiation_amount' => $params['negotiation_amount'],
'negotiation_type' => $params['negotiation_type'],
'labor_costs' => $params['labor_costs'],
'material_costs' => $params['material_costs'],
'warranty_amount' => $params['warranty_amount'],
'Warranty_expire_date' => strtotime($params['Warranty_expire_date']),
'profit' => $params['profit'],
'profit_rate' => $params['profit_rate'],
'negotiation_content' => $params['negotiation_content'],
'negotiation_detail' => $params['negotiation_detail'],
'negotiation_quotation' => $params['negotiation_quotation'],
'negotiation_basis' => $params['negotiation_basis']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除合同洽商
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 21:26
*/
public static function delete(array $params): bool
{
return ContractNegotiation::destroy($params['id']);
}
/**
* @notes 获取合同洽商详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/12/04 21:26
*/
public static function detail($params): array
{
return ContractNegotiation::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,118 @@
<?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\contract;
use app\common\model\contract\ProcurementContractDetail;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 采购明细逻辑
* Class ProcurementContractDetailLogic
* @package app\adminapi\logic\contract
*/
class ProcurementContractDetailLogic extends BaseLogic
{
/**
* @notes 添加采购明细
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:30
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
ProcurementContractDetail::create([
'procurement_contract_id' => $params['procurement_contract_id'],
'material_procurement_application_id' => $params['material_procurement_application_id'],
'num' => $params['num'],
'unit_price_including_tax' => $params['unit_price_including_tax'],
'tax_rate' => $params['tax_rate'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'amount_including_tax' => $params['amount_including_tax']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑采购明细
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:30
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
ProcurementContractDetail::where('id', $params['id'])->update([
'procurement_contract_id' => $params['procurement_contract_id'],
'material_procurement_application_id' => $params['material_procurement_application_id'],
'num' => $params['num'],
'unit_price_including_tax' => $params['unit_price_including_tax'],
'tax_rate' => $params['tax_rate'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'amount_including_tax' => $params['amount_including_tax']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除采购明细
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:30
*/
public static function delete(array $params): bool
{
return ProcurementContractDetail::destroy($params['id']);
}
/**
* @notes 获取采购明细详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/12/04 22:30
*/
public static function detail($params): array
{
return ProcurementContractDetail::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,136 @@
<?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\contract;
use app\common\model\contract\ProcurementContract;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 采购合同逻辑
* Class ProcurementContractLogic
* @package app\adminapi\logic\contract
*/
class ProcurementContractLogic extends BaseLogic
{
/**
* @notes 添加采购合同
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:08
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
ProcurementContract::create([
'supplier_id' => $params['supplier_id'],
'approve_id' => $params['approve_id'],
'project_id' => $params['project_id'],
'contract_no' => $params['contract_no'],
'supplier_contract_no' => $params['supplier_contract_no'],
'contract_type' => $params['contract_type'],
'signing_date' => strtotime($params['signing_date']),
'pay_type' => $params['pay_type'],
'account_period' => $params['account_period'],
'amount' => $params['amount'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'amount_daxie' => $params['amount_daxie'],
'retention_money_rate' => $params['retention_money_rate'],
'retention_money' => $params['retention_money'],
'remark' => $params['remark'],
'annex' => $params['annex']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑采购合同
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:08
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
ProcurementContract::where('id', $params['id'])->update([
'supplier_id' => $params['supplier_id'],
'approve_id' => $params['approve_id'],
'project_id' => $params['project_id'],
'contract_no' => $params['contract_no'],
'supplier_contract_no' => $params['supplier_contract_no'],
'contract_type' => $params['contract_type'],
'signing_date' => strtotime($params['signing_date']),
'pay_type' => $params['pay_type'],
'account_period' => $params['account_period'],
'amount' => $params['amount'],
'amount_excluding_tax' => $params['amount_excluding_tax'],
'amount_daxie' => $params['amount_daxie'],
'retention_money_rate' => $params['retention_money_rate'],
'retention_money' => $params['retention_money'],
'remark' => $params['remark'],
'annex' => $params['annex']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除采购合同
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/12/04 22:08
*/
public static function delete(array $params): bool
{
return ProcurementContract::destroy($params['id']);
}
/**
* @notes 获取采购合同详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/12/04 22:08
*/
public static function detail($params): array
{
return ProcurementContract::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,94 @@
<?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\contract;
use app\common\validate\BaseValidate;
/**
* 合同洽商验证器
* Class ContractNegotiationValidate
* @package app\adminapi\validate\contract
*/
class ContractNegotiationValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return ContractNegotiationValidate
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return ContractNegotiationValidate
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return ContractNegotiationValidate
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return ContractNegotiationValidate
* @author likeadmin
* @date 2023/12/04 21:26
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,94 @@
<?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\contract;
use app\common\validate\BaseValidate;
/**
* 采购明细验证器
* Class ProcurementContractDetailValidate
* @package app\adminapi\validate\contract
*/
class ProcurementContractDetailValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return ProcurementContractDetailValidate
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return ProcurementContractDetailValidate
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return ProcurementContractDetailValidate
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return ProcurementContractDetailValidate
* @author likeadmin
* @date 2023/12/04 22:30
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,94 @@
<?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\contract;
use app\common\validate\BaseValidate;
/**
* 采购合同验证器
* Class ProcurementContractValidate
* @package app\adminapi\validate\contract
*/
class ProcurementContractValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return ProcurementContractValidate
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return ProcurementContractValidate
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return ProcurementContractValidate
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return ProcurementContractValidate
* @author likeadmin
* @date 2023/12/04 22:08
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -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\contract;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 合同洽商模型
* Class ContractNegotiation
* @package app\common\model\contract
*/
class ContractNegotiation extends BaseModel
{
use SoftDelete;
protected $name = 'contract_negotiation';
protected $deleteTime = 'delete_time';
}

View File

@ -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\contract;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 采购合同模型
* Class ProcurementContract
* @package app\common\model\contract
*/
class ProcurementContract extends BaseModel
{
use SoftDelete;
protected $name = 'procurement_contract';
protected $deleteTime = 'delete_time';
}

View File

@ -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\contract;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 采购明细模型
* Class ProcurementContractDetail
* @package app\common\model\contract
*/
class ProcurementContractDetail extends BaseModel
{
use SoftDelete;
protected $name = 'procurement_contract_detail';
protected $deleteTime = 'delete_time';
}