付款单申请审核

This commit is contained in:
lSun 2026-01-29 13:59:17 +08:00
parent 198de69371
commit 4496206c0f
9 changed files with 1556 additions and 0 deletions

12
.idea/gz_car_ui.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,591 @@
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'});
$('body').css('margin', '0');
let obj = decodeURIComponent(getUrlParam('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();
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 () {
}, function (result) {
if (result.code === 200) {
params.isFinish === '1' ? result.data.checkType = 0 : result.data.checkType = 2
setParams(JSON.stringify(result.data));
} else {
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
});
function setParams(obj) {
objParam = JSON.parse(obj);
if (objParam.checkType === 2) {
$('#print').before('<button type="button" class="layui-btn layui-bg-orange" onclick="check()">审核</button>');
}
idParam = objParam.id;
layui.use(['form', 'layer', 'table'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
getNeedPlanDetails();
initTable();
});
}
// 详情
function getNeedPlanDetails() {
let params = {
encryptedData: JSON.stringify({
'id': objParam.id
})
};
let url = dataUrl + 'backstage/carNeedPlan/getNeedPlanDetails';
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.code === 200) {
setPlanBasicTableInfo(result.data);
setOperRecordInfo(result.data.recordList, result.data);
setCheckStatus(result.data);
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
// 基本信息
function setPlanBasicTableInfo(obj) {
$('#proName').html(obj.proName);
$('#projectPart').html(obj.projectPart);
$('#projectContent').html(obj.projectContent);
$('#needTime').html(obj.needTime);
$('#remark').html(obj.remark);
$('#carLength').html(obj.carLength);
$('#carWidth').html(obj.carWidth);
$('#carHeight').html(obj.carHeight);
$('#carWeight').html(obj.carWeight);
$('#carStart').html(obj.carStart);
$('#carEnd').html(obj.carEnd);
setRoutePoint(obj.routePoint);
// 附件文档
setFileTable(obj.fileList);
}
function setRoutePoint(data) {
// 清空之前的表格
$('#routePoint').empty();
let html = '';
html += "<table class='classTable'>";
if (data != null && data !== "") {
// 分割数据并过滤掉空值
let result = data.split("routePoint;").filter(item => item.trim() !== "");
if (result && result.length > 0) {
// 动态生成表头
html += "<tr>";
for (let i = 0; i < Math.min(result.length, 4); i++) {
html += "<th>途经点</th>";
}
html += "</tr>";
// 动态生成表格内容,每行最多 4 列
let rowCount = Math.ceil(result.length / 4); // 计算需要多少行
for (let row = 0; row < rowCount; row++) {
html += "<tr>";
for (let col = 0; col < 4; col++) {
let index = row * 4 + col;
if (index < result.length) {
html += "<td>" + result[index] + "</td>";
} else {
html += "<td></td>"; // 如果没有数据,填充空白单元格
}
}
html += "</tr>";
}
}
}
html += "</table>";
// 将生成的 HTML 插入到页面中
$('#routePoint').append(html);
}
// 附件文档赋值
function setFileTable(fileList) {
$('#file-table tr:not(:first)').remove();
let html = '';
if (fileList && fileList.length > 0) {
$.each(fileList, function (index, item) {
html += '<tr>' +
'<td>' + handleFileType(item.fileName) + item.fileName + '</td>' +
'<td>' + (item.type) + '</td>' +
'<td><img src="../../../images/user_head_icon.png" width="20px" height="20px">' + item.createName + '</td>' +
'<td>' + item.createTime + '</td>' +
'<td><a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'viewFile(' + JSON.stringify(item) + ')\'>预览</a>' +
'<a style="margin:0 5px;color:#409EFF;cursor: pointer;" onclick=\'downLoadFile(' + JSON.stringify(item) + ')\'>下载</a>' +
'</td>' +
'</tr>';
})
} else {
html = '<tr><td colspan="5" style="text-align: center;">暂无数据</td></tr>';
}
$('#file-table tbody').after(html);
}
// 处理文件类型
function handleFileType(value) {
value = value.toLowerCase();
let src = '';
if (value.indexOf('docx') > -1 || value.indexOf('doc') > -1) {
src = '../../../images/docx.png'
} else if (value.indexOf('xls') > -1 || value.indexOf('xlsx') > -1) {
src = '../../../images/xlsx.png'
} else if (value.indexOf('pdf') > -1) {
src = '../../../images/pdf.png'
} else if (value.indexOf('png') > -1 || value.indexOf('jpg') > -1 || value.indexOf('jpeg') > -1) {
src = '../../../images/img_icon.png'
}
return '<img width="20px" height="20px" src = "' + src + '" style="margin:0 5px;">'
}
// 预览文件
function viewFile(obj) {
let fileName = obj.fileName.toLowerCase();
if (fileName.indexOf('png') > -1 || fileName.indexOf('jpg') > -1 || fileName.indexOf('jpeg') > -1) {
layer.photos({
shade: 0.5,
photos: {
"title": "图片预览",
"start": 0,
"data": [
{
"alt": "layer",
"pid": 1,
"src": fileUrl + obj.fileUrl + '?token=' + sessionStorage.getItem("gz-token"),
}
]
}
});
} else {
// 调用公司的预览文件的服务
commonViewFile(obj.fileUrl);
}
}
// 下载文件
function downLoadFile(obj) {
let url = dataUrl + "sys/file/download?fileId=" + obj.id;
downLoadFileUtil(url, obj.fileName, null);
}
// 查询/重置
function queryTable(type) {
if (type === 1) {
let name = $('#name').val();
let flag = checkValue(name);
if (flag) {
$('#name').val('');
return layer.msg('名称查询包含特殊字符,请重新输入', {icon: 2});
}
let model = $('#model').val();
let flag2 = checkValue(model);
if (flag2) {
$('#model').val('');
return layer.msg('规格查询包含特殊字符,请重新输入', {icon: 2});
}
reloadTable(1);
} else if (type === 2) {
$('#name').val('');
$('#model').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadTable(1);
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'name': $('#name').val(),
'model': $('#model').val(),
'id': objParam.id
}),
},
},
);
}
// 初始化表格
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full",
url: dataUrl + "backstage/carNeedPlan/getNeedPlanDetailsList",
where: {
encryptedData: JSON.stringify({
'name': $('#name').val(),
'model': $('#model').val(),
'id': objParam.id
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
if (res.code === 401) {
closeWindowOpen();
}
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '8%',
title: "序号",
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "type",
width: '10%',
title: "类型",
unresize: true,
align: "center",
sort: true,
},
{
field: "name",
width: '10%',
title: "名称",
unresize: true,
align: "center",
sort: true,
},
{
field: "model",
width: '15%',
title: "规格",
unresize: true,
align: "center",
sort: true,
},
{
field: "unit",
width: '10%',
title: "单位",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return setNullValue(d.unit);
},
},
{
field: "carSpec",
width: '14%',
title: "所需规格",
unresize: true,
align: "center",
},
{
field: "needNum",
width: '10%',
title: "需用量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return setNumColor(d.needNum);
},
},
{
field: "backDate",
width: '12%',
title: "预计使用时间(天)",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.backDate;
},
},
{
field: "remark",
width: '10%',
title: "备注",
sort: true,
unresize: true,
align: "center",
templet: function (d) {
if (d.remark) {
if (d.remark.length > 60) {
return '<span title="' + d.remark + '">' + d.remark.substring(0, 60) + '...</span>'
} else {
return '<span title="' + d.remark + '">' + d.remark + '</span>'
}
} else {
return '';
}
},
},
],
],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;
table.resize("currentTableId");
},
});
}
// 数量颜色
function setNumColor(value, isNeedNum) {
if (isNeedNum) {
return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>";
} else {
return '<span style="color:#409Eff;font-weight:bold;">' + value + "</span>";
}
}
// 导出
function exportData() {
let params = {
"id": objParam.id,
'name': $('#name').val(),
'model': $('#model').val(),
}
let url = dataUrl + "backstage/carNeedPlan/exportDetails";
exportExcelUtil(url, '申请明细', JSON.stringify(params));
}
// 操作记录
function setOperRecordInfo(list, obj) {
let html = '';
if (list && list.length > 0) {
let imgUrl = '../../../images/user_head_icon.png';
let imgUrl2 = '../../../images/time_icon.png';
$.each(list, function (index, item) {
const creator = (item.nikeName ? item.nikeName : item.userName);
// 1. 容错处理(统一处理空值、类型转换)
const remark = setNullValue(item.auditRemark); // 已有空值处理,保留
const auditType = item.auditType + ''; // 确保为字符串(匹配原条件的字符串判断)
const auditStatus = item.auditStatus + ''; // 确保为字符串
const times = setNullValue(item.times) || '0'; // 时间间隔容错(避免拼接 undefined
// 2. 部门映射表(替代多 if-else清晰直观
const deptMap = {
'0': '项目部',
'1': '项目部',
'-1': '项目部',
'2': '分公司',
'3': '项管中心',
'4': '智联装备云控公司',
'5': '供应商'
};
const dept = deptMap[auditType] || '未知部门'; // 默认值容错
// 3. 操作流程规则(按「优先级+条件组合」定义,避免逻辑冲突)
const operRules = [
// 规则:[条件函数, 操作文案],按优先级排序(先匹配先执行)
[() => index === 0 && auditType === '1', '发起申请'],
[() => index !== 0 && auditType === '1', '提交派车申请'],
[() => index !== 0 && auditType === '9' && auditStatus === '9', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
[() => index !== 0 && auditType === '2' && auditStatus === '1', `审核确认通过,共间隔:${times} 原因备注:${remark}`],
[() => index !== 0 && auditType === '2' && auditStatus === '2', `完结-审核确认通过,共耗时:${times} 原因备注:${remark}`],
[() => auditType === '2' && auditStatus === '2', `审核确认通过,共间隔:${times} 原因备注:${remark}`], // 原逻辑:无 index 限制
[() => auditType === '2' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
[() => auditType === '3' && auditStatus === '2', `审核确认通过,共间隔:${times} 原因备注:${remark}`],
[() => auditType === '3' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
[() => auditType === '4' && auditStatus === '2', `完结-审核确认通过,共耗时:${times} 原因备注:${remark}`],
[() => auditType === '4' && auditStatus === '3', `驳回-给发起人${creator},共间隔:${times} 原因备注:${remark}`],
[() => auditType === '5' && auditStatus === '2', `派车情况-${remark},共耗时:${times}`]
];
// 匹配操作文案(默认值容错)
let operData = '未知操作';
for (const [condition, text] of operRules) {
if (condition()) {
operData = text;
break; // 找到匹配规则,立即退出(保证优先级)
}
}
html += '<div class="layui-timeline-item">' +
'<i class="layui-icon layui-timeline-axis"></i>' +
'<div class="layui-timeline-content layui-text">' +
'<h3 class="layui-timeline-title">' + item.auditTime.substring(0, 10) + '</h3>' +
'<div class="layui-panel">' +
'<div class="oper-info layout">' +
'<div class="layout">' +
'<img src="' + imgUrl + '">' +
'</div>' +
'<div class="user-oper layout">' +
'<div style="width: 100%">' +
'<span>' + (item.nikeName ? item.nikeName : item.userName) + '</span><span>' + item.phone + '</span><span>' + dept + '</span>' +
'</div>' +
'<div style="width: 100%">' +
'<span>' + operData + '</span>' +
'</div>' +
'</div>' +
'<div class="layout">' +
'<img src="' + imgUrl2 + '">' +
'<span style="margin: 0 5px 0 5px;">' + item.auditTime + '</span>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
})
}
$('.layui-timeline').empty().append(html);
}
// 设置计划编号/审核状态
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) { // 待分公司审核可以撤回 && 申请人可以撤回 && 不是审核页面跳转
let user = sessionStorage.getItem('us');
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>");
}
}
}
}
// 审核状态
function getCheckStatus(statusType, status) {
var company = "";
if (statusType === 0 && status === 0) {
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>已撤回";
}
if (statusType === 1) {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核通过";
} else if (statusType === 2) {
company = "分公司";
} else if (statusType === 3) {
company = "项管中心";
} else if (statusType === 4) {
company = "智联装备云控公司";
}
if (status === 1) {
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待" + company + "审核";
} else if (status === 2) {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核通过";
} else if (status === 3) {
return "<span style='color:#F56C6C;margin:0 5px 0 5px;font-size:16px'>●</span>" + company + "审核驳回";
}
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待审核";
}
// 打印
function print() {
$("#main-box").print({
globalStyles: true,
mediaPrint: false,
stylesheet: '../../../css/aq_demand_plan/apply_plan_detail.css',
noPrintSelector: ".no-print",
iframe: true,
append: null,
prepend: null,
manuallyCopyFormValues: true,
deferred: $.Deferred()
});
}
// 撤回
function withdrawData(data) {
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 params = {
encryptedData: JSON.stringify(obj)
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
console.error(result);
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
parent.layer.msg(result.msg, {icon: 1})
closePage();
} else {
layer.msg(result.msg, {icon: 2})
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
});
})
}
// 需求计划申请审核
function check() {
objParam.checkType = '2'; // 需求计划申请审核
objParam.token = token;
openIframeByParamObj("check", "审核", "./car_audit_form.html", "40%", "50%", objParam, 1);
}
function closePage() {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
window.parent.queryTable(1);
parent.layer.close(index); // 再执行关闭
}

View File

@ -0,0 +1,224 @@
let form, table, laydate;
let tableIns;
let pageNum = 1; // 定义分页
let objParam;
function setParams(params) {
objParam = JSON.parse(params);
layui.use(["form", "table", 'laydate'], function () {
form = layui.form;
table = layui.table;
laydate = layui.laydate;
initTable();
});
}
// 查询/重置
function queryTable(type) {
if (type === 1) {
let keyWord = $('#keyWord').val();
let flag = checkValue(keyWord);
if (flag) {
$('#keyWord').val('');
return layer.msg('关键字查询包含特殊字符,请重新输入', { icon: 2 });
}
reloadTable(1);
} else if (type === 2) {
$('#keyWord').val('');
$('#status').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadTable(1);
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
'contractId': objParam.contractId,
'supId': objParam.supId,
}),
},
},
);
}
// 初始化表格
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-170",
url: dataUrl + "backstage/carBalance/getSltDetailsList",
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
'contractId': objParam.contractId,
'supId': objParam.supId,
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
if (res.code === 401) {
closeWindowOpen();
}
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '5.9%',
title: "序号",
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "type",
width: '10%',
title: "类型",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
return d.type === '1' ? '车辆':'吊车';
},
},
{
field: "supName",
width: '15%',
title: "供应商名称",
unresize: true,
align: "center",
sort:true,
},
{
field: "code",
width: '14%',
title: "需求计划编号",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
let html = "";
html += "<a onclick='openPlanDetail(" + JSON.stringify(d) + ")'>" + d.code + "</a>";
return html;
},
},
{
field: "carNum",
width: '10%',
title: "用车数量",
unresize: true,
align: "center",
sort:true,
},
{
field: "money",
width: '10%',
title: "应付金额",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
return ' ¥ ' + (d.money ? d.money : 0);
},
},
{
field: "status",
width: '10%',
title: "已付金额",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
let payMoney = d.payMoney || 0;
if (d.status === '已付') {
return ' ¥ ' + payMoney;
} else {
return '<p style="color:#f56c6c;">待付</p>';
}
},
},
{
field: "proName",
width: '15%',
title: "工程名称",
unresize: true,
align: "center",
sort:true,
},
{
title: "操作",
width: '10%',
align: "center",
unresize: true,
templet: function (d) {
let html = "";
html += "<a onclick='paymentDetail(" + JSON.stringify(d) + ")'>详情</a>";
return html;
},
},
],
],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;
table.resize("currentTableId");
},
});
}
// 导出
function exportExcel() {
let params = {
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
'supId': objParam.supId
}
let url = dataUrl + "backstage/carBalance/export2";
exportExcelUtil(url, '付款单录入详情', JSON.stringify(params));
}
// 详情
function paymentDetail(obj) {
openIframeByParamObj2("paymentDetail2", "详情", "./car_audit_detail.html", "92%", "95%", obj);
}
// 需求计划详情
function openPlanDetail(obj) {
obj.id = obj.planId;
obj.code = obj.code;
let content = '../car_demand_plan/child/apply_plan_detail.html';
if (obj.code.indexOf('spec-') > -1) {
content = '../car_demand_plan/child/emerg_internal_car_detail.html';
}
openIframeByParamObj2("planDetail", "车辆需求计划", content, "92%", "95%", obj);
}

View File

@ -0,0 +1,102 @@
var form, layer;
let objParam, idParam;
function setParams(params) {
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')
}
// 提交
function submitApply(data) {
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});
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); // 再执行关闭
}

View File

@ -0,0 +1,282 @@
let form, table, element;
let tableIns;
let pageNum = 1; // 定义分页
layui.use(["form", "table", 'element'], function () {
form = layui.form;
table = layui.table;
element = layui.element;
// tab 切换事件
element.on('tab(demo-filter-tab)', function (data) {
let status = $(this).attr('value');
$('#status').val(status);
queryTable(1);
});
initTable();
});
// 查询/重置
function queryTable(type) {
if (type === 1) {
let supName = $('#supName').val();
let flag = checkValue(supName);
if (flag) {
$('#supName').val('');
return layer.msg('关键字查询包含特殊字符,请重新输入', { icon: 2 });
}
reloadTable(1);
} else if (type === 2) {
$('#supName').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadTable(1);
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'supName': $('#supName').val(),
'status': $('#status').val()
}),
},
},
);
}
// 初始化表格
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
height: "full-220",
url: dataUrl + "backstage/carBalance/getBalanceData",
where: {
encryptedData: JSON.stringify({
'supName': $('#supName').val(),
'status': $('#status').val()
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
if(res.code === 401){
closeWindowOpen();
}
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '6.9%',
title: "序号",
type: 'numbers',
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "supName",
width: '14%',
title: "供应商名称",
unresize: true,
align: "center",
sort:true,
},
{
field: "ygMoney",
width: '14%',
title: "预估金额(元) ",
unresize: true,
align: "center",
sort:true,
},
{
field: "money",
width: '14%',
title: "租赁金额(元) ",
unresize: true,
align: "center",
sort:true,
},
{
field: "status",
width: '10%',
title: "审核状态",
unresize: true,
sort:true,
align: "center",
templet: function (d) {
return getCheckStatus(d.status);
},
},
{
field: "userName",
width: '8%',
title: "提交人",
unresize: true,
align: "center",
sort:true,
},
{
field: "createTime",
width: '15%',
title: "提交时间",
unresize: true,
align: "center",
sort:true,
},
{
field: "remark",
width: '14%',
title: "备注",
unresize: true,
align: "center",
sort:true,
templet: function (d) {
if (d.remark) {
if (d.remark.length > 60) {
return '<span title="' + d.remark + '">' + d.remark.substring(0, 60) + '...</span>'
} else {
return '<span title="' + d.remark + '">' + d.remark + '</span>'
}
} else {
return '';
}
},
},
{
title: "操作",
width: '15%',
align: "center",
fixed: 'right',
unresize: true,
templet: function (d) {
let html = "";
let content = getCheckStatus(d.status);
if(!(content.indexOf('驳回') > -1)){
html += "<a onclick='checkSubmit(" + JSON.stringify(d) + ")'>提交</a><div class='splitLine'>|</div>"
}
if(!(content.indexOf('驳回') > -1)){
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>驳回</a><div class='splitLine'>|</div>"
}
html += "<a onclick='planAuditDetail(" + JSON.stringify(d) + ")'>详情</a>";
if (!(content.indexOf('驳回') > -1 || content.indexOf('已撤回') > -1 || content.indexOf('通过') > -1)) {
html += "<div class='splitLine'>|</div><a onclick='checkDetail(" + JSON.stringify(d) + ")'>审核</a>";
}
return html;
},
},
],
],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;
table.resize("currentTableId");
},
});
}
// 导出
function exportExcel() {
let params = {
'supName': $('#supName').val(),
'status': $('#status').val()
}
let url = dataUrl + "backstage/carPlanAudit/export";
exportExcelUtil(url, '计划申请审核', JSON.stringify(params));
}
//审核状态
function getCheckStatus(status) {
if(status === 0){
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>全部通过";
}
/*var company = "";
if (statusType === 1) {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核通过";
} else if (statusType === 2) {
company = "分公司";
} else if (statusType === 3) {
company = "项目管理中心";
} else if (statusType === 4) {
company = "机具公司";
}*/
if (status === 1) {
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待审核";
} else if (status === 2) {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核驳回";
} else if (status === -3) {
return "<span style='color:#F56C6C;margin:0 5px 0 5px;font-size:16px'>●</span>待提交";
}
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>待提交";
}
// 详情
function planAuditDetail(obj) {
openIframeByParamObj("plan_audit_detail", "详情", "./child/car_audit_detail_list.html", "92%", "95%", obj);
}
// 需求计划申请审核
function checkDetail(obj) {
obj.checkType = 2;
openIframeByParamObj("check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
}
//提交
function checkSubmit(obj) {
layer.confirm("确定提交此条数据吗?", { 'title': '操作提示', move: false }, function () {
let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
let url = dataUrl + "backstage/carType/deleteType"
let obj = { 'id': id }
let params = {
encryptedData: JSON.stringify(obj)
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
layer.msg(result.msg, { icon: 1 })
if (type === 1) {
fitTypeTree.partialRefreshDel($div); // 删除节点
} else if (type === 2) {
dtreeData = getDTreeData();
dtree.reload("fitTypeTree", {
data: dtreeData
});
}
queryTable(1);
} else {
layer.msg(result.msg, { icon: 2 })
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
});
})
}

View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>需求计划审核</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../css/font.css" media="all">
<link rel="stylesheet" href="../../css/public.css" media="all">
</head>
<style>
.layui-tab-brief>.layui-tab-title .layui-this {
color: #409eff;
}
.layui-tab-brief>.layui-tab-more li.layui-this:after,
.layui-tab-brief>.layui-tab-title .layui-this:after {
border-bottom: 2px solid #409eff;
}
a {
color: #428bca;
text-decoration: none;
}
a:hover,
a:focus {
color: #2a6496;
text-decoration: underline;
}
</style>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-tab layui-tab-brief" lay-filter="demo-filter-tab">
<ul class="layui-tab-title">
<li value="">全部</li>
<li value="-1" class="layui-this">待提交</li>
<li value="1" >待审核</li>
<li value="0">已通过</li>
<li value="2">已驳回</li>
</ul>
</div>
<fieldset class="table-search-fieldset">
<legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px">
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
<input type="text" value="-1" id="status" name="status" hidden>
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 380px;">
<input type="text" name="supName" id="supName" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入供应商名称" maxlength="30">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
class="layui-icon"></i> 搜 索</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button>
<button class="layui-btn layui-btn-primary" onclick="exportExcel()"><i
class="layui-icon layui-icon-download-circle"></i> 导 出</button>
</div>
</div>
</form>
</div>
</fieldset>
<div class="table-box" table-responsive style="z-index: 1;">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
</div>
</div>
</div>
<script src="../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
<script src="../../js/public.js" charset="utf-8"></script>
<script src="../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../js/car_application_audit/car_audit_list.js" charset="utf-8"></script>
<script src="../../js/openIframe.js" charset="utf-8"></script>
</body>
</html>

View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>付款单审核-详情信息</title>
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../../css/font.css" media="all">
<link rel="stylesheet" href="../../../css/public.css" media="all">
<link rel="stylesheet" href="../../../css/car_demand_plan/apply_plan_detail.css" media="all">
</head>
<body id="body">
<div id="main-box">
<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>
<p style="font-size: 20px;font-weight: bold;">付款单详情</p>
<div class="layout">
<p id="code"></p>
<span id="checkStatus"></span>
</div>
</div>
</div>
<div>
<button type="button" class="layui-btn layui-bg-blue no-print" id="print" onclick="print()">打印</button>
</div>
</div>
<!--基本信息-->
<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>
</div>
<div id="plan-basic-table">
<table class="classTable">
<tr>
<th>项目名称</th>
<th>项目部分</th>
<th>工程内容</th>
<th>需用日期</th>
</tr>
<tr>
<td id="proName"></td>
<td id="projectPart"></td>
<td id="projectContent"></td>
<td id="needTime"></td>
</tr>
<tr>
<th colspan="4">计划说明</th>
</tr>
<tr>
<td colspan="4" id="remark"></td>
</tr>
<tr>
<th>预计运输物品重量(吨)</th>
<th>运输起点</th>
<th>运输终点</th>
<th></th>
</tr>
<tr>
<td id="carWeight"></td>
<td id="carStart"></td>
<td id="carEnd"></td>
<td></td>
</tr>
</table>
<div id="routePoint"></div>
</div>
<div id="file-box">
<div class="title layout">
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>附件文档</p>
</div>
<div id="file-table-box">
<table class="classTable" id="file-table">
<tr>
<th style="width: 30%;">文件名</th>
<th style="width: 10%;">文件类型</th>
<th>上传人员</th>
<th>上传时间</th>
<th>操作</th>
</tr>
</table>
</div>
</div>
</div>
<!--申请明细-->
<div id="implement-box" class="layout">
<div class="title layout">
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>申请明细</p>
</div>
<div class="page-content">
<form class="layui-form layui-form-pane no-print" action="#" onsubmit="return false;">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="name" id="name" autocomplete="off" class="layui-input"
lay-affix="clear" placeholder="输入名称" maxlength="30">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="model" id="model" autocomplete="off" class="layui-input"
lay-affix="clear" placeholder="输入规格" maxlength="30">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i class="layui-icon"></i>
</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button>
<button class="layui-btn layui-btn-primary" onclick="exportData()"><i
class="layui-icon layui-icon-download-circle"></i> 下 载</button>
</div>
</div>
</form>
<div class="table-box" table-responsive style="z-index: 1;">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
</div>
</div>
</div>
<!-- 操作记录 -->
<div id="oper-record-box" class="layout">
<div class="title layout">
<span style="font-weight:700;text-decoration:none;color:#409EFF;"></span>
<p>操作记录</p>
</div>
<div class="layui-timeline">
</div>
</div>
</div>
</body>
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
<script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../js/jQuery.print.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/car_application_audit/car_audit_detail.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>供应商付款单详情列表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../../css/font.css" media="all">
<link rel="stylesheet" href="../../../css/public.css" media="all">
</head>
<style>
body {
margin: 0 15px 15px 15px;
height: 100%;
}
</style>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<fieldset class="table-search-fieldset">
<legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px">
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="keyWord" id="keyWord" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入关键字" maxlength="30">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<select id="status">
<option value="">请选择付款状态</option>
<option value="0">待付</option>
<option value="1">已付</option>
</select>
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
class="layui-icon"></i> 搜 索</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button>
<button class="layui-btn layui-btn-primary" onclick="exportExcel()"><i
class="layui-icon layui-icon-download-circle"></i> 导 出</button>
</div>
</div>
</form>
</div>
</fieldset>
<div class="table-box" table-responsive style="z-index: 1;">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
</div>
</div>
</div>
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
<script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/car_application_audit/car_audit_detail_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</body>
</html>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>审核</title>
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../../css/font.css" media="all">
<link rel="stylesheet" href="../../../css/data_form.css" media="all">
</head>
<body>
<div id="main-box">
<form class="layui-form layuimini-form" onsubmit="return false;" onclick="return false;">
<div class="layui-form-item" style="margin-top: 1%;">
<label class="layui-form-label required">审核结果</label>
<div class="layui-input-block">
<input type="radio" lay-filter="auditStatus" name="status" value="2" title="通过" checked>
<input type="radio" lay-filter="auditStatus" name="status" value="3" title="不通过">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" id="auditRemarksLabel">审核意见</label>
<div class="layui-input-inline" style="width: 250px;">
<textarea placeholder="不通过必须填写审核意见" id="remark" name="remark" class="layui-textarea" maxLength="60">审核通过
</textarea>
</div>
</div>
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
style="display: none;"></button>
</form>
<div class="btn-box">
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
<button class="layui-btn layui-btn-normal save" onclick="saveData2()">确定</button>
</div>
</div>
</body>
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
<script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/car_application_audit/car_audit_form.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html>