Crazy пре 7 месеци
родитељ
комит
42e4ba640f

+ 339 - 3
app/admin/controller/Index.php

@@ -13,6 +13,7 @@ use app\admin\BaseController;
 use think\facade\Db;
 use think\facade\View;
 
+
 class Index extends BaseController
 {
 
@@ -696,10 +697,253 @@ class Index extends BaseController
         return View();
     }
 
-    public function main_proprietor()//业主
+    public function main_proprietor()//业主
     {
+
+        $sent_review_amount = Db::name("cost_project")->where([
+            ["sent_review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ["project_status", ">", 2],
+            ["project_status", "<>", 9],
+        ])->field("sent_review_amount,sent_review_cost,review_add_reduce_rate,authorize_amount,engineering_type1")->select();
+        //engineering_type1=1是预算,2是结算
+
+        $amount = [
+            //送审总额
+            'sent_review_amount' => 0,
+            //评审服务费
+            'sent_review_cost' => 0,
+            //审定总额
+            'authorize_amount' => 0,
+            //总审减率
+            'review_add_reduce_rate' => 0
+        ];
+
+        $sent_review_amount_tol = [
+            "sent_review_amount_type1" => 0,
+            "sent_review_amount_type2" => 0,
+
+            "authorize_amount_type1" => 0,
+            "authorize_amount_type2" => 0,
+
+            "review_add_reduce_rate_type1" => 0,
+            "review_add_reduce_rate_type2" => 0
+        ];
+        for ($i = 0; $i < count($sent_review_amount); $i++) {
+            $a = $sent_review_amount[$i];
+            if ($a['engineering_type1'] == 1) {
+                if ((int)$a["sent_review_amount"]) {
+                    //预算总额
+                    $sent_review_amount_tol["sent_review_amount_type1"] += $a["sent_review_amount"];
+                }
+                if ((int)$a["authorize_amount"]) {
+                    //审定
+                    $sent_review_amount_tol["authorize_amount_type1"] += $a["authorize_amount"];
+                }
+
+
+            } elseif ($a['engineering_type1'] == 2) {
+                if ((int)$a["sent_review_amount"]) {
+                    //结算总额
+                    $sent_review_amount_tol["sent_review_amount_type2"] += $a["sent_review_amount"];
+                }
+                if ((int)$a["authorize_amount"]) {
+                    //审定
+                    $sent_review_amount_tol["authorize_amount_type2"] += $a["authorize_amount"];
+                }
+            }
+
+        }
+
+        //什么率的
+        $sentReviewAmount = 0;
+        $authorizeAmount = 0;
+        $sent_review_amount_type1 = 0;
+        $authorize_amount_type1 = 0;
+        $sent_review_amount_type2 = 0;
+        $authorize_amount_type2 = 0;
+        for ($i = 0; $i < count($sent_review_amount); $i++) {
+            $a = $sent_review_amount[$i];
+
+            if ($a['engineering_type1'] == 1 && (int)$a["authorize_amount"]) {
+                if ((int)$a["sent_review_amount"]) {
+                    //预算总额
+                    $sent_review_amount_type1 += $a["sent_review_amount"];
+                    //审定
+                    $authorize_amount_type1 += $a["authorize_amount"];
+                }
+            } elseif ($a['engineering_type1'] == 2) {
+                if ((int)$a["sent_review_amount"] && (int)$a["authorize_amount"]) {
+                    //结算总额
+                    $sent_review_amount_type2 += $a["sent_review_amount"];
+                    //审定
+                    $authorize_amount_type2 += $a["authorize_amount"];
+                }
+            }
+            if ((int)$a["sent_review_amount"] && (int)$a["authorize_amount"]) {
+                //结算总额
+                $sentReviewAmount += $a["sent_review_amount"];
+                //审定
+                $authorizeAmount += $a["authorize_amount"];
+            }
+        }
+
+
+        if ((int)$sent_review_amount_type1 && (int)$authorize_amount_type1) {
+            //预算核增减率
+            $sent_review_amount_tol["review_add_reduce_rate_type1"] = sprintf("%.4f", ($authorize_amount_type1 - $sent_review_amount_type1) / $sent_review_amount_type1) * 100;
+
+        }
+
+        if ($sent_review_amount_type2 && $authorize_amount_type2) {
+            //结算核增减率
+            $sent_review_amount_tol["review_add_reduce_rate_type2"] = sprintf("%.4f", ($authorize_amount_type2 - $sent_review_amount_type2) / $sent_review_amount_type2) * 100;
+
+        }
+        if ((int)$sentReviewAmount && (int)$authorizeAmount) {
+
+            $amount['review_add_reduce_rate'] = (sprintf("%.4f", ($authorizeAmount - $sentReviewAmount) / $sentReviewAmount)) * 100;
+
+        }
+
+
+
+
+        for ($i = 0; $i < count($sent_review_amount); $i++) {
+            $a = $sent_review_amount[$i];
+            if ((int)$a['sent_review_amount']) {
+                $amount["sent_review_amount"] += $a['sent_review_amount'];
+            }
+            if ((int)$a['sent_review_cost']) {
+                $amount["sent_review_cost"] += $a['sent_review_cost'];
+            }
+            if ((int)$a['authorize_amount']) {
+                $amount["authorize_amount"] += $a['authorize_amount'];
+            }
+
+        }
+
+
+        //评审服务费,上半年服务费用,下半年服务费用 start
+        $currentTime = time();
+        $year = date('Y', $currentTime);
+        // 计算上半年时间范围
+        $firstHalfStart = strtotime($year . '-01-01');
+        $firstHalfEnd = strtotime($year . '-06-30 23:59:59');
+        // 计算下半年时间范围
+        $secondHalfStart = strtotime($year . '-07-01');
+        $secondHalfEnd = strtotime($year . '-12-31 23:59:59');
+
+        $first_sent_review_cost = Db::name("cost_project")->where([
+            ['delete_time', '=', 0],
+            ["project_status", ">", 2],
+            ["project_status", "<>", 9],
+            ["sent_review_unit", "=", get_login_admin("unit_name")],
+        ])->
+        whereBetween('create_time', [$firstHalfStart, $firstHalfEnd])->field("sent_review_cost")->select()->toArray();
+        $second_sent_review_cost = Db::name("cost_project")->where([
+            ['delete_time', '=', 0],
+            ["project_status", ">", 2],
+            ["project_status", "<>", 9],
+            ["sent_review_unit", "=", get_login_admin("unit_name")],
+        ])->whereBetween('create_time', [$secondHalfStart, $secondHalfEnd])->field("sent_review_cost")->select()->toArray();
+        $sent_review_cost = [
+            'first_sent_review_cost' => 0,
+            'second_sent_review_cost' => 0
+        ];
+
+        for ($i = 0; $i < count($first_sent_review_cost); $i++) {
+            $a = $first_sent_review_cost[$i];
+            $sent_review_cost["first_sent_review_cost"] += $a['sent_review_cost'];
+        }
+        for ($i = 0; $i < count($second_sent_review_cost); $i++) {
+            $a = $second_sent_review_cost[$i];
+
+
+            $sent_review_cost["second_sent_review_cost"] += $a['sent_review_cost'];
+        }
+        //评审服务费,上半年服务费用,下半年服务费用 end
+
+
+        //项目数量,正在作业,已归档
+        $num = Db::name("cost_project")->where([
+            ["sent_review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ["project_status", '>', 0],
+        ])->count();
+        $where = [
+            ["sent_review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ["project_status", '>', 0],
+        ];
+        $data = Db::name("cost_project")->where($where)->select();
+        $num_project = [
+            'num' => 0,
+            "yu" => 0,
+            "jie" => 0,
+            "zuo" => 0,
+            "gui" => 0,
+            "tui" => 0,
+        ];
+        foreach ($data as $key => $value) {
+            $num_project["num"] += 1;
+
+            if ($value["project_status"] < 6 && $value["project_status"] > 3) {
+                $num_project["zuo"] += 1;
+            }
+            if ($value["project_status"] < 8 && $value["project_status"] > 3) {
+                if ($value["engineering_type1"] == 1) {
+
+                    $num_project["yu"] += 1;
+                }
+                if ($value["engineering_type1"] == 2) {
+                    $num_project["jie"] += 1;
+                }
+            }
+            if ($value["project_status"] == 8) {
+                $num_project["gui"] += 1;
+            }
+            if ($value["project_status"] == 9) {
+                $num_project["tui"] += 1;
+            }
+        }
+
+
+        //项目数量,正在作业,已归档
+        $sent_review_cost_real = [];
+        foreach ($sent_review_cost as $item=>$value){
+            $sent_review_cost_real[$item] = number_format($value/10000,2,".","");
+        }
+        $sent_review_amount_tol_real = [];
+        foreach ($sent_review_amount_tol as $item=>$value){
+
+            if(!($item == "review_add_reduce_rate_type1" || $item == "review_add_reduce_rate_type2")){
+                $sent_review_amount_tol_real[$item] = number_format($value/10000,2,".","");
+            }else{
+                $sent_review_amount_tol_real[$item] = number_format($value,2,".","");
+            }
+        }
+        $amount_real = [];
+        foreach ($amount as $item=>$value){
+            if($item=="review_add_reduce_rate"){
+                $amount_real[$item] = number_format($value,2,".","");
+            }else{
+                $amount_real[$item] = number_format($value/10000,2,".","");
+            }
+
+        }
+
+        View::assign("sent_review_cost", $sent_review_cost_real);
+        View::assign("amount", $amount_real);
+        View::assign("num", $num);
+        View::assign("num_project", $num_project);
+        View::assign("sent_review_amount_tol", $sent_review_amount_tol_real);
+        // dump(self::getHomeFive());
+        View::assign("home_five", self::getHomeFive_proprietor());
+        dump(self::getHomeFive_proprietor());
         return View();
     }
+
     public function main_admin()//管理首页
     {
 
@@ -808,9 +1052,9 @@ class Index extends BaseController
             ['name', '=', '项目列表-财政局'],
             ['name', '=', '通讯录-财政局'],
         ];
-
+            //业主一
         $list = Db::name('AdminRule')->whereOr($where)->field('id,name')->select()->toArray();
-        $group_id = Db::name('AdminGroupAccess')->where('uid', get_login_admin('id'))->value('group_id');
+        $group_id = Db::name('AdminGroupAccess')->where('uid', get_login_admin('id'))->value('group_id');//167
         $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules');
         $login_rules = explode(',', $login_rules);
         $rules_id = array();
@@ -912,4 +1156,96 @@ class Index extends BaseController
         return $rules_id;
     }
 
+    public function getHomeFive_proprietor()
+    {
+        $where = [
+            ['name', '=', '待审核任务-业主'],
+            ['name', '=', '临期项目-业主'],
+            ['name', '=', '逾期项目-业主'],
+            ['name', '=', '项目列表-业主'],
+            ['name', '=', '通讯录-业主'],
+        ];
+        // 业主一
+        $list = Db::name('AdminRule')->whereOr($where)->field('id,name')->select()->toArray();
+        $group_id = Db::name('AdminGroupAccess')->where('uid', get_login_admin('id'))->value('group_id');//权限组 id167
+        $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules');
+        $login_rules = explode(',', $login_rules);
+        $rules_id = array();
+
+        try {
+            foreach ($list as $key => $value) {
+                if ($value['name'] == "待审核任务-业主") {
+                    if (in_array($value['id'], $login_rules)) {
+                        $rules_id['audit_project'] = 1;
+                    } else {
+                        $rules_id['audit_project'] = 0;
+                    }
+                } else if ($value['name'] == "临期项目-业主") {
+                    if (in_array($value['id'], $login_rules)) {
+                        $rules_id['imminent_project'] = 1;
+                    } else {
+                        $rules_id['imminent_project'] = 0;
+                    }
+                } else if ($value['name'] == "逾期项目-业主") {
+                    if (in_array($value['id'], $login_rules)) {
+                        $rules_id['overdue_item'] = 1;
+                    } else {
+                        $rules_id['overdue_item'] = 0;
+                    }
+                } else if ($value['name'] == "项目列表-业主") {
+                    if (in_array($value['id'], $login_rules)) {
+                        $rules_id['list_project'] = 1;
+                    } else {
+                        $rules_id['list_project'] = 0;
+                    }
+                } else if ($value['name'] == "通讯录-业主") {
+                    if (in_array($value['id'], $login_rules)) {
+                        $rules_id['address_book'] = 1;
+                    } else {
+                        $rules_id['address_book'] = 0;
+                    }
+                }
+            }
+        } catch (\Exception $e) {
+            // 在这里处理异常,可以输出错误信息或者进行其他错误处理操作
+            echo "发生异常:". $e->getMessage();
+        }
+
+        return $rules_id;
+    }
+
+    public function proprietor_caiping()//业主附属财评,在财评端显示
+    {
+        $admin_unit_name =get_login_admin("unit_name");
+        $proprietor_department = Db::name("department")->where([
+            ["delete_time", "=", 0],
+            ["pid", "=", 0],
+            ["type", "=", 1], //1表示业主
+            ["entrust_unit", "=",  $admin_unit_name] // 确保只获取当前财评所属单位关联的业主单位
+        ])->field('id')->select();
+        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
+        $proprietor_list = Db::name("admin")->where("unit_name","$proprietor_department")->field('id,nickname,mobile,unit_name,')->order("id desc")->paginate($rows, false)
+        ->each(function ($item){
+
+        });
+        //$proprietor_list = Db::name("admin")->where("unit_name",$proprietor_department)->find();
+        //dump($proprietor_list);
+        View::assign("admin_unit_name","$admin_unit_name");
+        View::assign("proprietor_department","$proprietor_department");
+        View::assign("proprietor_list","$proprietor_list");
+        return View();
+    }
+
+    //财评添加业主部门
+    public function add_proprietor_department(){
+        if (request()->isAjax()) {
+            $param = get_params();
+            $admin = get_login_admin();
+            //找到业主部门
+
+        }else{//添加页面需要的
+
+        }
+    }
+
 }

+ 2 - 1
app/admin/controller/project/Api.php

@@ -548,7 +548,8 @@ class Api extends BaseController
 
         return table_assign(0, '', $file_array);
     }
