yzx 5 months ago
parent
commit
c907c89823

+ 1 - 1
app/admin/controller/Admin.php

@@ -74,7 +74,7 @@ class Admin extends BaseController
                     $item->last_login_time = empty($item->last_login_time) ? '-' : date('Y-m-d H:i', $item->last_login_time);
                 })->toArray();
             // dump($admin);
-            if(get_login_admin('user_type') == -1){
+            if(get_login_admin('user_type') !== -1){
                 $admin_ = $admin['data'];
                 unset($admin['data'][count($admin['data']) - 1]);   //移除超级管理
             }

+ 4 - 4
app/admin/validate/AdminCheck.php

@@ -11,13 +11,13 @@ use think\Validate;
 
 class AdminCheck extends Validate
 {
-	protected $regex = [ 'checkUser' => '/^[A-Za-z]{1}[A-Za-z0-9_-]{4,19}$/'];
-	
+    protected $regex = [ 'checkUser' => '/^[A-Za-z]{1}[A-Za-z0-9_-]{4,19}$/'];
+
     protected $rule = [
         'username' => 'require|regex:checkUser|unique:admin',
         'pwd' => 'require|min:6|confirm',
         'edit_pwd' => 'min:6|confirm',
-        'mobile' => 'require|mobile',
+        'mobile' => 'require',
         'nickname' => 'require|chsAlpha',
         'group_id' => 'require',
         'id' => 'require',
@@ -32,7 +32,7 @@ class AdminCheck extends Validate
         'pwd.require' => '密码不能为空',
         'pwd.min' => '密码至少要6个字符',
         'pwd.confirm' => '两次密码不一致',
-		'edit_pwd.min' => '密码至少要6个字符',
+        'edit_pwd.min' => '密码至少要6个字符',
         'edit_pwd.confirm' => '两次密码不一致',
         'mobile.require' => '手机不能为空',
         'mobile.mobile' => '手机格式错误',

+ 1 - 1
app/admin/view/admin/add.html

@@ -38,7 +38,7 @@
 			</td>
 		</tr>
 		<tr>
-			<td class="layui-td-gray">手机号码<font>*</font></td>
+			<td class="layui-td-gray">手机/座机<font>*</font></td>
 			<td>
 				<input type="text" name="mobile" lay-verify="required" placeholder="请输入手机" lay-reqText="请输入手机" autocomplete="off" class="layui-input">
 			</td>

+ 63 - 44
app/admin/view/project/cost_company/edit_user.html

@@ -27,7 +27,6 @@
             cols: [[ //表头
                 {field: 'nickname', fixed: 'left', title: '成员姓名', width: 200, align: 'center', rowspan: 2},
                 {field: 'unit_name', title: '所在单位', align: 'center', width: 200, rowspan: 2},
-
                 {
                     field: 'type', title: '成员类型', align: 'center', width: 200, rowspan: 2,
                     templet: function (a) {
@@ -48,15 +47,28 @@
                         return html;
                     }
                 },
-                {field: 'unit_type', title: '单位类型', align: 'center', width: 200, rowspan: 2},
-                {field: 'mobile', title: '手机号码', align: 'center', rowspan: 2},
+                {field: 'unit_type', title: '单位类型', align: 'center', width: 200, rowspan: 2,},
+                {
+                    field: 'mobile', title: '联系方式', align: 'center', rowspan: 2, templet: function (d) {
+                        if (d.unit_type == "送审单位") {
+                            return '';
+                        } else {
+                            return d.mobile
+                        }
+                    }
+                },
                 {field: 'email', title: '单位邮箱', align: 'center', rowspan: 2},
                 {
                     title: '操作', fixed: 'right', align: 'center', width: 150, rowspan: 2, templet: function (d) {
                         var html = '<span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</span>';
 
+                        if (d.unit_type == "评审机构") {
+                            return html;
+                        } else {
+                            return '';
+                        }
+
 
-                        return html;
                     }
                 }
             ]]
@@ -135,32 +147,32 @@
                         }
                     })
                     break;
-                    // getSentReview()
-                    // let call = function () {
-                    //     layer.msg(e.msg);
-                    //     if (e.code == 0) {
-                    //         parent.layui.userTable.reload();
-                    //     }
-                    // }
-                    // employeepicker.init({
-                    //     type: 0,
-                    //     department_url: "/admin/project.cost_company/get_department_tree",
-                    //     employee_url: "/admin/project.cost_company/get_employee",
-                    //     callback: function (ids, names, dids, departments) {
-                    //         let callback = function (e) {
-                    //             layer.msg(e.msg);
-                    //             if (e.code == 0) {
-                    //                 parent.layui.userTable.reload();
-                    //             }
-                    //         }
-                    //         tool.post("/admin/project.cost_company/add_sent_review_unit", {
-                    //             id: ids,
-                    //             project_id: project_id,
-                    //         }, callback);
-                    //     }
-                    // })
-                    // parent.layui.tool.side('/admin/project.cost_company/add_sent_review_unit?project_id=' + project_id, call);
-                    // break;
+                // getSentReview()
+                // let call = function () {
+                //     layer.msg(e.msg);
+                //     if (e.code == 0) {
+                //         parent.layui.userTable.reload();
+                //     }
+                // }
+                // employeepicker.init({
+                //     type: 0,
+                //     department_url: "/admin/project.cost_company/get_department_tree",
+                //     employee_url: "/admin/project.cost_company/get_employee",
+                //     callback: function (ids, names, dids, departments) {
+                //         let callback = function (e) {
+                //             layer.msg(e.msg);
+                //             if (e.code == 0) {
+                //                 parent.layui.userTable.reload();
+                //             }
+                //         }
+                //         tool.post("/admin/project.cost_company/add_sent_review_unit", {
+                //             id: ids,
+                //             project_id: project_id,
+                //         }, callback);
+                //     }
+                // })
+                // parent.layui.tool.side('/admin/project.cost_company/add_sent_review_unit?project_id=' + project_id, call);
+                // break;
                 case "add_head":
                     employeepicker.init({
                         type: 0,
@@ -218,7 +230,7 @@
                     layer.confirm('确定要移除该委托单位成员吗?', {icon: 3, title: '提示'}, function (index) {
                         tool.delete("/admin/project.cost_company/remove_entrust_head", postData, callback);
                     });
-                }else {
+                } else {
                     layer.msg("该成员不可移除");
                 }
 
@@ -228,8 +240,8 @@
         });
 
         //委托单位
-        function aaa(callback){
-            var customeTable,form = layui.form;
+        function aaa(callback) {
+            var customeTable, form = layui.form;
             const a = layer.open({
                 title: '选择委托单位',
                 area: ['600px', '580px'],
@@ -250,7 +262,7 @@
                         , limit: 10
                         , cols: [[
                             {type: 'radio', title: '选择'},
-                            
+
                             {field: 'title', title: '委托单位名称', align: 'center'},
                             {field: 'address', title: ' 评审单位地址', align: 'center'}
                         ]]
@@ -278,8 +290,8 @@
             })
         }
 
-        function bbb(e){
-            var entrustPeopleTable,form = layui.form;
+        function bbb(e) {
+            var entrustPeopleTable, form = layui.form;
 
             layer.open({
                 title: '选择委托单位',
@@ -297,7 +309,7 @@
                     entrustPeopleTable = table.render({
                         elem: '#entrustPeopleTable'
                         , url: '/admin/project.api/get_entrust_people'
-                        , where:{unit_id:e[0]["id"]}
+                        , where: {unit_id: e[0]["id"]}
                         , page: true //开启分页
                         , limit: 10
                         , cols: [[
@@ -308,7 +320,10 @@
                     });
                     //客户搜索提交
                     form.on('submit(entrustPeople)', function (data) {
-                        entrustPeopleTable.reload({where: {keywords: data.field.keywords,unit_id:e[0]["id"]}, page: {curr: 1}});
+                        entrustPeopleTable.reload({
+                            where: {keywords: data.field.keywords, unit_id: e[0]["id"]},
+                            page: {curr: 1}
+                        });
                         return false;
                     });
                 },
@@ -339,8 +354,8 @@
             })
         }
 
-        function getSentReview(){
-            var sentReviewTable,form = layui.form;
+        function getSentReview() {
+            var sentReviewTable, form = layui.form;
             const a = layer.open({
                 title: '选择送审单位',
                 area: ['600px', '580px'],
@@ -388,8 +403,9 @@
                 }
             })
         }
-        function getSentReviewPeople(e){
-            var sentReviewPeople,form = layui.form;
+
+        function getSentReviewPeople(e) {
+            var sentReviewPeople, form = layui.form;
 
             layer.open({
                 title: '选择送审单位',
@@ -407,7 +423,7 @@
                     sentReviewPeople = table.render({
                         elem: '#sentReviewPeople'
                         , url: '/admin/project.api/get_sent_review_people'
-                        , where:{unit_id:e[0]["id"]}
+                        , where: {unit_id: e[0]["id"]}
                         , page: true //开启分页
                         , limit: 10
                         , cols: [[
@@ -418,7 +434,10 @@
                     });
                     //客户搜索提交
                     form.on('submit(entrustPeople)', function (data) {
-                        sentReviewPeople.reload({where: {keywords: data.field.keywords,unit_id:e[0]["id"]}, page: {curr: 1}});
+                        sentReviewPeople.reload({
+                            where: {keywords: data.field.keywords, unit_id: e[0]["id"]},
+                            page: {curr: 1}
+                        });
                         return false;
                     });
                 },

+ 42 - 18
app/admin/view/project/cost_company/project_user.html

@@ -20,33 +20,48 @@
                 {field: 'nickname', fixed: 'left', title: '成员姓名', width: 200, align: 'center', rowspan: 2},
                 {field: 'unit_name', title: '所在单位', align: 'center', width: 200, rowspan: 2},
 
-                {field: 'type', title: '成员类型', align: 'center', width: 200, rowspan: 2,
-                    templet:function (a){
-                        var html= "";
-                        if(a.type==1){
+                {
+                    field: 'type', title: '成员类型', align: 'center', width: 200, rowspan: 2,
+                    templet: function (a) {
+                        var html = "";
+                        if (a.type == 1) {
                             html = "项目负责人"
-                        }else if(a.type==2) {
+                        } else if (a.type == 2) {
                             html = "项目负责人"
-                        }else if(a.type==3) {
+                        } else if (a.type == 3) {
                             html = "作业负责人"
-                        }else if(a.type==4) {
+                        } else if (a.type == 4) {
                             html = "作业成员"
-                        }else if(a.type==5) {
+                        } else if (a.type == 5) {
                             html = "项目负责人"
-                        }else if(a.type==6) {
+                        } else if (a.type == 6) {
                             html = "项目负责人"
                         }
                         return html;
-                    }},
+                    }
+                },
                 {field: 'unit_type', title: '单位类型', align: 'center', width: 200, rowspan: 2},
-                {field: 'mobile', title: '手机号码', align: 'center', rowspan: 2},
+                {
+                    field: 'mobile', title: '联系方式', align: 'center', rowspan: 2, templet: function (d) {
+                        if (d.unit_type == "送审单位") {
+                            return '';
+                        } else {
+                            return d.mobile
+                        }
+                    }
+                },
                 {field: 'email', title: '单位邮箱', align: 'center', rowspan: 2},
                 // {
                 //     title: '操作', fixed: 'right', align: 'center', width: 150, rowspan: 2, templet: function (d) {
                 //         var html = '<span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</span>';
 
+                //         if(unit_type == "评审机构"){
+                //             return html;
+                //         }else{
+                //             return '';
+                //         }
+
 
-                //         return html;
                 //     }
                 // }
             ]]
@@ -69,7 +84,11 @@
                                 }
                             }
 
-                            tool.post("/admin/project.cost_company/add_user_company_type1", {id: ids, project_id: project_id,type:1}, callback);
+                            tool.post("/admin/project.cost_company/add_user_company_type1", {
+                                id: ids,
+                                project_id: project_id,
+                                type: 1
+                            }, callback);
                         }
                     })
                     break;
@@ -86,16 +105,21 @@
                                 }
                             }
 
-                            tool.post("/admin/project.cost_company/add_user_company_type2", {id: ids, project_id: project_id,type:2}, callback);
+                            tool.post("/admin/project.cost_company/add_user_company_type2", {
+                                id: ids,
+                                project_id: project_id,
+                                type: 2
+                            }, callback);
                         }
                     })
                     break;
-            };
+            }
+            ;
         });
 
         //监听行工具事件
         table.on('tool(user)', function (obj) {
-            let postData = {"id": obj.data.id,"project_id":project_id,"type":obj.data.type};
+            let postData = {"id": obj.data.id, "project_id": project_id, "type": obj.data.type};
             let callback = function (e) {
                 layer.closeAll();
                 layer.msg(e.msg);
@@ -105,12 +129,12 @@
             }
             if (obj.event === 'remove') {
 
-                if(obj.data.type == 3 || obj.data.type == 4){
+                if (obj.data.type == 3 || obj.data.type == 4) {
                     console.log(postData);
                     layer.confirm('确定要移除该项目成员吗?', {icon: 3, title: '提示'}, function (index) {
                         tool.delete("/admin/project.cost_company/remove_user_company", postData, callback);
                     });
-                }else {
+                } else {
                     layer.msg("该成员不可移除");
                 }
 

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

@@ -49,6 +49,11 @@ class Temporary extends BaseController
         // }
     }
 
+    public function getOpenId() {
+        $redirect_uri = "http://testwxpress.ngrok.natapp.cn/index.php/Home/Index/getCode";
+        $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . C('WECHAT_APPID') . '&redirect_uri=' . urlencode($redirect_uri) . '&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect';
+        header("Location:" . $url);
+    }
 
     /**
      *个人资料

+ 7 - 1
app/wechat/controller/Officialaccount.php

@@ -313,7 +313,7 @@ class Officialaccount{
 
         $buttons = [
             [
-                "name"       => "系统登录",
+                "name"       => "系统功能",
                 "sub_button" => [
                     [
                         "type" => "view",
@@ -321,6 +321,12 @@ class Officialaccount{
                         // "url"  => "https://open.weixin.qq.com//mobile/index/main",
                         "url"  => $this->url."mobile/Login/Login",
                     ],
+                    [
+                        "type" => "view",
+                        "name" => "项目跟踪",
+                        // "url"  => "https://open.weixin.qq.com//mobile/index/main",
+                        "url"  => $this->url."mobile/Login/Login",
+                    ],
                 ],
                 
             ],