前端接口对接

This commit is contained in:
pengyb 2024-08-21 11:19:49 +08:00
parent 70dd098a82
commit ee03de8f4c
5 changed files with 34 additions and 8 deletions

View File

@ -83,12 +83,12 @@
</div>
<!-- 栏目5 -->
<div class="layui-tab-item">
<iframe src="./project/projectList.html" frameborder="0" width="100%"
<iframe src="./project/projectList.html" id="projectFrame" frameborder="0" width="100%"
height="100%"></iframe>
</div>
<!-- 栏目6 -->
<div class="layui-tab-item">
<iframe src="./attendance/attendance.html" frameborder="0" width="100%"
<iframe src="./attendance/attendance.html" id="attendanceFrame" frameborder="0" width="100%"
height="100%"></iframe>
</div>
<!-- 栏目7 -->

View File

@ -115,6 +115,8 @@ function resetClick(){
* 初始化数据 全部
*/
function initTable1(){
var yjId = $(window.parent.document).find("input[id='taskSourceId']").attr("stationId");
console.log('全部')
table.render({
id: 'layui_table1',
@ -122,7 +124,8 @@ function initTable1(){
url: PATH_URL + '/attendance/getAllInspectionList',
where: {
startMakeMonth: $('#makeMonth').val(),
endMakeMonth: $('#makeMonth').val()
endMakeMonth: $('#makeMonth').val(),
yjId: yjId
},
page: true, //开启分页
method:'post',
@ -165,6 +168,7 @@ function initTable1(){
*/
function initTable2(){
console.log('正常巡视统计')
var yjId = $(window.parent.document).find("input[id='taskSourceId']").attr("stationId");
// 渲染表格
table.render({
id: 'layui_table2',
@ -172,7 +176,8 @@ function initTable2(){
url: PATH_URL + '/attendance/getNormalInspectionList',
where: {
startMakeMonth: $('#makeMonth').val(),
endMakeMonth: $('#makeMonth').val()
endMakeMonth: $('#makeMonth').val(),
yjId: yjId
},
page: true, //开启分页
method:'post',
@ -212,7 +217,7 @@ function initTable2(){
*/
function initTable3(userName,proName,yjName,makeMonth){
console.log('特巡统计')
var yjId = $(window.parent.document).find("input[id='taskSourceId']").attr("stationId");
//保存数据
var tableData = []
@ -225,6 +230,7 @@ function initTable3(userName,proName,yjName,makeMonth){
align: 'center',
type: 'numbers'
},
{field:'userId', style: 'display:none'},
{field:'userName', title: '姓 名',align: 'center', width: '80'},
{field:'proName', title: '管辖线路名称',align: 'center', width: '200'},
{field:'yjName', title: '所属运检站',align: 'center', width: '200'},
@ -238,12 +244,13 @@ function initTable3(userName,proName,yjName,makeMonth){
userName: userName,
proName: proName,
yjName: yjName,
makeMonth: $('#makeMonth').val()
makeMonth: $('#makeMonth').val(),
yjId: yjId
}, //获取提交的表单字段
success: function (data) {
for (var i = 0; i < data.length; i++) {
var json =
{'userName': data[i].userName, 'proName': data[i].proName, 'yjName': data[i].yjName, 'special': data[i].special, 'makeMonth': data[i].makeMonth, 'proId': data[i].proId }
{'userId': data[i].userId, 'userName': data[i].userName, 'proName': data[i].proName, 'yjName': data[i].yjName, 'special': data[i].special, 'makeMonth': data[i].makeMonth, 'proId': data[i].proId }
var spMakeList = data[i].spMakeList;
for (var j = 0; j < spMakeList.length; j++) {
json[`${ spMakeList[j].currDay }`] = spMakeList[j].isAtt;
@ -294,6 +301,7 @@ function initTable3(userName,proName,yjName,makeMonth){
* 详情
* */
function checkView(obj) {
debugger
let height = '98%';
let width = '95%';
$.ajax({
@ -302,7 +310,8 @@ function checkView(obj) {
contentType: "application/json; charset=utf-8",
data: JSON.stringify({
makeMonth: $("#makeMonth").val(),
proId: obj.data.proId
proId: obj.data.proId,
userId: obj.data.userId
}),
success: function (data) {
console.log("dataaaaaa:", data)

View File

@ -102,6 +102,8 @@ function getView(data){
}
$("#firstViewBox").append(html1);
var twoMakeList = data.data.twoMakeList;
$("#secondViewBox").html('');
let html2 = ``;

View File

@ -36,10 +36,23 @@ function init(){
$("#taskSourceId").attr("gsName", item.parentName);
/**
* 选择运检站后会根据运检id重新查询页面内容
*/
localStorage.setItem("selectyj", item.id)
var iframe = $("#indexFrame")[0];
var iframeWindow = iframe.contentWindow;
iframeWindow.setData();
var projectFrame = $("#projectFrame")[0];
var projectWindow = projectFrame.contentWindow;
projectWindow.init();
var attendanceFrame = $("#attendanceFrame")[0];
var attendanceWindow = attendanceFrame.contentWindow;
attendanceWindow.init();
},
});
},

View File

@ -52,12 +52,14 @@ function resetClick(){
* 初始化数据
*/
function init(){
var yjId = $(window.parent.document).find("input[id='taskSourceId']").attr("stationId");
// 渲染表格
table.render({
id: 'layui_table',
elem: '#table',
url: PATH_URL + '/lineProject/getLineProjectList',
where: {
'yjId': yjId
},
page: true, //开启分页
method:'post',