公文流转管理功能

main
15036302109 10 months ago
parent 576a1834de
commit 14fc936df7

@ -0,0 +1,99 @@
package com.ruoyi.web.controller.ehs;
import java.util.List;
import java.util.Arrays;
import javax.servlet.http.HttpServletResponse;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.ehsDocTransfer.domain.EhsDocTransfer;
import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-07
*/
@Api(tags = "公文流转管理")
@RestController
@RequestMapping("/ehs/ehsDocTransfer")
public class EhsDocTransferController extends BaseController {
@Autowired
private IEhsDocTransferService ehsDocTransferService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(EhsDocTransfer ehsDocTransfer) {
startPage();
List<EhsDocTransfer> list = ehsDocTransferService.selectEhsDocTransferList(ehsDocTransfer);
return getDataTable(list);
}
/**
*
*/
@Log(title = "公文流转", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EhsDocTransfer ehsDocTransfer) {
List<EhsDocTransfer> list = ehsDocTransferService.selectEhsDocTransferList(ehsDocTransfer);
ExcelUtil<EhsDocTransfer> util = new ExcelUtil<EhsDocTransfer>(EhsDocTransfer.class);
util.exportExcel(response, list, "公文流转数据");
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ehsDocTransferService.selectEhsDocTransferById(id));
}
/**
*
*/
@ApiOperation("新增公文流转")
@Log(title = "公文流转", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EhsDocTransfer ehsDocTransfer) {
return toAjax(ehsDocTransferService.save(ehsDocTransfer));
}
/**
*
*/
@ApiOperation("修改公文流转")
@Log(title = "公文流转", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EhsDocTransfer ehsDocTransfer) {
return toAjax(ehsDocTransferService.updateById(ehsDocTransfer));
}
/**
*
*/
@ApiOperation("删除公文流转")
@Log(title = "公文流转", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(ehsDocTransferService.removeByIds(Arrays.asList(ids)));
}
}

@ -0,0 +1,128 @@
package com.ruoyi.web.controller.ehs;
import java.util.List;
import java.util.Arrays;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer;
import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.ehsDocument.domain.EhsDocument;
import com.ruoyi.ehsDocument.service.IEhsDocumentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-07
*/
@Api(tags = "公文管理管理")
@RestController
@RequestMapping("/ehs/ehsDocument")
public class EhsDocumentController extends BaseController {
@Autowired
private IEhsDocumentService ehsDocumentService;
@Autowired
private IEhsDocTransferService transferService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:list')")
@GetMapping("/list")
public TableDataInfo list(EhsDocument ehsDocument) {
startPage();
List<EhsDocument> list = ehsDocumentService.selectEhsDocumentList(ehsDocument);
return getDataTable(list);
}
/**
* 稿
*/
@GetMapping(value = "/getAllDraftDept")
public AjaxResult getAllDraftDept() {
return AjaxResult.success(ehsDocumentService.getAllDraftDept());
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:export')")
@Log(title = "公文管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EhsDocument ehsDocument) {
List<EhsDocument> list = ehsDocumentService.selectEhsDocumentList(ehsDocument);
ExcelUtil<EhsDocument> util = new ExcelUtil<EhsDocument>(EhsDocument.class);
util.exportExcel(response, list, "公文管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(ehsDocumentService.selectEhsDocumentById(id));
}
/**
* id
*/
@GetMapping(value = "transfer/{id}")
public TableDataInfo getTransferInfoByDocId(@PathVariable("id") Long id) {
startPage();
List<EhsDocTransfer> list = transferService.getTransferInfoByDocId(id);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("新增公文管理")
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:add')")
@Log(title = "公文管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EhsDocument ehsDocument) {
return toAjax(ehsDocumentService.save(ehsDocument));
}
/**
*
*/
@ApiOperation("修改公文管理")
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:edit')")
@Log(title = "公文管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EhsDocument ehsDocument) {
return toAjax(ehsDocumentService.updateById(ehsDocument));
}
/**
*
*/
@ApiOperation("删除公文管理")
@PreAuthorize("@ss.hasPermi('ehs:ehsDocument:remove')")
@Log(title = "公文管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(ehsDocumentService.removeByIds(Arrays.asList(ids)));
}
}

@ -0,0 +1,73 @@
package com.ruoyi.ehsDocTransfer.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ehs_doc_transfer
*
* @author ruoyi
* @date 2023-12-07
*/
@Data
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ehs_doc_transfer")
public class EhsDocTransfer extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* id
*/
private Long transferUserId;
/**
*
*/
@Excel(name = "流转人")
private String transferName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "流转时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date transferTime;
/**
*
*/
@Excel(name = "公文流转状态")
private Integer docTransferStatus;
/**
* id
*/
@Excel(name = "公文id")
private Long documentId;
/**
*
*/
@Excel(name = "公文名称")
private String documentName;
}

@ -0,0 +1,36 @@
package com.ruoyi.ehsDocTransfer.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-07
*/
public interface EhsDocTransferMapper extends BaseMapper<EhsDocTransfer> {
/**
*
*
* @param id
* @return
*/
public EhsDocTransfer selectEhsDocTransferById(Long id);
/**
*
*
* @param ehsDocTransfer
* @return
*/
public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer);
/**
* id
*/
List<EhsDocTransfer> getTransferInfoByDocId(@Param("id") Long id);
}

@ -0,0 +1,36 @@
package com.ruoyi.ehsDocTransfer.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer;
/**
* Service
*
* @author ruoyi
* @date 2023-12-07
*/
public interface IEhsDocTransferService extends IService<EhsDocTransfer> {
/**
*
*
* @param id
* @return
*/
public EhsDocTransfer selectEhsDocTransferById(Long id);
/**
*
*
* @param ehsDocTransfer
* @return
*/
public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer);
/**
* id
*/
List<EhsDocTransfer> getTransferInfoByDocId(Long id);
}

