change -库存台账显示样式修改

master
wenjy 8 months ago
parent 81e3601e8d
commit 6c95bc911c

@ -154,17 +154,23 @@ public class BaseLocationInfoController extends BaseController
@Autowired
private ILedgerInstantBindingService ledgerInstantBindingService;
@PostMapping("/childList")
@ResponseBody
public TableDataInfo list(LedgerInstantBinding ledgerInstantBinding)
{
startPage();
List<LedgerInstantBinding> list = ledgerInstantBindingService.selectLedgerInstantBindingList(ledgerInstantBinding);
return getDataTable(list);
}
/*if(StringUtils.isNotEmpty(ledgerInstantBinding.getCargoFrameEpc())){
}else {
return null;
}*/
@GetMapping("/childList")
@ResponseBody
public TableDataInfo childList(String cargoFrameEpc)
{
LedgerInstantBinding ledgerInstantBinding = new LedgerInstantBinding();
ledgerInstantBinding.setCargoFrameEpc(cargoFrameEpc);
startPage();
List<LedgerInstantBinding> list = ledgerInstantBindingService.selectLedgerInstantBindingList(ledgerInstantBinding);
return getDataTable(list);
}

@ -1,223 +1,299 @@
<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('库存台账列表')"/>
<th:block th:include="include :: header('入库申请单列表')"/>
</head>
<style>
#bootstrap-table tbody .detail-view td {
background-color: rgba(0, 0, 0, 0.2);
}
#bootstrap-table tbody .detail-view .bootstrap-table .fixed-table-container .fixed-table-body table tbody tr td:nth-child(7n+2) {
border: 1px solid #fff;
border-bottom-color: #cccccc !important;
}
#bootstrap-table tbody .detail-view .bootstrap-table .fixed-table-container .fixed-table-body table tbody tr:last-child td:nth-child(7n+2) {
border-bottom-color: #ddd !important;
}
</style>
<head>
<th:block th:include="include :: header('库位信息列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>库位名称:</label>
<input type="text" name="locationName"/>
</li>
<li>
<label>库位类别:</label>
<select name="localtionType" th:with="type=${@dict.getType('sys_localtion_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>仓库编号:</label>
<input type="text" name="storeCode"/>
</li>
<li>
<label>库位状态:</label>
<select name="locationStatus" th:with="type=${@dict.getType('sys_location_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<!--<li>
<label>库位编号:</label>
<input type="text" name="locationCode"/>
</li>-->
<li>
<label>库位名称:</label>
<input type="text" name="locationName"/>
</li>
<li>
<label>库位类别:</label>
<select name="localtionType" th:with="type=${@dict.getType('sys_localtion_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>仓库编号:</label>
<input type="text" name="storeCode"/>
</li>
<li>
<label>库位状态:</label>
<select name="locationStatus" th:with="type=${@dict.getType('sys_location_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>是否状态:</label>
<select name="isFlag" th:with="type=${@dict.getType('sys_is_flag')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>更新时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginUpdatedTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endUpdatedTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:location:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="base:location:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="base:location:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="base:location:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:location:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<div class="tabs-container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-1" onclick="TabOnclick(false)"
aria-expanded="true"> 库存明细</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab-1">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table1"></table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: jquery-smartwizard-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('base:location:edit')}]];
var removeFlag = [[${@permission.hasPermi('base:location:remove')}]];
var localtionTypeDatas = [[${@dict.getType('sys_localtion_type')}]];
var locationStatusDatas = [[${@dict.getType('sys_location_status')}]];
var isFlagDatas = [[${@dict.getType('sys_is_flag')}]];
var prefix = ctx + "base/location";
var editFlag = [[${@permission.hasPermi('base:location:edit')}]];
var removeFlag = [[${@permission.hasPermi('base:location:remove')}]];
var localtionTypeDatas = [[${@dict.getType('sys_localtion_type')}]];
var locationStatusDatas = [[${@dict.getType('sys_location_status')}]];
var isFlagDatas = [[${@dict.getType('sys_is_flag')}]];
var prefix = ctx + "base/location";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "库位信息",
onClickRow: onClickRow,
columns: [{
checkbox: true
},
{
field: 'objId',
title: '标识ID',
visible: false
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'locationCode',
title: '库位编号'
},
{
field: 'locationName',
title: '库位名称'
},
{
field: 'remark',
title: '货筐RFID'
},
{
field: 'localtionType',
title: '库位类别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(localtionTypeDatas, value);
}
},
{
field: 'locationDescribe',
title: '库位描述'
},
{
field: 'storeCode',
title: '仓库编号'
},
{
field: 'maxAmount',
title: '最大数量'
},
{
field: 'usedAmount',
title: '存放数量'
},
{
field: 'maxVolume',
title: '最大容积'
},
{
field: 'usedVolume',
title: '存放体积'
},
{
field: 'locationStatus',
title: '库位状态',
formatter: function (value, row, index) {
return $.table.selectDictLabel(locationStatusDatas, value);
}
},
{
field: 'isFlag',
title: '是否状态',
formatter: function (value, row, index) {
return $.table.selectDictLabel(isFlagDatas, value);
}
},
{
field: 'updatedTime',
title: '更新时间'
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
const onClickRow = function (row, $element) {
initTable1(row);
}
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "库存台账",
detailView: true,
onExpandRow: function (index, row, $detail) {
initChildTable(index, row, $detail);
},
onClickRow: function (e, row) {
let index = $(row[0]).attr('data-index')
let node = $('#bootstrap-table tbody tr[data-index=' + index + '] td a:first-child')[0]
node.click()
},
columns: [
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'locationCode',
title: '库位编号'
},
{
field: 'remark',
title: '货筐RFID'
},
{
field: 'locationName',
title: '库位名称'
},
{
field: 'localtionType',
title: '库位类别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(localtionTypeDatas, value);
}
},
{
field: 'locationDescribe',
title: '库位描述'
},
{
field: 'storeCode',
title: '仓库编号'
},
/*{
field: 'maxAmount',
title: '最大数量'
},*/
{
field: 'usedAmount',
title: '存放数量'
},
/*{
field: 'maxVolume',
title: '最大容积'
},*/
{
field: 'usedVolume',
title: '存放体积'
},
{
field: 'locationStatus',
title: '库位状态',
formatter: function (value, row, index) {
return $.table.selectDictLabel(locationStatusDatas, value);
}
},
{
field: 'updatedTime',
title: '更新时间'
}]
};
$.table.init(options);
});
const initChildTable = async function(index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
let data = await $.post( prefix + "/childList",{
cargoFrameEpc: row.remark
},(e)=>{
return e
})
data.rows = data.rows.map((val,index)=>{
let locationCode = val.locationCode
if(index !== Math.ceil(data.rows.length/2)-1){
locationCode = ''
}
return{
...val,
locationCode
}
})
var clickRow = null;
const initTable1 = function (row) {
clickRow = row;
//先销毁表格,必须先销毁才能实现动态加载数据
$('#bootstrap-table1').bootstrapTable('destroy');
$('#bootstrap-table1').bootstrapTable({
method: "get", //向服务器请求数据的方式
url: prefix + "/childList?cargoFrameEpc=" + row.remark,
striped: true, //表格显示条纹
pagination: false, //不启动分页
pageSize: 1, //每页显示的记录数
pageNumber: 1, //当前第几页
pageList: [5, 10, 15, 20, 25], //记录数可选列表
striped: true, //显示行间隔色
sortOrder: "asc", //排序方式
sidePagination: "server", //分页方式client客户端分页server服务端分页
queryParamsType: "undefined",
columns: [
{
title: '序号',
align: 'center',
formatter: function (value, row, index) {
// 显示行号
let options = $('#bootstrap-table1').bootstrapTable('getOptions');
return options.pageSize * (options.pageNumber - 1) + index + 1;
}
},
{
field: 'objId',
title: '主键标识',
align: 'center',
visible: false
},
{
field: 'locationCode',
title: '库位编号'
},
{
field: 'cargoFrameEpc',
title: '货筐RFID'
},
{
field: 'waybillNumber',
title: '运单编号'
},
{
field: 'crateTime',
title: '绑定时间'
}
],
onLoadSuccess: function () { //加载成功时执行
//layer.msg("加载成功");
},
onLoadError: function () { //加载失败时执行
layer.msg("加载数据失败", {time: 1500, icon: 2});
}
});
}
$(childTable).bootstrapTable({
data,
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
columns: [
{
field: 'objid',
title: '主键标识',
visible: false
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'cargoFrameEpc',
title: '货筐RFID'
},
{
field: 'waybillNumber',
title: '运单编号'
},
{
field: 'crateTime',
title: '绑定时间'
},
layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({
elem: '#startTime',
type: 'datetime',
trigger: 'click'
});
]
laydate.render({
elem: '#endTime',
type: 'datetime',
trigger: 'click'
});
});
}
</script>
</body>
</html>
</html>

