info.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $data = Dever::db('work/q_cate')->state();
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $branch = function()
  13. {
  14. $array = array();
  15. $data = Dever::db('work/branch')->state();
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $priority = function()
  23. {
  24. $array = array();
  25. $data = Dever::db('work/priority')->state();
  26. if($data)
  27. {
  28. foreach ($data as $k => $v) {
  29. $data[$k]['style'] = 'color:'.$v['color'];
  30. }
  31. $array += $data;
  32. }
  33. return $array;
  34. };
  35. $source = function()
  36. {
  37. $array = array();
  38. $data = Dever::db('work/q_source')->state();
  39. if($data)
  40. {
  41. $array += $data;
  42. }
  43. return $array;
  44. };
  45. $question = function()
  46. {
  47. $array = array();
  48. $data = Dever::db('work/question')->state();
  49. if($data)
  50. {
  51. $array += $data;
  52. }
  53. return $array;
  54. };
  55. $status = array
  56. (
  57. // 1 => '全部',
  58. 1 => '待处理',
  59. 2 => '处理中',
  60. 3 => '完成关闭',
  61. 4 => '取消关闭',
  62. );
  63. $admin = Dever::load("manage/auth.info");
  64. $admin_id = '';
  65. if ($admin) {
  66. $admin_id = $admin['id'];
  67. }
  68. #工单列表是1,我的工单列表2
  69. $search_auth = Dever::input('search_option_dever_auth', 1);
  70. $list_button = array();
  71. $list_button['location'] = array('查看详情',Dever::url('lib/appoint.show','work'));
  72. $list_button ['fast_add'] = array('指派工单','appoint&search_option_info_id={id}','{status}<3');
  73. $data = array();
  74. $insert = true;
  75. // $company = Dever::load('manage/company.get');
  76. if ($search_auth == 2) {
  77. $insert = false;
  78. $audit_admin = Dever::setInput('search_option_col', $admin_id);
  79. $data[]= array('待我处理',function() use ($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,2);});
  80. $data[]= array('处理完成',function() use($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,3);});
  81. $data[]= array('我创建的',function() use($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,false);});
  82. }
  83. $button = array();
  84. if ($search_auth == 1) {
  85. $button['回调界面'] = array('location',Dever::url('lib/appoint.back','work'));
  86. }
  87. $excel = false;
  88. if (Dever::load('manage/auth')->checkFunc('work.info', 'infoedit', '数据导出')) {
  89. $excel[] = array('数据导出', '工单列表数据导出', 'work/lib/manage.out_info');
  90. }
  91. return array
  92. (
  93. # 表名
  94. 'name' => 'info',
  95. # 显示给用户看的名称
  96. 'lang' => '发起新工单',
  97. # 后台菜单排序
  98. 'order' => 100,
  99. // 'menu' => false,
  100. // 'auto' => 100000,
  101. 'end' => array
  102. (
  103. 'insert' => 'work/lib/manage.updateInfo',
  104. 'update' => 'work/lib/manage.updateInfo',
  105. ),
  106. 'config_status' => $status,
  107. # 数据结构
  108. 'struct' => array
  109. (
  110. 'id' => array
  111. (
  112. 'type' => 'int-11',
  113. 'name' => 'ID',
  114. 'default' => '',
  115. 'desc' => '',
  116. 'match' => 'is_numeric',
  117. 'search' => 'order',
  118. 'list' => true,
  119. 'order' => 'desc',
  120. ),
  121. 'company_id' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '所属公司',
  125. 'default' => '1',
  126. 'desc' => '所属公司',
  127. 'match' => 'is_numeric',
  128. 'update' => 'hidden',
  129. //'search' => $company ? 'select' : false,
  130. //'list' => true,
  131. ),
  132. 'mobile' => array
  133. (
  134. 'type' => 'bigint-11',
  135. 'name' => '手机号',
  136. 'default' => '',
  137. 'desc' => '请输入手机号',
  138. 'match' => 'option',
  139. 'update' => 'text',
  140. 'search' => 'fulltext',
  141. 'value' => Dever::input('search_option_mobile'),
  142. # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
  143. 'bind' => array('onblur', 'loading', array('url' => Dever::url("lib/manage.search","work"))),
  144. 'list_name' => '客户信息',
  145. 'list' => 'Dever::load("work/lib/manage.getUser#user",{id})',#true,
  146. // '"Dever::load("work/lib/manage.getUser",{mobile})"',
  147. ),
  148. 'name' => array
  149. (
  150. 'type' => 'varchar-200',
  151. 'name' => '用户姓名(或微信名)',
  152. 'default' => '',
  153. 'desc' => '用户姓名(或微信名)',
  154. 'match' => 'option',
  155. 'update' => 'text',
  156. // 'search' => 'fulltext',
  157. // 'list' => true,
  158. ),
  159. 'work_num' => array
  160. (
  161. 'type' => 'varchar-100',
  162. 'name' => '工单号',
  163. 'default' => '',
  164. 'desc' => '工单号',
  165. 'match' => 'is_string',
  166. 'update' => 'hidden',
  167. // 'search' => 'fulltext',
  168. // 'list' => true,
  169. ),
  170. 'source' => array
  171. (
  172. 'type' => 'int-11',
  173. 'name' => '问题来源',
  174. 'default' => '1',
  175. 'desc' => '问题来源',
  176. 'match' => 'is_string',
  177. 'option' => $source,
  178. 'update' => 'radio',
  179. 'search' => $search_auth == 1 ? 'select' : false,
  180. // 'list' => true,
  181. ),
  182. 'cate_id' => array
  183. (
  184. 'type' => 'varchar-30',
  185. 'name' => '问题类型',
  186. 'default' => '-1',
  187. 'desc' => '问题类型',
  188. 'match' => 'is_string',
  189. 'search' => $search_auth == 1 ? 'linkage' : false,
  190. 'update' => 'linkage',
  191. 'option' => Dever::url('lib/appoint.getCate?level_total=2', 'work'),
  192. 'list' => 'Dever::load("work/lib/manage.getUser#cate_name",{id})',
  193. ),
  194. 'priority_id' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '优先级',
  198. 'default' => '1',
  199. 'desc' => '优先级',
  200. 'match' => 'is_string',
  201. 'option' => $priority,
  202. 'update' => 'radio',
  203. 'search' => $search_auth == 1 ? 'select' : false,
  204. 'list' => true,
  205. ),
  206. 'appoint_id' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '指派人',
  210. 'default' => '-1',
  211. 'desc' => '指派人',
  212. 'match' => 'is_string',
  213. // 'option' => $priority,
  214. // 'update' => 'select',
  215. // 'search' => 'select',
  216. // 'list' => true,
  217. ),
  218. 'desc' => array
  219. (
  220. 'type' => 'text-255',
  221. 'name' => '问题描述',
  222. 'default' => '',
  223. 'desc' => '问题描述',
  224. 'match' => 'is_string',
  225. 'update' => 'textarea',
  226. 'list' => true,
  227. ),
  228. 'pic' => array
  229. (
  230. 'type' => 'varchar-500',
  231. 'name' => '相关截图',
  232. 'default' => '',
  233. 'desc' => '请选择相关截图',
  234. 'match' => 'option',
  235. 'update' => 'images',
  236. 'key' => '1',
  237. //'place' => '150',
  238. ),
  239. 'video' => array
  240. (
  241. 'type' => 'varchar-500',
  242. 'name' => '相关视频',
  243. 'default' => '',
  244. 'desc' => '请选择相关视频',
  245. 'match' => 'option',
  246. 'update' => 'video',
  247. 'key' => '3',
  248. //'place' => '150',
  249. ),
  250. 'group' => array
  251. (
  252. 'type' => 'int-11',
  253. 'name' => '部门',
  254. 'default' => '',
  255. 'desc' => '部门',
  256. 'match' => 'option',
  257. // 'search' => 'linkage',
  258. 'update' => 'hidden',
  259. // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  260. ),
  261. 'branch_id' => array
  262. (
  263. 'type' => 'varchar-500',
  264. 'name' => '协助部门',
  265. 'default' => '',
  266. 'desc' => '协助部门',
  267. 'match' => 'option',
  268. // 'search' => 'linkage',
  269. 'update' => 'linkage',
  270. 'option' => Dever::url('lib/appoint.get?level_total=1', 'work'),
  271. ),
  272. 'status' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '处理结果',
  276. 'default' => '1',
  277. 'desc' => '处理结果',
  278. 'match' => 'is_string',
  279. 'option' => $status,
  280. 'update' => 'radio',
  281. 'search' => 'select',
  282. 'list' => true,
  283. ),
  284. 'fdate' => array
  285. (
  286. 'type' => 'int-11',
  287. 'name' => '完成时间',
  288. 'default' => '',
  289. 'match' => 'is_numeric',
  290. // 'search' => 'date',
  291. 'list_name' => '时间/完成时间',
  292. // 'desc' => '',
  293. 'list' => 'Dever::load("work/lib/manage.getUSer#time",{id})',
  294. 'list_order' => 1,
  295. ),
  296. 'zdate' => array
  297. (
  298. 'type' => 'int-11',
  299. 'name' => '指派时间',
  300. 'default' => '',
  301. 'match' => 'is_numeric',
  302. // 'search' => 'date',
  303. ),
  304. 'chdate' => array
  305. (
  306. 'type' => 'int-11',
  307. 'name' => '处理时间',
  308. 'default' => '',
  309. 'match' => 'is_numeric',
  310. // 'search' => 'date',
  311. // 'desc' => '',
  312. ),
  313. 'audit_admin' => array
  314. (
  315. 'type' => 'int-11',
  316. 'name' => '工单创建人',
  317. 'default' => '',
  318. 'match' => 'is_numeric',
  319. 'desc' => '工单创建人',
  320. 'update' => 'hidden',
  321. 'value' => $admin_id,
  322. // 'list' => 'Dever::load("active/lib/manage.active#admin_name",{id})',
  323. ),
  324. 'reorder' => array
  325. (
  326. 'type' => 'int-11',
  327. 'name' => '排序-数值越大越靠前',
  328. 'default' => '1',
  329. 'desc' => '请输入排序',
  330. 'match' => 'option',
  331. // 'update' => 'text',
  332. // 'search' => 'order',
  333. // 'list' => true,
  334. // 'order' => 'desc',
  335. // 'edit' => true,
  336. ),
  337. 'state' => array
  338. (
  339. 'type' => 'tinyint-1',
  340. 'name' => '状态',
  341. 'default' => '1',
  342. 'desc' => '请选择状态',
  343. 'match' => 'is_numeric',
  344. ),
  345. 'cdate' => array
  346. (
  347. 'type' => 'int-11',
  348. 'name' => '创建时间',
  349. 'match' => array('is_numeric', time()),
  350. 'desc' => '',
  351. # 只有insert时才生效
  352. 'insert' => true,
  353. 'search' => 'date',
  354. // 'list' => 'date("Y-m-d H:i:s", {cdate})',
  355. ),
  356. ),
  357. 'manage' => array
  358. (
  359. 'insert' => $insert,
  360. 'delete' => false,
  361. 'edit' => false,
  362. 'list_button' => $list_button,
  363. 'data' => $data,
  364. 'button' => $button,
  365. 'excel' => $excel,
  366. # 设置公司权限
  367. 'company' => 'company_id',
  368. ),
  369. 'request' => array
  370. (
  371. 'list_option' => array
  372. (
  373. 'col' => 'yes-appoint_id,audit_admin',
  374. ),
  375. // 'getData' => array
  376. // (
  377. // # 匹配的正则或函数 选填项
  378. // 'option' => array
  379. // (
  380. // //'id' => array('yes', '!='),
  381. // 'state' => 1,
  382. // ),
  383. // 'type' => 'all',
  384. // 'order' => array('id' => 'desc'),
  385. // 'col' => '*|id',
  386. // ),
  387. 'getTotal' => array
  388. (
  389. # 匹配的正则或函数 选填项
  390. 'option' => array
  391. (
  392. 'audit_admin' => 'yes',
  393. 'appoint_id' => 'yes',
  394. 'state' => 1,
  395. 'status'=> 'yes',
  396. 'company_id'=>'yes',
  397. ),
  398. 'type' => 'count',
  399. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  400. 'col' => '*',
  401. ),
  402. 'getCount' => array
  403. (
  404. # 匹配的正则或函数 选填项
  405. 'option' => array
  406. (
  407. 'group' => 'yes',
  408. 'state' => 1,
  409. 'start' => array('yes-cdate','>='),
  410. 'end' => array('yes-cdate','<='),
  411. 'status'=> array('yes','in'),
  412. ),
  413. 'type' => 'count',
  414. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  415. 'col' => '*',
  416. ),
  417. 'getAll' => array
  418. (
  419. # 匹配的正则或函数 选填项
  420. 'option' => array
  421. (
  422. 'group' => 'yes',
  423. 'state' => 1,
  424. 'start' => array('yes-cdate','>='),
  425. 'end' => array('yes-cdate','<='),
  426. 'status'=> array('yes','in'),
  427. ),
  428. 'type' => 'all',
  429. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  430. 'col' => '*',
  431. ),
  432. 'getHAll' => array
  433. (
  434. # 匹配的正则或函数 选填项
  435. 'option' => array
  436. (
  437. 'mobile' =>'yes',
  438. 'state' => 1,
  439. ),
  440. 'type' => 'all',
  441. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  442. 'page' => array(5,'list'),
  443. 'col' => '*',
  444. ),
  445. ),
  446. );