Commit 51fb0938 by yyq1988

优化表单

parent 00e888b5
...@@ -249,14 +249,14 @@ $(document).ready(function() { ...@@ -249,14 +249,14 @@ $(document).ready(function() {
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/goods/goods/form/edit?id=" + id); jp.openSaveDialog("编辑货品","${ctx}/warehouse/goods/goods/form/edit?id=" + id, '1200', '800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/goods/goods/form/view?id=" + id); jp.openViewDialog("查看货品","${ctx}/warehouse/goods/goods/form/view?id=" + id, '1200', '800');
} }
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %> <%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left"> <div id="toolbar" class="text-left">
<c:if test="${mode == 'add' || mode == 'edit'}">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a> <a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a> <a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a> <a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
</c:if>
</div> </div>
<table id="detail_table" data-toolbar="#toolbar"></table> <table id="detail_table" data-toolbar="#toolbar"></table>
<script> <script>
...@@ -282,7 +284,7 @@ ...@@ -282,7 +284,7 @@
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" /> <input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
</script> </script>
<script id="remarksTpl" type="text/html"> <script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="4" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea> <textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script> </script>
<script id="scanResultTpl" type="text/html"> <script id="scanResultTpl" type="text/html">
......
...@@ -6,6 +6,33 @@ ...@@ -6,6 +6,33 @@
<meta name="decorator" content="ani"/> <meta name="decorator" content="ani"/>
<link rel="stylesheet" href="${ctxStatic}/common/css/form.css"> <link rel="stylesheet" href="${ctxStatic}/common/css/form.css">
<link rel="stylesheet" href="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css"> <link rel="stylesheet" href="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css">
<style>
.statistic-container{
position: relative;
padding: 45px 15px 15px;
margin: 0 -15px 15px;
border-style: solid;
margin-right: 0;
margin-left: 0;
background-color: #fff;
border-color: #ddd;
border-width: 1px;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.statistic-container:after {
position: absolute;
top: 15px;
left: 15px;
font-size: 12px;
font-weight: 700;
color: #959595;
text-transform: uppercase;
letter-spacing: 1px;
content: "统计信息";
}
</style>
<script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"></script> <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script> <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script>
</head> </head>
...@@ -63,6 +90,11 @@ ...@@ -63,6 +90,11 @@
<%@include file="storageDetail.jsp" %> <%@include file="storageDetail.jsp" %>
</td> </td>
</tr> </tr>
<tr>
<td colspan="4">
<%@include file="storageStatistic.jsp" %>
</td>
</tr>
</table> </table>
</form:form> </form:form>
</div> </div>
...@@ -74,6 +106,12 @@ ...@@ -74,6 +106,12 @@
$(document).ready(function () { $(document).ready(function () {
initTable(); initTable();
if('${mode}' == 'view'){
getDetail();
initStatisticTable();
}
jp.ajaxForm("#inputForm", function (data) { jp.ajaxForm("#inputForm", function (data) {
if (data.success) { if (data.success) {
jp.success(data.msg); jp.success(data.msg);
......
...@@ -262,7 +262,7 @@ $(document).ready(function() { ...@@ -262,7 +262,7 @@ $(document).ready(function() {
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/storage/storage/form/view?id=" + id); jp.openViewDialog("查看入库单","${ctx}/warehouse/storage/storage/form/view?id=" + id, '1200', '800');
} }
...@@ -313,7 +313,6 @@ $(document).ready(function() { ...@@ -313,7 +313,6 @@ $(document).ready(function() {
<th>货架</th> <th>货架</th>
<th>总价</th> <th>总价</th>
<th>数量</th> <th>数量</th>
<th>备注信息</th>
</tr> </tr>
</thead> </thead>
<tbody id="storageChild-{{idx}}-1-List"> <tbody id="storageChild-{{idx}}-1-List">
...@@ -345,8 +344,5 @@ $(document).ready(function() { ...@@ -345,8 +344,5 @@ $(document).ready(function() {
<td> <td>
{{row.num}} {{row.num}}
</td> </td>
<td>
{{row.remarks}}
</td>
</tr>//--> </tr>//-->
</script> </script>
<%--
Created by IntelliJ IDEA.
User: dell
Date: 2023/2/22
Time: 15:27
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div class="statistic-container">
<table id="statisticTable" class="detail-table"></table>
</div>
<script>
function initStatisticTable(){
$("#statisticTable").bootstrapTable({
data: [],
columns:[
{field: 'name', title: '名称', align: 'center'},
{field: 'type.name', title: '类型',align: 'center'},
{field: 'model', title: '型号',align: 'center'},
{field: 'warehouseNames', title: '仓库',align: 'center'},
{field: 'shelvesNames', title: '货架',align: 'center'},
{field: 'sum', title: '总价',align: 'center'},
{field: 'num', title: '数量',align: 'center'}
]
})
}
function getDetail(){
$.get("${ctx}/warehouse/storage/storage/countStorage?id=${storage.id}", function(storage){
var data = storage.countStorageInfoList;
$("#statisticTable").bootstrapTable('append', data);
})
}
</script>
\ No newline at end of file
...@@ -233,14 +233,14 @@ $(document).ready(function() { ...@@ -233,14 +233,14 @@ $(document).ready(function() {
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/warehouse/warehouse/form/edit?id=" + id); jp.openSaveDialog("编辑仓库","${ctx}/warehouse/warehouse/warehouse/form/edit?id=" + id, '800', '600');
} }
function view(id) { function view(id) {
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/warehouse/warehouse/form/view?id=" + id); jp.openViewDialog("查看仓库","${ctx}/warehouse/warehouse/warehouse/form/view?id=" + id, '800', '600');
} }
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment