change - add库位管理条码功能

master
yinq 4 months ago
parent 9002296df2
commit 11e673453c

@ -172,6 +172,25 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String confirmFlag;//用来二次确认使用
private Long locationBarcodeId;
private String locationCode;
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public Long getLocationBarcodeId() {
return locationBarcodeId;
}
public void setLocationBarcodeId(Long locationBarcodeId) {
this.locationBarcodeId = locationBarcodeId;
}
public String getPrintFlag() {
return printFlag;

@ -280,5 +280,28 @@ public class MesBaseBarcodeInfoController extends BaseController
return toAjax(mesBaseBarcodeInfoService.generateRegularRawBarcode(mesBaseBarcodeInfo));
}
/**
*
*/
@RequiresPermissions("mes:barcode:list")
@GetMapping("/selectBarCodeAllocationWarehouse")
public TableDataInfo selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
startPage();
List<MesBaseBarcodeInfo> list = mesBaseBarcodeInfoService.selectBarCodeAllocationWarehouse(mesBaseBarcodeInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:barcode:list")
@GetMapping("/selectWarehouseBarCodeList")
public TableDataInfo selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
startPage();
List<MesBaseBarcodeInfo> list = mesBaseBarcodeInfoService.selectWarehouseBarCodeList(mesBaseBarcodeInfo);
return getDataTable(list);
}
}

@ -114,4 +114,19 @@ public interface MesBaseBarcodeInfoMapper
*/
public int batchMesBaseBarcodeInfo(List<MesBaseBarcodeInfo> mesBaseBarcodeInfos);
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
public List<MesBaseBarcodeInfo> selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo);
}

@ -144,4 +144,18 @@ public interface IMesBaseBarcodeInfoService
* @return
*/
public int regenerateBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
public List<MesBaseBarcodeInfo> selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo);
}

@ -867,4 +867,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
@Override
public List<MesBaseBarcodeInfo> selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
return mesBaseBarcodeInfoMapper.selectBarCodeAllocationWarehouse(mesBaseBarcodeInfo);
}
/**
*
* @param mesBaseBarcodeInfo
* @return
*/
@Override
public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo);
}
}

