修改ui项目标题

修改拦截器增加插入表示默认插入create_user_id,dept_id,update_user_id
增加物资管理模块
main
liukewei 12 months ago
parent bef3a697de
commit e1d3a417da

@ -10,7 +10,7 @@
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>若依管理系统</description> <description>唐河县安全隐患及应急救援管理平台</description>
<properties> <properties>
<ruoyi.version>3.8.6</ruoyi.version> <ruoyi.version>3.8.6</ruoyi.version>

@ -0,0 +1,114 @@
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.ehsMaterial.domain.EhsMaterial;
import com.ruoyi.ehsMaterial.service.IEhsMaterialService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-12-01
*/
@Api(tags="物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”管理")
@RestController
@RequestMapping("/ehsMaterial/ehsMaterial")
public class EhsMaterialController extends BaseController
{
@Autowired
private IEhsMaterialService ehsMaterialService;
/**
*
*/
@ApiOperation("查询物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”列表")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:list')")
@GetMapping("/list")
public TableDataInfo list(EhsMaterial ehsMaterial)
{
startPage();
List<EhsMaterial> list = ehsMaterialService.selectEhsMaterialList(ehsMaterial);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("导出物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”列表")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:export')")
@Log(title = "物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EhsMaterial ehsMaterial)
{
List<EhsMaterial> list = ehsMaterialService.selectEhsMaterialList(ehsMaterial);
ExcelUtil<EhsMaterial> util = new ExcelUtil<EhsMaterial>(EhsMaterial.class);
util.exportExcel(response, list, "物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”数据");
}
/**
*
*/
@ApiOperation("获取物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”详细信息")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:query')")
@GetMapping(value = "/{materialId}")
public AjaxResult getInfo(@PathVariable("materialId") Long materialId)
{
return success(ehsMaterialService.getById(materialId));
}
/**
*
*/
@ApiOperation("新增物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:add')")
@Log(title = "物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EhsMaterial ehsMaterial)
{
return toAjax(ehsMaterialService.save(ehsMaterial));
}
/**
*
*/
@ApiOperation("修改物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:edit')")
@Log(title = "物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EhsMaterial ehsMaterial)
{
return toAjax(ehsMaterialService.updateById(ehsMaterial));
}
/**
*
*/
@ApiOperation("删除物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”")
@PreAuthorize("@ss.hasPermi('ehsMaterial:ehsMaterial:remove')")
@Log(title = "物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”", businessType = BusinessType.DELETE)
@DeleteMapping("/{materialIds}")
public AjaxResult remove(@PathVariable Long[] materialIds)
{
return toAjax(ehsMaterialService.removeByIds(Arrays.asList(materialIds)));
}
}

@ -113,7 +113,7 @@ public class SwaggerConfig
// 用ApiInfoBuilder进行定制 // 用ApiInfoBuilder进行定制
return new ApiInfoBuilder() return new ApiInfoBuilder()
// 设置标题 // 设置标题
.title("标题:若依管理系统_接口文档") .title("标题:唐河县安全隐患及应急救援管理平台_接口文档")
// 描述 // 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息 // 作者信息

@ -27,16 +27,23 @@ public class BaseEntity implements Serializable
/** 创建者 */ /** 创建者 */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private String createBy; private String createBy;
/** 创建者 */
@TableField(fill = FieldFill.INSERT)
private Long createUserId;
/** 创建者 */
@TableField(fill = FieldFill.INSERT)
private Long deptId;
/** 创建时间 */ /** 创建时间 */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/** 更新者 */
@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateUserId;
/** 更新者 */ /** 更新者 */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy; private String updateBy;
/** 更新时间 */ /** 更新时间 */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ -50,6 +57,31 @@ public class BaseEntity implements Serializable
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params; private Map<String, Object> params;
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getUpdateUserId() {
return updateUserId;
}
public void setUpdateUserId(Long updateUserId) {
this.updateUserId = updateUserId;
}
public String getSearchValue() public String getSearchValue()
{ {
return searchValue; return searchValue;

@ -29,12 +29,18 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
? baseEntity.getCreateTime() : new Date(); ? baseEntity.getCreateTime() : new Date();
baseEntity.setCreateTime(current); baseEntity.setCreateTime(current);
baseEntity.setUpdateTime(current); baseEntity.setUpdateTime(current);
String username = StringUtils.isNotBlank(baseEntity.getCreateBy()) String username = StringUtils.isNotBlank(baseEntity.getCreateBy()) ? baseEntity.getCreateBy() : SecurityUtils.getUsername();
? baseEntity.getCreateBy() : SecurityUtils.getUsername();
// 当前已登录 且 创建人为空 则填充 // 当前已登录 且 创建人为空 则填充
baseEntity.setCreateBy(username); baseEntity.setCreateBy(username);
// 当前已登录 且 更新人为空 则填充 // 当前已登录 且 更新人为空 则填充
baseEntity.setUpdateBy(username); baseEntity.setUpdateBy(username);
Long userId = baseEntity.getCreateUserId()!=null ? baseEntity.getCreateUserId() : SecurityUtils.getUserId();
// 当前已登录 且 创建人为空 则填充
baseEntity.setCreateUserId(userId);
// 当前已登录 且 更新人为空 则填充
baseEntity.setUpdateUserId(userId);
baseEntity.setDeptId(baseEntity.getDeptId()!=null ? baseEntity.getDeptId() : SecurityUtils.getDeptId());
} }
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);

@ -0,0 +1,78 @@
package com.ruoyi.ehsMaterial.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_material
*
* @author ruoyi
* @date 2023-12-01
*/
@Data
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ehs_material")
public class EhsMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@TableId(type= IdType.AUTO)
private Long materialId;
/** 性质 */
@Excel(name = "性质")
private Long materialType;
/** 类别 */
@Excel(name = "类别")
private Long classFirst;
/** 类别 */
@Excel(name = "类别")
private String classSecond;
/** 物资名称 */
@Excel(name = "物资名称")
private String materialName;
/** 规格/参数 */
@Excel(name = "规格/参数")
private String materialSpecs;
/** 数量 */
@Excel(name = "数量")
private String materialQuantity;
/** 储备地点 */
@Excel(name = "储备地点")
private String reserveLocation;
/** 管理责任人 */
@Excel(name = "管理责任人")
private String managerPerson;
/** 联系电话 */
@Excel(name = "联系电话")
private String tel;
/** 创建者部门 */
private Long deptId;
/** 创建者id */
private Long createUserId;
/** 修改着id */
private Long updateUserId;
}

@ -0,0 +1,13 @@
package com.ruoyi.ehsMaterial.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ehsMaterial.domain.EhsMaterial;
/**
* Mapper
*
* @author ruoyi
* @date 2023-12-01
*/
public interface EhsMaterialMapper extends BaseMapper<EhsMaterial> {
}

@ -0,0 +1,23 @@
package com.ruoyi.ehsMaterial.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.ehsMaterial.domain.EhsMaterial;
/**
* Service
*
* @author ruoyi
* @date 2023-12-01
*/
public interface IEhsMaterialService extends IService<EhsMaterial> {
/**
*
*
* @param ehsMaterial
* @return
*/
public List<EhsMaterial> selectEhsMaterialList(EhsMaterial ehsMaterial);
}

@ -0,0 +1,57 @@
package com.ruoyi.ehsMaterial.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.ehsMaterial.mapper.EhsMaterialMapper;
import com.ruoyi.ehsMaterial.domain.EhsMaterial;
import com.ruoyi.ehsMaterial.service.IEhsMaterialService;
/**
* Service
*
* @author ruoyi
* @date 2023-12-01
*/
@Service
public class EhsMaterialServiceImpl extends ServiceImpl<EhsMaterialMapper, EhsMaterial> implements IEhsMaterialService {
@Autowired
private EhsMaterialMapper ehsMaterialMapper;
/**
*
*
* @param ehsMaterial
* @return
*/
@Override
public List<EhsMaterial> selectEhsMaterialList(EhsMaterial ehsMaterial)
{
List<EhsMaterial> ehsMaterialList = ehsMaterialMapper.selectList(buildQueryWrapper(ehsMaterial));
return ehsMaterialList;
}
private LambdaQueryWrapper<EhsMaterial> buildQueryWrapper(EhsMaterial query) {
Map<String, Object> params = query.getParams();
LambdaQueryWrapper<EhsMaterial> lqw = Wrappers.lambdaQuery();
lqw.eq(query.getMaterialType() != null, EhsMaterial::getMaterialType, query.getMaterialType());
lqw.eq(query.getClassFirst() != null, EhsMaterial::getClassFirst, query.getClassFirst());
lqw.eq(StringUtils.isNotBlank(query.getClassSecond()), EhsMaterial::getClassSecond, query.getClassSecond());
lqw.like(StringUtils.isNotBlank(query.getMaterialName()), EhsMaterial::getMaterialName, query.getMaterialName());
lqw.eq(StringUtils.isNotBlank(query.getMaterialSpecs()), EhsMaterial::getMaterialSpecs, query.getMaterialSpecs());
lqw.eq(StringUtils.isNotBlank(query.getMaterialQuantity()), EhsMaterial::getMaterialQuantity, query.getMaterialQuantity());
lqw.like(StringUtils.isNotBlank(query.getReserveLocation()), EhsMaterial::getReserveLocation, query.getReserveLocation());
lqw.like(StringUtils.isNotBlank(query.getManagerPerson()), EhsMaterial::getManagerPerson, query.getManagerPerson());
lqw.like(StringUtils.isNotBlank(query.getTel()), EhsMaterial::getTel, query.getTel());
lqw.orderByDesc(EhsMaterial::getCreateTime);
return lqw;
}
}

@ -0,0 +1,29 @@
<?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.ehsMaterial.mapper.EhsMaterialMapper">
<resultMap type="EhsMaterial" id="EhsMaterialResult">
<result property="materialId" column="material_id" />
<result property="materialType" column="material_type" />
<result property="classFirst" column="class_first" />
<result property="classSecond" column="class_second" />
<result property="materialName" column="material_name" />
<result property="materialSpecs" column="material_specs" />
<result property="materialQuantity" column="material_quantity" />
<result property="reserveLocation" column="reserve_location" />
<result property="managerPerson" column="Manager_person" />
<result property="tel" column="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>
</mapper>

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 唐河县安全隐患及应急救援管理平台
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 唐河县安全隐患及应急救援管理平台
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 唐河县安全隐患及应急救援管理平台
NODE_ENV = production NODE_ENV = production

@ -1,7 +1,7 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.6", "version": "3.8.6",
"description": "若依管理系统", "description": "唐河县安全隐患及应急救援管理平台",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”列表
export function listEhsMaterial(query) {
return request({
url: '/ehsMaterial/ehsMaterial/list',
method: 'get',
params: query
})
}
// 查询物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”详细
export function getEhsMaterial(materialId) {
return request({
url: '/ehsMaterial/ehsMaterial/' + materialId,
method: 'get'
})
}
// 新增物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”
export function addEhsMaterial(data) {
return request({
url: '/ehsMaterial/ehsMaterial',
method: 'post',
data: data
})
}
// 修改物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”
export function updateEhsMaterial(data) {
return request({
url: '/ehsMaterial/ehsMaterial',
method: 'put',
data: data
})
}
// 删除物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”
export function delEhsMaterial(materialId) {
return request({
url: '/ehsMaterial/ehsMaterial/' + materialId,
method: 'delete'
})
}

@ -0,0 +1,370 @@
<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="classFirst">
<el-input
v-model="queryParams.classFirst"
placeholder="请输入类别"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类别" prop="classSecond">
<el-input
v-model="queryParams.classSecond"
placeholder="请输入类别"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物资名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物资名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格/参数" prop="materialSpecs">
<el-input
v-model="queryParams.materialSpecs"
placeholder="请输入规格/参数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数量" prop="materialQuantity">
<el-input
v-model="queryParams.materialQuantity"
placeholder="请输入数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="储备地点" prop="reserveLocation">
<el-input
v-model="queryParams.reserveLocation"
placeholder="请输入储备地点"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="管理责任人" prop="managerPerson">
<el-input
v-model="queryParams.managerPerson"
placeholder="请输入管理责任人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="tel">
<el-input
v-model="queryParams.tel"
placeholder="请输入联系电话"
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="['ehsMaterial:ehsMaterial: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="['ehsMaterial:ehsMaterial: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="['ehsMaterial:ehsMaterial: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="['ehsMaterial:ehsMaterial:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ehsMaterialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="materialId" />
<el-table-column label="性质" align="center" prop="materialType" />
<el-table-column label="类别" align="center" prop="classFirst" />
<el-table-column label="类别" align="center" prop="classSecond">
<template slot-scope="scope">
<dict-tag :options="dict.type.material_class_1" :value="scope.row.classSecond"/>
</template>
</el-table-column>
<el-table-column label="物资名称" align="center" prop="materialName" />
<el-table-column label="规格/参数" align="center" prop="materialSpecs" />
<el-table-column label="数量" align="center" prop="materialQuantity" />
<el-table-column label="储备地点" align="center" prop="reserveLocation" />
<el-table-column label="管理责任人" align="center" prop="managerPerson" />
<el-table-column label="联系电话" align="center" prop="tel" />
<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="['ehsMaterial:ehsMaterial:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ehsMaterial:ehsMaterial: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="classFirst">
<el-input v-model="form.classFirst" placeholder="请输入类别" />
</el-form-item>
<el-form-item label="类别" prop="classSecond">
<el-input v-model="form.classSecond" placeholder="请输入类别" />
</el-form-item>
<el-form-item label="物资名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物资名称" />
</el-form-item>
<el-form-item label="规格/参数" prop="materialSpecs">
<el-input v-model="form.materialSpecs" placeholder="请输入规格/参数" />
</el-form-item>
<el-form-item label="数量" prop="materialQuantity">
<el-input v-model="form.materialQuantity" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="储备地点" prop="reserveLocation">
<el-input v-model="form.reserveLocation" placeholder="请输入储备地点" />
</el-form-item>
<el-form-item label="管理责任人" prop="managerPerson">
<el-input v-model="form.managerPerson" placeholder="请输入管理责任人" />
</el-form-item>
<el-form-item label="联系电话" prop="tel">
<el-input v-model="form.tel" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="创建者部门" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入创建者部门" />
</el-form-item>
<el-form-item label="创建者id" prop="createUserId">
<el-input v-model="form.createUserId" placeholder="请输入创建者id" />
</el-form-item>
<el-form-item label="修改着id" prop="updateUserId">
<el-input v-model="form.updateUserId" placeholder="请输入修改着id" />
</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 { listEhsMaterial, getEhsMaterial, delEhsMaterial, addEhsMaterial, updateEhsMaterial } from "@/api/ehs/ehsMaterial";
export default {
name: "EhsMaterial",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
ehsMaterialList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
materialType: null,
classFirst: null,
classSecond: null,
materialName: null,
materialSpecs: null,
materialQuantity: null,
reserveLocation: null,
managerPerson: null,
tel: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”列表 */
getList() {
this.loading = true;
listEhsMaterial(this.queryParams).then(response => {
this.ehsMaterialList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
materialId: null,
materialType: null,
classFirst: null,
classSecond: null,
materialName: null,
materialSpecs: null,
materialQuantity: null,
reserveLocation: null,
managerPerson: null,
tel: 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.materialId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const materialId = row.materialId || this.ids
getEhsMaterial(materialId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.materialId != null) {
updateEhsMaterial(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEhsMaterial(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const materialIds = row.materialId || this.ids;
this.$modal.confirm('是否确认删除物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”编号为"' + materialIds + '"的数据项?').then(function() {
return delEhsMaterial(materialIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ehsMaterial/ehsMaterial/export', {
...this.queryParams
}, `ehsMaterial_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require('compression-webpack-plugin') const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 const name = process.env.VUE_APP_TITLE || '唐河县安全隐患及应急救援管理平台' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口

Loading…
Cancel
Save