配件入库

This commit is contained in:
cwchen 2024-11-12 15:21:53 +08:00
parent 99f2f32ebf
commit 1d5ffe52a1
7 changed files with 302 additions and 25 deletions

View File

@ -1,3 +1,17 @@
.layout {
display: flex;
align-items: center;
justify-content: center;
}
#no_data_title {
width: 100%;
height: 200px;
flex-direction: column;
justify-content: space-evenly;
margin-top: 2%;
}
#search-info { #search-info {
border-width: 1px; border-width: 1px;
margin-bottom: 10px; margin-bottom: 10px;

BIN
images/no_data_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -50,7 +50,6 @@ function setParams(obj) {
}); });
} }
}); });
initTable();
}); });
} }
// 设置文件类型 // 设置文件类型
@ -107,6 +106,25 @@ function saveData2() {
$('#formSubmit').trigger('click') $('#formSubmit').trigger('click')
} }
// 复选框全选
function selectAll(selectStatus) {//传入参数(全选框的选中状态)
//根据name属性获取到单选框的input使用each方法循环设置所有单选框的选中状态
if (selectStatus) {
$("input[name='check']").each(function (i, n) {
n.checked = true;
$(n).parent().parent().find('td').eq(2).find('input').prop('readonly', false).removeAttr('style').val('0');
});
} else {
$("input[name='check']").each(function (i, n) {
n.checked = false;
$(n).parent().parent().find('td').eq(2).find('input').prop('readonly', true).css({
'background-color': '#f0f0f0',
'border': '1px solid #d9d9d9'
}).val('');
});
}
}
function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量 function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量
let color = '#66b1ff'; let color = '#66b1ff';
if (type === 1) { if (type === 1) {
@ -194,20 +212,14 @@ function handleNum(value) {
return null; return null;
} }
// 详情
function openDetail() {
openIframeByParamObj("view_plan", "需求计划", "./demand_plan_detail_list.html", "92%", "95%", objParam);
}
// 新增需求计划外机具 // 选择入库配件类型
function addJjData() { function chooseFitType() {
let params = { let params = {};
'proId': idParam /* if (jjDataArr && jjDataArr.length > 0) {
};
if (jjDataArr && jjDataArr.length > 0) {
params.jjDataArrStr = JSON.stringify(jjDataArr); params.jjDataArrStr = JSON.stringify(jjDataArr);
} } */
openIframeByParamObj("addJjData", '新增需求计划外机具', "./add_jj_data.html", '72%', '80%', params); openIframeByParamObj("choose_fit_type", '选择入库配件类型', "./choose_fit_type_list.html", '82%', '90%', params);
} }
function addJjDatas(data) { function addJjDatas(data) {

View File

@ -0,0 +1,180 @@
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(),
'proId': objParam.proId
}),
},
},
);
}
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-180",
url: dataUrl + "backstage/planOut/getProPlanListByProId",
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'proId': objParam.proId
}),
},
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",
unresize: true,
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 exportExcel() {
let params = {
'keyWord': $('#keyWord').val(),
'proId': objParam.proId
}
let url = dataUrl + "backstage/export/export";
exportExcelUtil(url, '需求计划', JSON.stringify(params));
}
// 需求计划编号
function addFitTypeData() {
openIframeByParamObj2("add_fit_type_data", "配件类型", "../../../page/basic/fit_type_list.html", "82%", "90%", {});
}

View File

@ -1,4 +1,10 @@
let form, layer, dtree, fitTypeTree, util, dtreeData = [], jsonData = null; let form, layer, dtree, fitTypeTree, util, dtreeData = [], jsonData = null;
function setParams() {
// 配件入库页面跳转
$('body').css({ 'margin': '0 15px 15px 15px' });
$('.layuimini-container').css({ 'height': '99%' });
};
layui.config({ layui.config({
base: "../../lib/layui-v2.9.18/layui/dtree/", //此处路径请自行处理, 可以使用绝对路径 base: "../../lib/layui-v2.9.18/layui/dtree/", //此处路径请自行处理, 可以使用绝对路径
}).extend({ }).extend({

View File

@ -59,6 +59,13 @@
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span> <span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>入库配件明细</p> <p>入库配件明细</p>
</div> </div>
<!-- 无数据时-展示 -->
<div id="no_data_title" class="layout">
<img src="../../../images/no_data_icon.png" alt="无数据">
<p style="font-size: 16px;font-weight: bold;">您还没选择入库配件类型</p>
<p style="color: #999999;">需要添加配件类型后才能执行入库操作</p>
<button class="layui-btn layui-bg-blue" onclick="chooseFitType()">选择入库配件类型</button>
</div>
<fieldset class="table-search-fieldset" id="search-info" style="display: none;"> <fieldset class="table-search-fieldset" id="search-info" style="display: none;">
<legend>搜索信息</legend> <legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px"> <div style="margin: 10px 10px 10px 10px">
@ -81,31 +88,26 @@
class="layui-icon"></i> 搜 索</button> class="layui-icon"></i> 搜 索</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i <button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button> class="layui-icon layui-icon-refresh"></i> 重 置</button>
<button type="button" class="layui-btn" onclick="addJjData()">
<i class="layui-icon layui-icon-add-1"></i>添 加
</button>
</div>
<div class="layui-inline">
<p>(需求计划无机具名称及规格,点击添加新数据)</p>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</fieldset> </fieldset>
<div class="table-box" table-responsive style="z-index: 1;" id="table-box" style="display: none;"> <div class="table-box" table-responsive style="display: none;" id="table-box">
<!-- <table class="layui-hide" id="currentTableId" lay-filter="currentTableId" style="display: none;"></table> -->
<table id="baseTable" class="classTable table-hover"> <table id="baseTable" class="classTable table-hover">
<thead> <thead>
<tr> <tr>
<th style="width: 5%" class="center">序号</th> <th style="width: 5%" class="center">
<input onclick="selectAll(this.checked)" type="checkbox">
</th>
<th style="width: 5%" class="center">序号</th> <th style="width: 5%" class="center">序号</th>
<th style="width: 10%" class="center">配件类型</th> <th style="width: 10%" class="center">配件类型</th>
<th style="width: 10%" class="center">配件名称</th> <th style="width: 10%" class="center">配件名称</th>
<th style="width: 10%" class="center">规格型号</th> <th style="width: 10%" class="center">规格型号</th>
<th style="width: 10%" class="center">单位</th> <th style="width: 10%" class="center">单位</th>
<th style="width: 10%" class="center">* 本次入库量</th> <th style="width: 10%" class="center"><span style="color: red;">*</span> 本次入库量</th>
<th style="width: 10%" class="center">单价(元)</th> <th style="width: 10%" class="center">单价(元)</th>
<th style="width: 15%" class="center">* 配件厂家</th> <th style="width: 15%" class="center"><span style="color: red;">*</span> 配件厂家</th>
<th style="width: 15%" class="center">备注</th> <th style="width: 15%" class="center">备注</th>
</tr> </tr>
</thead> </thead>
@ -114,7 +116,7 @@
</div> </div>
</div> </div>
<div class="btn-box"> <div class="btn-box">
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定发货</button> <button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定入库</button>
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">返回</button> <button class="layui-btn layui-btn-primary cancel" onclick="closePage()">返回</button>
</div> </div>
</div> </div>

View File

@ -0,0 +1,63 @@
<!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%;
}
</style>
<body>
<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="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 type="button" class="layui-btn" onclick="addFitTypeData()">
<i class="layui-icon layui-icon-add-1"></i>添 加
</button>
</div>
<div class="layui-inline">
<p>(需求计划无机具名称及规格,点击添加新数据)</p>
</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/accessory/child/choose_fit_type_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html>