This commit is contained in:
jiang 2025-07-16 16:56:45 +08:00
parent b16ee4540b
commit ba8085e957
2 changed files with 19 additions and 14 deletions

View File

@ -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("<button type='button' style='margin-left:10px;' class='layui-btn layui-bg-orange' onclick='withdrawData("+JSON.stringify(obj)+")'>撤回</button>");
if (userObj.username === obj.userName) {
$('#print').before("<button type='button' style='margin-left:10px;' class='layui-btn layui-bg-orange' onclick='withdrawData(" + JSON.stringify(obj) + ")'>撤回</button>");
}
}
}
@ -503,7 +507,7 @@ function setCheckStatus(obj) {
// 审核状态
function getCheckStatus(statusType, status) {
var company = "";
if(statusType === 0 && status === 0){
if (statusType === 0 && status === 0) {
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>已撤回";
}
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() {

View File

@ -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 {
}