企业信息
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)));
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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>
|
@ -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>
|
Loading…
Reference in New Issue