agreement.php 13 KB

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