This commit is contained in:
cwchen 2024-11-11 13:05:34 +08:00
parent 5245512e4c
commit 432235d9ea
8 changed files with 322 additions and 44 deletions

View File

@ -1,3 +1,6 @@
body {
margin: 0 15px 15px 15px;
}
.layui-tab-brief {
border: 1px solid #f2f2f2;
border-radius: 5px;
@ -26,9 +29,12 @@ a:focus {
}
.layuimini-container {
height: 89%;
height: 91%;
}
.layui-tab .layui-tab-title li {
font-size: 16px;
}
.layui-tab {
margin: 0 0 10px 0;
}

View File

@ -77,6 +77,7 @@ function initTable() {
width: '9.9%',
title: "序号",
align: "center",
unresize: true,
templet: function (d) {
return d.LAY_NUM;
},

View File

@ -418,7 +418,7 @@ function handleNum(value) {
// 详情
function openDetail() {
alert('详情');
openIframeByParamObj("view_plan", "需求计划", "./demand_plan_detail_list.html", "92%", "95%", objParam);
}
// 新增需求计划外机具

View File

@ -4,6 +4,7 @@ layui.use(["form", "table", 'element', 'layer'], function () {
form = layui.form;
table = layui.table;
element = layui.element;
layer = layui.layer;
initTable();
});
@ -193,5 +194,5 @@ function print() {
// 查看来源
function viewSource(obj) {
openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./delivery_detail_list.html", "92%", "95%", obj);
openIframeByParamObj2("viewSource", "数据来源", "./delivery_detail_list.html", "92%", "95%", obj);
}

View File

@ -60,7 +60,7 @@ function initTable() {
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-230",
height: "full-220",
url: dataUrl + "backstage/planOut/getProPlanPage",
where: {
encryptedData: JSON.stringify({
@ -84,7 +84,7 @@ function initTable() {
cols: [
[
{
width: 80,
width: '6%',
title: "序号",
align: "center",
templet: function (d) {
@ -92,94 +92,91 @@ function initTable() {
},
},
{
field: "proName",
width: 150,
field: "type",
width: '10%',
title: "物机类型 ",
unresize: true,
align: "center",
},
{
field: "planNum",
width: 150,
field: "name",
width: '10%',
title: "物机名称",
unresize: true,
align: "center",
/* templet: function (d) {
return setNumColor(d.planNum);
}, */
},
{
field: "recordNum",
width: 150,
field: "module",
width: '10%',
title: "规格 ",
unresize: true,
align: "center",
/* templet: function (d) {
return setNumColor(d.recordNum);
}, */
},
{
field: "status",
field: "unit",
title: "单位",
width: 150,
width: '8%',
unresize: true,
align: "center",
/* templet: function (d) {
return setStatusColor(d.status);
}, */
},
{
field: "status",
field: "needNum",
title: "需要量",
width: 150,
width: '8%',
unresize: true,
align: "center",
/* templet: function (d) {
return setNumColor(d.status);
}, */
templet: function (d) {
return setNumColor(d.needNum,1);
},
},
{
field: "status",
title: "已发货量",
width: 150,
width: '8%',
unresize: true,
align: "center",
/* templet: function (d) {
return setStatusColor(d.status);
}, */
templet: function (d) {
return setNumColor(d.needNum,2);
},
},
{
field: "status",
title: "待发货量",
width: 120,
width: '10%',
unresize: true,
align: "center",
/* templet: function (d) {
return setStatusColor(d.status);
}, */
templet: function (d) {
return setNumColor(d.needNum,3);
},
},
{
field: "lastDay",
width: 150,
field: "proNum",
width: '10%',
title: "工程数",
unresize: true,
align: "center",
templet: function (d) {
return setFontBold(d.needNum);
},
},
{
field: "progress",
width: 150,
field: "planNum",
width: '10%',
title: "需求计划数",
unresize: true,
align: "center",
templet: function (d) {
return setFontBold(d.planNum);
},
},
{
title: "来源工程",
minwidth: 200,
width: '10%',
align: "center",
unresize: true,
templet: function (d) {
let html = "";
html += "<a onclick=\"viewSource('" + d.proId + "')\">查看来源</a>";
html += "<a onclick='viewSource(" + JSON.stringify(d) + ")'>查看来源</a>";
return html;
},
},
@ -200,7 +197,7 @@ function setFontBold(value) {
return '<span style="font-weight:bold">' + value + "</span>";
}
// 发货状态颜色
// 数量状态颜色 1.需要量 2.已发货量 3.待发货量
function setNumColor(value,type) {
let color = "#409Eff";
if (type === 1) {
@ -236,6 +233,6 @@ function print() {
}
// 查看来源
function viewSource(id) {
openIframeByParam("viewSource","未发货机具设备超出库存数量-数据来源","./view_resource_list.html","92%","95%",id);
function viewSource(obj) {
openIframeByParamObj2("view_data_source_list", "数据来源", "./child/view_data_source_list.html", "92%", "95%", obj);
}

View File

@ -0,0 +1,160 @@
let objParam;
let form, table, element, tableIns, layer;
let pageNum = 1;
function setParams(obj) {
objParam = JSON.parse(obj);
console.log(objParam);
layui.use(["form", "table", 'element', 'layer'], function () {
form = layui.form;
table = layui.table;
element = layui.element;
layer = layui.layer;
getDataInfoDetails();
initTable();
});
}
// 基本数据
function getDataInfoDetails() {
let encryptedData = {
'moduleId': objParam.moduleId,
};
let url = dataUrl + 'backstage/planOut/getDataInfoDetails?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
ajaxRequest(url, "GET", null, true, function () {
}, function (result) {
console.log(result);
if (result.code === 200) {
setData(result.data);
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
function setData(obj) {
// $('#type').html(obj.type);
// $('#name').html(obj.name);
// $('#unit').html(obj.unit);
// $('#module').html(obj.module);
// $('#wfhNum').html(obj.wfhNum);
// $('#kuNum').html(obj.kuNum);
// $('#clNum').html(obj.clNum);
// $('#proNum').html(obj.proNum);
}
}
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-180",
url: dataUrl + "backstage/planOut/getDataPlanByPage",
where: {
encryptedData: JSON.stringify({
'moduleId': objParam.moduleId
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '10%',
title: "序号",
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "proName",
width: '35%',
title: "工程名称",
unresize: true,
align: "center",
},
{
field: "code",
width: '25%',
title: "需求计划编号",
unresize: true,
align: "center",
templet: function (d) {
let html = "";
html += "<a onclick='demand_plan(" + JSON.stringify(d) + ")'>"+d.code+"</a>";
return html;
},
},
{
field: "needNum",
width: '10%',
title: "需用量",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 1);
},
},
{
field: "needNum",
width: '10%',
title: "已发货量",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 2);
},
},
{
field: "needNum",
width: '10%',
title: "待发货量",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 3);
},
}
]
],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;
element.render();
table.resize("currentTableId");
},
});
}
// 数量颜色 1.需要量 2.已发货量 3.待发货量
function setNumColor(value, type) {
let color = "#409Eff";
if (type === 1) {
color = "#409Eff";
} else if (type === 2) {
color = "#19be6b";
} else if (type === 3) {
color = "#f56c6c";
}
return '<span style="color:' + color + '">' + value + "</span>";
}
// 需求计划编号
function demand_plan(obj){
openIframeByParamObj2("demand_plan", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj);
}

View File

@ -60,4 +60,5 @@
<script src="../../../js/Print.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/demandPlan/child/unplanned_quantity_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html>

View File

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>超库存量-来源</title>
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../../css/font.css" media="all">
<link rel="stylesheet" href="../../../css/public.css" media="all">
<link rel="stylesheet" href="../../../css/demandPlan/excess_inventory_source.css" media="all">
<style>
body {
margin: 0;
padding: 0;
height: 100%;
}
</style>
</head>
<body>
<div id="main-box">
<div id="basic-box">
<div class="title layout">
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>基本信息</p>
</div>
<div id="basic-table">
<table class="classTable">
<tr>
<th>物机类型</th>
<td id="type"></td>
<th>物机名称</th>
<td id="name"></td>
<th>规格</th>
<td id="module"></td>
<th>单位</th>
<td id="unit"></td>
<th>工程数量</th>
<td id="proNum"></td>
</tr>
<tr>
<th>需求量</th>
<td id="wfhNum"></td>
<th>已发货量</th>
<td id="kuNum"></td>
<th>未发货量</th>
<td id="clNum"></td>
<th>差量</th>
<td id="proNum"></td>
<th>需求计划数量</th>
<td id="proNum"></td>
</tr>
</table>
</div>
</div>
<div id="source-box">
<div class="title layout">
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>来源明细</p>
</div>
<div class="layuimini-container">
<div class="layuimini-main">
<fieldset class="table-search-fieldset">
<legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px">
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="name" id="name" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入物机名称" maxlength="30">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="module" id="module" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入规格" maxlength="30">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
class="layui-icon"></i> 搜 索</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button>
<button class="layui-btn layui-btn-primary" onclick="exportExcel()"><i
class="layui-icon layui-icon-download-circle"></i> 下 载</button>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<input type="radio" name="sex" value="" title="全部">
<input type="radio" name="sex" value="1" title="待发货>0">
<input type="radio" name="sex" value="2" title="待发货=0">
</div>
</div>
</div>
</form>
</div>
</fieldset>
<div class="table-box" table-responsive style="z-index: 1;">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../js/Print.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/demandPlan/child/view_data_source_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html>