@ -46,6 +46,7 @@
<result property="materialSpec" column="material_spec"/>
<result property="alwaysFlag" column="always_flag"/>
<result property="checkStatus" column="checkStatus"/>
<result property="locationBarcodeId" column="location_barcode_id"/>
</resultMap>
<sql id="selectMesBaseBarcodeInfoVo">
@ -380,4 +381,47 @@
</foreach>
</insert>
<select id="selectBarCodeAllocationWarehouse" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
select bbi.barcode_id,
bbi.print_time,
bbi.print_person,
bbi.batch_flag,
bbi.barcode_type,
bbi.barcode_info,
bbi.material_id,
bmi.material_code,
bmi.material_name,
bmi.material_spec
from mes_base_barcode_info bbi
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id
<where>
bbi.barcode_type = '9'
and not exists(select 1
from wms_location_barcode wlb
where bbi.barcode_info = wlb.barcode_info
and wlb.location_code = #{locationCode})
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info like concat('%', #{barcodeInfo},'%')</if>
</where>
</select>
<select id="selectWarehouseBarCodeList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
select wlb.location_barcode_id,
wlb.location_code,
wlb.barcode_info,
bmi.material_id,
bmi.material_code,
bmi.material_name,
bmi.material_spec
from wms_location_barcode wlb
left join mes_base_material_info bmi on bmi.material_id = wlb.material_id
<where>
<if test="locationCode != null and locationCode != ''"> and wlb.location_code = #{locationCode}</if>
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and wlb.barcode_info like concat('%', #{barcodeInfo},'%')</if>
</where>
</select>
</mapper>

@ -275,7 +275,7 @@
<where>
and not exists (select 1 from wms_warehouse_material wwm where mbmi.material_id = wwm.storage_id and wwm.storage_type='1' and wwm.warehouse_id=#{warehouseId})
<if test="erpId != null ">and erp_id = #{erpId}</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="materialCode != null and materialCode != ''">and material_code like concat('%', #{materialCode},'%')</if>
<if test="oldMaterialCode != null and oldMaterialCode != ''">and old_material_code = #{oldMaterialCode}
</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},

@ -160,4 +160,31 @@ public class WmsBaseLocationController extends BaseController {
return success(wmsBaseLocationService.printLabels(locationIds, 2));
}
/**
*
*
* @param locationCode
* @param materialIds ID
* @param barcodeInfos
*/
@RequiresPermissions("wms:wmslocation:barCode")
@Log(title = "库位管理", businessType = BusinessType.ALLOCATE)
@PutMapping("/allocateBarCodes")
public AjaxResult allocateBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) {
wmsBaseLocationService.batchInsertWarehouseBarCodes(locationCode, materialIds, barcodeInfos);
return success();
}
/**
*
* @param locationBarcodeIds
* @return
*/
@RequiresPermissions("wms:wmslocation:barCode")
@Log(title = "库位管理", businessType = BusinessType.UNALLOCATE)
@PostMapping("/unallocateBarCodes")
public AjaxResult unallocateBarCodes(Long[] locationBarcodeIds) {
return toAjax(wmsBaseLocationService.deleteWmsLocationBarcodeByLocationBarcodeIds(locationBarcodeIds));
}
}

@ -0,0 +1,99 @@
package com.hw.wms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.wms.domain.WmsLocationBarcode;
import com.hw.wms.service.IWmsLocationBarcodeService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-07-31
*/
@RestController
@RequestMapping("/locationBarcode")
public class WmsLocationBarcodeController extends BaseController {
@Autowired
private IWmsLocationBarcodeService wmsLocationBarcodeService;
/**
*
*/
@RequiresPermissions("wms:locationBarcode:list")
@GetMapping("/list")
public TableDataInfo list(WmsLocationBarcode wmsLocationBarcode) {
startPage();
List<WmsLocationBarcode> list = wmsLocationBarcodeService.selectWmsLocationBarcodeList(wmsLocationBarcode);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("wms:locationBarcode:export")
@Log(title = "库位关联条码信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsLocationBarcode wmsLocationBarcode) {
List<WmsLocationBarcode> list = wmsLocationBarcodeService.selectWmsLocationBarcodeList(wmsLocationBarcode);
ExcelUtil<WmsLocationBarcode> util = new ExcelUtil<WmsLocationBarcode>(WmsLocationBarcode.class);
util.exportExcel(response, list, "库位关联条码信息数据");
}
/**
*
*/
@RequiresPermissions("wms:locationBarcode:query")
@GetMapping(value = "/{locationBarcodeId}")
public AjaxResult getInfo(@PathVariable("locationBarcodeId") Long locationBarcodeId) {
return success(wmsLocationBarcodeService.selectWmsLocationBarcodeByLocationBarcodeId(locationBarcodeId));
}
/**
*
*/
@RequiresPermissions("wms:locationBarcode:add")
@Log(title = "库位关联条码信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsLocationBarcode wmsLocationBarcode) {
return toAjax(wmsLocationBarcodeService.insertWmsLocationBarcode(wmsLocationBarcode));
}
/**
*
*/
@RequiresPermissions("wms:locationBarcode:edit")
@Log(title = "库位关联条码信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsLocationBarcode wmsLocationBarcode) {
return toAjax(wmsLocationBarcodeService.updateWmsLocationBarcode(wmsLocationBarcode));
}
/**
*
*/
@RequiresPermissions("wms:locationBarcode:remove")
@Log(title = "库位关联条码信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{locationBarcodeIds}")
public AjaxResult remove(@PathVariable Long[] locationBarcodeIds) {
return toAjax(wmsLocationBarcodeService.deleteWmsLocationBarcodeByLocationBarcodeIds(locationBarcodeIds));
}
}

@ -0,0 +1,84 @@
package com.hw.wms.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* wms_location_barcode
*
* @author Yinq
* @date 2024-07-31
*/
public class WmsLocationBarcode extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long locationBarcodeId;
/**
*
*/
@Excel(name = "库位编码")
private String locationCode;
/**
* ID
*/
@Excel(name = "物料ID")
private Long materialId;
/**
*
*/
@Excel(name = "物料条码")
private String barcodeInfo;
public void setLocationBarcodeId(Long locationBarcodeId) {
this.locationBarcodeId = locationBarcodeId;
}
public Long getLocationBarcodeId() {
return locationBarcodeId;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public String getLocationCode() {
return locationCode;
}
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public Long getMaterialId() {
return materialId;
}
public void setBarcodeInfo(String barcodeInfo) {
this.barcodeInfo = barcodeInfo;
}
public String getBarcodeInfo() {
return barcodeInfo;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("locationBarcodeId", getLocationBarcodeId())
.append("locationCode", getLocationCode())
.append("materialId", getMaterialId())
.append("barcodeInfo", getBarcodeInfo())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,70 @@
package com.hw.wms.mapper;
import java.util.List;
import com.hw.wms.domain.WmsLocationBarcode;
/**
* Mapper
*
* @author Yinq
* @date 2024-07-31
*/
public interface WmsLocationBarcodeMapper
{
/**
*
*
* @param locationBarcodeId
* @return
*/
public WmsLocationBarcode selectWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public List<WmsLocationBarcode> selectWmsLocationBarcodeList(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public int insertWmsLocationBarcode(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public int updateWmsLocationBarcode(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param locationBarcodeId
* @return
*/
public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId);
/**
*
*
* @param locationBarcodeIds
* @return
*/
public int deleteWmsLocationBarcodeByLocationBarcodeIds(Long[] locationBarcodeIds);
/**
*
*
* @param wmsLocationBarcodeList
* @return
*/
public int batchWmsLocationBarcode(List<WmsLocationBarcode> wmsLocationBarcodeList);
}

@ -93,4 +93,21 @@ public interface IWmsBaseLocationService
* @return
*/
public int printLabels(Long[] locationIds, int type);
/**
*
*
* @param locationCode
* @param materialIds ID
* @param barcodeInfos
*/
public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos);
/**
*
* @param locationBarcodeIds
* @return
*/
public int deleteWmsLocationBarcodeByLocationBarcodeIds(Long[] locationBarcodeIds);
}

@ -0,0 +1,61 @@
package com.hw.wms.service;
import java.util.List;
import com.hw.wms.domain.WmsLocationBarcode;
/**
* Service
*
* @author Yinq
* @date 2024-07-31
*/
public interface IWmsLocationBarcodeService {
/**
*
*
* @param locationBarcodeId
* @return
*/
public WmsLocationBarcode selectWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public List<WmsLocationBarcode> selectWmsLocationBarcodeList(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public int insertWmsLocationBarcode(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param wmsLocationBarcode
* @return
*/
public int updateWmsLocationBarcode(WmsLocationBarcode wmsLocationBarcode);
/**
*
*
* @param locationBarcodeIds
* @return
*/
public int deleteWmsLocationBarcodeByLocationBarcodeIds(Long[] locationBarcodeIds);
/**
*
*
* @param locationBarcodeId
* @return
*/
public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId);
}

@ -10,13 +10,17 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.printer.api.RemotePrinterService;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsLocationBarcode;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsLocationBarcodeMapper;
import com.hw.wms.service.IWmsBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -34,6 +38,9 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
@Autowired
private WmsBaseWarehouseMapper wmsBaseWarehouseMapper;
@Autowired
private WmsLocationBarcodeMapper wmsLocationBarcodeMapper;
@Resource
private RemotePrinterService remotePrinterService;
@ -205,4 +212,39 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
}
}
/**
*
*
* @param locationCode
* @param materialIds ID
* @param barcodeInfos
*/
@Override
public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) {
if (StringUtils.isNotEmpty(barcodeInfos)){
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
List<WmsLocationBarcode> list = new ArrayList<>();
for (int i = 0; i < barcodeInfos.length; i++) {
WmsLocationBarcode locationBarcode = new WmsLocationBarcode();
locationBarcode.setLocationCode(locationCode);
locationBarcode.setMaterialId(materialIds[i]);
locationBarcode.setBarcodeInfo(barcodeInfos[i]);
locationBarcode.setCreateBy(userName);
locationBarcode.setCreateTime(currentDate);
list.add(locationBarcode);
}
wmsLocationBarcodeMapper.batchWmsLocationBarcode(list);
}
}
/**
*
* @param locationBarcodeIds
* @return
*/
@Override
public int deleteWmsLocationBarcodeByLocationBarcodeIds(Long[] locationBarcodeIds) {
return wmsLocationBarcodeMapper.deleteWmsLocationBarcodeByLocationBarcodeIds(locationBarcodeIds);
}
}

@ -0,0 +1,89 @@
<?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.hw.wms.mapper.WmsLocationBarcodeMapper">
<resultMap type="WmsLocationBarcode" id="WmsLocationBarcodeResult">
<result property="locationBarcodeId" column="location_barcode_id"/>
<result property="locationCode" column="location_code"/>
<result property="materialId" column="material_id"/>
<result property="barcodeInfo" column="barcode_info"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectWmsLocationBarcodeVo">
select location_barcode_id, location_code, material_id, barcode_info, remark, create_by, create_time
from wms_location_barcode
</sql>
<select id="selectWmsLocationBarcodeList" parameterType="WmsLocationBarcode" resultMap="WmsLocationBarcodeResult">
<include refid="selectWmsLocationBarcodeVo"/>
<where>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and barcode_info = #{barcodeInfo}</if>
</where>
</select>
<select id="selectWmsLocationBarcodeByLocationBarcodeId" parameterType="Long" resultMap="WmsLocationBarcodeResult">
<include refid="selectWmsLocationBarcodeVo"/>
where location_barcode_id = #{locationBarcodeId}
</select>
<insert id="insertWmsLocationBarcode" parameterType="WmsLocationBarcode" useGeneratedKeys="true"
keyProperty="locationBarcodeId">
insert into wms_location_barcode
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="materialId != null">material_id,</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWmsLocationBarcode" parameterType="WmsLocationBarcode">
update wms_location_barcode
<trim prefix="SET" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where location_barcode_id = #{locationBarcodeId}
</update>
<delete id="deleteWmsLocationBarcodeByLocationBarcodeId" parameterType="Long">
delete
from wms_location_barcode
where location_barcode_id = #{locationBarcodeId}
</delete>
<delete id="deleteWmsLocationBarcodeByLocationBarcodeIds" parameterType="String">
delete from wms_location_barcode where location_barcode_id in
<foreach item="locationBarcodeId" collection="array" open="(" separator="," close=")">
#{locationBarcodeId}
</foreach>
</delete>
<insert id="batchWmsLocationBarcode">
insert into wms_location_barcode( location_barcode_id, location_code, material_id, barcode_info, remark, create_by, create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.locationBarcodeId}, #{item.locationCode}, #{item.materialId}, #{item.barcodeInfo}, #{item.remark}, #{item.createBy}, #{item.createTime})
</foreach>
</insert>
</mapper>

@ -87,3 +87,39 @@ export function printContainerLabels(locationId) {
method: 'get'
})
}
// 查询条码信息列表
export function selectBarCodeAllocationWarehouse(query) {
return request({
url: '/mes/barcode/selectBarCodeAllocationWarehouse',
method: 'get',
params: query
})
}
// 查询库位已关联条码信息列表
export function selectWarehouseBarCodeList(query) {
return request({
url: '/mes/barcode/selectWarehouseBarCodeList',
method: 'get',
params: query
})
}
// 保存库位关联的条码信息列表
export function allocateBarCodes(data) {
return request({
url: '/wms/wmslocation/allocateBarCodes',
method: 'put',
params: data
})
}
// 删除库位分配的条码信息列表
export function unallocateBarCodes(data) {
return request({
url: '/wms/wmslocation/unallocateBarCodes',
method: 'post',
params: data
})
}

