Browse Source

卫健高教++

sugangqiang 1 year ago
parent
commit
116591237a

+ 1 - 1
app/admin/validate/User.php

@@ -20,7 +20,7 @@ class User extends Validate {
     protected $rule = [
         'account' => 'require|max:50|checkUnique:sys_user',
         'name' => 'require|max:50|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u',
-        'type' => 'require|checkInSelect:type,1,2,3,4',
+        'type' => 'require|checkInSelect:type,1,2,3,4,5,6',
         'password' => 'require|min:8|regex:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$/',
         're_password' => 'require|confirm:password',
         'phone' => 'require|mobile',

+ 2 - 0
app/admin/view/user/add.html

@@ -32,6 +32,8 @@
                                 <option value="">请选择</option>
                                 <option value="1">晋江市现代产业体系人才</option>
                                 <option value="2">集成电路优秀人才</option>
+                                <option value="5">卫健医院</option>
+                                <option value="6">高教学校</option>
                                 <option value="3">海峡计划申报</option>
                                 <option value="4">super</option>
                             </select>

+ 2 - 0
app/admin/view/user/edit.html

@@ -32,6 +32,8 @@
                                 <option value="">请选择</option>
                                 <option value="1">晋江市现代产业体系人才</option>
                                 <option value="2">集成电路优秀人才</option>
+                                <option value="5">卫健医院</option>
+                                <option value="6">高教学校</option>
                                 <option value="3">海峡计划申报</option>
                                 <option value="4">super</option>
                             </select>

+ 8 - 5
app/common/controller/Auth.php

@@ -348,7 +348,8 @@ class Auth extends BaseController {
                 return \StrUtil::back($response_object, "Register.epCallBack");
             }
         }
-        return view("", ["msg" => $msg]);
+        $medicalCommunities = Db::table("nhc_medical_community")->where("status", 1)->order("num asc,createTime asc")->select()->toArray();
+        return view("", ["msg" => $msg, "medicalCommunities" => $medicalCommunities]);
     }
 
     public function enterprise_edit() {
@@ -452,7 +453,7 @@ class Auth extends BaseController {
                 $data['id'] = $ep->id;
                 if ($ep->special == 0) {
                     $idCardName = "营业执照";
-                    if ($data["type"] == 1) {
+                    if ($data["type"] == CommonConst::ENTERPRISE_NORMAL) {
                         if ($data["agencyType"] == 1) {
                             validate(\app\common\validate\Enterprise::class)->batch(true)->scene('change')->check($data);
                             if (!$data["domainImg"] && !$ep->domainImg) {
@@ -474,17 +475,19 @@ class Auth extends BaseController {
                             $response_object->msg = '开户许可证/基本存款账户信息不能为空';
                             return \StrUtil::back($response_object, "Register.epCallBack");
                         }
-                    } else if ($data["type"] == 2) {
+                    } else if ($data["type"] == CommonConst::ENTERPRISE_JC) {
                         //集成电路
                         validate(\app\common\validate\Enterprise::class)->batch(true)->scene('jc_change')->check($data);
-                    } else if ($data["type"] == 3) {
+                    } else if ($data["type"] == CommonConst::ENTERPRISE_WJ) {
                         //卫健医院
                         validate(\app\common\validate\Hospital::class)->batch(true)->scene('change')->check($data);
                         $idCardName = "医疗机构执业许可证";
-                    } else {
+                    } else if ($data["type"] == CommonConst::ENTERPRISE_GJ) {
                         //高教学校
                         validate(\app\common\validate\School::class)->batch(true)->scene('change')->check($data);
                         $idCardName = "办学许可证、法人证书或登记证书";
+                    } else {
+                        throw new ValidateException("未知注册类型");
                     }
                     if (!$data["imgurl"] && !$ep->imgurl) {
                         $response_object->code = 500;

+ 2 - 2
app/common/state/CommonConst.php

@@ -26,8 +26,8 @@ class CommonConst {
     const JYJ = "jyj";         //教育局
     const ENTERPRISE_NORMAL = 1; //通常企业
     const ENTERPRISE_JC = 2; //电路企业
-    const ENTERPRISE_WJ = 3; //卫健医院
-    const ENTERPRISE_GJ = 4; //高教学校
+    const ENTERPRISE_WJ = 5; //卫健医院
+    const ENTERPRISE_GJ = 6; //高教学校
 
     /**
      * 晋江市优秀人才津补贴审核单位 

+ 13 - 11
app/common/view/auth/register.html

@@ -517,7 +517,9 @@
                                                                 <div class="rowGroup">
                                                                     <label class=" control-label spacing td-label"><span style="color: red">*</span>医共体</label>
                                                                     <select class="form-control" id="wj_medicalCommunityId" name="medicalCommunityId">
-
+                                                                        {volist name="medicalCommunities" id="mc"}
+                                                                        <option value="{$mc.id}">{$mc.name}</option>
+                                                                        {/volist}
                                                                     </select>
                                                                 </div>
                                                             </td>
@@ -538,18 +540,18 @@
                                                                     <label class=" control-label spacing td-label"><span style="color: red">*</span>地址</label>                                                                    
                                                                     <div class="col-sm-12">
                                                                         <div class="col-sm-2">
-                                                                            <select class="form-control" id="wj_province" name="province">
-                                                                                <option value="">请选择省</option>
+                                                                            <select class="form-control" id="wj_province" name="province" onchange="Register.afterSelectProvince('wj');">
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-2">
-                                                                            <select class="form-control" id="wj_city" name="city">
-                                                                                <option value="">请选择市</option>
+                                                                            <select class="form-control" id="wj_city" name="city" onchange="Register.afterSelectCity('wj');">
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-2">
                                                                             <select class="form-control" id="wj_county" name="county">
-                                                                                <option value="">请选择县/区</option>
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-6">
@@ -618,18 +620,18 @@
                                                                     <label class=" control-label spacing td-label"><span style="color: red">*</span>地址</label>                                                                    
                                                                     <div class="col-sm-12">
                                                                         <div class="col-sm-2">
-                                                                            <select class="form-control" id="gj_province" name="province">
-                                                                                <option value="">请选择省</option>
+                                                                            <select class="form-control" id="gj_province" name="province" onchange="Register.afterSelectProvince('gj');">
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-2">
-                                                                            <select class="form-control" id="gj_city" name="city">
-                                                                                <option value="">请选择市</option>
+                                                                            <select class="form-control" id="gj_city" name="city" onchange="Register.afterSelectCity('gj');">
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-2">
                                                                             <select class="form-control" id="gj_county" name="county">
-                                                                                <option value="">请选择县/区</option>
+                                                                                <option value="">---请选择---</option>
                                                                             </select>
                                                                         </div>
                                                                         <div class="col-sm-6">

+ 46 - 1
public/static/js/register.js

@@ -862,6 +862,40 @@ Register.industryChange = function () {
     Feng.findChildDictBatch(JSON.stringify(arr));
 }
 
+
+Register.afterSelectProvince = function (prefix) {
+    var province = $("#" + prefix + "_province").val();
+    $("#" + prefix + "_city").empty();
+    $("#" + prefix + "_county").empty();
+    if (province == null || province == '') {
+        return;
+    }
+    Feng.addAjaxSelect({
+        "id": prefix + "_city",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/tool/findCityByProvinceSelect/code/" + province
+    });
+}
+/**
+ * 加载县
+ */
+Register.afterSelectCity = function (prefix) {
+    var city = $("#" + prefix + "_city").val();
+    $("#" + prefix + "_county").empty();
+    if (city == null || city == '') {
+        return;
+    }
+    Feng.addAjaxSelect({
+        "id": prefix + "_county",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/tool/findCountyByCitySelect/code/" + city
+    });
+}
+
 $(function () {
     $('#ep_form').bootstrapValidator({
         feedbackIcons: {
@@ -913,7 +947,7 @@ $(function () {
         {"name": "mf_street", "code": "street"},
         {"name": "agencyType", "code": "agency_type"}];
     Feng.findChildDictBatch(JSON.stringify(arr));
-    $("#imgurl,#sy_imgurl,#mf_imgurl,#bankImg,#mf_bankImg,#sy_bankImg,#beian,#domainImg,#typeImg").change(function (e) {
+    $("#imgurl,#sy_imgurl,#mf_imgurl,#wj_imgurl,#gj_imgurl,#bankImg,#mf_bankImg,#sy_bankImg,#beian,#domainImg,#typeImg").change(function (e) {
         var that = this;
         if (!Feng.chkFileInvalid(that.files[0], 5, 10)) {
             return;
@@ -931,4 +965,15 @@ $(function () {
             }
         };
     });
+
+    //加载省份
+    Feng.addAjaxSelect({
+        "id": "wj_province",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": Feng.ctxPath + "/common/tool/getProvinceSelect"
+    });
+    var provinceList = $("#wj_province option").clone();
+    $("#gj_province").html(provinceList);
 });

+ 8 - 8
public/static/modular/gate/enterprise/enterprise_edit.js

@@ -14,11 +14,11 @@ Register.enterpriseUserRegister = function () {
     var idCardName = "统一社会信用代码";
     switch (special) {
         case 0:
-            if (type == 3) {
+            if (type == 5) {
                 enterpriseTypeName = "医院";
                 idCardName = "登记号";
             }
-            if (type == 4) {
+            if (type == 6) {
                 enterpriseTypeName = "学校";
             }
             break;
@@ -61,7 +61,7 @@ Register.enterpriseUserRegister = function () {
         Feng.info(enterpriseTypeName + "名称最多100个字符!");
         return;
     }
-    if ((idCard == null || idCard == '') && special != "1" && type != 4) {
+    if ((idCard == null || idCard == '') && special != "1" && type != 6) {
         Feng.info("请填写" + idCardName + "!");
         return;
     }
@@ -77,11 +77,11 @@ Register.enterpriseUserRegister = function () {
         Feng.info("请填写" + enterpriseTypeName + "电话");
         return;
     }
-    if ((medicalCommunityId == null || medicalCommunityId == '') && type == 3) {
+    if ((medicalCommunityId == null || medicalCommunityId == '') && type == 5) {
         Feng.info("请选择医共体");
         return;
     }
-    if ((isGeneral == null || isGeneral == '') && type == 3) {
+    if ((isGeneral == null || isGeneral == '') && type == 5) {
         Feng.info("请选择是否总院");
         return;
     }
@@ -89,11 +89,11 @@ Register.enterpriseUserRegister = function () {
         Feng.info("请选择所属街道!");
         return;
     }
-    if ((province == null || province == '') && [3, 4].indexOf(type) > -1) {
+    if ((province == null || province == '') && [5, 6].indexOf(type) > -1) {
         Feng.info("请选择" + enterpriseTypeName + "所在省份!");
         return;
     }
-    if ((city == null || city == '') && [3, 4].indexOf(type) > -1) {
+    if ((city == null || city == '') && [5, 6].indexOf(type) > -1) {
         Feng.info("请选择" + enterpriseTypeName + "所在市!");
         return;
     }
@@ -101,7 +101,7 @@ Register.enterpriseUserRegister = function () {
         Feng.info("请填写" + enterpriseTypeName + "地址!");
         return;
     }
-    if (special != "1" && [2, 3, 4].indexOf(type) == -1) {
+    if (special != "1" && [2, 5, 6].indexOf(type) == -1) {
         if (bankCard == null || bankCard == '') {
             Feng.info("请填写企业银行账号!");
             return;

+ 4 - 0
public/static/modular/system/user/user.js

@@ -32,6 +32,10 @@ MgrUser.initColumn = function () {
                     return "晋江市现代产业体系人才";
                 } else if (value == 2) {
                     return "集成电路优秀人才";
+                } else if (value == 5) {
+                    return "卫健医院";
+                } else if (value == 6) {
+                    return "高教学校";
                 } else if (value == 3) {
                     return "海峡计划申报";
                 } else if (value == 4) {