This commit is contained in:
parent
b61aecb994
commit
4b3aca38f1
|
|
@ -1,11 +1,15 @@
|
|||
let form, table, element;
|
||||
let form, table, laydate;
|
||||
let tableIns;
|
||||
let pageNum = 1; // 定义分页
|
||||
layui.use(["form", "table"], function () {
|
||||
layui.use(["form", "table", 'laydate'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
element.render();
|
||||
laydate = layui.laydate;
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-rangeLinked',
|
||||
range: ['#startDate', '#endDate'],
|
||||
rangeLinked: true
|
||||
});
|
||||
initTable();
|
||||
});
|
||||
|
||||
|
|
@ -14,8 +18,9 @@ function queryTable(type) {
|
|||
if (type === 1) {
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#proName').val('');
|
||||
$('#status').val('0');
|
||||
$('#keyWord').val('');
|
||||
$('#startDate').val('');
|
||||
$('#endDate').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
|
|
@ -34,8 +39,9 @@ function reloadTable(pageNum) {
|
|||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'proName': $('#proName').val(),
|
||||
'status': $('#status').val()
|
||||
'keyWord': $('#keyWord').val(),
|
||||
'startDate': $('#startDate').val(),
|
||||
'endDate': $('#endDate').val()
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
@ -51,11 +57,12 @@ function initTable() {
|
|||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-170",
|
||||
url: dataUrl + "backstage/planOut/getProPlanPage",
|
||||
url: dataUrl + "backstage/partInput/findByPage",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'proName': $('#proName').val(),
|
||||
'status': $('#status').val()
|
||||
'keyWord': $('#keyWord').val(),
|
||||
'startDate': $('#startDate').val(),
|
||||
'endDate': $('#endDate').val()
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
|
|
@ -81,55 +88,55 @@ function initTable() {
|
|||
},
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
field: "code",
|
||||
width: '15%',
|
||||
title: "入库编号",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
field: "inputUser",
|
||||
width: '10%',
|
||||
title: "入库人",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
field: "inputNum",
|
||||
width: '10%',
|
||||
title: "入库数量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "lastDay",
|
||||
field: "allPrice",
|
||||
width: '10%',
|
||||
title: "成本价格(元)",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "lastDay",
|
||||
field: "inputDay",
|
||||
width: '10%',
|
||||
title: "入库时间",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "lastDay",
|
||||
field: "remark",
|
||||
width: '19.9%',
|
||||
title: "备注",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "lastDay",
|
||||
field: "isFlag",
|
||||
width: '10%',
|
||||
title: "单价是否录入",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return setStatusColor(d.status);
|
||||
return setStatusColor(d.isFlag);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -151,7 +158,6 @@ function initTable() {
|
|||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
pageNum = tableIns.config.page.curr;
|
||||
element.render();
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
|
|
@ -162,7 +168,7 @@ function setStatusColor(value) {
|
|||
value = value ? parseInt(value) : 0;
|
||||
let color = "";
|
||||
let name = ''
|
||||
if (value === 0) {
|
||||
if (value === '0') {
|
||||
color = "#f56c6c";
|
||||
}
|
||||
return '<span style="color:' + color + '">' + name + "</span>";
|
||||
|
|
|
|||
|
|
@ -22,20 +22,21 @@
|
|||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 300px;">
|
||||
<input type="text" name="proName" id="proName" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入工程名称" maxlength="30">
|
||||
<input type="text" name="proName" id="keyWord" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="请输入关键字" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline" style="margin-bottom: 0;">
|
||||
<div class="layui-inline" id="ID-laydate-rangeLinked">
|
||||
<div class="layui-input-inline">
|
||||
<select id="status">
|
||||
<option value="">请选择状态</option>
|
||||
<option value="0">未发货</option>
|
||||
<option value="1">部分发货</option>
|
||||
<option value="2">全部发货</option>
|
||||
</select>
|
||||
</select>
|
||||
</select>
|
||||
<input type="text" autocomplete="off" id="startDate" class="layui-input"
|
||||
placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="endDate" class="layui-input"
|
||||
placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
|
|
|||
Loading…
Reference in New Issue