This commit is contained in:
cwchen 2024-11-15 14:22:21 +08:00
parent 4233327b61
commit 4152458b89
4 changed files with 46 additions and 35 deletions

View File

@ -142,13 +142,22 @@ function initTable() {
title: "库存数量",
unresize: true,
align: "center",
templet: function (d) {
if(d.num > 0){
return d.num;
}
return '<p style="color:#f56c6c;">' + d.num + ' </p>';
},
},
{
field: "price",
width: '15%',
title: "平均单价(元)",
unresize: true,
align: "center"
align: "center",
templet: function (d) {
return ' ¥ ' + d.price;
},
},
],
],

View File

@ -1,15 +1,9 @@
let form, table, laydate;
let form, table;
let tableIns;
let pageNum = 1; // 定义分页
layui.use(["form", "table", 'laydate'], function () {
layui.use(["form", "table"], function () {
form = layui.form;
table = layui.table;
laydate = layui.laydate;
laydate.render({
elem: '#ID-laydate-rangeLinked',
range: ['#startDay', '#endDay'],
rangeLinked: true
});
initTable();
});
@ -18,9 +12,8 @@ function queryTable(type) {
if (type === 1) {
reloadTable(1);
} else if (type === 2) {
$('#keyWord').val('');
$('#startDate').val('');
$('#endDate').val('');
$('#proName').val('');
$('#proStatus').val('');
layui.form.render();
reloadTable(1);
}
@ -39,9 +32,8 @@ function reloadTable(pageNum) {
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'startDate': $('#startDate').val(),
'endDate': $('#endDate').val()
'proName': $('#proName').val(),
'proStatus': $('#proStatus').val()
}),
},
},
@ -57,12 +49,11 @@ function initTable() {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-170",
url: dataUrl + "backstage/partInput/findByPage",
url: dataUrl + "backstage/statistic/getProListPage",
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'startDate': $('#startDate').val(),
'endDate': $('#endDate').val()
'proName': $('#proName').val(),
'proStatus': $('#proStatus').val()
}),
},
request: {
@ -88,40 +79,40 @@ function initTable() {
},
},
{
field: "code",
field: "proName",
width: '15%',
title: "工程名称",
unresize: true,
align: "center",
},
{
field: "inputUser",
field: "proStatus",
width: '8%',
title: "工程状态",
unresize: true,
align: "center",
templet: function (d) {
return setProStatus('1');
return setProStatus(d.proStatus);
},
},
{
field: "inputNum",
field: "wxdNum",
width: '10%',
title: "维修单数量",
unresize: true,
align: "center",
templet: function (d) {
return '<span style="color:#ff9900;font-weight:bold;">1</span>';
return '<span style="color:#ff9900;font-weight:bold;">' + setNullNumValue(d.wxdNum) + '</span>';
},
},
{
field: "allPrice",
field: "lydNum",
width: '10%',
title: "配件领料单数量",
unresize: true,
align: "center",
templet: function (d) {
return '<span style="color:#409eff;font-weight:bold;">1</span>';
return '<span style="color:#409eff;font-weight:bold;">' + setNullNumValue(d.lydNum) + '</span>';
},
},
{
@ -141,10 +132,9 @@ function initTable() {
unresize: true,
align: "center",
templet: function (d) {
return '<p style="color:#409eff;">领2,563 </p>';
// return '<p style="color:#409eff;">领2,563 </p><p style="color:#19be6b;">用2,000 </p><p style="color:#f56c6c;">退563</p>';
return '<p style="color:#409eff;">领:' + setNullNumValue(d.lyNum) + ' </p>';
},
},
{
field: "remark",
@ -153,8 +143,7 @@ function initTable() {
unresize: true,
align: "center",
templet: function (d) {
return '<p style="color:#409eff;">领2,563 </p>';
// return '<p style="color:#409eff;">领2,563 </p><p style="color:#19be6b;">用2,000 </p><p style="color:#f56c6c;">退563</p>';
return '<p style="color:#409eff;">领:' + setNullNumValue(d.lyMoney) + ' </p>';
},
},
{
@ -184,10 +173,10 @@ function initTable() {
function exportExcel() {
let params = {
'proName': $('#proName').val(),
'status': $('#status').val()
'proStatus': $('#proStatus').val()
}
let url = dataUrl + "backstage/export/exportFhList";
exportExcelUtil(url, '配件入库数据', JSON.stringify(params));
let url = dataUrl + "backstage/statistic/exportProListPage";
exportExcelUtil(url, '工程统计', JSON.stringify(params));
}
// 配件退料详情
@ -201,5 +190,7 @@ function setProStatus(status) {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px'>●</span>在建";
} else if (status === '2') {
return "<span style='color:#999;margin:0 5px 0 5px;font-size:16px;'>●</span>完工";
} else {
return '';
}
}

View File

@ -148,6 +148,16 @@ function setNullValue(value) {
return value;
}
// 数字空值赋值
function setNullNumValue(value) {
if (value === 0) {
return 0;
} else if (!value || value === 'null') {
return 0;
}
return value;
}
function getUrlParam(key) {
var href = window.location.href;
var url = href.split("?");

View File

@ -22,12 +22,13 @@
<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"
<input type="text" name="proName" id="proName" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入工程名称" maxlength="30">
</div>
</div>
<div class="layui-inline" style="width: 200px;">
<select class="layui-select">
<option value="">请选择</option>
<option value="1">在建</option>
<option value="2">完工</option>
</select>