This commit is contained in:
jiang 2025-07-09 18:58:24 +08:00
parent 06ae05c16c
commit c15ecca0ba
2 changed files with 96 additions and 12 deletions

View File

@ -10,6 +10,38 @@ if (isPage) { // 首页跳转
setParams(obj); setParams(obj);
} }
// 获取 URL 参数
function getParamsFromUrl() {
const urlParams = new URLSearchParams(window.location.search);
const result = {};
for (const [key, value] of urlParams.entries()) {
result[key] = value;
}
return result;
}
// 页面加载完成后执行
window.addEventListener("DOMContentLoaded", () => {
const params = getParamsFromUrl();
if (!params.token) {
return;
}
sessionStorage.setItem('gz-token', params.token);
let url = dataUrl + `backstage/carPlanAudit/getCarAuditById/${params.id}`;
ajaxRequest(url, "GET",{}, true, function () {
}, function (result) {
if (result.code === 200) {
result.data.checkType =2
setParams(JSON.stringify(result.data));
} else {
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
});
function setParams(obj) { function setParams(obj) {
objParam = JSON.parse(obj); objParam = JSON.parse(obj);
if (objParam.checkType === 2) { if (objParam.checkType === 2) {
@ -538,7 +570,7 @@ function withdrawData(data) {
// 需求计划申请审核 // 需求计划申请审核
function check() { function check() {
objParam.checkType = '2'; // 需求计划申请审核 objParam.checkType = '2'; // 需求计划申请审核
openIframeByParamObj("check", "审核", "./audit_form.html", "40%", "50%", objParam); openIframeByParamObj("check", "审核", "./audit_form.html", "40%", "50%", objParam,1);
} }
function closePage() { function closePage() {

View File

@ -2,8 +2,43 @@ 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 = ''; // 当前选中的批次
// 获取 URL 参数
function getParamsFromUrl() {
const urlParams = new URLSearchParams(window.location.search);
const result = {};
for (const [key, value] of urlParams.entries()) {
result[key] = value;
}
return result;
}
// 页面加载完成后执行
window.addEventListener("DOMContentLoaded", () => {
const params = getParamsFromUrl();
if (!params.token) {
return;
}
sessionStorage.setItem('gz-token', params.token);
let url = dataUrl + `backstage/dispatchCar/getNeedPlanById/${params.id}`;
ajaxRequest(url, "GET",{}, true, function () {
}, function (result) {
if (result.code === 200) {
result.data.type =2
setParams(JSON.stringify(result.data));
} else {
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
});
function setParams(params) { function setParams(params) {
objParam = JSON.parse(params); objParam = JSON.parse(params);
console.log(params)
$('#titleName').html(objParam.proName); $('#titleName').html(objParam.proName);
$('#code').html(objParam.code); $('#code').html(objParam.code);
layui.use(["form", "table", 'upload', 'layer', 'element'], function () { layui.use(["form", "table", 'upload', 'layer', 'element'], function () {
@ -46,7 +81,7 @@ function getAllOutList() {
}, function (result) { }, function (result) {
if (result.code === 200) { if (result.code === 200) {
if (result.data.length === 0 && objParam.type === 1) { if (result.data.length === 0 && objParam.type === 1) {
parent.layer.msg('暂无派车批次数据', { icon: 7 }); parent.layer.msg('暂无派车批次数据', {icon: 7});
closePage(); closePage();
} else if (result.data.length === 0 && objParam.type === 2) { } else if (result.data.length === 0 && objParam.type === 2) {
closePage(1); closePage(1);
@ -58,6 +93,7 @@ function getAllOutList() {
}, function (xhr, status, error) { }, function (xhr, status, error) {
errorFn(xhr, status, error) errorFn(xhr, status, error)
}, null); }, null);
// 详情批次数据/待审核批次数据 // 详情批次数据/待审核批次数据
function setBatchData(dataList) { function setBatchData(dataList) {
let html = '', id = '', status = '', type = ''; let html = '', id = '', status = '', type = '';
@ -155,6 +191,7 @@ function getDispatchCarData(id) {
}, function (xhr, status, error) { }, function (xhr, status, error) {
errorFn(xhr, status, error) errorFn(xhr, status, error)
}, null); }, null);
function setTableData(obj) { function setTableData(obj) {
$('#planCode').html(objParam.code); $('#planCode').html(objParam.code);
@ -164,7 +201,7 @@ function getDispatchCarData(id) {
// 附件文档 // 附件文档
setFileTable(obj.fileList); setFileTable(obj.fileList);
// 供应商信息 // 供应商信息
let supInfoList = [{ supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money }]; let supInfoList = [{supName: obj.supName, dispatchNum: obj.dispatchNum, money: obj.money}];
setSubInfos(supInfoList); setSubInfos(supInfoList);
// 操作记录 // 操作记录
setOperRecordInfo(obj.recordList); setOperRecordInfo(obj.recordList);
@ -241,8 +278,12 @@ function getDispatchCarData(id) {
if (list && list.length > 0) { if (list && list.length > 0) {
$.each(list, function (index, item) { $.each(list, function (index, item) {
let imgNum = 0; let imgNum = 0;
imgNum += item.carImage.filter(item => { return item.type !== '6' }).length; imgNum += item.carImage.filter(item => {
imgNum += item.driverUserImage.filter(item => { return item.type !== '6' }).length; 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>" + objParam.typeName + "</td>" +
@ -273,8 +314,12 @@ function getDispatchCarData(id) {
if (list && list.length > 0) { if (list && list.length > 0) {
$.each(list, function (index, item) { $.each(list, function (index, item) {
let imgNum = 0; let imgNum = 0;
imgNum += item.driverUserImage.filter(item => { return item.type === '2' || item.type === '3' }).length; imgNum += item.driverUserImage.filter(item => {
imgNum += item.operaImage.filter(item => { return item.type === '2' || item.type === '3' || item.type === '6' }).length; return item.type === '2' || item.type === '3'
}).length;
imgNum += item.operaImage.filter(item => {
return item.type === '2' || item.type === '3' || item.type === '6'
}).length;
imgNum += item.fileList.length; imgNum += item.fileList.length;
html += '<tr>' + html += '<tr>' +
'<td>' + item.type + '</td>' + '<td>' + item.type + '</td>' +
@ -321,7 +366,8 @@ function getDispatchCarData(id) {
creator = item.userName; creator = item.userName;
} }
let remark = setNullValue(item.auditRemark); let remark = setNullValue(item.auditRemark);
let dept = '',operData = '';; // auditType 1.提交 2.审核 auditStatus:1.审核通过 2.审核驳回 let dept = '', operData = '';
; // auditType 1.提交 2.审核 auditStatus:1.审核通过 2.审核驳回
if (parseInt(item.auditType) === 1) { if (parseInt(item.auditType) === 1) {
dept = '供应商'; dept = '供应商';
} else if (parseInt(item.auditType) === 2) { } else if (parseInt(item.auditType) === 2) {
@ -432,13 +478,19 @@ function print() {
// 审核派车录入数据 // 审核派车录入数据
function auditData(id, type) { function auditData(id, type) {
let obj = { id: dataObj.id, checkType: '1', planId: dataObj.planId, contractId: dataObj.contractId, supId: dataObj.supId }; let obj = {
openIframeByParamObj("auditData", "审核", "./audit_form.html", "40%", "50%", obj); id: dataObj.id,
checkType: '1',
planId: dataObj.planId,
contractId: dataObj.contractId,
supId: dataObj.supId
};
openIframeByParamObj("auditData", "审核", "./audit_form.html", "40%", "50%", obj,1);
} }
// 修改派车录入数据 // 修改派车录入数据
function updateData(id, type) { function updateData(id, type) {
let obj = { id: id, type: type, proName: objParam.proName, code: objParam.code,supId: objParam.supId}; let obj = {id: id, type: type, proName: objParam.proName, code: objParam.code, supId: objParam.supId};
openIframeByParamObj2("updateData", "派车信息修改", "../car_demand_plan/child/dispatch_car_edit_form.html", "92%", "95%", obj); openIframeByParamObj2("updateData", "派车信息修改", "../car_demand_plan/child/dispatch_car_edit_form.html", "92%", "95%", obj);
} }