agreement.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待签署',
  5. 2 => '有效',
  6. 3 => '作废',
  7. );
  8. $audit = array
  9. (
  10. 1 => '未提交审核',
  11. 2 => '待审核',
  12. 3 => '审核通过',
  13. 4 => '审核未通过',
  14. );
  15. $audit_manage = array
  16. (
  17. //1 => '未提交审核',
  18. //2 => '待审核',
  19. 3 => '审核通过',
  20. 4 => '审核未通过',
  21. );
  22. $col = Dever::input('col');
  23. $aid = Dever::input('search_option_aid');
  24. $button = array();
  25. if ($aid) {
  26. $option_aid = $aid;
  27. $search_auth = Dever::input('search_auth');
  28. if ($search_auth) {
  29. $option_aid .= '&search_auth=' . $search_auth;
  30. }
  31. $button = array
  32. (
  33. '返回上一页' => array('location', 'l=project/database/list&project=option&table=cash&page_type=1&aid=' . $option_aid),
  34. );
  35. }
  36. return array
  37. (
  38. # 表名
  39. 'name' => 'agreement',
  40. # 显示给用户看的名称
  41. 'lang' => '期权合同管理',
  42. 'order' => 10,
  43. 'status' => $status,
  44. 'start' => array
  45. (
  46. 'update' => 'option/lib/manage.setAudit',
  47. ),
  48. 'end' => array
  49. (
  50. 'update' => 'option/lib/manage.setAgreement',
  51. ),
  52. # 数据结构
  53. 'struct' => array
  54. (
  55. 'id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => 'ID',
  59. 'default' => '',
  60. 'desc' => '',
  61. 'match' => 'is_numeric',
  62. 'search' => 'order',
  63. //'list' => true,
  64. ),
  65. 'aid' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '手机号',
  69. 'default' => '-1',
  70. 'desc' => '代理商',
  71. 'match' => 'is_string',
  72. 'update' => 'text',
  73. 'search' => array
  74. (
  75. 'api' => 'option/account-find',
  76. 'col' => 'mobile',
  77. 'result' => 'id',
  78. ),
  79. 'list_name' => '期权账户',
  80. 'list' => 'Dever::load("option/lib/account.getInfo", {aid})',
  81. 'list_order' => 3,
  82. ),
  83. 'order_num' => array
  84. (
  85. 'type' => 'varchar-100',
  86. 'name' => '合同编号',
  87. 'default' => '',
  88. 'desc' => '合同编号',
  89. 'match' => 'is_string',
  90. 'update' => 'text',
  91. ),
  92. 'agreement_id' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '合同模板id',
  96. 'default' => '',
  97. 'desc' => '合同模板id',
  98. 'match' => 'is_numeric',
  99. ),
  100. 'agreement_name' => array
  101. (
  102. 'type' => 'varchar-500',
  103. 'name' => '合同名称',
  104. 'default' => '',
  105. 'desc' => '合同名称',
  106. 'match' => 'is_string',
  107. 'update' => 'text',
  108. 'search' => 'fulltext',
  109. 'list' => true,
  110. 'list_order' => 6,
  111. ),
  112. 'jiaofu_date' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '交付时间',
  116. 'match' => 'is_numeric',
  117. 'desc' => '交付时间',
  118. ),
  119. 'jiaofu_total' => array
  120. (
  121. 'type' => 'float-11,2',
  122. 'name' => '交付的总额',
  123. 'default' => '',
  124. 'desc' => '交付的总额',
  125. 'match' => 'is_numeric',
  126. ),
  127. 'jiaofu_qiquan' => array
  128. (
  129. 'type' => 'float-11,2',
  130. 'name' => '交付的期权价值',
  131. 'default' => '',
  132. 'desc' => '交付的期权价值',
  133. 'match' => 'is_numeric',
  134. ),
  135. 'jiaofu_yuanshi' => array
  136. (
  137. 'type' => 'float-11,2',
  138. 'name' => '交付的原始期权价值',
  139. 'default' => '',
  140. 'desc' => '交付的原始期权价值',
  141. 'match' => 'is_numeric',
  142. ),
  143. 'sign' => array
  144. (
  145. 'type' => 'varchar-150',
  146. 'name' => '合同签名',
  147. 'default' => '',
  148. 'desc' => '合同签名',
  149. 'match' => 'option',
  150. 'update' => 'image',
  151. 'key' => '7',
  152. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  153. 'list_order' => 7,
  154. ),
  155. 'name' => array
  156. (
  157. 'type' => 'varchar-100',
  158. 'name' => '姓名',
  159. 'default' => '',
  160. 'desc' => '姓名',
  161. 'match' => 'is_string',
  162. 'update' => 'text',
  163. ),
  164. 'mobile' => array
  165. (
  166. 'type' => 'bigint-11',
  167. 'name' => '手机号',
  168. 'default' => '',
  169. 'desc' => '请输入手机号',
  170. 'match' => Dever::rule('mobile'),
  171. 'update' => 'text',
  172. 'search' => $aid ? 'hidden' : 'fulltext',
  173. //'list' => $aid ? false : true,
  174. //'list_order' => 2,
  175. ),
  176. 'idcard' => array
  177. (
  178. 'type' => 'varchar-32',
  179. 'name' => '身份证号码',
  180. 'default' => '',
  181. 'desc' => '身份证号码',
  182. 'match' => 'is_string',
  183. 'update' => 'text',
  184. ),
  185. 'idcard_front' => array
  186. (
  187. 'type' => 'varchar-150',
  188. 'name' => '身份证正面',
  189. 'default' => '',
  190. 'desc' => '身份证正面',
  191. 'match' => 'option',
  192. 'update' => 'image',
  193. 'key' => '8',
  194. 'place' => '660*660',
  195. ),
  196. 'idcard_back' => array
  197. (
  198. 'type' => 'varchar-150',
  199. 'name' => '身份证背面',
  200. 'default' => '',
  201. 'desc' => '身份证背面',
  202. 'match' => 'option',
  203. 'update' => 'image',
  204. 'key' => '8',
  205. 'place' => '660*660',
  206. ),
  207. 'address' => array
  208. (
  209. 'type' => 'varchar-800',
  210. 'name' => '地址',
  211. 'default' => '',
  212. 'desc' => '地址',
  213. 'match' => 'is_string',
  214. 'update' => 'text',
  215. ),
  216. 'qdate' => array
  217. (
  218. 'type' => 'int-11',
  219. 'name' => '协议签订时间',
  220. 'match' => 'is_numeric',
  221. 'desc' => '协议签订时间',
  222. 'update' => 'text',
  223. ),
  224. 'sdate' => array
  225. (
  226. 'type' => 'int-11',
  227. 'name' => '有效期开始时间',
  228. 'match' => 'is_numeric',
  229. 'desc' => '有效期开始时间',
  230. 'update' => 'text',
  231. ),
  232. 'edate' => array
  233. (
  234. 'type' => 'int-11',
  235. 'name' => '有效期结束时间',
  236. 'match' => 'is_numeric',
  237. 'desc' => '有效期结束时间',
  238. 'update' => 'text',
  239. ),
  240. 'udate' => array
  241. (
  242. 'type' => 'int-11',
  243. 'name' => '更新时间',
  244. 'match' => 'is_numeric',
  245. 'desc' => '更新时间',
  246. 'search' => 'date',
  247. 'list' => 'date("Y-m-d H:i", {udate})',
  248. 'list_order' => 5,
  249. ),
  250. 'content' => array
  251. (
  252. 'type' => 'text-255',
  253. 'name' => '合同内容',
  254. 'default' => '',
  255. 'desc' => '请输入内容',
  256. 'match' => 'is_string',
  257. ),
  258. 'status' => array
  259. (
  260. 'type' => 'tinyint-1',
  261. 'name' => '合同状态',
  262. 'default' => '1',
  263. 'desc' => '合同状态',
  264. 'match' => 'is_numeric',
  265. 'option' => $status,
  266. //'search' => 'select',
  267. //'list' => true,
  268. //'list_order' => 8,
  269. ),
  270. 'audit' => array
  271. (
  272. 'type' => 'tinyint-1',
  273. 'name' => '审核状态',
  274. 'default' => $col ? '3' : '1',
  275. 'desc' => '审核',
  276. 'match' => 'is_numeric',
  277. 'option' => $col ? $audit_manage : $audit,
  278. 'update' => 'radio',
  279. 'search' => 'select',
  280. 'control' => 'audit',
  281. 'value' => $col ? '3' : '1',
  282. 'list' => true,
  283. 'list_order' => 7,
  284. 'control' => 'audit',
  285. ),
  286. 'audit_desc' => array
  287. (
  288. 'type' => 'varchar-500',
  289. 'name' => '审核备注',
  290. 'default' => '',
  291. 'desc' => '备注',
  292. 'match' => 'option',
  293. 'update' => 'textarea',
  294. 'value' => '',
  295. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  296. 'list_order' => 9,
  297. 'show' => 'audit=4',
  298. ),
  299. 'audit_date' => array
  300. (
  301. 'type' => 'int-11',
  302. 'name' => '审核时间',
  303. 'match' => 'is_numeric',
  304. 'desc' => '审核时间',
  305. 'default' => '',
  306. ),
  307. 'audit_admin' => array
  308. (
  309. 'type' => 'int-11',
  310. 'name' => '操作人',
  311. 'default' => '',
  312. 'match' => 'is_numeric',
  313. 'desc' => '操作人',
  314. 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  315. 'list_order' => 6,
  316. ),
  317. 'state' => array
  318. (
  319. 'type' => 'tinyint-1',
  320. 'name' => '状态',
  321. 'default' => '1',
  322. 'desc' => '请选择状态',
  323. 'match' => 'is_numeric',
  324. ),
  325. 'cdate' => array
  326. (
  327. 'type' => 'int-11',
  328. 'name' => '操作时间',
  329. 'match' => array('is_numeric', time()),
  330. 'desc' => '',
  331. # 只有insert时才生效
  332. 'insert' => true,
  333. //'search' => 'date',
  334. 'list' => 'Dever::load("option/lib/manage.getDate", {id})',
  335. 'list_order' => 4,
  336. ),
  337. ),
  338. 'manage' => array
  339. (
  340. 'insert' => false,
  341. 'delete' => false,
  342. 'edit' => false,
  343. 'button' => $button,
  344. 'list_button' => array
  345. (
  346. 'new' => array('查看', '"lib/agreement.location?id={id}"', 'option'),
  347. //'oper' => array('作废并生成', '"option/lib/manage.dropAgreement?id={id}"', "{status} == 2"),
  348. //'oper1' => array('更新', '"option/lib/manage.upAgreement?id={id}"', "{status} == 2"),
  349. 'edit' => array('审核', 'audit,audit_desc', '{audit} >= 2'),
  350. ),
  351. ),
  352. 'request' => array
  353. (
  354. 'getData' => array
  355. (
  356. # 匹配的正则或函数 选填项
  357. 'option' => array
  358. (
  359. 'aid' => 'yes',
  360. 'agreement_id' => 'yes',
  361. 'state' => 1,
  362. ),
  363. 'type' => 'all',
  364. 'order' => array('id' => 'desc'),
  365. 'col' => '*',
  366. ),
  367. 'getOld' => array
  368. (
  369. # 匹配的正则或函数 选填项
  370. 'option' => array
  371. (
  372. 'aid' => 'yes',
  373. 'agreement_id' => 'yes',
  374. 'state' => 1,
  375. ),
  376. 'type' => 'one',
  377. 'order' => array('id' => 'desc'),
  378. 'col' => '*',
  379. ),
  380. 'getOne' => array
  381. (
  382. # 匹配的正则或函数 选填项
  383. 'option' => array
  384. (
  385. 'aid' => 'yes',
  386. 'type' => 'yes',
  387. 'state' => 1,
  388. ),
  389. 'type' => 'one',
  390. 'order' => array('id' => 'desc'),
  391. 'col' => '*',
  392. ),
  393. 'getAll' => array
  394. (
  395. # 匹配的正则或函数 选填项
  396. 'option' => array
  397. (
  398. 'aid' => 'yes',
  399. 'audit' => 'yes',
  400. 'state' => 1,
  401. ),
  402. 'type' => 'all',
  403. 'order' => array('id' => 'desc'),
  404. 'page' => array(10, 'list'),
  405. 'col' => 'id,aid,agreement_id,status,qdate,name,agreement_name',
  406. ),
  407. ),
  408. );