agreement.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. 'sign' => array
  124. (
  125. 'type' => 'varchar-150',
  126. 'name' => '合同签名',
  127. 'default' => '',
  128. 'desc' => '合同签名',
  129. 'match' => 'option',
  130. 'update' => 'image',
  131. 'key' => '7',
  132. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  133. 'list_order' => 7,
  134. ),
  135. 'name' => array
  136. (
  137. 'type' => 'varchar-100',
  138. 'name' => '姓名',
  139. 'default' => '',
  140. 'desc' => '姓名',
  141. 'match' => 'is_string',
  142. 'update' => 'text',
  143. ),
  144. 'mobile' => array
  145. (
  146. 'type' => 'bigint-11',
  147. 'name' => '手机号',
  148. 'default' => '',
  149. 'desc' => '请输入手机号',
  150. 'match' => Dever::rule('mobile'),
  151. 'update' => 'text',
  152. 'search' => $aid ? 'hidden' : 'fulltext',
  153. //'list' => $aid ? false : true,
  154. //'list_order' => 2,
  155. ),
  156. 'idcard' => array
  157. (
  158. 'type' => 'varchar-32',
  159. 'name' => '身份证号码',
  160. 'default' => '',
  161. 'desc' => '身份证号码',
  162. 'match' => 'is_string',
  163. 'update' => 'text',
  164. ),
  165. 'idcard_front' => array
  166. (
  167. 'type' => 'varchar-150',
  168. 'name' => '身份证正面',
  169. 'default' => '',
  170. 'desc' => '身份证正面',
  171. 'match' => 'option',
  172. 'update' => 'image',
  173. 'key' => '8',
  174. 'place' => '660*660',
  175. ),
  176. 'idcard_back' => array
  177. (
  178. 'type' => 'varchar-150',
  179. 'name' => '身份证背面',
  180. 'default' => '',
  181. 'desc' => '身份证背面',
  182. 'match' => 'option',
  183. 'update' => 'image',
  184. 'key' => '8',
  185. 'place' => '660*660',
  186. ),
  187. 'address' => array
  188. (
  189. 'type' => 'varchar-800',
  190. 'name' => '地址',
  191. 'default' => '',
  192. 'desc' => '地址',
  193. 'match' => 'is_string',
  194. 'update' => 'text',
  195. ),
  196. 'qdate' => array
  197. (
  198. 'type' => 'int-11',
  199. 'name' => '协议签订时间',
  200. 'match' => 'is_numeric',
  201. 'desc' => '协议签订时间',
  202. 'update' => 'text',
  203. ),
  204. 'sdate' => array
  205. (
  206. 'type' => 'int-11',
  207. 'name' => '有效期开始时间',
  208. 'match' => 'is_numeric',
  209. 'desc' => '有效期开始时间',
  210. 'update' => 'text',
  211. ),
  212. 'edate' => array
  213. (
  214. 'type' => 'int-11',
  215. 'name' => '有效期结束时间',
  216. 'match' => 'is_numeric',
  217. 'desc' => '有效期结束时间',
  218. 'update' => 'text',
  219. ),
  220. 'udate' => array
  221. (
  222. 'type' => 'int-11',
  223. 'name' => '更新时间',
  224. 'match' => 'is_numeric',
  225. 'desc' => '更新时间',
  226. 'search' => 'date',
  227. 'list' => 'date("Y-m-d H:i", {udate})',
  228. 'list_order' => 5,
  229. ),
  230. 'content' => array
  231. (
  232. 'type' => 'text-255',
  233. 'name' => '合同内容',
  234. 'default' => '',
  235. 'desc' => '请输入内容',
  236. 'match' => 'is_string',
  237. ),
  238. 'status' => array
  239. (
  240. 'type' => 'tinyint-1',
  241. 'name' => '合同状态',
  242. 'default' => '1',
  243. 'desc' => '合同状态',
  244. 'match' => 'is_numeric',
  245. 'option' => $status,
  246. 'search' => 'select',
  247. //'list' => true,
  248. //'list_order' => 8,
  249. ),
  250. 'audit' => array
  251. (
  252. 'type' => 'tinyint-1',
  253. 'name' => '审核',
  254. 'default' => $col ? '3' : '1',
  255. 'desc' => '审核',
  256. 'match' => 'is_numeric',
  257. 'option' => $col ? $audit_manage : $audit,
  258. 'update' => 'radio',
  259. 'control' => 'audit',
  260. 'value' => $col ? '3' : '1',
  261. 'list' => true,
  262. 'list_order' => 7,
  263. ),
  264. 'audit_desc' => array
  265. (
  266. 'type' => 'varchar-500',
  267. 'name' => '审核备注',
  268. 'default' => '',
  269. 'desc' => '备注',
  270. 'match' => 'option',
  271. 'update' => 'textarea',
  272. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  273. 'list_order' => 9,
  274. ),
  275. 'audit_date' => array
  276. (
  277. 'type' => 'int-11',
  278. 'name' => '审核时间',
  279. 'match' => 'is_numeric',
  280. 'desc' => '审核时间',
  281. 'default' => '',
  282. ),
  283. 'audit_admin' => array
  284. (
  285. 'type' => 'int-11',
  286. 'name' => '操作人',
  287. 'default' => '',
  288. 'match' => 'is_numeric',
  289. 'desc' => '操作人',
  290. 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  291. 'list_order' => 6,
  292. ),
  293. 'state' => array
  294. (
  295. 'type' => 'tinyint-1',
  296. 'name' => '状态',
  297. 'default' => '1',
  298. 'desc' => '请选择状态',
  299. 'match' => 'is_numeric',
  300. ),
  301. 'cdate' => array
  302. (
  303. 'type' => 'int-11',
  304. 'name' => '操作时间',
  305. 'match' => array('is_numeric', time()),
  306. 'desc' => '',
  307. # 只有insert时才生效
  308. 'insert' => true,
  309. //'search' => 'date',
  310. 'list' => 'Dever::load("option/lib/manage.getDate", {id})',
  311. 'list_order' => 4,
  312. ),
  313. ),
  314. 'manage' => array
  315. (
  316. 'insert' => false,
  317. 'delete' => false,
  318. 'edit' => false,
  319. 'button' => $button,
  320. 'list_button' => array
  321. (
  322. 'new' => array('查看', '"lib/agreement.location?id={id}"', 'option'),
  323. //'oper' => array('作废并生成', '"option/lib/manage.dropAgreement?id={id}"', "{status} == 2"),
  324. //'oper1' => array('更新', '"option/lib/manage.upAgreement?id={id}"', "{status} == 2"),
  325. 'edit' => array('审核', 'audit,audit_desc', '{audit} == 2'),
  326. ),
  327. ),
  328. 'request' => array
  329. (
  330. 'getData' => array
  331. (
  332. # 匹配的正则或函数 选填项
  333. 'option' => array
  334. (
  335. 'aid' => 'yes',
  336. 'agreement_id' => 'yes',
  337. 'state' => 1,
  338. ),
  339. 'type' => 'all',
  340. 'order' => array('id' => 'desc'),
  341. 'col' => '*',
  342. ),
  343. 'getOld' => array
  344. (
  345. # 匹配的正则或函数 选填项
  346. 'option' => array
  347. (
  348. 'aid' => 'yes',
  349. 'agreement_id' => 'yes',
  350. 'state' => 1,
  351. ),
  352. 'type' => 'one',
  353. 'order' => array('id' => 'desc'),
  354. 'col' => '*',
  355. ),
  356. 'getOne' => array
  357. (
  358. # 匹配的正则或函数 选填项
  359. 'option' => array
  360. (
  361. 'aid' => 'yes',
  362. 'type' => 'yes',
  363. 'state' => 1,
  364. ),
  365. 'type' => 'one',
  366. 'order' => array('id' => 'desc'),
  367. 'col' => '*',
  368. ),
  369. 'getAll' => array
  370. (
  371. # 匹配的正则或函数 选填项
  372. 'option' => array
  373. (
  374. 'aid' => 'yes',
  375. 'audit' => 'yes',
  376. 'state' => 1,
  377. ),
  378. 'type' => 'all',
  379. 'order' => array('id' => 'desc'),
  380. 'page' => array(10, 'list'),
  381. 'col' => 'id,aid,agreement_id,status,qdate,name,agreement_name',
  382. ),
  383. ),
  384. );