@ -0,0 +1,223 @@
<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('库存台账列表')"/>
</head>
<style>
#bootstrap-table tbody .detail-view td {
background-color: rgba(0, 0, 0, 0.2);
}
#bootstrap-table tbody .detail-view .bootstrap-table .fixed-table-container .fixed-table-body table tbody tr td:nth-child(7n+2) {
border: 1px solid #fff;
border-bottom-color: #cccccc !important;
}
#bootstrap-table tbody .detail-view .bootstrap-table .fixed-table-container .fixed-table-body table tbody tr:last-child td:nth-child(7n+2) {
border-bottom-color: #ddd !important;
}
</style>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>库位名称:</label>
<input type="text" name="locationName"/>
</li>
<li>
<label>库位类别:</label>
<select name="localtionType" th:with="type=${@dict.getType('sys_localtion_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>仓库编号:</label>
<input type="text" name="storeCode"/>
</li>
<li>
<label>库位状态:</label>
<select name="locationStatus" th:with="type=${@dict.getType('sys_location_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:location:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('base:location:edit')}]];
var removeFlag = [[${@permission.hasPermi('base:location:remove')}]];
var localtionTypeDatas = [[${@dict.getType('sys_localtion_type')}]];
var locationStatusDatas = [[${@dict.getType('sys_location_status')}]];
var isFlagDatas = [[${@dict.getType('sys_is_flag')}]];
var prefix = ctx + "base/location";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "库存台账",
detailView: true,
onExpandRow: function (index, row, $detail) {
initChildTable(index, row, $detail);
},
onClickRow: function (e, row) {
let index = $(row[0]).attr('data-index')
let node = $('#bootstrap-table tbody tr[data-index=' + index + '] td a:first-child')[0]
node.click()
},
columns: [
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'locationCode',
title: '库位编号'
},
{
field: 'remark',
title: '货筐RFID'
},
{
field: 'locationName',
title: '库位名称'
},
{
field: 'localtionType',
title: '库位类别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(localtionTypeDatas, value);
}
},
{
field: 'locationDescribe',
title: '库位描述'
},
{
field: 'storeCode',
title: '仓库编号'
},
/*{
field: 'maxAmount',
title: '最大数量'
},*/
{
field: 'usedAmount',
title: '存放数量'
},
/*{
field: 'maxVolume',
title: '最大容积'
},*/
{
field: 'usedVolume',
title: '存放体积'
},
{
field: 'locationStatus',
title: '库位状态',
formatter: function (value, row, index) {
return $.table.selectDictLabel(locationStatusDatas, value);
}
},
{
field: 'updatedTime',
title: '更新时间'
}]
};
$.table.init(options);
});
const initChildTable = async function(index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
let data = await $.post( prefix + "/childList",{
cargoFrameEpc: row.remark
},(e)=>{
return e
})
data.rows = data.rows.map((val,index)=>{
let locationCode = val.locationCode
if(index !== Math.ceil(data.rows.length/2)-1){
locationCode = ''
}
return{
...val,
locationCode
}
})
$(childTable).bootstrapTable({
data,
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
columns: [
{
field: 'objid',
title: '主键标识',
visible: false
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'cargoFrameEpc',
title: '货筐RFID'
},
{
field: 'waybillNumber',
title: '运单编号'
},
{
field: 'crateTime',
title: '绑定时间'
},
]
});
}
</script>
</body>
</html>

