Browse Source

上传一部分

sugangqiang 2 years ago
parent
commit
6b02584275

+ 119 - 10
app/enterprise/controller/Api.php

@@ -12,6 +12,7 @@ use app\enterprise\model\EnterpriseRecord;
 use app\enterprise\common\EnterpriseController;
 use app\enterprise\common\EnterpriseController;
 use app\Request;
 use app\Request;
 use think\exception\ValidateException;
 use think\exception\ValidateException;
+use app\common\api\UploadApi;
 
 
 class Api extends EnterpriseController {
 class Api extends EnterpriseController {
 
 
@@ -146,7 +147,7 @@ class Api extends EnterpriseController {
             'bank' => \StrUtil::getRequestDecodeParam($this->request, 'newBank'), //开户行
             'bank' => \StrUtil::getRequestDecodeParam($this->request, 'newBank'), //开户行
             'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'newBankNetwork')//网点
             'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'newBankNetwork')//网点
         ];
         ];
-
+        $response_object = new \stdClass();
         try {
         try {
             if (stripos($data['name'], "(")) {
             if (stripos($data['name'], "(")) {
                 $data['name'] = str_replace('(', '(', $data['name']);
                 $data['name'] = str_replace('(', '(', $data['name']);
@@ -170,8 +171,9 @@ class Api extends EnterpriseController {
 
 
             $record_id = \StrUtil::getRequestDecodeParam($this->request, 'id');
             $record_id = \StrUtil::getRequestDecodeParam($this->request, 'id');
             if (!$record_id) {
             if (!$record_id) {
+                $record_id = getStringId();
                 $record_data = [
                 $record_data = [
-                    'id' => getStringId(),
+                    'id' => $record_id,
                     'mainId' => $data['id'],
                     'mainId' => $data['id'],
                     'type' => $data['type'],
                     'type' => $data['type'],
                     'oldName' => $ep['name'],
                     'oldName' => $ep['name'],
@@ -190,6 +192,10 @@ class Api extends EnterpriseController {
                     'oldBankCard' => $ep['bankCard'],
                     'oldBankCard' => $ep['bankCard'],
                     'oldBank' => $ep['bank'],
                     'oldBank' => $ep['bank'],
                     'oldBankNetwork' => $ep['bankNetwork'],
                     'oldBankNetwork' => $ep['bankNetwork'],
+                    "oldImgurl" => $ep["imgurl"],
+                    "oldBankImg" => $ep["bankImg"],
+                    "oldDomainImg" => $ep["domainImg"],
+                    "oldBeian" => $ep["beian"],
                     'newName' => htmlspecialchars($data['name']),
                     'newName' => htmlspecialchars($data['name']),
                     'newIdCard' => htmlspecialchars($data['idCard']),
                     'newIdCard' => htmlspecialchars($data['idCard']),
                     'newIndustryFieldNew' => $data['industryFieldNew'],
                     'newIndustryFieldNew' => $data['industryFieldNew'],
@@ -210,8 +216,53 @@ class Api extends EnterpriseController {
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => session("user")["uid"]
                     'createUser' => session("user")["uid"]
                 ];
                 ];
-                EnterpriseRecord::create($record_data);
+                $files = $this->request->file();
+                if ($files) {
+                    $uploadapi = new UploadApi();
+                    if (array_key_exists('imgurl', $files)) {
+                        $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
+                        if ($upload_result->code == 500) {
+                            return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
+                        }
+                        $record_data["newImgurl"] = $upload_result->filepath;
+                    } else {
+                        $record_data["newImgurl"] = $ep["imgurl"];
+                    }
+
+                    //检验附件 开户许可证
+                    if (array_key_exists('bankImg', $files)) {
+                        $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
+                        if ($upload_result1->code == 500) {
+                            return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
+                        }
+                        $record_data["newBankImg"] = $upload_result1->filepath;
+                    } else {
+                        $record_data["newBankImg"] = $ep["bankImg"];
+                    }
 
 
+                    //检验附件 行业领域佐证材料
+                    if (array_key_exists('domainImg', $files)) {
+                        $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
+                        if ($upload_result2->code == 500) {
+                            return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
+                        }
+                        $record_data["newDomainImg"] = $upload_result2->filepath;
+                    } else {
+                        $record_data["newDomainImg"] = $ep["domainImg"];
+                    }
+
+                    //检验附件 人才联络员备案表
+                    if (array_key_exists('beian', $files)) {
+                        $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
+                        if ($upload_result3->code == 500) {
+                            return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
+                        }
+                        $record_data["newBeian"] = $upload_result3->filepath;
+                    } else {
+                        $record_data["newBeian"] = $ep["beian"];
+                    }
+                }
+                EnterpriseRecord::create($record_data);
                 $log = [
                 $log = [
                     'id' => getStringId(),
                     'id' => getStringId(),
                     'mainId' => $record_data['id'],
                     'mainId' => $record_data['id'],
@@ -225,7 +276,8 @@ class Api extends EnterpriseController {
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => '用户'
                     'createUser' => '用户'
                 ];
                 ];
-                $res = ['msg' => '添加成功', 'code' => 200, 'obj' => $record_data];
+                $success_msg = "添加成功";
+                //$res = ['msg' => '添加成功', 'code' => 200, 'obj' => $record_data];
             } else {
             } else {
                 $record = EnterpriseRecord::find($record_id);
                 $record = EnterpriseRecord::find($record_id);
                 $ep = Enterprise::where('id', session("user")["uid"])->find();
                 $ep = Enterprise::where('id', session("user")["uid"])->find();
@@ -271,6 +323,58 @@ class Api extends EnterpriseController {
                     }
                     }
                 }
                 }
 
 
+                $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 (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;
+                    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;
+                    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;
+                    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"];
+                    }
+                }
+
                 $record->updateTime = date("Y-m-d H:i:s");
                 $record->updateTime = date("Y-m-d H:i:s");
                 $record->updateUser = session("user")["uid"];
                 $record->updateUser = session("user")["uid"];
 
 
@@ -289,16 +393,21 @@ class Api extends EnterpriseController {
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => '用户'
                     'createUser' => '用户'
                 ];
                 ];
-
-                $res = ['msg' => '修改成功', 'code' => 200, 'obj' => $record];
+                $success_msg = "修改成功";
+                //$res = ['msg' => '修改成功', 'code' => 200, 'obj' => $record];
             }
             }
 
 
             TalentChecklog::create($log);
             TalentChecklog::create($log);
-
-            return json($res);
+            $response_object->id = $record_id;
+            $response_object->code = 200;
+            $response_object->msg = $success_msg;
+            return \StrUtil::back($response_object, "EpChangeEdit.callBack");
+            //return json($res);
         } catch (ValidateException $e) {
         } catch (ValidateException $e) {
-            $error = $e->getError();
-            return json(["msg" => array_pop($error), 'code' => 500]);
+            $response_object->code = 500;
+            $response_object->msg = implode("<br>",$e->getError());
+            return \StrUtil::back($response_object, "EpChangeEdit.callBack");
+            //return json(["msg" => array_pop($error), 'code' => 500]);
         }
         }
     }
     }
 
 

