瀏覽代碼

积分申报修改

sugangqiang 2 年之前
父節點
當前提交
dc07b1972b

+ 4 - 4
app/admin/controller/IntegralVerify.php

@@ -65,17 +65,17 @@ class IntegralVerify extends AdminController {
         $ids_arr = array_filter(explode(",", $ids));
         $counts = 0;
         foreach ($ids_arr as $id) {
-            $record = IntegralRecord::getOne($id);
+            $record = IntegralRecordApi::getOne($id);
             $data["id"] = $id;
             if ($record["checkState"] == IntegralState::SUBMIT) {
                 $data["checkState"] = IntegralState::VERIFY_FAIL;
                 TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::VERIFY_FAIL, $msg, 1);
-                TalentModel::update($data);
+                IntegralRecord::update($data);
                 $counts++;
             } else if ($record["checkState"] == IntegralState::VERIFY_PASS) {
-                $data["checkState"] = IntegralState::FST_VERIFY_FAIL;
+                $data["checkState"] = IntegralState::REVERIFY_FAIL;
                 TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::REVERIFY_FAIL, $msg, 1);
-                TalentModel::update($data);
+                IntegralRecord::update($data);
                 $counts++;
             } else {
                 return json(["msg" => "不在审核范围"]);

+ 12 - 0
app/admin/view/integral_verify/detail.html

@@ -135,6 +135,12 @@
                                                         <div class="form-control" style="border: none">{$row.enterprise.streetName}</div>
                                                     </div>
                                                 </td>
+                                                <td>
+                                                    <div class="rowGroup">
+                                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>是否股东</label>
+                                                        <div class="form-control" style="border: none">{eq name="row.shareholder" value="1"}是{else/}否{/eq}</div>
+                                                    </div>
+                                                </td>
                                             </tr>
                                         </table>
                                     </div>
@@ -177,6 +183,12 @@
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                     </div>
                                                 </td>
+                                                <td>
+                                                    <div class="rowGroup">
+                                                        <label class=" control-label spacing td-label">预估积分</label>
+                                                        <div class="form-control points" style="border: none">{$item.pre_point}</div>
+                                                    </div>
+                                                </td>
                                             </tr>
                                         </table>
                                         {/volist}

+ 14 - 0
app/admin/view/integral_verify/fst_verify.html

@@ -84,6 +84,20 @@
                                     </select>
                                 </div>
                             </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                            是否股东
+                                        </button>
+                                    </div>
+                                    <select class="form-control" id="shareholder">
+                                        <option value="">---请选择---</option>
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
+                                    </select>
+                                </div>
+                            </div>
                             <div class="col-sm-3">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">

+ 14 - 0
app/admin/view/integral_verify/pre_list.html

@@ -100,6 +100,20 @@
                                     <input type="text" class="form-control" id="email" placeholder="">
                                 </div>                            
                             </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                            是否股东
+                                        </button>
+                                    </div>
+                                    <select class="form-control" id="shareholder">
+                                        <option value="">---请选择---</option>
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
+                                    </select>
+                                </div>
+                            </div>
                             <div class="col-sm-3">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">

+ 14 - 0
app/admin/view/integral_verify/re_verify.html

@@ -84,6 +84,20 @@
                                     </select>
                                 </div>
                             </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
+                                            是否股东
+                                        </button>
+                                    </div>
+                                    <select class="form-control" id="shareholder">
+                                        <option value="">---请选择---</option>
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
+                                    </select>
+                                </div>
+                            </div>
                             <div class="col-sm-3">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">

+ 2 - 1
app/common/api/DictApi.php

@@ -144,7 +144,8 @@ class DictApi {
             "card_type" => "证件类型",
             "card_number" => "证件号码",
             "phone" => "手机号码",
-            "email" => "电子邮箱"
+            "email" => "电子邮箱",
+            "shareholder" => "是否股东"
         ];
     }
 

+ 6 - 2
app/common/api/IntegralRecordApi.php

@@ -58,10 +58,10 @@ class IntegralRecordApi {
         $where = [];
         switch ($process) {
             case 1://初审阶段
-                $where[] = ["checkState", "in", [IntegralState::SUBMIT]];
+                $where[] = ["checkState", "in", [IntegralState::SUBMIT, IntegralState::VERIFY_FAIL]];
                 break;
             case 2://复审阶段
-                $where[] = ["checkState", "in", [IntegralState::VERIFY_PASS]];
+                $where[] = ["checkState", "in", [IntegralState::VERIFY_PASS, IntegralState::REVERIFY_FAIL]];
                 break;
             case 3://复审后征信公示等状态
                 $where[] = ["checkState", "in", [IntegralState::REVERIFY_PASS, IntegralState::ZX_PASS, IntegralState::ZX_FAIL, IntegralState::ANNOUNCED, IntegralState::ANNOUNCED_REVERIFY_PASS, IntegralState::ANNOUNCED_REVERIFY_FAIL, IntegralState::PUBLISH_PASS, IntegralState::PUBLISH_FAIL, IntegralState::SUCCESS]];
@@ -233,6 +233,10 @@ class IntegralRecordApi {
                     $returnObj->points = $returnObj->fstPoints = $amount >= $item["fstNeedAmount"] ? $item["fstGainPoints"] : 0;
                 }
             }
+            $point1 = $project["limit"] == 1 ? ($returnObj->projectRemainderPoints > $returnObj->points ? $returnObj->points : $returnObj->projectRemainderPoints) : $returnObj->points;
+            $point2 = $item["limit"] == 1 ? ($returnObj->itemRemainderPoints > $returnObj->points ? $returnObj->points : $returnObj->itemRemainderPoints) : $returnObj->points;
+            $returnObj->theoretical = $returnObj->points; //理论值
+            $returnObj->points = $point1 > $point2 ? $point2 : $point1; //实际值,当有限额时,会与理论值有偏差
         }
         return $returnObj;
     }

