agreement.php 12 KB

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