diff --git a/js/car_demand_plan/child/apply_plan_detail.js b/js/car_demand_plan/child/apply_plan_detail.js
index a740bf9..d537666 100644
--- a/js/car_demand_plan/child/apply_plan_detail.js
+++ b/js/car_demand_plan/child/apply_plan_detail.js
@@ -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;
- }
- 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 + '';
+// 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; // 找到匹配规则,立即退出(保证优先级)
+ }
}
html += '
' +
'
' +
diff --git a/js/car_demand_plan/child/arrival_confirm_detail.js b/js/car_demand_plan/child/arrival_confirm_detail.js
index f99af47..9a4e918 100644
--- a/js/car_demand_plan/child/arrival_confirm_detail.js
+++ b/js/car_demand_plan/child/arrival_confirm_detail.js
@@ -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);
@@ -82,15 +84,15 @@ function getDispatchCarData(id) {
// 附件文档
setFileTable(obj.fileList);
// 供应商信息
- let supInfoList = [{ supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money }];
+ let supInfoList = [{supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money}];
setSubInfos(supInfoList);
// 派车明细
if (obj.detailsVoList[0].type === '车辆') {
$('#dispatch-car-table2').remove();
- setDispatchCarTable(obj.detailsVoList,obj.supName);
+ setDispatchCarTable(obj.detailsVoList, obj.supName);
} else if (obj.detailsVoList[0].type === '吊车') {
$('#dispatch-car-table').remove();
- setDispatchCarTable2(obj.detailsVoList,obj.supName);
+ setDispatchCarTable2(obj.detailsVoList, obj.supName);
}
}
@@ -105,7 +107,7 @@ function getDispatchCarData(id) {
'
下载';
// 如果是 "到货确认单",增加删除按钮
- if (item.type === '到货确认单' && item.status!=='1') {
+ if (item.type === '到货确认单' && item.status !== '1') {
actions += '
删除';
}
@@ -149,7 +151,7 @@ function getDispatchCarData(id) {
html += '
' +
'| ' + item.supName + ' | ' +
'' + item.dispatchNum + ' | ' +
- ' ¥ ' + (item.money ? item.money : 0) + ' | ' +
+ ' ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + ' | ' +
'
';
})
} else {
@@ -159,14 +161,18 @@ function getDispatchCarData(id) {
}
// 派车明细-车辆
- function setDispatchCarTable(list,supName) {
+ function setDispatchCarTable(list, supName) {
$('#dispatch-car-table tr:not(:first)').remove();
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.carImage.filter(item => {
+ return item.type !== '6'
+ }).length;
+ imgNum += item.driverUserImage.filter(item => {
+ return item.type !== '6'
+ }).length;
imgNum += item.fileList.length;
html += "
" +
"| " + item.type + " | " +
@@ -178,8 +184,8 @@ function getDispatchCarData(id) {
"" + item.startAddress + " | " +
"" + item.endAddress + " | " +
"" + item.gls + " | " +
- "" + item.glsPrice + " | " +
- " ¥ " + (item.glsMoney ? item.glsMoney : 0) + " | " +
+ "" + parseFloat(item.glsPrice).toFixed(2) + " | " +
+ " ¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 0) + " | " +
"" + imgNum + "查看附件>> | " +
"" + supName + " | " +
"
";
@@ -191,14 +197,18 @@ function getDispatchCarData(id) {
}
// 派车明细-吊车
- function setDispatchCarTable2(list,supName) {
+ function setDispatchCarTable2(list, supName) {
$('#dispatch-car-table2 tr:not(:first)').remove();
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.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 += '
' +
'| ' + item.type + ' | ' +
@@ -208,7 +218,7 @@ function getDispatchCarData(id) {
'' + item.useAddress + ' | ' +
'' + item.planDay + ' | ' +
'' + setZlPrice(item) + ' | ' +
- ' ¥ ' + item.cost + ' | ' +
+ ' ¥ ' + parseFloat(item.cost).toFixed(2) + ' | ' +
"" + imgNum + "查看附件>> | " +
'' + supName + ' | ' +
'
';
@@ -222,12 +232,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
- html += '
' + item.monthPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
} else {
- html += '
' + item.dayPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
}
if (item.isOutSet === 1) {
- html += '
' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)
'
+ html += '
' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)
'
}
return html;
}
@@ -266,8 +276,8 @@ function downLoadFile(obj) {
}
function deleteFile(item) {
- layer.confirm("确定要删除文件吗?", { 'title': '操作提示', move: false }, function () {
- let loadingMsg = layer.msg('数据删除中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
+ 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
@@ -279,11 +289,11 @@ function deleteFile(item) {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
- layer.msg(result.msg, { icon: 1 })
+ layer.msg(result.msg, {icon: 1})
getDispatchCarListData(objParam.id);
getDispatchCarData(objParam.id);
} else {
- layer.msg(result.msg, { icon: 2 })
+ layer.msg(result.msg, {icon: 2})
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
@@ -325,13 +335,19 @@ 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);
}
// 修改派车录入数据
function updateData(id, type) {
- let obj = { id: id, type: type, proName: objParam.proName, code: objParam.code };
+ let obj = {id: id, type: type, proName: objParam.proName, code: objParam.code};
openIframeByParamObj2("updateData", "派车信息修改", "../car_demand_plan/child/dispatch_car_edit_form.html", "92%", "95%", obj);
}
diff --git a/js/car_demand_plan/child/dispatch_car_detail.js b/js/car_demand_plan/child/dispatch_car_detail.js
index b49e7f2..ea15fd2 100644
--- a/js/car_demand_plan/child/dispatch_car_detail.js
+++ b/js/car_demand_plan/child/dispatch_car_detail.js
@@ -264,7 +264,7 @@ function getDispatchCarData(id) {
html += '
' +
'| ' + item.supName + ' | ' +
'' + item.dispatchNum + ' | ' +
- ' ¥ ' + (item.money ? item.money : 0) + ' | ' +
+ ' ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + ' | ' +
'
';
})
} else {
@@ -297,8 +297,8 @@ function getDispatchCarData(id) {
"
" + item.startAddress + " | " +
"
" + item.endAddress + " | " +
"
" + item.gls + " | " +
- "
" + item.glsPrice + " | " +
- "
¥ " + (item.glsMoney ? item.glsMoney : 0) + " | " +
+ "
" + item.glsPrice.toFixed(2) + " | " +
+ "
¥ " + (item.glsMoney ? item.glsMoney.toFixed(2) : 0) + " | " +
"
" + imgNum + "查看附件>> | " +
"
" + objParam.supName + " | " +
"";
@@ -331,7 +331,7 @@ function getDispatchCarData(id) {
'
' + item.useAddress + ' | ' +
'
' + item.planDay + ' | ' +
'
' + setZlPrice(item) + ' | ' +
- '
¥ ' + item.cost + ' | ' +
+ '
¥ ' + parseFloat(item.cost).toFixed(2) + ' | ' +
"
" + imgNum + "查看附件>> | " +
'
' + objParam.supName + ' | ' +
'';
@@ -345,12 +345,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
- html += '
' + item.monthPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
} else {
- html += '
' + item.dayPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
}
if (item.isOutSet === 1) {
- html += '
' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)
'
+ html += '
' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)
'
}
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);
- }
- 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 + '';
+ 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; // 找到匹配规则,立即退出(保证优先级)
+ }
}
html += '
' +
'
' +
diff --git a/js/car_demand_plan/child/dispatch_car_edit_record_detail.js b/js/car_demand_plan/child/dispatch_car_edit_record_detail.js
index 498de17..d6b3176 100644
--- a/js/car_demand_plan/child/dispatch_car_edit_record_detail.js
+++ b/js/car_demand_plan/child/dispatch_car_edit_record_detail.js
@@ -79,6 +79,7 @@ function getRecordDetailsList(id) {
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
+
function setTableData(obj) {
if (obj) {
$('#planCode').html(code);
@@ -88,7 +89,7 @@ function getRecordDetailsList(id) {
// 附件文档
setFileTable(obj.fileList);
// 供应商信息
- let supInfoList = [{ supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money }];
+ let supInfoList = [{supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money}];
setSubInfos(supInfoList);
// 派车明细
if (parseInt(typeName) === 1) {
@@ -148,7 +149,7 @@ function getRecordDetailsList(id) {
html += '
' +
'| ' + item.supName + ' | ' +
'' + item.dispatchNum + ' | ' +
- ' ¥ ' + (item.money ? item.money : 0) + ' | ' +
+ ' ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + ' | ' +
'
';
})
} 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 += "
" +
"| " + (parseInt(typeName) === 1 ? '车辆' : '吊车') + " | " +
@@ -177,8 +182,8 @@ function getRecordDetailsList(id) {
"" + setEditSign(item.startAddress, item.updateStartAddress) + " | " +
"" + setEditSign(item.endAddress, item.updateEndAddress) + " | " +
"" + setEditSign(item.gls, item.updateGls) + " | " +
- "" + item.glsPrice + " | " +
- " ¥ " + (item.glsMoney ? item.glsMoney : 0) + " | " +
+ "" + parseFloat(item.glsPrice).toFixed(2) + " | " +
+ " ¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 0) + " | " +
setEditSign2(imgNum, item) +
"" + dataObj.supName + " | " +
"
";
@@ -199,6 +204,7 @@ function getRecordDetailsList(id) {
}
}
}
+
function setEditSign2(imgNum, item, isUpdate) {
if (isInit === 'true') {
return "
" + imgNum + "查看附件>> | ";
@@ -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 += '
' +
'| ' + item.type + ' | ' +
@@ -231,7 +242,7 @@ function getRecordDetailsList(id) {
'' + setEditSign(item.useAddress) + ' | ' +
'' + setEditSign(item.planDay, item.updateDay) + ' | ' +
'' + setZlPrice(item) + ' | ' +
- ' ¥ ' + item.dcMoney + ' | ' +
+ ' ¥ ' + parseFloat(item.dcMoney).toFixed(2) + ' | ' +
setEditSign2(imgNum, item) +
'' + dataObj.supName + ' | ' +
'
';
@@ -240,6 +251,7 @@ function getRecordDetailsList(id) {
html = '
| 暂无数据 |
';
}
$('#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 "
" + imgNum + "查看附件>> | ";
@@ -263,16 +276,17 @@ function getRecordDetailsList(id) {
}
}
}
+
// 设置租赁单价
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
- html += '
' + item.monthPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
} else {
- html += '
' + item.dayPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
}
if (item.isOutSet === 1) {
- html += '
' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)
'
+ html += '
' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)
'
}
return html;
}
diff --git a/js/car_demand_plan/child/dispatch_input_detail.js b/js/car_demand_plan/child/dispatch_input_detail.js
index a8fead7..ed5ebc9 100644
--- a/js/car_demand_plan/child/dispatch_input_detail.js
+++ b/js/car_demand_plan/child/dispatch_input_detail.js
@@ -221,7 +221,7 @@ function getDispatchCarData(id) {
html += '
' +
'| ' + item.supName + ' | ' +
'' + item.dispatchNum + ' | ' +
- ' ¥ ' + (item.money ? item.money : 0) + ' | ' +
+ ' ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + ' | ' +
'
';
})
} else {
@@ -280,7 +280,7 @@ function getDispatchCarData(id) {
'
' + item.useAddress + ' | ' +
'
' + item.planDay + ' | ' +
'
' + setZlPrice(item) + ' | ' +
- '
¥ ' + item.cost + ' | ' +
+ '
¥ ' + parseFloat(item.cost).toFixed(2) + ' | ' +
"
" + imgNum + "查看附件>> | " +
'
' + (objParam.supName || dataObj.supName) + ' | ' +
'';
diff --git a/js/car_settlement/child/branch_dispatch_car_detail.js b/js/car_settlement/child/branch_dispatch_car_detail.js
index e8bf137..5654d1d 100644
--- a/js/car_settlement/child/branch_dispatch_car_detail.js
+++ b/js/car_settlement/child/branch_dispatch_car_detail.js
@@ -36,7 +36,7 @@ function getAllOutList() {
}, function (result) {
if (result.code === 200) {
if (result.data.length === 0 && objParam.type === 1) {
- parent.layer.msg('暂无派车批次数据', { icon: 7 });
+ parent.layer.msg('暂无派车批次数据', {icon: 7});
closePage();
} else if (result.data.length > 0) {
setBatchData(result.data);
@@ -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);
@@ -149,7 +151,7 @@ function getDispatchCarData(id) {
// 附件文档
setFileTable(obj.fileList);
// 供应商信息
- let supInfoList = [{ supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money }];
+ let supInfoList = [{supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money}];
setSubInfos(supInfoList);
// 操作记录
setOperRecordInfo(obj.recordList);
@@ -210,7 +212,7 @@ function getDispatchCarData(id) {
html += '
' +
'| ' + item.supName + ' | ' +
'' + item.dispatchNum + ' | ' +
- ' ¥ ' + (item.money ? item.money : 0) + ' | ' +
+ ' ¥ ' + (item.money ? parseFloat(item.money).toFixed(2) : 0) + ' | ' +
'
';
})
} 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 += "
" +
"| " + objParam.typeName + " | " +
@@ -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 += '
' +
'| ' + item.type + ' | ' +
@@ -269,7 +279,7 @@ function getDispatchCarData(id) {
'' + item.useAddress + ' | ' +
'' + item.planDay + ' | ' +
'' + setZlPrice(item) + ' | ' +
- ' ¥ ' + item.cost + ' | ' +
+ ' ¥ ' + parseFloat(item.cost).toFixed(2) + ' | ' +
"" + imgNum + "查看附件>> | " +
'' + objParam.supName + ' | ' +
'
';
@@ -283,12 +293,12 @@ function getDispatchCarData(id) {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
- html += '
' + item.monthPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
} else {
- html += '
' + item.dayPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
}
if (item.isOutSet === 1) {
- html += '
' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)
'
+ html += '
' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)
'
}
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) {
diff --git a/js/car_settlement/child/settlement_detail.js b/js/car_settlement/child/settlement_detail.js
index 23669ae..da96cf0 100644
--- a/js/car_settlement/child/settlement_detail.js
+++ b/js/car_settlement/child/settlement_detail.js
@@ -42,7 +42,7 @@ function getSltDetailsInfo() {
}, null);
function setTableData(obj) {
-
+ console.log(obj)
$('#supName').html(objParam.supName);
$('#planCode').html("
" + obj.code + "");
$('#proName').html(obj.proName);
@@ -145,8 +145,8 @@ function getPayCarDetails() {
"
" + item.startAddress + " | " +
"
" + item.endAddress + " | " +
"
" + item.gls + " | " +
- "
" + item.glsPrice + " | " +
- "
¥ " + (item.glsMoney ? item.glsMoney : 0) + " | " +
+ "
" + parseFloat(item.glsPrice).toFixed(2) + " | " +
+ "
¥ " + (item.glsMoney ? parseFloat(item.glsMoney).toFixed(2) : 0) + " | " +
"
" + imgNum + "查看附件>> | " +
"
" + item.planCode + " | " +
"";
@@ -185,7 +185,7 @@ function getPayCarDetails() {
'
' + item.days + ' | ' +
'
' + item.fee + '元 | ' +
'
' + setZlPrice(item) + ' | ' +
- '
¥ ' + item.cost + ' | ' +
+ '
¥ ' + parseFloat(item.cost).toFixed(2) + ' | ' +
"
" + imgNum + "查看附件>> | " +
"
" + item.planCode + " | " +
"
录入 | " +
@@ -200,12 +200,12 @@ function getPayCarDetails() {
function setZlPrice(item) {
let html = '';
if (item.dcUnit === '元/月/台') {
- html += '
' + item.monthPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
} else {
- html += '
' + item.dayPrice + '(' + item.dcUnit + ')' + '
';
+ html += '
' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '
';
}
if (item.isOutSet === 1) {
- html += '
' + (item.jcMoney ? item.jcMoney : 0) + '(进出场费)
'
+ html += '
' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)
'
}
return html;
}
diff --git a/js/car_settlement/sup_settlement_list.js b/js/car_settlement/sup_settlement_list.js
index 9adf228..53da110 100644
--- a/js/car_settlement/sup_settlement_list.js
+++ b/js/car_settlement/sup_settlement_list.js
@@ -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 += "
详情 ";
- html += "
入场费";
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() {
diff --git a/page/car_demand_plan/child/arrival_confirm_detail.html b/page/car_demand_plan/child/arrival_confirm_detail.html
index 0807aa1..7c59182 100644
--- a/page/car_demand_plan/child/arrival_confirm_detail.html
+++ b/page/car_demand_plan/child/arrival_confirm_detail.html
@@ -153,9 +153,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
供应商 |
diff --git a/page/car_demand_plan/child/dispatch_car_detail.html b/page/car_demand_plan/child/dispatch_car_detail.html
index f719eab..7b9a162 100644
--- a/page/car_demand_plan/child/dispatch_car_detail.html
+++ b/page/car_demand_plan/child/dispatch_car_detail.html
@@ -214,9 +214,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
供应商 |
diff --git a/page/car_demand_plan/child/dispatch_car_edit_record_detail.html b/page/car_demand_plan/child/dispatch_car_edit_record_detail.html
index 4d97275..ce2dd28 100644
--- a/page/car_demand_plan/child/dispatch_car_edit_record_detail.html
+++ b/page/car_demand_plan/child/dispatch_car_edit_record_detail.html
@@ -144,9 +144,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
供应商 |
diff --git a/page/car_demand_plan/child/dispatch_input_detail.html b/page/car_demand_plan/child/dispatch_input_detail.html
index 8df54a6..ce5cc8a 100644
--- a/page/car_demand_plan/child/dispatch_input_detail.html
+++ b/page/car_demand_plan/child/dispatch_input_detail.html
@@ -203,9 +203,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
供应商 |
diff --git a/page/car_settlement/child/branch_dispatch_car_detail.html b/page/car_settlement/child/branch_dispatch_car_detail.html
index ce78292..2165c5a 100644
--- a/page/car_settlement/child/branch_dispatch_car_detail.html
+++ b/page/car_settlement/child/branch_dispatch_car_detail.html
@@ -203,9 +203,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
供应商 |
diff --git a/page/car_settlement/child/payment_form.html b/page/car_settlement/child/payment_form.html
index e2ee8c2..51d629b 100644
--- a/page/car_settlement/child/payment_form.html
+++ b/page/car_settlement/child/payment_form.html
@@ -111,9 +111,9 @@
车型 |
型号 |
车牌 |
-
使用地 |
+
使用地 |
计划使用天数 |
-
租赁单价 |
+
租赁单价 |
预估金额 |
操作证/ 身份证/导航图 |
需求计划编号 |