库存统计

This commit is contained in:
cwchen 2024-11-15 14:09:11 +08:00
parent 8ca5691202
commit 4233327b61
2 changed files with 22 additions and 20 deletions

View File

@ -10,8 +10,9 @@ layui.use(["form", "table"], function () {
// 数据概览 // 数据概览
function getStatistics() { function getStatistics() {
let url = dataUrl + 'backstage/planOut/getStatistics'; let encryptedData = {};
ajaxRequest(url, "POST", null, true, function () { let url = dataUrl + 'backstage/statistic/getPaTypeStatistics?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
ajaxRequest(url, "GET", null, true, function () {
}, function (result) { }, function (result) {
console.log(result); console.log(result);
if (result.code === 200) { if (result.code === 200) {
@ -23,11 +24,10 @@ function getStatistics() {
// 数据概览赋值 // 数据概览赋值
function setNum(obj) { function setNum(obj) {
$('#totalNum').html(obj.needNum); $('#warn').html(parseInt(obj.warn));
$('#dfhNum').html(obj.dfhNum); $('#money').html(obj.money);
$('#fhNum').html(obj.fhNum); $('#type').html(parseInt(obj.type));
$('#overNum').html(obj.overNum); $('#kcNum').html(parseInt(obj.kcNum));
$('#noPlanNum').html(obj.noPlanNum);
} }
} }
@ -77,7 +77,7 @@ function initTable() {
authorization: sessionStorage.getItem("gz-token"), authorization: sessionStorage.getItem("gz-token"),
}, },
height: "full-300", height: "full-300",
url: dataUrl + "backstage/planOut/getProPlanPage", url: dataUrl + "backstage/statistic/findByPage",
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'type': $('#type').val(), 'type': $('#type').val(),
@ -109,42 +109,42 @@ function initTable() {
}, },
}, },
{ {
field: "proName", field: "type",
width: '15%', width: '15%',
title: "配件类型", title: "配件类型",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "planNum", field: "name",
width: '15%', width: '15%',
title: "配件名称", title: "配件名称",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "recordNum", field: "model",
width: '15%', width: '15%',
title: "规格型号 ", title: "规格型号 ",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "status", field: "unit",
title: "计量单位", title: "计量单位",
width: '15%', width: '15%',
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "lastDay", field: "num",
width: '15%', width: '15%',
title: "库存数量", title: "库存数量",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "progress", field: "price",
width: '15%', width: '15%',
title: "平均单价(元)", title: "平均单价(元)",
unresize: true, unresize: true,
@ -165,9 +165,11 @@ function initTable() {
// 导出 // 导出
function exportExcel() { function exportExcel() {
let params = { let params = {
'proName': $('#proName').val(), 'type': $('#type').val(),
'name': $('#name').val(),
'model': $('#model').val(),
'status': $('#status').val() 'status': $('#status').val()
} }
let url = dataUrl + "backstage/export/exportFhList"; let url = dataUrl + "backstage/statistic/exportPaTypeList";
exportExcelUtil(url, '机具公司发货数据', JSON.stringify(params)); exportExcelUtil(url, '机具公司发货数据', JSON.stringify(params));
} }

View File

@ -40,7 +40,7 @@
<div class="layout num-title"> <div class="layout num-title">
<p>配件类型</p> <p>配件类型</p>
<div class="layout"> <div class="layout">
<p class="num-style" id="totalNum">0</p> <p class="num-style" id="type">0</p>
<p class="unit-class"></p> <p class="unit-class"></p>
</div> </div>
</div> </div>
@ -54,7 +54,7 @@
<div class="layout num-title"> <div class="layout num-title">
<p>配件库存</p> <p>配件库存</p>
<div class="layout"> <div class="layout">
<p class="num-style" id="dfhNum"></p> <p class="num-style" id="kcNum">0</p>
<p class="unit-class"></p> <p class="unit-class"></p>
</div> </div>
</div> </div>
@ -68,7 +68,7 @@
<div class="layout num-title"> <div class="layout num-title">
<p>配件价值</p> <p>配件价值</p>
<div class="layout"> <div class="layout">
<p class="num-style" id="fhNum"></p> <p class="num-style" id="money">0</p>
<p class="unit-class"></p> <p class="unit-class"></p>
</div> </div>
</div> </div>
@ -82,7 +82,7 @@
<div class="layout num-title"> <div class="layout num-title">
<p>配件预警库存为0</p> <p>配件预警库存为0</p>
<div class="layout"> <div class="layout">
<p class="num-style">200</p> <p class="num-style" id="warn">0</p>
<p class="unit-class"></p> <p class="unit-class"></p>
</div> </div>
</div> </div>