info.php 15 KB

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