加盛开

This commit is contained in:
skjia 2024-08-26 09:00:01 +08:00
parent 123157a7d2
commit 712f539ae7
21 changed files with 822 additions and 131 deletions

View File

@ -38,17 +38,17 @@
<div class="form-group" style="margin-top: 0.5%">
<div class="layui-inline">
<div class="layui-input-inline">
<input id="userName" type="text" class="layui-input" placeholder="人员姓名" >
<input id="userName" name="userName" type="text" class="layui-input" placeholder="人员姓名" >
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<input id="proName" type="text" class="layui-input" placeholder="工程名称" >
<input id="proName" name="proName" type="text" class="layui-input" placeholder="工程名称" >
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<input id="yjName" type="text" class="layui-input" placeholder="工作站名称" >
<input id="yjName" name="yjName" type="text" class="layui-input" placeholder="工作站名称" >
</div>
</div>
<div class="layui-inline">

View File

@ -48,8 +48,8 @@
let player = document.querySelector('#myVideo');
//测试用
player.src = 'http://192.168.0.14:1909/file/ynRealName/zys_cs/mp4.mp4';
//player.src = fileUrl + '/' + filePath;
// player.src = 'http://192.168.0.14:1909/file/ynRealName/zys_cs/mp4.mp4';
player.src = filePath;
player.play();
// 获取视频元素

View File

@ -242,7 +242,7 @@
</label>
<div class="layui-input-inline">
<textarea id="gtName" name="gtName" class="layui-textarea layui-input-inline"
placeholder="请填写范围、基数" style="width: 425px;max-height: 200px;" lay-verify="required" maxlength="500"></textarea>
placeholder="请填写范围、基数" style="width: 425px;max-height: 200px;" maxlength="500"></textarea>
</div>
</div>
</div>
@ -309,6 +309,10 @@
<button type="button" style="margin-left: 2%;" class="layui-btn layui-btn-primary" id="contractFile">
<i class="layui-icon">&#xe67c;</i>上传附件
</button>
<blockquote id="preview1" class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
预览图:
<div class="layui-upload-list" id="demo1"></div>
</blockquote>
</div>
</div>
</div>

View File

@ -2,14 +2,15 @@
<html>
<head>
<meta charset="utf-8">
<title>护线员考勤</title>
<title>导入</title>
<script src="../../../plugs/jquery/jquery-3.6.0.min.js"></script>
<script src="../../../js/public/jq.js"></script>
<script src="../../../js/public/public.js"></script>
<script src="../../../js/public/public_utils.js"></script>
<script src="../../../js/public/aescbc.js"></script>
<script src="../../../plugs/jquery/jquery-3.6.0.min.js"></script>
<script src="../../../plugs/layui-v2.9.2/layui/layui.js"></script>
<link href="../../../plugs/layui-v2.9.2/layui/css/layui.css" rel="stylesheet">
<script src="../../../util/Interceptor.js"></script>
<!-- <script src="../../../util/Interceptor.js"></script> -->
<!--业务js-->
<script src="../../../js/wireManager/staff/staffImport.js"></script>
<!-- css -->
@ -22,21 +23,28 @@
</div>
<div class="layui-form-item">
</div>
<div>
<img src="../../../../image/down.jpg" height="100%">
<div style="margin-top: 1.5%;">
<img src="../../../image/down.jpg" height="100%">
<div style="color: #333333;font-size: 16px;margin-top: 2%;">填写导入数据信息</div>
<div style="color: #999999;margin-top: 0.6%;">请按照数据模板的格式准备导入数据,模板中的表头名称不可更改,表头行不能删除。</div>
<div style="margin-top: 1%;">
<a id="tempId" href="../../../../downloads/导入模版.xlsx" download="导入模版.xlsx" style="color: #409EFF;">下载模板</a>
<a id="tempId" href="../../../templateDown/人员信息.xlsx" download="人员信息.xlsx" style="color: #409EFF;">下载模板</a>
</div>
</div>
<div class="layui-upload" style="margin-top: 1.5%;">
<img src="../../../../image/up.jpg" height="100%">
<img src="../../../image/up.jpg" height="100%">
<div style="color: #333333;font-size: 16px;margin-top: 2%;"><span style="color: red">*</span>上传填好的信息表</div>
<div style="color: #999999;margin-top: 0.6%;">文件后缀名必须为xls或xlsx即Excel格式文件大小不得大于10M</div>
<input style="margin-left: 30px;margin-top: 10px;" type="file" accept=".xls,.xlsx" id="file" name="file">
</div>
<div style="margin-top: 1.5%;background-color: #FFF5E6;border-radius: 5px;height: 16%;display: flex;align-items: center;">
<img src="../../../image/exclamationMark.png" width="40" height="40" style="border: none; margin-left: 2%;"/>
<div style="margin-left: 2%;">
<div style="color:#666666">特别提示</div>
<div style="color:#999999;font-size: 12px;margin-top:2%">导入过程中请确保工程名称、杆塔名称与系统工程名称、杆塔名称一致性</div>
</div>
</div>
<button id="closeBt" class="layui-btn layui-btn-primary layui-border-blue" style="position: fixed;left: 9%;top: 80%;background-color: #ffffff">取消</button>
<button id="searchBt" class="layui-btn" lay-submit lay-filter="formDemo" style="position: fixed;left: 90%;top: 80%;">保存</button>
</form>

