linwu пре 5 месеци
родитељ
комит
4b7c89d4f4

+ 57 - 5
app/admin/controller/Human.php

@@ -32,7 +32,7 @@ class Human extends AdminBaseController
     {
         $map   = $this->dealEqualInput(['status', 'is_arrive'], $this->dealLikeInput(['name']));
         $list  = HumanInstitutionApplyModel::where($map)
-            ->order(['status' => 'asc','id'=>'desc'])
+            ->order(['status' => 'asc', 'id' => 'desc'])
             ->limit(input('limit'))
             ->page(input('page'))
             ->append(['status_text', 'is_arrive_text'])
@@ -143,7 +143,7 @@ class Human extends AdminBaseController
     {
         $map   = $this->dealEqualInput(['status', 'is_arrive'], $this->dealLikeInput(['name']));
         $list  = HumanEnterpriseApplyModel::where($map)
-            ->order(['status' => 'asc','id'=>'desc'])
+            ->order(['status' => 'asc', 'id' => 'desc'])
             ->limit(input('limit'))
             ->page(input('page'))
             ->append(['status_text', 'is_arrive_text'])
@@ -164,6 +164,33 @@ class Human extends AdminBaseController
         ajax_return();
     }
 
+    public function syncEnterPrise()
+    {
+        $id    = input('id/d', 0);
+        $apply = HumanEnterpriseApplyModel::find($id);
+        empty($apply) && ajax_return(1, '该企业不存在');
+
+        $enterprise = HumanEnterpriseModel::where('join_mobile', $apply['join_mobile'])->find();
+        if (!empty($enterprise)) {
+            ajax_return(1, '该企业已存在,无须转换');
+        }
+
+        HumanEnterpriseModel::create([
+            'name'         => $apply['name'],
+            'capital'      => $apply['capital'],
+            'tel'          => $apply['tel'],
+            'address'      => $apply['address'],
+            'introduction' => $apply['describe'],
+            'join'         => $apply['join'],
+            'join_mobile'  => $apply['join_mobile'],
+            'priority'     => 255,
+            'cooperate'    => $apply['cooperate'],
+            'industry'     => $apply['industry'],
+        ]);
+
+        ajax_return();
+    }
+
     public function delEnterpriseApply()
     {
         $id_arr = input('id_arr/a');
@@ -221,7 +248,7 @@ class Human extends AdminBaseController
 
     public function listInstitution()
     {
-        $map   = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
+        $map          = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
         $booth_status = input('booth_status');
         if (!empty($booth_status)) {
             if ($booth_status == 1) {
@@ -250,6 +277,31 @@ class Human extends AdminBaseController
         ajax_return();
     }
 
+    public function syncInstitution()
+    {
+        $id    = input('id/d', 0);
+        $apply = HumanInstitutionApplyModel::find($id);
+        empty($apply) && ajax_return(1, '该机构不存在');
+
+        $institution = HumanInstitutionModel::where('join_mobile', $apply['join_mobile'])->find();
+        if (!empty($institution)) {
+            ajax_return(1, '该机构已存在,无须转换');
+        }
+
+        HumanInstitutionModel::create([
+            'name'         => $apply['name'],
+            'tel'          => $apply['tel'],
+            'address'      => $apply['address'],
+            'introduction' => $apply['describe'],
+            'join'         => $apply['join'],
+            'join_mobile'  => $apply['join_mobile'],
+            'priority'     => 255,
+            'cooperate'    => $apply['cooperate'],
+        ]);
+
+        ajax_return();
+    }
+
     /**
      * 编辑
      */
@@ -384,7 +436,7 @@ class Human extends AdminBaseController
 
     public function listEnterprise()
     {
-        $map   = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
+        $map          = $this->dealEqualInput(['status'], $this->dealLikeInput(['name']));
         $booth_status = input('booth_status');
         if (!empty($booth_status)) {
             if ($booth_status == 1) {
@@ -425,7 +477,7 @@ class Human extends AdminBaseController
             'info'           => $info,
             'status_list'    => HumanEnterpriseModel::STATUS,
             'cooperate_list' => HumanInstitutionModel::COOPERATE,
-            'industry_list'       => HumanEnterpriseModel::INDUSTRY,
+            'industry_list'  => HumanEnterpriseModel::INDUSTRY,
         ]);
     }
 

+ 15 - 1
app/admin/view/human/enterprise_apply.html

@@ -59,7 +59,7 @@
                 <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="enterprise">
                     <i class="layui-icon layui-icon-edit"></i>转机构
                 </a>
-                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="enterprise">
+                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sync">
                     <i class="layui-icon layui-icon-edit"></i>同步到参会列表
                 </a>
             </script>
@@ -86,6 +86,7 @@
                     {field: 'join', title: '参会人', width: 100},
                     {field: 'join_mobile', title: '参会手机号', width: 160},
                     {field: 'wechat', title: '微信号', width: 160},
+                    {field: 'industry', title: '行业', width: 160},
                     {field: 'cooperate', title: '希望合作的业务', width: 200},
                     {field: 'suggestion', title: '对本次活动想说的话'},
                     {field: 'status_text', title: '状态', width: 100, align: 'center'},
@@ -297,6 +298,19 @@
                     });
                     layer.close(index);
                 });
+            } else if (obj.event === 'sync') {
+                layer.confirm('确定此操作吗?', function (index) {
+                    admin.req({
+                        url: "{:url('human/syncEnterPrise')}",
+                        data: {
+                            id: data.id,
+                        },
+                        done: function (res) {
+                            table.reload('{$lay_table}');
+                        }
+                    });
+                    layer.close(index);
+                });
             }
         });
 

+ 34 - 2
app/admin/view/human/enterprise_detail.html

@@ -41,6 +41,14 @@
                             {$info.wechat}
                         </div>
                     </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            行业
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.industry}
+                        </div>
+                    </div>
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
                             希望合作的业务
@@ -51,13 +59,37 @@
                             {/volist}
                         </div>
                     </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            注册资本
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.capital}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            联系电话
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.tel}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            企业地址
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.address}
+                        </div>
+                    </div>
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
                             公司介绍
                         </div>
                         <div class="layui-col-md9 pre">{$info.describe}</div>
                     </div>
-                    <div class="layui-row mt10">
+                    <!--<div class="layui-row mt10">
                         <div class="layui-col-md3">
                             网址
                         </div>
@@ -74,7 +106,7 @@
                             <img src="{$image}" class="image" data-index="{$key}">
                             {/volist}
                         </div>
-                    </div>
+                    </div>-->
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
                             对本次活动想说的话

+ 14 - 1
app/admin/view/human/institution_apply.html

@@ -59,7 +59,7 @@
                 <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="enterprise">
                     <i class="layui-icon layui-icon-edit"></i>转企业
                 </a>
-                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="enterprise">
+                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sync">
                     <i class="layui-icon layui-icon-edit"></i>同步到参会列表
                 </a>
             </script>
@@ -296,6 +296,19 @@
                     });
                     layer.close(index);
                 });
+            } else if (obj.event === 'sync') {
+                layer.confirm('确定此操作吗?', function (index) {
+                    admin.req({
+                        url: "{:url('human/syncInstitution')}",
+                        data: {
+                            id: data.id,
+                        },
+                        done: function (res) {
+                            table.reload('{$lay_table}');
+                        }
+                    });
+                    layer.close(index);
+                });
             }
         });
 

+ 19 - 3
app/admin/view/human/institution_detail.html

@@ -43,7 +43,7 @@
                     </div>
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
-                            希望合作的业务
+                            业务范围
                         </div>
                         <div class="layui-col-md9">
                             {volist name="info.cooperate" id="vo"}
@@ -51,13 +51,29 @@
                             {/volist}
                         </div>
                     </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            联系电话
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.tel}
+                        </div>
+                    </div>
+                    <div class="layui-row mt10">
+                        <div class="layui-col-md3">
+                            机构地址
+                        </div>
+                        <div class="layui-col-md9">
+                            {$info.address}
+                        </div>
+                    </div>
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
                             机构介绍
                         </div>
                         <div class="layui-col-md9 pre">{$info.describe}</div>
                     </div>
-                    <div class="layui-row mt10">
+                    <!--<div class="layui-row mt10">
                         <div class="layui-col-md3">
                             网址
                         </div>
@@ -74,7 +90,7 @@
                             <img src="{$image}" class="image" data-index="{$key}">
                             {/volist}
                         </div>
-                    </div>
+                    </div>-->
                     <div class="layui-row mt10">
                         <div class="layui-col-md3">
                             对本次活动想说的话

+ 8 - 3
app/mobile/controller/Human.php

@@ -17,7 +17,7 @@ class Human extends MobileBaseController
     protected function initialize()
     {
 //        session('mobile.human.open_id','o8F4O6OW6pUzLWulOi-OzuGaBzoE');
-//        session('mobile.human.open_id','null');
+        session('mobile.human.open_id', 'aa');
         $open_id = session('mobile.human.open_id');
         if (empty($open_id)) {
             session('mobile.human.back_url', request()->url(true));
@@ -64,8 +64,13 @@ class Human extends MobileBaseController
     {
         $this->_formValidate();
 
+        $industry_list = [];
+        foreach (HumanEnterpriseModel::INDUSTRY as $industry) {
+            $industry_list[] = ['text' => $industry, 'value' => $industry];
+        }
         return view('', [
             'cooperate_list' => json_encode(HumanInstitutionModel::COOPERATE),
+            'industry_list'  => json_encode($industry_list),
         ]);
     }
 
@@ -394,12 +399,12 @@ class Human extends MobileBaseController
 
     private function _listValidate()
     {
-        $action = $this->request->action();
+        /*$action = $this->request->action();
         if ($action != 'center') {
             if (time() < 1730736000) {
                 jump('11月5日开启,敬请期待','mobile/human/center');
             }
-        }
+        }*/
         $open_id = session('mobile.human.open_id');
 
         $institution = HumanInstitutionApplyModel::where('open_id', $open_id)->find();

+ 51 - 10
app/mobile/view/human/enterprise_form.html

@@ -35,16 +35,16 @@
                 required
                 type="text"
                 label="姓名"
-                placeholder="请输入姓名"
-                :rules="[{ required: true, message: '请输入姓名' }]"
+                placeholder="请输入参会人姓名"
+                :rules="[{ required: true, message: '请输入参会人姓名' }]"
         ></van-field>
         <van-field
                 v-model="form.join_mobile"
                 required
                 type="mobile"
                 label="手机号"
-                placeholder="请输入手机号"
-                :rules="[{ required: true, message: '请输入手机号' }]"
+                placeholder="请输入参会人手机号"
+                :rules="[{ required: true, message: '请输入参会人手机号' }]"
         ></van-field>
         <van-field
                 v-model="form.wechat"
@@ -52,6 +52,21 @@
                 label="微信号"
                 placeholder="请输入微信号"
         ></van-field>
+        <van-field
+                v-model="form.industry"
+                is-link
+                readonly
+                label="行业"
+                placeholder="选择行业"
+                @click="showIndustryPicker = true"
+        ></van-field>
+        <van-popup v-model:show="showIndustryPicker" round position="bottom">
+            <van-picker
+                    :columns="industry_list"
+                    @cancel="showIndustryPicker = false"
+                    @confirm="onIndustryConfirm"
+            ></van-picker>
+        </van-popup>
         <van-field name="form.cooperate" label="希望合作的业务">
             <template #input>
                 <van-row :gutter="10">
@@ -67,24 +82,42 @@
             </template>
         </van-field>
         <van-field
-                v-model="form.url"
+                v-model="form.capital"
                 type="text"
-                label="官网"
-                placeholder="请输入官网"
+                label="注册资本"
+                placeholder="请输入注册资本"
+        ></van-field>
+        <van-field
+                v-model="form.tel"
+                type="text"
+                label="联系电话"
+                placeholder="请输入单位联系电话"
+        ></van-field>
+        <van-field
+                v-model="form.address"
+                type="text"
+                label="企业地址"
+                placeholder="请输入企业地址"
         ></van-field>
         <van-field
                 v-model="form.describe"
                 rows="3"
                 autosize
-                label="公司介绍"
+                label="企业简介"
                 type="textarea"
-                placeholder="请输入公司介绍"
+                placeholder="请输入企业简介"
+        ></van-field>
+        <!--<van-field
+                v-model="form.url"
+                type="text"
+                label="官网"
+                placeholder="请输入官网"
         ></van-field>
         <van-field label="附件(海报,名片等)">
             <template #input>
                 <van-uploader v-model="fileList" :before-read="uploadImage" :before-delete="deleteImage"></van-uploader>
             </template>
-        </van-field>
+        </van-field>-->
         <van-field
                 v-model="form.suggestion"
                 rows="3"
@@ -177,6 +210,14 @@
             ]);
         };
 
+        //行业选择
+        base.industry_list = {$industry_list};
+        base.showIndustryPicker = Vue.ref(false);
+        base.onIndustryConfirm = ({ selectedOptions }) => {
+            base.form.industry= selectedOptions[0].value
+            base.showIndustryPicker.value = false;
+        };
+
         return base;
     }
 </script>

+ 22 - 10
app/mobile/view/human/institution_form.html

@@ -35,16 +35,16 @@
                 required
                 type="text"
                 label="姓名"
-                placeholder="请输入姓名"
-                :rules="[{ required: true, message: '请输入姓名' }]"
+                placeholder="请输入参会人姓名"
+                :rules="[{ required: true, message: '请输入参会人姓名' }]"
         ></van-field>
         <van-field
                 v-model="form.join_mobile"
                 required
                 type="mobile"
                 label="手机号"
-                placeholder="请输入手机号"
-                :rules="[{ required: true, message: '请输入手机号' }]"
+                placeholder="请输入参会人手机号"
+                :rules="[{ required: true, message: '请输入参会人手机号' }]"
         ></van-field>
         <van-field
                 v-model="form.wechat"
@@ -67,24 +67,36 @@
             </template>
         </van-field>
         <van-field
-                v-model="form.url"
+                v-model="form.tel"
                 type="text"
-                label="官网"
-                placeholder="请输入官网"
+                label="联系电话"
+                placeholder="请输入机构联系电话"
+        ></van-field>
+        <van-field
+                v-model="form.address"
+                type="text"
+                label="机构地址"
+                placeholder="请输入机构地址"
         ></van-field>
         <van-field
                 v-model="form.describe"
                 rows="3"
                 autosize
-                label="公司介绍"
+                label="机构简介"
                 type="textarea"
-                placeholder="请输入公司介绍"
+                placeholder="请输入机构简介"
+        ></van-field>
+        <!--<van-field
+                v-model="form.url"
+                type="text"
+                label="官网"
+                placeholder="请输入官网"
         ></van-field>
         <van-field label="附件(海报,名片等)">
             <template #input>
                 <van-uploader v-model="fileList" :before-read="uploadImage" :before-delete="deleteImage"></van-uploader>
             </template>
-        </van-field>
+        </van-field>-->
         <van-field
                 v-model="form.suggestion"
                 rows="3"