Browse Source

修改物料出库时的物料选择页面

lwx_dev
erdanergou 3 years ago
parent
commit
a5f5ac4666
  1. 12
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  2. 142
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html

12
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -63,7 +63,11 @@
} else {
wxScan = wxScan.parent.wx;
}
wxScan.scanQRCode({
var result = "1614903417674964992";//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);
/*wxScan.scanQRCode({
desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
@ -82,7 +86,7 @@
}
});
});*/
});
@ -321,7 +325,7 @@
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['70%', '70%'],
area: ['100%', '100%'],
content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + place.id + '&mcode=' + mcode + '&depositoryId=' + place.did,
end: function () {
let flagForSelect = layui.$("#flagForSelect").val();
@ -409,7 +413,7 @@
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['70%', '70%'],
area: ['100%', '100%'],
content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + 0 + '&mcode=' + mcode + '&depositoryId=' + depository.id,
end: function () {
let flagForSelect = layui.$("#flagForSelect").val();

142
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html

@ -48,37 +48,46 @@
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索
</button>
</div>
</form>
</div>
</form>
</div>
</div>
</div>
<ul class="flow-default" id="LAY_Inventory"></ul>
</div>
<div class="layui-btn-container">
<button class="layui-btn layui-btn-primary select_this" th:each="material,iterStar:${materialList}"
th:value="${material.getCode()}"
th:text="${material.getMname()+','+(material.getVersion() == null ? '' :material.getVersion())}">
<i class="layui-icon layui-icon-down layui-font-12"></i>
</button>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['layer',"form"], function () {
function updateFlow() {
}
function chooseThis() {
}
layui.use(['layer', "form", "flow"], function () {
var $ = layui.jquery,
form = layui.form,
flow = layui.flow,
layer = layui.layer;
let takingPre = 0;
let size = 8;
let mcode = $("#mcode").val();
let depositoryId = $("#depositoryId").val();
let pid = $("#pid").val();
// 给每个按钮添加点击事件
$(".select_this").on("click", function () {
chooseThis = function (code) {
// 获取当前点击物料编码
var code = this.value;
code = String(code);
// 获取当前点击物料名称
if (code !== mcode) {
// 如果点击的不是要出库的物料
@ -93,14 +102,14 @@
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
});
};
form.on('submit(data-search-btn)', function (data) {
var req = {};
data = data.field;
req.depositoryId = $("#depositoryId").val();
req.pid = $("#pid").val();
req.depositoryId = depositoryId;
req.pid = pid;
if (data.mname !== '') {
req.mname = data.mname.trim();
}
@ -110,17 +119,102 @@
if (data.mcode !== '') {
req.mcode = data.mcode.trim();
}
$.ajax({
url: "/material/findInventoryForCompleteOutTask",
type: "post",
data: JSON.stringify(req),
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
console.log(res)
updateFlow(req);
});
flow.load({
elem: '#LAY_Inventory' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result;
let lis = [];
let req = {};
req.depositoryId = depositoryId;
req.pid = pid;
req.page = page;
req.size = size;
$.ajax({
url: "/material/findInventoryForCompleteOutTask",
type: "post",
data: JSON.stringify(req),
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
let brand = result[i].brand;
let brandItem = '<p>' + "物料品牌:" + brand + '</p>';
if (brand === "" || brand === null) {
brandItem = "";
}
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="chooseThis('
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
+ '<p>' + "物料编码:" + result[i].code + '</p>'
+ '<p>' + "物料型号:" + result[i].version + '</p>'
+ brandItem
+ '<p>' + "物料类型:" + result[i].typeName + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
})
}
});
updateFlow = function (req) {
$("#LAY_Inventory").empty();
takingPre = 0;
flow.load({
elem: '#LAY_Inventory' //流加载容器
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result = [];
req.page = page;
req.size = size;
$.ajax({
url: "/material/findInventoryForCompleteOutTask",
type: "post",
data: JSON.stringify(req),
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
let brand = result[i].brand;
let brandItem = '<p>' + "物料品牌:" + brand + '</p>';
if (brand === "" || brand === null) {
brandItem = "";
}
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="chooseThis('
+ result[i].code + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].mname + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+ '<p>' + "物料编码:" + result[i].code + '</p>'
+ '<p>' + "物料型号:" + result[i].version + '</p>'
+ brandItem
+ '<p>' + "物料类型:" + result[i].typeName + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
})
});
};
})
</script>
</body>

Loading…
Cancel
Save