|
|
@ -10,182 +10,194 @@ |
|
|
<link rel="stylesheet" href="/static/css/public.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/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"> |
|
|
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
|
|
|
|
|
<link rel="stylesheet" href="/static/lib/bootstrap-3.4.1-dist/css/bootstrap.min.css"> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
.inputdiv { |
|
|
.editButton { |
|
|
display: flex; |
|
|
position: absolute; |
|
|
background-color: #fff; |
|
|
top: 5px; |
|
|
height: 38px; |
|
|
right: 15px; |
|
|
line-height: 38px; |
|
|
|
|
|
border: 1px solid rgb(238, 238, 238); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.layui-form-label { |
|
|
|
|
|
padding: 9px 0px; |
|
|
|
|
|
text-align: left; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.layui-input-block { |
|
|
.myEchart { |
|
|
margin-left: 80px; |
|
|
min-width: 500px; |
|
|
|
|
|
min-height: 500px; |
|
|
|
|
|
margin: 0 2px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.inputdiv .layui-unselect { |
|
|
|
|
|
border-style: none; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
</style> |
|
|
</head> |
|
|
</head> |
|
|
|
|
|
|
|
|
<body> |
|
|
<body> |
|
|
|
|
|
|
|
|
<form class="layui-form layui-form-pane" action=""> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input type="text" id="id" th:value="${record.getId()}" name="id" style="display: none"> |
|
|
<input type="text" id="id" th:value="${record.getId()}" name="id" style="display: none"> |
|
|
<div class="layui-form-item"> |
|
|
<div class="layui-fluid"> |
|
|
<label class="layui-form-label">存货编码</label> |
|
|
<div class="layui-row layui-col-space1"> |
|
|
<div class="layui-input-inline"> |
|
|
<div class="layui-row layui-col-xs12 layui-col-md8"> |
|
|
<input type="text" th:value="${record.getCode()}" name="code" id="code" readonly |
|
|
<div> |
|
|
autocomplete="off" class="layui-input"> |
|
|
<div class="panel panel-info"> |
|
|
</div> |
|
|
<div class="panel-heading">物料基本信息 |
|
|
|
|
|
<button type="button" th:attr="mid=${record.getMid()}" lay-on="editMaterialInfo" |
|
|
|
|
|
th:style="'display:'+${display}" |
|
|
|
|
|
class="editButton layui-btn layui-btn-sm layui-btn-primary"> |
|
|
|
|
|
<i class="layui-icon layui-icon-edit"></i> |
|
|
|
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
<div class="panel-body"> |
|
|
<label class="layui-form-label">物料名称</label> |
|
|
<table class="table"> |
|
|
<div class="layui-input-inline"> |
|
|
<tbody> |
|
|
<input type="text" th:value="${record.getMname()}" name="mname" readonly |
|
|
<tr> |
|
|
autocomplete="off" class="layui-input"> |
|
|
<td th:text="'物料编码:'+${record.getCode()}">物料编码:</td> |
|
|
|
|
|
<td th:text="'物料名称:'+${record.getMname()}">物料名称:</td> |
|
|
|
|
|
<td th:text="'规格型号:'+${record.getVersion()}">规格型号:</td> |
|
|
|
|
|
<td th:text="'物料材质:'+${record.getTexture()}">物料材质:</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td th:text="'物料品牌:'+${record.getBrand()}">物料品牌:</td> |
|
|
|
|
|
<td th:text="'物料类型:'+${record.getTypeName()}">物料类型:</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
计量单位: |
|
|
|
|
|
<span th:text="${record.getUnit()}"></span> |
|
|
|
|
|
<span th:each="splitInfo,iterStar:${record.getSplitInfoList()}" |
|
|
|
|
|
th:text="${splitInfo.getNewUnit()}"></span> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td th:text="'物料单价:'+${record.getPrice()}" th:style="'display:'+${display}">物料单价:</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td th:text="'物料备注:'+${record.getIremark()}">物料备注:</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<label class="layui-form-label">规格型号</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<input type="text" th:value="${record.getVersion()}" name="version" autocomplete="off" readonly |
|
|
|
|
|
class="layui-input"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="panel panel-primary"> |
|
|
|
|
|
<div class="panel-heading">数据图标 |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
<div class="panel-body"> |
|
|
<label class="layui-form-label">品牌:</label> |
|
|
<div class="layui-col-xs4 myEchart"> |
|
|
<div class="layui-input-inline"> |
|
|
<div class="panel panel-warning"> |
|
|
<input type="text" class="layui-input" th:value="${record.getBrand()}" readonly |
|
|
<div class="panel-heading">物料入库明细</div> |
|
|
name="brand"/> |
|
|
<div class="panel-body"> |
|
|
|
|
|
<div id="echarts-line-in" style="height:500px;width: 500px;"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<label class="layui-form-label">物料类型</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<input type="text" class="layui-input" id="openSonByMateralType" readonly |
|
|
|
|
|
th:value="${record.getTypeName()}" |
|
|
|
|
|
lay-verify="required"/> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-col-xs4 myEchart"> |
|
|
<div class="layui-form-item"> |
|
|
<div class="panel panel-warning"> |
|
|
<label class="layui-form-label">材质</label> |
|
|
<div class="panel-heading">物料出库明细</div> |
|
|
<div class="layui-input-inline"> |
|
|
<div class="panel-body"> |
|
|
<input type="text" th:value="${record.getTexture()}" name="texture" autocomplete="off" readonly |
|
|
<div id="echarts-line-out" style="height: 500px;width: 500px"> |
|
|
class="layui-input"> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<label class="layui-form-label">计量单位</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<select id="unit"> |
|
|
|
|
|
<option value="-1" 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> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
<div class="layui-col-xs4 myEchart"> |
|
|
<label class="layui-form-label">所处仓库</label> |
|
|
<div class="panel panel-warning"> |
|
|
<div class="layui-input-inline"> |
|
|
<div class="panel-heading">物料库存明细</div> |
|
|
<input type="text" th:value="${record.getDepositoryName()}" name="depositoryName" required |
|
|
<div class="panel-body"> |
|
|
autocomplete="off" readonly |
|
|
<div id="echarts-line-inventory" style="height: 500px;width: 500px"> |
|
|
class="layui-input"> |
|
|
|
|
|
<input type="text" id="depositoryId" th:value="${record.getDepositoryId()}" style="display: none"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<label class="layui-form-label">所处库位</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<button th:each="placeP,iterStar:${record.getPlacePList()}" |
|
|
|
|
|
th:attr="id=${record.getMid()}" class="layui-btn layui-btn-customize" |
|
|
|
|
|
onclick="changePlaceCode(this)" th:value="${record.getDepositoryId()}" |
|
|
|
|
|
th:text="${placeP.getKingdeecode()}"> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<label class="layui-form-label">数量</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<input type="text" th:value="${record.getQuantity()}" name="quantity" required autocomplete="off" |
|
|
|
|
|
id="quantity" readonly |
|
|
|
|
|
class="layui-input"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item" th:style="'display:'+${display}"> |
|
|
|
|
|
<label class="layui-form-label">单价</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<input type="text" th:value="${record.getPrice()}" name="price" required autocomplete="off" id="price" |
|
|
|
|
|
readonly |
|
|
|
|
|
class="layui-input"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item" th:style="'display:'+${display}"> |
|
|
<div class="layui-col-xs6 layui-col-md4"> |
|
|
<label class="layui-form-label">总额</label> |
|
|
<div class=""> |
|
|
<div class="layui-input-inline"> |
|
|
<div class="panel panel-success"> |
|
|
<input type="text" th:value="${record.getAmounts()}" name="amounts" required autocomplete="off" id="amounts" |
|
|
<div class="panel-heading">库存基本信息</div> |
|
|
readonly |
|
|
<div class="panel-body"> |
|
|
class="layui-input"> |
|
|
|
|
|
|
|
|
<table class="table"> |
|
|
|
|
|
<caption th:text="${record.getDepositoryName()}">所属仓库:</caption> |
|
|
|
|
|
<caption th:text="'备注:'+${record.getIremark()}">备注:</caption> |
|
|
|
|
|
|
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>所处库位</td> |
|
|
|
|
|
<td>计量单位</td> |
|
|
|
|
|
<td>对应数量</td> |
|
|
|
|
|
<td th:style="'display:'+${display}">金额</td> |
|
|
|
|
|
<td>操作</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<tr type="button" |
|
|
|
|
|
th:each="materialAndPlace,iterStar:${record.getMaterialAndPlaceList()}"> |
|
|
|
|
|
<td> |
|
|
|
|
|
<button onclick="changePlaceCode(this)" |
|
|
|
|
|
th:text="${materialAndPlace.getKingdeecode()}" |
|
|
|
|
|
th:attr="id=${materialAndPlace.getId()}" |
|
|
|
|
|
class="layui-btn layui-btn-primary layui-btn-sm"></button> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<select class="mySelect" onchange="changeUnitForQuantity(this)" |
|
|
|
|
|
th:attr="id='materialUnit'+${materialAndPlace.getId()}"> |
|
|
|
|
|
<option th:text="${record.getUnit()}" value="-1" |
|
|
|
|
|
class="myOption"></option> |
|
|
|
|
|
<option class="myOption" |
|
|
|
|
|
th:each="splitInfo,iterStar:${record.getSplitInfoList()}" |
|
|
|
|
|
th:value="${splitInfo.getNewUnit()}" |
|
|
|
|
|
th:text="${splitInfo.getNewUnit()}"></option> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<span th:attr="id='quantity'+${materialAndPlace.getId()}" |
|
|
|
|
|
th:text="${materialAndPlace.getInventory()}"></span> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td th:style="'display:'+${display}"> |
|
|
|
|
|
<span th:attr="id='amounts'+${materialAndPlace.getId()}" |
|
|
|
|
|
th:text="${materialAndPlace.getAmount()}"></span> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
<a class="layui-btn layui-btn-xs" |
|
|
|
|
|
th:attr="mid=${materialAndPlace.getIid()},depositoryId=${materialAndPlace.getDepository_id()},placeId=${materialAndPlace.getPid()}" |
|
|
|
|
|
lay-on="applicationIn">入库</a> |
|
|
|
|
|
<a class="layui-btn layui-btn-xs" |
|
|
|
|
|
th:attr="code=${materialAndPlace.getMcode()},depositoryId=${materialAndPlace.getDepository_id()}" |
|
|
|
|
|
lay-on="applicationOut">出库</a> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item" > |
|
|
|
|
|
<label class="layui-form-label">备注</label> |
|
|
|
|
|
<div class="layui-input-inline"> |
|
|
|
|
|
<input type="text" th:value="${record.getIremark()}" name="iremark" required autocomplete="off" id="iremark" |
|
|
|
|
|
onchange="updateInventoryRemark()" |
|
|
|
|
|
class="layui-input"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="layui-form-item"> |
|
|
|
|
|
<div class="layui-input-block"> |
|
|
|
|
|
<button class="layui-btn layui-btn-customize" type="button" onclick="applicationIn()">入库申请</button> |
|
|
|
|
|
|
|
|
|
|
|
<button class="layui-btn layui-btn-customize" type="button" onclick="applicationOut()">出库申请</button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</form> |
|
|
|
|
|
|
|
|
|
|
|
<script src="/static/lib/layui-v2.8.6/layui.js" charset="utf-8"></script> |
|
|
<script src="/static/lib/layui-v2.8.6/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/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
|
|
|
<script src="/static/lib/echarts/echarts.js" charset="utf-8"></script> |
|
|
<script> |
|
|
<script> |
|
|
function applicationIn() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function applicationOut() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function updateInventoryRemark() { |
|
|
function updateInventoryRemark() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function changePlaceCode() { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function changeUnitForQuantity() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var barCode = []; |
|
|
var barCode = []; |
|
|
var flag = false; |
|
|
var flag = false; |
|
|
layui.use(['form', 'laydate', 'miniTab'], function () { |
|
|
layui.use(['form', 'laydate', 'util'], function () { |
|
|
var form = layui.form, |
|
|
var form = layui.form, |
|
|
laydate = layui.laydate, |
|
|
laydate = layui.laydate, |
|
|
$ = layui.$, |
|
|
$ = layui.$, |
|
|
miniTab = layui.miniTab; |
|
|
util = layui.util; |
|
|
let iremark = $("#iremark").val(); |
|
|
let iremark = $("#iremark").val(); |
|
|
miniTab.listen(); |
|
|
let id = $("#id").val(); |
|
|
|
|
|
|
|
|
form.on('select()', function (data) { |
|
|
form.on('select()', function (data) { |
|
|
var id = data.elem.id; //得到select原始DOM对象id |
|
|
var id = data.elem.id; //得到select原始DOM对象id |
|
|
@ -204,41 +216,59 @@ |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
applicationOut = function () { |
|
|
util.on('lay-on', { |
|
|
var index = layer.open({ |
|
|
'editMaterialInfo': function (obj) { |
|
|
title: '出库申请', |
|
|
let mid = $(obj).attr("mid"); |
|
|
|
|
|
layer.open({ |
|
|
type: 2, |
|
|
type: 2, |
|
|
shade: 0.2, |
|
|
offset: 'r', |
|
|
maxmin: true, |
|
|
anim: 'slideLeft', // 从右往左 |
|
|
|
|
|
area: ['40%', '100%'], |
|
|
|
|
|
shade: 0.1, |
|
|
|
|
|
title: "物料详情", |
|
|
shadeClose: true, |
|
|
shadeClose: true, |
|
|
area: ['100%', '100%'], |
|
|
id: 'ID-demo-layer-direction-r', |
|
|
content: '/application_out_back?code=' + $("#code").val() + "&depositoryId=" + $("#depositoryId").val() |
|
|
content: '/materialEditForInventory?id=' + mid, |
|
|
|
|
|
end: function () { |
|
|
|
|
|
location.reload(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
$(window).on("resize", function () { |
|
|
}, |
|
|
layer.full(index); |
|
|
'applicationIn': function (obj) { |
|
|
|
|
|
let mid = $(obj).attr('mid'); |
|
|
|
|
|
let depositoryId = $(obj).attr('depositoryId'); |
|
|
|
|
|
let placeId = $(obj).attr('placeId'); |
|
|
|
|
|
layer.open({ |
|
|
|
|
|
type: 2, |
|
|
|
|
|
offset: 'r', |
|
|
|
|
|
anim: 'slideLeft', // 从右往左 |
|
|
|
|
|
area: ['40%', '100%'], |
|
|
|
|
|
shade: 0.1, |
|
|
|
|
|
title: "入库申请", |
|
|
|
|
|
shadeClose: true, |
|
|
|
|
|
id: 'ID-demo-layer-direction-r', |
|
|
|
|
|
content: '/application_in_back?mid=' + mid + "&depositoryId=" + depositoryId + "&placeId=" + placeId |
|
|
}); |
|
|
}); |
|
|
return false; |
|
|
}, |
|
|
}; |
|
|
'applicationOut': function (obj) { |
|
|
|
|
|
let code = $(obj).attr('code'); |
|
|
applicationIn = function () { |
|
|
let depositoryId = $(obj).attr('depositoryId'); |
|
|
var index = layer.open({ |
|
|
layer.open({ |
|
|
title: '入库申请', |
|
|
|
|
|
type: 2, |
|
|
type: 2, |
|
|
shade: 0.2, |
|
|
offset: 'r', |
|
|
maxmin: true, |
|
|
anim: 'slideLeft', // 从右往左 |
|
|
|
|
|
area: ['40%', '100%'], |
|
|
|
|
|
shade: 0.1, |
|
|
|
|
|
title: "出库申请", |
|
|
shadeClose: true, |
|
|
shadeClose: true, |
|
|
area: ['100%', '100%'], |
|
|
id: 'ID-demo-layer-direction-r', |
|
|
content: '/application_in_back?mid=' + $("#id").val() + "&depositoryId=" + $("#depositoryId").val() |
|
|
content: '/application_out_back?code=' + code + "&depositoryId=" + depositoryId |
|
|
}); |
|
|
}); |
|
|
$(window).on("resize", function () { |
|
|
}, |
|
|
layer.full(index); |
|
|
|
|
|
}); |
|
|
}); |
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateInventoryRemark = function () { |
|
|
updateInventoryRemark = function () { |
|
|
let id = $("#id").val(); |
|
|
|
|
|
let newIremark = $("#iremark").val(); |
|
|
let newIremark = $("#iremark").val(); |
|
|
let index = layer.confirm('确认更改备注?', { |
|
|
let index = layer.confirm('确认更改备注?', { |
|
|
btn: ['确定', '取消'] //按钮 |
|
|
btn: ['确定', '取消'] //按钮 |
|
|
@ -273,7 +303,168 @@ |
|
|
}, function () { |
|
|
}, function () { |
|
|
$("#iremark").val(iremark); |
|
|
$("#iremark").val(iremark); |
|
|
}); |
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 用于更改同一仓库下的库位 |
|
|
|
|
|
changePlaceCode = function (obj) { |
|
|
|
|
|
var id = $(obj).attr("id"); |
|
|
|
|
|
// 当前点击行中的计量单位按钮 |
|
|
|
|
|
let materialUnitObj = $("#materialUnit" + id + " option:selected"); |
|
|
|
|
|
let unit = materialUnitObj.val(); |
|
|
|
|
|
if (unit === -1 || unit === "-1") { |
|
|
|
|
|
unit = materialUnitObj.text(); |
|
|
|
|
|
} |
|
|
|
|
|
unit = unit.trim(); |
|
|
|
|
|
layer.open({ |
|
|
|
|
|
title: '选择库位', |
|
|
|
|
|
type: 2, |
|
|
|
|
|
shade: 0.2, |
|
|
|
|
|
maxmin: true, |
|
|
|
|
|
shadeClose: true, |
|
|
|
|
|
area: ['70%', '70%'], |
|
|
|
|
|
content: '/selectPlaceByDepositoryForInventory?id=' + id + '&unit=' + unit, |
|
|
|
|
|
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 () { |
|
|
|
|
|
location.reload(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用于修改展示的库存数量 |
|
|
|
|
|
* @param obj |
|
|
|
|
|
*/ |
|
|
|
|
|
changeUnitForQuantity = function (obj) { |
|
|
|
|
|
let materialUnitObj = $(obj); |
|
|
|
|
|
let req = {}; |
|
|
|
|
|
req.unit = materialUnitObj.val(); |
|
|
|
|
|
let id = materialUnitObj.attr("id").split("materialUnit")[1].trim(); |
|
|
|
|
|
req.id = id; |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/material/getQuantityForLocationAndUnit", |
|
|
|
|
|
type: "post", |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
let data = res.data; |
|
|
|
|
|
$("#quantity" + id).text(data.quantity); |
|
|
|
|
|
$("#amounts" + id).text(data.amount); |
|
|
} |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 柱状图 |
|
|
|
|
|
var echartLineChartIn = echarts.init(document.getElementById('echarts-line-in')); |
|
|
|
|
|
var echartLineChartOut = echarts.init(document.getElementById('echarts-line-out')); |
|
|
|
|
|
var echartLineChartInventory = echarts.init(document.getElementById('echarts-line-inventory')); |
|
|
|
|
|
var optionLineChartIn = { |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: [] |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value' |
|
|
|
|
|
}, |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: "axis", |
|
|
|
|
|
}, |
|
|
|
|
|
series: [] |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
var optionLineChartOut = { |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: [] |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value' |
|
|
|
|
|
}, |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: "axis", |
|
|
|
|
|
}, |
|
|
|
|
|
series: [] |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
var optionLineChartInventory = { |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: [] |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value' |
|
|
|
|
|
}, |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: "axis", |
|
|
|
|
|
}, |
|
|
|
|
|
series: [] |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: '/depositoryRecord/getApplicationForMaterial', |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
async: true, |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
data: JSON.stringify({"id": id}), |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
complete: function (XHR, TS) { |
|
|
|
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (XHR.status !== 200) { |
|
|
|
|
|
layer.alert("系统繁忙,稍后重试"); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
beforeSend: function () { |
|
|
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (result) { |
|
|
|
|
|
let data = result.data; |
|
|
|
|
|
let dayNames = data["dayNames"]; |
|
|
|
|
|
let amountItemForIn = data["amountItemForIn"]; |
|
|
|
|
|
let countItemForIn = data["countItemForIn"]; |
|
|
|
|
|
let amountItemForOut = data["amountItemForOut"]; |
|
|
|
|
|
let countItemForOut = data["countItemForOut"]; |
|
|
|
|
|
let countItemForInventory = data["countItemForInventory"]; |
|
|
|
|
|
let amountItemForInventory = data["amountItemForInventory"]; |
|
|
|
|
|
let legendItem = data["legend"]; |
|
|
|
|
|
let seriesInItem = []; |
|
|
|
|
|
let seriesOutItem = []; |
|
|
|
|
|
let seriesInventoryItem = []; |
|
|
|
|
|
seriesInItem.push(amountItemForIn); |
|
|
|
|
|
seriesInItem.push(countItemForIn); |
|
|
|
|
|
seriesOutItem.push(amountItemForOut); |
|
|
|
|
|
seriesOutItem.push(countItemForOut); |
|
|
|
|
|
seriesInventoryItem.push(countItemForInventory); |
|
|
|
|
|
seriesInventoryItem.push(amountItemForInventory); |
|
|
|
|
|
optionLineChartIn.series = seriesInItem; |
|
|
|
|
|
optionLineChartOut.series = seriesOutItem; |
|
|
|
|
|
optionLineChartInventory.series = seriesInventoryItem; |
|
|
|
|
|
|
|
|
|
|
|
optionLineChartIn.xAxis.data = dayNames; |
|
|
|
|
|
optionLineChartIn.legend = legendItem; |
|
|
|
|
|
optionLineChartOut.legend = legendItem; |
|
|
|
|
|
optionLineChartOut.xAxis.data = dayNames; |
|
|
|
|
|
optionLineChartInventory.legend = legendItem; |
|
|
|
|
|
optionLineChartInventory.xAxis.data = dayNames; |
|
|
|
|
|
echartLineChartIn.setOption(optionLineChartIn); |
|
|
|
|
|
echartLineChartOut.setOption(optionLineChartOut); |
|
|
|
|
|
echartLineChartInventory.setOption(optionLineChartInventory); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|