车辆问题修改

This commit is contained in:
jiang 2025-12-02 18:14:42 +08:00
parent 36bbc3532e
commit 5af866ce72
14 changed files with 202 additions and 180 deletions

View File

@ -416,48 +416,54 @@ function exportData() {
// 操作记录
function setOperRecordInfo(list, obj) {
let creator = obj.userName; // 发起人
let html = '';
if (list && list.length > 0) {
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);
// 1. 容错处理(统一处理空值、类型转换)
const remark = setNullValue(item.auditRemark); // 已有空值处理,保留
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
const auditStatus = item.auditStatus + ''; // 确保为字符串
const times = setNullValue(item.times) || '0'; // 时间间隔容错(避免拼接 undefined
let operData = "";
let dept = '';
let minutes = item.minutes;
if (item.hours === 0 && item.minutes === 0) {
minutes = 1;
// 2. 部门映射表(替代多 if-else清晰直观
const deptMap = {
'0': '项目部',
'1': '项目部',
'-1': '项目部',
'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}`]
];
// 匹配操作文案(默认值容错)
let operData = '未知操作';
for (const [condition, text] of operRules) {
if (condition()) {
operData = text;
break; // 找到匹配规则,立即退出(保证优先级)
}
if (item.auditType === '0' || item.auditType === '1' || item.auditType === '-1') {
dept = '项目部';
} else if (item.auditType === '2') {
dept = '分公司';
} else if (item.auditType === '3') {
dept = '项管中心';
} else if (item.auditType === '4') {
dept = '智联装备云控公司';
}
let remark = setNullValue(item.auditRemark);
// 操作流程
if (index === 0 && item.auditType === '1') {
operData = '发起申请';
} else if (item.auditType === '-1') {
operData = '撤回申请';
} else if (index > 0 && item.auditType === '1') {
operData = '重新提交申请';
} else if (item.auditType === '2' && item.auditStatus === '2') {
operData = '审核确认通过,共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (item.auditType === '2' && item.auditStatus === '3') {
operData = '驳回-给发起人' + creator + ',共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (item.auditType === '3' && item.auditStatus === '2') {
operData = '审核确认通过,共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (item.auditType === '3' && item.auditStatus === '3') {
operData = '驳回-给发起人' + creator + ',共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (item.auditType === '4' && item.auditStatus === '2') {
operData = '完结-审核确认通过,共耗时:' + item.times + ' 原因备注:' + remark + '';
} else if (item.auditType === '4' && item.auditStatus === '3') {
operData = '驳回-给发起人' + creator + ',共间隔:' + item.times + ' 原因备注:' + remark + '';
}
html += '<div class="layui-timeline-item">' +
'<i class="layui-icon layui-timeline-axis"></i>' +

View File

@ -1,5 +1,6 @@
let objParam, dataObj;
let form, table, upload, tableIns, layer, element;
function setParams(params) {
objParam = JSON.parse(params);
$('#titleName').html(objParam.proName);
@ -73,6 +74,7 @@ function getDispatchCarData(id) {
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
function setTableData(obj) {
$('#planCode').html(objParam.code);
@ -149,7 +151,7 @@ function getDispatchCarData(id) {
html += '<tr>' +
'<td>' + item.supName + '</td>' +
'<td>' + item.dispatchNum + '</td>' +
'<td> ¥ ' + (item.money ? item.money : 0) + '</td>' +
'<td> ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + '</td>' +
'</tr>';
})
} else {
@ -165,8 +167,12 @@ function getDispatchCarData(id) {
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.carImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.driverUserImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.fileList.length;
html += "<tr>" +
"<td>" + item.type + "</td>" +
@ -178,8 +184,8 @@ function getDispatchCarData(id) {
"<td>" + item.startAddress + "</td>" +
"<td>" + item.endAddress + "</td>" +
"<td>" + item.gls + "</td>" +
"<td>" + item.glsPrice + "</td>" +
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
"<td>" + parseFloat(item.glsPrice).toFixed(2) + "</td>" +
"<td> ¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 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>" + supName + "</td>" +
"</tr>";
@ -197,8 +203,12 @@ function getDispatchCarData(id) {
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.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;
html += '<tr>' +
'<td>' + item.type + '</td>' +
@ -208,7 +218,7 @@ function getDispatchCarData(id) {
'<td>' + item.useAddress + '</td>' +
'<td>' + item.planDay + '</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.cost + '</td>' +
'<td> ¥ ' + parseFloat(item.cost).toFixed(2) + '</td>' +
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>" +
'<td>' + supName + '</td>' +
'</tr>';
@ -222,12 +232,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
html += '<p>' + item.monthPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.monthPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
} else {
html += '<p>' + item.dayPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
}
if (item.isOutSet === 1) {
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
}
return html;
}
@ -325,7 +335,13 @@ function print() {
// 审核派车录入数据
function auditData(id, type) {
let obj = { id: dataObj.id, checkType: '1', planId: dataObj.planId, contractId: dataObj.contractId, supId: dataObj.supId };
let obj = {
id: dataObj.id,
checkType: '1',
planId: dataObj.planId,
contractId: dataObj.contractId,
supId: dataObj.supId
};
openIframeByParamObj("auditData", "审核", "./audit_form.html", "40%", "50%", obj);
}

View File

@ -264,7 +264,7 @@ function getDispatchCarData(id) {
html += '<tr>' +
'<td>' + item.supName + '</td>' +
'<td>' + item.dispatchNum + '</td>' +
'<td> ¥ ' + (item.money ? item.money : 0) + '</td>' +
'<td> ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + '</td>' +
'</tr>';
})
} else {
@ -297,8 +297,8 @@ function getDispatchCarData(id) {
"<td>" + item.startAddress + "</td>" +
"<td>" + item.endAddress + "</td>" +
"<td>" + item.gls + "</td>" +
"<td>" + item.glsPrice + "</td>" +
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
"<td>" + item.glsPrice.toFixed(2) + "</td>" +
"<td> ¥ " + (item.glsMoney ? item.glsMoney.toFixed(2) : 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>" + objParam.supName + "</td>" +
"</tr>";
@ -331,7 +331,7 @@ function getDispatchCarData(id) {
'<td>' + item.useAddress + '</td>' +
'<td>' + item.planDay + '</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.cost + '</td>' +
'<td> ¥ ' + parseFloat(item.cost).toFixed(2) + '</td>' +
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>" +
'<td>' + objParam.supName + '</td>' +
'</tr>';
@ -345,12 +345,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
html += '<p>' + item.monthPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.monthPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
} else {
html += '<p>' + item.dayPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
}
if (item.isOutSet === 1) {
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
}
return html;
}
@ -358,34 +358,54 @@ function getDispatchCarData(id) {
// 操作记录
function setOperRecordInfo(list) {
let creator = ''; // 发起人
let html = '';
if (list && list.length > 0) {
let imgUrl = '../../../images/user_head_icon.png';
let imgUrl2 = '../../../images/time_icon.png';
$.each(list, function (index, item) {
if (index === 0) {
creator = (item.nikeName ? item.nikeName : item.userName);
const creator = (item.nikeName ? item.nikeName : item.userName);
// 1. 容错处理(统一处理空值、类型转换)
const remark = setNullValue(item.auditRemark); // 已有空值处理,保留
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
const auditStatus = item.auditStatus + ''; // 确保为字符串
const times = setNullValue(item.times) || '0'; // 时间间隔容错(避免拼接 undefined
// 2. 部门映射表(替代多 if-else清晰直观
const deptMap = {
'0': '项目部',
'1': '项目部',
'-1': '项目部',
'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}`]
];
// 匹配操作文案(默认值容错)
let operData = '未知操作';
for (const [condition, text] of operRules) {
if (condition()) {
operData = text;
break; // 找到匹配规则,立即退出(保证优先级)
}
let remark = setNullValue(item.auditRemark);
let dept = '', operData = '';
; // auditType 1.提交 2.审核 auditStatus:1.审核通过 2.审核驳回
if (parseInt(item.auditType) === 1) {
dept = '供应商';
} else if (parseInt(item.auditType) === 2) {
dept = '机具公司';
}
// 操作流程
if (index === 0 && parseInt(item.auditType) === 1) {
operData = '发起申请';
} else if (index !== 0 && parseInt(item.auditType) === 1) {
operData = '重新提交申请';
} else if (index !== 0 && parseInt(item.auditType) === 9 && parseInt(item.auditStatus) === 9) {
operData = '驳回-给发起人' + creator + ',共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (index !== 0 && parseInt(item.auditType) === 2 && parseInt(item.auditStatus) === 1) {
operData = '审核确认通过,共间隔:' + item.times + ' 原因备注:' + remark + '';
} else if (index !== 0 && parseInt(item.auditType) === 2 && parseInt(item.auditStatus) === 2) {
operData = '完结-审核确认通过,共耗时:' + item.times + ' 原因备注:' + remark + '';
}
html += '<div class="layui-timeline-item">' +
'<i class="layui-icon layui-timeline-axis"></i>' +

View File

@ -79,6 +79,7 @@ function getRecordDetailsList(id) {
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
function setTableData(obj) {
if (obj) {
$('#planCode').html(code);
@ -148,7 +149,7 @@ function getRecordDetailsList(id) {
html += '<tr>' +
'<td>' + item.supName + '</td>' +
'<td>' + item.dispatchNum + '</td>' +
'<td> ¥ ' + (item.money ? item.money : 0) + '</td>' +
'<td> ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + '</td>' +
'</tr>';
})
} else {
@ -164,8 +165,12 @@ function getRecordDetailsList(id) {
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.carImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.driverUserImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.fileList.length;
html += "<tr>" +
"<td>" + (parseInt(typeName) === 1 ? '车辆' : '吊车') + "</td>" +
@ -177,8 +182,8 @@ function getRecordDetailsList(id) {
"<td>" + setEditSign(item.startAddress, item.updateStartAddress) + "</td>" +
"<td>" + setEditSign(item.endAddress, item.updateEndAddress) + "</td>" +
"<td>" + setEditSign(item.gls, item.updateGls) + "</td>" +
"<td>" + item.glsPrice + "</td>" +
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
"<td>" + parseFloat(item.glsPrice).toFixed(2) + "</td>" +
"<td> ¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 0) + "</td>" +
setEditSign2(imgNum, item) +
"<td>" + dataObj.supName + "</td>" +
"</tr>";
@ -199,6 +204,7 @@ function getRecordDetailsList(id) {
}
}
}
function setEditSign2(imgNum, item, isUpdate) {
if (isInit === 'true') {
return "<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",1)'>查看附件>></a></td>";
@ -210,6 +216,7 @@ function getRecordDetailsList(id) {
}
}
}
$('#dispatch-car-table').append(html);
}
@ -220,8 +227,12 @@ function getRecordDetailsList(id) {
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.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;
html += '<tr>' +
'<td>' + item.type + '</td>' +
@ -231,7 +242,7 @@ function getRecordDetailsList(id) {
'<td>' + setEditSign(item.useAddress) + '</td>' +
'<td>' + setEditSign(item.planDay, item.updateDay) + '</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.dcMoney + '</td>' +
'<td> ¥ ' + parseFloat(item.dcMoney).toFixed(2) + '</td>' +
setEditSign2(imgNum, item) +
'<td>' + dataObj.supName + '</td>' +
'</tr>';
@ -240,6 +251,7 @@ function getRecordDetailsList(id) {
html = '<tr><td colspan="10" style="text-align: center;">暂无数据</td></tr>';
}
$('#dispatch-car-table2').append(html);
// 修改标识
function setEditSign(value, isUpdate) {
if (isInit === 'true') {
@ -252,6 +264,7 @@ function getRecordDetailsList(id) {
}
}
}
function setEditSign2(imgNum, item, isUpdate) {
if (isInit === 'true') {
return "<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>";
@ -263,16 +276,17 @@ function getRecordDetailsList(id) {
}
}
}
// 设置租赁单价
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
html += '<p>' + item.monthPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.monthPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
} else {
html += '<p>' + item.dayPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
}
if (item.isOutSet === 1) {
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
}
return html;
}

View File

@ -221,7 +221,7 @@ function getDispatchCarData(id) {
html += '<tr>' +
'<td>' + item.supName + '</td>' +
'<td>' + item.dispatchNum + '</td>' +
'<td> ¥ ' + (item.money ? item.money : 0) + '</td>' +
'<td> ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + '</td>' +
'</tr>';
})
} else {
@ -280,7 +280,7 @@ function getDispatchCarData(id) {
'<td>' + item.useAddress + '</td>' +
'<td>' + item.planDay + '</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.cost + '</td>' +
'<td> ¥ ' + parseFloat(item.cost).toFixed(2) + '</td>' +
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>" +
'<td>' + (objParam.supName || dataObj.supName) + '</td>' +
'</tr>';

View File

@ -46,6 +46,7 @@ function getAllOutList() {
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
// 详情批次数据
function setBatchData(dataList) {
let html = '', id = '', status = '', type = '';
@ -140,6 +141,7 @@ function getDispatchCarData(id) {
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
function setTableData(obj) {
$('#planCode').html(objParam.code);
@ -210,7 +212,7 @@ function getDispatchCarData(id) {
html += '<tr>' +
'<td>' + item.supName + '</td>' +
'<td>' + item.dispatchNum + '</td>' +
'<td> ¥ ' + (item.money ? item.money : 0) + '</td>' +
'<td> ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + '</td>' +
'</tr>';
})
} else {
@ -226,8 +228,12 @@ function getDispatchCarData(id) {
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.carImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.driverUserImage.filter(item => {
return item.type !== '6'
}).length;
imgNum += item.fileList.length;
html += "<tr>" +
"<td>" + objParam.typeName + "</td>" +
@ -258,8 +264,12 @@ function getDispatchCarData(id) {
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.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;
html += '<tr>' +
'<td>' + item.type + '</td>' +
@ -269,7 +279,7 @@ function getDispatchCarData(id) {
'<td>' + item.useAddress + '</td>' +
'<td>' + item.planDay + '</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.cost + '</td>' +
'<td> ¥ ' + parseFloat(item.cost).toFixed(2) + '</td>' +
"<td style='color:#409eff'>" + imgNum + "<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewFileDetail(" + JSON.stringify(item) + ",2)'>查看附件>></a></td>" +
'<td>' + objParam.supName + '</td>' +
'</tr>';
@ -283,12 +293,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
html += '<p>' + item.monthPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.monthPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
} else {
html += '<p>' + item.dayPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
}
if (item.isOutSet === 1) {
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
}
return html;
}
@ -306,7 +316,8 @@ function getDispatchCarData(id) {
creator = item.userName;
}
let remark = setNullValue(item.auditRemark);
let dept = '',operData = '';; // auditType 1.提交 2.审核 auditStatus:1.审核通过 2.审核驳回
let dept = '', operData = '';
; // auditType 1.提交 2.审核 auditStatus:1.审核通过 2.审核驳回
if (parseInt(item.auditType) === 1) {
dept = '供应商';
} else if (parseInt(item.auditType) === 2) {

View File

@ -42,7 +42,7 @@ function getSltDetailsInfo() {
}, null);
function setTableData(obj) {
console.log(obj)
$('#supName').html(objParam.supName);
$('#planCode').html("<a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='viewPlanDetail(" + JSON.stringify(obj) + ")'>" + obj.code + "</a>");
$('#proName').html(obj.proName);
@ -145,8 +145,8 @@ function getPayCarDetails() {
"<td>" + item.startAddress + "</td>" +
"<td>" + item.endAddress + "</td>" +
"<td>" + item.gls + "</td>" +
"<td>" + item.glsPrice + "</td>" +
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
"<td>" + parseFloat(item.glsPrice).toFixed(2) + "</td>" +
"<td> ¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 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>";
@ -185,7 +185,7 @@ function getPayCarDetails() {
'<td>' + item.days + '</td>' +
'<td>' + item.fee + '元</td>' +
'<td>' + setZlPrice(item) + '</td>' +
'<td> ¥ ' + item.cost + '</td>' +
'<td> ¥ ' + parseFloat(item.cost).toFixed(2) + '</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>" +
"<td><a style='color:#409eff;margin:0 5px;cursor: pointer;' onclick='enter(" + JSON.stringify(item) + ")'>录入</a></td>" +
@ -200,12 +200,12 @@ function getPayCarDetails() {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
html += '<p>' + item.monthPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.monthPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
} else {
html += '<p>' + item.dayPrice + '' + item.dcUnit + '' + '</p>';
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '' + item.dcUnit + '' + '</p>';
}
if (item.isOutSet === 1) {
html += '<p>' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)</p>'
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
}
return html;
}

View File

@ -175,7 +175,7 @@ function initTable() {
align: "center",
sort: true,
templet: function (d) {
return ' ¥ ' + (d.money ? d.money : 0);
return ' ¥ ' + (d.money ? parseFloat(d.money).toFixed(2) : 0);
},
},
{
@ -234,7 +234,6 @@ function initTable() {
templet: function (d) {
let html = "";
html += "<a onclick='settlementDetail(" + JSON.stringify(d) + ")'>详情</a> ";
html += "<a onclick='admission(" + JSON.stringify(d) + ")'>入场费</a>";
return html;
},
},
@ -266,50 +265,6 @@ function settlementDetail(obj) {
openIframeByParamObj("settlementDetail", "详情", "./child/settlement_detail.html", "92%", "95%", obj);
}
function admission(obj) {
layer.prompt({
title: '入场费',
formType: 3,
success: function (layero) {
var input = layero.find('input');
// 设置输入类型为number以优化移动端体验
input.attr('type', 'number');
// 允许输入数字和小数点,但限制格式
input.on('input', function () {
// 保留数字和单个小数点
this.value = this.value
.replace(/[^\d.]/g, '') // 移除所有非数字和非小数点字符
.replace(/(\.\d*)\./g, '$1') // 只允许一个小数点
.replace(/^\./, ''); // 不允许以小数点开头
});
}
}, function (pass, index) {
// 最终验证,确保是有效的数字格式
if (!/^\d+(\.\d+)?$/.test(pass)) {
layer.msg('请输入有效的数字(可包含小数)');
return false; // 验证失败,不关闭弹窗
}
let encryptedData = {};
let url = dataUrl + 'backstage/carStatistics/getSltSupInformation?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
let params = {
encryptedData: JSON.stringify(obj)
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.code === 200) {
layer.msg(result.msg, { icon: 1 })
queryTable(1);
} else {
layer.msg(result.msg, { icon: 2 })
}
}, function (xhr) {
layer.close(index);
});
console.log('输入的金额:', parseFloat(pass));
});
}
// 导出
function exportExcel() {

View File

@ -153,9 +153,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 10%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 8%;">供应商</th>

View File

@ -214,9 +214,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 10%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 8%;">供应商</th>

View File

@ -144,9 +144,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 10%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 8%;">供应商</th>

View File

@ -203,9 +203,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 10%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 8%;">供应商</th>

View File

@ -203,9 +203,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 10%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 8%;">供应商</th>

View File

@ -111,9 +111,9 @@
<th style="width: 10%;">车型</th>
<th style="width: 8%;">型号</th>
<th style="width: 10%;">车牌</th>
<th style="width: 15%;">使用地</th>
<th style="width: 10%;">使用地</th>
<th style="width: 8%;">计划使用天数</th>
<th style="width: 10%;">租赁单价</th>
<th style="width: 15%;">租赁单价</th>
<th style="width: 8%;">预估金额</th>
<th style="width: 11%;">操作证/<br>身份证/导航图</th>
<th style="width: 10%;">需求计划编号</th>