agreement.php 12 KB

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