+ 184 - 215
app/enterprise/view/api/to_add.html

@@ -1,34 +1,6 @@
 {extend name="layout/content"}
 {extend name="layout/content"}
 {block name="content"}
 {block name="content"}
 <style>
 <style>
-    .upload-btn {
-        position: relative;
-        display: inline-block;
-        cursor: pointer;
-        background: #1ab394;
-        padding: 6px 12px;
-        color: #fff;
-        text-align: center;
-        border-radius: 3px;
-        overflow: hidden;
-        font-size: 14px;
-        font-weight: 400;
-    }
-
-    .spacing {
-        margin-bottom: 10px;
-        padding-right: 4px;
-        padding-left: 4px;
-    }
-
-    .imgs li {
-        list-style: none;
-        float: left;
-        border: 1px solid #d8d1d1;
-        text-align: center;
-        height: 30px;
-    }
-
     .panel-heading{
     .panel-heading{
         color:#333;
         color:#333;
         background-color:#f5f5f5;
         background-color:#f5f5f5;
@@ -56,225 +28,222 @@
     }
     }
 </style>
 </style>
 <div class="ibox float-e-margins">
 <div class="ibox float-e-margins">
-    <div class="ibox-content">
-        <div class="form-horizontal">
-            <div class="panel panel-default">
-                <div class="panel-heading">基础信息</div>
-                <div class="panel-body">
-                    <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
-                        <tr>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>企业名称</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newName" name="newName" value="{$ecr.newName}"/>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>统一社会信用代码</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newIdCard" name="newIdCard"  value="{$ecr.newIdCard}"/>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>法人代表</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newLegal" name="newLegal" value="{$ecr.newLegal}"/>
-                                </div>
-                            </td>
-                            <td rowspan="2" style="position:relative;">
-                                <button class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;"><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']"}
-                                {eq name="ecr.imgurl_is_img" value="1"}
-                                <img id="photoImg" src="{$ecr.imgurl|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
-                                {else/}
-                                <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$ecr.imgurl|getStoragePath}', 'imgurl')">
-                                    <i class="fa fa-file-pdf-o" aria-hidden="true"></i>查看文件
-                                </button>
-                                {/eq}
-                                {else/}
-                                <img id="photoImg" src="/static/img/yyzz.png" style="height: 60px;" onclick="$('#imgurl').click()" >
-                                {/if}                                
-                                <input style="display: none" autocomplete="off" type="file" class="form-control" id="imgurl" name="imgurl" />
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>所属街道</label>
-                                    <select class="form-control" id="newStreet" name="newStreet" value="{$ecr.newStreet}"></select>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>企业地址</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>
-                                    <input autocomplete="off" type="text" class="form-control" id="newEphone" name="newEphone" placeholder="固话格式0595xxxx" value="{$ecr.newEphone}"/>
-                                </div>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class=" control-label spacing td-label"><span style="color: red">*</span>企业银行账号</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>
-                                    <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>
-                                    <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 class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;"><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']"}
-                                {eq name="ecr.bankImg_is_img" value="1"}
-                                <img id="photoImg" src="{$ecr.bankImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
-                                {else/}
-                                <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$ecr.bankImg|getStoragePath}', 'bankImg')">
-                                    <i class="fa fa-file-pdf-o" aria-hidden="true"></i>查看文件
-                                </button>
-                                {/eq}
-                                {else/}
-                                <img id="photoImg" src="/static/img/yyzz.png" style="height: 60px;" onclick="$('#imgurl').click()" >
-                                {/if}
-                                <input style="display: none" autocomplete="off" type="file" class="form-control" id="bankImg" name="bankImg" />
-                            </td>
-                        </tr>
-                    </table>
-                </div>
-            </div>
-            {if condition="$ecr['special'] eq 0"}
-            <div class="panel panel-default">
-                <div class="panel-heading">申报基础信息</div>
-                <div class="panel-body">
-                    <div class="row">
-                        <div class="rowGroup" >
-                            <label class="col-sm-1 control-label spacing"><span class="text-danger">*</span>申报类型</label>
-                            <div class="col-sm-4 spacing">
-                                <div class="form-control" disabled="disabled">
-                                    {switch name="ecr.type"}
-                                    {case value="1"}晋江市现代产业体系人才{/case}
-                                    {case value="2"}集成电路优秀人才{/case}
-                                    {case value="3"}海峡计划团队{/case}
-                                    {/switch}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    {if condition="$ecr['type'] eq 1"}
-                    <div class="row" id="typeGroup">
+    <div class="ibox-content">                                
+        <form id="ecr_form" class="form-horizontal" target="hiddenIframe" action="" method="post" enctype="multipart/form-data">
+            <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}"/>
+            <div class="form-horizontal">
+                <div class="panel panel-default">
+                    <div class="panel-heading">基础信息</div>
+                    <div class="panel-body">
                         <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
                         <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
                             <tr>
                             <tr>
                                 <td>
                                 <td>
                                     <div class="rowGroup">
                                     <div class="rowGroup">
