agreement.php 13 KB

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