From e4339a1e131f9030f3b3936b9f72e6814afdabcd Mon Sep 17 00:00:00 2001 From: wuyibo <771227828@qq.com> Date: Thu, 3 Aug 2023 15:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-modules/ruoyi-gen/pom.xml | 10 +- .../src/main/resources/bootstrap.yml | 25 +- .../system/controller/CustomerController.java | 12 + .../controller/CustomerOrderController.java | 121 ++++++ .../ruoyi/system/domain/CustomerOrder.java | 49 +++ .../com/ruoyi/system/domain/FollowUp.java | 52 ++- .../system/domain/vo/CustomerOrderVo.java | 48 +++ .../ruoyi/system/domain/vo/CustomerVo.java | 14 + .../ruoyi/system/mapper/CustomerMapper.java | 2 + .../system/mapper/CustomerOrderMapper.java | 66 +++ .../system/service/ICustomerOrderService.java | 66 +++ .../system/service/ICustomerService.java | 2 + .../impl/CustomerOrderServiceImpl.java | 104 +++++ .../service/impl/CustomerServiceImpl.java | 5 + .../service/impl/FollowUpServiceImpl.java | 5 +- .../mapper/system/CustomerMapper.xml | 107 +++-- .../mapper/system/CustomerOrderMapper.xml | 123 ++++++ .../mapper/system/FollowUpMapper.xml | 94 +++-- ruoyi-ui/src/api/system/customer.js | 24 +- ruoyi-ui/src/api/system/customerOrder.js | 58 +++ ruoyi-ui/src/utils/dict/Dict.js | 173 ++++---- .../src/views/system/bookManger/index.vue | 163 +++----- ruoyi-ui/src/views/system/customer/index.vue | 160 ++++++-- .../src/views/system/customerOrder/index.vue | 385 ++++++++++++++++++ .../views/system/potentialCustomer/index.vue | 377 +++++++++++------ .../src/views/system/salesFollowUp/index.vue | 297 ++++++-------- 26 files changed, 1942 insertions(+), 600 deletions(-) create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerOrderController.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CustomerOrder.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerOrderVo.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerOrderMapper.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerOrderService.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerOrderServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerOrderMapper.xml create mode 100644 ruoyi-ui/src/api/system/customerOrder.js create mode 100644 ruoyi-ui/src/views/system/customerOrder/index.vue diff --git a/ruoyi-modules/ruoyi-gen/pom.xml b/ruoyi-modules/ruoyi-gen/pom.xml index a51984ba..082527a4 100644 --- a/ruoyi-modules/ruoyi-gen/pom.xml +++ b/ruoyi-modules/ruoyi-gen/pom.xml @@ -77,7 +77,15 @@ com.ruoyi ruoyi-common-swagger - + + org.projectlombok + lombok + + + + com.mybatis-flex + mybatis-flex-spring-boot-starter + diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index 9419ea4c..580617e7 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -6,4 +6,27 @@ server: spring: application: # 应用名称 - name: ruoyi-gen \ No newline at end of file + name: ruoyi-gen +# Mybatis开启驼峰映射 +mybatis: + configuration: + mapUnderscoreToCamelCase: true +# MyBatis配置 +mybatis-flex: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapper-locations: classpath*:mapper/**/*Mapper.xml + cacheEnabled: true + useGeneratedKeys: true + defaultExecutorType: SIMPLE + configuration: + # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl + # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl + # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl + logImpl: org.apache.ibatis.logging.slf4j.Slf4jImpl +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + supportMethodsArguments: true + params: count=countSql \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java index de6435f4..716acbe6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java @@ -49,6 +49,18 @@ public class CustomerController extends BaseController return getDataTable(list); } + /** + * 查询客户信息列表 + */ + @RequiresPermissions("system:customer:makerList") + @GetMapping("/makerList") + public TableDataInfo makerList(CustomerVo customer) + { + startPage(); + List list = customerService.selectCustomerMakerList(customer); + return getDataTable(list); + } + /** * 导出客户信息列表 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerOrderController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerOrderController.java new file mode 100644 index 00000000..02185e71 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerOrderController.java @@ -0,0 +1,121 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.domain.Customer; +import com.ruoyi.system.domain.vo.CustomerOrderVo; +import com.ruoyi.system.service.ICustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.system.domain.CustomerOrder; +import com.ruoyi.system.service.ICustomerOrderService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 客户-订车Controller + * + * @author ruoyi + * @date 2023-08-01 + */ +@RestController +@RequestMapping("/customerOrder") +public class CustomerOrderController extends BaseController +{ + @Autowired + private ICustomerOrderService customerOrderService; + @Autowired + private ICustomerService customerService; + /** + * 查询客户-订车列表 + */ + @RequiresPermissions("system:customerOrder:list") + @GetMapping("/list") + public TableDataInfo list(CustomerOrder customerOrder) + { + startPage(); + List list = customerOrderService.selectCustomerOrderList(customerOrder); + return getDataTable(list); + } + + @GetMapping("/getCustomerOrderPage") + public TableDataInfo getCustomerOrderPage(CustomerOrderVo customerOrder) + { + startPage(); + List list = customerOrderService.getCustomerOrderPage(customerOrder); + return getDataTable(list); + } + + /** + * 导出客户-订车列表 + */ + @RequiresPermissions("system:customerOrder:export") + @Log(title = "客户-订车", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CustomerOrder customerOrder) + { + List list = customerOrderService.selectCustomerOrderList(customerOrder); + ExcelUtil util = new ExcelUtil(CustomerOrder.class); + util.exportExcel(response, list, "客户-订车数据"); + } + + /** + * 获取客户-订车详细信息 + */ + @RequiresPermissions("system:customerOrder:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(customerOrderService.selectCustomerOrderById(id)); + } + + /** + * 新增客户-订车 + */ + @Log(title = "客户-订车", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CustomerOrder customerOrder) + { + Customer customer = new Customer(); + customer.setId(customerOrder.getCustomerId()); + customer.setStatus("order"); + customerService.updateCustomer(customer); + return toAjax(customerOrderService.insertCustomerOrder(customerOrder)); + } + + /** + * 修改客户-订车 + */ + @RequiresPermissions("system:customerOrder:edit") + @Log(title = "客户-订车", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CustomerOrder customerOrder) + { + return toAjax(customerOrderService.updateCustomerOrder(customerOrder)); + } + + /** + * 删除客户-订车 + */ + @RequiresPermissions("system:customerOrder:remove") + @Log(title = "客户-订车", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(customerOrderService.deleteCustomerOrderByIds(ids)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CustomerOrder.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CustomerOrder.java new file mode 100644 index 00000000..f3d24c85 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CustomerOrder.java @@ -0,0 +1,49 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 客户-订车对象 f_customer_order + * + * @author ruoyi + * @date 2023-08-01 + */ +@Data +public class CustomerOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 客户id */ + @Excel(name = "客户id") + private Long customerId; + + /** 订车时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "订车时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date orderDate; + + /** 车辆详细 */ + @Excel(name = "车辆详细") + private String carInfo; + + /** 车辆VIN */ + @Excel(name = "车辆VIN") + private String carVin; + + /** 车辆状态 */ + @Excel(name = "车辆状态") + private String carStatus; + + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date outDate; +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java index efde3bc6..30735152 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/FollowUp.java @@ -36,21 +36,47 @@ public class FollowUp extends BaseEntity @Excel(name = "跟进日期", width = 30, dateFormat = "yyyy-MM-dd") private Date followUpDate; - /** 跟进记录 */ - @Excel(name = "跟进记录") - private String followUpRecord; - - /** 再次预约到店日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "再次预约到店日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date preToStoreDate; + /** 跟进方式 */ + @Excel(name = "跟进方式") + private String followUpMethod; - /** 级别 */ - @Excel(name = "级别") - private String followLevel; + /** 跟进结果 */ @Excel(name = "跟进结果") private String followResult; - @Excel(name = "跟进方式") - private String followUpMethod; + + /** 意向级别 */ + @Excel(name = "意向级别") + private String intentionLevel; + + /** 本次跟进记录 */ + @Excel(name = "本次跟进记录") + private String followUpRecord; + + /** 下次跟进备注 */ + @Excel(name = "下次跟进备注") + private String nextFollowUpRecord; + + /** 下次跟进时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "下次跟进时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date nextFollowUpTime; + + /** 预约时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date appointmentTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "到店时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date arrivalTime; + + /** 战败原因 */ + @Excel(name = "战败原因") + private String defeatReasons; + @Excel(name = "预约状态") + private String makerStatus; + @Excel(name = "跟进类型(销售回访,潜客跟进)") + private String followType; + @Excel(name = "跟进目的") + private String objective; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerOrderVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerOrderVo.java new file mode 100644 index 00000000..f46f68a9 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerOrderVo.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * @author 吴一博 + * @date 2023年08月03日 8:36 + * @Description + */ +@Data +public class CustomerOrderVo extends CustomerVo{ + + /** 客户id */ + @Excel(name = "客户id") + private Long customerId; + + /** 订车时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "订车时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date orderDate; + + /** 车辆详细 */ + @Excel(name = "车辆详细") + private String carInfo; + + /** 车辆VIN */ + @Excel(name = "车辆VIN") + private String carVin; + + /** 车辆状态 */ + @Excel(name = "车辆状态") + private String carStatus; + /** 车辆状态 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd") + private String outDate; + + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划跟进日期", width = 30, dateFormat = "yyyy-MM-dd") + private String planFollowUpDate; + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "实际跟进日期", width = 30, dateFormat = "yyyy-MM-dd") + private String actualFollowUpDate; +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java index f0b2f383..f64a23bf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/CustomerVo.java @@ -27,4 +27,18 @@ public class CustomerVo extends Customer { @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "跟进超期", width = 30, dateFormat = "yyyy-MM-dd") private String followUpOverdueDate; + /** 意向级别 */ + @Excel(name = "意向级别") + private String intentionLevel; + @Excel(name = "跟进方式") + private String followUpMethod; + /** 预约时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date appointmentTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "到店时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date arrivalTime; + @Excel(name = "预约状态") + private String makerStatus; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java index 242417f2..a58a5b57 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerMapper.java @@ -85,4 +85,6 @@ public interface CustomerMapper * @return 结果 */ public int deleteFollowUpByCustomerId(Long id); + //预约记录列表 + List selectCustomerMakerList(CustomerVo customer); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerOrderMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerOrderMapper.java new file mode 100644 index 00000000..1d20e603 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomerOrderMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.system.mapper; + +import java.util.List; + +import com.mybatisflex.core.BaseMapper; +import com.ruoyi.system.domain.CustomerOrder; +import com.ruoyi.system.domain.vo.CustomerOrderVo; + +/** + * 客户-订车Mapper接口 + * + * @author ruoyi + * @date 2023-08-01 + */ +public interface CustomerOrderMapper extends BaseMapper +{ + /** + * 查询客户-订车 + * + * @param id 客户-订车主键 + * @return 客户-订车 + */ + public CustomerOrder selectCustomerOrderById(Long id); + + /** + * 查询客户-订车列表 + * + * @param customerOrder 客户-订车 + * @return 客户-订车集合 + */ + public List selectCustomerOrderList(CustomerOrder customerOrder); + + /** + * 新增客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + public int insertCustomerOrder(CustomerOrder customerOrder); + + /** + * 修改客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + public int updateCustomerOrder(CustomerOrder customerOrder); + + /** + * 删除客户-订车 + * + * @param id 客户-订车主键 + * @return 结果 + */ + public int deleteCustomerOrderById(Long id); + + /** + * 批量删除客户-订车 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCustomerOrderByIds(Long[] ids); + + List getCustomerOrderPage(CustomerOrderVo customerOrder); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerOrderService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerOrderService.java new file mode 100644 index 00000000..b4f7e77d --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerOrderService.java @@ -0,0 +1,66 @@ +package com.ruoyi.system.service; + +import java.util.List; + +import com.mybatisflex.core.service.IService; +import com.ruoyi.system.domain.CustomerOrder; +import com.ruoyi.system.domain.vo.CustomerOrderVo; + +/** + * 客户-订车Service接口 + * + * @author ruoyi + * @date 2023-08-01 + */ +public interface ICustomerOrderService extends IService +{ + /** + * 查询客户-订车 + * + * @param id 客户-订车主键 + * @return 客户-订车 + */ + public CustomerOrder selectCustomerOrderById(Long id); + + /** + * 查询客户-订车列表 + * + * @param customerOrder 客户-订车 + * @return 客户-订车集合 + */ + public List selectCustomerOrderList(CustomerOrder customerOrder); + + /** + * 新增客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + public int insertCustomerOrder(CustomerOrder customerOrder); + + /** + * 修改客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + public int updateCustomerOrder(CustomerOrder customerOrder); + + /** + * 批量删除客户-订车 + * + * @param ids 需要删除的客户-订车主键集合 + * @return 结果 + */ + public int deleteCustomerOrderByIds(Long[] ids); + + /** + * 删除客户-订车信息 + * + * @param id 客户-订车主键 + * @return 结果 + */ + public int deleteCustomerOrderById(Long id); + + List getCustomerOrderPage(CustomerOrderVo customerOrder); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java index cd4eb899..555b38f4 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ICustomerService.java @@ -59,4 +59,6 @@ public interface ICustomerService * @return 结果 */ public int deleteCustomerById(Long id); + + List selectCustomerMakerList(CustomerVo customer); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerOrderServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerOrderServiceImpl.java new file mode 100644 index 00000000..4a2338cd --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerOrderServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import com.mybatisflex.spring.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.system.domain.vo.CustomerOrderVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.CustomerOrderMapper; +import com.ruoyi.system.domain.CustomerOrder; +import com.ruoyi.system.service.ICustomerOrderService; + +/** + * 客户-订车Service业务层处理 + * + * @author ruoyi + * @date 2023-08-01 + */ +@Service +public class CustomerOrderServiceImpl extends ServiceImpl implements ICustomerOrderService +{ + @Autowired + private CustomerOrderMapper customerOrderMapper; + + /** + * 查询客户-订车 + * + * @param id 客户-订车主键 + * @return 客户-订车 + */ + @Override + public CustomerOrder selectCustomerOrderById(Long id) + { + return customerOrderMapper.selectCustomerOrderById(id); + } + + /** + * 查询客户-订车列表 + * + * @param customerOrder 客户-订车 + * @return 客户-订车 + */ + @Override + public List selectCustomerOrderList(CustomerOrder customerOrder) + { + return customerOrderMapper.selectCustomerOrderList(customerOrder); + } + + /** + * 新增客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + @Override + public int insertCustomerOrder(CustomerOrder customerOrder) + { + customerOrder.setCreateTime(DateUtils.getNowDate()); + return customerOrderMapper.insertCustomerOrder(customerOrder); + } + + /** + * 修改客户-订车 + * + * @param customerOrder 客户-订车 + * @return 结果 + */ + @Override + public int updateCustomerOrder(CustomerOrder customerOrder) + { + customerOrder.setUpdateTime(DateUtils.getNowDate()); + return customerOrderMapper.updateCustomerOrder(customerOrder); + } + + /** + * 批量删除客户-订车 + * + * @param ids 需要删除的客户-订车主键 + * @return 结果 + */ + @Override + public int deleteCustomerOrderByIds(Long[] ids) + { + return customerOrderMapper.deleteCustomerOrderByIds(ids); + } + + /** + * 删除客户-订车信息 + * + * @param id 客户-订车主键 + * @return 结果 + */ + @Override + public int deleteCustomerOrderById(Long id) + { + return customerOrderMapper.deleteCustomerOrderById(id); + } + + @Override + public List getCustomerOrderPage(CustomerOrderVo customerOrder) { + return customerOrderMapper.getCustomerOrderPage(customerOrder); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java index e2988c62..15a9072b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomerServiceImpl.java @@ -109,6 +109,11 @@ public class CustomerServiceImpl implements ICustomerService return customerMapper.deleteCustomerById(id); } + @Override + public List selectCustomerMakerList(CustomerVo customer) { + return customerMapper.selectCustomerMakerList(customer); + } + /** * 新增跟进模块-客户跟进记录信息 * diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java index 4e4ae70d..75a4b0e2 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FollowUpServiceImpl.java @@ -63,12 +63,9 @@ public class FollowUpServiceImpl extends ServiceImpl i Customer customer = new Customer(); customer.setId(followUp.getCustomerId()); //如果跟进记录的跟进级别选择 - if("战败".equals(followUp.getFollowLevel())){ + if("fail".equals(followUp.getFollowResult())){ customer.setStatus("defeat"); customerMapper.updateCustomer(customer); - }else if("订车".equals(followUp.getFollowLevel())||"成交".equals(followUp.getFollowLevel())){ - customer.setStatus("order"); - customerMapper.updateCustomer(customer); } return followUpMapper.insertFollowUp(followUp); } diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml index 0916b6d5..276e5e7a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml @@ -65,34 +65,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + insert into f_customer diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerOrderMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerOrderMapper.xml new file mode 100644 index 00000000..790499e5 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerOrderMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + select id, customer_id, order_date, car_info, car_vin,out_date, car_status, create_by, create_time, update_by, update_time, remark from f_customer_order + + + + + + + + + insert into f_customer_order + + customer_id, + order_date, + out_date, + car_info, + car_vin, + car_status, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{customerId}, + #{orderDate}, + #{outDate}, + #{carInfo}, + #{carVin}, + #{carStatus}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update f_customer_order + + customer_id = #{customerId}, + order_date = #{orderDate}, + out_date = #{outDate}, + car_info = #{carInfo}, + car_vin = #{carVin}, + car_status = #{carStatus}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from f_customer_order where id = #{id} + + + + delete from f_customer_order where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml index eb060693..54e82fa7 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/FollowUpMapper.xml @@ -3,102 +3,134 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + - + + + - - - + + + + + - select id, customer_id, follow_up_date, follow_up_record, pre_to_store_date, create_by, create_time, update_by, update_time, remark, follow_level,follow_result,follow_up_method from f_follow_up + select id, customer_id,objective,follow_type,maker_status,arrival_time, follow_up_date, follow_up_method, follow_result, intention_level, follow_up_record, next_follow_up_record, next_follow_up_time, appointment_time, create_by, create_time, update_by, update_time, remark, defeat_reasons from f_follow_up - - where id = #{id} - + insert into f_follow_up customer_id, + maker_status, + follow_type, + arrival_time, follow_up_date, + follow_up_method, + follow_result, + intention_level, follow_up_record, - pre_to_store_date, + next_follow_up_record, + next_follow_up_time, + appointment_time, create_by, create_time, update_by, update_time, remark, - follow_level, - follow_result , - follow_up_method , - + defeat_reasons, + objective, + #{customerId}, + #{makerStatus}, + #{followType}, + #{arrivalTime}, #{followUpDate}, + #{followUpMethod}, + #{followResult}, + #{intentionLevel}, #{followUpRecord}, - #{preToStoreDate}, + #{nextFollowUpRecord}, + #{nextFollowUpTime}, + #{appointmentTime}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, - #{followLevel}, - #{followResult}, - #{followUpMethod}, - + #{defeatReasons}, + #{objective}, + update f_follow_up customer_id = #{customerId}, + maker_status = #{makerStatus}, + follow_type = #{followType}, + arrival_time = #{arrivalTime}, follow_up_date = #{followUpDate}, + follow_up_method = #{followUpMethod}, + follow_result = #{followResult}, + intention_level = #{intentionLevel}, follow_up_record = #{followUpRecord}, - pre_to_store_date = #{preToStoreDate}, + next_follow_up_record = #{nextFollowUpRecord}, + next_follow_up_time = #{nextFollowUpTime}, + appointment_time = #{appointmentTime}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, - follow_level = #{followLevel}, - follow_result = #{followResult}, - follow_up_method = #{followUpMethod}, + defeat_reasons = #{defeatReasons}, + objective = #{objective}, where id = #{id} - + delete from f_follow_up where id = #{id} - delete from f_follow_up where id in + delete from f_follow_up where id in #{id} diff --git a/ruoyi-ui/src/api/system/customer.js b/ruoyi-ui/src/api/system/customer.js index 1a7dfd47..ab391dbd 100644 --- a/ruoyi-ui/src/api/system/customer.js +++ b/ruoyi-ui/src/api/system/customer.js @@ -8,6 +8,14 @@ export function listCustomer(query) { params: query }) } +// 查询客户预约信息列表 +export function listCustomerMaker(query) { + return request({ + url: '/system/customer/makerList', + method: 'get', + params: query + }) +} // 查询客户信息列表 export function listCustomerFollow(query) { return request({ @@ -49,7 +57,13 @@ export function addCustomerFollowRecerd(data) { data: data }) } - +export function addCustomerOrderRecerd(data){ + return request({ + url: '/system/customerOrder', + method: 'post', + data: data + }) +} export function updateCustomerFollowRecerd(data) { return request({ url: '/system/up', @@ -57,6 +71,14 @@ export function updateCustomerFollowRecerd(data) { data: data }) } +//确认到店 +export function confirmToStore(data) { + return request({ + url: '/system/up', + method: 'put', + data: data + }) +} // 删除客户信息 export function delCustomer(id) { return request({ diff --git a/ruoyi-ui/src/api/system/customerOrder.js b/ruoyi-ui/src/api/system/customerOrder.js new file mode 100644 index 00000000..e0cd19c0 --- /dev/null +++ b/ruoyi-ui/src/api/system/customerOrder.js @@ -0,0 +1,58 @@ +import request from '@/utils/request' + +// 查询客户-订车列表 +export function listCustomerOrder(query) { + return request({ + url: '/system/customerOrder/list', + method: 'get', + params: query + }) +} +// 查询客户-订车列表 +export function getCustomerOrderPage(query) { + return request({ + url: '/system/customerOrder/getCustomerOrderPage', + method: 'get', + params: query + }) +} +export function confirmToOut(data){ + return request({ + url: '/system/customerOrder', + method: 'put', + data: data + }) +} +// 查询客户-订车详细 +export function getCustomerOrder(id) { + return request({ + url: '/system/customerOrder/' + id, + method: 'get' + }) +} + +// 新增客户-订车 +export function addCustomerOrder(data) { + return request({ + url: '/system/customerOrder', + method: 'post', + data: data + }) +} + +// 修改客户-订车 +export function updateCustomerOrder(data) { + return request({ + url: '/system/customerOrder', + method: 'put', + data: data + }) +} + +// 删除客户-订车 +export function delCustomerOrder(id) { + return request({ + url: '/system/customerOrder/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/utils/dict/Dict.js b/ruoyi-ui/src/utils/dict/Dict.js index 22db32fe..cddd4bbd 100644 --- a/ruoyi-ui/src/utils/dict/Dict.js +++ b/ruoyi-ui/src/utils/dict/Dict.js @@ -1,82 +1,91 @@ -import Vue from 'vue' -import { mergeRecursive } from "@/utils/ruoyi"; -import DictMeta from './DictMeta' -import DictData from './DictData' - -const DEFAULT_DICT_OPTIONS = { - types: [], -} - -/** - * @classdesc 字典 - * @property {Object} label 标签对象,内部属性名为字典类型名称 - * @property {Object} dict 字段数组,内部属性名为字典类型名称 - * @property {Array.} _dictMetas 字典元数据数组 - */ -export default class Dict { - constructor() { - this.owner = null - this.label = {} - this.type = {} - } - - init(options) { - if (options instanceof Array) { - options = { types: options } - } - const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) - if (opts.types === undefined) { - throw new Error('need dict types') - } - const ps = [] - this._dictMetas = opts.types.map(t => DictMeta.parse(t)) - this._dictMetas.forEach(dictMeta => { - const type = dictMeta.type - Vue.set(this.label, type, {}) - Vue.set(this.type, type, []) - if (dictMeta.lazy) { - return - } - ps.push(loadDict(this, dictMeta)) - }) - return Promise.all(ps) - } - - /** - * 重新加载字典 - * @param {String} type 字典类型 - */ - reloadDict(type) { - const dictMeta = this._dictMetas.find(e => e.type === type) - if (dictMeta === undefined) { - return Promise.reject(`the dict meta of ${type} was not found`) - } - return loadDict(this, dictMeta) - } -} - -/** - * 加载字典 - * @param {Dict} dict 字典 - * @param {DictMeta} dictMeta 字典元数据 - * @returns {Promise} - */ -function loadDict(dict, dictMeta) { - return dictMeta.request(dictMeta) - .then(response => { - const type = dictMeta.type - let dicts = dictMeta.responseConverter(response, dictMeta) - if (!(dicts instanceof Array)) { - console.error('the return of responseConverter must be Array.') - dicts = [] - } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { - console.error('the type of elements in dicts must be DictData') - dicts = [] - } - dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) - dicts.forEach(d => { - Vue.set(dict.label[type], d.value, d.label) - }) - return dicts - }) -} +import Vue from 'vue' +import { mergeRecursive } from "@/utils/ruoyi"; +import DictMeta from './DictMeta' +import DictData from './DictData' + +const DEFAULT_DICT_OPTIONS = { + types: [], +} +//字典翻译 +export function translateDict(list, e){ + var value = '' + list.map(i =>{ + if (i.code ==e) { + value =i.value + } + }) + return value +} +/** + * @classdesc 字典 + * @property {Object} label 标签对象,内部属性名为字典类型名称 + * @property {Object} dict 字段数组,内部属性名为字典类型名称 + * @property {Array.} _dictMetas 字典元数据数组 + */ +export default class Dict { + constructor() { + this.owner = null + this.label = {} + this.type = {} + } + + init(options) { + if (options instanceof Array) { + options = { types: options } + } + const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) + if (opts.types === undefined) { + throw new Error('need dict types') + } + const ps = [] + this._dictMetas = opts.types.map(t => DictMeta.parse(t)) + this._dictMetas.forEach(dictMeta => { + const type = dictMeta.type + Vue.set(this.label, type, {}) + Vue.set(this.type, type, []) + if (dictMeta.lazy) { + return + } + ps.push(loadDict(this, dictMeta)) + }) + return Promise.all(ps) + } + + /** + * 重新加载字典 + * @param {String} type 字典类型 + */ + reloadDict(type) { + const dictMeta = this._dictMetas.find(e => e.type === type) + if (dictMeta === undefined) { + return Promise.reject(`the dict meta of ${type} was not found`) + } + return loadDict(this, dictMeta) + } +} + +/** + * 加载字典 + * @param {Dict} dict 字典 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {Promise} + */ +function loadDict(dict, dictMeta) { + return dictMeta.request(dictMeta) + .then(response => { + const type = dictMeta.type + let dicts = dictMeta.responseConverter(response, dictMeta) + if (!(dicts instanceof Array)) { + console.error('the return of responseConverter must be Array.') + dicts = [] + } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { + console.error('the type of elements in dicts must be DictData') + dicts = [] + } + dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) + dicts.forEach(d => { + Vue.set(dict.label[type], d.value, d.label) + }) + return dicts + }) +} diff --git a/ruoyi-ui/src/views/system/bookManger/index.vue b/ruoyi-ui/src/views/system/bookManger/index.vue index 968736e5..5c425254 100644 --- a/ruoyi-ui/src/views/system/bookManger/index.vue +++ b/ruoyi-ui/src/views/system/bookManger/index.vue @@ -27,75 +27,23 @@ @keyup.enter.native="handleQuery" /> - - + + - - - - - - - - - - - - - - - - - - - - - - - - 搜索 重置 - + - - - - + + - - + - - + - - - - - - + + - - - - - - - @@ -348,14 +272,6 @@ placeholder="请选择预计到店"> - @@ -457,9 +373,10 @@ diff --git a/ruoyi-ui/src/views/system/potentialCustomer/index.vue b/ruoyi-ui/src/views/system/potentialCustomer/index.vue index 341a9bbd..9c49c2da 100644 --- a/ruoyi-ui/src/views/system/potentialCustomer/index.vue +++ b/ruoyi-ui/src/views/system/potentialCustomer/index.vue @@ -9,7 +9,6 @@ @keyup.enter.native="handleQuery" /> - - - - - - - - - - + + + - - - - + - - + + - + @@ -207,6 +188,13 @@ @click="handleFollow(scope.row)" v-hasPermi="['system:customer:edit']" >跟进 + 下订单 - - + + - + @@ -379,19 +367,14 @@ -

