问题修复
This commit is contained in:
parent
e41085ffb9
commit
a27acfa853
|
|
@ -83,13 +83,37 @@ function initTable() {
|
|||
cols: [
|
||||
[
|
||||
{
|
||||
width: '5.9%',
|
||||
width: '4%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
width: '12%',
|
||||
title: "工程",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
width: '4%',
|
||||
title: "类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
if (d.type===1){
|
||||
return "<span>车辆</span>";
|
||||
} else if (d.type===2) {
|
||||
return "<span>吊车</span>";
|
||||
} else {
|
||||
return "<span></span>";
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "code",
|
||||
width: '10%',
|
||||
|
|
@ -103,15 +127,14 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "userName",
|
||||
width: '10%',
|
||||
width: '7.1%',
|
||||
title: "申请人",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "appLyTime",
|
||||
width: '10%',
|
||||
width: '12%',
|
||||
title: "申请时间",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -138,9 +161,8 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "statusName",
|
||||
width: '10%',
|
||||
width: '7%',
|
||||
title: "派车状态",
|
||||
sort:true,
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
|
|
@ -149,15 +171,14 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "dispatchNum",
|
||||
width: '10%',
|
||||
width: '6%',
|
||||
title: "派车数量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "outTime",
|
||||
width: '10%',
|
||||
width: '8%',
|
||||
title: "派车日期",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -165,10 +186,9 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "auditStatus",
|
||||
width: '10%',
|
||||
width: '7%',
|
||||
title: "到货确认单",
|
||||
unresize: true,
|
||||
sort:true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return setIsUpload(d.fileNum);
|
||||
|
|
@ -176,7 +196,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: '9%',
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
|
|
|
|||
|
|
@ -100,22 +100,30 @@ function getDispatchCarData(id) {
|
|||
let html = '';
|
||||
if (fileList && fileList.length > 0) {
|
||||
$.each(fileList, function (index, item) {
|
||||
// 构建操作列
|
||||
let actions = '<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>';
|
||||
|
||||
// 如果是 "到货确认单",增加删除按钮
|
||||
if (item.type === '到货确认单') {
|
||||
actions += '<a style="margin:0 5px;color:#F5222D;cursor: pointer;" onclick=\'deleteFile(' + JSON.stringify(item) + ')\'>下载</a>';
|
||||
}
|
||||
|
||||
html += '<tr>' +
|
||||
'<td>' + handleFileType(item.fileName) + item.fileName + '</td>' +
|
||||
'<td>' + (item.type) + '</td>' +
|
||||
'<td><img src="../../../images/user_head_icon.png" width="20px" height="20px">' + item.createName + '</td>' +
|
||||
'<td>' + item.type + '</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>' +
|
||||
'<td>' + actions + '</td>' +
|
||||
'</tr>';
|
||||
})
|
||||
});
|
||||
} else {
|
||||
html = '<tr><td colspan="5" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#file-table tbody').after(html);
|
||||
$('#file-table tbody').html(html);
|
||||
}
|
||||
|
||||
|
||||
// 处理文件类型
|
||||
function handleFileType(value) {
|
||||
value = value.toLowerCase();
|
||||
|
|
@ -257,6 +265,33 @@ function downLoadFile(obj) {
|
|||
downLoadFileUtil(url, obj.fileName, null);
|
||||
}
|
||||
|
||||
function deleteFile(item) {
|
||||
layer.confirm("确定要删除文件吗?", { 'title': '操作提示', move: false }, function () {
|
||||
let loadingMsg = layer.msg('数据删除中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
|
||||
let url = dataUrl + "backstage/supDispatchCar/deleteFile"
|
||||
let obj = {
|
||||
'delFileId': item.id
|
||||
}
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(obj)
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
if (result.code === 200) {
|
||||
layer.msg(result.msg, { icon: 1 })
|
||||
getDispatchCarListData(objParam.id);
|
||||
getDispatchCarData(objParam.id);
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2 })
|
||||
}
|
||||
}, function (xhr) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
error(xhr)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 查看附件
|
||||
function viewFileDetail(obj, type) {
|
||||
let title = '行驶证/挂靠协议驾驶证/身份证/导航图'
|
||||
|
|
@ -312,6 +347,7 @@ function reloadAuditData() {
|
|||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
let index = parent.layer.getFrameIndex(window.name); // 获取当前 iframe 层的索引
|
||||
parent.initTable(); // 刷新上级页面的表格数据
|
||||
parent.layer.close(index); // 关闭弹出层
|
||||
}
|
||||
|
|
@ -58,6 +58,9 @@ function openIframeByParamObj(id, title, content, width, height, paramsObj, isCa
|
|||
// 采购发货刷新一级页面
|
||||
reloadData();
|
||||
}
|
||||
if (id==='arrivalConfirmDetail'){
|
||||
initTable();
|
||||
}
|
||||
},
|
||||
end: function () { }
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<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">
|
||||
class="layui-input" lay-affix="clear" placeholder="输入关键字" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
|
|
|||
Loading…
Reference in New Issue