企业信息

main
liukewei 10 months ago
parent 234aeaa283
commit ef343ae751

@ -0,0 +1,111 @@
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.ehsEnterprise.domain.EhsEnterprise;
import com.ruoyi.ehsEnterprise.service.IEhsEnterpriseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-08
*/
@Api(tags="企业基本信息管理")
@RestController
@RequestMapping("/ehsEnterprise/ehsEnterprise")
public class EhsEnterpriseController extends BaseController
{
@Autowired
private IEhsEnterpriseService ehsEnterpriseService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:list')")
@GetMapping("/list")
public TableDataInfo list(EhsEnterprise ehsEnterprise)
{
startPage();
List<EhsEnterprise> list = ehsEnterpriseService.selectEhsEnterpriseList(ehsEnterprise);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:export')")
@Log(title = "企业基本信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EhsEnterprise ehsEnterprise)
{
List<EhsEnterprise> list = ehsEnterpriseService.selectEhsEnterpriseList(ehsEnterprise);
ExcelUtil<EhsEnterprise> util = new ExcelUtil<EhsEnterprise>(EhsEnterprise.class);
util.exportExcel(response, list, "企业基本信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:query')")
@GetMapping(value = "/{enterpriseId}")
public AjaxResult getInfo(@PathVariable("enterpriseId") Long enterpriseId)
{
return success(ehsEnterpriseService.selectEhsEnterpriseByEnterpriseId(enterpriseId));
}
/**
*
*/
@ApiOperation("新增企业基本信息")
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:add')")
@Log(title = "企业基本信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EhsEnterprise ehsEnterprise)
{
return toAjax(ehsEnterpriseService.save(ehsEnterprise));
}
/**
*
*/
@ApiOperation("修改企业基本信息")
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:edit')")
@Log(title = "企业基本信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EhsEnterprise ehsEnterprise)
{
return toAjax(ehsEnterpriseService.updateById(ehsEnterprise));
}
/**
*
*/
@ApiOperation("删除企业基本信息")
@PreAuthorize("@ss.hasPermi('ehsEnterprise:ehsEnterprise:remove')")
@Log(title = "企业基本信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{enterpriseIds}")
public AjaxResult remove(@PathVariable Long[] enterpriseIds)
{
return toAjax(ehsEnterpriseService.removeByIds(Arrays.asList(enterpriseIds)));
}
}

@ -107,8 +107,8 @@ public class FileUploadUtils
{
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
}
assertAllowed(file, allowedExtension);
//验证扩展名和文件大小
//assertAllowed(file, allowedExtension);
String fileName = extractFilename(file);

@ -0,0 +1,81 @@
package com.ruoyi.ehsEnterprise.domain;
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_enterprise
*
* @author ruoyi
* @date 2023-12-08
*/
@Data
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ehs_enterprise")
public class EhsEnterprise extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
@TableId(type= IdType.AUTO)
private Long enterpriseId;
/** 社会信用代码 */
@Excel(name = "社会信用代码")
private String enterpriseCode;
/** 名称 */
@Excel(name = "名称")
private String enterpriseName;
/** 行业 */
@Excel(name = "行业")
private String enterpriseType;
/** 生产经营地址 */
@Excel(name = "生产经营地址")
private String enterpriseAddr;
/** 企业负责人 */
@Excel(name = "企业负责人")
private String enterpriseLeader;
/** 企业负责人电话 */
@Excel(name = "企业负责人电话")
private String leaderTel;
/** 注册资本 */
@Excel(name = "注册资本")
private String registeredCapital;
/** 营业执照核定的经营范围 */
@Excel(name = "营业执照核定的经营范围")
private String businessScope;
/** 企业实际从事的经营项目 */
@Excel(name = "企业实际从事的经营项目")
private String businessProjects;
/** 企业现状0停业、1正常经营 */
@Excel(name = "企业现状", readConverterExp = "0=停业、1正常经营")
private String enterpriseStatus;
/** 分管安全副职姓名 */
@Excel(name = "分管安全副职姓名")
private String safetyManagerName;
/** 分管安全副职电话 */
@Excel(name = "分管安全副职电话")
private String safetyManagerTel;
}

@ -0,0 +1,29 @@
package com.ruoyi.ehsEnterprise.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ehsEnterprise.domain.EhsEnterprise;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-08
*/
public interface EhsEnterpriseMapper extends BaseMapper<EhsEnterprise> {
/**
*
*
* @param enterpriseId
* @return
*/
public EhsEnterprise selectEhsEnterpriseByEnterpriseId(Long enterpriseId);
/**
*
*
* @param ehsEnterprise
* @return
*/
public List<EhsEnterprise> selectEhsEnterpriseList(EhsEnterprise ehsEnterprise);
}

@ -0,0 +1,31 @@
package com.ruoyi.ehsEnterprise.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.ehsEnterprise.domain.EhsEnterprise;
/**
* Service
*
* @author ruoyi
* @date 2023-12-08
*/
public interface IEhsEnterpriseService extends IService<EhsEnterprise> {
/**
*
*
* @param enterpriseId
* @return
*/
public EhsEnterprise selectEhsEnterpriseByEnterpriseId(Long enterpriseId);
/**
*
*
* @param ehsEnterprise
* @return
*/
public List<EhsEnterprise> selectEhsEnterpriseList(EhsEnterprise ehsEnterprise);
}

@ -0,0 +1,74 @@
package com.ruoyi.ehsEnterprise.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.ehsEnterprise.mapper.EhsEnterpriseMapper;
import com.ruoyi.ehsEnterprise.domain.EhsEnterprise;
import com.ruoyi.ehsEnterprise.service.IEhsEnterpriseService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-08
*/
@Service
public class EhsEnterpriseServiceImpl extends ServiceImpl<EhsEnterpriseMapper, EhsEnterprise> implements IEhsEnterpriseService {
@Autowired
private EhsEnterpriseMapper ehsEnterpriseMapper;
/**
*
*
* @param enterpriseId
* @return
*/
@Override
public EhsEnterprise selectEhsEnterpriseByEnterpriseId(Long enterpriseId)
{
return ehsEnterpriseMapper.selectEhsEnterpriseByEnterpriseId(enterpriseId);
}
/**
*
*
* @param ehsEnterprise
* @return
*/
@Override
public List<EhsEnterprise> selectEhsEnterpriseList(EhsEnterprise ehsEnterprise)
{
return ehsEnterpriseMapper.selectEhsEnterpriseList(ehsEnterprise);
}
private LambdaQueryWrapper<EhsEnterprise> buildQueryWrapper(EhsEnterprise query) {
Map<String, Object> params = query.getParams();
LambdaQueryWrapper<EhsEnterprise> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(query.getEnterpriseCode()), EhsEnterprise::getEnterpriseCode, query.getEnterpriseCode());
lqw.like(StringUtils.isNotBlank(query.getEnterpriseName()), EhsEnterprise::getEnterpriseName, query.getEnterpriseName());
lqw.eq(StringUtils.isNotBlank(query.getEnterpriseType()), EhsEnterprise::getEnterpriseType, query.getEnterpriseType());
lqw.like(StringUtils.isNotBlank(query.getEnterpriseAddr()), EhsEnterprise::getEnterpriseAddr, query.getEnterpriseAddr());
lqw.like(StringUtils.isNotBlank(query.getEnterpriseLeader()), EhsEnterprise::getEnterpriseLeader, query.getEnterpriseLeader());
lqw.like(StringUtils.isNotBlank(query.getLeaderTel()), EhsEnterprise::getLeaderTel, query.getLeaderTel());
lqw.like(StringUtils.isNotBlank(query.getRegisteredCapital()), EhsEnterprise::getRegisteredCapital, query.getRegisteredCapital());
lqw.like(StringUtils.isNotBlank(query.getBusinessScope()), EhsEnterprise::getBusinessScope, query.getBusinessScope());
lqw.like(StringUtils.isNotBlank(query.getBusinessProjects()), EhsEnterprise::getBusinessProjects, query.getBusinessProjects());
lqw.eq(StringUtils.isNotBlank(query.getEnterpriseStatus()), EhsEnterprise::getEnterpriseStatus, query.getEnterpriseStatus());
lqw.like(StringUtils.isNotBlank(query.getSafetyManagerName()), EhsEnterprise::getSafetyManagerName, query.getSafetyManagerName());
lqw.like(StringUtils.isNotBlank(query.getSafetyManagerTel()), EhsEnterprise::getSafetyManagerTel, query.getSafetyManagerTel());
lqw.orderByDesc(EhsEnterprise::getCreateTime);
lqw.eq(query.getDeptId() != null, EhsEnterprise::getDeptId, query.getDeptId());
lqw.eq(query.getCreateUserId() != null, EhsEnterprise::getCreateUserId, query.getCreateUserId());
lqw.eq(query.getUpdateUserId() != null, EhsEnterprise::getUpdateUserId, query.getUpdateUserId());
return lqw;
}
}

@ -40,8 +40,11 @@ public class EhsNoticeMessage extends BaseEntity
/** 文件下载列表 */
@Excel(name = "文件下载列表")
@TableField(exist = false)
private String fileName;
/** 临时任务的下载模板 */
@Excel(name = "下载模板")
private String fileTempName;
/** 1:未发布 2:已发布 */
@Excel(name = "0:未发布 1:已发布")
private String status;

@ -0,0 +1,64 @@
<?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.ehsEnterprise.mapper.EhsEnterpriseMapper">
<resultMap type="EhsEnterprise" id="EhsEnterpriseResult">
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseType" column="enterprise_type" />
<result property="enterpriseAddr" column="enterprise_addr" />
<result property="enterpriseLeader" column="Enterprise_leader" />
<result property="leaderTel" column="leader_tel" />
<result property="registeredCapital" column="registered_capital" />
<result property="businessScope" column="business_scope" />
<result property="businessProjects" column="business_projects" />
<result property="enterpriseStatus" column="enterprise_status" />
<result property="safetyManagerName" column="safety_manager_name" />
<result property="safetyManagerTel" column="safety_manager_tel" />
<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="selectEhsEnterpriseVo">
select enterprise_id, enterprise_code, enterprise_name, enterprise_type, enterprise_addr, Enterprise_leader, leader_tel, registered_capital, business_scope, business_projects, enterprise_status, safety_manager_name, safety_manager_tel, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_enterprise
</sql>
<select id="selectEhsEnterpriseList" parameterType="EhsEnterprise" resultMap="EhsEnterpriseResult">
<include refid="selectEhsEnterpriseVo"/>
<where>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseType != null and enterpriseType != ''"> and enterprise_type = #{enterpriseType}</if>
<if test="enterpriseAddr != null and enterpriseAddr != ''"> and enterprise_addr like concat('%', #{enterpriseAddr}, '%')</if>
<if test="enterpriseLeader != null and enterpriseLeader != ''"> and Enterprise_leader like concat('%', #{enterpriseLeader}, '%')</if>
<if test="leaderTel != null and leaderTel != ''"> and leader_tel like concat('%', #{leaderTel}, '%')</if>
<if test="registeredCapital != null and registeredCapital != ''"> and registered_capital like concat('%', #{registeredCapital}, '%')</if>
<if test="businessScope != null and businessScope != ''"> and business_scope like concat('%', #{businessScope}, '%')</if>
<if test="businessProjects != null and businessProjects != ''"> and business_projects like concat('%', #{businessProjects}, '%')</if>
<if test="enterpriseStatus != null and enterpriseStatus != ''"> and enterprise_status = #{enterpriseStatus}</if>
<if test="safetyManagerName != null and safetyManagerName != ''"> and safety_manager_name like concat('%', #{safetyManagerName}, '%')</if>
<if test="safetyManagerTel != null and safetyManagerTel != ''"> and safety_manager_tel like concat('%', #{safetyManagerTel}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
</where>
</select>
<select id="selectEhsEnterpriseByEnterpriseId" parameterType="Long" resultMap="EhsEnterpriseResult">
<include refid="selectEhsEnterpriseVo"/>
where enterprise_id = #{enterpriseId}
</select>
</mapper>

@ -9,6 +9,7 @@
<result property="title" column="title" />
<result property="displayContent" column="display_content" />
<result property="fileName" column="file_name" />
<result property="fileTempName" column="file_temp_name" />
<result property="status" column="status" />
<result property="readDeptId" column="read_dept_id" />
<result property="mesgType" column="mesg_type" />
@ -33,12 +34,12 @@
</resultMap>
<sql id="selectEhsNoticeMessageVo">
select notice_message_id, title, display_content, file_name, status, read_dept_id, mesg_type, dept_list, all_dept, create_dept_id, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_notice_message
select notice_message_id, title, display_content, file_temp_name, status, read_dept_id, mesg_type, dept_list, all_dept, create_dept_id, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_notice_message
</sql>
<select id="selectEhsNoticeMessageList" parameterType="EhsNoticeMessage" resultMap="EhsNoticeMessageResult">
select m.notice_message_id, m.create_user_id, m.create_time, m.dept_id,m.title, m.display_content, m.status,d.dept_name dept_name
,FIND_IN_SET(#{deptId}, m.read_dept_id ) is_read,m.mesg_type,m.read_dept_id,m.all_dept,
,FIND_IN_SET(#{deptId}, m.read_dept_id ) is_read,m.mesg_type,m.read_dept_id,m.all_dept,m.file_temp_name,
(select f.id from ehs_notice_message_file f where m.notice_message_id = f.notice_message_id and f.dept_ID =#{fileDeptId} ) AS message_file_id,
(select f.file_name from ehs_notice_message_file f where m.notice_message_id = f.notice_message_id and f.dept_ID =#{fileDeptId}) file_name,
IFNULL((select IFNULL(f.state,0) from ehs_notice_message_file f where m.notice_message_id = f.notice_message_id and f.dept_ID =#{fileDeptId}),0) file_state,

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询企业基本信息列表
export function listEhsEnterprise(query) {
return request({
url: '/ehsEnterprise/ehsEnterprise/list',
method: 'get',
params: query
})
}
// 查询企业基本信息详细
export function getEhsEnterprise(enterpriseId) {
return request({
url: '/ehsEnterprise/ehsEnterprise/' + enterpriseId,
method: 'get'
})
}
// 新增企业基本信息
export function addEhsEnterprise(data) {
return request({
url: '/ehsEnterprise/ehsEnterprise',
method: 'post',
data: data
})
}
// 修改企业基本信息
export function updateEhsEnterprise(data) {
return request({
url: '/ehsEnterprise/ehsEnterprise',
method: 'put',
data: data
})
}
// 删除企业基本信息
export function delEhsEnterprise(enterpriseId) {
return request({
url: '/ehsEnterprise/ehsEnterprise/' + enterpriseId,
method: 'delete'
})
}

@ -0,0 +1,467 @@
<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="deptId" v-show="deptShow">
<el-select v-model="queryParams.deptId" filterable placeholder="请选择部门" clearable>
<el-option
v-for="dict in allDeptList"
:key="dict.deptId"
:label="dict.deptName"
:value="dict.deptId"
/>
</el-select>
</el-form-item>
<el-form-item label="社会信用代码" prop="enterpriseCode">
<el-input
v-model="queryParams.enterpriseCode"
placeholder="请输入社会信用代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="名称" prop="enterpriseName">
<el-input
v-model="queryParams.enterpriseName"
placeholder="请输入名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="行业" prop="enterpriseType">
<el-select v-model="queryParams.enterpriseType" placeholder="请选择行业" clearable>
<el-option
v-for="dict in dict.type.enterprise_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="生产经营地址" prop="enterpriseAddr">
<el-input
v-model="queryParams.enterpriseAddr"
placeholder="请输入生产经营地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="企业负责人" prop="enterpriseLeader">
<el-input
v-model="queryParams.enterpriseLeader"
placeholder="请输入企业负责人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="企业负责人电话" prop="leaderTel">
<el-input
v-model="queryParams.leaderTel"
placeholder="请输入企业负责人电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="注册资本" prop="registeredCapital">
<el-input
v-model="queryParams.registeredCapital"
placeholder="请输入注册资本"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="营业执照核定的经营范围" prop="businessScope">
<el-input
v-model="queryParams.businessScope"
placeholder="请输入营业执照核定的经营范围"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="企业实际从事的经营项目" prop="businessProjects">
<el-input
v-model="queryParams.businessProjects"
placeholder="请输入企业实际从事的经营项目"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="分管安全副职姓名" prop="safetyManagerName">
<el-input
v-model="queryParams.safetyManagerName"
placeholder="请输入分管安全副职姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="分管安全副职电话" prop="safetyManagerTel">
<el-input
v-model="queryParams.safetyManagerTel"
placeholder="请输入分管安全副职电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建者部门" prop="deptId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入创建者部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建者id" prop="createUserId">
<el-input
v-model="queryParams.createUserId"
placeholder="请输入创建者id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="修改着id" prop="updateUserId">
<el-input
v-model="queryParams.updateUserId"
placeholder="请输入修改着id"
clearable
@keyup.enter.native="handleQuery"
/>
</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-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ehsEnterprise:ehsEnterprise:add']"
>新增</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="['ehsEnterprise:ehsEnterprise: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="['ehsEnterprise:ehsEnterprise: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="['ehsEnterprise:ehsEnterprise:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ehsEnterpriseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="enterpriseId" />
<el-table-column label="社会信用代码" align="center" prop="enterpriseCode" />
<el-table-column label="名称" align="center" prop="enterpriseName" />
<el-table-column label="行业" align="center" prop="enterpriseType">
<template slot-scope="scope">
<dict-tag :options="dict.type.enterprise_type" :value="scope.row.enterpriseType"/>
</template>
</el-table-column>
<el-table-column label="生产经营地址" align="center" prop="enterpriseAddr" />
<el-table-column label="企业负责人" align="center" prop="enterpriseLeader" />
<el-table-column label="企业负责人电话" align="center" prop="leaderTel" />
<el-table-column label="注册资本" align="center" prop="registeredCapital" />
<el-table-column label="营业执照核定的经营范围" align="center" prop="businessScope" />
<el-table-column label="企业实际从事的经营项目" align="center" prop="businessProjects" />
<el-table-column label="企业现状" align="center" prop="enterpriseStatus" />
<el-table-column label="分管安全副职姓名" align="center" prop="safetyManagerName" />
<el-table-column label="分管安全副职电话" align="center" prop="safetyManagerTel" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建者部门" align="center" prop="deptId" />
<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="['ehsEnterprise:ehsEnterprise:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ehsEnterprise:ehsEnterprise: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="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="社会信用代码" prop="enterpriseCode">
<el-input v-model="form.enterpriseCode" placeholder="请输入社会信用代码" />
</el-form-item>
<el-form-item label="名称" prop="enterpriseName">
<el-input v-model="form.enterpriseName" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="行业" prop="enterpriseType">
<el-select v-model="form.enterpriseType" placeholder="请选择行业">
<el-option
v-for="dict in dict.type.enterprise_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产经营地址" prop="enterpriseAddr">
<el-input v-model="form.enterpriseAddr" placeholder="请输入生产经营地址" />
</el-form-item>
<el-form-item label="企业负责人" prop="enterpriseLeader">
<el-input v-model="form.enterpriseLeader" placeholder="请输入企业负责人" />
</el-form-item>
<el-form-item label="企业负责人电话" prop="leaderTel">
<el-input v-model="form.leaderTel" placeholder="请输入企业负责人电话" />
</el-form-item>
<el-form-item label="注册资本" prop="registeredCapital">
<el-input v-model="form.registeredCapital" placeholder="请输入注册资本" />
</el-form-item>
<el-form-item label="营业执照核定的经营范围" prop="businessScope">
<el-input v-model="form.businessScope" placeholder="请输入营业执照核定的经营范围" />
</el-form-item>
<el-form-item label="企业实际从事的经营项目" prop="businessProjects">
<el-input v-model="form.businessProjects" placeholder="请输入企业实际从事的经营项目" />
</el-form-item>
<el-form-item label="分管安全副职姓名" prop="safetyManagerName">
<el-input v-model="form.safetyManagerName" placeholder="请输入分管安全副职姓名" />
</el-form-item>
<el-form-item label="分管安全副职电话" prop="safetyManagerTel">
<el-input v-model="form.safetyManagerTel" 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 { listEhsEnterprise, getEhsEnterprise, delEhsEnterprise, addEhsEnterprise, updateEhsEnterprise } from "@/api/ehs/ehsEnterprise";
import {listAllDept } from "@/api/system/dept";
export default {
name: "EhsEnterprise",
dicts: ['enterprise_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
ehsEnterpriseList: [],
//
deptShow: false,
//
allDeptList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseCode: null,
enterpriseName: null,
enterpriseType: null,
enterpriseAddr: null,
enterpriseLeader: null,
leaderTel: null,
registeredCapital: null,
businessScope: null,
businessProjects: null,
enterpriseStatus: null,
safetyManagerName: null,
safetyManagerTel: null,
deptId: null,
createUserId: null,
updateUserId: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
},
methods: {
/** 查询企业基本信息列表 */
getList() {
this.loading = true;
listEhsEnterprise(this.queryParams).then(response => {
this.ehsEnterpriseList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 单位信息列表 */
getListAllDept() {
console.log(this.$store.state.user.deptId);
this.loading = true;
listAllDept().then(response => {
this.allDeptList = response.data;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
enterpriseId: null,
enterpriseCode: null,
enterpriseName: null,
enterpriseType: null,
enterpriseAddr: null,
enterpriseLeader: null,
leaderTel: null,
registeredCapital: null,
businessScope: null,
businessProjects: null,
enterpriseStatus: null,
safetyManagerName: null,
safetyManagerTel: 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.enterpriseId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加企业基本信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const enterpriseId = row.enterpriseId || this.ids
getEhsEnterprise(enterpriseId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改企业基本信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.enterpriseId != null) {
updateEhsEnterprise(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEhsEnterprise(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const enterpriseIds = row.enterpriseId || this.ids;
this.$modal.confirm('是否确认删除企业基本信息编号为"' + enterpriseIds + '"的数据项?').then(function() {
return delEhsEnterprise(enterpriseIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ehsEnterprise/ehsEnterprise/export', {
...this.queryParams
}, `ehsEnterprise_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -63,6 +63,7 @@
<span v-html='scope.row.allDept==1 ?"": scope.row.deptName.replace(/;/g ,"<br>")'> </span>
</template>
</el-table-column>
<el-table-column label="任务模板" align="center" prop="fileTempName" v-if ="taskShow" />
<el-table-column label="发布状态" align="center" prop="status" >
<template slot-scope="scope">
<span> {{ statusList[scope.row.status].label}}</span>
@ -125,7 +126,7 @@
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="部门" prop="deptList">
<el-checkbox v-model="allDeptCheck" @change="allDeptChange"></el-checkbox>
<el-checkbox v-model="allDeptCheck" @change="allDeptChange"></el-checkbox>
<el-select v-model="form.deptList" multiple collapse-tags v-if = "deptShow"
style="margin-left: 20px;" placeholder="请选择">
<el-option
@ -136,6 +137,9 @@
/>
</el-select>
</el-form-item>
<el-form-item label="上报模板" v-if="taskShow">
<file-upload v-model="form.fileTempName" fileType=""/>
</el-form-item>
<el-form-item label="内容">
<editor v-model="form.displayContent" :min-height="192"/>
</el-form-item>
@ -212,6 +216,7 @@ export default {
deptShow:true,
//
allDeptCheck:false,
taskShow:false,//
//
queryParams: {
pageNum: 1,
@ -221,13 +226,13 @@ export default {
fileName: null,
status: null,
readDeptId: null,
mesgType: null,
deptList: null,
allDept: null,
createDeptId: null,
deptId: null,
createUserId: null,
updateUserId: null
updateUserId: null,
mesgType: this.$route.query.noticeType,
},
statusList: [{
value: '0',
@ -252,6 +257,7 @@ export default {
created() {
this.getList();
this.getListAllDept();
this.taskShow = this.$route.query.noticeType==1 ?true :false; //=0 =1
},
methods: {
//
@ -291,7 +297,7 @@ export default {
fileName: null,
status: null,
readDeptId: null,
mesgType: null,
mesgType: this.$route.query.noticeType,
deptList: null,
allDept: null,
createDeptId: null,
@ -302,7 +308,8 @@ export default {
remark: null,
deptId: null,
createUserId: null,
updateUserId: null
updateUserId: null,
fileTempName:null
};
this.resetForm("form");
},

@ -75,7 +75,7 @@
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="noticeMessageId" />-->
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="任务模板" align="center" prop="fileTempName" v-if ="taskShow" />
<el-table-column label="提交状态" align="center" prop="status" >
<template slot-scope="scope">
<span> {{ statusList[scope.row.fileState].label }}</span>
@ -230,6 +230,7 @@ export default {
openFile:false,
//id
curNoticeMessageId:"",
taskShow:false,
//
queryParams: {
pageNum: 1,
@ -239,7 +240,7 @@ export default {
fileName: null,
status: null,
readDeptId: null,
mesgType: null,
mesgType: this.$route.query.noticeType,
deptList: null,
allDept: null,
createDeptId: null,
@ -266,6 +267,7 @@ export default {
created() {
this.getList();
this.getListAllDept();
this.taskShow = this.$route.query.noticeType==1 ?true :false; //=0 =1
},
methods: {
/** 查询内部公告列表 */
@ -306,7 +308,7 @@ export default {
fileName: null,
status: null,
readDeptId: null,
mesgType: null,
mesgType: this.$route.query.noticeType,
deptList: null,
allDept: null,
createDeptId: null,

@ -2,7 +2,7 @@
<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="deptId" v-show="deptShow">
<el-select v-model="queryParams.deptId" placeholder="请选择部门" clearable>
<el-select v-model="queryParams.deptId" filterable placeholder="请选择部门" clearable>
<el-option
v-for="dict in allDeptList"
:key="dict.deptId"

@ -36,7 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://127.0.0.1:8082`,
//target: `http://221.176.140.236`,
//target: `http://221.176.140.236:8082`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save