agreement.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待签署',
  5. 2 => '有效',
  6. 3 => '作废',
  7. );
  8. $aid = Dever::input('search_option_aid');
  9. $button = array();
  10. if ($aid) {
  11. $button = array
  12. (
  13. '返回上一页' => array('location', 'l=project/database/list&project=option&table=cash&page_type=1&aid=' . $aid),
  14. );
  15. }
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'agreement',
  20. # 显示给用户看的名称
  21. 'lang' => '合同管理',
  22. 'order' => 10,
  23. 'menu' => false,
  24. 'status' => $status,
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'order',
  36. //'list' => true,
  37. ),
  38. 'aid' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '手机号',
  42. 'default' => '-1',
  43. 'desc' => '代理商',
  44. 'match' => 'is_string',
  45. 'update' => 'text',
  46. 'search' => array
  47. (
  48. 'api' => 'option/account-find',
  49. 'col' => 'mobile',
  50. 'result' => 'id',
  51. ),
  52. 'list_name' => '期权账户',
  53. 'list' => 'Dever::load("option/lib/account.getInfo", {aid})',
  54. 'list_order' => 3,
  55. ),
  56. 'order_num' => array
  57. (
  58. 'type' => 'varchar-100',
  59. 'name' => '合同编号',
  60. 'default' => '',
  61. 'desc' => '合同编号',
  62. 'match' => 'is_string',
  63. 'update' => 'text',
  64. ),
  65. 'agreement_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '合同模板id',
  69. 'default' => '',
  70. 'desc' => '合同模板id',
  71. 'match' => 'is_numeric',
  72. ),
  73. 'agreement_name' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '合同名称',
  77. 'default' => '',
  78. 'desc' => '合同名称',
  79. 'match' => 'is_string',
  80. 'update' => 'text',
  81. 'search' => 'fulltext',
  82. 'list' => true,
  83. 'list_order' => 6,
  84. ),
  85. 'sign' => array
  86. (
  87. 'type' => 'varchar-150',
  88. 'name' => '合同签名',
  89. 'default' => '',
  90. 'desc' => '合同签名',
  91. 'match' => 'option',
  92. 'update' => 'image',
  93. 'key' => '7',
  94. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  95. 'list_order' => 7,
  96. ),
  97. 'name' => array
  98. (
  99. 'type' => 'varchar-100',
  100. 'name' => '姓名',
  101. 'default' => '',
  102. 'desc' => '姓名',
  103. 'match' => 'is_string',
  104. 'update' => 'text',
  105. ),
  106. 'mobile' => array
  107. (
  108. 'type' => 'bigint-11',
  109. 'name' => '手机号',
  110. 'default' => '',
  111. 'desc' => '请输入手机号',
  112. 'match' => Dever::rule('mobile'),
  113. 'update' => 'text',
  114. 'search' => $aid ? 'hidden' : 'fulltext',
  115. //'list' => $aid ? false : true,
  116. //'list_order' => 2,
  117. ),
  118. 'idcard' => array
  119. (
  120. 'type' => 'varchar-32',
  121. 'name' => '身份证号码',
  122. 'default' => '',
  123. 'desc' => '身份证号码',
  124. 'match' => 'is_string',
  125. 'update' => 'text',
  126. ),
  127. 'idcard_front' => array
  128. (
  129. 'type' => 'varchar-150',
  130. 'name' => '身份证正面',
  131. 'default' => '',
  132. 'desc' => '身份证正面',
  133. 'match' => 'option',
  134. 'update' => 'image',
  135. 'key' => '8',
  136. 'place' => '660*660',
  137. ),
  138. 'idcard_back' => array
  139. (
  140. 'type' => 'varchar-150',
  141. 'name' => '身份证背面',
  142. 'default' => '',
  143. 'desc' => '身份证背面',
  144. 'match' => 'option',
  145. 'update' => 'image',
  146. 'key' => '8',
  147. 'place' => '660*660',
  148. ),
  149. 'address' => array
  150. (
  151. 'type' => 'varchar-800',
  152. 'name' => '地址',
  153. 'default' => '',
  154. 'desc' => '地址',
  155. 'match' => 'is_string',
  156. 'update' => 'text',
  157. ),
  158. 'qdate' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '协议签订时间',
  162. 'match' => 'is_numeric',
  163. 'desc' => '协议签订时间',
  164. 'update' => 'text',
  165. ),
  166. 'sdate' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '有效期开始时间',
  170. 'match' => 'is_numeric',
  171. 'desc' => '有效期开始时间',
  172. 'update' => 'text',
  173. ),
  174. 'edate' => array
  175. (
  176. 'type' => 'int-11',
  177. 'name' => '有效期结束时间',
  178. 'match' => 'is_numeric',
  179. 'desc' => '有效期结束时间',
  180. 'update' => 'text',
  181. ),
  182. 'udate' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '更新时间',
  186. 'match' => 'is_numeric',
  187. 'desc' => '更新时间',
  188. 'search' => 'date',
  189. 'list' => 'date("Y-m-d H:i", {udate})',
  190. 'list_order' => 5,
  191. ),
  192. 'content' => array
  193. (
  194. 'type' => 'text-255',
  195. 'name' => '合同内容',
  196. 'default' => '',
  197. 'desc' => '请输入内容',
  198. 'match' => 'is_string',
  199. ),
  200. 'status' => array
  201. (
  202. 'type' => 'tinyint-1',
  203. 'name' => '合同状态',
  204. 'default' => '1',
  205. 'desc' => '合同状态',
  206. 'match' => 'is_numeric',
  207. 'option' => $status,
  208. 'search' => 'select',
  209. 'list' => true,
  210. 'list_order' => 8,
  211. ),
  212. 'state' => array
  213. (
  214. 'type' => 'tinyint-1',
  215. 'name' => '状态',
  216. 'default' => '1',
  217. 'desc' => '请选择状态',
  218. 'match' => 'is_numeric',
  219. ),
  220. 'cdate' => array
  221. (
  222. 'type' => 'int-11',
  223. 'name' => '创建时间',
  224. 'match' => array('is_numeric', time()),
  225. 'desc' => '',
  226. # 只有insert时才生效
  227. 'insert' => true,
  228. //'search' => 'date',
  229. 'list' => 'date("Y-m-d H:i", {cdate})',
  230. 'list_order' => 4,
  231. ),
  232. ),
  233. 'manage' => array
  234. (
  235. 'insert' => false,
  236. 'delete' => false,
  237. 'edit' => false,
  238. 'button' => $button,
  239. 'list_button' => array
  240. (
  241. 'new' => array('查看', '"lib/agreement.location?id={id}"', 'option'),
  242. 'oper' => array('作废并生成', '"option/lib/manage.dropAgreement?id={id}"', "{status} == 2"),
  243. 'oper1' => array('更新', '"option/lib/manage.upAgreement?id={id}"', "{status} == 2"),
  244. ),
  245. ),
  246. 'request' => array
  247. (
  248. 'getData' => array
  249. (
  250. # 匹配的正则或函数 选填项
  251. 'option' => array
  252. (
  253. 'aid' => 'yes',
  254. 'agreement_id' => 'yes',
  255. 'state' => 1,
  256. ),
  257. 'type' => 'all',
  258. 'order' => array('id' => 'desc'),
  259. 'col' => '*',
  260. ),
  261. 'getOld' => array
  262. (
  263. # 匹配的正则或函数 选填项
  264. 'option' => array
  265. (
  266. 'aid' => 'yes',
  267. 'agreement_id' => 'yes',
  268. 'state' => 1,
  269. ),
  270. 'type' => 'one',
  271. 'order' => array('id' => 'desc'),
  272. 'col' => '*',
  273. ),
  274. 'getOne' => array
  275. (
  276. # 匹配的正则或函数 选填项
  277. 'option' => array
  278. (
  279. 'aid' => 'yes',
  280. 'type' => 'yes',
  281. 'state' => 1,
  282. ),
  283. 'type' => 'one',
  284. 'order' => array('id' => 'desc'),
  285. 'col' => '*',
  286. ),
  287. 'getAll' => array
  288. (
  289. # 匹配的正则或函数 选填项
  290. 'option' => array
  291. (
  292. 'aid' => 'yes',
  293. 'state' => 1,
  294. ),
  295. 'type' => 'all',
  296. 'order' => array('id' => 'desc'),
  297. 'page' => array(10, 'list'),
  298. 'col' => 'id,aid,agreement_id,status,qdate,name,area,agreement_name',
  299. ),
  300. ),
  301. );