合同模板,合同分类

This commit is contained in:
丁瑞超 2020-11-03 12:48:56 +08:00
parent 16a9dc401f
commit e8568e7d82
8 changed files with 319 additions and 128 deletions

View File

@ -26,15 +26,15 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2020-10-21
*/
@Controller
@RequestMapping("/front/template")
@RequestMapping("/front/contractTemplate")
public class ContractTemplateController extends BaseController
{
private String prefix = "front/template";
private String prefix = "front/contract_template";
@Autowired
private IContractTemplateService contractTemplateService;
@RequiresPermissions("front:template:view")
@RequiresPermissions("front:contract_template:view")
@GetMapping()
public String template()
{
@ -44,7 +44,7 @@ public class ContractTemplateController extends BaseController
/**
* 查询合同模板列表
*/
@RequiresPermissions("front:template:list")
@RequiresPermissions("front:contractTemplate:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ContractTemplate contractTemplate)
@ -57,7 +57,7 @@ public class ContractTemplateController extends BaseController
/**
* 导出合同模板列表
*/
@RequiresPermissions("front:template:export")
@RequiresPermissions("front:contractTemplate:export")
@Log(title = "合同模板", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
@ -80,7 +80,7 @@ public class ContractTemplateController extends BaseController
/**
* 新增保存合同模板
*/
@RequiresPermissions("front:template:add")
@RequiresPermissions("front:contractTemplate:add")
@Log(title = "合同模板", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
@ -103,7 +103,7 @@ public class ContractTemplateController extends BaseController
/**
* 修改保存合同模板
*/
@RequiresPermissions("front:template:edit")
@RequiresPermissions("front:contract_template:edit")
@Log(title = "合同模板", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
@ -115,7 +115,7 @@ public class ContractTemplateController extends BaseController
/**
* 删除合同模板
*/
@RequiresPermissions("front:template:remove")
@RequiresPermissions("front:contractTemplate:remove")
@Log(title = "合同模板", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody

View File

@ -26,25 +26,25 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2020-10-21
*/
@Controller
@RequestMapping("/front/contract")
@RequestMapping("/front/contractType")
public class ContractTypeController extends BaseController
{
private String prefix = "front/contract";
private String prefix = "front/contract_type";
@Autowired
private IContractTypeService contractTypeService;
@RequiresPermissions("front:contract:view")
@RequiresPermissions("front:contractType:view")
@GetMapping()
public String contract()
{
return prefix + "/contract";
return prefix + "/type";
}
/**
* 查询合同分类列表
*/
@RequiresPermissions("front:contract:list")
@RequiresPermissions("front:contractType:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ContractType contractType)
@ -57,7 +57,7 @@ public class ContractTypeController extends BaseController
/**
* 导出合同分类列表
*/
@RequiresPermissions("front:contract:export")
@RequiresPermissions("front:contractType:export")
@Log(title = "合同分类", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
@ -80,7 +80,7 @@ public class ContractTypeController extends BaseController
/**
* 新增保存合同分类
*/
@RequiresPermissions("front:contract:add")
@RequiresPermissions("front:contractType:add")
@Log(title = "合同分类", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
@ -103,7 +103,7 @@ public class ContractTypeController extends BaseController
/**
* 修改保存合同分类
*/
@RequiresPermissions("front:contract:edit")
@RequiresPermissions("front:contractType:edit")
@Log(title = "合同分类", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
@ -115,7 +115,7 @@ public class ContractTypeController extends BaseController
/**
* 删除合同分类
*/
@RequiresPermissions("front:contract:remove")
@RequiresPermissions("front:contractType:remove")
@Log(title = "合同分类", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody

View File

@ -39,7 +39,6 @@ public class ClasssicCases extends BaseEntity
private Integer hits;
/** 图片地址(多个地址用,分隔) */
@Excel(name = "图片地址", readConverterExp = "多=个地址用,分隔")
private String pictureUrl;
/** 状态0正常 1停用 */

View File

@ -1,49 +0,0 @@
<!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-contract-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">分类名称:</label>
<div class="col-sm-8">
<input name="name" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required"></label>
<div class="col-sm-8">
<input name="englishName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" 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 name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "front/contract"
$("#form-contract-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-contract-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -1,44 +0,0 @@
<!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-contract-edit" th:object="${contractType}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">分类名称:</label>
<div class="col-sm-8">
<input name="name" th:field="*{name}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required"></label>
<div class="col-sm-8">
<input name="englishName" th:field="*{englishName}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "front/contract";
$("#form-contract-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-contract-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增合同模板')" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-template-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">合同分类id(contract_type表主键id)</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" required>
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">标题:</label>
<div class="col-sm-8">
<input name="title" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">简介:</label>
<div class="col-sm-8">
<input name="introduction" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">详情内容:</label>
<div class="col-sm-8">
<input type="hidden" class="form-control" name="content">
<div class="summernote" id="content"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">点击量:</label>
<div class="col-sm-8">
<input name="hits" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">附件下载:</label>
<div class="col-sm-8">
<textarea name="enclosureUrl" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="status" value="">
<label th:for="status" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" 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 name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: summernote-js" />
<script th:inline="javascript">
var prefix = ctx + "front/contractTemplate";
$("#form-template-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-template-add').serialize());
}
}
$(function() {
$('.summernote').summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改合同模板')" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-template-edit" th:object="${contractTemplate}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">合同分类id(contract_type表主键id)</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" required>
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">标题:</label>
<div class="col-sm-8">
<input name="title" th:field="*{title}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">简介:</label>
<div class="col-sm-8">
<input name="introduction" th:field="*{introduction}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">详情内容:</label>
<div class="col-sm-8">
<input type="hidden" class="form-control" th:field="*{content}">
<div class="summernote" id="content"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">点击量:</label>
<div class="col-sm-8">
<input name="hits" th:field="*{hits}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">附件下载:</label>
<div class="col-sm-8">
<textarea name="enclosureUrl" class="form-control" required>[[*{enclosureUrl}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="status" value="">
<label th:for="status" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: summernote-js" />
<script th:inline="javascript">
var prefix = ctx + "front/contractTemplate";
$("#form-template-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-template-edit').serialize());
}
}
$(function() {
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
});
</script>
</body>
</html>

View File

@ -1,7 +1,7 @@
<!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('合同分类列表')" />
<th:block th:include="include :: header('合同模板列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -11,12 +11,30 @@
<div class="select-list">
<ul>
<li>
<label>分类名称:</label>
<input type="text" name="name"/>
<label>合同分类id(contract_type表主键id)</label>
<select name="type">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label></label>
<input type="text" name="englishName"/>
<label>标题:</label>
<input type="text" name="title"/>
</li>
<li>
<label>简介:</label>
<input type="text" name="introduction"/>
</li>
<li>
<label>点击量:</label>
<input type="text" name="hits"/>
</li>
<li>
<label>状态:</label>
<select name="status">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -28,16 +46,16 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:contract:add">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:contractTemplate:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:contract:edit">
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:contractTemplate:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:contract:remove">
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:contractTemplate:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:contract:export">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:contractTemplate:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -48,9 +66,9 @@
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('front:contract:edit')}]];
var removeFlag = [[${@permission.hasPermi('front:contract:remove')}]];
var prefix = ctx + "front/contract";
var editFlag = [[${@permission.hasPermi('front:contractTemplate:edit')}]];
var removeFlag = [[${@permission.hasPermi('front:contractTemplate:remove')}]];
var prefix = ctx + "front/contractTemplate";
$(function() {
var options = {
@ -59,7 +77,7 @@
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "合同分类",
modalName: "合同模板",
columns: [{
checkbox: true
},
@ -69,12 +87,32 @@
visible: false
},
{
field: 'name',
title: '分类名称'
field: 'type',
title: '合同分类'
},
{
field: 'englishName',
title: ''
field: 'title',
title: '标题'
},
{
field: 'introduction',
title: '简介'
},
{
field: 'content',
title: '详情内容'
},
{
field: 'hits',
title: '点击量'
},
{
field: 'enclosureUrl',
title: '附件下载'
},
{
field: 'status',
title: '状态'
},
{
field: 'remark',