跟进方式: - - - -

-

级别: {{follow.followLevel}}

-

记录: {{follow.followUpRecord}}

-

再次预约到店日期: {{follow.preToStoreDate}}

+

跟进方式: {{follow.followUpMethod}}

+

跟进结果: {{follow.followResultDesc}}

+

意向级别: {{follow.intentionLevel}}

+

跟进记录: {{follow.followUpRecord}}

+

预约时间: {{follow.appointmentTime}}

+

下次跟进时间: {{follow.nextFollowUpTime}}

+

下次跟进记录: {{follow.nextFollowUpRecord}}

+

战败原因: {{follow.defeatReasons}}

提交于 {{follow.createTime}}

@@ -416,11 +399,39 @@ />
- + - - + + + {{ dict.label }} + + + + + + + + + + + + + + + + - - - - - - + +
@@ -446,8 +449,54 @@ 取 消
- + + + + + {{orderForm.customerName}} + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -458,13 +507,12 @@ import { delCustomer, addCustomer, updateCustomer, - addCustomerFollowRecerd, updateCustomerFollowRecerd, listCustomerFollow + addCustomerFollowRecerd, updateCustomerFollowRecerd, listCustomerFollow, addCustomerOrderRecerd } from "@/api/system/customer"; -import Data from "@/views/system/dict/data"; export default { name: "potentialCustomer", - dicts: ['to_store_status', 'customer_source','customer_status', 'sys_user_sex', 'customer_level', 'clue_channels','follow_result','follow_up_method'], + dicts: ['to_store_status','car_status' ,'customer_source','customer_status', 'sys_user_sex', 'customer_level', 'clue_channels','follow_result','follow_up_method'], data() { return { drawer:false, @@ -472,6 +520,7 @@ export default { innerDrawer:false, dafaultValue:null, customerId:null, + customerStatus:null, // 遮罩层 loading: true, followTitle:null, @@ -495,6 +544,23 @@ export default { title: "", // 是否显示弹出层 open: false, + orderOpen:false, + orderTitle:null, + orderForm:{}, + orderRules:{ + orderDate: [ + { required: true, message: "订单日期不能为空", trigger: "blur" } + ], + carInfo: [ + { required: true, message: "车辆信息不能为空", trigger: "blur" } + ], + carVin: [ + { required: true, message: "车辆VIN不能为空", trigger: "blur" } + ], + carStatus:[ + { required: true, message: "车辆状态不能为空", trigger: "change" } + ], + }, // 查询参数 queryParams: { pageNum: 1, @@ -507,7 +573,7 @@ export default { status: null, wechat: null, intentionCarModels: null, - preToStoreDate: null, + appointmentTime: null, orderDate: null }, // 表单参数 @@ -518,6 +584,13 @@ export default { followUpDate:null, customerId:null, }, + followFormShow:{ + appointmentTimeShow:false, + intentionLevelShow:false, + nextFollowUpTimeShow:false, + nextFollowUpRecordShow:false, + defeatReasonsShow:false, + }, // 表单校验 rules: { userName: [ @@ -544,7 +617,7 @@ export default { followUpRecord:[ { required: true, message: "跟进记录不能为空", trigger: "blur" } ], - followLevel: [ + intentionLevel: [ { required: true, message: "级别不能为空", trigger: "blur" } ], followUpMethod:[ @@ -556,39 +629,39 @@ export default { }, // 列表的列的显示隐藏设置 columns:[ - { key: 0, label: `客户ID`, visible: true }, + { key: 0, label: `客户ID`, visible: false }, { key: 1, label: `客户名`, visible: true }, - { key: 2, label: `客户昵称`, visible: true }, + { key: 2, label: `客户昵称`, visible: false }, { key: 3, label: `客户级别`, visible: true }, { key: 4, label: `用户邮箱`, visible: true }, { key: 5, label: `手机号码`, visible: true }, { key: 6, label: `客户性别`, visible: true }, - { key: 7, label: `头像地址`, visible: true }, - { key: 8, label: `线索渠道`, visible: true }, - { key: 9, label: `信息来源`, visible: true }, + { key: 7, label: `头像地址`, visible: false }, + { key: 8, label: `线索渠道`, visible: false }, + { key: 9, label: `信息来源`, visible: false }, { key: 10, label: `客户居住`, visible: true }, { key: 11, label: `到店状态`, visible: true }, - { key: 12, label: `删除标志`, visible: true }, - { key: 13, label: `最后登录IP`, visible: true }, - { key: 14, label: `最后登录时间`, visible: true }, - { key: 15, label: `创建者`, visible: true }, + { key: 12, label: `删除标志`, visible: false }, + { key: 13, label: `最后登录IP`, visible: false }, + { key: 14, label: `最后登录时间`, visible: false }, + { key: 15, label: `创建者`, visible: false }, { key: 16, label: `创建时间`, visible: true }, - { key: 17, label: `更新者`, visible: true }, + { key: 17, label: `更新者`, visible: false }, { key: 18, label: `更新时间`, visible: true }, - { key: 19, label: `备注`, visible: true }, + { key: 19, label: `备注`, visible: false }, { key: 20, label: `微信号`, visible: true }, - { key: 21, label: `购车类型`, visible: true }, - { key: 22, label: `已有车辆`, visible: true }, - { key: 23, label: `是否评估`, visible: true }, + { key: 21, label: `购车类型`, visible: false }, + { key: 22, label: `已有车辆`, visible: false }, + { key: 23, label: `是否评估`, visible: false }, { key: 24, label: `意向车型`, visible: true }, - { key: 25, label: `对比车型`, visible: true }, - { key: 26, label: `是否试驾`, visible: true }, - { key: 27, label: `是否报价`, visible: true }, - { key: 28, label: `是否金融`, visible: true }, - { key: 29, label: `未订车原因`, visible: true }, - { key: 30, label: `预计到店`, visible: true }, - { key: 31, label: `最后到店`, visible: true }, - { key: 32, label: `4S店`, visible: true }, + { key: 25, label: `对比车型`, visible: false }, + { key: 26, label: `是否试驾`, visible: false }, + { key: 27, label: `是否报价`, visible: false }, + { key: 28, label: `是否金融`, visible: false }, + { key: 29, label: `未订车原因`, visible: false }, + { key: 30, label: `预计到店`, visible: false }, + { key: 31, label: `最后到店`, visible: false }, + { key: 32, label: `4S店`, visible: false }, { key: 33, label: `下单日期`, visible: true }, { key: 34, label: `跟进次数`, visible: true }, { key: 35, label: `最新跟进日`, visible: true }, @@ -620,18 +693,40 @@ export default { }, /** 查询客户跟进信息列表 */ getFollowList(customerId) { + let that = this; this.loading = true; let queryParams = { customerId:customerId, pageNum:1, pageSize:1000, + followType:'potential' } + let dictType = that.dict.type; listCustomerFollow(queryParams).then(response => { this.followUpList = response.rows; + //赋值 + for (let follow of this.followUpList) { + let followUpMethod = this.getDictLableByVal(dictType.follow_up_method,follow.followUpMethod); + let followResult = this.getDictLableByVal(dictType.follow_result,follow.followResult); + let intentionLevel = this.getDictLableByVal(dictType.customer_level,follow.intentionLevel); + follow.followUpMethod = followUpMethod; + follow.followResultDesc = followResult; + follow.intentionLevel = intentionLevel; + } this.total = response.total; this.loading = false; }); }, + //跟进字典val获取描述 + getDictLableByVal(dictData,val){ + let lable = ''; + dictData.map(i =>{ + if (i.value == val) { + lable = i.label + } + }) + return lable + }, // 取消按钮 cancel() { this.open = false; @@ -670,7 +765,7 @@ export default { isOffer: null, isFinance: null, unBookingCarReason: null, - preToStoreDate: null, + appointmentTime: null, lastToStoreDate: null, storeName: null, orderDate: null @@ -716,14 +811,39 @@ export default { handleFollow(row){ this.drawer = true; this.customerId = row.id; - this.followTitle = row.userName + " 跟进记录"; + this.customerStatus = row.status; + this.followTitle = row.userName +" "+ row.phoneNumber+" 跟进记录"; this.getFollowList(this.customerId); }, + //订车 + handleToOrder(row){ + this.orderForm.customerId = row.id; + this.orderForm.customerName = row.userName; + this.orderForm.carStatus = 'notOut'; + this.orderOpen = true; + this.orderTitle = "新增订单"; + }, + orderSubmitForm(){ + this.$refs["orderForm"].validate(valid => { + if (valid) { + addCustomerOrderRecerd(this.orderForm).then(response => { + this.$modal.msgSuccess("订单新增成功"); + this.orderOpen = false; + this.getList(this.customerId); + }); + } + }); + }, + orderCancel(){ + this.orderOpen = false; + this.orderForm = { }; + }, handleDrawerAddFollowUp(){ this.innerDrawer = true; this.followForm = {}; this.followForm.followUpDate = new Date(); this.followForm.customerId = this.customerId; + this.followForm.followType = this.customerStatus; }, /** 提交按钮 */ submitForm() { @@ -785,9 +905,9 @@ export default { let obj = {}; obj.followUpDate = ""; obj.followUpRecord = ""; - obj.preToStoreDate = ""; + obj.appointmentTime = ""; obj.remark = ""; - obj.followLevel = ""; + obj.intentionLevel = ""; this.followUpList.push(obj); }, /** 跟进模块-客户跟进记录删除按钮操作 */ @@ -802,6 +922,35 @@ export default { }); } }, + //新增跟进时,选择跟进结果实现不同表单校验 + selctRadion(e){ + if(e=='fail'){ + // this.followRules.defeatReasons = [{required: true, message: "战败原因不能为空", trigger: "blur"}] + this.followRules.intentionLevel = []; + this.followRules.nextFollowUpTime = []; + this.followFormShow.defeatReasonsShow = true; + this.followFormShow.appointmentTimeShow=false; + this.followFormShow.intentionLevelShow=false; + this.followFormShow.nextFollowUpTimeShow=false; + this.followFormShow.nextFollowUpRecordShow=false; + }else if(e=='going'){ + this.followRules.defeatReasons = []; + this.followRules.appointmentTime = []; + this.followFormShow.defeatReasonsShow = false; + this.followFormShow.appointmentTimeShow=false; + this.followFormShow.intentionLevelShow=true; + this.followFormShow.nextFollowUpTimeShow=true; + this.followFormShow.nextFollowUpRecordShow=true; + }else if(e=='maker'){ + this.followRules.defeatReasons = []; + this.followFormShow.defeatReasonsShow = false; + this.followFormShow.appointmentTimeShow=true; + this.followFormShow.intentionLevelShow=true; + this.followFormShow.nextFollowUpTimeShow=true; + this.followFormShow.nextFollowUpRecordShow=true; + this.followForm.makerStatus ="waitStore"; + } + }, /** 复选框选中数据 */ handleFollowUpSelectionChange(selection) { this.checkedFollowUp = selection.map(item => item.index) diff --git a/ruoyi-ui/src/views/system/salesFollowUp/index.vue b/ruoyi-ui/src/views/system/salesFollowUp/index.vue index 1f110e72..47384a7e 100644 --- a/ruoyi-ui/src/views/system/salesFollowUp/index.vue +++ b/ruoyi-ui/src/views/system/salesFollowUp/index.vue @@ -1,95 +1,46 @@