This commit is contained in:
parent
4152458b89
commit
74024b4c19
|
|
@ -4,8 +4,8 @@ let pageNum = 1;
|
|||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
$('#proStatus').html(setProStatus('1'));
|
||||
$('#titleName').html(objParam.inputDay + '配件记录');
|
||||
$('#proStatus').html(setProStatus(objParam.proStatus));
|
||||
$('#titleName').html(objParam.proName + '配件记录');
|
||||
layui.use(["form", "table", 'upload', 'layer'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
|
|
@ -13,6 +13,7 @@ function setParams(params) {
|
|||
layer = layui.layer;
|
||||
getInputDetails();
|
||||
initTable();
|
||||
initFileTable();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -20,10 +21,10 @@ function setParams(params) {
|
|||
function getInputDetails() {
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'id': objParam.id
|
||||
'proId': objParam.proId
|
||||
})
|
||||
};
|
||||
let url = dataUrl + 'backstage/partInput/getInputDetails';
|
||||
let url = dataUrl + 'backstage/statistic/getProDetails';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
console.error(result);
|
||||
|
|
@ -36,38 +37,11 @@ function getInputDetails() {
|
|||
}, null);
|
||||
// 基本数据表格赋值
|
||||
function setTableData(obj) {
|
||||
$('#codeValue').html(obj.code);
|
||||
$('#inputNum').html(obj.inputNum);
|
||||
$('#allPrice').html(obj.allPrice);
|
||||
$('#inputUser').html(obj.inputUser);
|
||||
$('#inputDay').html(obj.inputDay);
|
||||
$('#remark').html(obj.remark);
|
||||
setFileTable(obj.fileList);
|
||||
$('#lyNum').html(obj.lyNum);
|
||||
$('#lyMoney').html(obj.lyMoney);
|
||||
}
|
||||
}
|
||||
|
||||
// 附件文档赋值
|
||||
function setFileTable(fileList) {
|
||||
$('#file-table tbody tr:not(:first)').remove();
|
||||
let html = '';
|
||||
if (fileList && fileList.length > 0) {
|
||||
$.each(fileList, function (index, item) {
|
||||
html += '<tr>' +
|
||||
'<td>' + handleFileType(item.fileName) + item.fileName + '</td>' +
|
||||
'<td>' + (item.suffix.replace('.', '')) + '</td>' +
|
||||
'<td><img src="../../../images/user_head_icon.png" width="20px" height="20px">' + item.createName + '</td>' +
|
||||
'<td>' + item.createTime + '</td>' +
|
||||
'<td><a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewFile(' + JSON.stringify(item) + ')\'>预览</a>' +
|
||||
'<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'downLoadFile(' + JSON.stringify(item) + ')\'>下载</a>' +
|
||||
'</td>' +
|
||||
'</tr>';
|
||||
})
|
||||
} else {
|
||||
html = '<tr><td colspan="5" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#file-table tbody').after(html);
|
||||
}
|
||||
|
||||
// 处理文件类型
|
||||
function handleFileType(value) {
|
||||
value = value.toLowerCase();
|
||||
|
|
@ -84,6 +58,103 @@ function handleFileType(value) {
|
|||
return '<img width="20px" height="20px" src = "' + src + '" style="margin:0 5px;">'
|
||||
}
|
||||
|
||||
|
||||
function initFileTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableIdByFile",
|
||||
id: 'currentTableIdByFile',
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full",
|
||||
url: dataUrl + "backstage/statistic/getProDetailsFilePage",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'proId': objParam.proId
|
||||
}),
|
||||
},
|
||||
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: "fileName",
|
||||
width: '20%',
|
||||
title: "文件名",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return handleFileType(d.fileName) + d.fileName;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
width: '10%',
|
||||
title: "文件类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "createName",
|
||||
title: "上传人员",
|
||||
width: '20%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return '<img src="../../../images/user_head_icon.png" width="20px" height="20px">' + d.createName;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "createTime",
|
||||
title: "上传时间",
|
||||
width: '20%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "inputNum",
|
||||
title: "操作",
|
||||
width: '20%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
let html = "";
|
||||
html += "<a style='margin:0 5px;color:#409EFF;cursor: pointer;' onclick='viewFile(" + JSON.stringify(d) + ")'>预览</a>";
|
||||
html += "<a style='margin:0 5px;color:#409EFF;cursor: pointer;' onclick='downLoadFile(" + 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;
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
|
|
@ -113,7 +184,7 @@ function reloadTable(pageNum) {
|
|||
'type': $('#type').val(),
|
||||
'name': $('#name').val(),
|
||||
'model': $('#model').val(),
|
||||
'id': objParam.id
|
||||
'proId': objParam.proId
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
@ -129,13 +200,13 @@ function initTable() {
|
|||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full",
|
||||
url: dataUrl + "backstage/partInput/getInputDetailListByPage",
|
||||
url: dataUrl + "backstage/statistic/getProDetailsPage",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'type': $('#type').val(),
|
||||
'name': $('#name').val(),
|
||||
'model': $('#model').val(),
|
||||
'id': objParam.id
|
||||
'proId': objParam.proId
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
|
|
@ -246,14 +317,13 @@ function initTable() {
|
|||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
'type': $('#type').val(),
|
||||
'name': $('#name').val(),
|
||||
'module': $('#module').val(),
|
||||
'proId': objParam.proId,
|
||||
'id': id,
|
||||
'curryDay': time
|
||||
}
|
||||
let url = dataUrl + "backstage/export/exportPcList";
|
||||
exportExcelUtil(url, '发货详情-批次-' + time, JSON.stringify(params));
|
||||
let url = dataUrl + "backstage/statistic/exportProDetailsPage";
|
||||
exportExcelUtil(url, '配件明细', JSON.stringify(params));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -305,5 +375,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 '';
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>库存盘点记录</title>
|
||||
<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">
|
||||
|
|
@ -61,8 +61,8 @@
|
|||
<th>使用成本价格(元)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="codeValue"></td>
|
||||
<td id="inputNum"></td>
|
||||
<td id="lyNum"></td>
|
||||
<td id="lyMoney"></td>
|
||||
<td id="allPrice"></td>
|
||||
<td id="inputUser"></td>
|
||||
<td id="inputUser2"></td>
|
||||
|
|
@ -77,7 +77,10 @@
|
|||
<p>附件文档</p>
|
||||
</div>
|
||||
<div id="file-table-box">
|
||||
<table class="classTable" id="file-table">
|
||||
<div class="table-box" table-responsive style="z-index: 1;" id="table-box">
|
||||
<table class="layui-hide" id="currentTableIdByFile" lay-filter="currentTableIdByFile2"></table>
|
||||
</div>
|
||||
<!-- <table class="classTable" id="file-table">
|
||||
<tr>
|
||||
<th style="width: 30%;">文件名</th>
|
||||
<th style="width: 10%;">文件类型</th>
|
||||
|
|
@ -85,7 +88,7 @@
|
|||
<th>上传时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</table>
|
||||
</table> -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="fhjj-box">
|
||||
|
|
|
|||
Loading…
Reference in New Issue