change - add库位管理条码功能
parent
9002296df2
commit
11e673453c
@ -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);
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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>
|
@ -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>
|
Loading…
Reference in New Issue