sugangqiang 2 年之前
父節點
當前提交
411d7dcab9

+ 42 - 2
app/admin/controller/EnterpriseChangeRecord.php

@@ -45,6 +45,42 @@ class EnterpriseChangeRecord extends AdminController {
                 $ecr['newStreetName'] = $streetList[$ecr['newStreet']];
             }
         }
+        if ($ep["imgurl"]) {
+            $ecr["imgurl"] = $ep["imgurl"];
+            $pathinfo = pathinfo($ecr["imgurl"]);
+            if (in_array($pathinfo['extension'], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr['imgurl_is_img'] = 1;
+            } else {
+                $ecr['imgurl_is_img'] = 0;
+            }
+        }
+        if ($ep["bankImg"]) {
+            $ecr["bankImg"] = $ep["bankImg"];
+            $pathinfo = pathinfo($ecr["bankImg"]);
+            if (in_array($pathinfo['extension'], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr['bankImg_is_img'] = 1;
+            } else {
+                $ecr['bankImg_is_img'] = 0;
+            }
+        }
+        if ($ep["domainImg"]) {
+            $ecr["domainImg"] = $ep["domainImg"];
+            $pathinfo = pathinfo($ecr["domainImg"]);
+            if (in_array($pathinfo['extension'], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr['domainImg_is_img'] = 1;
+            } else {
+                $ecr['domainImg_is_img'] = 0;
+            }
+        }
+        if ($ep["beian"]) {
+            $ecr["beian"] = $ep["beian"];
+            $pathinfo = pathinfo($ecr["beian"]);
+            if (in_array($pathinfo['extension'], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr['beian_is_img'] = 1;
+            } else {
+                $ecr['beian_is_img'] = 0;
+            }
+        }
 
         switch ($ecr['checkState']) {
             case 1:
@@ -72,7 +108,12 @@ class EnterpriseChangeRecord extends AdminController {
         $files = TalentCommonFile::alias("tcf")->field("tcf.*,cft.api")->leftJoin("new_currency_filetype cft", "cft.id=tcf.typeId")->where($where)->select();
         $_files = [];
         foreach ($files as $k => $v) {
-            $v["ext"] = pathinfo($v["url"])["extension"];
+            $extension = pathinfo($v["url"])["extension"];
+            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
+                $v["is_img"] = 1;
+            } else {
+                $v["is_img"] = 0;
+            }
             $v['url'] = getStoragePath($v['url']);
             $_files[$v["api"]][] = $v;
         }
@@ -113,7 +154,6 @@ class EnterpriseChangeRecord extends AdminController {
                     $industry = DictApi::findDictByCode($ecr['newEnterpriseType']);
                     $ecr['newEnterpriseTypeName'] = $industry['name'];
                 }
-
                 return view("", ['ecr' => $ecr, 'files' => $_files]);
                 break;
             case 1:

+ 72 - 24
app/admin/view/enterprise_change_record/goto_enterprise_change_detail_page.html

@@ -1,6 +1,7 @@
 {extend name="layout/content"}
 {block name="content"}
 <style>
+    .float-e-margins .btn{margin-bottom:0 !important;}
     .upload-btn {
         position: relative;
         display: inline-block;
@@ -50,11 +51,12 @@
     }
     span.new{font-weight:bold;color:#333;}
     span.old{text-decoration:line-through;}
-    ul.files{list-style:none;display:flex;justify-content:center;padding:0;}
+    ul.files{list-style:none;display:flex;justify-content:center;padding:0;align-items:flex-start;}
     ul.files li{background:#ddd;overflow:hidden;position:relative;margin-right:10px;float:left;border:1px solid #ddd;}
     ul.yyzz li{width:100px;}
     ul.khxkz li{width:100px;}
     ul.hyly li{width:100px;}
+    ul.beian li{width:100px;}
     ul.files i.old{text-align:center;height:0;width:0;line-height:15px;color:#fff;position:absolute;right:0;bottom:0;border-top:15px solid transparent;border-right:15px solid #000;border-bottom:15px solid #000;border-left:15px solid transparent;display:block;}
     ul.files i.new{text-align:center;height:0;width:0;line-height:15px;color:#000;position:absolute;right:0;bottom:0;border-top:15px solid transparent;border-right:15px solid #0bfd1a;border-bottom:15px solid #0bfd1a;border-left:15px solid transparent;display:block;}
 </style>
@@ -84,14 +86,24 @@
                                 </label>
                                 <ul class="files yyzz">
                                     {if condition="$ecr['imgurl']"}                                    
-                                        <li>
-                                            <img onclick="Feng.showImg(this)" id="yyzz" src="{$ecr.imgurl|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
-                                        </li>
+                                    <li>
+                                        {if condition="$ecr['imgurl_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.imgurl|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.imgurl|getStoragePath}', 'imgurl')">点击查看(旧)</button>
+                                        {/if}
+                                    </li>
                                     {/if}
                                     {if condition="$files['businessLicense']"}
-                                        {volist name="$files['businessLicense']" id="file"}
-                                        <li><img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i></li>
-                                        {/volist}
+                                    {volist name="$files['businessLicense']" id="file"}
+                                    <li>
+                                        {if condition="$file['is_img']"}
+                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$file.url}', 'imgurl')">点击查看(新)</button>
+                                        {/if}
+                                    </li>
+                                    {/volist}
                                     {/if}
                                 </ul>
                             </td>
@@ -133,14 +145,24 @@
                                 </label>
                                 <ul class="files khxkz">
                                     {if condition="$ecr['bankImg']"}                                    
-                                        <li>
-                                            <img onclick="Feng.showImg(this)" id="yyzz" src="{$ecr.bankImg|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
-                                        </li>
+                                    <li>
+                                        {if condition="$ecr['bankImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.bankImg|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.bankImg|getStoragePath}', 'bankImg')">点击查看(旧)</button>
+                                        {/if}
+                                    </li>
                                     {/if}
                                     {if condition="$files['businessBank']"}
-                                        {volist name="$files['businessBank']" id="file"}
-                                        <li><img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i></li>
-                                        {/volist}
+                                    {volist name="$files['businessBank']" id="file"}
+                                    <li>
+                                        {if condition="$file['is_img']"}
+                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$file.url}', 'bankImg')">点击查看(新)</button>
+                                        {/if}
+                                    </li>
+                                    {/volist}
                                     {/if}
                                 </ul>
                             </td>
@@ -195,14 +217,24 @@
                             <td>
                                 <ul class="files hyly">
                                     {if condition="$ecr['domainImg']"}                                    
-                                        <li>
-                                            <img onclick="Feng.showImg(this)" id="yyzz" src="{$ecr.domainImg|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
-                                        </li>
+                                    <li>
+                                        {if condition="$ecr['domainImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.domainImg|getStoragePath}" style="max-width: 100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.domainImg|getStoragePath}', 'domainImg')">点击查看(旧)</button>
+                                        {/if}
+                                    </li>
                                     {/if}
                                     {if condition="$files['businessDomain']"}
-                                        {volist name="$files['businessDomain']" id="file"}
-                                        <li><img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i></li>
-                                        {/volist}
+                                    {volist name="$files['businessDomain']" id="file"}      
+                                    <li>
+                                        {if condition="$file['is_img']"}
+                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$file.url}', 'domainImg')">点击查看(新)</button>
+                                        {/if}
+                                    </li>
+                                    {/volist}
                                     {/if}
                                 </ul>
                             </td>
@@ -236,12 +268,28 @@
                                 人才联络员信息备案表
                             </td>
                             <td style="text-align: left">
-                                {if condition="$ecr['beian']"}<button type="button" class="btn btn-danger" onclick="Feng.showFile('{$ecr.beian|getStoragePath}', 'beian')">点击查看(旧)</button>{/if}                                
-                                {if condition="$files['businessBeian']"}
+                                <ul class="files beian">
+                                    {if condition="$ecr['beian']"}
+                                    <li>
+                                        {if condition="$ecr['beian_is_img'] eq 1"}
+                                        <img src="{$ecr.beian|getStoragePath}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="old">旧</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-danger" onclick="Feng.showFile('{$ecr.beian|getStoragePath}', 'beian')">点击查看(旧)</button>
+                                        {/if}
+                                    </li>
+                                    {/if}                                
+                                    {if condition="$files['businessBeian']"}
                                     {volist name="$files['businessBeian']" id="file"}
-                                    <button type="button" class="btn btn-primary" onclick="Feng.showFile('{$file.url}', 'beian')">点击查看(新)</button>
+                                    <li>
+                                        {if condition="$file['is_img']"}
+                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$file.url}', 'beian')">点击查看(新)</button>
+                                        {/if}
+                                    </li>
                                     {/volist}
-                                {/if}
+                                    {/if}
+                                </ul>
                             </td>
                         </tr>
                     </table>
@@ -252,6 +300,6 @@
 </div>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>
 <script type="text/javascript">
-    document.write('<script src="/static/modular/enterprise/enterprisechangeRecord/ep_change_record_detail.js?v='+(new Date()).getTime()+'"><\/script>');
+    document.write('<script src="/static/modular/enterprise/enterprisechangeRecord/ep_change_record_detail.js?v=' + (new Date()).getTime() + '"><\/script>');
 </script>
 {/block}

+ 0 - 3
app/enterprise/api/TalentApi.php

@@ -36,9 +36,6 @@ class TalentApi {
 
     public static function getOne($id) {
         $one = Talent::findOrEmpty($id);
-        if ($one["headimgurl"]) {
-            $one["headimgurl"] = getStoragePath($one["headimgurl"]);
-        }
         return $one;
     }
 

+ 1 - 1
app/enterprise/view/base/first.html

@@ -99,7 +99,7 @@
                                                     <p style="text-align: center;color: red">
                                                         请上传近期免冠半身彩照(两寸)
                                                     </p>
-                                                    <img id="photoImg" {if condition="$row['headimgurl']"} src="{$row.headimgurl}" {else/} src="/static/img/photo.png" {/if} onclick="$('#photo').click();" style="height:147px;width:105px;margin:0 auto;display:block;">
+                                                    <img id="photoImg" {if condition="$row['headimgurl']"} src="{$row.headimgurl|getStoragePath}" {else/} src="/static/img/photo.png" {/if} onclick="$('#photo').click();" style="height:147px;width:105px;margin:0 auto;display:block;">
                                                          <hr />
                                                     附件:
                                                     <table class="fileTable"></table>

+ 1 - 1
app/enterprise/view/talent/second.html

@@ -99,7 +99,7 @@
                                                     </div>
                                                 </td>
                                                 <td rowspan="5" style="width: 200%">
-                                                    <img id="photoImg" src="{$row.headimgurl}"  style="height:147px;width:105px;margin:0 auto;display:block;">
+                                                    <img id="photoImg" src="{$row.headimgurl|getStoragePath}"  style="height:147px;width:105px;margin:0 auto;display:block;">
                                                     <hr />
                                                     附件:
                                                     <table class="fileTable"></table>