Browse Source

Merge branch 'master' of http://59.57.98.130:3000/jjhc/report

sugangqiang 1 year ago
parent
commit
cb5c8e440c

+ 15 - 1
app/admin/view/file_type/add.html

@@ -41,6 +41,18 @@
                                 <option value="1">是(与人才层级条件联动)</option>
                                 <option value="1">是(与人才层级条件联动)</option>
                             </select>
                             </select>
                         </div>
                         </div>
+                        <div class="input-group input-group-sm project20" style="display:none;">
+                            <div class="input-group-btn">
+                                <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                    是否公共附件
+                                </button>
+                            </div>
+                            <select class="form-control" id="isConditionFile" name="isConditionFile" selectVal="{$info.isConditionFile}">
+                                <option value="">---请选择---</option>
+                                <option value="0">否</option>
+                                <option value="1">是</option>
+                            </select>
+                        </div>
                         <div class="input-group input-group-sm">
                         <div class="input-group input-group-sm">
                             <div class="input-group-btn">
                             <div class="input-group-btn">
                                 <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
                                 <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
@@ -134,5 +146,7 @@
     </div>
     </div>
 </div>
 </div>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
-<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js"></script>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
 {/block}
 {/block}

+ 15 - 1
app/admin/view/file_type/edit.html

@@ -47,6 +47,18 @@
                                 <option value="1">是(与人才层级条件联动)</option>
                                 <option value="1">是(与人才层级条件联动)</option>
                             </select>
                             </select>
                         </div>
                         </div>
+                        <div class="input-group input-group-sm project20" style="display:none;">
+                            <div class="input-group-btn">
+                                <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                    是否公共附件
+                                </button>
+                            </div>
+                            <select class="form-control" id="isConditionFile" name="isConditionFile" selectVal="{$info.isConditionFile}">
+                                <option value="">---请选择---</option>
+                                <option value="0">否</option>
+                                <option value="1">是</option>
+                            </select>
+                        </div>
                         <div class="input-group input-group-sm">
                         <div class="input-group input-group-sm">
                             <div class="input-group-btn">
                             <div class="input-group-btn">
                                 <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
                                 <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
@@ -140,5 +152,7 @@
     </div>
     </div>
 </div>
 </div>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
-<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js"></script>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
 {/block}
 {/block}

+ 55 - 26
app/common/controller/Api.php

