11 changed files with 3206 additions and 0 deletions
@ -0,0 +1,284 @@ |
|||
|
|||
// 用于扫描条形码或二维码
|
|||
function scanCode(obj) { |
|||
} |
|||
|
|||
|
|||
// 用于计算盘点结果
|
|||
function calculateForLocation(obj) { |
|||
|
|||
} |
|||
|
|||
|
|||
function updateFlowShowForLocation() { |
|||
|
|||
} |
|||
|
|||
|
|||
layui.use(['form', 'step', 'flow', 'inputTag'], function () { |
|||
var $ = layui.$, |
|||
form = layui.form, |
|||
flow = layui.flow, |
|||
inputTag = layui.inputTag, |
|||
dropdown = layui.dropdown, //下拉菜单
|
|||
step = layui.step; |
|||
departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); |
|||
|
|||
let takingPre = 0; |
|||
|
|||
|
|||
let tagData = []; |
|||
let tempData = $("#departmentManagerForLocation").val().split(","); |
|||
$.each(tempData, function (index, item) { |
|||
if (item !== "") { |
|||
tagData.push(item) |
|||
} |
|||
}); |
|||
$("#departmentManagerForLocation").val(""); |
|||
|
|||
|
|||
|
|||
|
|||
let tagLabel1 = inputTag.render({ |
|||
elem: '#departmentManagerForLocation', |
|||
data: tagData,//初始值
|
|||
removeKeyNum: 8,//删除按键编号 默认,BackSpace 键
|
|||
createKeyNum: 13,//创建按键编号 默认,Enter 键
|
|||
onChange: function (data, value, type, index) { |
|||
if (type === "remove") { |
|||
let split = departmentManagerIdForLocation.split(","); |
|||
split.splice(index, 1); |
|||
departmentManagerIdForLocation = split.toString(); |
|||
$("#departmentManagerIdForLocation").val(departmentManagerIdForLocation); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
// 用于打开负责人树形菜单
|
|||
$("#selectdepartmentManagerForLocation").on('click', function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '弹窗内容', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层
|
|||
area: ['70%', '70%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: '/selectManager?type=Location', |
|||
end: function () { |
|||
departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); |
|||
tagLabel1.createItem(); |
|||
}, |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
// 扫码盘点位置
|
|||
scanCode = function () { |
|||
parent.wx.scanQRCode({ |
|||
desc: 'scanQRCode desc', |
|||
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
|
|||
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
|
|||
success: function (res) { |
|||
// 回调
|
|||
var result = res.resultStr;//当needResult为1时返回处理结果
|
|||
var req = {}; |
|||
req.qrCode = result; |
|||
req.codeFlag = 2; |
|||
$.ajax({ |
|||
url: "/place/qywxApplicationInScanQrCode", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify(req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
var data = d.data; |
|||
var flag = data["flag"]; |
|||
if (flag === 0) { |
|||
// 如果没有获取到位置
|
|||
layer.msg("并未查询到对应位置,请重新扫描", { |
|||
icon: 0, |
|||
time: 1000 |
|||
}, function () { |
|||
depositoryId = -1; |
|||
placeId = -1; |
|||
|
|||
}); |
|||
} else if (flag === 1) { |
|||
// 如果获取到的是库位
|
|||
var place = data["place"]; |
|||
$("#placeId").val(place.id); |
|||
$("#openSonByDepository").val(place.depositoryName); |
|||
$("#depositoryId").val(place.did); |
|||
|
|||
depositoryId = place.did; |
|||
placeId = place.id; |
|||
} else if (flag === 2) { |
|||
// 如果获取到的是仓库
|
|||
var depository = data["depository"]; |
|||
$("#placeId").val("0"); |
|||
$("#openSonByDepository").val(depository.dname); |
|||
$("#depositoryId").val(depository.id); |
|||
|
|||
depositoryId = depository.id; |
|||
placeId = "0"; |
|||
|
|||
} |
|||
updateFlowShowForLocation(); |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
}; |
|||
|
|||
|
|||
|
|||
|
|||
// 用于计算盘点结果
|
|||
calculateForLocation = function (obj) { |
|||
let oldInventory = Number(obj.tr[0].childNodes[6].childNodes[0].innerText); |
|||
let nowInventory = Number(obj.value); |
|||
let number = 0; |
|||
let takingResult = ''; |
|||
let takingResultString = ''; |
|||
let req = {}; |
|||
if ((oldInventory) > (nowInventory)) { |
|||
number = oldInventory - nowInventory; |
|||
takingResult = "Inventory_down"; |
|||
takingResultString = "盘亏"; |
|||
} else if ((oldInventory) < (nowInventory)) { |
|||
number = nowInventory - oldInventory; |
|||
takingResult = "Inventory_up"; |
|||
takingResultString = "盘盈"; |
|||
} else { |
|||
takingResult = "Inventory_normal"; |
|||
takingResultString = "正常"; |
|||
} |
|||
obj.tr[0].childNodes[8].childNodes[0].innerText = takingResultString; |
|||
obj.tr[0].childNodes[9].childNodes[0].innerText = number; |
|||
obj.update({takingResult: takingResult}); |
|||
obj.update({takingInventory: number}); |
|||
req.number = number + ""; |
|||
req.takingResult = takingResult; |
|||
req.takingResultString = takingResultString; |
|||
req.id = obj.data.id + ""; |
|||
req.unit = obj.tr[0].childNodes[5].childNodes[0].innerText; |
|||
req.oldInventory = oldInventory + ""; |
|||
$.ajax({ |
|||
url: "/stockTaking/temporaryStorageForTakingResult", |
|||
dataType: "json", |
|||
data: JSON.stringify(req), |
|||
type: "POST", |
|||
contentType: "application/json;charset=utf-8" |
|||
}); |
|||
}; |
|||
|
|||
|
|||
// 用于打开仓库树形菜单
|
|||
$('#openSonByDepository').on('click', function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '弹窗内容', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层
|
|||
area: ['70%', '70%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: '/selectDepository?type=2', |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
}, |
|||
end: function () { |
|||
var nowDepositoryId = $("#depositoryId").val(); |
|||
var nowPlaceId = $("#placeId").val(); |
|||
if (nowDepositoryId !== depositoryId || nowPlaceId !== placeId) { |
|||
// 如果重新选择盘点位置
|
|||
var nowDepositoryName = $("#openSonByDepository").val(); |
|||
$("#form1")[0].reset(); |
|||
$("#depositoryId").val(nowDepositoryId); |
|||
$("#placeId").val(nowPlaceId); |
|||
$("#openSonByDepository").val(nowDepositoryName); |
|||
form.render(); |
|||
} |
|||
if (nowDepositoryId !== null && nowDepositoryId !== "") { |
|||
depositoryId = nowDepositoryId; |
|||
placeId = nowPlaceId; |
|||
updateFlowShowForLocation(); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
|
|||
updateFlowShowForLocation = function () { |
|||
$("#LAY_FlowForLocation").empty(); |
|||
takingPre = 0; |
|||
let req = {}; |
|||
req.depositoryId = depositoryId; |
|||
req.placeId = placeId; |
|||
req.size = size; |
|||
flow.load({ |
|||
elem: '#LAY_FlowForLocation' //流加载容器
|
|||
, done: function (page, next) { //执行下一页的回调
|
|||
let result; |
|||
let lis = []; |
|||
req.page = page; |
|||
$.ajax({ |
|||
url: '/material/findInventoryForStockTaking', |
|||
data: req, |
|||
type: 'get', |
|||
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 splitInventory = result[i].splitInventory; |
|||
let keys = Object.keys(splitInventory); |
|||
let InventoryItem = ""; |
|||
for (let j = 0; j < keys.length; j++) { |
|||
let key = keys[j]; |
|||
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; |
|||
InventoryItem += item; |
|||
} |
|||
let brandItem ='<p>' + "物料品牌:"+result[i].mbrand + '</p>'; |
|||
if(result[i].mbrand === ""){ |
|||
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" iid='+result[i].id+' pid='+result[i].pid+' onclick="showDetail(this)">' + |
|||
'<div class="layui-card-header"><h2>' + "物料名称:" + result[i].mname + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+'<p>' + "物料编码:" + result[i].mcode + '</p>' |
|||
+'<p>' + "物料型号:" + result[i].version + '</p>' |
|||
+ brandItem |
|||
+'<p>' + "所处库位:" + result[i].kingdeecode + '</p>' |
|||
+ InventoryItem |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|||
next(lis.join(''), takingPre < res.count); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
}); |
|||
@ -0,0 +1,481 @@ |
|||
// 用于扫描条形码或二维码
|
|||
function scanCode(obj) { |
|||
} |
|||
|
|||
// 用于加载物料选择菜单
|
|||
function selectMaterial() { |
|||
|
|||
} |
|||
|
|||
// 用于通过物料名称获取物料
|
|||
function selectMaterialByName() { |
|||
|
|||
} |
|||
|
|||
// 用于编码查询
|
|||
function selectCode(obj) { |
|||
} |
|||
|
|||
|
|||
// 用于扫描物料码
|
|||
function scanCodeForMaterial() { |
|||
|
|||
} |
|||
|
|||
// 用于计算盘点结果
|
|||
function calculateForMaterial(obj) { |
|||
|
|||
} |
|||
|
|||
|
|||
function updateFlowShowForMaterial() { |
|||
|
|||
} |
|||
|
|||
// 用于展示具体库存数据
|
|||
function showDetail() { |
|||
|
|||
} |
|||
|
|||
|
|||
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
|||
var $ = layui.$, |
|||
form = layui.form, |
|||
table = layui.table, |
|||
inputTag = layui.inputTag, |
|||
dropdown = layui.dropdown, //下拉菜单
|
|||
flow = layui.flow; |
|||
departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val(); |
|||
|
|||
let takingPre = 0; |
|||
|
|||
|
|||
let tagData = []; |
|||
let tempData = $("#departmentManagerForMaterial").val().split(","); |
|||
$.each(tempData, function (index, item) { |
|||
if (item !== "") { |
|||
tagData.push(item) |
|||
} |
|||
}); |
|||
$("#departmentManagerForMaterial").val(""); |
|||
|
|||
|
|||
let tagLabel = inputTag.render({ |
|||
elem: '#departmentManagerForMaterial', |
|||
data: tagData,//初始值
|
|||
removeKeyNum: 8,//删除按键编号 默认,BackSpace 键
|
|||
createKeyNum: 13,//创建按键编号 默认,Enter 键
|
|||
onChange: function (data, value, type, index) { |
|||
if (type === "remove") { |
|||
let split = departmentManagerIdForMaterial.split(","); |
|||
split.splice(index, 1); |
|||
departmentManagerIdForMaterial = split.toString(); |
|||
$("#departmentManagerIdForMaterial").val(departmentManagerIdForMaterial); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
updateFlowShowForMaterial = function () { |
|||
$("#LAY_FlowForMaterial").empty(); |
|||
takingPre = 0; |
|||
let req = {}; |
|||
let mid = $("#mid").val(); |
|||
req.mid = mid; |
|||
req.size = size; |
|||
if(mid !== ""){ |
|||
flow.load({ |
|||
elem: '#LAY_FlowForMaterial' //流加载容器
|
|||
, done: function (page, next) { //执行下一页的回调
|
|||
let result; |
|||
let lis = []; |
|||
req.page = page; |
|||
$.ajax({ |
|||
url: '/material/findMaterialByConditionForStockTaking', |
|||
data: req, |
|||
type: 'get', |
|||
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 splitInventory = result[i].splitInventory; |
|||
let keys = Object.keys(splitInventory); |
|||
let InventoryItem = ""; |
|||
for (let j = 0; j < keys.length; j++) { |
|||
let key = keys[j]; |
|||
let item = '<p>' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '</p>'; |
|||
InventoryItem += item; |
|||
} |
|||
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" iid='+result[i].id+' pid='+result[i].pid+' onclick="showDetail(this)">' + |
|||
'<div class="layui-card-header"><h2>' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+ InventoryItem |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|||
next(lis.join(''), takingPre < res.count); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}; |
|||
|
|||
|
|||
// 用于打开负责人树形菜单
|
|||
$("#selectdepartmentManagerForMaterial").on('click', function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '弹窗内容', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层
|
|||
area: ['70%', '70%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: '/selectManager?type=Material', |
|||
end: function () { |
|||
departmentManagerIdForMaterial = $("#departmentManagerIdForMaterial").val(); |
|||
tagLabel.createItem(); |
|||
}, |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
|
|||
table.on('edit(currentTableFilterForMaterial)', function (obj) { |
|||
obj.update({stockTakingQuantity: obj.value});//修改当前行数据
|
|||
calculateForMaterial(obj); |
|||
}); |
|||
// 用于监听下拉菜单
|
|||
table.on('tool(currentTableFilterForMaterial)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
|||
var data = obj.data //获得当前行数据
|
|||
, layEvent = obj.event; //获得 lay-event 对应的值
|
|||
if (layEvent === 'more') { |
|||
let splitInfoList = obj.data.splitInfoList; |
|||
if (splitInfoList.length > 0) { |
|||
let dropDownDataList = []; |
|||
for (var i = 0; i < splitInfoList.length; i++) { |
|||
let dropDownData = {}; |
|||
dropDownData.title = splitInfoList[i].newUnit; |
|||
dropDownData.id = obj.data.id; |
|||
dropDownDataList.push(dropDownData); |
|||
} |
|||
dropdown.render({ |
|||
elem: this //触发事件的 DOM 对象
|
|||
, show: true //外部事件触发即显示
|
|||
, data: dropDownDataList |
|||
, click: function (unit) { |
|||
this.elem[0].childNodes[0].data = unit.title; |
|||
obj.tr[0].childNodes[7].childNodes[0].innerText = obj.data.splitInventory[unit.title]; |
|||
} |
|||
, align: 'right' //右对齐弹出(v2.6.8 新增)
|
|||
, style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式
|
|||
}) |
|||
} |
|||
//下拉菜单
|
|||
|
|||
} |
|||
}); |
|||
|
|||
// 用于计算盘点结果
|
|||
calculateForMaterial = function (obj) { |
|||
let oldInventory = Number(obj.tr[0].childNodes[7].childNodes[0].innerText); |
|||
let nowInventory = Number(obj.value); |
|||
let number = 0; |
|||
let takingResult = ''; |
|||
let takingResultString = ''; |
|||
let req = {}; |
|||
if ((oldInventory) > (nowInventory)) { |
|||
number = oldInventory - nowInventory; |
|||
takingResult = "Inventory_down"; |
|||
takingResultString = "盘亏"; |
|||
} else if ((oldInventory) < (nowInventory)) { |
|||
number = nowInventory - oldInventory; |
|||
takingResult = "Inventory_up"; |
|||
takingResultString = "盘盈"; |
|||
} else { |
|||
takingResult = "Inventory_normal"; |
|||
takingResultString = "正常"; |
|||
} |
|||
obj.tr[0].childNodes[9].childNodes[0].innerText = takingResultString; |
|||
obj.tr[0].childNodes[10].childNodes[0].innerText = number; |
|||
obj.update({takingResult: takingResult}); |
|||
obj.update({takingInventory: number}); |
|||
req.number = number + ""; |
|||
req.takingResult = takingResult; |
|||
req.takingResultString = takingResultString; |
|||
req.id = obj.data.id + ""; |
|||
req.unit = obj.tr[0].childNodes[6].childNodes[0].innerText; |
|||
req.oldInventory = oldInventory + ""; |
|||
$.ajax({ |
|||
url: "/stockTaking/temporaryStorageForTakingResult", |
|||
dataType: "json", |
|||
data: JSON.stringify(req), |
|||
type: "POST", |
|||
contentType: "application/json;charset=utf-8" |
|||
}); |
|||
}; |
|||
|
|||
// 用于通过物料名称获取物料
|
|||
selectMaterialByName = function (obj) { |
|||
// 输入code
|
|||
var data = obj.value; |
|||
var req = {}; |
|||
data = data.split(",")[0]; |
|||
if (data !== "") { |
|||
req.mname = data; |
|||
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|||
$.ajax({ |
|||
url: "/material/findMaterialByCondition", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify(req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
if (d.count > 1) { |
|||
layer.msg("请点击右侧搜索确定物品",{ |
|||
icon:0, |
|||
time:1000 |
|||
},function () { |
|||
$("#mname").val(""); |
|||
$("#mid").val(""); |
|||
$("#code").val(""); |
|||
$("#version").val(""); |
|||
$("#mtype").val(""); |
|||
$("#texture").val(""); |
|||
$("#brand").val(""); |
|||
layer.close(loading2); |
|||
}); |
|||
|
|||
return false; |
|||
} else if (d.count === 0) { |
|||
layer.msg("没有该物品,请确认输入是否正确",{ |
|||
icon:0, |
|||
time:1000 |
|||
},function () { |
|||
$("#mname").val(""); |
|||
$("#mid").val(""); |
|||
$("#code").val(""); |
|||
$("#version").val(""); |
|||
$("#mtype").val(""); |
|||
$("#texture").val(""); |
|||
$("#brand").val(""); |
|||
layer.close(loading2); |
|||
}); |
|||
return false; |
|||
} else { |
|||
var material = d.data[0]; |
|||
$("#mname").val(material.mname); |
|||
$("#mid").val(material.mid); |
|||
$("#code").val(material.code); |
|||
$("#version").val(material.version); |
|||
$("#mtype").val(material.typeName); |
|||
$("#texture").val(material.texture); |
|||
$("#brand").val(material.brand); |
|||
form.render(); |
|||
updateFlowShowForMaterial(); |
|||
layer.close(loading2); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}; |
|||
|
|||
|
|||
// 用于实现点击搜索按钮
|
|||
selectMaterial = function (obj) { |
|||
var mname = $("#mname").val(); |
|||
mname = mname.split(",")[0]; |
|||
layer.open({ |
|||
type: 2, |
|||
title: '弹窗内容', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层
|
|||
area: ['70%', '70%'], |
|||
content: '/selectMaterial?mname=' + mname + '&type=2', |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
}, |
|||
end: function () { |
|||
let mid = $("#mid").val(); |
|||
if (mid !== "") { |
|||
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|||
$.ajax({ |
|||
url: "/material/findMatrialById?mid=" + mid + "&type=out", |
|||
type: "get", |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
var material = d.data.materialById; |
|||
$("#mid").val(material.mid); |
|||
$("#mname").val(material.mname); |
|||
$("#code").val(material.code); |
|||
$("#version").val(material.version); |
|||
$("#mtype").val(material.typeName); |
|||
$("#texture").val(material.texture); |
|||
$("#brand").val(material.brand); |
|||
layer.close(loading2); |
|||
updateFlowShowForMaterial(); |
|||
form.render(); |
|||
} |
|||
}); |
|||
|
|||
} |
|||
else{ |
|||
updateFlowShowForMaterial() |
|||
} |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
// 用于实现通过编码查询物料
|
|||
selectCode = function (obj) { |
|||
// 输入code
|
|||
var code = obj.value; |
|||
var req = {}; |
|||
req.code = code; |
|||
req.type = "out"; |
|||
if (code !== "") { |
|||
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|||
$.ajax({ |
|||
url: "/material/findMatrialByCode", |
|||
type: "get", |
|||
dataType: 'json', |
|||
data: (req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
var d = d.data; |
|||
if (d == null) { |
|||
layer.msg("仓库中暂无该物料", { |
|||
icon: 0, |
|||
time: 1000 |
|||
}, function () { |
|||
$("#mname").val(""); |
|||
$("#mid").val(""); |
|||
$("#code").val(""); |
|||
$("#version").val(""); |
|||
$("#mtype").val(""); |
|||
$("#texture").val(""); |
|||
$("#brand").val(""); |
|||
updateFlowShowForMaterial(); |
|||
layer.close(loading2); |
|||
}); |
|||
|
|||
} else { |
|||
$("#mname").val(d.mname); |
|||
$("#mid").val(d.mid); |
|||
$("#version").val(d.version); |
|||
$("#mtype").val(d.typeName); |
|||
$("#texture").val(d.texture); |
|||
$("#brand").val(d.brand); |
|||
form.render(); |
|||
updateFlowShowForMaterial(); |
|||
layer.close(loading2); |
|||
|
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}; |
|||
|
|||
|
|||
scanCodeForMaterial = function () { |
|||
let wxScan = parent; |
|||
|
|||
if (wxScan.wx === undefined) { |
|||
wxScan = wxScan.parent.wx; |
|||
} else { |
|||
wxScan = wxScan.wx; |
|||
} |
|||
wxScan.scanQRCode({ |
|||
desc: 'scanQRCode desc', |
|||
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
|
|||
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
|
|||
success: function (res) { |
|||
// 回调
|
|||
var result = res.resultStr;//当needResult为1时返回处理结果
|
|||
var req = {}; |
|||
req.qrCode = result; |
|||
req.codeFlag = 2; |
|||
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|||
$.ajax({ |
|||
url: "/material/qywxApplicationOutScanQrCode", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify(req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
var data = d.data; |
|||
if (data === null) { |
|||
layer.msg("对于编码:" + result + ",并未发现仓库中存在对应的物料", { |
|||
icon: 0, |
|||
time: 1000 //0.5秒关闭(如果不配置,默认是3秒)
|
|||
}, function () { |
|||
$("#mname").val(""); |
|||
$("#mid").val(""); |
|||
$("#code").val(""); |
|||
$("#version").val(""); |
|||
$("#mtype").val(""); |
|||
$("#texture").val(""); |
|||
$("#brand").val(""); |
|||
updateFlowShowForMaterial(); |
|||
layer.close(loading2); |
|||
}) |
|||
} else { |
|||
$("#mname").val(data.mname); |
|||
$("#mid").val(data.id); |
|||
$("#code").val(data.code); |
|||
$("#version").val(data.version); |
|||
$("#mtype").val(data.typeName); |
|||
$("#texture").val(data.texture); |
|||
$("#brand").val(data.brand); |
|||
updateFlowShowForMaterial(); |
|||
layer.close(loading2); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
}; |
|||
|
|||
showDetail = function (obj) { |
|||
let pid = $(obj).attr("pid"); |
|||
let iid = $(obj).attr("iid"); |
|||
layer.open({ |
|||
type: 2, |
|||
title: '盘点详情', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层
|
|||
area: ['100%', '100%'], |
|||
content: '/stockTakingInfoForInventory?id=' + iid + '&pid='+pid, |
|||
move: '.layui-layer-title', |
|||
fixed: false |
|||
}) |
|||
} |
|||
|
|||
|
|||
}); |
|||
@ -0,0 +1,358 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>layui</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
</head> |
|||
<body> |
|||
<div class="layuimini-container"> |
|||
<div class="layui-row"> |
|||
<div class="layui-col-md8"> |
|||
<div class="layui-tab" lay-filter="roleSet"> |
|||
<ul class="layui-tab-title"> |
|||
<li class="layui-this" tabType="person">人员</li> |
|||
<li tabType="post">岗位</li> |
|||
</ul> |
|||
<div class="layui-tab-content"> |
|||
<div class="layui-tab-item layui-show"> |
|||
<form class="layui-form layui-form-pane" action=""> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">人员姓名</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="name" autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">人员工号</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="number" autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit |
|||
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<table class="layui-hide" id="currentTableForUser" |
|||
lay-filter="currentTableFilterForUser"></table> |
|||
</div> |
|||
<div class="layui-tab-item"> |
|||
<div id="postTree" class="demo-tree"></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-col-md4"> |
|||
<div id="depositoryTree" class="demo-tree"></div> |
|||
<button type="button" class="layui-btn layui-btn-primary layui-border-blue" onclick="Impower()">授权</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|||
|
|||
<script> |
|||
|
|||
|
|||
function Impower() { |
|||
|
|||
} |
|||
|
|||
// 用于标志是否为第一次提交 |
|||
let flagForForm = false; |
|||
layui.use(['form', 'layer', 'tree', 'element', 'table'], function () { |
|||
var $ = layui.jquery, |
|||
form = layui.form, |
|||
tree = layui.tree, |
|||
element = layui.element, |
|||
table = layui.table, |
|||
layer = layui.layer; |
|||
|
|||
|
|||
let tabType = "person"; |
|||
|
|||
let depositoryTree; |
|||
let postTree; |
|||
element.on('tab(roleSet)', function (data) { |
|||
tabType = $(this).attr("tabType"); |
|||
if (tabType === "post") { |
|||
$.ajax({ |
|||
url: "/company/getOrgAndPostThree", |
|||
type: 'get', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
beforeSend: function () { |
|||
}, |
|||
success: function (d) { |
|||
var data2 = d.data; |
|||
postTree.reload({ |
|||
data: data2 |
|||
}); |
|||
}, |
|||
|
|||
}); |
|||
} else { |
|||
table.reload('currentTableForUser', { |
|||
url: '/sys/findUsers', |
|||
page: { |
|||
curr: 1 |
|||
}, |
|||
}, 'data'); |
|||
} |
|||
|
|||
}); |
|||
|
|||
table.render({ |
|||
elem: '#currentTableForUser', |
|||
url: '/sys/findUsers', |
|||
method: "POST", |
|||
parseData: function (res) { //res 即为原始返回的数据 |
|||
return { |
|||
"status": res.status, //解析接口状态 |
|||
"message": res.statusInfo.message, //解析提示文本 |
|||
"count": res.count, //解析数据长度 |
|||
"data": res.data //解析数据列表 |
|||
}; |
|||
}, |
|||
height: 'full-255',//固定高度-即固定表头固定第一行首行 |
|||
request: { |
|||
pageName: 'page', //页码的参数名称,默认:page |
|||
limitName: 'size' //每页数据量的参数名,默认:limit |
|||
}, |
|||
response: { |
|||
statusName: 'status' //规定数据状态的字段名称,默认:code |
|||
, statusCode: 200 //规定成功的状态码,默认:0 |
|||
, msgName: 'message' //规定状态信息的字段名称,默认:msg |
|||
, countName: 'count' //规定数据总数的字段名称,默认:count |
|||
, dataName: 'data' //规定数据列表的字段名称,默认:data |
|||
}, |
|||
cols: [ |
|||
[ |
|||
{type: "checkbox", width: 50}, |
|||
{field: 'number', width: 100, title: '工号', sort: true}, |
|||
{field: 'name', width: 100, title: '姓名'}, |
|||
{ |
|||
field: 'gender', width: 80, title: '性别', templet: function (d) { |
|||
if (d.gender === 1) { |
|||
return "男性"; |
|||
} else if (d.gender === 2) { |
|||
return "女性"; |
|||
} else if (d.gender === 3) { |
|||
return "中性"; |
|||
} else { |
|||
return ""; |
|||
} |
|||
} |
|||
}, |
|||
{field: 'companyname', width: 200, title: '公司名称'}, |
|||
{field: 'maindeparmentname', width: 200, title: '主部门'}, |
|||
{field: 'sunmaindeparmentname', width: 200, title: '岗位'}, |
|||
{field: 'workpostname', width: 200, title: '工段'}, |
|||
{field: 'positionname', width: 200, title: '职位'} |
|||
] |
|||
], |
|||
limits: [10, 15, 20, 25, 50, 100], |
|||
limit: 10, |
|||
page: true, |
|||
skin: 'line', |
|||
}); |
|||
|
|||
|
|||
table.on('row(currentTableFilterForUser)', function (obj) { |
|||
let data = obj.data; //得到当前行数据 |
|||
$.ajax({ |
|||
url: "/repository/findWarehouseVisiblePermission", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify({"type": "person", "uid": data.id}), |
|||
success: function (res) { |
|||
let data = res.data; |
|||
depositoryTree.reload(); |
|||
tree.setChecked('depositoryTree', data); |
|||
|
|||
} |
|||
}) |
|||
}); |
|||
|
|||
form.on('submit(data-search-btn)', function (data) { |
|||
data = data.field; |
|||
let req = {}; |
|||
if (data.name !== '') { |
|||
req.name = data.name; |
|||
} |
|||
if (data.number !== '') { |
|||
req.number = data.number; |
|||
} |
|||
//执行搜索重载 |
|||
table.reload('currentTableForUser', { |
|||
url: '/sys/findUsers', |
|||
page: { |
|||
curr: 1 |
|||
}, |
|||
where: req |
|||
}, 'data'); |
|||
return false; |
|||
}); |
|||
|
|||
|
|||
depositoryTree = tree.render({ |
|||
elem: '#depositoryTree' |
|||
, id: "depositoryTree" |
|||
, showCheckbox: true //是否显示复选框 |
|||
, data: [] |
|||
}); |
|||
$.ajax({ |
|||
url: "/repository/treeMenusOnlyDepository", |
|||
type: 'get', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
beforeSend: function () { |
|||
}, |
|||
success: function (d) { |
|||
depositoryTree.reload({ |
|||
data: d.data |
|||
}); |
|||
}, |
|||
|
|||
}); |
|||
|
|||
postTree = tree.render({ |
|||
elem: '#postTree' |
|||
, id: "postTree" |
|||
, showCheckbox: true //是否显示复选框 |
|||
, data: [] |
|||
, click: function (obj) { |
|||
let data = obj.data; //得到当前点击的节点数据 |
|||
let elem = obj.elem; |
|||
if ("-1" === data.orgid) { |
|||
// 如果点击的是岗位 |
|||
let postId = data.id; // 岗位id |
|||
$.ajax({ |
|||
url: "/repository/findWarehouseVisiblePermission", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify({"type": "post", "uid": postId}), |
|||
success: function (res) { |
|||
let data = res.data; |
|||
depositoryTree.reload(); |
|||
tree.setChecked('depositoryTree', data); |
|||
tree.setChecked('postTree', [postId]) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
Impower = function () { |
|||
let treeData = tree.getChecked('depositoryTree'); |
|||
// 获取选中的Id |
|||
let userIds = []; |
|||
if (tabType === "person") { |
|||
let checkUserData = table.checkStatus('currentTableForUser').data; |
|||
for (let i = 0, len = checkUserData.length; i < len; i++) { |
|||
userIds.push(checkUserData[i].id); |
|||
} |
|||
} else { |
|||
userIds = getAllTreeId(tree.getChecked('postTree')); |
|||
} |
|||
// 获取选中的仓库树id |
|||
let allTreeId = getAllTreeId(treeData); |
|||
if (userIds.length > 0) { |
|||
if (!flagForForm) { |
|||
flagForForm = true; |
|||
let req = {}; |
|||
req.userIds = userIds; |
|||
req.depositoryIds = allTreeId; |
|||
req.type = tabType; |
|||
req.count = userIds.length * allTreeId.length; |
|||
$.ajax({ |
|||
url: "/repository/setWarehouseVisiblePermission", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify(req), |
|||
beforeSend: function () { |
|||
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|||
}, |
|||
success: function (res) { |
|||
layer.close(this.layerIndex); |
|||
if (res.status >= 300) { |
|||
layer.msg(res.statusInfo.message, { |
|||
icon: 5, |
|||
time: 1000 |
|||
}, function () { |
|||
location.reload(); |
|||
});//失败的表情 |
|||
flagForForm = false; |
|||
} else { |
|||
layer.msg("设置成功!", { |
|||
icon: 6,//成功的表情 |
|||
time: 1000 |
|||
}, //1秒关闭(如果不配置,默认是3秒) |
|||
function () { |
|||
//do something |
|||
location.reload(); |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
} else { |
|||
layer.msg("请选中赋权岗位或人员", { |
|||
icon: 5, |
|||
time: 1000 |
|||
}) |
|||
} |
|||
|
|||
|
|||
}; |
|||
|
|||
|
|||
/** |
|||
* 用于获取选中树的id |
|||
* @param data |
|||
*/ |
|||
function getAllTreeId(data) { |
|||
// 用于存储id |
|||
let idList = []; |
|||
for (let i = 0; i < data.length; i++) { |
|||
let temp = data[i]; |
|||
if (temp.orgid !== undefined) { |
|||
if (temp.orgid === "-1") { |
|||
idList.push(temp.id); |
|||
} |
|||
} else { |
|||
if (temp.children.length === 0) { |
|||
// 如果是底层仓库 |
|||
idList.push(temp.id); |
|||
} |
|||
} |
|||
if (temp.children !== null && temp.children !== undefined && temp.children.length > 0) { |
|||
// 如果存在子树 |
|||
idList.push(...getAllTreeId(temp.children)); |
|||
} |
|||
} |
|||
return idList; |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,199 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>layui</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
</head> |
|||
<body> |
|||
<div class="layuimini-container"> |
|||
<div class="layuimini-main"> |
|||
|
|||
<div class="layui-collapse"> |
|||
<div class="layui-colla-item"> |
|||
<h2 class="layui-colla-title">搜索</h2> |
|||
<div class="layui-colla-content"> |
|||
<div style="margin: 10px 10px 10px 10px"> |
|||
<form class="layui-form layui-form-pane" action=""> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">标题</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" class="layui-input" id="title" name="title" |
|||
autocomplete="off"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">发布日期</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="startDate" id="startDate" placeholder="请选择开始日期" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
<div class="layui-form-mid">-</div> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="endDate" id="endDate" placeholder="请选择开始日期" |
|||
autocomplete="off" |
|||
class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">状态</label> |
|||
<div class="layui-input-inline"> |
|||
<select name="state"> |
|||
<option value="">请选择状态</option> |
|||
<option value="1">启用</option> |
|||
<option value="2">禁用</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit |
|||
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<ul class="flow-default" id="LAY_notice"></ul> |
|||
|
|||
</div> |
|||
</div> |
|||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|||
<script> |
|||
layui.use(['form', 'flow', 'laydate'], function () { |
|||
var $ = layui.jquery, |
|||
form = layui.form, |
|||
laydate = layui.laydate, |
|||
flow = layui.flow; |
|||
|
|||
let takingPre = 0; |
|||
let size = 8; |
|||
|
|||
laydate.render({ |
|||
elem: '#startDate' |
|||
}); |
|||
|
|||
laydate.render({ |
|||
elem: '#endDate' |
|||
}); |
|||
|
|||
flow.load({ |
|||
elem: '#LAY_notice' //流加载容器 |
|||
, done: function (page, next) { //执行下一页的回调 |
|||
let result; |
|||
let lis = []; |
|||
$.get('/notice/findAllNotices?page=' + page + '&size=' + size, function (res) { |
|||
result = res.data; |
|||
lis.push("<div class='clearfix'>"); |
|||
for (let i = 0; i < result.length; i++) { |
|||
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="showDetail(' |
|||
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "标题:"+result[i].title + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+ '<p>' + "内容:"+result[i].content + '</p>' |
|||
+ '<p>' +"发布人:"+ result[i].userName + '</p>' |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|||
next(lis.join(''), takingPre < res.count); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
updateFlow = function (req) { |
|||
$("#LAY_material").empty(); |
|||
takingPre = 0; |
|||
flow.load({ |
|||
elem: '#LAY_material' //流加载容器 |
|||
, done: function (page, next) { //执行下一页的回调 |
|||
let result; |
|||
let lis = []; |
|||
req.page = page; |
|||
req.size = size; |
|||
$.ajax({ |
|||
url: "/material/material", |
|||
type: "get", |
|||
data: 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++) { |
|||
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="showDetail(' |
|||
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "标题:"+result[i].title + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+ '<p>' + "内容:"+result[i].content + '</p>' |
|||
+ '<p>' +"发布人:"+ result[i].userName + '</p>' |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|||
next(lis.join(''), takingPre < res.count); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
|
|||
// 监听搜索操作 |
|||
form.on('submit(data-search-btn)', function (data) { |
|||
var req = {}; |
|||
data = data.field; |
|||
req.type = 1; |
|||
if (data.title !== '') { |
|||
req.title = data.title; |
|||
} |
|||
if (data.state !== '') { |
|||
req.state = data.state; |
|||
} |
|||
if (data.startDate !== '') { |
|||
req.startDate = data.startDate; |
|||
} |
|||
if (data.endDate !== '') { |
|||
req.endDate = data.endDate; |
|||
} |
|||
//执行搜索重载 |
|||
updateFlow(req); |
|||
return false; |
|||
}); |
|||
|
|||
|
|||
showDetail = function(data){ |
|||
let req = {}; |
|||
var index = layer.open({ |
|||
title: '公告详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/noticeView?id=' + data, |
|||
}); |
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
return false; |
|||
} |
|||
|
|||
|
|||
}) |
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,197 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>layui</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
</head> |
|||
<body> |
|||
<div class="layuimini-container"> |
|||
<div class="layuimini-main"> |
|||
|
|||
|
|||
<div class="layui-collapse"> |
|||
<div class="layui-colla-item"> |
|||
<h2 class="layui-colla-title">搜索</h2> |
|||
<div class="layui-colla-content"> |
|||
<div style="margin: 10px 10px 10px 10px"> |
|||
<form class="layui-form layui-form-pane" action=""> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">标题</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" class="layui-input" id="title" name="title" |
|||
autocomplete="off"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">发布日期</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="startDate" id="startDate" placeholder="请选择开始日期" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
<div class="layui-form-mid">-</div> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="endDate" id="endDate" placeholder="请选择开始日期" |
|||
autocomplete="off" |
|||
class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<label class="layui-form-label">状态</label> |
|||
<div class="layui-input-inline"> |
|||
<select name="state"> |
|||
<option value="">请选择状态</option> |
|||
<option value="1">启用</option> |
|||
<option value="2">禁用</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit |
|||
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<ul class="flow-default" id="LAY_notice"></ul> |
|||
|
|||
</div> |
|||
</div> |
|||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|||
<script> |
|||
layui.use(['form', 'flow', 'laydate'], function () { |
|||
var $ = layui.jquery, |
|||
form = layui.form, |
|||
laydate = layui.laydate, |
|||
flow = layui.flow; |
|||
|
|||
let takingPre = 0; |
|||
let size = 8; |
|||
|
|||
|
|||
laydate.render({ |
|||
elem: '#startDate' |
|||
}); |
|||
|
|||
laydate.render({ |
|||
elem: '#endDate' |
|||
}); |
|||
|
|||
flow.load({ |
|||
elem: '#LAY_notice' //流加载容器 |
|||
, done: function (page, next) { //执行下一页的回调 |
|||
let result; |
|||
let lis = []; |
|||
$.get('/notice/findAllNotices?page=' + page + '&size=' + size, function (res) { |
|||
result = res.data; |
|||
lis.push("<div class='clearfix'>"); |
|||
for (let i = 0; i < result.length; i++) { |
|||
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="showDetail(' |
|||
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "标题:"+result[i].title + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+ '<p>' + "内容:"+result[i].content + '</p>' |
|||
+ '<p>' +"发布人:"+ result[i].userName + '</p>' |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|||
next(lis.join(''), takingPre < res.count); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
|
|||
// 监听搜索操作 |
|||
form.on('submit(data-search-btn)', function (data) { |
|||
var req = {}; |
|||
data = data.field; |
|||
req.type = 1; |
|||
if (data.title !== '') { |
|||
req.title = data.title; |
|||
} |
|||
if (data.state !== '') { |
|||
req.state = data.state; |
|||
} |
|||
if (data.startDate !== '') { |
|||
req.startDate = data.startDate; |
|||
} |
|||
if (data.endDate !== '') { |
|||
req.endDate = data.endDate; |
|||
} |
|||
updateFlow(); |
|||
return false; |
|||
}); |
|||
|
|||
updateFlow = function (req) { |
|||
$("#LAY_material").empty(); |
|||
takingPre = 0; |
|||
flow.load({ |
|||
elem: '#LAY_material' //流加载容器 |
|||
, done: function (page, next) { //执行下一页的回调 |
|||
let result; |
|||
let lis = []; |
|||
req.page = page; |
|||
req.size = size; |
|||
$.ajax({ |
|||
url: "/material/material", |
|||
type: "get", |
|||
data: 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++) { |
|||
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="showDetail(' |
|||
+ result[i].id + ')"><div class="layui-card-header"><h2>' + "标题:"+result[i].title + '</h2></div>'); |
|||
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">' |
|||
+ '<p>' + "内容:"+result[i].content + '</p>' |
|||
+ '<p>' +"发布人:"+ result[i].userName + '</p>' |
|||
+ '</div></div></li>'); |
|||
} |
|||
lis.push('</div>'); |
|||
takingPre += result.length; |
|||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 |
|||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 |
|||
next(lis.join(''), takingPre < res.count); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
showDetail = function(data){ |
|||
let req = {}; |
|||
var index = layer.open({ |
|||
title: '公告详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/noticeView?id=' + data, |
|||
}); |
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
return false; |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,474 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>首页二</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<style> |
|||
.layui-card { |
|||
border: 1px solid #f2f2f2; |
|||
border-radius: 5px; |
|||
} |
|||
|
|||
.icon { |
|||
margin-right: 10px; |
|||
color: #1aa094; |
|||
} |
|||
|
|||
.icon-cray { |
|||
color: #ffb800 !important; |
|||
} |
|||
|
|||
.icon-blue { |
|||
color: #1e9fff !important; |
|||
} |
|||
|
|||
.icon-tip { |
|||
color: #ff5722 !important; |
|||
} |
|||
|
|||
.layuimini-qiuck-module { |
|||
text-align: center; |
|||
margin-top: 10px |
|||
} |
|||
|
|||
.layuimini-qiuck-module a i { |
|||
display: inline-block; |
|||
width: 100%; |
|||
height: 60px; |
|||
line-height: 60px; |
|||
text-align: center; |
|||
border-radius: 2px; |
|||
font-size: 30px; |
|||
background-color: #F8F8F8; |
|||
color: #333; |
|||
transition: all .3s; |
|||
-webkit-transition: all .3s; |
|||
} |
|||
|
|||
.layuimini-qiuck-module a cite { |
|||
position: relative; |
|||
top: 2px; |
|||
display: block; |
|||
color: #666; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.welcome-module { |
|||
width: 100%; |
|||
height: 210px; |
|||
} |
|||
|
|||
.panel { |
|||
background-color: #fff; |
|||
border: 1px solid transparent; |
|||
border-radius: 3px; |
|||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); |
|||
box-shadow: 0 1px 1px rgba(0, 0, 0, .05) |
|||
} |
|||
|
|||
.panel-body { |
|||
padding: 10px |
|||
} |
|||
|
|||
.panel-title { |
|||
margin-top: 0; |
|||
margin-bottom: 0; |
|||
font-size: 12px; |
|||
color: inherit |
|||
} |
|||
|
|||
.label { |
|||
display: inline; |
|||
padding: .2em .6em .3em; |
|||
font-size: 75%; |
|||
font-weight: 700; |
|||
line-height: 1; |
|||
color: #fff; |
|||
text-align: center; |
|||
white-space: nowrap; |
|||
vertical-align: baseline; |
|||
border-radius: .25em; |
|||
margin-top: .3em; |
|||
} |
|||
|
|||
.layui-red { |
|||
color: red |
|||
} |
|||
|
|||
.main_btn > p { |
|||
height: 40px; |
|||
} |
|||
|
|||
.layui-bg-number { |
|||
background-color: #F8F8F8; |
|||
} |
|||
|
|||
.layuimini-notice:hover, .layuimini-myTask:hover { |
|||
background: #f6f6f6; |
|||
} |
|||
|
|||
.layuimini-notice, .layuimini-myTask { |
|||
padding: 7px 16px; |
|||
clear: both; |
|||
font-size: 12px !important; |
|||
cursor: pointer; |
|||
position: relative; |
|||
transition: background 0.2s ease-in-out; |
|||
} |
|||
|
|||
.layuimini-notice-title, .layuimini-notice-label, .layuimini-myTask-type { |
|||
padding-right: 70px !important; |
|||
text-overflow: ellipsis !important; |
|||
overflow: hidden !important; |
|||
white-space: nowrap !important; |
|||
} |
|||
|
|||
.layuimini-notice-title, .layuimini-myTask-type { |
|||
line-height: 28px; |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.layuimini-notice-extra, .layuimini-myTask-extra { |
|||
position: absolute; |
|||
top: 50%; |
|||
margin-top: -8px; |
|||
right: 16px; |
|||
display: inline-block; |
|||
height: 16px; |
|||
color: #999; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="layuimini-container"> |
|||
|
|||
|
|||
<div class="layuimini-main"> |
|||
<div class="layui-row layui-col-space15"> |
|||
<div class="layui-col-md4"> |
|||
<div class="layui-card"> |
|||
<div class="layui-card-header"> |
|||
<i class="fa fa-bullhorn icon icon-tip"></i>系统公告 |
|||
<i class="fa fa-chevron-right" aria-hidden="true" |
|||
style="right: 7px;top: 13px;position: absolute;" onclick="showAllNotice()"></i> |
|||
</div> |
|||
<div class="layui-card-body layui-text"> |
|||
<div class="layuimini-notice" th:each="notice,iterStat:${notices}"> |
|||
<input id="noticeId" style="display:none;" th:value="${notice.getId()}"/> |
|||
<div class="layuimini-notice-title" th:text="${notice.getTitle()}"></div> |
|||
<div class="layuimini-notice-extra" th:text="${notice.getTime()}"></div> |
|||
<div class="layuimini-notice-content layui-hide" th:text="${notice.getContent()}"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-col-md12"> |
|||
<div class="layui-card"> |
|||
<div class="layui-card-header"> |
|||
<i class="fa fa-tasks icon-blue"></i>我的任务 |
|||
<i class="fa fa-chevron-right" aria-hidden="true" |
|||
style="right: 7px;top: 13px;position: absolute;" onclick="showAllMyTask()"></i> |
|||
</div> |
|||
<div class="layui-card-body layui-text"> |
|||
<div class="layuimini-myTask" th:each="myTask,iterStat:${myTaskList}"> |
|||
<div class="layuimini-myTask-type" th:text="${myTask.getType()}"></div> |
|||
<div class="layuimini-myTask-extra" th:text="${myTask.getApplicantTime()}"></div> |
|||
<div class="layuimini-myTask-name " th:text="${myTask.getApplicantName()}"></div> |
|||
<div class="layuimini-myTask-id layui-hide" th:text="${myTask.getId()}"></div> |
|||
<hr/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-col-md12"> |
|||
<div class="layui-card"> |
|||
<div class="layui-card-header"> |
|||
<i class="fa fa fa-map-o icon"></i>我的申请 |
|||
<i class="fa fa-chevron-right" aria-hidden="true" |
|||
style="right: 7px;top: 13px;position: absolute;" onclick="showAllMyApply()"></i> |
|||
</div> |
|||
<div class="layui-card-body layui-text"> |
|||
<div class="layuimini-myApply" th:each="myTask,iterStat:${myApplyList}"> |
|||
<div class="layuimini-myApply-type" th:text="${myTask.getType()}"></div> |
|||
<div class="layuimini-myApply-extra" th:text="${myTask.getApplicantTime()}"></div> |
|||
<div class="layuimini-myApply-name " th:text="${myTask.getApplicantName()}"></div> |
|||
<div class="layuimini-myApply-id layui-hide" th:text="${myTask.getId()}"></div> |
|||
<hr/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</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> |
|||
|
|||
function showAllNotice() { |
|||
|
|||
} |
|||
|
|||
function showAllMyTask() { |
|||
|
|||
} |
|||
|
|||
function showAllMyApply() { |
|||
|
|||
} |
|||
|
|||
layui.use(['layer', 'miniTab', 'echarts'], function () { |
|||
var $ = layui.jquery, |
|||
layer = layui.layer, |
|||
miniTab = layui.miniTab, |
|||
echarts = layui.echarts; |
|||
|
|||
miniTab.listen(); |
|||
|
|||
/** |
|||
* 查看公告信息 |
|||
**/ |
|||
$('body').on('click', '.layuimini-notice', function () { |
|||
var title = $(this).children('.layuimini-notice-title').text(), |
|||
noticeTime = $(this).children('.layuimini-notice-extra').text(), |
|||
content = $(this).children('.layuimini-notice-content').html(), |
|||
nid = $(this).children("#noticeId").val(); |
|||
var html = '<div style="padding:15px 20px; text-align:justify; line-height: 22px;border-bottom:1px solid #e2e2e2;background-color: #2f4056;color: #ffffff">\n' + |
|||
'<div style="text-align: center;margin-bottom: 20px;font-weight: bold;border-bottom:1px solid #718fb5;padding-bottom: 5px"><h4 class="text-danger">' + title + '</h4></div>\n' + |
|||
'<div style="font-size: 12px">' + content + '</div>\n' + |
|||
'</div>\n'; |
|||
|
|||
parent.layer.open({ |
|||
type: 1, |
|||
title: '系统公告' + '<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">' + noticeTime + '</span>', |
|||
area: '300px;', |
|||
shade: 0.8, |
|||
id: 'layuimini-notice', |
|||
btn: ['查看', '取消'], |
|||
btnAlign: 'c', |
|||
moveType: 1, |
|||
content: html, |
|||
success: function (layero) { |
|||
var btn = layero.find('.layui-layer-btn'); |
|||
btn.find('.layui-layer-btn0').click(function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '弹窗内容', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层 |
|||
area: ['100%', '100%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: "/noticeView?id=" + nid |
|||
}); |
|||
} |
|||
); |
|||
|
|||
} |
|||
}); |
|||
}); |
|||
|
|||
/** |
|||
* 查看任务信息 |
|||
**/ |
|||
$('body').on('click', '.layuimini-myTask', function () { |
|||
var id = $(this).children('.layuimini-myTask-id').text(); |
|||
var type = $(this).children('.layuimini-myTask-type').text(); |
|||
if (type === '出库请求') { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/application_review?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
|
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
else if (type === '入库请求') { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/application_in_review?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
|
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
else if (type === "库存盘点请求") { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/StockTakingReview?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} else if (type === "物料出库请求") { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/ApplicationOutMinByDidForMobile?depositoryId=' + id + "&state=0", |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
/** |
|||
* 查看申请信息 |
|||
**/ |
|||
$('body').on('click', '.layuimini-myApply', function () { |
|||
var id = $(this).children('.layuimini-myApply-id').text(); |
|||
var type = $(this).children('.layuimini-myApply-type').text(); |
|||
if (type === '物料出库申请') { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/ApplicationOutView?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
|
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
else if (type === '物料入库请求') { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/form_step_look?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
|
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
else if (type === "库存盘点请求") { |
|||
var index = layer.open({ |
|||
title: '请求详情', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/StockTakingView?id=' + id, |
|||
end: function () { |
|||
location.reload() |
|||
} |
|||
}); |
|||
$(window).on("resize", function () { |
|||
layer.full(index); |
|||
}); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
showAllNotice = function () { |
|||
var index = layer.open({ |
|||
title: '所有公告', |
|||
type: 2, |
|||
shade: 0.2, |
|||
maxmin: true, |
|||
shadeClose: true, |
|||
area: ['100%', '100%'], |
|||
content: '/noticeAll', |
|||
}); |
|||
}; |
|||
|
|||
showAllMyTask = function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '我的任务', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层 |
|||
area: ['100%', '100%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: '/my_task', |
|||
}); |
|||
} |
|||
|
|||
showAllMyApply = function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '我的申请', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层 |
|||
area: ['100%', '100%'], |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
content: '/my_apply', |
|||
}); |
|||
} |
|||
|
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
|
|||
|
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,236 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>用户功能</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
</head> |
|||
<body> |
|||
<style> |
|||
.layui-colla-content:before, .layui-colla-content:after { |
|||
content: ""; |
|||
display: block; |
|||
clear: both; |
|||
} |
|||
|
|||
.layuimini-container { |
|||
background-color: #efefef; |
|||
} |
|||
|
|||
.layuimini-authority-content-item a i { |
|||
background-color: #efefef; |
|||
|
|||
} |
|||
|
|||
.first a i { |
|||
color: #993333; |
|||
} |
|||
|
|||
.second a i { |
|||
color: #6699CC; |
|||
} |
|||
|
|||
.third a i { |
|||
color: #99CC33; |
|||
} |
|||
|
|||
.fourthly a i { |
|||
color: #003399; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
<div class="layuimini-container"> |
|||
|
|||
|
|||
<div class="layuimini-main"> |
|||
<div class="layuimini-authority" id="layuimini-authority"> |
|||
|
|||
</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', 'miniTab', 'echarts', 'element'], function () { |
|||
var $ = layui.jquery, |
|||
layer = layui.layer, |
|||
element = layui.element, |
|||
miniTab = layui.miniTab; |
|||
|
|||
miniTab.listen(); |
|||
/*$(function () { |
|||
$.ajax({ |
|||
url: "/index/menus", |
|||
type: 'get', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (data) { |
|||
let menuInfo = data.menuInfo; |
|||
for (let i = 0; i < menuInfo.length; i++) { |
|||
let menuInfoElement = menuInfo[i]; |
|||
if (menuInfoElement.href === '') { |
|||
let menuItem = createMenuList(menuInfoElement); |
|||
if(menuInfoElement.title.indexOf("辅助管理") !== -1){ |
|||
let resultChild = '<div class="layui-collapse"> ' + |
|||
'<div class="layui-colla-item">' + |
|||
'<h2 class="layui-colla-title">' + menuInfoElement.title + '</h2>' + |
|||
'<div class="layui-colla-content layui-show" >'; |
|||
resultChild += menuItem; |
|||
resultChild += '</div></div></div>'; |
|||
menuItem = resultChild; |
|||
} |
|||
$("#layuimini-authority").append(menuItem); |
|||
element.render(); |
|||
} |
|||
} |
|||
} |
|||
}) |
|||
}); |
|||
|
|||
|
|||
// 用于构造菜单列表 |
|||
function createMenuList(data) { |
|||
// 获取子菜单 |
|||
let childList = data.child; |
|||
// 如果存在子菜单 |
|||
if (childList.length > 0) { |
|||
let result = ''; |
|||
// 循环子菜单 |
|||
for (let i = 0; i < childList.length; i++) { |
|||
let childListElement = childList[i]; |
|||
if (childListElement.href.indexOf("my_")!== -1) { |
|||
continue; |
|||
} |
|||
result += createChildMenuItem(childListElement); |
|||
} |
|||
return result; |
|||
} |
|||
} |
|||
|
|||
|
|||
// 用于构造子菜单列表 |
|||
function createChildMenuItem(data) { |
|||
// 获取当前子菜单 |
|||
let childList = data.child; |
|||
// 定义返回结果 |
|||
let result; |
|||
// 如果存在子菜单 |
|||
if (childList !== undefined && childList !== null && childList.length > 0) { |
|||
let resultChild = '<div class="layui-collapse"> ' + |
|||
'<div class="layui-colla-item">' + |
|||
'<h2 class="layui-colla-title">' + data.title + '</h2>' + |
|||
'<div class="layui-colla-content layui-show" >'; |
|||
for (let i = 0; i < childList.length; i++) { |
|||
let childMenuList = createChildMenuItem(childList[i]); |
|||
resultChild += childMenuList; |
|||
} |
|||
resultChild += '</div></div></div>'; |
|||
return resultChild; |
|||
} else { |
|||
// 如果不存在子菜单 |
|||
|
|||
// 构造标签 |
|||
let childItem_out = '<div class="layuimini-authority-content-item layuimini-qiuck-module">'; |
|||
let childItem_a = '<a href="javascript:;" layuimini-content-href="' + data.href+ '" data-title="' + data.title + '" data-icon="' + data.icon + '">'; |
|||
let childItem_i = '<i class="' + data.icon + '"></i>'; |
|||
let childItem_cite = ' <cite>' + data.title + '</cite></a></div>'; |
|||
result = childItem_out + childItem_a + childItem_i + childItem_cite; |
|||
} |
|||
return result; |
|||
}*/ |
|||
|
|||
$(function () { |
|||
$.ajax({ |
|||
url: "/getUserAuthorization", |
|||
type: 'get', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (res) { |
|||
let menuList = res.data; |
|||
let menuItem = createMenuList(menuList); |
|||
$("#layuimini-authority").append(menuItem); |
|||
element.render(); |
|||
|
|||
} |
|||
}) |
|||
}); |
|||
|
|||
|
|||
// 用于构造菜单列表 |
|||
function createMenuList(data) { |
|||
// 如果存在菜单 |
|||
if (data.length > 0) { |
|||
// 定义结果 |
|||
let result = ''; |
|||
// 定义暂存结果 |
|||
let tempItemForApplication = ''; |
|||
let tempItemForAnalyse = ''; |
|||
let tempItemForCreate = ''; |
|||
let tempItemForSystem = ''; |
|||
for (let i = 0; i < data.length; i++) { |
|||
// 遍历子菜单 |
|||
let childListElement = data[i]; |
|||
if (childListElement.url.indexOf("my_") !== -1) { |
|||
// 如果是我的任务,我的申请跳过 |
|||
continue; |
|||
} |
|||
if (childListElement.name.indexOf("申请") !== -1) { |
|||
// 如果是申请相关操作 |
|||
tempItemForApplication = createChildMenuItem(childListElement, tempItemForApplication, '业务操作','first'); |
|||
} else if (childListElement.name.indexOf("查询") !== -1 || childListElement.name.indexOf("可视化") !== -1) { |
|||
// 如果是查询可视化等操作 |
|||
tempItemForAnalyse = createChildMenuItem(childListElement, tempItemForAnalyse, '查询分析','second'); |
|||
} else if (childListElement.name.indexOf("创建") !== -1) { |
|||
// 如果是创建相关操作 |
|||
tempItemForCreate = createChildMenuItem(childListElement, tempItemForCreate, '基础设置','third'); |
|||
} else if (childListElement.name.indexOf("赋权") !== -1 || childListElement.name.indexOf("发布") !== -1) { |
|||
tempItemForSystem = createChildMenuItem(childListElement, tempItemForSystem, '系统管理','fourthly'); |
|||
} |
|||
if (i === data.length - 1) { |
|||
tempItemForApplication += "</div></div></div>"; |
|||
tempItemForAnalyse += "</div></div></div>"; |
|||
tempItemForCreate += "</div></div></div>"; |
|||
tempItemForSystem += "</div></div></div>"; |
|||
result = tempItemForApplication+tempItemForAnalyse+tempItemForCreate+tempItemForSystem; |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
} |
|||
|
|||
|
|||
// 用于构造子菜单按钮 |
|||
function createChildMenuItem(data, result, title,classItem) { |
|||
if (result.indexOf("layui-collapse") === -1) { |
|||
// 如果没有面板 |
|||
let resultChild = '<div class="layui-collapse '+classItem+'"> ' + |
|||
'<div class="layui-colla-item">' + |
|||
'<h2 class="layui-colla-title">' + title + '</h2>' + |
|||
'<div class="layui-colla-content layui-show" >'; |
|||
result += resultChild; |
|||
} |
|||
// 构造标签 |
|||
let childItem_out = '<div class="layuimini-authority-content-item layuimini-qiuck-module">'; |
|||
let childItem_a = '<a href="javascript:;" layuimini-content-href="' + data.url + '" data-title="' + data.name + '" data-icon="' + data.icon + '">'; |
|||
let childItem_i = '<i class="' + data.icon + '"></i>'; |
|||
let childItem_cite = ' <cite>' + data.name + '</cite></a></div>'; |
|||
result += childItem_out + childItem_a + childItem_i + childItem_cite; |
|||
return result; |
|||
|
|||
} |
|||
|
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
|
|||
|
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,148 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>仓库盘点</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/inputTag.css"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
<style> |
|||
|
|||
.inputdiv { |
|||
display: flex; |
|||
background-color: #fff; |
|||
height: 38px; |
|||
line-height: 38px; |
|||
border: 1px solid rgb(238, 238, 238); |
|||
} |
|||
|
|||
.layui-card-body { |
|||
padding: 0px; |
|||
} |
|||
|
|||
.layui-form-label { |
|||
padding: 9px 0px; |
|||
text-align: left; |
|||
} |
|||
|
|||
.layui-input-block { |
|||
margin-left: 80px; |
|||
} |
|||
|
|||
.layui-form-select { |
|||
width: 100%; |
|||
height: 38px; |
|||
|
|||
} |
|||
|
|||
.lay-step { |
|||
display: none; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
|
|||
<div class="layuimini-container"> |
|||
<div class="layuimini-main"> |
|||
<div class="layui-fluid"> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script id="changeUnit" type="text/html"> |
|||
<a class="layui-btn layui-btn-xs" lay-event="more">{{d.unit}}<i class="layui-icon layui-icon-down"></i></a> |
|||
</script> |
|||
<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 src="/static/js/stockTaking/stockTakingForMaterial.js" charset="utf-8"></script> |
|||
<script> |
|||
layui.use(['form', 'step'], function () { |
|||
var $ = layui.$, |
|||
step = layui.step, |
|||
form = layui.form; |
|||
|
|||
// 用于分步表单加载 |
|||
step.render({ |
|||
elem: '#stepForm', |
|||
filter: 'stepForm', |
|||
width: '100%', //设置容器宽度 |
|||
height: '900px', |
|||
stepItems: [{ |
|||
title: '填写信息' |
|||
}, { |
|||
title: '提交成功' |
|||
}] |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
// 用于提交盘点情况 |
|||
form.on('submit(formStep)', function (data) { |
|||
if(!flagForForm){ |
|||
flagForForm = true; |
|||
data = data.field; |
|||
data.depositoryId = depositoryId; |
|||
data.placeId = placeId; |
|||
let submitType = this.getAttribute("submitType"); |
|||
if ("Material" === submitType) { |
|||
data.departmentManager = departmentManagerIdForMaterial; |
|||
} else if ("Location" === submitType) { |
|||
data.departmentManager = departmentManagerIdForLocation; |
|||
} |
|||
$.ajax({ |
|||
url: "/stockTaking/submitStockTaking", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify(data), |
|||
beforeSend: function () { |
|||
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|||
}, |
|||
success: function (data) { |
|||
layer.msg("申请提交成功", { |
|||
icon: 6,//成功的表情 |
|||
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|||
}, function () { |
|||
step.next('#stepForm'); |
|||
}); |
|||
}, |
|||
complete: function () { |
|||
layer.close(this.layerIndex); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
form.on('submit(formStep2)', function (data) { |
|||
step.next('#stepForm'); |
|||
return false; |
|||
}); |
|||
|
|||
|
|||
$('.pre').click(function () { |
|||
step.pre('#stepForm'); |
|||
}); |
|||
|
|||
$('.next').click(function () { |
|||
step.next('#stepForm'); |
|||
}); |
|||
|
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
}) |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,273 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>仓库盘点</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
</head> |
|||
<body> |
|||
<div class="layuimini-container"> |
|||
<div class="layuimini-main"> |
|||
|
|||
|
|||
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; "> |
|||
<div carousel-item style="overflow: inherit"> |
|||
<div> |
|||
<form class="layui-form" |
|||
style="margin: 0 auto;max-width: 700px;" |
|||
lay-filter="form1"> |
|||
<div class="layui-card-body" style="padding-right: 0px"> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">盘点位置:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getDepositoryCode()}" |
|||
id="openSonByDepository" readonly |
|||
lay-verify="required"/> |
|||
<input type="text" name="depositoryId" class="layui-input" |
|||
th:value="${record.getDepositoryId()}" |
|||
id="depositoryId" |
|||
style="display: none" lay-verify="required"/> |
|||
<input type="text" name="placeId" class="layui-input" th:value="${record.getPid()}" |
|||
id="placeId" |
|||
style="display: none" lay-verify="required"/> |
|||
<input type="text" name="mpId" class="layui-input" th:value="${mpId}" |
|||
id="mpId" |
|||
style="display: none" lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">物料名称:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getMname()}" |
|||
id="mname" readonly/> |
|||
<input type="text" name="mid" class="layui-input" th:value="${record.getId()}" |
|||
id="mid" |
|||
style="display: none" lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">物料编码:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getCode()}" |
|||
id="mcode" readonly/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">物料品牌:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getBrand()}" |
|||
id="mbrand" readonly/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">物料型号:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getVersion()}" |
|||
id="mversion" readonly/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">计量单位:</label> |
|||
<div class="layui-input-block"> |
|||
<select id="unit" name="unit"> |
|||
<option th:value="${record.getUnit()}" th:text="${record.getUnit()}"></option> |
|||
<option th:each="splitInfo,iterStar:${record.getSplitInfoList()}" |
|||
th:value="${splitInfo?.getNewUnit()}" |
|||
th:text="${splitInfo?.getNewUnit()}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">库存数量:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" class="layui-input" |
|||
th:value="${record.getQuantity()}" |
|||
id="quantity" readonly/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">盘点数量:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="number" class="layui-input" id="newInventory" |
|||
onblur="calculateForMaterial(this)" |
|||
name="newInventory" |
|||
lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">盘点结果:</label> |
|||
<div class="layui-input-block"> |
|||
<input name="takingResult" id="result" class="layui-input"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label">盈亏数量:</label> |
|||
<div class="layui-input-block"> |
|||
<input type="number" class="layui-input" |
|||
readonly |
|||
id="Inventory_number" |
|||
name="inventory" lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</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(['form', 'flow', 'step', 'element'], function () { |
|||
var $ = layui.$, |
|||
step = layui.step, |
|||
element = layui.element, |
|||
form = layui.form; |
|||
|
|||
|
|||
// 用于分步表单加载 |
|||
step.render({ |
|||
elem: '#stepForm', |
|||
filter: 'stepForm', |
|||
width: '100%', //设置容器宽度 |
|||
stepWidth: '750px', |
|||
height: '1050px', |
|||
stepItems: [] |
|||
}); |
|||
|
|||
$(function() { |
|||
$.ajax({ |
|||
url: "/stockTaking/getTemporaryStorageForTakingResult", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify({"mpId":$("#mpId").val()}), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (res) { |
|||
let data = res.data; |
|||
if(data !== null){ |
|||
let nowUnit = $("#unit").val(); |
|||
let stockUnit = data.unit; |
|||
if(nowUnit !== stockUnit){ |
|||
$("#unit").val(stockUnit); |
|||
findInventoryForUnit({}); |
|||
form.render(); |
|||
} |
|||
$("#Inventory_number").val(data.number); |
|||
$("#result").val(data.takingResultString); |
|||
let takingResult = data.takingResult; |
|||
if("Inventory_up" === takingResult){ |
|||
// 如果盘盈 |
|||
$("#newInventory").val(Number(data.oldInventory) + Number(data.number)); |
|||
}else if("Inventory_down" === takingResult){ |
|||
// 如果盘亏 |
|||
$("#newInventory").val(Number(data.oldInventory) - Number(data.number)); |
|||
}else{ |
|||
// 如果正常 |
|||
$("#newInventory").val(0); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
|
|||
form.on('select()', function (data) { |
|||
var id = data.elem.id; //得到select原始DOM对象id |
|||
var req = {}; |
|||
if (id.includes("producedDate")) { |
|||
req.mid = $("#mid").val(); |
|||
req.producedDate = data.value; |
|||
$.ajax({ |
|||
url: "/material/findQuantityByProducedDate", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify(req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
$("#quantity").val(d.data) |
|||
} |
|||
}); |
|||
} else if (id.includes("unit")) { |
|||
findInventoryForUnit(req); |
|||
} |
|||
}); |
|||
|
|||
findInventoryForUnit = function(req){ |
|||
req.mid = $("#mid").val(); |
|||
req.unit = $("#unit").val(); |
|||
req.placeId = $("#placeId").val(); |
|||
$.ajax({ |
|||
url: "/material/findQuantityByUnit", |
|||
type: "post", |
|||
dataType: 'json', |
|||
data: JSON.stringify(req), |
|||
contentType: "application/json;charset=utf-8", |
|||
success: function (d) { |
|||
$("#quantity").val(d.data); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
// 用于计算盘点结果 |
|||
calculateForMaterial = function (obj) { |
|||
let oldInventory = Number($("#quantity").val()); |
|||
let nowInventory = Number(obj.value); |
|||
let number = 0; |
|||
let takingResult = ''; |
|||
let takingResultString = ''; |
|||
let req = {}; |
|||
if ((oldInventory) > (nowInventory)) { |
|||
number = oldInventory - nowInventory; |
|||
takingResult = "Inventory_down"; |
|||
takingResultString = "盘亏"; |
|||
} else if ((oldInventory) < (nowInventory)) { |
|||
number = nowInventory - oldInventory; |
|||
takingResult = "Inventory_up"; |
|||
takingResultString = "盘盈"; |
|||
} else { |
|||
takingResult = "Inventory_normal"; |
|||
takingResultString = "正常"; |
|||
} |
|||
$("#result").val(takingResultString); |
|||
$("#Inventory_number").val(number); |
|||
req.number = number + ""; |
|||
req.takingResult = takingResult; |
|||
req.takingResultString = takingResultString; |
|||
req.id = $("#mpId").val(); |
|||
req.unit = $("#unit").val(); |
|||
req.oldInventory = oldInventory + ""; |
|||
$.ajax({ |
|||
url: "/stockTaking/temporaryStorageForTakingResult", |
|||
dataType: "json", |
|||
data: JSON.stringify(req), |
|||
type: "POST", |
|||
contentType: "application/json;charset=utf-8" |
|||
}); |
|||
}; |
|||
|
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
|
|||
}); |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,445 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>仓库盘点</title> |
|||
<meta name="renderer" content="webkit"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
|||
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all"> |
|||
<link rel="stylesheet" href="/static/css/inputTag.css"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
<style> |
|||
.inputdiv { |
|||
display: flex; |
|||
background-color: #fff; |
|||
height: 38px; |
|||
line-height: 38px; |
|||
border: 1px solid rgb(238, 238, 238); |
|||
} |
|||
|
|||
.layui-card-body { |
|||
padding: 0px; |
|||
} |
|||
|
|||
.layui-form-label { |
|||
padding: 9px 0px; |
|||
text-align: left; |
|||
} |
|||
|
|||
.layui-input-block { |
|||
margin-left: 80px; |
|||
} |
|||
|
|||
.layui-form-select { |
|||
width: 100%; |
|||
height: 38px; |
|||
|
|||
} |
|||
|
|||
.lay-step { |
|||
display: none; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
|
|||
<div class="layuimini-container"> |
|||
<div class="layuimini-main"> |
|||
<div class="layui-fluid"> |
|||
|
|||
|
|||
<div class="layui-tab"> |
|||
<ul class="layui-tab-title" style="text-align: center"> |
|||
<li class="layui-this">物料盘点</li> |
|||
<li class="layui-this">位置盘点</li> |
|||
</ul> |
|||
<div class="layui-tab-content"> |
|||
<div class="layui-tab-item layui-show"> |
|||
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; "> |
|||
<div carousel-item style="overflow: inherit"> |
|||
<div> |
|||
<form class="layui-form" |
|||
style="margin: 0 auto;max-width: 700px;" |
|||
lay-filter="form1" id="form1"> |
|||
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px"> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料名称:</label> |
|||
|
|||
<div class="layui-input-block" style="margin: 0px;"> |
|||
<div class="inputdiv"> |
|||
<input type="text" placeholder="请选择物料" class="layui-input" |
|||
style="border-style: none" |
|||
id="mname" |
|||
onblur="selectMaterialByName(this)" |
|||
lay-verify="required"/> |
|||
<i class="layui-icon layui-icon-search" |
|||
style="display: inline;" |
|||
id="selectMaterial" onclick="selectMaterial(this)"></i> |
|||
</div> |
|||
<input type="text" name="mid" class="layui-input" id="mid" |
|||
style="display: none" lay-verify="required"/> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料编码:</label> |
|||
<div class="layui-input-block" style="margin: 0px;"> |
|||
<div class="inputdiv"> |
|||
<input id="code" name="code" type="text" |
|||
placeholder="请填写入物料编码" |
|||
value="" |
|||
onblur="selectCode(this)" |
|||
class="layui-input" lay-verify="required" |
|||
style="border-style: none"> |
|||
<img src="/static/images/search.ico" height="16" width="16" |
|||
id="qrCodeImg" |
|||
style="margin-top: 10px" |
|||
onclick="scanCodeForMaterial(this)"> |
|||
<input id="qrCode" name="qrCode" type="text" |
|||
style="display:none;"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料型号</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" name="version" id="version" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料品牌</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" name="brand" id="brand" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料类型</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" name="mtype" id="mtype" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">物料材质</label> |
|||
<div class="layui-input-block"> |
|||
<input type="text" name="texture" id="texture" |
|||
autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">负责人:</label> |
|||
<div class="layui-input-block"> |
|||
|
|||
<div class="fairy-tag-container" style="border-style: none"> |
|||
<div class="inputdiv"> |
|||
<input type="text" id="departmentManagerForMaterial" |
|||
style="display: none" |
|||
th:value="${departmentHeadName}"/> |
|||
<i class="layui-icon layui-icon-search" |
|||
style="display: inline;right: 0;position: absolute;" |
|||
id="selectdepartmentManagerForMaterial"></i> |
|||
<input type="text" id="departmentManagerIdForMaterial" |
|||
name="departmentManagerId" |
|||
th:value="${departmentHeadId}" |
|||
class="layui-input" style="display: none" |
|||
lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<ul class="flow-default" id="LAY_FlowForMaterial"></ul> |
|||
<!-- 提交按钮--> |
|||
<div class="layui-form-item" style="margin-top: 10px;"> |
|||
<div class="layui-input-block"> |
|||
<button type="button" class="layui-btn layui-btn-normal layui-btn-lg" |
|||
submitType="Material" |
|||
lay-submit |
|||
lay-filter="formStep"> |
|||
 提交  |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 下一步--> |
|||
<div> |
|||
<form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;"> |
|||
<div style="text-align: center;margin-top: 90px;"> |
|||
<i class="layui-icon layui-circle" |
|||
style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;"></i> |
|||
<div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;"> |
|||
提交成功 |
|||
</div> |
|||
<div style="text-align: center;margin-top: 50px;"> |
|||
<button class="layui-btn next">再填写一次</button> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="layui-tab-item"> |
|||
<div class="layui-carousel" id="stepForm1" lay-filter="stepForm" style="margin: 0 auto; "> |
|||
<div carousel-item style="overflow: inherit"> |
|||
<div> |
|||
<div class="layui-card"> |
|||
<form class="layui-form" |
|||
style="margin: 0 auto;max-width: 700px;" |
|||
lay-filter="form1"> |
|||
<div class="layui-card-body" style="padding-right: 0px"> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">盘点位置:</label> |
|||
<div class="layui-input-block"> |
|||
<div class="inputdiv"> |
|||
<input type="text" placeholder="请选择盘点位置" class="layui-input" |
|||
style="border-style: none" |
|||
id="openSonByDepository" readonly |
|||
lay-verify="required"/> |
|||
<img src="/static/images/search.ico" height="16" width="16" |
|||
id="scanCodeImg" |
|||
style="margin-top: 10px" onclick="scanCode(this)"> |
|||
</div> |
|||
<input type="text" name="depositoryId" class="layui-input" |
|||
id="depositoryId" |
|||
style="display: none" lay-verify="required"/> |
|||
<input type="text" name="placeId" class="layui-input" |
|||
id="placeId" |
|||
style="display: none" lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-form-label" style="height: 40px;">负责人:</label> |
|||
<div class="layui-input-block"> |
|||
|
|||
<div class="fairy-tag-container" style="border-style: none"> |
|||
<div class="inputdiv"> |
|||
<input type="text" id="departmentManagerForLocation" |
|||
style="display: none" |
|||
th:value="${departmentHeadName}"/> |
|||
<i class="layui-icon layui-icon-search" |
|||
id="selectdepartmentManagerForLocation" |
|||
style="display: inline;right: 0;position: absolute;" |
|||
></i> |
|||
<input type="text" id="departmentManagerIdForLocation" |
|||
name="departmentManagerId" |
|||
th:value="${departmentHeadId}" |
|||
class="layui-input" style="display: none" |
|||
lay-verify="required"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<div class="layui-tab"> |
|||
<div class="layui-tab-content"> |
|||
<ul class="flow-default" id="LAY_FlowForLocation"></ul> |
|||
|
|||
<!-- 提交按钮--> |
|||
<div class="layui-form-item" style="margin-top: 10px;"> |
|||
<div class="layui-input-block"> |
|||
<button type="button" |
|||
class="layui-btn layui-btn-normal layui-btn-lg" |
|||
submitType="Location" |
|||
lay-submit |
|||
lay-filter="formStep"> |
|||
 提交  |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- 下一步--> |
|||
<div> |
|||
<form class="layui-form" |
|||
style="margin: 0 auto;max-width: 460px;padding-top: 40px;"> |
|||
<div style="text-align: center;margin-top: 90px;"> |
|||
<i class="layui-icon layui-circle" |
|||
style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;"></i> |
|||
<div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;"> |
|||
提交成功 |
|||
</div> |
|||
<div style="text-align: center;margin-top: 50px;"> |
|||
<button class="layui-btn next">再填写一次</button> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script id="changeUnit" type="text/html"> |
|||
<a class="layui-btn layui-btn-xs" lay-event="more">{{d.unit}}<i class="layui-icon layui-icon-down"></i></a> |
|||
</script> |
|||
<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 src="/static/js/stockTaking/stockTakingForMaterial_mobile.js" charset="utf-8"></script> |
|||
<script src="/static/js/stockTaking/stockTakingForLocation_mobile.js" charset="utf-8"></script> |
|||
<script> |
|||
// 用于存储当前选择的盘点位置 |
|||
let depositoryId; |
|||
let placeId; |
|||
// 用于存储当前选择的负责人 |
|||
let departmentManagerIdForMaterial; |
|||
// 用于存储当前选择的负责人 |
|||
let departmentManagerIdForLocation; |
|||
|
|||
// 用于标志是否为第一次提交 |
|||
let flagForForm = false; |
|||
let flagForForm1 = false; |
|||
|
|||
|
|||
// 用于控制每次展示数目 |
|||
let size = 8; |
|||
layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { |
|||
var $ = layui.$, |
|||
form = layui.form, |
|||
table = layui.table, |
|||
inputTag = layui.inputTag, |
|||
dropdown = layui.dropdown, //下拉菜单 |
|||
step = layui.step; |
|||
|
|||
// 用于分步表单加载 |
|||
step.render({ |
|||
elem: '#stepForm', |
|||
filter: 'stepForm', |
|||
width: '100%', //设置容器宽度 |
|||
height: '900px', |
|||
stepItems: [{ |
|||
title: '填写信息' |
|||
}, { |
|||
title: '提交成功' |
|||
}] |
|||
}); |
|||
|
|||
// 用于分步表单加载 |
|||
step.render({ |
|||
elem: '#stepForm1', |
|||
filter: 'stepForm', |
|||
width: '100%', //设置容器宽度 |
|||
height: '900px', |
|||
stepItems: [{ |
|||
title: '填写信息' |
|||
}, { |
|||
title: '提交成功' |
|||
}] |
|||
}); |
|||
|
|||
|
|||
// 用于提交盘点情况 |
|||
form.on('submit(formStep)', function (data) { |
|||
if (!flagForForm) { |
|||
flagForForm = true; |
|||
data = data.field; |
|||
data.depositoryId = depositoryId; |
|||
data.placeId = placeId; |
|||
let submitType = this.getAttribute("submitType"); |
|||
if ("Material" === submitType) { |
|||
data.departmentManager = departmentManagerIdForMaterial; |
|||
} else if ("Location" === submitType) { |
|||
data.departmentManager = departmentManagerIdForLocation; |
|||
} |
|||
$.ajax({ |
|||
url: "/stockTaking/submitStockTaking", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify(data), |
|||
beforeSend: function () { |
|||
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|||
}, |
|||
success: function (data) { |
|||
layer.msg("申请提交成功", { |
|||
icon: 6,//成功的表情 |
|||
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|||
}, function () { |
|||
step.next('#stepForm'); |
|||
}); |
|||
}, |
|||
complete: function () { |
|||
layer.close(this.layerIndex); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
form.on('submit(formStep2)', function (data) { |
|||
step.next('#stepForm'); |
|||
return false; |
|||
}); |
|||
|
|||
// 用于提交盘点情况 |
|||
form.on('submit(formStep3)', function (data) { |
|||
if (!flagForForm1) { |
|||
flagForForm1 = true; |
|||
data = data.field; |
|||
data.params = params; |
|||
data.departmentManagerId = departmentManagerIdForLocation; |
|||
data.depositoryId = depositoryId; |
|||
data.placeId = placeId; |
|||
$.ajax({ |
|||
url: "/stockTaking/addStockTakingRecord", |
|||
type: 'post', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
data: JSON.stringify(data), |
|||
beforeSend: function () { |
|||
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|||
}, |
|||
success: function (data) { |
|||
layer.msg("申请提交成功", { |
|||
icon: 6,//成功的表情 |
|||
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|||
}, function () { |
|||
step.next('#stepForm'); |
|||
}); |
|||
}, |
|||
complete: function () { |
|||
layer.close(this.layerIndex); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
}); |
|||
|
|||
$('.pre').click(function () { |
|||
step.pre('#stepForm'); |
|||
}); |
|||
|
|||
$('.next').click(function () { |
|||
step.next('#stepForm'); |
|||
}); |
|||
|
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
}) |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,111 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<title>后台管理-登陆</title> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta http-equiv="Access-Control-Allow-Origin" content="*"> |
|||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
|||
<meta name="apple-mobile-web-app-capable" content="yes"> |
|||
<meta name="format-detection" content="telephone=no"> |
|||
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
|||
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|||
|
|||
<link rel="stylesheet" href="/static/css/public.css"> |
|||
<!--[if lt IE 9]> |
|||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
|||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
|||
<![endif]--> |
|||
|
|||
</head> |
|||
<body> |
|||
<div class="layui-container"> |
|||
|
|||
|
|||
<div class="admin-login-background"> |
|||
<div class="layui-form login-form"> |
|||
<form class="layui-form layui-form-pane" action=""> |
|||
|
|||
<div style="text-align: center" onclick="showInfo()"> |
|||
<img th:attr="src=${userInfo.getIcon()}" alt="头像" class="userInfo_icon"> |
|||
</div> |
|||
<div style="text-align: center;margin-top: 20px"> |
|||
<span id="number" th:text="${userInfo.getNumber()}" style="font-size: x-large"></span> |
|||
</div> |
|||
<div style="text-align: center;margin-top: 20px"> |
|||
<span id="maindeparmentname" th:text="${userInfo.getMaindeparmentname()}" |
|||
style="font-size: x-large"></span> |
|||
</div> |
|||
<div style="text-align: center;margin-top: 20px"> |
|||
<span id="name" th:text="${userInfo.getName()}" style="font-size: x-large"></span> |
|||
</div> |
|||
|
|||
<div class="layui-form-item" style="margin-top: 20%"> |
|||
<button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" onclick="loginOut()">退出 |
|||
</button> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script> |
|||
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|||
<script> |
|||
function loginOut() { |
|||
|
|||
} |
|||
|
|||
function showInfo() { |
|||
|
|||
} |
|||
|
|||
layui.use(['layer', 'form'], function () { |
|||
var form = layui.form, |
|||
$ = layui.jquery, |
|||
layer = layui.layer; |
|||
|
|||
loginOut = function () { |
|||
$.ajax({ |
|||
url: "/loginOut", |
|||
type: 'get', |
|||
dataType: 'json', |
|||
contentType: "application/json;charset=utf-8", |
|||
beforeSend: function () { |
|||
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|||
}, |
|||
success: function (data) { |
|||
layer.close(this.layerIndex); |
|||
layer.msg(data.statusInfo.message, function () { |
|||
window.location = '/login'; |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
showInfo = function () { |
|||
layer.open({ |
|||
type: 2, |
|||
title: '个人信息', |
|||
skin: 'layui-layer-rim', |
|||
maxmin: true, |
|||
shadeClose: true, //点击遮罩关闭层 |
|||
area: ['100%', '100%'], |
|||
content: '/account_look', |
|||
move: '.layui-layer-title', |
|||
fixed: false, |
|||
success: function (layero, index) { |
|||
var children = layero.children(); |
|||
var content = $(children[1]); |
|||
var iframeChildren = $(content.children()); |
|||
content.css('height', '100%'); |
|||
iframeChildren.css('height', '100%'); |
|||
} |
|||
}) |
|||
} |
|||
$('body').on('click', '[data-refresh]', function () { |
|||
location.reload(); |
|||
}) |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
|||
Loading…
Reference in new issue