+ 22 - 4
app/common/controller/Api.php

@@ -18,6 +18,7 @@ use app\common\api\UploadApi;
 use app\common\api\TalentConditionApi;
 use app\common\api\CompanyApi;
 use app\common\api\TalentState;
+use app\common\state\ProjectState;
 
 /**
  * 需要权限的公共方法放这
@@ -265,12 +266,12 @@ class Api extends BaseController {
             $new_item["createTime"] = $item["updateTime"] ?: $item["createTime"];
             $new_list[] = $new_item;
         }
-        if ($type == \app\common\state\ProjectState::TALENT) {
+        if ($type == ProjectState::TALENT) {
             $talentInfo = TalentApi::getOne($mainId);
             if ($talentInfo["oldId"]) {
                 $where = [];
                 $where[] = ["mainId", "=", $talentInfo["oldId"]];
-                $where[] = ["type", "=", \app\common\state\ProjectState::TALENT];
+                $where[] = ["type", "=", ProjectState::TALENT];
                 $before_list = Db::table("un_talent_checklog")->where($where)->order("createTime desc")->select();
                 foreach ($before_list as $before_item) {
                     $new_list[] = [
@@ -376,7 +377,16 @@ class Api extends BaseController {
         $type = $this->request->param("type");
         $upload = new \app\common\api\UploadApi();
         $file = $this->request->file("fileUrl");
-        if (!TalentApi::checkIsEditable($mainId)) {
+        $isFileEditable = false;
+        switch ($type) {
+            case ProjectState::INTEGRAL:
+                $isFileEditable = \app\common\api\IntegralRecordApi::checkIsEditable($mainId);
+                break;
+            default:
+                $isFileEditable = TalentApi::checkIsEditable($mainId);
+                break;
+        }
+        if (!$isFileEditable) {
             $res = ["msg" => "当前状态不能修改附件", "obj" => $index];
             echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
             exit();
@@ -570,7 +580,7 @@ class Api extends BaseController {
         if (!$mainId)
             return true;
         switch ($type) {
-            case 1:
+            case ProjectState::TALENT:
                 if ($this->user["usertype"] == 2) {
                     $user_id = $this->user["uid"];
                     $talent_info = Db::table("new_talent_info")->findOrEmpty($mainId);
@@ -578,6 +588,14 @@ class Api extends BaseController {
                         return true;
                 }
                 break;
+            case ProjectState::INTEGRAL:
+                if ($this->user["usertype"] == 2) {
+                    $user_id = $this->user["uid"];
+                    $record = Db::table("new_integral_record")->findOrEmpty($mainId);
+                    if ($user_id == $record["enterprise_id"])
+                        return true;
+                }
+                break;
         }
         return false;
     }

+ 8 - 1
app/enterprise/controller/Integral.php

@@ -195,13 +195,20 @@ class Integral extends EnterpriseController {
                 if (!is_numeric($amounts[$i]) || $amounts[$i] < 0) {
                     throw new ValidateException(sprintf("第%d个积分标准项的数额填写错误,应填入大于0的数字", $i + 1));
                 }
-                $insertDetailList[] = [
+                $tmpItemData = [];
+                $tmpItemData = [
                     "id" => getStringId(),
                     "record_id" => "",
                     "item_id" => $item_ids[$i],
                     "amount" => $amounts[$i],
                     "unit" => ""
                 ];
+                if ($param["card_type"] && $param["card_number"]) {
+                    $log = IntegralRecordApi::calIntegral($this->user["uid"], $param["card_type"], $param["card_number"], $item_ids[$i], $amounts[$i]);
+                    $tmpItemData["pre_point"] = $log->points;
+                    $tmpItemData["log"] = json_encode($log);
+                }
+                $insertDetailList[] = $tmpItemData;
             }
 
             if ($info["real_state"] == IntegralState::VERIFY_REJECT) {

+ 1 - 1
app/enterprise/view/integral/apply.html

@@ -199,7 +199,7 @@
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label">预估积分</label>
-                                                        <div class="form-control points" style="border: none">{$item.integral}</div>
+                                                        <div class="form-control points" style="border: none">{$item.pre_point}</div>
                                                     </div>
                                                 </td>
                                             </tr>

+ 16 - 0
app/enterprise/view/integral/view.html

@@ -136,6 +136,16 @@
                                                         <div class="form-control" style="border: none">{$row.enterprise.streetName}</div>
                                                     </div>
                                                 </td>
+                                                <td>
+                                                    <div class="rowGroup">
+                                                        <label class=" control-label spacing td-label"><span style="color: red">*</span>是否股东</label>
+                                                        <select class="form-control" id="shareholder" name="shareholder" value="{$row.shareholder}">
+                                                            <option value="">请选择</option>
+                                                            <option value="1">是</option>
+                                                            <option value="2">否</option>
+                                                        </select>
+                                                    </div>
+                                                </td>
                                             </tr>
                                         </table>
                                     </div>
@@ -179,6 +189,12 @@
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                     </div>
                                                 </td>
+                                                <td>
+                                                    <div class="rowGroup">
+                                                        <label class=" control-label spacing td-label">预估积分</label>
+                                                        <div class="form-control points" style="border: none">{$item.pre_point}</div>
+                                                    </div>
+                                                </td>
                                             </tr>
                                             <!--<tr>
                                                 <td colspan="5">

+ 7 - 8
public/static/modular/gate/integral/integralInfo.js

@@ -78,7 +78,7 @@ IntegralInfoDlg.get = function (key) {
  * 关闭此对话框
  */
 IntegralInfoDlg.close = function () {
-    parent.layer.close(window.parent.TalentInfo.layerIndex);
+    parent.layer.close(window.parent.Integral.layerIndex);
 }
 
 /**
@@ -320,7 +320,7 @@ IntegralInfoDlg.onItemChange = function (obj) {
     IntegralInfoDlg.calIntegral(obj);
 }
 IntegralInfoDlg.timeout = null;
-IntegralInfoDlg.delay = 250;
+IntegralInfoDlg.delay = 500;
 IntegralInfoDlg.onAmountChange = function (obj) {
     clearTimeout(IntegralInfoDlg.timeout);
     IntegralInfoDlg.timeout = setTimeout(function () {
@@ -337,10 +337,10 @@ IntegralInfoDlg.calIntegral = function (obj) {
     if (cardTypeArr.indexOf(cardType) > -1 && cardNumber != "" && itemId > 0 && !isNaN(amount) && amount != "") {
         //条件齐全就可以查询积分        
         var ajax = new $ax(Feng.ctxPath + "/common/api/calIntegral", function (data) {
-            let point1 = typeof data.projectRemainderPoints != "undefined" ? (data.projectRemainderPoints > data.points ? data.points : data.projectRemainderPoints) : data.points;
-            let point2 = typeof data.itemRemainderPoints != "undefined" ? (data.itemRemainderPoints > data.points ? data.points : data.itemRemainderPoints) : data.points;
-            let points = point1 > point2 ? point2 : point1;
-            parent.find(".points").html(points);
+            /*let point1 = typeof data.projectRemainderPoints != "undefined" ? (data.projectRemainderPoints > data.points ? data.points : data.projectRemainderPoints) : data.points;
+             let point2 = typeof data.itemRemainderPoints != "undefined" ? (data.itemRemainderPoints > data.points ? data.points : data.itemRemainderPoints) : data.points;
+             let points = point1 > point2 ? point2 : point1;*/
+            parent.find(".points").html(data.points);
         }, function (data) {
             Feng.error("预估积分失败!" + data.responseJSON.message + "!");
         });