@ -211,6 +211,20 @@ export const dynamicRoutes = [
}
]
},
{
path: '/wmslocation/correlationBarCode',
component: Layout,
hidden: true,
permissions: ['wms:wmslocation:barCode'],
children: [
{
path: 'index/:locationId(\\d+)',
component: () => import('@/views/wms/base/wmslocation/correlationBarCode'),
name: 'CorrelationBarCode',
meta: { title: '库位关联条码', activeMenu: '/wms/base/wmslocation' }
}
]
},
{
path: '/system/wfProcessActivityAuth',
component: Layout,

@ -0,0 +1,325 @@
<template>
<div class="app-container">
<h4 class="form-header h4">仓库信息</h4>
<el-form ref="locationForm" :model="locationForm" label-width="80px">
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input v-model="locationForm.warehouseName" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="库位编号" prop="locationCode">
<el-input v-model="locationForm.locationCode" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row>
<el-col :span="11">
<h4 class="form-header h4">已选条码</h4>
<el-form :model="allocateBarCodeQueryParams" ref="allocateMaterialQueryForm" size="small" :inline="true"
v-show="showSearch"
label-width="68px">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="allocateBarCodeQueryParams.materialCode"
placeholder="请输入物料编码"
style="width:140px;"
clearable
@keyup.enter.native="handleAllocateMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="allocateBarCodeQueryParams.materialName"
placeholder="请输入物料名称"
style="width:140px;"
clearable
@keyup.enter.native="handleAllocateMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料条码" prop="barcodeInfo">
<el-input
v-model="allocateBarCodeQueryParams.barcodeInfo"
placeholder="请输入物料条码"
style="width:140px;"
clearable
@keyup.enter.native="handleMaterialQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleAllocateMaterialQuery">
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetAllocateMaterialQuery"></el-button>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleUnallocateBarCodes"
v-hasPermi="['wms:wmslocation:remove']"
>删除
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="allocateMaterialLoading" :data="allocateMaterialList"
@selection-change="handleAllocateMaterialSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="物料条码" align="center" prop="barcodeInfo" width="180"/>
</el-table>
<pagination
v-show="allocateMaterialTotal>0"
:total="allocateMaterialTotal"
:page.sync="allocateBarCodeQueryParams.pageNum"
:limit.sync="allocateBarCodeQueryParams.pageSize"
@pagination="getAllocateBarCodeList"
/>
</el-col>
<el-col :span="11" style="margin-left:10px;">
<h4 class="form-header h4">可选条码</h4>
<el-form :model="barCodeQueryParams" ref="materialQueryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="barCodeQueryParams.materialCode"
placeholder="请输入物料编码"
style="width:140px;"
clearable
@keyup.enter.native="handleMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="barCodeQueryParams.materialName"
placeholder="请输入物料名称"
style="width:140px;"
clearable
@keyup.enter.native="handleMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料条码" prop="barcodeInfo">
<el-input
v-model="barCodeQueryParams.barcodeInfo"
placeholder="请输入物料条码"
style="width:140px;"
clearable
@keyup.enter.native="handleMaterialQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery"></el-button>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
:disabled="allocateBarCodeBtnDisable"
@click="submitForm"
v-hasPermi="['wms:wmslocation:add']"
>保存
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="materialLoading" :data="materialinfoList"
@selection-change="handleMaterialSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="物料条码" align="center" prop="barcodeInfo" width="180"/>
</el-table>
<pagination
v-show="materialTotal>0"
:total="materialTotal"
:page.sync="barCodeQueryParams.pageNum"
:limit.sync="barCodeQueryParams.pageSize"
@pagination="getBarCodeList"
/>
</el-col>
</el-row>
</div>
</template>
<script>
import {
selectBarCodeAllocationWarehouse, allocateBarCodes, selectWarehouseBarCodeList, unallocateBarCodes
} from "@/api/wms/wmslocation";
export default {
name: "CorrelationBarCode",
data() {
return {
//
allocateMaterialLoading: true,
//
materialLoading: true,
//
locationBarcodeIds: [],
//
barcodeInfos: [],
//ID
materialIds: [],
//
allocateMaterialSingle: true,
//
allocateMaterialMultiple: true,
//
materialSingle: true,
//
materialMultiple: true,
//
showSearch: true,
//
allocateMaterialTotal: 0,
//
materialTotal: 0,
//
allocateMaterialList: [],
//
materialinfoList: [],
//
locationForm: {},
allocateBarCodeBtnDisable: true,
//
allocateBarCodeQueryParams: {
pageNum: 1,
pageSize: 10,
materialCode: null,
materialName: null,
warehouseCode: null,
},
//
barCodeQueryParams: {
pageNum: 1,
pageSize: 10,
materialCode: null,
materialName: null,
warehouseCode: null
},
};
},
created() {
this.allocateBarCodeBtnDisable = false;
const locationCode = this.$route.query && this.$route.query.locationCode;
this.allocateBarCodeQueryParams.locationCode = locationCode;
this.barCodeQueryParams.locationCode = locationCode;
this.locationForm.locationCode = locationCode;
this.locationForm.warehouseName = this.$route.query && this.$route.query.warehouseName;
this.getAllocateBarCodeList();
this.getBarCodeList();
},
methods: {
/** 查询已选条码信息列表 */
getAllocateBarCodeList() {
this.allocateMaterialLoading = true;
selectWarehouseBarCodeList(this.allocateBarCodeQueryParams).then(response => {
this.allocateMaterialList = response.rows;
this.allocateMaterialTotal = response.total;
this.allocateMaterialLoading = false;
});
},
/** 查询可选条码信息列表 */
getBarCodeList() {
this.materialLoading = true;
selectBarCodeAllocationWarehouse(this.barCodeQueryParams).then(response => {
this.materialinfoList = response.rows;
this.materialTotal = response.total;
this.materialLoading = false;
});
},
/** 已选条码搜索按钮操作 */
handleAllocateMaterialQuery() {
this.allocateBarCodeQueryParams.pageNum = 1;
this.getAllocateBarCodeList();
},
/** 已选条码重置按钮操作 */
resetAllocateMaterialQuery() {
this.resetForm("allocateMaterialQueryForm");
this.handleAllocateMaterialQuery();
},
/** 已选条码多选框选中数据 */
handleAllocateMaterialSelectionChange(selection) {
this.locationBarcodeIds = selection.map(item => item.locationBarcodeId)
this.allocateBarcodeInfos = selection.map(item => item.barcodeInfo)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 可选条码搜索按钮操作 */
handleMaterialQuery() {
this.barCodeQueryParams.pageNum = 1;
this.getBarCodeList();
},
/** 可选条码重置按钮操作 */
resetMaterialQuery() {
this.resetForm("materialQueryForm");
this.handleMaterialQuery();
},
//
handleMaterialSelectionChange(selection) {
this.barcodeInfos = selection.map(item => item.barcodeInfo)
this.materialIds = selection.map(item => item.materialId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleUnallocateBarCodes() {
const locationBarcodeIds = this.locationBarcodeIds.join(",");
const allocateBarcodeInfos = this.allocateBarcodeInfos;
const params = {
locationBarcodeIds: locationBarcodeIds
}
this.$modal.confirm('是否确认删除物料条码为"' + allocateBarcodeInfos + '"的数据项?').then(function () {
return unallocateBarCodes(params);
}).then(() => {
this.getAllocateBarCodeList();
this.getBarCodeList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 提交按钮 */
submitForm() {
this.allocateBarCodeBtnDisable = true;
const locationCode = this.locationForm.locationCode;
const materialIds = this.materialIds.join(",");
const barcodeInfos = this.barcodeInfos.join(",");
allocateBarCodes({
locationCode: locationCode,
materialIds: materialIds,
barcodeInfos: barcodeInfos
}).then((response) => {
this.$modal.msgSuccess("保存成功");
this.selectBarCodeAllocationWarehouse();
this.getAllocateBarCodeList();
this.allocateBarCodeBtnDisable = false;
}).catch(() => {
this.getAllocateBarCodeList();
this.getBarCodeList();
this.allocateBarCodeBtnDisable = false;
});
},
/** 关闭按钮 */
close() {
const obj = {path: "/system/user"};
this.$tab.closeOpenPage(obj);
},
}
};
</script>

@ -278,6 +278,13 @@
v-hasPermi="['wms:wmslocation:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleCorrelationBarCode(scope.row)"
v-hasPermi="['wms:wmswarehouse:barCode']"
>关联条码</el-button>
<el-button
v-if="scope.row.locationStatus=='3'"
size="mini"
@ -669,6 +676,13 @@ export default {
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleCorrelationBarCode(row){
const locationId = row.locationId;
const locationCode = row.locationCode;
const warehouseName = row.warehouseName;
const params = {locationCode: locationCode, warehouseName: warehouseName};
this.$tab.openPage("库位关联条码[" + locationCode + "]", '/wmslocation/correlationBarCode/index/' + locationId, params);
},
/** 新增按钮操作 */
handleAdd() {
this.reset();

Loading…
Cancel
Save