新增提成查询
This commit is contained in:
parent
3deb40bac9
commit
cf70d53d7f
ruoyi-admin
ruoyi-custom
ruoyi-ui
sql
@ -94,6 +94,12 @@
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-custom</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
103
ruoyi-admin/src/main/java/com/ruoyi/web/controller/custom/SysCommisionController.java
Normal file
103
ruoyi-admin/src/main/java/com/ruoyi/web/controller/custom/SysCommisionController.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.web.controller.custom;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.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.custom.domain.SysCommision;
|
||||
import com.ruoyi.custom.service.ISysCommisionService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 业务提成比例Controller
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/commision")
|
||||
public class SysCommisionController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysCommisionService sysCommisionService;
|
||||
|
||||
/**
|
||||
* 查询业务提成比例列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysCommision sysCommision)
|
||||
{
|
||||
startPage();
|
||||
List<SysCommision> list = sysCommisionService.selectSysCommisionList(sysCommision);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出业务提成比例列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:export')")
|
||||
@Log(title = "业务提成比例", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysCommision sysCommision)
|
||||
{
|
||||
List<SysCommision> list = sysCommisionService.selectSysCommisionList(sysCommision);
|
||||
ExcelUtil<SysCommision> util = new ExcelUtil<SysCommision>(SysCommision.class);
|
||||
return util.exportExcel(list, "commision");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业务提成比例详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:query')")
|
||||
@GetMapping(value = "/{ruleId}")
|
||||
public AjaxResult getInfo(@PathVariable("ruleId") Long ruleId)
|
||||
{
|
||||
return AjaxResult.success(sysCommisionService.selectSysCommisionById(ruleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务提成比例
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:add')")
|
||||
@Log(title = "业务提成比例", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysCommision sysCommision)
|
||||
{
|
||||
return toAjax(sysCommisionService.insertSysCommision(sysCommision));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务提成比例
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:edit')")
|
||||
@Log(title = "业务提成比例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysCommision sysCommision)
|
||||
{
|
||||
return toAjax(sysCommisionService.updateSysCommision(sysCommision));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业务提成比例
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:commision:remove')")
|
||||
@Log(title = "业务提成比例", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ruleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] ruleIds)
|
||||
{
|
||||
return toAjax(sysCommisionService.deleteSysCommisionByIds(ruleIds));
|
||||
}
|
||||
}
|
@ -11,5 +11,17 @@
|
||||
|
||||
<artifactId>ruoyi-custom</artifactId>
|
||||
|
||||
<description>
|
||||
自定义模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
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_commision
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public class SysCommision extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long ruleId;
|
||||
|
||||
/** 业务员 */
|
||||
private Long userId;
|
||||
|
||||
/** 业务员 */
|
||||
@Excel(name = "业务员")
|
||||
private String nickName;
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private Long amount;
|
||||
|
||||
/** 分成比例 */
|
||||
@Excel(name = "分成比例")
|
||||
private Long rate;
|
||||
|
||||
public void setRuleId(Long ruleId)
|
||||
{
|
||||
this.ruleId = ruleId;
|
||||
}
|
||||
|
||||
public Long getRuleId()
|
||||
{
|
||||
return ruleId;
|
||||
}
|
||||
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 setRate(Long rate)
|
||||
{
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public Long getRate()
|
||||
{
|
||||
return rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("ruleId", getRuleId())
|
||||
.append("userId", getUserId())
|
||||
.append("nickName", getNickName())
|
||||
.append("amount", getAmount())
|
||||
.append("rate", getRate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.custom.domain.SysCommision;
|
||||
|
||||
/**
|
||||
* 业务提成比例Mapper接口
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface SysCommisionMapper
|
||||
{
|
||||
/**
|
||||
* 查询业务提成比例
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 业务提成比例
|
||||
*/
|
||||
public SysCommision selectSysCommisionById(Long ruleId);
|
||||
|
||||
/**
|
||||
* 查询业务提成比例列表
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 业务提成比例集合
|
||||
*/
|
||||
public List<SysCommision> selectSysCommisionList(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 新增业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysCommision(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 修改业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysCommision(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 删除业务提成比例
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysCommisionById(Long ruleId);
|
||||
|
||||
/**
|
||||
* 批量删除业务提成比例
|
||||
*
|
||||
* @param ruleIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysCommisionByIds(Long[] ruleIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.custom.domain.SysCommision;
|
||||
|
||||
/**
|
||||
* 业务提成比例Service接口
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
public interface ISysCommisionService
|
||||
{
|
||||
/**
|
||||
* 查询业务提成比例
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 业务提成比例
|
||||
*/
|
||||
public SysCommision selectSysCommisionById(Long ruleId);
|
||||
|
||||
/**
|
||||
* 查询业务提成比例列表
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 业务提成比例集合
|
||||
*/
|
||||
public List<SysCommision> selectSysCommisionList(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 新增业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysCommision(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 修改业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysCommision(SysCommision sysCommision);
|
||||
|
||||
/**
|
||||
* 批量删除业务提成比例
|
||||
*
|
||||
* @param ruleIds 需要删除的业务提成比例ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysCommisionByIds(Long[] ruleIds);
|
||||
|
||||
/**
|
||||
* 删除业务提成比例信息
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysCommisionById(Long ruleId);
|
||||
}
|
96
ruoyi-custom/src/main/java/com/ruoyi/custom/service/impl/SysCommisionServiceImpl.java
Normal file
96
ruoyi-custom/src/main/java/com/ruoyi/custom/service/impl/SysCommisionServiceImpl.java
Normal file
@ -0,0 +1,96 @@
|
||||
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.custom.mapper.SysCommisionMapper;
|
||||
import com.ruoyi.custom.domain.SysCommision;
|
||||
import com.ruoyi.custom.service.ISysCommisionService;
|
||||
|
||||
/**
|
||||
* 业务提成比例Service业务层处理
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@Service
|
||||
public class SysCommisionServiceImpl implements ISysCommisionService
|
||||
{
|
||||
@Autowired
|
||||
private SysCommisionMapper sysCommisionMapper;
|
||||
|
||||
/**
|
||||
* 查询业务提成比例
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 业务提成比例
|
||||
*/
|
||||
@Override
|
||||
public SysCommision selectSysCommisionById(Long ruleId)
|
||||
{
|
||||
return sysCommisionMapper.selectSysCommisionById(ruleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务提成比例列表
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 业务提成比例
|
||||
*/
|
||||
@Override
|
||||
public List<SysCommision> selectSysCommisionList(SysCommision sysCommision)
|
||||
{
|
||||
return sysCommisionMapper.selectSysCommisionList(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysCommision(SysCommision sysCommision)
|
||||
{
|
||||
sysCommision.setCreateTime(DateUtils.getNowDate());
|
||||
return sysCommisionMapper.insertSysCommision(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务提成比例
|
||||
*
|
||||
* @param sysCommision 业务提成比例
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysCommision(SysCommision sysCommision)
|
||||
{
|
||||
sysCommision.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysCommisionMapper.updateSysCommision(sysCommision);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除业务提成比例
|
||||
*
|
||||
* @param ruleIds 需要删除的业务提成比例ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysCommisionByIds(Long[] ruleIds)
|
||||
{
|
||||
return sysCommisionMapper.deleteSysCommisionByIds(ruleIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业务提成比例信息
|
||||
*
|
||||
* @param ruleId 业务提成比例ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysCommisionById(Long ruleId)
|
||||
{
|
||||
return sysCommisionMapper.deleteSysCommisionById(ruleId);
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
<?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.SysCommisionMapper">
|
||||
|
||||
<resultMap type="SysCommision" id="SysCommisionResult">
|
||||
<result property="ruleId" column="rule_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="rate" column="rate" />
|
||||
<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="selectSysCommisionVo">
|
||||
select rule_id, user_id, nick_name, amount, rate, create_by, create_time, update_by, update_time, remark from sys_commision
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCommisionList" parameterType="SysCommision" resultMap="SysCommisionResult">
|
||||
<include refid="selectSysCommisionVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="amount != null "> and amount = #{amount}</if>
|
||||
<if test="rate != null "> and rate = #{rate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCommisionById" parameterType="Long" resultMap="SysCommisionResult">
|
||||
<include refid="selectSysCommisionVo"/>
|
||||
where rule_id = #{ruleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCommision" parameterType="SysCommision" useGeneratedKeys="true" keyProperty="ruleId">
|
||||
insert into sys_commision
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="rate != null">rate,</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">#{nickName},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="rate != null">#{rate},</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="updateSysCommision" parameterType="SysCommision">
|
||||
update sys_commision
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="rate != null">rate = #{rate},</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 rule_id = #{ruleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCommisionById" parameterType="Long">
|
||||
delete from sys_commision where rule_id = #{ruleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysCommisionByIds" parameterType="String">
|
||||
delete from sys_commision where rule_id in
|
||||
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
|
||||
#{ruleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
53
ruoyi-ui/src/api/custom/commision.js
Normal file
53
ruoyi-ui/src/api/custom/commision.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询业务提成比例列表
|
||||
export function listCommision(query) {
|
||||
return request({
|
||||
url: '/custom/commision/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询业务提成比例详细
|
||||
export function getCommision(ruleId) {
|
||||
return request({
|
||||
url: '/custom/commision/' + ruleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增业务提成比例
|
||||
export function addCommision(data) {
|
||||
return request({
|
||||
url: '/custom/commision',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改业务提成比例
|
||||
export function updateCommision(data) {
|
||||
return request({
|
||||
url: '/custom/commision',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除业务提成比例
|
||||
export function delCommision(ruleId) {
|
||||
return request({
|
||||
url: '/custom/commision/' + ruleId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出业务提成比例
|
||||
export function exportCommision(query) {
|
||||
return request({
|
||||
url: '/custom/commision/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
326
ruoyi-ui/src/views/custom/commision/index.vue
Normal file
326
ruoyi-ui/src/views/custom/commision/index.vue
Normal file
@ -0,0 +1,326 @@
|
||||
<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="amount">
|
||||
<el-input
|
||||
v-model="queryParams.amount"
|
||||
placeholder="请输入金额"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分成比例" prop="rate">
|
||||
<el-input
|
||||
v-model="queryParams.rate"
|
||||
placeholder="请输入分成比例"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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="['custom:commision: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:commision: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:commision: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:commision:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="commisionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="ruleId" />
|
||||
<el-table-column label="业务员" align="center" prop="nickName" />
|
||||
<el-table-column label="金额" align="center" prop="amount" />
|
||||
<el-table-column label="分成比例" align="center" prop="rate" />
|
||||
<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:commision:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['custom:commision: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="rate">
|
||||
<el-input v-model="form.rate" placeholder="请输入分成比例" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCommision, getCommision, delCommision, addCommision, updateCommision, exportCommision } from "@/api/custom/commision";
|
||||
|
||||
export default {
|
||||
name: "Commision",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 业务提成比例表格数据
|
||||
commisionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 业务员字典
|
||||
userIdOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
amount: null,
|
||||
rate: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userId: [
|
||||
{ required: true, message: "业务员不能为空", trigger: "change" }
|
||||
],
|
||||
amount: [
|
||||
{ required: true, message: "金额不能为空", trigger: "blur" }
|
||||
],
|
||||
rate: [
|
||||
{ required: true, message: "分成比例不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_saller").then(response => {
|
||||
this.userIdOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询业务提成比例列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCommision(this.queryParams).then(response => {
|
||||
this.commisionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 业务员字典翻译
|
||||
userIdFormat(row, column) {
|
||||
return this.selectDictLabel(this.userIdOptions, row.userId);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
ruleId: null,
|
||||
userId: null,
|
||||
nickName: null,
|
||||
amount: null,
|
||||
rate: 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.ruleId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加业务提成比例";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const ruleId = row.ruleId || this.ids
|
||||
getCommision(ruleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改业务提成比例";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.ruleId != null) {
|
||||
updateCommision(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addCommision(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ruleIds = row.ruleId || this.ids;
|
||||
this.$confirm('是否确认删除业务提成比例编号为"' + ruleIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delCommision(ruleIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有业务提成比例数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportCommision(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -34,7 +34,7 @@ module.exports = {
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://192.168.110.150:8090`,
|
||||
target: `http://localhost:8091`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
|
@ -693,8 +693,8 @@ 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 int comment '金额',
|
||||
rate int comment '分成比例',
|
||||
amount decimal comment '金额',
|
||||
rate float 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