This commit is contained in:
parent
f10f91eb19
commit
7f14ca723a
|
|
@ -29,6 +29,17 @@ body {
|
|||
|
||||
}
|
||||
|
||||
.fixed-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: white; /* 防止盖住内容后面透明 */
|
||||
z-index: 999; /* 确保在最上层 */
|
||||
padding: 10px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 可选阴影 */
|
||||
}
|
||||
|
||||
#plan-detail-box {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
|
|
@ -44,6 +55,9 @@ body {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
#plan-detail-box>div {
|
||||
margin: 0 20px;
|
||||
}
|
||||
#plan-basic-box {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
|
|
|
|||
|
|
@ -1,88 +1,102 @@
|
|||
var form, layer;
|
||||
let objParam, idParam;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
idParam = objParam.id;
|
||||
layui.use(['form'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
form.verify();
|
||||
form.on('submit(formData)', function (data) {
|
||||
submitApply(data);
|
||||
});
|
||||
form.on('radio(auditStatus)', function (data) {
|
||||
if (data.value === '2') { // 通过
|
||||
$('#remark').removeAttr('lay-verify');
|
||||
$('#auditRemarksLabel').removeClass('required');
|
||||
} else if (data.value === '3') { // 不通过
|
||||
$('#remark').attr('lay-verify', 'required');
|
||||
$('#auditRemarksLabel').addClass('required');
|
||||
}
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
objParam = JSON.parse(params);
|
||||
console.log(objParam);
|
||||
idParam = objParam.id;
|
||||
layui.use(['form'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
form.verify();
|
||||
form.on('submit(formData)', function (data) {
|
||||
submitApply(data);
|
||||
});
|
||||
form.on('radio(auditStatus)', function (data) {
|
||||
if (data.value === '2') { // 通过
|
||||
$('#remark').removeAttr('lay-verify');
|
||||
$('#remark').val("申请通过"); // textarea 设置内容用 val()
|
||||
$('#auditRemarksLabel').removeClass('required');
|
||||
} else if (data.value === '3') { // 不通过
|
||||
$('#remark').attr('lay-verify', 'required');
|
||||
$('#remark').val("申请驳回"); // textarea 设置内容用 val()
|
||||
$('#auditRemarksLabel').addClass('required');
|
||||
}
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
}
|
||||
|
||||
function saveData2() {
|
||||
$('#formSubmit').trigger('click')
|
||||
$('#formSubmit').trigger('click')
|
||||
}
|
||||
|
||||
// 提交
|
||||
function submitApply(data) {
|
||||
let loadingMsg = layer.msg('正在提交保存,请稍等...', {
|
||||
icon: 16,
|
||||
shade: 0.01,
|
||||
time: '0'
|
||||
});
|
||||
let loadingMsg = layer.msg('正在提交保存,请稍等...', {
|
||||
icon: 16,
|
||||
shade: 0.01,
|
||||
time: '0'
|
||||
});
|
||||
|
||||
let url = '';
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
url = dataUrl + 'backstage/dispatchCar/dispatchAudit';
|
||||
// 出库单ID、合同ID
|
||||
data.field.id = idParam;
|
||||
data.field.contractId = objParam.contractId;
|
||||
data.field.outId = objParam.outId;
|
||||
data.field.planId = objParam.planId;
|
||||
data.field.supId = objParam.supId;
|
||||
data.field.status = data.field.status === '2' ? '1' : '2';
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
url = dataUrl + 'backstage/carPlanAudit/auditInfo';
|
||||
data.field.id = idParam;
|
||||
}
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(data.field)
|
||||
};
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg);
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
if (result.code === 200) {
|
||||
top.layer.msg(result.msg, { icon: 1 });
|
||||
closePage(1);
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2 });
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
layer.msg('服务异常,请稍后重试', { icon: 16, scrollbar: false, time: 2000 });
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
let url = '';
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
url = dataUrl + 'backstage/dispatchCar/dispatchAudit';
|
||||
// 出库单ID、合同ID
|
||||
data.field.id = idParam;
|
||||
data.field.contractId = objParam.contractId;
|
||||
data.field.outId = objParam.outId;
|
||||
data.field.planId = objParam.planId;
|
||||
data.field.supId = objParam.supId;
|
||||
data.field.status = data.field.status === '2' ? '1' : '2';
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
url = dataUrl + 'backstage/carPlanAudit/auditInfo';
|
||||
data.field.id = idParam;
|
||||
}
|
||||
let params = {
|
||||
encryptedData: JSON.stringify(data.field)
|
||||
};
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg);
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
if (result.code === 200) {
|
||||
top.layer.msg(result.msg, {icon: 1});
|
||||
if (objParam.token) {
|
||||
// 如果没有 token,直接关闭整个窗口
|
||||
window.parent.open('', '_self');
|
||||
window.parent.close();
|
||||
return;
|
||||
} else {
|
||||
closePage(1);
|
||||
}
|
||||
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
||||
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}
|
||||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
window.parent.reloadAuditData();
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
window.parent.closePage();
|
||||
}
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
|
||||
|
||||
if (type == 1) {
|
||||
if (objParam.checkType === '1') { // 派车录入审核
|
||||
window.parent.reloadAuditData();
|
||||
} else if (objParam.checkType === '2') { // 需求计划审核
|
||||
window.parent.closePage();
|
||||
}
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ let objParam, dataObj;
|
|||
let form, table, upload, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
let checkNowValue = ''; // 当前选中的批次
|
||||
let token;
|
||||
|
||||
// 获取 URL 参数
|
||||
function getParamsFromUrl() {
|
||||
|
|
@ -20,12 +21,13 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
if (!params.token) {
|
||||
return;
|
||||
}
|
||||
token = params.token;
|
||||
sessionStorage.setItem('gz-token', params.token);
|
||||
let url = dataUrl + `backstage/dispatchCar/getNeedPlanById/${params.id}`;
|
||||
ajaxRequest(url, "GET",{}, true, function () {
|
||||
ajaxRequest(url, "GET", {}, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
result.data.type =2
|
||||
result.data.type = 2
|
||||
setParams(JSON.stringify(result.data));
|
||||
} else {
|
||||
}
|
||||
|
|
@ -378,7 +380,7 @@ function getDispatchCarData(id) {
|
|||
operData = '发起申请';
|
||||
} else if (index !== 0 && parseInt(item.auditType) === 1) {
|
||||
operData = '重新提交申请';
|
||||
} else if (index !== 0 && parseInt(item.auditType) === 2 && parseInt(item.auditStatus) === 2) {
|
||||
} else if (index !== 0 && parseInt(item.auditType) === 9 && parseInt(item.auditStatus) === 9) {
|
||||
operData = '驳回-给发起人' + creator + ',共间隔:' + item.times + ' 原因备注:' + remark + '';
|
||||
} else if (index !== 0 && parseInt(item.auditType) === 2 && parseInt(item.auditStatus) === 1) {
|
||||
operData = '完结-审核确认通过,共耗时:' + item.times + ' 原因备注:' + remark + '';
|
||||
|
|
@ -483,9 +485,10 @@ function auditData(id, type) {
|
|||
checkType: '1',
|
||||
planId: dataObj.planId,
|
||||
contractId: dataObj.contractId,
|
||||
supId: dataObj.supId
|
||||
supId: dataObj.supId,
|
||||
token: token
|
||||
};
|
||||
openIframeByParamObj("auditData", "审核", "./audit_form.html", "40%", "50%", obj,1);
|
||||
openIframeByParamObj("auditData", "审核", "./audit_form.html", "40%", "50%", obj, 1);
|
||||
}
|
||||
|
||||
// 修改派车录入数据
|
||||
|
|
@ -507,6 +510,13 @@ function reloadAuditData() {
|
|||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
|
||||
if (token) {
|
||||
// 如果没有 token,直接关闭整个窗口
|
||||
window.open('', '_self');
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
let frameId = parent.document.getElementById('dispatchCarProDetail').getElementsByTagName("iframe")[0];
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<body id="body">
|
||||
<div id="main-box">
|
||||
<div id="plan-detail-box" class="layout">
|
||||
<div id="plan-detail-box" class="layout fixed-header">
|
||||
<div class="layout">
|
||||
<img src="../../../images/svg/u702.svg" width="40px" height="40px" style="margin-right: 10px;">
|
||||
<div>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!--基本信息-->
|
||||
<div id="plan-basic-box" class="layout">
|
||||
<div id="plan-basic-box" class="layout" style="margin-top: 110px">
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>基本信息</p>
|
||||
|
|
|
|||
|
|
@ -75,11 +75,22 @@
|
|||
.layuimini-container {
|
||||
height: 89%;
|
||||
}
|
||||
|
||||
.fixed-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: white; /* 防止盖住内容后面透明 */
|
||||
z-index: 999; /* 确保在最上层 */
|
||||
padding: 10px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 可选阴影 */
|
||||
}
|
||||
</style>
|
||||
|
||||
<body id="body">
|
||||
<div id="main-box">
|
||||
<div class="layout" id="detail-box">
|
||||
<div class="layout fixed-header" id="detail-box" >
|
||||
<div class="layout">
|
||||
<img src="../../../images/svg/u418.svg">
|
||||
<div class="layout" style="flex-direction: column;align-items: start;margin-left: 10px;">
|
||||
|
|
@ -87,7 +98,7 @@
|
|||
<p id="code"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div >
|
||||
<button type="button" class="layui-btn layui-bg-blue no-print" id="print" onclick="print()">打印</button>
|
||||
<button class="layui-btn layui-btn-primary cancel no-print" onclick="closePage(1)">返回</button>
|
||||
</div>
|
||||
|
|
@ -96,7 +107,7 @@
|
|||
<ul class="layui-tab-title" id="layui-tab-title">
|
||||
</ul>
|
||||
</div>
|
||||
<div id="plan-box">
|
||||
<div id="plan-box" style="margin-top: 40px">
|
||||
<div class="title layout">
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>需求计划申请明细</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue