tdj пре 8 месеци
родитељ
комит
42f8a6ad4b

+ 2570 - 0
app/mobile/controller/Temporary.php

@@ -0,0 +1,2570 @@
+<?php
+/**
+ * @copyright Copyright (c) 2021 勾股工作室
+ * @license https://opensource.org/licenses/Apache-2.0
+ * @link https://www.gougucms.com
+ */
+
+declare (strict_types=1);
+
+namespace app\mobile\controller;
+
+use app\admin\BaseController;
+use app\admin\controller\field\Field;
+use app\admin\model\Admin;
+use app\admin\model\Admin as AdminList;
+use app\admin\model\Appointment as AppointmentModel;
+use app\admin\model\Contact;
+use app\admin\model\Contact as ContactModel;
+use app\admin\model\CostProject as CostProjectModel;
+use app\admin\model\ProjectAudit as AuditModel;
+use app\admin\model\ProjectRecord;
+use think\App;
+use think\facade\Db;
+use think\facade\Request;
+use think\facade\Session;
+use think\facade\View;
+use app\admin\model\Appropriation as AppropriationModel;
+use app\admin\controller\datastat\Datastat;
+
+class Temporary extends BaseController
+{
+    /**
+     * 构造函数
+     */
+    public function __construct(App $app)
+    {
+        $this->Datastat = new Datastat($app);
+        $this->AppropriationModel = new AppropriationModel();
+        $this->Field = new Field($app);
+        $this->model = new CostProjectModel();
+        $this->Adminmodel = new Admin();
+        $this->Auditmodel = new AuditModel();
+        $this->ContactModel = new ContactModel();
+
+        $this->AppointmentModel = new AppointmentModel();
+
+        $this->uid = get_login_admin('id');
+        $this->unit = get_login_admin('unit_name');
+        $this->user_tpe = Db::name("department")->where("id", $this->unit)->value("type");
+        // $session_admin = get_config('app.session_admin');
+        // $request = Request::instance();
+        // if (!Session::has($session_admin) && $request->url() !== '/mobile/index/login.html') {
+        //     redirect('/mobile/index/login.html')->send();
+        //     exit;
+        // }
+    }
+
+    /**
+     * 财评首页
+     * 通用
+     */
+    public function main()
+    {
+        // halt(session::get('gougu_admin'));
+        if (session::get(get_config('app.session_admin')) == NULL) {
+            $param = get_params();
+            if ($param == NULL) {
+                redirect('/mobile/index/login.html')->send();
+            } else {  // 微信登录 但session为空
+                $session_admin = get_config('app.session_admin');
+                $admin = Db::name('Admin')->where('id', $param['admin'])->find();
+                Session::set($session_admin, $admin);   // null
+                $token = make_token();
+                set_cache($token, $admin, 7200);
+                $admin['token'] = $token;
+
+                $this->uid = $param['admin'];
+                $this->unit = Db::name('Admin')->where('id', $this->uid)->value('unit_name');
+            }
+
+        }
+        //0->财政局,1->业主,2->公司
+        if ($this->user_tpe == 0) {
+            $sent_review_amount = Db::name("cost_project")->where([
+                ["entrust_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();
+        } else if ($this->user_tpe == 2) {
+            $sent_review_amount = Db::name("cost_project")->where([
+                ["review_unit", "=", $this->unit],
+                ['delete_time', '=', 0],
+                ["project_status", ">", 3]
+
+            ])->field("sent_review_amount,sent_review_cost,review_add_reduce_rate,authorize_amount,engineering_type1")->select();
+        } else if ($this->user_tpe == 1) {
+            $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');
+
+
+        if ($this->user_tpe == 0) {
+            $first_sent_review_cost = Db::name("cost_project")->where([
+                ['delete_time', '=', 0],
+                ["project_status", ">", 2],
+                ["project_status", "<>", 9],
+                ["entrust_unit", "=", get_login_admin("unit_name")]
+            ])->whereBetween('create_time', [$firstHalfStart, $firstHalfEnd])->field("sent_review_cost")->select();
+            if (!$first_sent_review_cost->isEmpty()) {
+                $first_sent_review_cost->toArray();
+            } else {
+                $first_sent_review_cost = [];
+            }
+            $second_sent_review_cost = Db::name("cost_project")->where([
+                ['delete_time', '=', 0],
+                ["project_status", ">", 2],
+                ["project_status", "<>", 9],
+                ["entrust_unit", "=", get_login_admin("unit_name")]
+            ])->whereBetween('create_time', [$secondHalfStart, $secondHalfEnd])->field("sent_review_cost")->select();
+            if (!$second_sent_review_cost->isEmpty()) {
+                $second_sent_review_cost->toArray();
+            } else {
+                $second_sent_review_cost = [];
+            }
+        } else if ($this->user_tpe == 2) {
+            $first_sent_review_cost = Db::name("cost_project")->where([
+                ['project_status', '>', 3],
+                ["review_unit", "=", get_login_admin("unit_name")],
+                ["project_status", "<>", 7],
+                ["project_status", "<>", 9]
+            ])->
+            whereBetween('create_time', [$firstHalfStart, $firstHalfEnd])->field("sent_review_cost")->select();
+            if (!$first_sent_review_cost->isEmpty()) {
+                $first_sent_review_cost->toArray();
+            } else {
+                $first_sent_review_cost = [];
+            }
+            $second_sent_review_cost = Db::name("cost_project")->where([
+                ['project_status', '>', 3],
+                ["review_unit", "=", get_login_admin("unit_name")],
+                ["project_status", "<>", 7],
+                ["project_status", "<>", 9]
+            ])->
+            whereBetween('create_time', [$secondHalfStart, $secondHalfEnd])->field("sent_review_cost")->select();
+            if (!$second_sent_review_cost->isEmpty()) {
+                $second_sent_review_cost->toArray();
+            } else {
+                $second_sent_review_cost = [];
+            }
+        } else if ($this->user_tpe == 1) {
+
+            $first_sent_review_cost = Db::name("cost_project")->where([
+                ['project_status', '>', 2], ["sent_review_unit", "=", $this->unit]
+            ])->
+            whereBetween('create_time', [$firstHalfStart, $firstHalfEnd])->field("sent_review_cost")->select();
+            if (!$first_sent_review_cost->isEmpty()) {
+                $first_sent_review_cost->toArray();
+            } else {
+                $first_sent_review_cost = [];
+            }
+            $second_sent_review_cost = Db::name("cost_project")->where([
+                ['project_status', '>', 2], ["sent_review_unit", "=", $this->unit]
+            ])->
+            whereBetween('create_time', [$secondHalfStart, $secondHalfEnd])->field("sent_review_cost")->select();
+            if (!$second_sent_review_cost->isEmpty()) {
+                $second_sent_review_cost->toArray();
+            } else {
+                $second_sent_review_cost = [];
+            }
+
+        }
+
+        $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([
+            ["entrust_unit", "=", $this->unit],
+            ['delete_time', '=', 0],
+            ["project_status", '>', 2],
+        ])->count();
+        if ($this->user_tpe == 0) {
+            $where = [
+                ["entrust_unit", "=", $this->unit],
+                ['delete_time', '=', 0],
+                ["project_status", '>', 2],
+
+
+            ];
+        } else if ($this->user_tpe == 2) {
+            $where = [
+                ["review_unit", "=", $this->unit],
+                ['delete_time', '=', 0],
+                ["project_status", '>', 2],
+
+            ];
+        }
+        if($this->user_tpe == 1){
+            $data = Db::name("cost_project")
+                ->where(function($query) {
+                    $query->where([
+                        ["sent_review_unit", "=", get_login_admin("unit_name")],
+                        ['delete_time', '=', 0],
+                        ["proprietor_status", '>', 1],
+                        ["project_status", '=', 0],
+                    ]);
+                })
+                ->whereOr(function($query) {
+                    $query->where([
+                        ["sent_review_unit", "=", get_login_admin("unit_name")],
+                        ['delete_time', '=', 0],
+                        ["project_status", '>', 0],
+                    ]);
+                })
+
+                ->select();
+        }else{
+            $data = Db::name("cost_project")->where($where)->select();
+        }
+        // halt($data);
+        $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, ".", "");
+            }
+
+        }
+
+        $red = $this->Auditmodel->where("approver", $this->uid)->where("audit_status", 1)->count();
+
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        $unread_id = Db::name("admin")->where("id", $this->uid)->value("unread");
+        if (empty($unread_id)) {
+            $unread_id = 0;
+        } else {
+            $unread_id = 1;
+        }
+
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+
+
+        View::assign('unit_type', $unit_type);
+        View::assign("red_kan", $red_kan);
+        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);
+        View::assign("red", $red);
+        View::assign("red_notice", $unread_id);
+
+        return View();
+    }
+
+    /**
+     * 公司首页
+     */
+    public function main_company()
+    {
+
+        $sent_review_amount = Db::name("cost_project")->where([
+            ["review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ['project_status', '>', 3],
+        ])->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"] && (int)$a["authorize_amount"]) {
+                    //预算总额
+                    $sent_review_amount_tol["sent_review_amount_type1"] += $a["sent_review_amount"];
+                    //审定
+                    $sent_review_amount_tol["authorize_amount_type1"] += $a["authorize_amount"];
+                }
+
+
+            } elseif ($a['engineering_type1'] == 2) {
+                if ((int)$a["sent_review_amount"] && (int)$a["authorize_amount"]) {
+                    //结算总额
+                    $sent_review_amount_tol["sent_review_amount_type2"] += $a["sent_review_amount"];
+                    //审定
+                    $sent_review_amount_tol["authorize_amount_type2"] += $a["authorize_amount"];
+                }
+            }
+
+        }
+
+        if ((int)$sent_review_amount_tol["sent_review_amount_type1"] && (int)$sent_review_amount_tol["authorize_amount_type1"]) {
+            //预算核增减率
+            $sent_review_amount_tol["review_add_reduce_rate_type1"] = (sprintf("%.4f", ($sent_review_amount_tol["authorize_amount_type1"] - $sent_review_amount_tol["sent_review_amount_type1"]) / $sent_review_amount_tol["sent_review_amount_type1"])) * 100;
+        }
+
+        if ((int)$sent_review_amount_tol["sent_review_amount_type2"] && (int)$sent_review_amount_tol["authorize_amount_type2"]) {
+            //结算核增减率
+            $sent_review_amount_tol["review_add_reduce_rate_type2"] = (sprintf("%.4f", ($sent_review_amount_tol["authorize_amount_type2"] - $sent_review_amount_tol["sent_review_amount_type2"]) / $sent_review_amount_tol["sent_review_amount_type2"])) * 100;
+        }
+
+
+        for ($i = 0; $i < count($sent_review_amount); $i++) {
+            $a = $sent_review_amount[$i];
+            if ((int)$a['sent_review_amount'] && (int)$a['sent_review_cost'] && (int)$a['authorize_amount']) {
+                $amount["sent_review_amount"] += $a['sent_review_amount'];
+                $amount["sent_review_cost"] += $a['sent_review_cost'];
+                $amount["authorize_amount"] += $a['authorize_amount'];
+            }
+
+        }
+
+        if ((int)$amount['sent_review_amount'] && (int)$amount["authorize_amount"]) {
+            $amount['review_add_reduce_rate'] = (sprintf("%.4f", ($amount["authorize_amount"] - $amount["sent_review_amount"]) / $amount["sent_review_amount"])) * 100;
+        }
+
+
+        //评审服务费,上半年服务费用,下半年服务费用 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([
+            ['project_status', '>', 2], ["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([
+            ['project_status', '>', 2], ["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([
+            ["review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ["project_status", '>', 3],
+        ])->count();
+        $where = [
+            ["review_unit", "=", get_login_admin("unit_name")],
+            ['delete_time', '=', 0],
+            ["project_status", ">", 3]
+        ];
+        $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["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;
+            }
+        }
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+
+        View::assign("red_kan", $red_kan);
+        View::assign("sent_review_cost", $sent_review_cost);
+        View::assign("amount", $amount);
+        View::assign("num", $num);
+        View::assign("num_project", $num_project);
+        View::assign("sent_review_amount_tol", $sent_review_amount_tol);
+
+        return View();
+    }
+
+
+    /**
+     * cp看板列表
+     */
+    public function kan_list()
+    {
+        //根据所登录的账号,查询跟本身有关的项目
+        //2是公司,0是财政局,1是业主
+        $param = get_params();
+
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+        if (isset($param["project_start_time"])) {
+            $param["project_start_time"] = $param["project_start_time"] ? strtotime($param["project_start_time"]) : 0;
+        }
+        if (isset($param["project_end_time"])) {
+            $param["project_end_time"] = $param["project_end_time"] ? strtotime($param["project_end_time"]) : 0;
+        }
+        $where3 = [];//搜索条件
+        if (!empty($param['project_status'])) {
+            $where3[] = ['project_status', '=', $param['project_status']];
+        }
+        if (!empty($param['province'])) {
+            $where3[] = ['province', '=', $param['province']];
+        }
+        if (!empty($param['city'])) {
+            $where3[] = ['city', '=', $param['city']];
+        }
+        if (!empty($param['area'])) {
+            $where3[] = ['area', '=', $param['area']];
+        }
+        if (!empty($param['project_end_time'])) {
+            $where3[] = ['project_end_time', '<', $param['project_end_time']];
+        }
+        if (!empty($param['project_start_time'])) {
+            $where3[] = ['project_start_time', '>', $param['project_start_time']];
+        }
+        if (!empty($param['keyword'])) {
+            $keyword = $param['keyword'];
+            $where3[] = ['project_num|project_name|review_unit', 'like', '%' . $keyword . '%'];
+        }
+        if (!empty($param['review_unit_name'])) {
+            $where3[] = ['review_unit_name', 'like', '%' . $param['review_unit_name'] . '%'];
+        }
+        if (!empty($param['sent_review_unit_name'])) {
+            $where3[] = ['sent_review_unit_name', 'like', '%' . $param['sent_review_unit_name'] . '%'];
+        }
+        if (!empty($param['entrust_unit_name'])) {
+            $where3[] = ['entrust_unit_name', 'like', '%' . $param['entrust_unit_name'] . '%'];
+        }
+
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        $inarr = array();
+
+        if ($unit_type == 0) {
+            $where[] = ["delete_time", "=", 0];
+            $where[] = ["project_status", ">", 0];
+            $where[] = ["entrust_unit", "=", get_login_admin('unit_name')];
+            $where2[] = ["delete_time", "=", 0];
+            $where2[] = ["project_status", ">", 0];
+            $where2[] = ["entrust_unit", "=", get_login_admin('unit_name')];
+            //项目可见的权限
+            $field = $this->Field->get_field_rules_new($this->uid);
+            //1全部-可查看可编辑,2全部-可查看,0与我有关
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            if ($see_auth == 3) {
+                $where[] = ["entrust_maker", "=", $this->uid];
+
+                $where2[] = ["entrust_approver", "=", $this->uid];
+                $where2[] = ["project_status", ">", 1];
+
+            } elseif ($see_auth == 0) {
+                $where[] = ["entrust_maker", "=", $this->uid];
+                $where[] = ["project_status", ">", 0];
+                $where2[] = ["entrust_approver", "=", $this->uid];
+                $where2[] = ["project_status", ">", 1];
+            }
+            $list = $this->model->where($where3)
+                ->where(function ($query) use ($where,$where2) {
+                    // 第一组条件(entrust_maker)
+                    $query->where(function ($q1) use ($where) {
+                        $q1->where($where);
+                    });
+                    // 使用 OR 连接第二组条件(entrust_approver)
+                    $query->whereOr(function ($q2) use ($where2) {
+                        $q2->where($where2);
+                    });
+                })
+                ->order("create_time desc")->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {
+                    $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                    if ($red) {
+                        if ($red["detail"] || $red["comment"] || $red["report"] || $red["user"] || $red["contact"]) {
+                            $item->red = 1;
+                        } else {
+
+                            $item->red = 0;
+                        }
+                    } else {
+                        $item->red = 0;
+                    }
+                    if (($item->province && $item->city && $item->area)) {
+                        $item->project_region = $item->province . '-' . $item->city . '-' . $item->area;
+                    }
+
+                })->toArray();
+        } elseif ($unit_type == 2) {
+            $order = empty($param['order']) ? 'project_receive_time desc,id desc' : $param['order'];
+
+            $where = [
+                ["delete_time", "=", 0],
+                ["project_status", ">", 3],
+                ["review_unit", "=", get_login_admin("unit_name")]
+            ];
+            $review_unit = $this->model->where($where)->where($where3)->field('id,review_head,operate_head,operate_team')->select()->toArray();
+            for ($i = 0; $i < count($review_unit); $i++) {
+                $a = $review_unit[$i];
+                $ids = $a["review_head"] . ',' . $a["operate_head"] . ',' . $a["operate_team"];
+                $ids = explode(",", $ids);
+                $c = in_array($this->uid, $ids);
+                if ($c) {
+                    $inarr[] = $a["id"];
+                }
+            }
+
+
+            $field = $this->Field->get_field_rules_New($this->uid);
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            $this->see_auth = $see_auth;
+            if ($see_auth == 3) {
+
+                $list = $this->model
+                    ->where($where)->where($where3)->whereIn("id", $inarr)
+                    ->order($order)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+
+                    })->toArray();
+
+            } elseif ($see_auth == 0) {
+                $list = $this->model
+                    ->where($where)->where($where3)->whereIn("id", $inarr)
+                    ->order($order)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+
+                    })->toArray();
+            } else {
+                $list = $this->model
+                    ->where($where)
+                    ->order($order)->where($where3)->paginate(9999, false, ['query' => $param])
+                    ->each(function ($item) {
+
+                        $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                        if ($red) {
+                            if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                                $item->red = 1;
+                            } else {
+                                $item->red = 0;
+                            }
+                        } else {
+                            $item->red = 0;
+                        }
+                    })->toArray();
+            }
+
+        } elseif ($unit_type == 1) {
+            $field = $this->Field->get_field_rules_New($this->uid);
+            $see_auth = isset($field["see_auth"]) ? $field["see_auth"] : 3;
+            if ($see_auth == 0 || $see_auth == 3) {
+                $where = [
+                    ["delete_time", "=", 0],
+                    ["sent_review_unit", "=", get_login_admin("unit_name")],
+                    ["sent_review_head", "=", $this->uid]
+                ];
+            } else {
+                $where = [
+                    ["delete_time", "=", 0],
+                    ["sent_review_unit", "=", get_login_admin("unit_name")]
+                ];
+            }
+            $list = $this->model
+                ->where($where)
+                ->order($order)->where($where3)->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {
+
+                    $red = Db::name("new_msg")->where([["project_id", "=", $item->id], ["uid", "=", $this->uid]])->find();
+                    if ($red) {
+                        if ($red["detail"] || $red["comment"] || $red["report"] || $red["record"] || $red["user"] || $red["contact"]) {
+                            $item->red = 1;
+                        } else {
+                            $item->red = 0;
+                        }
+                    } else {
+                        $item->red = 0;
+                    }
+                })->toArray();
+        } else {
+            $list["data"] = [];
+        }
+
+
+        $data = $list["data"];
+        $real_list = array_values(array_column($data, NULL, 'id'));
+
+        $red = $this->Auditmodel->where("approver", $this->uid)->where("audit_status", 1)->count();
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        View::assign("red_kan", $red_kan);
+        View::assign("detail", $real_list);
+        View::assign("red", $red);
+        View::assign("unit_type", $unit_type);
+        return view();
+    }
+
+    public function pending_invite()
+    {
+        $param = get_params();
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        $where1 = [];
+        //2是公司,0是财政局,1是业主
+        if ($unit_type == 0) {
+
+            if (!empty($param['invite_keyword'])) {
+                $keyword = $param['invite_keyword'];
+                $where1[] = ['review_unit_name', 'like', '%' . $keyword . '%'];
+            }
+            $order = empty($param['order']) ? 'id desc' : $param['order'];
+            $Appropriationlist = $this->AppropriationModel->where("entrust_unit", get_login_admin("unit_name"))
+                ->where("status",">",0)->where($where1)
+                ->order( $order)->paginate(9999, false, ['query' => $param])
+                ->each(function ($item) {
+                    $data = Db::name("appropriation_project")->alias("a")->join("cost_project c","a.project_id=c.id","left")
+                        ->where("a.uid","not null")->where("a.uid",$item->id)
+                        ->where("c.entrust_unit",get_login_admin("unit_name"))->column("c.project_name,c.sent_review_cost");
+                    if (!empty($data)) {
+                        $a = 0;
+                        $project_name = [];
+                        $appropriation_amount = 0;
+                        foreach ($data as $key => $value) {
+                            $a += 1;
+                            $project_name[] = $a . "." . $value["project_name"];
+                            $appropriation_amount += $value["sent_review_cost"];
+                        }
+                        $item->a = count($data);
+                        $item->appropriation_amount = $appropriation_amount;
+                        $item->project_names = $project_name;
+                    }
+                });
+
+        } else if($unit_type == 2) {
+            $where = [
+                ["a.approver", "=", $this->uid],
+                ["a.audit_type", ">", 3],
+                ["a.audit_status", "<", 5]
+            ];
+            $order = empty($param['order']) ? 'id desc' : $param['order'];
+            if (!empty($param['invite_keyword'])) {
+                $keyword = $param['invite_keyword'];
+                $where[] = ['entrust_unit_name', 'like', '%' . $keyword . '%'];
+            }
+
+            $Appropriationlist = $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(9999, false, ['query' => $param])
+                ->where('audit_type','in',[10,11,12])
+                ->each(function ($item){
+                    switch ($item["audit_type"]) {
+                        case 10:
+                            $item->else_name = "请款一级审核";
+                            break;
+                        case 11:
+                            $item->else_name = "请款二级审核";
+                            break;
+                        case 12:
+                            $item->else_name = "请款三级审核";
+                            break;
+                    }
+                });
+        }else{
+            $Appropriationlist = [];
+        }
+        
+        
+         $app_red = 0;
+        if($this->user_tpe==0){
+            $app_where=[
+                ["status","=",1],
+                ["entrust_unit","=",get_login_admin("unit_name")]
+            ];
+            if(Db::name("appropriation")->where($app_where)->count()>0){$app_red=1;}
+        }else if($this->user_tpe==2){
+            //10请款一审,11请款二审,12,请款三审
+            $app_where=[
+                ["audit_type",">",9],
+                ["audit_type","<",13],
+                ["audit_status","=",1],
+                ["approver","=",$this->uid]
+            ];
+            if($this->Auditmodel->where($app_where)->count()>0){$app_red=1;}
+        }
+
+        
+        
+        //红点
+        $where = [
+            ["approver", "=", $this->uid],
+            ["audit_status", "<", 5]
+        ];
+        $list = $this->Auditmodel->alias("a")->join("cost_project c", "a.project_id=c.id", "left")
+            ->where($where)->field("a.*,c.project_num,c.project_status,c.engineering_type,c.sent_review_amount")
+            ->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+                $item->approver_name = Db::name("admin")->where("id", $item->approver)->value("nickname");
+            })->toArray();
+        $red = 0;
+        foreach ($list["data"] as $item => $value) {
+            if ($value["audit_status"] == 1) {
+                $red = 1;
+            }
+        }
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        View::assign('unit_type', $unit_type);
+        View::assign('list', $Appropriationlist);
+        View::assign("red_kan", $red_kan);
+        View::assign('red', $red);
+        View::assign('app_red', $app_red);
+        return view();
+    }
+
+
+    /**
+     * cp待办列表
+     */
+    public function pending()
+    {
+        $param = get_params();
+        //1项目,2报告,3联系函,4公司一级审核,5公司二级审核,6公司三级审核,7联系函一审,8联系过二审,9联系函三审,10请款一审,11请款二审,12,请款三审,14报告四审,15报告五审
+        $where = [
+            ["approver", "=", $this->uid],
+            ["audit_status", "<", 5],
+            ["audit_type", "<>", 10],
+            ["audit_type", "<>", 11],
+            ["audit_type", "<>", 12],
+        ];
+
+        if (!empty($param['project_status'])) {
+
+            $where[] = ['c.project_status', '=', $param['project_status']];
+        }
+        if (!empty($param['province'])) {
+
+            $where[] = ['c.province', '=', $param['province']];
+        }
+        if (!empty($param['city'])) {
+
+            $where[] = ['c.city', '=', $param['city']];
+        }
+        if (!empty($param['area'])) {
+
+            $where[] = ['c.area', '=', $param['area']];
+        }
+        if (!empty($param['project_end_time'])) {
+
+            $where[] = ['c.project_end_time', '<', $param['project_end_time']];
+        }
+        if (!empty($param['project_start_time'])) {
+
+            $where[] = ['c.project_start_time', '>', $param['project_start_time']];
+        }
+        if (!empty($param['keyword'])) {
+            $keyword = $param['keyword'];
+            $where[] = ['c.project_num|c.project_name|c.review_unit', 'like', '%' . $keyword . '%'];
+        }
+
+        if (!empty($param['list_keyword'])) {
+            $keyword = $param['list_keyword'];
+            $where[] = ['c.project_name', 'like', '%' . $keyword . '%'];
+        }
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+
+        $app_red = 0;
+        if($this->user_tpe==0){
+            $app_where=[
+                ["status","=",1],
+                ["entrust_unit","=",get_login_admin("unit_name")]
+            ];
+            if(Db::name("appropriation")->where($app_where)->count()>0){$app_red=1;}
+        }else if($this->user_tpe==2){
+            //10请款一审,11请款二审,12,请款三审
+            $app_where=[
+                ["audit_type",">",9],
+                ["audit_type","<",13],
+                ["audit_status","=",1],
+                ["approver","=",$this->uid]
+            ];
+            if($this->Auditmodel->where($app_where)->count()>0){$app_red=1;}
+        }
+
+
+        $list = $this->Auditmodel->alias("a")->join("cost_project c", "a.project_id=c.id", "left")->where($where)->field("a.*,c.project_num,c.project_status,c.engineering_type,c.sent_review_amount")
+            ->order($order)->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+                $item->approver_name = Db::name("admin")->where("id", $item->approver)->value("nickname");
+            })->toArray();
+
+        $red = 0;
+        foreach ($list["data"] as $item => $value) {
+            if ($value["audit_status"] == 1) {
+                $red = 1;
+            }
+        }
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+
+        $real_list = [];
+        foreach ($list["data"] as $item => $value) {
+            if (in_array($value["audit_type"], [2,4, 5, 6,14,15])) {
+                $a = Db::name("project_report")->where("id", $value["else_id"])->field("title,status")->find();
+                $value["else_name"] = $a["title"];
+                $value["else_status"] = $a["status"];
+            } elseif (in_array($value["audit_type"], [3,7, 8, 9])) {
+                $a = Db::name("contact")->where("id", $value["else_id"])->field("title,status")->find();
+                $value["else_name"] = $a["title"];
+                $value["else_status"] = $a["status"];
+            }
+            //,14报告四审,15报告五审
+            if (in_array($value["audit_type"], [4, 5, 6,14,15])) {
+                switch ($value["audit_type"]) {
+                    case 4:
+                        $value["audit_name"] = "报告一审";
+                        break;
+                    case 5:
+                        $value["audit_name"] = "报告二审";
+                        break;
+                    case 6:
+                        $value["audit_name"] = "报告三审";
+                        break;
+                    case 14:
+                        $value["audit_name"] = "报告四审";
+                        break;
+                    case 15:
+                        $value["audit_name"] = "报告五审";
+                        break;
+                }
+            } elseif (in_array($value["audit_type"], [7, 8, 9])) {
+                switch ($value["audit_type"]) {
+                    case 7:
+                        $value["audit_name"] = "联系函一审";
+                        break;
+                    case 8:
+                        $value["audit_name"] = "联系函二审";
+                        break;
+                    case 9:
+                        $value["audit_name"] = "联系函三审";
+                        break;
+                }
+
+            } elseif (in_array($value["audit_type"], [10, 11, 12])) {
+                switch ($value["audit_type"]) {
+                    case 10:
+                        $value["audit_name"] = "请款一审";
+                        break;
+                    case 11:
+                        $value["audit_name"] = "请款二审";
+                        break;
+                    case 12:
+                        $value["audit_name"] = "请款三审";
+                        break;
+                }
+            }
+
+
+            $real_list[] = $value;
+        }
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+
+        // halt($real_list);
+        View::assign("red_kan", $red_kan);
+        View::assign('app_red', $app_red);
+        View::assign('red', $red);
+        View::assign('list', $real_list);
+        View::assign('unit_type', $unit_type);
+        // halt($real_list);
+
+        return view();
+    }
+
+    /**
+     *个人资料
+     */
+    public function person()
+    {
+        $person = get_login_admin();
+        $red = $this->Auditmodel->where("approver", $this->uid)->where("audit_status", 1)->count();
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        View::assign("red_kan", $red_kan);
+        View::assign('red', $red);
+        View::assign('person', $person);
+        return view();
+    }
+
+    /**
+     * cp看板内容
+     */
+    public function detail()
+    {
+
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;
+        $type = isset($param['type']) ? $param['type'] : 0;
+        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'a.id desc' : $param['order'];
+
+        $detail = $this->model->getCostProjectById($id);
+        $comment = Db::name("project_comment")->where("project_id", $id)->order('create_time', 'desc')->select();
+        $file_array = Db::name('ProjectFile')
+            ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name')
+            ->alias('mf')
+            ->join('File f', 'mf.file_id = f.id', 'LEFT')
+            ->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
+            ->order('mf.create_time desc')
+            ->where(array('mf.topic_id' => $id, 'mf.module' => 'project'))
+            ->select()->toArray();
+
+        $report = Db::name("project_report")
+            ->where([["project_id", "=", $id]])
+            ->alias("r")->join("admin a", "r.maker_id = a.id")
+            ->field("r.*,a.nickname")
+            ->select();
+        $contact = $this->ContactModel->where([['project_id', '=', $id]])
+            ->field('a.*,u.nickname as admin_name,f.name,f.filesize,f.filepath,f.fileext,f.admin_id')
+            ->alias('a')
+            ->join('file f', "a.file = f.id", "left")
+            ->join('Admin u', 'a.maker_id = u.id', "left")
+            ->order($order)
+            ->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+
+            })->toArray();
+
+        $contact = $contact['data'];
+        $where = [
+            ["cp_project_record.delete_time", "=", 0],
+            ["project_id", "=", $id],
+            ["maker_id", "=", get_login_admin('id')]
+        ];
+        $record = Db::name('project_record')->where($where)
+            ->field('a.*,u.nickname as admin_name')
+            ->alias('a')
+            ->join('Admin u', 'a.maker_id = u.id', "left")
+            ->order($order)
+            ->select();
+
+        //2是公司,0是财政局,1是业主
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        if ($unit_type == 0) {
+            $person = self::user($id);
+            View::assign('project_five', self::getProjectFive());
+        } elseif ($unit_type == 2) {
+            $person = self::user($id);
+            View::assign('project_five', self::getProjectFiveCompany());
+        } else {
+            $person = 0;
+            View::assign('project_five', self::getProjectFiveYezhu());
+        }
+
+
+        $appropriation_uid = Db::name("appropriation_project")->where("project_id", $id)->value("uid");
+        if (empty($appropriation_uid)) {
+            $appropriation_data = [];
+            $appropriation_file_array = [];
+        } else {
+            $where = [
+                ["id", "=", $appropriation_uid],
+                ["status", ">", 0]
+            ];
+            //请款
+            $appropriation = Db::name("appropriation")->where($where)->find();
+            if (!empty($appropriation)) {
+                $projects = Db::name("appropriation_project")->alias("a")
+                    ->leftJoin("cost_project c", "a.project_id=c.id")
+                    ->where("uid", $appropriation["id"])->column("c.project_name,c.sent_review_cost");
+                $data = [];
+                $appropriation_amount = 0;
+                for ($i = 0; $i < count($projects); $i++) {
+                    $v = $projects[$i];
+                    $b = $i + 1;
+                    $appropriation_amount += $v["sent_review_cost"];
+                    $data[] = $b . "." . $v["project_name"];
+                }
+                $appropriation_data = $appropriation;
+                $appropriation_data["appropriation_amount"] = $appropriation_amount;
+                $appropriation_data["project_name"] = $data;
+
+                $appropriation_file_array = Db::name('ProjectFile')
+                    ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name')
+                    ->alias('mf')
+                    ->join('File f', 'mf.file_id = f.id', 'LEFT')
+                    ->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
+                    ->order('mf.create_time desc')
+                    ->where(array('mf.topic_id' => $appropriation_uid, 'mf.module' => 'appropriation'))
+                    ->select()->toArray();
+            } else {
+                $appropriation_data = [];
+                $appropriation_file_array = [];
+            }
+
+
+        }
+
+
+        $project_log = self::project_log($id);
+
+        $red = Db::name("new_msg")->where([["uid", '=', $this->uid], ["project_id", "=", $id]])->field('detail,comment,report,user,contact')->find();
+        if (empty($red)) {
+            $red = ["detail" => 0, "comment" => 0, "report" => 0, "user" => 0, "contact" => 0];
+        }
+        $field = $this->Field->get_field_rules_new($this->uid);
+        $fields = [];
+        foreach ($field as $k=>$v){
+            if($v==1){
+                $fields[$k] = true;
+            }else{
+                $fields[$k] = false;
+            }
+        }
+        if($this->user_tpe==2){
+            $fields["sent_review_approver_amount"] = false;
+            $fields["construction_approver_amount"] = false;
+        }
+
+        $appointmentList = $this->AppointmentModel->where("project_id",$id)->paginate(9999, false, ['query' => $param])
+            ->order("create_time","desc")
+            ->each(function ($item) {
+                if($item->sponsor_unit==get_login_admin("unit_name")){
+                    $item->operate = false;
+                }else{
+                    $item->operate = true;
+                }
+            });;
+//            halt($appointmentList->toArray());
+        View::assign('field', $fields);
+
+
+        if (!empty($detail)) {
+            View::assign('appointmentList', $appointmentList);
+            View::assign('project_log', $project_log);
+            View::assign('project_id', $id);
+            View::assign('comment', $comment);
+            View::assign('record', $record);
+            View::assign('contact', $contact);
+            View::assign('detail', $detail);
+            View::assign('appropriation', $appropriation_data);
+            View::assign('file_array', $file_array);
+            View::assign('appropriation_file_array', $appropriation_file_array);
+            View::assign('report', $report);
+            View::assign('person', $person);
+            View::assign('red', $red);
+            View::assign('unit_type', $unit_type);
+
+            return view();
+        } else {
+            throw new \think\exception\HttpException(404, '找不到页面');
+        }
+
+    }
+
+    /**
+     * cp代办内容
+     */
+    public function pdetail()
+    {
+
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;
+        $type = isset($param['type']) ? $param['type'] : 0;
+        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'a.id desc' : $param['order'];
+
+        $detail = $this->model->getCostProjectById($id);
+        $comment = Db::name("project_comment")->where("project_id", $id)->order('create_time', 'desc')->select();
+        $file_array = Db::name('ProjectFile')
+            ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name')
+            ->alias('mf')
+            ->join('File f', 'mf.file_id = f.id', 'LEFT')
+            ->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
+            ->order('mf.create_time desc')
+            ->where(array('mf.topic_id' => $id, 'mf.module' => 'project'))
+            ->select()->toArray();
+
+        $report = Db::name("project_report")->where([["project_id", "=", $id], ["r.status", "=", 1]])->alias("r")->join("admin a", "r.maker_id = a.id")->field("r.*,a.nickname")->select();
+        $contact = $this->ContactModel->where([['project_id', '=', $id]])
+            ->field('a.*,u.nickname as admin_name,f.name,f.filesize,f.filepath,f.fileext,f.admin_id')
+            ->alias('a')
+            ->join('file f', "a.file = f.id", "left")
+            ->join('Admin u', 'a.maker_id = u.id', "left")
+            ->order($order)
+            ->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+
+            })->toArray();
+
+        $contact = $contact['data'];
+        $where = [
+            ["cp_project_record.delete_time", "=", 0],
+            ["project_id", "=", $id],
+            ["maker_id", "=", get_login_admin('id')]
+        ];
+        $record = Db::name('project_record')->where($where)
+            ->field('a.*,u.nickname as admin_name')
+            ->alias('a')
+            ->join('Admin u', 'a.maker_id = u.id', "left")
+            ->order($order)
+            ->select();
+
+        //2是公司,0是财政局,1是业主
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        if ($unit_type == 0) {
+            $person = self::user($id);
+            View::assign('project_five', self::getProjectFive());
+        } elseif ($unit_type == 2) {
+            $person = self::user($id);
+            View::assign('project_five', self::getProjectFiveCompany());
+        } else {
+            $person = 0;
+            View::assign('project_five', self::getProjectFiveYezhu());
+        }
+
+        $field = $this->Field->get_field_rules_new($this->uid);
+        $fields = [];
+        foreach ($field as $k=>$v){
+            if($v==1){
+                $fields[$k] = true;
+            }else{
+                $fields[$k] = false;
+            }
+        }
+        if($this->user_tpe==2){
+            $fields["sent_review_approver_amount"] = false;
+            $fields["construction_approver_amount"] = false;
+        }
+        View::assign('field', $fields);
+
+        $project_log = self::project_log($id);
+        // halt($detail);
+        if (!empty($detail)) {
+            View::assign('project_log', $project_log);
+            View::assign('project_id', $id);
+            View::assign('comment', $comment);
+            View::assign('record', $record);
+            View::assign('contact', $contact);
+            View::assign('detail', $detail);
+            View::assign('file_array', $file_array);
+            View::assign('report', $report);
+            View::assign('person', $person);
+            return view();
+        } else {
+            echo '<div style="text-align:center;color:red;margin-top:20%;font-size:425%"><span>项目不存在!</span><br><span>已被删除</span></div>';
+            // throw new \think\exception\HttpException(404, '项目不存在');
+        }
+
+    }
+
+    /**
+     * cp看板报告内容
+     */
+    public function report_detail()
+    {
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;
+
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $detail = Db::name('ProjectReport')->where(['id' => $id])->find();
+        if (empty($detail)) {
+            if (empty($detail)) {
+                echo '<div style="text-align:center;color:red;margin-top:20%;">该文档不存在</div>';
+                exit;
+            }
+        } else {
+            $maker_name = Db::name('admin')->where(['id' => $detail["maker_id"]])->value("nickname");
+            $detail["maker_name"] = $maker_name;
+            $file_array = Db::name('ProjectReport')
+                ->field("r.*,a.nickname as admin_name,f.name,f.filesize,f.filepath,f.fileext,f.admin_id")
+                ->alias('r')
+                ->join('File f', 'r.file = f.id')
+                ->join('Admin a', 'r.maker_id = a.id', 'LEFT')
+                ->order('r.create_time desc')
+                ->where(array('r.id' => $id))
+                ->select()->toArray();
+
+
+            View::assign('file_array', $file_array);
+            View::assign('project_id', $project_id);
+            View::assign('detail', $detail);
+            return view();
+        }
+
+    }
+
+
+    /**
+     * cp待办报告内容
+     */
+    public function report_pdetail()
+    {
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;
+
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $detail = Db::name('ProjectReport')->where(['id' => $id])->find();
+        if (empty($detail)) {
+            if (empty($detail)) {
+                echo '<div style="text-align:center;color:red;margin-top:20%;">该文档不存在</div>';
+                exit;
+            }
+        } else {
+            $maker_name = Db::name('admin')->where(['id' => $detail["maker_id"]])->value("nickname");
+            $detail["maker_name"] = $maker_name;
+            $file_array = Db::name('ProjectReport')
+                ->field("r.*,a.nickname as admin_name,f.name,f.filesize,f.filepath,f.fileext,f.admin_id")
+                ->alias('r')
+                ->join('File f', 'r.file = f.id')
+                ->join('Admin a', 'r.maker_id = a.id', 'LEFT')
+                ->order('r.create_time desc')
+                ->where(array('r.id' => $id))
+                ->select()->toArray();
+
+
+            View::assign('file_array', $file_array);
+            View::assign('project_id', $project_id);
+            View::assign('detail', $detail);
+            return view();
+        }
+
+    }
+
+    /**
+     *项目日志
+     */
+    public function project_log($project_id)
+    {
+        // $project_id = 24;
+        $login_admin = get_login_admin();
+
+        $where = array();
+
+        if ($login_admin['user_type'] == 2) {
+            $where = [
+                ['project_status', '>=', 3],
+                ['unit_name', '=', $login_admin['unit_name']],
+            ];
+        } else {
+
+            if ($login_admin['permission'] != 1) {
+                $where = [
+                    ['unit_name', '=', $login_admin['unit_name']],
+                ];
+            }
+
+        }
+        // dump($where);
+        $project_log = Db::name('ProjectLog')->where($where)->where('project_id', $project_id)->order('create_time', 'desc')->select()->toArray();
+
+        foreach ($project_log as $key => $value) {
+            $project_log[$key]['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
+        }
+        // dump($project_log);
+        // View::assign('project_log', $project_log);
+        // return View();
+        return $project_log;
+    }
+
+
+    /**
+     *
+     */
+    public function sift()
+    {
+        return view();
+    }
+
+    /**
+     *项目人员
+     */
+    public function user($id)
+    {
+
+
+        $ids = $this->model->where("id", $id)->field("entrust_maker,review_head,operate_head,operate_team")->find();
+
+        if (empty($ids)) {
+            return [];
+        } else {
+            $ids->toArray();
+        }
+        $idarr = $ids["operate_team"] . ',' . $ids["operate_head"] . ',' . $ids["review_head"] . ',' . $ids["entrust_maker"];
+        $idarr = explode(",", $idarr);
+        $param = [];
+        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
+        $list = $this->Adminmodel->whereIn("id", $idarr)->field("id,nickname,unit_name,mobile,email")->paginate(9999, false, ['query' => $param])
+//        field("a.id,a.nickname,a.unit_name,a.mobile,a.email,d.title,d.type")->join('department d', 'a.unit_name = d.id', 'LEFT')
+            ->each(function ($item) {
+                //获取单位的邮箱,单位信息页没做
+                $item->email = Db::name('department')->where(['id' => $item->unit_name])->value('email');
+                $type = Db::name('department')->where(['id' => $item->unit_name])->value('type');
+                $item->unit_name = Db::name('department')->where(['id' => $item->unit_name])->value('title');
+
+//                dump($type);
+                if ($type == 0) {
+                    $item->unit_type = "委托单位";
+                } elseif ($type == 1) {
+                    $item->unit_type = "送审单位";
+                } elseif ($type == 2) {
+                    $item->unit_type = "评审机构";
+                } else {
+                    $item->unit_type = "施工单位";
+                }
+            })->toArray();
+        $list = $list["data"];
+        $time_id = time();
+        $shigong = $this->model->where('id', $id)->find();
+        if ($shigong["construction_unit"] !== null ||
+            $shigong["construction_head"] !== null ||
+            $shigong["construction_email"] !== null ||
+            $shigong["construction_phone"] !== null
+        ) {
+            $shigongdata["id"] = $time_id;
+            $shigongdata["nickname"] = $shigong["construction_unit"];
+            $shigongdata["unit_name"] = $shigong["construction_head"];
+            $shigongdata["email"] = $shigong["construction_email"];
+            $shigongdata["mobile"] = $shigong["construction_phone"];
+            $shigongdata["unit_type"] = "施工单位";
+            array_push($list, $shigongdata);
+        }
+        $time_id_sent = time() - 200;
+        if ($shigong["sent_review_unit"] !== null ||
+            $shigong["sent_review_head"] !== null ||
+            $shigong["sent_review_phone"] !== null ||
+            $shigong["sent_review_head_email"] !== null
+
+        ) {
+            $sent_review_data["id"] = $time_id_sent;
+            $sent_review_data["nickname"] = $shigong["sent_review_head_name"];
+            $sent_review_data["unit_name"] = $shigong["sent_review_unit_name"];
+            $sent_review_data["email"] = $shigong["sent_review_head_email"];
+            $sent_review_data["mobile"] = $shigong["sent_review_phone"];
+            $sent_review_data["unit_type"] = "送审单位";
+            array_push($list, $sent_review_data);
+        }
+        if (empty($ids['operate_team'])) {
+            $operate_team[] = '0';
+        } else {
+            $operate_team = explode(',', $ids['operate_team']);
+        }
+        for ($i = 0; $i < count($list); $i++) {
+
+            if ($list[$i]['id'] == $ids['entrust_maker']) {
+//                dump($list[$i]['id'],$ids['entrust_maker']);
+                $list[$i]["type"] = 1;
+
+            } elseif ($list[$i]['id'] == $ids['review_head']) {
+                $list[$i]["type"] = 2;
+
+            } elseif ($list[$i]['id'] == $ids['operate_head']) {
+                $list[$i]["type"] = 3;
+
+            } elseif (in_array($list[$i]['id'], $operate_team)) {
+                $list[$i]["type"] = 4;
+
+            } elseif ($list[$i]['id'] == $time_id) {
+
+                $list[$i]["type"] = 5;
+
+
+            } elseif ($list[$i]['id'] !== time() - 1000) {
+                $list[$i]["type"] = 6;
+
+            }
+        }
+
+        $type = array_column($list, 'type');
+        array_multisort($type, SORT_ASC, $list);
+
+
+        return $list;
+    }
+
+
+    /**
+     * 修改个人资料
+     */
+    public function revise()
+    {
+        $person = get_login_admin();
+
+        View::assign('person', $person);
+        return view();
+    }
+
+    /**
+     * 消息通知
+     * 通用
+     */
+    public function notice()
+    {
+
+        $unread_id = Db::name("admin")->where("id", $this->uid)->value("unread");
+        if (empty($unread_id)) {
+            $unread_ids = [];
+        } else {
+            $unread_ids = explode(",", $unread_id);
+        }
+
+        $list = Db::name("ProjectMsg")->where("uid", $this->uid)->select();
+        if (is_object($list)) {
+            $data = $list->toArray();
+        }
+        $real_data = [];
+        foreach ($data as $item => $v) {
+            if (in_array($v["id"], $unread_ids)) {
+                $v["red"] = 1;
+                $real_data[] = $v;
+            } else {
+                $v["red"] = 0;
+                $real_data[] = $v;
+            }
+        }
+        Db::name("admin")->where("id", $this->uid)->update(["unread" => null]);
+        View::assign("msg", $real_data);
+        return view();
+    }
+
+    public function notice_content()
+    {
+        return view();
+    }
+
+    /**
+     * 工作记录
+     */
+    public function record()
+    {
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $detail = (new ProjectRecord())->detail($id);
+        if (empty($detail)) {
+            if (empty($detail)) {
+                echo '<div style="text-align:center;color:red;margin-top:20%;">该记录不存在</div>';
+                exit;
+            }
+            return '';
+        }
+        $maker_name = Db::name('admin')->where(['id' => $detail["maker_id"]])->value("nickname");
+        $detail["maker_name"] = $maker_name;
+
+        View::assign('detail', $detail);
+        View::assign('project_id', $project_id);
+
+        return view();
+    }
+
+    /**
+     * 编辑工作记录
+     */
+    public function record_edit()
+    {
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;//记录id
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $project = Db::name("cost_project")->where("id", $project_id)->value("project_name");
+        $detail = (new ProjectRecord())->getRecordById($id);
+
+        if (!empty($detail)) {
+
+            View::assign('id', $id);
+            View::assign('user_type', $this->user_tpe);
+            View::assign('project_id', $project_id);
+            View::assign('project', $project);
+            View::assign('detail', $detail);
+            return view();
+        } else {
+            throw new \think\exception\HttpException(404, '页面不存在');
+        }
+
+    }
+
+    /**
+     * 添加工作记录
+     */
+    public function record_add()
+    {
+
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;//记录id
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $project = Db::name("cost_project")->where("id", $project_id)->value("project_name");
+        View::assign('id', $id);
+        View::assign('user_type', $this->user_tpe);
+        View::assign('project_id', $project_id);
+        View::assign('project', $project);
+        return view();
+    }
+    public function appointment_add()
+    {
+
+        $param = get_params();
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        View::assign('user_type', $this->user_tpe);
+        View::assign('project_id', $project_id);
+        return view();
+    }
+    /**
+     * 临期表格
+     */
+    public function pending_advent()
+    {
+        $param = get_params();
+        $where = [
+            ["delete_time", "=", 0],
+            ['project_end_time', '<', strtotime('15 days')],
+            ['project_end_time', '>', time()],
+        ];
+        $where2 = [
+            ["delete_time", "=", 0],
+            ['project_end_time', '<', strtotime('15 days')],
+            ['project_end_time', '>', time()],
+            ["project_status", ">", 1]
+        ];
+
+        $where3[] = ["project_status", "<", 8];
+        if (!empty($param['project_status'])) {
+            $where3[] = ['project_status', '=', $param['project_status']];
+        }
+        if (!empty($param['province'])) {
+            $where3[] = ['province', '=', $param['province']];
+        }
+        if (!empty($param['city'])) {
+            $where3[] = ['city', '=', $param['city']];
+        }
+        if (!empty($param['area'])) {
+            $where3[] = ['area', '=', $param['area']];
+        }
+        if (!empty($param['project_end_time'])) {
+            $where3[] = ['project_end_time', '<', $param['project_end_time']];
+        }
+        if (!empty($param['project_start_time'])) {
+            $where3[] = ['project_start_time', '>', $param['project_start_time']];
+        }
+        if (!empty($param['keyword'])) {
+            $keyword = $param['keyword'];
+            $where3[] = ['project_name', 'like', '%' . $keyword . '%'];
+        }
+
+
+
+        if ($this->user_tpe == 0) {
+            $where[] = ["entrust_maker", "=", $this->uid];
+            $where2[] = ["entrust_approver", "=", $this->uid];
+        } else if ($this->user_tpe == 2) {
+            $inarr = array();
+            $review_unit = $this->model->where("review_unit", get_login_admin("unit_name"))->field('id,review_head,operate_head,operate_team')->select()->toArray();
+            for ($i = 0; $i < count($review_unit); $i++) {
+                $a = $review_unit[$i];
+                $ids = $a["review_head"] . ',' . $a["operate_head"] . ',' . $a["operate_team"];
+                $ids = explode(",", $ids);
+                $c = in_array($this->uid, $ids);
+                if ($c) {
+                    $inarr[] = $a["id"];
+                }
+            }
+            $where3[] = ["id","in", $inarr];
+        } else if ($this->user_tpe == 1) {
+            $where[] = ["entrust_maker", "=", $this->uid];
+            $where2[] = ["entrust_approver", "=", $this->uid];
+        }
+
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+        $advent_list = $this->model->where($where3)->where(function ($query) use ($where,$where2) {
+            // 第一组条件(entrust_maker)
+            $query->where(function ($q1) use ($where) {
+                $q1->where($where);
+            });
+            // 使用 OR 连接第二组条件(entrust_approver)
+            $query->whereOr(function ($q2) use ($where2) {
+                $q2->where($where2);
+            });
+        })
+            ->order($order)
+            ->paginate(9999, false, ['query' => $param])
+            ->each(function ($item) {
+                $c = $item->project_end_time - time();
+                $item->advent_time = floor($c / 86400) . "天";
+            });
+
+
+        $list = $this->Auditmodel->alias("a")->join("cost_project c", "a.project_id=c.id", "left")->where("approver", $this->uid)->field("a.*,c.project_num,c.project_status,c.engineering_type,c.sent_review_amount")
+            ->order($order)->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+                $item->approver_name = Db::name("admin")->where("id", $item->approver)->value("nickname");
+
+
+            })->toArray();
+        $red = 0;
+        foreach ($list["data"] as $item => $value) {
+            if ($value["audit_status"] == 1) {
+                $red = 1;
+            }
+        }
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        View::assign('unit_type', $unit_type);
+        View::assign("red_kan", $red_kan);
+        View::assign('red', $red);
+
+        View::assign('advent_list', $advent_list);
+        return view();
+    }
+
+    /**
+     * 逾期项目
+     */
+    public function pending_late()
+    {
+        $param = get_params();
+        $where = [
+            ["delete_time", "=", 0],
+            ['project_end_time', '<', time()],
+        ];
+
+        $where2 = [
+            ["delete_time", "=", 0],
+            ['project_end_time', '<', time()],
+            ["project_status", ">", 1]
+        ];
+        if (!empty($param['project_status'])) {
+            $where[] = ['project_status', '=', $param['project_status']];
+            $where2[] = ['project_status', '=', $param['project_status']];
+        }
+        if (!empty($param['province'])) {
+            $where[] = ['province', '=', $param['province']];
+            $where2[] = ['province', '=', $param['province']];
+        }
+        if (!empty($param['city'])) {
+            $where[] = ['city', '=', $param['city']];
+            $where2[] = ['city', '=', $param['city']];
+        }
+        if (!empty($param['area'])) {
+            $where[] = ['area', '=', $param['area']];
+            $where2[] = ['area', '=', $param['area']];
+        }
+        if (!empty($param['project_end_time'])) {
+            $where[] = ['project_end_time', '<', $param['project_end_time']];
+            $where2[] = ['project_end_time', '<', $param['project_end_time']];
+        }
+        if (!empty($param['project_start_time'])) {
+            $where[] = ['project_start_time', '>', $param['project_start_time']];
+            $where2[] = ['project_start_time', '>', $param['project_start_time']];
+        }
+
+        $where3[] = ["project_status", "<", 8];
+
+        if (!empty($param['keyword'])) {
+            $keyword = $param['keyword'];
+            $where3[] = ['project_name', 'like', '%' . $keyword . '%'];
+        }
+
+        if ($this->user_tpe == 0) {
+            $where[] = ["entrust_maker", "=", $this->uid];
+            $where2[] = ["entrust_approver", "=", $this->uid];
+        } else if ($this->user_tpe == 2) {
+            $inarr = array();
+            $review_unit = $this->model->where("review_unit", get_login_admin("unit_name"))->field('id,review_head,operate_head,operate_team')->select()->toArray();
+            for ($i = 0; $i < count($review_unit); $i++) {
+                $a = $review_unit[$i];
+                $ids = $a["review_head"] . ',' . $a["operate_head"] . ',' . $a["operate_team"];
+                $ids = explode(",", $ids);
+                $c = in_array($this->uid, $ids);
+                if ($c) {
+                    $inarr[] = $a["id"];
+                }
+            }
+            $where3[] = ["id","in", $inarr];
+        } else if ($this->user_tpe == 1) {
+
+        }
+
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+        // halt($where,$where2);
+        $late_list = $this->model->where($where3)
+            ->where(function ($query) use ($where,$where2) {
+                // 第一组条件(entrust_maker)
+                $query->where(function ($q1) use ($where) {
+                    $q1->where($where);
+                });
+                // 使用 OR 连接第二组条件(entrust_approver)
+                $query->whereOr(function ($q2) use ($where2) {
+                    $q2->where($where2);
+                });
+            })->order($order)->paginate(9999, false, ['query' => $param])
+            ->each(function ($item) {
+                $c = time() - $item->project_end_time;
+                $item->advent_time = floor($c / 86400) . "天";
+            });
+        // halt($late_list->toArray());
+        $list = $this->Auditmodel->alias("a")->join("cost_project c", "a.project_id=c.id", "left")->where("approver", $this->uid)->field("a.*,c.project_num,c.project_status,c.engineering_type,c.sent_review_amount")
+            ->order($order)->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+                $item->approver_name = Db::name("admin")->where("id", $item->approver)->value("nickname");
+
+
+            })->toArray();
+
+        $red = 0;
+        foreach ($list["data"] as $item => $value) {
+            if ($value["audit_status"] == 1) {
+                $red = 1;
+            }
+        }
+        $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+        $red_kan = 0;
+        foreach ($red_id as $item => $value) {
+            if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                $red_kan = 1;
+            }
+        }
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        View::assign('unit_type', $unit_type);
+        View::assign("red_kan", $red_kan);
+        View::assign('red', $red);
+
+        View::assign('late_list', $late_list);
+        return view();
+
+    }
+
+    /**
+     * 邀请函
+     */
+    public function invite()
+    {
+        $param = get_params();
+        $id = isset($param['id']) ? $param['id'] : 0;//记录id
+        $project_id = isset($param['project_id']) ? $param['project_id'] : 0;
+        $project = Db::name("cost_project")->where("id", $project_id)->value("project_name");
+        $detail = (new Contact())->detail($id);
+        $file_array = Db::name('contact')
+            ->field("r.*,a.nickname as admin_name,f.name,f.filesize,f.filepath,f.fileext,f.admin_id")
+            ->alias('r')
+            ->join('File f', 'r.file = f.id')
+            ->join('Admin a', 'r.maker_id = a.id', 'LEFT')
+            ->order('r.create_time desc')
+            ->where(array('r.id' => $id))
+            ->select()->toArray();
+
+        if (!empty($detail)) {
+
+            View::assign('id', $id);
+            View::assign('project_id', $project_id);
+            View::assign('project', $project);
+            View::assign('detail', $detail);
+            View::assign('file_array', $file_array);
+
+            return view();
+        } else {
+            throw new \think\exception\HttpException(404, '页面不存在');
+        }
+
+    }
+
+    public function cost_detail()
+    {
+        return view();
+    }
+
+    public function login()
+    {
+        return view();
+    }
+
+
+    /**
+     * 关联账号
+     * 通用
+     *
+     */
+    public function associated()
+    {
+
+        $param = get_params();
+
+        $id = get_login_admin("id");
+
+        $acct_connect = Db::name('Admin')->where('id', $id)->value('acct_connect');
+
+        $where = array();
+        $where[] = ['status', '>=', 0];
+
+        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
+        $admins = AdminList::where($where)->with('Department')
+            ->where('id', 'in', $acct_connect)
+            ->order('create_time asc')
+            ->paginate(9999, false, ['query' => $param])
+            ->each(function ($item, $key) {
+                $groupId = Db::name('AdminGroupAccess')->where(['uid' => $item->id])->column('group_id');
+                $groupName = Db::name('AdminGroup')->where('id', 'in', $groupId)->column('title');
+                $item->groupName = implode(',', $groupName);
+                $item->last_login_time = empty($item->last_login_time) ? '-' : date('Y-m-d H:i', $item->last_login_time);
+            })->toArray();
+
+        View::assign('admin', $admins["data"]);
+
+        return view();
+
+    }
+
+    // cp请款函内容
+    public function request_detail()
+    {
+        $param = get_params();
+
+        return view();
+    }
+
+    /**
+     * 查看审批进度
+     */
+    public function progress()
+    {
+        $param = get_params();
+
+        $id = isset($param['id']) ? $param['id'] : 0;
+
+        $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
+        $order = empty($param['order']) ? 'id desc' : $param['order'];
+
+        $list = $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('else_id', $id)->order('create_time', "sec")
+            ->select()
+            ->each(function ($item) {
+                switch ($item["audit_type"]) {
+                    case 4:
+                        $item->else_name = "报告一级审核";
+                        break;
+                    case 5:
+                        $item->else_name = "报告二级审核";
+                        break;
+                    case 6:
+                        $item->else_name = "报告三级审核";
+                        break;
+                }
+            });
+
+        View::assign('list', $list);
+        return view();
+    }
+
+    /**
+     * 通讯录
+     */
+    /**
+     * 通讯录
+     */
+    public function contacts()
+    {
+        $param = get_params();
+        $where = [];
+        if (!empty($param["keyword"])) {
+            $where = [["a.nickname|d.title", "like", "%" . $param["keyword"] . "%"]];
+        }
+        //0:财政局;1:业主;2:公司
+        if ($this->user_tpe == 0) {
+            //财评内部
+            $list = Db::name("admin")->alias("a")
+                ->where("a.unit_name", get_login_admin("unit_name"))
+                ->where("a.status", 1)
+                ->where($where)
+                ->join("department d", "a.did=d.id", "left")
+                ->field("a.id,d.title,a.nickname,a.mobile,a.email")->select();
+        } else if ($this->user_tpe == 1) {
+            //业主内部
+            $list = Db::name("admin")->alias("a")
+                ->where("a.unit_name", get_login_admin("unit_name"))
+                ->where("a.status", 1)
+                ->where($where)
+                ->join("department d", "a.did=d.id", "left")
+                ->field("a.id,d.title,a.nickname,a.mobile,a.email")
+                ->select();
+        } else if ($this->user_tpe == 2) {
+            $list = Db::name("admin")->alias("a")
+                ->where("a.unit_name", get_login_admin("unit_name"))
+                ->where("a.status", 1)
+                ->where($where)
+                ->join("department d", "a.did=d.id", "left")
+                ->field("a.id,d.title,a.nickname,a.mobile,a.email")
+                ->select();
+        }
+        View::assign('list', $list);
+        return view();
+    }
+
+
+    public function contacts_exterior()
+    {
+        $param = get_params();
+        $where = [];
+        if (!empty($param["keyword"])) {
+            $where = [["a.nickname|d.title", "like", "%" . $param["keyword"] . "%"]];
+        }
+        //0:财政局;1:业主;2:公司
+        if ($this->user_tpe == 0) {
+            //公司负责人
+            $list_company = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 2], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+            $list_proprietor = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 1], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)
+                ->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+            $list_exterior = array_merge($list_company,$list_proprietor);
+        } else if ($this->user_tpe == 1) {
+            //公司负责人
+            $list_company = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 2], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+            //财评负责人
+            $list_entrust = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 0], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)
+                ->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+
+            $list_exterior = array_merge($list_company,$list_entrust);
+        } else if ($this->user_tpe == 2) {
+            //公司内部通讯录
+            $list_entrust = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 0], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)
+                ->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+            $list_proprietor = Db::name('department')->alias('d')->join("admin a", "d.leader_id=a.id")
+                ->where([["d.type", "=", 1], ["pid", "=", 0], ["d.status", "=", 1]])
+                ->where($where)
+                ->field("d.id,d.title,d.type,a.nickname,a.mobile,a.email")
+                ->select()->toArray();
+            $list_exterior = array_merge($list_proprietor,$list_entrust);
+        }
+        View::assign('list_exterior', $list_exterior);
+        return view();
+    }
+
+    public function getProjectFive()
+    {
+        $where = [
+            ['name', '=', '作业日志-财政局'],
+            ['name', '=', '工作记录-财政局'],
+            ['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');
+        $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules');
+        $login_rules = explode(',', $login_rules);
+        $rules_id = array();
+        foreach ($list as $key => $value) {
+            if ($value['name'] == "作业日志-财政局") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_comments'] = 1;
+                } else {
+                    $rules_id['project_comments'] = 0;
+                }
+            } else if ($value['name'] == "工作记录-财政局") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_record'] = 1;
+                } else {
+                    $rules_id['project_record'] = 0;
+                }
+            } else if ($value['name'] == "项目报告-财政局") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_report'] = 1;
+                } else {
+                    $rules_id['project_report'] = 0;
+                }
+            } else if ($value['name'] == "项目人员-财政局") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_user'] = 1;
+                } else {
+                    $rules_id['project_user'] = 0;
+                }
+            } else if ($value['name'] == "项目动态-财政局") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_log'] = 1;
+                } else {
+                    $rules_id['project_log'] = 0;
+                }
+            } else if ($value['name'] == "项目附件-财政局") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_file'] = 1;
+                } else {
+                    $rules_id['project_file'] = 0;
+                }
+            } else if ($value['name'] == "联系函-财政局") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_contact'] = 1;
+                } else {
+                    $rules_id['project_contact'] = 0;
+                }
+            }
+        }
+
+        return $rules_id;
+    }
+    public function getProjectFiveCompany()
+    {
+        $where = [
+            ['name', '=', '作业日志-公司'],
+            ['name', '=', '工作记录-公司'],
+            ['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');
+        $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules');
+        $login_rules = explode(',', $login_rules);
+        $rules_id = array();
+        foreach ($list as $key => $value) {
+            if ($value['name'] == "作业日志-公司") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_comments'] = 1;
+                } else {
+                    $rules_id['project_comments'] = 0;
+                }
+            } else if ($value['name'] == "工作记录-公司") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_record'] = 1;
+                } else {
+                    $rules_id['project_record'] = 0;
+                }
+            } else if ($value['name'] == "项目报告-公司") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_report'] = 1;
+                } else {
+                    $rules_id['project_report'] = 0;
+                }
+            } else if ($value['name'] == "项目人员-公司") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_user'] = 1;
+                } else {
+                    $rules_id['project_user'] = 0;
+                }
+            } else if ($value['name'] == "项目动态-公司") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_log'] = 1;
+                } else {
+                    $rules_id['project_log'] = 0;
+                }
+            } else if ($value['name'] == "项目附件-公司") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_file'] = 1;
+                } else {
+                    $rules_id['project_file'] = 0;
+                }
+            } else if ($value['name'] == "联系函-公司") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_contact'] = 1;
+                } else {
+                    $rules_id['project_contact'] = 0;
+                }
+            }
+        }
+
+        return $rules_id;
+    }
+
+    public function getProjectFiveYezhu()
+    {
+        $where = [
+            ['name', '=', '作业日志-业主'],
+            ['name', '=', '工作记录-业主'],
+            ['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');
+        $login_rules = Db::name('AdminGroup')->where('id', $group_id)->value('rules');
+        $login_rules = explode(',', $login_rules);
+        $rules_id = array();
+        foreach ($list as $key => $value) {
+            if ($value['name'] == "作业日志-业主") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_comments'] = 1;
+                } else {
+                    $rules_id['project_comments'] = 0;
+                }
+            } else if ($value['name'] == "工作记录-业主") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_record'] = 1;
+                } else {
+                    $rules_id['project_record'] = 0;
+                }
+            } else if ($value['name'] == "项目报告-业主") {
+
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_report'] = 1;
+                } else {
+                    $rules_id['project_report'] = 0;
+                }
+            } else if ($value['name'] == "项目人员-业主") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_user'] = 1;
+                } else {
+                    $rules_id['project_user'] = 0;
+                }
+            } else if ($value['name'] == "项目动态-业主") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_log'] = 1;
+                } else {
+                    $rules_id['project_log'] = 0;
+                }
+            } else if ($value['name'] == "项目附件-业主") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_file'] = 1;
+                } else {
+                    $rules_id['project_file'] = 0;
+                }
+            } else if ($value['name'] == "联系函-业主") {
+                if (in_array($value['id'], $login_rules)) {
+                    $rules_id['project_contact'] = 1;
+                } else {
+                    $rules_id['project_contact'] = 0;
+                }
+            }
+        }
+
+        return $rules_id;
+    }
+
+    public function read_company()
+    {
+        $param = get_params();
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+
+        // halt($param);
+        $a = time();
+        $id = isset($param["project_id"]) ? $param["project_id"] : $a;
+
+        if ($id == $a) {
+            $datas = array();
+            $datas["data"] = null;
+            return table_assign(0, "无项目", $datas);
+        }
+        $project = Db::name("appropriation_project")->where("uid", $id)->select();
+        $datas["data"] = $project;
+        $datas["total"] = count($project);
+
+        if ($param["type"] > 9) {
+            $a = time();
+            $id = isset($param["project_id"]) ? $param["project_id"] : $a;
+            $detail = Db::name("appropriation")->where("id", $id)->find();
+            $file_array = Db::name('ProjectFile')
+                ->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.nickname as admin_name')
+                ->alias('mf')
+                ->join('File f', 'mf.file_id = f.id', 'LEFT')
+                ->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
+                ->order('mf.create_time desc')
+                ->where(array('mf.topic_id' => $id, 'mf.module' => 'appropriation'))
+                ->select()->toArray();
+            $where = [
+                ["approver", "=", $this->uid],
+                ["audit_status", "<", 5]
+            ];
+            $list = $this->Auditmodel->alias("a")->join("cost_project c", "a.project_id=c.id", "left")
+                ->where($where)->where('audit_status',1)->where('audit_type','in',[10,11,12])
+                ->field("a.*,c.project_num,c.project_status,c.engineering_type,c.sent_review_amount")
+                ->paginate(9999, false, ['query' => $param])
+                ->each(function ($item, $key) {
+                    $item->approver_name = Db::name("admin")->where("id", $item->approver)->value("nickname");
+                })->toArray();
+            // halt($list);
+            $red = 0;
+            foreach ($list["data"] as $item => $value) {
+                if ($value["audit_status"] == 1) {
+                    $red = 1;
+                }
+            }
+
+            $red_id = Db::name("new_msg")->where("uid", "=", $this->uid)->select();
+            $red_kan = 0;
+
+            foreach ($red_id as $item => $value) {
+                if ($value["detail"] || $value["comment"] || $value["report"] || $value["user"] || $value["contact"]) {
+                    $red_kan = 1;
+                }
+            }
+
+            if($unit_type == 2){
+                $auditdata = $this->Auditmodel->where('id',$param['id'])->find();
+                $detail['audit_status'] = $auditdata['audit_status'];
+                View::assign('auditdata', $auditdata);
+            }else{
+                $detail['audit_status'] = 0;
+            }
+            // halt($audit_status,$id);
+            // halt($list);
+
+            View::assign('unit_type', $unit_type);
+            View::assign('datas', $datas['data']);
+            View::assign('id', $id);
+            View::assign('detail', $detail);
+            View::assign("red_kan", $red_kan);
+            View::assign('red', $red);
+            View::assign('file_array', $file_array);
+            return view();
+        }
+
+
+    }
+
+    public function datastat(){
+
+        return View();
+    }
+
+    public function contract()
+    {
+        return view();
+    }
+
+    public function contract_detail()
+    {
+        return view();
+    }
+    public function data_statistics($today = 2024)
+    {
+
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        if($unit_type == 2){
+            $all_sent_review_cost_company = $this->Datastat->sent_review_cost_company($today);
+            $review_poportion_company = $this->Datastat->review_poportion_company();
+            $sent_poportion_company = $this->Datastat->sent_poportion_company();
+            View::assign('all_sent_review_cost_company', $all_sent_review_cost_company);
+            View::assign('review_poportion_company', $review_poportion_company);
+            View::assign('sent_poportion_company', $sent_poportion_company);
+        }elseif($unit_type == 0){
+            $all_sent_review_cost = $this->Datastat->sent_review_cost($today);
+            $review_poportion = $this->Datastat->review_poportion();
+            $sent_poportion = $this->Datastat->sent_poportion();
+            View::assign('sent', $all_sent_review_cost);
+            View::assign('review_poportion', $review_poportion);
+            View::assign('sent_poportion', $sent_poportion);
+        }
+        View::assign('unit_type', $unit_type);
+
+        return view();
+    }
+
+    public function data_statistics_member($today = 2024)
+    {
+        $unit_type = Db::name("department")->where("id", get_login_admin("unit_name"))->value("type");
+        $cost_project_member = $this->Datastat->cost_project_member($today);
+        $cost_month_member = $this->Datastat->cost_month_member($today);
+        View::assign('unit_type', $unit_type);
+        View::assign('cost_project_member', $cost_project_member);
+        View::assign('cost_month_member', $cost_month_member);
+        return View();
+    }
+}
+
+
+

+ 1202 - 0
app/mobile/view/temporary/detail.html

@@ -0,0 +1,1202 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>逸管FEP</title>
+    <link rel="stylesheet" href="{__MOBILE__}/css/base.css">
+    <link rel="stylesheet" href="{__MOBILE__}/css/detail.css">
+    <link rel="stylesheet" href="{__MOBILE__}/css/temporary_detail.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui/css/layui.css">
+    <script src="{__JS__}/jquery.min.js"></script>
+    <link rel="stylesheet" href="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/css/layui.css">
+
+</head>
+
+<body>
+<div class="top">
+    <a href="{:url('mobile/temporary/kan_list')}">
+        <div><img src="{__MOBILE__}/img/left.png" alt="" style="width: 5vw;"></div>
+    </a>
+    <div style="margin-left: 36vw;">看板</div>
+
+
+    <div class="dropdown">
+        <!-- <button onclick="dropdown()" class="dropbtn" style="margin-left: 28vw;background: url({__MOBILE__}/img/list.png) no-repeat;width: 5vw;"> -->
+        <button onclick="dropdown()" class="dropbtn" style="margin-left: 33vw;">
+
+
+            <img src="{__MOBILE__}/img/list.png" alt="" style="width: 5vw;pointer-events: none;">
+        </button>
+        <div id="myDropdown" class="dropdown-content" style="width: 24vw;">
+            <a href="{:url('mobile/index/main')}">首页</a>
+            <a href="{:url('mobile/index/kan_list')}">看板</a>
+            <a href="{:url('mobile/index/pending')}">待处理</a>
+            <a href="{:url('mobile/index/person')}">我的</a>
+        </div>
+    </div>
+</div>
+<div class="layui-tab layui-tab-brief" style="margin-top: 13vw;"  lay-filter="test-hash">
+
+    <ul class="layui-tab-title" style="background-color: #fff;" id="ullist">
+        
+        <li class="layui-this">项目概览<span id="li_first" class="dot-img hongdian" >{if $red.detail}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">{/if}</span></li>
+        
+        {if $project_five.project_user == 1}
+        <li data-id="1">项目人员<span class="dot-img hongdian">{if $red.user}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">{/if}</span></li>
+        {/if}
+        
+        {if $project_five.project_report == 1}
+        <li data-id="2">项目报告<span class="dot-img hongdian">{if $red.report}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">{/if}</span></li>
+        {/if}
+        
+        {if $project_five.project_contact == 1}
+        <li data-id="3">联系函<span class="dot-img hongdian">{if $red.contact}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">{/if}</span></li>
+        {/if}
+        
+        <li data-id="4">请款详情</li>
+        
+        {if $project_five.project_comments == 1}
+        <li data-id="5">作业日志<span class="dot-img hongdian">{if $red.comment}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">{/if}</span></li>
+        {/if}
+
+        {if $project_five.project_record == 1}
+        <li data-id="6">工作记录</li>
+        {/if}
+
+
+        {if $project_five.project_log == 1}
+        <li data-id="7">项目动态</li>
+        {/if}
+
+        <li data-id="8">预约看现场</li>
+
+        <li data-id="9">二维码</li>
+    </ul>
+
+    <div class="layui-tab-content">
+        <!-- 项目概览 -->
+        <div class="layui-tab-item layui-show">
+            <div class="detail-basic">
+                <div class="basic-top">
+                    <div class="basic-title">
+                            <div class="title-img">
+                                <span><img src="{__MOBILE__}/img/project1.png" alt=""
+                                           style="width: 5vw;margin-right: 1vw;"></span>
+                                <span style="font-size: 2vh;"><b>{if $field.project_name}{$detail.project_name}{/if}</b></span>
+                            </div>
+
+                            <div>
+                                <button id="followBtn">关注项目</button>
+                            </div>
+                    </div>
+                    
+                    <div style="display:flex;align-items: center;">
+                        
+                            <span class="title-img" style="color: #1287ff;">
+                                <span><img src="{__MOBILE__}/img/await.png" alt="" style="width: 5vw;"></span>&nbsp;
+                                <span style="font-weight:600;">
+                                    {if $field.project_status}
+                                    {switch $detail.project_status}
+                                    {case 1}<span style="color: #ffaa64">财评立项中</span>{/case}
+                                    {case 2}<span style="color: #b30095">财评审批中</span>{/case}
+                                    {case 3}<span style="color: #769fcd">公司待接收</span>{/case}
+                                    {case 4}<span style="color: #005fa8">待分配</span>{/case}
+                                    {case 5}<span style="color: #1e9fff">作业中</span>{/case}
+                                    {case 6}<span style="color: #007244">归档中</span>{/case}
+                                    {case 7}<span style="color: #881f1f">退审中</span>{/case}
+                                    {case 8}<span style="color: #16b777">已归档</span>{/case}
+                                    {case 9}<span style="color: #d81e06">已退审</span>{/case}
+                                    {case 0}
+                                    {switch $vo.proprietor_status}
+                                    {case 0}<span style="color: #ffb800">业主立项中</span>{/case}
+                                    {case 1}<span style="color: #b30095">业主审核中</span>{/case}
+                                    {case 2}<span style="color: #b88230">财评待接收</span>{/case}
+                                    {/switch}
+                                    {/case}
+                                    {default /}未知
+                                    {/switch}
+                                    {/if}
+                                </span>
+                            </span>
+
+                            <span style="padding-left: 5vw;">
+                                <b>
+    
+                                    {switch $detail.report_status}
+                                        {case 0}<span style="color: #ffb800">初稿中</span>{/case}
+                                        {case 1}<span style="color: #005fa8">对数中</span>{/case}
+                                        {case 2}<span style="color: #ea8816">审定中</span>{/case}
+                                        {case 3}<span style="color: #16b777">已审定</span>{/case}
+                                        {default /}未知
+                                    {/switch}
+                                </b>
+                            </span>
+                        
+                        
+                        
+                    </div>
+
+                </div>
+
+            </div>
+            <div class="basic-top-inner">
+
+                {if $field.project_num}
+                <div class="basic-inner">
+                    项目编号:{$detail.project_num}
+                </div>
+                {/if}
+
+                <div class="basic-inner">
+                    {if $field.engineering_type}<span>项目类型:{$detail.engineering_type} </span>{/if} {if $field.engineering_category}<span>工程类别: {$detail.engineering_category} </span>{/if}
+                </div>
+                
+                {if $field.fiscal_nature}
+                <div class="basic-inner">
+                    资金性质:{$detail.fiscal_nature}
+                </div>
+                {/if}
+
+                {if $field.project_region}
+                <div class="basic-inner">
+                    项目区域:{$detail.province}-{$detail.city}-{$detail.area}
+                </div>
+                {/if}
+
+                {if $field.project_scale}
+                <div class="basic-inner">
+                    项目规模:{$detail.project_scale}
+                </div>
+                {/if}
+
+                {if $field.charge_standard}
+                <div class="basic-inner">
+                    收费标准:{$detail.charge_standard}
+                </div>
+                {/if}
+
+                {if $field.project_time}
+                <div class="basic-inner">
+                    项目周期:{$detail.project_start_time|date="Y-m-d"}&nbsp;至&nbsp;{$detail.project_end_time|date="Y-m-d"}
+                </div>
+                {/if}
+            </div>
+            <div class="bottom-top">
+                <span><img src="{__MOBILE__}/img/unit.png" alt="" style="width: 6vw;"></span><span
+                    style="font-size: 2vh;"><b>相关单位</b></span>
+            </div>
+            <div class="basic-bottom">
+                <div class="bottom">
+                    {if $field.entrust_unit}
+                    <div class="bottom-item"><span>委托单位:{$detail.entrust_unit_name}</span></div>
+                    {/if}
+
+                    {if $field.entrust_head}
+                    <div class="bottom-person"><span>负责人:{$detail.entrust_maker_name}</span></div>
+                    {/if}
+
+                    {if $field.sent_review_unit}
+                    <div class="bottom-item"><span>送审单位:{$detail.sent_review_unit_name}</span></div>
+                    {/if}
+
+                    {if $field.sent_review_head}
+                    <div class="bottom-person"><span>负责人:{$detail.sent_review_head_name}</span></div>
+                    {/if}
+
+                    {if $field.review_unit}
+                    <div class="bottom-item"><span>评审机构:{$detail.review_unit_name}</span></div>
+                    {/if}
+
+                    {if $field.review_head||$field.operate_name}
+                    <div class="bottom-person" style="display: flex;">
+                        {if $field.review_head}
+                        <span style="width: 50%;">项目负责人:{$detail.review_head_name}</span>
+                        {/if}
+
+                        {if $field.operate_name}
+                        <span>作业负责人:{$detail.operate_head_name}</span></div>
+                        {/if}
+
+                    {/if}
+                    {if $field.operate_team_names}
+                    <div class="bottom-person">
+                        <span>作业成员:{$detail.operate_team_names}</span>
+                    </div>
+                    {/if}
+                </div>
+            </div>
+            <div class="bottom-top">
+                <span><img src="{__MOBILE__}/img/money.png" alt="" style="width: 6vw;"></span><span
+                    style="font-size: 2vh;"><b>金额详情</b></span>
+            </div>
+            <div class="basic-money">
+                {if $field.sent_review_amount}
+                <div class="money-inner">
+                    <span>送审金额:{$detail.sent_review_amount}元</span>
+                </div>
+                {/if}
+
+                {if $field.authorize_amount||$field.review_add_reduce_amount}
+                <div class="money-inner">
+                    {if $field.authorize_amount}
+                    <span class="long">审定金额:{$detail.authorize_amount}元</span>
+                    {/if}
+                </div>
+                
+                <div class="money-inner">
+                    {if $field.review_add_reduce_amount}
+                    <span>审增金额:{$detail.review_add_amount}元</span>
+                    {/if}
+                    {if $field.review_add_reduce_amount}
+                    <span>审减金额:{$detail.review_reduce_amount}元</span>
+                    {/if}
+                </div>
+                {/if}
+
+                {if $field.review_add_reduce_rate||$field.sent_review_cost}
+                <div class="money-inner">
+                    {if $field.review_add_reduce_rate}
+                    <span>审增减率:{$detail.review_add_reduce_rate}%</span>
+                    {/if}
+
+                    {if $field.sent_review_cost}
+                    <span>送审服务费:{$detail.sent_review_cost}元</span>
+                    {/if}
+                </div>
+                {/if}
+
+                {if $field.sent_review_approver_amount}
+                <div class="money-inner">
+                    <span class="long">送审单位承担审核费:{$detail.sent_review_approver_amount}元</span>
+                </div>
+                {/if}
+
+                {if $field.construction_approver_amount}
+                <div class="money-inner">
+                    <span class="long">施工单位负责核减超5%评审费部分:{$detail.construction_approver_amount}元</span>
+                </div>
+                {/if}
+            </div>
+
+            <div class="bottom-top">
+                <span><img src="{__MOBILE__}/img/annex.png" alt="" style="width: 6vw;"></span><span
+                    style="font-size: 2vh;"><b>相关附件</b></span>
+            </div>
+            <div id="filesBox2">
+                <div class="filelist" id="filesBigBox">
+                    <ul id="filesBox">
+                        {:fileCard($file_array)}
+
+                    </ul>
+                    {empty name="$file_array" }
+                    <div class="layui-data-none" style="text-align: center;padding-bottom: 3vw;">暂无附件</div>
+                    {/empty}
+
+                </div>
+
+                <!-- {empty name="$file_array" }
+            <div class="layui-data-none">暂无附件</div>
+            {/empty} -->
+            </div>
+        </div>
+        <!-- 项目人员 -->
+        {if $project_five.project_user == 1}
+        <div class="layui-tab-item">
+
+            {volist name="person" id="vo"}
+            <div class="person">
+                <div><img src="{__MOBILE__}/img/line.png" alt="" style="width: 5vw;height: 4vw;"></div>
+                <div>
+                    <div class="person-content">
+                        <div class="content">
+                            <span>成员姓名:{$vo.nickname}</span>
+                        </div>
+                        <div class="content">
+                            <span>所在单位:{$vo.unit_name}</span>
+                        </div>
+                        <div class="content">
+                                <span>成员类型:{switch $vo.type}
+                                    {case 1}项目负责人{/case}
+                                    {case 2}项目负责人{/case}
+                                    {case 3}项目负责人{/case}
+                                    {case 4}项目负责人{/case}
+                                    {case 5}项目负责人{/case}
+                                    {case 6}项目负责人{/case}
+                                    {default /}
+                                    {/switch}
+                                    </span>
+                        </div>
+                        <div class="content">
+                                <span>单位类型:{$vo.unit_type}
+                                </span>
+                        </div>
+                        <div class="content">
+                                <span>
+                                    手机号码:<a href="tel://{$vo.mobile}">{$vo.mobile}</a>
+                                </span>
+
+                        </div>
+                        <div class="content">
+                            <span>单位邮箱:{$vo.email}</span>
+                        </div>
+                    </div>
+
+                </div>
+            </div>
+            {/volist}
+        </div>
+        {/if}
+        
+        <!-- 项目报告 -->
+        {if $project_five.project_report == 1}
+        <div class="layui-tab-item">
+
+            <div class="detail-report">
+                {volist name="report" id="vo"}
+                <a href="{:url('mobile/index/report_detail')}?id={$vo.id}&project_id={$project_id}">
+                <div class="report-item">
+                    <div class="report-top">
+                        <span style="font-size: 2vh;width:70vw;"><b>{$vo.title}</b></span>
+                                <span style="display: flex;align-items: center;font-size: 1.5vh;color: #187FDD;">
+                                    <span><b>查看详情</b></span>
+                                    <span><img src="{__MOBILE__}/img/right.png" alt=""
+                                               style="width: 4vw;height: 3.5vw;">
+                                    </span>
+                                </span>
+                    </div>
+
+                    <div class="report-content" style="margin-bottom: 1.5vw;">
+                            <span class="report-overdue">
+                                <span>报告类型:
+                                    {switch $vo.type}
+                                    {case 0}初审报告{/case}
+                                    {case 1}对数报告{/case}
+                                    {case 2}定案报告{/case}
+                                    {default /}未知
+                                    {/switch}
+                                </span>
+                                <span>创建人:{$vo.nickname}</span>
+                            </span>
+                    </div>
+                    <div class="report-content"
+                         style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 1.5vw;">
+                        <span style="color: darkgray;"><b>{$vo.create_time|date="Y-m-d"}</b></span>
+                    </div>
+                </div>
+                </a>
+                {/volist}
+
+            </div>
+        </div>
+        {/if}
+        
+        <!-- 联系函 -->
+        {if $project_five.project_contact == 1}
+        <div class="layui-tab-item">
+            {volist name="contact" id="vo"}
+            <a href="{:url('mobile/index/invite')}?id={$vo.id}">
+            <div class="record1">
+                <div class="record-top">
+                    <div class="record-title" style="width:73vw;">
+                        <span><img src="{__MOBILE__}/img/invite.png" alt="" style="width: 5vw;"></span>&nbsp;
+                        <span><b>联系函名称:{$vo.title}</b></span>
+                    </div>
+                    <div style="display: flex;align-items: center;">
+                                    <span style="color: #187FDD;font-size: 1.5vh;">
+                                        <span><b>查看详情</b></span>
+                                    </span>
+                                        <span>
+                                            <img src="{__MOBILE__}/img/right.png" alt="" style="width: 4vw;height: 3.5vw;">
+                                        </span>
+                        
+                    </div>
+                </div>
+                <div>
+                    <div class="invite-bottom">
+                        <span style="width: 50%;">创建人:{$vo.admin_name}</span>
+                        <!--                        <span>审批人:{$vo.title}</span>-->
+                    </div>
+                    <div>
+                                    <span>审批状态:{switch $vo.status}
+                                        {case 0}未审核(新建){/case}
+                                        {case 1}已通过(新建){/case}
+                                        {case 2}已拒绝(新建){/case}
+                                        {case 3}未审核(删除){/case}
+                                        {case 4}已通过(删除){/case}
+                                        {case 5}已拒绝(删除){/case}
+                                        {default /}未知
+                                        {/switch}</span>
+                    </div>
+                    <div>
+                        <span>创建时间:{$vo.create_time|date="Y-m-d"}</span>
+                    </div>
+                </div>
+
+            </div>
+            </a>
+            {/volist}
+        </div>
+        {/if}
+        <!-- 请款详情 -->
+        <div class="layui-tab-item">
+            <div class="detail-request">
+                {if !empty($appropriation)}
+                <div class="request-title" style="display:flex;justify-content:space-between;align-items: center;">
+                    <span>
+                        <span><img src="{__MOBILE__}/img/project1.png" alt="" style="width: 5vw;margin-right: 1vw;"></span>
+                        <span style="font-size: 2vh;margin-bottom:1vw;"><b>请款函</b></span>
+                    </span>
+                    <span style="margin-right:3vw;">
+                        <b>
+                            {switch $appropriation.status}
+                                {case -2}<span style="color: #881f1f">立项未通过</span>{/case}
+                                {case -1}<span style="color: #b30095">立项审核中</span>{/case}
+                                {case 0}<span style="color: #ffb800">立项中</span>{/case}
+                                {case 1}<span style="color: #ea8816">待审核</span>{/case}
+                                {case 2}<span style="color: #16b777">已通过</span>{/case}
+                                {case 3}<span style="color: #d81e06">已拒绝</span>{/case}
+                            {/switch}
+                        </b>
+                    </span>
+                </div>
+                
+                <div class="request-item">
+                    <div class="request-content">
+                            <span class="request-overdue" style="display:flex;">
+                                <span style="width:100%;">送审单位:{$appropriation.review_unit_name}</span>
+                            </span>
+                            <span class="request-overdue">
+                                <span style="width:100%;">创建人名称:</span>
+                            </span>
+                        <span class="request-overdue">
+                                <span style="width:100%;">送审服务费:{$appropriation.appropriation_amount}元</span>
+                            </span>
+                        <span class="request-overdue">
+                                <span>请款金额:{$appropriation.appropriation_amount}元</span>
+                                <span>回款金额:{if $appropriation.status==2}{$appropriation.appropriation_amount}{else /}0.00{/if}元</span>
+                            </span>
+                        <span class="request-overdue-long">
+                                <span  style="margin-bottom: 1vw !important;">相关项目:{foreach $appropriation.project_name as $v }{$v}</span>
+                                <br>
+                            <!--<span style="padding-left:18.5vw;"></span>-->
+                                {/foreach}
+                            </span>
+                        <span class="request-overdue">
+                                <span style="width:100%;">请款时间:{$appropriation.appropriation_time|date="Y-m-d"}</span>
+                            </span>
+                            <span class="request-overdue">
+                                <span style="width:100%;">回款时间:</span>
+                            </span>
+                    </div>
+                </div>
+                <div class="request-item">
+                    <div class="request-content">
+                            <span class="request-overdue">
+                                <span style="width:100%;">委托单位:{$appropriation.entrust_unit_name}</span>
+                            </span>
+                        <span class="request-overdue">
+                                <span>是否开票:
+                                    {switch $appropriation.invoice_status}
+                                    {case 1}是 {/case}
+                                    {case 0}否 {/case}
+                                    {/switch}
+                                    </span>
+                            </span>
+                        <span class="request-overdue">
+                                <span>发票编号:{$appropriation.invoicing_num}</span>
+                            </span>
+                        <span class="request-overdue">
+                                <span>发票类型:
+                                    {switch $appropriation.invoice_type}
+                                    {case 1}普通发票{/case}
+                                    {case 2}专用发票{/case}
+                                    {case 3}电子普票/case}
+                                    {case 4}电子专票{/case}
+                                    {/switch}</span>
+                            </span>
+                        <span class="request-overdue">
+                                <span>发票金额:{$appropriation.invoicing_amount}元</span>
+                            </span>
+                    </div>
+                </div>
+
+                <div class="request-annex">
+                    <div class="annex-title">
+                        <img src="{__MOBILE__}/img/annex.png" alt="" style="width: 5vw;">&nbsp;<b>附件</b>
+                    </div>
+                    <div class="annex-content" >
+                        <ul>
+                            {:fileCard($appropriation_file_array)}
+                        </ul>
+                        {empty name="$appropriation_file_array" }
+                        <div class="layui-data-none" style="text-align: center;padding-bottom: 3vw;">暂无附件</div>
+                        {/empty}
+                    </div>
+                </div>
+                {else /}
+                <div style="margin: 3vw;background-color: #fff;text-align: center;padding: 2vw;box-shadow: 0 1px 3px 0 rgb(5 32 96 / 10%);">暂无请款</div>
+                {/if}
+            </div>
+
+        </div>
+        
+        <!-- 作业日志 -->
+        {if $project_five.project_comments == 1}
+        <div class="layui-tab-item">
+            <div id="comments">
+                {volist name="comment" id="vo"}
+                <div class="detail-log">
+                    <div class="log-top">
+                        <span>{$vo.maker}</span>
+                        <span
+                                class="{if $vo.unit_type==2}log-company{else}log-financial{/if}">{$vo.unit_name}</span>
+                        <span>{$vo.create_time|date="y-m-d H:i"}</span>
+                    </div>
+
+                    <div class="log-bottom" style="width: fit-content;padding-left: 10px;padding-right: 10px;">
+                        <div>{$vo.content}</div>
+                        {if !empty($vo.thumb)}
+                        <div class="log_content_img informBlock" >
+                            <div class="content_img" ><img src="{$vo.thumb}" alt="" style="width: auto;"></div>
+                        </div>
+
+                        <section class="imgzoom_pack">
+                            <div class="imgzoom_x">
+                                <div class="imgzoom_img">
+                                    <img src="" alt="">
+                                </div>
+                            </div>
+                        </section>
+                        {/if}
+                    </div>
+
+                </div>
+                {/volist}
+            </div>
+            <div class="log_item_bottom"
+                 style="position: fixed;bottom: 0;width: 100vw;background-color: #fff;border-top: 0.25vw solid #eee;">
+                <div class="layui-form log_bottom_left">
+                    <form class="layui-form">
+                        <!-- <div style="margin-left: 2vw;">普通文本域</div> -->
+                        <div class="logimg">
+                            <div class="layui-form-item layui-form-text">
+                                <div class="layui-input-block" style="width: 80vw;">
+                                        <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>
+                                <div class="layui-input-block">
+                                    <button class="layui-btn" lay-submit lay-filter="sent_comment" type="button"
+                                            style="background-color: #16baaa00 !important;padding: 0;margin-left: 1vw;margin-top: 2vw;">
+                                        <img src="/static/home/images/allupload.png" height="100"
+                                             style="height: 8vw;" />
+                                    </button>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div style="clear: both;"></div>
+                        <div id="imgItem">
+                            <label class="layui-form-label">上传图片:</label>
+                            <div class="layui-input-inlines-self">
+                                <div class="layui-upload-drag-self">
+                                    <div id="uploadBtn" style="position:relative;display: flex;">
+                                        <img src="/static/home/images/upload.png" height="100"
+                                             style="width: 15vw;height: 15vw;"/>
+                                        <input type="hidden" name="thumb" value="">
+
+                                        <i class="layui-icon  layui-icon-clear" id="imgdel"></i>
+
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+
+        </div>
+        {/if}
+        <!-- 工作记录 -->
+        {if $project_five.project_record == 1}
+        <div class="layui-tab-item">
+            <!-- <a href="{:url('mobile/index/record')}"> -->
+            {volist name="record" id="vo"}
+            <div class="record">
+                <a href="{:url('mobile/index/record')}?id={$vo.id}&project_id={$project_id}">
+                    <div class="record-top">
+                        <div class="record-title">
+                            <span><img src="{__MOBILE__}/img/record.png" alt="" style="width: 4vw;"></span>&nbsp;
+                            
+    
+                        </div>
+                        <div style="display: flex;align-items: center;">
+                                <span>
+                                    <span>{$vo.admin_name}发表于:</span><span>{$vo.create_time|date="Y-m-d h:i"}</span>
+                                </span>
+                                     <span>
+                                        <img src="{__MOBILE__}/img/right1.png" alt="" style="width: 5vw;">
+                                    </span>
+                           
+    
+                        </div>
+                    </div>
+                    <div class="record-bottom">
+    
+                        {$vo.content|raw}
+                    </div>
+                 </a>
+                <div class="layui-btn-group" style="display: flex;justify-content: space-between;">
+                    <div></div>
+                    <div>
+                        <form class="layui-form">
+                            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"></button>
+                            <!-- <button type="button" class="layui-btn layui-btn-primary layui-btn-sm">
+                          <i class="layui-icon layui-icon-add-1"></i>
+                          </button> -->
+                            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"
+                                    style="border: 0.25vw solid #d2d2d2;margin-right: 0.25vw;">
+                                <a href="{:url('mobile/index/record_edit')}?id={$vo.id}&project_id={$project_id}"><i
+                                        class="layui-icon layui-icon-edit"></i></a>
+
+                            </button>
+                            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"
+                                    style="border: 0.25vw solid #d2d2d2;" data-id="{$vo.id}" lay-filter="delete_record"
+                                    lay-submit="">
+                                <i class="layui-icon layui-icon-delete"></i>
+                            </button>
+                        </form>
+                    </div>
+
+                </div>
+
+            </div>
+            
+            {/volist}
+            <div class="record-add">
+                <a href="{:url('mobile/index/record_add')}?project_id={$project_id}">
+                    <img src="{__MOBILE__}/img/add.png" alt="">
+                </a>
+            </div>
+        </div>
+        {/if}
+        
+        <!-- 项目动态 -->
+        {if $project_five.project_log == 1}
+        <div class="layui-tab-item">
+            <div class="detail-dynamic">
+                <div class="layui-timeline">
+
+                    {volist name="project_log" id="vo"}
+                    <div class="layui-timeline-item">
+
+                        <i class="layui-icon layui-timeline-axis"></i>
+                        <div class="layui-timeline-content layui-text" style="color: black;">
+                            <h3 class="layui-timeline-title dynamic-content"><b>{$vo.create_time}</b></h3>
+                            <p>
+                                {$vo.nickname}&nbsp;<b>{$vo.action}</b><span
+                                    style="color: #187FDD;">《{$vo.content}》</span>
+                            </p>
+                        </div>
+
+                    </div>
+                    {/volist}
+
+                </div>
+            </div>
+        </div>
+        {/if}
+
+
+        <!-- 预约看现场 -->
+        <div class="layui-tab-item">
+
+            <div class="detail-report">
+                {volist name="appointmentList" id="vo"}
+                    <div class="report-item">
+                        <form class="layui-form" lay-filter="barsearchform">
+                            <input type="hidden" value="{$vo.id}"  name="id">
+                            <input type="hidden" value="{$vo.project_id}" name="project_id">
+                        <div class="report-top" style="justify-content: normal;margin-bottom: 2.5vw;">
+                            <img src="{__MOBILE__}/img/line.png" alt="" style="width: 5vw;height: 4vw;">
+                            <span style="font-size: 2vh;"><b>预约看现场申请</b></span>
+                        </div>
+
+                        <div class="report-content" style="margin-bottom: 2vw;">
+                            <span class="report-overdue" style="margin-bottom: 2vw;">
+                                <span >发起人:{$vo.sponsor_name}</span>
+                                <span>审批人:{$vo.approval_name}</span>
+                                
+                            </span>
+
+                            <span class="report-overdue" style="margin-bottom: 2vw;width: 100% !important;">
+                                <span style="width: 100% !important;">预约时间:{$vo.appointment_time}</span>
+                            </span>
+
+                            <span class="report-overdue" style="margin-bottom: 2vw;">
+                                <span>派遣人数:{$vo.dispatch_num}</span>
+                            </span>
+
+                            <span class="report-overdue" style="margin-bottom: 2vw;width: 100% !important;">
+                                <span style="width: 100% !important;">地址/备注:{$vo.address_or_remark}</span>
+                            </span>
+
+                            <span class="report-overdue" style="margin-bottom: 2.5vw;width: 100% !important;">
+                                <span style="width: 100% !important;">回执:{$vo.audit_remark}</span>
+                            </span>
+                            
+                        </div>
+                        
+                        <div class="report-content"
+                             style="display: flex;align-items: center;margin-bottom: 2vw;">
+                             {if $unit_type != 1}
+                             {switch $vo.audit_status}
+                             {case 0}
+                             {if $vo.operate}
+                             <button type="button" class="layui-btn layui-btn-normal " lay-submit lay-filter="appointmentAgree" style="background-color:#67c23a;border-radius: 5px;padding: 0 20px;font-size: 14px;">通 过</button>
+                             <button type="button" class="layui-btn layui-bg-red layui-btn-normal" lay-submit lay-filter="appointmentDisagree" style="background-color:#f56c6c !important;border-radius: 5px;padding: 0 20px;font-size: 14px;">拒 绝</button>
+                             {else}
+                             <span style="border: 2px solid #faecd8;border-radius: 5px;padding: 5px 10px;background-color: #fdf6ec;color: #e6a23c;">待审核</span>
+                             {/if}
+                             {/case}
+                             {case 1}<span style="border: 2px solid #e1f3d8;border-radius: 5px;padding: 5px 10px;background-color: #f0f9eb;color: #67c23a;">已通过</span>{/case}
+                             {case 2}<span style="border: 2px solid #fde2e2;border-radius: 5px;padding: 5px 10px;background-color: #fef0f0;color: #f56c6c;">已拒绝</span>{/case}
+                             {default /}未知
+                             {/switch}
+                         {else}
+                             {switch $vo.audit_status}
+                             {case 0}
+                             <span style="border: 2px solid #faecd8;border-radius: 5px;padding: 5px 10px;background-color: #fdf6ec;color: #e6a23c;">待审核</span>
+                             {/case}
+                             {case 1}<span style="border: 2px solid #e1f3d8;border-radius: 5px;padding: 5px 10px;background-color: #f0f9eb;color: #67c23a;">已通过</span>{/case}
+                             {case 2}<span style="border: 2px solid #fde2e2;border-radius: 5px;padding: 5px 10px;background-color: #fef0f0;color: #f56c6c;">已拒绝</span>{/case}
+                             {default /}未知
+                             {/switch}
+                         {/if}
+                        </div>
+                            
+                        </form>
+                    </div>
+                {/volist}
+            </div>
+            <div class="record-add" style="position: fixed;">
+                <a href="{:url('mobile/index/appointment_add')}?project_id={$project_id}">
+                    <img src="{__MOBILE__}/img/add.png" alt="">
+                </a>
+            </div>
+        </div>
+
+        <!-- 二维码 -->
+        <div class="layui-tab-item">
+            <div class="box-btn">
+                <button id="generateBtn" class="code">生 成 二 维 码</button>
+                <div class="code-img">
+                    <div id="qrcode"></div>
+                </div>
+                
+
+                <button id="saveBtn" style="display: none;">保存二维码</button>
+                <button id="clearBtn" style="display: none;">清除二维码</button>
+            </div>
+            
+        </div>
+
+
+    </div>
+</div>
+
+<script src="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/layui.js"></script>
+<script src="{__MOBILE__}/js/jquery-3.4.1.min.js"></script>
+<script type="text/javascript" src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js"></script>
+<script>
+    let form = layui.form;
+    let tool = {
+        ajax: function (options, callback) {
+            var format = 'json';
+            if (options.hasOwnProperty('data')) {
+                format = options.data.hasOwnProperty('format') ? options.data.format : 'json';
+            }
+            callback = callback || options.success;
+            callback && delete options.success;
+            var optsetting = { timeout: 10000 };
+            if (format == 'jsonp') {
+                optsetting = { timeout: 10000, dataType: 'jsonp', jsonp: 'callback' }
+            }
+            var opts = $.extend({}, optsetting, {
+                success: function (res) {
+                    if (callback && typeof callback === 'function') {
+                        callback(res);
+                    }
+                }
+            }, options);
+            $.ajax(opts);
+        },
+
+        post: function (url, data, callback) {
+            this.ajax({
+                url: url,
+                type: "POST",
+                data: data
+            }, callback);
+        },
+    }
+
+    var project_id = "{$project_id}"
+    layui.use(function () {
+        var upload = layui.upload;
+        var layer = layui.layer;
+        var element = layui.element;
+        var $ = layui.$;
+        // 单图片上传
+        var uploadInst = upload.render({
+            elem: '#uploadBtn',
+            url: '/admin/api/upload',
+            done: function (e) {
+                // 若上传失败
+                if (e.code > 0) {
+                    return layer.msg('上传失败');
+                }
+                //上传成功
+                $('#uploadBtn input').attr('value', e.data.filepath);
+                $('#uploadBtn img').attr('src', e.data.filepath);
+                $('#imgdel').show();
+            },
+            error: function () {
+                layer.msg("上传失败");
+            },
+
+        });
+        $("#li_first").css('display','none')
+
+        eliminate(1,$(this))
+        element.on('tab(test-hash)', function (data) {
+
+            let index = $(this).attr('data-id');
+            console.log(index);
+            if (index == 1) {
+
+                eliminate(2,$(this))
+
+            } else if (index == 2) {
+
+
+            } else if (index == 3) {
+                eliminate(4,$(this))
+
+            } else if (index == 4) {
+                eliminate(5,$(this))
+
+            } else if (index == 5) {
+                eliminate(6,$(this))
+
+            } else if (index == 6) {
+
+            }else if (index == 7) {
+                eliminate(6,$(this))
+            }
+        });
+
+
+
+
+    })
+
+    $('#imgdel').click(() => {
+        $('#uploadBtn input').attr('value', '');
+        $('#uploadBtn img').attr('src', '/static/home/images/upload.png');
+        $('#imgdel').hide();
+        return false;
+    })
+
+
+    //监听提交
+    form.on('submit(sent_comment)', function (data) {
+
+
+        let callback = function (e) {
+
+
+            layer.msg(e.msg);
+            $("#text").val("");
+            $('#uploadBtn input').attr('value', '');
+            $('#imgdel').hide();
+            $('#uploadBtn img').attr('src', '/static/home/images/upload.png');
+            $("#comments").load(location.href+" #comments >* ", "")
+            console.log(e)
+        }
+        if (data.field.content === '' && data.field.thumb === '') {
+
+            console.log(data.field)
+            layer.msg("请完善内容");
+            return false;
+        } else {
+            data.field["project_id"] = project_id;
+            $.ajax({
+                type: "post", //使用get方式
+                url: "/admin/project.comment/add", //json文件相对于这个HTML的路径
+                data: data.field,
+                dataType: "json",
+                async: false,
+                success: function (e) {
+
+                    callback(e)
+                },
+                error: function () {
+                    layui.alert("网络错误!! ");
+                }
+            });
+
+
+        }
+
+
+
+        return false;
+    });
+
+    form.on('submit(delete_record)', function (data) {
+        console.log(1)
+        let index = $(this).attr('data-id');
+
+        let callback = function (e) {
+
+            a = 1
+            layer.msg(e.msg);
+            window.location.reload();
+
+        }
+
+        $.ajax({
+            type: "post", //使用get方式
+            url: "/admin/project.record/del", //json文件相对于这个HTML的路径
+            data: {
+                id: index
+            },
+            dataType: "json",
+            async: false,
+            success: function (e) {
+
+                callback(e)
+            },
+            error: function () {
+                layui.alert("地址请求失败!! ");
+            }
+        });
+
+
+
+        return false;
+    })
+
+
+
+
+
+    function eliminate(type,lidom){
+        let call=function (e){
+            $(lidom[0]).find('.hongdian').css('display','none')
+        }
+        $.ajax({
+            type: "post",
+            url: "/admin/project.api/eliminate",
+            data: {type: type,project_id:project_id},
+            dataType: "json",
+            async: false,
+            success: function (e) {
+                call(e)
+            },
+            error: function () {
+                layui.alert("网络错误!! ");
+            }
+        });
+
+    }
+
+    form.on('submit(appointmentAgree)', function (data) {
+        layer.prompt({
+            title: '请输入<span style="color: green">回执</span>',
+            formType: 2,
+            area: ['35vw', '15vw']
+        }, function (text, index) {
+            let callback = function (e) {
+                layer.msg(e.msg);
+                setTimeout(function () {
+                    layer.close(index);
+                    location.reload()
+                }, 2000)
+                location.reload()
+            }
+            if (text !== "") {
+                if("{$unit_type}" == 2){
+                    tool.post("/admin/project.appointment/agree_company", {id: data.field.id,audit_remark:text,project_id:data.field.project_id}, callback);// 项目id
+                }else{
+                    tool.post("/admin/project.appointment/agree", {id: data.field.id,audit_remark:text,project_id:data.field.project_id}, callback);// 项目id
+                }
+            } else {
+                layer.msg("回执不能为空")
+            }
+            // console.log(data)
+        })
+        return false;
+    });
+    form.on('submit(appointmentDisagree)', function (data) {
+        layer.prompt({
+            title: '请输入<span style="color: green">回执</span>',
+            formType: 2,
+            area: ['35vw', '15vw']
+        }, function (text, index) {
+            let callback = function (e) {
+                layer.msg(e.msg);
+                setTimeout(function () {
+                    layer.close(index);
+                    location.reload()
+                }, 2000)
+
+            }
+            if (text !== "") {
+                if("{$unit_type}" == 2){
+                    tool.post("/admin/project.appointment/disagree_company", {id: data.field.id,audit_remark:text,project_id:data.field.project_id}, callback);// 项目id
+                }else{
+                    tool.post("/admin/project.appointment/disagree", {id: data.field.id,audit_remark:text,project_id:data.field.project_id}, callback);// 项目id
+                }
+            } else {
+                layer.msg("回执不能为空")
+            }
+
+        })
+        return false;
+    });
+
+</script>
+
+<script>
+    /* 当用户点击按钮时,
+     在隐藏和显示下拉内容之间切换 */
+    function dropdown() {
+        document.getElementById("myDropdown").classList.toggle("show");
+    }
+
+    // 如果用户在下拉框外单击,则关闭下拉框
+    window.onclick = function (event) {
+        if (!event.target.matches('.dropbtn')) {
+            var dropdowns = document.getElementsByClassName("dropdown-content");
+            var i;
+            for (i = 0; i < dropdowns.length; i++) {
+                var openDropdown = dropdowns[i];
+                if (openDropdown.classList.contains('show')) {
+                    openDropdown.classList.remove('show');
+                }
+            }
+        }
+    }
+</script>
+
+<script>
+    const tx = document.querySelector('#text')
+    const total = document.querySelector('.total')
+
+    tx.addEventListener('input', function () {
+        console.log(tx.value.length)
+        total.innerHTML = `${tx.value.length}/3000字`
+    })
+</script>
+
+
+
+</body>
+
+
+<!-- 点击图片放大 -->
+<script src="{__MOBILE__}/js/scale.js"></script>
+<script type="text/javascript">
+    ImagesZoom.init({
+        "elem": ".informBlock"
+    });
+</script>
+
+<script src="{__JS__}/jquery.min.js"></script>
+<script>
+    $('#filesBox2').on('click', '.file-del', function () {
+
+        layer.msg("不可删除")
+
+    })
+</script>
+
+<!-- 生成二维码 -->
+<script>
+    document.getElementById('generateBtn').addEventListener('click', function() {
+    // 清除之前生成的二维码(如果有的话)
+    document.getElementById('qrcode').innerHTML = "";
+
+    // 获取当前网址
+    var currentUrl = window.location.href;
+
+    // 生成二维码并显示在页面上
+    var qrcode = new QRCode(document.getElementById('qrcode'), {
+        text: currentUrl,
+        width: 250, // 设置二维码的宽度
+        height: 250 // 设置二维码的高度
+    });
+
+    // 显示保存和清除按钮
+    document.getElementById('saveBtn').style.display = 'inline';
+    document.getElementById('clearBtn').style.display = 'inline';
+});
+
+    document.getElementById('saveBtn').addEventListener('click', function() {
+        // 获取生成的二维码的canvas元素
+        var canvas = document.querySelector('#qrcode canvas');
+
+        if (canvas) {
+            // 创建一个临时的下载链接
+            var link = document.createElement('a');
+            link.href = canvas.toDataURL('image/png');  // 将canvas内容转换为图片URL
+            link.download = 'qrcode.png';  // 设置下载的文件名
+            link.click();  // 自动触发下载
+        } else {
+            alert('请先生成二维码');
+        }
+    });
+
+    document.getElementById('clearBtn').addEventListener('click', function() {
+        // 清除二维码
+        document.getElementById('qrcode').innerHTML = "";
+
+        // 隐藏保存和清除按钮
+        document.getElementById('saveBtn').style.display = 'none';
+        document.getElementById('clearBtn').style.display = 'none';
+    });
+</script>
+
+<!-- 关注按钮 -->
+<script>
+    const followBtn = document.getElementById('followBtn');
+    let isFollowed = false;  // 用于跟踪当前状态
+
+    followBtn.addEventListener('click', function() {
+        if (!isFollowed) {
+            // 如果当前未关注,则进行关注操作
+            followBtn.textContent = '已关注';
+            followBtn.classList.add('followed');
+            isFollowed = true;
+        } else {
+            // 如果已关注,弹出确认框
+            let confirmUnfollow = confirm('是否取消关注?');
+            if (confirmUnfollow) {
+                // 如果确认取消关注,则恢复按钮状态
+                followBtn.textContent = '关注项目';
+                followBtn.classList.remove('followed');
+                isFollowed = false;
+            }
+        }
+    });
+</script>
+
+</html>

+ 90 - 0
app/mobile/view/temporary/invite.html

@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>逸管FEP</title>
+    <link rel="stylesheet" href="{__MOBILE__}/css/base.css">
+    <link rel="stylesheet" href="{__MOBILE__}/css/invite.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/css/layui.css">
+ <style>
+       
+    .invite-content1 img{
+        width: 100%;
+        object-fit: contain;
+    }
+    .bigImg {
+        /*max-width: 100%;*/
+        /*max-height: 100%;*/
+        width: 100%;
+        height: 100%;
+        object-fit: contain;
+      
+        /*top: 50%;*/
+        /*left: 50%;*/
+        /*图片向左移动自身宽度的50%, 向上移动自身高度的50%。*/
+        /*transform: translate(-50%, -50%);*/
+    }
+
+    /*遮罩层*/
+    .opacityBottom {
+        width: 100%;
+        height: 100%;
+        position: fixed;
+        background: rgba(0, 0, 0, 0.8);
+        z-index: 1000;
+        top: 0;
+        left: 0;
+    }
+</style>
+
+</head>
+<body>
+    <!-- <div class="top-return">
+        <a href="javascript:history.go(-1)">
+            <span><img src="{__MOBILE__}/img/left.png" alt=""
+                style="width: 5vw;"></span>
+        </a>
+        <span>工作记录详情</span>
+    </div> -->
+    <div class="invite">
+        <div class="invite-top">
+            <b>{$detail.title}</b>
+        </div>
+        <div class="invite-time">
+            <span>{$detail.maker_name}</span>&nbsp;<span>发表于</span>&nbsp;<span>{$detail.create_time|date="Y-m-d h:i:s"}</span>
+        </div>
+        <div class="invite-content">
+            {$detail.content|raw}
+        </div>
+        <div class="annex-title" style="margin-top: 1vw;">
+            <img src="{__MOBILE__}/img/annex.png" alt="" style="width: 5vw;">&nbsp;<b>附件</b>
+        </div>
+        <div class="invite-content1">
+            {:fileCard($file_array)}
+            {empty name="$file_array" }
+            <div class="layui-data-none">暂无附件</div>
+            {/empty}
+        </div>
+    </div>
+    <script src="{__MOBILE__}/js/jquery-3.4.1.min.js"></script>
+    <script type="text/javascript" charset="utf-8">
+        $('.invite-content img').click(function () {
+            var imgsrc = $(this).attr("src");
+            var opacityBottom = '<div class="opacityBottom" style = "display:none"><img class="bigImg" src="' + imgsrc + '"></div>';
+             console.log(opacityBottom)
+            $(document.body).append(opacityBottom);
+            // toBigImg();//变大函数
+            $(".opacityBottom").addClass("opacityBottom");//添加遮罩层
+            $(".opacityBottom").show();
+            $("html,body").addClass("none-scroll");//下层不可滑动
+            $(".bigImg").addClass("bigImg");//添加图片样式
+            $(".opacityBottom").click(function () {
+                $("html,body").removeClass("none-scroll");
+                $(".opacityBottom").remove();
+            })
+        })
+      
+    </script>   
+</body>
+</html>

+ 461 - 0
app/mobile/view/temporary/kan_list.html

@@ -0,0 +1,461 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>逸管FEP</title>
+    <link rel="stylesheet" href="{__MOBILE__}/css/base.css">
+    <link rel="stylesheet" href="{__MOBILE__}/css/kan.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui/css/layui.css">
+    <link rel="stylesheet" href="{__MOBILE__}/mobileSelect-master/css/mobileSelect.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/css/layui.css">
+
+    <style>
+        .footer_icon1 {
+            background-image: url('{__MOBILE__}/img/first.png') !important;
+        }
+
+        .footer_icon2 {
+            background-image: url('{__MOBILE__}/img/second-a.png') !important;
+        }
+
+        .footer_icon3 {
+            background-image: url('{__MOBILE__}/img/third.png') !important;
+        }
+
+        .footer_icon4 {
+            background-image: url('{__MOBILE__}/img/forth.png') !important;
+        }
+    </style>
+</head>
+
+<body>
+<!-- <div class="top">
+<span><img src="{__MOBILE__}/img/left.png" alt="" style="width: 5vw;"></span><span>看板</span><span></span>
+</div> -->
+<div class="kan-sreach">
+    <div class="layui-form" style="width: 80%;">
+        <form id="taskForm" class="layui-form" lay-filter="barsearchform">
+            <div class="layui-input-wrap" style="display: flex;">
+                <input type="text" name="keyword" lay-filter="search" placeholder="搜索…" class="layui-input">
+                <span><button lay-submit="" lay-filter="webform"><img src="{__MOBILE__}/img/search.png" alt=""
+                                                                      style="height: 5vw;"></button></span>
+            </div>
+        </form>
+
+
+
+    </div>
+    <div class="kan-sift"><span id="btn">筛选</span><span><img src="{__MOBILE__}/img/sift.png" alt=""></span></div>
+</div>
+
+<div id="search_reload" style="margin-bottom: 20vw;">
+    {volist name="detail" id="vo"}
+    <div class="kankan">
+        <a href='{:url("mobile/temporary/detail")}?id={$vo.id}'>
+            <div class="kan-kan">
+                <div class="kan">
+                    <div class="kan-top">
+                            <span class="dot1">
+                                <span style="font-size: 4.5vw;display:flex;align-items:center"><span><img src="{__MOBILE__}/img/project.png" alt=""
+                                                                                                          style="height: 7vw;"></span>&nbsp;<span style="font-size: 4vw;"><b>{$vo.project_name}</b></span></span>
+                                
+                            </span>
+
+                        <span style="display: flex;align-items: center;font-size: 3.5vw;color: #187FDD;">
+                                <span style="width:14vw;"><b>查看详情</b></span>
+                                <span><img src="{__MOBILE__}/img/right.png" alt=""
+                                           style="width: 4vw;height: 3.5vw;"></span>
+                                <span class="dot-img1">{if $vo.red}<img src="{__MOBILE__}/img/dot.png" alt=""
+                                                                        style="width: 4.5vw;">{/if}</span>
+                            </span>
+
+                    </div>
+                    <div class="kan-bottom">
+                        <div class="item-flex">
+                                <span
+                                        style="color: #187FDD;background-color: rgb(218, 235, 252);width:50vw;padding: 0.5vw 1vw;font-size: 3.7vw;
+                                line-height: 2.7vh;border-radius: 1.5vw;padding: 0.5vw 0;text-align: center;"><b>{$vo.project_start_time|date="Y-m-d"}&nbsp;至&nbsp;{$vo.project_end_time|date="Y-m-d"}</b></span>
+                            <span style="display:flex;justify-content: space-around;">
+                                    <span style="padding-right: 2vw;">
+                                        <b>
+                                            {switch $vo.report_status}
+                                                {case 0}<span style="color: #ffb800">初稿中</span>{/case}
+                                                {case 1}<span style="color: #005fa8">对数中</span>{/case}
+                                                {case 2}<span style="color: #ea8816">审定中</span>{/case}
+                                                {case 3}<span style="color: #16b777">已审定</span>{/case}
+                                                {default /}未知
+                                            {/switch}
+                                        
+                                        </b>
+                                    </span>
+                                    <span>
+                                        <b>
+                                            {switch $vo.project_status}
+                                            {case 1}<span style="color: #ffaa64">财评立项中</span>{/case}
+                                            {case 2}<span style="color: #b30095">财评审批中</span>{/case}
+                                            {case 3}<span style="color: #769fcd">公司待接收</span>{/case}
+                                            {case 4}<span style="color: #005fa8">待分配</span>{/case}
+                                            {case 5}<span style="color: #1e9fff">作业中</span>{/case}
+                                            {case 6}<span style="color: #007244">归档中</span>{/case}
+                                            {case 7}<span style="color: #881f1f">退审中</span>{/case}
+                                            {case 8}<span style="color: #16b777">已归档</span>{/case}
+                                            {case 9}<span style="color: #d81e06">已退审</span>{/case}
+                                            {case 0}
+                                            {switch $vo.proprietor_status}
+                                            {case 0}<span style="color: #ffb800">业主立项中</span>{/case}
+                                            {case 1}<span style="color: #b30095">业主审核中</span>{/case}
+                                            {case 2}<span style="color: #b88230">财评待接收</span>{/case}
+                                            {/switch}
+                                            {/case}
+                                            {default /}未知
+                                            {/switch}
+                                        </b>
+                                    </span>
+                                </span>
+                        </div>
+                    </div>
+                </div>
+
+            </div>
+        </a>
+
+        {/volist}
+        <div>
+            <!-- <div>
+        页面里的内容 <button id="btn">展示弹窗</button>
+         </div> -->
+            <div class="mask" id="mask"></div>
+            <div class="dialog" id="dialog">
+                <div class="sift">
+                    <div class="sift-top" style="margin-bottom: 2vw;">
+                        <b>项目状态</b>
+                    </div>
+
+                    <form class="layui-form" action="" lay-filter="demo-val-filter">
+                        <div class="layui-form-item">
+                            <div class="layui-input-block">
+                                <input type="radio" name="project_status" value="2" title="审批中" class="sift-state">
+                                <input type="radio" name="project_status" value="3" title="待接收" class="sift-state">
+                                <input type="radio" name="project_status" value="4" title="分配中" class="sift-state">
+                                <input type="radio" name="project_status" value="5" title="作业中" class="sift-state">
+                                <input type="radio" name="project_status" value="6" title="归档中" class="sift-state">
+                                <input type="radio" name="project_status" value="7" title="退审中" class="sift-state">
+                                <input type="radio" name="project_status" value="8" title="已归档" class="sift-state">
+                                <input type="radio" name="project_status" value="9" title="已退审" class="sift-state">
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <div class="layui-input-inline">
+                                <select id="province" lay-filter="province" name="province"></select>
+                            </div>
+                            <div class="layui-input-inline">
+                                <select id="city" lay-filter="city" name="city"></select>
+                            </div>
+                            <div class="layui-input-inline">
+                                <select id="area" lay-filter="area" name="area"></select>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <div class="sift-top">
+                                <b>日期范围</b>
+                            </div>
+                            <div class="layui-inline" id="ID-laydate-rangeLinked"
+                                 style="display: flex;align-items: center;">
+                                <div class="layui-input-inline">
+                                    <input type="text" autocomplete="off" id="ID-laydate-start-date-1"
+                                           style="margin: 0;padding: 0;text-align: center;" class="layui-input"
+                                           placeholder="开始日期" id="datePicker" name="project_start_time">
+                                </div>
+                                <div class="layui-form-mid">-</div>
+                                <div class="layui-input-inline">
+                                    <input type="text" autocomplete="off" id="ID-laydate-end-date-1"
+                                           class="layui-input" style="margin: 0;padding: 0;text-align: center;"
+                                           placeholder="结束日期" id="datePicker1" name="project_end_time">
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <div class="sift-bottom">
+                                <div class="layui-input-block">
+                                    <button type="button" class="layui-btn" lay-submit
+                                            lay-filter="demo1">立即提交</button>
+                                    <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
+                                </div>
+                            </div>
+                        </div>
+
+                    </form>
+
+
+                    <!-- </div> -->
+                </div>
+            </div>
+
+
+        </div>
+
+    </div>
+    <div class="footer">
+
+        <div class="footer_ge">
+            <!-- <a href="{:url('mobile/index/main')}" title="首页">
+        <div class="footer_icon footer_icon1"></div>
+        首页
+    </a> -->
+            <a href="{:url('mobile/index/main')}" title="首页">
+                <div class="dot">
+                    <div>
+                        <div class="footer_icon footer_icon1"></div>
+                        <div>首页</div>
+                    </div>
+                    <div class="dot-img">
+                        <!--<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;">-->
+                    </div>
+                </div>
+
+            </a>
+        </div>
+        <div class="footer_ge">
+            <a href="{:url('mobile/index/kan_list')}" title="看板" style="color: #187FDD;">
+                <div class="dot">
+                    <div>
+                        <div class="footer_icon footer_icon2"></div>
+                        <div>看板</div>
+                    </div>
+                    <div class="dot-img">
+                        {if $red_kan}<img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;"> {/if}
+                    </div>
+                </div>
+
+            </a>
+        </div>
+        <div class="footer_ge">
+            <a href="{:url('mobile/index/pending')}" title="待处理">
+                <div class="dot">
+                    <div>
+                        <div class="footer_icon footer_icon3"></div>
+                        <div>待处理</div>
+                    </div>
+                    <div class="dot-img">
+                        {if $red} <img src="{__MOBILE__}/img/dot.png" alt=""
+                                       style="width: 1.2vh;margin-left: -4.5vw;">{/if}
+                    </div>
+                </div>
+
+            </a>
+        </div>
+        <div class="footer_ge">
+            <a href="{:url('mobile/index/person')}" title="我的">
+                <div class="dot">
+                    <div>
+                        <div class="footer_icon footer_icon4"></div>
+                        <div>我的</div>
+                    </div>
+                    <div class="dot-img">
+                        <!-- <img src="{__MOBILE__}/img/dot.png" alt="" style="width: 1.2vh;"> -->
+                    </div>
+                </div>
+
+            </a>
+        </div>
+
+    </div>
+</div>
+<script src="{__MOBILE__}/mobileSelect-master/js/mobileSelect.js"></script>
+<script src="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/layui.js"></script>
+<script src="{__MOBILE__}/js/jquery-3.4.1.min.js"></script>
+
+<!--zjl,搜索-->
+<script>
+    var form = layui.form;
+    //监听搜索提交
+    form.on('submit(webform)', function (data) {
+        console.log(data.field);
+        const host = window.location.host;
+        window.location.href = 'http://' + host + '/mobile/index/kan_list?keyword=' + data.field['keyword'];
+        return false;
+    });
+
+    form.on('submit(sift)', function (data) {
+        const host = window.location.host;
+        // window.location.href = 'http://'+host+'/mobile/index/kan_list?keyword=' +  data.field['keyword'] ;
+        return false;
+    });
+
+</script>
+
+
+<script type="text/javascript">
+    $(function () {
+        $('.img').on('click', function () {
+            var src = $(this).attr('src');
+            $('.content_img img').attr('src', src);
+            $('.content_img').show()
+        });
+        $('.content_img').on('click', function () {
+            $('.content_img').hide()
+        });
+    })
+
+</script>
+
+<script>
+    const btn = document.getElementById('btn');
+    const mask = document.getElementById('mask');
+    const dialog = document.getElementById('dialog');
+    btn.addEventListener('click', () => {
+        mask.classList.add('show');
+        dialog.classList.add('show');
+    });
+    mask.addEventListener('click', () => {
+        mask.classList.remove('show');
+        dialog.classList.remove('show');
+    });
+</script>
+
+<script>
+    layui.use(['form', 'laydate', 'util','jquery'], function () {
+        var form = layui.form;
+        var layer = layui.layer;
+        var laydate = layui.laydate;
+        var util = layui.util;
+        var $ = layui.jquery;
+
+        // 自定义验证规则
+        form.verify({
+            pass: function (value) {
+                if (!/(.+){6,12}$/.test(value)) {
+                    return '密码必须 6 到 12 位';
+                }
+            }
+        });
+
+        // 指定开关事件
+        form.on('switch(switchTest)', function (data) {
+            layer.msg('开关 checked:' + (this.checked ? 'true' : 'false'), {
+                offset: '6px'
+            });
+            layer.tips('温馨提示:请注意开关状态的文字可以随意定义,而不仅仅是 ON|OFF', data.othis)
+        });
+
+        //buttom
+        form.on('button', function (data) {
+            console.log(data.field);
+        });
+
+        let adress;
+        $.ajax({
+            type: "get", //使用get方式
+            url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
+            dataType: "json",
+            async: false,
+            success: function (data) {
+                //这个data就是json数据
+                adress = data
+                var province = Object.keys(adress)
+                var proStrs = '<option value="">省</option>';
+                for (var i = 0; i < province.length; i++) {
+                    proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
+                }
+
+                $("#province").html(proStrs);
+                layui.form.render("select")
+
+            },
+            error: function () {
+                layer.alert("地址请求失败!! ");
+            }
+        });
+
+        function getFirstAttr(obj) {
+
+            for (var k in obj) return k;
+        }
+
+        function selectOption(selectedProvince, selectedCity = '', selectedArea = '') {
+            var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>',
+                areaStr = '<option value="">县</option>';
+            var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
+            for (var province in adress) {
+                if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
+                else proStr += '<option value="' + province + '">' + province + '</option>';
+            }
+            $("#province").html(proStr);
+
+            for (var city in pro) {
+
+                if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
+                else cityStr += '<option value="' + city + '">' + city + '</option>';
+            }
+            $("#city").html(cityStr);
+
+            for (var area in ci) {
+                if (area == "remove") {
+                    continue;
+                }
+
+                if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
+                else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
+            }
+            $("#area").html(areaStr);
+
+            form.render();
+        }
+
+
+        /*selectOption(1,2, 3);*/
+
+        form.on('select(province)', function (data) {
+            let thisProvince = data.value;
+            let thisCity = getFirstAttr(adress[thisProvince]);
+
+            selectOption(data.value);
+        });
+
+        form.on('select(city)', function (data) {
+
+            selectOption($("#province").val(), data.value, getFirstAttr(data.value));
+        });
+
+
+        // 提交事件
+        form.on('submit(demo1)', function (data) {
+            console.log(111)
+            var field = data.field; // 获取表单字段值
+            const host = window.location.host;
+            if(data.field['project_status'] == undefined){
+                data.field['project_status'] =''
+            }
+            window.location.href = 'http://' + host + '/mobile/index/kan_list?project_status=' + data.field['project_status'] + '&province=' + data.field['province'] + '&city=' + data.field['city'] + '&area=' + data.field['area'] + '&project_start_time=' + data.field['project_start_time'] + '&project_end_time=' + data.field['project_end_time'];
+            return false; // 阻止默认 form 跳转
+        });
+
+        // 日期
+        layui.use(function () {
+            var laydate = layui.laydate;
+            // 日期范围 - 左右面板联动选择模式
+            laydate.render({
+                elem: '#ID-laydate-rangeLinked',
+                range: ['#ID-laydate-start-date-1', '#ID-laydate-end-date-1'],
+                rangeLinked: true // 开启日期范围选择时的区间联动标注模式 ---  2.8+ 新增
+            });
+        })
+
+        $("#datePicker").focus(function () {
+            document.activeElement.blur();
+        });
+
+        $("#datePicker1").focus(function () {
+            document.activeElement.blur();
+        });
+
+        
+    });
+</script>
+
+</body>
+
+</html>

+ 50 - 0
app/mobile/view/temporary/report_detail.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>逸管FEP</title>
+    <link rel="stylesheet" href="{__MOBILE__}/css/base.css">
+    <link rel="stylesheet" href="{__MOBILE__}/css/report-detail.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui/css/layui.css">
+    <link rel="stylesheet" href="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/css/layui.css">
+</head>
+<body>
+    <!-- <div class="top-return">
+        <a href="{:url('mobile/index/detail')}?id={$project_id}"><span><img src="{__MOBILE__}/img/left.png" alt=""
+                    style="width: 5vw;"></span></a><span>项目报告</span>
+    </div> -->
+    <div class="report">
+        <div class="report-title">
+            <b>{$detail.title}</b>
+        </div>
+        <div class="report-title-bottom" style="font-size: 1.5vh;">
+            <span>{$detail.maker_name}发表于:</span><span>{$detail.create_time | date='Y-m-d H:i:s'}</span>
+        </div>
+        <div class="report-content">
+            {$detail.content|raw}
+        </div>
+        <div class="report-annex">
+            <div class="annex-title">
+                <img src="{__MOBILE__}/img/annex.png" alt="" style="width: 5vw;">&nbsp;<b>附件</b>
+            </div>
+            <div class="annex-content" id="filesBox2">
+                {:fileCard($file_array)}
+                {empty name="$file_array" }
+                <div class="layui-data-none">暂无附件</div>
+                {/empty}
+            </div>
+        </div>
+    </div>
+    
+</body>
+<script src="{__MOBILE__}/layui-v2.8.18-rc.1/layui-v2.8.18-rc.1/layui/layui.js"></script>
+<script src="{__JS__}/jquery.min.js"></script>
+<script>
+    $('#filesBox2').on('click', '.file-del', function () {
+
+        layer.msg("不可删除")
+
+    })
+</script>
+</html>

+ 65 - 0
public/static/mobile/css/temporary_detail.css

@@ -0,0 +1,65 @@
+.box-btn{
+  width: 100%;
+  text-align: center;
+  padding: 15px 0;
+}
+
+.code{
+  width: 90vw;
+  height: 10vw;
+  text-align: center;
+  background-color: #409eff;
+  border-radius: 5px;
+  border: #409eff;
+  color: #fff;
+}
+
+.code-img{
+  width: 100%;
+  text-align: center;
+  padding: 15px 0;
+}
+
+#qrcode img{
+  margin: 0 auto;
+}
+
+#saveBtn{
+  width: 45vw;
+  height: 10vw;
+  text-align: center;
+  background-color: #67c23a;
+  border-radius: 5px;
+  border: #67c23a;
+  color: #fff;
+}
+
+#clearBtn{
+  width: 45vw;
+  height: 10vw;
+  text-align: center;
+  background-color: #e6a23c;
+  border-radius: 5px;
+  border: #e6a23c;
+  color: #fff;
+}
+
+#followBtn {
+  padding: 10px 16px;
+  background-color: #409eff;
+  color: white;
+  border: #409eff;
+  border-radius: 5px;
+  cursor: pointer;
+  position: absolute;
+  right: 4.2vw;
+  margin-top: -2.8vw;
+  font-size: 14px;
+}
+
+#followBtn.followed {
+  background-color: #f0f9eb;
+  border: 1px solid #67c23a;
+  color: #71c647;
+  font-size: 14px;
+}