浏览代码

驳回字段

sugangqiang 2 年之前
父节点
当前提交
4a36a2229c

+ 56 - 1
app/admin/controller/EnterpriseChangeRecord.php

@@ -131,8 +131,54 @@ class EnterpriseChangeRecord extends AdminController {
             return json(["msg" => 'ID不能为空!']);
         }
         $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" => "人才联络员邮箱"];
+        $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["modify_fields"]) {
+            $_modify_fields = explode(",", $ecr["modify_fields"]);
+            foreach ($_modify_fields as $_field) {
+                if ($modify_fields[$_field]) {
+                    $modify_fields[$_field]["checked"] = true;
+                } else {
+                    $modify_fields[$_field] = ["field" => $_field, "name" => $fields[substr($_field, 3)], "checked" => true];
+                }
+            }
+        }
+        $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");
 
-        return view("", ['ecr' => $ecr]);
+        $where = [];
+        $where[] = ['mainId', '=', $id];
+        $uploadTypeIds = TalentCommonFile::distinct(true)->field("typeId")->where($where)->column("typeId");
+        $modify_files = [];
+        foreach ($uploadTypeIds as $typeId) {
+            $modify_files[$typeId] = ["typeId" => $typeId, "name" => $fileTypes[$typeId], "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;
+                } else {
+                    $modify_files[$_typeId] = ["typeId" => $_typeId, "name" => $fileTypes[$_typeId], "checked" => true];
+                }
+            }
+        }
+
+        return view("", ['ecr' => $ecr, 'fields' => $modify_fields, "files" => $modify_files]);
     }
 
     public function doExamine() {
@@ -145,6 +191,8 @@ class EnterpriseChangeRecord extends AdminController {
             return json(["msg" => '原始数据不存在!', 'code' => 500]);
         }
         $checkState = trim($this->request['checkState']);
+        $files = $this->request["files"];
+        $fields = $this->request["fields"];
         if ($checkState == null || ($checkState != 4 && $checkState != 3)) {
             return json(["msg" => '请选择审核状态!', 'code' => 500]);
         }
@@ -153,6 +201,9 @@ class EnterpriseChangeRecord extends AdminController {
         if ($checkState == 3 && \StrUtil::isEmpOrNull($checkMsg)) {
             return json(["msg" => '审核驳回时,需要填写审核意见!', 'code' => 500]);
         }
+        if ($checkState == 3 && !$files && !$fields) {
+            return json(["msg" => '审核驳回时,需要选择可修改的字段或者附件!', 'code' => 500]);
+        }
         if (\StrUtil::isNotEmpAndNull($checkMsg) && strlen($checkMsg) > 200) {
             return json(["msg" => '审核意见最多200个字符!', 'code' => 500]);
         }
@@ -165,6 +216,8 @@ class EnterpriseChangeRecord extends AdminController {
             $ecr->checkMsg = $checkMsg;
             $ecr->updateUser = session('user')['uid'];
             $ecr->updateTime = date("Y-m-d H:i:s");
+            $ecr->modify_fields = $fields ? implode(",", $fields) : null;
+            $ecr->modify_files = $files ? implode(",", $files) : null;
             $ecr->save();
             //发送短信
             $record_data = [
@@ -210,6 +263,8 @@ class EnterpriseChangeRecord extends AdminController {
             $ecr->checkMsg = $checkMsg;
             $ecr->updateUser = session('user')['uid'];
             $ecr->updateTime = date("Y-m-d H:i:s");
+            $ecr->modify_fields = null;
+            $ecr->modify_files = null;
             $ecr->save();
 
             $ep = EnterpriseApi::getOne($ecr['mainId']);

+ 56 - 32
app/admin/view/enterprise_change_record/goto_enterprise_change_examine_page.html

@@ -1,39 +1,63 @@
 {extend name="layout/content"}
 {block name="content"}
 <div class="ibox float-e-margins">
-  <div class="ibox-content">
-    <form id="erc_examine" class="form-horizontal">
-      <input type="text" id="id" value="{$ecr.id}" style="display: none;" />
-      <div class="row">
-        <div class="row">
-          <div class="col-sm-12">
-            <div class="rowGroup"  style="margin-bottom: 0px;">
-              <label class="col-sm-2 control-label"><span class="text-danger">*</span>审核状态</label>
-              <div class="col-sm-10">
-                <select class="form-control" id="checkState" name="checkState" onchange="examine.toggleField()" >
-                  <option value="">--- 请选择 ---</option>
-                  <option value="3">审核驳回</option>
-                  <option value="4">审核通过</option>
-                </select>
-              </div>
+    <div class="ibox-content">
+        <form id="erc_examine" class="form-horizontal">
+            <input type="text" id="id" value="{$ecr.id}" style="display: none;" />
+            <div class="row">
+                <div class="row">
+                    <div class="col-sm-12">
+                        <div class="rowGroup"  style="margin-bottom: 0px;">
+                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>审核状态</label>
+                            <div class="col-sm-10">
+                                <select class="form-control" id="checkState" name="checkState" onchange="examine.toggleField()" >
+                                    <option value="">--- 请选择 ---</option>
+                                    <option value="3">审核驳回</option>
+                                    <option value="4">审核通过</option>
+                                </select>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="hr-line-dashed"></div>
+                <div class="row">
+                    <div class="col-sm-12">
+                        <div class="rowGroup"  style="margin-bottom: 0px;">
+                            <label class="col-sm-2 control-label">审核意见</label>
+                            <div class="col-sm-10">
+                                <textarea class="form-control" rows="6" id="checkMsg" name="checkMsg">{$ecr.checkMsg}</textarea>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div id="field" style="padding-top:5px;display:none">
+                    <label for="checkMsg" class="control-label">可修改字段</label>
+                    <div id="field_info">
+                        <ul style="overflow:hidden;list-style:none;">
+                            {volist name="fields" id="field"}
+                            <li style="float:left;margin-right:10px;"><input type="checkbox" value="{$field.field}" {if condition="$field['checked']"}checked="true"{/if}><span>{$field.name}</span></li>
+                            {/volist}
+                        </ul>
+                    </div>
+                    <label for="checkMsg" class="control-label">可修改附件</label>
+                    <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>
+                            {/volist}
+                        </ul>
+                    </div>
+                    <div class="form-group" style="text-align: center">
+                        <button type="button" class="btn btn-primary" onclick="examine.checkAll()">全选</button>
+                        <button type="button" class="btn btn-success" onclick="examine.unCheckAll()">反选</button>
+                    </div>
+                </div>
             </div>
-          </div>
-        </div>
-        <div class="hr-line-dashed"></div>
-        <div class="row">
-          <div class="col-sm-12">
-            <div class="rowGroup"  style="margin-bottom: 0px;">
-              <label class="col-sm-2 control-label">审核意见</label>
-              <div class="col-sm-10">
-                <textarea class="form-control" rows="6" id="checkMsg" name="checkMsg">{$ecr.checkMsg}</textarea>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </form>
-  </div>
+        </form>
+    </div>
 </div>
 <input type="text" id="checkStateTemp" value="{$ecr.checkState}" style="display: none;" />
-<script src="/static/modular/enterprise/enterprisechangeRecord/ep_change_record_examine.js?v=1"></script>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/enterprise/enterprisechangeRecord/ep_change_record_examine.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
 {/block}

+ 94 - 91
app/enterprise/controller/Api.php

@@ -15,19 +15,18 @@ use think\exception\ValidateException;
 
 class Api extends EnterpriseController {
 
-    public function findEnterpriseChangeByPage()
-    {
+    public function findEnterpriseChangeByPage() {
         $order = trim($this->request->param("order")) ?: "desc";
         $offset = trim($this->request->param("offset")) ?: 0;
         $limit = trim($this->request->param("limit")) ?: 10;
 
-        $list = EnterpriseRecord::where('mainId',session("user")["uid"])->limit($offset, $limit)->order('createTime ' . $order)->select()->toArray();
+        $list = EnterpriseRecord::where('mainId', session("user")["uid"])->limit($offset, $limit)->order('createTime ' . $order)->select()->toArray();
         $count = count($list);
-        if($count > 0){
+        if ($count > 0) {
             $streetList = DictApi::selectByParentCode('street');
             $typeList = DictApi::selectByParentCode('enterprise_type');
             $industryFieldNew = DictApi::selectByParentCode('industry_field');
-            foreach ($list as $k => &$v){
+            foreach ($list as $k => &$v) {
                 $v['newIndustryFieldNewName'] = $industryFieldNew[$v['newIndustryFieldNew']];
                 $v['newEnterpriseType'] = $typeList[$v['newEnterpriseType']];
                 $v['newStreetName'] = $streetList[$v['newStreet']];
@@ -37,13 +36,12 @@ class Api extends EnterpriseController {
         return json(["total" => $count, "rows" => $list]);
     }
 
-    public function findUnfinishedChangeRecord(){
-        return EnterpriseRecord::where('mainId',session("user")["uid"])->where('checkState','<>', 4)->select()->toArray();
+    public function findUnfinishedChangeRecord() {
+        return EnterpriseRecord::where('mainId', session("user")["uid"])->where('checkState', '<>', 4)->select()->toArray();
     }
 
-    public function toAdd()
-    {
-        $ep = Enterprise::where('id',session("user")["uid"])->find();
+    public function toAdd() {
+        $ep = Enterprise::where('id', session("user")["uid"])->find();
         $ecr = [
             'enterprise_id' => $ep['id'],
             'newName' => $ep['name'],
@@ -65,7 +63,7 @@ class Api extends EnterpriseController {
             'newBankNetwork' => $ep['bankNetwork']
         ];
 
-        switch ($ep['checkState']){
+        switch ($ep['checkState']) {
             case 1:
                 $ecr['checkStateName'] = '保存未提交审核';
                 break;
@@ -86,7 +84,7 @@ class Api extends EnterpriseController {
         }
 
         //20220918增加根据不同的企业类型显示不同的信息变更界面
-        switch ($ep->special){
+        switch ($ep->special) {
             case 0:
                 return view("", ['ecr' => $ecr]);
                 break;
@@ -97,42 +95,40 @@ class Api extends EnterpriseController {
 
                 break;
         }
-
-
     }
 
-    public function upsert(){
+    public function upsert() {
         $data = [
-            'id' => \StrUtil::getRequestDecodeParam($this->request,'enterprise_id'),
-            'name' => \StrUtil::getRequestDecodeParam($this->request,'newName'),//单位名称
-            'idCard' => \StrUtil::getRequestDecodeParam($this->request,'newIdCard'),//统一社会信用代码
-            'agentName' => \StrUtil::getRequestDecodeParam($this->request,'newAgentName'),//人才联络员
-            'agentPhone' => \StrUtil::getRequestDecodeParam($this->request,'newAgentPhone'),//人才联络员电话
-            'legal' => \StrUtil::getRequestDecodeParam($this->request,'newLegal'),//法人
-            'street' => \StrUtil::getRequestDecodeParam($this->request,'newStreet'),//镇街
-            'address' => \StrUtil::getRequestDecodeParam($this->request,'newAddress'),//地址
+            'id' => \StrUtil::getRequestDecodeParam($this->request, 'enterprise_id'),
+            'name' => \StrUtil::getRequestDecodeParam($this->request, 'newName'), //单位名称
+            'idCard' => \StrUtil::getRequestDecodeParam($this->request, 'newIdCard'), //统一社会信用代码
+            'agentName' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentName'), //人才联络员
+            'agentPhone' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentPhone'), //人才联络员电话
+            'legal' => \StrUtil::getRequestDecodeParam($this->request, 'newLegal'), //法人
+            'street' => \StrUtil::getRequestDecodeParam($this->request, 'newStreet'), //镇街
+            'address' => \StrUtil::getRequestDecodeParam($this->request, 'newAddress'), //地址
             'type' => intval($this->request['type']),
-            'enterpriseTag' => \StrUtil::getRequestDecodeParam($this->request,'newEnterpriseTag'),//单位标签
-            'enterpriseType' => \StrUtil::getRequestDecodeParam($this->request,'newEnterpriseType'),//单位类型
-            'agentEmail' => \StrUtil::getRequestDecodeParam($this->request,'newAgentEmail'),//邮箱
-            'ephone' => \StrUtil::getRequestDecodeParam($this->request,'newEphone'),//单位电话
-            'industryFieldNew' => \StrUtil::getRequestDecodeParam($this->request,'newIndustryFieldNew'),//产业领域
-            'industryFieldOld' => \StrUtil::getRequestDecodeParam($this->request,'newIndustryFieldOld'),//行业领域
-            'bankCard' => \StrUtil::getRequestDecodeParam($this->request,'newBankCard'),//银行
-            'bank' => \StrUtil::getRequestDecodeParam($this->request,'newBank'),//开户行
-            'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request,'newBankNetwork')//网点
+            'enterpriseTag' => \StrUtil::getRequestDecodeParam($this->request, 'newEnterpriseTag'), //单位标签
+            'enterpriseType' => \StrUtil::getRequestDecodeParam($this->request, 'newEnterpriseType'), //单位类型
+            'agentEmail' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentEmail'), //邮箱
+            'ephone' => \StrUtil::getRequestDecodeParam($this->request, 'newEphone'), //单位电话
+            'industryFieldNew' => \StrUtil::getRequestDecodeParam($this->request, 'newIndustryFieldNew'), //产业领域
+            'industryFieldOld' => \StrUtil::getRequestDecodeParam($this->request, 'newIndustryFieldOld'), //行业领域
+            'bankCard' => \StrUtil::getRequestDecodeParam($this->request, 'newBankCard'), //银行
+            'bank' => \StrUtil::getRequestDecodeParam($this->request, 'newBank'), //开户行
+            'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'newBankNetwork')//网点
         ];
 
         try {
-            if(stripos($data['name'],"(")){
-                $data['name'] = str_replace('(','(',$data['name']);
+            if (stripos($data['name'], "(")) {
+                $data['name'] = str_replace('(', '(', $data['name']);
             }
 
-            if(stripos($data['name'],")")){
-                $data['name'] = str_replace(')',')',$data['name']);
+            if (stripos($data['name'], ")")) {
+                $data['name'] = str_replace(')', ')', $data['name']);
             }
-            $ep = Enterprise::where('id',session("user")["uid"])->find();
-            switch ($ep->special){
+            $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);
                     break;
@@ -144,8 +140,8 @@ class Api extends EnterpriseController {
                     break;
             }
 
-            $record_id = \StrUtil::getRequestDecodeParam($this->request,'id');
-            if(!$record_id){
+            $record_id = \StrUtil::getRequestDecodeParam($this->request, 'id');
+            if (!$record_id) {
                 $record_data = [
                     'id' => getStringId(),
                     'mainId' => $data['id'],
@@ -173,7 +169,7 @@ class Api extends EnterpriseController {
                     'newStreet' => $data['street'],
                     'newAddress' => $data['address'],
                     'newLegal' => $data['legal'],
-                    'newEphone' =>  $data['ephone'],
+                    'newEphone' => $data['ephone'],
                     'newAgentName' => $data['agentName'],
                     'newAgentEmail' => $data['agentEmail'],
                     'newAgentPhone' => $data['agentPhone'],
@@ -183,7 +179,7 @@ class Api extends EnterpriseController {
                     'newBank' => $data['bank'],
                     'newBankNetwork' => $data['bankNetwork'],
                     'checkState' => 1,
-                    'createTime' => date("Y-m-d H:i:s",time()),
+                    'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => session("user")["uid"]
                 ];
                 EnterpriseRecord::create($record_data);
@@ -198,13 +194,13 @@ class Api extends EnterpriseController {
                     'step' => 100,
                     'stateChange' => '保存未提交',
                     'description' => '机构信息变更记录添加成功',
-                    'createTime' => date("Y-m-d H:i:s",time()),
+                    'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => '用户'
                 ];
                 $res = ['msg' => '添加成功', 'code' => 200, 'obj' => $record_data];
             } else {
                 $record = EnterpriseRecord::find($record_id);
-                $ep = Enterprise::where('id',session("user")["uid"])->find();
+                $ep = Enterprise::where('id', session("user")["uid"])->find();
                 $record->oldName = $ep['name'];
                 $record->oldIdCard = $ep['idCard'];
                 $record->oldIndustryFieldNew = $ep['industryFieldNew'];
@@ -221,22 +217,30 @@ class Api extends EnterpriseController {
                 $record->oldBankCard = $ep['bankCard'];
                 $record->oldBank = $ep['bank'];
                 $record->oldBankNetwork = $ep['bankNetwork'];
-                $record->newName = htmlspecialchars($data['name']);
-                $record->newIdCard = htmlspecialchars($data['idCard']);
-                $record->newIndustryFieldNew = $data['industryFieldNew'];
-                $record->newIndustryFieldOld = $data['industryFieldOld'];
-                $record->newStreet = $data['street'];
-                $record->newAddress = $data['address'];
-                $record->newLegal = $data['legal'];
-                $record->newEphone = $data['ephone'];
-                $record->newAgentName = $data['agentName'];
-                $record->newAgentEmail = $data['agentEmail'];
-                $record->newAgentPhone = $data['agentPhone'];
-                $record->newEnterpriseTag = $data['enterpriseTag'];
-                $record->newEnterpriseType = $data['enterpriseType'];
-                $record->newBankCard = $data['bankCard'];
-                $record->newBank = $data['bank'];
-                $record->newBankNetwork = $data['bankNetwork'];
+
+                $fields = array_filter(explode(",", $record->modify_fields));
+                for ($i = 0; $i < count($fields); $i++) {
+                    $key = lcfirst(substr($fields[$i], 3));
+                    $record[$fields[$i]] = $data[$key]; //仅可修改选择的字段
+                }
+
+                /* $record->newName = htmlspecialchars($data['name']);
+                  $record->newIdCard = htmlspecialchars($data['idCard']);
+                  $record->newIndustryFieldNew = $data['industryFieldNew'];
+                  $record->newIndustryFieldOld = $data['industryFieldOld'];
+                  $record->newStreet = $data['street'];
+                  $record->newAddress = $data['address'];
+                  $record->newLegal = $data['legal'];
+                  $record->newEphone = $data['ephone'];
+                  $record->newAgentName = $data['agentName'];
+                  $record->newAgentEmail = $data['agentEmail'];
+                  $record->newAgentPhone = $data['agentPhone'];
+                  $record->newEnterpriseTag = $data['enterpriseTag'];
+                  $record->newEnterpriseType = $data['enterpriseType'];
+                  $record->newBankCard = $data['bankCard'];
+                  $record->newBank = $data['bank'];
+                  $record->newBankNetwork = $data['bankNetwork']; */
+
                 $record->updateTime = date("Y-m-d H:i:s");
                 $record->updateUser = session("user")["uid"];
 
@@ -252,7 +256,7 @@ class Api extends EnterpriseController {
                     'step' => 100,
                     'stateChange' => '保存未提交',
                     'description' => '机构信息变更记录修改成功',
-                    'createTime' => date("Y-m-d H:i:s",time()),
+                    'createTime' => date("Y-m-d H:i:s", time()),
                     'createUser' => '用户'
                 ];
 
@@ -262,19 +266,18 @@ class Api extends EnterpriseController {
             TalentChecklog::create($log);
 
             return json($res);
-        } catch (ValidateException $e){
+        } catch (ValidateException $e) {
             $error = $e->getError();
-            return json(["msg" => array_pop($error),'code' => 500]);
+            return json(["msg" => array_pop($error), 'code' => 500]);
         }
-
     }
 
-    public function toUpdate(){
+    public function toUpdate() {
         $id = trim($this->request['id']);
         $ecr = EnterpriseRecord::findOrEmpty($id);
-        $ep = Enterprise::where('id',$ecr->mainId)->find();
+        $ep = Enterprise::where('id', $ecr->mainId)->find();
 
-        switch ($ep->special){
+        switch ($ep->special) {
             case 0:
                 return view("", ['ecr' => $ecr]);
                 break;
@@ -287,25 +290,25 @@ class Api extends EnterpriseController {
         }
     }
 
-    public function submitToCheck(){
+    public function submitToCheck() {
         $id = trim($this->request->post('id'));
-        if(!$id){
+        if (!$id) {
             return json(['msg' => '记录为空', 'code' => 500]);
         }
         $obj = EnterpriseRecord::find($id);
 
-        if(!$obj){
+        if (!$obj) {
             return json(['msg' => '提交审核失败,请先填写基础信息', 'code' => 500]);
         }
 
-        if($obj['checkState'] != 1 && $obj['checkState'] != 3){
+        if ($obj['checkState'] != 1 && $obj['checkState'] != 3) {
             return json(['msg' => '不能重复提交审核', 'code' => 500]);
         }
 
         $ep = EnterpriseApi::getOne($obj->mainId);
 
         //20220918增加根据不同的企业类型显示不同的信息变更界面
-        switch ($ep->special){
+        switch ($ep->special) {
             case 0:
                 $org_type = 'enterpriseChange';
                 break;
@@ -317,29 +320,29 @@ class Api extends EnterpriseController {
                 break;
         }
 
-        $list = CurrentcyFileType::where('type',$org_type)->where('active',1)->select();
-        if(!$list || count($list) <= 0){
+        $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){
+        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){
+        if (strlen($error_msg) > 0) {
             return json(['msg' => $error_msg, 'code' => 500]);
         }
-        if($obj['checkState'] == 3){
+        if ($obj['checkState'] == 3) {
             $obj['checkState'] = 5;
             $state = 5;
-        }else{
+        } else {
             $obj['checkState'] = 2;
             $state = 2;
         }
@@ -353,18 +356,18 @@ class Api extends EnterpriseController {
             'active' => 1,
             'state' => $state,
             'step' => 100,
-            'stateChange' => "<span class='label'>待提交</span>-><span class='label label-success'>待审核</span>" ,
+            'stateChange' => "<span class='label'>待提交</span>-><span class='label label-success'>待审核</span>",
             'description' => '提交审核',
-            'createTime' => date("Y-m-d H:i:s",time()),
+            'createTime' => date("Y-m-d H:i:s", time()),
             'createUser' => '用户'
         ];
         TalentChecklog::create($log);
         return json(['msg' => '提交审核成功', 'code' => 200, 'obj' => 1]);
     }
 
-    public function toDetail(){
+    public function toDetail() {
         $id = trim($this->request['id']);
-        if(!$id){
+        if (!$id) {
             return json(['msg' => '记录为空', 'code' => 500]);
         }
         $ecr = EnterpriseRecord::find($id);
@@ -373,7 +376,7 @@ class Api extends EnterpriseController {
         $ecr['oldStreetName'] = $streetList[$ecr['oldStreet']];
         $ecr['newStreetName'] = $streetList[$ecr['newStreet']];
         //20220918增加根据不同的企业类型显示不同的信息变更界面
-        switch ($ep->special){
+        switch ($ep->special) {
             case 0:
                 $tagList = DictApi::selectByParentCode('enterprise_tag');
                 $typeList = DictApi::selectByParentCode('enterprise_type');
@@ -391,15 +394,15 @@ class Api extends EnterpriseController {
 
 
 
-                return view("",['ecr' => $ecr]);
+                return view("", ['ecr' => $ecr]);
                 break;
             case 1:
-                return view("to_detail1",['ecr' => $ecr]);
+                return view("to_detail1", ['ecr' => $ecr]);
                 break;
             default:
 
                 break;
         }
-
     }
-}
+
+}

+ 167 - 165
app/enterprise/view/api/to_update.html

@@ -1,181 +1,183 @@
 {extend name="layout/content"}
 {block name="content"}
 <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;
-  }
+    .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;
+    }
 </style>
 <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>
-          <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}"/>
-                  <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}"/>
-                        </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 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>
+                    <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>
+                                </form>
+                            </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>
+                            <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>
                     </div>
-                  </div>
-                </form>
-              </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>
-              <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>
-          </div>
         </div>
-      </div>
     </div>
-  </div>
 </div>
 <iframe style="display: none;" id="hiddenIframe" name="hiddenIframe"></iframe>
 <!--<script src="${ctxPath}/static/modular/gate/enterprise/enterprise_change_edit.js"></script>-->
 <script type="text/javascript">
-  document.write('<script src="/static/modular/gate/enterprise/enterprise_change_edit.js?v='+(new Date()).getTime()+'"><\/script>');
+    document.write('<script src="/static/modular/gate/enterprise/enterprise_change_edit.js?v=' + (new Date()).getTime() + '"><\/script>');
 </script>
 {/block}

+ 27 - 45
app/enterprise/view/api/to_update1.html

@@ -36,110 +36,94 @@
                 <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 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>
                     <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}"/>
+                                <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">
+                                        <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}"/>
+                                                    <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">统一社会信用代码</label>
                                                 <div class="col-sm-4 spacing">
-                                                    <input type="text" class="form-control" id="newIdCard"
-                                                           name="newIdCard" value="{$ecr.newIdCard}"/>
+                                                    <input type="text" class="form-control" id="newIdCard" name="newIdCard" value="{$ecr.newIdCard}"/>
                                                 </div>
                                             </div>
                                             <div class="rowGroup" style="margin-bottom: 0px;">
                                                 <label class="col-sm-2 control-label spacing">法人代表</label>
                                                 <div class="col-sm-4 spacing">
-                                                    <input type="text" class="form-control" id="newLegal"
-                                                           name="newLegal" value="{$ecr.newLegal}"/>
+                                                    <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>
+                                                    <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}"/>
+                                                    <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}"/>
+                                                    <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}"/>
+                                                    <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}"/>
+                                                    <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}"/>
+                                                    <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">企业银行账号</label>
                                                 <div class="col-sm-4 spacing">
-                                                    <input type="text" class="form-control" id="newBankCard"
-                                                           name="newBankCard" value="{$ecr.newBankCard}"/>
+                                                    <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">企业开户银行</label>
                                                 <div class="col-sm-4 spacing">
-                                                    <input type="text" class="form-control" id="newBank" name="newBank"
-                                                           value="{$ecr.newBank}"/>
+                                                    <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">企业开户银行网点</label>
                                                 <div class="col-sm-4 spacing">
-                                                    <input type="text" class="form-control" id="newBankNetwork"
-                                                           name="newBankNetwork" value="{$ecr.newBankNetwork}"/>
+                                                    <input type="text" class="form-control" id="newBankNetwork" name="newBankNetwork" value="{$ecr.newBankNetwork}"/>
                                                 </div>
                                             </div>
                                         </div>
@@ -148,13 +132,11 @@
                             </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">
+                            <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>
+                                    <tr>
+                                        <th data-field="selectItem" data-checkbox="true"></th>
+                                    </tr>
                                 </thead>
                             </table>
                             <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label>

+ 41 - 41
public/static/modular/enterprise/enterprise_examine.js

@@ -1,50 +1,50 @@
 var EpExam = {};
 var locked = false;
 
-EpExam.addSubmit = function() {
-	var id = $("#id").val();
-	var checkState = $("#checkState").val();
-	var checkMsg = $("#checkMsg").val();
-	if(checkState == null || checkState == ""){
-		Feng.info("请选择审核状态");
-		return ;
-	}
-	if(checkMsg == null || checkMsg == ""){
-		Feng.info("请填写审核意见");
-		return ;
-	}
-	var da = {"id":id, "checkState":checkState, "checkMsg":checkMsg};
-	var operation = function() {
-		var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doExamine", function (data) {
-			if (data.code == 200) {
-				window.parent.Enterprise.table.refresh();
-				parent.layer.closeAll();
-			}
-			Feng.info(data.msg);
-		}, function (data) {
-			Feng.error("操作失败!" + data.responseJSON.message + "!");
-		});
-		ajax.set(da);
-		ajax.start();
-	};
-	Feng.confirm("确定提交吗?", operation);
+EpExam.addSubmit = function () {
+    var id = $("#id").val();
+    var checkState = $("#checkState").val();
+    var checkMsg = $("#checkMsg").val();
+    if (checkState == null || checkState == "") {
+        Feng.info("请选择审核状态");
+        return;
+    }
+    if (checkMsg == null || checkMsg == "") {
+        Feng.info("请填写审核意见");
+        return;
+    }
+    var da = {"id": id, "checkState": checkState, "checkMsg": checkMsg};
+    var operation = function () {
+        var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doExamine", function (data) {
+            if (data.code == 200) {
+                window.parent.Enterprise.table.refresh();
+                parent.layer.closeAll();
+            }
+            Feng.info(data.msg);
+        }, function (data) {
+            Feng.error("操作失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set(da);
+        ajax.start();
+    };
+    Feng.confirm("确定提交吗?", operation);
 };
 
-EpExam.toggleField = function(){
-	var checkState = $("#checkState").val();
-	var checkMsg = $("#checkMsg").val();
-	if(checkState==3){
-		if(checkMsg == null || checkMsg == ''){
-			$("#checkMsg").val("机构账号注册审核通过。");
-		}
-	}else{
-		$("#checkMsg").val("");
-	}
+EpExam.toggleField = function () {
+    var checkState = $("#checkState").val();
+    var checkMsg = $("#checkMsg").val();
+    if (checkState == 3) {
+        if (checkMsg == null || checkMsg == '') {
+            $("#checkMsg").val("机构账号注册审核通过。");
+        }
+    } else {
+        $("#checkMsg").val("");
+    }
 }
 
 $(function () {
-	var checkStateTemp = $("#checkStateTemp").val();
-	if (checkStateTemp!=null && checkStateTemp!='' && checkStateTemp!=1) {
-		$("#checkState").val(checkStateTemp);
-	}
+    var checkStateTemp = $("#checkStateTemp").val();
+    if (checkStateTemp != null && checkStateTemp != '' && checkStateTemp != 1) {
+        $("#checkState").val(checkStateTemp);
+    }
 });

+ 35 - 10
public/static/modular/enterprise/enterprisechangeRecord/ep_change_record_examine.js

@@ -1,29 +1,44 @@
 var examine = {};
 var locked = false;
 
-examine.addSubmit = function() {
+examine.addSubmit = function () {
     var id = $("#id").val();
     var checkState = $("#checkState").val();
     var checkMsg = $("#checkMsg").val();
-    if (checkState==null || checkState=='') {
+    if (checkState == null || checkState == '') {
         Feng.info("请选择审核状态!");
         return;
     }
-    if (checkMsg==null || checkMsg=='') {
+    if (checkMsg == null || checkMsg == '') {
         Feng.info("请填写审核意见!");
         return;
     }
-    var da = {"id":id, "checkState":checkState, "checkMsg":checkMsg};
-    if(locked)return;
+    if (checkState == 3 && $("#field input[type=checkbox]:checked").length == 0) {
+        Feng.info("请选择驳回修改的字段或者附件");
+        return;
+    }
+    var fieldCount = $("#field_info input[type=checkbox]:checked").length;
+    var fields = new Array();
+    for (var i = 0; i < fieldCount; i++) {
+        fields.push($("#field_info input[type=checkbox]:checked").eq(i).val());
+    }
+    var fileCount = $("#field_file input[type=checkbox]:checked").length;
+    var files = new Array();
+    for (var i = 0; i < fileCount; i++) {
+        files.push($("#field_file input[type=checkbox]:checked").eq(i).val());
+    }
+    var da = {"id": id, "checkState": checkState, "checkMsg": checkMsg, fields: fields, files: files};
+    if (locked)
+        return;
     locked = true;
-    var ajax = new $ax(Feng.ctxPath + "/admin/enterpriseChangeRecord/doExamine", function(data){
+    var ajax = new $ax(Feng.ctxPath + "/admin/enterpriseChangeRecord/doExamine", function (data) {
         if (data.code == 200) {
             window.parent.parent.EpChange.table.refresh();
             parent.layer.closeAll();
         }
         Feng.info(data.msg);
         locked = false;
-    },function(data){
+    }, function (data) {
         Feng.error("操作失败!" + data.responseJSON.message + "!");
         locked = false;
     });
@@ -31,14 +46,24 @@ examine.addSubmit = function() {
     ajax.start();
 };
 
+examine.checkAll = function () {
+    $("#field input[type=checkbox]").prop("checked", true);
+}
+examine.unCheckAll = function () {
+    $("#field input[type=checkbox]").removeAttr("checked");
+}
+
 examine.toggleField = function () {
     var checkState = $("#checkState").val();
     var checkMsg = $("#checkMsg").val();
-    if(checkState==4){
-        if(checkMsg == null || checkMsg == ''){
+    if (checkState == 4) {
+        $("#field").css("display", "none");
+        if (checkMsg == null || checkMsg == '') {
             $("#checkMsg").val("机构信息变更审核通过。");
         }
-    }else{
+    }
+    if (checkState == 3) {
         $("#checkMsg").val("");
+        $("#field").css("display", "block");
     }
 }

+ 15 - 5
public/static/modular/gate/enterprise/enterprise_change_edit.js

@@ -176,6 +176,7 @@ EpChangeEdit.initFileTable = function () {
                 if (data == null || data.length == 0) {
                     return;
                 }
+                var files = $("#files").val().split(",");
                 var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
                 for (var key in data) {
                     var sn = data[key].url.lastIndexOf(".");
@@ -193,7 +194,7 @@ EpChangeEdit.initFileTable = function () {
                     html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
                             '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
                             '<li style="width: 10%;">' + imgStr + '</li>\n' +
-                            '<li style="width: 10%;padding-top: 2px;">' + btn + '</li>';
+                            '<li style="width: 10%;padding-top: 2px;">' + (files.indexOf(data[key].typeId.toString()) > -1 ? btn : "") + '</li>';
                 }
                 html = html + '</ul>';
                 $detail.html(html);
@@ -244,10 +245,14 @@ EpChangeEdit.initFileTypeColumn = function () {
         },
         {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "10%",
             formatter: function (value, row, index) {
-                return "<button type='button' onclick=\"EpChangeEdit.checkFile('" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
-                        "<i class=\"fa fa-upload\"></i>上传" +
-                        "</button>";
-
+                var files = $("#files").val().split(",");
+                if (files.indexOf(value.toString()) != -1) {
+                    return "<button type='button' onclick=\"EpChangeEdit.checkFile('" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
+                            "<i class=\"fa fa-upload\"></i>上传" +
+                            "</button>";
+                } else {
+                    return "";
+                }
             }
         }
     ]
@@ -444,4 +449,9 @@ $(function () {
     } else {
         $("#fileLi").attr("style", "pointer-events: none");
     }
+    $("#baseForm :input").prop("disabled", true);
+    var fields = $("#fields").val().split(",");
+    for (var i in fields) {
+        $("#" + fields[i]).removeAttr("disabled");
+    }
 });

+ 144 - 132
public/static/modular/gate/enterprise/enterprise_change_edit1.js

@@ -1,8 +1,8 @@
 var locked = false;
 var EpChangeEdit = {
-    epChangeEditData : {},
+    epChangeEditData: {},
     validateFields: {
-        newName: {validators: {notEmpty: {message: '单位名称不能为空' },regexp:{regexp:/^[\u4e00-\u9fa5]{1,100}$/,message:"单位名称只允许中文"}}},
+        newName: {validators: {notEmpty: {message: '单位名称不能为空'}, regexp: {regexp: /^[\u4e00-\u9fa5]{1,100}$/, message: "单位名称只允许中文"}}},
         newAddress: {validators: {notEmpty: {message: '单位地址不能为空'}}},
         newStreet: {validators: {notEmpty: {message: '所属街道不能为空'}}},
         newAgentName: {validators: {notEmpty: {message: '人才联络员不能为空'}}},
@@ -22,9 +22,9 @@ var EpChangeEdit = {
                 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:"人才联络员电话格式不正确"
+                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: "人才联络员电话格式不正确"
                 }
             }
         },
@@ -33,8 +33,8 @@ var EpChangeEdit = {
                 notEmpty: {
                     message: '电子邮箱不能为空'
                 },
-                emailAddress:{
-                    message:"电子邮箱格式不正确"
+                emailAddress: {
+                    message: "电子邮箱格式不正确"
                 }
             }
         }
@@ -44,7 +44,7 @@ var EpChangeEdit = {
 /**
  * 清除数据
  */
-EpChangeEdit.clearData = function() {
+EpChangeEdit.clearData = function () {
     this.epChangeEditData = {};
 }
 
@@ -54,7 +54,7 @@ EpChangeEdit.clearData = function() {
  * @param key 数据的名称
  * @param val 数据的具体值
  */
-EpChangeEdit.set = function(key, val) {
+EpChangeEdit.set = function (key, val) {
     this.epChangeEditData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
     return this;
 }
@@ -65,41 +65,41 @@ EpChangeEdit.set = function(key, val) {
  * @param key 数据的名称
  * @param val 数据的具体值
  */
-EpChangeEdit.get = function(key) {
+EpChangeEdit.get = function (key) {
     return $("#" + key).val();
 }
 
 /**
  * 关闭此对话框
  */
-EpChangeEdit.close = function() {
+EpChangeEdit.close = function () {
     parent.layer.close(window.parent.EnterpriseCenter.layerIndex);
 }
 
 /**
  * 收集数据
  */
-EpChangeEdit.collectData = function() {
+EpChangeEdit.collectData = function () {
     this
-        .set('id')
-        .set('type')
-        .set('newName')
-        .set('newIdCard')
-        .set('newEnterpriseTag')
-        .set('newEnterpriseType')
-        .set('newLegal')
-        .set('newStreet')
-        .set('newAddress')
-        .set('newEphone')
-        .set('newAgentName')
-        .set('newAgentPhone')
-        .set('newAgentEmail')
-        .set('newIndustryFieldNew')
-        .set('newIndustryFieldOld')
-        .set('newBankCard')
-        .set('newBank')
-        .set('newBankNetwork')
-        .set('enterprise_id');
+            .set('id')
+            .set('type')
+            .set('newName')
+            .set('newIdCard')
+            .set('newEnterpriseTag')
+            .set('newEnterpriseType')
+            .set('newLegal')
+            .set('newStreet')
+            .set('newAddress')
+            .set('newEphone')
+            .set('newAgentName')
+            .set('newAgentPhone')
+            .set('newAgentEmail')
+            .set('newIndustryFieldNew')
+            .set('newIndustryFieldOld')
+            .set('newBankCard')
+            .set('newBank')
+            .set('newBankNetwork')
+            .set('enterprise_id');
 }
 
 /**
@@ -112,29 +112,29 @@ EpChangeEdit.validate = function () {
 }
 
 
-EpChangeEdit.initFileTable = function(){
+EpChangeEdit.initFileTable = function () {
     $("#fileTable").bootstrapTable({
         url: Feng.ctxPath + "/common/api/listCurrencyFileType",
         method: 'POST',
         contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-        search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
-        showRefresh: false,				// 是否显示刷新按钮
-        clickToSelect: true,			// 是否启用点击选中行
-        singleSelect: true,				// 设置True 将禁止多选
-        striped: true,  				// 是否显示行间隔色
+        search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false, // 是否显示刷新按钮
+        clickToSelect: true, // 是否启用点击选中行
+        singleSelect: true, // 设置True 将禁止多选
+        striped: true, // 是否显示行间隔色
         escape: true,
-        pagination: false,   			// 设置为 true 会在表格底部显示分页条
+        pagination: false, // 设置为 true 会在表格底部显示分页条
         paginationHAlign: "left",
         paginationDetailHAlign: "right",
-        sidePagination: "server",   	// 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
         showColumns: false,
-        detailView: true,               //是否显示父子表
+        detailView: true, //是否显示父子表
         pageList: [10, 30, 50],
         queryParams: function (params) {
-            return $.extend({"type":"governmentChange"},params)
+            return $.extend({"type": "governmentChange"}, params)
         },
         rowStyle: function (row, index) {
-            return {classes:"info"};
+            return {classes: "info"};
         },
         columns: EpChangeEdit.initFileTypeColumn(),
         onPostBody: function () {
@@ -148,33 +148,34 @@ EpChangeEdit.initFileTable = function(){
         },
         onExpandRow: function (index, row, $detail) {
             var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentCommonFile", function (data) {
-                if(data==null||data.length==0){
+                if (data == null || data.length == 0) {
                     return;
                 }
+                var files = $("#files").val().split(",");
                 var html = '<ul class="imgs"><li style="width: 80%;font-weight: bold;padding-top: 5px;">附件原名</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">预览</li><li style="width: 10%;font-weight: bold;padding-top: 5px;">操作</li>';
-                for(var key in data){
+                for (var key in data) {
                     var sn = data[key].url.lastIndexOf(".");
-                    var suffix = data[key].url.substring(sn+1,data[key].url.length);
+                    var suffix = data[key].ext;//data[key].url.substring(sn+1,data[key].url.length);
                     var imgStr = "";
-                    if(suffix=="pdf"||suffix=="PDF"){
-                        imgStr = "<button type='button'  onclick=\"Feng.showPdf('"+data[key].url+"','"+data[key].id+"','"+data[key].orignName+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
-                    }else if(suffix == "xlsx" || suffix=="XLSX" || suffix == 'xls' || suffix == 'XLS'){
-                        imgStr = "<button type='button'  onclick=\"Feng.showExcel('"+data[key].url+"','"+data[key].id+"','"+data[key].orignName+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
-                    }else{
-                        imgStr = '<img class=\"imgUrl\"  src=\"'+data[key].url+'\" style=\"width:25px;height:25px;\">';
+                    if (suffix == "pdf" || suffix == "PDF") {
+                        imgStr = "<button type='button'  onclick=\"Feng.showPdf('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
+                    } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS' || suffix == "DOCX" || suffix == "docx" || suffix == 'DOC' || suffix == 'doc') {
+                        imgStr = "<button type='button'  onclick=\"Feng.showExcel('" + data[key].url + "','" + data[key].id + "','" + data[key].orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                    } else {
+                        imgStr = '<img class=\"imgUrl\"  src=\"' + data[key].url + '\" style=\"width:25px;height:25px;\">';
                     }
-                    var btn = "<button type=\'button\' onclick=\"EpChangeEdit.checkFile('"+row.id+"','"+data[key].id+"')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\"><i class=\"fa fa-paste\"></i>修改</button>" +
-                        "<button type='button' onclick=\"EpChangeEdit.deleteFile('"+data[key].id+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-times\"></i>删除</button>";
-                    html = html + '<li style="display: none">'+data[key].id+'</li>\n'+
-                        '<li style="width: 80%;padding-top: 5px;">'+data[key].orignName+'</li>\n'+
-                        '<li style="width: 10%;">'+imgStr+'</li>\n'+
-                        '<li style="width: 10%;padding-top: 2px;">'+btn+'</li>';
+                    var btn = "<button type=\'button\' onclick=\"EpChangeEdit.checkFile('" + row.id + "','" + data[key].id + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\"><i class=\"fa fa-paste\"></i>修改</button>" +
+                            "<button type='button' onclick=\"EpChangeEdit.deleteFile('" + data[key].id + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-times\"></i>删除</button>";
+                    html = html + '<li style="display: none">' + data[key].id + '</li>\n' +
+                            '<li style="width: 80%;padding-top: 5px;">' + data[key].orignName + '</li>\n' +
+                            '<li style="width: 10%;">' + imgStr + '</li>\n' +
+                            '<li style="width: 10%;padding-top: 2px;">' + (files.indexOf(data[key].typeId.toString()) > -1 ? btn : "") + '</li>';
                 }
                 html = html + '</ul>';
                 $detail.html(html);
                 $(".imgs").viewer({
                     // toolbar:false,
-                    fullscreen:false
+                    fullscreen: false
                 });
             }, function (data) {
                 Feng.error("查询失败!" + data.responseJSON.message + "!");
@@ -189,83 +190,88 @@ EpChangeEdit.initFileTable = function(){
 }
 
 
-EpChangeEdit.initFileTypeColumn =  function(){
+EpChangeEdit.initFileTypeColumn = function () {
     return [
-        {field: 'selectItem', checkbox:false,visible:false},
-        {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:"30%",'class': 'uitd_showTip',
-            formatter : function(value,row,index){
-                if(row.must==1){
-                    return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> '+ value;
-                }if(row.must==2){
-                    return '<i class="fa fa-paste"></i>'+value;
+        {field: 'selectItem', checkbox: false, visible: false},
+        {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%", 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                if (row.must == 1) {
+                    return '<i class="fa fa-paste"></i><span style="font-weight:bold;color:red;font-size:14px;font-family:宋体"> * </span> ' + value;
+                }
+                if (row.must == 2) {
+                    return '<i class="fa fa-paste"></i>' + value;
                 }
             }
         },
-        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"52%",'class': 'uitd_showTip',
-            formatter : function(value,row,index){
-                return '<span style="color: red">'+value+'</span>';
+        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "52%", 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                return '<span style="color: red">' + value + '</span>';
             }
         },
-        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"10%",
-            formatter : function(value,row,index){
-                return "<button type='button' onclick=\"EpChangeEdit.checkFile('"+value+"','"+null+"')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
-                    "<i class=\"fa fa-upload\"></i>上传" +
-                    "</button>" ;
-
+        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "10%",
+            formatter: function (value, row, index) {
+                var files = $("#files").val().split(",");
+                if (files.indexOf(value.toString()) != -1) {
+                    return "<button type='button' onclick=\"EpChangeEdit.checkFile('" + value + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
+                            "<i class=\"fa fa-upload\"></i>上传" +
+                            "</button>";
+                } else {
+                    return "";
+                }
             }
         }
     ]
 }
 
 //选择附件并显示附件名
-EpChangeEdit.checkFile = function (fileTypeId,fileId){
+EpChangeEdit.checkFile = function (fileTypeId, fileId) {
     var checkState = $("#checkState").val();
-    if(checkState==2){
+    if (checkState == 2) {
         Feng.error("正在审核中,无法修改");
-        return ;
+        return;
     }
-    if(checkState==4){
+    if (checkState == 4) {
         Feng.error("审核通过,无法修改");
-        return ;
+        return;
     }
     $("#upload_file ").unbind("change");
     $("#upload_file ").change(function () {
-        EpChangeEdit.upload(fileTypeId,fileId);
+        EpChangeEdit.upload(fileTypeId, fileId);
     });
     $('#upload_file').val("");
     $('#upload_file').click()
 }
 //上传附件
-EpChangeEdit.upload = function (fileTypeId,fileId){
-    if(fileId!=null&&fileId!='null'){
+EpChangeEdit.upload = function (fileTypeId, fileId) {
+    if (fileId != null && fileId != 'null') {
         $("#fileId").val(fileId)
-    }else{
+    } else {
         $("#fileId").val("");
     }
 
     $("#mainId").val($("#id").val());
     $("#typeId").val(fileTypeId);
-    var index = layer.load(0, {shade: false,time:0});
+    var index = layer.load(0, {shade: false, time: 0});
     $("#index").val(index);
     $("#uploadForm").submit();
 }
 //删除附件
-EpChangeEdit.deleteFile = function (id){
+EpChangeEdit.deleteFile = function (id) {
     var checkState = $("#checkState").val();
-    if(checkState==2){
+    if (checkState == 2) {
         Feng.error("正在审核中,无法修改");
-        return ;
+        return;
     }
-    if(checkState==4){
+    if (checkState == 4) {
         Feng.error("审核通过,无法删除");
-        return ;
+        return;
     }
-    var operation = function() {
+    var operation = function () {
         var ajax = new $ax(Feng.ctxPath + "/api/talentCommonFile/deleteTalentCommonFile", function (data) {
-            if(data.code=200){
+            if (data.code = 200) {
                 Feng.success(data.msg);
                 $("#fileTable").bootstrapTable("refresh", {});
-            }else{
+            } else {
                 Feng.error(data.msg);
             }
         }, function (data) {
@@ -278,37 +284,38 @@ EpChangeEdit.deleteFile = function (id){
 }
 
 
-EpChangeEdit.addSubmit = function() {
+EpChangeEdit.addSubmit = function () {
     this.clearData();
     this.collectData();
-    if(!this.validate()){
+    if (!this.validate()) {
         return;
     }
     var checkState = $("#checkState").val();
-    if(checkState == 2 || checkState == 5){
+    if (checkState == 2 || checkState == 5) {
         Feng.info("正在审核中,无法修改")
-        return ;
+        return;
     }
-    if(checkState == 4 ){
+    if (checkState == 4) {
         Feng.info("已审核通过,无法修改")
-        return ;
+        return;
     }
     // $(".layui-layer-btn0",parent.document).css("pointer-events","none");
-    if(locked)return;
+    if (locked)
+        return;
     locked = true;
-    var ajax = new $ax(Feng.ctxPath + "/enterprise/api/upsert", function(data){
-        if(data.code=="200"){
+    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{
+        } else {
             Feng.info(data.msg);
         }
         //$(".layui-layer-btn0",parent.document).css("pointer-events","block");
         locked = false;
-    },function(data){
+    }, function (data) {
         Feng.error("添加失败!" + data.responseJSON.msg + "!");
         locked = false;
     });
@@ -320,30 +327,30 @@ EpChangeEdit.addSubmit = function() {
 /**
  * 提交审核
  */
-EpChangeEdit.submitToCheck = function(){
+EpChangeEdit.submitToCheck = function () {
     var id = $("#id").val();
-    if(id==null || id==""){
+    if (id == null || id == "") {
         Feng.info("请先填写基础信息并上传附件");
-        return ;
+        return;
     }
     var checkState = $("#checkState").val();
-    if(checkState==2 || checkState == 5){
+    if (checkState == 2 || checkState == 5) {
         Feng.error("正在审核中,无法修改");
-        return ;
+        return;
     }
-    if(checkState==4){
+    if (checkState == 4) {
         Feng.error("审核通过,无法修改");
-        return ;
+        return;
     }
     //$(".layui-layer-btn1",parent.document).css("pointer-events","none");
-    var operation = function() {
+    var operation = function () {
         var ajax = new $ax(Feng.ctxPath + "/enterprise/api/submitToCheck", function (data) {
             //$(".layui-layer-btn1",parent.document).css("pointer-events","block");
-            if(data.code==200){
+            if (data.code == 200) {
                 Feng.success(data.msg);
                 window.parent.EnterpriseCenter.table.refresh();
                 EpChangeEdit.close();
-            }else{
+            } else {
                 Feng.error(data.msg);
             }
 
@@ -359,7 +366,7 @@ EpChangeEdit.submitToCheck = function(){
 }
 
 
-EpChangeEdit.callBack = function(data) {
+EpChangeEdit.callBack = function (data) {
     layer.close(data.obj);
     Feng.info(data.msg);
     if (data.code == 200) {
@@ -368,43 +375,48 @@ EpChangeEdit.callBack = function(data) {
 };
 
 
-EpChangeEdit.downloadFile = function(id) {
-    window.location.href = Feng.ctxPath + '/enterprisechangeRecord/downloadFile?id='+id;
+EpChangeEdit.downloadFile = function (id) {
+    window.location.href = Feng.ctxPath + '/enterprisechangeRecord/downloadFile?id=' + id;
 };
 
-EpChangeEdit.industryChange = function(){
+EpChangeEdit.industryChange = function () {
     var industryNew = $("#newIndustryFieldNew").val();
-    var arr = [{"name":"newIndustryFieldOld","code":industryNew+"_field"}];
+    var arr = [{"name": "newIndustryFieldOld", "code": industryNew + "_field"}];
     Feng.findChildDictBatch(JSON.stringify(arr));
 }
 
-$(function() {
+$(function () {
     Feng.initValidator("ecr_form", EpChangeEdit.validateFields);
     var industryNew = $("#newIndustryFieldNew").attr("value");
     var arr = [
-        {"name":"newStreet","code":"street"},
-        {"name":"newEnterpriseTag","code":"enterprise_tag"},
-        {"name":"newEnterpriseType","code":"enterprise_type"},
-        {"name":"newIndustryFieldNew","code":"industry_field"},
-        {"name":"newIndustryFieldOld","code":industryNew+"_field"}];
+        {"name": "newStreet", "code": "street"},
+        {"name": "newEnterpriseTag", "code": "enterprise_tag"},
+        {"name": "newEnterpriseType", "code": "enterprise_type"},
+        {"name": "newIndustryFieldNew", "code": "industry_field"},
+        {"name": "newIndustryFieldOld", "code": industryNew + "_field"}];
     Feng.findChildDictBatch(JSON.stringify(arr));
     $("select").each(function () {
         $(this).val($(this).attr("value"));
     })
-    if($("#type").val()==1){
-        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style","display:block");
+    if ($("#type").val() == 1) {
+        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:block");
         $("#newEnterpriseTag").val($("#newEnterpriseTag").attr("value"));
         $("#newIndustryFieldNew").val($("#newIndustryFieldNew").attr("value"));
         $("#newIndustryFieldOld").val($("#newIndustryFieldOld").attr("value"));
-    }else{
-        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style","display:none");
+    } else {
+        $("#newEnterpriseTag,#newIndustryFieldNew,#newIndustryFieldOld,#newEnterpriseType").parent().parent().attr("style", "display:none");
         $("#newEnterpriseTag").val("");
         $("#newIndustryFieldNew").val("");
     }
     var id = $("#id").val();
-    if(id!=null && id!=''){
+    if (id != null && id != '') {
         $("#fileLi").removeAttr("style");
-    }else{
-        $("#fileLi").attr("style","pointer-events: none");
+    } else {
+        $("#fileLi").attr("style", "pointer-events: none");
+    }
+    $("#baseForm :input").prop("disabled", true);
+    var fields = $("#fields").val().split(",");
+    for (var i in fields) {
+        $("#" + fields[i]).removeAttr("disabled");
     }
 });