付款单申请审核
This commit is contained in:
parent
a7dfc8ce36
commit
97eb522fb8
|
|
@ -56,87 +56,176 @@ function setParams(obj) {
|
|||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
getNeedPlanDetails();
|
||||
initTable();
|
||||
getBalanceDataDetails();
|
||||
// initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 详情
|
||||
function getNeedPlanDetails() {
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'id': objParam.id
|
||||
})
|
||||
};
|
||||
let url = dataUrl + 'backstage/carNeedPlan/getNeedPlanDetails';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
function getBalanceDataDetails() {
|
||||
let encryptedData = {id: objParam.id};
|
||||
let url = dataUrl + 'backstage/carBalance/getBalanceDataDetails?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
|
||||
ajaxRequest(url, "GET", null, true, function () {
|
||||
}, function (result) {
|
||||
|
||||
if (result.code === 200) {
|
||||
setPlanBasicTableInfo(result.data);
|
||||
setOperRecordInfo(result.data.recordList, result.data);
|
||||
setCheckStatus(result.data);
|
||||
setOperRecordInfo(result.data.aulditList, result.data);
|
||||
// setCheckStatus(result.data);
|
||||
|
||||
// 计划明细回显
|
||||
planDetail(result.data.planList)
|
||||
// 用车明细回显
|
||||
carDetail(result.data.detailsList)
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}
|
||||
|
||||
// 基本信息
|
||||
function setPlanBasicTableInfo(obj) {
|
||||
$('#proName').html(obj.proName);
|
||||
$('#projectPart').html(obj.projectPart);
|
||||
$('#projectContent').html(obj.projectContent);
|
||||
$('#needTime').html(obj.needTime);
|
||||
$('#remark').html(obj.remark);
|
||||
|
||||
$('#carLength').html(obj.carLength);
|
||||
$('#carWidth').html(obj.carWidth);
|
||||
$('#carHeight').html(obj.carHeight);
|
||||
$('#carWeight').html(obj.carWeight);
|
||||
$('#carStart').html(obj.carStart);
|
||||
$('#carEnd').html(obj.carEnd);
|
||||
|
||||
setRoutePoint(obj.routePoint);
|
||||
|
||||
// 附件文档
|
||||
setFileTable(obj.fileList);
|
||||
}
|
||||
|
||||
function setRoutePoint(data) {
|
||||
// 清空之前的表格
|
||||
$('#routePoint').empty();
|
||||
function planDetail(list) {
|
||||
$('#plan-detail-table tr:not(:first)').remove();
|
||||
if (list.length > 0) {
|
||||
let html = '';
|
||||
html += "<table class='classTable'>";
|
||||
if (data != null && data !== "") {
|
||||
// 分割数据并过滤掉空值
|
||||
let result = data.split("routePoint;").filter(item => item.trim() !== "");
|
||||
if (result && result.length > 0) {
|
||||
// 动态生成表头
|
||||
html += "<tr>";
|
||||
for (let i = 0; i < Math.min(result.length, 4); i++) {
|
||||
html += "<th>途经点</th>";
|
||||
$.each(list, function (index, item) {
|
||||
html += '<tr>' +
|
||||
'<td>' + (index + 1) + '</td>' +
|
||||
'<td>' + item.proName + '</td>' +
|
||||
'<td>' + item.code + '</td>' +
|
||||
'<td>' + item.supName + '</td>' +
|
||||
'<td>' + item.carNum + '</td>' +
|
||||
'<td>' + item.money + '</td>' +
|
||||
'<td>' + item.ygMoney + '</td>' +
|
||||
'</tr>';
|
||||
});
|
||||
$('#plan-detail-table').append(html);
|
||||
}
|
||||
html += "</tr>";
|
||||
// 动态生成表格内容,每行最多 4 列
|
||||
let rowCount = Math.ceil(result.length / 4); // 计算需要多少行
|
||||
for (let row = 0; row < rowCount; row++) {
|
||||
html += "<tr>";
|
||||
for (let col = 0; col < 4; col++) {
|
||||
let index = row * 4 + col;
|
||||
if (index < result.length) {
|
||||
html += "<td>" + result[index] + "</td>";
|
||||
}
|
||||
|
||||
function carDetail(list) {
|
||||
// 派车明细
|
||||
let carList = list.filter(item => {
|
||||
return item.type === '车辆';
|
||||
})
|
||||
let dcList = list.filter(item => {
|
||||
return item.type === '吊车';
|
||||
})
|
||||
setDispatchCarTable(carList);
|
||||
setDispatchCarTable2(dcList);
|
||||
|
||||
// 派车明细-车辆
|
||||
function setDispatchCarTable(list) {
|
||||
$('#dispatch-car-table tr:not(:first)').remove();
|
||||
if (list.length > 0) {
|
||||
let html = '';
|
||||
if (list && list.length > 0) {
|
||||
$.each(list, function (index, item) {
|
||||
let imgNum = 0;
|
||||
imgNum += item.carImage.filter(item => {
|
||||
return item.type !== '6'
|
||||
}).length;
|
||||
imgNum += item.driverUserImage.filter(item => {
|
||||
return item.type !== '6'
|
||||
}).length;
|
||||
imgNum += item.fileList.length;
|
||||
|
||||
const actualGls = item.exeGls; // 实际公里数初始=预估公里数
|
||||
|
||||
html += "<tr>" +
|
||||
"<td>" + item.type + "</td>" +
|
||||
"<td>" + item.name + "</td>" +
|
||||
"<td>" + item.model + "</td>" +
|
||||
"<td>" + item.carNum + "</td>" +
|
||||
"<td>" + (item.ton + '吨') + "</td>" +
|
||||
"<td>" + item.goodsName + "</td>" +
|
||||
"<td>" + item.startAddress + "</td>" +
|
||||
"<td>" + item.endAddress + "</td>" +
|
||||
|
||||
"<td>" + actualGls + "</td>" +
|
||||
"<td>" + item.glsPrice + "</td>" +
|
||||
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
|
||||
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",1)'>查看附件>></a></td>" +
|
||||
"<td><a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewPlanDetail(" + JSON.stringify(item) + ")'>" + item.planCode + "</a></td>" +
|
||||
"</tr>";
|
||||
})
|
||||
} else {
|
||||
html += "<td></td>"; // 如果没有数据,填充空白单元格
|
||||
html = '<tr><td colspan="13" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#dispatch-car-table').removeAttr('style').append(html);
|
||||
} else {
|
||||
$('#dispatch-car-table').css('display', 'none');
|
||||
}
|
||||
}
|
||||
html += "</tr>";
|
||||
|
||||
// 派车明细-吊车
|
||||
function setDispatchCarTable2(list) {
|
||||
$('#dispatch-car-table2 tr:not(:first)').remove();
|
||||
if (list.length > 0) {
|
||||
let html = '';
|
||||
if (list && list.length > 0) {
|
||||
$.each(list, function (index, item) {
|
||||
let imgNum = 0;
|
||||
imgNum += item.driverUserImage.filter(item => {
|
||||
return item.type === '2' || item.type === '3'
|
||||
}).length;
|
||||
imgNum += item.operaImage.filter(item => {
|
||||
return item.type === '2' || item.type === '3' || item.type === '6'
|
||||
}).length;
|
||||
imgNum += item.fileList.length;
|
||||
|
||||
const actualPlanDay = item.exeDay || 0;
|
||||
const actualDcMoney = item.money;
|
||||
|
||||
html += '<tr>' +
|
||||
'<td>' + item.type + '</td>' +
|
||||
'<td>' + item.name + '</td>' +
|
||||
'<td>' + item.model + '</td>' +
|
||||
'<td>' + item.carNum + '</td>' +
|
||||
'<td>' + item.useAddress + '</td>' +
|
||||
'<td>' + item.exeDay + '</td>' +
|
||||
|
||||
'<td>' + setZlPrice(item) + '</td>' +
|
||||
'<td> ¥ ' + item.dcMoney + '</td>' +
|
||||
'<td>' + actualDcMoney + '</td>' +
|
||||
|
||||
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>" +
|
||||
"<td><a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewPlanDetail(" + JSON.stringify(item) + ")'>" + item.planCode + "</a></td>" +
|
||||
'</tr>';
|
||||
})
|
||||
} else {
|
||||
html = '<tr><td colspan="10" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#dispatch-car-table2').removeAttr('style').append(html);
|
||||
|
||||
// 设置租赁单价
|
||||
function setZlPrice(item) {
|
||||
let html = '';
|
||||
if (item.dcUnit === '元/月/台') {
|
||||
html += '<p>' + item.monthPrice + '(' + item.dcUnit + ')' + '</p>';
|
||||
} else {
|
||||
html += '<p>' + item.dayPrice + '(' + item.dcUnit + ')' + '</p>';
|
||||
}
|
||||
if (item.isOutSet === 1) {
|
||||
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
|
||||
}
|
||||
return html;
|
||||
}
|
||||
} else {
|
||||
$('#dispatch-car-table2').css('display', 'none');
|
||||
}
|
||||
}
|
||||
}
|
||||
html += "</table>";
|
||||
// 将生成的 HTML 插入到页面中
|
||||
$('#routePoint').append(html);
|
||||
|
||||
// 基本信息
|
||||
function setPlanBasicTableInfo(dataObj) {
|
||||
$('#supId').html(dataObj.supId);
|
||||
$('#supName').html(dataObj.supName);
|
||||
$('#fkTime').html(dataObj.fkTime);
|
||||
$('#money').html(dataObj.money);
|
||||
$('#remark').html(dataObj.remark);
|
||||
$('#planListNum').html(dataObj.planList.length)
|
||||
// 附件文档
|
||||
setFileTable(dataObj.fileList);
|
||||
}
|
||||
|
||||
// 附件文档赋值
|
||||
|
|
@ -421,40 +510,43 @@ function setOperRecordInfo(list, obj) {
|
|||
let imgUrl = '../../../images/user_head_icon.png';
|
||||
let imgUrl2 = '../../../images/time_icon.png';
|
||||
$.each(list, function (index, item) {
|
||||
const creator = (item.nikeName ? item.nikeName : item.userName);
|
||||
const creator = item.userName;
|
||||
// 1. 容错处理(统一处理空值、类型转换)
|
||||
const remark = setNullValue(item.auditRemark); // 已有空值处理,保留
|
||||
const remark = setNullValue(item.auditReason); // 已有空值处理,保留
|
||||
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
|
||||
const auditStatus = item.auditStatus + ''; // 确保为字符串
|
||||
const times = setNullValue(item.times) || '0'; // 时间间隔容错(避免拼接 undefined)
|
||||
const times = setNullValue(item.auditTime) || '0'; // 时间间隔容错(避免拼接 undefined)
|
||||
|
||||
// 2. 部门映射表(替代多 if-else,清晰直观)
|
||||
const deptMap = {
|
||||
'0': '项目部',
|
||||
'0': '分包商',
|
||||
'1': '项目部',
|
||||
'-1': '项目部',
|
||||
'2': '分公司',
|
||||
'3': '项管中心',
|
||||
'4': '智联装备云控公司',
|
||||
'5': '供应商'
|
||||
'2': '防线部门',
|
||||
'3': '分公司',
|
||||
'4': '经营部',
|
||||
'5': '总公司'
|
||||
};
|
||||
const dept = deptMap[auditType] || '未知部门'; // 默认值容错
|
||||
|
||||
// 3. 操作流程规则(按「优先级+条件组合」定义,避免逻辑冲突)
|
||||
const operRules = [
|
||||
// 规则:[条件函数, 操作文案],按优先级排序(先匹配先执行)
|
||||
[() => index === 0 && auditType === '1', '发起申请'],
|
||||
[() => index !== 0 && auditType === '1', '提交派车申请'],
|
||||
[() => index !== 0 && auditType === '9' && auditStatus === '9', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
[() => index !== 0 && auditType === '2' && auditStatus === '1', `审核确认通过,共间隔:${times} 原因备注:${remark}`],
|
||||
[() => index !== 0 && auditType === '2' && auditStatus === '2', `完结-审核确认通过,共耗时:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '2' && auditStatus === '2', `审核确认通过,共间隔:${times} 原因备注:${remark}`], // 原逻辑:无 index 限制
|
||||
[() => auditType === '2' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '3' && auditStatus === '2', `审核确认通过,共间隔:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '3' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '4' && auditStatus === '2', `完结-审核确认通过,共耗时:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '4' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '5' && auditStatus === '2', `派车情况-${remark},共耗时:${times}`]
|
||||
[() => index === 0 && auditType == '0', '发起申请'],
|
||||
|
||||
[() => auditType === '1' && auditStatus == '1', `审核确认通过,时间:${times} 原因备注:${remark}`], // 原逻辑:无 index 限制
|
||||
[() => auditType === '1' && auditStatus == '2', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
|
||||
[() => auditType === '2' && auditStatus == '1', `审核确认通过,时间:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '2' && auditStatus == '2', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
|
||||
[() => auditType === '3' && auditStatus == '1', `完结-审核确认通过,时间:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '3' && auditStatus == '2', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
|
||||
[() => auditType === '4' && auditStatus == '1', `完结-审核确认通过,时间:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '4' && auditStatus == '2', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
|
||||
[() => auditType === '5' && auditStatus == '1', `完结-审核确认通过,时间:${times} 原因备注:${remark}`],
|
||||
[() => auditType === '5' && auditStatus == '2', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
|
||||
];
|
||||
|
||||
// 匹配操作文案(默认值容错)
|
||||
|
|
@ -476,7 +568,7 @@ function setOperRecordInfo(list, obj) {
|
|||
'</div>' +
|
||||
'<div class="user-oper layout">' +
|
||||
'<div style="width: 100%">' +
|
||||
'<span>' + (item.nikeName ? item.nikeName : item.userName) + '</span><span>(' + item.phone + ')</span><span>' + dept + '</span>' +
|
||||
'<span>' + (item.auditReason ? item.auditReason : item.auditUser) + '</span><span>' + dept + '</span>' +
|
||||
'</div>' +
|
||||
'<div style="width: 100%">' +
|
||||
'<span>' + operData + '</span>' +
|
||||
|
|
@ -577,9 +669,31 @@ function withdrawData(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查看附件
|
||||
function viewFileDetail(obj, type) {
|
||||
let title = '行驶证/挂靠协议驾驶证/身份证/导航图'
|
||||
if (type === 1) {
|
||||
title = '行驶证/挂靠协议驾驶证/身份证/导航图'
|
||||
} else if (type === 2) {
|
||||
title = '操作证/身份证/导航图'
|
||||
}
|
||||
obj.type = type;
|
||||
openIframeByParamObj("viewFileDetail", title, '../../car_demand_plan/child/view_file_detail.html', "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
function viewPlanDetail(obj) {
|
||||
obj.id = obj.planId;
|
||||
obj.code = obj.planCode;
|
||||
let content = '../car_demand_plan/child/apply_plan_detail.html';
|
||||
if (obj.code.indexOf('spec-') > -1) {
|
||||
content = '../car_demand_plan/child/emerg_internal_car_detail.html';
|
||||
}
|
||||
openIframeByParamObj2("viewPlanDetail", "车辆需求计划", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 需求计划申请审核
|
||||
function check() {
|
||||
objParam.checkType = '2'; // 需求计划申请审核
|
||||
objParam.token = token;
|
||||
openIframeByParamObj("check", "审核", "./car_audit_form.html", "40%", "50%", objParam, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ function setParams(params) {
|
|||
submitApply(data);
|
||||
});
|
||||
form.on('radio(auditStatus)', function (data) {
|
||||
if (data.value === '2') { // 通过
|
||||
$('#remark').removeAttr('lay-verify');
|
||||
$('#remark').val("申请通过"); // textarea 设置内容用 val()
|
||||
if (data.value === '1') { // 通过
|
||||
$('#auditReason').removeAttr('lay-verify');
|
||||
$('#auditReason').val("申请通过"); // textarea 设置内容用 val()
|
||||
$('#auditRemarksLabel').removeClass('required');
|
||||
} else if (data.value === '3') { // 不通过
|
||||
$('#remark').attr('lay-verify', 'required');
|
||||
$('#remark').val("申请驳回"); // textarea 设置内容用 val()
|
||||
} else if (data.value === '2') { // 不通过
|
||||
$('#auditReason').attr('lay-verify', 'required');
|
||||
$('#auditReason').val("申请驳回"); // textarea 设置内容用 val()
|
||||
$('#auditRemarksLabel').addClass('required');
|
||||
}
|
||||
});
|
||||
|
|
@ -38,25 +38,13 @@ function submitApply(data) {
|
|||
shade: 0.01,
|
||||
time: '0'
|
||||
});
|
||||
|
||||
let url = '';
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
url = dataUrl + 'backstage/dispatchCar/dispatchAudit';
|
||||
// 出库单ID、合同ID
|
||||
let url = dataUrl + 'backstage/carBalance/sltAudit';
|
||||
data.field.id = idParam;
|
||||
data.field.contractId = objParam.contractId;
|
||||
data.field.outId = objParam.outId;
|
||||
data.field.planId = objParam.planId;
|
||||
data.field.supId = objParam.supId;
|
||||
data.field.status = data.field.status === '2' ? '1' : '2';
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
url = dataUrl + 'backstage/carPlanAudit/auditInfo';
|
||||
data.field.id = idParam;
|
||||
}
|
||||
data.field.auditStatus = data.field.status;
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(data.field)
|
||||
};
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
ajaxRequest(url, "GET", params, true, function () {
|
||||
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
}, function (result) {
|
||||
|
|
@ -64,18 +52,28 @@ function submitApply(data) {
|
|||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
if (result.code === 200) {
|
||||
top.layer.msg(result.msg, {icon: 1});
|
||||
if (objParam.token) {
|
||||
// 如果没有 token,直接关闭整个窗口
|
||||
window.parent.open('', '_self');
|
||||
window.parent.close();
|
||||
return;
|
||||
} else {
|
||||
closePage(1);
|
||||
// top.layer.msg(result.data, {icon: 1});
|
||||
// if (objParam.token) {
|
||||
// // 如果没有 token,直接关闭整个窗口
|
||||
// window.parent.open('', '_self');
|
||||
// window.parent.close();
|
||||
// return;
|
||||
// } else {
|
||||
// closePage(1);
|
||||
// }
|
||||
|
||||
const topParent = window.top;
|
||||
// 2. 调用最外层父页面的刷新表格函数
|
||||
if (topParent.queryTable) {
|
||||
topParent.queryTable(1); // 执行最外层的刷新
|
||||
}
|
||||
// 3. 关闭所有layui弹窗(包括所有iframe层)
|
||||
topParent.layer.closeAll();
|
||||
// 4. 提示成功
|
||||
topParent.layer.msg(result.data, {icon: 1});
|
||||
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
layer.msg(result.data, {icon: 2});
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
|
|
@ -89,14 +87,5 @@ function submitApply(data) {
|
|||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
|
||||
|
||||
if (type == 1) {
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
window.parent.reloadAuditData();
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
window.parent.closePage();
|
||||
}
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,30 @@ function initTable() {
|
|||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "carName",
|
||||
width: '14%',
|
||||
title: "车辆类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
templet: function (d) {
|
||||
var type = d.type;
|
||||
if (type == 1) {
|
||||
return '车辆';
|
||||
} else if (type == 2) {
|
||||
return '吊车';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "planNum",
|
||||
width: '10%',
|
||||
title: "车辆数量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "ygMoney",
|
||||
width: '14%',
|
||||
|
|
@ -127,7 +151,7 @@ function initTable() {
|
|||
sort:true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return getCheckStatus(d.status);
|
||||
return getCheckStatus(d.auditType ,d.status);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -173,19 +197,21 @@ function initTable() {
|
|||
unresize: true,
|
||||
templet: function (d) {
|
||||
let html = "";
|
||||
let content = getCheckStatus(d.status);
|
||||
if(!(content.indexOf('驳回') > -1)){
|
||||
let status = d.status;
|
||||
if(status == -1){
|
||||
html += "<a onclick='checkSubmit(" + JSON.stringify(d) + ")'>提交</a><div class='splitLine'>|</div>"
|
||||
}
|
||||
|
||||
if(!(content.indexOf('驳回') > -1)){
|
||||
if(status == -1 || status == 2){
|
||||
html += "<a onclick='checkUpdate(" + JSON.stringify(d) + ")'>修改</a><div class='splitLine'>|</div>"
|
||||
html += "<div class='splitLine'>|</div><a onclick='checkDelete(" + JSON.stringify(d) + ")'>删除</a>";
|
||||
}
|
||||
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>详情</a>";
|
||||
if ( status == 1 ) {
|
||||
html += "<div class='splitLine'>|</div><a onclick='checkDetail(" + JSON.stringify(d) + ")'>审核</a>";
|
||||
}
|
||||
|
||||
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>详情</a>";
|
||||
|
||||
if (!(content.indexOf('驳回') > -1 || content.indexOf('已撤回') > -1 || content.indexOf('通过') > -1)) {
|
||||
html += "<div class='splitLine'>|</div><a onclick='checkDetail(" + JSON.stringify(d) + ")'>审核</a>";
|
||||
if(status == 0){
|
||||
html += "<div class='splitLine'>|</div><a onclick='checkAuditDetail(" + JSON.stringify(d) + ")'>审核记录</a>";
|
||||
}
|
||||
return html;
|
||||
},
|
||||
|
|
@ -213,28 +239,30 @@ function exportExcel() {
|
|||
}
|
||||
|
||||
//审核状态
|
||||
function getCheckStatus(status) {
|
||||
if(status === 0){
|
||||
function getCheckStatus(auditType,status) {
|
||||
|
||||
if(status == 0){
|
||||
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>全部通过";
|
||||
}
|
||||
/*var company = "";
|
||||
if (statusType === 1) {
|
||||
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核通过";
|
||||
} else if (statusType === 2) {
|
||||
company = "分公司";
|
||||
} else if (statusType === 3) {
|
||||
company = "项目管理中心";
|
||||
} else if (statusType === 4) {
|
||||
company = "机具公司";
|
||||
}*/
|
||||
if (status === 1) {
|
||||
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待审核";
|
||||
} else if (status === 2) {
|
||||
let name = '分包商';
|
||||
if(auditType == 1){
|
||||
name = "项目部"
|
||||
}else if(auditType == 2){
|
||||
name = "防线部门"
|
||||
}else if(auditType == 3){
|
||||
name = "分公司"
|
||||
}else if(auditType == 4){
|
||||
name = "经营部"
|
||||
}else if(auditType == 5){
|
||||
name = "总公司"
|
||||
}
|
||||
if (status == 1) {
|
||||
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>"+ name+"待审核";
|
||||
} else if (status == 2) {
|
||||
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核驳回";
|
||||
} else if (status === -3) {
|
||||
} else if (status == -1) {
|
||||
return "<span style='color:#F56C6C;margin:0 5px 0 5px;font-size:16px'>●</span>待提交";
|
||||
}
|
||||
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待提交";
|
||||
}
|
||||
|
||||
// 详情
|
||||
|
|
@ -248,35 +276,68 @@ function checkDetail(obj) {
|
|||
openIframeByParamObj("car_check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
|
||||
}
|
||||
|
||||
|
||||
function checkAuditDetail(obj) {
|
||||
// obj.checkType = 2;
|
||||
openIframeByParamObj("car_check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
|
||||
}
|
||||
|
||||
|
||||
//提交
|
||||
function checkSubmit(obj) {
|
||||
layer.confirm("确定提交此条数据吗?", { 'title': '操作提示', move: false }, function () {
|
||||
let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
|
||||
let url = dataUrl + "backstage/carType/deleteType"
|
||||
let obj = { 'id': id }
|
||||
let url = dataUrl + "backstage/carBalance/sltSubmitAudit"
|
||||
let data = { 'id': obj.id }
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(obj)
|
||||
encryptedData: JSON.stringify(data)
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
ajaxRequest(url, "GET", params, true, function () {
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
if (result.code === 200) {
|
||||
layer.msg(result.msg, { icon: 1 })
|
||||
if (type === 1) {
|
||||
fitTypeTree.partialRefreshDel($div); // 删除节点
|
||||
} else if (type === 2) {
|
||||
dtreeData = getDTreeData();
|
||||
dtree.reload("fitTypeTree", {
|
||||
data: dtreeData
|
||||
});
|
||||
}
|
||||
layer.msg(result.data, { icon: 1 })
|
||||
queryTable(1);
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2 })
|
||||
layer.msg(result.data, { icon: 2 })
|
||||
}
|
||||
}, function (xhr) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
error(xhr)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
function checkDelete(obj) {
|
||||
layer.confirm("确定删除此条数据吗?", { 'title': '操作提示', move: false }, function () {
|
||||
let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
|
||||
let url = dataUrl + "backstage/carBalance/delBalanceData"
|
||||
let postData = { 'id': obj.id };
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
headers: {
|
||||
"authorization": sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
type: "POST",
|
||||
contentType: "application/json;charset=utf-8", // 指定Body为JSON格式
|
||||
data: JSON.stringify(postData), // 直接传JSON字符串,不加密
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
layer.close(loadingMsg);
|
||||
if (result.code === 200) { // 假设后端返回code=200代表成功
|
||||
layer.msg('删除成功!', { icon: 1 });
|
||||
queryTable(1); // 刷新表格
|
||||
layer.closeAll(); // 关闭所有弹窗
|
||||
} else {
|
||||
layer.msg('删除失败:' + (result.msg || '未知错误'), { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
layer.close(loadingMsg);
|
||||
layer.msg('删除失败,服务异常!', { icon: 2 });
|
||||
console.error('删除请求错误:', error); // 调试用
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ function getBalanceDataDetails() {
|
|||
|
||||
//基本信息回显
|
||||
let dataObj = result.data;
|
||||
$('#supId').val(dataObj.supId);
|
||||
$('#supName').val(dataObj.supName);
|
||||
$('#fkTime').val(util.toDateString(dataObj.fkTime, 'yyyy-MM-dd'));
|
||||
$('#money').val(dataObj.money);
|
||||
|
|
@ -409,7 +410,7 @@ function submitApply(data) {
|
|||
let obj = {
|
||||
id: item.id || '',
|
||||
planId: item.planId || item.id,
|
||||
supId: objParam.supId,
|
||||
supId: item.supId,
|
||||
money: item.money,
|
||||
type: item.type || '1',
|
||||
proId: item.proId || '',
|
||||
|
|
@ -434,7 +435,7 @@ function submitApply(data) {
|
|||
exeGls: carActual?.exeGls || item.exeGls || '',
|
||||
inMoney: carActual?.inMoney || craneActual?.inMoney || '',
|
||||
exeDay: craneActual?.exeDay || item.exeDay || '',
|
||||
outDetailId: item.id || '',
|
||||
outDetailId: item.outDetailId || '',
|
||||
modelId: item.modelId || '',
|
||||
ton: item.ton || 0
|
||||
};
|
||||
|
|
@ -697,12 +698,12 @@ function getEditedActualValues() {
|
|||
|
||||
// 修复列索引:实际公里数输入框在td:eq(9),预估公里数在td:eq(8)
|
||||
const actualGls = $tr.find('.actual-gls').val().trim() || $tr.find('td:eq(8)').text().trim() || '0.00';
|
||||
const actualMoney = $tr.find('.actual-money').val()?.trim() || '0.00';
|
||||
// const actualMoney = $tr.find('.actual-money').val()?.trim() || '0.00';
|
||||
|
||||
actualValues.carActualList.push({
|
||||
outDetailId: itemId,
|
||||
exeGls: formatToTwoDecimals(actualGls),
|
||||
inMoney: formatToTwoDecimals(actualMoney)
|
||||
inMoney: 0
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ function getEditedActualValues() {
|
|||
actualValues.carActualList.push({
|
||||
outDetailId: itemId,
|
||||
exeGls: actualGls,
|
||||
inMoney: actualMoney
|
||||
inMoney: 0
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
</div>
|
||||
<!--基本信息-->
|
||||
<div id="plan-basic-box" class="layout" style="margin-top: 110px">
|
||||
<input type="hidden" id="supId" name="supId">
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>基本信息</p>
|
||||
|
|
@ -37,38 +38,24 @@
|
|||
<div id="plan-basic-table">
|
||||
<table class="classTable">
|
||||
<tr>
|
||||
<th>项目名称</th>
|
||||
<th>项目部分</th>
|
||||
<th>工程内容</th>
|
||||
<th>需用日期</th>
|
||||
<th>供应商</th>
|
||||
<th>选择需求计划数</th>
|
||||
<th>付款日期</th>
|
||||
<th>本次付款金额</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="proName"></td>
|
||||
<td id="projectPart"></td>
|
||||
<td id="projectContent"></td>
|
||||
<td id="needTime"></td>
|
||||
<td id="supName"></td>
|
||||
<td id="planListNum"></td>
|
||||
<td id="fkTime"></td>
|
||||
<td id="money"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4">计划说明</th>
|
||||
<th colspan="4">备注</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" id="remark"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>预计运输物品重量(吨)</th>
|
||||
<th>运输起点</th>
|
||||
<th>运输终点</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="carWeight"></td>
|
||||
<td id="carStart"></td>
|
||||
<td id="carEnd"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="routePoint"></div>
|
||||
</div>
|
||||
|
||||
<div id="file-box">
|
||||
|
|
@ -89,13 +76,34 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>计划明细</p>
|
||||
</div>
|
||||
|
||||
<!-- 新增计划明细表格 -->
|
||||
<div id="plan-detail-table-box" style="padding: 0 39px; margin-bottom: 20px;">
|
||||
<table class="classTable" id="plan-detail-table">
|
||||
<tr>
|
||||
<th style="width: 6%;">序号</th>
|
||||
<th style="width: 15%;">工程名称</th>
|
||||
<th style="width: 12%;">需求计划编号</th>
|
||||
<th style="width: 15%;">供应商名称</th>
|
||||
<th style="width: 8%;">用车数量</th>
|
||||
<th style="width: 10%;">金额</th>
|
||||
<th style="width: 10%;">预估金额</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--申请明细-->
|
||||
<div id="implement-box" class="layout">
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>申请明细</p>
|
||||
<p>用车明细</p>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<!--<div class="page-content">
|
||||
<form class="layui-form layui-form-pane no-print" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
|
|
@ -124,6 +132,43 @@
|
|||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div id="dispatch-car-table-box">
|
||||
<table class="classTable" id="dispatch-car-table" style="display: none;">
|
||||
<tr>
|
||||
<th style="width: 5%;">类型</th>
|
||||
<th style="width: 6%;">车型</th>
|
||||
<th style="width: 6%;">型号</th>
|
||||
<th style="width: 7%;">车牌</th>
|
||||
<th style="width: 6%;">吨位</th>
|
||||
<th style="width: 7%;">货物名称</th>
|
||||
<th style="width: 7%;">起运地</th>
|
||||
<th style="width: 7%;">目的地</th>
|
||||
<!-- <th style="width: 5%;">预估公里数</th>-->
|
||||
<th style="width: 5%;">公里数</th>
|
||||
<th style="width: 6%;">单价<br>(元/吨*公里)</th>
|
||||
<th style="width: 6%;">金额</th>
|
||||
<th style="width: 10%;">行驶证/挂靠协议<br>驾驶证/身份证/导航图</th>
|
||||
<th style="width: 9%;">需求计划编号</th>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="display: none;" class="classTable" id="dispatch-car-table2">
|
||||
<tr>
|
||||
<th style="width: 9%;">类型</th>
|
||||
<th style="width: 9%;">车型</th>
|
||||
<th style="width: 7%;">型号</th>
|
||||
<th style="width: 9%;">车牌</th>
|
||||
<th style="width: 9%;">使用地</th>
|
||||
<!-- <th style="width: 7%;">计划使用天数</th>-->
|
||||
<th style="width: 8%;">使用天数</th>
|
||||
<th style="width: 13%;">租赁单价</th>
|
||||
<th style="width: 7%;">金额</th>
|
||||
<th style="width: 7%;">出入场金额</th>
|
||||
<th style="width: 10%;">操作证/<br>身份证/导航图</th>
|
||||
<th style="width: 9%;">需求计划编号</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 操作记录 -->
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<label class="layui-form-label required">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" lay-filter="auditStatus" name="status" value="2" title="通过" checked>
|
||||
<input type="radio" lay-filter="auditStatus" name="status" value="3" title="不通过">
|
||||
<input type="radio" lay-filter="auditStatus" name="status" value="1" title="通过" checked>
|
||||
<input type="radio" lay-filter="auditStatus" name="status" value="2" title="不通过">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" id="auditRemarksLabel">审核意见</label>
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<textarea placeholder="不通过必须填写审核意见" id="remark" name="remark" class="layui-textarea" maxLength="60">审核通过
|
||||
<textarea placeholder="不通过必须填写审核意见" id="auditReason" name="auditReason" class="layui-textarea" maxLength="60">审核通过
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
<div id="basic-box">
|
||||
<form class="layui-form layuimini-form" onclick="return false;">
|
||||
<div class="layui-form-item">
|
||||
<input type="hidden" id="supId" name="supId">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">供应商</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
|
|||
Loading…
Reference in New Issue