From ba8085e95748d2414afee24fcd875d7cc01f1ddd Mon Sep 17 00:00:00 2001 From: jiang Date: Wed, 16 Jul 2025 16:56:45 +0800 Subject: [PATCH] 1 --- js/car_demand_plan/child/apply_plan_detail.js | 31 +++++++++++-------- .../child/dispatch_car_detail.js | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/js/car_demand_plan/child/apply_plan_detail.js b/js/car_demand_plan/child/apply_plan_detail.js index 40e5028..a740bf9 100644 --- a/js/car_demand_plan/child/apply_plan_detail.js +++ b/js/car_demand_plan/child/apply_plan_detail.js @@ -2,6 +2,7 @@ let idParam, objParam; let details; let form, layer, table; let isPage = getUrlParam('isPage'); +let token; if (isPage) { // 首页跳转 $('#plan-detail-box>div').eq(0).remove(); $('#plan-detail-box').css({'justify-content': 'end', 'height': '50px'}); @@ -24,15 +25,18 @@ function getParamsFromUrl() { // 页面加载完成后执行 window.addEventListener("DOMContentLoaded", () => { const params = getParamsFromUrl(); + console.log(params) if (!params.token) { return; } + + token = params.token; sessionStorage.setItem('gz-token', params.token); let url = dataUrl + `backstage/carPlanAudit/getCarAuditById/${params.id}`; - ajaxRequest(url, "GET",{}, true, function () { + ajaxRequest(url, "GET", {}, true, function () { }, function (result) { if (result.code === 200) { - result.data.checkType =2 + params.isFinish === '1' ? result.data.checkType = 0 : result.data.checkType = 2 setParams(JSON.stringify(result.data)); } else { } @@ -489,12 +493,12 @@ function setOperRecordInfo(list, obj) { function setCheckStatus(obj) { $('#code').empty().html(obj.code); $('#checkStatus').html(getCheckStatus(obj.statusType, obj.status)); - if(obj.statusType === 2 && obj.status === 1 && objParam.checkType !== 2){ // 待分公司审核可以撤回 && 申请人可以撤回 && 不是审核页面跳转 + if (obj.statusType === 2 && obj.status === 1 && objParam.checkType !== 2) { // 待分公司审核可以撤回 && 申请人可以撤回 && 不是审核页面跳转 let user = sessionStorage.getItem('us'); - if(user){ + if (user) { let userObj = JSON.parse(user); - if(userObj.username === obj.userName){ - $('#print').before(""); + if (userObj.username === obj.userName) { + $('#print').before(""); } } } @@ -503,7 +507,7 @@ function setCheckStatus(obj) { // 审核状态 function getCheckStatus(statusType, status) { var company = ""; - if(statusType === 0 && status === 0){ + if (statusType === 0 && status === 0) { return "已撤回"; } if (statusType === 1) { @@ -543,10 +547,10 @@ function print() { // 撤回 function withdrawData(data) { - layer.confirm("确定撤回此条数据吗?", { 'title': '操作提示', move: false }, function () { - let loadingMsg = layer.msg('数据撤回中,请稍候...', { icon: 16, scrollbar: false, time: 0 }); + layer.confirm("确定撤回此条数据吗?", {'title': '操作提示', move: false}, function () { + let loadingMsg = layer.msg('数据撤回中,请稍候...', {icon: 16, scrollbar: false, time: 0}); let url = dataUrl + "backstage/carNeedPlan/withdrawData" - let obj = { id: data.id } + let obj = {id: data.id} let params = { encryptedData: JSON.stringify(obj) } @@ -555,10 +559,10 @@ function withdrawData(data) { console.error(result); layer.close(loadingMsg); // 关闭提示层 if (result.code === 200) { - parent.layer.msg(result.msg, { icon: 1 }) + parent.layer.msg(result.msg, {icon: 1}) closePage(); } else { - layer.msg(result.msg, { icon: 2 }) + layer.msg(result.msg, {icon: 2}) } }, function (xhr) { layer.close(loadingMsg); // 关闭提示层 @@ -570,7 +574,8 @@ function withdrawData(data) { // 需求计划申请审核 function check() { objParam.checkType = '2'; // 需求计划申请审核 - openIframeByParamObj("check", "审核", "./audit_form.html", "40%", "50%", objParam,1); + objParam.token = token; + openIframeByParamObj("check", "审核", "./audit_form.html", "40%", "50%", objParam, 1); } function closePage() { diff --git a/js/car_demand_plan/child/dispatch_car_detail.js b/js/car_demand_plan/child/dispatch_car_detail.js index 87830a1..4bfa458 100644 --- a/js/car_demand_plan/child/dispatch_car_detail.js +++ b/js/car_demand_plan/child/dispatch_car_detail.js @@ -27,7 +27,7 @@ window.addEventListener("DOMContentLoaded", () => { ajaxRequest(url, "GET", {}, true, function () { }, function (result) { if (result.code === 200) { - result.data.type = 2 + params.isFinish === '1' ? result.data.checkType = 0 : result.data.checkType = 2 setParams(JSON.stringify(result.data)); } else { }