@ -33,6 +33,8 @@ public class LedgerInstantBinding extends BaseEntity
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date crateTime;
private String locationCode;
public void setObjid(Long objid)
{
this.objid = objid;
@ -73,6 +75,14 @@ public class LedgerInstantBinding extends BaseEntity
return crateTime;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cargoFrameEpc" column="cargo_frame_epc" />
<result property="waybillNumber" column="waybill_number" />
<result property="crateTime" column="crate_time" />
<result property="locationCode" column="location_code" />
</resultMap>
<sql id="selectLedgerInstantBindingVo">
@ -16,11 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectLedgerInstantBindingList" parameterType="LedgerInstantBinding" resultMap="LedgerInstantBindingResult">
<include refid="selectLedgerInstantBindingVo"/>
select t1.*,t2.location_code
from ledger_instant_binding t1
left join base_location_info t2 on t1.cargo_frame_epc = t2.remark
<where>
<if test="cargoFrameEpc != null and cargoFrameEpc != ''"> and cargo_frame_epc = #{cargoFrameEpc}</if>
<if test="waybillNumber != null and waybillNumber != ''"> and waybill_number = #{waybillNumber}</if>
<if test="params.beginCrateTime != null and params.beginCrateTime != '' and params.endCrateTime != null and params.endCrateTime != ''"> and crate_time between #{params.beginCrateTime} and #{params.endCrateTime}</if>
<if test="cargoFrameEpc != null and cargoFrameEpc != ''"> and t1.cargo_frame_epc = #{cargoFrameEpc}</if>
<if test="waybillNumber != null and waybillNumber != ''"> and t1.waybill_number = #{waybillNumber}</if>
<if test="params.beginCrateTime != null and params.beginCrateTime != '' and params.endCrateTime != null and params.endCrateTime != ''"> and t1.crate_time between #{params.beginCrateTime} and #{params.endCrateTime}</if>
</where>
</select>

Loading…
Cancel
Save