问题修复、首页

This commit is contained in:
cwchen 2025-01-17 13:27:30 +08:00
parent c3a22b34f6
commit 8e750edca8
6 changed files with 237 additions and 230 deletions

View File

@ -31,16 +31,16 @@ function queryTable(type) {
$('#proName').val(''); $('#proName').val('');
return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 });
} }
let planCode = $('#planCode').val(); let code = $('#code').val();
let flag2 = checkValue(planCode); let flag2 = checkValue(code);
if (flag2) { if (flag2) {
$('#planCode').val(''); $('#code').val('');
return layer.msg('需求计划编号查询包含特殊字符,请重新输入', { icon: 2 }); return layer.msg('需求计划编号查询包含特殊字符,请重新输入', { icon: 2 });
} }
reloadTable(1); reloadTable(1);
} else if (type === 2) { } else if (type === 2) {
$('#proName').val(''); $('#proName').val('');
$('#planCode').val(''); $('#code').val('');
layui.form.render(); layui.form.render();
reloadTable(1); reloadTable(1);
} }
@ -55,7 +55,7 @@ function reloadTable(pageNum) {
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'proName': $('#proName').val(), 'proName': $('#proName').val(),
'planCode': $('#planCode').val(), 'code': $('#code').val(),
'contractId': objParam.contractId, 'contractId': objParam.contractId,
'supId': objParam.supId 'supId': objParam.supId
}), }),
@ -78,7 +78,7 @@ function initTable() {
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'proName': $('#proName').val(), 'proName': $('#proName').val(),
'planCode': $('#planCode').val(), 'code': $('#code').val(),
'contractId': objParam.contractId, 'contractId': objParam.contractId,
'supId': objParam.supId 'supId': objParam.supId
}), }),

View File

