change -库存台账显示样式修改
parent
81e3601e8d
commit
6c95bc911c
@ -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> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||
class="fa fa-refresh"></i> 重置</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>
|
Loading…
Reference in New Issue