diff --git a/app/adminapi/lists/project/CompetitorLists.php b/app/adminapi/lists/project/CompetitorLists.php index b2cf034c7..7f0f17687 100644 --- a/app/adminapi/lists/project/CompetitorLists.php +++ b/app/adminapi/lists/project/CompetitorLists.php @@ -16,6 +16,7 @@ namespace app\adminapi\lists\project; use app\adminapi\lists\BaseAdminDataLists; +use app\common\lists\ListsExcelInterface; use app\common\model\custom\Custom; use app\common\model\custom\CustomerDemand; use app\common\model\project\Competitor; @@ -28,7 +29,7 @@ use app\common\model\project\Project; * Class CompetitorLists * @package app\adminapi\listsproject */ -class CompetitorLists extends BaseAdminDataLists implements ListsSearchInterface +class CompetitorLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -115,5 +116,29 @@ class CompetitorLists extends BaseAdminDataLists implements ListsSearchInterface } return Competitor::where($this->searchWhere)->where($where)->count(); } - + + public function setFileName(): string + { + return '竞争对手列表'; + } + + /** + * @notes 导出字段 + * @return string[] + * @author 段誉 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + return [ + 'id' => 'id', + 'project_name' => '项目名称', + 'custom_name' => '客户名称', + 'customer_demand_name' => '客户需求', + 'competitor_name' => '竞争对手名称', + 'competitor_contacts' => '竞争对手联系人', + 'competitor_contacts_phone' => '联系人电话', + 'competitive_power' => '竞争能力', + ]; + } } \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectEstimateLists.php b/app/adminapi/lists/project/ProjectEstimateLists.php index b61349ce5..a2cb3180c 100644 --- a/app/adminapi/lists/project/ProjectEstimateLists.php +++ b/app/adminapi/lists/project/ProjectEstimateLists.php @@ -16,6 +16,7 @@ namespace app\adminapi\lists\project; use app\adminapi\lists\BaseAdminDataLists; +use app\common\lists\ListsExcelInterface; use app\common\model\auth\Admin; use app\common\model\custom\Custom; use app\common\model\custom\CustomContacts; @@ -30,7 +31,7 @@ use app\common\lists\ListsSearchInterface; * Class ProjectEstimateLists * @package app\adminapi\listsproject */ -class ProjectEstimateLists extends BaseAdminDataLists implements ListsSearchInterface +class ProjectEstimateLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -152,5 +153,32 @@ class ProjectEstimateLists extends BaseAdminDataLists implements ListsSearchInte } return ProjectEstimate::where($this->searchWhere)->where($where)->count(); } + + public function setFileName(): string + { + return '项目概算列表'; + } + + /** + * @notes 导出字段 + * @return string[] + * @author 段誉 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + return [ + 'id' => 'id', + 'project_name' => '项目名称', + 'custom_name' => '客户名称', + 'customer_demand_name' => '需求', + 'estimate_source_text' => '概算来源', + 'create_user' => '制单人', + 'quotation_date' => '报价日期', + 'invoice_type_text' => '发票类型', + 'technician_name' => '技术人员', + 'estimate_amount' => '概算金额', + ]; + } } \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectFollowUpLists.php b/app/adminapi/lists/project/ProjectFollowUpLists.php index 2fa4319b4..05fba3ef1 100644 --- a/app/adminapi/lists/project/ProjectFollowUpLists.php +++ b/app/adminapi/lists/project/ProjectFollowUpLists.php @@ -16,6 +16,7 @@ namespace app\adminapi\lists\project; use app\adminapi\lists\BaseAdminDataLists; +use app\common\lists\ListsExcelInterface; use app\common\model\auth\Admin; use app\common\model\custom\Custom; use app\common\model\project\Project; @@ -28,7 +29,7 @@ use app\common\lists\ListsSearchInterface; * Class ProjectFollowUpLists * @package app\adminapi\listsproject */ -class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInterface +class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -109,5 +110,33 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte } return ProjectFollowUp::where($this->searchWhere)->where($where)->count(); } + + public function setFileName(): string + { + return '项目跟进列表'; + } + + /** + * @notes 导出字段 + * @return string[] + * @author 段誉 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + return [ + 'id' => 'id', + 'project_name' => '项目名称', + 'custom_name' => '客户名称', + 'executor' => '执行人', + 'follow_date' => '日期', + 'follow_type_text' => '类型', + 'theme' => '主题', + 'project_assurance_text' => '项目把握度', + 'follow_status_text' => '状态', + 'follow_stage_text' => '阶段', + 'next_follow_up_date' => '下次回访日期', + ]; + } } \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectLists.php b/app/adminapi/lists/project/ProjectLists.php index 7ec0bb323..fb9a5540f 100644 --- a/app/adminapi/lists/project/ProjectLists.php +++ b/app/adminapi/lists/project/ProjectLists.php @@ -16,6 +16,7 @@ namespace app\adminapi\lists\project; use app\adminapi\lists\BaseAdminDataLists; +use app\common\lists\ListsExcelInterface; use app\common\model\custom\Custom; use app\common\model\dept\Dept; use app\common\model\dept\Orgs; @@ -29,7 +30,7 @@ use app\common\model\project\ProjectTypeSet; * Class ProjectLists * @package app\adminapi\listsproject */ -class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface +class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -95,8 +96,7 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface }) ->toArray(); } - - + /** * @notes 获取数量 * @return int @@ -113,5 +113,35 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface } return Project::where($this->searchWhere)->where($condition)->count(); } + + public function setFileName(): string + { + return '项目列表'; + } + + /** + * @notes 导出字段 + * @return string[] + * @author 段誉 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + return [ + 'id' => 'id', + 'custom_name' => '客户名称', + 'project_code' => '项目编码', + 'name' => '项目名称', + 'status' => '项目状态', + 'project_address' => '项目所在地', + 'project_type' => '项目类型', + 'strategic_significance' => '战略意义', + 'industry' => '所属行业', + 'unit_nature' => '单位性质', + 'bidding_method' => '招标方式', + 'information_sources' => '信息来源', + 'person' => '负责人', + ]; + } } \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectPreSalesMembersLists.php b/app/adminapi/lists/project/ProjectPreSalesMembersLists.php index 7a245ccdb..d153ddc2e 100644 --- a/app/adminapi/lists/project/ProjectPreSalesMembersLists.php +++ b/app/adminapi/lists/project/ProjectPreSalesMembersLists.php @@ -16,6 +16,7 @@ namespace app\adminapi\lists\project; use app\adminapi\lists\BaseAdminDataLists; +use app\common\lists\ListsExcelInterface; use app\common\model\auth\Admin; use app\common\model\custom\Custom; use app\common\model\project\Project; @@ -28,7 +29,7 @@ use app\common\lists\ListsSearchInterface; * Class ProjectPreSalesMembersLists * @package app\adminapi\listsproject */ -class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSearchInterface +class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -112,5 +113,28 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea } return ProjectPreSalesMembers::where($this->searchWhere)->where($where)->count(); } + + public function setFileName(): string + { + return '售前成员列表'; + } + + /** + * @notes 导出字段 + * @return string[] + * @author 段誉 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + return [ + 'id' => 'id', + 'project_name' => '项目名称', + 'technician' => '技术人员', + 'business_people' => '商务人员', + 'cross_departmental_personnel' => '跨部门人员', + 'add_user' => '添加人', + ]; + } } \ No newline at end of file diff --git a/app/common/model/project/Project.php b/app/common/model/project/Project.php index 3d4ce5457..9717d23ff 100644 --- a/app/common/model/project/Project.php +++ b/app/common/model/project/Project.php @@ -34,7 +34,7 @@ class Project extends BaseModel public function getStatusTextAttr($value,$data) { $dictData = DictData::where('type_value','project_status')->column('name','value'); - return !empty($data['status']) ? $dictData[$data['status']] : ''; + return $dictData[$data['status']]; } public function getProjectContentTextAttr($value,$data)