@ -2,45 +2,82 @@ initTable();
// 查询/重置 // 查询/重置
function queryTable(type) { function queryTable(type) {
if (type === 1) { if (type === 1) {
let proName = $('#proName').val(); let code = $('#code').val();
let flag = checkValue(proName); let flag = checkValue(code);
if (flag) { if (flag) {
$('#code').val('');
return layer.msg('计划编号查询包含特殊字符,请重新输入', { icon: 2 });
}
let supName = $('#supName').val();
let flag2 = checkValue(supName);
if (flag2) {
$('#supName').val('');
return layer.msg('供应商查询包含特殊字符,请重新输入', { icon: 2 });
}
let proName = $('#proName').val();
let flag3 = checkValue(proName);
if (flag3) {
$('#proName').val(''); $('#proName').val('');
return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 });
} }
reloadTable(1); reloadTable(1);
} else if (type === 2) { } else if (type === 2) {
$('#code').val('');
$('#supName').val('');
$('#proName').val(''); $('#proName').val('');
$('#planStatus').val('');
layui.form.render(); layui.form.render();
reloadTable(1); reloadTable(1);
} }
} }
// 刷新页面数据 // 刷新页面数据
function reloadData() { function reloadData() {
reloadTable(1); reloadTable(1);
getProStatisticsDetails(); getProStatisticsDetails();
} }
// 重载表格 // 获取筛选条件
function reloadTable(pageNum) { function getFilterParams() {
let filterParams = {};
$('#delDemo .tag-item').each(function () {
let layId = $(this).attr('lay-id');
let strArr = layId.split('-');
if (strArr[0] === 'company') {
let name = replaceChinese($(this).html());
filterParams.companyName = name;
} else if (strArr[0] === 'dispatch') {
filterParams.dispatchStatus = strArr[1];
} else if (strArr[0] === 'year') {
filterParams.year = strArr[1];
} else if (strArr[0] === 'month') {
filterParams.month = strArr[1];
} else if (strArr[0] === 'pay') {
filterParams.payStatus = strArr[1];
}
})
filterParams.code = $('#code').val();
filterParams.supName = $('#supName').val();
filterParams.proName = $('#proName').val();
return filterParams;
}
// 重载表格
function reloadTable(pageNum) {
let params = getFilterParams();
table.reload("currentTableId", { table.reload("currentTableId", {
page: { page: {
curr: pageNum ? pageNum : 1, curr: pageNum ? pageNum : 1,
}, },
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify(params),
'proName': $('#proName').val(),
'planStatus': $('#planStatus').val()
}),
}, },
}, },
); );
} }
// 初始化表格 // 初始化表格
function initTable() { function initTable() {
let params = getFilterParams();
tableIns = table.render({ tableIns = table.render({
elem: "#currentTableId", elem: "#currentTableId",
id: 'currentTableId', id: 'currentTableId',
@ -48,12 +85,9 @@ function queryTable(type) {
authorization: sessionStorage.getItem("gz-token"), authorization: sessionStorage.getItem("gz-token"),
}, },
height: "full-450", height: "full-450",
url: dataUrl + "backstage/dispatchCar/getProStatisticsList", url: dataUrl + "backstage/homeIndex/getPlanDetails",
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify(params),
'proName': $('#proName').val(),
'planStatus': $('#planStatus').val()
}),
}, },
request: { request: {
pageName: 'pageNum', pageName: 'pageNum',
@ -100,61 +134,55 @@ function queryTable(type) {
align: "center", align: "center",
}, },
{ {
field: "planNum", field: "dispatchStatus",
width: '10%', width: '10%',
title: "派车状态", title: "派车状态",
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
return '<span style="color:#409Eff;font-weight:bold;">' + d.planNum + '</span>'; return setStatusColor(d.dispatchStatus);
}, },
}, },
{ {
field: "ypcNum", field: "carNum",
width: '10%', width: '10%',
title: "车辆数量", title: "车辆数量",
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) {
return '<span style="color:#19be6b;font-weight:bold;">' + d.ypcNum + '</span>';
},
}, },
{ {
field: "dpcNum", field: "craneNum",
width: '10%', width: '10%',
title: "吊车数量", title: "吊车数量",
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) {
return '<span style="color:#ff9900;font-weight:bold;">' + d.dpcNum + '</span>';
},
}, },
{ {
field: "planStatus", field: "money",
title: "金额", title: "金额",
width: '10%', width: '10%',
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
return setStatusColor(d.planStatus); return '<span>¥ ' + d.money + '</span>'
}, },
}, },
{ {
field: "lastDay", field: "supName",
width: '10%', width: '10%',
title: "供应商", title: "供应商",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "progress", field: "payStatus",
width: '10%', width: '10%',
title: "付款状态", title: "付款状态",
unresize: true, unresize: true,
align: "center", align: "center",
}, },
{ {
field: "needNum", field: "companyName",
title: "所属分公司", title: "所属分公司",
width: '10%', width: '10%',
unresize: true, unresize: true,
@ -171,63 +199,41 @@ function queryTable(type) {
table.resize("currentTableId"); table.resize("currentTableId");
}, },
}); });
} }
// 数量颜色 // 数量颜色
function setNumColor(value) { function setNumColor(value) {
return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>"; return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>";
} }
// 发货状态颜色 // 派车状态颜色
function setStatusColor(value) { function setStatusColor(value) {
let color = "#409Eff"; let color = "#409Eff";
let name = '' let name = ''
if (value === '未派车') { if (value === '1') {
color = "#f56c6c"; color = "#f56c6c";
name = '未派车'; name = '未派车';
} else if (value === '部分派车') { } else if (value === '2') {
color = "#ff9900";
name = '部分派车'
} else if (value === '全部派车') {
color = "#19be6b"; color = "#19be6b";
name = '全部派车' name = '已派车'
}
return '<span style="color:' + color + '">' + name + "</span>";
} }
return '<span style="color:' + color + '"> ● ' + name + "</span>";
}
// 设置进度值 // 导出
function schedule(d) { function exportExcel() {
d.progress = d.process; let params = getFilterParams();
d.progress = parseFloat(d.progress ? d.progress : 0); let url = dataUrl + "backstage/homeIndex/exportPlanDetails";
d.filter == undefined ? (d.filter = d.LAY_NUM) : d.filter; exportExcelUtil(url, '需求计划详情', JSON.stringify(params));
d.progress == undefined ? (d.progress = 100) : d.progress; }
var color = "layui-bg-orange";
if (d.progress < 100) {
color = "layui-bg-orange";
} else if (d.progress === 100) {
color = "layui-bg-primary";
} else if (d.progress > 100) {
color = "layui-bg-blue";
}
//设置页面进度条
return (
'<div class="layui-progress layui-progress-big" lay-showpercent="true" id="' + d.filter + '" lay-filter="progress' + d.filter + '">' +
'<div class="layui-progress-bar ' + color + '" lay-percent="' + d.progress + '%">' +
"</div></div>"
);
}
// 导出 // 需求计划详情
function exportExcel() { function openPlanDetail(obj) {
let params = { obj.id = obj.planId;
'proName': $('#proName').val(), obj.code = obj.code;
'planStatus': $('#planStatus').val() let content = '../car_demand_plan/child/apply_plan_detail.html';
} if (obj.code.indexOf('spec-') > -1) {
let url = dataUrl + "backstage/dispatchCar/export"; content = '../car_demand_plan/child/emerg_internal_car_detail.html';
exportExcelUtil(url, '派车管理', JSON.stringify(params));
}
// 工程详情
function dispatchCarProDetail(obj) {
openIframeByParamObj("dispatchCarProDetail", "工程详情", "./child/dispatch_car_pro_detail.html", "92%", "95%", obj, 1);
} }
openIframeByParamObj2("homePlanDetail", "需求计划", content, "92%", "95%", obj);
}