-                                        <label class="control-label spacing td-label"><span style="color: red">*</span>产业领域</label>
-                                        <select autocomplete="off" type="text" class="form-control" id="newIndustryFieldNew" name="newIndustryFieldNew" value="{$ecr.newIndustryFieldNew}" onchange="EpChangeEdit.industryChange()"></select>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业名称</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newName" name="newName" value="{$ecr.newName}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>统一社会信用代码</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newIdCard" name="newIdCard"  value="{$ecr.newIdCard}"/>
                                     </div>
                                     </div>
                                 </td>
                                 </td>
                                 <td>
                                 <td>
                                     <div class="rowGroup">
                                     <div class="rowGroup">
-                                        <label class="control-label spacing td-label"><span style="color: red">*</span>行业领域</label>
-                                        <select class="form-control" id="newIndustryFieldOld" name="newIndustryFieldOld" value="{$ecr.newIndustryFieldOld}">
-                                        </select>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>法人代表</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newLegal" name="newLegal" value="{$ecr.newLegal}"/>
                                     </div>
                                     </div>
                                 </td>
                                 </td>
                                 <td rowspan="2" style="position:relative;">
                                 <td rowspan="2" style="position:relative;">
-                                    <button class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;"><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']"}
-                                    {eq name="ecr.domainImg_is_img" value="1"}
-                                    <img id="photoImg" src="{$ecr.domainImg|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
+                                    <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']"}
+                                    {eq name="ecr.imgurl_is_img" value="1"}
+                                    <img src="{$ecr.imgurl|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)">
                                     {else/}
                                     {else/}
-                                    <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$ecr.domainImg|getStoragePath}', 'domainImg')">
-                                        <i class="fa fa-file-pdf-o" aria-hidden="true"></i>查看文件
-                                    </button>
+                                    <img src="/static/img/File.png" style="height: 60px;" onclick="Feng.showPdf('{$ecr.imgurl|getStoragePath}', 'imgurl')">
                                     {/eq}
                                     {/eq}
                                     {else/}
                                     {else/}
-                                    <img id="photoImg" src="/static/img/yyzz.png" style="height: 60px;" onclick="$('#imgurl').click()" >
-                                    {/if}
-                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="domainImg" name="domainImg" />
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}                                
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="imgurl" name="imgurl" />
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>所属街道</label>
+                                        <select class="form-control" id="newStreet" name="newStreet" value="{$ecr.newStreet}"></select>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业地址</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>
+                                        <input autocomplete="off" type="text" class="form-control" id="newEphone" name="newEphone" placeholder="固话格式0595xxxx" value="{$ecr.newEphone}"/>
+                                    </div>
                                 </td>
                                 </td>
                             </tr>
                             </tr>
                             <tr>
                             <tr>
                                 <td>
                                 <td>
                                     <div class="rowGroup">
                                     <div class="rowGroup">
-                                        <label class="control-label spacing td-label"><span style="color: red">*</span>企业标签</label>
-                                        <select class="form-control" id="EpChangeEdit" name="newEnterpriseTag" value="{$ecr.newEnterpriseTag}">
-                                        </select>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业银行账号</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newBankCard" name="newBankCard" value="{$ecr.newBankCard}"/>
                                     </div>
                                     </div>
                                 </td>
                                 </td>
                                 <td>
                                 <td>
                                     <div class="rowGroup">
                                     <div class="rowGroup">
-                                        <label class="control-label spacing td-label"><span style="color: red">*</span>企业类型</label>
-                                        <select class="form-control" id="newEnterpriseType" name="newEnterpriseType" value="{$ecr.newEnterpriseType}">
-                                        </select>
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newBank" name="newBank" value="{$ecr.newBank}"/>
                                     </div>
                                     </div>
                                 </td>
                                 </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业开户银行网点</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']"}
+                                    {eq name="ecr.bankImg_is_img" value="1"}
+                                    <img src="{$ecr.bankImg|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')">
+                                    {/eq}
+                                    {else/}
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="bankImg" name="bankImg" />
+                                </td>
                             </tr>
                             </tr>
                         </table>
                         </table>
                     </div>
                     </div>
-                    {/if}
                 </div>
                 </div>
-            </div>
-            {/if}
-            <div class="panel panel-default">
-                <div class="panel-heading">人才联络员信息</div>
-                <div class="panel-body">
-                    <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
-                        <tr>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newAgentName" name="newAgentName" value="{$ecr.newAgentName}"/>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class="control-label spacing td-label"><span style="color: red">*</span>电子邮箱</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newAgentEmail" name="newAgentEmail" value="{$ecr.newAgentEmail}"/>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="rowGroup">
-                                    <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员手机号</label>
-                                    <input autocomplete="off" type="text" class="form-control" id="newAgentPhone" name="newAgentPhone" value="{$ecr.newAgentPhone}"/>
+                {if condition="$ecr['special'] eq 0"}
+                <div class="panel panel-default">
+                    <div class="panel-heading">申报基础信息</div>
+                    <div class="panel-body">
+                        <div class="row">
+                            <div class="rowGroup" >
+                                <label class="col-sm-1 control-label spacing"><span class="text-danger">*</span>申报类型</label>
+                                <div class="col-sm-4 spacing">
+                                    <div class="form-control" disabled="disabled">
+                                        {switch name="ecr.type"}
+                                        {case value="1"}晋江市现代产业体系人才{/case}
+                                        {case value="2"}集成电路优秀人才{/case}
+                                        {case value="3"}海峡计划团队{/case}
+                                        {/switch}
+                                    </div>
                                 </div>
                                 </div>
-                            </td>
-                            <td style="position:relative;">
-                                <button class="btn btn-info btn-sm" style="position:absolute;right:5px;top:5px;"><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']"}
-                                {eq name="ecr.beian_is_img" value="1"}
-                                <img id="photoImg" src="{$ecr.beian|getStoragePath}" style="height: 60px;" onclick="Feng.showImg(this)" >
-                                {else/}
-                                <button type="button" class="btn btn-primary" onclick="Feng.showPdf('{$ecr.beian|getStoragePath}', 'beian')">
-                                    <i class="fa fa-file-pdf-o" aria-hidden="true"></i>查看文件
-                                </button>
-                                {/eq}
-                                {else/}
-                                <img id="photoImg" src="/static/img/yyzz.png" style="height: 60px;" onclick="$('#imgurl').click()" >
-                                {/if}
-                                <input style="display: none" autocomplete="off" type="file" class="form-control" id="beian" name="beian" />
-                            </td>
-                        </tr>
-                    </table>
+                            </div>
+                        </div>
+                        {if condition="$ecr['type'] eq 1"}
+                        <div class="row" id="typeGroup">
+                            <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
+                                <tr>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>产业领域</label>
+                                            <select autocomplete="off" type="text" class="form-control" id="newIndustryFieldNew" name="newIndustryFieldNew" value="{$ecr.newIndustryFieldNew}" onchange="EpChangeEdit.industryChange()"></select>
+                                        </div>
+                                    </td>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>行业领域</label>
+                                            <select class="form-control" id="newIndustryFieldOld" name="newIndustryFieldOld" value="{$ecr.newIndustryFieldOld}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                    <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']"}
+                                        {eq name="ecr.domainImg_is_img" value="1"}
+                                        <img src="{$ecr.domainImg|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')">
+                                        {/eq}
+                                        {else/}
+                                        <img src="/static/img/yyzz.png" style="height: 60px;">
+                                        {/if}
+                                        <input style="display: none" autocomplete="off" type="file" class="form-control" id="domainImg" name="domainImg" />
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>企业标签</label>
+                                            <select class="form-control" id="newEnterpriseTag" name="newEnterpriseTag" value="{$ecr.newEnterpriseTag}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>企业类型</label>
+                                            <select class="form-control" id="newEnterpriseType" name="newEnterpriseType" value="{$ecr.newEnterpriseType}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </table>
+                        </div>
+                        {/if}
+                    </div>
+                </div>
+                {/if}
+                <div class="panel panel-default">
+                    <div class="panel-heading">人才联络员信息</div>
+                    <div class="panel-body">
+                        <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentName" name="newAgentName" value="{$ecr.newAgentName}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>电子邮箱</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentEmail" name="newAgentEmail" value="{$ecr.newAgentEmail}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员手机号</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentPhone" name="newAgentPhone" value="{$ecr.newAgentPhone}"/>
+                                    </div>
+                                </td>
+                                <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']"}
+                                    {eq name="ecr.beian_is_img" value="1"}
+                                    <img src="{$ecr.beian|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')">
+                                    {/eq}
+                                    {else/}
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="beian" name="beian" />
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
                 </div>
                 </div>
             </div>
             </div>
-        </div>
+        </form>
     </div>
     </div>
 </div>
 </div>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>

+ 228 - 154
app/enterprise/view/api/to_update.html

@@ -1,178 +1,252 @@
 {extend name="layout/content"}
 {extend name="layout/content"}
 {block name="content"}
 {block name="content"}
 <style>
 <style>
-    .upload-btn{
-        position: relative;
-        display: inline-block;
-        cursor: pointer;
-        background: #1ab394;
-        padding: 6px 12px;
-        color: #fff;
-        text-align: center;
-        border-radius: 3px;
-        overflow: hidden;
-        font-size: 14px;
-        font-weight: 400;
+    .panel-heading{
+        color:#333;
+        background-color:#f5f5f5;
+        border-color:#ddd
     }
     }
     .spacing {
     .spacing {
         margin-bottom: 10px;
         margin-bottom: 10px;
         padding-right:4px;
         padding-right:4px;
         padding-left: 4px;
         padding-left: 4px;
     }
     }
-    .imgs li{
-        list-style: none;
-        float: left;
-        border: 1px solid #d8d1d1;
-        text-align: center;
-        height: 30px;
+    .has-feedback label~.form-control-feedback{
+        top: 35px;
+    }
+    .table .td-label{
+        display: block;
+        text-align: left;
+        border-bottom: 1px solid #ccc;
+        margin-bottom: 10px;
+    }
+    .word-wrap{
+        width:100%;
+        white-space:normal;
+        word-wrap:break-word;
+        word-break:break-all;
     }
     }
 </style>
 </style>
 <div class="ibox float-e-margins">
 <div class="ibox float-e-margins">
-    <div class="ibox-content" style="height: 600px;">
-        <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="EpChangeEdit.initFileTable()"  aria-expanded="false">2.附件上传</a></li>
-                        </ul>
+    <div class="ibox-content">                                
+        <form id="ecr_form" class="form-horizontal" target="hiddenIframe" action="" method="post" enctype="multipart/form-data">
+            <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}"/>
+            <input type="hidden" id="checkState" name="checkState" value="{$ecr.checkState}"/>
+            <input type="hidden" id="fields" name="fields" value="{$ecr.modify_fields}"/>
+            <input type="hidden" id="files" name="files" value="{$ecr.modify_files}"/>
+            <div class="form-horizontal">
+                <div class="panel panel-default">
+                    <div class="panel-heading">基础信息</div>
+                    <div class="panel-body">
+                        <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业名称</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newName" name="newName" value="{$ecr.newName}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>统一社会信用代码</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newIdCard" name="newIdCard"  value="{$ecr.newIdCard}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>法人代表</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newLegal" name="newLegal" value="{$ecr.newLegal}"/>
+                                    </div>
+                                </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']"}
+                                    {eq name="ecr.imgurl_is_img" value="1"}
+                                    <img src="{$ecr.imgurl|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')">
+                                    {/eq}
+                                    {else/}
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}                                
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="imgurl" name="imgurl" />
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>所属街道</label>
+                                        <select class="form-control" id="newStreet" name="newStreet" value="{$ecr.newStreet}"></select>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业地址</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>
+                                        <input autocomplete="off" type="text" class="form-control" id="newEphone" name="newEphone" placeholder="固话格式0595xxxx" value="{$ecr.newEphone}"/>
+                                    </div>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>企业银行账号</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>
+                                        <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>
+                                        <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']"}
+                                    {eq name="ecr.bankImg_is_img" value="1"}
+                                    <img src="{$ecr.bankImg|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')">
+                                    {/eq}
+                                    {else/}
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="bankImg" name="bankImg" />
+                                </td>
+                            </tr>
+                        </table>
                     </div>
                     </div>
-                    <div class="tab-content">
-                        <div id="tab-1" class="tab-pane active">
-                            <div class="panel-body">
-                                <form id="ecr_form" class="form-horizontal" target="hiddenIframe" action="" method="post" enctype="multipart/form-data">
-                                    <input type="text" class="form-control" id="enterprise_id" name="enterprise_id" value="{$ecr.mainId}" style="display: none;"/>
-                                    <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}"/>
-                                    <input type="hidden" id="fields" name="fields" value="{$ecr.modify_fields}"/>
-                                    <input type="hidden" id="files" name="files" value="{$ecr.modify_files}"/>
-                                    <div class="col-sm-12 ">
-                                        <div class="row" id="baseForm">
-                                            <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}"/>
-                                                </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}"/>
-                                                </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">
-                                                    <select type="text" class="form-control" id="newIndustryFieldNew" name="newIndustryFieldNew" value="{$ecr.newIndustryFieldNew}"></select>
-                                                </div>
-                                            </div>
-                                            <div class="rowGroup" style="display: none">
-                                                <label class="col-sm-2 control-label spacing">行业领域</label>
-                                                <div class="col-sm-4 spacing">
-                                                    <select type="text" class="form-control" id="newIndustryFieldOld" name="newIndustryFieldOld" value="{$ecr.newIndustryFieldOld}"></select>
-                                                </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">
-                                                    <select type="text" class="form-control" id="newEnterpriseTag" name="newEnterpriseTag" value="{$ecr.newEnterpriseTag}"></select>
-                                                </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">
-                                                    <select type="text" class="form-control" id="newEnterpriseType" name="newEnterpriseType" value="{$ecr.newEnterpriseType}"></select>
-                                                </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}"/>
-                                                </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">
-                                                    <select class="form-control" id="newStreet" name="newStreet" value="{$ecr.newStreet}"></select>
-                                                </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}"/>
-                                                </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}"/>
-                                                </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}"/>
-                                                </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}"/>
-                                                </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}"/>
-                                                </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="newBankCard" name="newBankCard" value="{$ecr.newBankCard}"/>
-                                                </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="newBank" name="newBank" value="{$ecr.newBank}"/>
-                                                </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="newBankNetwork" name="newBankNetwork" value="{$ecr.newBankNetwork}" placeholder="XX银行XX支行/分行/分理处"/>
-                                                </div>
-                                            </div>
-                                        </div>
+                </div>
+                {if condition="$ecr['special'] eq 0"}
+                <div class="panel panel-default">
+                    <div class="panel-heading">申报基础信息</div>
+                    <div class="panel-body">
+                        <div class="row">
+                            <div class="rowGroup" >
+                                <label class="col-sm-1 control-label spacing"><span class="text-danger">*</span>申报类型</label>
+                                <div class="col-sm-4 spacing">
+                                    <div class="form-control" disabled="disabled">
+                                        {switch name="ecr.type"}
+                                        {case value="1"}晋江市现代产业体系人才{/case}
+                                        {case value="2"}集成电路优秀人才{/case}
+                                        {case value="3"}海峡计划团队{/case}
+                                        {/switch}
                                     </div>
                                     </div>
-                                </form>
+                                </div>
                             </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>
+                        {if condition="$ecr['type'] eq 1"}
+                        <div class="row" id="typeGroup">
+                            <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
+                                <tr>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>产业领域</label>
+                                            <select autocomplete="off" type="text" class="form-control" id="newIndustryFieldNew" name="newIndustryFieldNew" value="{$ecr.newIndustryFieldNew}" onchange="EpChangeEdit.industryChange()"></select>
+                                        </div>
+                                    </td>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>行业领域</label>
+                                            <select class="form-control" id="newIndustryFieldOld" name="newIndustryFieldOld" value="{$ecr.newIndustryFieldOld}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                    <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']"}
+                                        {eq name="ecr.domainImg_is_img" value="1"}
+                                        <img src="{$ecr.domainImg|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')">
+                                        {/eq}
+                                        {else/}
+                                        <img src="/static/img/yyzz.png" style="height: 60px;">
+                                        {/if}
+                                        <input style="display: none" autocomplete="off" type="file" class="form-control" id="domainImg" name="domainImg" />
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>企业标签</label>
+                                            <select class="form-control" id="newEnterpriseTag" name="newEnterpriseTag" value="{$ecr.newEnterpriseTag}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                    <td>
+                                        <div class="rowGroup">
+                                            <label class="control-label spacing td-label"><span style="color: red">*</span>企业类型</label>
+                                            <select class="form-control" id="newEnterpriseType" name="newEnterpriseType" value="{$ecr.newEnterpriseType}">
+                                            </select>
+                                        </div>
+                                    </td>
+                                </tr>
                             </table>
                             </table>
-                            <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>
-                            <form id="uploadForm" action="/common/api/addTalentCommonFile" method="post" class="form-horizontal" enctype="multipart/form-data" target="hiddenIframe" style="display: none">
-                                <input type="hidden" name="backName" value="EpChangeEdit.callBack">
-                                <input type='hidden' id="fileId" name="fileId" >
-                                <input type='file' id="upload_file" name="fileUrl" style='display: none'>
-                                <input type='hidden' id="mainId" name="mainId" >
-                                <input type='hidden' id="typeId" name="typeId" >
-                                <input type='hidden' id="index" name="index" >
-                            </form>
                         </div>
                         </div>
+                        {/if}
+                    </div>
+                </div>
+                {/if}
+                <div class="panel panel-default">
+                    <div class="panel-heading">人才联络员信息</div>
+                    <div class="panel-body">
+                        <table style="width: 100%;border-collapse: collapse;" class="table table-bordered">
+                            <tr>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentName" name="newAgentName" value="{$ecr.newAgentName}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>电子邮箱</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentEmail" name="newAgentEmail" value="{$ecr.newAgentEmail}"/>
+                                    </div>
+                                </td>
+                                <td>
+                                    <div class="rowGroup">
+                                        <label class="control-label spacing td-label"><span style="color: red">*</span>人才联络员手机号</label>
+                                        <input autocomplete="off" type="text" class="form-control" id="newAgentPhone" name="newAgentPhone" value="{$ecr.newAgentPhone}"/>
+                                    </div>
+                                </td>
+                                <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']"}
+                                    {eq name="ecr.beian_is_img" value="1"}
+                                    <img src="{$ecr.beian|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')">
+                                    {/eq}
+                                    {else/}
+                                    <img src="/static/img/yyzz.png" style="height: 60px;">
+                                    {/if}
+                                    <input style="display: none" autocomplete="off" type="file" class="form-control" id="beian" name="beian" />
+                                </td>
+                            </tr>
+                        </table>
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
-        </div>
+        </form>
     </div>
     </div>
 </div>
 </div>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>

BIN
public/static/img/File.png


+ 7 - 0
public/static/js/common/Feng.js

@@ -648,5 +648,12 @@ var Feng = {
                 return false;
                 return false;
         }
         }
         return true;
         return true;
+    },
+    isImg:function(type){        
+        var imgtypes = ["image/jpeg", "image/gif", "image/png", "image/jpg"];
+        if(imgtypes.indexOf(type) > -1){
+            return true;
+        }
+        return false;
     }
     }
 };
 };

+ 61 - 22
public/static/modular/gate/enterprise/enterprise_change_edit.js