@@ -336,36 +336,65 @@ class Api extends BaseController {
             case 20:
             case 20:
                 //积分申报的附件需要特殊处理
                 //积分申报的附件需要特殊处理
                 $newList = [];
                 $newList = [];
+
+                $_where = $where;
+                $_where[] = ["isConditionFile", "=", 1];
+                $fileTypes = Db::table("new_common_filetype")->where($_where)->order("must asc")->order("sn " . $order)->select()->toArray();
+                foreach ($fileTypes as $k => $ft) {
+                    $_whr = [];
+                    if ($id) {
+                        $_whr[] = ["mainId", "=", $id];
+                    } else {
+                        $_whr[] = ["description", "=", $token];
+                    }
+                    $_whr[] = ["relationId", "=", 0];
+                    $_whr[] = ["typeId", "=", $ft["id"]];
+                    $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
+                    foreach ($files as $n => $file) {
+                        $files[$n]["ext"] = pathinfo($file["url"])["extension"];
+                        $files[$n]["url"] = getStoragePath($file["url"]);
+                    }
+                    $fileTypes[$k]["files"] = $files;
+                }
+                $newList[] = [
+                    "id" => 0,
+                    "name" => "公共附件",
+                    "fileTypes" => $fileTypes
+                ];
+
                 $itemIds = $param["itemId"];
                 $itemIds = $param["itemId"];
                 $redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
                 $redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
-                foreach ($itemIds as $key => $item_id) {
-                    $integral_item = json_decode($redis->hGet("IntegralItem", $item_id), true);
-                    if ($integral_item["fileTypeId"]) {
-                        $typeIds = array_filter(explode(",", $integral_item["fileTypeId"]));
-                        $whr = $where;
-                        $whr[] = ["id", "in", $typeIds];
-                        $fileTypes = Db::table("new_common_filetype")->where($whr)->order("must asc")->order("sn " . $order)->select()->toArray();
-                        foreach ($fileTypes as $k => $ft) {
-                            $_whr = [];
-                            if ($id) {
-                                $_whr[] = ["mainId", "=", $id];
-                            } else {
-                                $_whr[] = ["description", "=", $token];
-                            }
-                            $_whr[] = ["relationId", "=", $item_id];
-                            $_whr[] = ["typeId", "=", $ft["id"]];
-                            $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
-                            foreach ($files as $n => $file) {
-                                $files[$n]["ext"] = pathinfo($file["url"])["extension"];
-                                $files[$n]["url"] = getStoragePath($file["url"]);
+                if ($itemIds) {
+                    foreach ($itemIds as $key => $item_id) {
+                        $integral_item = json_decode($redis->hGet("IntegralItem", $item_id), true);
+                        if ($integral_item["fileTypeId"]) {
+                            $typeIds = array_filter(explode(",", $integral_item["fileTypeId"]));
+                            $whr = $where;
+                            $whr[] = ["id", "in", $typeIds];
+                            $whr[] = ["isConditionFile", "=", 0];
+                            $fileTypes = Db::table("new_common_filetype")->where($whr)->order("must asc")->order("sn " . $order)->select()->toArray();
+                            foreach ($fileTypes as $k => $ft) {
+                                $_whr = [];
+                                if ($id) {
+                                    $_whr[] = ["mainId", "=", $id];
+                                } else {
+                                    $_whr[] = ["description", "=", $token];
+                                }
+                                $_whr[] = ["relationId", "=", $item_id];
+                                $_whr[] = ["typeId", "=", $ft["id"]];
+                                $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
+                                foreach ($files as $n => $file) {
+                                    $files[$n]["ext"] = pathinfo($file["url"])["extension"];
+                                    $files[$n]["url"] = getStoragePath($file["url"]);
+                                }
+                                $fileTypes[$k]["files"] = $files;
                             }
                             }
-                            $fileTypes[$k]["files"] = $files;
+                            $newList[] = [
+                                "id" => $integral_item["id"],
+                                "name" => $integral_item["name"],
+                                "fileTypes" => $fileTypes
+                            ];
                         }
                         }
-                        $newList[] = [
-                            "id" => $integral_item["id"],
-                            "name" => $integral_item["name"],
-                            "fileTypes" => $fileTypes
-                        ];
                     }
                     }
                 }
                 }
                 return json(["rows" => $newList]);
                 return json(["rows" => $newList]);

+ 10 - 0
app/enterprise/controller/Integral.php

@@ -134,6 +134,16 @@ class Integral extends EnterpriseController {
             if (count($tmp_item_ids) != $detailCounts) {
             if (count($tmp_item_ids) != $detailCounts) {
                 throw new ValidateException("同一个申报中,同一个积分标准不能申报多次");
                 throw new ValidateException("同一个申报中,同一个积分标准不能申报多次");
             }
             }
+
+            $whrCommonFt = [];
+            $whrCommonFt[] = ["project", "=", $project];
+            $whrCommonFt[] = ["active", "=", 1];
+            $whrCommonFt[] = ["delete", "=", 0];
+            $whrCommonFt[] = ["type", "=", ProjectState::INTEGRAL];
+            $whrCommonFt[] = ["isConditionFile", "=", 1];
+            $common_fts = Db::table("new_common_filetype")->where($whrCommonFt)->select()->toArray();
+            $common_ft_ids = array_column($common_fts, "id");
+            $ft_ids = array_filter(array_merge($ft_ids, (array) $common_ft_ids));
             if ($ft_ids) {
             if ($ft_ids) {
                 $whr = [];
                 $whr = [];
                 if ($id) {
                 if ($id) {

+ 1 - 1
public/static/modular/common/upload.js

@@ -90,7 +90,7 @@ function initFileTypeColumn () {
                 if(value==null||value==''||value=='null'){
                 if(value==null||value==''||value=='null'){
                     return '无';
                     return '无';
                 }
                 }
-                return "<button type='button' onclick=\"downloadFile('"+row.id+"',3)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
+                return "<button type='button' onclick=\"downloadFile('"+row.id+"',5)\" style='margin-right: 10px' class=\"btn btn-xs btn-primary\">" +
                     "<i class=\"fa fa-download\"></i>下载" +
                     "<i class=\"fa fa-download\"></i>下载" +
                     "</button>";
                     "</button>";
             }
             }

+ 8 - 4
public/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js

@@ -155,10 +155,14 @@ UnCommonFiletypeInfoDlg.typeChange = function () {
 
 
 UnCommonFiletypeInfoDlg.projectChange = function () {
 UnCommonFiletypeInfoDlg.projectChange = function () {
     var project = $("#project").val();
     var project = $("#project").val();
-    if(project == 1){
-        $(".project1").css("display","");
-    }else{
-        $(".project1").css("display","none");
+    $(".project1").css("display", "none");
+    $(".project20").css("display", "none");
+    if (project == "1") {
+        $(".project1").css("display", "");
+    } else if (project == "20") {
+        $(".project20").css("display", "");
+    } else {
+
     }
     }
     UnCommonFiletypeInfoDlg.typeAndProjectChange();
     UnCommonFiletypeInfoDlg.typeAndProjectChange();
 }
 }

+ 8 - 5
public/static/modular/gate/integral/integralInfo.js

@@ -109,9 +109,12 @@ IntegralInfoDlg.validate = function () {
 IntegralInfoDlg.initFileTypeColumn = function () {
 IntegralInfoDlg.initFileTypeColumn = function () {
     return [
     return [
         {field: 'selectItem', checkbox: false, visible: false},
         {field: 'selectItem', checkbox: false, visible: false},
-        {title: '附件列表', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
+        {title: '附件列表(带*号的附件必需上传)', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
             formatter: function (value, row, index) {
             formatter: function (value, row, index) {
-                return '<span style="color:#ff0000;">申报"' + value + '"积分项目需要上传以下附件(带*号的附件必需上传)</span>';
+                if (row.id != 0) {
+                    return '<span style="color:#000000;font-weight:bold;">申报"' + value + '"积分项目需要上传以下附件</span>';
+                }
+                return '<span style="color:#000000;font-weight:bold;">公共附件</span>';
             }
             }
         },
         },
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
@@ -189,8 +192,8 @@ IntegralInfoDlg.changeAndLoadFile = function () {
         }
         }
     }
     }
     if (item_id.length == 0) {
     if (item_id.length == 0) {
-        table.bootstrapTable("destroy");
-        return;
+        //table.bootstrapTable("destroy");
+        //return;
     }
     }
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
         table.bootstrapTable("destroy");
         table.bootstrapTable("destroy");
@@ -715,7 +718,7 @@ $(function () {
     }
     }
     $("#card_type").val($("#card_type").attr("value"));
     $("#card_type").val($("#card_type").attr("value"));
     IntegralInfoDlg.validId();
     IntegralInfoDlg.validId();
-    //IntegralInfoDlg.changeAndLoadFile();
+    IntegralInfoDlg.changeAndLoadFile();
 });
 });
 
 
 
 

+ 8 - 5
public/static/modular/gate/integral/integralInfo_select.js

@@ -19,9 +19,12 @@ IntegralInfoDlg.close = function () {
 IntegralInfoDlg.initFileTypeColumn = function () {
 IntegralInfoDlg.initFileTypeColumn = function () {
     return [
     return [
         {field: 'selectItem', checkbox: false, visible: false},
         {field: 'selectItem', checkbox: false, visible: false},
-        {title: '附件列表', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
+        {title: '附件列表(带*号的附件必需上传)', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
             formatter: function (value, row, index) {
             formatter: function (value, row, index) {
-                return '<span style="color:#ff0000;">申报"' + value + '"积分项目需要上传以下附件(带*号的附件必需上传)</span>';
+                if (row.id != 0) {
+                    return '<span style="color:#000000;font-weight:bold;">申报"' + value + '"积分项目需要上传以下附件</span>';
+                }
+                return '<span style="color:#000000;font-weight:bold;">公共附件</span>';
             }
             }
         },
         },
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
@@ -39,8 +42,8 @@ IntegralInfoDlg.changeAndLoadFile = function () {
         }
         }
     }
     }
     if (item_id.length == 0) {
     if (item_id.length == 0) {
-        table.bootstrapTable("destroy");
-        return;
+        //table.bootstrapTable("destroy");
+        //return;
     }
     }
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
         if (data == null || data.length == 0) {
         if (data == null || data.length == 0) {
@@ -298,7 +301,7 @@ $(function () {
     }
     }
     $("#card_type").val($("#card_type").attr("value"));
     $("#card_type").val($("#card_type").attr("value"));
     IntegralInfoDlg.setNoChangeField();
     IntegralInfoDlg.setNoChangeField();
-    //IntegralInfoDlg.changeAndLoadFile();
+    IntegralInfoDlg.changeAndLoadFile();
 });
 });
 
 
 
 

+ 7 - 4
public/static/modular/talentIdentify/integralMgr/IntegralVerify_info.js

@@ -13,9 +13,12 @@ var IntegralVerifyInfoDlg = {
 IntegralVerifyInfoDlg.initFileTypeColumn = function () {
 IntegralVerifyInfoDlg.initFileTypeColumn = function () {
     return [
     return [
         {field: 'selectItem', checkbox: false, visible: false},
         {field: 'selectItem', checkbox: false, visible: false},
-        {title: '附件列表', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
+        {title: '附件列表(带*号的附件必需上传)', field: 'name', visible: true, align: 'left', valign: 'middle', width: "100%", 'class': 'uitd_showTip',
             formatter: function (value, row, index) {
             formatter: function (value, row, index) {
-                return '<span style="color:#ff0000;">申报"' + value + '"积分项目需要上传以下附件(带*号的附件必需上传)</span>';
+                if (row.id != 0) {
+                    return '<span style="color:#000000;font-weight:bold;">申报"' + value + '"积分项目需要上传以下附件</span>';
+                }
+                return '<span style="color:#000000;font-weight:bold;">公共附件</span>';
             }
             }
         },
         },
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
         {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "8%"},
@@ -34,8 +37,8 @@ IntegralVerifyInfoDlg.changeAndLoadFile = function () {
         }
         }
     }
     }
     if (item_id.length == 0) {
     if (item_id.length == 0) {
-        table.bootstrapTable("destroy");
-        return;
+        //table.bootstrapTable("destroy");
+        //return;
     }
     }
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
     var ajax = new $ax("/common/api/findCommonFileType", function (data) {
         if (data == null || data.length == 0) {
         if (data == null || data.length == 0) {