Преглед изворни кода

Merge remote-tracking branch 'origin/master'

sandm пре 2 година
родитељ
комит
1b9a2395a7

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

@@ -65,17 +65,17 @@ class IntegralVerify extends AdminController {
         $ids_arr = array_filter(explode(",", $ids));
         $ids_arr = array_filter(explode(",", $ids));
         $counts = 0;
         $counts = 0;
         foreach ($ids_arr as $id) {
         foreach ($ids_arr as $id) {
-            $record = IntegralRecord::getOne($id);
+            $record = IntegralRecordApi::getOne($id);
             $data["id"] = $id;
             $data["id"] = $id;
             if ($record["checkState"] == IntegralState::SUBMIT) {
             if ($record["checkState"] == IntegralState::SUBMIT) {
                 $data["checkState"] = IntegralState::VERIFY_FAIL;
                 $data["checkState"] = IntegralState::VERIFY_FAIL;
                 TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::VERIFY_FAIL, $msg, 1);
                 TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::VERIFY_FAIL, $msg, 1);
-                TalentModel::update($data);
+                IntegralRecord::update($data);
                 $counts++;
                 $counts++;
             } else if ($record["checkState"] == IntegralState::VERIFY_PASS) {
             } 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);
                 TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::REVERIFY_FAIL, $msg, 1);
