Commit f342d035 authored by 马奔奔's avatar 马奔奔

feature: 调整工程回弹数据详情

parent ff71e8ed
...@@ -92,15 +92,43 @@ ...@@ -92,15 +92,43 @@
<div id="popup-info" class="popup-info hidden"> <div id="popup-info" class="popup-info hidden">
<div class="head"></div> <div class="head"></div>
<div class="main"> <div class="tab">
</div>
<div class="main data-detail-main">
<div class="left-item" id="subrwList"> <div class="left-item" id="subrwList">
<div class="noData">暂无数据</div> <div class="noData">暂无数据</div>
</div> </div>
<div class="right-item right-item1"></div> <div class="right-item right-item1"></div>
<div class="right-item right-item2 hiddenImportant"></div> <div class="right-item right-item2 hiddenImportant"></div>
</div> </div>
<div class="hoverInfo hidden" id="hoverInfo"></div> <div id="test-location-main" class="test-location-main hidden"></div>
<div class="hoverInfo hidden" id="hoverInfo" onmouseover="detail.hoverInfoMouseover()"
onmouseout="detail.hoverInfoMouseout()"></div>
</div>
<div id="popup-info-change-list" class="popup-info hidden">
<div class="content">
<div class="table">
<table cellspacing="0">
<thead class="table-head">
<tr>
<th width="25%">修改人员</th>
<th width="25%">修改时间</th>
<th width="25%">修改前</th>
<th width="25%">修改后</th>
</tr>
</thead>
<tbody class="table-body">
</tbody>
</table>
</div>
</div>
</div> </div>
<div class="swiper hidden" id="swiper"> <div class="swiper hidden" id="swiper">
<div class="mask" onclick="detail.swiperHide()"></div> <div class="mask" onclick="detail.swiperHide()"></div>
<div class="main"> <div class="main">
......
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
} }
.popup-info .head { .popup-info .head {
height: .7rem; height: .5rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -326,9 +326,45 @@ ...@@ -326,9 +326,45 @@
font-size: .18rem; font-size: .18rem;
} }
.popup-info .tab {
width: 100%;
background: #113883;
padding: 0.15rem 0.5rem;
margin-bottom: 0.05rem;
}
.popup-info .tab .tabBox{
display: flex;
align-items: center;
color: #FFFFFF;
}
.popup-info .tab .tabBox >div{
margin-right: 0.68rem;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
}
.popup-info .tab .tabBox >div.actived{
color: #00FFFF;
}
.popup-info .tab .tabBox .actived::after{
display: block;
content: '';
width: 0.55rem;
height: 0.02rem;
background: #00FFFF;
position: relative;
top: 0.15rem;
}
.popup-info .main { .popup-info .main {
display: flex; display: flex;
height: calc(100% - .7rem); height: calc(100% - .97rem);
} }
.popup-info .main .left-item { .popup-info .main .left-item {
...@@ -702,10 +738,7 @@ ...@@ -702,10 +738,7 @@
.popup-info .main .right-item .info-item .bw-item .item { .popup-info .main .right-item .info-item .bw-item .item {
position: relative; position: relative;
background: #0D3177;
border: .01rem solid #90A1B1;
font-size: .18rem; font-size: .18rem;
color: #C0D3E6;
height: .8rem; height: .8rem;
width: calc(25% - .2rem); width: calc(25% - .2rem);
margin: .2rem .1rem 0; margin: .2rem .1rem 0;
...@@ -716,7 +749,28 @@ ...@@ -716,7 +749,28 @@
cursor: pointer; cursor: pointer;
} }
.popup-info .main .right-item .info-item .bw-item .item:hover { .popup-info .main .right-item .info-item .bw-item .item .icon-change{
width: 63px;
height: 46px;
position: absolute;
right: 0;
top: 0;
}
.popup-info .main .right-item .info-item .bw-item .common{
background: #0D3177;
border: .01rem solid #90A1B1;
color: #C0D3E6;
}
.popup-info .main .right-item .info-item .bw-item .fail{
background: rgba(147, 24, 24, .5);
border: .01rem solid #931818;
color: #E7555C;
}
.popup-info .main .right-item .info-item .bw-item .common:hover {
background: rgba(42, 210, 255, 0.2); background: rgba(42, 210, 255, 0.2);
border: .02rem solid #2AD2FF; border: .02rem solid #2AD2FF;
color: #2AD2FF; color: #2AD2FF;
...@@ -771,6 +825,68 @@ ...@@ -771,6 +825,68 @@
margin-bottom: .1rem; margin-bottom: .1rem;
} }
.popup-info .hoverInfo .modification{
border: .01rem solid #A76619;
color: #D99749;
cursor: pointer;
}
#popup-info-change-list .content{
box-sizing: border-box;
padding: 20px;
font-size: 18px;
height: calc(100% - .44rem);
}
#popup-info-change-list .content .table{
height: 100%;
overflow: auto;
}
#popup-info-change-list .content .table::-webkit-scrollbar{
width: 10px;
height: 10px;
}
#popup-info-change-list .content .table::-webkit-scrollbar-thumb{
background: rgba(0, 0, 0, 0.4);
border-radius: 8px;
}
#popup-info-change-list .content .table::-webkit-scrollbar-track{
background: rgba(42, 93, 197, 0.3);
border-radius: 8px;
}
#popup-info-change-list .content .table-head{
height: 50px;
color: #fff;
background: rgb(17, 56, 131);
position: sticky;
top: 0;
}
#popup-info-change-list .content .table-body tr{
height: 50px;
color: #fff;
}
#popup-info-change-list .content .table-body tr:nth-child(odd) {
background: rgba(17, 56, 131, .5);
}
#popup-info-change-list .content .table-body tr:nth-child(even) {
background: rgba(17, 56, 131, .7);
}
#popup-info-change-list .content .table-body td{
text-align: center;
}
.layui-layer-content { .layui-layer-content {
height: calc(100% - 42px) !important; height: calc(100% - 42px) !important;
} }
......
...@@ -12,7 +12,7 @@ var taskList = { ...@@ -12,7 +12,7 @@ var taskList = {
dataType: "json", dataType: "json",
data: { data: {
keywords: $("#rw-keywords").val(), keywords: $("#rw-keywords").val(),
date: $("#rw-date").val(), date:$("#rw-date").val(),
page: 1, page: 1,
limit: 100 limit: 100
}, },
...@@ -121,7 +121,7 @@ var testCount = { ...@@ -121,7 +121,7 @@ var testCount = {
}) })
}, },
setData: function (data) { setData: function (data) {
console.log(data)
$("#zjgc").html(data[0].today_project_count); $("#zjgc").html(data[0].today_project_count);
$("#ycgc").html(data[0].today_abnormal_project_count); $("#ycgc").html(data[0].today_abnormal_project_count);
$("#yjbw").html(data[0].today_test_count); $("#yjbw").html(data[0].today_test_count);
...@@ -138,7 +138,7 @@ var map = { ...@@ -138,7 +138,7 @@ var map = {
}; };
var district = new AMap.DistrictSearch(options); var district = new AMap.DistrictSearch(options);
district.search($("#province").html(), function (status, result) { district.search($("#province").html(), function (status, result) {
//district.search('河南省', function (status, result) { //district.search('河南省', function (status, result) {
var bounds = result.districtList[0]['boundaries']; var bounds = result.districtList[0]['boundaries'];
var mask = []; var mask = [];
for (var i = 0; i < bounds.length; i++) { for (var i = 0; i < bounds.length; i++) {
...@@ -167,8 +167,8 @@ var map = { ...@@ -167,8 +167,8 @@ var map = {
} }
//行政区查询 //行政区查询
district.setLevel('district') district.setLevel('district')
district.search($("#area").html(), function(status, result) { district.search($("#area").html(), function (status, result) {
//district.search('濮阳市', function (status, result) { //district.search('濮阳市', function (status, result) {
map.remove(polygons)//清除上次结果 map.remove(polygons)//清除上次结果
polygons = []; polygons = [];
var bounds = result.districtList[0].boundaries; var bounds = result.districtList[0].boundaries;
...@@ -243,7 +243,7 @@ var map = { ...@@ -243,7 +243,7 @@ var map = {
$("#rwList .item-head").click(function () { $("#rwList .item-head").click(function () {
var mapx = $(this).attr('data-mapx'); var mapx = $(this).attr('data-mapx');
var mapy = $(this).attr('data-mapy'); var mapy = $(this).attr('data-mapy');
if(Math.floor(mapx) ==0 && Math.floor(mapy) == 0){ if (Math.floor(mapx) == 0 && Math.floor(mapy) == 0) {
return false; return false;
} }
var index = Number($(this).attr('data-index')); var index = Number($(this).attr('data-index'));
...@@ -292,19 +292,25 @@ var detail = { ...@@ -292,19 +292,25 @@ var detail = {
project_id: '', project_id: '',
data: [], data: [],
ysjl_list: [], ysjl_list: [],
sample_id: '',
selectedTab:'detail', // detail=>数据详情 location=>检测定位
getData: function (project_id, sample_id, index, index2) { getData: function (project_id, sample_id, index, index2) {
let _this = this; let _this = this;
_this.project_id = project_id; _this.project_id = project_id;
_this.sample_id = sample_id;
$.ajax({ $.ajax({
url: baseURL_htjc + "GetTaskInfo.ashx", url: baseURL_htjc + "GetTaskInfo.ashx",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
project_id project_id,
date:$("#rw-date").val(),
}, },
success: function (data) { success: function (data) {
console.log(data,'getData');
if (data.data && data.data.length > 0) { if (data.data && data.data.length > 0) {
_this.setLeftData(data.data, sample_id, index, index2); _this.setLeftData(data.data, sample_id, index, index2);
_this.setTab();
} else { } else {
$("#subrwList").html('<div class="noData">暂无数据</div>'); $("#subrwList").html('<div class="noData">暂无数据</div>');
} }
...@@ -314,6 +320,31 @@ var detail = { ...@@ -314,6 +320,31 @@ var detail = {
console.log("发生错误:" + jqXHR.status); console.log("发生错误:" + jqXHR.status);
} }
}) })
},
setTab(){
let str = (`
<div class="tabBox">
<div class="data-detail ${this.selectedTab==='detail'?'actived':''}" onclick="detail.changeTab('data-detail')" >数据详情</div>
<div class="test-location ${this.selectedTab==='location'?'actived':''}" onclick="detail.changeTab('test-location')" >检测定位</div>
</div
`)
$("#popup-info .tab").html(str);
},
changeTab(val){
console.log(val);
this.selectedTab = val
$('.tabBox').children().removeClass('actived')
$(`.tabBox .${val}`).addClass('actived')
$(`#popup-info .data-detail-main`).addClass('hiddenImportant')
$(`#popup-info .test-location-main`).addClass('hiddenImportant')
$(`#popup-info .${val}-main`).removeClass('hiddenImportant')
}, },
setLeftData: function (data, sample_id, aindex, aindex2) { setLeftData: function (data, sample_id, aindex, aindex2) {
this.data = data; this.data = data;
...@@ -345,17 +376,20 @@ var detail = { ...@@ -345,17 +376,20 @@ var detail = {
`; `;
} }
$("#popup-info .left-item").html(str); $("#popup-info .left-item").html(str);
if(sample_id){ if (sample_id) {
detail.getsubRightData(sample_id, aindex, aindex2); detail.getsubRightData(sample_id, aindex, aindex2);
sublistClick('subrwInfo-'+aindex); sublistClick('subrwInfo-' + aindex);
let item = this.data[0];
$("#popup-info .head").html(`${item.project_no ? '【' + item.project_no + '】' : ''}${item.project_name}`);
this.showPopup(); this.showPopup();
}else{ } else {
this.setRightData(0, 'subrwInfo-0'); this.setRightData(0, 'subrwInfo-0');
this.showPopup(); this.showPopup();
} }
}, },
setRightData(index, id) { setRightData(index, id) {
sublistClick(id); sublistClick(id);
console.log(this.data,'this.data');
var item = this.data[index]; var item = this.data[index];
$("#subrwList .info-item").removeClass("active"); $("#subrwList .info-item").removeClass("active");
$("#subrwList .flex-item").removeClass("active"); $("#subrwList .flex-item").removeClass("active");
...@@ -368,7 +402,7 @@ var detail = { ...@@ -368,7 +402,7 @@ var detail = {
${item.report_file && `<div class="flex-item"><div class="value">回弹文件:<a href="${item.report_file}" style="color:#C0D3E6">点击查看</a></div></div>` ${item.report_file && `<div class="flex-item"><div class="value">回弹文件:<a href="${item.report_file}" style="color:#C0D3E6">点击查看</a></div></div>`
} }
<div class="flex-item flex-item2 over-flex"> <div class="flex-item flex-item2 over-flex">
${item.faceimg_list&&item.faceimg_list.length>0 ? item.faceimg_list.map((item2) => { ${item.faceimg_list && item.faceimg_list.length > 0 ? item.faceimg_list.map((item2) => {
return (` return (`
<div class="box"> <div class="box">
<div class="img"> <div class="img">
...@@ -381,7 +415,7 @@ var detail = { ...@@ -381,7 +415,7 @@ var detail = {
</div> </div>
`); `);
}).join('') }).join('')
: '' } : ''}
</div> </div>
</div> </div>
<div class="main-item"> <div class="main-item">
...@@ -438,8 +472,8 @@ var detail = { ...@@ -438,8 +472,8 @@ var detail = {
}) })
}, },
setsubRightData(index, index2, data) { setsubRightData(index, index2, data) {
console.log(index, index2);
console.log(data); console.log(data, 'data');
$("#subrwList .info-item").removeClass("active"); $("#subrwList .info-item").removeClass("active");
$("#subrwList .flex-item").removeClass("active"); $("#subrwList .flex-item").removeClass("active");
$("#subrwList .info-item:nth-child(" + (Number(index) + 1) + ") .flex-item:nth-child(" + (Number(index2) + 1) + ")").addClass("active"); $("#subrwList .info-item:nth-child(" + (Number(index) + 1) + ") .flex-item:nth-child(" + (Number(index2) + 1) + ")").addClass("active");
...@@ -456,7 +490,9 @@ var detail = { ...@@ -456,7 +490,9 @@ var detail = {
${item.test_status == 1 && item.ysjl_list && item.ysjl_list.length > 0 ? ${item.test_status == 1 && item.ysjl_list && item.ysjl_list.length > 0 ?
item.ysjl_list.map((item2, index2) => { item.ysjl_list.map((item2, index2) => {
return (` return (`
<div class="item" onmouseover="mouseover(${index2}, event)" onmouseout="mouseout()">${item2.jc_data21}</div> <div class="item ${item2.test_status == '1' ? 'common' : 'fail'}" onmouseover="mouseover(${index2}, event)" onmouseout="mouseout()">${item2.jc_data21}
${item2.is_change > 0 ? '<img class="icon-change" src="../static/images/icon-change.png" />' : ''}
</div>
`); `);
}).join('') }).join('')
: '<div class="noData">暂无数据</div>' : '<div class="noData">暂无数据</div>'
...@@ -466,7 +502,7 @@ var detail = { ...@@ -466,7 +502,7 @@ var detail = {
</div> </div>
`); `);
}, },
listgetsubRightData: function(project_id, sample_id, index, index2){ listgetsubRightData: function (project_id, sample_id, index, index2) {
detail.getData(project_id, sample_id, index, index2); detail.getData(project_id, sample_id, index, index2);
}, },
showPopup: function () { showPopup: function () {
...@@ -481,6 +517,76 @@ var detail = { ...@@ -481,6 +517,76 @@ var detail = {
$("#popup-info").css('display', 'none'); $("#popup-info").css('display', 'none');
} }
}); });
},
showPopupChangeList: function (sample_id, jc_data26, group_no, index, val) {
$("#popup-info-change-list .content .table .table-body").html('');
$.ajax({
url: baseURL_htjc + `GetChangeList.ashx?sample_id=${sample_id}&jc_data26=${jc_data26}&group_no=${group_no}&index=${index}`,
type: "get",
dataType: "json",
success: function (data) {
if (data.data.length) {
let arr = data.data
for (let i = 0; i < arr.length; i++) {
if (i === arr.length - 1) {
arr[i].newVal = val
break
}
arr[i].newVal = arr[i + 1].jc_data
}
$("#popup-info-change-list .content .table .table-body").append(`
${arr.map(item => {
return (`
<tr>
<td width="25%">${item.update_opname}</td>
<td width="25%">${item.update_time}</td>
<td width="25%">${item.jc_data}</td>
<td width="25%">${item.newVal}</td>
</tr>
`)
}).join('')
}
`);
}
},
error: function (jqXHR) {
console.log("发生错误:" + jqXHR.status);
}
})
layer.open({
type: 1,
shadeClose: true,
maxmin: true,
title: "<p class='popup-title'>数据修改详情</p>",
area: ['10rem', '70%'],
content: $('#popup-info-change-list'),
end: function () {
$("#popup-info-change-list").css('display', 'none');
}
});
}, },
imgView(index, index2, index3) { imgView(index, index2, index3) {
var arr = this.data[index].flow_list[index2].file_list; var arr = this.data[index].flow_list[index2].file_list;
...@@ -501,24 +607,43 @@ var detail = { ...@@ -501,24 +607,43 @@ var detail = {
}, },
swiperHide() { swiperHide() {
$("#swiper").addClass("hidden"); $("#swiper").addClass("hidden");
},
hoverInfoMouseover() {
clearTimeout(hoverInfoTime)
},
hoverInfoMouseout() {
mouseout()
} }
} }
var hoverInfoTime;
var isHoverInfoModal; // 弹窗是否正在显示
function mouseover(index, e) { function mouseover(index, e) {
if (isHoverInfoModal) {
return
}
var arr = []; var arr = [];
let notArr = ['jc_data21', 'test_status', 'change_list', 'group_no', 'is_change', 'jc_data26']
for (i in detail.ysjl_list[index]) { for (i in detail.ysjl_list[index]) {
if (i != 'jc_data21' && i != 'test_status') { if (!notArr.includes(i)) {
arr.push(detail.ysjl_list[index][i]); arr.push(detail.ysjl_list[index][i]);
} }
} }
$("#hoverInfo").html(` $("#hoverInfo").html(`
${arr.map(item2 => { ${arr.map((item2, index2) => {
let bool = detail.ysjl_list[index].change_list[0][`is_change${index2 + 1}`] > 0
return (` return (`
<div>${item2}</div> <div onClick="detail.showPopupChangeList('${detail.sample_id}', '${detail.ysjl_list[index].jc_data26}','${detail.ysjl_list[index].group_no}','${index2 + 1}','${item2}')" class="${bool ? 'modification' : ''}">${item2}</div>
`); `);
}).join('') }).join('')
} }
`); `);
isHoverInfoModal = true
setTimeout(() => { setTimeout(() => {
var divW = $("#hoverInfo").width(); var divW = $("#hoverInfo").width();
var screenW = $(window).width(); var screenW = $(window).width();
...@@ -527,11 +652,14 @@ function mouseover(index, e) { ...@@ -527,11 +652,14 @@ function mouseover(index, e) {
} else { } else {
$("#hoverInfo").css("left", e.clientX + 10 + 'px').css("right", 'auto').css("top", e.clientY + 10 + 'px').removeClass("hidden"); $("#hoverInfo").css("left", e.clientX + 10 + 'px').css("right", 'auto').css("top", e.clientY + 10 + 'px').removeClass("hidden");
} }
}, 50); }, 50);
} }
function mouseout() { function mouseout() {
setTimeout(() => {
hoverInfoTime = setTimeout(() => {
$("#hoverInfo").addClass("hidden").css("left", 0).css("right", 0).css("top", 0); $("#hoverInfo").addClass("hidden").css("left", 0).css("right", 0).css("top", 0);
isHoverInfoModal = false
}, 50); }, 50);
} }
...@@ -572,7 +700,7 @@ function init() { ...@@ -572,7 +700,7 @@ function init() {
var laydate = layui.laydate; var laydate = layui.laydate;
laydateObj = laydate.render({ laydateObj = laydate.render({
elem: '#rw-date' elem: '#rw-date'
, value: getNextDate(dateFormat('YYYY-mm-dd', new Date()), 0) , value: ''
, done: function () { , done: function () {
taskList.init(); taskList.init();
} }
...@@ -602,15 +730,15 @@ function init() { ...@@ -602,15 +730,15 @@ function init() {
dataType: "json", dataType: "json",
data: finalData, data: finalData,
success: function (data) { success: function (data) {
console.log(data)
if(data.status == 200){ if (data.status == 200) {
layer.msg('已录入', {icon: 0}, function(){}); layer.msg('已录入', { icon: 0 }, function () { });
setTimeout(() => { setTimeout(() => {
layer.closeAll(); layer.closeAll();
}, 1000); }, 1000);
}else{ } else {
layer.msg(data.msg, {icon: 0}, function(){}); layer.msg(data.msg, { icon: 0 }, function () { });
} }
}, },
error: function (jqXHR) { error: function (jqXHR) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment