Explorar o código

津补贴附件可以上传压缩包文件

sugangqiang hai 9 meses
pai
achega
0011030fdd

+ 11 - 0
app/common/controller/Api.php

@@ -613,6 +613,17 @@ class Api extends BaseController {
             case "image/gif":
             case "image/gif":
                 $filestd = $upload->uploadOne($file, "image", "talent_files");
                 $filestd = $upload->uploadOne($file, "image", "talent_files");
                 break;
                 break;
+            case "application/zip":
+            case "application/x-rar-compressed":
+            case "application/x-7z-compressed":
+                if (in_array($type, [ProjectState::JBT])) {
+                    $filestd = $upload->uploadOne($file, "hybrid", "talent_files");
+                } else {
+                    $res = ["msg" => "不支持的附件类型", "obj" => $index];
+                    echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
+                    exit();
+                }
+                break;
             default:
             default:
                 $res = ["msg" => "不支持的附件类型", "obj" => $index];
                 $res = ["msg" => "不支持的附件类型", "obj" => $index];
                 echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
                 echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));

+ 2 - 2
app/common/validate/Upload.php

@@ -9,7 +9,7 @@ class Upload extends Validate {
     protected $rule = [
     protected $rule = [
         'image' => ['fileExt' => 'jpg,png,gif,jpeg', 'fileSize' => 5 * 1024 * 1024, 'fileMime' => 'image/jpg,image/png,image/gif,image/jpeg'],
         'image' => ['fileExt' => 'jpg,png,gif,jpeg', 'fileSize' => 5 * 1024 * 1024, 'fileMime' => 'image/jpg,image/png,image/gif,image/jpeg'],
         'file' => ['fileExt' => 'pdf,doc,docx,xlsx,xls,csv', 'fileSize' => 20 * 1024 * 1024, 'fileMime' => 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
         'file' => ['fileExt' => 'pdf,doc,docx,xlsx,xls,csv', 'fileSize' => 20 * 1024 * 1024, 'fileMime' => 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
-        'hybrid' => ['fileExt' => 'zip,rar,7z', 'fileSize' => 20 * 1024 * 1024, 'fileMime' => 'application/zip,application/x-rar-compressed,application/x-7z-compressed'],
+        'hybrid' => ['fileExt' => 'zip,rar,7z', 'fileSize' => 100 * 1024 * 1024, 'fileMime' => 'application/zip,application/x-rar-compressed,application/x-7z-compressed'],
         'system' => ['fileExt' => 'jpg,png,gif,jpeg,pdf,doc,docx,xlsx,xls,csv', 'fileSize' => 20 * 1024 * 1024, 'fileMime' => 'image/jpg,image/png,image/gif,image/jpeg,application/pdf,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
         'system' => ['fileExt' => 'jpg,png,gif,jpeg,pdf,doc,docx,xlsx,xls,csv', 'fileSize' => 20 * 1024 * 1024, 'fileMime' => 'image/jpg,image/png,image/gif,image/jpeg,application/pdf,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
     ];
     ];
     protected $message = [
     protected $message = [
@@ -20,7 +20,7 @@ class Upload extends Validate {
         'file.fileSize' => '文件大小不能大于20兆',
         'file.fileSize' => '文件大小不能大于20兆',
         'file.fileMime' => '文件类型不支持',
         'file.fileMime' => '文件类型不支持',
         'hybrid.fileExt' => '文件的格式支持:zip,rar,7z',
         'hybrid.fileExt' => '文件的格式支持:zip,rar,7z',
-        'hybrid.fileSize' => '文件大小不能大于20兆',
+        'hybrid.fileSize' => '文件大小不能大于100兆',
         'hybrid.fileMime' => '文件类型不支持',
         'hybrid.fileMime' => '文件类型不支持',
         'system.fileExt' => '文件的格式仅支持:png,jpg,jpeg,gif,pdf,doc,docx,xlsx,xls,csv',
         'system.fileExt' => '文件的格式仅支持:png,jpg,jpeg,gif,pdf,doc,docx,xlsx,xls,csv',
         'system.fileSize' => '文件大小不能大于20兆',
         'system.fileSize' => '文件大小不能大于20兆',

+ 2 - 0
public/static/modular/gate/talentAllowance/check/talentAllowanceInfo_info_supple.js

@@ -360,6 +360,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }

+ 2 - 0
public/static/modular/gate/talentAllowance/common/talentAllowanceInfo_select.js

@@ -63,6 +63,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }

+ 2 - 0
public/static/modular/gate/talentAllowance/common/talentAllowance_info.js

@@ -701,6 +701,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }

+ 1 - 1
public/static/modular/gate/talentAllowance/common/talentAllowance_info_supple.js

@@ -97,7 +97,7 @@ TalentAllowanceInfoDlg.initProjectColumns = function () {
     return [
     return [
         {field: 'selectItem', checkbox: false, visible: false},
         {field: 'selectItem', checkbox: false, visible: false},
         {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
         {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
-        {title: '详情(填写完请按右的保存按钮)', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%",
+        {title: '详情(填写完请按右的保存按钮)', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%",
             formatter: function (value, row, index) {
             formatter: function (value, row, index) {
                 var allowanceType = $("#allowanceType").val();
                 var allowanceType = $("#allowanceType").val();
                 var html = "";
                 var html = "";

+ 2 - 0
public/static/modular/talentAllowance/talentAllowanceInfo_info_supple.js

@@ -417,6 +417,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }

+ 2 - 0
public/static/modular/talentAllowance/talentAllowanceInfo_public_check.js

@@ -1090,6 +1090,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf(('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf(('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }

+ 2 - 0
public/static/modular/talentAllowance/talentAllowanceInfo_select.js

@@ -337,6 +337,8 @@ TalentAllowanceInfoDlg.initFileTable = function () {
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" 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') {
                     } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
                         imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "zip" || suffix == "rar" || suffix == '7z' || suffix == "ZIP" || suffix == "RAR" || suffix == '7Z') {
+                        imgStr = '<a href=\"' + data[key].url + '\">' + data[key].orignName + '</a>';
                     } else {
                     } else {
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                         imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
                     }