diff --git a/api/api-system/src/main/java/com/bonus/system/api/model/Dict.java b/api/api-system/src/main/java/com/bonus/system/api/model/Dict.java index c7d17af..8c16ea6 100644 --- a/api/api-system/src/main/java/com/bonus/system/api/model/Dict.java +++ b/api/api-system/src/main/java/com/bonus/system/api/model/Dict.java @@ -6,11 +6,20 @@ public class Dict extends BaseEntity { private String type; private String k; private String val; + private String isSpecial; public String getType() { return type; } + public String getIsSpecial() { + return isSpecial; + } + + public void setIsSpecial(String isSpecial) { + this.isSpecial = isSpecial; + } + public void setType(String type) { this.type = type; } diff --git a/modules/bmw/src/main/resources/static/downloads/农民工实名制导入模版.xlsx b/modules/bmw/src/main/resources/static/downloads/农民工实名制导入模版.xlsx new file mode 100644 index 0000000..466a379 Binary files /dev/null and b/modules/bmw/src/main/resources/static/downloads/农民工实名制导入模版.xlsx differ diff --git a/modules/bmw/src/main/resources/static/js/dict.js b/modules/bmw/src/main/resources/static/js/dict.js index 0bf3043..d075ea7 100644 --- a/modules/bmw/src/main/resources/static/js/dict.js +++ b/modules/bmw/src/main/resources/static/js/dict.js @@ -24,21 +24,29 @@ function showDictSelect(id, type, all) { * @returns {any} */ function showDictSelectToLayui(id, type, all, key) { - var data = getDict(type); var select = $("#" + id); select.empty(); - if (all != undefined && all) { - select.append(""); - } - $.each(data, function (k, v) { - if (k == key) { - select.append(""); - } else { - select.append(""); - } - }); - layui.form.render(); - return data; + $.ajax({ + type : 'post', + url : systemPath + '/dicts', + data : { + "type" : type + }, + async : false, + success : function(data) { + if (all != undefined && all) { + select.append(""); + } + $.each(data, function (index, item) { + if (item.k == key) { + select.append(""); + } else { + select.append(""); + } + }) + layui.form.render(); + } + }) } function getDict(type) { @@ -64,4 +72,4 @@ function changTime(rowData){ var d = new Date(rowData) var a= d.getFullYear() + '-' + (d.getMonth() + 1 < 10 ? "0" + (d.getMonth() + 1) : d.getMonth() + 1) + '-' + (d.getDate()<10 ? "0" +d.getDate():d.getDate()) return a; -} \ No newline at end of file +} diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html index c5853ab..6da5233 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html @@ -148,7 +148,7 @@ -
+
@@ -188,6 +188,21 @@
+ +
@@ -717,4 +732,4 @@ \ No newline at end of file + defer="defer"> diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js index 58974db..b73700e 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js @@ -28,7 +28,8 @@ layui.use(['form', 'laydate', 'upload', 'element'], function () { ); //顶部样式 titleStyle() - getProByTeamId('', ''); + + getSub('') form.on('select(subId)', function(data){ getTeamBySubId(data.value,'') $("#fallPro").val(""); @@ -41,6 +42,17 @@ layui.use(['form', 'laydate', 'upload', 'element'], function () { 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 maxListDate = '2200-12-31';//最大可选时间,例:2200-12-31 var begin = "#signDate", end = "#expiryDate";//开始时间选择框、结束时间选择框:文本框 @@ -176,6 +188,7 @@ layui.use(['form', 'laydate', 'upload', 'element'], function () { uploadTeamExamFIle(1); uploadCheckup(1); + uploadSpecial(5); //监听开关事件(班组、工程选择) form.on('switch(teamAndProChooseSwitch)', function(data){ @@ -1948,4 +1961,73 @@ function uploadCheckup(number){ console.log(e) } }); -} \ No newline at end of file +} + +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( + '
' + + '' + file.name + '' + + '
' + (file.name.length > 8 ? (file.name.substr(0, 8) + "..") : file.name) + '
' + + '
' + ); + }); + }, + 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) + } + }); +} + diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.html b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.html index d37df6b..b9dfaae 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.html +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.html @@ -69,13 +69,17 @@ onclick="importData()">导入
+ href="../../../../downloads/人员库_导入模板.xlsx" download="人员库_导入模板.xlsx" style="margin-top:0.5%"> 模板下载 + + 农民工实名制模板下载 +
@@ -123,4 +127,4 @@ - \ No newline at end of file + diff --git a/modules/system/src/main/java/com/bonus/system/basic/dao/DictDao.java b/modules/system/src/main/java/com/bonus/system/basic/dao/DictDao.java index f43d6c5..96ec996 100644 --- a/modules/system/src/main/java/com/bonus/system/basic/dao/DictDao.java +++ b/modules/system/src/main/java/com/bonus/system/basic/dao/DictDao.java @@ -7,6 +7,6 @@ import java.util.List; @Mapper public interface DictDao { - @Select("select t.value as val,type,id as k from t_dict t where t.type = #{type} and t.is_active = '1'") + @Select("select t.value as val,t.is_special as isSpecial,type,id as k from t_dict t where t.type = #{type} and t.is_active = '1'") List listByType(String type); }