漏洞修改

This commit is contained in:
jiang 2025-11-07 14:24:02 +08:00
parent 623f3048a3
commit 36bbc3532e
4 changed files with 136 additions and 89 deletions

View File

@ -48,7 +48,11 @@ function setParams(obj) {
$('#layui-tab-content').empty().append(cent);
$('#layui-tab-title li').eq(0).addClass('layui-this');
$('#layui-tab-content>div').eq(0).addClass('layui-show');
$(".tips").suspensionTips({ "content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。", position: "top", width: 300 });
$(".tips").suspensionTips({
"content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。",
position: "top",
width: 300
});
layui.form.render();
} else if (value === '1') {
cjDataArr.splice(0, cjDataArr.length);
@ -129,9 +133,9 @@ function setParams(obj) {
}
})
if (allRatio > 100) {
return layer.msg('合同占比不能超过100%', { icon: 7 });
return layer.msg('合同占比不能超过100%', {icon: 7});
} else if (allRatio < 100) {
return layer.msg('合同占比不能小于100%', { icon: 7 });
return layer.msg('合同占比不能小于100%', {icon: 7});
}
submitApply(data);
});
@ -143,11 +147,15 @@ function setParams(obj) {
let id = $(this).find('option:checked').val();
if (id && id === value && !($(data.elem).is($(this)))) {
$(data.elem).val('');
return layer.msg('请勿重复选择供应商', { icon: 7 });
return layer.msg('请勿重复选择供应商', {icon: 7});
}
})
handleTabData(type);
$(".tips").suspensionTips({ "content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。", position: "top", width: 300 });
$(".tips").suspensionTips({
"content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。",
position: "top",
width: 300
});
layui.form.render();
});
// 合同类型
@ -176,7 +184,7 @@ function setParams(obj) {
choose: function (obj) {
let length = $('.file-iteme').length;
if (length >= 5) {
return layer.msg('最多上传5个附件证明', { icon: 7 });
return layer.msg('最多上传5个附件证明', {icon: 7});
}
uploadObj.config.elem.next()[0].value = '';
let num = 0;
@ -279,7 +287,8 @@ function handleTabData(type) {
$('#layui-tab-title' + type + ' li').each(function (index2, item2) {
if ($(this).hasClass('layui-this')) {
flag2 = false;
};
}
;
})
if (flag2) {
$('#layui-tab-title' + type + ' li').eq(0).addClass('layui-this');
@ -319,7 +328,7 @@ function getCarContractDetail() {
let fileList = obj.fileList, html = '';
for (let i = 0; i < fileList.length; i++) {
let path = fileUrl + fileList[i].fileUrl + '?token=' + sessionStorage.getItem("gz-token");
let file = { name: fileList[i].fileName, id: fileList[i].id };
let file = {name: fileList[i].fileName, id: fileList[i].id};
html += '<div id="" class="file-iteme">' +
'<div class="handle"><p>x</p></div>' +
handleFileType(i, file, path) +
@ -351,7 +360,7 @@ function getCarContractDetail() {
}
modelIdArr.push(item.modelId); // 用与后期比较删除的工器具ID
jjDataArr.push(obj);
$('#no_data_title').css({ 'display': 'none' });
$('#no_data_title').css({'display': 'none'});
$('#search-info').removeAttr('style');
$('#table-box').removeAttr('style');
setTableData(jjDataArr);
@ -442,10 +451,10 @@ function setCjData(value) {
// 设置文件类型
function handleFileType(index, file, result) {
let html = '', img = '';
if(file.ext){
if (file.ext) {
file.ext = file.ext.toLowerCase();
}
if(file.name){
if (file.name) {
file.name = file.name.toLowerCase();
}
if (file.ext === 'doc' || file.ext === 'docx' || file.name.indexOf('doc') > -1 || file.name.indexOf('docx') > -1) {
@ -498,7 +507,7 @@ function submitApply(data) {
console.log(data.field);
let length = $('.file-iteme').length;
if (length === 0) {
return layer.msg('请上传附件', { icon: 7 });
return layer.msg('请上传附件', {icon: 7});
}
let cjList = [];
$('select[name="supplier"]').each(function (index, item) {
@ -523,10 +532,10 @@ function submitApply(data) {
}
console.error(dataList);
if (dataList.length === 0) {
return layer.msg('未添加供应商数据', { icon: 7 });
return layer.msg('未添加供应商数据', {icon: 7});
}
if (cjList.length > dataList.length) {
return layer.msg('供应商数据添加不完整', { icon: 7 });
return layer.msg('供应商数据添加不完整', {icon: 7});
}
if (type === '1') {
for (let i = 0; i < dataList.length; i++) {
@ -534,7 +543,7 @@ function submitApply(data) {
for (let j = 0; j < carList.length; j++) {
let l = carList[j];
if ((!l.glsKs) || (!l.glsJs) || (!l.glPrice) || (!l.glXf) || (!l.glSjPrice)) {
return layer.msg('运输车辆-供应商:' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', { icon: 7 });
return layer.msg('运输车辆-供应商:' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', {icon: 7});
}
carList.sort((a, b) => parseInt(a.glsKs) - parseInt(b.glsJs));
console.error(carList);
@ -543,14 +552,14 @@ function submitApply(data) {
let ll2 = carList[k + 1];
if (carList.length !== 1) {
if (parseInt(carList[0].glsKs) !== 0) {
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
// if ((parseInt(ll.glsJs) + 1) !== parseInt(ll2.glsKs)) {
// return layer.msg('运输车辆-供应商-' + dataList[i].supName + ':公里数范围设置有误,请仔细检查数据', { icon: 7 });
// }
} else {
if (parseInt(ll.glsKs) !== 0) {
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
}
}
@ -562,7 +571,7 @@ function submitApply(data) {
for (let j = 0; j < carList.length; j++) {
let l = carList[j];
if ((!l.dayPrice) || (!l.monthPrice) || (!l.dcXf) || (!l.daySjPrice) || (!l.monthSjPrice) || (!l.dayToMonth)) {
return layer.msg('吊车-供应商-' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', { icon: 7 });
return layer.msg('吊车-供应商-' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', {icon: 7});
}
let outList = l.outList;
if (outList.length > 0) {
@ -572,14 +581,14 @@ function submitApply(data) {
let ll2 = outList[k + 1];
if (outList.length !== 1) {
if (parseInt(outList[0].glsStart) !== 0) {
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
// if ((parseInt(ll.glsEnd) + 1) !== parseInt(ll2.glsStart)) {
// return layer.msg('吊车-供应商-' + dataList[i].supName + ':公里数范围设置有误,请仔细检查数据', { icon: 7 });
// }
} else {
if (parseInt(ll.glsStart) !== 0) {
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
}
}
@ -607,7 +616,7 @@ function submitApply(data) {
formData.append('params', JSON.stringify(params));
console.error(params);
let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' });
let loadingMsg = layer.msg('正在提交保存,请稍等...', {icon: 16, shade: 0.01, time: '0'});
let url = dataUrl + 'backstage/carContract/updateCarContractData';
ajaxRequestByUploadFile(url, formData, function () {
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
@ -617,14 +626,14 @@ function submitApply(data) {
$('.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 });
parent.layer.msg(result.msg, {icon: 1});
closePage(1);
} else {
layer.msg(result.msg, { icon: 2 });
layer.msg(result.msg, {icon: 2});
}
}, function (xhr, status, error) {
layer.close(loadingMsg); // 关闭提示层
layer.msg('服务异常,请稍后重试', { icon: 16, scrollbar: false, time: 2000 });
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)
@ -649,12 +658,14 @@ function getCjTableData2(cjList) {
let num3 = $(this).find('td').eq(3).find('input').eq(0).val();
let num4 = $(this).find('td').eq(4).find('input').eq(0).val();
let num5 = $(this).find('td').eq(5).html();
let num6 = $(this).find('td').eq(6).find("select").eq(0).val();
obj2.id = dataId;
obj2.glsKs = num;
obj2.glsJs = num2;
obj2.glPrice = num3;
obj2.glXf = num4;
obj2.glSjPrice = num5;
obj2.ton = num6;
list.push(obj2);
})
$.each(cjList, function (index, item) {
@ -808,7 +819,7 @@ function addFitDatas(data) {
} else { // 第一次添加数据
jjDataArr = JSON.parse(data);
if (jjDataArr && jjDataArr.length > 0) {
$('#no_data_title').css({ 'display': 'none' });
$('#no_data_title').css({'display': 'none'});
$('#search-info').removeAttr('style');
$('#table-box').removeAttr('style');
setTableData(jjDataArr);
@ -863,10 +874,10 @@ function sel(selectStatus, that, id) {
// 删除选中
function delFitType() {
if (delIdArr.length == 0) {
layer.msg('请先选择需要删除的数据!', { icon: 7 })
layer.msg('请先选择需要删除的数据!', {icon: 7})
return;
}
let layerIndex = layer.confirm('<h5 style="color:red">确定要删除选中数据吗!</h5>', { title: '操作提示' }, function () {
let layerIndex = layer.confirm('<h5 style="color:red">确定要删除选中数据吗!</h5>', {title: '操作提示'}, function () {
layer.close(layerIndex);
for (let i = 0; i < delIdArr.length; i++) {
for (let j = 0; j < jjDataArr.length; j++) {
@ -880,8 +891,8 @@ function delFitType() {
delIdArr.splice(0, delIdArr.length);
if (jjDataArr.length === 0) {
$('#no_data_title').removeAttr('style');
$('#search-info').css({ 'display': 'none' });
$('#table-box').css({ 'display': 'none' });
$('#search-info').css({'display': 'none'});
$('#table-box').css({'display': 'none'});
} else {
setTableData(jjDataArr);
}
@ -971,6 +982,7 @@ function addCj(dataId) {
$('#supplier' + addNum).empty().append(cent);
layui.form.render();
}
// 删除厂家
function delCj(that, addNum, dataId) {
let cjId = $('#supplier' + addNum).val();
@ -1000,7 +1012,8 @@ function delCj(that, addNum, dataId) {
$('#layui-tab-title li').each(function (index2, item2) {
if ($(this).hasClass('layui-this')) {
flag2 = false;
};
}
;
})
if (flag2) {
$('#layui-tab-title li').eq(0).addClass('layui-this');
@ -1027,14 +1040,14 @@ function checkValue(that, type) {
const regex = /^(0|[1-9]\d{0,6})$/;
if (!regex.test(value) && value) {
$(that).val(0);
return layer.msg('数量输入有误,请重新输入!', { icon: 5 })
return layer.msg('数量输入有误,请重新输入!', {icon: 5})
}
} else if (type === 2) { // 单价
const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/;
if (!regex.test(value) && value) {
$(that).val(0);
return layer.msg('单价最高限价格式不正确(提示:最多保留两位小数)!', { icon: 5 })
return layer.msg('单价最高限价格式不正确(提示:最多保留两位小数)!', {icon: 5})
}
}
}

View File

@ -1,4 +1,5 @@
let chooseCjId = '';
// 添加运输车辆表格数据
function addTransVehiclesTable(cjId, isUse) {
let html = '<fieldset class="table-search-fieldset" id="search-info">' +
@ -23,10 +24,11 @@ function addTransVehiclesTable(cjId, isUse) {
'<tr>' +
'<th style="width: 5%" class="center"><input id="allCheck" onclick="selectAll2(this.checked,' + cjId + ')" type="checkbox"></th>' +
'<th style="width: 5%" class="center">序号</th>' +
'<th style="width: 30%" class="center">公里数</th>' +
'<th style="width: 25%" class="center">公里数</th>' +
'<th style="width: 20%" class="center">单项基准费用(元/吨*公里)</th>' +
'<th style="width: 20%" class="center">投标下浮率</th>' +
'<th style="width: 19%" class="center">实际基准费用(元/吨*公里)</th>' +
'<th style="width: 10%" class="center">实际基准费用(元/吨*公里)</th>' +
'<th style="width: 15%" class="center">吨位</th>' +
'</tr>' +
'</thead>' +
'<tbody cjId="' + cjId + '" id="transVehiclesTbody' + cjId + '" dataId="" delCarId=""></tbody>' +
@ -38,13 +40,14 @@ function addTransVehiclesTable(cjId, isUse) {
// 添加一行数据
function addTableTrData(cjId, item) {
let glsKs = '', glsJs = '', glPrice = '', glXf = '', glSjPrice = '', dataId = '';
let glsKs = '', ton = '', glsJs = '', glPrice = '', glXf = '', glSjPrice = '', dataId = '';
if (item) {
glsKs = item.glsKs;
glsJs = item.glsJs;
glPrice = item.glPrice;
glXf = item.glXf;
glSjPrice = item.glSjPrice;
ton = item.ton;
dataId = item.id ? item.id : '';
let relId = item.relId ? item.relId : '';
let id = $('#transVehiclesTbody' + cjId).attr('dataId');
@ -62,9 +65,11 @@ function addTableTrData(cjId, item) {
html += "<td>" + setFormInput(glPrice, '', 2) + "</td>";
html += "<td>" + setFormInput(glXf, '', 3) + "</td>";
html += "<td>" + glSjPrice + "</td>";
html += "<td>" + setFormInput(ton, '', 4) + "</td>";
html += "</tr>";
$('#transVehiclesTbody' + cjId).append(html);
layui.form.render();
function setFormInput(value, value2, type) {
let html = '<form class="layui-form layuimini-form"><div class="layui-inline layout">';
if (type === 1) { // 公里数
@ -75,6 +80,13 @@ function addTableTrData(cjId, item) {
html += '<input class="layui-input" name="num3" value="' + value + '" onblur="checkValue2(this,3)" autocomplete="off" maxlength="11">';
} else if (type === 3) { // 投标下浮率
html += '<input class="layui-input" name="num4" value="' + value + '" onblur="checkValue2(this,4)" autocomplete="off" maxlength="11"><span style="margin: 0 10px;"> % </span>';
} else if (type === 4) {
html += '<select name="ton">\n' +
' <option value="" ' + (value === '' ? 'selected="selected"' : '') + '>请选择</option>\n' +
' <option value="1" ' + (value === '1' ? 'selected="selected"' : '') + '>2T以下</option>\n' +
' <option value="2" ' + (value === '2' ? 'selected="selected"' : '') + '>2T到5T</option>\n' +
' <option value="3" ' + (value === '3' ? 'selected="selected"' : '') + '>5T以上</option>\n' +
' </select>';
}
html += '</div></form>';
return html;
@ -93,13 +105,13 @@ function checkValue2(that, type) {
let index = $(that).parents('td').prev().html();
if (index === '1' && value !== '0') { // 第一行数据必须从0开始
$(that).val('0');
return layer.msg('第一行前置公里数只能从0开始!', { icon: 5 })
return layer.msg('第一行前置公里数只能从0开始!', {icon: 5})
}
if (parseInt(index) > 1) {
let num2 = $(that).parents('tr').prev().find('td').eq(2).find('input').eq(1).val();
if (!num2) {
$(that).val('');
return layer.msg('请先将上一行的公里数填写完整', { icon: 5 })
return layer.msg('请先将上一行的公里数填写完整', {icon: 5})
}
// if ((parseInt(value) <= parseInt(num2)) || parseInt(value) !== (parseInt(num2) + 1)) {
// $(that).val(parseInt(num2) + 1);
@ -116,7 +128,7 @@ function checkValue2(that, type) {
let num = $(that).prev().prev().val();
if (!num) {
$(that).val('');
return layer.msg('请先填写当前行的前置公里数!', { icon: 5 })
return layer.msg('请先填写当前行的前置公里数!', {icon: 5})
}
// if (parseInt(index) === 1) {
// if (parseInt(value) <= parseInt(num)) {
@ -148,7 +160,7 @@ function checkValue2(that, type) {
const regex = /^(?:0(?:\.[0-9]{1,3})?|[1-9]\d?(?:\.[0-9]{1,3})?)$/;
if (!regex.test(value) && value || parseFloat(value) >= 100) {
$(that).val('');
return layer.msg('投标下浮率填写范围在0-99.999),请重新输入!', { icon: 5 });
return layer.msg('投标下浮率填写范围在0-99.999),请重新输入!', {icon: 5});
}
if (!value) {
$(that).parents('td').next().html('0');
@ -184,7 +196,7 @@ function delTableTrData(cjId) {
}
});
if (num === 0) {
return layer.msg('请先选择需要删除的数据!', { icon: 7 })
return layer.msg('请先选择需要删除的数据!', {icon: 7})
}
let delCarId = $('#transVehiclesTbody' + cjId).attr('delCarId');
$("input[name='check" + cjId + "']").each(function (i, n) {
@ -247,7 +259,7 @@ function importExcelData(cjId) {
console.error(dataList);
setImportData(dataList);
} else {
layer.msg("仅支持上传文件格式为xlx、xlsx", { icon: 7, });
layer.msg("仅支持上传文件格式为xlx、xlsx", {icon: 7,});
$("#import-excel" + chooseCjId).val("");
}
}
@ -264,7 +276,6 @@ function setImportData(list) {
}
/**********************************************************************/
// 厂家数据查询
@ -276,7 +287,7 @@ function search2(cjId) {
let name = $(this).find('td').eq(1).html();
if (name.indexOf(keyWord) < 0) {
$(this).removeAttr('style');
$(this).css({ 'display': 'none' });
$(this).css({'display': 'none'});
}
});
resetXh(cjId);
@ -285,7 +296,7 @@ function search2(cjId) {
let model = $(this).find('td').eq(2).html();
if (model.indexOf(keyWord2) < 0) {
$(this).removeAttr('style');
$(this).css({ 'display': 'none' });
$(this).css({'display': 'none'});
}
});
resetXh(cjId);
@ -295,7 +306,7 @@ function search2(cjId) {
let model = $(this).find('td').eq(2).html();
if (name.indexOf(keyWord) < 0 || model.indexOf(keyWord2) < 0) {
$(this).removeAttr('style');
$(this).css({ 'display': 'none' });
$(this).css({'display': 'none'});
}
});
resetXh(cjId);
@ -489,7 +500,7 @@ function checkValue3(that, type) {
const regex = /^(?:0(?:\.[0-9]{1,3})?|[1-9]\d?(?:\.[0-9]{1,3})?)$/;
if (!regex.test(value) && value || parseFloat(value) >= 100) {
$(that).val('');
return layer.msg('投标下浮率填写范围在0-99.999),请重新输入!', { icon: 5 });
return layer.msg('投标下浮率填写范围在0-99.999),请重新输入!', {icon: 5});
}
if (!value) {
$(that).parents('td').next().html('0');
@ -510,11 +521,11 @@ function checkValue3(that, type) {
const regex = /^\s*\d+\s*$/;
if (!regex.test(value) && value) {
$(that).val('');
return layer.msg('日租自动转月租只能输入正整数,请重新输入!', { icon: 5 })
return layer.msg('日租自动转月租只能输入正整数,请重新输入!', {icon: 5})
}
if (parseInt(value) === 0 || (parseInt(value) > 30)) {
$(that).val('');
return layer.msg('日租自动转月租只能在1-30之间请重新输入!', { icon: 5 })
return layer.msg('日租自动转月租只能在1-30之间请重新输入!', {icon: 5})
}
}
@ -539,7 +550,7 @@ function setCost(cjId, id) {
let item = $(this).attr('item');
list.push(JSON.parse(item));
});
let params = { id: id, cjId: cjId, list: list };
let params = {id: id, cjId: cjId, list: list};
openIframeByParamObj("setCost", '吊车进出场费用设置', "./set_cost_form.html", '92%', '95%', params);
}

View File

@ -43,7 +43,11 @@ function setParams(obj) {
$('#layui-tab-content').empty().append(cent);
$('#layui-tab-title li').eq(0).addClass('layui-this');
$('#layui-tab-content>div').eq(0).addClass('layui-show');
$(".tips").suspensionTips({ "content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。", position: "top", width: 300 });
$(".tips").suspensionTips({
"content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。",
position: "top",
width: 300
});
layui.form.render();
/* var scrollableElement = document.getElementById('layui-tab-brief');
// 添加事件监听器来处理滚轮事件
@ -130,9 +134,9 @@ function setParams(obj) {
}
})
if (allRatio > 100) {
return layer.msg('合同占比不能超过100%', { icon: 7 });
return layer.msg('合同占比不能超过100%', {icon: 7});
} else if (allRatio < 100) {
return layer.msg('合同占比不能小于100%', { icon: 7 });
return layer.msg('合同占比不能小于100%', {icon: 7});
}
submitApply(data);
});
@ -144,11 +148,15 @@ function setParams(obj) {
let id = $(this).find('option:checked').val();
if (id && id === value && !($(data.elem).is($(this)))) {
$(data.elem).val('');
return layer.msg('请勿重复选择供应商', { icon: 7 });
return layer.msg('请勿重复选择供应商', {icon: 7});
}
})
handleTabData(type);
$(".tips").suspensionTips({ "content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。", position: "top", width: 300 });
$(".tips").suspensionTips({
"content": "1.当单个项目8吨吊车作业天数22天时按零星租赁的单项基准费用×实际租赁时间×(1-投标下浮率6.2%据实结算。当单个项目作业天数≥22天按包月租赁单价执行不足30天的按1个月计费实际连续使用时间超过30天含第30天未到52天不含第52天多出的天数按包月租赁单价/30×实际租赁时间×(1-投标下浮率6.2%据实结算。连续使用时间达到52天不足60天的按两个包月租赁单价执行以此类推。2.对于同一项目,同一施工地点,同一车型,进出场时间少于或等于三次,累计计算该车型使用时间,如达到包月使用时间按包月结算。进出场超过三次及以上,按零星租赁结算。同一项目,同一施工地点,同时使用几台同一车型,按实际使用天数进行结算,如达到包月使用时间按包月结算。",
position: "top",
width: 300
});
layui.form.render();
});
// 合同类型
@ -177,7 +185,7 @@ function setParams(obj) {
choose: function (obj) {
let length = $('.file-iteme').length;
if (length >= 5) {
return layer.msg('最多上传5个附件证明', { icon: 7 });
return layer.msg('最多上传5个附件证明', {icon: 7});
}
uploadObj.config.elem.next()[0].value = '';
let num = 0;
@ -256,7 +264,8 @@ function handleTabData(type) {
$('#layui-tab-title' + type + ' li').each(function (index2, item2) {
if ($(this).hasClass('layui-this')) {
flag2 = false;
};
}
;
})
if (flag2) {
$('#layui-tab-title' + type + ' li').eq(0).addClass('layui-this');
@ -269,13 +278,14 @@ function getMinus(a, b) {
let minus = b.filter(item => !a.includes(item));
return minus;
}
// 设置文件类型
function handleFileType(index, file, result) {
let html = '', img = '';
if(file.ext){
if (file.ext) {
file.ext = file.ext.toLowerCase();
}
if(file.name){
if (file.name) {
file.name = file.name.toLowerCase();
}
if (file.ext === 'doc' || file.ext === 'docx') {
@ -322,7 +332,7 @@ function submitApply(data) {
console.log(data.field);
// 校验附件是否上传
if (fileList.length === 0) {
return layer.msg('请上传附件', { icon: 7 });
return layer.msg('请上传附件', {icon: 7});
}
let cjList = [];
$('select[name="supplier"]').each(function (index, item) {
@ -343,10 +353,10 @@ function submitApply(data) {
}
console.error(dataList);
if (dataList.length === 0) {
return layer.msg('未添加供应商数据', { icon: 7 });
return layer.msg('未添加供应商数据', {icon: 7});
}
if (cjList.length > dataList.length) {
return layer.msg('供应商数据添加不完整', { icon: 7 });
return layer.msg('供应商数据添加不完整', {icon: 7});
}
if (type === '1') {
for (let i = 0; i < dataList.length; i++) {
@ -354,7 +364,7 @@ function submitApply(data) {
for (let j = 0; j < carList.length; j++) {
let l = carList[j];
if ((!l.glsKs) || (!l.glsJs) || (!l.glPrice) || (!l.glXf) || (!l.glSjPrice)) {
return layer.msg('运输车辆-供应商-' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', { icon: 7 });
return layer.msg('运输车辆-供应商-' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', {icon: 7});
}
carList.sort((a, b) => parseInt(a.glsKs) - parseInt(b.glsJs));
console.error(carList);
@ -363,14 +373,14 @@ function submitApply(data) {
let ll2 = carList[k + 1];
if (carList.length !== 1) {
if (parseInt(carList[0].glsKs) !== 0) {
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
// if ((parseInt(ll.glsJs) + 1) !== parseInt(ll2.glsKs)) {
// return layer.msg('运输车辆-供应商-' + dataList[i].supName + ':公里数范围设置有误,请仔细检查数据', { icon: 7 });
// }
} else {
if (parseInt(ll.glsKs) !== 0) {
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('运输车辆-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
}
}
@ -381,11 +391,11 @@ function submitApply(data) {
let carList = dataList[i].carList;
for (let j = 0; j < carList.length; j++) {
let l = carList[j];
if ((!l.dayPrice) || (!l.monthPrice) || (!l.dcXf) || (!l.daySjPrice) || (!l.monthSjPrice)|| (!l.dayToMonth)) {
return layer.msg('吊车-供应商:' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', { icon: 7 });
if ((!l.dayPrice) || (!l.monthPrice) || (!l.dcXf) || (!l.daySjPrice) || (!l.monthSjPrice) || (!l.dayToMonth)) {
return layer.msg('吊车-供应商:' + dataList[i].supName + ',第' + (j + 1) + '行,填写不完整', {icon: 7});
}
let outList = l.outList;
if(outList.length > 0){
if (outList.length > 0) {
outList.sort((a, b) => parseInt(a.glsStart) - parseInt(b.glsEnd));
console.error(outList);
for (let k = 0; k <= outList.length - 2; k++) {
@ -393,14 +403,14 @@ function submitApply(data) {
let ll2 = outList[k + 1];
if (outList.length !== 1) {
if (parseInt(outList[0].glsStart) !== 0) {
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
// if ((parseInt(ll.glsEnd) + 1) !== parseInt(ll2.glsStart)) {
// return layer.msg('吊车-供应商-' + dataList[i].supName + ':公里数范围设置有误,请仔细检查数据', { icon: 7 });
// }
} else {
if (parseInt(ll.glsStart) !== 0) {
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', { icon: 7 });
return layer.msg('吊车-供应商-' + dataList[i].supName + '公里数初始值未从0开始', {icon: 7});
}
}
}
@ -420,12 +430,12 @@ function submitApply(data) {
endTime: data.field.endTime,
money: data.field.money,
type: type,
supList:dataList
supList: dataList
};
formData.append('params', JSON.stringify(params));
console.log(params);
let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' });
let loadingMsg = layer.msg('正在提交保存,请稍等...', {icon: 16, shade: 0.01, time: '0'});
let url = dataUrl + 'backstage/carContract/addCarContractData';
ajaxRequestByUploadFile(url, formData, function () {
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
@ -435,14 +445,14 @@ function submitApply(data) {
$('.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 });
parent.layer.msg(result.msg, {icon: 1});
closePage(1);
} else {
layer.msg(result.msg, { icon: 2 });
layer.msg(result.msg, {icon: 2});
}
}, function (xhr, status, error) {
layer.close(loadingMsg); // 关闭提示层
layer.msg('服务异常,请稍后重试', { icon: 16, scrollbar: false, time: 2000 });
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)
@ -464,11 +474,13 @@ function getCjTableData2(cjList) {
let num3 = $(this).find('td').eq(3).find('input').eq(0).val();
let num4 = $(this).find('td').eq(4).find('input').eq(0).val();
let num5 = $(this).find('td').eq(5).html();
let num6 = $(this).find('td').eq(6).find("select").eq(0).val();
obj2.glsKs = num;
obj2.glsJs = num2;
obj2.glPrice = num3;
obj2.glXf = num4;
obj2.glSjPrice = num5;
obj2.ton = num6;
list.push(obj2);
})
$.each(cjList, function (index, item) {
@ -512,16 +524,16 @@ function getCjTableData(cjList) {
let dataValue2 = $(this).find('td').eq(7).html();
let num4 = $(this).find('td').eq(8).find('input').val();
let open = $(this).find('td').eq(9).find('input').prop('checked');
let costList = [],remark = '';
let costList = [], remark = '';
$(this).find('td').eq(10).find('div').find('span').each(function () {
let item = $(this).attr('item');
remark += $(this).html() + ',';
let l = JSON.parse(item);
let obj3 = {
glsStart:l.num,
glsEnd:l.num2,
price:l.num3,
modelId:id
glsStart: l.num,
glsEnd: l.num2,
price: l.num3,
modelId: id
};
costList.push(obj3);
})
@ -608,7 +620,7 @@ function addFitDatas(data) {
} else { // 第一次添加数据
jjDataArr = JSON.parse(data);
if (jjDataArr && jjDataArr.length > 0) {
$('#no_data_title').css({ 'display': 'none' });
$('#no_data_title').css({'display': 'none'});
$('#search-info').removeAttr('style');
$('#table-box').removeAttr('style');
setTableData(jjDataArr);
@ -663,10 +675,10 @@ function sel(selectStatus, that, id) {
// 删除选中
function delFitType() {
if (delIdArr.length == 0) {
layer.msg('请先选择需要删除的数据!', { icon: 7 })
layer.msg('请先选择需要删除的数据!', {icon: 7})
return;
}
let layerIndex = layer.confirm('<h5 style="color:red">确定要删除选中数据吗!</h5>', { title: '操作提示' }, function () {
let layerIndex = layer.confirm('<h5 style="color:red">确定要删除选中数据吗!</h5>', {title: '操作提示'}, function () {
layer.close(layerIndex);
for (let i = 0; i < delIdArr.length; i++) {
for (let j = 0; j < jjDataArr.length; j++) {
@ -680,8 +692,8 @@ function delFitType() {
delIdArr.splice(0, delIdArr.length);
if (jjDataArr.length === 0) {
$('#no_data_title').removeAttr('style');
$('#search-info').css({ 'display': 'none' });
$('#table-box').css({ 'display': 'none' });
$('#search-info').css({'display': 'none'});
$('#table-box').css({'display': 'none'});
} else {
setTableData(jjDataArr);
}
@ -772,6 +784,7 @@ function addCj() {
$('#supplier' + addNum).empty().append(cent);
layui.form.render();
}
// 删除厂家
function delCj(that, addNum) {
let cjId = $('#supplier' + addNum).val();
@ -795,7 +808,8 @@ function delCj(that, addNum) {
$('#layui-tab-title li').each(function (index2, item2) {
if ($(this).hasClass('layui-this')) {
flag2 = false;
};
}
;
})
if (flag2) {
$('#layui-tab-title li').eq(0).addClass('layui-this');
@ -819,14 +833,14 @@ function checkValue(that, type) {
const regex = /^(0|[1-9]\d{0,6})$/;
if (!regex.test(value) && value) {
$(that).val(0);
return layer.msg('数量输入有误,请重新输入!', { icon: 5 })
return layer.msg('数量输入有误,请重新输入!', {icon: 5})
}
} else if (type === 2) { // 单价
const regex = /^(?:1(?:\d{0,8}|[0-9]*\.\d{1,2})|(?:[1-9]\d{0,7}|[1-9]\d{0,6}\.\d{1,2}|[1-9]\d{1,7}\.\d{2}|100000000(?:\.00)?))$/;
if (!regex.test(value) && value) {
$(that).val(0);
return layer.msg('单价最高限价格式不正确(提示:最多保留两位小数)!', { icon: 5 })
return layer.msg('单价最高限价格式不正确(提示:最多保留两位小数)!', {icon: 5})
}
}
}

View File

@ -23,10 +23,11 @@ function addTransVehiclesTable(cjId, isUse) {
'<tr>' +
'<th style="width: 5%" class="center"><input id="allCheck" onclick="selectAll2(this.checked,' + cjId + ')" type="checkbox"></th>' +
'<th style="width: 5%" class="center">序号</th>' +
'<th style="width: 30%" class="center">公里数</th>' +
'<th style="width: 25%" class="center">公里数</th>' +
'<th style="width: 20%" class="center">单项基准费用(元/吨*公里)</th>' +
'<th style="width: 20%" class="center">投标下浮率</th>' +
'<th style="width: 19%" class="center">实际基准费用(元/吨*公里)</th>' +
'<th style="width: 10%" class="center">实际基准费用(元/吨*公里)</th>' +
'<th style="width: 15%" class="center">吨位</th>' +
'</tr>' +
'</thead>' +
'<tbody cjId="' + cjId + '" id="transVehiclesTbody' + cjId + '"></tbody>' +
@ -56,6 +57,7 @@ function addTableTrData(cjId, item) {
html += "<td>" + setFormInput(glPrice, '', 2) + "</td>";
html += "<td>" + setFormInput(glXf, '', 3) + "</td>";
html += "<td>" + glSjPrice + "</td>";
html += "<td>" + setFormInput(glXf, '', 4) + "</td>";
html += "</tr>";
$('#transVehiclesTbody' + cjId).append(html);
layui.form.render();
@ -70,6 +72,13 @@ function addTableTrData(cjId, item) {
html += '<input class="layui-input" name="num3" value="' + value + '" onblur="checkValue2(this,3)" autocomplete="off" maxlength="11">';
} else if (type === 3) { // 投标下浮率
html += '<input class="layui-input" name="num4" value="' + value + '" onblur="checkValue2(this,4)" autocomplete="off" maxlength="11"><span style="margin: 0 10px;"> % </span>';
} else if (type === 4) {
html += '<select name="ton" value="' + value + '">\n' +
' <option value="">请选择</option>\n' +
' <option value="1">2T以下</option>\n' +
' <option value="2">2T到5T</option>\n' +
' <option value="3">5T以上</option>\n' +
' </select>'
}
html += '</div></form>';
return html;