@ -0,0 +1,71 @@
package com.ruoyi.ehsDocTransfer.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.common.utils.StringUtils;
import java.util.List;
import java.util.Map;
import com.ruoyi.ehsDocTransfer.mapper.EhsDocTransferMapper;
import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer;
import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-07
*/
@Service
public class EhsDocTransferServiceImpl extends ServiceImpl<EhsDocTransferMapper, EhsDocTransfer> implements IEhsDocTransferService {
@Autowired
private EhsDocTransferMapper ehsDocTransferMapper;
/**
*
*
* @param id
* @return
*/
@Override
public EhsDocTransfer selectEhsDocTransferById(Long id) {
return ehsDocTransferMapper.selectEhsDocTransferById(id);
}
/**
*
*
* @param ehsDocTransfer
* @return
*/
@Override
public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer) {
return ehsDocTransferMapper.selectEhsDocTransferList(ehsDocTransfer);
}
/**
* id
*/
@Override
public List<EhsDocTransfer> getTransferInfoByDocId(Long id) {
return ehsDocTransferMapper.getTransferInfoByDocId(id);
}
private LambdaQueryWrapper<EhsDocTransfer> buildQueryWrapper(EhsDocTransfer query) {
Map<String, Object> params = query.getParams();
LambdaQueryWrapper<EhsDocTransfer> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(query.getTransferName()), EhsDocTransfer::getTransferName, query.getTransferName());
lqw.eq(query.getTransferTime() != null, EhsDocTransfer::getTransferTime, query.getTransferTime());
lqw.eq(query.getDocTransferStatus() != null, EhsDocTransfer::getDocTransferStatus, query.getDocTransferStatus());
lqw.eq(query.getDocumentId() != null, EhsDocTransfer::getDocumentId, query.getDocumentId());
lqw.orderByDesc(EhsDocTransfer::getCreateTime);
return lqw;
}
}

@ -0,0 +1,74 @@
package com.ruoyi.ehsDocument.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* ehs_document
*
* @author ruoyi
* @date 2023-12-07
*/
@Data
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ehs_document")
public class EhsDocument extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
*
*/
@Excel(name = "公文名称")
private String docName;
/**
*
*/
@Excel(name = "公文字号")
private String docFont;
/**
* 稿
*/
@Excel(name = "拟稿部门")
private String draftDept;
/**
*
*/
@Excel(name = "公文类型")
private Integer docType;
/**
*
*/
@Excel(name = "公文编号")
private String docNumber;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "收文日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date receiveTime;
}

