Commit c70af3c0 authored by 耿迪迪's avatar 耿迪迪

车辆信息

parent f225b791
package com.zehong.web.controller.lpgRegulation;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TLpgVehicleInfo;
import com.zehong.system.service.ITLpgVehicleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 液化石油车辆信息Controller
*
* @author zehong
* @date 2024-07-19
*/
@RestController
@RequestMapping("/lpg/vehicleInfo")
public class TLpgVehicleInfoController extends BaseController
{
@Autowired
private ITLpgVehicleInfoService tLpgVehicleInfoService;
/**
* 查询液化石油车辆信息列表
*/
@GetMapping("/list")
public TableDataInfo list(TLpgVehicleInfo tLpgVehicleInfo)
{
startPage();
List<TLpgVehicleInfo> list = tLpgVehicleInfoService.selectTLpgVehicleInfoList(tLpgVehicleInfo);
return getDataTable(list);
}
/**
* 导出液化石油车辆信息列表
*/
@Log(title = "液化石油车辆信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TLpgVehicleInfo tLpgVehicleInfo)
{
List<TLpgVehicleInfo> list = tLpgVehicleInfoService.selectTLpgVehicleInfoList(tLpgVehicleInfo);
ExcelUtil<TLpgVehicleInfo> util = new ExcelUtil<TLpgVehicleInfo>(TLpgVehicleInfo.class);
return util.exportExcel(list, "液化石油车辆信息数据");
}
/**
* 获取液化石油车辆信息详细信息
*/
@GetMapping(value = "/{vehicleId}")
public AjaxResult getInfo(@PathVariable("vehicleId") Long vehicleId)
{
return AjaxResult.success(tLpgVehicleInfoService.selectTLpgVehicleInfoById(vehicleId));
}
/**
* 新增液化石油车辆信息
*/
@Log(title = "液化石油车辆信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TLpgVehicleInfo tLpgVehicleInfo)
{
return toAjax(tLpgVehicleInfoService.insertTLpgVehicleInfo(tLpgVehicleInfo));
}
/**
* 修改液化石油车辆信息
*/
@Log(title = "液化石油车辆信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TLpgVehicleInfo tLpgVehicleInfo)
{
return toAjax(tLpgVehicleInfoService.updateTLpgVehicleInfo(tLpgVehicleInfo));
}
/**
* 删除液化石油车辆信息
*/
@Log(title = "液化石油车辆信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{vehicleIds}")
public AjaxResult remove(@PathVariable Long[] vehicleIds)
{
return toAjax(tLpgVehicleInfoService.deleteTLpgVehicleInfoByIds(vehicleIds));
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 液化石油车辆信息对象 t_lpg_vehicle_info
*
* @author zehong
* @date 2024-07-19
*/
public class TLpgVehicleInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 车辆主键 */
private Long vehicleId;
/** 储配站 */
@Excel(name = "储配站")
private String stationName;
/** 车辆编号 */
@Excel(name = "车辆编号")
private String carNumber;
/** 企业ID */
//@Excel(name = "企业ID")
private Long beyondEnterpriseId;
/** 代码 */
@Excel(name = "代码")
private String vehicleCode;
/** 车牌 */
@Excel(name = "车牌")
private String carNum;
/** 品牌型号 */
@Excel(name = "品牌型号")
private String brandModel;
/** 车辆类型: 1.罐车 2.卡车 */
@Excel(name = "车辆类型",readConverterExp = "1=罐车,2=卡车")
private String vehicleType;
/** 车辆载重 */
@Excel(name = "车辆载重")
private String vehicleLoad;
/** 车辆大小 */
@Excel(name = "车辆大小")
private String vehicleSize;
/** 车辆限乘 */
@Excel(name = "车辆限乘")
private String vehicleLimt;
/** 车辆检查信息 */
@Excel(name = "车辆检查信息")
private String vehicleInspect;
/** 责任人 */
@Excel(name = "责任人")
private String personLiable;
/** 使用状态 0未使用 1使用中 */
@Excel(name = "使用状态",readConverterExp = "0=未使用,1=使用中")
private String onState;
/** 使用人 */
@Excel(name = "使用人")
private Long vehicleUser;
/** 联系电话 */
@Excel(name = "联系电话")
private String phone;
/** 是否删除(0正常,1删除) */
//@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setVehicleId(Long vehicleId)
{
this.vehicleId = vehicleId;
}
public Long getVehicleId()
{
return vehicleId;
}
public void setStationName(String stationName)
{
this.stationName = stationName;
}
public String getStationName()
{
return stationName;
}
public void setCarNumber(String carNumber)
{
this.carNumber = carNumber;
}
public String getCarNumber()
{
return carNumber;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
public void setVehicleCode(String vehicleCode)
{
this.vehicleCode = vehicleCode;
}
public String getVehicleCode()
{
return vehicleCode;
}
public void setCarNum(String carNum)
{
this.carNum = carNum;
}
public String getCarNum()
{
return carNum;
}
public void setBrandModel(String brandModel)
{
this.brandModel = brandModel;
}
public String getBrandModel()
{
return brandModel;
}
public void setVehicleType(String vehicleType)
{
this.vehicleType = vehicleType;
}
public String getVehicleType()
{
return vehicleType;
}
public void setVehicleLoad(String vehicleLoad)
{
this.vehicleLoad = vehicleLoad;
}
public String getVehicleLoad()
{
return vehicleLoad;
}
public void setVehicleSize(String vehicleSize)
{
this.vehicleSize = vehicleSize;
}
public String getVehicleSize()
{
return vehicleSize;
}
public void setVehicleLimt(String vehicleLimt)
{
this.vehicleLimt = vehicleLimt;
}
public String getVehicleLimt()
{
return vehicleLimt;
}
public void setVehicleInspect(String vehicleInspect)
{
this.vehicleInspect = vehicleInspect;
}
public String getVehicleInspect()
{
return vehicleInspect;
}
public void setPersonLiable(String personLiable)
{
this.personLiable = personLiable;
}
public String getPersonLiable()
{
return personLiable;
}
public void setOnState(String onState)
{
this.onState = onState;
}
public String getOnState()
{
return onState;
}
public void setVehicleUser(Long vehicleUser)
{
this.vehicleUser = vehicleUser;
}
public Long getVehicleUser()
{
return vehicleUser;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("vehicleId", getVehicleId())
.append("stationName", getStationName())
.append("carNumber", getCarNumber())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("vehicleCode", getVehicleCode())
.append("carNum", getCarNum())
.append("brandModel", getBrandModel())
.append("vehicleType", getVehicleType())
.append("vehicleLoad", getVehicleLoad())
.append("vehicleSize", getVehicleSize())
.append("vehicleLimt", getVehicleLimt())
.append("vehicleInspect", getVehicleInspect())
.append("personLiable", getPersonLiable())
.append("onState", getOnState())
.append("vehicleUser", getVehicleUser())
.append("phone", getPhone())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TLpgVehicleInfo;
/**
* 液化石油车辆信息Mapper接口
*
* @author zehong
* @date 2024-07-19
*/
public interface TLpgVehicleInfoMapper
{
/**
* 查询液化石油车辆信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 液化石油车辆信息
*/
public TLpgVehicleInfo selectTLpgVehicleInfoById(Long vehicleId);
/**
* 查询液化石油车辆信息列表
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 液化石油车辆信息集合
*/
public List<TLpgVehicleInfo> selectTLpgVehicleInfoList(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 新增液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
public int insertTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 修改液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
public int updateTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 删除液化石油车辆信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 结果
*/
public int deleteTLpgVehicleInfoById(Long vehicleId);
/**
* 批量删除液化石油车辆信息
*
* @param vehicleIds 需要删除的数据ID
* @return 结果
*/
public int deleteTLpgVehicleInfoByIds(Long[] vehicleIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TLpgVehicleInfo;
/**
* 液化石油车辆信息Service接口
*
* @author zehong
* @date 2024-07-19
*/
public interface ITLpgVehicleInfoService
{
/**
* 查询液化石油车辆信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 液化石油车辆信息
*/
public TLpgVehicleInfo selectTLpgVehicleInfoById(Long vehicleId);
/**
* 查询液化石油车辆信息列表
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 液化石油车辆信息集合
*/
public List<TLpgVehicleInfo> selectTLpgVehicleInfoList(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 新增液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
public int insertTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 修改液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
public int updateTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 批量删除液化石油车辆信息
*
* @param vehicleIds 需要删除的液化石油车辆信息ID
* @return 结果
*/
public int deleteTLpgVehicleInfoByIds(Long[] vehicleIds);
/**
* 删除液化石油车辆信息信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 结果
*/
public int deleteTLpgVehicleInfoById(Long vehicleId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TLpgVehicleInfoMapper;
import com.zehong.system.domain.TLpgVehicleInfo;
import com.zehong.system.service.ITLpgVehicleInfoService;
/**
* 液化石油车辆信息Service业务层处理
*
* @author zehong
* @date 2024-07-19
*/
@Service
public class TLpgVehicleInfoServiceImpl implements ITLpgVehicleInfoService
{
@Autowired
private TLpgVehicleInfoMapper tLpgVehicleInfoMapper;
/**
* 查询液化石油车辆信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 液化石油车辆信息
*/
@Override
public TLpgVehicleInfo selectTLpgVehicleInfoById(Long vehicleId)
{
return tLpgVehicleInfoMapper.selectTLpgVehicleInfoById(vehicleId);
}
/**
* 查询液化石油车辆信息列表
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 液化石油车辆信息
*/
@Override
public List<TLpgVehicleInfo> selectTLpgVehicleInfoList(TLpgVehicleInfo tLpgVehicleInfo)
{
return tLpgVehicleInfoMapper.selectTLpgVehicleInfoList(tLpgVehicleInfo);
}
/**
* 新增液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
@Override
public int insertTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo)
{
return tLpgVehicleInfoMapper.insertTLpgVehicleInfo(tLpgVehicleInfo);
}
/**
* 修改液化石油车辆信息
*
* @param tLpgVehicleInfo 液化石油车辆信息
* @return 结果
*/
@Override
public int updateTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo)
{
return tLpgVehicleInfoMapper.updateTLpgVehicleInfo(tLpgVehicleInfo);
}
/**
* 批量删除液化石油车辆信息
*
* @param vehicleIds 需要删除的液化石油车辆信息ID
* @return 结果
*/
@Override
public int deleteTLpgVehicleInfoByIds(Long[] vehicleIds)
{
return tLpgVehicleInfoMapper.deleteTLpgVehicleInfoByIds(vehicleIds);
}
/**
* 删除液化石油车辆信息信息
*
* @param vehicleId 液化石油车辆信息ID
* @return 结果
*/
@Override
public int deleteTLpgVehicleInfoById(Long vehicleId)
{
return tLpgVehicleInfoMapper.deleteTLpgVehicleInfoById(vehicleId);
}
}
<?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.zehong.system.mapper.TLpgVehicleInfoMapper">
<resultMap type="TLpgVehicleInfo" id="TLpgVehicleInfoResult">
<result property="vehicleId" column="vehicle_id" />
<result property="stationName" column="station_name" />
<result property="carNumber" column="car_number" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="vehicleCode" column="vehicle_code" />
<result property="carNum" column="car_num" />
<result property="brandModel" column="brand_model" />
<result property="vehicleType" column="vehicle_type" />
<result property="vehicleLoad" column="vehicle_load" />
<result property="vehicleSize" column="vehicle_size" />
<result property="vehicleLimt" column="vehicle_limt" />
<result property="vehicleInspect" column="vehicle_inspect" />
<result property="personLiable" column="person_liable" />
<result property="onState" column="on_state" />
<result property="vehicleUser" column="vehicle_user" />
<result property="phone" column="phone" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTLpgVehicleInfoVo">
select vehicle_id, station_name, car_number, beyond_enterprise_id, vehicle_code, car_num, brand_model, vehicle_type, vehicle_load, vehicle_size, vehicle_limt, vehicle_inspect, person_liable, on_state, vehicle_user, phone, is_del, remarks from t_lpg_vehicle_info
</sql>
<select id="selectTLpgVehicleInfoList" parameterType="TLpgVehicleInfo" resultMap="TLpgVehicleInfoResult">
<include refid="selectTLpgVehicleInfoVo"/>
<where>
<if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
<if test="carNumber != null and carNumber != ''"> and car_number = #{carNumber}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="vehicleCode != null and vehicleCode != ''"> and vehicle_code = #{vehicleCode}</if>
<if test="carNum != null and carNum != ''"> and car_num like concat('%', #{carNum}, '%')</if>
<if test="brandModel != null and brandModel != ''"> and brand_model = #{brandModel}</if>
<if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if>
<if test="vehicleLoad != null and vehicleLoad != ''"> and vehicle_load = #{vehicleLoad}</if>
<if test="vehicleSize != null and vehicleSize != ''"> and vehicle_size = #{vehicleSize}</if>
<if test="vehicleLimt != null and vehicleLimt != ''"> and vehicle_limt = #{vehicleLimt}</if>
<if test="vehicleInspect != null and vehicleInspect != ''"> and vehicle_inspect = #{vehicleInspect}</if>
<if test="personLiable != null and personLiable != ''"> and person_liable like concat('%', #{personLiable}, '%')</if>
<if test="onState != null and onState != ''"> and on_state = #{onState}</if>
<if test="vehicleUser != null "> and vehicle_user = #{vehicleUser}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTLpgVehicleInfoById" parameterType="Long" resultMap="TLpgVehicleInfoResult">
<include refid="selectTLpgVehicleInfoVo"/>
where vehicle_id = #{vehicleId}
</select>
<insert id="insertTLpgVehicleInfo" parameterType="TLpgVehicleInfo" useGeneratedKeys="true" keyProperty="vehicleId">
insert into t_lpg_vehicle_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stationName != null">station_name,</if>
<if test="carNumber != null">car_number,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="vehicleCode != null">vehicle_code,</if>
<if test="carNum != null">car_num,</if>
<if test="brandModel != null">brand_model,</if>
<if test="vehicleType != null">vehicle_type,</if>
<if test="vehicleLoad != null">vehicle_load,</if>
<if test="vehicleSize != null">vehicle_size,</if>
<if test="vehicleLimt != null">vehicle_limt,</if>
<if test="vehicleInspect != null">vehicle_inspect,</if>
<if test="personLiable != null">person_liable,</if>
<if test="onState != null">on_state,</if>
<if test="vehicleUser != null">vehicle_user,</if>
<if test="phone != null">phone,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stationName != null">#{stationName},</if>
<if test="carNumber != null">#{carNumber},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="vehicleCode != null">#{vehicleCode},</if>
<if test="carNum != null">#{carNum},</if>
<if test="brandModel != null">#{brandModel},</if>
<if test="vehicleType != null">#{vehicleType},</if>
<if test="vehicleLoad != null">#{vehicleLoad},</if>
<if test="vehicleSize != null">#{vehicleSize},</if>
<if test="vehicleLimt != null">#{vehicleLimt},</if>
<if test="vehicleInspect != null">#{vehicleInspect},</if>
<if test="personLiable != null">#{personLiable},</if>
<if test="onState != null">#{onState},</if>
<if test="vehicleUser != null">#{vehicleUser},</if>
<if test="phone != null">#{phone},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTLpgVehicleInfo" parameterType="TLpgVehicleInfo">
update t_lpg_vehicle_info
<trim prefix="SET" suffixOverrides=",">
<if test="stationName != null">station_name = #{stationName},</if>
<if test="carNumber != null">car_number = #{carNumber},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="vehicleCode != null">vehicle_code = #{vehicleCode},</if>
<if test="carNum != null">car_num = #{carNum},</if>
<if test="brandModel != null">brand_model = #{brandModel},</if>
<if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
<if test="vehicleLoad != null">vehicle_load = #{vehicleLoad},</if>
<if test="vehicleSize != null">vehicle_size = #{vehicleSize},</if>
<if test="vehicleLimt != null">vehicle_limt = #{vehicleLimt},</if>
<if test="vehicleInspect != null">vehicle_inspect = #{vehicleInspect},</if>
<if test="personLiable != null">person_liable = #{personLiable},</if>
<if test="onState != null">on_state = #{onState},</if>
<if test="vehicleUser != null">vehicle_user = #{vehicleUser},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where vehicle_id = #{vehicleId}
</update>
<delete id="deleteTLpgVehicleInfoById" parameterType="Long">
delete from t_lpg_vehicle_info where vehicle_id = #{vehicleId}
</delete>
<delete id="deleteTLpgVehicleInfoByIds" parameterType="String">
delete from t_lpg_vehicle_info where vehicle_id in
<foreach item="vehicleId" collection="array" open="(" separator="," close=")">
#{vehicleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询液化石油车辆信息列表
export function listInfo(query) {
return request({
url: '/lpg/vehicleInfo/list',
method: 'get',
params: query
})
}
// 查询液化石油车辆信息详细
export function getInfo(vehicleId) {
return request({
url: '/lpg/vehicleInfo/' + vehicleId,
method: 'get'
})
}
// 新增液化石油车辆信息
export function addInfo(data) {
return request({
url: '/lpg/vehicleInfo',
method: 'post',
data: data
})
}
// 修改液化石油车辆信息
export function updateInfo(data) {
return request({
url: '/lpg/vehicleInfo',
method: 'put',
data: data
})
}
// 删除液化石油车辆信息
export function delInfo(vehicleId) {
return request({
url: '/lpg/vehicleInfo/' + vehicleId,
method: 'delete'
})
}
// 导出液化石油车辆信息
export function exportInfo(query) {
return request({
url: '/lpg/vehicleInfo/export',
method: 'get',
params: query
})
}
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="120px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="车辆编号">
<span v-if="detailInfo.carNumber">{{ detailInfo.carNumber }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="代码">
<span v-if="detailInfo.vehicleCode">{{ detailInfo.vehicleCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车牌">
<span v-if="detailInfo.carNum">{{ detailInfo.carNum }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="品牌型号">
<span v-if="detailInfo.brandModel">{{ detailInfo.brandModel }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆类型">
<span v-if="detailInfo.vehicleType == '1'">罐车</span>
<span v-else-if="detailInfo.vehicleType == '2'">卡车</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆载重">
<span v-if="detailInfo.vehicleLoad">{{ detailInfo.vehicleLoad }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆大小">
<span v-if="detailInfo.vehicleSize">{{ detailInfo.vehicleSize }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆限乘">
<span v-if="detailInfo.vehicleLimt">{{ detailInfo.vehicleLimt }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆检查信息">
<span v-if="detailInfo.vehicleInspect">{{ detailInfo.vehicleInspect }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="责任人">
<span v-if="detailInfo.personLiable">{{ detailInfo.personLiable }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用状态">
<span v-if="detailInfo.onState == '0'">未使用</span>
<span v-else-if="detailInfo.onState == '1'">使用中</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用人">
<span v-if="detailInfo.vehicleUser">{{ detailInfo.vehicleUser }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话">
<span v-if="detailInfo.phone">{{ detailInfo.phone }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否删除">
<span v-if="detailInfo.onState == '0'">正常</span>
<span v-else-if="detailInfo.onState == '1'">删除</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remarks">
<span v-if="detailInfo.remarks">{{ detailInfo.remarks }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getInfo } from "@/api/lpgRegulation/vehicleinfo";
export default {
name: "detail-info",
data(){
return{
detailInfo: {
fDeleteFlag: 0
},
detailOpen: false
}
},
methods:{
getDetailInfo(id){
getInfo(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="车牌号" prop="carNum">
<el-input
v-model="queryParams.carNum"
placeholder="请输入车牌"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="责任人" prop="personLiable">
<el-input
v-model="queryParams.personLiable"
placeholder="请输入责任人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="使用状态" prop="onState">
<el-select v-model="queryParams.onState" placeholder="请选择使用状态">
<el-option label="未使用" value="0"/>
<el-option label="使用中" value="1"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:info: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="['system:info: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="['system:info:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="储配站" align="center" prop="stationName" />
<el-table-column label="车辆编号" align="center" prop="carNumber" />
<el-table-column label="车牌" align="center" prop="carNum" />
<el-table-column label="品牌型号" align="center" prop="brandModel" />
<el-table-column label="车辆类型" align="center" prop="vehicleType">
<template slot-scope="scope">
<span v-if="scope.row.vehicleType == '1'">罐车</span>
<span v-else-if="scope.row.vehicleType == '2'">卡车</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="车辆载重" align="center" prop="vehicleLoad" />
<el-table-column label="车辆大小" align="center" prop="vehicleSize" />
<el-table-column label="车辆限乘" align="center" prop="vehicleLimt" />
<el-table-column label="车辆检查信息" align="center" prop="vehicleInspect" />
<el-table-column label="责任人" align="center" prop="personLiable" />
<el-table-column label="使用状态" align="center" prop="onState">
<template slot-scope="scope">
<span v-if="scope.row.onState == '0'">未使用</span>
<span v-else-if="scope.row.onState == '1'">使用中</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="使用人" align="center" prop="vehicleUser" />
<el-table-column label="联系电话" align="center" prop="phone" />
<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-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:info: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="stationName">
<el-input v-model="form.stationName" placeholder="请输入储配站" />
</el-form-item>
<el-form-item label="车辆编号" prop="carNumber">
<el-input v-model="form.carNumber" placeholder="请输入车辆编号" />
</el-form-item>
<el-form-item label="企业ID" prop="beyondEnterpriseId">
<el-input v-model="form.beyondEnterpriseId" placeholder="请输入企业ID" />
</el-form-item>
<el-form-item label="代码" prop="vehicleCode">
<el-input v-model="form.vehicleCode" placeholder="请输入代码" />
</el-form-item>
<el-form-item label="车牌" prop="carNum">
<el-input v-model="form.carNum" placeholder="请输入车牌" />
</el-form-item>
<el-form-item label="品牌型号" prop="brandModel">
<el-input v-model="form.brandModel" placeholder="请输入品牌型号" />
</el-form-item>
<el-form-item label="车辆类型: 1.罐车 2.卡车" prop="vehicleType">
<el-select v-model="form.vehicleType" placeholder="请选择车辆类型: 1.罐车 2.卡车">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="车辆载重" prop="vehicleLoad">
<el-input v-model="form.vehicleLoad" placeholder="请输入车辆载重" />
</el-form-item>
<el-form-item label="车辆大小" prop="vehicleSize">
<el-input v-model="form.vehicleSize" placeholder="请输入车辆大小" />
</el-form-item>
<el-form-item label="车辆限乘" prop="vehicleLimt">
<el-input v-model="form.vehicleLimt" placeholder="请输入车辆限乘" />
</el-form-item>
<el-form-item label="车辆检查信息" prop="vehicleInspect">
<el-input v-model="form.vehicleInspect" placeholder="请输入车辆检查信息" />
</el-form-item>
<el-form-item label="责任人" prop="personLiable">
<el-input v-model="form.personLiable" placeholder="请输入责任人" />
</el-form-item>
<el-form-item label="使用状态 0未使用 1使用中" prop="onState">
<el-input v-model="form.onState" placeholder="请输入使用状态 0未使用 1使用中" />
</el-form-item>
<el-form-item label="使用人" prop="vehicleUser">
<el-input v-model="form.vehicleUser" placeholder="请输入使用人" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="是否删除(0正常,1删除)" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入是否删除(0正常,1删除)" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" 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>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/lpgRegulation/vehicleinfo";
import DetailInfo from "./components/DetailInfo";
export default {
name: "Info",
components: {
DetailInfo
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 液化石油车辆信息表格数据
infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
carNum: null,
personLiable: null,
onState: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询液化石油车辆信息列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
vehicleId: null,
stationName: null,
carNumber: null,
beyondEnterpriseId: null,
vehicleCode: null,
carNum: null,
brandModel: null,
vehicleType: null,
vehicleLoad: null,
vehicleSize: null,
vehicleLimt: null,
vehicleInspect: null,
personLiable: null,
onState: null,
vehicleUser: null,
phone: null,
isDel: null,
remarks: 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.vehicleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加液化石油车辆信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const vehicleId = row.vehicleId || this.ids
getInfo(vehicleId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改液化石油车辆信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.vehicleId != null) {
updateInfo(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const vehicleIds = row.vehicleId || this.ids;
this.$confirm('是否确认删除液化石油车辆信息编号为"' + vehicleIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInfo(vehicleIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有液化石油车辆信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInfo(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.vehicleId);
},
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment