261 lines
9.3 KiB
Plaintext
261 lines
9.3 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||
<!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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||
<%@include file="../baseset.jsp" %>
|
||
<%@include file="../systemset.jsp" %>
|
||
<link rel="stylesheet" href="${bonuspath}/static/js/layui/css/layui.css" media="all">
|
||
<link rel="stylesheet" href="${bonuspath}/static/css/admin.css" media="all">
|
||
<link rel="stylesheet" href="${bonuspath}/static/css/common.css" media="all">
|
||
<style>
|
||
.layui-table-body layui-table-main {
|
||
height: 300px;
|
||
}
|
||
.layui-form-item .layui-input-inline {
|
||
width: 180px;
|
||
}
|
||
.table-container {
|
||
padding: 0 10px;
|
||
height: calc(100vh - 150px);
|
||
}
|
||
.table-section {
|
||
height: calc(50% - 20px);
|
||
margin-bottom: 20px;
|
||
}
|
||
.table-section:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
.table-header {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
margin-bottom: 10px;
|
||
padding-left: 10px;
|
||
border-left: 5px solid #1E9FFF;
|
||
}
|
||
|
||
.modified-cell {
|
||
color: #FF5722 !important;
|
||
font-weight: bold !important;
|
||
background-color: #fff5f0 !important;
|
||
}
|
||
.confirm-bar {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
background: #fff;
|
||
border-top: 1px solid #eee;
|
||
padding: 10px;
|
||
text-align: right;
|
||
z-index: 999;
|
||
box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
|
||
}
|
||
.confirm-btn {
|
||
padding: 0 30px;
|
||
height: 40px;
|
||
line-height: 40px;
|
||
font-size: 16px;
|
||
}
|
||
.summary-modal {
|
||
padding: 20px;
|
||
}
|
||
.summary-item {
|
||
margin-bottom: 15px;
|
||
padding: 10px;
|
||
border: 1px solid #e6e6e6;
|
||
border-radius: 4px;
|
||
}
|
||
.summary-header {
|
||
font-weight: bold;
|
||
margin-bottom: 10px;
|
||
padding-bottom: 5px;
|
||
border-bottom: 1px solid #eee;
|
||
}
|
||
.summary-row {
|
||
display: flex;
|
||
margin-bottom: 8px;
|
||
}
|
||
.summary-label {
|
||
width: 120px;
|
||
color: #666;
|
||
}
|
||
.summary-value {
|
||
flex: 1;
|
||
}
|
||
.modified-mark {
|
||
display: inline-block;
|
||
padding: 2px 6px;
|
||
background: #FF5722;
|
||
color: white;
|
||
border-radius: 3px;
|
||
font-size: 12px;
|
||
margin-left: 5px;
|
||
vertical-align: middle;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="layui-form" lay-filter="calculation-form" id="calculation-form">
|
||
<input type="hidden" name="id" id="editId">
|
||
<!-- 加载中提示 -->
|
||
<div id="data-loading" style="display:none; text-align: center; padding: 30px 0;">
|
||
<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 30px;"></i>
|
||
<p>数据加载中,请稍候...</p>
|
||
</div>
|
||
|
||
<!-- 数据表格容器 -->
|
||
<div id="data-container" class="table-container" style="display:none;">
|
||
<div class="table-section" style="margin-bottom: 150px;">
|
||
<div class="table-header">物资领料明细</div>
|
||
<table class="layui-table" id="leaseTable" lay-filter="leaseTable"></table>
|
||
</div>
|
||
<div class="table-section">
|
||
<div class="table-header">物资退料明细</div>
|
||
<table class="layui-table" id="returnTable" lay-filter="returnTable"></table>
|
||
</div>
|
||
</div>
|
||
<!-- 底部确认栏 -->
|
||
<div class="confirm-bar">
|
||
<button class="layui-btn layui-btn-danger confirm-btn" id="confirmAllEdit">
|
||
确认修改
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 修改确认弹框模板 -->
|
||
<script type="text/html" id="confirmModalTpl">
|
||
<div class="summary-modal">
|
||
<div style="margin-bottom: 20px; font-size: 16px; font-weight: bold; color: #333;">
|
||
共修改了 {{ d.totalCount }} 条数据
|
||
</div>
|
||
|
||
<div style="max-height: 400px; overflow-y: auto;">
|
||
{{# if(d.leaseModified.length > 0) { }}
|
||
<div class="summary-item">
|
||
<div class="summary-header">领料明细修改 ({{ d.leaseModified.length }}条)</div>
|
||
{{# layui.each(d.leaseModified, function(index, item){ }}
|
||
<div class="summary-row">
|
||
<div class="summary-label">物资名称:</div>
|
||
<div class="summary-value">{{ item.machineTypeName || '' }}</div>
|
||
</div>
|
||
{{# layui.each(item.fields, function(fieldName, fieldData){ }}
|
||
<div class="summary-row">
|
||
<div class="summary-label">{{ fieldData.label }}:</div>
|
||
<div class="summary-value">
|
||
<span style="text-decoration: line-through; color: #999; margin-right: 10px;">
|
||
{{ fieldData.old }}
|
||
</span>
|
||
<span class="modified-cell">→ {{ fieldData.val }}</span>
|
||
<span class="modified-mark">已修改</span>
|
||
</div>
|
||
</div>
|
||
{{# }); }}
|
||
<div style="height: 1px; background: #eee; margin: 10px 0;"></div>
|
||
{{# }); }}
|
||
</div>
|
||
{{# } }}
|
||
|
||
{{# if(d.returnModified.length > 0) { }}
|
||
<div class="summary-item">
|
||
<div class="summary-header">退料明细修改 ({{ d.returnModified.length }}条)</div>
|
||
{{# layui.each(d.returnModified, function(index, item){ }}
|
||
<div class="summary-row">
|
||
<div class="summary-label">物资名称:</div>
|
||
<div class="summary-value">{{ item.machineTypeName || '' }}</div>
|
||
</div>
|
||
{{# layui.each(item.fields, function(fieldName, fieldData){ }}
|
||
<div class="summary-row">
|
||
<div class="summary-label">{{ fieldData.label }}:</div>
|
||
<div class="summary-value">
|
||
<span style="text-decoration: line-through; color: #999; margin-right: 10px;">
|
||
{{ fieldData.old }}
|
||
</span>
|
||
<span class="modified-cell">→ {{ fieldData.val }}</span>
|
||
<span class="modified-mark">已修改</span>
|
||
</div>
|
||
</div>
|
||
{{# }); }}
|
||
<div style="height: 1px; background: #eee; margin: 10px 0;"></div>
|
||
{{# }); }}
|
||
</div>
|
||
{{# } }}
|
||
</div>
|
||
|
||
{{# if(d.totalCount === 0) { }}
|
||
<div style="text-align: center; padding: 30px; color: #999;">
|
||
暂无修改的数据
|
||
</div>
|
||
{{# } }}
|
||
</div>
|
||
</script>
|
||
|
||
<script src="${bonuspath}/static/js/layui/layui.js"></script>
|
||
<script>
|
||
// 先配置模块路径
|
||
layui.config({
|
||
base: '${bonuspath}/static/' //静态资源所在路径
|
||
}).extend({
|
||
index: 'js/index', //主入口模块
|
||
projectCost: 'js/projectCost/projectCostEdit'
|
||
});
|
||
|
||
// 然后按顺序加载模块
|
||
layui.use(['layer', 'element', 'form', 'table', 'laydate', 'index'], function(){
|
||
var $ = layui.$,
|
||
layer = layui.layer,
|
||
form = layui.form,
|
||
laydate = layui.laydate;
|
||
|
||
// 初始化日期选择器(与新增页一致)
|
||
laydate.render({elem: '#startTime', format: 'yyyy-MM-dd'});
|
||
laydate.render({elem: '#endTime', format: 'yyyy-MM-dd'});
|
||
|
||
// 【核心1:解析URL参数的工具函数】
|
||
function getUrlParam(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return decodeURIComponent(r[2]);
|
||
return null;
|
||
}
|
||
|
||
// 加载projectCost模块
|
||
layui.use('projectCost', function(){
|
||
var projectCost = layui.projectCost;
|
||
|
||
// 解析URL传递的参数
|
||
var editId = getUrlParam('id');
|
||
var projectId = getUrlParam('projectId');
|
||
var startTime = getUrlParam('startTime');
|
||
var endTime = getUrlParam('endTime');
|
||
|
||
$('#editId').val(editId);
|
||
form.render();
|
||
|
||
setTimeout(function() {
|
||
var field = {
|
||
calculationId: $('#editId').val(),
|
||
projectId: projectId,
|
||
startTime: startTime,
|
||
endTime: endTime
|
||
};
|
||
// 此时执行,参数有效、方法可正常触发
|
||
console.log("传参",field)
|
||
projectCost.generateSettlement(field);
|
||
}, 200);
|
||
|
||
|
||
// 绑定确认修改按钮点击事件
|
||
$('#confirmAllEdit').click(function() {
|
||
projectCost.showConfirmModal();
|
||
});
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html> |