-    
+
+    //
     
 
 }

+ 43 - 1
app/admin/controller/project/Audit.php

@@ -183,7 +183,7 @@ class Audit extends BaseController
     }
 
     /**
-     * 首页待审核列表
+     * 财评首页待审核列表
      */
     public function list()
     {
@@ -223,6 +223,47 @@ class Audit extends BaseController
         }
     }
 
+    /**
+     * 业主首页待审核列表
+     */
+    public function proprietor_list()
+    {
+        if (request()->isAjax()) {
+            $param = get_params();
+
+            $where = [
+                ["cp_project_audit.approver", "=", $this->uid],
+                ["cp_project_audit.audit_type", "<", 4],
+                ["cp_project_audit.audit_status", "=", 1],
+            ];
+            if(!empty($param["keywords"])){
+                $where[] = ["c.review_unit_name|c.engineering_type|a.project_name","like","%".$param["keywords"]."%"];
+            }
+            $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+            $order = empty($param['order']) ? 'id desc' : $param['order'];
+
+            $list2 = $this->Auditmodel->alias('a')->join("cost_project c", "a.project_id=c.id", 'left')
+                ->field("a.*,c.project_status,c.sent_review_amount,c.engineering_type,c.review_unit_name")->where($where)->order($order)
+                ->paginate($rows, false, ['query' => $param])
+                ->each(function ($item) {
+                    if ($item->audit_type == 2) {
+                        $a = Db::name("project_report")->where("id", $item->else_id)->field("title,status")->find();
+                        $item->else_name = $a["title"];
+                        $item->else_status = $a["status"];
+                    } elseif ($item->audit_type == 3) {
+                        $a = Db::name("contact")->where("id", $item->else_id)->field("title,status")->find();
+                        $item->else_name = $a["title"];
+                        $item->else_status = $a["status"];
+                    }
+                });
+
+
+            return table_assign(0, '', $list2);
+        } else {
+            return view();
+        }
+    }
+
     /**
      * 项目日志
      */
@@ -315,6 +356,7 @@ class Audit extends BaseController
         }
     }
 
+
     /**
      * 公司查看信息
      */

+ 0 - 22
app/admin/controller/project/Cost.php

@@ -1391,28 +1391,6 @@ class Cost extends BaseController
         return $rules_id;
     }
 
-
-//    public function getIntitutions()//获取当前财评关联的业主列表
-//    {
-//        // 获取当前登录用户所属单位名称
-//        $unit_Name = get_login_admin('unit_name');
-//
-//        // 查询满足条件的业主列表
-//        $Intitutions = $this->department->where([
-//            ["delete_time", "=", 0],
-//            ["pid", "=", 0],
-//            ["type", "=", 1], //1表示业主
-//            //entrust_unit委托的单位
-//            ["entrust_unit", "=", $unit_Name] // 确保只获取当前财评所属单位关联的业主
-//        ])->field('id,title')->select();
-//
-//        return Intitutions;
-//
-//        // 在某个业务方法中
-////        $owners = $this->getOwners();
-////       / 对 $owners 数据进行进一步处理,例如传递给视图进行展示等
-////        View::assign('owners', $owners);
-//    }
     public function ceshi($id)
     {
         View::assign('detailId', $id);

+ 13 - 4
app/admin/view/index/main.html

@@ -962,8 +962,19 @@
                             }, 1000)
                         }
 
