This commit is contained in:
weiz 2024-03-25 10:26:23 +08:00
parent 4aa0d392ef
commit 7225206303

View File

@ -11,128 +11,128 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\lists\cost_project; namespace app\adminapi\lists\cost_project;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\cost_project\CostApprovedProject; use app\common\lists\ListsSearchInterface;
use app\common\lists\ListsSearchInterface; use app\common\model\cost_project\CostApprovedProject;
/** /**
* 待立项造价项目列表 * 待立项造价项目列表
* Class CostApprovedProjectLists * Class CostApprovedProjectLists
* @package app\adminapi\listscost_project * @package app\adminapi\listscost_project
*/ */
class CostApprovedProjectLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface class CostApprovedProjectLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
{ {
/** /**
* @notes 设置搜索条件 * @notes 设置搜索条件
* @return \string[][] * @return \string[][]
* @author likeadmin * @author likeadmin
* @date 2024/02/20 14:16 * @date 2024/02/20 14:16
*/ */
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['business_nature', 'industry_nature', 'fund_sources', 'const_area'], '=' => ['business_nature', 'industry_nature', 'fund_sources', 'const_area', 'status'],
'%like%' => ['contract_name', 'contract_num', 'part_a', 'part_b'], '%like%' => ['contract_name', 'contract_num', 'part_a', 'part_b'],
]; ];
} }
/** /**
* @notes 获取待立项造价项目列表 * @notes 获取待立项造价项目列表
* @return array * @return array
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @author likeadmin * @author likeadmin
* @date 2024/02/20 14:16 * @date 2024/02/20 14:16
*/ */
public function lists(): array public function lists(): array
{ {
return CostApprovedProject::where($this->searchWhere) return CostApprovedProject::where($this->searchWhere)
->where('status', 1) ->where('status', 1)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function ($data) { ->select()->each(function ($data) {
$data['business_nature_text'] = $data->business_nature_text; $data['business_nature_text'] = $data->business_nature_text;
$data['industry_nature_text'] = $data->industry_nature_text; $data['industry_nature_text'] = $data->industry_nature_text;
$data['fund_sources_text'] = $data->fund_sources_text; $data['fund_sources_text'] = $data->fund_sources_text;
$data['const_area_text'] = $data->const_area_text; $data['const_area_text'] = $data->const_area_text;
}) })
->toArray(); ->toArray();
} }
/** /**
* @notes 获取待立项造价项目数量 * @notes 获取待立项造价项目数量
* @return int * @return int
* @author likeadmin * @author likeadmin
* @date 2024/02/20 14:16 * @date 2024/02/20 14:16
*/ */
public function count(): int public function count(): int
{ {
return CostApprovedProject::where($this->searchWhere)->count(); return CostApprovedProject::where($this->searchWhere)->count();
} }
public function setFileName(): string public function setFileName(): string
{ {
return '待立项造价合同'; return '待立项造价合同';
} }
/** /**
* @notes 导出字段 * @notes 导出字段
* @return string[] * @return string[]
* @author 段誉 * @author 段誉
* @date 2022/11/24 16:17 * @date 2022/11/24 16:17
*/ */
public function setExcelFields(): array public function setExcelFields(): array
{ {
return [ return [
'id' => 'id', 'id' => 'id',
'contract_name' => '合同名称', 'contract_name' => '合同名称',
'contract_num' => '合同编号', 'contract_num' => '合同编号',
'part_a' => '甲方签约单位', 'part_a' => '甲方签约单位',
'part_a_contract' => '甲方联系人', 'part_a_contract' => '甲方联系人',
'part_a_address' => '业主地址', 'part_a_address' => '业主地址',
'part_b' => '乙方签约', 'part_b' => '乙方签约',
'part_b_signatory' => '乙方签约人', 'part_b_signatory' => '乙方签约人',
'business_nature' => '业务性质', 'business_nature' => '业务性质',
'fund_sources' => '资金来源', 'fund_sources' => '资金来源',
'const_area' => '建设区域', 'const_area' => '建设区域',
'project_money' => '工程总投资', 'project_money' => '工程总投资',
'project_scale' => '工程规模及概况', 'project_scale' => '工程规模及概况',
'money' => '签订金额(元)', 'money' => '签订金额(元)',
'rate' => '合同签订费率(%)', 'rate' => '合同签订费率(%)',
'contract_service' => '合同服务工期', 'contract_service' => '合同服务工期',
'start_date' => '合同计划开始日期', 'start_date' => '合同计划开始日期',
'end_date' => '合同计划结束日期', 'end_date' => '合同计划结束日期',
'performance' => '合同履约金(元)', 'performance' => '合同履约金(元)',
'due_time' => '履约金到期时间', 'due_time' => '履约金到期时间',
'payment' => '合同付款方式', 'payment' => '合同付款方式',
'content' => '合同主要内容', 'content' => '合同主要内容',
'founder' => '创建人', 'founder' => '创建人',
'create_date' => '创建日期', 'create_date' => '创建日期',
'dept' => '签订部门', 'dept' => '签订部门',
'signing_person' => '签订负责人', 'signing_person' => '签订负责人',
'regulators' => '监管部门', 'regulators' => '监管部门',
'project_director' => '项目总监/经理', 'project_director' => '项目总监/经理',
'way' => '实施方式', 'way' => '实施方式',
'seal_name' => '盖章名称', 'seal_name' => '盖章名称',
'limit' => '是否限制', 'limit' => '是否限制',
'limit_num' => '限制次数', 'limit_num' => '限制次数',
'file_type' => '文件类', 'file_type' => '文件类',
'seal_num' => '盖章份数', 'seal_num' => '盖章份数',
'sealer' => '盖章人', 'sealer' => '盖章人',
'plance_seal' => '骑缝盖章', 'plance_seal' => '骑缝盖章',
'send_date' => '发出日期', 'send_date' => '发出日期',
'number' => '邮寄编号', 'number' => '邮寄编号',
]; ];
} }
} }