info.php 15 KB

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