-
-                        if (data.audit_type == 1) {
+                        if (data.audit_type == 0) {
+                            if (data.project_status == 2) {
+                                //立项
+                                tool.post("/admin/project.audit/project_edit_first2", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                }, callback);
+                            }
+                        }
+                         else if (data.audit_type == 1) {
                             if (data.project_status == 2) {
                                 //立项审批
                                 tool.post("/admin/project.audit/project_edit_first", {
@@ -1111,7 +1122,6 @@
                             if (data.project_status == 2) {
                                 //立项
 
-
                                 tool.post("/admin/project.audit/project_overrule_first", {
                                     id: data.id,
                                     else_id: data.else_id,
@@ -1122,7 +1132,6 @@
 
                                 }, callback);
 
-
                             } else if (data.project_status == 6) {
                                 //归档
 

+ 1921 - 11
app/admin/view/index/main_proprietor.html

@@ -1,11 +1,1921 @@
-<!doctype html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>业主</title>
-</head>
-<body>
-<h1>业主主页</h1>
-</body>
-</html>
+{extend name="common/base"/}
+{block name="style"}
+<link rel="stylesheet" href="{__GOUGU__}/icon-main/iconfont.css">
+<!--<link rel="stylesheet" href="../../../../public/static/assets/icons/main-icon/iconfont.css">-->
+<style type="text/css">
+    .footer{
+        width: 100%;
+        height: 25px;
+        text-align: center;
+        margin-bottom: 0 !important;
+    }
+
+    .dashboard-num table {
+        width: 100%;
+    }
+
+    .dashboard-num td {
+        text-align: center;
+        padding: 16px 0;
+        width: 20%;
+        border-left: 1px solid #f1f1f1;
+        position: relative;
+    }
+
+    .dashboard-num td:nth-child(1) {
+        border-left: none
+    }
+
+    .dashboard-num .num-title {
+        padding-bottom: 10px;
+        color: #999;
+    }
+
+    .dashboard-num .blue {
+        font-size: 20px;
+        font-weight: 300;
+    }
+
+    .dashboard-num td .badge {
+        position: absolute;
+        top: 0;
+        right: 0;
+    }
+
+    .dashboard-num td .badge span {
+        padding: 2px 4px;
+        font-size: 12px;
+        border-radius: 0 0 0 4px;
+    }
+
+    .dashboard-total td {
+        border-top: 1px solid #f1f1f1
+    }
+
+    .dashboard-logs .layui-timeline-item {
+        padding-bottom: 1px;
+    }
+
+    .info-td {
+        width: 90px;
+        text-align: right;
+        background-color: #fafafa;
+        color: #999;
+        padding: 5px 3px;
+    }
+
+    .info-td {
+        width: 90px;
+        text-align: right;
+        background-color: #fafafa;
+        color: #999;
+        padding: 5px 3px;
+    }
+
+    .layui-card-body .layui-timeline-title {
+        padding-bottom: 0;
+        font-size: 14px;
+    }
+
+    .layui-card-body .layui-timeline-item {
+        padding-bottom: 5px;
+    }
+
+    .top-box {
+        height: 30%;
+
+    }
+
+    .top-title {
+        height: 4.5vh;
+        font-size: 1vw;
+        line-height: 4.5vh;
+        color: grey;
+        border-bottom: 1px solid rgb(221, 219, 219);
+
+    }
+
+    .top-box-middle {
+        height: 16vh;
+        /* background: url({__IMG__}/base.png) no-repeat;
+        background-size: 70% 70%;
+        background-position: 50% 85%; */
+
+    }
+
+    .top-box-bottom {
+        height: 13.5vh;
+        font-size: 1vw;
+
+    }
+
+    .top-box-bottom-1,
+    .top-box-bottom-1 a {
+        float: left;
+        width: 97%;
+    }
+
+    .top-box-bottom-2,
+    .top-box-bottom-2 a {
+        float: left;
+        width: 97%;
+    }
+
+    .sleep {
+        width: 100%;
+        height: 0.01vh;
+        border-bottom: 1px solid rgb(221, 219, 219);
+        float: left;
+        /* margin-top: -1vh;
+        left: -0.25vw; */
+        position: relative;
+        padding: 0;
+    }
+
+    .top-box-bottom-2 {
+        float: left;
+        height: 48px;
+    }
+
+    .bottom-box-left,
+    .bottom-box-right {
+        height: 64vh;
+
+    }
+
+    .heading {
+        background-color: #f1f1f1;
+    }
+
+    .heading th {
+        text-align: center;
+        height: 2.5vh;
+    }
+
+    .form td {
+        text-align: center;
+        height: 2.5vh;
+    }
+
+    .layui-tab .layui-tab-title li {
+
+        font-size: 0.7vw;
+    }
+
+    .layui-matter-item li a {
+        display: block;
+        padding: 12px;
+        background-color: #f8f8f8;
+        color: #999;
+        border-radius: 3px;
+        transition: all .3s;
+        -webkit-transition: all .3s;
+        font-size: 0.7vw;
+    }
+
+    .layui-matter-item li a:hover {
+        background-color: #F2F8FF;
+    }
+
+
+    .layui-matter-item li span {
+        float: right;
+    }
+
+    .layui-matter-item li cite {
+        font-size: 0.7vw;
+        font-weight: 300;
+        color: #187FDD;
+    }
+
+    .top-head {
+        width: 20%;
+    }
+
+    .middle-left {
+        width: 60%;
+    }
+
+    .middle-right {
+        width: 40%;
+    }
+
+    .top-box-middle-money {
+        width: 100%;
+        height: 15.2vh;
+        line-height: 14.5vh;
+        font-size: 2.1vw;
+        text-align: center;
+
+
+    }
+
+    .top-box-middle-money-left {
+        color: #1287ff;
+
+    }
+
+    .top-box-middle-money-right {
+        color: #999;
+        font-size: 0.9vw;
+
+    }
+
+    .top-box-middle-left {
+        background: url({__IMG__}/main-first.png) no-repeat;
+        background-size: 100% 85%;
+        background-position: 85% 50%;
+    }
+
+    .top-box-middle-left-2 {
+        background: url({__IMG__}/main-second.png) no-repeat;
+        background-size: 85% 70%;
+        background-position: 50% 50%;
+    }
+
+    .top-box-middle-left-3 {
+        background: url({__IMG__}/main-third.png) no-repeat;
+        background-size: 90% 70%;
+        background-position: 50% 50%;
+    }
+
+    .top-box-middle-left-4 {
+        background: url({__IMG__}/main-fourth.png) no-repeat;
+        background-size: 80% 65%;
+        background-position: 50% 50%;
+    }
+
+    /* 项目数量模块 */
+    .number-box-top {
+        width: 100%;
+        height: 13.6vh;
+        display: flex;
+        justify-content: space-around;
+    }
+
+    .number-box-bottom {
+        width: 100%;
+        height: 13.6vh;
+        display: flex;
+        justify-content: space-around;
+    }
+
+    .number {
+        width: 33%;
+        height: 100%;
+        border-left: 1px solid #e2e2e2;
+        border-bottom: 1px solid #e2e2e2;
+    }
+
+    .number-1 {
+        height: 4.55vh;
+        text-align: center;
+        padding-top: 2.8vh;
+        font-size: 0.85vw;
+        font-weight: 550;
+        color: grey;
+    }
+
+    .number-2 {
+
+        text-align: center;
+        color: #1287ff;
+        font-size: 1.25vw;
+    }
+
+    .ing {
+        color: #999;
+        font-size: 0.65vw;
+        margin-top: -0.5vh;
+    }
+
+    .number-2 span {
+        color: #999;
+        font-size: 0.8vw;
+    }
+
+    .button-search {
+        margin-left: 1vw;
+    }
+
+    #test2 {
+        width: 100%;
+        height: 32vh;
+    }
+
+    #test2 .layui-laydate-main {
+        width: 100%;
+    }
+
+    #test2 .layui-laydate-content td {
+        height: 3.645vh;
+    }
+
+    #test2 .layui-laydate-content th {
+        width: 1%;
+        padding: 7px 0;
+    }
+
+    .layui-laydate-content td>div{
+        height: auto;
+    }
+
+    #test2 #layui-laydate1 .layui-laydate-header {
+        background-color: #fff;
+        border-bottom: 1px solid #e2e2e2;
+        height: 4.6vh;
+        font-size: 0.85vw;
+        line-height: 2.5vh;
+    }
+
+    #test2 .laydate-theme-molv .layui-laydate-header i,
+    .laydate-theme-molv .layui-laydate-header span {
+        color: #2c2727b7;
+    }
+
+    #test2 .laydate-theme-molv .layui-laydate-header i, .laydate-theme-molv .layui-laydate-header span {
+        color: grey !important;
+        font-weight: 600;
+    }
+
+    #test2 .laydate-theme-molv .layui-laydate-footer {
+        border: none;
+    }
+
+    #test2 .laydate-theme-molv .layui-laydate-content {
+        border: none;
+        border-top: none;
+        border-bottom: 1px solid #e2e2e2;
+        height: 27.2vh;
+    }
+
+    #test2 .laydate-theme-molv .layui-laydate-header i,
+    .laydate-theme-molv .layui-laydate-header span {
+        padding-left: 0;
+    }
+
+    .layui-laydate-content td, .layui-laydate-content th {
+        height: 21px;
+    }
+
+    /* .layui-laydate-content td>div {
+        height: 0.3vh;
+    }
+
+    .layui-laydate-content th {
+        height: 0.25vh;
+    } */
+
+    .laydate-theme-molv {
+        width: 100%;
+    }
+
+    .main-input {
+        width: auto;
+    }
+
+    .main-input-name {
+        display: flex;
+    }
+
+    .layui-form-label {
+        padding: 9px 0;
+        position: relative;
+        display: block;
+        text-align: left;
+        width: 80px;
+        font-weight: 400;
+        line-height: 20px;
+    }
+
+    .eleven div{
+        padding-bottom: 6px;
+    }
+
+    #test2 .layui-laydate, .layui-laydate-hint{
+        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
+    }
+</style>
+{/block}
+<!-- 主体 -->
+{block name="body"}
+<div class="p-3">
+    <div class="layui-row layui-col-space12">
+        <div class="layui-col-md2 top-head">
+            <div class="layui-card top-box">
+                <div class="layui-card-header top-title"><span
+                        style="font-size: 0.85vw;font-weight: 600;">送审总额</span>
+                </div>
+                <div class="layui-card-body">
+                    <div class="layui-sales-info top-box-middle">
+                        <div class="top-box-middle-left" style="width: 37.5%;height: 95%;float: left;">
+
+                        </div>
+                        <div class="top-box-middle-right" style="width: 62.5%;height: 95%;float: left;">
+                            <div class="top-box-middle-money">
+                                <span class="top-box-middle-money-left">{$amount.sent_review_amount}</span>
+                                <span class="top-box-middle-money-right">万元</span>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="layui-sales-info top-box-bt" style="height: 10.5vh;width: auto;margin-bottom: -0.8vh;">
+                        <ul class="layui-row layui-col-space12">
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;预算总额&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">万元&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+
+                                    style="float: right;color: #187FDD;">{$sent_review_amount_tol.sent_review_amount_type1}&nbsp;</span>
+                            </li>
+
+
+                            <div class="sleep"></div>
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;结算总额&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">万元&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+
+                                    style="float: right;color: #187FDD;">{$sent_review_amount_tol.sent_review_amount_type2}&nbsp;</span>
+                            </li>
+
+                        </ul>
+                    </div>
+
+
+                </div>
+            </div>
+        </div>
+
+        <div class="layui-col-md2 top-head">
+            <div class="layui-card top-box">
+                <div class="layui-card-header top-title"><span
+                        style="font-size: 0.85vw;font-weight: 600;">评审服务费</span>
+                </div>
+                <div class="layui-card-body">
+
+                    <div class="layui-sales-info top-box-middle">
+                        <div class="top-box-middle-left-2" style="width: 37.5%;height: 95%;float: left;">
+
+                        </div>
+                        <div class="top-box-middle-right" style="width: 62.5%;height: 95%;float: left;">
+                            <p class="top-box-middle-money">
+                                <span class="top-box-middle-money-left">{$amount.sent_review_cost}</span>
+                                <span class="top-box-middle-money-right">万元</span>
+                            </p>
+                        </div>
+                    </div>
+                    <div class="layui-sales-info top-box-bt" style="height: 10.5vh;width: auto;margin-bottom: -0.8vh;">
+                        <ul class="layui-row layui-col-space12">
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;<span id="time1"></span>年上半年服务费用&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">万元&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+                                    style="float: right;color: #187FDD;">{$sent_review_cost.first_sent_review_cost}&nbsp;</span>
+                            </li>
+                            <div class="sleep"></div>
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;<span id="time2"></span>年下半年服务费用&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">万元&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+                                    style="float: right;color: #187FDD;">{$sent_review_cost.second_sent_review_cost}&nbsp;</span>
+                            </li>
+                        </ul>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+
+
+        <div class="layui-col-md2 top-head">
+            <div class="layui-card top-box">
+                <div class="layui-card-header top-title"><span
+                        style="font-size: 0.85vw;font-weight: 600;">总审增减率</span>
+                </div>
+                <div class="layui-card-body">
+
+                    <div class="layui-sales-info top-box-middle">
+                        <div class="top-box-middle-left-3" style="width: 37.5%;height: 95%;float: left;">
+
+                        </div>
+                        <div class="top-box-middle-right" style="width: 62.5%;height: 95%;float: left;">
+                            <p class="top-box-middle-money">
+                                <span class="top-box-middle-money-left">{$amount.review_add_reduce_rate}</span>
+                                <span class="top-box-middle-money-right">%</span>
+                            </p>
+                        </div>
+                    </div>
+                    <div class="layui-sales-info top-box-bt" style="height: 10.5vh;width: auto;margin-bottom: -0.8vh;">
+                        <ul class="layui-row layui-col-space12">
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;预算核增减率&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">%&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+
+                                    style="float: right;color: #187FDD;">{$sent_review_amount_tol.review_add_reduce_rate_type1}&nbsp;</span>
+                            </li>
+
+                            <div class="sleep"></div>
+                            <li class="layui-col-md12"
+                                style="height: 5.2vh;line-height: 5.2vh;font-size: 0.8vw;padding: 0;background-color: #f9faff;color: rgb(154,153,155);">
+                                &nbsp;&nbsp;&nbsp;&nbsp;结算核增减率&nbsp;&nbsp;&nbsp;<span
+                                    style="float: right;">%&nbsp;&nbsp;&nbsp;&nbsp;</span><span
+                                    style="float: right;color: #187FDD;">{$sent_review_amount_tol.review_add_reduce_rate_type2}&nbsp;</span>
+                            </li>
+
+
+                        </ul>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+
+
+        <div class="layui-col-md2 top-head">
+            <div class="layui-card top-box">
+                <div class="layui-card-header top-title"><span
+                        style="font-size: 0.85vw;font-weight: 600;">项目数量</span>
+                </div>
+                <div class="layui-card-body" style="padding: 0;">
+
+                    <div class="number-box-top">
+                        <div class="number" style="border-left:none">
+                            <div class="number-1"><i class="iconfont" style="color: rgb(83,150,255);">&#xe67e; </i>项目总数
+                            </div>
+                            <div class="number-2">{$num_project.num} <span>个</span></div>
+                        </div>
+                        <div class="number">
+                            <div class="number-1">
+                                <i class="iconfont" style="color: rgb(242,173,76);">&#xe6eb; </i>
+                                预算项目
+                                <div class="ing">(进行中)</div>
+                            </div>
+                            <div class="number-2">{$num_project.yu} <span>个</span></div>
+                        </div>
+                        <div class="number">
+                            <div class="number-1">
+                                <i class="iconfont" style="color: rgb(38,131,245);">&#xe75e; </i>
+                                结算项目
+                                <div class="ing">(进行中)</div>
+                            </div>
+                            <div class="number-2">{$num_project.jie} <span>个</span></div>
+                        </div>
+                    </div>
+                    <div class="number-box-bottom">
+                        <div class="number" style="border-left:none;border-bottom: none;">
+                            <div class="number-1"><i class="iconfont" style="color: rgb(81,161,255);">&#xe504; </i>作业中
+                            </div>
+                            <div class="number-2">{$num_project.zuo} <span>个</span></div>
+                        </div>
+                        <div class="number" style="border-bottom: none;">
+                            <div class="number-1"><i class="iconfont" style="color: rgb(0,221,3);">&#xe622; </i>已归档
+                            </div>
+                            <div class="number-2">{$num_project.gui} <span>个</span></div>
+                        </div>
+                        <div class="number" style="border-bottom: none;">
+                            <div class="number-1"><i class="iconfont" style="color: rgb(232,82,74);">&#xe6b8;</i>已退审
+                            </div>
+                            <div class="number-2">{$num_project.tui} <span>个</span></div>
+                        </div>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+
+        <div class="layui-col-md2 top-head">
+            <div id="test2" style="width: 100%;height: 32vh;"></div>
+        </div>
+
+
+    </div>
+<!--    这里下面没有了-->
+    <div class="layui-row layui-col-space12">
+        {if $home_five.audit_project == 1}
+        <div class="layui-col-md5 middle-left">
+            <div class="layui-card">
+                <div class="layui-card-body bottom-box-left" style="padding-top: 0;overflow: hidden;">
+                    <div class="layui-tab layui-tab-brief" style="height: 88%;">
+                        <ul class="layui-tab-title" style="font-size: 1vw; font-weight: 600;">
+                            <li class="layui-this" style="font-size: 0.95vw;">
+                                待审核任务
+                            </li>
+
+                        </ul>
+                        <div class="layui-tab-content" style="height: 100%; overflow: scroll;">
+                            <table class="layui-hide" id="cost_project" lay-filter="cost_project"></table>
+                        </div>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+        {/if}
+
+        {if $home_five.imminent_project == 1 || $home_five.overdue_item == 1}
+        <div class="layui-col-md4 middle-right">
+            <div class="layui-card">
+                <div class="layui-card-body bottom-box-left" style="padding-top: 0;overflow: hidden;">
+                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"
+                         style="height: 63.75vh; /* 容器高度 */overflow: hidden;">
+                        <ul class="layui-tab-title" style="font-size: 1vw; font-weight: 600;color: grey;">
+                            {if $home_five.imminent_project == 1}
+                            <li class="layui-this" style="font-size: 0.95vw;">
+                                临期项目
+                            </li>
+                            {/if}
+
+                            {if $home_five.overdue_item == 1}
+                            <li style="font-size: 0.95vw;">
+                                逾期项目
+                            </li>
+                            {/if}
+                        </ul>
+                        <div class="layui-tab-content" style="height: 100%; overflow: scroll;">
+                            {if $home_five.imminent_project == 1}
+                            <div class="layui-tab-item layui-show">
+                                <table class="layui-hide" id="advent_project" lay-filter="advent_project"></table>
+                            </div>
+                            {/if}
+
+                            {if $home_five.overdue_item == 1}
+                            <div class="layui-tab-item">
+                                <table class="layui-hide" id="late_project" lay-filter="late_project"></table>
+                            </div>
+                            {/if}
+                            <div class="layui-tab-item"></div>
+                        </div>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+        {/if}
+
+        {if $home_five.list_project == 1}
+        <div class="layui-col-md3 middle-left">
+            <div class="layui-card">
+                <div class="layui-card-body bottom-box-left" style="padding-top: 0;overflow: hidden;">
+                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="height: 88%;">
+                        <div class="layui-card-header top-title" style="font-size: 0.95vw;font-weight: 600;">
+                            项目列表
+                        </div>
+
+                        <div class="layui-tab-content" style="height: 100%; overflow: scroll;padding: 0 0 10px 0;">
+                            <form id="projectForm" class="layui-form" lay-filter="barsearchform">
+                                <div class="layui-card-body layui-col-space11 eleven">
+                                    <div class="layui-col-md3 main-input-name" style="width: 40%;">
+                                        <label class="layui-form-label">
+                                            项目名称:
+                                        </label>
+                                        <div class="layui-input-block">
+                                            <input type="text" name="project_name" placeholder="请输入项目名称" autocomplete="off"
+                                                   class="layui-input main-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-md3 main-input-name" style="width: 35%;">
+                                        <label class="layui-form-label" style="text-align: center;">
+                                            负责人:
+                                        </label>
+                                        <div class="layui-input-block">
+                                            <input type="text" name="review_head_name" placeholder="请输入负责人" autocomplete="off"
+                                                   class="layui-input main-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-col-md3 main-input-name">
+                                        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="project-search"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
+                                        <button type="reset" class="layui-btn layui-btn-primary swiper-right-form-reset" lay-submit="" lay-filter="reset">重置</button>
+                                    </div>
+                                </div>
+                            </form>
+                            <div class="layui-tab-item layui-show">
+                                <table class="layui-hide" id="cost_project2" lay-filter="cost_project2"></table>
+                            </div>
+                        </div>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+        {/if}
+
+        {if $home_five.address_book == 1}
+        <div class="layui-col-md3 middle-right">
+            <div class="layui-card">
+                <div class="layui-card-body bottom-box-left" style="padding-top: 0;overflow: hidden;">
+                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
+                        <!-- <div class="layui-card-header top-title" style="font-size: 0.95vw;font-weight: 600;">
+                            通讯录
+                        </div> -->
+                        <ul class="layui-tab-title"
+                            style="font-size: 1vw; font-weight: 600;color: grey;display: flex;justify-content: flex-end;align-items: center;">
+                            <div style="left: 2%;position: absolute;">通讯录</div>
+                            <li class="layui-this" style="font-size: 0.95vw;">
+                                内部
+                            </li>
+                            <li style="font-size: 0.95vw;">
+                                外部
+                            </li>
+
+                        </ul>
+
+
+                        <div class="layui-tab-content" style="height: 100%; overflow: scroll;padding: 0 0 10px 0;">
+
+
+                            <div class="layui-tab-item layui-show">
+                                <form id="peopleForm" class="layui-form" lay-filter="barsearchform">
+                                    <div class="layui-card-body layui-col-space11 eleven">
+                                        <div class="layui-col-md5 main-input-name" style="width: 65%;">
+                                            <label class="layui-form-label" style="width: 7vw;">
+                                                联系人姓名:
+                                            </label>
+                                            <div class="layui-input-block">
+                                                <input type="text" name="nickname" placeholder="请输入联系人姓名" autocomplete="off" class="layui-input main-input">
+                                            </div>
+                                        </div>
+
+                                        <div class="layui-col-md2 main-input-name">
+                                            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
+                                            <button type="reset" class="layui-btn layui-btn-primary swiper-right-form-reset" lay-submit="" lay-filter="reset">重置</button>
+                                        </div>
+                                    </div>
+                                </form>
+                                <table class="layui-hide" id="people" lay-filter="people"></table>
+                            </div>
+                            <div class="layui-tab-item">
+                                <form id="peopleForm2" class="layui-form" lay-filter="barsearchform">
+                                    <div class="layui-card-body layui-col-space11 eleven">
+                                        <div class="layui-col-md5 main-input-name" style="width: 65%;">
+                                            <label class="layui-form-label" style="width: 7vw;">
+                                                联系人/单位名称:
+                                            </label>
+                                            <div class="layui-input-block">
+                                                <input type="text" name="nickname2" placeholder="请输入联系人/单位名称" autocomplete="off" class="layui-input main-input">
+                                            </div>
+                                        </div>
+
+                                        <div class="layui-col-md2 main-input-name">
+                                            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform2"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
+                                            <button type="reset" class="layui-btn layui-btn-primary swiper-right-form-reset" lay-submit="" lay-filter="reset">重置</button>
+                                        </div>
+                                    </div>
+                                </form>
+                                <table class="layui-hide" id="head" lay-filter="head"></table>
+                            </div>
+                        </div>
+
+
+                    </div>
+
+                </div>
+            </div>
+        </div>
+        {/if}
+
+    </div>
+</div>
+
+<div class="layui-col-md4">
+
+
+</div>
+
+{/block}
+<!-- /主体 -->
+
+<!-- 脚本 -->
+{block name="script"}
+<script src="https://cdn.staticfile.org/echarts/5.3.0/echarts.min.js"></script>
+<script>
+    //console.log($home_five);
+    const moduleInit = ['tool'];
+
+    function gouguInit() {
+        var table = layui.table,
+            tool = layui.tool,
+            form = layui.form;
+
+        var allcount;
+
+        //审核表格
+        layui.pageTable = table.render({
+            elem: '#cost_project',
+            title: '待审核任务',
+            // toolbar: '#toolbarDemo',
+            url: '/admin/project.audit/proprietor_list',
+            page: false,
+            limit: 20,
+            cellMinWidth: 80,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+            cols: [
+                [
+                    {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                        templet: function(d){
+                            return allcount - (d.LAY_NUM-1);
+                        }
+                    }, {
+                    field: 'project_status',
+                    title: '项目状态',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+
+                        var html = '';
+                        if (item.project_status === 2) {
+                            html = '<span class="layui-badge layui-bg-blue">审批中</span> ';
+                        } else if (item.project_status === 6) {
+                            html = '<span class="layui-badge layui-bg-blue">归档中</span> ';
+                        } else if (item.project_status === 7) {
+                            html = '<span class="layui-badge layui-bg-blue">退审中</span> ';
+                        } else if (item.project_status === 5) {
+                            html = '<span class="layui-badge layui-bg-blue">作业中</span> ';
+                        }
+                        return html;
+                    }
+                }, {
+                    field: 'audit_status',
+                    title: '审批状态',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+
+                        var html = '';
+                        if (item.audit_status === 1) {
+                            html = '<span class="layui-badge layui-bg-blue">待审核</span> ';
+                        } else if (item.audit_status === 2) {
+                            html = '<span class="layui-badge layui-bg-green">已通过</span> ';
+                        } else if (item.audit_status === 3) {
+                            html = '<span class="layui-badge layui-bg-red">已拒绝</span> ';
+                        }
+                        return html;
+                    }
+                }, {
+                    field: 'project_name',
+                    title: '项目名称',
+                    align: 'center',
+                    width: 400
+                }, {
+                    field: 'project_type',
+                    title: '项目类型',
+                    align: 'center',
+                    width: 100
+                }, {
+                    field: 'audit_name',
+                    title: '流程名称',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'sponsor',
+                    title: '发起人',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'sponsor_unit',
+                    title: '发起单位/部门',
+                    align: 'center',
+                    width: 200
+                }, {
+                    field: 'create_time',
+                    title: '发起时间',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'approver_name',
+                    title: '审批人',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'update_time',
+                    title: '审批时间',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'remark',
+                    title: '审批原因',
+                    align: 'center',
+                    width: 150
+                }, {
+                    fixed: 'right',
+                    field: 'right',
+                    title: '操作',
+
+                    width: 136,
+                    align: 'center',
+                    templet: function (item) {
+                        var h = '';
+                        if (item.audit_status === 1) {
+
+                            h = '<div class="layui-btn-group"> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a> <a class="layui-btn layui-btn-xs" lay-event="edit">通过</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="overrule">拒绝</a> </div>'
+
+                        } else {
+                            h = '<div class="layui-btn-group"> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a></div>'
+                        }
+                        return h;
+                    }
+                }]
+            ]
+        });
+        var abc = 0;
+        ////审核表格 监听表格行工具事件
+        table.on('tool(cost_project)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+
+                if (data.audit_type == 1) {
+                    tool.side('/admin/project.audit/read?id=' + data.project_id);
+                } else if (data.audit_type == 2) {
+
+                    tool.side('/admin/project.report/view_proprietor?id=' + data.else_id);
+                } else if (data.audit_type == 3) {
+
+                    tool.side(' /admin/project.contact/view?id=' + data.else_id);
+                }else {
+                    layer.msg("审核内容不存在!")
+                }
+
+
+                // console.log(obj.data.getTrusteeName.institution)
+                tool.side('/admin/project.audit/read?id=' + obj.data.project_id);
+            } else if (obj.event === 'edit') {
+                layer.confirm("确认是否审批通过?", function (index) {
+                    console.log(data)
+                    if (abc == 0) {
+
+                        let callback = function (e) {
+
+                            abc = 0
+                            layer.msg(e.msg);
+
+
+                            setTimeout(function () {
+                                window.location.reload()
+                                layer.close(index);
+                            }, 1000)
+                        }
+
+                        if (data.audit_type == 0) {
+                            //立项审批
+                            if (data.project_status == 0) {//业主端
+                                tool.post("/admin/project.audit/proprietor_agree", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                }, callback);
+                            }
+                        }
+                        else if (data.audit_type == 1) {
+                            if (data.project_status == 0) {//业主端
+                                //立项审批
+                                tool.post("/admin/project.audit/proprietor_agree2", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                }, callback);
+                            } else if (data.project_status == 6) {
+
+                                tool.post("/admin/project.audit/project_edit_second", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+
+
+                                }, callback);
+
+
+                            } else if (data.project_status == 7) {
+                                //退审审批
+
+                                tool.post("/admin/project.audit/project_edit_third", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+
+                                }, callback);
+
+
+                            }
+                        } else if (data.audit_type == 2) {
+                            if (data.else_status == 0) {
+                                //报告新建
+
+                                console.log(1)
+                                tool.post("/admin/project.report/proprietor_agree_report", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            } else if (data.else_status == 3) {
+                                //报告删除
+
+                                tool.post("/admin/project.report/proprietor_agree_delete", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            }
+                        } else if (data.audit_type == 3) {
+                            if (data.else_status == 0) {
+                                //联系函新建
+
+
+                                tool.post("/admin/project.contact/agree_contact", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            } else if (data.else_status == 3) {
+                                //联系函删除
+
+
+                                tool.post("/admin/project.contact/agree_delete", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            }
+                        }else{
+                            layer.msg("请联系管理员")
+                        }
+                        // console.log(abc, data.else_status)
+                        abc = 1;
+                    }
+                }, function () {
+
+                    abc = 0;
+                })
+            } else if (obj.event === 'overrule') {
+                layer.prompt({
+                    title: '请输入<span style="color: red">拒绝</span>原因',
+                    formType: 2,
+                    area: ['35vw', '15vw']
+                }, function (text, index) {
+
+
+                    if (text == '') {
+                        layer.msg('请先完善拒绝原因');
+                        return false;
+                    } else {
+                        let callback = function (e) {
+
+                            layer.msg(e.msg);
+                            listount--;
+                            if (listount == 0) {
+                                parent.showhongdian()
+                            }
+                            setTimeout(function () {
+                                window.location.reload()
+                                layer.close(index);
+                            }, 2000)
+
+
+                        }
+
+
+                        if (data.audit_type == 1) {
+                            if (data.project_status == 2) {
+                                //立项
+
+
+                                tool.post("/admin/project.audit/project_overrule_first", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+
+                                }, callback);
+
+
+                            } else if (data.project_status == 6) {
+                                //归档
+
+
+                                tool.post("/admin/project.audit/project_overrule_second", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+
+
+                                }, callback);
+
+
+                            } else if (data.project_status == 7) {
+                                //退审
+
+
+                                tool.post("/admin/project.audit/project_overrule_third", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+
+
+                                }, callback);
+
+
+                            }
+                        } else if (data.audit_type == 2) {
+                            if (data.else_status == 1) {
+                                //报告新建
+
+
+                                tool.post("/admin/project.report/proprietor_un_report", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+                                    type: 1000,
+
+                                }, callback);
+
+
+                            } else if (data.else_status == 4) {
+                                //报告删除
+
+
+                                tool.post("/admin/project.report/proprietor_un_delete", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            }
+
+                        } else if (data.audit_type == 3) {
+                            if (data.else_status == 0) {
+                                //联系函新建
+
+
+                                tool.post("/admin/project.contact/un_contact", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            } else if (data.else_status == 3) {
+                                //联系函删除
+
+
+                                tool.post("/admin/project.contact/un_delete", {
+                                    id: data.id,
+                                    else_id: data.else_id,
+                                    audit_type: data.audit_type,
+                                    project_id: data.project_id,
+                                    project_status: data.project_status,
+                                    audit_remark: text,
+                                    type: 1000,
+
+
+                                }, callback);
+
+
+                            }
+
+                        }
+                        else{
+                            layer.msg("请联系管理员")
+                        }
+
+                    }
+
+
+                })
+            }
+            return false;
+        });
+
+        //临期表格
+        layui.pageTable = table.render({
+            elem: '#advent_project',
+            title: '临期项目',
+
+            url: '/admin/project.cost_proprietor/list',
+            page: false,
+            limit: 20,
+            cellMinWidth: 80,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+
+            cols: [
+                [
+                    {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                        templet: function(d){
+                            return allcount - (d.LAY_NUM-1);
+                        }
+                    }, {
+                    field: 'project_status',
+                    title: '项目状态',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+
+                        var html = '';
+                        if (item.project_status === 1) {
+                            html = '<span class="layui-badge layui-bg-orange">立项中</span> ';
+                        } else if (item.project_status === 2) {
+                            html = '<span class="layui-badge layui-bg-blue">审批中</span> ';
+                        } else if (item.project_status === -1) {
+                            html = '<span class="layui-badge layui-bg-red">待修改</span> ';
+                        } else if (item.project_status === 3) {
+                            html = '<span class="layui-badge layui-bg-green">待接收</span> ';
+                        } else if (item.project_status === 4) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">分配中</span> ';
+                        } else if (item.project_status === 5) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">作业中</span> ';
+                        } else if (item.project_status === 6) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">归档中</span> ';
+                        } else if (item.project_status === 7) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">退审中</span> ';
+                        } else if (item.project_status === 8) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">已归档</span> ';
+                        } else if (item.project_status === 9) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">已退审</span> ';
+                        }
+                        return html;
+                    }
+                }, {
+                    field: 'project_name',
+                    title: '项目名称',
+                    align: 'center',
+
+                }, {
+                    field: 'project_num',
+                    title: '项目编号',
+                    align: 'center',
+
+                }, {
+                    field: 'project_time',
+                    title: '剩余时间',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+                        let outcome = Math.round(new Date().getTime() / 1000).toString();
+                        var advent_time = item.project_end_time - outcome
+                        // console.log(advent_time);
+
+                        function getDuration(second) {
+                            var duration
+                            var days = Math.floor(second / 86400);
+                            var hours = Math.floor((second % 86400) / 3600);
+                            var minutes = Math.floor(((second % 86400) % 3600) / 60);
+                            var seconds = Math.floor(((second % 86400) % 3600) % 60);
+                            if (days > 0) duration = days + "天";
+                            else if (hours > 0) duration = hours + "小时";
+                            else if (minutes > 0) duration = minutes + "分";
+                            else if (seconds > 0) duration = seconds + "秒";
+                            return duration;
+                        }
+
+                        return getDuration(advent_time);
+                    }
+                },
+                    {
+                        fixed: 'right',
+                        field: 'right',
+                        title: '操作',
+
+                        width: 136,
+                        align: 'center',
+                        templet: function (a) {
+                            var h = '';
+                            var arr = [3, 4, 5];
+                            if (a.self_id == a.entrust_maker) {
+                                if (a.project_status == 1) {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
+                                } else if (arr.indexOf(a.project_status) !== -1) {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
+
+                                } else {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><div'
+
+                                }
+                            } else {
+
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><div'
+                            }
+                            return h;
+                        }
+                    }
+                ]
+            ]
+        });
+
+        //临期表格监听表格行工具事件
+        table.on('tool(advent_project)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+                tool.side('/admin/project.cost_proprietor/read?id=' + obj.data.id);
+            } else if (obj.event === 'edit') {
+
+
+                tool.side('/admin/project.cost_proprietor/edit?id=' + obj.data.id);
+
+
+            } else if (obj.event === 'del') {
+                layer.confirm('确定要删除该记录吗?', {
+                    icon: 3,
+                    title: '提示'
+                }, function (index) {
+
+
+                    if (data.project_status < 3) {
+                        let callback = function (e) {
+                            layer.msg(e.msg);
+                            if (e.code == 0) {
+                                obj.del();
+                            }
+                        }
+                        tool.delete("/admin/project.cost_proprietor/del", {
+                            id: data.id
+                        }, callback);
+                        layer.close(index);
+                    }
+                    layer.msg("已审核,无法删除");
+                });
+            }
+            return false;
+        });
+
+        //逾期表格
+        layui.pageTable = table.render({
+            elem: '#late_project',
+            title: '逾期项目',
+            url: '/admin/project.cost_proprietor/list2',
+            page: false,
+            limit: 20,
+            cellMinWidth: 80,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+            cols: [
+                [
+                    {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                        templet: function(d){
+                            return allcount - (d.LAY_NUM-1);
+                        }
+                    }, {
+                    field: 'project_status',
+                    title: '项目状态',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+
+                        var html = '';
+                        if (item.project_status === 1) {
+                            html = '<span class="layui-badge layui-bg-orange">立项中</span> ';
+                        } else if (item.project_status === 2) {
+                            html = '<span class="layui-badge layui-bg-blue">审批中</span> ';
+                        } else if (item.project_status === -1) {
+                            html = '<span class="layui-badge layui-bg-red">待修改</span> ';
+                        } else if (item.project_status === 3) {
+                            html = '<span class="layui-badge layui-bg-green">待接收</span> ';
+                        } else if (item.project_status === 4) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">分配中</span> ';
+                        } else if (item.project_status === 5) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">作业中</span> ';
+                        } else if (item.project_status === 6) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">归档中</span> ';
+                        } else if (item.project_status === 7) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">退审中</span> ';
+                        } else if (item.project_status === 8) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">已归档</span> ';
+                        } else if (item.project_status === 9) {
+                            html =
+                                '<span class="layui-badge" style="background-color: #31bdec">已退审</span> ';
+                        }
+                        return html;
+                    }
+                }, {
+                    field: 'project_name',
+                    title: '项目名称',
+                    align: 'center',
+
+                }, {
+                    field: 'project_num',
+                    title: '项目编号',
+                    align: 'center',
+
+                }, {
+                    field: 'project_time',
+                    title: '逾期时间',
+                    align: 'center',
+                    width: 100,
+                    templet: function (item) {
+                        let outcome = Math.round(new Date().getTime() / 1000).toString();
+                        var advent_time = item.project_end_time - outcome
+                        var time = getDuration(advent_time);
+                        var timestr = "<span style='color: green'>" + "剩余" + time + "</span>";
+                        if (advent_time < 0) {
+                            advent_time = -advent_time;
+                            time = getDuration(advent_time);
+                            timestr = "<span style='color: red'>" + "逾期" + time + "</span>";
+                        }
+
+                        var html;
+
+                        html =
+                            "<div>" + timestr + "</div>";
+
+
+                        function getDuration(second) {
+                            var duration
+                            var days = Math.floor(second / 86400);
+                            var hours = Math.floor((second % 86400) / 3600);
+                            if (days > 0) duration = days + "天";
+                            else if (hours > 0) duration = "不足一天";
+                            else if (hours == 0) duration = "不足一天";
+                            return duration;
+                        }
+
+
+                        return html;
+                    }
+                },
+                    {
+                        fixed: 'right',
+                        field: 'right',
+                        title: '操作',
+                        width: 136,
+                        align: 'center',
+                        templet: function (a) {
+                            var h = '';
+                            var arr = [3, 4, 5];
+                            if (a.self_id == a.entrust_maker) {
+                                if (a.project_status == 1) {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
+                                } else if (arr.indexOf(a.project_status) !== -1) {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
+
+                                } else {
+
+                                    h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><div'
+
+                                }
+                            } else {
+
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><div'
+                            }
+                            return h;
+                        }
+                    }
+                ]
+            ]
+        });
+        //逾期表格
+        table.on('tool(late_project)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+                tool.side('/admin/project.cost_proprietor/read?id=' + obj.data.id);
+            } else if (obj.event === 'edit') {
+
+
+                tool.side('/admin/project.cost_proprietor/edit?id=' + obj.data.id);
+
+
+            } else if (obj.event === 'del') {
+                layer.confirm('确定要删除该记录吗?', {
+                    icon: 3,
+                    title: '提示'
+                }, function (index) {
+
+
+                    if (data.project_status < 3) {
+                        let callback = function (e) {
+                            layer.msg(e.msg);
+                            if (e.code == 0) {
+                                obj.del();
+                            }
+                        }
+                        tool.delete("/admin/project._proprietor/del", {
+                            id: data.id
+                        }, callback);
+                        layer.close(index);
+                    }
+                    layer.msg("已审核,无法删除");
+                });
+            }
+            return false;
+        });
+
+
+        layui.project2Table = table.render({
+            elem: '#cost_project2',
+            title: '造价项目列表',
+            //toolbar: '#toolbarDemo',
+            url: '/admin/project.cost_proprietor/datalist',
+            limit: 20,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+            cols: [
+                [
+                    {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                        templet: function(d){
+                            return allcount - (d.LAY_NUM-1);
+                        }
+                    },
+                    {
+                        field: 'project_status',
+                        title: '项目状态',
+                        align: 'center',
+                        width: 100,
+                        templet: function (item) {
+
+                            var html = '';
+                            if (item.project_status === 1) {
+                                html = '<span class="layui-badge layui-bg-orange" style="background-color: #ffb800">立项中</span> ';
+                            } else if (item.project_status === 2) {
+                                html = '<span class="layui-badge layui-bg-blue" style="background-color: #b30095">审批中</span> ';
+                            } else if (item.project_status === -1) {
+                                html = '<span class="layui-badge layui-bg-red" style="background-color: #5825aa">待修改</span> ';
+                            } else if (item.project_status === 3) {
+                                html = '<span class="layui-badge layui-bg-green" style="background-color: #d37000">待接收</span> ';
+                            } else if (item.project_status === 4) {
+                                html = '<span class="layui-badge" style="background-color: #005fa8">分配中</span> ';
+                            } else if (item.project_status === 5) {
+
+                                html = '<span class="layui-badge layui-bg-blue" style="background-color: #1e9fff">作业中</span> ';
+                            } else if (item.project_status === 6) {
+                                html = '<span class="layui-badge" style="background-color: #007244">归档中</span> ';
+                            } else if (item.project_status === 7) {
+                                html = '<span class="layui-badge" style="background-color: #881f1f">退审中</span> ';
+                            } else if (item.project_status === 8) {
+                                html = '<span class="layui-badge" style="background-color: #16b777">已归档</span> ';
+                            } else if (item.project_status === 9) {
+                                html = '<span class="layui-badge" style="background-color: #d81e06">已退审</span> ';
+                            }
+                            return html;
+                        }
+                    },
+
+                    {
+                        field: 'project_name',
+                        title: '项目名称',
+                        align: 'center',
+                        width: 400
+                    }, {
+                    field: 'project_num',
+                    title: '项目编号',
+                    align: 'center',
+                    width: 200
+                }, {
+                    field: 'project_time',
+                    title: '项目周期',
+                    align: 'center',
+                    width: 300,
+                    templet: function (item) {
+
+                        var html;
+                        html =
+                            "<div>" +
+                            layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
+                            "~" +
+                            layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
+                            "</div>";
+                        return html;
+                    }
+
+                }, {
+                    field: 'entrust_unit_name',
+                    title: '委托单位',
+                    align: 'center',
+                    width: 150
+                }, {
+                    field: 'entrust_head',
+                    title: '委托单位负责人',
+                    align: 'center',
+                    width: 200
+                }, {
+                    field: 'entrust_head_phone',
+                    title: '委托单位负责人电话',
+                    align: 'center',
+                    width: 250
+                }, {
+                    fixed: 'right',
+                    field: 'right',
+                    title: '操作',
+
+                    width: 136,
+                    align: 'center',
+                    templet: function (a) {
+                        var h = '';
+                        // 1全部-可查看可编辑,2全部-可查看,0与我有关
+                        // console.log(a.self_id);
+                        if(a.self_id == 1){
+                            if(a.project_status==1){
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
+                            } else {
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
+                            }
+                        }else if(a.self_id == 2){
+                            h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="read">查看</a></div>'
+                        }else if(a.self_id == 0 || a.self_id == 3){
+                            if(a.project_status==1){
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>'
+                            } else {
+                                h = '<div class="layui-btn-group"><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a></div>'
+                            }
+                        }
+
+                        return h;
+                    }
+                }]
+            ]
+        });
+
+        table.on('tool(cost_project2)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'read') {
+                tool.side('/admin/project.cost_proprietor/read?id=' + obj.data.id);
+            } else if (obj.event === 'edit') {
+                if (obj.data.project_status<6) {
+
+                    tool.side('/admin/project.cost_proprietor/edit?id=' + obj.data.id);
+                }else {
+                    layer.msg("已归档/已退审")
+                }
+
+            } else if (obj.event === 'del') {
+                layer.confirm('确定要删除该记录吗?', {
+                    icon: 3,
+                    title: '提示'
+                }, function (index) {
+
+
+                    if (data.project_status == 1) {
+                        let callback = function (e) {
+                            layer.msg(e.msg);
+                            if (e.code == 0) {
+                                obj.del();
+                            }
+                        }
+                        tool.delete("/admin/project.cost_proprietor/del", {id: data.id}, callback);
+                        layer.close(index);
+
+                    }else {
+                        layer.msg("已审核,无法删除");
+                    }
+
+                });
+            }
+            return false;
+        });
+
+
+        layui.headTable = table.render({
+            elem: '#head',
+            title: '通讯录外部',
+            url: '/admin/index/head',
+            page: false,
+            limit: 20,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+            cols: [
+                [
+                    {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                        templet: function(d){
+                            return allcount - (d.LAY_NUM-1);
+                        }
+                    }, {
+                    field: 'title',
+                    title: '公司名称',
+                    align: 'center',
+
+                }, {
+                    field: 'nickname',
+                    title: '联系人',
+                    align: 'center',
+
+                }, {
+                    field: 'mobile',
+                    title: '电话',
+                    align: 'center',
+
+                }, {
+                    field: 'email',
+                    title: '电子邮箱',
+                    align: 'center',
+
+                },
+
+                ]
+            ]
+        });
+
+        layui.peopleTable = table.render({
+            elem: '#people',
+            title: '通讯录内部',
+            //toolbar: '#toolbarDemo',
+            url: '/admin/index/people',
+            limit: 20,
+            parseData: function(res) { // 数据解析回调函数
+                // 在这里可以获取数据总数
+                allcount =  res.count;
+                return {
+                    code: res.code, // 数据状态码
+                    msg: res.msg, // 状态信息
+                    count: res.count, // 数据总数
+                    data: res.data // 当前页数据
+                };
+            },
+            cols: [
+                [{fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
+                    templet: function(d){
+                        return allcount - (d.LAY_NUM-1);
+                    }
+                }, {
+                    field: 'nickname',
+                    title: '联系人',
+                    align: 'center',
+
+                }, {
+                    field: 'mobile',
+                    title: '电话',
+                    align: 'center',
+
+                }, {
+                    field: 'email',
+                    title: '电子邮箱',
+                    align: 'center',
+
+                }]
+            ]
+        });
+
+
+        //监听搜索提交
+        form.on('submit(webform)', function (data) {
+
+
+            layui.peopleTable.reload({
+                where: {
+                    nickname: data.field.nickname
+                },
+
+            });
+            return false;
+        });
+
+        form.on('submit(webform2)', function (data) {
+
+
+            layui.headTable.reload({
+                where: {
+                    nickname: data.field.nickname2
+                },
+
+            });
+            return false;
+        });
+
+        form.on('submit(project-search)', function (data) {
+            layui.project2Table.reload({
+                where: data.field,
+
+            });
+            return false;
+        });
+        layui.use(function () {
+            var layer = layui.layer;
+            var form = layui.form;
+            var laydate = layui.laydate;
+            var util = layui.util;
+
+            laydate.render({
+                elem: '#test2',
+                position: 'static',
+                theme: '#1A75FF',
+                calendar: 'true',
+                showBottom: false,
+
+            });
+        });
+    }
+</script>
+
+<!--显示实时年份-->
+<script>
+    `use strict`
+    var datetime = new Date().getFullYear();
+    // console.log(datetime); // it will represent date in the console of developers tool
+    document.getElementById("time1").textContent = datetime; //it will print on html page
+    document.getElementById("time2").textContent = datetime;
+</script>
+
+{/block}
+<!-- /脚本 -->

+ 15 - 0
app/admin/view/index/proprietor_caiping.html

@@ -0,0 +1,15 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>业主附属财评</title>
+</head>
+<body>
+<h1>业主附属财评</h1>
+<div>{$admin_unit_name}</div>
+<h1>{$proprietor_department}</h1>
+<div>{$proprietor_list}</div>
+
+</body>
+</html>

+ 3 - 5
app/admin/view/project/cost/edit_first.html

@@ -427,7 +427,7 @@
       </th>
       {/if}
 
-      {if $field.project_time == 1 }
+      {if $field.project_time == 1  }
       <th class="form-title">项目周期 <font style="color: red !important;">*</font></th>
       <th id="date" colspan="2">
         <div class="layui-input-inline" style="width: 47%;">
@@ -438,12 +438,10 @@
         </div>
       </th>
       {/if}
-
     </tr>
 
 
 
-
     <tr>
       {if $field.engineering_type == 1}
       <th class="form-title ">项目类型 <font style="color: red !important;">*</font></th>
@@ -491,8 +489,8 @@
       {/if}
     <tr>
 
-    <!--        添加送审业主-->
-    {if $detail.project_status == 1 && $detail.proprietor_stauts !=null}
+    <!--        财评自己创建时需添加送审业主-->
+    {if $detail.project_status == 1 && $detail.proprietor_status =null}
     <tr>
       <th class="form-title">送审业主 <font style="color: red !important;">*</font></th>
       <th colspan="2">