View File

@ -59,8 +59,6 @@ function reloadTable(pageNum) {
// 初始化表格 // 初始化表格
function initTable() { function initTable() {
let params = getFilterParams(); let params = getFilterParams();
console.error(params);
tableIns = table.render({ tableIns = table.render({
elem: "#currentTableId", elem: "#currentTableId",
id: 'currentTableId', id: 'currentTableId',
@ -193,7 +191,7 @@ function setNumColor(value) {
return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>"; return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>";
} }
// 发货状态颜色 // 派车状态颜色
function setStatusColor(value) { function setStatusColor(value) {
let color = "#409Eff"; let color = "#409Eff";
let name = '' let name = ''

View File

@ -22,8 +22,11 @@ function loadCompanyData() {
} }
// 派车状态 // 派车状态
function loadDispatchStatusData() { function loadDispatchStatusData(type) {
const list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '部分派车' }, { id: 'dispatch-2', labelName: '未派车' }, { id: 'dispatch-3', labelName: '全部派车' }]; let list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '部分派车' }, { id: 'dispatch-2', labelName: '未派车' }, { id: 'dispatch-3', labelName: '全部派车' }];
if(type){
list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '未派车' }, { id: 'dispatch-2', labelName: '已派车' }];
}
setTagData(list, 'demo2'); setTagData(list, 'demo2');
} }

View File

@ -259,7 +259,7 @@ function setFilterData(type) {
loadMonthData(); // 月份 loadMonthData(); // 月份
} else if (type === 2) { // 需求计划详情 } else if (type === 2) { // 需求计划详情
loadCompanyData(); // 分公司 loadCompanyData(); // 分公司
loadDispatchStatusData(); // 派车状态 loadDispatchStatusData(1); // 派车状态
loadPayStatusData(); // 付款状态 loadPayStatusData(); // 付款状态
loadYearsData(); // 年份 loadYearsData(); // 年份
loadMonthData(); // 月份 loadMonthData(); // 月份

View File

@ -49,7 +49,7 @@
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
<div class="layui-input-inline" style="width: 250px;"> <div class="layui-input-inline" style="width: 250px;">
<input type="text" name="planCode" id="planCode" autocomplete="off" <input type="text" name="code" id="code" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入需求计划编号" maxlength="30"> class="layui-input" lay-affix="clear" placeholder="输入需求计划编号" maxlength="30">
</div> </div>
</div> </div>