|
@@ -587,4 +587,103 @@ class EnterpriseChangeRecord extends AdminController {
|
|
|
return json(["msg" => "没有可以导出的内容"]);
|
|
|
}
|
|
|
|
|
|
+ public function findFieldsAndFiles() {
|
|
|
+ $id = trim($this->request['id']);
|
|
|
+ $ecr = EnterpriseApi::getOneRecord($id);
|
|
|
+ $ep = EnterpriseApi::getOne($ecr['mainId']);
|
|
|
+ if (!$ecr || !$ep || !$id) {
|
|
|
+ return json(["msg" => '没有对应的企业变更信息!']);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($ep->special == 0) {
|
|
|
+ if ($ep->type == 1) {
|
|
|
+ $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
|
|
|
+ "AgencyType" => "机构类型", "IndustryFieldNew" => "产业领域", "IndustryFieldOld" => "行业领域", "EnterpriseTag" => "企业标签", "EnterpriseType" => "企业类型",
|
|
|
+ "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
|
|
|
+ $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证/基本存款账户信息", "newDomainImg" => "行业领域佐证材料", "newBeian" => "人才联络员信息备案表", "newTypeImg" => "规上、高新技术、专精特新企业上传材料"];
|
|
|
+ } else {
|
|
|
+ $fields = ["Name" => "企业名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "企业地址", "Street" => "所属街道", "Ephone" => "企业电话", "BankCard" => "企业银行账号", "Bank" => "企业开户银行", "BankNetwork" => "企业开户银行网点",
|
|
|
+ "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
|
|
|
+ $files = ["newImgurl" => "企业营业执照", "newBankImg" => "开户许可证/基本存款账户信息", "newBeian" => "人才联络员备案表"];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $fields = ["Name" => "单位名称", "IdCard" => "统一社会信用代码", "Legal" => "法人代表", "Address" => "单位地址", "Street" => "所属街道", "Ephone" => "单位电话", "BankCard" => "单位银行账号", "Bank" => "单位开户银行", "BankNetwork" => "单位开户银行网点",
|
|
|
+ "AgentName" => "人才联络员姓名", "AgentPhone" => "人才联络员电话", "AgentEmail" => "人才联络员邮箱"];
|
|
|
+ if ($ep->special == 1) {
|
|
|
+ $fields["InstitutionTag"] = "单位标签";
|
|
|
+ }
|
|
|
+ if ($ep->special == 3) {
|
|
|
+ $fields["OrganizationTag"] = "机构标签";
|
|
|
+ }
|
|
|
+ $files = ["newImgurl" => "法人证或批文", "newBankImg" => "开户许可证/基本存款账户信息", "newBeian" => "人才联络员备案表"];
|
|
|
+ }
|
|
|
+ $modify_fields = [];
|
|
|
+ foreach ($fields as $key => $value) {
|
|
|
+ $oldFieldName = "old" . $key;
|
|
|
+ $newFieldName = "new" . $key;
|
|
|
+ //if ($ecr[$oldFieldName] != $ecr[$newFieldName]) {
|
|
|
+ $modify_fields[$newFieldName] = ["field" => $newFieldName, "name" => $value, "checked" => false];
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ if ($ecr["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];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
|
|
|
+ "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
|
|
|
+ $modify_files = [];
|
|
|
+ foreach ($files as $key => $value) {
|
|
|
+ $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => false];
|
|
|
+ }
|
|
|
+ if ($ecr["modify_files"]) {
|
|
|
+ $_modify_files = explode(",", $ecr["modify_files"]);
|
|
|
+ foreach ($_modify_files as $_file) {
|
|
|
+ if ($modify_files[$_file]) {
|
|
|
+ $modify_files[$_file]["checked"] = true;
|
|
|
+ } else {
|
|
|
+ if (strtotime($ecr["createTime"]) < strtotime($this->compatible_time)) {
|
|
|
+ //兼容旧的typeid
|
|
|
+ $_file = $oldtypes[$_file];
|
|
|
+ }
|
|
|
+ $modify_files[$_file] = ["field" => $_file, "name" => $files[$_file], "checked" => true];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json(["code" => 200, "files" => $modify_files, "fields" => $modify_fields]);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function updateFieldsAndFiles() {
|
|
|
+ try {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $id = $params["id"];
|
|
|
+ $ecr = EnterpriseApi::getOneRecord($id);
|
|
|
+ if (!$ecr) {
|
|
|
+ throw new \think\Exception("没有对应的企业变更信息");
|
|
|
+ }
|
|
|
+ if ($ecr["checkState"] != 3) {
|
|
|
+ throw new \think\Exception("不是驳回状态,不能修改驳回字段!");
|
|
|
+ }
|
|
|
+ $fields = array_filter(explode(",", $params["fields"]));
|
|
|
+ $files = array_filter(explode(",", $params["files"]));
|
|
|
+ if (!$fields || !$files)
|
|
|
+ throw new \think\Exception("请选择要驳回的字段或附件!");
|
|
|
+ $data["id"] = $id;
|
|
|
+ $data["modify_fields"] = $fields ? implode(",", $fields) : null;
|
|
|
+ $data["modify_files"] = $files ? implode(",", $files) : null;
|
|
|
+ $data["updateTime"] = date("Y-m-d H:i:s");
|
|
|
+ $data["updateUser"] = session("user")["uid"];
|
|
|
+ if (EnterpriseApi::updateById($data)) {
|
|
|
+ return json(["code" => 200, "msg" => "修改成功!"]);
|
|
|
+ }
|
|
|
+ } catch (\think\Exception $e) {
|
|
|
+ return json(["msg" => $e->getMessage()]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|