+ 244 - 0
app/admin/view/project/cost_proprietor/edit_comments.html

@@ -0,0 +1,244 @@
+
+<style>
+    #imgdel {
+        font-size: 30px;
+        position: absolute;
+        top: -30px;
+        right: -12px;
+        display: none;
+        color: red;
+    }
+
+    .wrapper{
+        display: flex;
+        justify-content: space-between;
+        padding-top: 3px;
+    }
+
+    /* 点击图片放大 */
+    .img-responsive{
+        /* width: 150px; */
+        height: 150px;
+        /* padding: 10px; */
+    }
+</style>
+<div class="log_item_top" id="comments">
+    <div class="layui-tab-content">
+        {volist name="$comment" id="vo"}
+        <div class="log_top">
+            <span>{$vo.maker}</span><span
+                class="{if $vo.unit_type==2}log_commentary{else}log_company{/if}">{$vo.unit_name}</span><span>{$vo.create_time|date="y-m-d H:i"}</span>
+        </div>
+        <div class="log_content">
+            <div style="word-wrap:break-word;padding: 5px 10px;width: fit-content;">
+                {$vo.content}
+            </div>
+            {if !empty($vo.thumb)}
+            <div class="log_content_img" style="width: fit-content;">
+                <img src="{$vo.thumb}" alt="" class="img-responsive">
+                <span></span>
+            </div>
+            {/if}
+        </div>
+        {/volist}
+    </div>
+</div>
+
+
+<!-- <hr class="ws-space-16" style="border: 1.5px solid #e2e2e2 !important;"> -->
+
+<div class="log_item_bottom" style="border-top: 2px solid #e2e2e2;">
+    <div class="layui-form log_bottom_left">
+        <form class="layui-form" action="">
+            <div class="layui-form-item layui-form-text" style="float: left;width: 95%;">
+                <label class="layui-form-label">普通文本域</label>
+                <div class="layui-input-block" style="margin-left: 100px;">
+                    <textarea id="text" name="content" placeholder="请输入内容" maxlength="3000"class="layui-textarea"></textarea>
+                </div>
+                <div class="wrapper">
+                    <span></span><span class="total">0/3000字</span>
+                  </div>
+            </div>
+            <div class="layui-form-item" style="float: left;width: 4.5%;">
+                <div class="layui-input-block">
+                    <button type="submit" class="layui-btn" lay-submit lay-filter="webform" type="button"
+                            style="width: 100%;height: 100% !important;background-color: #16baaa00 !important;margin-top: 30%;">
+                        <img src="/static/home/images/allupload.png" height="100"
+                        style="max-width: 40px;height: 40px;"/>
+                    </button>
+                </div>
+            </div>
+            <div style="clear: both;"></div>
+            <div class="layui-form-item" id="imgItem">
+                <label class="layui-form-label">上传图片:</label>
+                <div>
+                    <div class="layui-upload-drag-self">
+                        <div id="uploadBtn2" style="position:relative;">
+                            <img src="/static/home/images/upload.png" height="100"
+                                 style="max-width: 100%; width: 100%;"/>
+                            <input type="hidden" name="thumb" value="">
+
+                            <i class="layui-icon  layui-icon-clear" id="imgdel"></i>
+
+                        </div>
+                    </div>
+                </div>
+                 <!--//TODO 重载的时候加上comment_type,0:全部,1:财政局to公司,2财政局to业主,3公司to业主-->
+                <!-- <label class="layui-form-label">通信对象:</label>-->
+                <!-- <div>-->
+                <!--    <div class="layui-upload-drag-self">-->
+                <!--        <div id="uploadBtn3" style="position:relative;">-->
+                <!--           <select lay-filter="uploadBtn3" name="type">-->
+                <!--              <option value="0">全部</option>-->
+                <!--              <option value="1">财政局to公司</option>-->
+                <!--              <option value="2">财政局to业主</option>-->
+                              <!--<option value="3">公司to业主</option>-->
+                <!--            </select>-->
+                <!--        </div>-->
+                <!--    </div>-->
+                <!--</div>-->
+                
+                
+                
+            </div>
+        </form>
+    </div>
+    
+    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
+        <div id="innerdiv" style="position:absolute;">
+            <img id="bigimg" style="" src="" />
+        </div>
+    </div>
+        
+</div>
+
+
+
+
+<!--zjl,懂的都懂-->
+ <script>
+
+    function comment() {
+        //console.log(location.href)
+        var form = layui.form,tool=layui.tool,upload = layui.upload;
+        //头像上传
+        var uploadInst = upload.render({
+            elem: '#uploadBtn2'
+            , url: '/admin/api/upload'
+            , done: function (e) {
+                //如果上传失败
+                if (e.code == 1) {
+                    return layer.msg('上传失败');
+                }
+                //上传成功
+                $('#uploadBtn2 input').attr('value', e.data.filepath);
+                $('#uploadBtn2 img').attr('src', e.data.filepath);
+                $('#imgdel').show();
+            }
+        });
+
+        $('#imgdel').click(()=>{
+            $('#uploadBtn2 input').attr('value', '');
+            $('#uploadBtn2 img').attr('src', '/static/home/images/upload.png');
+            $('#imgdel').hide();
+            return false;
+        })
+
+
+        form.on('select(uploadBtn3)', function (data) {
+            //console.log(data)
+            $("#comments").load(location.href + " #comments>*", "type=2&comment_type=" + data.value)
+             
+            return false;
+        });
+
+
+        let a = 1;
+        //监听提交
+        form.on('submit(webform)', function (data) {
+            if (a) {
+                //console.log(data)
+                let callback = function (e) {
+                    a = 1
+                    layer.msg(e.msg);
+                    $("#text").val("");
+                    $('#uploadBtn2 input').attr('value', '');
+                    $('#imgdel').hide();
+                    $('#uploadBtn2 img').attr('src', '/static/home/images/upload.png');
+
+                    //TODO 重载的时候加上comment_type,0:全部,1:财政局to公司,2财政局to业主,3公司to业主
+                    $("#comments").load(location.href + " #comments>*", "type=2&comment_type=" + data.field.type)
+
+                }
+                if (data.field.content === '' && data.field.thumb === '') {
+                    //console.log(data.field)
+                    layer.msg("请完善内容");
+                } else {
+                    data.field["project_id"] = project_id;
+                    tool.post("/admin/project.comment/add", data.field, callback);
+                }
+            }
+
+            a = 0
+            return false;
+        });
+    }
+</script>
+
+<script>
+    const tx = document.querySelector('#text')
+    const total = document.querySelector('.total')
+
+    tx.addEventListener('input', function () {
+
+      total.innerHTML = `${tx.value.length}/3000字`
+    })
+</script>
+
+<!-- 点击放大图片 -->
+<script src="{__MOBILE__}/js/jquery.min.js"></script>
+<script>
+    $(function() {
+    $(".img-responsive").click(function (){
+        // debugger
+        var _this=$(this);
+        imgShow("#outerdiv","#innerdiv","#bigimg",_this);
+    });
+});
+
+function imgShow(outerdiv,innerdiv,bigimg,_this){
+    // debugger
+    var src=_this.attr("src");
+    $(bigimg).attr("src",src);
+    $("<img/>").attr("src",src).on('load',function () {
+        // debugger
+        var windowW=$(window).width()
+        var windowH=$(window).height();
+        var realWidth=this.width;
+        var readHeight=this.height;
+        var imgWidth,imgHeight;
+        var scale=0.8;
+        if(realWidth>windowW+scale){
+            imgHeight=windowH*scale;
+            imgWidth=imgHeight/readHeight*realWidth;
+            if(imgWidth>windowW*scale){
+                imgWidth=windowW*scale;
+            }
+        }else if(realWidth>windowW*scale){
+            imgWidth=windowW*scale;
+            imgHeight=imgWidth/realWidth*readHeight;
+        }else {
+            imgWidth=realWidth;
+            imgHeight=readHeight;
+        }
+        $(bigimg).css("width",imgWidth);
+        var w=(windowW-imgWidth)/2;
+        var h=(windowH-imgHeight)/2;
+        $(innerdiv).css({"top":h,"left":w});
+        $(outerdiv).fadeIn("fast");
+    });
+    $(outerdiv).click(function (){
+        $(this).fadeOut("fast");
+    });
+};
+</script>

+ 3 - 0
app/admin/view/project/cost_proprietor/edit_first.html

@@ -447,6 +447,9 @@
             <option value="">请选择项目类型</option>
             <option value="1" {eq name="$detail.engineering_type1" value="1"} selected {/eq}>预算</option>
             <option value="2"{eq name="$detail.engineering_type1" value="2"} selected {/eq}>结算</option>
+            <option value="3" {eq name="$detail.engineering_type1" value="3"} selected {/eq}>概算</option>
+            <option value="4" {eq name="$detail.engineering_type1" value="4"} selected {/eq}>决算</option>
+            <option value="5" {eq name="$detail.engineering_type1" value="5"} selected {/eq}>工程总承包(EPC)</option>
           </select>
         </div>
       </th>

+ 2 - 2
app/admin/view/project/cost_proprietor/edit_main.html

@@ -473,9 +473,9 @@
             {include file="/project/cost_proprietor/edit_contact" /}
         </div>
         {/if}
-<!--        有问题-->
+
         <div class="layui-tab-item" >
-            {include file="/project/cost_proprietor/project_comments"/}
+            {include file="/project/cost_proprietor/edit_comments"/}
         </div>