View File

@ -67,7 +67,7 @@
</div>
</div>
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="query">
<button class="layui-btn layui-btn-sm layui-btn-normal" id="query" lay-submit lay-filter="query">
<i class="layui-icon layui-icon-search"></i>
查询
</button>
@ -77,8 +77,9 @@
</button>
<button class="layui-btn layui-btn-sm layui-btn-normal" onclick="add()">
<i class="layui-icon">&#xe608;</i>新增人员</button>
<!-- <button id="importBt" class="layui-btn layui-btn-sm" onclick="importData()"> -->
<!-- <i class="layui-icon">&#xe67c;</i>导入</button> -->
<button id="importBt" class="layui-btn layui-btn-sm"
onclick="importData()">
<i class="layui-icon">&#xe67c;</i>导入</button>
<button id="exportBt" class="layui-btn layui-btn-sm" onclick="exportData()">
<i class="layui-icon">&#xe67c;</i>导出</button>
</div>

View File

@ -33,7 +33,7 @@
<input type="hidden" id="makeType" name="makeType">
<input type="hidden" id="proId" name="proId">
<label class="layui-form-label" style="width:220px;">
<i class="tip-required" style="color: red;font-size: 20px">*</i>考勤照片(可多个):</label>
<i class="tip-required" style="color: red;font-size: 20px">*</i>考勤照片:</label>
<div class="layui-input-inline" style="width: 610px;">
<div class="layui-upload">
<blockquote id="preview" class="layui-elem-quote layui-quote-nm " style="margin-top: 10px;width: 94%;min-height: 150px;display: flex;">

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>特巡结果上传</title>
<script src="../../../js/public/public.js"></script>
<script src="../../../js/public/public_utils.js"></script>
<script src="../../../js/public/aescbc.js"></script>
<script src="../../../plugs/jquery/jquery-3.6.0.min.js"></script>
<script src="../../../plugs/layui-v2.9.2/layui/layui.js"></script>
<link href="../../../plugs/layui-v2.9.2/layui/css/layui.css" rel="stylesheet">
<!-- <script src="../../../util/Interceptor.js"></script> -->
<script src="../../../js/wireManager/viewResult/uploadSpecialPhoto.js"></script>
<style type="text/css">
.layui-form-label {
width: 210px;
}
button{
margin-left: 73.5%;
margin-top: 1%;
}
</style>
</head>
<body>
<div class="layui-form" onsubmit="return false">
<form class="layui-form" action="">
<div class="layui-form-item" style="margin-top: 5%;">
<div class="layui-inline">
<input type="hidden" id="gtId" name="gtId">
<input type="hidden" id="month" name="month">
<input type="hidden" id="numTimes" name="numTimes">
<input type="hidden" id="userId" name="userId">
<input type="hidden" id="makeType" name="makeType">
<input type="hidden" id="proId" name="proId">
<label class="layui-form-label" style="width:220px;">
<i class="tip-required" style="color: red;font-size: 20px">*</i>考勤照片:</label>
<div class="layui-input-inline" style="width: 610px;">
<div class="layui-upload">
<blockquote id="preview" class="layui-elem-quote layui-quote-nm " style="margin-top: 10px;width: 94%;min-height: 150px;display: flex;">
<div class="layui-upload-list" id="demo" style="float: left"></div>
<img src="../../../image/add.png" id="test" style="width: 80px;height: 80px;margin-top: 18px">
</blockquote>
<button id="hideUpload" style=""></button>
</div>
</div>
</div>
</div>
<button id="resetBt" class="layui-btn layui-btn-primary layui-border-blue">取消</button>
<button id="searchBt" class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
</form>
</div>
</body>
</html>

View File

@ -246,7 +246,7 @@
<div id="otherNum">--</div>
</div>
<div>
<button type="button" class="layui-btn layui-bg-blue" onclick="normalInspectionUpload()">正常巡视照片导入</button>
<button type="button" id="normalInspectionUpload" class="layui-btn layui-bg-blue" onclick="normalInspectionUpload()">正常巡视照片导入</button>
<button type="button" class="layui-btn layui-bg-orange" onclick="specialPatrolAdd()">新增特巡结果</button>
</div>
<input type="text" class="layui-input" readonly placeholder="月份" id="month" style="border: none;" autocomplete="off">

View File

