配件入库

This commit is contained in:
cwchen 2024-11-13 11:03:54 +08:00
parent 35a38d17ca
commit f4f958762e
3 changed files with 32 additions and 34 deletions

View File

@ -1,51 +1,49 @@
let objParam; let objParam;
let id = getUrlParam('id'); // 批次ID
let time = getUrlParam('time'); // 批次日期
let form, table, element, tableIns, layer; let form, table, element, tableIns, layer;
let pageNum = 1; let pageNum = 1;
function setParams(params) { function setParams(params) {
objParam = JSON.parse(params); objParam = JSON.parse(params);
console.error(objParam);
$('#code').html(objParam.code);
$('#titleName').html(objParam.inputDay + '配件入库记录');
layui.use(["form", "table", 'element', 'layer'], function () { layui.use(["form", "table", 'element', 'layer'], function () {
form = layui.form; form = layui.form;
table = layui.table; table = layui.table;
element = layui.element; element = layui.element;
layer = layui.layer; layer = layui.layer;
getOutDetails(); getInputDetails();
initTable(); // initTable();
}); });
} }
// 获取配件到货入库详情
// 基本信息和附件文档接口 function getInputDetails() {
function getOutDetails() {
let params = { let params = {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'proId': objParam.proId, 'id': objParam.id
'id': id
}) })
}; };
let url = dataUrl + 'backstage/planOut/getOutDetails'; let url = dataUrl + 'backstage/partInput/getInputDetails';
ajaxRequest(url, "POST", params, true, function () { ajaxRequest(url, "POST", params, true, function () {
}, function (result) { }, function (result) {
console.error(result); console.error(result);
if (result.code === 200) { if (result.code === 200) {
setBasicValue(result.data); setTableData(result.data);
setFileTable(result.data.fileList);
} else { } else {
setBasicValue(null);
setFileTable(null);
} }
}, function (xhr, status, error) { }, function (xhr, status, error) {
errorFn(xhr, status, error) errorFn(xhr, status, error)
}, null); }, null);
} // 基本数据表格赋值
function setTableData(obj) {
function setBasicValue(obj) { $('#codeValue').html(obj.code + '<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewGs(' + JSON.stringify(obj) + ')\'>查看概述</a>');
if (obj) { $('#inputNum').html(obj.inputNum);
$('#userName').html(obj.userName); parseInt(); $('#allPrice').html(obj.allPrice);
$('#createDay').html(obj.createDay + '<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewGs(' + JSON.stringify(obj) + ')\'>查看概述</a>'); $('#inputUser').html(obj.inputUser);
$('#remark').html(obj.remarks); $('#inputDay').html(obj.inputDay);
$('#remark').html(obj.remark);
setFileTable(obj.fileList);
} }
} }
@ -57,8 +55,8 @@ function setFileTable(fileList) {
$.each(fileList, function (index, item) { $.each(fileList, function (index, item) {
html += '<tr>' + html += '<tr>' +
'<td>' + handleFileType(item.fileName) + item.fileName + '</td>' + '<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><img src="../../../images/user_head_icon.png" width="20px" height="20px">' + item.createName + '</td>' +
'<td>入库附件</td>' +
'<td>' + item.createTime + '</td>' + '<td>' + item.createTime + '</td>' +
'<td><a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewFile(' + JSON.stringify(item) + ')\'>预览</a>' + '<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>' + '<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'downLoadFile(' + JSON.stringify(item) + ')\'>下载</a>' +
@ -261,8 +259,8 @@ function viewGs(obj) {
layer.open({ layer.open({
type: 1, type: 1,
shade: false, // 不显示遮罩 shade: false, // 不显示遮罩
content: '<div style="padding: 1%;">' + obj.details + '</div>', content: '<div style="padding: 1%;">' + obj.info + '</div>',
title: '<h3 style="color: #F56C6C;">' + obj.createDay + '发货概述:</h3>', title: '<h3 style="color: #F56C6C;">' + obj.inputDay + '入库概述:</h3>',
btn: ['复制文字', '关闭'], btn: ['复制文字', '关闭'],
area: ['60%', '50%'], area: ['60%', '50%'],
move: false, move: false,

View File

@ -1,5 +1,5 @@
const dataUrl = 'http://127.0.0.1:21995/'; // 数据请求路径 const dataUrl = 'http://127.0.0.1:21995/'; // 数据请求路径
const fileUrl = 'http://127.0.0.1:21995/'; // 文件路径 const fileUrl = 'http://127.0.0.1:21995/statics'; // 文件路径

View File

@ -38,7 +38,7 @@
<img src="../../../images/svg/u418.svg"> <img src="../../../images/svg/u418.svg">
<div class="layout" style="flex-direction: column;align-items: start;margin-left: 10px;"> <div class="layout" style="flex-direction: column;align-items: start;margin-left: 10px;">
<p style="font-size: 18px;font-weight: bold;" id="titleName">2024-05-05配件入库记录</p> <p style="font-size: 18px;font-weight: bold;" id="titleName">2024-05-05配件入库记录</p>
<p id="code">20240607096</p> <p id="code"></p>
</div> </div>
</div> </div>
<div> <div>
@ -60,11 +60,11 @@
<th>入库日期</th> <th>入库日期</th>
</tr> </tr>
<tr> <tr>
<td id="userName"></td> <td id="codeValue"></td>
<td id="createDay"></td> <td id="inputNum"></td>
<td id="createDay2"></td> <td id="allPrice"></td>
<td id="createDay3"></td> <td id="inputUser"></td>
<td id="createDay4"></td> <td id="inputDay"></td>
</tr> </tr>
<tr> <tr>
<th colspan="5">备注</th> <th colspan="5">备注</th>
@ -83,8 +83,8 @@
<div id="file-table-box"> <div id="file-table-box">
<table class="classTable" id="file-table"> <table class="classTable" id="file-table">
<tr> <tr>
<th>文件名</th> <th style="width: 30%;">文件名</th>
<th>文件类型</th> <th style="width: 10%;">文件类型</th>
<th>上传人员</th> <th>上传人员</th>
<th>上传时间</th> <th>上传时间</th>
<th>操作</th> <th>操作</th>