Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
fb2cfba2ec
|
|
@ -127,7 +127,7 @@ function getDispatchCarListData(id) {
|
||||||
'<td>' + item.model + '</td>' +
|
'<td>' + item.model + '</td>' +
|
||||||
'<td>' + item.unit + '</td>' +
|
'<td>' + item.unit + '</td>' +
|
||||||
'<td>' + item.needNum + '</td>' +
|
'<td>' + item.needNum + '</td>' +
|
||||||
'<td>' + item.needDay + '</td>' +
|
'<td>' + (item.needDay !== null ? item.needDay : '') + '</td>' +
|
||||||
'<td>' + item.remark + '</td>' +
|
'<td>' + item.remark + '</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function getRecordList(id) {
|
||||||
'<td>' + item.model + '</td>' +
|
'<td>' + item.model + '</td>' +
|
||||||
'<td>' + item.unit + '</td>' +
|
'<td>' + item.unit + '</td>' +
|
||||||
'<td>' + item.needNum + '</td>' +
|
'<td>' + item.needNum + '</td>' +
|
||||||
'<td>' + item.needDay + '</td>' +
|
'<td>' + (item.needDay !== null ? item.needDay : '') + '</td>' +
|
||||||
'<td>' + item.remark + '</td>' +
|
'<td>' + item.remark + '</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ function isExistData(type, obj) {
|
||||||
if (type === 1 || type === 3) {
|
if (type === 1 || type === 3) {
|
||||||
url = dataUrl + 'backstage/supDispatchCar/getAllOutList'; // 详情-派车批次
|
url = dataUrl + 'backstage/supDispatchCar/getAllOutList'; // 详情-派车批次
|
||||||
} else if (type === 2) { // 审核-待审核批次
|
} else if (type === 2) { // 审核-待审核批次
|
||||||
url = dataUrl + 'backstage/dispatchCar/getAuditListNew';
|
url = dataUrl + 'backstage/dispatchCar/getAuditList';
|
||||||
}
|
}
|
||||||
ajaxRequest(url, "POST", params, false, function () {
|
ajaxRequest(url, "POST", params, false, function () {
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ function getDispatchCarListData(id) {
|
||||||
'<td>' + item.model + '</td>' +
|
'<td>' + item.model + '</td>' +
|
||||||
'<td>' + item.unit + '</td>' +
|
'<td>' + item.unit + '</td>' +
|
||||||
'<td>' + item.needNum + '</td>' +
|
'<td>' + item.needNum + '</td>' +
|
||||||
'<td>' + item.needDay + '</td>' +
|
'<td>' + (item.needDay !== null ? item.needDay : '') + '</td>' +
|
||||||
'<td>' + item.remark + '</td>' +
|
'<td>' + item.remark + '</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ function setPlanTables(list) {
|
||||||
let html = '';
|
let html = '';
|
||||||
if (list && list.length > 0) {
|
if (list && list.length > 0) {
|
||||||
$.each(list, function (index, item) {
|
$.each(list, function (index, item) {
|
||||||
|
console.log("item", item);
|
||||||
html += "<tr item=" + JSON.stringify(item) + ">" +
|
html += "<tr item=" + JSON.stringify(item) + ">" +
|
||||||
"<td><input onclick='sel(this.checked,this," + item.id + ")' name='check' type='checkbox'></td>" +
|
"<td><input onclick='sel(this.checked,this," + item.id + ")' name='check' type='checkbox'></td>" +
|
||||||
"<td>" + (index + 1) + "</td>" +
|
"<td>" + (index + 1) + "</td>" +
|
||||||
|
|
@ -157,6 +158,10 @@ function setPlanTables(list) {
|
||||||
"<td>" + item.model + "</td>" +
|
"<td>" + item.model + "</td>" +
|
||||||
"<td>" + item.unit + "</td>" +
|
"<td>" + item.unit + "</td>" +
|
||||||
"<td>" + item.needNum + "</td>" +
|
"<td>" + item.needNum + "</td>" +
|
||||||
|
"<td><input type='number' min='1' max='" + Math.min(99, item.needNum) + "' value='" + (item.needNums || '') + "' " +
|
||||||
|
"class='need-nums-input' style='width:60px;' " +
|
||||||
|
"onchange='validateNumberInput(this, " + item.needNum + ")' " +
|
||||||
|
"data-max='" + item.needNum + "'></td>" +
|
||||||
"<td>" + (item.needDay !== null ? item.needDay : '') + "</td>" +
|
"<td>" + (item.needDay !== null ? item.needDay : '') + "</td>" +
|
||||||
"<td>" + handleRemark(item.remark) + "</td>" +
|
"<td>" + handleRemark(item.remark) + "</td>" +
|
||||||
"</tr>";
|
"</tr>";
|
||||||
|
|
@ -167,6 +172,21 @@ function setPlanTables(list) {
|
||||||
$('#plan-table tbody').after(html);
|
$('#plan-table tbody').after(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证数字输入的函数
|
||||||
|
function validateNumberInput(input, maxNeedNum) {
|
||||||
|
let value = parseInt(input.value);
|
||||||
|
const maxAllowed = Math.min(99, maxNeedNum); // 不能超过99也不能超过needNum
|
||||||
|
|
||||||
|
if (isNaN(value) || value <= 0 || value > maxAllowed) {
|
||||||
|
// 如果输入无效,恢复之前的值或设为空
|
||||||
|
input.value = input.dataset.prevValue || '';
|
||||||
|
layer.msg('此次派车量不能大于需用量', { icon: 7 })
|
||||||
|
} else {
|
||||||
|
// 保存当前有效值
|
||||||
|
input.dataset.prevValue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 处理备注
|
// 处理备注
|
||||||
function handleRemark(remark) {
|
function handleRemark(remark) {
|
||||||
if (remark) {
|
if (remark) {
|
||||||
|
|
@ -185,15 +205,25 @@ function selectAll(selectStatus) {//传入参数(全选框的选中状态)
|
||||||
if (selectStatus) {
|
if (selectStatus) {
|
||||||
$("input[name='check']").each(function (i, n) {
|
$("input[name='check']").each(function (i, n) {
|
||||||
n.checked = true;
|
n.checked = true;
|
||||||
let item = JSON.parse($(this).parents('tr').attr('item'));
|
let tr = $(this).parents('tr');
|
||||||
|
let item = JSON.parse(tr.attr('item'));
|
||||||
|
console.log(item)
|
||||||
|
// 获取手动输入的值
|
||||||
|
let inputValue = tr.find('.need-nums-input').val();
|
||||||
|
let needNums = inputValue ? parseInt(inputValue) : 0;
|
||||||
|
console.log('手动输入的值:', needNums); // 打印输入的值
|
||||||
|
if (needNums<=0){
|
||||||
|
n.checked = false;
|
||||||
|
return layer.msg('请先选择此次派车量', {icon: 7})
|
||||||
|
}
|
||||||
if (item.type === '车辆') {
|
if (item.type === '车辆') {
|
||||||
carType=1;
|
carType=1;
|
||||||
for (let i = 1; i <= item.needNum; i++) {
|
for (let i = 1; i <= needNums; i++) {
|
||||||
addCarFormData(item.modelId, i, item);
|
addCarFormData(item.modelId, i, item);
|
||||||
}
|
}
|
||||||
} else if (item.type === '吊车') {
|
} else if (item.type === '吊车') {
|
||||||
carType=2;
|
carType=2;
|
||||||
for (let i = 1; i <= item.needNum; i++) {
|
for (let i = 1; i <= needNums; i++) {
|
||||||
addCraneFormData(item.modelId, i, item.isDriverSet, item);
|
addCraneFormData(item.modelId, i, item.isDriverSet, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -202,6 +232,7 @@ function selectAll(selectStatus) {//传入参数(全选框的选中状态)
|
||||||
$("input[name='check']").each(function (i, n) {
|
$("input[name='check']").each(function (i, n) {
|
||||||
n.checked = false;
|
n.checked = false;
|
||||||
let item = JSON.parse($(this).parents('tr').attr('item'));
|
let item = JSON.parse($(this).parents('tr').attr('item'));
|
||||||
|
console.log(item)
|
||||||
if (item.type === '车辆') {
|
if (item.type === '车辆') {
|
||||||
removeCarFormData(item.modelId);
|
removeCarFormData(item.modelId);
|
||||||
fileList = fileList.filter(l => {
|
fileList = fileList.filter(l => {
|
||||||
|
|
@ -221,17 +252,27 @@ function selectAll(selectStatus) {//传入参数(全选框的选中状态)
|
||||||
function sel(selectStatus, that, id) {
|
function sel(selectStatus, that, id) {
|
||||||
console.error(fileList);
|
console.error(fileList);
|
||||||
|
|
||||||
let item = JSON.parse($(that).parents('tr').attr('item'));
|
let tr = $(that).parents('tr');
|
||||||
|
let item = JSON.parse(tr.attr('item'));
|
||||||
|
console.log(item)
|
||||||
|
// 获取手动输入的值
|
||||||
|
let inputValue = tr.find('.need-nums-input').val();
|
||||||
|
let needNums = inputValue ? parseInt(inputValue) : 0;
|
||||||
|
console.log('手动输入的值:', needNums); // 打印输入的值
|
||||||
|
if (needNums<=0){
|
||||||
|
$(that).prop('checked', false);
|
||||||
|
return layer.msg('请先选择此次派车量', {icon: 7})
|
||||||
|
}
|
||||||
if (selectStatus) {
|
if (selectStatus) {
|
||||||
$(that).prop('checked', true);
|
$(that).prop('checked', true);
|
||||||
if (item.type === '车辆') {
|
if (item.type === '车辆') {
|
||||||
carType=1;
|
carType=1;
|
||||||
for (let i = 1; i <= item.needNum; i++) {
|
for (let i = 1; i <= needNums; i++) {
|
||||||
addCarFormData(item.modelId, i, item);
|
addCarFormData(item.modelId, i, item);
|
||||||
}
|
}
|
||||||
} else if (item.type === '吊车') {
|
} else if (item.type === '吊车') {
|
||||||
carType=2;
|
carType=2;
|
||||||
for (let i = 1; i <= item.needNum; i++) {
|
for (let i = 1; i <= needNums; i++) {
|
||||||
addCraneFormData(item.modelId, i, item.isDriverSet, item);
|
addCraneFormData(item.modelId, i, item.isDriverSet, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -316,8 +357,12 @@ function submitApply(data) {
|
||||||
let check = n.checked;
|
let check = n.checked;
|
||||||
if (check === true) {
|
if (check === true) {
|
||||||
num++;
|
num++;
|
||||||
let item = JSON.parse($(this).parents('tr').attr('item'));
|
let tr = $(this).parents('tr');
|
||||||
for (let i = 1; i <= item.needNum; i++) {
|
let item = JSON.parse(tr.attr('item'));
|
||||||
|
// 获取手动输入的值
|
||||||
|
let inputValue = tr.find('.need-nums-input').val();
|
||||||
|
let needNums = inputValue ? parseInt(inputValue) : 0;
|
||||||
|
for (let i = 1; i <= needNums; i++) {
|
||||||
let dhFiles = fileList.filter(item2 => {
|
let dhFiles = fileList.filter(item2 => {
|
||||||
return item2.type === item.modelId + '-' + i;
|
return item2.type === item.modelId + '-' + i;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
<th>规格</th>
|
<th>规格</th>
|
||||||
<th>单位</th>
|
<th>单位</th>
|
||||||
<th>需用量</th>
|
<th>需用量</th>
|
||||||
|
<th>此次派车量</th>
|
||||||
<th>需用天数</th>
|
<th>需用天数</th>
|
||||||
<th>备注</th>
|
<th>备注</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue