|
@@ -292,6 +292,132 @@ TalentAllowanceInfo.getIdentifyCondition = function () {
|
|
|
$("#identifyCondition").trigger('chosen:updated');
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+TalentAllowanceInfo.initCheckFileTable = function () {
|
|
|
+ $('#checkFileTable').bootstrapTable('destroy');
|
|
|
+ $('#checkFileTable').bootstrapTable({
|
|
|
+ url: Feng.ctxPath + "/enterprise/talentAllowance/listCommonFile",
|
|
|
+ method: 'POST',
|
|
|
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
|
|
+ search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
|
|
|
+ showRefresh: false, // 是否显示刷新按钮
|
|
|
+ clickToSelect: true, // 是否启用点击选中行
|
|
|
+ singleSelect: true, // 设置True 将禁止多选
|
|
|
+ striped: true, // 是否显示行间隔色
|
|
|
+ pagination: false, // 设置为 true 会在表格底部显示分页条
|
|
|
+ paginationHAlign: "left",
|
|
|
+ paginationDetailHAlign: "right",
|
|
|
+ sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
|
|
|
+ showColumns: false,
|
|
|
+ queryParams: function (params) {
|
|
|
+ return {"batch": $("#batch").val(), "fileTag": "master_living_allowance"};
|
|
|
+ },
|
|
|
+ rowStyle: function (row, index) {
|
|
|
+ return {css: {"word-break": "break-word", "white-space": "inherit"}}
|
|
|
+ },
|
|
|
+ columns:
|
|
|
+ [
|
|
|
+ {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', width: '120px'},
|
|
|
+ {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px",
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ var sn = value.lastIndexOf(".");
|
|
|
+ var suffix = value.substring(sn + 1, value.length);
|
|
|
+ var imgStr = "";
|
|
|
+ if (suffix == "pdf" || suffix == "PDF") {
|
|
|
+ imgStr = "<button type='button' onclick=\"Feng.showPdf('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
|
|
|
+ } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
|
|
|
+ imgStr = "<button type='button' onclick=\"Feng.showExcel('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
|
|
|
+ } else {
|
|
|
+ imgStr = '<img class=\"imgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
|
|
|
+ }
|
|
|
+ return imgStr;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '80px',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ return "<button type='button' onclick=\"downloadFile('" + row.id + "','6')\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>" +
|
|
|
+ "<button type='button' onclick=\"TalentAllowanceInfo.deleteCheckFile('" + row.id + "','" + CONFIG.project_jbt + "')\" class=\"btn btn-xs btn-danger\">" +
|
|
|
+ "<i class=\"fa fa-times\"></i>删除" +
|
|
|
+ "</button>";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ onPostBody: function () {
|
|
|
+ $('#checkFileTable' + "td.uitd_showTip").bind("mouseover", function () {
|
|
|
+ var htm = $(this).html();
|
|
|
+ $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
|
|
|
+ });
|
|
|
+ $(".imgUrl").viewer({fullscreen: false});
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 核查材料留存上传
|
|
|
+ */
|
|
|
+TalentAllowanceInfo.showCheckFileModal = function () {
|
|
|
+ Feng.addAjaxSelect({
|
|
|
+ "id": "batch",
|
|
|
+ "displayCode": "id",
|
|
|
+ "displayName": "batch",
|
|
|
+ "type": "GET",
|
|
|
+ "url": "/common/batch/listBatchByType?type=" + CONFIG.project_jbt + "&source=" + $("#type").val()
|
|
|
+ });
|
|
|
+ $("#upload_file").val("");
|
|
|
+ $("#checkFileModal").modal("show");
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+TalentAllowanceInfo.checkFileUpload = function () {
|
|
|
+ var batch = $("#batch").val();
|
|
|
+ if (Feng.isEmptyStr(batch)) {
|
|
|
+ Feng.info("请选择申报批次后再上传!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $("#upload_file ").unbind("change");
|
|
|
+ $("#upload_file ").change(function () {
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("batch", batch);
|
|
|
+ for (var i = 0; i < $('#upload_file')[0].files.length; i++) {
|
|
|
+ formData.append('file', $('#upload_file')[0].files[i]);
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: Feng.ctxPath + "/enterprise/talentAllowance/uploadCommonFile",
|
|
|
+ type: "POST",
|
|
|
+ processData: false,
|
|
|
+ contentType: false,
|
|
|
+ data: formData,
|
|
|
+ success: function (data) {
|
|
|
+ $("#checkFileTable").bootstrapTable("refresh", {});
|
|
|
+ Feng.info(data.msg);
|
|
|
+ }, error: function (data) {
|
|
|
+ Feng.error("上传失败!" + data.responseJSON.message + "!");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('#upload_file').val("");
|
|
|
+ $('#upload_file').click();
|
|
|
+}
|
|
|
+
|
|
|
+TalentAllowanceInfo.deleteCheckFile = function (id, type) {
|
|
|
+ var operation = function () {
|
|
|
+ var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/deleteCommonFile", function (data) {
|
|
|
+ if (data.code = 200) {
|
|
|
+ Feng.success(data.msg);
|
|
|
+ $("#checkFileTable").bootstrapTable("refresh", {});
|
|
|
+ } else {
|
|
|
+ Feng.error(data.msg);
|
|
|
+ }
|
|
|
+ }, function (data) {
|
|
|
+ Feng.error("删除失败!" + data.responseJSON.message + "!");
|
|
|
+ });
|
|
|
+ ajax.set("id", id);
|
|
|
+ ajax.set("type", type);
|
|
|
+ ajax.start();
|
|
|
+ }
|
|
|
+ Feng.confirm("删除后无法恢复,确认删除吗?", operation);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 显示审核日志
|
|
|
*/
|