Compare commits

...

2 Commits

Author SHA1 Message Date
LHD_HY 0c35c181ec Merge remote-tracking branch 'origin/main' 2025-06-03 18:42:15 +08:00
LHD_HY c092634558 入场人员信息修改 2025-06-03 18:41:35 +08:00
2 changed files with 81 additions and 1 deletions

View File

@ -41,6 +41,16 @@ layui.use(['form', 'laydate', 'upload', 'element'], function () {
getTeamBySubIdToData($("#subId").val(), data.value); getTeamBySubIdToData($("#subId").val(), data.value);
}); });
form.on('select(postId)', function(data){
var selectedOption = $(data.elem).find('option:selected');
var isSpecial = selectedOption.attr('data-is-special')
if(isSpecial === '1') {
$('#targetDiv').show();
} else {
$('#targetDiv').hide();
}
});
var minListDate = "1990-01-01"; //最小可选时间1990-02-01 var minListDate = "1990-01-01"; //最小可选时间1990-02-01
var maxListDate = "2200-12-31"; //最大可选时间2200-12-31 var maxListDate = "2200-12-31"; //最大可选时间2200-12-31
var begin = "#signDate", var begin = "#signDate",
@ -178,6 +188,7 @@ layui.use(['form', 'laydate', 'upload', 'element'], function () {
uploadTeamExamFIle(1); uploadTeamExamFIle(1);
uploadCheckup(1); uploadCheckup(1);
uploadSpecial(5);
//监听开关事件(班组、工程选择) //监听开关事件(班组、工程选择)
form.on("switch(teamAndProChooseSwitch)", function (data) { form.on("switch(teamAndProChooseSwitch)", function (data) {
@ -2178,3 +2189,72 @@ function uploadCheckup(number){
} }
}); });
} }
function uploadSpecial(number){
var uploadup = upload.render({
elem: '#special_img',
url: fileUrl + '/file/upload', //改成您自己的上传接口
multiple: false, //是否允许多文件上传默认未false
dataType: "json",
exts: 'pdf|PDF',
auto: true, //是否自动上传 默认为true
number: number, //最大上传数量
size: 1024*30, //最大文件大小单位k
bindAction: '#hideUploadCheckup', //绑定的按钮
field: 'file', //传到后台的字段名,默认file
choose: function (obj) {
flag = false;
// 清空现有预览和文件信息
$('#specialProve').empty();
CheckupFiles = {};
checkupFilePath = ''; // 确保清除旧的文件路径
obj.preview(function (index, file, result) {
$("#previewSpecialProve").css("display", "");
var previewImgSrc = "../../../../img/filetype/pdf.png"; // 预览图片源
$('#specialProve').append(
'<div id="' + index + '" style="display: inline-block;text-align: center;width:150px">' +
'<img src="' + previewImgSrc + '" alt="' + file.name + '" style="height: 80px;width: 80px;margin-right: 10px" class="layui-upload-img ">' +
'<div><span>' + (file.name.length > 8 ? (file.name.substr(0, 8) + "..") : file.name) + '</span></div>' +
'</div>'
);
});
},
before: function (obj) {
this.data = {
photoType: "exam_checkup",
};
if ($("[name='brand']").val() == '') {
return false;
} else {
var names = '';
layui.each(CheckupFiles, function (index, file) {
names += file.name + ',';
});
$("[name='image']").val(names)
}
return true;
},
done: function (data) {
if(data.code === 200) {
layer.msg('上传成功');
checkupFilePath = data.data.url;
} else {
layer.msg('上传失败');
$('#specialProve').empty();
checkupFilePath = '';
}
},
allDone: function (data) {
// parent.layer.msg('新增体检报告成功');
},
error: function (e) {
layer.msg('上传失败');
$('#specialProve').empty();
checkupFilePath = '';
console.log(e)
}
});
}