仓库点位管理
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.warehousePort.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.bas.warehousePort.domain.BasWarehousePort;
|
||||
import com.ruoyi.bas.warehousePort.service.IBasWarehousePortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/warehousePort")
|
||||
public class BasWarehousePortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasWarehousePortService basWarehousePortService;
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
startPage();
|
||||
List<BasWarehousePort> list = basWarehousePortService.selectBasWarehousePortList(basWarehousePort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库出入管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:export')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasWarehousePort basWarehousePort)
|
||||
{
|
||||
List<BasWarehousePort> list = basWarehousePortService.selectBasWarehousePortList(basWarehousePort);
|
||||
ExcelUtil<BasWarehousePort> util = new ExcelUtil<BasWarehousePort>(BasWarehousePort.class);
|
||||
util.exportExcel(response, list, "仓库出入管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓库出入管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basWarehousePortService.selectBasWarehousePortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:add')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return toAjax(basWarehousePortService.insertBasWarehousePort(basWarehousePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:edit')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return toAjax(basWarehousePortService.updateBasWarehousePort(basWarehousePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:remove')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basWarehousePortService.deleteBasWarehousePortByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.bas.warehousePort.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 仓库出入管理对象 bas_warehouse_port
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public class BasWarehousePort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 仓库id */
|
||||
@Excel(name = "仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/** 端点编码 */
|
||||
@Excel(name = "端点编码")
|
||||
private String portCode;
|
||||
|
||||
/** 端点名称 */
|
||||
@Excel(name = "端点名称")
|
||||
private String portName;
|
||||
|
||||
/** 端点类型 1-入口 2-出口 */
|
||||
@Excel(name = "端点类型 1-入口 2-出口")
|
||||
private String portType;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setPortCode(String portCode)
|
||||
{
|
||||
this.portCode = portCode;
|
||||
}
|
||||
|
||||
public String getPortCode()
|
||||
{
|
||||
return portCode;
|
||||
}
|
||||
|
||||
public void setPortName(String portName)
|
||||
{
|
||||
this.portName = portName;
|
||||
}
|
||||
|
||||
public String getPortName()
|
||||
{
|
||||
return portName;
|
||||
}
|
||||
|
||||
public void setPortType(String portType)
|
||||
{
|
||||
this.portType = portType;
|
||||
}
|
||||
|
||||
public String getPortType()
|
||||
{
|
||||
return portType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("portCode", getPortCode())
|
||||
.append("portName", getPortName())
|
||||
.append("portType", getPortType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.warehousePort.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface BasWarehousePortMapper
|
||||
{
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理集合
|
||||
*/
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.warehousePort.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface IBasWarehousePortService
|
||||
{
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理集合
|
||||
*/
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的仓库出入管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理信息
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bas.warehousePort.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.warehousePort.mapper.BasWarehousePortMapper;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
import com.ruoyi.bas.warehousePort.service.IBasWarehousePortService;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Service
|
||||
public class BasWarehousePortServiceImpl implements IBasWarehousePortService
|
||||
{
|
||||
@Autowired
|
||||
private BasWarehousePortMapper basWarehousePortMapper;
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
@Override
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id)
|
||||
{
|
||||
return basWarehousePortMapper.selectBasWarehousePortById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
@Override
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.selectBasWarehousePortList(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.insertBasWarehousePort(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.updateBasWarehousePort(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasWarehousePortByIds(Long[] ids)
|
||||
{
|
||||
return basWarehousePortMapper.deleteBasWarehousePortByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理信息
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasWarehousePortById(Long id)
|
||||
{
|
||||
return basWarehousePortMapper.deleteBasWarehousePortById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?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.bas.warehousePort.mapper.BasWarehousePortMapper">
|
||||
|
||||
<resultMap type="BasWarehousePort" id="BasWarehousePortResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="portCode" column="port_code" />
|
||||
<result property="portName" column="port_name" />
|
||||
<result property="portType" column="port_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasWarehousePortVo">
|
||||
select id, warehouse_id, port_code, port_name, port_type from bas_warehouse_port
|
||||
</sql>
|
||||
|
||||
<select id="selectBasWarehousePortList" parameterType="BasWarehousePort" resultMap="BasWarehousePortResult">
|
||||
<include refid="selectBasWarehousePortVo"/>
|
||||
<where>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="portCode != null and portCode != ''"> and port_code = #{portCode}</if>
|
||||
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
|
||||
<if test="portType != null and portType != ''"> and port_type = #{portType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasWarehousePortById" parameterType="Long" resultMap="BasWarehousePortResult">
|
||||
<include refid="selectBasWarehousePortVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasWarehousePort" parameterType="BasWarehousePort">
|
||||
insert into bas_warehouse_port
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="portCode != null">port_code,</if>
|
||||
<if test="portName != null">port_name,</if>
|
||||
<if test="portType != null">port_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="portCode != null">#{portCode},</if>
|
||||
<if test="portName != null">#{portName},</if>
|
||||
<if test="portType != null">#{portType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasWarehousePort" parameterType="BasWarehousePort">
|
||||
update bas_warehouse_port
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="portCode != null">port_code = #{portCode},</if>
|
||||
<if test="portName != null">port_name = #{portName},</if>
|
||||
<if test="portType != null">port_type = #{portType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasWarehousePortById" parameterType="Long">
|
||||
delete from bas_warehouse_port where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasWarehousePortByIds" parameterType="String">
|
||||
delete from bas_warehouse_port where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
44
ruoyi-ui/src/api/bas/warehousePort.js
Normal file
44
ruoyi-ui/src/api/bas/warehousePort.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询仓库出入管理列表
|
||||
export function listWarehousePort(query) {
|
||||
return request({
|
||||
url: '/bas/warehousePort/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询仓库出入管理详细
|
||||
export function getWarehousePort(id) {
|
||||
return request({
|
||||
url: '/bas/warehousePort/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增仓库出入管理
|
||||
export function addWarehousePort(data) {
|
||||
return request({
|
||||
url: '/bas/warehousePort',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改仓库出入管理
|
||||
export function updateWarehousePort(data) {
|
||||
return request({
|
||||
url: '/bas/warehousePort',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除仓库出入管理
|
||||
export function delWarehousePort(id) {
|
||||
return request({
|
||||
url: '/bas/warehousePort/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -1085,7 +1085,19 @@ export default {
|
||||
customerManagement:'客户管理',
|
||||
supplierManagement:'供应商管理',
|
||||
materialManagement:'物料管理',
|
||||
basicPointLocation:'基础点位'
|
||||
basicPointLocation:'基础点位',
|
||||
//*************** 查询统计*************
|
||||
queryStatistics:'queryStatistics',
|
||||
inventoryDetailQuery:'inventoryDetailQuery',
|
||||
inventorySummaryQuery:'inventorySummaryQuery',
|
||||
inboundDocumentHistory:'inboundDocumentHistory',
|
||||
outboundDocumentHistory:'outboundDocumentHistory',
|
||||
inboundTaskFlow:'inboundTaskFlow',
|
||||
outboundTaskFlow:'outboundTaskFlow',
|
||||
flatInventoryFlow:'flatInventoryFlow',
|
||||
flatOutboundFlow:'flatOutboundFlow',
|
||||
safetyStockInquiry:'safetyStockInquiry',
|
||||
warningInventoryInquiry:'warningInventoryInquiry'
|
||||
|
||||
},
|
||||
|
||||
|
||||
324
ruoyi-ui/src/views/bas/warehousePort/index.vue
Normal file
324
ruoyi-ui/src/views/bas/warehousePort/index.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<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="warehouseId"><!--仓库-->
|
||||
<el-select
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="端点名称" prop="portName">
|
||||
<el-input
|
||||
v-model="queryParams.portName"
|
||||
placeholder="请输入端点名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="端点类型" prop="portType">
|
||||
<el-select v-model="queryParams.portType" placeholder="请选择端点类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.warehouse_port_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</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="['bas:warehousePort: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="['bas:warehousePort: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="['bas:warehousePort: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="['bas:warehousePort:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="warehousePortList" @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="仓库id" align="center" prop="warehouseId" />
|
||||
<el-table-column label="端点编码" align="center" prop="portCode" />
|
||||
<el-table-column label="端点名称" align="center" prop="portName" />
|
||||
<el-table-column label="端点类型" align="center" prop="portType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.warehouse_port_type" :value="scope.row.portType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['bas:warehousePort:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bas:warehousePort: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="仓库id" prop="warehouseId">
|
||||
<!-- <el-input v-model="form.warehouseId" type="textarea" placeholder="请输入内容" />-->
|
||||
<el-select
|
||||
v-model="form.warehouseId"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="端点编码" prop="portCode">
|
||||
<el-input v-model="form.portCode" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="端点名称" prop="portName">
|
||||
<el-input v-model="form.portName" placeholder="请输入端点名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="端点类型" prop="portType">
|
||||
<el-select v-model="form.portType" placeholder="请选择端点类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.warehouse_port_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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 { listWarehousePort, getWarehousePort, delWarehousePort, addWarehousePort, updateWarehousePort } from "@/api/bas/warehousePort"
|
||||
import {listWarehouse} from "@/api/bas/warehouse"
|
||||
export default {
|
||||
name: "WarehousePort",
|
||||
dicts: ['warehouse_port_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 仓库选项列表
|
||||
warehouseOptions: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 仓库出入管理表格数据
|
||||
warehousePortList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseId: null,
|
||||
portCode: null,
|
||||
portName: null,
|
||||
portType: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询仓库出入管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listWarehousePort(this.queryParams).then(response => {
|
||||
this.warehousePortList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
warehouseId: null,
|
||||
portCode: null,
|
||||
portName: null,
|
||||
portType: 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
|
||||
getWarehousePort(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) {
|
||||
updateWarehousePort(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addWarehousePort(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 delWarehousePort(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/warehousePort/export', {
|
||||
...this.queryParams
|
||||
}, `warehousePort_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.queryParams.warehouseId = this.warehouseOptions[0].warehouseId;
|
||||
this.handleQuery();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user