This commit is contained in:
cwchen 2024-11-11 12:28:05 +08:00
parent 01ddb1af76
commit 5245512e4c
8 changed files with 281 additions and 46 deletions

View File

@ -10,8 +10,7 @@ body {
#main-box {
width: 100%;
height: 100%;
padding: 0 2% 0 2%;
padding: 0 1% 0 1%;
box-sizing: border-box;
background-color: #fff;
border-radius: 5px;
@ -86,6 +85,11 @@ body {
background-color: #f2f2f2;
}
#baseTable tr td,
#baseTable tr th{
text-align: center;
}
#implement-box {
width: 100%;
flex-direction: column;

View File

@ -3,6 +3,8 @@ let details;
let form, layer, laydate;
function setParams(obj) {
objParam = JSON.parse(obj);
// console.log(objParam);
idParam = objParam.id;
layui.use(['form', 'layer', 'laydate'], function () {
form = layui.form;
@ -68,10 +70,10 @@ function getbaseList(results) {
html += "<td style='vertical-align:middle;' class='center'>" + l.typeName + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + l.type + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + l.module + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + l.unit + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + setNullValue(l.unit) + "</td>";
html += "<td style='vertical-align:middle;color:#409EFF;' class='center'>" + l.needNum + "</td>";
html += "<td style='vertical-align:middle;color:#409EFF;' class='center'>" + l.times + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + l.remarks + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + setNullValue(l.remarks) + "</td>";
html += "</tr>";
}
} else {
@ -80,16 +82,6 @@ function getbaseList(results) {
$("#baseTable tbody").empty().append(html);
}
function rowFunction(id) {
var h = "";
h += "<td style='vertical-align:middle;' class='center'>";
h += "<div class='visible-md visible-lg hidden-sm hidden-xs btn-group'>";
h += "<a href='#' title='详情' onclick='detail(&apos;" + id + "&apos;)' class='aBtnNoTD' ><i class='icon-zoom-in color-p bigger-140'></i></a>";
h += "</div>";
h += "</td>";
return h;
}
// 导出
function exportData() {
let params = {
@ -210,10 +202,10 @@ function getDetailById() {
}, function (result) {
console.log(result);
if (result.code === 200) {
setPlanBasicTableInfo(result.obj);
getbaseList(result.obj.details);
setOperRecordInfo(result.obj.auditList,result.obj);
details = result.obj.details;
setPlanBasicTableInfo(result.data);
getbaseList(result.data.details);
setOperRecordInfo(result.data.auditList, result.data);
details = result.data.details;
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)

View File

@ -0,0 +1,166 @@
let objParam;
let form, table, element, tableIns, layer;
let pageNum = 1;
function setParams(obj) {
objParam = JSON.parse(obj);
console.log(objParam);
$('#proName').html(objParam.proName);
layui.use(["form", "table", 'element', 'layer'], function () {
form = layui.form;
table = layui.table;
element = layui.element;
layer = layui.layer;
initTable();
});
}
// 查询/重置
function queryTable(type) {
if (type === 1) {
reloadTable(1);
} else if (type === 2) {
$('#keyWord').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadData(pageNum);
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val()
}),
},
},
);
}
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({
'keyWord': $('#keyWord').val()
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '9.9%',
title: "序号",
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "code",
width: '15%',
title: "计划编号",
unresize: true,
align: "center",
},
{
field: "proName",
width: '20%',
title: "工程名称",
unresize: true,
align: "center",
},
{
field: "needTime",
width: '10%',
title: "需用日期",
unresize: true,
align: "center",
},
{
field: "creator",
width: '10%',
title: "申请人 ",
unresize: true,
align: "center",
},
{
field: "createTime",
width: '10%',
title: "申请时间",
unresize: true,
align: "center",
},
{
field: "remark",
width: '15%',
title: "计划说明 ",
unresize: true,
align: "center",
},
{
width: '10%',
title: "操作 ",
unresize: true,
align: "center",
templet: function (d) {
let html = "";
html += "<a onclick='plan_detail(" + JSON.stringify(d) + ")'>详情</a>";
return html;
},
},
]
],
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 plan_detail(obj){
openIframeByParamObj2("plan_detail", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj);
}

View File

@ -80,7 +80,7 @@ function initTable() {
},
{
field: "code",
width: '10%',
width: '12%',
title: "需求计划编号",
unresize: true,
align: "center",
@ -99,7 +99,7 @@ function initTable() {
},
{
field: "projectPart",
width: '15%',
width: '13%',
title: "项目部分",
unresize: true,
align: "center",
@ -130,6 +130,7 @@ function initTable() {
width: '9%',
title: "需用量 ",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 1);
},

View File

@ -132,7 +132,7 @@ function initTable() {
unresize: true,
templet: function (d) {
let html = "";
html += "<a onclick=\"viewSource('" + d.proId + "',2)\">查看来源</a>";
html += "<a onclick='viewSource(" + JSON.stringify(d) + ")'>查看来源</a>";
return html;
},
},
@ -169,27 +169,6 @@ function setNumColor(value, type) {
return '<span style="color:' + color + '">' + value + "</span>";
}
// 设置进度值
function schedule(d) {
d.progress = parseFloat(d.progress)
d.filter == undefined ? (d.filter = d.LAY_NUM) : d.filter;
d.progress == undefined ? (d.progress = 100) : d.progress;
var color = "layui-bg-orange";
if (d.progress < 100) {
color = "layui-bg-orange";
} else if (d.progress === 100) {
color = "layui-bg-primary";
} else if (d.progress > 100) {
color = "layui-bg-blue";
}
//设置页面进度条
return (
'<div class="layui-progress layui-progress-big" lay-showpercent="true" id="' + d.filter + '" lay-filter="progress' + d.filter + '">' +
'<div class="layui-progress-bar ' + color + '" lay-percent="' + d.progress + '%">' +
"</div></div>"
);
}
// 导出
function exportExcel() {
let encryptedData = JSON.stringify({
@ -213,6 +192,6 @@ function print() {
}
// 查看来源
function viewSource(id) {
openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./view_resource_list.html", "92%", "95%", id);
function viewSource(obj) {
openIframeByParam("viewSource", "未发货机具设备超出库存数量-数据来源", "./delivery_detail_list.html", "92%", "95%", obj);
}

View File

@ -134,7 +134,9 @@ function initTable() {
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.planNum);
let html = "";
html += "<a onclick='view_plan(" + JSON.stringify(d) + ")'>"+setNumColor(d.planNum)+"</a>";
return html;
},
},
{
@ -267,4 +269,9 @@ function openViewData(type) {
// type 1.超库存量 2.计划外量
function earlyInfo(type) {
openIframeByParam("viewData", "预警信息", "./child/early_info_list.html", "92%", "95%", type);
}
// 需求计划
function view_plan(obj){
openIframeByParamObj("view_plan", "需求计划", "./child/demand_plan_detail_list.html", "92%", "95%", obj);
}

View File

@ -115,7 +115,7 @@ const getNowDate = () => {
function setNullValue(value) {
if (value === 0) {
return 0;
} else if (!value) {
} else if (!value || value === 'null') {
return '';
}
return value;

View File

@ -0,0 +1,86 @@
<!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">
</head>
<style>
body {
margin: 0;
padding: 0;
height: 100%;
}
.layout {
display: flex;
align-items: center;
justify-content: center;
}
.title {
width: 100%;
height: 30px;
justify-content: start;
padding: 0 0 0 20px;
box-sizing: border-box;
}
.title p {
font-size: 16px;
font-weight: bold;
}
.layuimini-main {
height: calc(100% - 30px);
margin: 10px 10px 10px 10px;
}
</style>
<body>
<div class="layuimini-container">
<div class="title layout">
<p id="proName"></p>
</div>
<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="keyWord" id="keyWord" 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>
</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>
</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/demand_plan_detail_list.js" charset="utf-8"></script>
</html>