问题修改

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 details;
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) {
objParam = JSON.parse(obj);
if (objParam.checkType === 2) {
@ -142,7 +150,7 @@ function initTable() {
title: "类型",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "name",
@ -150,7 +158,7 @@ function initTable() {
title: "名称",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "model",
@ -158,7 +166,7 @@ function initTable() {
title: "规格",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "unit",
@ -166,7 +174,7 @@ function initTable() {
title: "单位",
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return setNullValue(d.unit);
},
@ -177,7 +185,7 @@ function initTable() {
title: "需用量",
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return setNumColor(d.needNum);
},
@ -188,7 +196,7 @@ function initTable() {
title: "需用天数",
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return setNumColor(d.needDay);
},
@ -198,7 +206,7 @@ function initTable() {
field: "remark",
width: '15%',
title: "备注",
sort:true,
sort: true,
unresize: true,
align: "center",
templet: function (d) {
@ -252,7 +260,7 @@ function setOperRecordInfo(list, obj) {
let imgUrl2 = '../../../images/time_icon.png';
$.each(list, function (index, item) {
console.error(item);
let operData = "";
let dept = '';
let minutes = item.minutes;

View File

@ -164,7 +164,7 @@ function getDispatchCarData(id) {
imgNum += item.driverUserImage.filter(item => { return item.type !== '6' }).length;
imgNum += item.fileList.length;
html += "<tr>" +
"<td>" + objParam.typeName + "</td>" +
"<td>" + item.type + "</td>" +
"<td>" + item.name + "</td>" +
"<td>" + item.model + "</td>" +
"<td>" + item.carNum + "</td>" +
@ -316,9 +316,5 @@ function reloadAuditData() {
// 关闭页面
function closePage(type) {
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); // 再执行关闭
}

View File

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

View File

@ -2,6 +2,15 @@ let objParam, dataObj;
let form, table, upload, tableIns, layer, element;
let pageNum = 1;
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) {
objParam = JSON.parse(params);
console.error(objParam);

View File

@ -51,6 +51,9 @@ function setParams(obj) {
});
form.on('submit(formData)', function (data) {
let length = $('.formSubmit2').length;
if(length === 1){
length = 2;
}
for (let i = 0; i <= length - 1; i++) {
let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter');
if (i === 0) {
@ -198,10 +201,10 @@ function getDispatchCarData(id) {
// 设置文件类型
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) {
@ -438,7 +441,7 @@ function addFitDatas(data) {
function addCarFormData(id, num, item) {
formNum++;
let length = $('.dispatch').length;
let html = '<div class="dispatch dispatch-box car-' + id + '" id="model-' + (id + '-' + num) + '" modelId="' + item.modelId + '" id2="' + item.id + '" dataId="'+item.id+'" contractId = "' + item.contractId + '">' +
let html = '<div class="dispatch dispatch-box car-' + id + '" id="model-' + (id + '-' + num) + '" modelId="' + item.modelId + '" id2="' + item.id + '" dataId="' + item.id + '" contractId = "' + item.contractId + '">' +
'<div class="dispatch-title layout">' +
'<p class="xh">' + (length + 1) + '</p>' +
'<img src="../../../images/svg/u326.svg" width="40px" height="40px">' +
@ -615,7 +618,7 @@ function removeCarFormData(id) {
function addCraneFormData(id, num, isDriverSet, item) {
formNum++;
let length = $('.dispatch').length;
let html = '<div class="dispatch dispatch-box2 crane-' + id + '" id="model-' + (id + '-' + num) + '" modelId="' + item.modelId + '" id2="' + item.id + '" dataId="'+item.id+'" contractId = "' + item.contractId + '">' +
let html = '<div class="dispatch dispatch-box2 crane-' + id + '" id="model-' + (id + '-' + num) + '" modelId="' + item.modelId + '" id2="' + item.id + '" dataId="' + item.id + '" contractId = "' + item.contractId + '">' +
'<div class="dispatch-title2 layout" >' +
'<p class="xh">' + (length + 1) + '</p>' +
'<img src="../../../images/svg/u312.svg" width="40px" height="40px">' +

View File

@ -53,6 +53,9 @@ function setParams(obj) {
if (length === 0) {
submitApply(data);
} else {
if (length === 1) {
length = 2;
}
for (let i = 0; i <= length - 1; i++) {
let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter');
if (i === 0) {
@ -249,10 +252,10 @@ function sel(selectStatus, that, id) {
// 设置文件类型
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') {

View File

@ -1,6 +1,14 @@
let idParam, objParam;
let details;
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) {
objParam = JSON.parse(obj);
idParam = objParam.id;

View File

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

View File

@ -118,7 +118,7 @@ function initTable() {
width: '10%',
title: "需求计划编号",
unresize: true,
sort:true,
sort: true,
align: "center",
templet: function (d) {
let html = "";
@ -132,7 +132,7 @@ function initTable() {
title: "工程名称",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "dispatchStatus",
@ -140,7 +140,7 @@ function initTable() {
title: "派车状态",
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return setStatusColor(d.dispatchStatus);
},
@ -151,7 +151,7 @@ function initTable() {
title: "车辆数量",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "craneNum",
@ -159,7 +159,7 @@ function initTable() {
title: "吊车数量",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "money",
@ -167,7 +167,7 @@ function initTable() {
width: '10%',
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return '<span>¥ ' + d.money + '</span>'
},
@ -178,7 +178,7 @@ function initTable() {
title: "供应商",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "payStatus",
@ -186,7 +186,7 @@ function initTable() {
title: "付款状态",
unresize: true,
align: "center",
sort:true,
sort: true,
},
{
field: "companyName",
@ -194,7 +194,7 @@ function initTable() {
width: '10%',
unresize: true,
align: "center",
sort:true,
sort: true,
},
],
],
@ -238,10 +238,7 @@ function exportExcel() {
// 需求计划详情
function openPlanDetail(obj) {
obj.id = obj.planId;
obj.code = 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("homePlanDetail", "需求计划", content, "92%", "95%", obj);
obj.pageType = 1;
obj.typeName = obj.typeName === 1 ? '车辆' : '吊车';
openIframeByParamObj2("homePlanDetail", "详情", '../welcome/plan_dispatch_detail.html', "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>
<th colspan="4">计划说明</th>
</tr>
<tr style="height: 100px;">
<tr>
<td colspan="4" id="remark"></td>
</tr>
</table>

View File

@ -54,7 +54,7 @@
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>基本信息填写</p>
</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-inline">
<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="工程排名">
<p>工程排名</p>
</div>
<a href="#">查看更多></a>
<a href="#" onclick="openDetail(1)">查看更多></a>
</div>
<div id="pro-ranking-box">
<div id="pro-ranking-title" class="layout">