1.新增“业务磅点”数据

This commit is contained in:
xiaosuonian 2025-06-03 15:59:24 +08:00
parent 67748a8c6e
commit 5c412dd6ab
9 changed files with 1238 additions and 1 deletions

View File

@ -0,0 +1,105 @@
package com.ruoyi.basedata.controller;
import java.util.Arrays;
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.basedata.domain.Buspound;
import com.ruoyi.basedata.service.IBuspoundService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 业务磅点Controller
*
* @author ruoyi
* @date 2025-06-03
*/
@RestController
@RequestMapping("/measurement/basedata/buspound")
public class BuspoundController extends BaseController
{
@Autowired
private IBuspoundService buspoundService;
/**
* 查询业务磅点列表
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:list')")
@GetMapping("/list")
public TableDataInfo list(Buspound buspound)
{
startPage();
List<Buspound> list = buspoundService.selectBuspoundList(buspound);
return getDataTable(list);
}
/**
* 导出业务磅点列表
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:export')")
@Log(title = "业务磅点", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Buspound buspound)
{
List<Buspound> list = buspoundService.selectBuspoundList(buspound);
ExcelUtil<Buspound> util = new ExcelUtil<Buspound>(Buspound.class);
util.exportExcel(response, list, "业务磅点数据");
}
/**
* 获取业务磅点详细信息
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(buspoundService.getById(id));
}
/**
* 新增业务磅点
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:add')")
@Log(title = "业务磅点", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Buspound buspound)
{
return toAjax(buspoundService.save(buspound));
}
/**
* 修改业务磅点
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:edit')")
@Log(title = "业务磅点", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Buspound buspound)
{
return toAjax(buspoundService.updateById(buspound));
}
/**
* 删除业务磅点
*/
@PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:remove')")
@Log(title = "业务磅点", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(buspoundService.removeByIds(Arrays.asList(ids)));
}
}

View File