@ -0,0 +1,36 @@
package com.ruoyi.ehsDocument.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ehsDocument.domain.EhsDocument;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-07
*/
public interface EhsDocumentMapper extends BaseMapper<EhsDocument> {
/**
*
*
* @param id
* @return
*/
public EhsDocument selectEhsDocumentById(Long id);
/**
*
*
* @param ehsDocument
* @return
*/
public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument);
/**
* 稿
* @return
*/
List<String> getAllDraftDept();
}

@ -0,0 +1,37 @@
package com.ruoyi.ehsDocument.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.ehsDocument.domain.EhsDocument;
/**
* Service
*
* @author ruoyi
* @date 2023-12-07
*/
public interface IEhsDocumentService extends IService<EhsDocument> {
/**
*
*
* @param id
* @return
*/
public EhsDocument selectEhsDocumentById(Long id);
/**
*
*
* @param ehsDocument
* @return
*/
public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument);
/**
* 稿
* @return
*/
List<String> getAllDraftDept();
}

@ -0,0 +1,70 @@
package com.ruoyi.ehsDocument.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.common.utils.StringUtils;
import java.util.List;
import java.util.Map;
import com.ruoyi.ehsDocument.mapper.EhsDocumentMapper;
import com.ruoyi.ehsDocument.domain.EhsDocument;
import com.ruoyi.ehsDocument.service.IEhsDocumentService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-07
*/
@Service
public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDocument> implements IEhsDocumentService {
@Autowired
private EhsDocumentMapper ehsDocumentMapper;
/**
*
*
* @param id
* @return
*/
@Override
public EhsDocument selectEhsDocumentById(Long id) {
return ehsDocumentMapper.selectEhsDocumentById(id);
}
/**
*
*
* @param ehsDocument
* @return
*/
@Override
public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument) {
return ehsDocumentMapper.selectEhsDocumentList(ehsDocument);
}
/**
* 稿
* @return
*/
@Override
public List<String> getAllDraftDept() {
return ehsDocumentMapper.getAllDraftDept();
}
private LambdaQueryWrapper<EhsDocument> buildQueryWrapper(EhsDocument query) {
Map<String, Object> params = query.getParams();
LambdaQueryWrapper<EhsDocument> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(query.getDocName()), EhsDocument::getDocName, query.getDocName());
lqw.eq(query.getDocType() != null, EhsDocument::getDocType, query.getDocType());
lqw.orderByDesc(EhsDocument::getCreateTime);
return lqw;
}
}

