订单管理界面
This commit is contained in:
parent
cf70d53d7f
commit
abf4cf2dc2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/custom
ruoyi-custom/src/main
java/com/ruoyi/custom
domain
mapper
service
resources/mapper/custom
ruoyi-system/src/main
ruoyi-ui/src
sql
@ -1,4 +1,4 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
package com.ruoyi.web.controller.custom;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -15,19 +15,19 @@ import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysOrder;
|
||||
import com.ruoyi.system.service.ISysOrderService;
|
||||
import com.ruoyi.custom.domain.SysOrder;
|
||||
import com.ruoyi.custom.service.ISysOrderService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 销售订单Controller
|
||||
*
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-23
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/order")
|
||||
@RequestMapping("/custom/order")
|
||||
public class SysOrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
@ -36,7 +36,7 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:list')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOrder sysOrder)
|
||||
{
|
||||
@ -48,7 +48,7 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 导出销售订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:export')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:export')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysOrder sysOrder)
|
||||
@ -61,7 +61,7 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 获取销售订单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:query')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:query')")
|
||||
@GetMapping(value = "/{orderId}")
|
||||
public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
|
||||
{
|
||||
@ -71,7 +71,7 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 新增销售订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:add')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:add')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysOrder sysOrder)
|
||||
@ -82,7 +82,7 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 修改销售订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:edit')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysOrder sysOrder)
|
||||
@ -93,11 +93,11 @@ public class SysOrderController extends BaseController
|
||||
/**
|
||||
* 删除销售订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:order:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:remove')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{orderIds}")
|
||||
@DeleteMapping("/{orderIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] orderIds)
|
||||
{
|
||||
return toAjax(sysOrderService.deleteSysOrderByIds(orderIds));
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 业务提成比例对象 sys_commision
|
||||
*
|
||||
@ -27,7 +29,7 @@ public class SysCommision extends BaseEntity
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private Long amount;
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 分成比例 */
|
||||
@Excel(name = "分成比例")
|
||||
@ -60,12 +62,9 @@ public class SysCommision extends BaseEntity
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setAmount(Long amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
public void setAmount(BigDecimal amount) { this.amount = amount; }
|
||||
|
||||
public Long getAmount()
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
359
ruoyi-custom/src/main/java/com/ruoyi/custom/domain/SysOrder.java
Normal file
359
ruoyi-custom/src/main/java/com/ruoyi/custom/domain/SysOrder.java
Normal file
@ -0,0 +1,359 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 销售订单对象 sys_order
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public class SysOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long orderId;
|
||||
|
||||
/** 客户姓名 */
|
||||
@Excel(name = "客户姓名")
|
||||
private String customer;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
private String phone;
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 收款方式 */
|
||||
private Long payTypeId;
|
||||
|
||||
/** 收款方式 */
|
||||
@Excel(name = "收款方式")
|
||||
private String payType;
|
||||
|
||||
/** 售前 */
|
||||
private Long preSaleId;
|
||||
|
||||
/** 售前 */
|
||||
@Excel(name = "售前")
|
||||
private String preSale;
|
||||
|
||||
/** 售后 */
|
||||
private Long afterSaleId;
|
||||
|
||||
/** 售后 */
|
||||
@Excel(name = "售后")
|
||||
private String afterSale;
|
||||
|
||||
/** 营养师 */
|
||||
private Long nutritionistId;
|
||||
|
||||
/** 营养师 */
|
||||
@Excel(name = "营养师")
|
||||
private String nutritionist;
|
||||
|
||||
/** 助理营养师 */
|
||||
private Long nutriAssisId;
|
||||
|
||||
/** 助理营养师 */
|
||||
@Excel(name = "助理营养师")
|
||||
private String nutriAssis;
|
||||
|
||||
/** 账号 */
|
||||
private Long accountId;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String account;
|
||||
|
||||
/** 策划 */
|
||||
private Long plannerId;
|
||||
|
||||
/** 策划 */
|
||||
@Excel(name = "策划")
|
||||
private String planner;
|
||||
|
||||
/** 策划助理 */
|
||||
private Long plannerAssisId;
|
||||
|
||||
/** 策划助理 */
|
||||
@Excel(name = "策划助理")
|
||||
private String plannerAssis;
|
||||
|
||||
/** 运营 */
|
||||
private Long operatorId;
|
||||
|
||||
/** 运营 */
|
||||
@Excel(name = "运营")
|
||||
private String operator;
|
||||
|
||||
/** 推荐人 */
|
||||
@Excel(name = "推荐人")
|
||||
private String recommender;
|
||||
|
||||
/** 成交日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成交日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderTime;
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setCustomer(String customer)
|
||||
{
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public String getCustomer()
|
||||
{
|
||||
return customer;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setPayTypeId(Long payTypeId)
|
||||
{
|
||||
this.payTypeId = payTypeId;
|
||||
}
|
||||
|
||||
public Long getPayTypeId()
|
||||
{
|
||||
return payTypeId;
|
||||
}
|
||||
public void setPayType(String payType)
|
||||
{
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public String getPayType()
|
||||
{
|
||||
return payType;
|
||||
}
|
||||
public void setPreSaleId(Long preSaleId)
|
||||
{
|
||||
this.preSaleId = preSaleId;
|
||||
}
|
||||
|
||||
public Long getPreSaleId()
|
||||
{
|
||||
return preSaleId;
|
||||
}
|
||||
public void setPreSale(String preSale)
|
||||
{
|
||||
this.preSale = preSale;
|
||||
}
|
||||
|
||||
public String getPreSale()
|
||||
{
|
||||
return preSale;
|
||||
}
|
||||
public void setAfterSaleId(Long afterSaleId)
|
||||
{
|
||||
this.afterSaleId = afterSaleId;
|
||||
}
|
||||
|
||||
public Long getAfterSaleId()
|
||||
{
|
||||
return afterSaleId;
|
||||
}
|
||||
public void setAfterSale(String afterSale)
|
||||
{
|
||||
this.afterSale = afterSale;
|
||||
}
|
||||
|
||||
public String getAfterSale()
|
||||
{
|
||||
return afterSale;
|
||||
}
|
||||
public void setNutritionistId(Long nutritionistId)
|
||||
{
|
||||
this.nutritionistId = nutritionistId;
|
||||
}
|
||||
|
||||
public Long getNutritionistId()
|
||||
{
|
||||
return nutritionistId;
|
||||
}
|
||||
public void setNutritionist(String nutritionist)
|
||||
{
|
||||
this.nutritionist = nutritionist;
|
||||
}
|
||||
|
||||
public String getNutritionist()
|
||||
{
|
||||
return nutritionist;
|
||||
}
|
||||
public void setNutriAssisId(Long nutriAssisId)
|
||||
{
|
||||
this.nutriAssisId = nutriAssisId;
|
||||
}
|
||||
|
||||
public Long getNutriAssisId()
|
||||
{
|
||||
return nutriAssisId;
|
||||
}
|
||||
public void setNutriAssis(String nutriAssis)
|
||||
{
|
||||
this.nutriAssis = nutriAssis;
|
||||
}
|
||||
|
||||
public String getNutriAssis()
|
||||
{
|
||||
return nutriAssis;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setAccount(String account)
|
||||
{
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccount()
|
||||
{
|
||||
return account;
|
||||
}
|
||||
public void setPlannerId(Long plannerId)
|
||||
{
|
||||
this.plannerId = plannerId;
|
||||
}
|
||||
|
||||
public Long getPlannerId()
|
||||
{
|
||||
return plannerId;
|
||||
}
|
||||
public void setPlanner(String planner)
|
||||
{
|
||||
this.planner = planner;
|
||||
}
|
||||
|
||||
public String getPlanner()
|
||||
{
|
||||
return planner;
|
||||
}
|
||||
public void setPlannerAssisId(Long plannerAssisId)
|
||||
{
|
||||
this.plannerAssisId = plannerAssisId;
|
||||
}
|
||||
|
||||
public Long getPlannerAssisId()
|
||||
{
|
||||
return plannerAssisId;
|
||||
}
|
||||
public void setPlannerAssis(String plannerAssis)
|
||||
{
|
||||
this.plannerAssis = plannerAssis;
|
||||
}
|
||||
|
||||
public String getPlannerAssis()
|
||||
{
|
||||
return plannerAssis;
|
||||
}
|
||||
public void setOperatorId(Long operatorId)
|
||||
{
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public Long getOperatorId()
|
||||
{
|
||||
return operatorId;
|
||||
}
|
||||
public void setOperator(String operator)
|
||||
{
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperator()
|
||||
{
|
||||
return operator;
|
||||
}
|
||||
public void setRecommender(String recommender)
|
||||
{
|
||||
this.recommender = recommender;
|
||||
}
|
||||
|
||||
public String getRecommender()
|
||||
{
|
||||
return recommender;
|
||||
}
|
||||
public void setOrderTime(Date orderTime)
|
||||
{
|
||||
this.orderTime = orderTime;
|
||||
}
|
||||
|
||||
public Date getOrderTime()
|
||||
{
|
||||
return orderTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("orderId", getOrderId())
|
||||
.append("customer", getCustomer())
|
||||
.append("phone", getPhone())
|
||||
.append("amount", getAmount())
|
||||
.append("payTypeId", getPayTypeId())
|
||||
.append("payType", getPayType())
|
||||
.append("preSaleId", getPreSaleId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("preSale", getPreSale())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("afterSaleId", getAfterSaleId())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("afterSale", getAfterSale())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("nutritionistId", getNutritionistId())
|
||||
.append("remark", getRemark())
|
||||
.append("nutritionist", getNutritionist())
|
||||
.append("nutriAssisId", getNutriAssisId())
|
||||
.append("nutriAssis", getNutriAssis())
|
||||
.append("accountId", getAccountId())
|
||||
.append("account", getAccount())
|
||||
.append("plannerId", getPlannerId())
|
||||
.append("planner", getPlanner())
|
||||
.append("plannerAssisId", getPlannerAssisId())
|
||||
.append("plannerAssis", getPlannerAssis())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("operator", getOperator())
|
||||
.append("recommender", getRecommender())
|
||||
.append("orderTime", getOrderTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
package com.ruoyi.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysOrder;
|
||||
import com.ruoyi.custom.domain.SysOrder;
|
||||
|
||||
/**
|
||||
* 销售订单Mapper接口
|
||||
*
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-23
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysOrderMapper
|
||||
public interface SysOrderMapper
|
||||
{
|
||||
/**
|
||||
* 查询销售订单
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 销售订单
|
||||
*/
|
||||
@ -21,7 +21,7 @@ public interface SysOrderMapper
|
||||
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 销售订单集合
|
||||
*/
|
||||
@ -29,7 +29,7 @@ public interface SysOrderMapper
|
||||
|
||||
/**
|
||||
* 新增销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -37,7 +37,7 @@ public interface SysOrderMapper
|
||||
|
||||
/**
|
||||
* 修改销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -45,7 +45,7 @@ public interface SysOrderMapper
|
||||
|
||||
/**
|
||||
* 删除销售订单
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -53,9 +53,9 @@ public interface SysOrderMapper
|
||||
|
||||
/**
|
||||
* 批量删除销售订单
|
||||
*
|
||||
*
|
||||
* @param orderIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOrderByIds(Long[] orderIds);
|
||||
}
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
package com.ruoyi.system.service;
|
||||
package com.ruoyi.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysOrder;
|
||||
import com.ruoyi.custom.domain.SysOrder;
|
||||
|
||||
/**
|
||||
* 销售订单Service接口
|
||||
*
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-23
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface ISysOrderService
|
||||
public interface ISysOrderService
|
||||
{
|
||||
/**
|
||||
* 查询销售订单
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 销售订单
|
||||
*/
|
||||
@ -21,7 +21,7 @@ public interface ISysOrderService
|
||||
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 销售订单集合
|
||||
*/
|
||||
@ -29,7 +29,7 @@ public interface ISysOrderService
|
||||
|
||||
/**
|
||||
* 新增销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -37,7 +37,7 @@ public interface ISysOrderService
|
||||
|
||||
/**
|
||||
* 修改销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -45,7 +45,7 @@ public interface ISysOrderService
|
||||
|
||||
/**
|
||||
* 批量删除销售订单
|
||||
*
|
||||
*
|
||||
* @param orderIds 需要删除的销售订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -53,9 +53,9 @@ public interface ISysOrderService
|
||||
|
||||
/**
|
||||
* 删除销售订单信息
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysOrderById(Long orderId);
|
||||
}
|
||||
}
|
@ -1,28 +1,28 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
package com.ruoyi.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysOrderMapper;
|
||||
import com.ruoyi.system.domain.SysOrder;
|
||||
import com.ruoyi.system.service.ISysOrderService;
|
||||
import com.ruoyi.custom.mapper.SysOrderMapper;
|
||||
import com.ruoyi.custom.domain.SysOrder;
|
||||
import com.ruoyi.custom.service.ISysOrderService;
|
||||
|
||||
/**
|
||||
* 销售订单Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-23
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysOrderServiceImpl implements ISysOrderService
|
||||
public class SysOrderServiceImpl implements ISysOrderService
|
||||
{
|
||||
@Autowired
|
||||
private SysOrderMapper sysOrderMapper;
|
||||
|
||||
/**
|
||||
* 查询销售订单
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 销售订单
|
||||
*/
|
||||
@ -34,7 +34,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 销售订单
|
||||
*/
|
||||
@ -46,7 +46,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
|
||||
/**
|
||||
* 新增销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -59,7 +59,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
|
||||
/**
|
||||
* 修改销售订单
|
||||
*
|
||||
*
|
||||
* @param sysOrder 销售订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ -72,7 +72,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
|
||||
/**
|
||||
* 批量删除销售订单
|
||||
*
|
||||
*
|
||||
* @param orderIds 需要删除的销售订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -84,7 +84,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
|
||||
/**
|
||||
* 删除销售订单信息
|
||||
*
|
||||
*
|
||||
* @param orderId 销售订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -93,4 +93,4 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
{
|
||||
return sysOrderMapper.deleteSysOrderById(orderId);
|
||||
}
|
||||
}
|
||||
}
|
177
ruoyi-custom/src/main/resources/mapper/custom/SysOrderMapper.xml
Normal file
177
ruoyi-custom/src/main/resources/mapper/custom/SysOrderMapper.xml
Normal file
@ -0,0 +1,177 @@
|
||||
<?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.custom.mapper.SysOrderMapper">
|
||||
|
||||
<resultMap type="SysOrder" id="SysOrderResult">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="customer" column="customer" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="payTypeId" column="pay_type_id" />
|
||||
<result property="payType" column="pay_type" />
|
||||
<result property="preSaleId" column="pre_sale_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="preSale" column="pre_sale" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="afterSaleId" column="after_sale_id" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="afterSale" column="after_sale" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="nutritionistId" column="nutritionist_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="nutritionist" column="nutritionist" />
|
||||
<result property="nutriAssisId" column="nutri_assis_id" />
|
||||
<result property="nutriAssis" column="nutri_assis" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="account" column="account" />
|
||||
<result property="plannerId" column="planner_id" />
|
||||
<result property="planner" column="planner" />
|
||||
<result property="plannerAssisId" column="planner_assis_id" />
|
||||
<result property="plannerAssis" column="planner_assis" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="recommender" column="recommender" />
|
||||
<result property="orderTime" column="order_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysOrderVo">
|
||||
select order_id, customer, phone, amount, pay_type_id, pay_type, pre_sale_id, create_by, pre_sale, create_time, after_sale_id, update_by, after_sale, update_time, nutritionist_id, remark, nutritionist, nutri_assis_id, nutri_assis, account_id, account, planner_id, planner, planner_assis_id, planner_assis, operator_id, operator, recommender, order_time from sys_order
|
||||
</sql>
|
||||
|
||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
<where>
|
||||
<if test="customer != null and customer != ''"> and customer = #{customer}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="payTypeId != null "> and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null "> and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="afterSaleId != null "> and after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null "> and nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null "> and nutri_assis_id = #{nutriAssisId}</if>
|
||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||
<if test="plannerId != null "> and planner_id = #{plannerId}</if>
|
||||
<if test="plannerAssisId != null "> and planner_assis_id = #{plannerAssisId}</if>
|
||||
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
|
||||
<if test="recommender != null and recommender != ''"> and recommender = #{recommender}</if>
|
||||
<if test="orderTime != null "> and order_time = #{orderTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
where order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysOrder" parameterType="SysOrder" useGeneratedKeys="true" keyProperty="orderId">
|
||||
insert into sys_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customer != null and customer != ''">customer,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="payTypeId != null">pay_type_id,</if>
|
||||
<if test="payType != null">pay_type,</if>
|
||||
<if test="preSaleId != null">pre_sale_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="preSale != null">pre_sale,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="afterSaleId != null">after_sale_id,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="afterSale != null">after_sale,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="nutritionistId != null">nutritionist_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="nutritionist != null">nutritionist,</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id,</if>
|
||||
<if test="nutriAssis != null">nutri_assis,</if>
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="account != null">account,</if>
|
||||
<if test="plannerId != null">planner_id,</if>
|
||||
<if test="planner != null">planner,</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id,</if>
|
||||
<if test="plannerAssis != null">planner_assis,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operator != null">operator,</if>
|
||||
<if test="recommender != null">recommender,</if>
|
||||
<if test="orderTime != null">order_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customer != null and customer != ''">#{customer},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="payTypeId != null">#{payTypeId},</if>
|
||||
<if test="payType != null">#{payType},</if>
|
||||
<if test="preSaleId != null">#{preSaleId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="preSale != null">#{preSale},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="afterSaleId != null">#{afterSaleId},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="afterSale != null">#{afterSale},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="nutritionistId != null">#{nutritionistId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="nutritionist != null">#{nutritionist},</if>
|
||||
<if test="nutriAssisId != null">#{nutriAssisId},</if>
|
||||
<if test="nutriAssis != null">#{nutriAssis},</if>
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="plannerId != null">#{plannerId},</if>
|
||||
<if test="planner != null">#{planner},</if>
|
||||
<if test="plannerAssisId != null">#{plannerAssisId},</if>
|
||||
<if test="plannerAssis != null">#{plannerAssis},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operator != null">#{operator},</if>
|
||||
<if test="recommender != null">#{recommender},</if>
|
||||
<if test="orderTime != null">#{orderTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysOrder" parameterType="SysOrder">
|
||||
update sys_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customer != null and customer != ''">customer = #{customer},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="payTypeId != null">pay_type_id = #{payTypeId},</if>
|
||||
<if test="payType != null">pay_type = #{payType},</if>
|
||||
<if test="preSaleId != null">pre_sale_id = #{preSaleId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="preSale != null">pre_sale = #{preSale},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="afterSaleId != null">after_sale_id = #{afterSaleId},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="afterSale != null">after_sale = #{afterSale},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="nutritionist != null">nutritionist = #{nutritionist},</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if>
|
||||
<if test="nutriAssis != null">nutri_assis = #{nutriAssis},</if>
|
||||
<if test="accountId != null">account_id = #{accountId},</if>
|
||||
<if test="account != null">account = #{account},</if>
|
||||
<if test="plannerId != null">planner_id = #{plannerId},</if>
|
||||
<if test="planner != null">planner = #{planner},</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id = #{plannerAssisId},</if>
|
||||
<if test="plannerAssis != null">planner_assis = #{plannerAssis},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="recommender != null">recommender = #{recommender},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysOrderById" parameterType="Long">
|
||||
delete from sys_order where order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysOrderByIds" parameterType="String">
|
||||
delete from sys_order where order_id in
|
||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -1,114 +0,0 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 销售订单对象 sys_order
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
public class SysOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long orderId;
|
||||
|
||||
/** 业务员 */
|
||||
private Long userId;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private Long amount;
|
||||
|
||||
/** 成交日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成交日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date saleTime;
|
||||
|
||||
/** 销售渠道 */
|
||||
@Excel(name = "销售渠道")
|
||||
private Long channelId;
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setAmount(Long amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Long getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setSaleTime(Date saleTime)
|
||||
{
|
||||
this.saleTime = saleTime;
|
||||
}
|
||||
|
||||
public Date getSaleTime()
|
||||
{
|
||||
return saleTime;
|
||||
}
|
||||
public void setChannelId(Long channelId)
|
||||
{
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public Long getChannelId()
|
||||
{
|
||||
return channelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("orderId", getOrderId())
|
||||
.append("userId", getUserId())
|
||||
.append("nickName", getNickName())
|
||||
.append("amount", getAmount())
|
||||
.append("saleTime", getSaleTime())
|
||||
.append("channelId", getChannelId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?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.SysOrderMapper">
|
||||
|
||||
<resultMap type="SysOrder" id="SysOrderResult">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="saleTime" column="sale_time" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysOrderVo">
|
||||
select order_id, user_id, nick_name, amount, sale_time, channel_id, create_by, create_time, update_by, update_time, remark from sys_order
|
||||
</sql>
|
||||
|
||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="amount != null "> and amount = #{amount}</if>
|
||||
<if test="saleTime != null "> and sale_time = #{saleTime}</if>
|
||||
<if test="channelId != null "> and channel_id = #{channelId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
where order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysOrder" parameterType="SysOrder" useGeneratedKeys="true" keyProperty="orderId">
|
||||
insert into sys_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="saleTime != null">sale_time,</if>
|
||||
<if test="channelId != null">channel_id,</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="userId != null">#{userId},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="saleTime != null">#{saleTime},</if>
|
||||
<if test="channelId != null">#{channelId},</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="updateSysOrder" parameterType="SysOrder">
|
||||
update sys_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="saleTime != null">sale_time = #{saleTime},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</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 order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysOrderById" parameterType="Long">
|
||||
delete from sys_order where order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysOrderByIds" parameterType="String">
|
||||
delete from sys_order where order_id in
|
||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -1,53 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售订单详细
|
||||
export function getOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售订单
|
||||
export function addOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改销售订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售订单
|
||||
export function delOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出销售订单
|
||||
export function exportOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/custom/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售订单详细
|
||||
export function getOrder(orderId) {
|
||||
return request({
|
||||
url: '/custom/order/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售订单
|
||||
export function addOrder(data) {
|
||||
return request({
|
||||
url: '/custom/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改销售订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/custom/order',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售订单
|
||||
export function delOrder(orderId) {
|
||||
return request({
|
||||
url: '/custom/order/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出销售订单
|
||||
export function exportOrder(query) {
|
||||
return request({
|
||||
url: '/custom/order/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
737
ruoyi-ui/src/views/custom/order/index.vue
Normal file
737
ruoyi-ui/src/views/custom/order/index.vue
Normal file
@ -0,0 +1,737 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input
|
||||
v-model="queryParams.customer"
|
||||
placeholder="请输入客户姓名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入电话"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="queryParams.payTypeId" placeholder="请选择收款方式" clearable size="small">
|
||||
<el-option v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="queryParams.preSaleId" placeholder="请选择售前" clearable size="small">
|
||||
<el-option v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="queryParams.afterSaleId" placeholder="请选择售后" clearable size="small">
|
||||
<el-option v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="营养师" prop="nutritionistId">
|
||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId" label-width="90px">
|
||||
<el-select v-model="queryParams.nutriAssisId" placeholder="请选择助理营养师" clearable style="width: 170px"
|
||||
size="small">
|
||||
<el-option v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="queryParams.accountId" placeholder="请选择账号" clearable
|
||||
size="small">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="queryParams.plannerId" placeholder="请选择策划" clearable
|
||||
size="small">
|
||||
<el-option v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="queryParams.plannerAssisId" placeholder="请选择策划助理"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="queryParams.operatorId" placeholder="请选择运营"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-form-item label="推荐人" prop="recommender">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.recommender"-->
|
||||
<!-- placeholder="请输入推荐人"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-col :span="4">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" 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-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['custom:order:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['custom:order:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['custom:order:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['custom:order:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="编号" align="center" prop="orderId"/>
|
||||
<el-table-column label="客户姓名" align="center" prop="customer"/>
|
||||
<el-table-column label="电话" align="center" prop="phone"/>
|
||||
<el-table-column label="金额" align="center" prop="amount"/>
|
||||
<el-table-column label="收款方式" align="center" prop="payType"/>
|
||||
<el-table-column label="售前" align="center" prop="preSale"/>
|
||||
<el-table-column label="售后" align="center" prop="afterSale"/>
|
||||
<el-table-column label="营养师" align="center" prop="nutritionist"/>
|
||||
<el-table-column label="助理营养师" align="center" prop="nutriAssis"/>
|
||||
<el-table-column label="账号" align="center" prop="account"/>
|
||||
<el-table-column label="策划" align="center" prop="planner"/>
|
||||
<el-table-column label="策划助理" align="center" prop="plannerAssis"/>
|
||||
<el-table-column label="运营" align="center" prop="operator"/>
|
||||
<el-table-column label="推荐人" align="center" prop="recommender"/>
|
||||
<el-table-column label="成交日期" align="center" prop="orderTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<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="['custom:order:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:order:remove']"
|
||||
>删除
|
||||
</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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改销售订单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input v-model="form.customer" placeholder="请输入客户姓名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="form.payTypeId" placeholder="请选择收款方式">
|
||||
<el-option
|
||||
v-for="dict in payTypeIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="form.preSaleId" placeholder="请选择售前">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择售后">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师">
|
||||
<el-option
|
||||
v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="form.plannerId" placeholder="请选择策划">
|
||||
<el-option
|
||||
v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理">
|
||||
<el-option
|
||||
v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="form.operatorId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择账号">
|
||||
<el-option
|
||||
v-for="dict in accountIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="推荐人" prop="recommender">
|
||||
<el-input v-model="form.recommender" placeholder="请输入推荐人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<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 {listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder} from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 收款方式字典
|
||||
payTypeIdOptions: [],
|
||||
// 售前字典
|
||||
preSaleIdOptions: [],
|
||||
// 售后字典
|
||||
afterSaleIdOptions: [],
|
||||
// 营养师字典
|
||||
nutritionistIdOptions: [],
|
||||
// 助理营养师字典
|
||||
nutriAssisIdOptions: [],
|
||||
// 策划字典
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
operatorIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customer: null,
|
||||
phone: null,
|
||||
payTypeId: null,
|
||||
preSaleId: null,
|
||||
afterSaleId: null,
|
||||
nutritionistId: null,
|
||||
nutriAssisId: null,
|
||||
accountId: null,
|
||||
plannerId: null,
|
||||
plannerAssisId: null,
|
||||
operatorId: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
customer: [
|
||||
{required: true, message: "客户姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
amount: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("cus_pay_type").then(response => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_pre_sale").then(response => {
|
||||
this.preSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_after_sale").then(response => {
|
||||
this.afterSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri").then(response => {
|
||||
this.nutritionistIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri_assis").then(response => {
|
||||
this.nutriAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner").then(response => {
|
||||
this.plannerIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_account").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner_assis").then(response => {
|
||||
this.plannerAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_operator").then(response => {
|
||||
this.operatorIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},// 收款方式字典翻译
|
||||
payTypeIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.payTypeIdOptions, row.payTypeId);
|
||||
},
|
||||
// 售前字典翻译
|
||||
preSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.preSaleIdOptions, row.preSaleId);
|
||||
},
|
||||
// 售后字典翻译
|
||||
afterSaleIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.afterSaleIdOptions, row.afterSaleId);
|
||||
},
|
||||
// 营养师字典翻译
|
||||
nutritionistIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
||||
},
|
||||
// 助理营养师字典翻译
|
||||
nutriAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.nutriAssisIdOptions, row.nutriAssisId);
|
||||
},
|
||||
// 策划字典翻译
|
||||
plannerIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerIdOptions, row.plannerId);
|
||||
},
|
||||
// 账号字典翻译
|
||||
accountIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.accountIdOptions, row.accountId);
|
||||
},
|
||||
// 策划助理字典翻译
|
||||
plannerAssisIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.plannerAssisIdOptions, row.plannerAssisId);
|
||||
},
|
||||
// 运营字典翻译
|
||||
operatorIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.operatorIdOptions, row.operatorId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
orderId: null,
|
||||
customer: null,
|
||||
phone: null,
|
||||
amount: null,
|
||||
payTypeId: null,
|
||||
payType: null,
|
||||
preSaleId: null,
|
||||
createBy: null,
|
||||
preSale: null,
|
||||
createTime: null,
|
||||
afterSaleId: null,
|
||||
updateBy: null,
|
||||
afterSale: null,
|
||||
updateTime: null,
|
||||
nutritionistId: null,
|
||||
remark: null,
|
||||
nutritionist: null,
|
||||
nutriAssisId: null,
|
||||
nutriAssis: null,
|
||||
accountId: null,
|
||||
account: null,
|
||||
plannerId: null,
|
||||
planner: null,
|
||||
plannerAssisId: null,
|
||||
plannerAssis: null,
|
||||
operatorId: null,
|
||||
operator: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.getDicts("cus_pay_type").then(response => {
|
||||
this.payTypeIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_pre_sale").then(response => {
|
||||
this.preSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_after_sale").then(response => {
|
||||
this.afterSaleIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri").then(response => {
|
||||
this.nutritionistIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_nutri_assis").then(response => {
|
||||
this.nutriAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner").then(response => {
|
||||
this.plannerIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_custom").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_planner_assis").then(response => {
|
||||
this.plannerAssisIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_operator").then(response => {
|
||||
this.operatorIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加销售订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改销售订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$confirm('是否确认删除销售订单编号为"' + orderIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有销售订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return exportOrder(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,360 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="业务员" prop="userId">
|
||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in userIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="成交日期" prop="saleTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.saleTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售渠道" prop="channelId">
|
||||
<el-select v-model="queryParams.channelId" placeholder="请选择销售渠道" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in channelIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" 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"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:order:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:order:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:order:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="orderId" />
|
||||
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
||||
<el-table-column label="金额" align="center" prop="amount" />
|
||||
<el-table-column label="成交日期" align="center" prop="saleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.saleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售渠道" align="center" prop="channelId" :formatter="channelIdFormat" />
|
||||
<el-table-column label="创建者" align="center" prop="createBy" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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:order:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改销售订单对话框 -->
|
||||
<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="userId">
|
||||
<el-select v-model="form.userId" placeholder="请选择业务员">
|
||||
<el-option
|
||||
v-for="dict in userIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成交日期" prop="saleTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.saleTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售渠道" prop="channelId">
|
||||
<el-select v-model="form.channelId" placeholder="请选择销售渠道">
|
||||
<el-option
|
||||
v-for="dict in channelIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
></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 { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/system/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 业务员字典
|
||||
userIdOptions: [],
|
||||
// 销售渠道字典
|
||||
channelIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
saleTime: null,
|
||||
channelId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userId: [
|
||||
{ required: true, message: "业务员不能为空", trigger: "change" }
|
||||
],
|
||||
amount: [
|
||||
{ required: true, message: "金额不能为空", trigger: "blur" }
|
||||
],
|
||||
saleTime: [
|
||||
{ required: true, message: "成交日期不能为空", trigger: "blur" }
|
||||
],
|
||||
channelId: [
|
||||
{ required: true, message: "销售渠道不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_saller").then(response => {
|
||||
this.userIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_sale_channel").then(response => {
|
||||
this.channelIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 业务员字典翻译
|
||||
userIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.userIdOptions, row.userId);
|
||||
},
|
||||
// 销售渠道字典翻译
|
||||
channelIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.channelIdOptions, row.channelId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
orderId: null,
|
||||
userId: null,
|
||||
nickName: null,
|
||||
amount: null,
|
||||
saleTime: null,
|
||||
channelId: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加销售订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改销售订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$confirm('是否确认删除销售订单编号为"' + orderIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有销售订单数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportOrder(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -693,7 +693,7 @@ create table sys_commision (
|
||||
rule_id bigint(20) not null auto_increment comment '编号',
|
||||
user_id bigint(20) comment '用户ID',
|
||||
nick_name varchar(30) not null comment '用户昵称',
|
||||
amount decimal comment '金额',
|
||||
amount decimal(10,2) comment '金额',
|
||||
rate float comment '分成比例',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
@ -710,11 +710,29 @@ create table sys_commision (
|
||||
drop table if exists sys_order;
|
||||
create table sys_order (
|
||||
order_id bigint(20) not null auto_increment comment '编号',
|
||||
user_id bigint(20) comment '用户ID',
|
||||
nick_name varchar(30) comment '用户昵称',
|
||||
amount decimal comment '金额',
|
||||
sale_time datetime comment '成交日期',
|
||||
channel_id bigint(20) comment '销售渠道ID',
|
||||
customer varchar(30) not null comment '客户姓名',
|
||||
phone varchar(30) comment '电话',
|
||||
pay_type_id bigint(20) comment '收款方式ID',
|
||||
pay_type varchar(30) comment '收款方式',
|
||||
pre_sale_id bigint(20) comment '售前ID',
|
||||
pre_sale varchar(30) comment '售前',
|
||||
after_sale_id bigint(20) comment '售后ID',
|
||||
after_sale varchar(30) comment '售后',
|
||||
nutritionist_id bigint(20) comment '营养师ID',
|
||||
nutritionist varchar(30) comment '营养师',
|
||||
nutri_assis_id bigint(20) comment '助理营养师ID',
|
||||
nutri_assis varchar(30) comment '助理营养师',
|
||||
account_id bigint(20) comment '账号ID',
|
||||
account varchar(30) comment '账号',
|
||||
planner_id bigint(20) comment '策划ID',
|
||||
planner varchar(30) comment '策划',
|
||||
planner_assis_id bigint(20) comment '策划助理ID',
|
||||
planner_assis varchar(30) comment '策划助理',
|
||||
operator_id bigint(20) comment '运营ID',
|
||||
operator varchar(30) comment '运营',
|
||||
recommender varchar(30) comment '推荐人',
|
||||
amount decimal(10,2) comment '金额',
|
||||
order_time datetime comment '成交日期',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
|
Loading…
x
Reference in New Issue
Block a user