付款单申请审核
This commit is contained in:
parent
85211b1ad9
commit
a7dfc8ce36
|
|
@ -143,6 +143,12 @@
|
|||
"href": "page/car_application_audit/payment_list.html",
|
||||
"icon": "fa fa-asterisk",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "付款单审核",
|
||||
"href": "page/car_application_audit/car_audit_list.html",
|
||||
"icon": "fa fa-asterisk",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,3 +467,43 @@ blockquote {
|
|||
color: #66b1ff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ===================== 计划表格专属优化样式 ===================== */
|
||||
/* 表格整体布局与基础样式 */
|
||||
#plan-detail-table {
|
||||
table-layout: fixed; /* 固定列宽布局,避免内容撑开列宽 */
|
||||
width: 100%;
|
||||
border-collapse: collapse; /* 合并边框,避免双线条 */
|
||||
border-spacing: 0;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 表头样式:统一行高 + 禁止折行 + 背景色 */
|
||||
#plan-detail-table th {
|
||||
padding: 0 8px;
|
||||
height: 40px;
|
||||
line-height: 40px; /* 垂直居中,统一行高 */
|
||||
text-align: center;
|
||||
white-space: nowrap; /* 禁止文字折行 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis; /* 超长表头省略显示 */
|
||||
background-color: #F2F2F2;
|
||||
border: 1px solid #DDDDDD;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 内容单元格样式:统一内边距 + 边框 + 垂直居中 */
|
||||
#plan-detail-table td {
|
||||
padding: 6px 8px;
|
||||
text-align: center;
|
||||
vertical-align: middle; /* 关键:输入框/文字垂直居中 */
|
||||
border: 1px solid #DDDDDD;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ function reloadTable(pageNum) {
|
|||
encryptedData: JSON.stringify({
|
||||
'keyWord': $('#keyWord').val(),
|
||||
'status': $('#status').val(),
|
||||
'contractId': objParam.contractId,
|
||||
'supId': objParam.supId,
|
||||
'id': objParam.id,
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
@ -62,13 +61,12 @@ function initTable() {
|
|||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-170",
|
||||
url: dataUrl + "backstage/carBalance/getSltDetailsList",
|
||||
url: dataUrl + "backstage/carBalance/getBalanceDataList",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'keyWord': $('#keyWord').val(),
|
||||
'status': $('#status').val(),
|
||||
'contractId': objParam.contractId,
|
||||
'supId': objParam.supId,
|
||||
'id': objParam.id,
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
|
|
@ -200,7 +198,7 @@ function exportExcel() {
|
|||
let params = {
|
||||
'keyWord': $('#keyWord').val(),
|
||||
'status': $('#status').val(),
|
||||
'supId': objParam.supId
|
||||
'id': objParam.id
|
||||
}
|
||||
let url = dataUrl + "backstage/carBalance/export2";
|
||||
exportExcelUtil(url, '付款单录入详情', JSON.stringify(params));
|
||||
|
|
@ -208,7 +206,7 @@ function exportExcel() {
|
|||
|
||||
// 详情
|
||||
function paymentDetail(obj) {
|
||||
openIframeByParamObj2("paymentDetail2", "详情", "./car_audit_detail.html", "92%", "95%", obj);
|
||||
openIframeByParamObj2("paymentDetail2", "详情", "./child/settlement_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ function initTable() {
|
|||
}
|
||||
|
||||
if(!(content.indexOf('驳回') > -1)){
|
||||
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>驳回</a><div class='splitLine'>|</div>"
|
||||
html += "<a onclick='checkUpdate(" + JSON.stringify(d) + ")'>修改</a><div class='splitLine'>|</div>"
|
||||
}
|
||||
|
||||
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>详情</a>";
|
||||
|
|
@ -245,7 +245,7 @@ function planAuditDetail(obj) {
|
|||
// 需求计划申请审核
|
||||
function checkDetail(obj) {
|
||||
obj.checkType = 2;
|
||||
openIframeByParamObj("check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
|
||||
openIframeByParamObj("car_check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
|
||||
}
|
||||
|
||||
//提交
|
||||
|
|
@ -280,3 +280,7 @@ function checkSubmit(obj) {
|
|||
});
|
||||
})
|
||||
}
|
||||
|
||||
function checkUpdate(obj){
|
||||
openIframeByParamObj("car_audit_update", "修改", "./child/car_audit_update.html", "92%", "95%", obj,2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,764 @@
|
|||
let idParam, objParam, fileList = new Array(), imgListUp = new Array();
|
||||
let form, laydate, layer, upload, table, util;
|
||||
let pageNum = 1, tableIns; // 定义分页
|
||||
let jjDataArr = []; // 清单数据
|
||||
let delIdArr = []; // 存储要删除的文件ID(关键:新增初始化)
|
||||
let planId = ''; // 计划ID
|
||||
let allDataList = [];
|
||||
|
||||
function setParams(obj) {
|
||||
objParam = JSON.parse(obj);
|
||||
// 初始化删除文件ID数组(避免残留)
|
||||
delIdArr = [];
|
||||
layui.use(['form', 'layer', 'laydate', 'upload', 'table'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
laydate = layui.laydate;
|
||||
upload = layui.upload;
|
||||
table = layui.table;
|
||||
util = layui.util;
|
||||
laydate.render({
|
||||
elem: '#fkTime'
|
||||
});
|
||||
form.verify();
|
||||
form.on('submit(formData)', function (data) {
|
||||
submitApply(data);
|
||||
});
|
||||
form.render();
|
||||
let uploadObj = upload.render({
|
||||
elem: '#test2',
|
||||
multiple: true,
|
||||
dataType: "json",
|
||||
exts: 'jpg|png|jpeg|doc|docx|pdf|xlsx|xls',
|
||||
acceptMime: 'image/jpg,image/png,image/jpeg,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
number: 5, //最大上传数量
|
||||
size: 1024 * 10, //最大文件大小,单位k
|
||||
auto: false, //是否自动上传 ,默认为true
|
||||
bindAction: '#hideUpload', //绑定的按钮
|
||||
choose: function (obj) {
|
||||
let length = $('.file-iteme').length;
|
||||
if (length >= 5) {
|
||||
return layer.msg('最多上传5个附件证明', {icon: 7});
|
||||
}
|
||||
uploadObj.config.elem.next()[0].value = '';
|
||||
let num = 0;
|
||||
obj.preview(function (index, file, result) {
|
||||
num++;
|
||||
if (num <= (5 - length)) {
|
||||
$('#uploader-list').append(
|
||||
'<div id="" class="file-iteme">' +
|
||||
'<div class="handle"><p>x</p></div>' +
|
||||
handleFileType(index, file, result) +
|
||||
'</div>'
|
||||
);
|
||||
let map = new Map();//将选择的图片索引和图片写成对象存入集合
|
||||
map.index = index;
|
||||
map.file = file;
|
||||
fileList.push(map);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
getBalanceDataDetails();
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据详情
|
||||
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) {
|
||||
|
||||
//基本信息回显
|
||||
let dataObj = result.data;
|
||||
$('#supName').val(dataObj.supName);
|
||||
$('#fkTime').val(util.toDateString(dataObj.fkTime, 'yyyy-MM-dd'));
|
||||
$('#money').val(dataObj.money);
|
||||
$('#remark').val(dataObj.remark);
|
||||
$('#planListNum').val(dataObj.planList.length)
|
||||
|
||||
// ========== 保留:附件回显+加入 ==========
|
||||
let cent = '';
|
||||
// 清空原有fileList和delIdArr(避免重复)
|
||||
fileList = [];
|
||||
delIdArr = []; // 重置删除文件ID数组
|
||||
if (dataObj.fileList.length > 0) {
|
||||
for (let i = 0; i < dataObj.fileList.length; i++) {
|
||||
let l = dataObj.fileList[i];
|
||||
let path = fileUrl + l.fileUrl + '?token=' + sessionStorage.getItem("gz-token");
|
||||
let file = { name: l.fileName, id: l.id, type: l.type };
|
||||
cent += '<div id="" class="file-iteme" data-file-id="' + l.id + '">' +
|
||||
'<div class="handle"><p>x</p></div>' +
|
||||
handleFileType(i, file, path, l.type) +
|
||||
'</div>';
|
||||
// 回显附件加入fileList(标记为已存在的文件)
|
||||
fileList.push({
|
||||
index: i,
|
||||
file: file,
|
||||
isExist: true, // 标记为回显的旧文件
|
||||
fileId: l.id // 存储文件ID,用于删除
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log("aa==",fileList)
|
||||
$('#uploader-list').append(cent);
|
||||
|
||||
// 计划明细回显
|
||||
planDetail(dataObj.planList)
|
||||
// 用车明细回显
|
||||
carDetail(dataObj.detailsList)
|
||||
|
||||
// ========== 保留:初始化allDataList和jjDataArr ==========
|
||||
allDataList = dataObj.detailsList || [];
|
||||
jjDataArr = dataObj.planList || [];
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}
|
||||
|
||||
function planDetail(list) {
|
||||
$('#plan-detail-table tr:not(:first)').remove();
|
||||
if (list.length > 0) {
|
||||
let html = '';
|
||||
$.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>' +
|
||||
'<td>' +
|
||||
'<div class="handle">' +
|
||||
'<a style="color:#f56c6c;cursor: pointer;" onclick="delPlanDetail(' + index + ')">删除</a>' +
|
||||
'</div>' +
|
||||
'</td>' +
|
||||
'</tr>';
|
||||
});
|
||||
$('#plan-detail-table').append(html);
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 保留:delPlanDetail删除关联用车明细+同步数据 ==========
|
||||
function delPlanDetail(index) {
|
||||
let planList = $('#plan-detail-table tr:not(:first)');
|
||||
if (planList.length <= 1) {
|
||||
return layer.msg('计划明细至少保留1条数据,无法删除!', {icon: 7});
|
||||
}
|
||||
let currentTr = planList.eq(index);
|
||||
let delCode = currentTr.find('td:eq(2)').text().trim();
|
||||
if (!delCode) {
|
||||
return layer.msg('未获取到需求计划编号,无法删除!', {icon: 2});
|
||||
}
|
||||
|
||||
layer.confirm('确定删除该计划明细及对应的用车明细数据吗?', {icon: 3, title: '提示'}, function (layIndex) {
|
||||
currentTr.remove();
|
||||
$('#plan-detail-table tr:not(:first)').each(function(i) {
|
||||
$(this).find('td:eq(0)').text(i + 1);
|
||||
});
|
||||
//删除用车明细中code匹配的数据
|
||||
deleteCarDetailByCode(delCode);
|
||||
// 同步更新jjDataArr和allDataList
|
||||
jjDataArr = jjDataArr.filter(item => item.code !== delCode);
|
||||
allDataList = allDataList.filter(item => item.planCode !== delCode);
|
||||
layer.close(layIndex);
|
||||
})
|
||||
}
|
||||
|
||||
// ========== 保留:deleteCarDetailByCode精准删除用车明细 ==========
|
||||
function deleteCarDetailByCode(delCode) {
|
||||
// 1. 删除普通车辆表格中对应code的数据
|
||||
$('#dispatch-car-table tr:not(:first)').each(function() {
|
||||
let $tr = $(this);
|
||||
// 优先获取a标签文本,避免索引错误
|
||||
let carCode = $tr.find('td:last a').text().trim() || '';
|
||||
if (!carCode) {
|
||||
carCode = $tr.find('td:last').text().replace(/<.*?>/g, '').trim();
|
||||
}
|
||||
if (carCode === delCode) {
|
||||
$tr.remove();
|
||||
}
|
||||
});
|
||||
|
||||
// 2. 删除吊车表格中对应code的数据
|
||||
$('#dispatch-car-table2 tr:not(:first)').each(function() {
|
||||
let $tr = $(this);
|
||||
// 优先获取a标签文本,避免索引错误
|
||||
let dcCode = $tr.find('td:last a').text().trim() || '';
|
||||
if (!dcCode) {
|
||||
dcCode = $tr.find('td:last').text().replace(/<.*?>/g, '').trim();
|
||||
}
|
||||
if (dcCode === delCode) {
|
||||
$tr.remove();
|
||||
}
|
||||
});
|
||||
|
||||
// 3. 处理删除后无数据的情况
|
||||
if ($('#dispatch-car-table tr:not(:first)').length === 0) {
|
||||
$('#dispatch-car-table').css('display', 'none');
|
||||
}
|
||||
if ($('#dispatch-car-table2 tr:not(:first)').length === 0) {
|
||||
$('#dispatch-car-table2').css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
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 = formatToTwoDecimals(item.exeGls) || 0.00; // 实际公里数初始=预估公里数
|
||||
|
||||
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><input type='number' class='form-control actual-gls' value='" + actualGls +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></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 = '<tr><td colspan="13" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#dispatch-car-table').removeAttr('style').append(html);
|
||||
} else {
|
||||
$('#dispatch-car-table').css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
// 派车明细-吊车
|
||||
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 = formatToTwoDecimals(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.planDay + '</td>' +
|
||||
"<td><input type='number' class='form-control actual-dc-planDay' value='" + actualPlanDay +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></td>" +
|
||||
'<td>' + setZlPrice(item) + '</td>' +
|
||||
'<td> ¥ ' + item.dcMoney + '</td>' +
|
||||
|
||||
"<td><input type='number' class='form-control actual-dc-money' value='" + actualDcMoney +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置文件类型
|
||||
function handleFileType(index, file, result) {
|
||||
let html = '', img = '';
|
||||
if (file.ext) {
|
||||
file.ext = file.ext.toLowerCase();
|
||||
}
|
||||
if (file.name) {
|
||||
file.name = file.name.toLowerCase();
|
||||
}
|
||||
if (file.ext === 'doc' || file.ext === 'docx') {
|
||||
img = '../../../images/docx.png';
|
||||
} else if (file.ext === 'xls' || file.ext === 'xlsx') {
|
||||
img = '../../../images/xlsx.png';
|
||||
} else if (file.ext === 'pdf') {
|
||||
img = '../../../images/pdf.png';
|
||||
} else {
|
||||
return '<img class="img" style="width: 130px;height: 120px;" data-index=' + index + ' data-name=' + file.name + ' src=' + result + '>';
|
||||
}
|
||||
html += '<div class="layout upload-file" data-index=' + index + '>' +
|
||||
'<img src="' + img + '">' +
|
||||
'<p style="text-align: center;font-size:12px;">' + file.name + '</p>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
// ========== 保留+优化:附件删除逻辑(兼容回显/新增,收集delIdArr) ==========
|
||||
$(document).on("click", ".file-iteme .handle", function (event) {
|
||||
event.stopPropagation();
|
||||
let $this = $(this);
|
||||
let $parent = $this.parent();
|
||||
let fileId = $parent.attr('data-file-id'); // 回显文件的ID
|
||||
let index = $this.next().attr('data-index'); // 新增文件的索引
|
||||
|
||||
// 1. 收集要删除的文件ID(用于后端删除)
|
||||
if (fileId) {
|
||||
delIdArr.push(fileId); // 存储要删除的旧文件ID
|
||||
}
|
||||
|
||||
// 2. 过滤fileList数组
|
||||
let newFileList = [];
|
||||
$.each(fileList, function (inx, ele) {
|
||||
// 排除要删除的文件(新增文件按index,回显文件按fileId)
|
||||
if ((index && index != ele.index) || (fileId && ele.fileId != fileId)) {
|
||||
newFileList.push(ele);
|
||||
}
|
||||
});
|
||||
|
||||
// 3. 更新fileList
|
||||
fileList = newFileList;
|
||||
// 4. 删除DOM
|
||||
$parent.remove();
|
||||
});
|
||||
|
||||
function saveData2() {
|
||||
$('#formSubmit').trigger('click')
|
||||
}
|
||||
|
||||
// ========== 保留+核心修改:submitApply(delFileId逗号分隔) ==========
|
||||
function submitApply(data) {
|
||||
// 校验附件证明是否上传(保留:兼容回显附件)
|
||||
console.log('fileList:', fileList)
|
||||
let totalFileCount = fileList.length;
|
||||
if (totalFileCount === 0) {
|
||||
return layer.msg('请上传付款单', {icon: 7});
|
||||
}
|
||||
if (jjDataArr.length === 0) {
|
||||
return layer.msg('请选择需求计划', {icon: 7});
|
||||
}
|
||||
if (allDataList.length === 0) {
|
||||
return layer.msg('用车明细数据为空,无法提交', {icon: 7});
|
||||
}
|
||||
|
||||
data.field.supId = objParam.supId;
|
||||
data.field.id = objParam.id; // 修改操作必须传主键ID
|
||||
// ========== 核心修改:delFileId用逗号分隔 ==========
|
||||
data.field.delFileId = delIdArr.join(','); // 数组转逗号分隔字符串
|
||||
console.log('delFileId(逗号分隔):', data.field.delFileId); // 调试用
|
||||
|
||||
let planList = [], detailsList = [];
|
||||
$.each(jjDataArr, function (index, item) {
|
||||
let obj = {
|
||||
id: item.id || '',
|
||||
planId: item.planId || item.id,
|
||||
supId: objParam.supId,
|
||||
money: item.money,
|
||||
type: item.type || '1',
|
||||
proId: item.proId || '',
|
||||
carNum: item.carNum || item.needNum || 0
|
||||
};
|
||||
planList.push(obj);
|
||||
})
|
||||
|
||||
const actualValues = getEditedActualValues();
|
||||
|
||||
$.each(allDataList, function (index, item) {
|
||||
const carActual = actualValues.carActualList.find(v => v.outDetailId == item.id); // 普通车辆
|
||||
const craneActual = actualValues.craneActualList.find(v => v.outDetailId == item.id); // 吊车
|
||||
let obj = {
|
||||
id: item.id || '',
|
||||
planId: item.planId || '',
|
||||
type: item.type || '车辆',
|
||||
supId: item.supId || objParam.supId,
|
||||
proId: item.proId || '',
|
||||
money: item.cost || item.money || 0,
|
||||
outId: item.outId || '',
|
||||
exeGls: carActual?.exeGls || item.exeGls || '',
|
||||
inMoney: carActual?.inMoney || craneActual?.inMoney || '',
|
||||
exeDay: craneActual?.exeDay || item.exeDay || '',
|
||||
outDetailId: item.id || '',
|
||||
modelId: item.modelId || '',
|
||||
ton: item.ton || 0
|
||||
};
|
||||
detailsList.push(obj);
|
||||
})
|
||||
data.field.planList = planList;
|
||||
data.field.detailsList = detailsList;
|
||||
|
||||
let formData = new FormData();
|
||||
//遍历最终文件集合(仅上传新增文件)
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
let fileItem = fileList[i];
|
||||
if (!fileItem.isExist && fileItem.file) {
|
||||
formData.append("file[]", fileItem.file)
|
||||
}
|
||||
}
|
||||
formData.append('params', JSON.stringify(data.field));
|
||||
console.log("提交参数:", data.field); // 调试用
|
||||
|
||||
let loadingMsg = layer.msg('正在提交保存,请稍等...', {icon: 16, shade: 0.01, time: '0'});
|
||||
let url = dataUrl + 'backstage/carBalance/updateBalanceData';
|
||||
ajaxRequestByUploadFile(url, formData, function () {
|
||||
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg);
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
if (result.code === 200) {
|
||||
parent.layer.msg(result.msg, {icon: 1});
|
||||
closePage(1);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}
|
||||
|
||||
// 选择需求计划单据
|
||||
function chooseFitType() {
|
||||
let params = {
|
||||
contractId: objParam.contractId,
|
||||
supId: objParam.supId,
|
||||
planId: planId,
|
||||
jjDataArr: JSON.stringify(jjDataArr)
|
||||
};
|
||||
openIframeByParamObj("choose_plan_code_list", '选择需要付款的需求计划编号', "./choose_plan_code_list.html", '92%', '95%', params);
|
||||
}
|
||||
|
||||
// 需求计划单据赋值
|
||||
function addFitDatas(data, planIdArr) {
|
||||
jjDataArr = JSON.parse(data);
|
||||
console.error(jjDataArr);
|
||||
|
||||
let money = 0;
|
||||
$.each(jjDataArr, function (index, item) {
|
||||
const dataNum = item.money ? item.money : 0;
|
||||
const num = Number(dataNum);
|
||||
const cents = Math.round(num * 1000);
|
||||
money += cents;
|
||||
})
|
||||
$('#money').val(money / 1000);
|
||||
if (!planId) {
|
||||
$('#chooseValue').val('选择数据(已选择 ' + planIdArr.length + ' 条)');
|
||||
$('#no_data_title').css({'display': 'none'});
|
||||
$('#search-info').removeAttr('style');
|
||||
$('#table-box').removeAttr('style');
|
||||
planId = planIdArr.join('@');
|
||||
getPayCarDetails();
|
||||
} else {
|
||||
$('#chooseValue').val('选择数据(已选择 ' + planIdArr.length + ' 条)');
|
||||
planId = planIdArr.join('@');
|
||||
getPayCarDetails();
|
||||
}
|
||||
}
|
||||
|
||||
// 派车录入详情明细-派车资料等明细
|
||||
function getPayCarDetails(id) {
|
||||
let encryptedData = {planId: planId};
|
||||
let url = dataUrl + 'backstage/carBalance/getPayCarDetails?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
|
||||
ajaxRequest(url, "GET", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
dataObj = result.data;
|
||||
setTableData(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
function setTableData(list) {
|
||||
allDataList.splice(0, allDataList.length);
|
||||
allDataList = 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 = formatToTwoDecimals(item.gls) || 0.00; // 实际公里数初始=预估公里数
|
||||
// const actualMoney = formatToTwoDecimals(0); // 实际金额初始=预估金额
|
||||
|
||||
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>" + item.gls + "</td>" +
|
||||
|
||||
"<td><input type='number' class='form-control actual-gls' value='" + actualGls +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></td>" +
|
||||
|
||||
"<td>" + item.glsPrice + "</td>" +
|
||||
"<td> ¥ " + (item.glsMoney ? item.glsMoney : 0) + "</td>" +
|
||||
|
||||
// "<td><input type='number' class='form-control actual-money' value='" + actualMoney +
|
||||
// "' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></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 = '<tr><td colspan="13" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#dispatch-car-table').removeAttr('style').append(html);
|
||||
} else {
|
||||
$('#dispatch-car-table').css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
// 派车明细-吊车
|
||||
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.planDay || 0;
|
||||
const actualDcMoney = formatToTwoDecimals(0);
|
||||
|
||||
html += '<tr>' +
|
||||
'<td>' + item.type + '</td>' +
|
||||
'<td>' + item.name + '</td>' +
|
||||
'<td>' + item.model + '</td>' +
|
||||
'<td>' + item.carNum + '</td>' +
|
||||
'<td>' + item.useAddress + '</td>' +
|
||||
'<td>' + item.planDay + '</td>' +
|
||||
"<td><input type='number' class='form-control actual-dc-planDay' value='" + actualPlanDay +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></td>" +
|
||||
'<td>' + setZlPrice(item) + '</td>' +
|
||||
'<td> ¥ ' + item.dcMoney + '</td>' +
|
||||
|
||||
"<td><input type='number' class='form-control actual-dc-money' value='" + actualDcMoney +
|
||||
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'></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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
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 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 getEditedActualValues() {
|
||||
// 存储最终收集的实际值
|
||||
let actualValues = {
|
||||
carActualList: [], // 普通车辆实际值(实际公里数、实际金额)
|
||||
craneActualList: [] // 吊车实际值(实际金额)
|
||||
};
|
||||
|
||||
// 1. 收集普通车辆的实际公里数、实际金额
|
||||
$('#dispatch-car-table tr:not(:first)').each(function () {
|
||||
const $tr = $(this);
|
||||
const itemId = $tr.find('.actual-gls').data('id'); // 获取数据ID
|
||||
if (!itemId) return; // 无ID则跳过
|
||||
|
||||
// 修复列索引:实际公里数输入框在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';
|
||||
|
||||
actualValues.carActualList.push({
|
||||
outDetailId: itemId,
|
||||
exeGls: formatToTwoDecimals(actualGls),
|
||||
inMoney: formatToTwoDecimals(actualMoney)
|
||||
});
|
||||
});
|
||||
|
||||
// 2. 收集吊车的实际金额
|
||||
$('#dispatch-car-table2 tr:not(:first)').each(function () {
|
||||
const $tr = $(this);
|
||||
const itemId = $tr.find('.actual-dc-money').data('id'); // 获取数据ID
|
||||
if (!itemId) return; // 无ID则跳过
|
||||
|
||||
const actualPlanDay = $tr.find('.actual-dc-planDay').val().trim() || $tr.find('td:eq(5)').text().trim() || '0';
|
||||
const actualDcMoney = $tr.find('.actual-dc-money').val().trim() || '0.00';
|
||||
|
||||
actualValues.craneActualList.push({
|
||||
outDetailId: itemId,
|
||||
inMoney: formatToTwoDecimals(actualDcMoney),
|
||||
exeDay: actualPlanDay
|
||||
});
|
||||
});
|
||||
return actualValues;
|
||||
}
|
||||
|
||||
// 全局工具函数:格式化数字为两位小数(处理空值、非数字)
|
||||
function formatToTwoDecimals(num) {
|
||||
if (num === null || num === undefined || num === '' || isNaN(Number(num))) return '0.00';
|
||||
return Number(num).toFixed(2);
|
||||
}
|
||||
|
||||
// 输入框正则校验(仅正数 + 最多两位小数 + 不超过1亿元)
|
||||
$(document).on('input', '.actual-gls, .actual-money, .actual-dc-money', function () {
|
||||
this.value = this.value
|
||||
.replace(/[^0-9.]/g, '') // 过滤非法字符
|
||||
.replace(/\.{2,}/g, '.') // 单个小数点
|
||||
.replace(/^0+(?=\d)/, ''); // 去除开头多余0
|
||||
|
||||
if (this.value.indexOf('.') !== -1) {
|
||||
const parts = this.value.split('.');
|
||||
this.value = parts[0] + '.' + parts[1].substring(0, 2);
|
||||
}
|
||||
|
||||
const numValue = Number(this.value || 0);
|
||||
const maxAmount = 100000000;
|
||||
if (numValue > maxAmount) {
|
||||
this.value = maxAmount.toFixed(2);
|
||||
}
|
||||
});
|
||||
|
||||
// 失焦格式化
|
||||
$(document).on('blur', '.actual-gls, .actual-money, .actual-dc-money', function () {
|
||||
this.value = formatToTwoDecimals(this.value);
|
||||
});
|
||||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
window.parent.reloadData();
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
let objParam, dataObj;
|
||||
let form, table, upload, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
$('#titleName').html(objParam.supName + '供应商付款记录');
|
||||
$('#code').html(objParam.code + setPayStatus());
|
||||
layui.use(["form", "table", 'upload', 'layer', 'element'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
upload = layui.upload;
|
||||
layer = layui.layer;
|
||||
});
|
||||
|
||||
function setPayStatus() {
|
||||
if (objParam.status === '未付') {
|
||||
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待付款";
|
||||
} else {
|
||||
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px'>●</span>已付款";
|
||||
}
|
||||
}
|
||||
|
||||
getSltDetailsInfo();
|
||||
getPayCarDetails();
|
||||
}
|
||||
|
||||
//admission fee
|
||||
|
||||
// 供应商付款记录-详情
|
||||
function getSltDetailsInfo() {
|
||||
let encryptedData = {planId: objParam.planId};
|
||||
let url = dataUrl + 'backstage/carBalance/getSltDetailsInfo?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
|
||||
ajaxRequest(url, "GET", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
dataObj = result.data;
|
||||
setTableData(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, 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);
|
||||
$('#carNum').html(obj.carNum);
|
||||
$('#money').html('¥' + obj.money);
|
||||
$('#dispatchDay').html(obj.dispatchDay);
|
||||
$('#remark').html(obj.remark);
|
||||
// 附件文档
|
||||
setFileTable(obj.fileList);
|
||||
}
|
||||
|
||||
// 附件文档赋值
|
||||
function setFileTable(fileList) {
|
||||
$('#file-table tr:not(:first)').remove();
|
||||
let html = '';
|
||||
if (fileList && fileList.length > 0) {
|
||||
$.each(fileList, function (index, item) {
|
||||
html += '<tr>' +
|
||||
'<td>' + handleFileType(item.fileName) + item.fileName + '</td>' +
|
||||
'<td>' + (item.type) + '</td>' +
|
||||
'<td><img src="../../../images/user_head_icon.png" width="20px" height="20px">' + item.createName + '</td>' +
|
||||
'<td>' + item.createTime + '</td>' +
|
||||
'<td><a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewFile(' + JSON.stringify(item) + ')\'>预览</a>' +
|
||||
'<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'downLoadFile(' + JSON.stringify(item) + ')\'>下载</a>' +
|
||||
'</td>' +
|
||||
'</tr>';
|
||||
})
|
||||
} else {
|
||||
html = '<tr><td colspan="5" style="text-align: center;">暂无数据</td></tr>';
|
||||
}
|
||||
$('#file-table tbody').after(html);
|
||||
}
|
||||
|
||||
// 处理文件类型
|
||||
function handleFileType(value) {
|
||||
value = value.toLowerCase();
|
||||
let src = '';
|
||||
if (value.indexOf('docx') > -1 || value.indexOf('doc') > -1) {
|
||||
src = '../../../images/docx.png'
|
||||
} else if (value.indexOf('xls') > -1 || value.indexOf('xlsx') > -1) {
|
||||
src = '../../../images/xlsx.png'
|
||||
} else if (value.indexOf('pdf') > -1) {
|
||||
src = '../../../images/pdf.png'
|
||||
} else if (value.indexOf('png') > -1 || value.indexOf('jpg') > -1 || value.indexOf('jpeg') > -1) {
|
||||
src = '../../../images/img_icon.png'
|
||||
}
|
||||
return '<img width="20px" height="20px" src = "' + src + '" style="margin:0 5px;">'
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 用车明细
|
||||
function getPayCarDetails() {
|
||||
let encryptedData = {planId: objParam.planId};
|
||||
let url = dataUrl + 'backstage/carBalance/getPayCarDetails?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
|
||||
ajaxRequest(url, "GET", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setData(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
function setData(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;
|
||||
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>" + item.gls + "</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>";
|
||||
})
|
||||
} else {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
// 派车明细-吊车
|
||||
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;
|
||||
html += '<tr>' +
|
||||
'<td>' + item.type + '</td>' +
|
||||
'<td>' + item.name + '</td>' +
|
||||
'<td>' + item.model + '</td>' +
|
||||
'<td>' + item.carNum + '</td>' +
|
||||
'<td>' + item.useAddress + '</td>' +
|
||||
'<td>' + item.planDay + '</td>' +
|
||||
'<td>' + item.days + '</td>' +
|
||||
'<td>' + item.fee + '元</td>' +
|
||||
'<td>' + setZlPrice(item) + '</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>" +
|
||||
'</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>' + parseFloat(item.monthPrice).toFixed(2) + '(' + item.dcUnit + ')' + '</p>';
|
||||
} else {
|
||||
html += '<p>' + parseFloat(item.dayPrice).toFixed(2) + '(' + item.dcUnit + ')' + '</p>';
|
||||
}
|
||||
if (item.isOutSet === 1) {
|
||||
html += '<p>' + (item.jcMoney ? parseFloat(item.jcMoney).toFixed(2) : 0) + '(进出场费)</p>'
|
||||
}
|
||||
return html;
|
||||
}
|
||||
} else {
|
||||
$('#dispatch-car-table2').css('display', 'none');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 预览文件
|
||||
function viewFile(obj) {
|
||||
let fileName = obj.fileName.toLowerCase();
|
||||
if (fileName.indexOf('png') > -1 || fileName.indexOf('jpg') > -1 || fileName.indexOf('jpeg') > -1) {
|
||||
layer.photos({
|
||||
shade: 0.5,
|
||||
photos: {
|
||||
"title": "图片预览",
|
||||
"start": 0,
|
||||
"data": [
|
||||
{
|
||||
"alt": "layer",
|
||||
"pid": 1,
|
||||
"src": fileUrl + obj.fileUrl + '?token=' + sessionStorage.getItem("gz-token"),
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 调用公司的预览文件的服务
|
||||
commonViewFile(obj.fileUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// 下载文件
|
||||
function downLoadFile(obj) {
|
||||
let url = dataUrl + "sys/file/download?fileId=" + obj.id;
|
||||
downLoadFileUtil(url, obj.fileName, null);
|
||||
}
|
||||
|
||||
// 查看附件
|
||||
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 || obj.code;
|
||||
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 enter(obj) {
|
||||
var html = `
|
||||
<form class="layui-form" lay-filter="feeForm" style="padding: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">实际天数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="days" lay-verify="required|number|min[1]"
|
||||
placeholder="请输入使用天数" autocomplete="off"
|
||||
class="layui-input" min="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">入场费(元)</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="fee" lay-verify="required|number|min[0]"
|
||||
placeholder="请输入入场费用" autocomplete="off"
|
||||
class="layui-input" min="0" step="0.01">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-bg-blue no-print" lay-submit lay-filter="submitForm">确认</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" id="resetForm">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '录入信息',
|
||||
content: html,
|
||||
area: ['500px', '300px'],
|
||||
shade: 0.3,
|
||||
btn: [], // 不显示默认按钮
|
||||
success: function (layero) {
|
||||
// 渲染表单
|
||||
form.render();
|
||||
|
||||
// 表单提交事件
|
||||
form.on('submit(submitForm)', function (data) {
|
||||
obj.days = data.field.days;
|
||||
obj.fee = data.field.fee;
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(obj)
|
||||
}
|
||||
let url = dataUrl + 'backstage/carBalance/updatePayCar';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
getPayCarDetails()
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
|
||||
// 显示成功提示
|
||||
layer.msg('录入成功!', {icon: 1});
|
||||
|
||||
// 关闭弹窗
|
||||
layer.closeAll('page');
|
||||
|
||||
return false; // 阻止表单跳转
|
||||
});
|
||||
|
||||
// 重置按钮事件
|
||||
layero.find('#resetForm').on('click', function () {
|
||||
form.val('feeForm', {
|
||||
'days': '',
|
||||
'fee': ''
|
||||
});
|
||||
return false; // 阻止默认重置行为
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 打印
|
||||
function print() {
|
||||
$("#main-box").print({
|
||||
globalStyles: true,
|
||||
mediaPrint: false,
|
||||
noPrintSelector: ".no-print",
|
||||
iframe: true,
|
||||
append: null,
|
||||
prepend: null,
|
||||
manuallyCopyFormValues: true,
|
||||
deferred: $.Deferred()
|
||||
});
|
||||
}
|
||||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
<div class="layuimini-main">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="demo-filter-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li value="">全部</li>
|
||||
<li value="-1" class="layui-this">待提交</li>
|
||||
<li value="" class="layui-this">全部</li>
|
||||
<li value="-1">待提交</li>
|
||||
<li value="1" >待审核</li>
|
||||
<li value="0">已通过</li>
|
||||
<li value="2">已驳回</li>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>供应商付款-审核修改</title>
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/font.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/data_form.css" media="all">
|
||||
<!-- <link rel="stylesheet" href="../../../css/accessory/accessory_store_form.css" media="all"> -->
|
||||
<link rel="stylesheet" href="../../../css/car_settlement/payment_form.css" media="all">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main-box">
|
||||
<div id="basic-box">
|
||||
<form class="layui-form layuimini-form" onclick="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">供应商</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" style="background-color: #F2F2F2 !important;" readonly
|
||||
name="supName" id="supName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">选择需求计划数</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" style="background-color: #F2F2F2 !important;" readonly
|
||||
name="planListNum" id="planListNum">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 110px !important;">付款日期</label>
|
||||
<div class="layui-input-inline layui-input-wrap">
|
||||
<div class="layui-input-prefix">
|
||||
<i class="layui-icon layui-icon-date"></i>
|
||||
</div>
|
||||
<input class="layui-input" id="fkTime" autocomplete="off" name="fkTime"
|
||||
lay-verify="required" readonly style="cursor: pointer;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">本次付款金额</label>
|
||||
<div class="layui-input-inline layui-input-wrap">
|
||||
<input class="layui-input" style="background-color: #F2F2F2 !important;" readonly
|
||||
name="money" id="money">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">备注</label>
|
||||
<div class="layui-input-inline">
|
||||
<textarea placeholder="请输入备注" lay-verify="required" id="remark" name="remark"
|
||||
class="layui-textarea" maxLength="255" lay-affix="clear"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
|
||||
style="display: none;"></button>
|
||||
</form>
|
||||
<div class="layui-upload" style="padding: 0 39px;">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: auto;border: none;">
|
||||
<p>付款单附件<span class="required">*</span></p>
|
||||
<div class="layui-upload-list uploader-list" style="overflow: auto;" id="uploader-list"></div>
|
||||
<div id="test2" style="margin-left: 10px;">
|
||||
<img src="../../../images/add.png">
|
||||
</div>
|
||||
<div class="layout" style="flex-direction: column;margin-left: 2px;">
|
||||
<p style="color: red;">提示:最多上传5个附件</p>
|
||||
<p style="color: red;">支持格式:jpg、png、jpeg</p>
|
||||
<p style="color: red;">doc、docx、pdf、xlsx、xls</p>
|
||||
</div>
|
||||
</blockquote>
|
||||
</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>
|
||||
<th style="width: 10%;">操作</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>用车明细</p>
|
||||
</div>
|
||||
<!-- 无数据时-展示 -->
|
||||
<!-- <div id="no_data_title" class="layout">-->
|
||||
<!-- <img src="../../../images/no_data_icon.png" alt="无数据">-->
|
||||
<!-- <p style="font-size: 16px;font-weight: bold;">您还没选择需要付款的需求计划单据</p>-->
|
||||
<!-- <p style="color: #999999;">需要添加后才能执行操作</p>-->
|
||||
<!-- </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>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/car_application_audit/car_audit_update.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -151,6 +151,6 @@
|
|||
<script src="../../../js/jQuery.print.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
<script src="../../../js/car_settlement/child/settlement_detail.js" charset="utf-8"></script>
|
||||
<script src="../../../js/car_application_audit/settlement_detail.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue