From b7de3bf8765b09b94cbfaa53189b80c85961ee74 Mon Sep 17 00:00:00 2001
From: weiz <736250432@qq.com>
Date: Tue, 30 Jan 2024 09:53:56 +0800
Subject: [PATCH] update

---
 .../lists/custom/CustomContactsLists.php      | 36 ++++++++++++++-
 .../lists/custom/CustomFollowLists.php        | 40 ++++++++++++++++-
 app/adminapi/lists/custom/CustomLists.php     | 38 +++++++++++++++-
 .../lists/custom/CustomServiceLists.php       | 45 +++++++++++++++++--
 .../lists/custom/CustomerDemandLists.php      | 35 ++++++++++++++-
 .../custom/CustomerDemandSolutionLists.php    | 36 ++++++++++++++-
 6 files changed, 220 insertions(+), 10 deletions(-)

diff --git a/app/adminapi/lists/custom/CustomContactsLists.php b/app/adminapi/lists/custom/CustomContactsLists.php
index ef37299d0..43d80ba81 100644
--- a/app/adminapi/lists/custom/CustomContactsLists.php
+++ b/app/adminapi/lists/custom/CustomContactsLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 use app\adminapi\lists\BaseAdminDataLists;
+use app\common\lists\ListsExcelInterface;
 use app\common\model\custom\Custom;
 use app\common\model\custom\CustomContacts;
 use app\common\lists\ListsSearchInterface;
@@ -28,7 +29,7 @@ use app\common\model\dept\Orgs;
  * Class CustomContactsLists
  * @package app\adminapi\listscustom
  */
-class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -97,5 +98,38 @@ class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInter
 	    }
         return CustomContacts::where($this->searchWhere)->where($where)->count();
     }
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setFileName(): string
+	{
+		return '客户联系人列表';
+	}
+	
+	/**
+	 * @notes 导出字段
+	 * @return string[]
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setExcelFields(): array
+	{
+		return [
+			'id' => 'id',
+			'org_name' => '组织',
+			'dept_name' => '部门',
+			'custom_name' => '客户名称',
+			'name' => '姓名',
+			'position' => '职务',
+			'phone' => '手机',
+			'telephone' => '电话',
+			'email' => '邮箱',
+			'notes' => '备注',
+		];
+	}
 
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/custom/CustomFollowLists.php b/app/adminapi/lists/custom/CustomFollowLists.php
index 7854efc19..2b362212b 100644
--- a/app/adminapi/lists/custom/CustomFollowLists.php
+++ b/app/adminapi/lists/custom/CustomFollowLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 use app\adminapi\lists\BaseAdminDataLists;
+use app\common\lists\ListsExcelInterface;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\auth\Admin;
 use app\common\model\custom\Custom;
@@ -27,7 +28,7 @@ use app\common\model\custom\CustomFollow;
  * Class CustomFollowLists
  * @package app\adminapi\listscustom_follow
  */
-class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -67,7 +68,7 @@ class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterfa
 		    $custom_ids = Custom::where('custom_name','like','%'.$params['contacts'].'%')->column('id');
 		    $where[] = ['custom_id','in',$custom_ids];
 	    }
-        return CustomFollow::field('id,custom_id,name,date,types,executor,description,coordinate,next_follow_date,add_user,update_user,create_time,update_time')
+        return CustomFollow::field('id,custom_id,name,date,types,executor,description,annex,coordinate,next_follow_date,add_user,update_user,create_time,update_time')
 	        ->where($this->searchWhere)->where($where)
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
@@ -105,5 +106,40 @@ class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterfa
 	    }
         return CustomFollow::where($this->searchWhere)->where($where)->count();
     }
+	
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setFileName(): string
+	{
+		return '客户跟进记录列表';
+	}
+	
+	/**
+	 * @notes 导出字段
+	 * @return string[]
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setExcelFields(): array
+	{
+		return [
+			'id' => 'id',
+			'name' => '跟进主题',
+			'custom_name' => '客户名称',
+			'custom_master_name' => '联系人',
+			'date' => '日期',
+			'types' => '类型',
+			'executor' => '执行人',
+			'description' => '行动描述',
+			'annex' => '附件/现场照片',
+			'coordinate' => '位置',
+			'next_follow_date' => '下次回访日期',
+		];
+	}
 
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/custom/CustomLists.php b/app/adminapi/lists/custom/CustomLists.php
index b071628d1..8af944ea0 100644
--- a/app/adminapi/lists/custom/CustomLists.php
+++ b/app/adminapi/lists/custom/CustomLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 use app\adminapi\lists\BaseAdminDataLists;
+use app\common\lists\ListsExcelInterface;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\auth\Admin;
 use app\common\model\custom\Custom;
@@ -29,7 +30,7 @@ use app\common\model\GeoProvince;
  * Class CustomLists
  * @package app\adminapi\listscustom
  */
-class CustomLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -93,5 +94,40 @@ class CustomLists extends BaseAdminDataLists implements ListsSearchInterface
     {
         return Custom::where($this->searchWhere)->count();
     }
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setFileName(): string
+	{
+		return '客户列表';
+	}
+	
+	/**
+	 * @notes 导出字段
+	 * @return string[]
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	public function setExcelFields(): array
+	{
+		return [
+			'id' => 'id',
+			'name' => '客户名称',
+			'custom_type' => '客户属性',
+			'province_name' => '所在省',
+			'master_name' => '负责人姓名',
+			'master_position' => '负责人职务',
+			'master_telephone' => '负责人电话',
+			'master_phone' => '负责人手机',
+			'follow_total' => '跟进记录',
+			'last_follow_date' => '最后跟进',
+			'next_follow_date' => '下次回访日期',
+			'create_time' => '创建时间',
+		];
+	}
 
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/custom/CustomServiceLists.php b/app/adminapi/lists/custom/CustomServiceLists.php
index e7291acf1..18477fd88 100644
--- a/app/adminapi/lists/custom/CustomServiceLists.php
+++ b/app/adminapi/lists/custom/CustomServiceLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 use app\adminapi\lists\BaseAdminDataLists;
+use app\common\lists\ListsExcelInterface;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\auth\Admin;
 use app\common\model\contract\Contract;
@@ -28,7 +29,7 @@ use app\common\model\project\Project;
  * Class CustomServiceLists
  * @package app\adminapi\listscustom_service
  */
-class CustomServiceLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomServiceLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -100,7 +101,6 @@ class CustomServiceLists extends BaseAdminDataLists implements ListsSearchInterf
 	           ->toArray();
     }
 
-
     /**
      * @notes 获取数量
      * @return int
@@ -130,5 +130,44 @@ class CustomServiceLists extends BaseAdminDataLists implements ListsSearchInterf
 	    }
         return CustomService::where($this->searchWhere)->where($where)->count();
     }
-
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	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_name' => '项目名称',
+			'project_code' => '项目编码',
+			'contract_code' => '合同编号',
+			'name' => '投诉主题',
+			'date' => '日期',
+			'receiver' => '接待人',
+			'classification' => '分类',
+			'custom_master_name' => '投诉人',
+			'custom_master_phone' => '联系电话',
+			'processing_result' => '处理结果',
+			'urgency' => '紧急程度',
+			'processed_user' => '指定处理人',
+			'is_solve_text' => '问题是否解决',
+			'done_date' => '完成日期',
+			'score' => '评分',
+		];
+	}
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/custom/CustomerDemandLists.php b/app/adminapi/lists/custom/CustomerDemandLists.php
index 4788cbff8..68d88217f 100644
--- a/app/adminapi/lists/custom/CustomerDemandLists.php
+++ b/app/adminapi/lists/custom/CustomerDemandLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 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\lists\ListsSearchInterface;
@@ -29,7 +30,7 @@ use app\common\model\project\Project;
  * Class CustomerDemandLists
  * @package app\adminapi\listscustom
  */
-class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -107,5 +108,37 @@ class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInter
 	    }
         return CustomerDemand::where($this->searchWhere)->where($where)->count();
     }
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	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' => '客户名称',
+			'theme' => '需求主题',
+			'supplier' => '需求提供人',
+			'supplier_contacts' => '提供人联系方式',
+			'importance_text' => '重要程度',
+			'recording_time' => '记录时间',
+			'demand_content' => '需求内容',
+		];
+	}
 
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/custom/CustomerDemandSolutionLists.php b/app/adminapi/lists/custom/CustomerDemandSolutionLists.php
index b092830ce..aa0761dff 100644
--- a/app/adminapi/lists/custom/CustomerDemandSolutionLists.php
+++ b/app/adminapi/lists/custom/CustomerDemandSolutionLists.php
@@ -16,6 +16,7 @@ namespace app\adminapi\lists\custom;
 
 
 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\custom\CustomerDemandSolution;
@@ -28,7 +29,7 @@ use app\common\model\project\Project;
  * Class CustomerDemandSolutionLists
  * @package app\adminapi\listscustom
  */
-class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSearchInterface
+class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
 {
 
 
@@ -115,5 +116,36 @@ class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSea
 	    }
         return CustomerDemandSolution::where($this->searchWhere)->where($where)->count();
     }
-
+	
+	/**
+	 * @notes 导出文件名
+	 * @return string
+	 * @author 段誉
+	 * @date 2022/11/24 16:17
+	 */
+	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' => '需求名称',
+			'theme' => '解决方案主题',
+			'submission_time' => '提交时间',
+			'solution_content' => '方案内容',
+			'customer_feedback' => '客户反馈',
+			'annex' => '附件',
+		];
+	}
 }
\ No newline at end of file