@ -27,6 +27,8 @@ layui.use(['form','layer','table','laydate','element'], function () {
$("#queryBt").click(function(){
var keyword = $('#keyword').val();
let json = {
proId:localStorage.getItem("resultVisaProId"),
makeMonth:localStorage.getItem("resultVisaMakeMonth"),orders:orders,
"keyword": keyword
}
// 对表格进行重载。id 即 table表格的id
@ -47,6 +49,8 @@ layui.use(['form','layer','table','laydate','element'], function () {
orders=" order by state desc"
}else if(data.value==3){
orders=" order by state asc"
}else{
orders="";
}
});
@ -55,6 +59,8 @@ layui.use(['form','layer','table','laydate','element'], function () {
$("#reset").click(function(){
$('#keyword').val('');
let json = {
proId:localStorage.getItem("resultVisaProId"),
makeMonth:localStorage.getItem("resultVisaMakeMonth"),orders:orders,
"keyword": ''
}
// 对表格进行重载。id 即 table表格的id

View File

@ -70,14 +70,18 @@ layui.use(['element','layer','transfer', 'form', 'upload','laydate','tree'], fun
chosenum=1;
//预读本地文件,如果是多文件,则会遍历。(不支持ie8/9)
obj.preview(function(index, file, result){
console.log(index); //得到文件索引
console.log(file); //得到文件对象
console.log(result); //得到文件base64编码比如图片
//这里还可以做一些 append 文件列表 DOM 的操作
//obj.upload(index, file); //对上传失败的单个文件重新上传,一般在某个事件中使用
//delete files[index]; //删除列表中对应的文件,一般在某个事件中使用
var length = $('#demo1 img').length;
if (length > 2) {
delete files[index];//删除指定图片
$(this).remove();
return layer.msg("附件为1-3张请勿过多上传", {icon: 5});
}
$('#demo1').append('<img src="' + result + '" id="' + index + '" alt="' + file.name + '" style="height: 80px;width: 80px;margin-right: 10px" class="layui-upload-img ">');
$('#' + index).bind('dblclick', function () {//双击删除指定预上传图片
delete files[index];//删除指定图片
$(this).remove();
});
var imgNum = $("#demo1 img").length;
});
},
before: function (obj) {
@ -248,6 +252,14 @@ layui.use(['element','layer','transfer', 'form', 'upload','laydate','tree'], fun
layer.msg("请上传附件!")
return;
}
var usertype=$("#userType").val();
if(usertype==0){
var gtid=$("#gtId").val();
if(gtid==null||gtid==""){
layer.msg("请选择范围、基数!")
return;
}
}
$("#hideUpload1").trigger("click");
}else{
updateData(data); // 修改

View File

@ -1,9 +1,7 @@
var idNumber;
var loadingMsg;
var trainFileNames = [];
var trainFilePaths = [];
var examFileNames = [];
var examFilePaths = [];
var parentValue;
layui.use(['layer', 'form', 'upload'], function () {
var upload1 = layui.upload;
@ -11,8 +9,6 @@ layui.use(['layer', 'form', 'upload'], function () {
var form = layui.form;
var layer = layui.layer;
getProjectSelect();
$("#closeBt").click(function () {
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
@ -25,63 +21,52 @@ layui.use(['layer', 'form', 'upload'], function () {
return
}
$("#hideUpload1").trigger("click");
excelUpload();
});
});
function setParam(data){
parentValue = data;
}
function importData() {
var fileData = new FormData();
fileData.append('file', $('#file')[0].files[0]);
// 加载提示
loadingMsg = top.layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0, shade: [0.8, '#393D49']});
// form请求地址
var formUrl = oiPlanUrl + "/monthlyPlanSubmission/importData";
$.ajax({
type: 'POST',
url: formUrl, // 请求地址
data: fileData,
processData: false,
contentType: false,
success: function (data) {
top.layer.close(loadingMsg); //再执行关闭
if (data.code == 200) {
top.layer.alert(data.msg);
reloading();
/**
* 下拉框set值
*/
function setOption(id,resultObj,html) {
for (let i = 0; i < resultObj.length; i++) {
if (id == resultObj[i].id) {
html += '<option selected value=\'' + resultObj[i].id + '\'>' + resultObj[i].name + '</option>';
} else {
top.layer.alert(data.msg, {icon: 2});
html += '<option value=\'' + resultObj[i].id + '\'>' + resultObj[i].name + '</option>';
}
},
error: function (XMLHttpRequest, textStatus, e) {
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
top.layer.close(addLoadingMsg); //再执行关闭
}
});
return html;
}
function excelUpload() {
loadingMsg = top.layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0, shade: [0.8, '#393D49']}); //④创建一个formData对象
loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0, shade: [0.8, '#393D49']}); //④创建一个formData对象
var fileData = new FormData();
fileData.append('file', $('#file')[0].files[0]);
$.ajax({
url : oiPlanUrl + "/monthlyPlanSubmission/importData",
url : PATH_URL + "/personbase/importData",
type : 'POST',
data : fileData,
processData : false,// ⑧告诉jQuery不要去处理发送的数据
contentType : false, // ⑨告诉jQuery不要去设置Content-Type请求头
success : function(result) {
console.log(result)
top.layer.close(loadingMsg);
if (result.data.success) {
layer.msg(result.data.msg,{icon:1,time:1500},function () {
// reloadData();
reloading();
});
layer.close(loadingMsg);
if (result.code == 200) {
parent.document.getElementById('powerNum').innerText = result.data.powerNum;
parent.layer.alert(result.msg,{icon:1});
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
} else {
showModal(result.data);
layer.alert(result.msg,{icon:2});
}
},
error : function(XMLHttpRequest, textStatus, errorThrown,result) {
@ -124,6 +109,35 @@ function showModal(result) {
}, 1000);
}
//初始化工程下拉选
function getProSelect(subId,proId) {
$("#proId").empty();
$.ajax({
type: 'get',
url: systemPath + '/select/getProBySubId',
data: {
subId: subId
},
async: false,
success: function (data) {
console.log("获取工程下拉列表OK");
if(data.code == 200){
let html = '<option value="">--请选择工程--</option>';
let resultObj = data.data;
let htm = setOption(proId,resultObj,html);
$("#proId").html(htm);
}else{
$("#proId").html('<option value="">--无数据--</option>');
}
layui.form.render();
},
error: function (err) {
console.log("获取工程下拉列表出错:", err);
}
});
}
//刷新页面
function reloading() {
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引

View File

@ -253,7 +253,6 @@ function updateView(id) {
* 删除
* */
function delView(id) {
let index = layer.confirm("是否确定删除数据?相关数据也会删除!", function () {
$.ajax({
type: 'post',
@ -265,8 +264,8 @@ function delView(id) {
success: function (data) {
layer.close(index);
if (data.code == 200) {
top.layer.alert('删除成功', {icon: 1});
// example.ajax.reload(); // 刷新页面
layer.msg('删除成功');
$("#query").trigger("click"); // 刷新页面
} else {
layer.msg("删除失败", {icon: 2}, function () {
// example.ajax.reload(); // 刷新页面
@ -300,34 +299,6 @@ function importData(){
});
}
function importDataThread(formData, idx) {
$.ajax({
url: oiPlanUrl + "/basePerson/importData",
type: 'POST',
async: false,
data: formData,
timeout: 20000,
// 告诉jQuery不要去处理发送的数据
processData: false,
// 告诉jQuery不要去设置Content-Type请求头
contentType: false,
success: function (data) {
layer.close(idx);
if (data.code == 200) {
layer.alert(data.data, {icon: 1});
// example.ajax.reload(); // 刷新页面
} else{
layer.alert(data.msg, {icon: 2});
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log(JSON.stringify(errorThrown));
layer.close(idx);
}
});
$("#basePersonFile").val("");
}
//导出
function exportData() {
@ -343,3 +314,46 @@ function exportData() {
+ "&contractState=" + contractState
+ "&yjId=" + yjId
}
function excelUpload() {
if($("#projecct").val() == ""){
layer.msg("请选择工程", { icon: 0 });
return
}
loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0, shade: [0.8, '#393D49']}); //④创建一个formData对象
var fileData = new FormData();
fileData.append('file', $('#file')[0].files[0]);
fileData.append('proId', $("#projecct").val());
$.ajax({
url : PATH_URL + "/lineProject/importData",
type : 'POST',
data : fileData,
processData : false,// ⑧告诉jQuery不要去处理发送的数据
contentType : false, // ⑨告诉jQuery不要去设置Content-Type请求头
success : function(result) {
console.log(result)
layer.close(loadingMsg);
if (result.code == 200) {
parent.document.getElementById('powerNum').innerText = result.data.powerNum;
parent.layer.alert(result.msg,{icon:1});
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
} else {
layer.alert(result.msg,{icon:2});
}
},
error : function(XMLHttpRequest, textStatus, errorThrown,result) {
top.layer.close(loadingMsg);
if(XMLHttpRequest.status === 401){
localStorage.removeItem("token");
layer.msg('用户登录过期,请重新登录',{icon:5,time:2000},function(){
location.href = ctxPath + '/login.html';
});
}else{
layer.msg(result.data.msg,{icon:5,time:2000});
}
// $.dialog({title: '提示', content: result.msg});
}
});
}

View File

@ -126,7 +126,7 @@ function firstDayStr(){
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDay = new Date(year, thisMonth, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天
@ -142,7 +142,7 @@ function lastDayStr(){
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDay = new Date(year, thisMonth, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天

View File

@ -39,7 +39,9 @@ layui.use(['form', 'table', 'upload', 'laydate'], function () {
})
form.on('submit(formDemo)', function (data) {
$("#hideUpload").trigger("click");
console.log(data)
checkGt(data.field.gtId);
// $("#hideUpload").trigger("click");
});
form.on('select(proId)', function(data){
console.log(data);
@ -47,13 +49,34 @@ layui.use(['form', 'table', 'upload', 'laydate'], function () {
})
});
function checkGt(gtid){
$.ajax({//id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/checkGt",
dataType: 'json',
async:false,
data: {
gtid:gtid,makeTime:$("#dataTime").val()
},
success: function (res) {
if(res.code==200){
$("#hideUpload").trigger("click");
}else{
layer.msg("该杆塔已被巡视!");
}
},
error:function(e){
layer.msg("该杆塔已被巡视!");
}
})
}
function firstDayStr(){
var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDay = new Date(year, thisMonth, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天

View File

@ -30,7 +30,7 @@ function firstDayStr(){
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDay = new Date(year, thisMonth, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天
@ -46,7 +46,7 @@ function lastDayStr(){
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDay = new Date(year, thisMonth, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天

View File

@ -23,6 +23,9 @@ layui.use(['form', 'table', 'upload'], function () {
uploadFile();
form.on('submit(formDemo)', function (data) {
if(urls.length==0){
layer.msg("请上传文件!")
}
$("#hideUpload").trigger("click");
});
});
@ -61,7 +64,7 @@ function uploadFile(){
console.log(index); //得到文件索引
console.log(file.name); //得到文件对象
var files = $('#demo img')
if(files.length <= 2){
if(files.length <= 1){
$('#demo').append(
'<div id="prove_' + index + '" style="display: inline-block">' +
'<div class="item">' +
@ -74,7 +77,7 @@ function uploadFile(){
'</div>'
);
}else{
layer.msg('最多上传2张照片',{icon:2})
layer.msg('最多上传1张照片',{icon:2})
}
addDelete(startWorkFiles);
});

View File

@ -0,0 +1,179 @@
//全局的页面遮盖
let loadingMsg;
var startWorkFiles = {};
var upload;
var id;
var formData;
var gtId;
var month;
var numTimes;
var userId;
var makeType;
var proId;
layui.use(['form', 'table', 'upload'], function () {
let form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
form.render();
upload = layui.upload;
gtId=$("#gtId").val();
month=$("#month").val();
numTimes=$("#numTimes").val();
userId=$("#userId").val();
makeType=$("#makeType").val();
proId=$("#proId").val();
uploadFile();
form.on('submit(formDemo)', function (data) {
if(urls.length==0){
layer.msg("请上传文件!")
}
$("#hideUpload").trigger("click");
});
});
function setGtId(gtId,month,numTimes,resultUserId,makeType,proId){
console.log(gtId,"gtId");
console.log(month,"month");
$("#gtId").val(gtId);
$("#month").val(month);
$("#numTimes").val(numTimes);
$("#userId").val(resultUserId);
$("#makeType").val(makeType);
$("#proId").val(proId);
}
var ysUrls="";
var urls="";
function uploadFile(){
var uploadcom = upload.render({
elem: '#test',
url: FILE_URL + "/file/uploadmake" , //上传接口 //改成您自己的上传接口
multiple: true, //是否允许多文件上传默认未false
dataType: "json",
exts: 'jpg|png|mp4',
//acceptMime: 'image/jpg,image/png,image/jpeg,file/pdf,file/xlsx',
auto: false, //是否自动上传 默认为true
number: 1, //最大上传数量
// size: 1024*5, //最大文件大小单位k
bindAction: '#hideUpload', //绑定的按钮
field: 'file', //传到后台的字段名,默认file
choose: function (obj) {
flag = false;
var suffixType = ''; //后缀类型
uploadcom.config.elem.next()[0].value = '';
obj.files = obj.pushFile();
startWorkFiles = obj.pushFile();
obj.preview(function (index, file, result) {
console.log(index); //得到文件索引
console.log(file.name); //得到文件对象
var files = $('#demo img')
if(files.length <= 1){
$('#demo').append(
'<div id="prove_' + index + '" style="display: inline-block">' +
'<div class="item">' +
'<div class="handle" style="margin-top: -28px" data-idx="prove_' + index + '">' +
'<i class="layui-icon layui-icon-delete" style="position: relative;top: 30px;left: 72px; font-size: 20px;color: red" data-idx="prove_' + index + '" ></i>' +
'</div>' +
'<img src="' + result + '" alt="' + file.name + '" title="' + file.name + '" data-index="prove_' + index + '" data-name="' + file.name + '" style="height: 100px;width: 100px;margin-right: 10px" class="layui-upload-img ">' +
'<div><span>' + (file.name.length > 8 ? (file.name.substr(0, 8) + "..") : file.name) + '</span></div>' +
'</div>'+
'</div>'
);
}else{
layer.msg('最多上传1张照片',{icon:2})
}
addDelete(startWorkFiles);
});
},
before: function (obj) {
ysUrls="";
urls="";
this.data = {
"gtId": gtId,uploadType:"one",photoType:"hxy",month:month,numTimes:numTimes
};
},
done: function (data) {
console.log(data,"donedata");
urls=data.data.url;
ysUrls=data.data.ysUrl;
},
allDone: function (data) {
console.log(data,"allDonedata");
if(ysUrls!=null&&urls!=null){
insertMakeGt();
var iframeWindow = parent.window['layui-layer-iframe' + localStorage.getItem("resultindex")];
iframeWindow.reloadData();
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index);
}else{
layer.msg("上传错误!")
}
},
error: function (e) {
//请求异常回调
console.log(e)
}
});
}
function insertMakeGt(){
if(ysUrls.length == 0){
layer.msg('请上传文件', {icon: 2});
return;
}
$.ajax({
type:"post",
url : PATH_URL + "/makeInfo/insertMakeGt",
async:false,
data:{
"gtId": $("#gtId").val(),
userId:userId,
makeMonth:month,
sFilePath:ysUrls,
filePath:urls,makeType:3,proId:proId,
numTimes:numTimes
},
dataType:"json",
success:function(res){
console.log(res,"res")
if(res.code==500){
parent.layer.msg(res.msg)
return;
}
},
error:function(data){
}
});
}
var deletePhoto = [];
function delPhoto(i,id) {
var parentcolor = document.getElementById("demo" + i);
var childcolor = document.getElementById(id + "");
var path = childcolor.name;
deletePhoto.push(path);
parentcolor.removeChild(childcolor);
var photoNum = $("#demo" + i).children().length;
if (photoNum == 0) {
$("#preview" + i).css("display", "none");
}
}
function addDelete(arr) {
$('#demo').click(function (e) {
var target = $(e.target)
if (target.hasClass('handle') || target.hasClass('layui-icon')) {
var dataIdx = target.attr('data-idx')
var filePath = $('#' + dataIdx).children().children().next().attr('file')
delete arr[dataIdx]; // 通过获取绑定在标签上的index删除files对象中对应的key属性即可
target.parents('.item').remove() // 页面文件标签也删除
}
});
}
//设置弹窗关闭
function reloading() {
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
window.parent.location.reload();
}

View File

@ -16,6 +16,8 @@ layui.use(['form','layer','table','laydate'], function () {
// 触发submit提交 按钮点击或者表单被执行提交时触发
form.on('submit(query)', function (data) {
console.log(data,"搜索")
yjId=localStorage.getItem("oneselectyj");
data.field.yjId=yjId;
// 对表格进行重载。id 即 table表格的id
table.reload('table', {
// //设定异步数据接口的额外参数
@ -154,7 +156,6 @@ function init(){
}
//详情
function detailsView(id,userId,makeMonth) {
localStorage.setItem("resultId",id);

View File

@ -198,10 +198,20 @@ function getView(){
var gtName = viewList1[i].gtName.length>4?viewList1[i].gtName.substring(0,4) + '...': viewList1[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">`
var ystate=0;
for (var j = 0; j < photoList1.length; j++) {
if(viewList1[i].gtId == photoList1[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList1[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader">`
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList1[i].gtName}">${gtName}</span>
@ -260,10 +270,20 @@ function getView(){
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
`
var ystate=0;
for (var j = 0; j < photoList2.length; j++) {
if(viewList2[i].gtId == photoList2[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList2[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader">`
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `
<img src="../../../image/tower_white.png" alt="">
@ -325,7 +345,7 @@ function getView(){
var gtName = viewList3[i].gtName.length>11?viewList3[i].gtName.substring(0,11) + '...': viewList3[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList3[i].gtName}">${gtName}</span>
</div>

View File

@ -18,6 +18,8 @@ layui.use(['form','layer','table','laydate','element'], function () {
elem:'#month', //指定元素 元素选择器
type:'month', //选择时间类型 可选值:year(年) month(年月) date(年月日) time(时分秒) datetime(年月日时分秒)
trigger:'click',
min:firstDayStr(),
max:lastDayStr(),
format: 'yyyy-MM',
btns:['now','confirm'], //选择框右下角显示的按钮 清除-现在-确定
value: formatCurrentMonth(), // 如果你想预设当前日期为选中状态
@ -34,7 +36,42 @@ layui.use(['form','layer','table','laydate','element'], function () {
setData()
});
function firstDayStr(){
var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth-1, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天
var lastDay = new Date(year, thisMonth + 1, 1);
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
console.log("First day of this month: " + firstDayString);
return firstDayString;
}
function lastDayStr(){
var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDayString = firstDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
// 当月的最后一天
var lastDay = new Date();
var lastDayString = lastDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
console.log("Last day of this month: " + lastDayString);
return lastDayString;
}
function currMonth(){
var lastDay = new Date();
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
console.log("Last day of this month: " + lastDayString);
return lastDayString;
}
//工程切换
function projectTab(event,proId){
resultProId=proId;
@ -58,7 +95,13 @@ function formatCurrentMonth() {
function init(chosenYear,chosenMonth){
layui.use(['table'], function () {
getTab(chosenMonth)
getView()
if(localStorage.getItem("resultMakeMonth")!=currMonth()){
$("#normalInspectionUpload").css("display","none")
getViewc();
}else{
$("#normalInspectionUpload").css("display","")
getView();
}
getSpecial(chosenYear,chosenMonth)
})
}
@ -199,10 +242,20 @@ function getView(){
var gtName = viewList1[i].gtName.length>4?viewList1[i].gtName.substring(0,4) + '...': viewList1[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">`
var ystate=0;
for (var j = 0; j < photoList1.length; j++) {
if(viewList1[i].gtId == photoList1[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList1[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader">`
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList1[i].gtName}">${gtName}</span>
@ -263,10 +316,20 @@ function getView(){
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
`
var ystate=0;
for (var j = 0; j < photoList2.length; j++) {
if(viewList2[i].gtId == photoList2[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList2[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader">`
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `
<img src="../../../image/tower_white.png" alt="">
@ -290,7 +353,7 @@ function getView(){
<div style="color:#cccccc">上传图片</div>`
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})>
<button class="layui-btn" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
@ -330,9 +393,10 @@ function getView(){
var gtName = viewList3[i].gtName.length>11?viewList3[i].gtName.substring(0,11) + '...': viewList3[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList3[i].gtName}">${gtName}</span>
<img src="../../../image/edit_white.png" onclick="towerSpeciaEdit(this,${viewList1[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
<img src="../../../image/del_white.png" onclick="towerSpecialDel(this,${viewList3[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
</div>
<div class="viewContent">
@ -353,7 +417,7 @@ function getView(){
}
html += `
<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn">
<button class="layui-btn" onclick="uploadSpecialPhoto(${viewList3[i].gtId})">>
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
@ -379,36 +443,301 @@ function getView(){
$("#inspectionTourContent").append(html);
}
//页面赋值
function setData(){
var id=localStorage.getItem("resultUserId");
function getViewc(){
// ①已上传:展示修改、删除图标,上传日期不可选择,照片信息,杆塔号;颜色为“#52C1F5”
// ②未上传:展示上传图标,上传日期可选择,杆塔号,颜色为“#F56C6C”
// ③巡护段外:展示修改、删除图标,上传日期不可选择,照片信息,工程名称,杆塔号;颜色为“#FF9900”
// ④特巡/值守:展示修改、删除图标,上传日期不可选择,照片信息,备注;颜色为“#73A0FA”
// ⑤正在编辑:修改图标绿色背景,可重新上传照片、重新选择日期,编辑即边框闪烁;
$.ajax({//id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getUserDetail",
url: PATH_URL + "/makeInfo/getById",
dataType: 'json',
async:false,
data: {
id: id
userId: localStorage.getItem("resultUserId"),makeMonth:localStorage.getItem("resultMakeMonth"),proId:localStorage.getItem("resultProId")
},
success: function (data) {
$("#username").text(data.data.userName);
$("#phone").text(data.data.tel);
$("#num").text(data.data.powerNum);
$("#oneNum").text(data.data.oneMake);
$("#twoNum").text(data.data.twoMake);
$("#otherNum").text(data.data.special);
console.log(data,"result");
viewList1=data.mgtListone;
photoList1=data.vgtListone;
viewList2=data.mgtListtwo;
photoList2=data.vgtListtwo;
viewList3=data.mgtListspe;
photoList3=data.mgtListspe;
},
error:function(e){
}
})
$("#inspectionTourContent").empty();
//杆塔集合
// viewList1 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// //照片集合
var filePath = 'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg';
var sFilePath='../../../image/viewImg.jpg';
// photoList1 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
let html = ``;
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第一次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#999999">若需上传负责区域之外的杆塔请点击</span>
<span style="color:#0000FF;cursor: pointer;" onclick="patrolOutsideAdd()">巡护段外上传>></span>
</div>
<div id="firstViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
for (let i = 0;i < viewList1.length;i++) {
var gtName = viewList1[i].gtName.length>4?viewList1[i].gtName.substring(0,4) + '...': viewList1[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">`
var ystate=0;
for (var j = 0; j < photoList1.length; j++) {
if(viewList1[i].gtId == photoList1[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList1[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList1[i].gtName}">${gtName}</span>
</div>
<div class="viewContent">`
var flag = false;
for (var j = 0; j < photoList1.length; j++) {
if(viewList1[i].gtId == photoList1[j].gtId){
//照片存在,直接显示
html += `<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">`
flag = true;
break;
}
}
if(!flag){
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">
<div style="color:#cccccc">上传图片</div>`
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
for (var j = 0; j < photoList1.length; j++) {
if(viewList1[i].gtId == photoList1[j].gtId){
//照片存在,直接显示
html += `${photoList1[j].makeTime}`
break;
}
}
html +=`</div>
</div>
</div>`
}
html += `</div>`;
// viewList2 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList2 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第二次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>
</div>
<div id="secondViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
for (let i = 0;i < viewList2.length;i++) {
var gtName = viewList2[i].gtName.length>4?viewList2[i].gtName.substring(0,4) + '...': viewList2[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
`
var ystate=0;
for (var j = 0; j < photoList2.length; j++) {
if(viewList2[i].gtId == photoList2[j].gtId){
//照片存在,直接显示
ystate=1;
break;
}
}
if("1"==viewList2[i].makeType){
html +=`<div class="viewHeader" style="background-color: #FF9900;">`
}else if(ystate==0){
html +=`<div class="viewHeader" style="background-color: #F56C6C;">`
}else{
html +=`<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList2[i].gtName}">${gtName}</span>
</div>
<div class="viewContent">`
var flag = false;
for (var j = 0; j < photoList2.length; j++) {
if(viewList2[i].gtId == photoList2[j].gtId){
//照片存在,直接显示
html += `<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">`
flag = true;
break;
}
}
if(!flag){
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
<div style="color:#cccccc">上传图片</div>`
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
for (var j = 0; j < photoList2.length; j++) {
if(viewList2[i].gtId == photoList2[j].gtId){
//照片存在,直接显示
html += `${photoList2[j].makeTime}`
break;
}
}
html +=`
</div>
</div>
</div>`
}
html += `</div>`;
// viewList3 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList3 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>特巡 / 值守
</div>
<div style="width: 94%;height: 150px;overflow: auto;margin-left: 1.8%;">
<table id="isWorkList" class="layui-table" lay-skin="row" style="width:100%;"></table>
</div>
<div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
for (let i = 0;i < viewList3.length;i++) {
var gtName = viewList3[i].gtName.length>11?viewList3[i].gtName.substring(0,11) + '...': viewList3[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList3[i].gtName}">${gtName}</span>
<img src="../../../image/edit_white.png" onclick="towerSpeciaEdit(this,${viewList1[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
<img src="../../../image/del_white.png" onclick="towerSpecialDel(this,${viewList3[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
</div>
<div class="viewContent">
`
var flag = false;
for (var j = 0; j < photoList3.length; j++) {
if(viewList3[i].gtId == photoList3[j].gtId){
//照片存在,直接显示
html += `<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">`
flag = true;
break;
}
}
if(!flag){
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" ">
<div style="color:#cccccc">上传图片</div>`
}
html += `
<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn" onclick="uploadSpecialPhoto(${viewList3[i].gtId})">>
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;
`
for (var j = 0; j < photoList3.length; j++) {
if(viewList3[i].gtId == photoList3[j].gtId){
//照片存在,直接显示
html += `${photoList3[j].makeTime}`
break;
}
}
html +=`
</div>
</div>
</div>`
}
html += `</div>`;
$("#inspectionTourContent").append(html);
}
function towerSpeciaEdit(event,id,numTimes){
var color = $(event).css("background-color");
//通过按钮样式判断按钮状态
if(color == "rgb(22, 186, 170)"){
//此为编辑状态
//呼吸灯效果
$(event).parent().parent().removeClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "");
//展示编辑按钮
$(event).parent().next().children("div").css("display","none")
}else{
//常规状态
//呼吸灯效果
$(event).parent().parent().addClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "#16BAAA");
//展示编辑按钮
$(event).parent().next().children("div").css("display","flex")
}
}
function uploadSpecialPhoto(id){
let height = '70%';
let width = '60%';
var index = parent.layer.open({
title: ['上传特巡', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './uploadSpecialPhoto.html',
area: [width, height],
maxmin: false,
success: function (layero, index) {
var myIframe = parent.window[layero.find('iframe')[0]['name']];
myIframe.setGtId(id,localStorage.getItem("resultMakeMonth"),3,localStorage.getItem("resultUserId"),3,localStorage.getItem("resultProId"));
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
});
}
//文件查看
//查看附件详情
function filePreView(url) {
if(url != "" && url != null){
var suffix = url.split(".")[1];
if(suffix == "mp4"){
if(url.includes("mp4")){
localStorage.setItem("filePath", url);
var height = '99%';
var width = '70%';
@ -595,3 +924,26 @@ function uploadPhoto(id,numTimes,makeType){
},
});
}
//页面赋值
function setData(){
var id=localStorage.getItem("resultUserId");
$.ajax({//id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getUserDetail",
dataType: 'json',
data: {
id: id
},
success: function (data) {
$("#username").text(data.data.userName);
$("#phone").text(data.data.tel);
$("#num").text(data.data.powerNum);
$("#oneNum").text(data.data.oneMake);
$("#twoNum").text(data.data.twoMake);
$("#otherNum").text(data.data.special);
},
error:function(e){
}
})
}

Binary file not shown.