Your Name 3 anos atrás
pai
commit
509335eb67

+ 10 - 1
tool/work/assets/pc/html/back.html

@@ -101,18 +101,26 @@ td {
     <col width="100">
       <thead>
     <tr>
+    <{if(isset($user['name']) && $user['name']):}>
       <th>名称</th>
+      <{endif}>
       <th>电话号码</th>
       <th>平台</th>
+      <{if(isset($user['role_name']) && $user['role_name']):}>
       <th>角色</th>
+      <{endif}>
     </tr> 
   </thead>
   <tbody>
     <tr>
+    <{if(isset($user['name']) && $user['name']):}>
       <td><{$user['name']}></td>
+      <{endif}>
       <td><{$user['mobile']}></td>
       <td width=80px;><{$user['type']}></td>
+      <{if(isset($user['role_name'])  && $user['role_name']):}>
       <td width=80px;><{$user['role_name']}></td>
+      <{endif}>
     </tr>
   </tbody>
       </table>
@@ -199,8 +207,9 @@ function search()
 	      success: function (data) {
 	      	if(data == '代理商手机号不正确'){
 		      	layer.alert('请输入正确的手机号');
+		      	// location.reload();
 		         layer.close();
-		    } else {
+		    }  else {
 		      	location.href = config.host + 'lib/appoint.back&mobile=' + $('#content').val();
 		    }
 	      	

+ 23 - 22
tool/work/database/info.php

@@ -140,6 +140,7 @@ return array
             'match'     => 'option',
             'update'    => 'text',
             'search'    => 'fulltext',
+            'value'     => Dever::input('search_option_mobile'),
             # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
             'bind'        => array('onblur', 'loading', array('url' => Dever::url("lib/manage.search","work"))),
             'list_name' => '客户信息',
@@ -186,39 +187,39 @@ return array
 
         'cate_id'      => array
         (
-            'type'      => 'int-11',
+            'type'      => 'varchar-30',
             'name'      => '问题类型',
             'default'   => '-1',
             'desc'      => '问题类型',
             'match'     => 'is_string',
-            'option'    => $cate,
-            'update'    => 'select',
-            'search'    => $search_auth == 1 ? 'select' : false,
-            'list'      => true,
+            'search'    => $search_auth == 1 ? 'linkage' : false,
+            'update'    => 'linkage',
+            'option'    => Dever::url('lib/appoint.getCate?level_total=2', 'work'),
+            'list'      => 'Dever::load("work/lib/manage.getUser#cate_name",{id})',
         ),
 
-        'question_id'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '问题类型描述',
-            'default'   => '-1',
-            'desc'      => '问题类型描述',
-            'match'     => 'is_string',
-            'option'    => $question,
-            'update'    => 'select',
-            'search'    => $search_auth == 1 ? 'select' : false,
-            // 'list'      => true,
-        ),
+        // 'question_id'      => array
+        // (
+        //     'type'      => 'int-11',
+        //     'name'      => '问题类型描述',
+        //     'default'   => '-1',
+        //     'desc'      => '问题类型描述',
+        //     'match'     => 'is_string',
+        //     'option'    => $question,
+        //     'update'    => 'select',
+        //     'search'    => $search_auth == 1 ? 'select' : false,
+        //     // 'list'      => true,
+        // ),
 
         'priority_id'      => array
         (
             'type'      => 'int-11',
             'name'      => '优先级',
-            'default'   => '-1',
+            'default'   => '1',
             'desc'      => '优先级',
             'match'     => 'is_string',
             'option'    => $priority,
-            'update'    => 'select',
+            'update'    => 'radio',
             'search'    => $search_auth == 1 ? 'select' : false,
             'list'      => true,
         ),
@@ -303,7 +304,7 @@ return array
             'desc'      => '处理结果',
             'match'     => 'is_string',
             'option'    => $status,
-            'update'    => 'select',
+            'update'    => 'radio',
             'search'    => 'select',
             'list'      => true,
         ),
@@ -358,8 +359,8 @@ return array
             'default'   => '1',
             'desc'      => '请输入排序',
             'match'     => 'option',
-            'update'  => 'text',
-            'search'    => 'order',
+            // 'update'  => 'text',
+            // 'search'    => 'order',
             // 'list'      => true,
             // 'order'     => 'desc',
             // 'edit'      => true,

+ 18 - 7
tool/work/database/q_cate.php

@@ -82,29 +82,40 @@ return array
 
     'request' => array
     (
-        'getData' => array
+        // 'getData' => array
+        // (
+        //     # 匹配的正则或函数 选填项
+        //     'option' => array
+        //     (
+        //         //'id' => array('yes', '!='),
+        //         'state' => 1,
+        //     ),
+        //     'type' => 'all',
+        //     'order' => array('id' => 'desc'),
+        //     'col' => '*|id',
+        // ),
+        'getAll' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
             (
-                //'id' => array('yes', '!='),
+                // 'id' => array('yes','>'),
                 'state' => 1,
             ),
             'type' => 'all',
-            'order' => array('id' => 'desc'),
-            'col' => '*|id',
+            'order' => array('reorder' => 'desc', 'id' => 'asc'),
+            'col' => '*',
         ),
-        'getAll' => array
+        'getSearchAll' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
             (
-                // 'id' => array('yes','>'),
                 'state' => 1,
             ),
             'type' => 'all',
             'order' => array('reorder' => 'desc', 'id' => 'asc'),
-            'col' => '*',
+            'col' => 'id as value,name',
         ),
     ),
 );

+ 19 - 7
tool/work/database/question.php

@@ -196,29 +196,41 @@ return array
 
     'request' => array
     (
-        'getData' => array
+        // 'getData' => array
+        // (
+        //     # 匹配的正则或函数 选填项
+        //     'option' => array
+        //     (
+        //         //'id' => array('yes', '!='),
+        //         'state' => 1,
+        //     ),
+        //     'type' => 'all',
+        //     'order' => array('id' => 'desc'),
+        //     'col' => '*|id',
+        // ),
+        'getAll' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
             (
-                //'id' => array('yes', '!='),
+                // 'id' => array('yes','>'),
                 'state' => 1,
             ),
             'type' => 'all',
-            'order' => array('id' => 'desc'),
-            'col' => '*|id',
+            'order' => array('reorder' => 'desc', 'id' => 'asc'),
+            'col' => '*',
         ),
-        'getAll' => array
+        'getSearchAll' => array
         (
             # 匹配的正则或函数 选填项
             'option' => array
             (
-                // 'id' => array('yes','>'),
+                'cate_id'=>'yes',
                 'state' => 1,
             ),
             'type' => 'all',
             'order' => array('reorder' => 'desc', 'id' => 'asc'),
-            'col' => '*',
+            'col' => 'id as value, name',
         ),
     ),
 );

+ 90 - 15
tool/work/lib/Appoint.php

@@ -154,6 +154,62 @@ Class Appoint
     	}
     	return $data;
     }
+    #问题
+     private $cdefault = array
+    (
+        'value' => -1,
+        'name' => '不选择',
+    );
+    private $search_cdefault = array
+    (
+        'value' => -1,
+        'name' => '问题类型描述',
+    );
+    #问题类型联动
+    public function getCate_api()
+    {
+        # 联动总数,默认到部门
+        $level_total = Dever::input('level_total', 1);
+
+        # 当前联动级别
+        $level_num = Dever::input('level_num');
+
+        # 一般为id
+        $level_id = Dever::input('level_id');
+
+        # 是否是搜索列表页
+        $level_search = Dever::input('level_search');
+        if ($level_search) {
+            $default = $this->search_cdefault;
+            if ($level_num == 1) {
+                $default['name'] = '问题分类名称';
+            } elseif ($level_num == 2) {
+                $default['name'] = '问题类型描述';
+            } 
+        } else {
+            $default = $this->cdefault;
+        }
+        // if ($level_id < 0) {
+        //     Dever::alert('error');
+        // }
+        if ($level_num == 1) {
+            $data = Dever::db('work/q_cate')->getSearchAll();
+
+        } elseif ($level_num == 2) {
+            $data = Dever::db('work/question')->getSearchAll(array('cate_id'=>$level_id));
+        } 
+
+        if (!$data) {
+            Dever::alert('error');
+        }
+
+        if ($level_search || $level_num >= 1) {
+            array_unshift($data, $default);
+        }
+        $result['level_total'] = $level_total;
+        $result['list'] = $data;
+        return $result;
+    }
     public function show_api()
     {
     	$info_id = Dever::input('id');
@@ -172,15 +228,7 @@ Class Appoint
 				$data['info']['source_name'] = $source['name'];
 			}
 		} 
-		if ($data['info']['question_id']) {
-			$question = Dever::db('work/question')->find($data['info']['question_id']);
-			if ($question) {
-				$product = Dever::db('work/product')->find($question['product_id']);
-				if ($product) {
-					$data['info']['product_name'] = $product['name'];
-				}
-			}
-		}
+		
 		$data['info']['role_name'] = '';
 		$user = Dever::db('work/user')->find(array('mobile'=>$data['info']['mobile']));
 		if ($user) {
@@ -198,10 +246,33 @@ Class Appoint
 			}
 		}
 		$data['info']['cate_name'] = '';
+        $data['info']['product_name'] = '';
+         $data['info']['question_name'] ='';
 		if ($data['info']['cate_id']) {
-			$cate = Dever::db('work/q_cate')->find($data['info']['cate_id']);
-			if ($cate && $question) {
-				$data['info']['cate_name'] = $cate['name'].'      /       '.$question['name'];
+            $cate_id = explode(',',$data['info']['cate_id']);
+            if (isset($cate_id[0]) && $cate_id[0]) {
+                $cate = Dever::db('work/q_cate')->find($cate_id[0]);
+                if ($cate) {
+                    $data['info']['cate_name'] = $cate['name'];
+                }
+            } else {
+                $cate = array();
+            }
+            if (isset($cate_id[1]) && $cate_id[1]) {
+                $question = Dever::db('work/question')->find($cate_id[1]);
+                if ($question) {
+                    $product = Dever::db('work/product')->find($question['product_id']);
+                    if ($product) {
+                        $data['info']['product_name'] = $product['name'];
+                    }
+                    $data['info']['question_name'] = $question['name'];
+                }
+            } else {
+                $question = array();
+            }
+			
+			if ($data['info']['cate_name'] && $data['info']['product_name']) {
+				$data['info']['cate_name'] = $data['info']['cate_name'].'      /       '.$data['info']['product_name'];
 			}
 		}
 		if ($data['info']['pic']) {
@@ -296,7 +367,11 @@ Class Appoint
         }
         	$user = Dever::db('work/user')->find(array('mobile'=>$mobile));
         	if (!$user) {
-        		return '无系统关联关系';
+                $data['user']['mobile'] = $mobile;
+                $data['user']['type'] = '无系统关联关系';
+                $data['user']['work'] = Dever::url('project/database/update?project=work&table=info&menu=work&search_option_mobile='.$mobile, 'manage');
+                // print_R($data);die;
+        		 return Dever::render('back', $data);
         	}
         	if ($user){
         		$table = array();
@@ -329,7 +404,7 @@ Class Appoint
         				if ($user['passport_uid'] && $user['passport_uid']>0) {
 	        				$user['type'] = '小程序';
 	        			} else {
-	        				return '无系统关联关系';
+	        				$user['type'] = '无系统关联关系';
 	        			}
         			}
         		}
@@ -342,7 +417,7 @@ Class Appoint
         		if ($user['option_uid']) {
         			$user['option'] = Dever::url('project/database/list?project=option&table=member&search_option_id='.$user['option_uid'], 'manage');
         		}
-        		$user['work'] = Dever::url('project/database/update?project=work&table=info&menu=work', 'manage');
+        		$user['work'] = Dever::url('project/database/update?project=work&table=info&menu=work&search_option_mobile='.$mobile, 'manage');
         		$data['user'] = $user;
         		$data['info'] = Dever::db('work/info')->getHAll(array('mobile'=>$mobile));
         		$config = Dever::db('work/info')->config['config_status'];

+ 12 - 0
tool/work/lib/Manage.php

@@ -69,6 +69,18 @@ Class Manage
 				$fdate = '';
 			}
 			$html['time'] = date('Y-m-d H:i:s',$info['cdate']).'<br/>'.$fdate;
+			$cate_id = explode(',',$info['cate_id']);
+			$cate_name = '';
+			$question_name = '';
+			if (isset($cate_id[0]) && $cate_id[0]) {
+				$cate = Dever::db('work/q_cate')->find($cate_id[0]);
+				$cate_name = $cate['name'];
+			}
+			if (isset($cate_id[1]) && $cate_id[1]) {
+				$question = Dever::db('work/question')->find($cate_id[1]);
+				$question_name = $question['name'];
+			}
+			$html['cate_name'] = $cate_name.'<br/>'.$question_name;
 			return $html;
 		} else {
 			return '';