@ -0,0 +1,242 @@
package com.ruoyi.basedata.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
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;
/**
* 业务磅点对象 t_data_buspound
*
* @author ruoyi
* @date 2025-06-03
*/
@TableName(value = "t_data_buspound")
public class Buspound extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
@TableId(type = IdType.ASSIGN_UUID)
private String id;
/** 磅点编号 */
@Excel(name = "磅点编号")
private String usrcode;
/** 磅点名称 */
@Excel(name = "磅点名称")
private String name;
/** 磅点类型 */
@Excel(name = "磅点类型")
private String type;
/** 磅点位置 */
@Excel(name = "磅点位置")
private String pos;
/** 磅点类型(出厂/入厂) */
@Excel(name = "磅点类型", readConverterExp = "出=厂/入厂")
private String poundtype;
/** 默认申请过磅 */
@Excel(name = "默认申请过磅")
private String defweighttype;
/** 独立过磅输入方式 */
@Excel(name = "独立过磅输入方式")
private String caninput;
/** 登记部门 */
@Excel(name = "登记部门")
private Long crtorgid;
/** 是否启用 */
@Excel(name = "是否启用")
private String isinuse;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date crtdt;
/** 创建人 */
@Excel(name = "创建人")
private String crtopr;
/** 最后修改日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后修改日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date lstedtdt;
/** 最后修改人 */
@Excel(name = "最后修改人")
private String lstedtopr;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setUsrcode(String usrcode)
{
this.usrcode = usrcode;
}
public String getUsrcode()
{
return usrcode;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setPos(String pos)
{
this.pos = pos;
}
public String getPos()
{
return pos;
}
public void setPoundtype(String poundtype)
{
this.poundtype = poundtype;
}
public String getPoundtype()
{
return poundtype;
}
public void setDefweighttype(String defweighttype)
{
this.defweighttype = defweighttype;
}
public String getDefweighttype()
{
return defweighttype;
}
public void setCaninput(String caninput)
{
this.caninput = caninput;
}
public String getCaninput()
{
return caninput;
}
public void setCrtorgid(Long crtorgid)
{
this.crtorgid = crtorgid;
}
public Long getCrtorgid()
{
return crtorgid;
}
public void setIsinuse(String isinuse)
{
this.isinuse = isinuse;
}
public String getIsinuse()
{
return isinuse;
}
public void setCrtdt(Date crtdt)
{
this.crtdt = crtdt;
}
public Date getCrtdt()
{
return crtdt;
}
public void setCrtopr(String crtopr)
{
this.crtopr = crtopr;
}
public String getCrtopr()
{
return crtopr;
}
public void setLstedtdt(Date lstedtdt)
{
this.lstedtdt = lstedtdt;
}
public Date getLstedtdt()
{
return lstedtdt;
}
public void setLstedtopr(String lstedtopr)
{
this.lstedtopr = lstedtopr;
}
public String getLstedtopr()
{
return lstedtopr;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("usrcode", getUsrcode())
.append("name", getName())
.append("type", getType())
.append("pos", getPos())
.append("poundtype", getPoundtype())
.append("defweighttype", getDefweighttype())
.append("caninput", getCaninput())
.append("crtorgid", getCrtorgid())
.append("isinuse", getIsinuse())
.append("crtdt", getCrtdt())
.append("crtopr", getCrtopr())
.append("lstedtdt", getLstedtdt())
.append("lstedtopr", getLstedtopr())
.toString();
}
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.basedata.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.basedata.domain.Buspound;
/**
* 业务磅点Mapper接口
*
* @author ruoyi
* @date 2025-06-03
*/
public interface BuspoundMapper extends BaseMapper<Buspound>
{
/**
* 查询业务磅点
*
* @param id 业务磅点主键
* @return 业务磅点
*/
public Buspound selectBuspoundById(String id);
/**
* 查询业务磅点列表
*
* @param buspound 业务磅点
* @return 业务磅点集合
*/
public List<Buspound> selectBuspoundList(Buspound buspound);
/**
* 新增业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
public int insertBuspound(Buspound buspound);
/**
* 修改业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
public int updateBuspound(Buspound buspound);
/**
* 删除业务磅点
*
* @param id 业务磅点主键
* @return 结果
*/
public int deleteBuspoundById(String id);
/**
* 批量删除业务磅点
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBuspoundByIds(String[] ids);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.basedata.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.basedata.domain.Buspound;
/**
* 业务磅点Service接口
*
* @author ruoyi
* @date 2025-06-03
*/
public interface IBuspoundService extends IService<Buspound>
{
/**
* 查询业务磅点
*
* @param id 业务磅点主键
* @return 业务磅点
*/
public Buspound selectBuspoundById(String id);
/**
* 查询业务磅点列表
*
* @param buspound 业务磅点
* @return 业务磅点集合
*/
public List<Buspound> selectBuspoundList(Buspound buspound);
/**
* 新增业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
public int insertBuspound(Buspound buspound);
/**
* 修改业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
public int updateBuspound(Buspound buspound);
/**
* 批量删除业务磅点
*
* @param ids 需要删除的业务磅点主键集合
* @return 结果
*/
public int deleteBuspoundByIds(String[] ids);
/**
* 删除业务磅点信息
*
* @param id 业务磅点主键
* @return 结果
*/
public int deleteBuspoundById(String id);
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.basedata.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basedata.mapper.BuspoundMapper;
import com.ruoyi.basedata.domain.Buspound;
import com.ruoyi.basedata.service.IBuspoundService;
/**
* 业务磅点Service业务层处理
*
* @author ruoyi
* @date 2025-06-03
*/
@Service
public class BuspoundServiceImpl extends ServiceImpl<BuspoundMapper, Buspound> implements IBuspoundService
{
@Autowired
private BuspoundMapper buspoundMapper;
/**
* 查询业务磅点
*
* @param id 业务磅点主键
* @return 业务磅点
*/
@Override
public Buspound selectBuspoundById(String id)
{
return buspoundMapper.selectBuspoundById(id);
}
/**
* 查询业务磅点列表
*
* @param buspound 业务磅点
* @return 业务磅点
*/
@Override
public List<Buspound> selectBuspoundList(Buspound buspound)
{
return buspoundMapper.selectBuspoundList(buspound);
}
/**
* 新增业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
@Override
public int insertBuspound(Buspound buspound)
{
return buspoundMapper.insertBuspound(buspound);
}
/**
* 修改业务磅点
*
* @param buspound 业务磅点
* @return 结果
*/
@Override
public int updateBuspound(Buspound buspound)
{
return buspoundMapper.updateBuspound(buspound);
}
/**
* 批量删除业务磅点
*
* @param ids 需要删除的业务磅点主键
* @return 结果
*/
@Override
public int deleteBuspoundByIds(String[] ids)
{
return buspoundMapper.deleteBuspoundByIds(ids);
}
/**
* 删除业务磅点信息
*
* @param id 业务磅点主键
* @return 结果
*/
@Override
public int deleteBuspoundById(String id)
{
return buspoundMapper.deleteBuspoundById(id);
}
}

View File

@ -0,0 +1,118 @@
<?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.basedata.mapper.BuspoundMapper">
<resultMap type="Buspound" id="BuspoundResult">
<result property="id" column="id" />
<result property="usrcode" column="usrcode" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="pos" column="pos" />
<result property="poundtype" column="poundtype" />
<result property="defweighttype" column="defweighttype" />
<result property="caninput" column="caninput" />
<result property="crtorgid" column="crtorgid" />
<result property="isinuse" column="isinuse" />
<result property="crtdt" column="crtdt" />
<result property="crtopr" column="crtopr" />
<result property="lstedtdt" column="lstedtdt" />
<result property="lstedtopr" column="lstedtopr" />
</resultMap>
<sql id="selectBuspoundVo">
select id, usrcode, name, type, pos, poundtype, defweighttype, caninput, crtorgid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr from t_data_buspound
</sql>
<select id="selectBuspoundList" parameterType="Buspound" resultMap="BuspoundResult">
<include refid="selectBuspoundVo"/>
<where>
<if test="usrcode != null and usrcode != ''"> and usrcode = #{usrcode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="pos != null and pos != ''"> and pos = #{pos}</if>
<if test="poundtype != null and poundtype != ''"> and poundtype = #{poundtype}</if>
<if test="defweighttype != null and defweighttype != ''"> and defweighttype = #{defweighttype}</if>
<if test="caninput != null and caninput != ''"> and caninput = #{caninput}</if>
<if test="crtorgid != null "> and crtorgid = #{crtorgid}</if>
<if test="isinuse != null and isinuse != ''"> and isinuse = #{isinuse}</if>
<if test="crtdt != null "> and crtdt = #{crtdt}</if>
<if test="crtopr != null and crtopr != ''"> and crtopr = #{crtopr}</if>
<if test="lstedtdt != null "> and lstedtdt = #{lstedtdt}</if>
<if test="lstedtopr != null and lstedtopr != ''"> and lstedtopr = #{lstedtopr}</if>
</where>
</select>
<select id="selectBuspoundById" parameterType="String" resultMap="BuspoundResult">
<include refid="selectBuspoundVo"/>
where id = #{id}
</select>
<insert id="insertBuspound" parameterType="Buspound">
insert into t_data_buspound
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="usrcode != null and usrcode != ''">usrcode,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null">type,</if>
<if test="pos != null">pos,</if>
<if test="poundtype != null">poundtype,</if>
<if test="defweighttype != null">defweighttype,</if>
<if test="caninput != null">caninput,</if>
<if test="crtorgid != null">crtorgid,</if>
<if test="isinuse != null">isinuse,</if>
<if test="crtdt != null">crtdt,</if>
<if test="crtopr != null">crtopr,</if>
<if test="lstedtdt != null">lstedtdt,</if>
<if test="lstedtopr != null">lstedtopr,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="usrcode != null and usrcode != ''">#{usrcode},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null">#{type},</if>
<if test="pos != null">#{pos},</if>
<if test="poundtype != null">#{poundtype},</if>
<if test="defweighttype != null">#{defweighttype},</if>
<if test="caninput != null">#{caninput},</if>
<if test="crtorgid != null">#{crtorgid},</if>
<if test="isinuse != null">#{isinuse},</if>
<if test="crtdt != null">#{crtdt},</if>
<if test="crtopr != null">#{crtopr},</if>
<if test="lstedtdt != null">#{lstedtdt},</if>
<if test="lstedtopr != null">#{lstedtopr},</if>
</trim>
</insert>
<update id="updateBuspound" parameterType="Buspound">
update t_data_buspound
<trim prefix="SET" suffixOverrides=",">
<if test="usrcode != null and usrcode != ''">usrcode = #{usrcode},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="pos != null">pos = #{pos},</if>
<if test="poundtype != null">poundtype = #{poundtype},</if>
<if test="defweighttype != null">defweighttype = #{defweighttype},</if>
<if test="caninput != null">caninput = #{caninput},</if>
<if test="crtorgid != null">crtorgid = #{crtorgid},</if>
<if test="isinuse != null">isinuse = #{isinuse},</if>
<if test="crtdt != null">crtdt = #{crtdt},</if>
<if test="crtopr != null">crtopr = #{crtopr},</if>
<if test="lstedtdt != null">lstedtdt = #{lstedtdt},</if>
<if test="lstedtopr != null">lstedtopr = #{lstedtopr},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBuspoundById" parameterType="String">
delete from t_data_buspound where id = #{id}
</delete>
<delete id="deleteBuspoundByIds" parameterType="String">
delete from t_data_buspound where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -95,7 +95,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
expireTime: 600
# MyBatis Plus配置
mybatis-plus:

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询业务磅点列表
export function listBuspound(query) {
return request({
url: '/measurement/basedata/buspound/list',
method: 'get',
params: query
})
}
// 查询业务磅点详细
export function getBuspound(id) {
return request({
url: '/measurement/basedata/buspound/' + id,
method: 'get'
})
}
// 新增业务磅点
export function addBuspound(data) {
return request({
url: '/measurement/basedata/buspound',
method: 'post',
data: data
})
}
// 修改业务磅点
export function updateBuspound(data) {
return request({
url: '/measurement/basedata/buspound',
method: 'put',
data: data
})
}
// 删除业务磅点
export function delBuspound(id) {
return request({
url: '/measurement/basedata/buspound/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,507 @@
<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="usrcode">
<el-input
v-model="queryParams.usrcode"
placeholder="请输入磅点编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="磅点名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入磅点名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="磅点类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择磅点类型" clearable>
<el-option
v-for="dict in dict.type.poundtype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="磅点位置" prop="pos">
<el-input
v-model="queryParams.pos"
placeholder="请输入磅点位置"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="磅点类型" prop="poundtype">
<el-select v-model="queryParams.poundtype" placeholder="请选择磅点类型" clearable>
<el-option
v-for="dict in dict.type.poundoutintype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="默认申请过磅" prop="defweighttype">
<el-select v-model="queryParams.defweighttype" placeholder="请选择默认申请过磅" clearable>
<el-option
v-for="dict in dict.type.weighttype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="独立过磅输入方式" prop="caninput">
<el-select v-model="queryParams.caninput" placeholder="请选择独立过磅输入方式" clearable>
<el-option
v-for="dict in dict.type.caninputtype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="登记部门" prop="crtorgid">
<el-input
v-model="queryParams.crtorgid"
placeholder="请输入登记部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否启用" prop="isinuse">
<el-select v-model="queryParams.isinuse" placeholder="请选择是否启用" clearable>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="crtdt">
<el-date-picker clearable
v-model="queryParams.crtdt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="创建人" prop="crtopr">
<el-input
v-model="queryParams.crtopr"
placeholder="请输入创建人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="最后修改日期" prop="lstedtdt">
<el-date-picker clearable
v-model="queryParams.lstedtdt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后修改日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最后修改人" prop="lstedtopr">
<el-input
v-model="queryParams.lstedtopr"
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="['measurement/basedata:buspound: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="['measurement/basedata:buspound: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="['measurement/basedata:buspound: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="['measurement/basedata:buspound:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="buspoundList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="磅点编号" align="center" prop="usrcode" />
<el-table-column label="磅点名称" align="center" prop="name" />
<el-table-column label="磅点类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.poundtype" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="磅点位置" align="center" prop="pos" />
<el-table-column label="磅点类型" align="center" prop="poundtype">
<template slot-scope="scope">
<dict-tag :options="dict.type.poundoutintype" :value="scope.row.poundtype"/>
</template>
</el-table-column>
<el-table-column label="默认申请过磅" align="center" prop="defweighttype">
<template slot-scope="scope">
<dict-tag :options="dict.type.weighttype" :value="scope.row.defweighttype"/>
</template>
</el-table-column>
<el-table-column label="独立过磅输入方式" align="center" prop="caninput">
<template slot-scope="scope">
<dict-tag :options="dict.type.caninputtype" :value="scope.row.caninput"/>
</template>
</el-table-column>
<el-table-column label="登记部门" align="center" prop="crtorgid" />
<el-table-column label="是否启用" align="center" prop="isinuse">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isinuse"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="crtdt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.crtdt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="crtopr" />
<el-table-column label="最后修改日期" align="center" prop="lstedtdt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lstedtdt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后修改人" align="center" prop="lstedtopr" />
<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="['measurement/basedata:buspound:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['measurement/basedata:buspound: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="usrcode">
<el-input v-model="form.usrcode" placeholder="请输入磅点编号" />
</el-form-item>
<el-form-item label="磅点名称" prop="name">
<el-input v-model="form.name" placeholder="请输入磅点名称" />
</el-form-item>
<el-form-item label="磅点类型" prop="type">
<el-select v-model="form.type" placeholder="请选择磅点类型">
<el-option
v-for="dict in dict.type.poundtype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="磅点位置" prop="pos">
<el-input v-model="form.pos" placeholder="请输入磅点位置" />
</el-form-item>
<el-form-item label="磅点类型" prop="poundtype">
<el-select v-model="form.poundtype" placeholder="请选择磅点类型">
<el-option
v-for="dict in dict.type.poundoutintype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="默认申请过磅" prop="defweighttype">
<el-select v-model="form.defweighttype" placeholder="请选择默认申请过磅">
<el-option
v-for="dict in dict.type.weighttype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="独立过磅输入方式" prop="caninput">
<el-select v-model="form.caninput" placeholder="请选择独立过磅输入方式">
<el-option
v-for="dict in dict.type.caninputtype"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="登记部门" prop="crtorgid">
<el-input v-model="form.crtorgid" placeholder="请输入登记部门" />
</el-form-item>
<el-form-item label="是否启用" prop="isinuse">
<el-select v-model="form.isinuse" placeholder="请选择是否启用">
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="pos">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="创建时间" prop="crtdt">
<el-date-picker clearable
v-model="form.crtdt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="创建人" prop="crtopr">
<el-input v-model="form.crtopr" placeholder="请输入创建人" />
</el-form-item>
<el-form-item label="最后修改日期" prop="lstedtdt">
<el-date-picker clearable
v-model="form.lstedtdt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后修改日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最后修改人" prop="lstedtopr">
<el-input v-model="form.lstedtopr" 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 { listBuspound, getBuspound, delBuspound, addBuspound, updateBuspound } from "@/api/measurement/basedata/buspound"
export default {
name: "Buspound",
dicts: ['poundtype', 'weighttype', 'caninputtype', 'sys_yes_no', 'poundoutintype'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
buspoundList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
usrcode: null,
name: null,
type: null,
pos: null,
poundtype: null,
defweighttype: null,
caninput: null,
crtorgid: null,
isinuse: null,
crtdt: null,
crtopr: null,
lstedtdt: null,
lstedtopr: null
},
//
form: {},
//
rules: {
usrcode: [
{ required: true, message: "磅点编号不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "磅点名称不能为空", trigger: "blur" }
],
}
}
},
created() {
this.getList()
},
methods: {
/** 查询业务磅点列表 */
getList() {
this.loading = true
listBuspound(this.queryParams).then(response => {
this.buspoundList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
usrcode: null,
name: null,
type: null,
pos: null,
poundtype: null,
defweighttype: null,
caninput: null,
crtorgid: null,
isinuse: null,
crtdt: null,
crtopr: null,
lstedtdt: null,
lstedtopr: 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
getBuspound(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) {
updateBuspound(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addBuspound(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 delBuspound(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('measurement/basedata/buspound/export', {
...this.queryParams
}, `buspound_${new Date().getTime()}.xlsx`)
}
}
}
</script>