增加轮胎基础信息管理

master
杨万里 2 years ago
parent d29771c1ea
commit ea6f5326e4

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-basetyre</artifactId>
<version>3.8.5</version>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,104 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
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 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.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.service.IBaseTyreService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yangwl
* @date 2023-02-06
*/
@RestController
@RequestMapping("/basetyre/basetyre")
public class BaseTyreController extends BaseController
{
@Autowired
private IBaseTyreService baseTyreService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:list')")
@GetMapping("/list")
public TableDataInfo list(BaseTyre baseTyre)
{
startPage();
List<BaseTyre> list = baseTyreService.selectBaseTyreList(baseTyre);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:export')")
@Log(title = "轮胎基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseTyre baseTyre)
{
List<BaseTyre> list = baseTyreService.selectBaseTyreList(baseTyre);
ExcelUtil<BaseTyre> util = new ExcelUtil<BaseTyre>(BaseTyre.class);
util.exportExcel(response, list, "轮胎基础信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(baseTyreService.selectBaseTyreById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:add')")
@Log(title = "轮胎基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseTyre baseTyre)
{
return toAjax(baseTyreService.insertBaseTyre(baseTyre));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:edit')")
@Log(title = "轮胎基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseTyre baseTyre)
{
return toAjax(baseTyreService.updateBaseTyre(baseTyre));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:basetyre:remove')")
@Log(title = "轮胎基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(baseTyreService.deleteBaseTyreByIds(ids));
}
}

@ -0,0 +1,322 @@
package com.ruoyi.basetyre.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* base_tyre
*
* @author Yangwl
* @date 2023-02-06
*/
public class BaseTyre extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private String id;
/** 轮胎厂编码 */
@Excel(name = "轮胎厂编码")
private String tyreFacCode;
/** 企业编码 */
@Excel(name = "企业编码")
private String companyCode;
/** 车辆ID */
@Excel(name = "车辆ID")
private String carId;
/** 车牌号 */
@Excel(name = "车牌号")
private String carLicense;
/** 轮胎编号 */
@Excel(name = "轮胎编号")
private String tureCode;
/** 轮胎型号 */
@Excel(name = "轮胎型号")
private String tureModel;
/** 轮胎型号表ID */
@Excel(name = "轮胎型号表ID")
private String tureModelId;
/** 品牌ID */
@Excel(name = "品牌ID")
private String tureBrandId;
/** RFID */
@Excel(name = "RFID")
private String tyreRfid;
/** 轮位拼四段式1-1-1-21第一轴左侧外总第21个胎 */
@Excel(name = "轮位", readConverterExp = "拼=四段式1-1-1-21")
private String tyrePosition;
/** 当前轮胎传感器ID */
@Excel(name = "当前轮胎传感器ID")
private String sensorId;
/** 当前花纹深度 */
@Excel(name = "当前花纹深度")
private Long currentTextureDepth;
/** 状态 */
@Excel(name = "状态")
private Long state;
/** 是否删除 */
@Excel(name = "是否删除")
private Long isDelete;
/** 创建者ID */
@Excel(name = "创建者ID")
private String createId;
/** 创建者姓名 */
@Excel(name = "创建者姓名")
private String createName;
/** 修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date modifyTime;
/** 修改者ID */
@Excel(name = "修改者ID")
private String modifyId;
/** 修改者账号 */
@Excel(name = "修改者账号")
private String modifyBy;
/** 编辑者姓名 */
@Excel(name = "编辑者姓名")
private String modifyName;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTyreFacCode(String tyreFacCode)
{
this.tyreFacCode = tyreFacCode;
}
public String getTyreFacCode()
{
return tyreFacCode;
}
public void setCompanyCode(String companyCode)
{
this.companyCode = companyCode;
}
public String getCompanyCode()
{
return companyCode;
}
public void setCarId(String carId)
{
this.carId = carId;
}
public String getCarId()
{
return carId;
}
public void setCarLicense(String carLicense)
{
this.carLicense = carLicense;
}
public String getCarLicense()
{
return carLicense;
}
public void setTureCode(String tureCode)
{
this.tureCode = tureCode;
}
public String getTureCode()
{
return tureCode;
}
public void setTureModel(String tureModel)
{
this.tureModel = tureModel;
}
public String getTureModel()
{
return tureModel;
}
public void setTureModelId(String tureModelId)
{
this.tureModelId = tureModelId;
}
public String getTureModelId()
{
return tureModelId;
}
public void setTureBrandId(String tureBrandId)
{
this.tureBrandId = tureBrandId;
}
public String getTureBrandId()
{
return tureBrandId;
}
public void setTyreRfid(String tyreRfid)
{
this.tyreRfid = tyreRfid;
}
public String getTyreRfid()
{
return tyreRfid;
}
public void setTyrePosition(String tyrePosition)
{
this.tyrePosition = tyrePosition;
}
public String getTyrePosition()
{
return tyrePosition;
}
public void setSensorId(String sensorId)
{
this.sensorId = sensorId;
}
public String getSensorId()
{
return sensorId;
}
public void setCurrentTextureDepth(Long currentTextureDepth)
{
this.currentTextureDepth = currentTextureDepth;
}
public Long getCurrentTextureDepth()
{
return currentTextureDepth;
}
public void setState(Long state)
{
this.state = state;
}
public Long getState()
{
return state;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
public void setCreateId(String createId)
{
this.createId = createId;
}
public String getCreateId()
{
return createId;
}
public void setCreateName(String createName)
{
this.createName = createName;
}
public String getCreateName()
{
return createName;
}
public void setModifyTime(Date modifyTime)
{
this.modifyTime = modifyTime;
}
public Date getModifyTime()
{
return modifyTime;
}
public void setModifyId(String modifyId)
{
this.modifyId = modifyId;
}
public String getModifyId()
{
return modifyId;
}
public void setModifyBy(String modifyBy)
{
this.modifyBy = modifyBy;
}
public String getModifyBy()
{
return modifyBy;
}
public void setModifyName(String modifyName)
{
this.modifyName = modifyName;
}
public String getModifyName()
{
return modifyName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tyreFacCode", getTyreFacCode())
.append("companyCode", getCompanyCode())
.append("carId", getCarId())
.append("carLicense", getCarLicense())
.append("tureCode", getTureCode())
.append("tureModel", getTureModel())
.append("tureModelId", getTureModelId())
.append("tureBrandId", getTureBrandId())
.append("tyreRfid", getTyreRfid())
.append("tyrePosition", getTyrePosition())
.append("sensorId", getSensorId())
.append("currentTextureDepth", getCurrentTextureDepth())
.append("state", getState())
.append("isDelete", getIsDelete())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.append("createBy", getCreateBy())
.append("createName", getCreateName())
.append("modifyTime", getModifyTime())
.append("modifyId", getModifyId())
.append("modifyBy", getModifyBy())
.append("modifyName", getModifyName())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.mapper;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseTyre;
/**
* Mapper
*
* @author Yangwl
* @date 2023-02-06
*/
public interface BaseTyreMapper
{
/**
*
*
* @param id
* @return
*/
public BaseTyre selectBaseTyreById(String id);
/**
*
*
* @param baseTyre
* @return
*/
public List<BaseTyre> selectBaseTyreList(BaseTyre baseTyre);
/**
*
*
* @param baseTyre
* @return
*/
public int insertBaseTyre(BaseTyre baseTyre);
/**
*
*
* @param baseTyre
* @return
*/
public int updateBaseTyre(BaseTyre baseTyre);
/**
*
*
* @param id
* @return
*/
public int deleteBaseTyreById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseTyreByIds(String[] ids);
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.service;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseTyre;
/**
* Service
*
* @author Yangwl
* @date 2023-02-06
*/
public interface IBaseTyreService
{
/**
*
*
* @param id
* @return
*/
public BaseTyre selectBaseTyreById(String id);
/**
*
*
* @param baseTyre
* @return
*/
public List<BaseTyre> selectBaseTyreList(BaseTyre baseTyre);
/**
*
*
* @param baseTyre
* @return
*/
public int insertBaseTyre(BaseTyre baseTyre);
/**
*
*
* @param baseTyre
* @return
*/
public int updateBaseTyre(BaseTyre baseTyre);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseTyreByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBaseTyreById(String id);
}

@ -0,0 +1,95 @@
package com.ruoyi.basetyre.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basetyre.mapper.BaseTyreMapper;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.service.IBaseTyreService;
/**
* Service
*
* @author Yangwl
* @date 2023-02-06
*/
@Service
public class BaseTyreServiceImpl implements IBaseTyreService
{
@Autowired
private BaseTyreMapper baseTyreMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BaseTyre selectBaseTyreById(String id)
{
return baseTyreMapper.selectBaseTyreById(id);
}
/**
*
*
* @param baseTyre
* @return
*/
@Override
public List<BaseTyre> selectBaseTyreList(BaseTyre baseTyre)
{
return baseTyreMapper.selectBaseTyreList(baseTyre);
}
/**
*
*
* @param baseTyre
* @return
*/
@Override
public int insertBaseTyre(BaseTyre baseTyre)
{
baseTyre.setCreateTime(DateUtils.getNowDate());
return baseTyreMapper.insertBaseTyre(baseTyre);
}
/**
*
*
* @param baseTyre
* @return
*/
@Override
public int updateBaseTyre(BaseTyre baseTyre)
{
return baseTyreMapper.updateBaseTyre(baseTyre);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBaseTyreByIds(String[] ids)
{
return baseTyreMapper.deleteBaseTyreByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBaseTyreById(String id)
{
return baseTyreMapper.deleteBaseTyreById(id);
}
}

@ -0,0 +1,161 @@
<?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.basetyre.mapper.BaseTyreMapper">
<resultMap type="BaseTyre" id="BaseTyreResult">
<result property="id" column="id" />
<result property="tyreFacCode" column="tyre_fac_code" />
<result property="companyCode" column="company_code" />
<result property="carId" column="car_id" />
<result property="carLicense" column="car_license" />
<result property="tureCode" column="ture_code" />
<result property="tureModel" column="ture_model" />
<result property="tureModelId" column="ture_model_id" />
<result property="tureBrandId" column="ture_brand_id" />
<result property="tyreRfid" column="tyre_rfid" />
<result property="tyrePosition" column="tyre_position" />
<result property="sensorId" column="sensor_id" />
<result property="currentTextureDepth" column="current_texture_depth" />
<result property="state" column="state" />
<result property="isDelete" column="is_delete" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
<result property="createBy" column="create_by" />
<result property="createName" column="create_name" />
<result property="modifyTime" column="modify_time" />
<result property="modifyId" column="modify_id" />
<result property="modifyBy" column="modify_by" />
<result property="modifyName" column="modify__name" />
</resultMap>
<sql id="selectBaseTyreVo">
select id, tyre_fac_code, company_code, car_id, car_license, ture_code, ture_model, ture_model_id, ture_brand_id, tyre_rfid, tyre_position, sensor_id, current_texture_depth, state, is_delete, create_time, create_id, create_by, create_name, modify_time, modify_id, modify_by, modify__name from base_tyre
</sql>
<select id="selectBaseTyreList" parameterType="BaseTyre" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
<where>
<if test="tyreFacCode != null and tyreFacCode != ''"> and tyre_fac_code = #{tyreFacCode}</if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if>
<if test="carId != null and carId != ''"> and car_id = #{carId}</if>
<if test="carLicense != null and carLicense != ''"> and car_license = #{carLicense}</if>
<if test="tureCode != null and tureCode != ''"> and ture_code like concat('%', #{tureCode}, '%')</if>
<if test="tureModel != null and tureModel != ''"> and ture_model = #{tureModel}</if>
<if test="tureModelId != null and tureModelId != ''"> and ture_model_id = #{tureModelId}</if>
<if test="tureBrandId != null and tureBrandId != ''"> and ture_brand_id = #{tureBrandId}</if>
<if test="tyreRfid != null and tyreRfid != ''"> and tyre_rfid = #{tyreRfid}</if>
<if test="tyrePosition != null and tyrePosition != ''"> and tyre_position = #{tyrePosition}</if>
<if test="sensorId != null and sensorId != ''"> and sensor_id = #{sensorId}</if>
<if test="currentTextureDepth != null "> and current_texture_depth = #{currentTextureDepth}</if>
<if test="state != null "> and state = #{state}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="createId != null and createId != ''"> and create_id = #{createId}</if>
<if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
<if test="modifyId != null and modifyId != ''"> and modify_id = #{modifyId}</if>
<if test="modifyBy != null and modifyBy != ''"> and modify_by = #{modifyBy}</if>
<if test="modifyName != null and modifyName != ''"> and modify__name like concat('%', #{modifyName}, '%')</if>
</where>
</select>
<select id="selectBaseTyreById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where id = #{id}
</select>
<insert id="insertBaseTyre" parameterType="BaseTyre">
insert into base_tyre
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tyreFacCode != null">tyre_fac_code,</if>
<if test="companyCode != null">company_code,</if>
<if test="carId != null">car_id,</if>
<if test="carLicense != null">car_license,</if>
<if test="tureCode != null">ture_code,</if>
<if test="tureModel != null">ture_model,</if>
<if test="tureModelId != null">ture_model_id,</if>
<if test="tureBrandId != null">ture_brand_id,</if>
<if test="tyreRfid != null">tyre_rfid,</if>
<if test="tyrePosition != null">tyre_position,</if>
<if test="sensorId != null">sensor_id,</if>
<if test="currentTextureDepth != null">current_texture_depth,</if>
<if test="state != null">state,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createName != null">create_name,</if>
<if test="modifyTime != null">modify_time,</if>
<if test="modifyId != null">modify_id,</if>
<if test="modifyBy != null">modify_by,</if>
<if test="modifyName != null">modify__name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tyreFacCode != null">#{tyreFacCode},</if>
<if test="companyCode != null">#{companyCode},</if>
<if test="carId != null">#{carId},</if>
<if test="carLicense != null">#{carLicense},</if>
<if test="tureCode != null">#{tureCode},</if>
<if test="tureModel != null">#{tureModel},</if>
<if test="tureModelId != null">#{tureModelId},</if>
<if test="tureBrandId != null">#{tureBrandId},</if>
<if test="tyreRfid != null">#{tyreRfid},</if>
<if test="tyrePosition != null">#{tyrePosition},</if>
<if test="sensorId != null">#{sensorId},</if>
<if test="currentTextureDepth != null">#{currentTextureDepth},</if>
<if test="state != null">#{state},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createName != null">#{createName},</if>
<if test="modifyTime != null">#{modifyTime},</if>
<if test="modifyId != null">#{modifyId},</if>
<if test="modifyBy != null">#{modifyBy},</if>
<if test="modifyName != null">#{modifyName},</if>
</trim>
</insert>
<update id="updateBaseTyre" parameterType="BaseTyre">
update base_tyre
<trim prefix="SET" suffixOverrides=",">
<if test="tyreFacCode != null">tyre_fac_code = #{tyreFacCode},</if>
<if test="companyCode != null">company_code = #{companyCode},</if>
<if test="carId != null">car_id = #{carId},</if>
<if test="carLicense != null">car_license = #{carLicense},</if>
<if test="tureCode != null">ture_code = #{tureCode},</if>
<if test="tureModel != null">ture_model = #{tureModel},</if>
<if test="tureModelId != null">ture_model_id = #{tureModelId},</if>
<if test="tureBrandId != null">ture_brand_id = #{tureBrandId},</if>
<if test="tyreRfid != null">tyre_rfid = #{tyreRfid},</if>
<if test="tyrePosition != null">tyre_position = #{tyrePosition},</if>
<if test="sensorId != null">sensor_id = #{sensorId},</if>
<if test="currentTextureDepth != null">current_texture_depth = #{currentTextureDepth},</if>
<if test="state != null">state = #{state},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createName != null">create_name = #{createName},</if>
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
<if test="modifyId != null">modify_id = #{modifyId},</if>
<if test="modifyBy != null">modify_by = #{modifyBy},</if>
<if test="modifyName != null">modify__name = #{modifyName},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseTyreById" parameterType="String">
delete from base_tyre where id = #{id}
</delete>
<delete id="deleteBaseTyreByIds" parameterType="String">
delete from base_tyre where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").permitAll()
.antMatchers("/login", "/register", "/captchaImage","/basetyre/basetyre/**").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询轮胎基础信息列表
export function listBasetyre(query) {
return request({
url: '/basetyre/basetyre/list',
method: 'get',
params: query
})
}
// 查询轮胎基础信息详细
export function getBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
method: 'get'
})
}
// 新增轮胎基础信息
export function addBasetyre(data) {
return request({
url: '/basetyre/basetyre',
method: 'post',
data: data
})
}
// 修改轮胎基础信息
export function updateBasetyre(data) {
return request({
url: '/basetyre/basetyre',
method: 'put',
data: data
})
}
// 删除轮胎基础信息
export function delBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
method: 'delete'
})
}

@ -0,0 +1,454 @@
<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="tyreFacCode">
<el-input
v-model="queryParams.tyreFacCode"
placeholder="请输入轮胎厂编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="企业编码" prop="companyCode">
<el-input
v-model="queryParams.companyCode"
placeholder="请输入企业编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="车牌号" prop="carLicense">
<el-input
v-model="queryParams.carLicense"
placeholder="请输入车牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="轮胎编号" prop="tureCode">
<el-input
v-model="queryParams.tureCode"
placeholder="请输入轮胎编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="RFID" prop="tyreRfid">
<el-input
v-model="queryParams.tyreRfid"
placeholder="请输入RFID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="轮位" prop="tyrePosition">
<el-input
v-model="queryParams.tyrePosition"
placeholder="请输入轮位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="当前轮胎传感器ID" prop="sensorId">
<el-input
v-model="queryParams.sensorId"
placeholder="请输入当前轮胎传感器ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="当前花纹深度" prop="currentTextureDepth">
<el-input
v-model="queryParams.currentTextureDepth"
placeholder="请输入当前花纹深度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input
v-model="queryParams.state"
placeholder="请输入状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否删除" prop="isDelete">
<el-input
v-model="queryParams.isDelete"
placeholder="请输入是否删除"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建者姓名" prop="createName">
<el-input
v-model="queryParams.createName"
placeholder="请输入创建者姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="修改时间" prop="modifyTime">
<el-date-picker clearable
v-model="queryParams.modifyTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改者账号" prop="modifyBy">
<el-input
v-model="queryParams.modifyBy"
placeholder="请输入修改者账号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="编辑者姓名" prop="modifyName">
<el-input
v-model="queryParams.modifyName"
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="Plus"
@click="handleAdd"
v-hasPermi="['basetyre:basetyre:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['basetyre:basetyre: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="['basetyre:basetyre: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="['basetyre:basetyre:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="basetyreList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="轮胎厂编码" align="center" prop="tyreFacCode" />
<el-table-column label="企业编码" align="center" prop="companyCode" />
<el-table-column label="车辆ID" align="center" prop="carId" />
<el-table-column label="车牌号" align="center" prop="carLicense" />
<el-table-column label="轮胎编号" align="center" prop="tureCode" />
<el-table-column label="轮胎型号" align="center" prop="tureModel" />
<el-table-column label="轮胎型号表ID" align="center" prop="tureModelId" />
<el-table-column label="品牌ID" align="center" prop="tureBrandId" />
<el-table-column label="RFID" align="center" prop="tyreRfid" />
<el-table-column label="轮位" align="center" prop="tyrePosition" />
<el-table-column label="当前轮胎传感器ID" align="center" prop="sensorId" />
<el-table-column label="当前花纹深度" align="center" prop="currentTextureDepth" />
<el-table-column label="状态" align="center" prop="state" />
<el-table-column label="是否删除" align="center" prop="isDelete" />
<el-table-column label="创建者ID" align="center" prop="createId" />
<el-table-column label="创建者姓名" align="center" prop="createName" />
<el-table-column label="修改时间" align="center" prop="modifyTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.modifyTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="修改者ID" align="center" prop="modifyId" />
<el-table-column label="修改者账号" align="center" prop="modifyBy" />
<el-table-column label="编辑者姓名" align="center" prop="modifyName" />
<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="['basetyre:basetyre:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['basetyre:basetyre: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="tyreFacCode">
<el-input v-model="form.tyreFacCode" placeholder="请输入轮胎厂编码" />
</el-form-item>
<el-form-item label="企业编码" prop="companyCode">
<el-input v-model="form.companyCode" placeholder="请输入企业编码" />
</el-form-item>
<el-form-item label="车牌号" prop="carLicense">
<el-input v-model="form.carLicense" placeholder="请输入车牌号" />
</el-form-item>
<el-form-item label="轮胎编号" prop="tureCode">
<el-input v-model="form.tureCode" placeholder="请输入轮胎编号" />
</el-form-item>
<el-form-item label="RFID" prop="tyreRfid">
<el-input v-model="form.tyreRfid" placeholder="请输入RFID" />
</el-form-item>
<el-form-item label="轮位" prop="tyrePosition">
<el-input v-model="form.tyrePosition" placeholder="请输入轮位" />
</el-form-item>
<el-form-item label="当前轮胎传感器ID" prop="sensorId">
<el-input v-model="form.sensorId" placeholder="请输入当前轮胎传感器ID" />
</el-form-item>
<el-form-item label="当前花纹深度" prop="currentTextureDepth">
<el-input v-model="form.currentTextureDepth" placeholder="请输入当前花纹深度" />
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input v-model="form.state" placeholder="请输入状态" />
</el-form-item>
<el-form-item label="是否删除" prop="isDelete">
<el-input v-model="form.isDelete" placeholder="请输入是否删除" />
</el-form-item>
<el-form-item label="创建者姓名" prop="createName">
<el-input v-model="form.createName" placeholder="请输入创建者姓名" />
</el-form-item>
<el-form-item label="修改时间" prop="modifyTime">
<el-date-picker clearable
v-model="form.modifyTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改者账号" prop="modifyBy">
<el-input v-model="form.modifyBy" placeholder="请输入修改者账号" />
</el-form-item>
<el-form-item label="编辑者姓名" prop="modifyName">
<el-input v-model="form.modifyName" 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 { listBasetyre, getBasetyre, delBasetyre, addBasetyre, updateBasetyre } from "@/api/basetyre/basetyre";
export default {
name: "Basetyre",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
basetyreList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
tyreFacCode: null,
companyCode: null,
carId: null,
carLicense: null,
tureCode: null,
tureModel: null,
tureModelId: null,
tureBrandId: null,
tyreRfid: null,
tyrePosition: null,
sensorId: null,
currentTextureDepth: null,
state: null,
isDelete: null,
createId: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询轮胎基础信息列表 */
getList() {
this.loading = true;
listBasetyre(this.queryParams).then(response => {
this.basetyreList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
tyreFacCode: null,
companyCode: null,
carId: null,
carLicense: null,
tureCode: null,
tureModel: null,
tureModelId: null,
tureBrandId: null,
tyreRfid: null,
tyrePosition: null,
sensorId: null,
currentTextureDepth: null,
state: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: 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
getBasetyre(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改轮胎基础信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateBasetyre(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBasetyre(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 delBasetyre(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('basetyre/basetyre/export', {
...this.queryParams
}, `basetyre_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save