@@ -389,7 +389,6 @@ IntegralInfoDlg.addSubmit = function () {
 
 //回调
 IntegralInfoDlg.infoCallback = function (data) {
-    console.log(data)
     locked = false;
     IntegralInfoDlg.setNoChangeField();
     Feng.info(data.msg);
@@ -511,7 +510,7 @@ IntegralInfoDlg.submitCallback = function (data) {
     if (data.code == 200) {
         Feng.success(data.msg);
         // $("#checkState").val(data.obj);
-        window.parent.TalentInfo.table.refresh();
+        window.parent.Integral.table.refresh();
         IntegralInfoDlg.close();
     } else {
         Feng.error(data.msg);

+ 11 - 0
public/static/modular/talentIdentify/integralMgr/IntegralVerify.js

@@ -37,12 +37,23 @@ IntegralVerify.initColumn = function () {
                 }
             }
         },
+        {title: '是否股东', field: 'shareholder', visible: true, align: 'center', valign: 'middle', width: "100px",
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return '是';
+                }
+                if (value == 2) {
+                    return '否';
+                }
+            }
+        },
         {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
         {title: '申报标准', field: 'details', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
         {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
         {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
         {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
             formatter: function (value, row, index) {
+                console.log(row)
                 if (typeof row.deptCheckState != "undefined") {
                     if (row.deptCheckState == 12) {
                         return "<span class='label label-primary'>部门已通过</span>"