-                TalentModel::update($data);
+                IntegralRecord::update($data);
                 $counts++;
                 $counts++;
             } else {
             } else {
                 return json(["msg" => "不在审核范围"]);
                 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 class="form-control" style="border: none">{$row.enterprise.streetName}</div>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </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>
                                             </tr>
                                         </table>
                                         </table>
                                     </div>
                                     </div>
@@ -177,6 +183,12 @@
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </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>
                                         </table>
                                         </table>
                                         {/volist}
                                         {/volist}

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

@@ -84,6 +84,20 @@
                                     </select>
                                     </select>
                                 </div>
                                 </div>
                             </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="col-sm-3">
                                 <div class="input-group input-group-sm">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">
                                     <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="">
                                     <input type="text" class="form-control" id="email" placeholder="">
                                 </div>                            
                                 </div>                            
                             </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="col-sm-3">
                                 <div class="input-group input-group-sm">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">
                                     <div class="input-group-btn">

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

@@ -84,6 +84,20 @@
                                     </select>
                                     </select>
                                 </div>
                                 </div>
                             </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="col-sm-3">
                                 <div class="input-group input-group-sm">
                                 <div class="input-group input-group-sm">
                                     <div class="input-group-btn">
                                     <div class="input-group-btn">

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

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

+ 18 - 5
app/common/api/IntegralRecordApi.php

@@ -34,9 +34,9 @@ class IntegralRecordApi {
         if (session("user")["usertype"] == 2) {
         if (session("user")["usertype"] == 2) {
             $where[] = ["enterprise_id", "=", session("user")["uid"]];
             $where[] = ["enterprise_id", "=", session("user")["uid"]];
         }
         }
-        $where[] = ["delete", "=", 0];
+        $where[] = ["ir.delete", "=", 0];
         $count = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->count();
         $count = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->count();
-        $list = IntegralRecord::where($where)->field("ir.*,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
+        $list = IntegralRecord::alias("ir")->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")->where($where)->field("ir.*,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
         foreach ($list as $key => $item) {
         foreach ($list as $key => $item) {
             $list[$key]["apply_year"] = BatchApi::getOne($item["batch_id"])["batch"];
             $list[$key]["apply_year"] = BatchApi::getOne($item["batch_id"])["batch"];
             $tmp_items = [];
             $tmp_items = [];
@@ -58,10 +58,10 @@ class IntegralRecordApi {
         $where = [];
         $where = [];
         switch ($process) {
         switch ($process) {
             case 1://初审阶段
             case 1://初审阶段
-                $where[] = ["checkState", "in", [IntegralState::SUBMIT]];
+                $where[] = ["checkState", "in", [IntegralState::SUBMIT, IntegralState::VERIFY_FAIL]];
                 break;
                 break;
             case 2://复审阶段
             case 2://复审阶段
-                $where[] = ["checkState", "in", [IntegralState::VERIFY_PASS]];
+                $where[] = ["checkState", "in", [IntegralState::VERIFY_PASS, IntegralState::REVERIFY_FAIL]];
                 break;
                 break;
             case 3://复审后征信公示等状态
             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]];
                 $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]];
@@ -103,7 +103,16 @@ class IntegralRecordApi {
         return $info;
         return $info;
     }
     }
 
 
-    public static function calIntegral($enterprise_id, $cardType, $cardNumber, $itemId, $amount) {
+    /**
+     * 计算积分
+     * @param type $enterpriseId 企业id
+     * @param type $cardType 证件类型
+     * @param type $cardNumber 证件号码
+     * @param type $itemId 标准id
+     * @param type $amount 达成数额
+     * @return \stdClass 完整积分记录对象
+     */
+    public static function calIntegral($enterpriseId, $cardType, $cardNumber, $itemId, $amount) {
         $returnObj = new \stdClass();
         $returnObj = new \stdClass();
         $returnObj->amount = $amount;
         $returnObj->amount = $amount;
         $item = getCacheById("IntegralItem", $itemId);
         $item = getCacheById("IntegralItem", $itemId);
@@ -224,6 +233,10 @@ class IntegralRecordApi {
                     $returnObj->points = $returnObj->fstPoints = $amount >= $item["fstNeedAmount"] ? $item["fstGainPoints"] : 0;
                     $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;
         return $returnObj;
     }
     }

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

@@ -18,6 +18,7 @@ use app\common\api\UploadApi;
 use app\common\api\TalentConditionApi;
 use app\common\api\TalentConditionApi;
 use app\common\api\CompanyApi;
 use app\common\api\CompanyApi;
 use app\common\api\TalentState;
 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_item["createTime"] = $item["updateTime"] ?: $item["createTime"];
             $new_list[] = $new_item;
             $new_list[] = $new_item;
         }
         }
-        if ($type == \app\common\state\ProjectState::TALENT) {
+        if ($type == ProjectState::TALENT) {
             $talentInfo = TalentApi::getOne($mainId);
             $talentInfo = TalentApi::getOne($mainId);
             if ($talentInfo["oldId"]) {
             if ($talentInfo["oldId"]) {
                 $where = [];
                 $where = [];
                 $where[] = ["mainId", "=", $talentInfo["oldId"]];
                 $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();
                 $before_list = Db::table("un_talent_checklog")->where($where)->order("createTime desc")->select();
                 foreach ($before_list as $before_item) {
                 foreach ($before_list as $before_item) {
                     $new_list[] = [
                     $new_list[] = [
@@ -376,7 +377,16 @@ class Api extends BaseController {
         $type = $this->request->param("type");
         $type = $this->request->param("type");
         $upload = new \app\common\api\UploadApi();
         $upload = new \app\common\api\UploadApi();
         $file = $this->request->file("fileUrl");
         $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];
             $res = ["msg" => "当前状态不能修改附件", "obj" => $index];
             echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
             echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
             exit();
             exit();
@@ -570,7 +580,7 @@ class Api extends BaseController {
         if (!$mainId)
         if (!$mainId)
             return true;
             return true;
         switch ($type) {
         switch ($type) {
-            case 1:
+            case ProjectState::TALENT:
                 if ($this->user["usertype"] == 2) {
                 if ($this->user["usertype"] == 2) {
                     $user_id = $this->user["uid"];
                     $user_id = $this->user["uid"];
                     $talent_info = Db::table("new_talent_info")->findOrEmpty($mainId);
                     $talent_info = Db::table("new_talent_info")->findOrEmpty($mainId);
@@ -578,6 +588,14 @@ class Api extends BaseController {
                         return true;
                         return true;
                 }
                 }
                 break;
                 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;
         return false;
     }
     }
@@ -763,4 +781,18 @@ class Api extends BaseController {
         return json($list);
         return json($list);
     }
     }
 
 
+    public function calIntegral() {
+        $params = $this->request->param();
+        $enterpriseId = $params["enterpriseId"];
+        $cardType = $params["cardType"];
+        $cardNumber = $params["cardNumber"];
+        $itemId = $params["itemId"];
+        $amount = $params["amount"];
+        if (session("user")["usertype"] == 2) {
+            //企业端只能通过企业自身id来查询积分
+            $enterpriseId = session("user")["uid"];
+        }
+        return json(\app\common\api\IntegralRecordApi::calIntegral($enterpriseId, $cardType, $cardNumber, $itemId, $amount));
+    }
+
 }
 }

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

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

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

@@ -96,7 +96,7 @@
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>证件类型</label>
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>证件类型</label>
-                                                        <select class="form-control" id="card_type" name="card_type" value="{$row.card_type}">
+                                                        <select class="form-control" id="card_type" name="card_type" value="{$row.card_type}" onchange="IntegralInfoDlg.multipleRefreshPoints();">
                                                             <option value="">请选择</option>
                                                             <option value="">请选择</option>
                                                             <option value="1">身份证</option>
                                                             <option value="1">身份证</option>
                                                             <option value="2">通行证</option>
                                                             <option value="2">通行证</option>
@@ -107,7 +107,7 @@
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>证件号码</span></label>
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>证件号码</span></label>
-                                                        <input class="form-control" id="card_number" name="card_number" value="{$row.card_number}">
+                                                        <input class="form-control" id="card_number" name="card_number" value="{$row.card_number}" onblur="IntegralInfoDlg.multipleRefreshPoints();">
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </td>
                                                 <td>
                                                 <td>
@@ -193,13 +193,13 @@
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>
-                                                        <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
+                                                        <input type="text" class="form-control" name="amount[]" value="{$item.amount}" onkeyup="IntegralInfoDlg.onAmountChange(this);"/>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </td>
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label">预估积分</label>
                                                         <label class=" control-label spacing td-label">预估积分</label>
-                                                        <div class="form-control" style="border: none">{$item.integral}</div>
+                                                        <div class="form-control points" style="border: none">{$item.pre_point}</div>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </td>
                                             </tr>
                                             </tr>
@@ -249,13 +249,13 @@
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>
                                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>
-                                                        <input type="text" class="form-control" name="amount[]" value="{$row.amount}"/>
+                                                        <input type="text" class="form-control" name="amount[]" value="{$row.amount}" onkeyup="IntegralInfoDlg.onAmountChange(this);"/>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </td>
                                                 <td>
                                                 <td>
                                                     <div class="rowGroup">
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label">预估积分</label>
                                                         <label class=" control-label spacing td-label">预估积分</label>
-                                                        <div class="form-control" style="border: none">-</div>
+                                                        <div class="form-control points" style="border: none">-</div>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </td>
                                             </tr>
                                             </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 class="form-control" style="border: none">{$row.enterprise.streetName}</div>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </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>
                                             </tr>
                                         </table>
                                         </table>
                                     </div>
                                     </div>
@@ -179,6 +189,12 @@
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                     </div>
                                                     </div>
                                                 </td>
                                                 </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>
                                             <!--<tr>
                                             <!--<tr>
                                                 <td colspan="5">
                                                 <td colspan="5">

+ 54 - 4
public/static/modular/gate/integral/integralInfo.js

@@ -78,7 +78,7 @@ IntegralInfoDlg.get = function (key) {
  * 关闭此对话框
  * 关闭此对话框
  */
  */
 IntegralInfoDlg.close = function () {
 IntegralInfoDlg.close = function () {
-    parent.layer.close(window.parent.TalentInfo.layerIndex);
+    parent.layer.close(window.parent.Integral.layerIndex);
 }
 }
 
 
 /**
 /**
@@ -177,9 +177,15 @@ IntegralInfoDlg.addItem = function () {
             '                                 <td>' +
             '                                 <td>' +
             '                                     <div class="rowGroup">' +
             '                                     <div class="rowGroup">' +
             '                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>' +
             '                                         <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>' +
-            '                                         <input type="text" class="form-control" name="amount[]" value=""/>' +
+            '                                         <input type="text" class="form-control" name="amount[]" value="" onkeyup="IntegralInfoDlg.onAmountChange(this);"/>' +
             '                                     </div>' +
             '                                     </div>' +
             '                                 </td>' +
             '                                 </td>' +
+            '                                 <td>' +
+            '                                     <div class="rowGroup">' +
+            '                                         <label class=" control-label spacing td-label">预估积分</label>' +
+            '                                         <div class="form-control points" style="border: none">-</div>' +
+            '                                     </div>' +
+            '                                  </td>' +
             '                             </tr>' +
             '                             </tr>' +
             '                         </table>';
             '                         </table>';
     /*
     /*
@@ -285,6 +291,7 @@ IntegralInfoDlg.onProjectTypeChange = function (obj) {
         "type": "GET",
         "type": "GET",
         "url": "/common/api/getIntegralProjectsByType/projectType/" + projectType
         "url": "/common/api/getIntegralProjectsByType/projectType/" + projectType
     });
     });
+    IntegralInfoDlg.calIntegral(obj);
 }
 }
 IntegralInfoDlg.onProjectChange = function (obj) {
 IntegralInfoDlg.onProjectChange = function (obj) {
     var projectId = $(obj).val();
     var projectId = $(obj).val();
@@ -298,6 +305,7 @@ IntegralInfoDlg.onProjectChange = function (obj) {
             "type": "GET",
             "type": "GET",
             "url": "/common/api/getIntegralItemsByProject/projectId/" + projectId
             "url": "/common/api/getIntegralItemsByProject/projectId/" + projectId
         });
         });
+        IntegralInfoDlg.calIntegral(obj);
     }
     }
 }
 }
 IntegralInfoDlg.onItemChange = function (obj) {
 IntegralInfoDlg.onItemChange = function (obj) {
@@ -309,6 +317,49 @@ IntegralInfoDlg.onItemChange = function (obj) {
         parent.find(".unit").html("");
         parent.find(".unit").html("");
     }
     }
     IntegralInfoDlg.changeAndLoadFile();
     IntegralInfoDlg.changeAndLoadFile();
+    IntegralInfoDlg.calIntegral(obj);
+}
+IntegralInfoDlg.timeout = null;
+IntegralInfoDlg.delay = 500;
+IntegralInfoDlg.onAmountChange = function (obj) {
+    clearTimeout(IntegralInfoDlg.timeout);
+    IntegralInfoDlg.timeout = setTimeout(function () {
+        IntegralInfoDlg.calIntegral(obj);
+    }, IntegralInfoDlg.delay);
+}
+IntegralInfoDlg.calIntegral = function (obj) {
+    var parent = $(obj).parents("table");
+    var cardType = $("#card_type").val();
+    var cardNumber = $("#card_number").val();
+    var itemId = parent.find("select[name='item_id[]']").val();
+    var amount = parent.find("input[name='amount[]']").val();
+    var cardTypeArr = ["1", "2", "3"];
+    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(data.points);
+        }, function (data) {
+            Feng.error("预估积分失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("cardType", cardType);
+        ajax.set("cardNumber", cardNumber);
+        ajax.set("itemId", itemId);
+        ajax.set("amount", amount);
+        ajax.start();
+    } else {
+        parent.find(".points").html("-");
+    }
+}
+
+IntegralInfoDlg.multipleRefreshPoints = function () {
+    var count = $("#itemList").find("table").length;
+    for (var i = 0; i < count; i++) {
+        var table = $("#itemList").find("table").eq(i);
+        IntegralInfoDlg.calIntegral(table.find(".points")[0]);
+    }
 }
 }
 
 
 /**
 /**
@@ -338,7 +389,6 @@ IntegralInfoDlg.addSubmit = function () {
 
 
 //回调
 //回调
 IntegralInfoDlg.infoCallback = function (data) {
 IntegralInfoDlg.infoCallback = function (data) {
-    console.log(data)
     locked = false;
     locked = false;
     IntegralInfoDlg.setNoChangeField();
     IntegralInfoDlg.setNoChangeField();
     Feng.info(data.msg);
     Feng.info(data.msg);
@@ -460,7 +510,7 @@ IntegralInfoDlg.submitCallback = function (data) {
     if (data.code == 200) {
     if (data.code == 200) {
         Feng.success(data.msg);
         Feng.success(data.msg);
         // $("#checkState").val(data.obj);
         // $("#checkState").val(data.obj);
-        window.parent.TalentInfo.table.refresh();
+        window.parent.Integral.table.refresh();
         IntegralInfoDlg.close();
         IntegralInfoDlg.close();
     } else {
     } else {
         Feng.error(data.msg);
         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: '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: '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: '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: '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",
         {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
             formatter: function (value, row, index) {
             formatter: function (value, row, index) {
+                console.log(row)
                 if (typeof row.deptCheckState != "undefined") {
                 if (typeof row.deptCheckState != "undefined") {
                     if (row.deptCheckState == 12) {
                     if (row.deptCheckState == 12) {
                         return "<span class='label label-primary'>部门已通过</span>"
                         return "<span class='label label-primary'>部门已通过</span>"