@ -0,0 +1,53 @@
<?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.ehsDocTransfer.mapper.EhsDocTransferMapper">
<resultMap type="EhsDocTransfer" id="EhsDocTransferResult">
<result property="id" column="id" />
<result property="transferUserId" column="transfer_user_id" />
<result property="transferName" column="transfer_name" />
<result property="transferTime" column="transfer_time" />
<result property="docTransferStatus" column="doc_transfer_status" />
<result property="documentId" column="document_id" />
<result property="documentName" column="document_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="deptId" column="dept_id" />
<result property="createUserId" column="create_user_id" />
<result property="updateUserId" column="update_user_id" />
</resultMap>
<sql id="selectEhsDocTransferVo">
select id, transfer_user_id, transfer_name, transfer_time, doc_transfer_status, document_id, document_name, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_doc_transfer
</sql>
<select id="selectEhsDocTransferList" parameterType="EhsDocTransfer" resultMap="EhsDocTransferResult">
<include refid="selectEhsDocTransferVo"/>
<where>
<if test="transferUserId != null "> and transfer_user_id = #{transferUserId}</if>
<if test="transferName != null and transferName != ''"> and transfer_name like concat('%', #{transferName}, '%')</if>
<if test="transferTime != null "> and transfer_time = #{transferTime}</if>
<if test="docTransferStatus != null "> and doc_transfer_status = #{docTransferStatus}</if>
<if test="documentId != null "> and document_id = #{documentId}</if>
<if test="documentName != null and documentName != ''"> and document_name = #{documentName}</if>
</where>
</select>
<select id="selectEhsDocTransferById" parameterType="Long" resultMap="EhsDocTransferResult">
<include refid="selectEhsDocTransferVo"/>
where id = #{id}
</select>
<select id="getTransferInfoByDocId" resultMap="EhsDocTransferResult">
SELECT t.*
FROM ehs_document d,ehs_doc_transfer t
WHERE d.id = t.document_id AND d.id = #{id}
</select>
</mapper>

@ -0,0 +1,48 @@
<?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.ehsDocument.mapper.EhsDocumentMapper">
<resultMap type="EhsDocument" id="EhsDocumentResult">
<result property="id" column="id" />
<result property="docName" column="doc_name" />
<result property="docFont" column="doc_font" />
<result property="draftDept" column="draft_dept" />
<result property="docType" column="doc_type" />
<result property="docNumber" column="doc_number" />
<result property="receiveTime" column="receive_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="deptId" column="dept_id" />
<result property="createUserId" column="create_user_id" />
<result property="updateUserId" column="update_user_id" />
</resultMap>
<sql id="selectEhsDocumentVo">
select id, doc_name, doc_font, draft_dept, doc_type, doc_number, receive_time, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_document
</sql>
<select id="selectEhsDocumentList" parameterType="EhsDocument" resultMap="EhsDocumentResult">
<include refid="selectEhsDocumentVo"/>
<where>
<if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
<if test="docType != null "> and doc_type = #{docType}</if>
</where>
</select>
<select id="selectEhsDocumentById" parameterType="Long" resultMap="EhsDocumentResult">
<include refid="selectEhsDocumentVo"/>
where id = #{id}
</select>
<select id="getAllDraftDept" resultType="java.lang.String">
select dept_name
from sys_dept
</select>
</mapper>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询公文流转列表
export function listEhsDocTransfer(query) {
return request({
url: '/ehs/ehsDocTransfer/list',
method: 'get',
params: query
})
}
// 查询公文流转详细
export function getEhsDocTransfer(id) {
return request({
url: '/ehs/ehsDocTransfer/' + id,
method: 'get'
})
}
// 新增公文流转
export function addEhsDocTransfer(data) {
return request({
url: '/ehs/ehsDocTransfer',
method: 'post',
data: data
})
}
// 修改公文流转
export function updateEhsDocTransfer(data) {
return request({
url: '/ehs/ehsDocTransfer',
method: 'put',
data: data
})
}
// 删除公文流转
export function delEhsDocTransfer(id) {
return request({
url: '/ehs/ehsDocTransfer/' + id,
method: 'delete'
})
}

@ -0,0 +1,60 @@
import request from '@/utils/request'
// 查询公文管理列表
export function listEhsDocument(query) {
return request({
url: '/ehs/ehsDocument/list',
method: 'get',
params: query
})
}
// 查询公文管理详细
export function getEhsDocument(id) {
return request({
url: '/ehs/ehsDocument/' + id,
method: 'get'
})
}
// 获取拟稿部门下拉列表
export function getAllDraftDept() {
return request({
url: '/ehs/ehsDocument/getAllDraftDept',
method: 'get'
})
}
// 根据公文id获取公文流转信息
export function getDocTransferById(id) {
return request({
url: '/ehs/ehsDocument/transfer/' + id,
method: 'get'
})
}
// 新增公文管理
export function addEhsDocument(data) {
return request({
url: '/ehs/ehsDocument',
method: 'post',
data: data
})
}
// 修改公文管理
export function updateEhsDocument(data) {
return request({
url: '/ehs/ehsDocument',
method: 'put',
data: data
})
}
// 删除公文管理
export function delEhsDocument(id) {
return request({
url: '/ehs/ehsDocument/' + id,
method: 'delete'
})
}

@ -0,0 +1,410 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="公文名称" prop="docName">
<el-input
v-model="queryParams.docName"
placeholder="请输入公文名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="公文类型" prop="docType">
<el-select v-model="queryParams.docType" placeholder="请选择公文类型" clearable>
<el-option
v-for="dict in dict.type.doc_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-edit-outline"
size="mini"
@click="handleAdd"
v-hasPermi="['ehs:ehsDocument:add']"
>公文登记</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-document"
size="mini"
@click=""
>公文流转</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ehs:ehsDocument:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ehs:ehsDocument:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ehs:ehsDocument:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ehsDocumentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="序号" align="center">
<template slot-scope="scope">
<span>{{ Number(scope.$index) + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="公文名称" align="center" prop="docName" />
<el-table-column label="公文字号" align="center" prop="docFont" />
<el-table-column label="拟稿部门" align="center" prop="draftDept" />
<el-table-column label="公文类型" align="center" prop="docType">
<template slot-scope="scope">
<dict-tag :options="dict.type.doc_type" :value="scope.row.docType"/>
</template>
</el-table-column>
<el-table-column label="公文编号" align="center" prop="docNumber" />
<el-table-column label="收文日期" align="center" prop="receiveTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.receiveTime, '{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="['ehs:ehsDocument:edit']"
>修改</el-button>-->
<el-button
size="middle"
type="primary"
@click="transferRecord(scope.row)"
>流转记录</el-button>
<!--<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ehs:ehsDocument: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="docName">
<el-input v-model="form.docName" placeholder="请输入公文名称" />
</el-form-item>
<el-form-item label="公文字号" prop="docFont">
<el-input v-model="form.docFont" placeholder="请输入公文字号" />
</el-form-item>
<!--<el-form-item label="拟稿部门" prop="draftDept">
<el-input v-model="form.draftDept" placeholder="请输入拟稿部门" />
</el-form-item>-->
<el-form-item label="拟稿部门" prop="draftDept">
<el-select
v-model="form.draftDept"
placeholder="请选择拟稿部门"
clearable
style="width: 180px"
>
<el-option
v-for="(item, index) in ngbmInfo"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="公文类型" prop="docType">
<el-select v-model="form.docType" placeholder="请选择公文类型">
<el-option
v-for="dict in dict.type.doc_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="公文编号" prop="docNumber">
<el-input v-model="form.docNumber" placeholder="请输入公文编号" />
</el-form-item>
<el-form-item label="收文日期" prop="receiveTime">
<el-date-picker clearable
v-model="form.receiveTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择收文日期">
</el-date-picker>
</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>
<el-dialog :title="title1" :visible.sync="open1" width="600px" append-to-body>
<el-table v-loading="loading" :data="ehsDocTransferList">
<el-table-column label="序号" align="center">
<template slot-scope="scope">
<span>{{ Number(scope.$index) + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="流转人" align="center" prop="transferName" />
<el-table-column label="流转时间" align="center" prop="transferTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.transferTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="流转状态" align="center" prop="docTransferStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.doc_transfer_status" :value="scope.row.docTransferStatus"/>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import { listEhsDocument, getEhsDocument, delEhsDocument, addEhsDocument, updateEhsDocument, getAllDraftDept, getDocTransferById} from "@/api/ehs/ehsDocument";
import { listEhsDocTransfer } from '@/api/ehs/ehsDocTransfer'
import { parseTime } from '../../../utils/ruoyi'
import dict from '@/utils/dict'
export default {
name: "EhsDocument",
dicts: ['doc_type','doc_transfer_status'],
data() {
return {
//
loading: true,
//
ids: [],
// 稿
ngbmInfo: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
ehsDocumentList: [],
//
ehsDocTransferList: [],
//
title: "",
title1: "",
//
open: false,
open1: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
docName: null,
docType: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
// 稿
this.getAllDraftDept();
},
methods: {
dict,
parseTime,
/** 查询公文管理列表 */
getList() {
this.loading = true;
listEhsDocument(this.queryParams).then(response => {
this.ehsDocumentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 获取拟稿部门下拉列表 */
getAllDraftDept() {
getAllDraftDept().then((res) => {
console.log(res);
this.ngbmInfo = res.data;
});
},
//
cancel() {
this.open = false;
this.open1 = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
docName: null,
docFont: null,
draftDept: null,
docType: null,
docNumber: null,
receiveTime: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
deptId: null,
createUserId: null,
updateUserId: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "公文登记";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getEhsDocument(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改公文";
});
},
/** 流转记录按钮操作 */
transferRecord(row) {
this.reset();
const id = row.id || this.ids;
/** 查询公文流转记录 */
getDocTransferById(id).then(response => {
this.open1 = true;
this.loading = true;
this.title1 = "流转记录";
this.ehsDocTransferList = response.rows;
//this.total1 = response.total;
this.loading = false;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateEhsDocument(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEhsDocument(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除公文管理编号为"' + ids + '"的数据项?').then(function() {
return delEhsDocument(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ehs/ehsDocument/export', {
...this.queryParams
}, `ehsDocument_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save