问题修改

This commit is contained in:
cwchen 2025-01-17 16:48:43 +08:00
parent b881325e4c
commit 9501d7d915
14 changed files with 301 additions and 40 deletions

View File

@ -1,6 +1,14 @@
let idParam, objParam; let idParam, objParam;
let details; let details;
let form, layer, table; let form, layer, table;
let isPage = getUrlParam('isPage');
if (isPage) { // 首页跳转
$('#plan-detail-box>div').eq(0).remove();
$('#plan-detail-box').css({'justify-content':'end','height':'50px'});
$('body').css('margin', '0');
let obj = decodeURIComponent(getUrlParam('obj'))
setParams(obj);
}
function setParams(obj) { function setParams(obj) {
objParam = JSON.parse(obj); objParam = JSON.parse(obj);
if (objParam.checkType === 2) { if (objParam.checkType === 2) {

View File

@ -164,7 +164,7 @@ function getDispatchCarData(id) {
imgNum += item.driverUserImage.filter(item => { return item.type !== '6' }).length; imgNum += item.driverUserImage.filter(item => { return item.type !== '6' }).length;
imgNum += item.fileList.length; imgNum += item.fileList.length;
html += "<tr>" + html += "<tr>" +
"<td>" + objParam.typeName + "</td>" + "<td>" + item.type + "</td>" +
"<td>" + item.name + "</td>" + "<td>" + item.name + "</td>" +
"<td>" + item.model + "</td>" + "<td>" + item.model + "</td>" +
"<td>" + item.carNum + "</td>" + "<td>" + item.carNum + "</td>" +
@ -316,9 +316,5 @@ function reloadAuditData() {
// 关闭页面 // 关闭页面
function closePage(type) { function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引 let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
if (type == 1) {
let frameId = parent.document.getElementById('dispatchCarProDetail').getElementsByTagName("iframe")[0];
frameId.contentWindow.refreshAllData();
}
parent.layer.close(index); // 再执行关闭 parent.layer.close(index); // 再执行关闭
} }

View File

@ -52,6 +52,9 @@ function setParams(obj) {
}); });
form.on('submit(formData)', function (data) { form.on('submit(formData)', function (data) {
let length = $('.formSubmit2').length; let length = $('.formSubmit2').length;
if(length === 1){
length = 2;
}
for (let i = 0; i <= length - 1; i++) { for (let i = 0; i <= length - 1; i++) {
let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter');
if (i === 0) { if (i === 0) {

View File

@ -2,6 +2,15 @@ let objParam, dataObj;
let form, table, upload, tableIns, layer, element; let form, table, upload, tableIns, layer, element;
let pageNum = 1; let pageNum = 1;
let checkNowValue = ''; // 当前选中的批次 let checkNowValue = ''; // 当前选中的批次
let isPage = getUrlParam('isPage');
if (isPage) { // 首页跳转
$('#plan-detail-box>div').eq(0).remove();
$('#plan-detail-box').css({ 'justify-content': 'end', 'height': '50px' });
$('body').css('margin', '0');
$('.cancel').remove();
let obj = decodeURIComponent(getUrlParam('obj'))
setParams(obj);
}
function setParams(params) { function setParams(params) {
objParam = JSON.parse(params); objParam = JSON.parse(params);
console.error(objParam); console.error(objParam);

View File

@ -51,6 +51,9 @@ function setParams(obj) {
}); });
form.on('submit(formData)', function (data) { form.on('submit(formData)', function (data) {
let length = $('.formSubmit2').length; let length = $('.formSubmit2').length;
if(length === 1){
length = 2;
}
for (let i = 0; i <= length - 1; i++) { for (let i = 0; i <= length - 1; i++) {
let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter');
if (i === 0) { if (i === 0) {

View File

@ -53,6 +53,9 @@ function setParams(obj) {
if (length === 0) { if (length === 0) {
submitApply(data); submitApply(data);
} else { } else {
if (length === 1) {
length = 2;
}
for (let i = 0; i <= length - 1; i++) { for (let i = 0; i <= length - 1; i++) {
let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter');
if (i === 0) { if (i === 0) {

View File

@ -1,6 +1,14 @@
let idParam, objParam; let idParam, objParam;
let details; let details;
let form, layer, table; let form, layer, table;
let isPage = getUrlParam('isPage');
if (isPage) { // 首页跳转
$('#plan-detail-box>div').eq(0).remove();
$('#plan-detail-box').css({'justify-content':'end','height':'50px'});
$('body').css('margin', '0');
let obj = decodeURIComponent(getUrlParam('obj'))
setParams(obj);
}
function setParams(obj) { function setParams(obj) {
objParam = JSON.parse(obj); objParam = JSON.parse(obj);
idParam = objParam.id; idParam = objParam.id;

View File

@ -251,7 +251,10 @@ function exportExcel() {
exportExcelUtil(url, '派车详情', JSON.stringify(params)); exportExcelUtil(url, '派车详情', JSON.stringify(params));
} }
// 工程详情 // 派车详情
function dispatchCarProDetail(obj) { function openPlanDetail(obj) {
openIframeByParamObj("dispatchCarProDetail", "工程详情", "./child/dispatch_car_pro_detail.html", "92%", "95%", obj, 1); obj.id = obj.planId;
obj.pageType = 1;
obj.typeName = obj.typeName === 1 ? '车辆' : '吊车';
openIframeByParamObj2("homePlanDetail", "详情", '../welcome/plan_dispatch_detail.html', "92%", "95%", obj);
} }

View File

@ -238,10 +238,7 @@ function exportExcel() {
// 需求计划详情 // 需求计划详情
function openPlanDetail(obj) { function openPlanDetail(obj) {
obj.id = obj.planId; obj.id = obj.planId;
obj.code = obj.code; obj.pageType = 1;
let content = '../car_demand_plan/child/apply_plan_detail.html'; obj.typeName = obj.typeName === 1 ? '车辆' : '吊车';
if (obj.code.indexOf('spec-') > -1) { openIframeByParamObj2("homePlanDetail", "详情", '../welcome/plan_dispatch_detail.html', "92%", "95%", obj);
content = '../car_demand_plan/child/emerg_internal_car_detail.html';
}
openIframeByParamObj2("homePlanDetail", "需求计划", content, "92%", "95%", obj);
} }

View File

@ -0,0 +1,156 @@
let objParam, dataObj;
let form, table, upload, tableIns, layer;
let pageNum = 1;
let checkNowValue = '';
let checkType = '';
function setParams(params) {
objParam = JSON.parse(params);
console.error(objParam);
$('#titleName').html(objParam.proName);
$('#code').html(objParam.code);
layui.use(["form", "table", 'upload', 'layer'], function () {
form = layui.form;
table = layui.table;
upload = layui.upload;
layer = layui.layer;
layui.use(["layer", 'element'], function () {
layer = layui.layer;
element = layui.element;
// tab 切换事件
element.on('tab(demo-filter-tab)', function (data) {
let value = $(this).attr('value');
if (value === '1') {
let src = '../car_demand_plan/child/apply_plan_detail.html';
if (objParam.code.indexOf('spec-') > -1) {
src = '../car_demand_plan/child/emerg_internal_car_detail.html';
}
$('#indexIframe').attr('src', src + '?isPage=1' + '&obj=' + encodeURIComponent(JSON.stringify(objParam)));
} else if (value === '2') {
let src = '../car_demand_plan/child/dispatch_input_detail.html';
$('#indexIframe').attr('src', src + '?isPage=1' + '&obj=' + encodeURIComponent(JSON.stringify(objParam)));
}
});
});
if (objParam.pageType === 1) { // 需求计划详情跳转
$('#layui-tab-title li').eq(0).addClass('layui-this');
let src = '../car_demand_plan/child/apply_plan_detail.html';
if (objParam.code.indexOf('spec-') > -1) {
src = '../car_demand_plan/child/emerg_internal_car_detail.html';
}
$('#indexIframe').attr('src', src + '?isPage=1' + '&obj=' + encodeURIComponent(JSON.stringify(objParam)));
} else if (objParam.pageType === 2) { // 派车详情跳转
$('#layui-tab-title li').eq(1).addClass('layui-this');
let src = '../car_demand_plan/child/dispatch_input_detail.html';
$('#indexIframe').attr('src', src + '?isPage=1' + '&obj=' + encodeURIComponent(JSON.stringify(objParam)));
}
});
}
// 查询派车批次
function getAllOutList() {
let params = {
encryptedData: JSON.stringify({
'planId': objParam.id,
})
};
let url = dataUrl + 'backstage/supDispatchCar/getAllOutList';
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
console.error(result);
if (result.code === 200) {
if (result.data.length === 0) {
parent.layer.msg('暂无派车批次数据', { icon: 7 });
closePage();
} else {
setBatchData(result.data);
}
} else {
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
// 派车批次
function setBatchData(dataList) {
let html = '', id = '', status = '', type = '';
$.each(dataList, function (index, item) {
if (index === dataList.length - 1) {
id = item.id;
status = item.status;
type = item.type;
}
let batchName = '第' + numToChinese(index + 1) + '批次';
html += '<li value="' + item.id + '" status="' + item.status + '" type="' + item.type + '">' + batchName + '</li>';
})
$('#layui-tab-title').empty().append(html);
$('#layui-tab-title li').eq(dataList.length - 1).addClass('layui-this');
var scrollableElement = document.getElementById('layui-tab-brief');
// 添加事件监听器来处理滚轮事件
scrollableElement.addEventListener('wheel', function (event) {
// 阻止默认的滚动行为
event.preventDefault();
// 检查滚动的方向
var delta = event.deltaY > 0 ? -20 : 20; // 根据需要调整滚动的步长
// 设置新的滚动位置
scrollableElement.scrollLeft += delta;
});
checkNowValue = id;
checkType = type;
getUpdateList(id);
}
}
// 查询每个批次的修改记录
function getUpdateList(outId) {
let params = {
encryptedData: JSON.stringify({
planId: objParam.id,
outId: outId
})
};
let url = dataUrl + 'backstage/dispatchCar/getUpdateList';
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
console.error(result);
if (result.code === 200) {
getShipmentBatch(result.data);
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
// 修改记录次数
function getShipmentBatch(list) {
let dataList = [], html = '';
if (list && list.length > 0) {
$.each(list, function (index, item) {
if (index === 0) {
dataList.push({ name: '初始派车数据', id: item.id, color: '', isInit: true })
} else {
dataList.push({ name: '第' + numToChinese(index) + '次修改', id: item.id, color: '#f56c6c', isInit: false })
}
});
}
$.each(dataList, function (index, item) {
html += '<li value="' + item.id + '" type="' + checkType + '" style="color:' + item.color + '" isInit=' + item.isInit + '>' + this.name + '</li>';
})
$('#layui-tab-title2').empty().append(html);
$('#layui-tab-title2 li').eq(0).addClass('layui-this');
var scrollableElement = document.getElementById('layui-tab-brief');
// 添加事件监听器来处理滚轮事件
scrollableElement.addEventListener('wheel', function (event) {
// 阻止默认的滚动行为
event.preventDefault();
// 检查滚动的方向
var delta = event.deltaY > 0 ? -20 : 20; // 根据需要调整滚动的步长
// 设置新的滚动位置
scrollableElement.scrollLeft += delta;
});
$('#indexIframe').attr('src', './dispatch_car_edit_record_detail.html?id=' + dataList[0].id + '&type=' + checkType + '&code=' + objParam.code + '&isInit=' + dataList[0].isInit);
}
// 关闭页面
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
parent.layer.close(index); // 再执行关闭
}

View File

@ -51,7 +51,7 @@
<tr> <tr>
<th colspan="4">计划说明</th> <th colspan="4">计划说明</th>
</tr> </tr>
<tr style="height: 100px;"> <tr>
<td colspan="4" id="remark"></td> <td colspan="4" id="remark"></td>
</tr> </tr>
</table> </table>

View File

@ -54,7 +54,7 @@
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span> <span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>基本信息填写</p> <p>基本信息填写</p>
</div> </div>
<form class="layui-form layuimini-form" onclick="return false;"> <form class="layui-form layuimini-form" onclick="return false;" lay-filter="formInfo">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label required" style="width: 100px !important;">经办人</label> <label class="layui-form-label required" style="width: 100px !important;">经办人</label>

View File

@ -0,0 +1,75 @@
<!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/public.css" media="all">
<link rel="stylesheet" href="../../css/car_demand_plan/dispatch_car_edit_record_detail.css" media="all">
</head>
<style>
body {
margin: 0 15px 15px 15px;
}
.layuimini-container {
height: auto;
}
#detail-box {
width: 100%;
height: 70px;
justify-content: space-between;
}
#detail-box>div {
margin: 0 20px;
}
#detail-box img {
width: 50px;
height: 50px;
}
#iframe-box {
height: calc(100% - 140px);
}
</style>
<body id="body">
<div id="main-box">
<div class="layout" id="detail-box">
<div class="layout">
<img src="../../images/svg/u418.svg">
<div class="layout" style="flex-direction: column;align-items: start;margin-left: 10px;">
<p style="font-size: 18px;font-weight: bold;" id="titleName"></p>
<p id="code"></p>
</div>
</div>
<div>
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">返回</button>
</div>
</div>
<div class="layui-tab layui-tab-brief no-print" id="layui-tab-brief" lay-filter="demo-filter-tab">
<ul class="layui-tab-title" id="layui-tab-title">
<li value="1">需求计划</li>
<li value="2">派车详情</li>
</ul>
</div>
<div id="iframe-box">
<iframe id="indexIframe" width="100%" height="100%" frameborder="0" class="layadmin-iframe" src=""></iframe>
</div>
</div>
</body>
<script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../../js/aes.js" charset="utf-8"></script>
<script src="../../js/public.js" charset="utf-8"></script>
<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/welcome/plan_dispatch_detail.js" charset="utf-8"></script>
</html>

View File

@ -131,7 +131,7 @@
<img src="../../images/data_overview.png" alt="工程排名"> <img src="../../images/data_overview.png" alt="工程排名">
<p>工程排名</p> <p>工程排名</p>
</div> </div>
<a href="#">查看更多></a> <a href="#" onclick="openDetail(1)">查看更多></a>
</div> </div>
<div id="pro-ranking-box"> <div id="pro-ranking-box">
<div id="pro-ranking-title" class="layout"> <div id="pro-ranking-title" class="layout">