From d215be45e0b8fa3690b20bced5e4d181b0f17aa2 Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期一, 31 五月 2021 11:18:12 +0800
Subject: [PATCH] pda库存库存查询
---
src/main/webapp/views/pda/selectMat.html | 126 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 109 insertions(+), 17 deletions(-)
diff --git a/src/main/webapp/views/pda/selectMat.html b/src/main/webapp/views/pda/selectMat.html
index 41ecdc6..c8c73cb 100644
--- a/src/main/webapp/views/pda/selectMat.html
+++ b/src/main/webapp/views/pda/selectMat.html
@@ -19,6 +19,14 @@
height: 100%;
background-color: #f1f1f1;
padding: 5px;
+ position: relative;
+ }
+
+ /*header {*/
+ /* position: absolute;*/
+ /*}*/
+ main {
+ padding-bottom: 5px;
}
/* 澶撮儴鎼滅储鏍� */
@@ -31,7 +39,7 @@
border-radius: 20px;
height: 30px;
box-shadow: 0 0 3px rgba(0,0,0,.3);
- width: 75%;
+ width: 73%;
padding-left: 15px;
vertical-align: middle;
}
@@ -49,8 +57,10 @@
background-color: #dedede;
}
- /* 涓讳綋鍗$墖 */
- .box-item {
+ /* 涓讳綋 */
+
+ /* 褰掔被鏍囩 */
+ .box-tag-item {
height: 100px;
border-bottom: 1px solid #dedede;
background-color: #fff;
@@ -58,13 +68,42 @@
box-shadow: 0 0 3px rgba(0,0,0,.3);
margin-top: 2px;
}
- .box-item:hover {
+ .box-tag-item:hover {
background-color: #eaeaea;
}
- .box-item-label {
+ .box-tag-item-label {
+ padding: 5px 10px;
+ border-bottom: 1px solid #f6f6f6;
+ }
+ .box-tag-item-content {
font-size: x-large;
font-weight: bold;
- padding: 10px 0 0 20px;
+ padding: 15px 0 0 20px;
+ }
+
+ /* 鍟嗗搧鏍囩 */
+ .box-mat-item {
+ height: 100px;
+ border-bottom: 1px solid #dedede;
+ background-color: #fff;
+ border-radius: 5px;
+ box-shadow: 0 0 3px rgba(0,0,0,.3);
+ margin-top: 2px;
+ }
+ .box-mat-item:hover {
+ background-color: #eaeaea;
+ }
+ .box-mat-item-content {
+ padding: 15px 0 0 20px;
+ }
+ .box-mat-item-content-matnr {
+ font-size: small;
+ font-weight: bold;
+ margin-bottom: 5px;
+ }
+ .box-mat-item-content-maktx {
+ font-size: large;
+
}
</style>
</head>
@@ -72,8 +111,8 @@
<header>
<div class="search-box">
- <input type="text" placeholder="璇疯緭鍏ュ晢鍝佺紪鐮�/鍚嶇О">
- <button>
+ <input id="search-msg" type="text" placeholder="璇疯緭鍏ュ晢鍝佺紪鐮�/鍚嶇О">
+ <button onclick="search()">
<i class="layui-icon"></i>
</button>
</div>
@@ -88,9 +127,45 @@
showTag();
})
- $(document).on('click','.box-item', function () {
+ // 鎼滅储
+ function search(){
+ var condition = $('#search-msg').val();
+ $.ajax({
+ url: baseUrl + "/mat/search/pda/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ condition: condition
+ },
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200) {
+ if (res.data != null && res.data.length > 0) {
+ var tplDom = $("#matTpl");
+ var tpl = tplDom.html();
+ var template = Handlebars.compile(tpl);
+ var html = template(res);
+ $('#main-contain').html(html);
+ } else {
+ $('#main-contain').html('<div style="text-align: center; margin-top: 15px"><span style="font-size: large">鏆傛棤鍟嗗搧</span></div>');
+ }
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/pda";
+ } else {
+ parent.layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ }
+
+ // 褰掔被鐐瑰嚮
+ $(document).on('click','.box-tag-item', function () {
var tagId = $(this).children('input').get(0).value;
showTag(tagId);
+ })
+
+ // 鍟嗗搧鐐瑰嚮
+ $(document).on('click','.box-mat-item', function () {
+ parent.findBySelect($(this).children('input').get(0))
})
// 灞曠ず褰掔被
@@ -105,12 +180,12 @@
success: function (res) {
if (res.code === 200) {
if (res.data != null && res.data.length > 0) {
- console.log(res.data)
var tplDom = $("#tagTpl");
var tpl = tplDom.html();
var template = Handlebars.compile(tpl);
var html = template(res);
$('#main-contain').html(html);
+ toTop();
} else {
var tagId = parentId;
showMat(tagId);
@@ -139,14 +214,14 @@
success: function (res) {
if (res.code === 200) {
if (res.data != null && res.data.length > 0) {
- console.log(res.data)
var tplDom = $("#matTpl");
var tpl = tplDom.html();
var template = Handlebars.compile(tpl);
var html = template(res);
$('#main-contain').html(html);
+ toTop();
} else {
-
+ $('#main-contain').html('<div style="text-align: center; margin-top: 15px"><span style="font-size: large">鏆傛棤鍟嗗搧</span></div>');
}
} else if (res.code === 403) {
top.location.href = baseUrl + "/pda";
@@ -157,21 +232,38 @@
})
}
+ function toTop() {
+ window.scrollTo({
+ left: 0,
+ top: 0,
+ behavior: 'smooth'
+ })
+ }
+
</script>
<script type="text/template" id="tagTpl">
{{#each data}}
- <div class="box-item">
+ <div class="box-tag-item">
<input name="tagId" type="hidden" value="{{this.id}}">
- <div class="box-item-label">{{this.name}}</div>
+ <div class="box-tag-item-label">
+ <span class="layui-badge layui-badge-green pull-right">褰掔被</span>
+ </div>
+ <div class="box-tag-item-content">{{this.name}}</div>
</div>
{{/each}}
</script>
<script type="text/template" id="matTpl">
{{#each data}}
- <div class="box-item">
- <input name="matId" type="hidden" value="{{this.id}}">
- <div class="box-item-label">{{this.maktx}}</div>
+ <div class="box-mat-item">
+ <input name="matnr" type="hidden" value="{{this.matnr}}">
+ <div class="box-tag-item-label">
+ <span class="layui-badge layui-badge-blue pull-right">鍟嗗搧</span>
+ </div>
+ <div class="box-mat-item-content">
+ <div class="box-mat-item-content-matnr">{{this.matnr}}</div>
+ <div class="box-mat-item-content-maktx">{{this.maktx}}</div>
+ </div>
</div>
{{/each}}
</script>
--
Gitblit v1.9.1