agreement.php 13 KB

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