sugangqiang 2 年之前
父节点
当前提交
18200a7e52

+ 199 - 95
app/admin/controller/EnterpriseChangeRecord.php

@@ -45,42 +45,6 @@ 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:
@@ -103,21 +67,138 @@ class EnterpriseChangeRecord extends AdminController {
                 break;
         }
 
-        $where = [];
-        $where[] = ['tcf.mainId', '=', $id];
-        $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) {
-            $extension = pathinfo($v["url"])["extension"];
-            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
-                $v["is_img"] = 1;
-            } else {
-                $v["is_img"] = 0;
+        /* $where = [];
+          $where[] = ['tcf.mainId', '=', $id];
+          $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) {
+          $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;
+          } */
+        $time = "2022-10-14 23:59:59";
+        //营业执照
+        if (!$ecr["oldImgurl"]) {
+            $ecr["oldImgurl"] = $ep["imgurl"];
+        }
+        if ($ecr["oldImgurl"]) {
+            $pathinfo = pathinfo($ecr["oldImgurl"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldImgurl_is_img"] = 1;
             }
-            $v['url'] = getStoragePath($v['url']);
-            $_files[$v["api"]][] = $v;
         }
-
+        if (!$ecr["newImgurl"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessLicense"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newImgurl"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newImgurl"]) {
+            $pathinfo = pathinfo($ecr["newImgurl"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newImgurl_is_img"] = 1;
+            }
+        }
+        //备案表
+        if (!$ecr["oldBeian"]) {
+            $ecr["oldBeian"] = $ep["beian"];
+        }
+        if ($ecr["oldBeian"]) {
+            $pathinfo = pathinfo($ecr["oldBeian"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldBeian_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newBeian"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessBeian"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newBeian"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newBeian"]) {
+            $pathinfo = pathinfo($ecr["newBeian"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newBeian_is_img"] = 1;
+            }
+        }
+        //行业领域
+        if (!$ecr["oldDomainImg"]) {
+            $ecr["oldDomainImg"] = $ep["domainImg"];
+        }
+        if ($ecr["oldDomainImg"]) {
+            $pathinfo = pathinfo($ecr["oldDomainImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldDomainImg_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newDomainImg"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessDomain"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newDomainImg"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newDomainImg"]) {
+            $pathinfo = pathinfo($ecr["newDomainImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newDomainImg_is_img"] = 1;
+            }
+        }
+        //开户许可证
+        if (!$ecr["oldBankImg"]) {
+            $ecr["oldBankImg"] = $ep["bankImg"];
+        }
+        if ($ecr["oldBankImg"]) {
+            $pathinfo = pathinfo($ecr["oldBankImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldBankImg_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newBankImg"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessBank"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newBankImg"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newBankImg"]) {
+            $pathinfo = pathinfo($ecr["newBankImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newBankImg_is_img"] = 1;
+            }
+        }
+        $ecr["special"] = $ep->special;
         switch ($ep->special) {
             case 0:
                 if (\StrUtil::isNotEmpAndNull($ecr['oldEnterpriseTag']) || \StrUtil::isNotEmpAndNull($ecr['newEnterpriseTag'])) {
@@ -154,10 +235,10 @@ class EnterpriseChangeRecord extends AdminController {
                     $industry = DictApi::findDictByCode($ecr['newEnterpriseType']);
                     $ecr['newEnterpriseTypeName'] = $industry['name'];
                 }
-                return view("", ['ecr' => $ecr, 'files' => $_files]);
+                return view("", ['ecr' => $ecr]);
                 break;
             case 1:
-                return view("", ['ecr' => $ecr, 'files' => $_files]);
+                return view("", ['ecr' => $ecr]);
                 break;
             default:
 
@@ -172,16 +253,29 @@ class EnterpriseChangeRecord extends AdminController {
         }
         $ecr = EnterpriseApi::getOneRecord($id);
         $ep = EnterpriseApi::getOne($ecr['mainId']);
-        $fields = ["Name" => "单位名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "单位地址", "Street" => "所属街道", "Ephone" => "单位电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
-            "IndustryFieldNew" => "产业领域", "IndustryFieldOld" => "行业领域", "EnterpriseTag" => "单位标签", "EnterpriseType" => "单位类型",
-            "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+        if ($ep->special == 0) {
+            if ($ep->type == 1) {
+                $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
+                    "IndustryFieldNew" => "产业领域", "IndustryFieldOld" => "行业领域", "EnterpriseTag" => "企业标签", "EnterpriseType" => "企业类型",
+                    "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+                $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证", "newDomainImg" => "行业领域佐证材料", "newBeian" => "人才联络员信息备案表"];
+            } else {
+                $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
+                    "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+                $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证", "newBeian" => "人才联络员备案表"];
+            }
+        } else {
+            $fields = ["Name" => "单位名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "单位地址", "Street" => "所属街道", "Ephone" => "单位电话", "BankCard" => "单位银行账号", "Bank" => "单位开户银行", "BankNetwork" => "单位开户银行网点",
+                "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
+            $files = ["newImgurl" => "法人证或批文", "newBankImg" => "开户许可证", "newBeian" => "人才联络员备案表"];
+        }
         $modify_fields = [];
         foreach ($fields as $key => $value) {
             $oldFieldName = "old" . $key;
             $newFieldName = "new" . $key;
-            if ($ecr[$oldFieldName] != $ecr[$newFieldName]) {
-                $modify_fields[$newFieldName] = ["field" => $newFieldName, "name" => $value, "checked" => false];
-            }
+            //if ($ecr[$oldFieldName] != $ecr[$newFieldName]) {
+            $modify_fields[$newFieldName] = ["field" => $newFieldName, "name" => $value, "checked" => false];
+            //}
         }
         if ($ecr["modify_fields"]) {
             $_modify_fields = explode(",", $ecr["modify_fields"]);
@@ -193,27 +287,33 @@ class EnterpriseChangeRecord extends AdminController {
                 }
             }
         }
-        $currencyType = $ep["special"] == 0 ? "enterpriseChange" : "governmentChange";
-        $where = [];
-        $where[] = ["type", "=", $currencyType];
-        $where[] = ["active", "=", 1];
+        /* $currencyType = $ep["special"] == 0 ? "enterpriseChange" : "governmentChange";
+          $where = [];
+          $where[] = ["type", "=", $currencyType];
+          $where[] = ["active", "=", 1];
 
-        $fileTypes = \app\admin\model\CurrencyFiletype::where($where)->order("sn asc")->column("name", "id");
+          $fileTypes = \app\admin\model\CurrencyFiletype::where($where)->order("sn asc")->column("name", "id");
 
-        $where = [];
-        $where[] = ['mainId', '=', $id];
-        $uploadTypeIds = TalentCommonFile::distinct(true)->field("typeId")->where($where)->column("typeId");
+          $where = [];
+          $where[] = ['mainId', '=', $id];
+          $uploadTypeIds = TalentCommonFile::distinct(true)->field("typeId")->where($where)->column("typeId"); */
+        $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
+            "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
         $modify_files = [];
-        foreach ($uploadTypeIds as $typeId) {
-            $modify_files[$typeId] = ["typeId" => $typeId, "name" => $fileTypes[$typeId], "checked" => false];
+        foreach ($files as $key => $value) {
+            $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => false];
         }
         if ($ecr["modify_files"]) {
             $_modify_files = explode(",", $ecr["modify_files"]);
-            foreach ($_modify_files as $_typeId) {
-                if ($modify_files[$_typeId]) {
-                    $modify_files[$_typeId]["checked"] = true;
+            foreach ($_modify_files as $_file) {
+                if ($modify_files[$_file]) {
+                    $modify_files[$_file]["checked"] = true;
                 } else {
-                    $modify_files[$_typeId] = ["typeId" => $_typeId, "name" => $fileTypes[$_typeId], "checked" => true];
+                    if (strtotime($ecr["createTime"]) < strtotime("2022-10-14 23:59:59")) {
+                        //兼容旧的typeid
+                        $_file = $oldtypes[$_file];
+                    }
+                    $modify_files[$_file] = ["field" => $_file, "name" => $files[$_file], "checked" => true];
                 }
             }
         }
@@ -326,31 +426,35 @@ class EnterpriseChangeRecord extends AdminController {
             $ep->bank = $ecr['newBank'];
             $ep->updateUser = session('user')['uid'];
             $ep->updateTime = date("Y-m-d H:i:s");
+            $ep->imgurl = $ecr['newImgurl'] ?: $ep->imgurl;
+            $ep->bankImg = $ecr['newBankImg'] ?: $ep->bankImg;
+            $ep->domainImg = $ecr['newDomainImg'] ?: $ep->domainImg;
+            $ep->beian = $ecr['newBeian'] ?: $ep->beian;
             //查询此次上传的文件
-            $list = TalentCommonFile::where('mainId', $ecr['id'])->select()->toArray();
-            if (count($list) > 0) {
-                foreach ($list as $k => $v) {
-                    $fileInfo = CurrentcyFileType::where('id', $v['typeId'])->select()->toArray();
-                    if (count($fileInfo) > 0) {
-                        foreach ($fileInfo as $item) {
-                            switch ($item['api']) {
-                                case 'businessLicense':
-                                    $ep->imgurl = $v['url'];
-                                    break;
-                                case 'businessBank':
-                                    $ep->bankImg = $v['url'];
-                                    break;
-                                case 'businessDomain':
-                                    $ep->domainImg = $v['url'];
-                                    break;
-                                case 'businessBeian':
-                                    $ep->beian = $v['url'];
-                                    break;
-                            }
-                        }
-                    }
-                }
-            }
+            /* $list = TalentCommonFile::where('mainId', $ecr['id'])->select()->toArray();
+              if (count($list) > 0) {
+              foreach ($list as $k => $v) {
+              $fileInfo = CurrentcyFileType::where('id', $v['typeId'])->select()->toArray();
+              if (count($fileInfo) > 0) {
+              foreach ($fileInfo as $item) {
+              switch ($item['api']) {
+              case 'businessLicense':
+              $ep->imgurl = $v['url'];
+              break;
+              case 'businessBank':
+              $ep->bankImg = $v['url'];
+              break;
+              case 'businessDomain':
+              $ep->domainImg = $v['url'];
+              break;
+              case 'businessBeian':
+              $ep->beian = $v['url'];
+              break;
+              }
+              }
+              }
+              }
+              } */
             //同步人才库与津贴库  TODO
             $ep->save();
             //发送短信

+ 86 - 53
app/admin/view/enterprise_change_record/goto_enterprise_change_detail_page.html

@@ -52,7 +52,7 @@
     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;align-items:flex-start;}
-    ul.files li{background:#ddd;overflow:hidden;position:relative;margin-right:10px;float:left;border:1px solid #ddd;}
+    ul.files li{overflow:hidden;position:relative;margin-right:10px;float:left;}
     ul.yyzz li{width:100px;}
     ul.khxkz li{width:100px;}
     ul.hyly li{width:100px;}
@@ -67,12 +67,12 @@
                 <input type="hidden" id="id" name="id" value="{$ecr.id}"/>
                 <input type="hidden" id="type" name="type" value="{$ecr.type}"/>
                 <input type="hidden" id="checkState" name="checkState" value="{$ecr.checkState}"/>
-                <div class="panel-heading">单位信息</div>
+                <div class="panel-heading">{eq name="ecr.special" value="0"}企业{else/}单位{/eq}信息</div>
                 <div class="panel-body">
                     <table style="width:100%" class="table table-bordered">
                         <tr>
                             <td class="key">
-                                单位名称
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}名称
                             </td>
                             <td class="value1" data-old='{$ecr.oldName}' data-new='{$ecr.newName}'></td>
                             <td class="key">
@@ -81,29 +81,36 @@
                             <td class="value1" style="border-right: 1px solid #c0a16b" data-old='{$ecr.oldIdCard}' data-new='{$ecr.newIdCard}'></td>
                             <td rowspan="3" style="border: 1px solid #c0a16b;width: 300px">
                                 <label>
-                                    营业执照<br />
-                                    (事业单位法人证或批文)
+                                    {eq name="ecr.special" value="0"}营业执照{else/}事业单位法人证或批文{/eq}
                                 </label>
                                 <ul class="files yyzz">
-                                    {if condition="$ecr['imgurl']"}                                    
+                                    {if condition="$ecr['oldImgurl'] eq $ecr['newImgurl']"}
                                     <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>
+                                        {if condition="$ecr['oldImgurl_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldImgurl|getStoragePath}" style="max-width:100px;">
                                         {else/}
-                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.imgurl|getStoragePath}', 'imgurl')">点击查看(旧)</button>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldImgurl']"}
+                                    <li>
+                                        {if condition="$ecr['oldImgurl_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldImgurl|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;"><i class="old">旧</i>
                                         {/if}
                                     </li>
                                     {/if}
-                                    {if condition="$files['businessLicense']"}
-                                    {volist name="$files['businessLicense']" id="file"}
+                                    {if condition="$ecr['newImgurl']"}
                                     <li>
-                                        {if condition="$file['is_img']"}
-                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {if condition="$ecr['newImgurl_is_img'] eq 1"}
+                                        <img src="{$ecr.newImgurl|getStoragePath}" 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>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;"><i class="new">新</i>
                                         {/if}
                                     </li>
-                                    {/volist}
+                                    {/if}
                                     {/if}
                                 </ul>
                             </td>
@@ -116,7 +123,7 @@
                                 {$ep.legal}
                             </td>
                             <td class="key">
-                                单位地址
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}地址
                             </td>
                             <td class="value1 word-wrap" data-old='{$ecr.oldAddress}' data-new='{$ecr.newAddress}'></td>
                         </tr>
@@ -126,17 +133,17 @@
                             </td>
                             <td class="value1" data-old='{$ecr.oldStreetName}' data-new='{$ecr.newStreetName}'></td>
                             <td class="key">
-                                单位电话
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}电话
                             </td>
                             <td class="value1" data-old='{$ecr.oldEphone}' data-new='{$ecr.newEphone}'></td>
                         </tr>
                         <tr>
                             <td class="key">
-                                企业银行账号
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}银行账号
                             </td>
                             <td class="value1" data-old='{$ecr.oldBankCard}' data-new='{$ecr.newBankCard}'></td>
                             <td class="key">
-                                企业开户银行
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行
                             </td>
                             <td class="value1" style="border-right: 1px solid #c0a16b" data-old='{$ecr.oldBank}' data-new='{$ecr.newBank}'></td>
                             <td style="border: 1px solid #c0a16b" rowspan="2">
@@ -144,32 +151,40 @@
                                     开户许可证
                                 </label>
                                 <ul class="files khxkz">
-                                    {if condition="$ecr['bankImg']"}                                    
+                                    {if condition="$ecr['oldBankImg'] eq $ecr['newBankImg']"}
                                     <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>
+                                        {if condition="$ecr['oldBankImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBankImg|getStoragePath}" style="max-width:100px;">
                                         {else/}
-                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.bankImg|getStoragePath}', 'bankImg')">点击查看(旧)</button>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldBankImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldBankImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBankImg|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;"><i class="old">旧</i>
                                         {/if}
                                     </li>
                                     {/if}
-                                    {if condition="$files['businessBank']"}
-                                    {volist name="$files['businessBank']" id="file"}
+                                    {if condition="$ecr['newBankImg']"}
                                     <li>
-                                        {if condition="$file['is_img']"}
-                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {if condition="$ecr['newBankImg_is_img'] eq 1"}
+                                        <img src="{$ecr.newBankImg|getStoragePath}" 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>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;"><i class="new">新</i>
                                         {/if}
                                     </li>
-                                    {/volist}
+                                    {/if}
                                     {/if}
                                 </ul>
                             </td>
                         </tr>
                         <tr>
                             <td class="key">
-                                企业开户银行网点
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行网点
                             </td>
                             <td class="value1" colspan="3" data-old='{$ecr.oldBankNetwork}' data-new='{$ecr.newBankNetwork}'></td>
                         </tr>
@@ -192,6 +207,7 @@
                                 {/switch}
                             </td>
                         </tr>
+                        {if condition="$ecr['type'] eq 1"}
                         <tr class="type1">
                             <td class="key">
                                 产业领域
@@ -207,38 +223,47 @@
                         </tr>
                         <tr class="type1">
                             <td class="key">
-                                单位标签
+                                企业标签
                             </td>
                             <td class="value1" data-old="{$ecr.oldEnterpriseTagName}" data-new="{$ecr.newEnterpriseTagName}"></td>
                             <td class="key">
-                                单位类型
+                                企业类型
                             </td>
                             <td class="value1" data-old="{$ecr.oldEnterpriseTypeName}" data-new="{$ecr.newEnterpriseTypeName}"></td>
                             <td>
                                 <ul class="files hyly">
-                                    {if condition="$ecr['domainImg']"}                                    
+                                    {if condition="$ecr['oldDomainImg'] eq $ecr['newDomainImg']"}
                                     <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>
+                                        {if condition="$ecr['oldDomainImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldDomainImg|getStoragePath}" style="max-width:100px;">
                                         {else/}
-                                        <button type="button" class="btn btn-danger" onclick="Feng.showPdf('{$ecr.domainImg|getStoragePath}', 'domainImg')">点击查看(旧)</button>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldDomainImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldDomainImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldDomainImg|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;"><i class="old">旧</i>
                                         {/if}
                                     </li>
                                     {/if}
-                                    {if condition="$files['businessDomain']"}
-                                    {volist name="$files['businessDomain']" id="file"}      
+                                    {if condition="$ecr['newDomainImg']"}
                                     <li>
-                                        {if condition="$file['is_img']"}
-                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {if condition="$ecr['newDomainImg_is_img'] eq 1"}
+                                        <img src="{$ecr.newDomainImg|getStoragePath}" 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>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;"><i class="new">新</i>
                                         {/if}
                                     </li>
-                                    {/volist}
+                                    {/if}
                                     {/if}
                                 </ul>
                             </td>
                         </tr>
+                        {/if}
                     </table>
                 </div>
             </div>
@@ -269,25 +294,33 @@
                             </td>
                             <td style="text-align: left">
                                 <ul class="files beian">
-                                    {if condition="$ecr['beian']"}
+                                    {if condition="$ecr['oldBeian'] eq $ecr['newBeian']"}
+                                    <li>
+                                        {if condition="$ecr['oldBeian_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBeian|getStoragePath}" style="max-width:100px;">
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBeian|getStoragePath}', 'beian')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldBeian']"}
                                     <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>
+                                        {if condition="$ecr['oldBeian_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBeian|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
                                         {else/}
-                                        <button type="button" class="btn btn-danger" onclick="Feng.showFile('{$ecr.beian|getStoragePath}', 'beian')">点击查看(旧)</button>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBeian|getStoragePath}', 'beian')" style="max-width:100px;"><i class="old">旧</i>
                                         {/if}
                                     </li>
-                                    {/if}                                
-                                    {if condition="$files['businessBeian']"}
-                                    {volist name="$files['businessBeian']" id="file"}
+                                    {/if}
+                                    {if condition="$ecr['newBeian']"}
                                     <li>
-                                        {if condition="$file['is_img']"}
-                                        <img src="{$file.url}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {if condition="$ecr['newBeian_is_img'] eq 1"}
+                                        <img src="{$ecr.newBeian|getStoragePath}" 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>
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newBeian|getStoragePath}', 'beian')" style="max-width:100px;"><i class="new">新</i>
                                         {/if}
                                     </li>
-                                    {/volist}
+                                    {/if}
                                     {/if}
                                 </ul>
                             </td>

+ 1 - 1
app/admin/view/enterprise_change_record/goto_enterprise_change_examine_page.html

@@ -43,7 +43,7 @@
                     <div id="field_file">
                         <ul style="overflow:hidden;list-style:none;">
                             {volist name="files" id="file"}
-                            <li style="float:left;margin-right:10px;"><input type="checkbox" value="{$file.typeId}" {if condition="$file['checked']"}checked="true"{/if}><span>{$file.name}</span></li>
+                            <li style="float:left;margin-right:10px;"><input type="checkbox" value="{$file.field}" {if condition="$file['checked']"}checked="true"{/if}><span>{$file.name}</span></li>
                             {/volist}
                         </ul>
                     </div>

+ 5 - 1
app/common.php

@@ -315,7 +315,11 @@ function isImage($filename) {
 }
 
 function chkEnterpriseFull($ep) {
-    $checkEnterpriseFullFields = ["industryFieldNew", "enterpriseType", "bankCard", "bankNetwork", "bank", "bankImg", "domainImg", "beian"];
+    if ($ep["type"] == 1) {
+        $checkEnterpriseFullFields = ["industryFieldNew", "enterpriseType", "bankCard", "bankNetwork", "bank", "imgurl", "bankImg", "domainImg", "beian"];
+    } else {
+        $checkEnterpriseFullFields = ["bankCard", "bankNetwork", "bank", "imgurl", "bankImg", "beian"];
+    }
     $errorCounts = 0;
     while ($chk = array_shift($checkEnterpriseFullFields)) {
         if ($ep[$chk] == null)

+ 18 - 20
app/common/validate/Enterprise.php

@@ -1,18 +1,17 @@
 <?php
+
 namespace app\common\validate;
 
 use think\Validate;
 
-class Enterprise extends Validate{
-
+class Enterprise extends Validate {
 
-
-    protected $rule =   [
+    protected $rule = [
         'username' => 'require|max:50|unique:un_enterprise',
         'password' => 'require|min:8|regex:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$/',
         're_password' => 'require|confirm:password',
         'name' => 'require|max:100|unique:un_enterprise|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u',
-        'idCard' => ['require','unique:un_enterprise','regex:/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/'],
+        'idCard' => ['require', 'unique:un_enterprise', 'regex:/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/'],
         'type' => 'require',
         'industryFieldNew' => 'require',
         'enterpriseTag' => 'require',
@@ -29,8 +28,7 @@ class Enterprise extends Validate{
         'bank' => 'require|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u',
         'bankNetwork' => 'require|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u'
     ];
-
-    protected $message  =   [
+    protected $message = [
         'username.require' => '请填写账号!',
         'username.max' => '账号最多50个字符!',
         'username.unique' => '该账号已被注册',
@@ -40,11 +38,11 @@ class Enterprise extends Validate{
         're_password.require' => '请输入重复密码',
         're_password.confirm' => '两次密码输入不一致',
         'name.require' => '请输入单位名称',
-        'name.max'     => '单位名称最多100个字符!',
+        'name.max' => '单位名称最多100个字符!',
         'name.unique' => '该单位名称已存在',
         'name.regex' => '单位名称只能是中文',
-        'idCard.require'   => '请填写统一社会信用代码!',
-        'idCard.regex'  => '统一社会信用代码不正确!',
+        'idCard.require' => '请填写统一社会信用代码!',
+        'idCard.regex' => '统一社会信用代码不正确!',
         'idCard.unique' => '该统一社会信用代码已存在',
         'type.require' => '申报类型必须选择',
         'industryFieldNew.require' => '产业领域必须选择',
@@ -59,22 +57,22 @@ class Enterprise extends Validate{
         'address.require' => '请输入单位地址',
         'ephone.require' => '请输入单位电话',
         'agentEmail|require' => '请输入邮箱',
-        'agentEmail.email'        => '邮箱格式错误',
+        'agentEmail.email' => '邮箱格式错误',
         'bankCard.require' => '请输入企业银行账号',
         'bank.require' => '请输入企业开户银行',
         'bankNetwork.require' => '请输入企业开户银行网点',
         'bank.regex' => '开户银行不正确,请检查',
         'bankNetwork.regex' => '开户银行网点不正确,请检查'
-
     ];
-
     protected $scene = [
-        'add'  =>  ['username','password','re_password','name','idCard','type','industryFieldNew','enterpriseTag','enterpriseType','agentName','agentPhone','verificationCode','legal','street','address','ephone','agentEmail','bankCard','bank','bankNetwork'],
-        'change' => ['name','idCard','industryFieldNew','enterpriseTag','enterpriseType','agentName','agentPhone','legal','street','address','ephone','agentEmail','bankCard','bank','bankNetwork'],
+        'add' => ['username', 'password', 're_password', 'name', 'idCard', 'type', 'industryFieldNew', 'enterpriseTag', 'enterpriseType', 'agentName', 'agentPhone', 'verificationCode', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
+        'change' => ['name', 'idCard', 'industryFieldNew', 'enterpriseTag', 'enterpriseType', 'agentName', 'agentPhone', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
         'changePwd' => ['password'],
-        'check_common' => ['name','idCard','industryFieldNew','enterpriseTag','enterpriseType','agentName','legal','street','address','ephone','agentEmail','bankCard','bank','bankNetwork'],
-        'jc_add' => ['username','password','re_password','name','idCard','type','agentName','agentPhone','verificationCode','legal','street','address','ephone','agentEmail','bankCard','bank','bankNetwork'],
-        'sy_add' => ['username','password','re_password','name','verificationCode','street','address','ephone','agentEmail'],
-        'sy_change' => ['name','agentName','agentPhone','street','address','ephone','agentEmail']
+        'check_common' => ['name', 'idCard', 'industryFieldNew', 'enterpriseTag', 'enterpriseType', 'agentName', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
+        'jc_add' => ['username', 'password', 're_password', 'name', 'idCard', 'type', 'agentName', 'agentPhone', 'verificationCode', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork'],
+        'sy_add' => ['username', 'password', 're_password', 'name', 'verificationCode', 'street', 'address', 'ephone', 'agentEmail'],
+        'sy_change' => ['name', 'agentName', 'agentPhone', 'street', 'address', 'ephone', 'agentEmail'],
+        'jc_change' => ['name', 'idCard', 'agentName', 'agentPhone', 'legal', 'street', 'address', 'ephone', 'agentEmail', 'bankCard', 'bank', 'bankNetwork']
     ];
-}
+
+}

+ 235 - 63
app/enterprise/controller/Api.php

@@ -44,6 +44,7 @@ class Api extends EnterpriseController {
     public function toAdd() {
         $ep = Enterprise::where('id', session("user")["uid"])->find();
         $ecr = [
+            "special" => $ep["special"],
             'enterprise_id' => $ep['id'],
             'newName' => $ep['name'],
             'newIdCard' => $ep['idCard'],
@@ -111,14 +112,13 @@ class Api extends EnterpriseController {
             default:
                 $ecr['checkStateName'] = '';
         }
-
         //20220918增加根据不同的企业类型显示不同的信息变更界面
         switch ($ep->special) {
             case 0:
                 return view("", ['ecr' => $ecr]);
                 break;
             case 1:
-                return view("to_add1", ['ecr' => $ecr]);
+                return view("", ['ecr' => $ecr]);
                 break;
             default:
 
@@ -159,7 +159,11 @@ class Api extends EnterpriseController {
             $ep = Enterprise::where('id', session("user")["uid"])->find();
             switch ($ep->special) {
                 case 0:
-                    validate(\app\common\validate\Enterprise::class)->batch(true)->scene('change')->check($data);
+                    if ($ep->type == 2) {
+                        validate(\app\common\validate\Enterprise::class)->batch(true)->scene('jc_change')->check($data);
+                    } else {
+                        validate(\app\common\validate\Enterprise::class)->batch(true)->scene('change')->check($data);
+                    }
                     break;
                 case 1:
                     validate(\app\common\validate\Enterprise::class)->batch(true)->scene('sy_change')->check($data);
@@ -216,6 +220,10 @@ class Api extends EnterpriseController {
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => session("user")["uid"]
                 ];
+                $record_data["newImgurl"] = $ep["imgurl"];
+                $record_data["newBankImg"] = $ep["bankImg"];
+                $record_data["newDomainImg"] = $ep["domainImg"];
+                $record_data["newBeian"] = $ep["beian"];
                 $files = $this->request->file();
                 if ($files) {
                     $uploadapi = new UploadApi();
@@ -225,8 +233,6 @@ class Api extends EnterpriseController {
                             return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
                         }
                         $record_data["newImgurl"] = $upload_result->filepath;
-                    } else {
-                        $record_data["newImgurl"] = $ep["imgurl"];
                     }
 
                     //检验附件 开户许可证
@@ -236,8 +242,6 @@ class Api extends EnterpriseController {
                             return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
                         }
                         $record_data["newBankImg"] = $upload_result1->filepath;
-                    } else {
-                        $record_data["newBankImg"] = $ep["bankImg"];
                     }
 
                     //检验附件 行业领域佐证材料
@@ -247,8 +251,6 @@ class Api extends EnterpriseController {
                             return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
                         }
                         $record_data["newDomainImg"] = $upload_result2->filepath;
-                    } else {
-                        $record_data["newDomainImg"] = $ep["domainImg"];
                     }
 
                     //检验附件 人才联络员备案表
@@ -258,10 +260,22 @@ class Api extends EnterpriseController {
                             return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
                         }
                         $record_data["newBeian"] = $upload_result3->filepath;
-                    } else {
-                        $record_data["newBeian"] = $ep["beian"];
                     }
                 }
+                if (!$record_data["newImgurl"]) {
+                    throw new ValidateException("请上传营业执照");
+                }
+                if ($ep->special == 0) {
+                    if (!$record_data["newBankImg"]) {
+                        throw new ValidateException("请上传开户许可证");
+                    }
+                    if ($ep->type == 1 && !$record_data["newDomainImg"]) {
+                        throw new ValidateException("请上传行业领域佐证材料");
+                    }
+                }
+                if (!$record_data["newBeian"]) {
+                    throw new ValidateException("请上传人才联络员信息备案表");
+                }
                 EnterpriseRecord::create($record_data);
                 $log = [
                     'id' => getStringId(),
@@ -322,58 +336,77 @@ class Api extends EnterpriseController {
                         $record[$fields[$i]] = $data[$key]; //仅可修改选择的字段
                     }
                 }
-
+                $record["newImgurl"] = $record["newImgurl"] ?: $ep["imgurl"];
+                $record["newBankImg"] = $record["newBankImg"] ?: $ep["bankImg"];
+                $record["newDomainImg"] = $record["newDomainImg"] ?: $ep["domainImg"];
+                $record["newBeian"] = $record["newBeian"] ?: $ep["beian"];
                 $files = $this->request->file();
                 if ($files) {
                     $uploadapi = new UploadApi();
                     $modify_files = array_filter(explode(",", $record->modify_files));
-                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("imgurl", $modify_files)) ? true : false;
+                    if (strtotime($record->createTime) < strtotime("2022-10-14 23:59:59")) {
+                        //旧typeid需要转换成新的禁用文件格式
+                        $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
+                            "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
+                        foreach ($modify_files as $key => $_typeId) {
+                            if ($oldtypes[$_typeId]) {
+                                $modify_files[$key] = $oldtypes[$_typeId];
+                            }
+                        }
+                    }
+                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newImgurl", $modify_files)) ? true : false;
                     if (array_key_exists('imgurl', $files) && $uploadAllowed) {
                         $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
                         if ($upload_result->code == 500) {
                             return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
                         }
                         $record["newImgurl"] = $upload_result->filepath;
-                    } else {
-                        $record["newImgurl"] = $ep["imgurl"];
                     }
 
                     //检验附件 开户许可证
-                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("bankImg", $modify_files)) ? true : false;
+                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBankImg", $modify_files)) ? true : false;
                     if (array_key_exists('bankImg', $files) && $uploadAllowed) {
                         $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
                         if ($upload_result1->code == 500) {
                             return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
                         }
                         $record["newBankImg"] = $upload_result1->filepath;
-                    } else {
-                        $record["newBankImg"] = $ep["bankImg"];
                     }
 
                     //检验附件 行业领域佐证材料
-                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("domainImg", $modify_files)) ? true : false;
+                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newDomainImg", $modify_files)) ? true : false;
                     if (array_key_exists('domainImg', $files) && $uploadAllowed) {
                         $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
                         if ($upload_result2->code == 500) {
                             return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
                         }
                         $record["newDomainImg"] = $upload_result2->filepath;
-                    } else {
-                        $record["newDomainImg"] = $ep["domainImg"];
                     }
 
                     //检验附件 人才联络员备案表
-                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("beian", $modify_files)) ? true : false;
+                    $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBeian", $modify_files)) ? true : false;
                     if (array_key_exists('beian', $files) && $uploadAllowed) {
                         $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
                         if ($upload_result3->code == 500) {
                             return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
                         }
                         $record["newBeian"] = $upload_result3->filepath;
-                    } else {
-                        $record["newBeian"] = $ep["beian"];
                     }
                 }
+                if (!$record["newImgurl"]) {
+                    throw new ValidateException("请上传营业执照");
+                }
+                if ($ep->special == 0) {
+                    if (!$record["newBankImg"]) {
+                        throw new ValidateException("请上传开户许可证");
+                    }
+                    if ($ep->type == 1 && !$record["newDomainImg"]) {
+                        throw new ValidateException("请上传行业领域佐证材料");
+                    }
+                }
+                if (!$record["newBeian"]) {
+                    throw new ValidateException("请上传人才联络员信息备案表");
+                }
 
                 $record->updateTime = date("Y-m-d H:i:s");
                 $record->updateUser = session("user")["uid"];
@@ -405,7 +438,7 @@ class Api extends EnterpriseController {
             //return json($res);
         } catch (ValidateException $e) {
             $response_object->code = 500;
-            $response_object->msg = implode("<br>",$e->getError());
+            $response_object->msg = is_array($e->getError()) ? implode("<br>", $e->getError()) : $e->getError();
             return \StrUtil::back($response_object, "EpChangeEdit.callBack");
             //return json(["msg" => array_pop($error), 'code' => 500]);
         }
@@ -415,13 +448,37 @@ class Api extends EnterpriseController {
         $id = trim($this->request['id']);
         $ecr = EnterpriseRecord::findOrEmpty($id);
         $ep = Enterprise::where('id', $ecr->mainId)->find();
-
+        $ecr["special"] = $ep["special"];
+        if ($ecr["newImgurl"]) {
+            $extension = pathinfo($ecr["newImgurl"])["extension"];
+            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["imgurl_is_img"] = 1;
+            }
+        }
+        if ($ecr["newBankImg"]) {
+            $extension = pathinfo($ecr["newBankImg"])["extension"];
+            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["bankImg_is_img"] = 1;
+            }
+        }
+        if ($ecr["newDomainImg"]) {
+            $extension = pathinfo($ecr["newDomainImg"])["extension"];
+            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["domainImg_is_img"] = 1;
+            }
+        }
+        if ($ecr["newBeian"]) {
+            $extension = pathinfo($ecr["newBeian"])["extension"];
+            if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["beian_is_img"] = 1;
+            }
+        }
         switch ($ep->special) {
             case 0:
                 return view("", ['ecr' => $ecr]);
                 break;
             case 1:
-                return view("to_update1", ['ecr' => $ecr]);
+                return view("", ['ecr' => $ecr]);
                 break;
             default:
 
@@ -446,38 +503,38 @@ class Api extends EnterpriseController {
 
         $ep = EnterpriseApi::getOne($obj->mainId);
 
-        //20220918增加根据不同的企业类型显示不同的信息变更界面
-        switch ($ep->special) {
-            case 0:
-                $org_type = 'enterpriseChange';
-                break;
-            case 1:
-                $org_type = 'governmentChange';
-                break;
-            default:
-
-                break;
-        }
-
-        $list = CurrentcyFileType::where('type', $org_type)->where('active', 1)->select();
-        if (!$list || count($list) <= 0) {
-            return json(['msg' => '缺少附件', 'code' => 500]);
-        }
-        $error_msg = "";
-        foreach ($list as $k => $v) {
-            if ($v['must'] == 1) {
-                $count = TalentCommonFile::where('mainId', $id)->where('typeId', $v['id'])->count();
-                if ($count == 0) {
-                    if (strlen($error_msg) == 0) {
-                        $error_msg = "以下为必传附件:";
-                    }
-                    $error_msg .= $v['name'] . ";";
-                }
-            }
-        }
-        if (strlen($error_msg) > 0) {
-            return json(['msg' => $error_msg, 'code' => 500]);
-        }
+        //20220918增加根据不同的企业类型显示不同的信息变更界面|20221014废弃使用filetype
+        /* switch ($ep->special) {
+          case 0:
+          $org_type = 'enterpriseChange';
+          break;
+          case 1:
+          $org_type = 'governmentChange';
+          break;
+          default:
+
+          break;
+          }
+
+          $list = CurrentcyFileType::where('type', $org_type)->where('active', 1)->select();
+          if (!$list || count($list) <= 0) {
+          return json(['msg' => '缺少附件', 'code' => 500]);
+          }
+          $error_msg = "";
+          foreach ($list as $k => $v) {
+          if ($v['must'] == 1) {
+          $count = TalentCommonFile::where('mainId', $id)->where('typeId', $v['id'])->count();
+          if ($count == 0) {
+          if (strlen($error_msg) == 0) {
+          $error_msg = "以下为必传附件:";
+          }
+          $error_msg .= $v['name'] . ";";
+          }
+          }
+          }
+          if (strlen($error_msg) > 0) {
+          return json(['msg' => $error_msg, 'code' => 500]);
+          } */
         if ($obj['checkState'] == 3) {
             $obj['checkState'] = 5;
             $state = 5;
@@ -512,9 +569,127 @@ class Api extends EnterpriseController {
         $ecr = EnterpriseRecord::find($id);
         $ep = EnterpriseApi::getOne($ecr['mainId']);
         $streetList = DictApi::selectByParentCode('street');
+        $ecr["special"] = $ep["special"];
         $ecr['oldStreetName'] = $streetList[$ecr['oldStreet']];
         $ecr['newStreetName'] = $streetList[$ecr['newStreet']];
         //20220918增加根据不同的企业类型显示不同的信息变更界面
+        $time = "2022-10-14 23:59:59";
+        //营业执照
+        if (!$ecr["oldImgurl"]) {
+            $ecr["oldImgurl"] = $ep["imgurl"];
+        }
+        if ($ecr["oldImgurl"]) {
+            $pathinfo = pathinfo($ecr["oldImgurl"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldImgurl_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newImgurl"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessLicense"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newImgurl"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newImgurl"]) {
+            $pathinfo = pathinfo($ecr["newImgurl"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newImgurl_is_img"] = 1;
+            }
+        }
+        //备案表
+        if (!$ecr["oldBeian"]) {
+            $ecr["oldBeian"] = $ep["beian"];
+        }
+        if ($ecr["oldBeian"]) {
+            $pathinfo = pathinfo($ecr["oldBeian"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldBeian_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newBeian"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessBeian"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newBeian"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newBeian"]) {
+            $pathinfo = pathinfo($ecr["newBeian"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newBeian_is_img"] = 1;
+            }
+        }
+        //行业领域
+        if (!$ecr["oldDomainImg"]) {
+            $ecr["oldDomainImg"] = $ep["domainImg"];
+        }
+        if ($ecr["oldDomainImg"]) {
+            $pathinfo = pathinfo($ecr["oldDomainImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldDomainImg_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newDomainImg"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessDomain"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newDomainImg"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newDomainImg"]) {
+            $pathinfo = pathinfo($ecr["newDomainImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newDomainImg_is_img"] = 1;
+            }
+        }
+        //开户许可证
+        if (!$ecr["oldBankImg"]) {
+            $ecr["oldBankImg"] = $ep["bankImg"];
+        }
+        if ($ecr["oldBankImg"]) {
+            $pathinfo = pathinfo($ecr["oldBankImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["oldBankImg_is_img"] = 1;
+            }
+        }
+        if (!$ecr["newBankImg"]) {
+            //兼容旧filetype
+            if (strtotime($ecr["createTime"]) < strtotime($time)) {
+                $where = [];
+                $where[] = ["mainId", "=", $id];
+                $where[] = ["api", "=", "businessBank"];
+                $where[] = ["active", "=", 1];
+                $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("createTime desc")->find();
+                if ($_uploadFile) {
+                    $ecr["newBankImg"] = $_uploadFile["url"];
+                }
+            }
+        }
+        if ($ecr["newBankImg"]) {
+            $pathinfo = pathinfo($ecr["newBankImg"]);
+            if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
+                $ecr["newBankImg_is_img"] = 1;
+            }
+        }
         switch ($ep->special) {
             case 0:
                 $tagList = DictApi::selectByParentCode('enterprise_tag');
@@ -530,13 +705,10 @@ class Api extends EnterpriseController {
                 $ecr['newEnterpriseTypeName'] = $typeList[$ecr['newEnterpriseType']];
                 $ecr['oldIndustryFieldNewName'] = $industryFieldNew[$ecr['oldIndustryFieldNew']];
                 $ecr['newIndustryFieldNewName'] = $industryFieldNew[$ecr['newIndustryFieldNew']];
-
-
-
                 return view("", ['ecr' => $ecr]);
                 break;
             case 1:
-                return view("to_detail1", ['ecr' => $ecr]);
+                return view("", ['ecr' => $ecr]);
                 break;
             default:
 

+ 4 - 4
app/enterprise/controller/Base.php

@@ -86,10 +86,6 @@ class Base extends EnterpriseController {
             $filed_dict = \app\common\api\DictApi::getTalentFields(1);
             $no_empty = ["talent_type", "name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "experience", "education"];
 
-            $birthday = $param["birthday"];
-            $birthdayYear = substr($birthday, 0, 4);
-            $currentYear = date("Y");
-            $age = $currentYear - $birthdayYear;
 
             if (in_array($param["talent_type"], [1, 2])) {
                 $no_empty[] = "tax_insurance_month";
@@ -109,6 +105,10 @@ class Base extends EnterpriseController {
                 echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
                 exit;
             }
+            $birthday = $param["birthday"];
+            $birthdayYear = substr($birthday, 0, 4);
+            $currentYear = date("Y");
+            $age = $currentYear - $birthdayYear;
 
             $where = [];
             $where[] = ["step", "=", 1];

+ 35 - 1
app/enterprise/controller/Index.php

@@ -20,7 +20,17 @@ class Index extends EnterpriseController {
             "avatar" => $this->user["avatar"]
         ];
         $ep = \app\common\api\EnterpriseApi::getOne($this->user["uid"]);
-        $vars["isEnterpriseFull"] = $ep["special"] == 1 ? 1 : $ep["enterpriseTag"];
+        if ($ep["type"] == 1) {
+            $checkEnterpriseFullFields = ["industryFieldNew", "enterpriseType", "bankCard", "bankNetwork", "bank", "imgurl", "bankImg", "domainImg", "beian"];
+        } else {
+            $checkEnterpriseFullFields = ["bankCard", "bankNetwork", "bank", "imgurl", "bankImg", "beian"];
+        }
+        $errorCounts = 0;
+        while ($chk = array_shift($checkEnterpriseFullFields)) {
+            if ($ep[$chk] == null)
+                $errorCounts++;
+        }
+        $vars["isEnterpriseFull"] = $ep["special"] == 0 && $errorCounts > 0 ? 0 : 1;
         $menus = \app\common\api\MenuApi::getEnterpriseMenuByType($this->user["type"]);
         $vars["menus"] = $menus;
         return view("", $vars);
@@ -33,6 +43,30 @@ class Index extends EnterpriseController {
         $ep['enterpriseTagName'] = DictApi::findDictByCode($ep['enterpriseTag'])->name ?? '';
         $ep['streetName'] = DictApi::findDictByCode($ep['street'])->name ?? '';
         $ep['enterpriseTypeName'] = DictApi::findDictByCode($ep['enterpriseType'])->name ?? '';
+        if ($ep["imgurl"]) {
+            $pathinfo = pathinfo($ep["imgurl"]);
+            if (in_array($pathinfo["extension"], ["jpg", "jpeg", "png", "gif"])) {
+                $ep["imgurl_is_img"] = 1;
+            }
+        }
+        if ($ep["bankImg"]) {
+            $pathinfo = pathinfo($ep["bankImg"]);
+            if (in_array($pathinfo["extension"], ["jpg", "jpeg", "png", "gif"])) {
+                $ep["bankImg_is_img"] = 1;
+            }
+        }
+        if ($ep["domainImg"]) {
+            $pathinfo = pathinfo($ep["domainImg"]);
+            if (in_array($pathinfo["extension"], ["jpg", "jpeg", "png", "gif"])) {
+                $ep["domainImg_is_img"] = 1;
+            }
+        }
+        if ($ep["beian"]) {
+            $pathinfo = pathinfo($ep["beian"]);
+            if (in_array($pathinfo["extension"], ["jpg", "jpeg", "png", "gif"])) {
+                $ep["beian_is_img"] = 1;
+            }
+        }
         switch ($ep['type']) {
             case 1:
                 $ep['typeName'] = '晋江市现代产业体系人才';

+ 8 - 7
app/enterprise/view/api/to_add.html

@@ -30,6 +30,7 @@
 <div class="ibox float-e-margins">
     <div class="ibox-content">                                
         <form id="ecr_form" class="form-horizontal" target="hiddenIframe" action="" method="post" enctype="multipart/form-data">
+            <input type="hidden" id="special" name="special" value="{$ecr.special}"/>
             <input type="hidden" id="enterprise_id" name="enterprise_id" value="{$ecr.enterprise_id}"/>
             <input type="hidden" id="id" name="id" value="{$ecr.id}"/>
             <input type="hidden" id="type" name="type" value="{$ecr.type}"/>
@@ -41,7 +42,7 @@
                             <tr>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业名称</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}名称</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newName" name="newName" value="{$ecr.newName}"/>
                                     </div>
                                 </td>
@@ -59,7 +60,7 @@
                                 </td>
                                 <td rowspan="2" style="position:relative;">
                                     <button type="button" class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;" onclick="$('#imgurl').click()"><i class="fa fa-upload" aria-hidden="true"></i>上传文件</button>
-                                    <label class="control-label spacing"><span class="text-danger">*</span>营业执照</label>
+                                    <label class="control-label spacing"><span class="text-danger">*</span>{eq name="ecr.special" value="0"}营业执照{else/}事业单位法人证或批文{/eq}</label>
                                     {if condition="$ecr['imgurl']"}
                                     {eq name="ecr.imgurl_is_img" value="1"}
                                     <img src="{$ecr.imgurl|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)">
@@ -81,13 +82,13 @@
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业地址</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}地址</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newAddress" name="newAddress"  value="{$ecr.newAddress}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业电话</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}电话</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newEphone" name="newEphone" placeholder="固话格式0595xxxx" value="{$ecr.newEphone}"/>
                                     </div>
                                 </td>
@@ -95,19 +96,19 @@
                             <tr>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业银行账号</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}银行账号</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBankCard" name="newBankCard" value="{$ecr.newBankCard}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBank" name="newBank" value="{$ecr.newBank}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行网点</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行网点</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBankNetwork" name="newBankNetwork" placeholder="XX银行XX支行/分行/分理处" value="{$ecr.newBankNetwork}"/>
                                     </div>
                                 </td>

+ 301 - 307
app/enterprise/view/api/to_detail.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;
@@ -15,12 +16,6 @@
         font-weight: 400;
     }
 
-    .spacing {
-        margin-bottom: 10px;
-        padding-right: 4px;
-        padding-left: 4px;
-    }
-
     .imgs li {
         list-style: none;
         float: left;
@@ -28,310 +23,309 @@
         text-align: center;
         height: 30px;
     }
+
+
+    .spacing {
+        margin-bottom: 10px;
+        padding-right: 4px;
+        padding-left: 4px;
+        height: 30px;
+    }
+    table td{
+        text-align: center;
+    }
+    .key{
+        width: 150px;
+        text-align: right;
+        background-color: #f0f9eb;
+    }
+    .value1{
+        width: 240px;
+        text-align: left;
+    }
+    .word-wrap{
+        width:100%;
+        white-space:normal;
+        word-wrap:break-word;
+        word-break:break-all;
+    }
+    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;align-items:flex-start;}
+    ul.files li{overflow:hidden;position:relative;margin-right:10px;float:left;}
+    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>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
-        <div class="form-horizontal">
-            <div class="row">
-                <div class="col-sm-12">
-                    <div class="tabs-container">
-                        <ul class="nav nav-tabs">
-                            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">1.基本信息</a>
-                            </li>
-                            <li id="fileLi" class=""><a data-toggle="tab" href="#tab-2" onclick="ecre.initFileTable()"
-                                                        aria-expanded="false">2.附件上传</a></li>
-                        </ul>
-                    </div>
-                    <div class="tab-content">
-                        <div id="tab-1" class="tab-pane active">
-                            <div class="panel-body">
-                                <div class="panel panel-default">
-                                    <div class="panel-heading" onclick="$(this).next().toggle()">变更前机构信息</div>
-                                    <div class="panel-body">
-                                        <form id="ecr_form1" class="form-horizontal" target="hiddenIframe" action=""
-                                              method="post" enctype="multipart/form-data">
-                                            <input type="text" class="form-control" id="id" name="id" value="{$ecr.id}"
-                                                   style="display: none;"/>
-                                            <input type="text" class="form-control" id="type" name="type"
-                                                   value="{$ecr.type}" style="display: none;"/>
-                                            <input style="display: none;" type="text" class="form-control"
-                                                   id="checkState" name="checkState" value="{$ecr.checkState}"/>
-                                            <div class="col-sm-12 ">
-                                                <div class="row">
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位名称</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldName"
-                                                                   name="oldName" value="{$ecr.oldName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>统一社会信用代码</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldIdCard"
-                                                                   name="oldIdCard" value="{$ecr.oldIdCard}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>产业领域</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="oldIndustryFieldNew" name="oldIndustryFieldNew"
-                                                                   value="{$ecr.oldIndustryFieldNewName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>行业领域</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="oldIndustryFieldOld" name="oldIndustryFieldOld"
-                                                                   value="{$ecr.oldIndustryFieldOldName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位标签</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="oldEnterpriseTag" name="oldEnterpriseTag"
-                                                                   value="{$ecr.oldEnterpriseTagName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位类型</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="oldEnterpriseType" name="oldEnterpriseType"
-                                                                   value="{$ecr.oldEnterpriseTypeName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>法人代表</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldLegal"
-                                                                   name="oldLegal" value="{$ecr.oldLegal}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>所属街道</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldStreet"
-                                                                   name="oldStreet" value="{$ecr.oldStreetName}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位地址</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldAddress"
-                                                                   name="oldAddress" value="{$ecr.oldAddress}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位电话</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldEphone"
-                                                                   name="oldEphone" value="{$ecr.oldEphone}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>人才联络员</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldAgentName"
-                                                                   name="oldAgentName" value="{$ecr.oldAgentName}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>人才联络员电话</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldAgentPhone"
-                                                                   name="oldAgentPhone" value="{$ecr.oldAgentPhone}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>电子邮箱</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="oldAgentEmail"
-                                                                   name="oldAgentEmail" value="{$ecr.oldAgentEmail}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                </div>
-                                            </div>
-                                        </form>
-                                    </div>
-                                </div>
-                                <div class="panel panel-default">
-                                    <div class="panel-heading" onclick="$(this).next().toggle()">变更后机构信息</div>
-                                    <div class="panel-body">
-                                        <form id="ecr_form2" class="form-horizontal" target="hiddenIframe" action=""
-                                              method="post" enctype="multipart/form-data">
-                                            <div class="col-sm-12 ">
-                                                <div class="row">
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位名称</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newName"
-                                                                   name="newName" value="{$ecr.newName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>统一社会信用代码</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newIdCard"
-                                                                   name="newIdCard" value="{$ecr.newIdCard}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>产业领域</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="newIndustryFieldNew" name="newIndustryFieldNew"
-                                                                   value="{$ecr.newIndustryFieldNewName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>行业领域</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="newIndustryFieldOld" name="newIndustryFieldOld"
-                                                                   value="{$ecr.newIndustryFieldOldName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位标签</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="newEnterpriseTag" name="newEnterpriseTag"
-                                                                   value="{$ecr.newEnterpriseTagName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="display: none">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位类型</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control"
-                                                                   id="newEnterpriseType" name="newEnterpriseType"
-                                                                   value="{$ecr.newEnterpriseTypeName}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>法人代表</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newLegal"
-                                                                   name="newLegal" value="{$ecr.newLegal}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>所属街道</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newStreet"
-                                                                   name="newStreet" value="{$ecr.newStreetName}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位地址</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newAddress"
-                                                                   name="newAddress" value="{$ecr.newAddress}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>单位电话</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newEphone"
-                                                                   name="newEphone" value="{$ecr.newEphone}" readonly
-                                                                   disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>人才联络员</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newAgentName"
-                                                                   name="newAgentName" value="{$ecr.newAgentName}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>人才联络员电话</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newAgentPhone"
-                                                                   name="newAgentPhone" value="{$ecr.newAgentPhone}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                    <div class="rowGroup" style="margin-bottom: 0px;">
-                                                        <label class="col-sm-2 control-label spacing"><span
-                                                                class="text-danger">*</span>电子邮箱</label>
-                                                        <div class="col-sm-4 spacing">
-                                                            <input type="text" class="form-control" id="newAgentEmail"
-                                                                   name="newAgentEmail" value="{$ecr.newAgentEmail}"
-                                                                   readonly disabled/>
-                                                        </div>
-                                                    </div>
-                                                </div>
-                                            </div>
-                                        </form>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <div id="tab-2" class="tab-pane ">
-                            <table id="fileTable" class="table-condensed"
-                                   style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true"
-                                   data-click-to-select="true">
-                                <thead>
-                                <tr>
-                                    <th data-field="selectItem" data-checkbox="true"></th>
-                                </tr>
-                                </thead>
-                            </table>
-                            <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>
-                        </div>
-                    </div>
+        <div class="panel-body">
+            <div class="panel panel-default">
+                <input type="hidden" id="id" name="id" value="{$ecr.id}"/>
+                <input type="hidden" id="type" name="type" value="{$ecr.type}"/>
+                <input type="hidden" id="checkState" name="checkState" value="{$ecr.checkState}"/>
+                <div class="panel-heading">{eq name="ecr.special" value="0"}企业{else/}单位{/eq}信息</div>
+                <div class="panel-body">
+                    <table style="width:100%" class="table table-bordered">
+                        <tr>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}名称
+                            </td>
+                            <td class="value1" data-old='{$ecr.oldName}' data-new='{$ecr.newName}'></td>
+                            <td class="key">
+                                统一社会信用代码
+                            </td>
+                            <td class="value1" style="border-right: 1px solid #c0a16b" data-old='{$ecr.oldIdCard}' data-new='{$ecr.newIdCard}'></td>
+                            <td rowspan="3" style="border: 1px solid #c0a16b;width: 300px">
+                                <label>
+                                    {eq name="ecr.special" value="0"}营业执照{else/}事业单位法人证或批文{/eq}
+                                </label>
+                                <ul class="files yyzz">
+                                    {if condition="$ecr['oldImgurl'] eq $ecr['newImgurl']"}
+                                    <li>
+                                        {if condition="$ecr['oldImgurl_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldImgurl|getStoragePath}" style="max-width:100px;">
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldImgurl']"}
+                                    <li>
+                                        {if condition="$ecr['oldImgurl_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldImgurl|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;"><i class="old">旧</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {if condition="$ecr['newImgurl']"}
+                                    <li>
+                                        {if condition="$ecr['newImgurl_is_img'] eq 1"}
+                                        <img src="{$ecr.newImgurl|getStoragePath}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newImgurl|getStoragePath}', 'imgurl')" style="max-width:100px;"><i class="new">新</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {/if}
+                                </ul>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td class="key">
+                                法人代表
+                            </td>
+                            <td class="value1" data-old='{$ecr.oldLegal}' data-new='{$ecr.newLegal}'>
+                                {$ep.legal}
+                            </td>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}地址
+                            </td>
+                            <td class="value1 word-wrap" data-old='{$ecr.oldAddress}' data-new='{$ecr.newAddress}'></td>
+                        </tr>
+                        <tr>
+                            <td class="key">
+                                所属街道
+                            </td>
+                            <td class="value1" data-old='{$ecr.oldStreetName}' data-new='{$ecr.newStreetName}'></td>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}电话
+                            </td>
+                            <td class="value1" data-old='{$ecr.oldEphone}' data-new='{$ecr.newEphone}'></td>
+                        </tr>
+                        <tr>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}银行账号
+                            </td>
+                            <td class="value1" data-old='{$ecr.oldBankCard}' data-new='{$ecr.newBankCard}'></td>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行
+                            </td>
+                            <td class="value1" style="border-right: 1px solid #c0a16b" data-old='{$ecr.oldBank}' data-new='{$ecr.newBank}'></td>
+                            <td style="border: 1px solid #c0a16b" rowspan="2">
+                                <label>
+                                    开户许可证
+                                </label>
+                                <ul class="files khxkz">
+                                    {if condition="$ecr['oldBankImg'] eq $ecr['newBankImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldBankImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBankImg|getStoragePath}" style="max-width:100px;">
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldBankImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldBankImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBankImg|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;"><i class="old">旧</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {if condition="$ecr['newBankImg']"}
+                                    <li>
+                                        {if condition="$ecr['newBankImg_is_img'] eq 1"}
+                                        <img src="{$ecr.newBankImg|getStoragePath}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newBankImg|getStoragePath}', 'bankImg')" style="max-width:100px;"><i class="new">新</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {/if}
+                                </ul>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td class="key">
+                                {eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行网点
+                            </td>
+                            <td class="value1" colspan="3" data-old='{$ecr.oldBankNetwork}' data-new='{$ecr.newBankNetwork}'></td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
+        </div>
+        {if condition="$ecr['special'] == 0"}
+        <div class="panel-body">
+            <div class="panel panel-default">
+                <div class="panel-heading">申报信息</div>
+                <div class="panel-body">
+                    <table style="width:100%" class="table table-bordered">
+                        <tr>
+                            <td colspan="5">
+                                申报类型:
+                                {switch name="ecr.type"}
+                                {case value="1"}晋江市现代产业体系人才{/case}
+                                {case value="2"}集成电路优秀人才{/case}
+                                {/switch}
+                            </td>
+                        </tr>
+                        {if condition="$ecr['type'] eq 1"}
+                        <tr class="type1">
+                            <td class="key">
+                                产业领域
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldIndustryFieldNewName}" data-new="{$ecr.newIndustryFieldNewName}"></td>
+                            <td class="key">
+                                行业领域
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldIndustryFieldOldName}" data-new="{$ecr.newIndustryFieldOldName}"></td>
+                            <td class="key" style="text-align:center;">
+                                行业领域佐证材料
+                            </td>
+                        </tr>
+                        <tr class="type1">
+                            <td class="key">
+                                企业标签
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldEnterpriseTagName}" data-new="{$ecr.newEnterpriseTagName}"></td>
+                            <td class="key">
+                                企业类型
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldEnterpriseTypeName}" data-new="{$ecr.newEnterpriseTypeName}"></td>
+                            <td>
+                                <ul class="files hyly">
+                                    {if condition="$ecr['oldDomainImg'] eq $ecr['newDomainImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldDomainImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldDomainImg|getStoragePath}" style="max-width:100px;">
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldDomainImg']"}
+                                    <li>
+                                        {if condition="$ecr['oldDomainImg_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldDomainImg|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;"><i class="old">旧</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {if condition="$ecr['newDomainImg']"}
+                                    <li>
+                                        {if condition="$ecr['newDomainImg_is_img'] eq 1"}
+                                        <img src="{$ecr.newDomainImg|getStoragePath}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newDomainImg|getStoragePath}', 'domainImg')" style="max-width:100px;"><i class="new">新</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {/if}
+                                </ul>
+                            </td>
+                        </tr>
+                        {/if}
+                    </table>
+                </div>
+            </div>
+        </div>
+        {/if}
+        <div class="panel-body">
+            <div class="panel panel-default">
+                <div class="panel-heading">人才联络员信息</div>
+                <div class="panel-body">
+                    <table style="width:100%" class="table table-bordered">
+                        <tr>
+                            <td class="key">
+                                姓名
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldAgentName}" data-new="{$ecr.newAgentName}"></td>
+                            <td class="key">
+                                人才联络员电话
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldAgentPhone}" data-new="{$ecr.newAgentPhone}"></td>
+                        </tr>
+                        <tr>
+                            <td class="key">
+                                人才联络员邮箱
+                            </td>
+                            <td class="value1" data-old="{$ecr.oldAgentEmail}" data-new="{$ecr.newAgentEmail}"></td>
+                            <td class="key">
+                                人才联络员信息备案表
+                            </td>
+                            <td style="text-align: left">
+                                <ul class="files beian">
+                                    {if condition="$ecr['oldBeian'] eq $ecr['newBeian']"}
+                                    <li>
+                                        {if condition="$ecr['oldBeian_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBeian|getStoragePath}" style="max-width:100px;">
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBeian|getStoragePath}', 'beian')" style="max-width:100px;">
+                                        {/if}
+                                    </li>
+                                    {else/}
+                                    {if condition="$ecr['oldBeian']"}
+                                    <li>
+                                        {if condition="$ecr['oldBeian_is_img'] eq 1"}
+                                        <img onclick="Feng.showImg(this)" src="{$ecr.oldBeian|getStoragePath}" style="max-width:100px;"><i class="old">旧</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.oldBeian|getStoragePath}', 'beian')" style="max-width:100px;"><i class="old">旧</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {if condition="$ecr['newBeian']"}
+                                    <li>
+                                        {if condition="$ecr['newBeian_is_img'] eq 1"}
+                                        <img src="{$ecr.newBeian|getStoragePath}" onclick="Feng.showImg(this)" style="max-width:100px;"/><i class="new">新</i>
+                                        {else/}
+                                        <img src="/static/img/File.png" onclick="Feng.showPdf('{$ecr.newBeian|getStoragePath}', 'beian')" style="max-width:100px;"><i class="new">新</i>
+                                        {/if}
+                                    </li>
+                                    {/if}
+                                    {/if}
+                                </ul>
+                            </td>
+                        </tr>
+                    </table>
                 </div>
             </div>
         </div>

+ 20 - 19
app/enterprise/view/api/to_update.html

@@ -30,6 +30,7 @@
 <div class="ibox float-e-margins">
     <div class="ibox-content">                                
         <form id="ecr_form" class="form-horizontal" target="hiddenIframe" action="" method="post" enctype="multipart/form-data">
+            <input type="hidden" id="special" name="special" value="{$ecr.special}"/>
             <input type="hidden" id="enterprise_id" name="enterprise_id" value="{$ecr.mainId}"/>
             <input type="hidden" id="id" name="id" value="{$ecr.id}"/>
             <input type="hidden" id="type" name="type" value="{$ecr.type}"/>
@@ -44,7 +45,7 @@
                             <tr>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业名称</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}名称</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newName" name="newName" value="{$ecr.newName}"/>
                                     </div>
                                 </td>
@@ -62,12 +63,12 @@
                                 </td>
                                 <td rowspan="2" style="position:relative;">
                                     <button type="button" class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;" onclick="$('#imgurl').click()"><i class="fa fa-upload" aria-hidden="true"></i>上传文件</button>
-                                    <label class="control-label spacing"><span class="text-danger">*</span>营业执照</label>
-                                    {if condition="$ecr['imgurl']"}
+                                    <label class="control-label spacing"><span class="text-danger">*</span>{eq name="ecr.special" value="0"}营业执照{else/}事业单位法人证或批文{/eq}</label>
+                                    {if condition="$ecr['newImgurl']"}
                                     {eq name="ecr.imgurl_is_img" value="1"}
-                                    <img src="{$ecr.imgurl|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)">
+                                    <img src="{$ecr.newImgurl|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)">
                                     {else/}
-                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.imgurl|getStoragePath}', 'imgurl')">
+                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.newImgurl|getStoragePath}', 'imgurl')">
                                     {/eq}
                                     {else/}
                                     <img src="/static/img/yyzz.png" style="height: 60px;">
@@ -84,13 +85,13 @@
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业地址</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}地址</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newAddress" name="newAddress"  value="{$ecr.newAddress}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业电话</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}电话</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newEphone" name="newEphone" placeholder="固话格式0595xxxx" value="{$ecr.newEphone}"/>
                                     </div>
                                 </td>
@@ -98,30 +99,30 @@
                             <tr>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业银行账号</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}银行账号</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBankCard" name="newBankCard" value="{$ecr.newBankCard}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBank" name="newBank" value="{$ecr.newBank}"/>
                                     </div>
                                 </td>
                                 <td>
                                     <div class="rowGroup">
-                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行网点</label>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>{eq name="ecr.special" value="0"}企业{else/}单位{/eq}开户银行网点</label>
                                         <input autocomplete="off" type="text" class="form-control" id="newBankNetwork" name="newBankNetwork" placeholder="XX银行XX支行/分行/分理处" value="{$ecr.newBankNetwork}"/>
                                     </div>
                                 </td>
                                 <td style="position:relative;">            
                                     <button type="button" class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;" onclick="$('#bankImg').click()"><i class="fa fa-upload" aria-hidden="true"></i>上传文件</button>
                                     <label class="control-label spacing"><span class="text-danger">*</span>开户许可证</label>
-                                    {if condition="$ecr['bankImg']"}
+                                    {if condition="$ecr['newBankImg']"}
                                     {eq name="ecr.bankImg_is_img" value="1"}
-                                    <img src="{$ecr.bankImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
+                                    <img src="{$ecr.newBankImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
                                     {else/}
-                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.bankImg|getStoragePath}', 'bankImg')">
+                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.newBankImg|getStoragePath}', 'bankImg')">
                                     {/eq}
                                     {else/}
                                     <img src="/static/img/yyzz.png" style="height: 60px;">
@@ -170,11 +171,11 @@
                                     <td rowspan="2" style="position:relative;">
                                         <button type="button" class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;" onclick="$('#domainImg').click()"><i class="fa fa-upload" aria-hidden="true"></i>上传文件</button>
                                         <label class="control-label spacing"><span style="color: red">*</span>行业领域上传材料</label>
-                                        {if condition="$ecr['domainImg']"}
+                                        {if condition="$ecr['newDomainImg']"}
                                         {eq name="ecr.domainImg_is_img" value="1"}
-                                        <img src="{$ecr.domainImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
+                                        <img src="{$ecr.newDomainImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
                                         {else/}
-                                        <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.domainImg|getStoragePath}', 'domainImg')">
+                                        <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.newDomainImg|getStoragePath}', 'domainImg')">
                                         {/eq}
                                         {else/}
                                         <img src="/static/img/yyzz.png" style="height: 60px;">
@@ -230,11 +231,11 @@
                                 <td style="position:relative;">
                                     <button type="button" class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;" onclick="$('#beian').click()"><i class="fa fa-upload" aria-hidden="true"></i>上传文件</button>
                                     <label class="control-label spacing" style="text-align: center"><span style="color: red">*</span>人才联络员备案表<br /><a href="/beianbiao.doc" style="color: red">(点击此处下载模板)</a>  </label>
-                                    {if condition="$ecr['beian']"}
+                                    {if condition="$ecr['newBeian']"}
                                     {eq name="ecr.beian_is_img" value="1"}
-                                    <img src="{$ecr.beian|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
+                                    <img src="{$ecr.newBeian|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
                                     {else/}
-                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.beian|getStoragePath}', 'beian')">
+                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.newBeian|getStoragePath}', 'beian')">
                                     {/eq}
                                     {else/}
                                     <img src="/static/img/yyzz.png" style="height: 60px;">

+ 40 - 12
app/enterprise/view/index/center_page.html

@@ -44,7 +44,7 @@
                             <div id="tab-1" class="tab-pane active">
                                 <div class="panel-body">
                                     <div class="panel panel-default">
-                                        <div class="panel-heading">单位信息</div>
+                                        <div class="panel-heading">{eq name="ep.special" value="0"}企业{else/}单位{/eq}信息</div>
                                         <div class="panel-body">
 
                                             <table style="width:100%" class="table table-bordered">
@@ -56,13 +56,20 @@
                                                         {$ep.username}
                                                     </td>
                                                     <td class="key">
-                                                        单位名称
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}名称
                                                     </td>
                                                     <td class="value1" style="border-right: 1px solid #c0a16b">
                                                         {$ep.name}
                                                     </td>
                                                     <td rowspan="4"  style="border: 1px solid #c0a16b">
-                                                        <label>营业执照</label><img onclick="Feng.showImg(this)" id="yyzz" src="{$ep.imgurl|getStoragePath}" style="max-width: 100px;">
+                                                        <label>{eq name="ep.special" value="0"}营业执照{else/}事业单位法人证或批文{/eq}</label>
+                                                        {if condition="$ep['imgurl']"}
+                                                        {if condition="$ep['imgurl_is_img'] eq 1"}
+                                                        <img onclick="Feng.showImg(this)" id="yyzz" src="{$ep.imgurl|getStoragePath}" style="max-width: 100px;">
+                                                        {else/}
+                                                        <img onclick="Feng.showPdf('{$ep.imgurl|getStoragePath}', 'imgurl')" src="/static/img/File.png" style="max-width: 100px;">
+                                                        {/if}
+                                                        {/if}
                                                     </td>
                                                 </tr>
                                                 <tr>
@@ -87,7 +94,7 @@
                                                         {$ep.streetName}
                                                     </td>
                                                     <td class="key">
-                                                        单位电话
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}电话
                                                     </td>
                                                     <td>
                                                         {$ep.ephone}
@@ -96,7 +103,7 @@
                                                 <tr>
 
                                                     <td class="key">
-                                                        单位地址
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}地址
                                                     </td>
                                                     <td colspan="3">
                                                         {$ep.address}
@@ -104,25 +111,31 @@
                                                 </tr>
                                                 <tr>
                                                     <td class="key">
-                                                        企业银行账号
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}银行账号
                                                     </td>
                                                     <td>
                                                         {$ep.bankCard}
                                                     </td>
                                                     <td class="key">
-                                                        企业开户银行
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}开户银行
                                                     </td>
                                                     <td style="border-right: 1px solid #c0a16b">
                                                         {$ep.bank}
                                                     </td>
                                                     <td rowspan="2" style="border: 1px solid #c0a16b">
                                                         <label>开户许可证</label>
+                                                        {if condition="$ep['bankImg']"}
+                                                        {if condition="$ep['bankImg_is_img'] eq 1"}
                                                         <img onclick="Feng.showImg(this)" id="bankImg" src="{$ep.bankImg|getStoragePath}" style="max-width: 100px;">
+                                                        {else/}
+                                                        <img onclick="Feng.showPdf('{$ep.bankImg|getStoragePath}', 'bankImg')" src="/static/img/File.png" style="max-width: 100px;">
+                                                        {/if}
+                                                        {/if}
                                                     </td>
                                                 </tr>
                                                 <tr>
                                                     <td class="key">
-                                                        企业开户银行网点
+                                                        {eq name="ep.special" value="0"}企业{else/}单位{/eq}开户银行网点
                                                     </td>
                                                     <td colspan="3">
                                                         {$ep.bankNetwork}
@@ -133,6 +146,7 @@
                                         </div>
                                     </div>
                                 </div>
+                                {eq name="ep.special" value="0"}
                                 <div class="panel-body">
                                     <div class="panel panel-default">
                                         <div class="panel-heading">申报信息</div>
@@ -145,8 +159,8 @@
                                                 {/switch}
                                                 <input type="hidden" id="type" value="{$ep.type}">
                                             </p>
+                                            {if condition="$ep['type'] eq 1"}
                                             <table style="width:100%;table-layout:fixed;" class="table table-bordered">
-
                                                 <tr class="type1">
                                                     <td  class="key">
                                                         产业领域
@@ -162,27 +176,35 @@
                                                     </td>
                                                     <td rowspan="2" style="border: 1px solid #c0a16b">
                                                         <label>行业领域佐证材料</label>
+                                                        {if condition="$ep['domainImg']"}
+                                                        {if condition="$ep['domainImg_is_img'] eq 1"}
                                                         <img onclick="Feng.showImg(this)" id="domainImg" src="{$ep.domainImg|getStoragePath}" style="max-width: 100px;">
+                                                        {else/}
+                                                        <img onclick="Feng.showPdf('{$ep.domainImg|getStoragePath}', 'domainImg')" src="/static/img/File.png" style="max-width: 100px;">
+                                                        {/if}
+                                                        {/if}
                                                     </td>
                                                 </tr>
                                                 <tr class="type1">
                                                     <td  class="key">
-                                                        单位标签
+                                                        企业标签
                                                     </td>
                                                     <td>
                                                         {$ep.enterpriseTagName}
                                                     </td>
                                                     <td  class="key">
-                                                        单位类型
+                                                        企业类型
                                                     </td>
                                                     <td>
                                                         {$ep.enterpriseTypeName}
                                                     </td>
                                                 </tr>
                                             </table>
+                                            {/if}
                                         </div>
                                     </div>
                                 </div>
+                                {/eq}
                                 <div class="panel-body">
                                     <div class="panel panel-default">
                                         <div class="panel-heading">人才联络员信息</div>
@@ -203,7 +225,13 @@
                                                     </td>
                                                     <td rowspan="2" style="border: 1px solid #c0a16b">
                                                         <label>人才联络员信息备案表</label>
-                                                        <button type="button" onclick="Feng.showFile('{$ep.beian|getFileView}','beian')">点击查看</button>
+                                                        {if condition="$ep['beian']"}
+                                                        {if condition="$ep['beian_is_img'] eq 1"}
+                                                        <img onclick="Feng.showImg(this)" id="domainImg" src="{$ep.beian|getStoragePath}" style="max-width: 100px;">
+                                                        {else/}
+                                                        <img onclick="Feng.showPdf('{$ep.beian|getStoragePath}', 'beian')" src="/static/img/File.png" style="max-width: 100px;">
+                                                        {/if}
+                                                        {/if}
                                                     </td>
                                                 </tr>
                                                 <tr>

+ 19 - 19
public/static/modular/enterprise/enterprisechangeRecord/ep_change_record_detail.js

@@ -134,35 +134,35 @@ $(function () {
     // 	{"name":"oldIndustryFieldNew","code":"industry_field"},
     // 	{"name":"newIndustryFieldNew","code":"industry_field"}];
     // Feng.findChildDictBatch(JSON.stringify(arr))
-    $("td.value1").each(function(){
+    $("td.value1").each(function () {
         var oldVal = $(this).data("old");
         var newVal = $(this).data("new");
         var style = 0;
         var html = "";
         var oldValStr = oldVal == "" ? '"未填写"' : oldVal;
-        if(oldVal != newVal){
-             switch(style){
-                 case 1:
-                     html = '<span class="new"><i class="fa fa-dot-circle-o" aria-hidden="true"></i>'+newVal+'</span><br/><span class="old"><i class="fa fa-circle-o" aria-hidden="true"></i>'+oldValStr+'</span>';
-                     break;
-                 default:
-                     html = '<span class="old">'+oldValStr+'</span> -> <span class="new">'+newVal+'</span>';
-                     break;               
-             }
-        }else{
-             html = oldValStr;
+        if (oldVal != newVal) {
+            switch (style) {
+                case 1:
+                    html = '<span class="new"><i class="fa fa-dot-circle-o" aria-hidden="true"></i>' + newVal + '</span><br/><span class="old"><i class="fa fa-circle-o" aria-hidden="true"></i>' + oldValStr + '</span>';
+                    break;
+                default:
+                    html = '<span class="old">' + oldValStr + '</span> -> <span class="new">' + newVal + '</span>';
+                    break;
+            }
+        } else {
+            html = oldValStr;
         }
         $(this).html(html);
-        if(oldVal == "" && $(this).find("span.old").length == 1){
-            $(this).find("span.old").css("text-decoration","none");
+        if (oldVal == "" && $(this).find("span.old").length == 1) {
+            $(this).find("span.old").css("text-decoration", "none");
         }
     });
     $("select").each(function () {
         $(this).val($(this).attr("value"));
     })
-    if ($("#type").val() == 1) {
-        $("#newEnterpriseType,#oldEnterpriseType,#oldIndustryFieldOld,#oldIndustryFieldNew,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseTag,#oldEnterpriseTag").parent().parent().attr("style", "display:block");
-    } else {
-        $("#newEnterpriseType,#oldEnterpriseType,#oldIndustryFieldOld,#oldIndustryFieldNew,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseTag,#oldEnterpriseTag").parent().parent().attr("style", "display:none");
-    }
+    /*if ($("#type").val() == 1) {
+     $("#newEnterpriseType,#oldEnterpriseType,#oldIndustryFieldOld,#oldIndustryFieldNew,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseTag,#oldEnterpriseTag").parent().parent().attr("style", "display:block");
+     } else {
+     $("#newEnterpriseType,#oldEnterpriseType,#oldIndustryFieldOld,#oldIndustryFieldNew,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseTag,#oldEnterpriseTag").parent().parent().attr("style", "display:none");
+     }*/
 });

+ 93 - 23
public/static/modular/gate/enterprise/enterprise_change_edit.js

@@ -1,23 +1,23 @@
 var locked = false;
 var EpChangeEdit = {
     epChangeEditData: {},
-    validateFields: {
-        newName: {validators: {notEmpty: {message: '单位名称不能为空'}, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/, message: "单位名称只允许中文"}}},
+    validateFields1: {
+        newName: {validators: {notEmpty: {message: '企业名称不能为空'}, regexp: {regexp: /^([\u4E00-\u9FA5]|\(|\)|\(|\)){1,100}$/, message: "单位名称只允许中文"}}},
         newIdCard: {validators: {notEmpty: {message: '统一社会信用代码不能为空'}}},
-        newEnterpriseTag: {validators: {notEmpty: {message: '单位标签不能为空'}}},
-        newEnterpriseType: {validators: {notEmpty: {message: '单位类型不能为空'}}},
+        newEnterpriseTag: {validators: {notEmpty: {message: '企业标签不能为空'}}},
+        newEnterpriseType: {validators: {notEmpty: {message: '企业类型不能为空'}}},
         newLegal: {validators: {notEmpty: {message: '法人代表不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,50}$/, message: "法人代表只允许中文"}}},
-        newAddress: {validators: {notEmpty: {message: '单位地址不能为空'}}},
+        newAddress: {validators: {notEmpty: {message: '企业地址不能为空'}}},
         newStreet: {validators: {notEmpty: {message: '所属街道不能为空'}}},
         newAgentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
         newEphone: {
             validators: {
                 notEmpty: {
-                    message: '单位电话不能为空'
+                    message: '企业电话不能为空'
                 },
                 regexp: {
                     regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
-                    message: "单位电话格式不正确"
+                    message: "企业电话格式不正确"
                 }
             }
         },
@@ -63,6 +63,44 @@ var EpChangeEdit = {
                     message: "开户银行网点格式不正确"
                 }}
         }
+    },
+    validateFields2: {
+        newName: {validators: {notEmpty: {message: '单位名称不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,100}$/, message: "单位名称只允许中文"}}},
+        newAddress: {validators: {notEmpty: {message: '单位地址不能为空'}}},
+        newStreet: {validators: {notEmpty: {message: '所属街道不能为空'}}},
+        newAgentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
+        newEphone: {
+            validators: {
+                notEmpty: {
+                    message: '单位电话不能为空'
+                },
+                regexp: {
+                    regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
+                    message: "单位电话格式不正确"
+                }
+            }
+        },
+        newAgentPhone: {
+            validators: {
+                notEmpty: {
+                    message: '人才联络员电话不能为空'
+                },
+                regexp: {
+                    regexp: /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
+                    message: "人才联络员电话格式不正确"
+                }
+            }
+        },
+        newAgentEmail: {
+            validators: {
+                notEmpty: {
+                    message: '电子邮箱不能为空'
+                },
+                emailAddress: {
+                    message: "电子邮箱格式不正确"
+                }
+            }
+        }
     }
 };
 
@@ -348,9 +386,12 @@ EpChangeEdit.addSubmit = function () {
         return;
     }
     // $(".layui-layer-btn0",parent.document).css("pointer-events","none");
-    if (locked)
+    if (locked) {
+        Feng.info("保存进行中,请耐心等候")
         return;
+    }
     locked = true;
+    layer.load(0, {shade: false, time: 0});
     /*var ajax = new $ax(Feng.ctxPath + "/enterprise/api/upsert", function (data) {
      if (data.code == "200") {
      Feng.success(data.msg);
@@ -369,6 +410,8 @@ EpChangeEdit.addSubmit = function () {
      });
      ajax.set(this.epChangeEditData);
      ajax.start();*/
+
+    $("#ecr_form :input").removeAttr("disabled");
     $("#ecr_form").attr("action", "/enterprise/api/upsert");
     $("#ecr_form")[0].submit();
 };
@@ -378,6 +421,10 @@ EpChangeEdit.addSubmit = function () {
  * 提交审核
  */
 EpChangeEdit.submitToCheck = function () {
+    if (locked) {
+        Feng.info("保存进行中,请耐心等候")
+        return;
+    }
     var id = $("#id").val();
     if (id == null || id == "") {
         Feng.info("请先填写基础信息并上传附件");
@@ -413,18 +460,47 @@ EpChangeEdit.submitToCheck = function () {
     Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
 }
 
+EpChangeEdit.setFieldDisabled = function () {
+    var checkState = $("#checkState").length > 0 ? $("#checkState").val() : 1;
+    if (checkState != 1) {
+        $("#ecr_form :input").prop("disabled", true);
+        $("#ecr_form :button").css("display", "none");
+        var fields = $("#fields").val().split(",");
+        for (var i in fields) {
+            $("#" + fields[i]).removeAttr("disabled");
+        }
+        var files = $("#files").val().split(",");
+        for (var i in files) {
+            switch (files[i]) {
+                case "newImgurl":
+                    $("#imgurl").removeAttr("disabled");
+                    $("#imgurl").parent().find("button").removeAttr("disabled").css("display", "block");
+                    break;
+                case "newBankImg":
+                    $("#bankImg").removeAttr("disabled");
+                    $("#bankImg").parent().find("button").removeAttr("disabled").css("display", "block");
+                    break;
+                case "newDomainImg":
+                    $("#domainImg").removeAttr("disabled");
+                    $("#domainImg").parent().find("button").removeAttr("disabled").css("display", "block");
+                    break;
+                case "newBeian":
+                    $("#beian").removeAttr("disabled");
+                    $("#beian").parent().find("button").removeAttr("disabled").css("display", "block");
+                    break;
+            }
+        }
+    }
+}
 
 EpChangeEdit.callBack = function (data) {
-    console.log(data)
-    /*layer.close(data.obj);
-     Feng.info(data.msg);
-     if (data.code == 200) {
-     $("#fileTable").bootstrapTable("refresh", {});
-     }*/
+    layer.closeAll();
+    EpChangeEdit.setFieldDisabled();
     locked = false;
     Feng.info(data.msg);
     if (data.code == 200) {
         $("#id").val(data.id);
+        $("input[type=file]").val("");
         window.parent.EnterpriseCenter.table.refresh();
     }
 };
@@ -460,6 +536,8 @@ $("#imgurl,#bankImg,#beian,#domainImg").change(function (e) {
 });
 
 $(function () {
+    EpChangeEdit.setFieldDisabled();
+    var special = parseInt($("#special").val());
     $('#ecr_form').bootstrapValidator({
         feedbackIcons: {
             valid: 'glyphicon glyphicon-ok',
@@ -467,7 +545,7 @@ $(function () {
             validating: 'glyphicon glyphicon-refresh'
         },
         group: '.rowGroup',
-        fields: EpChangeEdit.validateFields,
+        fields: special == 1 ? EpChangeEdit.validateFields2 : EpChangeEdit.validateFields1,
         live: 'enabled',
         message: '该字段不能为空'
     });
@@ -499,12 +577,4 @@ $(function () {
     } else {
         $("#fileLi").attr("style", "pointer-events: none");
     }
-    var checkState = $("#checkState").length > 0 ? $("#checkState").val() : 1;
-    if (checkState != 1) {
-        $("#baseForm :input").prop("disabled", true);
-        var fields = $("#fields").val().split(",");
-        for (var i in fields) {
-            $("#" + fields[i]).removeAttr("disabled");
-        }
-    }
 });