@@ -351,24 +351,26 @@ EpChangeEdit.addSubmit = function () {
     if (locked)
     if (locked)
         return;
         return;
     locked = true;
     locked = true;
-    var ajax = new $ax(Feng.ctxPath + "/enterprise/api/upsert", function (data) {
-        if (data.code == "200") {
-            Feng.success(data.msg);
-            $("#fileLi").removeAttr("style");
-            $("#id").val(data.obj.id);
-            $("#checkState").val(data.obj.checkState);
-            window.parent.EnterpriseCenter.table.refresh();
-        } else {
-            Feng.info(data.msg);
-        }
-        // $(".layui-layer-btn0",parent.document).css("pointer-events","block");
-        locked = false;
-    }, function (data) {
-        Feng.error("添加失败!" + data.responseJSON.msg + "!");
-        locked = false;
-    });
-    ajax.set(this.epChangeEditData);
-    ajax.start();
+    /*var ajax = new $ax(Feng.ctxPath + "/enterprise/api/upsert", function (data) {
+     if (data.code == "200") {
+     Feng.success(data.msg);
+     $("#fileLi").removeAttr("style");
+     $("#id").val(data.obj.id);
+     $("#checkState").val(data.obj.checkState);
+     window.parent.EnterpriseCenter.table.refresh();
+     } else {
+     Feng.info(data.msg);
+     }
+     // $(".layui-layer-btn0",parent.document).css("pointer-events","block");
+     locked = false;
+     }, function (data) {
+     Feng.error("添加失败!" + data.responseJSON.msg + "!");
+     locked = false;
+     });
+     ajax.set(this.epChangeEditData);
+     ajax.start();*/
+    $("#ecr_form").attr("action", "/enterprise/api/upsert");
+    $("#ecr_form")[0].submit();
 };
 };
 
 
 
 
@@ -413,10 +415,17 @@ EpChangeEdit.submitToCheck = function () {
 
 
 
 
 EpChangeEdit.callBack = function (data) {
 EpChangeEdit.callBack = function (data) {
-    layer.close(data.obj);
+    console.log(data)
+    /*layer.close(data.obj);
+     Feng.info(data.msg);
+     if (data.code == 200) {
+     $("#fileTable").bootstrapTable("refresh", {});
+     }*/
+    locked = false;
     Feng.info(data.msg);
     Feng.info(data.msg);
     if (data.code == 200) {
     if (data.code == 200) {
-        $("#fileTable").bootstrapTable("refresh", {});
+        $("#id").val(data.id);
+        window.parent.EnterpriseCenter.table.refresh();
     }
     }
 };
 };
 
 
@@ -431,8 +440,38 @@ EpChangeEdit.industryChange = function () {
     Feng.findChildDictBatch(JSON.stringify(arr));
     Feng.findChildDictBatch(JSON.stringify(arr));
 }
 }
 
 
+$("#imgurl,#bankImg,#beian,#domainImg").change(function (e) {
+    var that = this;
+    if (!Feng.chkFileInvalid(that.files[0], 5, 10)) {
+        return;
+    }
+    var file = that.files[0];
+    var imgSrc;
+    var reader = new FileReader();
+    reader.readAsDataURL(file);
+    reader.onload = function () {
+        if (Feng.isImg(file.type)) {
+            imgSrc = this.result;
+            $(that).prev("img").attr("src", imgSrc);
+        } else {
+            $(that).prev("img").attr("src", Feng.ctxPath + "/static/img/File.png");
+        }
+    };
+});
+
 $(function () {
 $(function () {
-    Feng.initValidator("ecr_form", EpChangeEdit.validateFields);
+    $('#ecr_form').bootstrapValidator({
+        feedbackIcons: {
+            valid: 'glyphicon glyphicon-ok',
+            invalid: 'glyphicon glyphicon-remove',
+            validating: 'glyphicon glyphicon-refresh'
+        },
+        group: '.rowGroup',
+        fields: EpChangeEdit.validateFields,
+        live: 'enabled',
+        message: '该字段不能为空'
+    });
+    //Feng.initValidator("ecr_form", EpChangeEdit.validateFields);
     var industryNew = $("#newIndustryFieldNew").attr("value");
     var industryNew = $("#newIndustryFieldNew").attr("value");
     var arr = [
     var arr = [
         {"name": "newStreet", "code": "street"},
         {"name": "newStreet", "code": "street"},
@@ -445,7 +484,7 @@ $(function () {
         $(this).val($(this).attr("value"));
         $(this).val($(this).attr("value"));
     })
     })
     if ($("#type").val() == 1) {
     if ($("#type").val() == 1) {
-        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:block");
+        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:cell");
         $("#newEnterpriseTag").val($("#newEnterpriseTag").attr("value"));
         $("#newEnterpriseTag").val($("#newEnterpriseTag").attr("value"));
         $("#newIndustryFieldNew").val($("#newIndustryFieldNew").attr("value"));
         $("#newIndustryFieldNew").val($("#newIndustryFieldNew").attr("value"));
         $("#newIndustryFieldOld").val($("#newIndustryFieldOld").attr("value"));
         $("#newIndustryFieldOld").val($("#newIndustryFieldOld").attr("value"));