Pre Merge pull request !92 from a360158779/Pengc
This commit is contained in:
commit
5d01b4fabb
1
pom.xml
1
pom.xml
|
|
@ -213,6 +213,7 @@
|
|||
<module>ruoyi-quartz</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>zesome-cms</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@
|
|||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>zesome-cms</artifactId>
|
||||
<version>3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,124 @@
|
|||
package com.ruoyi.web.controller.cms.customer;
|
||||
|
||||
import com.ruoyi.cms.domain.Customer;
|
||||
import com.ruoyi.cms.service.ICustomerService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户 信息操作处理
|
||||
*
|
||||
* @author pengc
|
||||
* @date 2019-05-26
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/cms/customer")
|
||||
public class CustomerController extends BaseController
|
||||
{
|
||||
private String prefix = "cms/customer";
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
|
||||
@RequiresPermissions("cms:customer:view")
|
||||
@GetMapping()
|
||||
public String customer()
|
||||
{
|
||||
return prefix + "/customer";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
*/
|
||||
@RequiresPermissions("cms:customer:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(Customer customer)
|
||||
{
|
||||
startPage();
|
||||
List<Customer> list = customerService.selectCustomerList(customer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出客户列表
|
||||
*/
|
||||
@RequiresPermissions("cms:customer:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(Customer customer)
|
||||
{
|
||||
List<Customer> list = customerService.selectCustomerList(customer);
|
||||
ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
|
||||
return util.exportExcel(list, "customer");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存客户
|
||||
*/
|
||||
@RequiresPermissions("cms:customer:add")
|
||||
@Log(title = "客户", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(Customer customer)
|
||||
{
|
||||
return toAjax(customerService.insertCustomer(customer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*/
|
||||
@GetMapping("/edit/{customerid}")
|
||||
public String edit(@PathVariable("customerid") Integer customerid, ModelMap mmap)
|
||||
{
|
||||
Customer customer = customerService.selectCustomerById(customerid);
|
||||
mmap.put("customer", customer);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存客户
|
||||
*/
|
||||
@RequiresPermissions("cms:customer:edit")
|
||||
@Log(title = "客户", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(Customer customer)
|
||||
{
|
||||
return toAjax(customerService.updateCustomer(customer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
*/
|
||||
@RequiresPermissions("cms:customer:remove")
|
||||
@Log(title = "客户", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(customerService.deleteCustomerByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,9 +6,9 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/zesome?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: 123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
# 代码生成
|
||||
gen:
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
author: pengc
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.ruoyi.system
|
||||
packageName: com.ruoyi.cms
|
||||
# 自动去除表前缀,默认是true
|
||||
autoRemovePre: true
|
||||
# 表前缀(类名不会包含表前缀)
|
||||
tablePrefix: sys_
|
||||
tablePrefix: cms_
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zesome-cms</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.cms.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户表 cms_customer
|
||||
*
|
||||
* @author pengc
|
||||
* @date 2019-05-26
|
||||
*/
|
||||
public class Customer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 客户id */
|
||||
private Integer customerid;
|
||||
/** 名称 */
|
||||
private String name;
|
||||
/** 性别 */
|
||||
private Integer sex;
|
||||
/** 联系方式 */
|
||||
private String phone;
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
/** 咨询类型 */
|
||||
private Integer type;
|
||||
/** 内容 */
|
||||
private String context;
|
||||
|
||||
public void setCustomerid(Integer customerid)
|
||||
{
|
||||
this.customerid = customerid;
|
||||
}
|
||||
|
||||
public Integer getCustomerid()
|
||||
{
|
||||
return customerid;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setSex(Integer sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public Integer getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setType(Integer type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setContext(String context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getContext()
|
||||
{
|
||||
return context;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("customerid", getCustomerid())
|
||||
.append("name", getName())
|
||||
.append("sex", getSex())
|
||||
.append("phone", getPhone())
|
||||
.append("email", getEmail())
|
||||
.append("type", getType())
|
||||
.append("context", getContext())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.cms.domain.Customer;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户 数据层
|
||||
*
|
||||
* @author pengc
|
||||
* @date 2019-05-26
|
||||
*/
|
||||
public interface CustomerMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param customerid 客户ID
|
||||
* @return 客户信息
|
||||
*/
|
||||
public Customer selectCustomerById(Integer customerid);
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 客户集合
|
||||
*/
|
||||
public List<Customer> selectCustomerList(Customer customer);
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCustomer(Customer customer);
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCustomer(Customer customer);
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
*
|
||||
* @param customerid 客户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCustomerById(Integer customerid);
|
||||
|
||||
/**
|
||||
* 批量删除客户
|
||||
*
|
||||
* @param customerids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCustomerByIds(String[] customerids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.Customer;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户 服务层
|
||||
*
|
||||
* @author pengc
|
||||
* @date 2019-05-26
|
||||
*/
|
||||
public interface ICustomerService
|
||||
{
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param customerid 客户ID
|
||||
* @return 客户信息
|
||||
*/
|
||||
public Customer selectCustomerById(Integer customerid);
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 客户集合
|
||||
*/
|
||||
public List<Customer> selectCustomerList(Customer customer);
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCustomer(Customer customer);
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCustomer(Customer customer);
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCustomerByIds(String ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cms.mapper.CustomerMapper;
|
||||
import com.ruoyi.cms.domain.Customer;
|
||||
import com.ruoyi.cms.service.ICustomerService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 客户 服务层实现
|
||||
*
|
||||
* @author pengc
|
||||
* @date 2019-05-26
|
||||
*/
|
||||
@Service
|
||||
public class CustomerServiceImpl implements ICustomerService
|
||||
{
|
||||
@Autowired
|
||||
private CustomerMapper customerMapper;
|
||||
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param customerid 客户ID
|
||||
* @return 客户信息
|
||||
*/
|
||||
@Override
|
||||
public Customer selectCustomerById(Integer customerid)
|
||||
{
|
||||
return customerMapper.selectCustomerById(customerid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 客户集合
|
||||
*/
|
||||
@Override
|
||||
public List<Customer> selectCustomerList(Customer customer)
|
||||
{
|
||||
return customerMapper.selectCustomerList(customer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCustomer(Customer customer)
|
||||
{
|
||||
return customerMapper.insertCustomer(customer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户
|
||||
*
|
||||
* @param customer 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCustomer(Customer customer)
|
||||
{
|
||||
return customerMapper.updateCustomer(customer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCustomerByIds(String ids)
|
||||
{
|
||||
return customerMapper.deleteCustomerByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
<?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.cms.mapper.CustomerMapper">
|
||||
|
||||
<resultMap type="Customer" id="CustomerResult">
|
||||
<result property="customerid" column="customerid" />
|
||||
<result property="name" column="name" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="email" column="email" />
|
||||
<result property="type" column="type" />
|
||||
<result property="context" column="context" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustomerVo">
|
||||
select customerid, name, sex, phone, email, type, context, create_time from cms_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult">
|
||||
<include refid="selectCustomerVo"/>
|
||||
<where>
|
||||
<if test="customerid != null "> and customerid = #{customerid}</if>
|
||||
<if test="name != null and name != '' "> and name = #{name}</if>
|
||||
<if test="sex != null "> and sex = #{sex}</if>
|
||||
<if test="phone != null and phone != '' "> and phone = #{phone}</if>
|
||||
<if test="email != null and email != '' "> and email = #{email}</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="context != null and context != '' "> and context = #{context}</if>
|
||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustomerById" parameterType="Integer" resultMap="CustomerResult">
|
||||
<include refid="selectCustomerVo"/>
|
||||
where customerid = #{customerid}
|
||||
</select>
|
||||
|
||||
<insert id="insertCustomer" parameterType="Customer">
|
||||
insert into cms_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerid != null ">customerid,</if>
|
||||
<if test="name != null and name != '' ">name,</if>
|
||||
<if test="sex != null ">sex,</if>
|
||||
<if test="phone != null and phone != '' ">phone,</if>
|
||||
<if test="email != null and email != '' ">email,</if>
|
||||
<if test="type != null ">type,</if>
|
||||
<if test="context != null and context != '' ">context,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customerid != null ">#{customerid},</if>
|
||||
<if test="name != null and name != '' ">#{name},</if>
|
||||
<if test="sex != null ">#{sex},</if>
|
||||
<if test="phone != null and phone != '' ">#{phone},</if>
|
||||
<if test="email != null and email != '' ">#{email},</if>
|
||||
<if test="type != null ">#{type},</if>
|
||||
<if test="context != null and context != '' ">#{context},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustomer" parameterType="Customer">
|
||||
update cms_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != '' ">name = #{name},</if>
|
||||
<if test="sex != null ">sex = #{sex},</if>
|
||||
<if test="phone != null and phone != '' ">phone = #{phone},</if>
|
||||
<if test="email != null and email != '' ">email = #{email},</if>
|
||||
<if test="type != null ">type = #{type},</if>
|
||||
<if test="context != null and context != '' ">context = #{context},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where customerid = #{customerid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustomerById" parameterType="Integer">
|
||||
delete from cms_customer where customerid = #{customerid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustomerByIds" parameterType="String">
|
||||
delete from cms_customer where customerid in
|
||||
<foreach item="customerid" collection="array" open="(" separator="," close=")">
|
||||
#{customerid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增客户')"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-customer-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="name" name="name" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="sex" id="sex" class="form-control">
|
||||
<option value="1">男</option>
|
||||
<option value="2">女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="phone" name="phone" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="email" name="email" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">咨询类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="type" id="type" class="form-control"
|
||||
th:with="type=${@dict.getType('customer_contact_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="context" name="context" cols="3" rows="3"
|
||||
class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "cms/customer"
|
||||
$("#form-customer-add").validate({
|
||||
rules: {
|
||||
xxxx: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-customer-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('客户列表')"/>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
名称:<input type="text" name="name"/>
|
||||
</li>
|
||||
<li>
|
||||
联系方式:<input type="text" name="phone"/>
|
||||
</li>
|
||||
<li>
|
||||
邮箱:<input type="text" name="email"/>
|
||||
</li>
|
||||
<li>
|
||||
咨询类型:<input type="text" name="type"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
||||
class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||
class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="cms:customer:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.addFull()"
|
||||
shiro:hasPermission="cms:customer:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
|
||||
shiro:hasPermission="cms:customer:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="cms:customer:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('cms:customer:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('cms:customer:remove')}]];
|
||||
var prefix = ctx + "cms/customer";
|
||||
// 获取数据字典数据
|
||||
var datas = [[${@dict.getType('customer_contact_type')}]];
|
||||
$(function () {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "客户",
|
||||
showExport: true,
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'sex',
|
||||
title: '性别',
|
||||
sortable: true,
|
||||
formatter: function (value, row, index) {
|
||||
if(value==1){
|
||||
return '男';
|
||||
}else{
|
||||
return '女';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
title: '联系方式',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
title: '邮箱',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
title: '咨询类型',
|
||||
sortable: true,
|
||||
formatter: function (value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'context',
|
||||
title: '内容',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.customerid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.customerid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改客户')"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-customer-edit" th:object="${customer}">
|
||||
<input id="customerid" name="customerid" th:field="*{customerid}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="sex" id="sex" class="form-control">
|
||||
<option value="1" th:field="*{sex}">男</option>
|
||||
<option value="2" th:field="*{sex}">女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="phone" name="phone" th:field="*{phone}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="email" name="email" th:field="*{email}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">咨询类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="type" id="type" class="form-control"
|
||||
th:with="type=${@dict.getType('customer_contact_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
|
||||
th:field="*{type}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="context" name="context" th:field="*{context}" cols="3" rows="3"
|
||||
class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">创建时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text"
|
||||
readonly="readonly">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "cms/customer";
|
||||
$("#form-customer-edit").validate({
|
||||
rules: {
|
||||
xxxx: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue