This commit is contained in:
parent
b16ee4540b
commit
ba8085e957
|
|
@ -2,6 +2,7 @@ let idParam, objParam;
|
||||||
let details;
|
let details;
|
||||||
let form, layer, table;
|
let form, layer, table;
|
||||||
let isPage = getUrlParam('isPage');
|
let isPage = getUrlParam('isPage');
|
||||||
|
let token;
|
||||||
if (isPage) { // 首页跳转
|
if (isPage) { // 首页跳转
|
||||||
$('#plan-detail-box>div').eq(0).remove();
|
$('#plan-detail-box>div').eq(0).remove();
|
||||||
$('#plan-detail-box').css({'justify-content': 'end', 'height': '50px'});
|
$('#plan-detail-box').css({'justify-content': 'end', 'height': '50px'});
|
||||||
|
|
@ -24,15 +25,18 @@ function getParamsFromUrl() {
|
||||||
// 页面加载完成后执行
|
// 页面加载完成后执行
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
const params = getParamsFromUrl();
|
const params = getParamsFromUrl();
|
||||||
|
console.log(params)
|
||||||
if (!params.token) {
|
if (!params.token) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
token = params.token;
|
||||||
sessionStorage.setItem('gz-token', params.token);
|
sessionStorage.setItem('gz-token', params.token);
|
||||||
let url = dataUrl + `backstage/carPlanAudit/getCarAuditById/${params.id}`;
|
let url = dataUrl + `backstage/carPlanAudit/getCarAuditById/${params.id}`;
|
||||||
ajaxRequest(url, "GET",{}, true, function () {
|
ajaxRequest(url, "GET", {}, true, function () {
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
result.data.checkType =2
|
params.isFinish === '1' ? result.data.checkType = 0 : result.data.checkType = 2
|
||||||
setParams(JSON.stringify(result.data));
|
setParams(JSON.stringify(result.data));
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
@ -489,12 +493,12 @@ function setOperRecordInfo(list, obj) {
|
||||||
function setCheckStatus(obj) {
|
function setCheckStatus(obj) {
|
||||||
$('#code').empty().html(obj.code);
|
$('#code').empty().html(obj.code);
|
||||||
$('#checkStatus').html(getCheckStatus(obj.statusType, obj.status));
|
$('#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');
|
let user = sessionStorage.getItem('us');
|
||||||
if(user){
|
if (user) {
|
||||||
let userObj = JSON.parse(user);
|
let userObj = JSON.parse(user);
|
||||||
if(userObj.username === obj.userName){
|
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>");
|
$('#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) {
|
function getCheckStatus(statusType, status) {
|
||||||
var company = "";
|
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>已撤回";
|
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>已撤回";
|
||||||
}
|
}
|
||||||
if (statusType === 1) {
|
if (statusType === 1) {
|
||||||
|
|
@ -543,10 +547,10 @@ function print() {
|
||||||
|
|
||||||
// 撤回
|
// 撤回
|
||||||
function withdrawData(data) {
|
function withdrawData(data) {
|
||||||
layer.confirm("确定撤回此条数据吗?", { 'title': '操作提示', move: false }, function () {
|
layer.confirm("确定撤回此条数据吗?", {'title': '操作提示', move: false}, function () {
|
||||||
let loadingMsg = layer.msg('数据撤回中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
|
let loadingMsg = layer.msg('数据撤回中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||||
let url = dataUrl + "backstage/carNeedPlan/withdrawData"
|
let url = dataUrl + "backstage/carNeedPlan/withdrawData"
|
||||||
let obj = { id: data.id }
|
let obj = {id: data.id}
|
||||||
let params = {
|
let params = {
|
||||||
encryptedData: JSON.stringify(obj)
|
encryptedData: JSON.stringify(obj)
|
||||||
}
|
}
|
||||||
|
|
@ -555,10 +559,10 @@ function withdrawData(data) {
|
||||||
console.error(result);
|
console.error(result);
|
||||||
layer.close(loadingMsg); // 关闭提示层
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
parent.layer.msg(result.msg, { icon: 1 })
|
parent.layer.msg(result.msg, {icon: 1})
|
||||||
closePage();
|
closePage();
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, { icon: 2 })
|
layer.msg(result.msg, {icon: 2})
|
||||||
}
|
}
|
||||||
}, function (xhr) {
|
}, function (xhr) {
|
||||||
layer.close(loadingMsg); // 关闭提示层
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
|
@ -570,7 +574,8 @@ function withdrawData(data) {
|
||||||
// 需求计划申请审核
|
// 需求计划申请审核
|
||||||
function check() {
|
function check() {
|
||||||
objParam.checkType = '2'; // 需求计划申请审核
|
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() {
|
function closePage() {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
ajaxRequest(url, "GET", {}, true, function () {
|
ajaxRequest(url, "GET", {}, true, function () {
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
result.data.type = 2
|
params.isFinish === '1' ? result.data.checkType = 0 : result.data.checkType = 2
|
||||||
setParams(JSON.stringify(result.data));
|
setParams(JSON.stringify(result.data));
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue