yzx 7 月之前
父節點
當前提交
0670278196

+ 3 - 0
app/admin/controller/Api.php

@@ -260,8 +260,11 @@ class Api extends BaseController
     //修改密码
     public function edit_password()
     {
+        $admin = get_login_admin();
+        $daysSinceLastChange = (time() - $admin['last_password_change']) / (60 * 60 * 24);
         return view('admin/edit_password', [
             'admin' => get_login_admin(),
+            'daysSinceLastChange' =>  $daysSinceLastChange
         ]);
     }
 

+ 1 - 3
app/admin/controller/project/Appointment.php

@@ -204,7 +204,7 @@ class Appointment extends BaseController{
     
     
     
-    
+
     public function agree_company(){
         if (request()->isAjax()) {
             $param = get_params();
@@ -230,9 +230,7 @@ class Appointment extends BaseController{
             $param = get_params();
             $handle = $this->Pushmessage->handleParam($param);
             $param = $handle['param'];
-            
             $result = $this->model->disagree($param);
-            
             if($result){
                 $people = $this->costProjecModel->where("id",$param["project_id"])->field("entrust_maker,review_head,operate_head")->find();
 

+ 3 - 16
app/admin/controller/project/Audit.php

@@ -2462,21 +2462,8 @@ class Audit extends BaseController
             $project_id = isset($param["project_id"]) ? $param["project_id"] : 0;
             $this->Auditmodel->update(["id" => $id, "audit_status" => 3, "audit_remark" => $param["audit_remark"], "audit_time" => time()]);
 
-            $where=[
-                ["project_id", "=", $param["project_id"]],
-                ["audit_status", "=", 5],//待启用
-                ["audit_type", "=", 0],
-                ["audit_name", "=","业主项目审核二审"]
-            ];
-            //找第二审批人id
-            $second_approver=$this->Auditmodel->where($where)->value("approver");
-            if($second_approver!=null){
-                add_project_log('业主端审批一拒绝', $param['project_id'], "项目审核拒绝,原因:" . $param["audit_remark"]);
-            }
-            else{
-                $this->model->update(["id" => $project_id, "proprietor_status" => 0]);//改为业主立项中
-            }
-
+            add_project_log('业主端审批一拒绝', $param['project_id'], "项目审核拒绝,原因:" . $param["audit_remark"]);
+            $this->model->update(["id" => $project_id, "proprietor_status" => 0]);//改为业主立项中
 
             $sponsor_id = $this->Auditmodel->where('id', $id)->value('sponsor_id');
             $this->Pushmessage->pushMessage($project_id, [], [], (array)$sponsor_id);
@@ -2485,7 +2472,7 @@ class Audit extends BaseController
         }
     }
     //业主项目审核二拒绝
-    public function proprietor_disagre2()
+    public function proprietor_disagree2()
     {
         if (request()->isAjax()) {
             $param = get_params();

+ 6 - 4
app/admin/view/admin/edit_password.html

@@ -3,6 +3,7 @@
 {block name="body"}
 <form class="layui-form p-4">
   <h3 class="pb-3">重置密码</h3>
+  <h3 class="pb-3">您已经有{$daysSinceLastChange}天未进行密码修改,如大于180天则必须进行修改</h3>
   <table class="layui-table layui-table-form">
     <tr>
       <td class="layui-td-gray">用户名<font>*</font></td>
@@ -51,10 +52,11 @@
           
           layer.msg(e.msg);
           if (e.code == 0) {
-        setTimeout(function(){
-          tool.tabClose();
-          a = 1
-        },2000);
+            setTimeout(function(){
+              tool.tabClose();
+              window.location.href = "/admin"
+              a = 1
+            },2000);
           }
         }
         tool.post("/admin/api/password_submit", data.field, callback);

+ 5 - 0
app/admin/view/project/approval/project_overview.html

@@ -83,7 +83,12 @@
         </tr>
         <tr>
             <th class="form-title">项目周期</th>
+
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
         </tr>
 
         <tr>

+ 1 - 1
app/admin/view/project/audit/datalist_proprietor.html

@@ -310,7 +310,7 @@
 
                         }else if (data.audit_type==0){
 
-                                ool.post("/admin/project.audit/proprietor_disagree2", {
+                                tool.post("/admin/project.audit/proprietor_disagree2", {
                                     id: data.id,
                                     else_id: data.else_id,
                                     audit_type: data.audit_type,

+ 5 - 1
app/admin/view/project/audit/project_overview.html

@@ -82,8 +82,12 @@
             <th colspan="2">{$detail.project_num}</th>
         </tr>
         <tr>
-            <th class="form-title">项目周期</th>
+            <th class="form-title">项目周期</th>'
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
         </tr>
 
         <tr>

+ 4 - 0
app/admin/view/project/audit_company/project_overview.html

@@ -83,7 +83,11 @@
         </tr>
         <tr>
             <th class="form-title">项目周期</th>
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
         </tr>
 
         <tr>

+ 6 - 2
app/admin/view/project/cost/edit_first.html

@@ -429,8 +429,12 @@
 
 <!--      财评直接创建时-->
       {if $field.project_time == 1 }
-      <th class="form-title">项目周期 <font style="color: red !important;">*</font></th>
-      <th id="date" colspan="2">
+        {if $detail.project_start_time != null}
+        <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+        {else/}
+        <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+        {/if}
+        <th id="date" colspan="2">
         <div class="layui-input-inline" style="width: 47%;">
           <input type="text" id="start_time" name="project_start_time" readonly lay-verify="required" lay-reqText="请选择开始时间" placeholder="请选择" {if $field_edit.project_time_edit != 1} disabled {/if} class="layui-input" value="{if $detail.project_start_time ==null}  {else/} {$detail.project_start_time|date='Y-m-d'}{/if}">
         </div>

+ 4 - 0
app/admin/view/project/cost/project_overview.html

@@ -134,7 +134,11 @@
         <tr>
             {if $field.project_time == 1}
             <th class="form-title">项目周期</th>
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
             {/if}
         </tr>
 

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

@@ -424,9 +424,11 @@
         <tr>
             {if $field.project_time == 1}
             <th class="form-title">项目周期</th>
-            <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至
-                {$detail.project_end_time|date="Y-m-d"}
-            </th>
+            {if $detail.project_start_time != null}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
             {/if}
         </tr>
 

+ 0 - 2
app/admin/view/project/cost_company/project_appointment.html

@@ -112,8 +112,6 @@
                             layer.msg("回执不能为空")
                         }
                     })
-                
-                
                 return;
             }
         })

+ 4 - 0
app/admin/view/project/cost_company/project_overview.html

@@ -142,7 +142,11 @@
         <tr>
             {if $field.project_time == 1}
             <th class="form-title">项目周期</th>
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
             {/if}
         </tr>
 

+ 5 - 1
app/admin/view/project/cost_proprietor/edit_first.html

@@ -584,7 +584,11 @@
     <tr>
       {if $field.project_time == 1}
       <th class="form-title">项目周期</th>
-      <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{if $detail.project_start_time != null&& $detail.project_end_time != null}{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}{/if}</th>
+      {if $detail.project_start_time != null}
+      <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+      {else/}
+      <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+      {/if}
       {/if}
     </tr>
 

+ 4 - 0
app/admin/view/project/cost_proprietor/project_overview.html

@@ -94,7 +94,11 @@
         <tr>
             {if $field.project_time == 1}
             <th class="form-title">项目周期</th>
+            {if $detail.project_start_time != null}
             <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至 {$detail.project_end_time|date="Y-m-d"}</th>
+            {else/}
+            <th colspan="8" style="text-align: left; padding-left: 3.5vw;"> </th>
+            {/if}
             {/if}
         </tr>
 

+ 16 - 0
app/mobile/controller/Index.php

@@ -13,6 +13,7 @@ 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;
@@ -40,6 +41,9 @@ class Index
         $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");
@@ -1275,10 +1279,21 @@ class Index
             $fields["sent_review_approver_amount"] = false;
             $fields["construction_approver_amount"] = false;
         }
+
+        $appointmentList = $this->AppointmentModel->where("project_id",$id)->paginate(9999, false, ['query' => $param])
+            ->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);
@@ -1431,6 +1446,7 @@ class Index
 
     }
 
+
     /**
      * cp待办报告内容
      */

+ 138 - 6
app/mobile/view/index/detail.html

@@ -63,10 +63,13 @@
         {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>
     </ul>
 
     <div class="layui-tab-content">
@@ -685,14 +688,96 @@
             </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">
+                            <span style="font-size: 2vh;width:70vw;"><b>发起人:{$vo.sponsor_name}</b></span>
+                        </div>
+
+                        <div class="report-content" style="margin-bottom: 1.5vw;">
+                            <span class="report-overdue">
+                                <span>审批人:{$vo.approval_name}</span>
+                                <span>派遣人数:{$vo.dispatch_num}</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.appointment_time}</b></span>
+                            <span style="color: darkgray;"><b>派遣人数:{$vo.dispatch_num}</b></span>
+                        </div>
+                            {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:rgb(146,208,80);">通过</button>
+                            <button type="button" class="layui-btn layui-bg-red layui-btn-normal" lay-submit lay-filter="appointmentDisagree">拒绝</button>
+                            {else}
+                            待审核
+                            {/if}
+                            {/case}
+                            {case 1}通过{/case}
+                            {case 2}拒绝{/case}
+                            {default /}未知
+                            {/switch}
+
+                        </form>
+                    </div>
+                {/volist}
+            </div>
+            <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>
+
+
     </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>
-    let form = layui.form,
-        tool = layui.tool;
+    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;
@@ -743,10 +828,8 @@
 
             } else if (index == 6) {
 
-
             }else if (index == 7) {
                 eliminate(6,$(this))
-
             }
         });
 
@@ -857,7 +940,6 @@
             dataType: "json",
             async: false,
             success: function (e) {
-
                 call(e)
             },
             error: function () {
@@ -867,6 +949,56 @@
 
     }
 
+    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);
+                }, 2000)
+            }
+            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);
+                }, 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>