Эх сурвалжийг харах

高教津补贴中增加“岗位类型”、“所属编制”

sugangqiang 11 сар өмнө
parent
commit
4115d724d9

+ 48 - 3
app/admin/controller/TalentAllowance.php

@@ -109,7 +109,22 @@ class TalentAllowance extends AdminController {
         $process = $this->request["process"];
         $obj = TalentAllowanceApi::getInfoById($id);
         $this->translateToChinese($obj);
-        return view("info", ["row" => $obj, "process" => $process]);
+        if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
+            $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
+            $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
+            if ($need_choose_post_type[$obj["enterpriseId"]]) {
+                $postTypes = DictApi::findChildDictByCode("PostType");
+                foreach ($postTypes as $key => $pt) {
+                    if (!in_array($pt["code"], $need_choose_post_type[$obj["enterpriseId"]])) {
+                        unset($postTypes[$key]);
+                    }
+                }
+            }
+            if (in_array($obj["enterpriseId"], $need_choose_institution)) {
+                $institutions = DictApi::findChildDictByCode("Institution");
+            }
+        }
+        return view("info", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
     /**
@@ -121,7 +136,22 @@ class TalentAllowance extends AdminController {
         $process = $this->request["process"];
         $obj = TalentAllowanceApi::getInfoById($id);
         $this->translateToChinese($obj);
-        return view("select", ["row" => $obj, "process" => $process]);
+        if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
+            $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
+            $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
+            if ($need_choose_post_type[$obj["enterpriseId"]]) {
+                $postTypes = DictApi::findChildDictByCode("PostType");
+                foreach ($postTypes as $key => $pt) {
+                    if (!in_array($pt["code"], $need_choose_post_type[$obj["enterpriseId"]])) {
+                        unset($postTypes[$key]);
+                    }
+                }
+            }
+            if (in_array($obj["enterpriseId"], $need_choose_institution)) {
+                $institutions = DictApi::findChildDictByCode("Institution");
+            }
+        }
+        return view("select", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
     /**
@@ -626,7 +656,22 @@ class TalentAllowance extends AdminController {
         $process = $this->request["process"];
         $obj = TalentAllowanceApi::getInfoById($id);
         $this->translateToChinese($obj);
-        return view("public_check", ["row" => $obj, "process" => $process]);
+        if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
+            $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
+            $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
+            if ($need_choose_post_type[$obj["enterpriseId"]]) {
+                $postTypes = DictApi::findChildDictByCode("PostType");
+                foreach ($postTypes as $key => $pt) {
+                    if (!in_array($pt["code"], $need_choose_post_type[$obj["enterpriseId"]])) {
+                        unset($postTypes[$key]);
+                    }
+                }
+            }
+            if (in_array($obj["enterpriseId"], $need_choose_institution)) {
+                $institutions = DictApi::findChildDictByCode("Institution");
+            }
+        }
+        return view("public_check", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
     /**

+ 26 - 0
app/admin/view/talent_allowance/info.html

@@ -93,6 +93,32 @@
                                                         </select>
                                                     </div>
                                                 </div>
+                                                {if condition="in_array($row['type'],[6]) && $postTypes"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>岗位类型</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="postType" name="postType" value="{$row.postType}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="postTypes" id="pt"}
+                                                            <option value="{$pt.code}">{$pt.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
+                                                {if condition="in_array($row['type'],[6]) && $institutions"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>所属编制</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="institution" name="institution" value="{$row.institution}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="institutions" id="in"}
+                                                            <option value="{$in.code}">{$in.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
                                                 {if condition="!in_array($row['type'],[5])"}
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>

+ 26 - 0
app/admin/view/talent_allowance/public_check.html

@@ -103,6 +103,32 @@
                                                         </select>
                                                     </div>
                                                 </div>
+                                                {if condition="in_array($row['type'],[6]) && $postTypes"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>岗位类型</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="postType" name="postType" value="{$row.postType}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="postTypes" id="pt"}
+                                                            <option value="{$pt.code}">{$pt.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
+                                                {if condition="in_array($row['type'],[6]) && $institutions"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>所属编制</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="institution" name="institution" value="{$row.institution}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="institutions" id="in"}
+                                                            <option value="{$in.code}">{$in.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
                                                 <div class="rowGroup">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>申报来源</label>
                                                     <div class="col-sm-2 spacing">

+ 26 - 0
app/admin/view/talent_allowance/select.html

@@ -91,6 +91,32 @@
                                                         </select>
                                                     </div>
                                                 </div>
+                                                {if condition="in_array($row['type'],[6]) && $postTypes"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>岗位类型</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="postType" name="postType" value="{$row.postType}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="postTypes" id="pt"}
+                                                            <option value="{$pt.code}">{$pt.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
+                                                {if condition="in_array($row['type'],[6]) && $institutions"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>所属编制</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="institution" name="institution" value="{$row.institution}" disabled="disabled">
+                                                            <option value="">请选择</option>
+                                                            {volist name="institutions" id="in"}
+                                                            <option value="{$in.code}">{$in.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
                                                 {if condition="!in_array($row['type'],[5])"}
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>

+ 35 - 3
app/enterprise/controller/TalentAllowance.php

@@ -69,7 +69,22 @@ class TalentAllowance extends EnterpriseController {
             return $this->save($info, $request);
         }
         $batch = $info["year"] ?: BatchApi::getValidBatch(ProjectState::JBT, $this->user["type"])["batch"];
-        return view("", ["year" => $batch, "type" => $this->user["type"], "row" => $info]);
+        if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
+            $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
+            $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
+            if ($need_choose_post_type[$this->user["uid"]]) {
+                $postTypes = DictApi::findChildDictByCode("PostType");
+                foreach ($postTypes as $key => $pt) {
+                    if (!in_array($pt["code"], $need_choose_post_type[$this->user["uid"]])) {
+                        unset($postTypes[$key]);
+                    }
+                }
+            }
+            if (in_array($this->user["uid"], $need_choose_institution)) {
+                $institutions = DictApi::findChildDictByCode("institution");
+            }
+        }
+        return view("", ["year" => $batch, "type" => $this->user["type"], "row" => $info, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
     /**
@@ -263,7 +278,9 @@ class TalentAllowance extends EnterpriseController {
                 "createUser" => $user["uid"],
                 "id" => getStringId(),
                 "wage" => $param["wage"],
-                "allowanceType" => $param["allowanceType"]
+                "allowanceType" => $param["allowanceType"],
+                "postType" => $param["postType"] ?: 0,
+                "institution" => $param["institution"] ?: 0
             ];
 
             $submitTime = $ti["first_submit_time"] ? $ti["first_submit_time"] : $ti["new_submit_time"];
@@ -408,7 +425,22 @@ class TalentAllowance extends EnterpriseController {
         $id = $param["id"];
         $info = TalentAllowanceApi::getInfoById($id);
         $this->translateToChinese($info);
-        return view("", ["row" => $info]);
+        if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
+            $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
+            $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
+            if ($need_choose_post_type[$this->user["uid"]]) {
+                $postTypes = DictApi::findChildDictByCode("PostType");
+                foreach ($postTypes as $key => $pt) {
+                    if (!in_array($pt["code"], $need_choose_post_type[$this->user["uid"]])) {
+                        unset($postTypes[$key]);
+                    }
+                }
+            }
+            if (in_array($this->user["uid"], $need_choose_institution)) {
+                $institutions = DictApi::findChildDictByCode("institution");
+            }
+        }
+        return view("", ["row" => $info, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
     private function translateToChinese(&$obj) {

+ 26 - 0
app/enterprise/view/talent_allowance/apply.html

@@ -96,6 +96,32 @@
                                                         </select>
                                                     </div>
                                                 </div>
+                                                {if condition="in_array($type,[6]) && $postTypes"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>岗位类型</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="postType" name="postType" value="{$row.postType}">
+                                                            <option value="">请选择</option>
+                                                            {volist name="postTypes" id="pt"}
+                                                            <option value="{$pt.code}">{$pt.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
+                                                {if condition="in_array($type,[6]) && $institutions"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>所属编制</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" class="form-control" id="institution" name="institution" value="{$row.institution}">
+                                                            <option value="">请选择</option>
+                                                            {volist name="institutions" id="in"}
+                                                            <option value="{$in.code}">{$in.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
                                                 {if condition="!in_array($type,[5])"}
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>

+ 26 - 0
app/enterprise/view/talent_allowance/detail.html

@@ -82,6 +82,32 @@
                                                         </select>
                                                     </div>
                                                 </div>
+                                                {if condition="in_array($row['type'],[6]) && $postTypes"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>岗位类型</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" disabled="disabled" class="form-control" id="postType" name="postType" value="{$row.postType}">
+                                                            <option value="">请选择</option>
+                                                            {volist name="postTypes" id="pt"}
+                                                            <option value="{$pt.code}">{$pt.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
+                                                {if condition="in_array($row['type'],[6]) && $institutions"}
+                                                <div class="rowGroup">
+                                                    <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>所属编制</label>
+                                                    <div class="col-sm-2 spacing">
+                                                        <select type="text" disabled="disabled" class="form-control" id="institution" name="institution" value="{$row.institution}">
+                                                            <option value="">请选择</option>
+                                                            {volist name="institutions" id="in"}
+                                                            <option value="{$in.code}">{$in.name}</option>
+                                                            {/volist}
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                {/if}
                                                 {if condition="!in_array($row['type'],[5])"}
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>

+ 26 - 11
public/static/modular/gate/talentAllowance/check/talentAllowanceInfo_info_supple.js

@@ -468,17 +468,32 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
             '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
             '</div>\n' +
             '<div class="form-group" id="field" style="display: none;margin: 10px">\n';
-    //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
-    html = html +
-            '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
-            '<div id="field_concat">\n' +
-            '</div>\n' +
-            '<label for="field_project" class="control-label">可修改字段</label>\n' +
-            '<div id="field_field">\n' +
-            '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
-            '<!--<li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li>--></ul>\n' +
-            '</div>\n';
-    //}
+    if ($("#type").val() == 6 && ($("#postType option").length > 0 || $("#institution option").length > 0)) {
+        html = html +
+                '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
+                '<div id="field_concat">\n' +
+                '</div>\n' +
+                '<label for="field_project" class="control-label">可修改字段</label>\n' +
+                '<div id="field_field">\n' +
+                '<ul>';
+        if ($("#postType option").length > 0) {
+            html += '<li style="width: 100%"><input type="checkbox" value="postType"><span>岗位类型</span></li>';
+        }
+        if ($("#institution option").length > 0) {
+            html += '<li style="width: 100%"><input type="checkbox" value="institution"><span>所属编制</span></li>';
+        }
+        html += '</ul></div>';
+    } else {
+        html = html +
+                '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
+                '<div id="field_concat">\n' +
+                '</div>\n' +
+                '<label for="field_project" class="control-label">可修改字段</label>\n' +
+                '<div id="field_field">\n' +
+                '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
+                '<!--<li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li>--></ul>\n' +
+                '</div>\n';
+    }
     html = html +
             '<label for="field_project" class="control-label">可修改项目</label>\n' +
             '<div id="field_project">\n' +

+ 28 - 0
public/static/modular/gate/talentAllowance/common/talentAllowance_info.js

@@ -6,6 +6,32 @@ var TalentAllowanceInfoDlg = {
     validateFields: {
         talentId: {validators: {notEmpty: {message: '申报对象不能为空'}}},
         allowanceType: {validators: {notEmpty: {message: '津补贴类型不能为空'}}},
+        postType: {
+            validators: {
+                callback: {
+                    message: "请选择岗位类型",
+                    callback: function (value, validator) {
+                        if ($("#postType option").length > 0 && ($("#postType").val() == null || $("#postType").val() == "")) {
+                            return false;
+                        }
+                        return true;
+                    }
+                }
+            }
+        },
+        institution: {
+            validators: {
+                callback: {
+                    message: "请选择所属编制",
+                    callback: function (value, validator) {
+                        if ($("#institution option").length > 0 && ($("#institution").val() == null || $("#institution").val() == "")) {
+                            return false;
+                        }
+                        return true;
+                    }
+                }
+            }
+        },
         wage: {
             validators: {
                 callback: {
@@ -65,6 +91,8 @@ TalentAllowanceInfoDlg.collectData = function () {
             .set('talentId')
             .set('year')
             .set('allowanceType')
+            .set('postType')
+            .set('institution')
             .set('wage');
 }
 /**

+ 4 - 4
public/static/modular/talentAllowance/talentAllowanceInfo.js

@@ -378,7 +378,6 @@ TalentAllowanceInfo.submitBatchVisit = function () {
 TalentAllowanceInfo.updateFieldsAndFiles = function () {
     if (this.check()) {
         var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/findFieldsAndFiles?id=" + TalentAllowanceInfo.seItem.id, function (data) {
-            console.log(data)
             var obj = data.obj;
             if (data.code == 200) {
                 layer.open({
@@ -396,9 +395,10 @@ TalentAllowanceInfo.updateFieldsAndFiles = function () {
                             '                        </div>\n' +
                             '                        <label for="field_project" class="control-label">可修改字段</label>\n' +
                             '                        <div id="field_field">\n' +
-                            '                           <ul><li style="width: 100%"><input type="checkbox" id="typeChange" class="icheckbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
-                            '                           <!--<ul><li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li></ul>-->' +
-                            '                        </div>\n' +
+                            '                           <ul><li style="width: 100%"><input type="checkbox" id="typeChange" class="icheckbox" value="allowanceType"><span>津补贴类型</span></li>\n' +
+                            ($("#type").val() == 6 ? '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="postType"><span>岗位类型</span></li>' : "") +
+                            ($("#type").val() == 6 ? '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="institution"><span>所属编制</span></li>' : "") +
+                            '                        </ul></div>\n' +
                             '                        <label for="field_project" class="control-label">可修改项目</label>\n' +
                             '                        <div id="field_project">\n' +
                             '                        </div>\n' +

+ 27 - 11
public/static/modular/talentAllowance/talentAllowanceInfo_info_supple.js

@@ -471,17 +471,33 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
                     '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
                     '</div>\n' +
                     '<div class="form-group" id="field" style="display: none;margin: 10px">\n';
-            //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
-            html = html +
-                    '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
-                    '<div id="field_concat">\n' +
-                    '</div>\n' +
-                    '<label for="field_project" class="control-label">可修改字段</label>\n' +
-                    '<div id="field_field">\n' +
-                    '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
-                    '<!--<li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li>--></ul>\n' +
-                    '</div>\n';
-            //}
+
+            if ($("#type").val() == 6 && ($("#postType option").length > 0 || $("#institution option").length > 0)) {
+                html = html +
+                        '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
+                        '<div id="field_concat">\n' +
+                        '</div>\n' +
+                        '<label for="field_project" class="control-label">可修改字段</label>\n' +
+                        '<div id="field_field">\n' +
+                        '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li>';
+                if ($("#postType option").length > 0) {
+                    html += '<li style="width: 100%"><input type="checkbox" value="postType"><span>岗位类型</span></li>';
+                }
+                if ($("#institution option").length > 0) {
+                    html += '<li style="width: 100%"><input type="checkbox" value="institution"><span>所属编制</span></li>';
+                }
+                html += '</ul></div>';
+            } else {
+                html = html +
+                        '<label for="field_concat" class="control-label">可修改合同时间</label>\n' +
+                        '<div id="field_concat">\n' +
+                        '</div>\n' +
+                        '<label for="field_project" class="control-label">可修改字段</label>\n' +
+                        '<div id="field_field">\n' +
+                        '<ul><li style="width: 100%"><input type="checkbox" value="allowanceType"><span>津补贴类型</span></li></ul>\n' +
+                        '<!--<li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li>--></ul>\n' +
+                        '</div>\n';
+            }
             html = html +
                     '<label for="field_project" class="control-label">可修改项目</label>\n' +
                     '<div id="field_project">\n' +

+ 10 - 1
sys_config.json

@@ -144,5 +144,14 @@
     },
 	"twice_indentify_person": [
         "350583198605043738", "35058219820705403X", "210105196210255313", "659001198807310926", "420624198812091840", "A59097577", "370983198901241814", "350825198802204521", "350524198204036051", "350502198407182018", "350582198404083534", "350822198904124718", "350425198601261210"
-    ]
+    ],
+	"talent_allowance_need_choose_post_type":{
+		"1211474926804975617":[1,2,3,4],
+		"1211490446086291458":[1,2,3,4],
+		"1215115207978827777":[1,5,6,7],
+		"1216568840104734722":[1,5,6,7]
+	},
+	"talent_allowance_need_choose_institution":[
+		"1215115207978827777","1216568840104734722"
+	]
 }