parent
b3519d6782
commit
e4339a1e13
@ -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<CustomerOrder> list = customerOrderService.selectCustomerOrderList(customerOrder);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getCustomerOrderPage")
|
||||||
|
public TableDataInfo getCustomerOrderPage(CustomerOrderVo customerOrder)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<CustomerOrderVo> 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<CustomerOrder> list = customerOrderService.selectCustomerOrderList(customerOrder);
|
||||||
|
ExcelUtil<CustomerOrder> util = new ExcelUtil<CustomerOrder>(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));
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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<CustomerOrder>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户-订车
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 客户-订车
|
||||||
|
*/
|
||||||
|
public CustomerOrder selectCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户-订车列表
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 客户-订车集合
|
||||||
|
*/
|
||||||
|
public List<CustomerOrder> 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<CustomerOrderVo> getCustomerOrderPage(CustomerOrderVo customerOrder);
|
||||||
|
}
|
@ -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<CustomerOrder>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户-订车
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 客户-订车
|
||||||
|
*/
|
||||||
|
public CustomerOrder selectCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户-订车列表
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 客户-订车集合
|
||||||
|
*/
|
||||||
|
public List<CustomerOrder> 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<CustomerOrderVo> getCustomerOrderPage(CustomerOrderVo customerOrder);
|
||||||
|
}
|
@ -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<CustomerOrderMapper, CustomerOrder> 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<CustomerOrder> 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<CustomerOrderVo> getCustomerOrderPage(CustomerOrderVo customerOrder) {
|
||||||
|
return customerOrderMapper.getCustomerOrderPage(customerOrder);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.CustomerOrderMapper">
|
||||||
|
|
||||||
|
<resultMap type="CustomerOrder" id="CustomerOrderResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="customerId" column="customer_id" />
|
||||||
|
<result property="orderDate" column="order_date" />
|
||||||
|
<result property="carInfo" column="car_info" />
|
||||||
|
<result property="carVin" column="car_vin" />
|
||||||
|
<result property="carStatus" column="car_status" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="outDate" column="out_date"/>
|
||||||
|
<result property="carStatus" column="car_status"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectCustomerOrderVo">
|
||||||
|
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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectCustomerOrderList" parameterType="CustomerOrder" resultMap="CustomerOrderResult">
|
||||||
|
<include refid="selectCustomerOrderVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
||||||
|
<if test="outDate != null "> and out_date = #{outDate}</if>
|
||||||
|
<if test="orderDate != null "> and order_date = #{orderDate}</if>
|
||||||
|
<if test="carInfo != null and carInfo != ''"> and car_info = #{carInfo}</if>
|
||||||
|
<if test="carVin != null and carVin != ''"> and car_vin = #{carVin}</if>
|
||||||
|
<if test="carStatus != null and carStatus != ''"> and car_status = #{carStatus}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCustomerOrderById" parameterType="Long" resultMap="CustomerOrderResult">
|
||||||
|
<include refid="selectCustomerOrderVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="getCustomerOrderPage" resultType="com.ruoyi.system.domain.vo.CustomerOrderVo">
|
||||||
|
SELECT *,DATE_ADD(t.order_date, INTERVAL 7 DAY) as planFollowUpDate,f.create_time as actualFollowUpDate FROM f_customer_order t
|
||||||
|
LEFT JOIN f_customer c ON c.id = t.customer_id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT a.* FROM f_follow_up AS a
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT MAX(create_time) AS create_time, customer_id FROM f_follow_up GROUP BY customer_id
|
||||||
|
) AS b ON a.customer_id = b.customer_id where a.create_time = b.create_time
|
||||||
|
) f on f.customer_id = c.id
|
||||||
|
<where>
|
||||||
|
<if test="phoneNumber != null and phoneNumber != ''"> and c.phone_number like concat('%', #{phoneNumber}, '%')</if>
|
||||||
|
<if test="userName != null and userName != ''"> and c.user_name like concat('%', #{userName}, '%')</if>
|
||||||
|
<if test="status != null "> and c.status = #{status}</if>
|
||||||
|
<if test="customerId != null "> and t.customer_id = #{customerId}</if>
|
||||||
|
<if test="orderDate != null "> and t.order_date = #{orderDate}</if>
|
||||||
|
<if test="outDate != null "> and t.out_date = #{outDate}</if>
|
||||||
|
<if test="carInfo != null and carInfo != ''"> and t.car_info like concat('%', #{carInfo}, '%')</if>
|
||||||
|
<if test="carVin != null and carVin != ''"> and t.car_vin like concat('%', #{carVin}, '%')</if>
|
||||||
|
<if test="carStatus != null and carStatus != ''"> and t.car_status like concat('%', #{carStatus}, '%') </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCustomerOrder" parameterType="CustomerOrder" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into f_customer_order
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="customerId != null">customer_id,</if>
|
||||||
|
<if test="orderDate != null">order_date,</if>
|
||||||
|
<if test="outDate != null">out_date,</if>
|
||||||
|
<if test="carInfo != null">car_info,</if>
|
||||||
|
<if test="carVin != null">car_vin,</if>
|
||||||
|
<if test="carStatus != null">car_status,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="customerId != null">#{customerId},</if>
|
||||||
|
<if test="orderDate != null">#{orderDate},</if>
|
||||||
|
<if test="outDate != null">#{outDate},</if>
|
||||||
|
<if test="carInfo != null">#{carInfo},</if>
|
||||||
|
<if test="carVin != null">#{carVin},</if>
|
||||||
|
<if test="carStatus != null">#{carStatus},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCustomerOrder" parameterType="CustomerOrder">
|
||||||
|
update f_customer_order
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||||
|
<if test="orderDate != null">order_date = #{orderDate},</if>
|
||||||
|
<if test="outDate != null">out_date = #{outDate},</if>
|
||||||
|
<if test="carInfo != null">car_info = #{carInfo},</if>
|
||||||
|
<if test="carVin != null">car_vin = #{carVin},</if>
|
||||||
|
<if test="carStatus != null">car_status = #{carStatus},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteCustomerOrderById" parameterType="Long">
|
||||||
|
delete from f_customer_order where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteCustomerOrderByIds" parameterType="String">
|
||||||
|
delete from f_customer_order where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -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'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,385 @@
|
|||||||
|
<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="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
placeholder="请输入客户"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户手机" prop="phoneNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.phoneNumber"
|
||||||
|
placeholder="请输入客户手机号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订车时间" prop="orderDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.orderDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择订车时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆详细" prop="carInfo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.carInfo"
|
||||||
|
placeholder="请输入车辆详细"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆VIN" prop="carVin">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.carVin"
|
||||||
|
placeholder="请输入车辆VIN"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</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"
|
||||||
|
v-hasPermi="['system:customerOrder:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>-->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:customerOrder:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:customerOrder:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>-->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:customerOrder:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="customerOrderList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="客户" align="center" prop="userName" />
|
||||||
|
<el-table-column label="客户手机" align="center" prop="phoneNumber" />
|
||||||
|
<el-table-column label="客户性别" align="center" prop="sex" show-overflow-tooltip >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="线索渠道" align="center" prop="clueChannel" show-overflow-tooltip >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.clue_channels" :value="scope.row.clueChannel"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="信息来源" align="center" prop="dataSource" show-overflow-tooltip >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.customer_source" :value="scope.row.dataSource"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订车时间" align="center" prop="orderDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.orderDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="车辆详细" align="center" prop="carInfo" width="280"/>
|
||||||
|
<el-table-column label="车辆VIN" align="center" prop="carVin" width="220" />
|
||||||
|
<el-table-column label="车辆状态" align="center" prop="carStatus" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.car_status" :value="scope.row.carStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="出库日期" align="center" prop="outDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.outDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="创建者" align="center" prop="createBy" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="更新者" align="center" prop="updateBy" />
|
||||||
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>-->
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
|
||||||
|
<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)"
|
||||||
|
v-hasPermi="['system:customerOrder:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-popconfirm title="是否确认出库?" @confirm="popConfirm(scope.row)" @cancel="popCancel" >
|
||||||
|
<el-button v-if="scope.row.carStatus =='notOut'" size="mini" type="text" icon="el-icon-check" slot="reference">确认出库</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改客户-订车对话框 -->
|
||||||
|
<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="客户id" prop="customerId">
|
||||||
|
<el-input v-model="form.customerId" placeholder="请输入客户id" />
|
||||||
|
</el-form-item>-->
|
||||||
|
<el-form-item label="订车时间" prop="orderDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.orderDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择订车时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆详细" prop="carInfo">
|
||||||
|
<el-input v-model="form.carInfo" placeholder="请输入车辆详细" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆VIN" prop="carVin">
|
||||||
|
<el-input v-model="form.carVin" placeholder="请输入车辆VIN" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车辆状态" prop="carStatus">
|
||||||
|
<el-select v-model="form.carStatus" placeholder="请选择车辆状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.car_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</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 type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { confirmToOut,getCustomerOrderPage, getCustomerOrder, delCustomerOrder, addCustomerOrder, updateCustomerOrder } from "@/api/system/customerOrder";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "CustomerOrder",
|
||||||
|
dicts: ['to_store_status', 'customer_source','customer_status', 'sys_user_sex', 'customer_level', 'clue_channels','follow_result','car_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 客户-订车表格数据
|
||||||
|
customerOrderList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
customerId: null,
|
||||||
|
orderDate: null,
|
||||||
|
carInfo: null,
|
||||||
|
carVin: null,
|
||||||
|
carStatus: null,
|
||||||
|
orderByColumn:'t.order_date',
|
||||||
|
isAsc:'desc'
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询客户-订车列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getCustomerOrderPage(this.queryParams).then(response => {
|
||||||
|
this.customerOrderList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
customerId: null,
|
||||||
|
orderDate: null,
|
||||||
|
carInfo: null,
|
||||||
|
carVin: null,
|
||||||
|
carStatus: "0",
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
popConfirm(row){
|
||||||
|
let param = {
|
||||||
|
id : row.id,
|
||||||
|
carStatus:'outbound',
|
||||||
|
outDate:this.getDateYYYYMMddHHMMSS()
|
||||||
|
}
|
||||||
|
confirmToOut(param).then(response => {
|
||||||
|
this.$modal.msgSuccess("出库成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
popCancel(){
|
||||||
|
console.log('取消')
|
||||||
|
},
|
||||||
|
getDateYYYYMMddHHMMSS(){
|
||||||
|
const date = new Date();
|
||||||
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
const strDate = date.getDate().toString().padStart(2, '0');
|
||||||
|
const starHours = date.getHours().toString().padStart(2, '0');
|
||||||
|
const starMinutes = date.getMinutes().toString().padStart(2, '0');
|
||||||
|
const starSeconds = date.getSeconds().toString().padStart(2, '0');
|
||||||
|
return `${date.getFullYear()}-${month}-${strDate} ${starHours}:${starMinutes}:${starSeconds}`;
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加客户-订车";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getCustomerOrder(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改客户-订车";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateCustomerOrder(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCustomerOrder(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除客户-订车编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delCustomerOrder(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/customerOrder/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `customerOrder_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue