托盘条码下拉框选择

This commit is contained in:
liuhanqing
2025-08-14 15:18:57 +08:00
parent 196b774c64
commit b9c78e05de
3 changed files with 77 additions and 26 deletions

View File

@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/**
* 条码信息对象 bas_traycode
*
*
* @author ruoyi
* @date 2025-07-28
*/
@@ -21,6 +21,7 @@ public class BasTraycode extends BaseEntity
/** 条码类型id */
@Excel(name = "条码类型id")
private Long formatId;
private String formatName;
/** 条码 */
@Excel(name = "条码")
@@ -38,62 +39,70 @@ public class BasTraycode extends BaseEntity
@Excel(name = "备用字段3")
private String spare3;
public void setId(Long id)
public String getFormatName() {
return formatName;
}
public void setFormatName(String formatName) {
this.formatName = formatName;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
public Long getId()
{
return id;
}
public void setFormatId(Long formatId)
public void setFormatId(Long formatId)
{
this.formatId = formatId;
}
public Long getFormatId()
public Long getFormatId()
{
return formatId;
}
public void setTrayCode(String trayCode)
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
public String getTrayCode()
{
return trayCode;
}
public void setSpare1(String spare1)
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
public String getSpare3()
{
return spare3;
}

View File

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BasTraycode" id="BasTraycodeResult">
<result property="id" column="id" />
<result property="formatId" column="format_id" />
<result property="formatName" column="format_name" />
<result property="trayCode" column="tray_code" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
@@ -16,17 +17,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBasTraycodeVo">
select id, format_id, tray_code, create_time, update_time, spare1, spare2, spare3 from bas_traycode
select bt.id, bt.format_id, bt.tray_code, bt.create_time, bt.update_time, bt.spare1, bt.spare2, bt.spare3,btf.remarks as format_name
from bas_traycode bt
left join bas_traycode_format btf on btf.id = bt.format_id
</sql>
<select id="selectBasTraycodeList" parameterType="BasTraycode" resultMap="BasTraycodeResult">
<include refid="selectBasTraycodeVo"/>
<where>
<if test="formatId != null "> and format_id = #{formatId}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="formatId != null "> and bt.format_id = #{formatId}</if>
<if test="trayCode != null and trayCode != ''"> and bt.tray_code = #{trayCode}</if>
<if test="spare1 != null and spare1 != ''"> and bt.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and bt.spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and bt.spare3 = #{spare3}</if>
</where>
</select>

View File

@@ -2,12 +2,20 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item :label="$t('traycode.formatId')" prop="formatId">
<el-input
<!-- <el-input
v-model="queryParams.formatId"
:placeholder="$t('traycode.placeholder.formatId')"
clearable
@keyup.enter.native="handleQuery"
/>
/>-->
<el-select v-model="queryParams.formatId" :placeholder="$t('traycode.placeholder.formatId')">
<el-option
v-for="item in traycodeFormatList"
:key="item.id"
:label="item.remarks"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('traycode.trayCode')" prop="trayCode">
<el-input
@@ -17,7 +25,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('traycode.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('traycode.reset') }}</el-button>
@@ -84,7 +92,7 @@
<el-table ref="table" v-loading="loading" :data="traycodeList" @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="$t('traycode.formatId')" align="center" prop="formatId" />
<el-table-column :label="$t('traycode.formatId')" align="center" prop="formatName" />
<el-table-column :label="$t('traycode.trayCode')" align="center" prop="trayCode" />
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
<el-table-column label="备用字段2" align="center" prop="spare2" />
@@ -128,9 +136,17 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item :label="$t('traycode.formatId')" prop="formatId">
<el-input v-model="form.formatId" :placeholder="$t('traycode.placeholder.formatId')" />
<el-select v-model="form.formatId" :placeholder="$t('traycode.placeholder.formatId')">
<el-option
v-for="item in traycodeFormatList"
:key="item.id"
:label="item.remarks"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('traycode.trayCode')" prop="trayCode">
<el-input v-model="form.trayCode" :placeholder="$t('traycode.placeholder.trayCode')" />
</el-form-item>
<!-- <el-form-item label="备用字段1" prop="spare1">
@@ -154,6 +170,8 @@
<script>
import { listTraycode, getTraycode, delTraycode, addTraycode, updateTraycode } from "@/api/bas/traycode"
import { getLodop } from "@/plugins/LodopFuncs"
import { listTraycodeFormat} from "@/api/bas/traycodeFormat"
export default {
name: "Traycode",
@@ -175,8 +193,7 @@ export default {
total: 0,
// 条码信息表格数据
traycodeList: [],
// 弹出层标题
title: "",
traycodeFormatList: [],
// 是否显示弹出层
open: false,
// 查询参数
@@ -189,6 +206,10 @@ export default {
spare2: null,
spare3: null
},
queryTrayCodeFormatParams: {
pageNum: 1,
pageSize: 99,
},
// 表单参数
form: {},
// 表单校验
@@ -197,9 +218,19 @@ export default {
}
},
created() {
this.getTrayCodeFormatList()
this.getList()
},
methods: {
/** 查询条码信息列表 */
getTrayCodeFormatList() {
this.loading = true
listTraycodeFormat(this.queryTrayCodeFormatParams).then(response => {
this.traycodeFormatList = response.rows
this.total = response.total
this.loading = false
})
},
/** 查询条码信息列表 */
getList() {
this.loading = true
@@ -351,3 +382,10 @@ export default {
}
}
</script>
<style scoped>
/* 统一表单控件宽度 */
.el-select,
.el-input {
width: 100%;
}
</style>