'require|checkData', 'contract_name' => 'require', 'part_a' => 'require', 'part_b' => 'require', 'business_nature' => 'checkBusinessNature', 'industry_nature' => 'checkIndustryNature', 'fund_sources' => 'checkFundSources', 'const_area' => 'checkConstArea', 'project_money' => 'float|egt:0', 'money' => 'require|float|gt:0', 'rate' => 'float|egt:0', 'start_date' => 'dateFormat:Y-m-d', 'end_date' => 'dateFormat:Y-m-d', 'performance' => 'float|egt:0', 'due_time' => 'dateFormat:Y-m-d', 'create_date' => 'dateFormat:Y-m-d', 'dept' => 'require', 'regulators' => 'require', 'way' => 'checkWay', 'seal_name' => 'checkSealName', 'limit' => 'integer|in:0,1', 'limit_num' => 'integer', 'file_type' => 'checkFileType', 'seal_num' => 'integer', 'plance_seal' => 'integer|in:0,1', 'send_date' => 'dateFormat:Y-m-d', 'annex' => 'checkAnnex', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'contract_name' => '合同名称', 'part_a' => '甲方签约单位', 'part_b' => '乙方签约单位', 'business_nature' => '业务性质', 'industry_nature' => '行业性质', 'fund_sources' => '资金来源', 'const_area' => '建设区域', 'project_money' => '工程总投资(元)', 'money' => '签订金额(元)', 'rate' => '合同签订费率(%)', 'start_date' => '合同计划开始日期', 'end_date' => '合同计划结束日期', 'performance' => '履约金(元)', 'due_time' => '履约金到期时间', 'create_date' => '录入日期', 'dept' => '签订部门', 'regulators' => '监管部门', 'way' => '实施方式', 'seal_name' => '盖章名称', 'limit' => '是否限制', 'limit_num' => '限制次数', 'file_type' => '文件类型', 'seal_num' => '盖章份数', 'plance_seal' => '骑缝盖章', 'send_date' => '发出日期', ]; /** * @notes 添加场景 * @return CostApprovedProjectValidate * @author likeadmin * @date 2024/02/20 14:16 */ public function sceneAdd() { return $this->remove('id',true); } /** * @notes 编辑场景 * @return CostApprovedProjectValidate * @author likeadmin * @date 2024/02/20 14:16 */ public function sceneEdit() {} /** * @notes 删除场景 * @return CostApprovedProjectValidate * @author likeadmin * @date 2024/02/20 14:16 */ public function sceneDelete() { return $this->only(['id']); } /** * @notes 详情场景 * @return CostApprovedProjectValidate * @author likeadmin * @date 2024/02/20 14:16 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = CostApprovedProject::field('id')->where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '数据不存在'; } return true; } public function checkBusinessNature($value): bool|string { $dict = DictData::where('type_value','cost_consultation_business_nature')->column('value'); if(!in_array($value,$dict)){ return '业务性质数据值无效'; } return true; } public function checkIndustryNature($value): bool|string { $dict = DictData::where('type_value','cost_consultation_industry_nature')->column('value'); if(!in_array($value,$dict)){ return '行业性质数据值无效'; } return true; } public function checkFundSources($value): bool|string { $dict = DictData::where('type_value','cost_consultation_fund_sources')->column('value'); if(!in_array($value,$dict)){ return '资金来源数据值无效'; } return true; } public function checkConstArea($value): bool|string { $dict = DictData::where('type_value','cost_consultation_const_area')->column('value'); if(!in_array($value,$dict)){ return '建设区域数据值无效'; } return true; } public function checkWay($value): bool|string { $dict = DictData::where('type_value','cost_consultation_way')->column('value'); if(!in_array($value,$dict)){ return '实施方式数据值无效'; } return true; } public function checkSealName($value): bool|string { $dict = DictData::where('type_value','cost_consultation_seal_name')->column('value'); if(!in_array($value,$dict)){ return '盖章名称数据值无效'; } return true; } public function checkFileType($value): bool|string { $dict = DictData::where('type_value','cost_consultation_file_type')->column('value'); if(!in_array($value,$dict)){ return '文件类型数据值无效'; } return true; } public function checkAnnex($value): bool|string { if(!empty($value) && $value != ''){ if(!is_array($value)){ return '附件格式错误'; } } return true; } }