member_agreement.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待签署', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 2 => array('name' => '有效', 'style' => 'font-weight:bold;color:green'),
  6. 3 => array('name' => '作废', 'style' => 'font-weight:bold;color:#CD3700'),
  7. 4 => array('name' => '终止合同', 'style' => 'font-weight:bold;color:#CD3700'),
  8. );
  9. $mid = Dever::input('search_option_mid');
  10. $button = array();
  11. if ($mid) {
  12. $button = array
  13. (
  14. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  15. );
  16. }
  17. $list_button = array();
  18. $list_button['new'] = array('查看', '"lib/agreement.location?id={id}"', 'agent');
  19. if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit', '作废并生成')) {
  20. $list_button['oper'] = array('作废并生成', '"agent/lib/manage.dropAgreement?id={id}"', "{status} == 2");
  21. }
  22. if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit1', '更新')) {
  23. $list_button['oper1'] = array('更新', '"agent/lib/manage.upAgreement?id={id}"', "{status} <= 2");
  24. }
  25. if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'chongxinqianshu', '重新签署')) {
  26. $list_button['oper2'] = array('更新并重新签署', '"agent/lib/manage.upSignAgreement?id={id}"', "{status} == 2");
  27. }
  28. $agreement = function()
  29. {
  30. $array = array();
  31. $data = Dever::load('setting/lib/manage.getAgreementData');
  32. if($data)
  33. {
  34. $array += $data;
  35. }
  36. return $array;
  37. };
  38. $admin = Dever::load('manage/auth.info');
  39. $admin_auth = false;
  40. if ($admin && $admin['role'] == 24){
  41. $admin_auth = $admin['role'];
  42. }
  43. return array
  44. (
  45. # 表名
  46. 'name' => 'member_agreement',
  47. # 显示给用户看的名称
  48. 'lang' => '合同管理',
  49. 'order' => 10,
  50. 'status' => $status,
  51. # 数据结构
  52. 'struct' => array
  53. (
  54. 'id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => 'ID',
  58. 'default' => '',
  59. 'desc' => '',
  60. 'match' => 'is_numeric',
  61. 'search' => 'order',
  62. //'list' => true,
  63. ),
  64. 'mid' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '代理商姓名/手机号',
  68. 'default' => '-1',
  69. 'desc' => '代理商',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. 'search' => array
  73. (
  74. 'api' => 'agent/member-getSearch',
  75. 'col' => 'col',
  76. 'result' => 'id',
  77. 'search' => 'mid',
  78. ),
  79. 'list_name' => '代理商信息',
  80. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  81. 'list_order' => 3,
  82. ),
  83. 'agent-member-name'=> array
  84. (
  85. 'name' => '姓名',
  86. 'default' => '',
  87. 'desc' => '姓名',
  88. 'match' => 'option',
  89. # 读取另外表的关联方式
  90. 'sync' => array('mid', 'id'),
  91. //'list' => $mid ? false : true,
  92. //'list_order' => 1,
  93. ),
  94. 'agent-member-role'=> array
  95. (
  96. 'name' => '代理角色',
  97. 'default' => '',
  98. 'desc' => '代理角色',
  99. 'match' => 'option',
  100. # 读取另外表的关联方式
  101. 'sync' => array('mid', 'id'),
  102. //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  103. //'list_order' => 3,
  104. ),
  105. 'order_num' => array
  106. (
  107. 'type' => 'varchar-100',
  108. 'name' => '合同编号',
  109. 'default' => '',
  110. 'desc' => '合同编号',
  111. 'match' => 'is_string',
  112. 'update' => 'text',
  113. ),
  114. 'order_id' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '关联订单表id',
  118. 'default' => '',
  119. 'desc' => '关联订单表id',
  120. 'match' => 'is_numeric',
  121. ),
  122. 'agreement_id' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '合同模板',
  126. 'default' => '',
  127. 'desc' => '合同模板',
  128. 'match' => 'is_numeric',
  129. 'option' => $agreement,
  130. 'search' => 'select',
  131. ),
  132. 'agreement_name' => array
  133. (
  134. 'type' => 'varchar-500',
  135. 'name' => '合同名称',
  136. 'default' => '',
  137. 'desc' => '合同名称',
  138. 'match' => 'is_string',
  139. 'update' => 'text',
  140. 'search' => 'fulltext',
  141. 'list' => true,
  142. 'list_order' => 6,
  143. ),
  144. 'type' => array
  145. (
  146. 'type' => 'tinyint-1',
  147. 'name' => '类型',
  148. 'default' => '1',
  149. 'desc' => '类型',
  150. 'match' => 'is_numeric',
  151. ),
  152. 'sign' => array
  153. (
  154. 'type' => 'varchar-150',
  155. 'name' => '合同签名',
  156. 'default' => '',
  157. 'desc' => '合同签名',
  158. 'match' => 'option',
  159. 'update' => 'image',
  160. 'key' => '7',
  161. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  162. 'list_order' => 7,
  163. ),
  164. 'sign_old' => array
  165. (
  166. 'type' => 'varchar-150',
  167. 'name' => '合同签名',
  168. 'default' => '',
  169. 'desc' => '合同签名',
  170. 'match' => 'option',
  171. //'update' => 'image',
  172. 'key' => '7',
  173. ),
  174. 'name' => array
  175. (
  176. 'type' => 'varchar-100',
  177. 'name' => '姓名',
  178. 'default' => '',
  179. 'desc' => '姓名',
  180. 'match' => 'is_string',
  181. 'update' => 'text',
  182. ),
  183. 'mobile' => array
  184. (
  185. 'type' => 'bigint-11',
  186. 'name' => '手机号',
  187. 'default' => '',
  188. 'desc' => '请输入手机号',
  189. 'match' => Dever::rule('mobile'),
  190. 'update' => 'text',
  191. //'search' => $mid ? 'hidden' : 'fulltext',
  192. //'list' => $mid ? false : true,
  193. //'list_order' => 2,
  194. ),
  195. 'role' => array
  196. (
  197. 'type' => 'int-11',
  198. 'name' => '代理角色',
  199. 'default' => '',
  200. 'desc' => '代理角色',
  201. 'match' => 'is_numeric',
  202. ),
  203. 'price' => array
  204. (
  205. 'type' => 'decimal-11,2',
  206. 'name' => '实付金额',
  207. 'default' => '0',
  208. 'desc' => '金额',
  209. 'match' => 'option',
  210. 'update' => 'text',
  211. ),
  212. 'area' => array
  213. (
  214. 'type' => 'varchar-500',
  215. 'name' => '区域',
  216. 'default' => '',
  217. 'desc' => '区域',
  218. 'match' => 'option',
  219. ),
  220. 'idcard' => array
  221. (
  222. 'type' => 'varchar-32',
  223. 'name' => '身份证号码',
  224. 'default' => '',
  225. 'desc' => '身份证号码',
  226. 'match' => 'is_string',
  227. 'update' => 'text',
  228. //'search' => 'fulltext',
  229. ),
  230. 'idcard_front' => array
  231. (
  232. 'type' => 'varchar-150',
  233. 'name' => '身份证正面',
  234. 'default' => '',
  235. 'desc' => '身份证正面',
  236. 'match' => 'option',
  237. 'update' => 'image',
  238. 'key' => '8',
  239. 'place' => '660*660',
  240. ),
  241. 'idcard_back' => array
  242. (
  243. 'type' => 'varchar-150',
  244. 'name' => '身份证背面',
  245. 'default' => '',
  246. 'desc' => '身份证背面',
  247. 'match' => 'option',
  248. 'update' => 'image',
  249. 'key' => '8',
  250. 'place' => '660*660',
  251. ),
  252. 'company_name' => array
  253. (
  254. 'type' => 'varchar-100',
  255. 'name' => '公司名称',
  256. 'default' => '',
  257. 'desc' => '公司名称',
  258. 'match' => 'is_string',
  259. 'update' => 'text',
  260. //'search' => 'fulltext',
  261. //'list' => true,
  262. ),
  263. 'company_pic' => array
  264. (
  265. 'type' => 'varchar-150',
  266. 'name' => '营业执照',
  267. 'default' => '',
  268. 'desc' => '营业执照',
  269. 'match' => 'option',
  270. 'update' => 'image',
  271. 'key' => '8',
  272. 'place' => '660*660',
  273. ),
  274. 'company_number' => array
  275. (
  276. 'type' => 'varchar-80',
  277. 'name' => '营业执照号码',
  278. 'default' => '',
  279. 'desc' => '营业执照号码',
  280. 'match' => 'is_string',
  281. 'update' => 'text',
  282. ),
  283. 'address' => array
  284. (
  285. 'type' => 'varchar-800',
  286. 'name' => '地址',
  287. 'default' => '',
  288. 'desc' => '地址',
  289. 'match' => 'is_string',
  290. 'update' => 'text',
  291. ),
  292. 'qdate' => array
  293. (
  294. 'type' => 'int-11',
  295. 'name' => '协议签订时间',
  296. 'match' => 'is_numeric',
  297. 'desc' => '协议签订时间',
  298. 'search' => 'date',
  299. 'update' => 'text',
  300. ),
  301. 'sdate' => array
  302. (
  303. 'type' => 'int-11',
  304. 'name' => '有效期开始时间',
  305. 'match' => 'is_numeric',
  306. 'desc' => '有效期开始时间',
  307. 'update' => 'text',
  308. ),
  309. 'edate' => array
  310. (
  311. 'type' => 'int-11',
  312. 'name' => '有效期结束时间',
  313. 'match' => 'is_numeric',
  314. 'desc' => '有效期结束时间',
  315. 'update' => 'text',
  316. ),
  317. 'udate' => array
  318. (
  319. 'type' => 'int-11',
  320. 'name' => '更新时间',
  321. 'match' => 'is_numeric',
  322. 'desc' => '更新时间',
  323. 'search' => 'date',
  324. // 'list' => 'date("Y-m-d H:i", {udate})',
  325. 'list_name' => '创建时间<br/>更新时间<br/>签署时间',
  326. 'list' => 'Dever::load("agent/lib/agreement.data",{id})',
  327. 'list_order' => 5,
  328. ),
  329. 'content' => array
  330. (
  331. 'type' => 'text-255',
  332. 'name' => '合同内容',
  333. 'default' => '',
  334. 'desc' => '请输入内容',
  335. 'match' => 'is_string',
  336. ),
  337. 'status' => array
  338. (
  339. 'type' => 'tinyint-1',
  340. 'name' => '合同状态',
  341. 'default' => '1',
  342. 'desc' => '合同状态',
  343. 'match' => 'is_numeric',
  344. 'option' => $status,
  345. 'search' => 'select',
  346. 'list' => true,
  347. 'list_order' => 8,
  348. ),
  349. 'state' => array
  350. (
  351. 'type' => 'tinyint-1',
  352. 'name' => '状态',
  353. 'default' => '1',
  354. 'desc' => '请选择状态',
  355. 'match' => 'is_numeric',
  356. ),
  357. 'cdate' => array
  358. (
  359. 'type' => 'int-11',
  360. 'name' => '创建时间',
  361. 'match' => array('is_numeric', time()),
  362. 'desc' => '',
  363. # 只有insert时才生效
  364. 'insert' => true,
  365. //'search' => 'date',
  366. // 'list' => 'date("Y-m-d H:i", {cdate})',
  367. // 'list_order' => 4,
  368. ),
  369. ),
  370. 'alter' => array
  371. (
  372. 5 => array
  373. (
  374. array('update', 'price', 'price', 'decimal-11,2 0 实付金额'),
  375. ),
  376. 'version' => 5,
  377. ),
  378. 'manage' => array
  379. (
  380. 'list_table' => 'html',
  381. 'insert' => false,
  382. 'delete' => false,
  383. 'edit' => false,
  384. 'button' => $button,
  385. 'list_button' => $list_button,
  386. ),
  387. 'request' => array
  388. (
  389. 'getData' => array
  390. (
  391. # 匹配的正则或函数 选填项
  392. 'option' => array
  393. (
  394. 'mid' => 'yes',
  395. 'order_id' => 'yes',
  396. 'agreement_id' => 'yes',
  397. 'state' => 1,
  398. ),
  399. 'type' => 'all',
  400. 'order' => array('id' => 'desc'),
  401. 'col' => '*',
  402. ),
  403. 'getOld' => array
  404. (
  405. # 匹配的正则或函数 选填项
  406. 'option' => array
  407. (
  408. 'mid' => 'yes',
  409. 'order_id' => 'yes',
  410. 'agreement_id' => 'yes',
  411. 'state' => 1,
  412. ),
  413. 'type' => 'one',
  414. 'order' => array('id' => 'desc'),
  415. 'col' => '*',
  416. ),
  417. 'getOlds' => array
  418. (
  419. # 匹配的正则或函数 选填项
  420. 'option' => array
  421. (
  422. 'mid' => 'yes',
  423. 'order_id' => 'yes',
  424. 'agreement_id' => 'yes',
  425. 'state' => 1,
  426. ),
  427. 'type' => 'all',
  428. 'order' => array('id' => 'desc'),
  429. 'col' => '*',
  430. ),
  431. 'getOne' => array
  432. (
  433. # 匹配的正则或函数 选填项
  434. 'option' => array
  435. (
  436. 'mid' => 'yes',
  437. 'type' => 'yes',
  438. 'state' => 1,
  439. ),
  440. 'type' => 'one',
  441. 'order' => array('id' => 'desc'),
  442. 'col' => '*',
  443. ),
  444. 'getAll' => array
  445. (
  446. # 匹配的正则或函数 选填项
  447. 'option' => array
  448. (
  449. 'mid' => 'yes',
  450. 'status' => array('yes', 'in'),
  451. 'state' => 1,
  452. ),
  453. 'type' => 'all',
  454. 'order' => array('id' => 'desc'),
  455. 'page' => array(10, 'list'),
  456. 'col' => 'id,mid,agreement_id,status,qdate,role,name,area,agreement_name',
  457. ),
  458. 'getNum' => array
  459. (
  460. # 匹配的正则或函数 选填项
  461. 'option' => array
  462. (
  463. 'fstart' => array('yes-qdate', '>='),
  464. 'fend' => array('yes-qdate', '<='),
  465. 'agreement_id' => 6,
  466. 'status' => array('yes','='),
  467. 'state' => 1,
  468. ),
  469. 'type' => 'count',
  470. 'col' => '*',
  471. ),
  472. 'getNoNum' => array
  473. (
  474. # 匹配的正则或函数 选填项
  475. 'option' => array
  476. (
  477. 'fstart' => array('yes-cdate', '>='),
  478. 'fend' => array('yes-cdate', '<='),
  479. 'status' => 'yes',
  480. 'agreement_id' => 6,
  481. 'state' => 1,
  482. ),
  483. 'type' => 'count',
  484. 'col' => '*',
  485. ),
  486. 'getPrice' => array
  487. (
  488. # 匹配的正则或函数 选填项
  489. 'option' => array
  490. (
  491. 'fstart' => array('yes-qdate', '>='),
  492. 'fend' => array('yes-qdate', '<='),
  493. 'status' => array('yes', '='),
  494. 'agreement_id' => 6,
  495. 'state' => 1,
  496. ),
  497. 'type' => 'one',
  498. 'col' => 'sum(price) as total',
  499. ),
  500. 'getNoPrice' => array
  501. (
  502. # 匹配的正则或函数 选填项
  503. 'option' => array
  504. (
  505. 'fstart' => array('yes-qdate', '>='),
  506. 'fend' => array('yes-qdate', '<='),
  507. 'status' => 'yes',
  508. 'agreement_id' => 6,
  509. 'state' => 1,
  510. ),
  511. 'type' => 'one',
  512. 'col' => 'sum(price) as total',
  513. ),
  514. 'getDataByNew' => array
  515. (
  516. # 匹配的正则或函数 选填项
  517. 'option' => array
  518. (
  519. 'id' => 'yes',
  520. 'ids' => array('yes-id', '<'),
  521. 'sign' => array('yes', 'like'),
  522. 'state' => 1,
  523. ),
  524. 'order' => array('id' => 'asc'),
  525. 'type' => 'all',
  526. //'limit' => '0,2',
  527. 'col' => 'id,mid,sign',
  528. ),
  529. 'getAlls' => array
  530. (
  531. # 匹配的正则或函数 选填项
  532. 'option' => array
  533. (
  534. 'agreement_id' => 'yes',
  535. 'mid' => 'yes',
  536. 'state' => 1,
  537. ),
  538. 'type' => 'all',
  539. 'order' => array('id' => 'desc'),
  540. 'col' => 'id',
  541. ),
  542. ),
  543. );