付款单加备注
This commit is contained in:
parent
adc378a86d
commit
c1bc45744a
|
|
@ -512,7 +512,7 @@ function setOperRecordInfo(list, obj) {
|
||||||
let imgUrl = '../../../images/user_head_icon.png';
|
let imgUrl = '../../../images/user_head_icon.png';
|
||||||
let imgUrl2 = '../../../images/time_icon.png';
|
let imgUrl2 = '../../../images/time_icon.png';
|
||||||
$.each(list, function (index, item) {
|
$.each(list, function (index, item) {
|
||||||
const creator = item.userName;
|
const creator = item.auditUser;
|
||||||
// 1. 容错处理(统一处理空值、类型转换)
|
// 1. 容错处理(统一处理空值、类型转换)
|
||||||
const remark = setNullValue(item.auditReason); // 已有空值处理,保留
|
const remark = setNullValue(item.auditReason); // 已有空值处理,保留
|
||||||
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
|
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ function initTable() {
|
||||||
let html = "";
|
let html = "";
|
||||||
let status = d.status;
|
let status = d.status;
|
||||||
html += "<a onclick='checkAuditDetail(" + JSON.stringify(d) + ")'>详情</a> ";
|
html += "<a onclick='checkAuditDetail(" + JSON.stringify(d) + ")'>详情</a> ";
|
||||||
if(status == -1){
|
if(status == -1 || status == 2){
|
||||||
html += "<div class='splitLine'>|</div><a onclick='checkSubmit(" + JSON.stringify(d) + ")'>提交</a>"
|
html += "<div class='splitLine'>|</div><a onclick='checkSubmit(" + JSON.stringify(d) + ")'>提交</a>"
|
||||||
}
|
}
|
||||||
if(status == -1 || status == 2){
|
if(status == -1 || status == 2){
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ function setParams(obj) {
|
||||||
|
|
||||||
laydate.render({elem: '#fkTime'});
|
laydate.render({elem: '#fkTime'});
|
||||||
form.verify();
|
form.verify();
|
||||||
form.on('submit(formData)', function(data){ submitApply(data); });
|
form.on('submit(formData)', function (data) {
|
||||||
|
submitApply(data);
|
||||||
|
});
|
||||||
form.render();
|
form.render();
|
||||||
|
|
||||||
// 初始化上传
|
// 初始化上传
|
||||||
|
|
@ -39,7 +41,9 @@ function setParams(obj) {
|
||||||
bindAction: '#hideUpload',
|
bindAction: '#hideUpload',
|
||||||
choose: function (obj) {
|
choose: function (obj) {
|
||||||
let existCount = fileList.length;
|
let existCount = fileList.length;
|
||||||
if(existCount >=5){ return layer.msg('最多上传5个附件证明',{icon:7}); }
|
if (existCount >= 5) {
|
||||||
|
return layer.msg('最多上传5个附件证明', {icon: 7});
|
||||||
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
if (fileList.length >= 5) return;
|
if (fileList.length >= 5) return;
|
||||||
|
|
@ -83,11 +87,13 @@ function getBalanceDataDetails(){
|
||||||
dataObj.fileList.forEach((f, i) => {
|
dataObj.fileList.forEach((f, i) => {
|
||||||
const uid = 'old_' + f.id;
|
const uid = 'old_' + f.id;
|
||||||
const path = fileUrl + f.fileUrl + '?token=' + sessionStorage.getItem("gz-token");
|
const path = fileUrl + f.fileUrl + '?token=' + sessionStorage.getItem("gz-token");
|
||||||
|
// 从 suffix 取文件后缀
|
||||||
|
const ext = f.suffix ? f.suffix.replace('.', '').toLowerCase() : '';
|
||||||
fileList.push({uid, name: f.fileName, isExist: true, fileId: f.id, file: null});
|
fileList.push({uid, name: f.fileName, isExist: true, fileId: f.id, file: null});
|
||||||
$('#uploader-list').append(`
|
$('#uploader-list').append(`
|
||||||
<div class="file-iteme" data-uid="${uid}" data-file-id="${f.id}">
|
<div class="file-iteme" data-uid="${uid}" data-file-id="${f.id}">
|
||||||
<div class="handle">x</div>
|
<div class="handle">x</div>
|
||||||
${handleFileType(i,{name:f.fileName,ext:f.type},path)}
|
${handleFileType(i, {name: f.fileName, ext: ext}, path)}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
@ -103,7 +109,9 @@ function getBalanceDataDetails(){
|
||||||
allDataList = dataObj.detailsList || [];
|
allDataList = dataObj.detailsList || [];
|
||||||
jjDataArr = dataObj.planList || [];
|
jjDataArr = dataObj.planList || [];
|
||||||
}
|
}
|
||||||
},function(xhr,status,error){ errorFn(xhr,status,error); },null);
|
}, function (xhr, status, error) {
|
||||||
|
errorFn(xhr, status, error);
|
||||||
|
}, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------- 计划明细 -------------------
|
// ------------------- 计划明细 -------------------
|
||||||
|
|
@ -130,7 +138,9 @@ function planDetail(list){
|
||||||
// ------------------- 删除计划明细 -------------------
|
// ------------------- 删除计划明细 -------------------
|
||||||
function delPlanDetail(index) {
|
function delPlanDetail(index) {
|
||||||
let planList = $('#plan-detail-table tr:not(:first)');
|
let planList = $('#plan-detail-table tr:not(:first)');
|
||||||
if(planList.length<=1){ return layer.msg('计划明细至少保留1条数据,无法删除!',{icon:7}); }
|
if (planList.length <= 1) {
|
||||||
|
return layer.msg('计划明细至少保留1条数据,无法删除!', {icon: 7});
|
||||||
|
}
|
||||||
|
|
||||||
let currentTr = planList.eq(index);
|
let currentTr = planList.eq(index);
|
||||||
let delCode = currentTr.find('td:eq(2)').text().trim();
|
let delCode = currentTr.find('td:eq(2)').text().trim();
|
||||||
|
|
@ -138,7 +148,9 @@ function delPlanDetail(index){
|
||||||
|
|
||||||
layer.confirm('确定删除该计划明细及对应的用车明细数据吗?', {icon: 3, title: '提示'}, function (layIndex) {
|
layer.confirm('确定删除该计划明细及对应的用车明细数据吗?', {icon: 3, title: '提示'}, function (layIndex) {
|
||||||
currentTr.remove();
|
currentTr.remove();
|
||||||
$('#plan-detail-table tr:not(:first)').each(function(i){ $(this).find('td:eq(0)').text(i+1); });
|
$('#plan-detail-table tr:not(:first)').each(function (i) {
|
||||||
|
$(this).find('td:eq(0)').text(i + 1);
|
||||||
|
});
|
||||||
deleteCarDetailByCode(delCode);
|
deleteCarDetailByCode(delCode);
|
||||||
jjDataArr = jjDataArr.filter(item => item.code !== delCode);
|
jjDataArr = jjDataArr.filter(item => item.code !== delCode);
|
||||||
allDataList = allDataList.filter(item => item.planCode !== delCode);
|
allDataList = allDataList.filter(item => item.planCode !== delCode);
|
||||||
|
|
@ -154,7 +166,9 @@ function deleteCarDetailByCode(delCode){
|
||||||
let code = $tr.find('td:last a').text().trim() || $tr.find('td:last').text().replace(/<.*?>/g, '').trim();
|
let code = $tr.find('td:last a').text().trim() || $tr.find('td:last').text().replace(/<.*?>/g, '').trim();
|
||||||
if (code === delCode) $tr.remove();
|
if (code === delCode) $tr.remove();
|
||||||
});
|
});
|
||||||
if($(`${tableId} tr:not(:first)`).length===0){ $(`${tableId}`).css('display','none'); }
|
if ($(`${tableId} tr:not(:first)`).length === 0) {
|
||||||
|
$(`${tableId}`).css('display', 'none');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +204,9 @@ function carDetail(list){
|
||||||
</tr>`;
|
</tr>`;
|
||||||
});
|
});
|
||||||
$('#dispatch-car-table').removeAttr('style').append(html);
|
$('#dispatch-car-table').removeAttr('style').append(html);
|
||||||
}else{ $('#dispatch-car-table').css('display','none'); }
|
} else {
|
||||||
|
$('#dispatch-car-table').css('display', 'none');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDispatchCarTable2(list) {
|
function setDispatchCarTable2(list) {
|
||||||
|
|
@ -217,7 +233,9 @@ function carDetail(list){
|
||||||
</tr>`;
|
</tr>`;
|
||||||
});
|
});
|
||||||
$('#dispatch-car-table2').removeAttr('style').append(html);
|
$('#dispatch-car-table2').removeAttr('style').append(html);
|
||||||
}else{ $('#dispatch-car-table2').css('display','none'); }
|
} else {
|
||||||
|
$('#dispatch-car-table2').css('display', 'none');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,10 +256,15 @@ function handleFileType(index,file,result){
|
||||||
let html = '', img = '';
|
let html = '', img = '';
|
||||||
if (file.ext) file.ext = file.ext.toLowerCase();
|
if (file.ext) file.ext = file.ext.toLowerCase();
|
||||||
if (file.name) file.name = file.name.toLowerCase();
|
if (file.name) file.name = file.name.toLowerCase();
|
||||||
if(file.ext==='doc'||file.ext==='docx'){ img='../../../images/docx.png'; }
|
if (file.ext === 'doc' || file.ext === 'docx') {
|
||||||
else if(file.ext==='xls'||file.ext==='xlsx'){ img='../../../images/xlsx.png'; }
|
img = '../../../images/docx.png';
|
||||||
else if(file.ext==='pdf'){ img='../../../images/pdf.png'; }
|
} else if (file.ext === 'xls' || file.ext === 'xlsx') {
|
||||||
else{ return `<img class="img" style="width:130px;height:120px;" data-index=${index} data-name=${file.name} src=${result}>`; }
|
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}>
|
html = `<div class="layout upload-file" data-index=${index}>
|
||||||
<img src="${img}">
|
<img src="${img}">
|
||||||
<p style="text-align:center;font-size:12px;">${file.name}</p>
|
<p style="text-align:center;font-size:12px;">${file.name}</p>
|
||||||
|
|
@ -279,15 +302,23 @@ function getEditedActualValues(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------- 格式化两位小数 -------------------
|
// ------------------- 格式化两位小数 -------------------
|
||||||
function formatToTwoDecimals(num){ return isNaN(Number(num))? '0.00': Number(num).toFixed(2); }
|
function formatToTwoDecimals(num) {
|
||||||
|
return isNaN(Number(num)) ? '0.00' : Number(num).toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------- 正则校验输入框 -------------------
|
// ------------------- 正则校验输入框 -------------------
|
||||||
$(document).on('input', '.actual-gls,.actual-money,.actual-dc-money', function () {
|
$(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)/, '');
|
this.value = this.value.replace(/[^0-9.]/g, '').replace(/\.{2,}/g, '.').replace(/^0+(?=\d)/, '');
|
||||||
if(this.value.indexOf('.')!==-1){ const parts=this.value.split('.'); this.value=parts[0]+'.'+parts[1].substring(0,2);}
|
if (this.value.indexOf('.') !== -1) {
|
||||||
const numValue=Number(this.value||0); if(numValue>100000) this.value=(100000).toFixed(2);
|
const parts = this.value.split('.');
|
||||||
|
this.value = parts[0] + '.' + parts[1].substring(0, 2);
|
||||||
|
}
|
||||||
|
const numValue = Number(this.value || 0);
|
||||||
|
if (numValue > 100000) this.value = (100000).toFixed(2);
|
||||||
|
});
|
||||||
|
$(document).on('blur', '.actual-gls,.actual-money,.actual-dc-money', function () {
|
||||||
|
this.value = formatToTwoDecimals(this.value);
|
||||||
});
|
});
|
||||||
$(document).on('blur','.actual-gls,.actual-money,.actual-dc-money',function(){ this.value=formatToTwoDecimals(this.value); });
|
|
||||||
|
|
||||||
// ------------------- 提交 -------------------
|
// ------------------- 提交 -------------------
|
||||||
function submitApply(data) {
|
function submitApply(data) {
|
||||||
|
|
@ -337,7 +368,9 @@ function submitApply(data){
|
||||||
data.field.detailsList = detailsList;
|
data.field.detailsList = detailsList;
|
||||||
|
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
fileList.forEach(item=>{ if(!item.isExist && item.file) formData.append("file[]",item.file); });
|
fileList.forEach(item => {
|
||||||
|
if (!item.isExist && item.file) formData.append("file[]", item.file);
|
||||||
|
});
|
||||||
formData.append('params', JSON.stringify(data.field));
|
formData.append('params', JSON.stringify(data.field));
|
||||||
|
|
||||||
let loadingMsg = layer.msg('正在提交保存,请稍等...', {icon: 16, shade: 0.01, time: '0'});
|
let loadingMsg = layer.msg('正在提交保存,请稍等...', {icon: 16, shade: 0.01, time: '0'});
|
||||||
|
|
@ -347,8 +380,10 @@ function submitApply(data){
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
layer.close(loadingMsg);
|
layer.close(loadingMsg);
|
||||||
$('.save,.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
$('.save,.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||||
if(result.code===200){ parent.layer.msg(result.msg,{icon:1}); closePage(1);}
|
if (result.code === 200) {
|
||||||
else layer.msg(result.msg,{icon:2});
|
parent.layer.msg(result.msg, {icon: 1});
|
||||||
|
closePage(1);
|
||||||
|
} else layer.msg(result.msg, {icon: 2});
|
||||||
}, function (xhr, status, error) {
|
}, function (xhr, status, error) {
|
||||||
layer.close(loadingMsg);
|
layer.close(loadingMsg);
|
||||||
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue