CRM提交更新

This commit is contained in:
2025-03-12 21:14:46 +08:00
parent 6fbac23101
commit 0ce49d1504
52 changed files with 2918 additions and 179 deletions

View File

@@ -42,7 +42,6 @@ public class EmployeeFilesController extends BaseController {
/**
* 查询文件档案管理列表
*/
@SaCheckPermission("oa:files:list")
@GetMapping("/list")
public TableDataInfo<FileUser> list(EmployeeFilesBo bo, PageQuery pageQuery) {
return iEmployeeFilesService.queryPageList(bo, pageQuery);
@@ -53,7 +52,6 @@ public class EmployeeFilesController extends BaseController {
*
* @param userId 主键
*/
@SaCheckPermission("oa:files:query")
@GetMapping("/{userId}")
public R<UserFilesVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("userId") Long userId) {
@@ -63,7 +61,6 @@ public class EmployeeFilesController extends BaseController {
/**
* 新增文件档案管理
*/
@SaCheckPermission("oa:files:add")
@Log(title = "文件档案管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()

View File

@@ -42,7 +42,6 @@ public class EmployeeOffboardingController extends BaseController {
/**
* 查询离职管理列表
*/
@SaCheckPermission("system:offboarding:list")
@GetMapping("/list")
public TableDataInfo<EmployeeOffboardingVo> list(EmployeeOffboardingBo bo, PageQuery pageQuery) {
return iEmployeeOffboardingService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class EmployeeOffboardingController extends BaseController {
/**
* 导出离职管理列表
*/
@SaCheckPermission("system:offboarding:export")
@Log(title = "离职管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(EmployeeOffboardingBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class EmployeeOffboardingController extends BaseController {
*
* @param offboardingId 主键
*/
@SaCheckPermission("system:offboarding:query")
@GetMapping("/{offboardingId}")
public R<EmployeeOffboardingVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long offboardingId) {
@@ -74,7 +71,6 @@ public class EmployeeOffboardingController extends BaseController {
/**
* 新增离职管理
*/
@SaCheckPermission("system:offboarding:add")
@Log(title = "离职管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,6 @@ public class EmployeeOffboardingController extends BaseController {
/**
* 修改离职管理
*/
@SaCheckPermission("system:offboarding:edit")
@Log(title = "离职管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +93,6 @@ public class EmployeeOffboardingController extends BaseController {
*
* @param offboardingIds 主键串
*/
@SaCheckPermission("system:offboarding:remove")
@Log(title = "离职管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{offboardingIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -43,7 +43,6 @@ public class EmployeeOnboardingController extends BaseController {
/**
* 查询入职管理列表
*/
@SaCheckPermission("system:onboarding:list")
@GetMapping("/list")
public TableDataInfo<EmployeeOnboardingVo> list(EmployeeOnboardingBo bo, PageQuery pageQuery) {
return iEmployeeOnboardingService.queryPageList(bo, pageQuery);
@@ -52,7 +51,6 @@ public class EmployeeOnboardingController extends BaseController {
/**
* 导出入职管理列表
*/
@SaCheckPermission("system:onboarding:export")
@Log(title = "入职管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(EmployeeOnboardingBo bo, HttpServletResponse response) {
@@ -65,7 +63,6 @@ public class EmployeeOnboardingController extends BaseController {
*
* @param userId 主键
*/
@SaCheckPermission("system:onboarding:query")
@GetMapping("/{userId}")
public R<EmployeeOnboardingVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long userId) {
@@ -75,7 +72,6 @@ public class EmployeeOnboardingController extends BaseController {
/**
* 新增入职管理
*/
@SaCheckPermission("system:onboarding:add")
@Log(title = "入职管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -86,7 +82,6 @@ public class EmployeeOnboardingController extends BaseController {
/**
* 修改入职管理
*/
@SaCheckPermission("system:onboarding:edit")
@Log(title = "入职管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -99,7 +94,6 @@ public class EmployeeOnboardingController extends BaseController {
*
* @param onboardingIds 主键串
*/
@SaCheckPermission("system:onboarding:remove")
@Log(title = "入职管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{onboardingIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -43,16 +43,22 @@ public class OaBusinessController extends BaseController {
/**
* 查询CRM 商机列表
*/
@SaCheckPermission("oa:business:list")
@GetMapping("/list")
public TableDataInfo<OaBusinessVo> list(OaBusinessBo bo, PageQuery pageQuery) {
return iOaBusinessService.queryPageList(bo, pageQuery);
}
/**
* 查询CRM 商机列表
*/
@GetMapping("/listByCustomer")
public TableDataInfo<OaBusinessVo> listByCustomer(OaBusinessBo bo, PageQuery pageQuery) {
return iOaBusinessService.queryPageList(bo, pageQuery);
}
/**
* 导出CRM 商机列表
*/
@SaCheckPermission("oa:business:export")
@Log(title = "CRM 商机", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaBusinessBo bo, HttpServletResponse response) {
@@ -65,7 +71,6 @@ public class OaBusinessController extends BaseController {
*
* @param businessId 主键
*/
@SaCheckPermission("oa:business:query")
@GetMapping("/{businessId}")
public R<OaBusinessVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long businessId) {
@@ -75,7 +80,6 @@ public class OaBusinessController extends BaseController {
/**
* 新增CRM 商机
*/
@SaCheckPermission("oa:business:add")
@Log(title = "CRM 商机", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -86,7 +90,6 @@ public class OaBusinessController extends BaseController {
/**
* 修改CRM 商机
*/
@SaCheckPermission("oa:business:edit")
@Log(title = "CRM 商机", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -99,7 +102,6 @@ public class OaBusinessController extends BaseController {
*
* @param businessIds 主键串
*/
@SaCheckPermission("oa:business:remove")
@Log(title = "CRM 商机", businessType = BusinessType.DELETE)
@DeleteMapping("/{businessIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@@ -111,7 +113,6 @@ public class OaBusinessController extends BaseController {
/**
* 联查商机与产品以及其关联表
*/
@SaCheckPermission("oa:business:query")
@GetMapping("/BusinessProducts")
public TableDataInfo<OaProductVo> getBusinessProducts(OaBusinessBo bo) {
return iOaBusinessService.getBusinessProducts(bo);

View File

@@ -42,7 +42,6 @@ public class OaBusinessProductController extends BaseController {
/**
* 查询CRM 商机产品关联列表
*/
@SaCheckPermission("oa:businessProduct:list")
@GetMapping("/list")
public TableDataInfo<OaBusinessProductVo> list(OaBusinessProductBo bo, PageQuery pageQuery) {
return iOaBusinessProductService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class OaBusinessProductController extends BaseController {
/**
* 导出CRM 商机产品关联列表
*/
@SaCheckPermission("oa:businessProduct:export")
@Log(title = "CRM 商机产品关联", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaBusinessProductBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class OaBusinessProductController extends BaseController {
*
* @param businessProductId 主键
*/
@SaCheckPermission("oa:businessProduct:query")
@GetMapping("/{businessProductId}")
public R<OaBusinessProductVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long businessProductId) {
@@ -74,7 +71,6 @@ public class OaBusinessProductController extends BaseController {
/**
* 新增CRM 商机产品关联
*/
@SaCheckPermission("oa:businessProduct:add")
@Log(title = "CRM 商机产品关联", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,6 @@ public class OaBusinessProductController extends BaseController {
/**
* 修改CRM 商机产品关联
*/
@SaCheckPermission("oa:businessProduct:edit")
@Log(title = "CRM 商机产品关联", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +93,6 @@ public class OaBusinessProductController extends BaseController {
*
* @param businessProductIds 主键串
*/
@SaCheckPermission("oa:businessProduct:remove")
@Log(title = "CRM 商机产品关联", businessType = BusinessType.DELETE)
@DeleteMapping("/{businessProductIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,16 +42,14 @@ public class OaClueController extends BaseController {
/**
* 查询CRM 线索列表
*/
@SaCheckPermission("oa:clue:list")
@GetMapping("/list")
public TableDataInfo<OaClueVo> list(OaClueBo bo, PageQuery pageQuery) {
return iOaClueService.queryPageList(bo, pageQuery);
return iOaClueService.queryPageListVo(bo, pageQuery);
}
/**
* 导出CRM 线索列表
*/
@SaCheckPermission("oa:clue:export")
@Log(title = "CRM 线索", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaClueBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class OaClueController extends BaseController {
*
* @param clueId 主键
*/
@SaCheckPermission("oa:clue:query")
@GetMapping("/{clueId}")
public R<OaClueVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long clueId) {
@@ -74,7 +71,6 @@ public class OaClueController extends BaseController {
/**
* 新增CRM 线索
*/
@SaCheckPermission("oa:clue:add")
@Log(title = "CRM 线索", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,6 @@ public class OaClueController extends BaseController {
/**
* 修改CRM 线索
*/
@SaCheckPermission("oa:clue:edit")
@Log(title = "CRM 线索", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +93,6 @@ public class OaClueController extends BaseController {
*
* @param clueIds 主键串
*/
@SaCheckPermission("oa:clue:remove")
@Log(title = "CRM 线索", businessType = BusinessType.DELETE)
@DeleteMapping("/{clueIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,16 +42,22 @@ public class OaCustomerController extends BaseController {
/**
* 查询CRM 客户列表
*/
@SaCheckPermission("oa:customer:list")
@GetMapping("/list")
public TableDataInfo<OaCustomerVo> list(OaCustomerBo bo, PageQuery pageQuery) {
return iOaCustomerService.queryPageList(bo, pageQuery);
return iOaCustomerService.queryPageListToUser(bo, pageQuery);
}
/**
* 查询CRM 客户列表
*/
@GetMapping("/list-sea")
public TableDataInfo<OaCustomerVo> seaList(OaCustomerBo bo, PageQuery pageQuery) {
return iOaCustomerService.queryPageListToSea(bo, pageQuery);
}
/**
* 导出CRM 客户列表
*/
@SaCheckPermission("oa:customer:export")
@Log(title = "CRM 客户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaCustomerBo bo, HttpServletResponse response) {
@@ -64,7 +70,6 @@ public class OaCustomerController extends BaseController {
*
* @param customerId 主键
*/
@SaCheckPermission("oa:customer:query")
@GetMapping("/{customerId}")
public R<OaCustomerVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long customerId) {
@@ -74,7 +79,6 @@ public class OaCustomerController extends BaseController {
/**
* 新增CRM 客户
*/
@SaCheckPermission("oa:customer:add")
@Log(title = "CRM 客户", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +89,7 @@ public class OaCustomerController extends BaseController {
/**
* 修改CRM 客户
*/
@SaCheckPermission("oa:customer:edit")
@Log(title = "CRM 客户", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +102,7 @@ public class OaCustomerController extends BaseController {
*
* @param customerIds 主键串
*/
@SaCheckPermission("oa:customer:remove")
@Log(title = "CRM 客户", businessType = BusinessType.DELETE)
@DeleteMapping("/{customerIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -1,9 +1,12 @@
package com.ruoyi.oa.controller;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import com.ruoyi.oa.service.IOaBusinessProductService;
import com.ruoyi.oa.service.IOaBusinessService;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
@@ -34,15 +37,17 @@ import com.ruoyi.common.core.page.TableDataInfo;
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/followUpRecord")
@RequestMapping("/oa/followUpRecord")
public class OaFollowUpRecordController extends BaseController {
private final IOaFollowUpRecordService iOaFollowUpRecordService;
private final IOaBusinessService iOaBusinessService;
/**
* 查询CRM 跟进记录列表
*/
@SaCheckPermission("system:followUpRecord:list")
@GetMapping("/list")
public TableDataInfo<OaFollowUpRecordVo> list(OaFollowUpRecordBo bo, PageQuery pageQuery) {
return iOaFollowUpRecordService.queryPageList(bo, pageQuery);
@@ -51,7 +56,6 @@ public class OaFollowUpRecordController extends BaseController {
/**
* 导出CRM 跟进记录列表
*/
@SaCheckPermission("system:followUpRecord:export")
@Log(title = "CRM 跟进记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaFollowUpRecordBo bo, HttpServletResponse response) {
@@ -64,17 +68,26 @@ public class OaFollowUpRecordController extends BaseController {
*
* @param followId 主键
*/
@SaCheckPermission("system:followUpRecord:query")
@GetMapping("/{followId}")
public R<OaFollowUpRecordVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long followId) {
return R.ok(iOaFollowUpRecordService.queryById(followId));
}
/**
* CRM 商机
*
* @param businessIds 主键串
*/
@GetMapping("/listByIds/{businessIds}")
public R<List<OaFollowUpRecordVo>> selectByBusinessIds(
@PathVariable("businessIds") Long[] businessIds) {
return R.ok(iOaFollowUpRecordService.selectByBusinessIds(Arrays.asList(businessIds)));
}
/**
* 新增CRM 跟进记录
*/
@SaCheckPermission("system:followUpRecord:add")
@Log(title = "CRM 跟进记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +98,6 @@ public class OaFollowUpRecordController extends BaseController {
/**
* 修改CRM 跟进记录
*/
@SaCheckPermission("system:followUpRecord:edit")
@Log(title = "CRM 跟进记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +110,6 @@ public class OaFollowUpRecordController extends BaseController {
*
* @param followIds 主键串
*/
@SaCheckPermission("system:followUpRecord:remove")
@Log(title = "CRM 跟进记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{followIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,7 +42,6 @@ public class OaProductController extends BaseController {
/**
* 查询CRM 产品列表
*/
@SaCheckPermission("oa:product:list")
@GetMapping("/list")
public TableDataInfo<OaProductVo> list(OaProductBo bo, PageQuery pageQuery) {
return iOaProductService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class OaProductController extends BaseController {
/**
* 导出CRM 产品列表
*/
@SaCheckPermission("oa:product:export")
@Log(title = "CRM 产品", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaProductBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class OaProductController extends BaseController {
*
* @param productId 主键
*/
@SaCheckPermission("oa:product:query")
@GetMapping("/{productId}")
public R<OaProductVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long productId) {
@@ -74,7 +71,6 @@ public class OaProductController extends BaseController {
/**
* 新增CRM 产品
*/
@SaCheckPermission("oa:product:add")
@Log(title = "CRM 产品", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,6 @@ public class OaProductController extends BaseController {
/**
* 修改CRM 产品
*/
@SaCheckPermission("oa:product:edit")
@Log(title = "CRM 产品", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +93,6 @@ public class OaProductController extends BaseController {
*
* @param productIds 主键串
*/
@SaCheckPermission("oa:product:remove")
@Log(title = "CRM 产品", businessType = BusinessType.DELETE)
@DeleteMapping("/{productIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,7 +42,6 @@ public class OaSalaryController extends BaseController {
/**
* 查询薪资管理列表
*/
@SaCheckPermission("oa:salary:list")
@GetMapping("/list-staff")
public TableDataInfo<OaSalaryVo> list(OaSalaryBo bo, PageQuery pageQuery) {
return iOaSalaryService.queryPageList(bo, pageQuery);
@@ -50,7 +49,6 @@ public class OaSalaryController extends BaseController {
/**
* 查询薪资管理列表
*/
@SaCheckPermission("oa:salary:list")
@GetMapping("/list-worker")
public TableDataInfo<OaSalaryVo> listWorker(OaSalaryBo bo, PageQuery pageQuery) {
return iOaSalaryService.listWorker(bo, pageQuery);
@@ -67,7 +65,6 @@ public class OaSalaryController extends BaseController {
/**
* 导出薪资管理列表
*/
@SaCheckPermission("oa:salary:export")
@Log(title = "薪资管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaSalaryBo bo, HttpServletResponse response) {
@@ -79,7 +76,6 @@ public class OaSalaryController extends BaseController {
* 获取薪资管理详细信息
*
*/
@SaCheckPermission("oa:salary:query")
@GetMapping("/detail")
public R<OaSalaryVo> getInfo(@RequestBody OaSalaryBo bo) {
return R.ok(iOaSalaryService.queryById(bo.getSalaryId(),bo.getPayTime()));
@@ -88,7 +84,6 @@ public class OaSalaryController extends BaseController {
/**
* 新增薪资管理
*/
@SaCheckPermission("oa:salary:add")
@Log(title = "薪资管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -99,7 +94,6 @@ public class OaSalaryController extends BaseController {
/**
* 修改薪资管理
*/
@SaCheckPermission("oa:salary:edit")
@Log(title = "薪资管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -112,7 +106,6 @@ public class OaSalaryController extends BaseController {
*
* @param salaryIds 主键串
*/
@SaCheckPermission("oa:salary:remove")
@Log(title = "薪资管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{salaryIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,7 +42,6 @@ public class OaSalaryItemController extends BaseController {
/**
* 查询薪水详情列表
*/
@SaCheckPermission("oa:salaryItem:list")
@GetMapping("/list")
public TableDataInfo<OaSalaryItemVo> list(OaSalaryItemBo bo, PageQuery pageQuery) {
return iOaSalaryItemService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class OaSalaryItemController extends BaseController {
/**
* 导出薪水详情列表
*/
@SaCheckPermission("oa:salaryItem:export")
@Log(title = "薪水详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(OaSalaryItemBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class OaSalaryItemController extends BaseController {
*
* @param salaryItemId 主键
*/
@SaCheckPermission("oa:salaryItem:query")
@GetMapping("/{salaryItemId}")
public R<OaSalaryItemVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long salaryItemId) {
@@ -74,7 +71,6 @@ public class OaSalaryItemController extends BaseController {
/**
* 新增薪水详情
*/
@SaCheckPermission("oa:salaryItem:add")
@Log(title = "薪水详情", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,7 @@ public class OaSalaryItemController extends BaseController {
/**
* 修改薪水详情
*/
@SaCheckPermission("oa:salaryItem:edit")
@Log(title = "薪水详情", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +94,6 @@ public class OaSalaryItemController extends BaseController {
*
* @param salaryItemIds 主键串
*/
@SaCheckPermission("oa:salaryItem:remove")
@Log(title = "薪水详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{salaryItemIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -46,7 +46,6 @@ public class SysOaCostController extends BaseController {
/**
* 查询项目成本分析列表
*/
@SaCheckPermission("oa:oaCost:list")
@GetMapping("/list1")
public TableDataInfo<SysOaCostVo> list1(SysOaCostBo bo, PageQuery pageQuery) {
return iSysOaCostService.queryPageList(bo, pageQuery);
@@ -55,7 +54,6 @@ public class SysOaCostController extends BaseController {
/**
* 导出项目成本分析列表
*/
@SaCheckPermission("oa:oaCost:export")
@Log(title = "项目成本分析", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(SysOaCostBo bo, HttpServletResponse response) {
@@ -68,7 +66,6 @@ public class SysOaCostController extends BaseController {
*
* @param costId 主键
*/
@SaCheckPermission("oa:oaCost:query")
@GetMapping("/old/{costId}")
public R<SysOaCostVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long costId) {
@@ -78,7 +75,6 @@ public class SysOaCostController extends BaseController {
/**
* 新增项目成本分析
*/
@SaCheckPermission("oa:oaCost:add")
@Log(title = "项目成本分析", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -89,7 +85,6 @@ public class SysOaCostController extends BaseController {
/**
* 修改项目成本分析
*/
@SaCheckPermission("oa:oaCost:edit")
@Log(title = "项目成本分析", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -111,7 +106,6 @@ public class SysOaCostController extends BaseController {
/**
* 查询所有项目成本
*/
@SaCheckPermission("oa:oaCost:list")
@GetMapping("/list")
public TableDataInfo<SysOaCostAllVo> AllList(SysOaCostBo bo,PageQuery pageQuery) {
return iSysOaCostService.calcProjectCostList(bo,pageQuery);
@@ -123,7 +117,6 @@ public class SysOaCostController extends BaseController {
/**
* 查询详情
*/
@SaCheckPermission("oa:oaCost:query")
@GetMapping("/{projectId}")
public R<SysOaCostRow> getDetail(@NotNull(message = "项目id不能为空")
@PathVariable Long projectId) {
@@ -133,7 +126,6 @@ public class SysOaCostController extends BaseController {
/**
* 新增成本
*/
@SaCheckPermission("oa:oaCost:add")
@Log(title = "项目成本分析", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/add")
@@ -146,7 +138,6 @@ public class SysOaCostController extends BaseController {
*
* @param ids 主键串
*/
@SaCheckPermission("oa:cost:remove")
@Log(title = "项目成本分析", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -42,7 +42,6 @@ public class SysOaFileController extends BaseController {
/**
* 查询文件存储列表
*/
@SaCheckPermission("system:oaFile:list")
@GetMapping("/list")
public TableDataInfo<SysOaFileVo> list(SysOaFileBo bo, PageQuery pageQuery) {
return iSysOaFileService.queryPageList(bo, pageQuery);
@@ -51,7 +50,6 @@ public class SysOaFileController extends BaseController {
/**
* 导出文件存储列表
*/
@SaCheckPermission("system:oaFile:export")
@Log(title = "文件存储", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(SysOaFileBo bo, HttpServletResponse response) {
@@ -64,7 +62,6 @@ public class SysOaFileController extends BaseController {
*
* @param fileId 主键
*/
@SaCheckPermission("system:oaFile:query")
@GetMapping("/{fileId}")
public R<SysOaFileVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long fileId) {
@@ -74,7 +71,6 @@ public class SysOaFileController extends BaseController {
/**
* 新增文件存储
*/
@SaCheckPermission("system:oaFile:add")
@Log(title = "文件存储", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
@@ -85,7 +81,6 @@ public class SysOaFileController extends BaseController {
/**
* 修改文件存储
*/
@SaCheckPermission("system:oaFile:edit")
@Log(title = "文件存储", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -98,7 +93,6 @@ public class SysOaFileController extends BaseController {
*
* @param fileIds 主键串
*/
@SaCheckPermission("system:oaFile:remove")
@Log(title = "文件存储", businessType = BusinessType.DELETE)
@DeleteMapping("/{fileIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -63,6 +63,6 @@ public class OaProduct extends BaseEntity {
/**
* 是否删除
*/
private Long deleted;
private Long delFlag;
}

View File

@@ -25,43 +25,36 @@ public class OaBusinessProductBo extends BaseEntity {
/**
* 主键
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long businessProductId;
/**
* 商机编号
*/
@NotNull(message = "商机编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long businessId;
/**
* 产品编号
*/
@NotNull(message = "产品编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long productId;
/**
* 产品单价
*/
@NotNull(message = "产品单价不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal productPrice;
/**
* 商机价格
*/
@NotNull(message = "商机价格不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal businessPrice;
/**
* 数量
*/
@NotNull(message = "数量不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal count;
/**
* 总计价格
*/
@NotNull(message = "总计价格不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal totalPrice;

View File

@@ -26,121 +26,101 @@ public class OaClueBo extends BaseEntity {
/**
* 编号,主键自增
*/
@NotNull(message = "编号,主键自增不能为空", groups = { EditGroup.class })
private Long clueId;
/**
* 线索名称
*/
@NotBlank(message = "线索名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String clueName;
/**
* 跟进状态
*/
@NotNull(message = "跟进状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer followUpStatus;
/**
* 最后跟进时间
*/
@NotNull(message = "最后跟进时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date contactLastTime;
/**
* 最后跟进内容
*/
@NotBlank(message = "最后跟进内容不能为空", groups = { AddGroup.class, EditGroup.class })
private String contactLastContent;
/**
* 下次联系时间
*/
@NotNull(message = "下次联系时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date contactNextTime;
/**
* 负责人的用户编号
*/
@NotNull(message = "负责人的用户编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long ownerUserId;
/**
* 转化状态
*/
@NotNull(message = "转化状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer transformStatus;
/**
* 客户编号
*/
@NotNull(message = "客户编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long customerId;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class })
private String mobile;
/**
* 电话
*/
@NotBlank(message = "电话不能为空", groups = { AddGroup.class, EditGroup.class })
private String telephone;
/**
* QQ
*/
@NotBlank(message = "QQ不能为空", groups = { AddGroup.class, EditGroup.class })
private String qq;
/**
* 微信
*/
@NotBlank(message = "微信不能为空", groups = { AddGroup.class, EditGroup.class })
private String wechat;
/**
* 邮箱
*/
@NotBlank(message = "邮箱不能为空", groups = { AddGroup.class, EditGroup.class })
private String email;
/**
* 地区编号
*/
@NotNull(message = "地区编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long areaId;
/**
* 详细地址
*/
@NotBlank(message = "详细地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String detailAddress;
/**
* 所属行业
*/
@NotNull(message = "所属行业不能为空", groups = { AddGroup.class, EditGroup.class })
private Long industryId;
/**
* 客户等级
*/
@NotNull(message = "客户等级不能为空", groups = { AddGroup.class, EditGroup.class })
private Long level;
/**
* 客户来源
*/
@NotNull(message = "客户来源不能为空", groups = { AddGroup.class, EditGroup.class })
private Long source;
/**
* 备注
*/
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String remark;

View File

@@ -26,121 +26,101 @@ public class OaCustomerBo extends BaseEntity {
/**
* 编号,主键自增
*/
@NotNull(message = "编号,主键自增不能为空", groups = { EditGroup.class })
private Long customerId;
/**
* 客户名称
*/
@NotBlank(message = "客户名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String name;
/**
* 跟进状态
*/
@NotNull(message = "跟进状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer followUpStatus;
/**
* 最后跟进时间
*/
@NotNull(message = "最后跟进时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date contactLastTime;
/**
* 最后跟进内容
*/
@NotBlank(message = "最后跟进内容不能为空", groups = { AddGroup.class, EditGroup.class })
private String contactLastContent;
/**
* 下次联系时间
*/
@NotNull(message = "下次联系时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date contactNextTime;
/**
* 负责人的用户编号
*/
@NotNull(message = "负责人的用户编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long ownerUserId;
/**
* 成为负责人的时间
*/
@NotNull(message = "成为负责人的时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date ownerTime;
/**
* 成交状态
*/
@NotNull(message = "成交状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Long dealStatus;
/**
* 手机
*/
@NotBlank(message = "手机不能为空", groups = { AddGroup.class, EditGroup.class })
private String mobile;
/**
* 电话
*/
@NotBlank(message = "电话不能为空", groups = { AddGroup.class, EditGroup.class })
private String telephone;
/**
* QQ
*/
@NotBlank(message = "QQ不能为空", groups = { AddGroup.class, EditGroup.class })
private String qq;
/**
* 微信
*/
@NotBlank(message = "微信不能为空", groups = { AddGroup.class, EditGroup.class })
private String wechat;
/**
* 邮箱
*/
@NotBlank(message = "邮箱不能为空", groups = { AddGroup.class, EditGroup.class })
private String email;
/**
* 地区编号
*/
@NotNull(message = "地区编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long areaId;
/**
* 详细地址
*/
@NotBlank(message = "详细地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String detailAddress;
/**
* 所属行业
*/
@NotNull(message = "所属行业不能为空", groups = { AddGroup.class, EditGroup.class })
private Long industryId;
/**
* 客户等级
*/
@NotNull(message = "客户等级不能为空", groups = { AddGroup.class, EditGroup.class })
private Long level;
/**
* 客户来源
*/
@NotNull(message = "客户来源不能为空", groups = { AddGroup.class, EditGroup.class })
private Long source;
/**
* 备注
*/
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String remark;

View File

@@ -26,55 +26,48 @@ public class OaFollowUpRecordBo extends BaseEntity {
/**
* 编号
*/
@NotNull(message = "编号不能为空", groups = { EditGroup.class })
private Long followId;
/**
* 跟进类型
*/
@NotNull(message = "跟进类型不能为空", groups = { AddGroup.class, EditGroup.class })
private Long type;
/**
* 跟进内容
*/
@NotBlank(message = "跟进内容不能为空", groups = { AddGroup.class, EditGroup.class })
private String content;
/**
* 下次联系时间
*/
@NotNull(message = "下次联系时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date nextTime;
/**
* 图片
*/
@NotBlank(message = "图片不能为空", groups = { AddGroup.class, EditGroup.class })
private String picUrls;
/**
* 附件
*/
@NotBlank(message = "附件不能为空", groups = { AddGroup.class, EditGroup.class })
private String fileUrls;
/**
* 关联的商机编号数组
*/
@NotBlank(message = "关联的商机编号数组不能为空", groups = { AddGroup.class, EditGroup.class })
private String businessIds;
/**
* 暂用此代替商机记录
*/
@NotNull(message = "暂用此代替商机记录不能为空", groups = { AddGroup.class, EditGroup.class })
private Long businessId;
/**
* 关联的联系人编号数组
*/
@NotBlank(message = "关联的联系人编号数组不能为空", groups = { AddGroup.class, EditGroup.class })
private String contactIds;

View File

@@ -25,7 +25,6 @@ public class OaProductBo extends BaseEntity {
/**
* 产品编号
*/
@NotNull(message = "产品编号不能为空", groups = { EditGroup.class })
private Long productId;
/**
@@ -43,44 +42,38 @@ public class OaProductBo extends BaseEntity {
/**
* 单位
*/
@NotNull(message = "单位不能为空", groups = { AddGroup.class, EditGroup.class })
private Long unit;
/**
* 价格,单位:元
*/
@NotNull(message = "价格,单位:元不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal price;
/**
* 状态
*/
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Long status;
/**
* 产品分类编号
*/
@NotNull(message = "产品分类编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long categoryId;
/**
* 产品描述
*/
@NotBlank(message = "产品描述不能为空", groups = { AddGroup.class, EditGroup.class })
private String description;
/**
* 负责人的用户编号
*/
@NotNull(message = "负责人的用户编号不能为空", groups = { AddGroup.class, EditGroup.class })
private Long ownerUserId;
/**
* 是否删除
*/
@NotNull(message = "是否删除不能为空", groups = { AddGroup.class, EditGroup.class })
private Long deleted;
private Long delFlag;
}

View File

@@ -143,5 +143,6 @@ public class OaClueVo {
@ExcelProperty(value = "备注")
private String remark;
private String nickName;
}

View File

@@ -144,4 +144,11 @@ public class OaCustomerVo {
private String remark;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String nickName;
}

View File

@@ -73,14 +73,7 @@ public class OaProductVo {
/**
* 负责人的用户编号
*/
@ExcelProperty(value = "负责人的用户编号")
private Long ownerUserId;
/**
* 是否删除
*/
@ExcelProperty(value = "是否删除")
private Long deleted;
}

View File

@@ -1,8 +1,12 @@
package com.ruoyi.oa.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.oa.domain.OaClue;
import com.ruoyi.oa.domain.vo.OaClueVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
/**
* CRM 线索Mapper接口
@@ -12,4 +16,5 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
*/
public interface OaClueMapper extends BaseMapperPlus<OaClueMapper, OaClue, OaClueVo> {
Page<OaClueVo> selectVoListPage(Page<Object> build,@Param(Constants.WRAPPER) LambdaQueryWrapper<OaClue> lqw);
}

View File

@@ -1,8 +1,13 @@
package com.ruoyi.oa.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.oa.domain.OaCustomer;
import com.ruoyi.oa.domain.vo.OaCustomerVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
/**
* CRM 客户Mapper接口
@@ -12,4 +17,6 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
*/
public interface OaCustomerMapper extends BaseMapperPlus<OaCustomerMapper, OaCustomer, OaCustomerVo> {
Page<OaCustomerVo> selectVoPageToUser(Page<Object> build,@Param(Constants.WRAPPER) Wrapper<OaCustomer> lqw);
}

View File

@@ -5,6 +5,7 @@ import com.ruoyi.oa.domain.vo.OaBusinessVo;
import com.ruoyi.oa.domain.bo.OaBusinessBo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
import com.ruoyi.oa.domain.vo.OaProductVo;
import java.util.Collection;
@@ -53,4 +54,5 @@ public interface IOaBusinessService {
* 联查商机与产品以及其关联表
*/
TableDataInfo<OaProductVo> getBusinessProducts(OaBusinessBo bo);
}

View File

@@ -46,4 +46,12 @@ public interface IOaClueService {
* 校验并批量删除CRM 线索信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询使用xml 关联到user表
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaClueVo> queryPageListVo(OaClueBo bo, PageQuery pageQuery);
}

View File

@@ -46,4 +46,20 @@ public interface IOaCustomerService {
* 校验并批量删除CRM 客户信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询已分配的用户
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaCustomerVo> queryPageListToUser(OaCustomerBo bo, PageQuery pageQuery);
/**
* 查询公海中的客户
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<OaCustomerVo> queryPageListToSea(OaCustomerBo bo, PageQuery pageQuery);
}

View File

@@ -46,4 +46,6 @@ public interface IOaFollowUpRecordService {
* 校验并批量删除CRM 跟进记录信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
List<OaFollowUpRecordVo> selectByBusinessIds(Collection<Long> list);
}

View File

@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.oa.domain.vo.FileUser;
import com.ruoyi.oa.domain.vo.UserFilesVo;
import com.ruoyi.system.service.ISysUserService;
import liquibase.pro.packaged.A;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.oa.domain.vo.OaFollowUpRecordVo;
import com.ruoyi.oa.domain.vo.OaProductVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -17,6 +18,7 @@ import com.ruoyi.oa.domain.OaBusiness;
import com.ruoyi.oa.mapper.OaBusinessMapper;
import com.ruoyi.oa.service.IOaBusinessService;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@@ -128,7 +130,7 @@ public class OaBusinessServiceImpl implements IOaBusinessService {
@Override
public TableDataInfo<OaProductVo> getBusinessProducts(OaBusinessBo bo) {
QueryWrapper<OaBusiness> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(bo.getBusinessId() != null,"oa_business.business_id", bo.getBusinessId());
queryWrapper.eq(bo.getBusinessId() != null,"ob.business_id", bo.getBusinessId());
return TableDataInfo.build(baseMapper.getBusinessProducts(bo,queryWrapper));
}
}

View File

@@ -123,4 +123,11 @@ public class OaClueServiceImpl implements IOaClueService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public TableDataInfo<OaClueVo> queryPageListVo(OaClueBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaClue> lqw = buildQueryWrapper(bo);
Page<OaClueVo> result = baseMapper.selectVoListPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
}

View File

@@ -1,6 +1,7 @@
package com.ruoyi.oa.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
@@ -66,19 +67,8 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
lqw.eq(bo.getContactLastTime() != null, OaCustomer::getContactLastTime, bo.getContactLastTime());
lqw.eq(StringUtils.isNotBlank(bo.getContactLastContent()), OaCustomer::getContactLastContent, bo.getContactLastContent());
lqw.eq(bo.getContactNextTime() != null, OaCustomer::getContactNextTime, bo.getContactNextTime());
lqw.eq(bo.getOwnerUserId() != null, OaCustomer::getOwnerUserId, bo.getOwnerUserId());
lqw.eq(bo.getOwnerTime() != null, OaCustomer::getOwnerTime, bo.getOwnerTime());
lqw.eq(bo.getDealStatus() != null, OaCustomer::getDealStatus, bo.getDealStatus());
lqw.eq(StringUtils.isNotBlank(bo.getMobile()), OaCustomer::getMobile, bo.getMobile());
lqw.eq(StringUtils.isNotBlank(bo.getTelephone()), OaCustomer::getTelephone, bo.getTelephone());
lqw.eq(StringUtils.isNotBlank(bo.getQq()), OaCustomer::getQq, bo.getQq());
lqw.eq(StringUtils.isNotBlank(bo.getWechat()), OaCustomer::getWechat, bo.getWechat());
lqw.eq(StringUtils.isNotBlank(bo.getEmail()), OaCustomer::getEmail, bo.getEmail());
lqw.eq(bo.getAreaId() != null, OaCustomer::getAreaId, bo.getAreaId());
lqw.like(StringUtils.isNotBlank(bo.getDetailAddress()), OaCustomer::getDetailAddress, bo.getDetailAddress());
lqw.eq(bo.getIndustryId() != null, OaCustomer::getIndustryId, bo.getIndustryId());
lqw.eq(bo.getLevel() != null, OaCustomer::getLevel, bo.getLevel());
lqw.eq(bo.getSource() != null, OaCustomer::getSource, bo.getSource());
return lqw;
}
@@ -123,4 +113,20 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public TableDataInfo<OaCustomerVo> queryPageListToUser(OaCustomerBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
lqw.eq(OaCustomer::getOwnerUserId, LoginHelper.getUserId());
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@Override
public TableDataInfo<OaCustomerVo> queryPageListToSea(OaCustomerBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
lqw.isNull(OaCustomer::getOwnerUserId);
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
}

View File

@@ -15,6 +15,7 @@ import com.ruoyi.oa.domain.OaFollowUpRecord;
import com.ruoyi.oa.mapper.OaFollowUpRecordMapper;
import com.ruoyi.oa.service.IOaFollowUpRecordService;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@@ -113,4 +114,17 @@ public class OaFollowUpRecordServiceImpl implements IOaFollowUpRecordService {
}
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
public List<OaFollowUpRecordVo> selectByBusinessIds(Collection<Long> businessIds) {
LambdaQueryWrapper<OaFollowUpRecord> queryWrapper = new LambdaQueryWrapper<>();
// 将多个业务id用 or 拼接
for (Long id : businessIds) {
queryWrapper.or().apply("FIND_IN_SET({0}, business_ids)", id);
}
return baseMapper.selectVoList(queryWrapper);
}
}

View File

@@ -69,7 +69,6 @@ public class OaProductServiceImpl implements IOaProductService {
lqw.eq(bo.getCategoryId() != null, OaProduct::getCategoryId, bo.getCategoryId());
lqw.like(StringUtils.isNotBlank(bo.getDescription()), OaProduct::getDescription, bo.getDescription());
lqw.eq(bo.getOwnerUserId() != null, OaProduct::getOwnerUserId, bo.getOwnerUserId());
lqw.eq(bo.getDeleted() != null, OaProduct::getDeleted, bo.getDeleted());
return lqw;
}

View File

@@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getBusinessProducts" resultType="com.ruoyi.oa.domain.vo.OaProductVo">
select op.product_id, op.product_name, op.product_number, op.unit, op.price, op.status, op.category_id, op.description, op.deleted
select op.product_id, op.product_name, op.product_number, op.unit, op.price, op.status, op.category_id, op.description, op.del_flag
from oa_business ob
left join oa_business_product obp on ob.business_id = obp.business_id
left join oa_product op on obp.product_id = op.product_id

View File

@@ -33,4 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="selectVoListPage" resultType="com.ruoyi.oa.domain.vo.OaClueVo">
select oc.clue_id,oc.clue_id, oc.clue_name, oc.follow_up_status, oc.contact_last_time, oc.contact_last_content, oc.contact_next_time, oc.owner_user_id, oc.transform_status, oc.customer_id, oc.mobile, oc.telephone, oc.qq, oc.wechat, oc.email, oc.area_id, oc.detail_address, oc.industry_id, oc.level, oc.source, oc.remark, oc.create_by, oc.create_time, oc.update_by, oc.update_time, oc.del_flag
,nick_name
from oa_clue oc
left join sys_user su on su.user_id = oc.owner_user_id
${ew.getCustomSqlSegment}
</select>
</mapper>

View File

@@ -33,4 +33,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="selectVoPageToUser" resultType="com.ruoyi.oa.domain.vo.OaCustomerVo">
select oc.customer_id, nick_name,name, follow_up_status, contact_last_time, contact_last_content, contact_next_time, owner_user_id, owner_time, deal_status, mobile, telephone, qq, wechat, oc.email, area_id, detail_address, industry_id, level, source, oc.remark,oc.create_by, oc.create_time, oc.update_by, oc.update_time, oc.del_flag from oa_customer oc
left join fad_oa.sys_user su on oc.owner_user_id = su.user_id
${ew.getCustomSqlSegment}
</select>
</mapper>

View File

@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="deleted" column="deleted"/>
<result property="delFlag" column="del_flag"/>
</resultMap>

View File

@@ -34,8 +34,7 @@
os.pay_time,
os.base_salary,
(
os.base_salary * DAY(LAST_DAY(#{payTime}))
+ COALESCE(SUM(
COALESCE(SUM(
CASE
WHEN osi.flag = 1 THEN osi.price
WHEN osi.flag = 0 THEN -osi.price
@@ -80,14 +79,13 @@
os.pay_time,
os.base_salary,
(
os.base_salary * DAY(LAST_DAY(#{payTime}))
DAY(LAST_DAY(#{payTime}))
+ COALESCE(SUM(
CASE
WHEN osi.flag = 1 THEN osi.price
WHEN osi.flag = 0 THEN -osi.price
ELSE 0
END
), 0)
END), 0)
) AS real_salary,
osi.salary_item_id,
osi.reason,

View File

@@ -5,8 +5,8 @@ VUE_APP_TITLE = 福安德综合办公系统
ENV = 'production'
# 若依管理系统/生产环境
# VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'http://110.41.139.73:8080'
VUE_APP_BASE_API = '/prod-api'
# VUE_APP_BASE_API = 'http://110.41.139.73:8080'
# 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/'

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询CRM 商机列表
export function listBusiness(query) {
return request({
url: '/oa/business/list',
method: 'get',
params: query
})
}
// 查询CRM 商机详细
export function getBusiness(businessId) {
return request({
url: '/oa/business/' + businessId,
method: 'get'
})
}
// 新增CRM 商机
export function addBusiness(data) {
return request({
url: '/oa/business',
method: 'post',
data: data
})
}
// 修改CRM 商机
export function updateBusiness(data) {
return request({
url: '/oa/business',
method: 'put',
data: data
})
}
// 删除CRM 商机
export function delBusiness(businessId) {
return request({
url: '/oa/business/' + businessId,
method: 'delete'
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询CRM 线索列表
export function listClue(query) {
return request({
url: '/oa/clue/list',
method: 'get',
params: query
})
}
// 查询CRM 线索详细
export function getClue(clueId) {
return request({
url: '/oa/clue/' + clueId,
method: 'get'
})
}
// 新增CRM 线索
export function addClue(data) {
return request({
url: '/oa/clue',
method: 'post',
data: data
})
}
// 修改CRM 线索
export function updateClue(data) {
return request({
url: '/oa/clue',
method: 'put',
data: data
})
}
// 删除CRM 线索
export function delClue(clueId) {
return request({
url: '/oa/clue/' + clueId,
method: 'delete'
})
}

View File

@@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询CRM 客户列表
export function listCustomer(query) {
return request({
url: '/oa/customer/list',
method: 'get',
params: query
})
}
// 查询CRM 客户列表
export function listSeaCustomer(query) {
return request({
url: '/oa/customer/list-sea',
method: 'get',
params: query
})
}
// 查询CRM 客户详细
export function getCustomer(customerId) {
return request({
url: '/oa/customer/' + customerId,
method: 'get'
})
}
// 新增CRM 客户
export function addCustomer(data) {
return request({
url: '/oa/customer',
method: 'post',
data: data
})
}
// 修改CRM 客户
export function updateCustomer(data) {
return request({
url: '/oa/customer',
method: 'put',
data: data
})
}
// 删除CRM 客户
export function delCustomer(customerId) {
return request({
url: '/oa/customer/' + customerId,
method: 'delete'
})
}

View File

@@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询CRM 跟进记录列表
export function listFollowUpRecord(query) {
return request({
url: '/oa/followUpRecord/list',
method: 'get',
params: query
})
}
// 查询CRM 跟进记录列表
export function listFollowUpRecordByIds(ids) {
return request({
url: '/oa/followUpRecord/listByIds/'+ids,
method: 'get'
})
}
// 查询CRM 跟进记录详细
export function getFollowUpRecord(followId) {
return request({
url: '/oa/followUpRecord/' + followId,
method: 'get'
})
}
// 新增CRM 跟进记录
export function addFollowUpRecord(data) {
return request({
url: '/oa/followUpRecord',
method: 'post',
data: data
})
}
// 修改CRM 跟进记录
export function updateFollowUpRecord(data) {
return request({
url: '/oa/followUpRecord',
method: 'put',
data: data
})
}
// 删除CRM 跟进记录
export function delFollowUpRecord(followId) {
return request({
url: '/oa/followUpRecord/' + followId,
method: 'delete'
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询CRM 产品列表
export function listProduct(query) {
return request({
url: '/oa/product/list',
method: 'get',
params: query
})
}
// 查询CRM 产品详细
export function getProduct(productId) {
return request({
url: '/oa/product/' + productId,
method: 'get'
})
}
// 新增CRM 产品
export function addProduct(data) {
return request({
url: '/oa/product',
method: 'post',
data: data
})
}
// 修改CRM 产品
export function updateProduct(data) {
return request({
url: '/oa/product',
method: 'put',
data: data
})
}
// 删除CRM 产品
export function delProduct(productId) {
return request({
url: '/oa/product/' + productId,
method: 'delete'
})
}

View File

@@ -162,6 +162,21 @@ export const constantRoutes = [
]
},
{
path: '/customer',
component: Layout,
hidden: true,
children: [
{
path: 'detail/:customerId(\\d+)',
component: () => import('@/views/oa/customer/customer/detail'),
name: 'detail',
meta: { title: '客户详情' ,activeMenu: '/customer' }
},
]
},
{
path: '/claim',
component: Layout,
@@ -181,6 +196,8 @@ export const constantRoutes = [
},
]
},
]
// 动态路由,基于用户权限动态去加载

View File

@@ -0,0 +1,442 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商机名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入商机名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select v-model="queryParams.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商机状态" prop="statusId">
<el-select v-model="queryParams.statusId" placeholder="请选择商机状态编号" clearable>
<el-option
v-for="dict in dict.type.business_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="businessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="businessId" v-if="true"/>
<el-table-column label="商机名称" align="center" prop="name" fixed/>
<el-table-column label="客户姓名" align="center" prop="customerName" />
<el-table-column label="跟进状态" align="center" prop="followUpStatus" />
<el-table-column label="最后跟进时间" align="center" prop="contactLastTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactLastTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="下次联系时间" align="center" prop="contactNextTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactNextTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="nickName" />
<el-table-column label="商机状态编号" align="center" prop="statusId">
<template slot-scope="scope">
<dict-tag :options="dict.type.business_status" :value="scope.row.statusId"/>
</template>
</el-table-column>
<el-table-column label="预计成交日期" align="center" prop="dealTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.dealTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="产品总金额" align="center" prop="totalProductPrice" />
<el-table-column label="整单折扣" align="center" prop="discountPercent" />
<el-table-column label="商机总金额" align="center" prop="totalPrice" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="结束标注" align="center" prop="endRemark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改CRM 商机对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="商机名称" prop="name">
<el-input v-model="form.name" placeholder="请输入商机名称" />
</el-form-item>
<el-form-item label="客户编号" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择">
<el-option
v-for="item in customerList"
:key="item.customerId"
:label="item.name"
:value="item.customerId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="最后跟进时间" prop="contactLastTime">
<el-date-picker clearable
v-model="form.contactLastTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择最后跟进时间">
</el-date-picker>
</el-form-item>
<el-form-item label="下次联系时间" prop="contactNextTime">
<el-date-picker clearable
v-model="form.contactNextTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择下次联系时间">
</el-date-picker>
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select v-model="form.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="statusId">
<el-select v-model="form.statusId" placeholder="请选择商机状态编号">
<el-option
v-for="dict in dict.type.business_status"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="商机总金额" prop="totalPrice">
<el-input v-model="form.totalPrice" placeholder="总金额" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBusiness, getBusiness, delBusiness, addBusiness, updateBusiness } from "@/api/oa/business";
import {listUser} from "@/api/system/user";
import {listCustomer} from "@/api/oa/customer";
import {listProduct} from "@/api/oa/product";
export default {
name: "Business",
dicts: ['business_status'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// CRM 商机表格数据
businessList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
customerId: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
statusTypeId: undefined,
statusId: undefined,
endStatus: undefined,
dealTime: undefined,
totalProductPrice: undefined,
discountPercent: undefined,
totalPrice: undefined,
endRemark: undefined,
},
// 表单参数
form: {
},
// 表单校验
rules: {
businessId: [
{ required: true, message: "编号不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "商机名称不能为空", trigger: "blur" }
],
customerId: [
{ required: true, message: "客户编号不能为空", trigger: "blur" }
]
},
userList:[],
customerList:[],
productList:[]
};
},
created() {
this.getList();
this.getUserList();
this.getCustomerList();
this.getProductList();
},
methods: {
/** 查询CRM 商机列表 */
getList() {
this.loading = true;
listBusiness(this.queryParams).then(response => {
this.businessList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getUserList() {
listUser({pageSize: 999, pageNum: 1}).then((response) => {
this.userList = response.rows;
})
},
getCustomerList(){
listCustomer({pageSize: 999, pageNum: 1}).then(response => {
this.customerList = response.rows;
})
},
getProductList(){
listProduct({pageSize: 999, pageNum: 1}).then(res=>{
this.productList = res.rows;
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
name: undefined,
customerId: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
statusTypeId: undefined,
statusId: undefined,
endStatus: undefined,
dealTime: undefined,
totalProductPrice: undefined,
discountPercent: undefined,
totalPrice: undefined,
remark: undefined,
createBy: undefined,
updateBy: undefined,
createTime: undefined,
updateTime: undefined,
endRemark: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.businessId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加CRM 商机";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const businessId = row.businessId || this.ids
getBusiness(businessId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改CRM 商机";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.businessId != null) {
updateBusiness(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addBusiness(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const businessIds = row.businessId || this.ids;
this.$modal.confirm('是否确认删除CRM 商机编号为"' + businessIds + '"的数据项?').then(() => {
this.loading = true;
return delBusiness(businessIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('oa/business/export', {
...this.queryParams
}, `business_${new Date().getTime()}.xlsx`)
}
},
mounted() {
}
};
</script>
<style scoped>
.form-row {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.form-row .el-form-item {
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,469 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="线索名" prop="clueName">
<el-input
v-model="queryParams.clueName"
placeholder="请输入线索名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="负责人姓名" prop="nickName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入负责人的用户编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转化状态" prop="transformStatus">
<el-select v-model="queryParams.transformStatus" placeholder="请选择转化状态">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
@keyup.enter.native="handleQuery"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="queryParams.industryId" placeholder="请选择所属行业" clearable>
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable>
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="clueList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="编号" align="center" type="index" v-if="true"/>
<el-table-column label="转化状态" align="center" prop="transformStatus">
<template slot-scope="scope">
<el-tag :type="scope.row.transformStatus===0?'warning':'success'">
{{ scope.row.transformStatus === 0 ? '未转化' : '已转化' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="线索名称" align="center" prop="clueName" fixed/>
<el-table-column label="所属行业" align="center" prop="industryId">
<template slot-scope="scope">
<dict-tag :options="dict.type.industry_type" :value="scope.row.industryId"/>
</template>
</el-table-column>
<el-table-column label="客户等级" align="center" prop="level">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_level" :value="scope.row.level"/>
</template>
</el-table-column>
<el-table-column label="客户来源" align="center" prop="source">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_source" :value="scope.row.source"/>
</template>
</el-table-column>
<el-table-column label="跟进状态" align="center" prop="followUpStatus"/>
<el-table-column label="负责人的用户编号" align="center" prop="nickName"/>
<el-table-column label="详细地址" align="center" prop="detailAddress"/>
<el-table-column label="手机号" align="center" prop="mobile"/>
<el-table-column label="电话" align="center" prop="telephone"/>
<el-table-column label="QQ" align="center" prop="qq"/>
<el-table-column label="微信" align="center" prop="wechat"/>
<el-table-column label="邮箱" align="center" prop="email"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改CRM 线索对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="线索名称" prop="clueName">
<el-input v-model="form.clueName" placeholder="请输入线索名称"/>
</el-form-item>
<el-form-item label="负责人的用户编号" prop="ownerUserId">
<el-select v-model="form.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机号"/>
</el-form-item>
<el-form-item label="电话" prop="telephone">
<el-input v-model="form.telephone" placeholder="请输入电话"/>
</el-form-item>
<el-form-item label="QQ" prop="qq">
<el-input v-model="form.qq" placeholder="请输入QQ"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="form.industryId" placeholder="请选择所属行业">
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="form.level" placeholder="请选择客户等级">
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="form.source" placeholder="请选择客户来源">
<el-option
v-for="dict in dict.type.customer_source"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="微信" prop="wechat">
<el-input v-model="form.wechat" placeholder="请输入微信"/>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listClue, getClue, delClue, addClue, updateClue} from "@/api/oa/clue";
import {listUser} from "@/api/system/user";
export default {
name: "Clue",
dicts: ['customer_source', 'industry_type', 'customer_level'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// CRM 线索表格数据
clueList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
options: [{
value: '0',
label: '未转化'
}, {
value: '1',
label: '已转化'
}],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
clueName: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
transformStatus: undefined,
customerId: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
},
userList: [],
// 表单参数
form: {},
// 表单校验
rules: {
clueId: [
{required: true, message: "编号,主键自增不能为空", trigger: "blur"}
],
clueName: [
{required: true, message: "线索名称不能为空", trigger: "blur"}
],
ownerUserId: [
{required: true, message: "负责人的用户编号不能为空", trigger: "blur"}
]
}
};
},
created() {
this.getList();
this.getUserList();
},
methods: {
/** 查询CRM 线索列表 */
getList() {
this.loading = true;
listClue(this.queryParams).then(response => {
this.clueList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getUserList() {
listUser({pageSize: 999, pageNum: 1}).then((response) => {
this.userList = response.rows;
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
clueId: undefined,
clueName: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
transformStatus: undefined,
customerId: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
remark: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.clueId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加线索";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const clueId = row.clueId || this.ids
getClue(clueId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改线索";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.clueId != null) {
updateClue(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addClue(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const clueIds = row.clueId || this.ids;
this.$modal.confirm('是否确认删除线索编号为"' + clueIds + '"的数据项?').then(() => {
this.loading = true;
return delClue(clueIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('oa/clue/export', {
...this.queryParams
}, `clue_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,212 @@
<template>
<div class="user-detail-page">
<!-- 上半部分用户基本信息 -->
<el-card class="user-info-card">
<div slot="header" class="clearfix">
<div>用户详细信息</div>
<div>
<el-button type="text" @click="updateCustomer">分配负责人</el-button>
<el-button type="text" @click="openMsg">领取</el-button>
</div>
</div>
<el-row :gutter="20">
<el-col :span="8">
<div><strong>姓名</strong>{{ customerInfo.name }}</div>
<div><strong>下次交谈时间</strong>{{ parseTime(customerInfo.contactLastTime, '{y}-{m}-{d}') }}</div>
</el-col>
<el-col :span="8">
<div><strong>邮箱</strong>{{ customerInfo.email }}</div>
<div><strong>qq</strong>{{ customerInfo.qq }}</div>
</el-col>
<el-col :span="8">
<div><strong>地址</strong>{{ customerInfo.detailAddress }}</div>
<div><strong>来源</strong>{{ customerInfo.source }}</div>
</el-col>
</el-row>
</el-card>
<!-- 下半部分标签页 -->
<el-tabs v-model="activeTab" type="card" class="user-tabs">
<!-- 第一个tab跟进信息 -->
<el-tab-pane label="跟进信息" name="followup">
<el-table :data="followUpRecordList" style="width: 100%">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="编号" align="center" prop="followId" v-if="true"/>
<el-table-column label="跟进类型" align="center" prop="type"/>
<el-table-column label="跟进内容" align="center" prop="content"/>
</el-table>
</el-tab-pane>
<!-- 第二个tab商机 -->
<el-tab-pane label="商机" name="business">
<el-table :data="businessList" style="width: 100%">
<el-table-column label="商机名称" align="center" prop="name"/>
<el-table-column label="客户姓名" align="center" prop="customerName"/>
<el-table-column label="跟进状态" align="center" prop="followUpStatus"/>
<el-table-column label="负责人" align="center" prop="nickName"/>
<el-table-column label="商机状态" align="center" prop="statusId">
<template slot-scope="scope">
<dict-tag :options="dict.type.business_status" :value="scope.row.statusId"/>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 第三个tab更详细的用户信息 -->
<el-tab-pane label="详细信息" name="moreInfo">
<div class="more-info">
<p><strong>更多详细信息</strong></p>
<p><strong>等待需求..</strong></p>
</div>
</el-tab-pane>
</el-tabs>
<!-- 添加或修改CRM 客户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="customerInfo" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="customerInfo.name" placeholder="请输入客户名称" disabled/>
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select v-model="customerInfo.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getCustomer, updateCustomer} from "@/api/oa/customer";
import {listFollowUpRecordByIds} from "@/api/oa/followUpRecord";
import {listBusiness} from "@/api/oa/business";
import {listUser, getUserProfile} from "@/api/system/user";
export default {
name: 'UserDetail',
dicts: ['business_status'],
data() {
return {
activeTab: 'followup',
// 示例用户数据
customerInfo: {},
open: false,
queryParams: {
pageSize: 100,
pageNum: 1,
},
// 示例跟进信息数据
followupData: [
{date: '2025-03-10', content: '电话联系,确认需求', status: '已完成'},
{date: '2025-03-12', content: '发送邮件跟进', status: '待反馈'}
],
// 示例商机数据
businessList: [
{name: '项目A', amount: '10000', stage: '洽谈中'},
{name: '项目B', amount: '20000', stage: '合同签订'}
],
followUpRecordList: [],
userList: []
}
},
created() {
this.getCustomerInfo()
this.getList()
},
methods: {
getCustomerInfo() {
getCustomer(this.$route.params.customerId).then(res => {
this.customerInfo = res.data
})
},
getList() {
this.loading = true;
listUser(this.queryParams).then(res => {
this.userList = res.rows
})
this.queryParams.customerId = this.$route.params.customerId
listBusiness(this.queryParams).then(response => {
this.businessList = response.rows;
console.log(this.businessList);
if (this.businessList.length > 0) {
const businessIds = this.businessList.map(item => item.businessId);
listFollowUpRecordByIds(businessIds).then(response => {
this.followUpRecordList = response.rows;
})
}
this.loading = false;
});
},
openMsg() {
this.$alert('确定要领取此用户吗', '领取用户', {
confirmButtonText: '确定',
callback: action => {
getUserProfile().then(response => {
let user = response.data.user
console.log(response.data)
this.customerInfo.ownerUserId = user.userId
updateCustomer(this.customerInfo).then(res => {
this.$message({
type: 'info',
message: '领取成功'
});
})
})
}
});
},
updateCustomer() {
this.open = true;
this.form = this.customerInfo
},
submitForm() {
updateCustomer(this.form).then(res => {
this.$notify({
title: '成功',
message: '这是一条成功的提示消息',
type: 'success'
});
})
}
}
}
</script>
<style scoped>
.clearfix {
display: flex;
justify-content: space-between;
}
.user-detail-page {
padding: 20px;
}
.user-info-card {
margin-bottom: 20px;
}
.more-info {
padding: 10px;
line-height: 1.6;
}
</style>

View File

@@ -0,0 +1,563 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="客户名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入客户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="queryParams.industryId" placeholder="请选择所属行业" clearable>
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable>
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable>
<el-option
v-for="dict in dict.type.customer_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-tabs v-model="activeTab" type="card" class="user-tabs">
<!-- <el-tab-pane label="我的客户" name="userList1">-->
<!-- <el-table v-loading="loading" :data="customerListOwn" @selection-change="handleSelectionChange">-->
<!-- <el-table-column type="selection" width="55" align="center"/>-->
<!-- <el-table-column label="序号" align="center" type="index"/>-->
<!-- <el-table-column label="客户名称" align="center" prop="name" fixed>-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" @click="toDetail(scope.row)">{{scope.row.name}}</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="客户等级" align="center" prop="level">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.customer_level" :value="scope.row.level"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="客户来源" align="center" prop="source">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.customer_source" :value="scope.row.source"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="跟进状态" align="center" prop="followUpStatus"/>-->
<!-- <el-table-column label="最后跟进时间" align="center" prop="contactLastTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.contactLastTime, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="最后跟进内容" align="center" prop="contactLastContent"/>-->
<!-- <el-table-column label="下次联系时间" align="center" prop="contactNextTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.contactNextTime, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="负责人" align="center" prop="nickName"/>-->
<!-- <el-table-column label="所属行业" align="center" prop="industryId">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.industry_type" :value="scope.row.industryId"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="手机" align="center" prop="mobile"/>-->
<!-- <el-table-column label="电话" align="center" prop="telephone"/>-->
<!-- <el-table-column label="QQ" align="center" prop="qq"/>-->
<!-- <el-table-column label="微信" align="center" prop="wechat"/>-->
<!-- <el-table-column label="邮箱" align="center" prop="email"/>-->
<!-- <el-table-column label="详细地址" align="center" prop="detailAddress"/>-->
<!-- <el-table-column label="备注" align="center" prop="remark"/>-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['oa:customer:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['oa:customer:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="我的客户" name="userList1">
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="客户名称" align="center" prop="name" fixed>
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row)">{{scope.row.name}}</el-button>
</template>
</el-table-column>
<el-table-column label="客户等级" align="center" prop="level">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_level" :value="scope.row.level"/>
</template>
</el-table-column>
<el-table-column label="客户来源" align="center" prop="source">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_source" :value="scope.row.source"/>
</template>
</el-table-column>
<el-table-column label="跟进状态" align="center" prop="followUpStatus"/>
<el-table-column label="最后跟进时间" align="center" prop="contactLastTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactLastTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后跟进内容" align="center" prop="contactLastContent"/>
<el-table-column label="下次联系时间" align="center" prop="contactNextTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactNextTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="nickName"/>
<el-table-column label="所属行业" align="center" prop="industryId">
<template slot-scope="scope">
<dict-tag :options="dict.type.industry_type" :value="scope.row.industryId"/>
</template>
</el-table-column>
<el-table-column label="手机" align="center" prop="mobile"/>
<el-table-column label="电话" align="center" prop="telephone"/>
<el-table-column label="QQ" align="center" prop="qq"/>
<el-table-column label="微信" align="center" prop="wechat"/>
<el-table-column label="邮箱" align="center" prop="email"/>
<el-table-column label="详细地址" align="center" prop="detailAddress"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改CRM 客户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="form.name" placeholder="请输入客户名称"/>
</el-form-item>
<el-form-item label="最后跟进时间" prop="contactLastTime">
<el-date-picker clearable
v-model="form.contactLastTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择最后跟进时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后跟进内容" prop="contactLastContent">
<el-input v-model="form.contactLastContent" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="下次联系时间" prop="contactNextTime">
<el-date-picker clearable
v-model="form.contactNextTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择下次联系时间">
</el-date-picker>
</el-form-item>
<el-form-item label="微信" prop="wechat">
<el-input v-model="form.wechat" placeholder="请输入微信"/>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select v-model="form.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="详细地址" prop="detailAddress">
<el-input v-model="form.detailAddress" type="textarea" placeholder="请输入详细地址"/>
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机"/>
</el-form-item>
<el-form-item label="电话" prop="telephone">
<el-input v-model="form.telephone" placeholder="请输入电话"/>
</el-form-item>
<el-form-item label="QQ" prop="qq">
<el-input v-model="form.qq" placeholder="请输入QQ"/>
</el-form-item>
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="form.industryId" placeholder="请选择所属行业">
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="form.level" placeholder="请选择客户等级">
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="form.source" placeholder="请选择客户来源">
<el-option
v-for="dict in dict.type.customer_source"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer} from "@/api/oa/customer";
import {listUser} from "@/api/system/user";
export default {
name: "Customer",
dicts: ['customer_source', 'industry_type', 'customer_level'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// CRM 客户表格数据
customerList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
ownerTime: undefined,
dealStatus: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
},
userList: [],
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{required: true, message: "客户名称不能为空", trigger: "blur"}
],
},
activeTab: 'userList1',
};
},
created() {
this.getList();
this.getUserList();
},
methods: {
/** 查询CRM 客户列表 */
getList() {
this.loading = true;
listCustomer(this.queryParams).then(response => {
this.customerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getUserList() {
listUser({pageSize: 999, pageNum: 1}).then((response) => {
this.userList = response.rows;
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
customerId: undefined,
name: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
ownerTime: undefined,
dealStatus: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
remark: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.customerId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加CRM 客户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const customerId = row.customerId || this.ids
getCustomer(customerId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改CRM 客户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.customerId != null) {
updateCustomer(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCustomer(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const customerIds = row.customerId || this.ids;
this.$modal.confirm('是否确认删除客户编号为"' + customerIds + '"的数据项?').then(() => {
this.loading = true;
return delCustomer(customerIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('oa/customer/export', {
...this.queryParams
}, `customer_${new Date().getTime()}.xlsx`)
},
toDetail(row){
console.log(row)
this.$router.push('/customer/detail/'+row.customerId);
}
}
};
</script>

View File

@@ -0,0 +1,339 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="产品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品编码" prop="productNumber">
<el-input
v-model="queryParams.productNumber"
placeholder="请输入产品编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品分类" prop="categoryId">
<el-select v-model="queryParams.categoryId" placeholder="请选择产品分类编号" clearable>
<el-option
v-for="dict in dict.type.product_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="productList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="产品编号" align="center" prop="productId" v-if="true"/>
<el-table-column label="产品名称" align="center" prop="productName" />
<el-table-column label="产品编码" align="center" prop="productNumber" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="价格" align="center" prop="price" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="产品分类" align="center" prop="categoryId">
<template slot-scope="scope">
<dict-tag :options="dict.type.product_category" :value="scope.row.categoryId"/>
</template>
</el-table-column>
<el-table-column label="产品描述" align="center" prop="description" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改CRM 产品对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="产品名称" prop="productName">
<el-input v-model="form.productName" placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="产品编码" prop="productNumber">
<el-input v-model="form.productNumber" placeholder="请输入产品编码" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" />
</el-form-item>
<el-form-item label="产品分类编号" prop="categoryId">
<el-select v-model="form.categoryId" placeholder="请选择产品分类编号">
<el-option
v-for="dict in dict.type.product_category"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品描述" prop="description">
<el-input v-model="form.description" placeholder="请输入产品描述" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProduct, getProduct, delProduct, addProduct, updateProduct } from "@/api/oa/product";
export default {
name: "Product",
dicts: ['product_category'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// CRM 产品表格数据
productList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
productName: undefined,
productNumber: undefined,
unit: undefined,
price: undefined,
status: undefined,
categoryId: undefined,
description: undefined,
ownerUserId: undefined,
deleted: undefined
},
// 表单参数
form: {},
// 表单校验
rules: {
productName: [
{ required: true, message: "产品名称不能为空", trigger: "blur" }
],
productNumber: [
{ required: true, message: "产品编码不能为空", trigger: "blur" }
],
categoryId: [
{ required: true, message: "产品分类编号不能为空", trigger: "change" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询CRM 产品列表 */
getList() {
this.loading = true;
listProduct(this.queryParams).then(response => {
this.productList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
productId: undefined,
productName: undefined,
productNumber: undefined,
unit: undefined,
price: undefined,
status: undefined,
categoryId: undefined,
description: undefined,
ownerUserId: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
deleted: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.productId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加CRM 产品";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const productId = row.productId || this.ids
getProduct(productId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改CRM 产品";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.productId != null) {
updateProduct(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addProduct(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const productIds = row.productId || this.ids;
this.$modal.confirm('是否确认删除CRM 产品编号为"' + productIds + '"的数据项?').then(() => {
this.loading = true;
return delProduct(productIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('oa/product/export', {
...this.queryParams
}, `product_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,484 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="客户名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入客户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="queryParams.industryId" placeholder="请选择所属行业" clearable>
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable>
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable>
<el-option
v-for="dict in dict.type.customer_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="客户名称" align="center" prop="name" fixed>
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row)">{{scope.row.name}}</el-button>
</template>
</el-table-column>
<el-table-column label="客户等级" align="center" prop="level">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_level" :value="scope.row.level"/>
</template>
</el-table-column>
<el-table-column label="客户来源" align="center" prop="source">
<template slot-scope="scope">
<dict-tag :options="dict.type.customer_source" :value="scope.row.source"/>
</template>
</el-table-column>
<el-table-column label="跟进状态" align="center" prop="followUpStatus"/>
<el-table-column label="最后跟进时间" align="center" prop="contactLastTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactLastTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后跟进内容" align="center" prop="contactLastContent"/>
<el-table-column label="下次联系时间" align="center" prop="contactNextTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.contactNextTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="nickName"/>
<el-table-column label="所属行业" align="center" prop="industryId">
<template slot-scope="scope">
<dict-tag :options="dict.type.industry_type" :value="scope.row.industryId"/>
</template>
</el-table-column>
<el-table-column label="手机" align="center" prop="mobile"/>
<el-table-column label="电话" align="center" prop="telephone"/>
<el-table-column label="QQ" align="center" prop="qq"/>
<el-table-column label="微信" align="center" prop="wechat"/>
<el-table-column label="邮箱" align="center" prop="email"/>
<el-table-column label="详细地址" align="center" prop="detailAddress"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改CRM 客户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="form.name" placeholder="请输入客户名称"/>
</el-form-item>
<el-form-item label="最后跟进时间" prop="contactLastTime">
<el-date-picker clearable
v-model="form.contactLastTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择最后跟进时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后跟进内容" prop="contactLastContent">
<el-input v-model="form.contactLastContent" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="下次联系时间" prop="contactNextTime">
<el-date-picker clearable
v-model="form.contactNextTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择下次联系时间">
</el-date-picker>
</el-form-item>
<el-form-item label="微信" prop="wechat">
<el-input v-model="form.wechat" placeholder="请输入微信"/>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select v-model="form.ownerUserId" placeholder="请选择">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="详细地址" prop="detailAddress">
<el-input v-model="form.detailAddress" type="textarea" placeholder="请输入详细地址"/>
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机"/>
</el-form-item>
<el-form-item label="电话" prop="telephone">
<el-input v-model="form.telephone" placeholder="请输入电话"/>
</el-form-item>
<el-form-item label="QQ" prop="qq">
<el-input v-model="form.qq" placeholder="请输入QQ"/>
</el-form-item>
<el-form-item label="所属行业" prop="industryId">
<el-select v-model="form.industryId" placeholder="请选择所属行业">
<el-option
v-for="dict in dict.type.industry_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户等级" prop="level">
<el-select v-model="form.level" placeholder="请选择客户等级">
<el-option
v-for="dict in dict.type.customer_level"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="source">
<el-select v-model="form.source" placeholder="请选择客户来源">
<el-option
v-for="dict in dict.type.customer_source"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, listSeaCustomer} from "@/api/oa/customer";
import {listUser} from "@/api/system/user";
export default {
name: "Customer",
dicts: ['customer_source', 'industry_type', 'customer_level'],
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// CRM 客户表格数据
customerList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
ownerTime: undefined,
dealStatus: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
},
userList: [],
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{required: true, message: "客户名称不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
this.getUserList();
},
methods: {
/** 查询CRM 客户列表 */
getList() {
this.loading = true;
listSeaCustomer(this.queryParams).then(response => {
this.customerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getUserList() {
listUser({pageSize: 999, pageNum: 1}).then((response) => {
this.userList = response.rows;
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
customerId: undefined,
name: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
ownerTime: undefined,
dealStatus: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
remark: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.customerId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加CRM 客户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const customerId = row.customerId || this.ids
getCustomer(customerId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改CRM 客户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.customerId != null) {
updateCustomer(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCustomer(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const customerIds = row.customerId || this.ids;
this.$modal.confirm('是否确认删除CRM 客户编号为"' + customerIds + '"的数据项?').then(() => {
this.loading = true;
return delCustomer(customerIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('oa/customer/export', {
...this.queryParams
}, `customer_${new Date().getTime()}.xlsx`)
},
toDetail(row){
this.$router.push({
path: '/customer/detail/'+row.customerId,
})
}
}
};
</script>