问题修复

This commit is contained in:
hayu 2025-07-15 20:36:25 +08:00
parent a27acfa853
commit bc7d802ca8
2 changed files with 123 additions and 12 deletions

View File

@ -92,7 +92,7 @@ function initTable() {
},
{
field: "proName",
width: '12%',
width: '11%',
title: "工程",
unresize: true,
align: "center",
@ -116,11 +116,10 @@ function initTable() {
},
{
field: "code",
width: '10%',
width: '8.5%',
title: "需求计划编号",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
return "<a style='color:#409eff;' onclick='viewPlanDetail(" + JSON.stringify(d) + ")'>" + d.code + "</a>";
},
@ -134,7 +133,7 @@ function initTable() {
},
{
field: "appLyTime",
width: '12%',
width: '10%',
title: "申请时间",
unresize: true,
align: "center",
@ -142,10 +141,9 @@ function initTable() {
},
{
field: "remark",
width: '15%',
width: '10.5%',
title: "备注",
unresize: true,
sort:true,
align: "center",
templet: function (d) {
if (d.remark) {
@ -161,7 +159,7 @@ function initTable() {
},
{
field: "statusName",
width: '7%',
width: '6%',
title: "派车状态",
unresize: true,
align: "center",
@ -182,7 +180,6 @@ function initTable() {
title: "派车日期",
unresize: true,
align: "center",
sort:true,
},
{
field: "auditStatus",
@ -194,16 +191,57 @@ function initTable() {
return setIsUpload(d.fileNum);
},
},
{
field: "fileStatus",
width: '6%',
title: "状态",
unresize: true,
align: "center",
templet: function(d) {
let statusText = d.fileStatus;
let colorClass = '';
switch (statusText) {
case '待上传':
colorClass = 'layui-bg-red'; // 红色
break;
case '待审核':
colorClass = 'layui-bg-orange'; // 橙色
break;
case '审核通过':
colorClass = 'layui-bg-green'; // 绿色
break;
case '审核驳回':
colorClass = 'layui-bg-red'; // 红色
break;
default:
colorClass = 'layui-bg-gray'; // 默认灰色
break;
}
return `<span class="layui-badge ${colorClass}" style="border-radius: 4px;">${statusText}</span>`;
}
},
{
title: "操作",
width: '8%',
width: '11.5%',
align: "center",
unresize: true,
templet: function (d) {
let html = "";
html += "<a onclick='arrivalConfirmDetail(" + JSON.stringify(d) + ")'>详情</a>";
if(d.fileNum === 0){
// if(d.fileNum === 0){
// html += "<div class='splitLine'>|</div><a onclick='uploadConfirm(" + JSON.stringify(d) + ")'>上传</a>";
// } else {
// html += "<div class='splitLine'>|</div><a onclick='examine(" + JSON.stringify(d) + ")'>审核</a>";
// }
if (d.fileStatus==='待上传'){
html += "<div class='splitLine'>|</div><a onclick='uploadConfirm(" + JSON.stringify(d) + ")'>上传</a>";
} else if (d.fileStatus==='待审核'){
html += "<div class='splitLine'>|</div><a onclick='examine(" + JSON.stringify(d) + ")'>审核</a>";
} else if (d.fileStatus==='审核驳回'){
html += "<div class='splitLine'>|</div><a onclick='uploadConfirm(" + JSON.stringify(d) + ")'>上传</a>";
html += "<div class='splitLine'>|</div><a onclick='toCheck(" + JSON.stringify(d) + ")'>提交审核</a>";
}
return html;
},
@ -230,8 +268,81 @@ function exportExcel() {
exportExcelUtil(url, '到货确认单', JSON.stringify(params));
}
function toCheck(item) {
layer.confirm("确定要提交审核吗?", { 'title': '操作提示', move: false }, function () {
let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
let url = dataUrl + "backstage/supDispatchCar/toCheck"
let obj = {
id: 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 })
initTable();
} else {
layer.msg(result.msg, { icon: 2 })
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
});
})
}
function examine(item) {
// 创建自定义的 layer 弹窗
const index = layer.confirm(
'请选择审核结果:',
{
title: '审核操作',
move: false,
btn: ['不通过', '通过'] // 按钮顺序:左 -> 不通过,右 -> 通过
},
function () {
// 点击 "不通过" 的回调函数(左侧按钮)
submitExamineStatus(item, 2);
},
function () {
// 点击 "通过" 的回调函数(右侧按钮)
submitExamineStatus(item, 1);
}
);
}
// 提交审核状态的方法
function submitExamineStatus(item, status) {
let loadingMsg = layer.msg('提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
let url = dataUrl + "backstage/supDispatchCar/examine"; // 假设这是你的审核接口
let obj = {
id: item.id,
status: status // 1: 通过0: 不通过
};
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 });
initTable();
} else {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr);
});
}
//审核状态
function setIsUpload(value) {
if (value > 0) {

View File

@ -105,8 +105,8 @@ function getDispatchCarData(id) {
'<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>';
if (item.type === '到货确认单' && item.status!=='1') {
actions += '<a style="margin:0 5px;color:#F5222D;cursor: pointer;" onclick=\'deleteFile(' + JSON.stringify(item) + ')\'>删除</a>';
}
html += '<tr>' +