supplier.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <?php
  2. $type = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('scm_role/supplier_type-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $category = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('scm_product/category-getTop');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $identity = array
  23. (
  24. 1 => '个人',
  25. 2 => '个体户',
  26. 3 => '企业',
  27. );
  28. $status = array
  29. (
  30. 1 => '启用',
  31. 2 => '禁用',
  32. );
  33. return array
  34. (
  35. # 表名
  36. 'name' => 'supplier',
  37. # 显示给用户看的名称
  38. 'lang' => '供应商',
  39. # 是否显示在后台菜单
  40. 'order' => 11,
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'list' => true,
  52. 'order' => 'asc',
  53. ),
  54. 'name' => array
  55. (
  56. 'type' => 'varchar-150',
  57. 'name' => '供应商名称',
  58. 'default' => '',
  59. 'desc' => '供应商名称',
  60. 'match' => 'is_string',
  61. 'update' => 'text',
  62. 'search' => 'fulltext',
  63. 'list' => true,
  64. 'edit' => true,
  65. ),
  66. 'code' => array
  67. (
  68. 'type' => 'varchar-150',
  69. 'name' => '供应商编码',
  70. 'default' => '-1',
  71. 'desc' => '供应商编码',
  72. 'match' => 'is_string',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'type_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '供应商类型',
  81. 'default' => '1',
  82. 'desc' => '供应商类型',
  83. 'match' => 'is_numeric',
  84. 'update' => 'radio',
  85. 'option' => $type,
  86. ),
  87. 'category' => array
  88. (
  89. 'type' => 'varchar-2000',
  90. 'name' => '商品属性分类-如不选择就是可以销售所有商品属性分类下的商品',
  91. 'default' => '',
  92. 'desc' => '商品属性分类',
  93. 'match' => 'is_string',
  94. 'update' => 'checkbox',
  95. 'option' => $category,
  96. ),
  97. 'truename' => array
  98. (
  99. 'type' => 'varchar-100',
  100. 'name' => '联系人姓名',
  101. 'default' => '',
  102. 'desc' => '请输入联系人姓名',
  103. 'match' => 'is_string',
  104. 'update' => 'text',
  105. 'search' => 'fulltext',
  106. 'tab' => 1,
  107. ),
  108. 'tel' => array
  109. (
  110. 'type' => 'varchar-50',
  111. 'name' => '联系人电话',
  112. 'default' => '',
  113. 'desc' => '请输入联系人电话',
  114. 'match' => 'is_numeric',
  115. 'update' => 'text',
  116. 'search' => 'fulltext',
  117. 'tab' => 1,
  118. ),
  119. 'email' => array
  120. (
  121. 'type' => 'varchar-50',
  122. 'name' => '联系人邮箱',
  123. 'default' => '',
  124. 'desc' => '联系人邮箱',
  125. 'match' => 'option',
  126. 'update' => 'text',
  127. 'search' => 'fulltext',
  128. 'tab' => 1,
  129. ),
  130. 'area' => array
  131. (
  132. 'type' => 'varchar-500',
  133. 'name' => '联系人城市',
  134. 'default' => '',
  135. 'desc' => '联系人城市',
  136. 'match' => 'option',
  137. 'search' => 'linkage',
  138. 'update' => 'linkage',
  139. 'option' => Dever::url('api.get?level_total=3', 'area'),
  140. //'list' => 'Dever::load("area/api.string", "{area}")',
  141. 'tab' => 1,
  142. ),
  143. 'province' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '省份',
  147. 'default' => '',
  148. 'desc' => '省份',
  149. 'match' => 'option',
  150. //'update' => 'text',
  151. 'tab' => 1,
  152. ),
  153. 'city' => array
  154. (
  155. 'type' => 'int-11',
  156. 'name' => '城市',
  157. 'default' => '',
  158. 'desc' => '城市',
  159. 'match' => 'option',
  160. //'update' => 'text',
  161. 'tab' => 1,
  162. ),
  163. 'county' => array
  164. (
  165. 'type' => 'int-11',
  166. 'name' => '县区',
  167. 'default' => '',
  168. 'desc' => '县区',
  169. 'match' => 'option',
  170. //'update' => 'text',
  171. 'tab' => 1,
  172. ),
  173. 'address' => array
  174. (
  175. 'type' => 'varchar-1000',
  176. 'name' => '联系人地址',
  177. 'default' => '',
  178. 'desc' => '联系人地址',
  179. 'match' => 'option',
  180. 'update' => 'text',
  181. //'list' => true,
  182. 'tab' => 1,
  183. ),
  184. 'identity' => array
  185. (
  186. 'type' => 'tinyint-1',
  187. 'name' => '销售商身份',
  188. 'default' => '1',
  189. 'desc' => '销售商身份',
  190. 'match' => 'is_numeric',
  191. 'update' => 'radio',
  192. 'option' => $identity,
  193. 'control' => 'identity',
  194. 'tab' => 2,
  195. ),
  196. 'idcard_front' => array
  197. (
  198. 'type' => 'varchar-150',
  199. 'name' => '身份证正面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  200. 'default' => '',
  201. 'desc' => '身份证正面',
  202. 'match' => 'option',
  203. 'update' => 'image',
  204. 'key' => '8',
  205. 'place' => '660*660',
  206. 'tab' => 2,
  207. ),
  208. 'idcard_back' => array
  209. (
  210. 'type' => 'varchar-150',
  211. 'name' => '身份证背面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  212. 'default' => '',
  213. 'desc' => '身份证背面',
  214. 'match' => 'option',
  215. 'update' => 'image',
  216. 'key' => '8',
  217. 'place' => '660*660',
  218. 'tab' => 2,
  219. ),
  220. 'company_name' => array
  221. (
  222. 'type' => 'varchar-200',
  223. 'name' => '企业名称',
  224. 'default' => '',
  225. 'desc' => '企业名称',
  226. 'match' => 'option',
  227. 'update' => 'text',
  228. 'show' => 'identity=2,3',
  229. 'tab' => 2,
  230. ),
  231. 'company_license' => array
  232. (
  233. 'type' => 'varchar-150',
  234. 'name' => '企业营业执照',
  235. 'default' => '',
  236. 'desc' => '企业营业执照',
  237. 'match' => 'option',
  238. 'update' => 'image',
  239. 'key' => '8',
  240. 'place' => '660*660',
  241. 'show' => 'identity=2,3',
  242. 'tab' => 2,
  243. ),
  244. 'company_license_number' => array
  245. (
  246. 'type' => 'varchar-200',
  247. 'name' => '企业营业执照号码',
  248. 'default' => '',
  249. 'desc' => '营业执照号码',
  250. 'match' => 'option',
  251. 'update' => 'text',
  252. 'show' => 'identity=2,3',
  253. 'tab' => 2,
  254. ),
  255. 'reorder' => array
  256. (
  257. 'type' => 'int-11',
  258. 'name' => '排序(数值越大越靠前)',
  259. 'default' => '1',
  260. 'desc' => '请输入排序',
  261. 'match' => 'option',
  262. //'update' => 'text',
  263. 'search' => 'order',
  264. 'list_name' => '排序',
  265. 'list' => true,
  266. 'order' => 'desc',
  267. 'edit' => true,
  268. ),
  269. 'status' => array
  270. (
  271. 'type' => 'int-11',
  272. 'name' => '状态',
  273. 'default' => '1',
  274. 'desc' => '状态',
  275. 'match' => 'is_numeric',
  276. //'update' => 'select',
  277. 'option' => $status,
  278. 'search' => 'select',
  279. 'list' => true,
  280. 'edit' => true,
  281. ),
  282. 'state' => array
  283. (
  284. 'type' => 'tinyint-1',
  285. 'name' => '数据状态',
  286. 'default' => '1',
  287. 'desc' => '请选择状态',
  288. 'match' => 'is_numeric',
  289. ),
  290. 'cdate' => array
  291. (
  292. 'type' => 'int-11',
  293. 'name' => '录入时间',
  294. 'match' => array('is_numeric', time()),
  295. 'desc' => '',
  296. # 只有insert时才生效
  297. 'insert' => true,
  298. //'search' => 'date',
  299. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  300. ),
  301. ),
  302. 'manage' => array
  303. (
  304. 'delete' => false,
  305. 'tab' => array('基本设置', '联系人信息', '认证信息'),
  306. 'button' => array
  307. (
  308. '类型配置' => array('list', 'supplier_type&oper_parent=supplier'),
  309. ),
  310. 'list_button' => array
  311. (
  312. 'location' => array('商品列表', Dever::url('lib/supplier.setGoods', 'scm_role')),
  313. //'fast_add' => array('账户操作', 'push&project=account&oper_table=supplier&oper_project=scm_role&uid={id}'),
  314. )
  315. ),
  316. 'default' => array
  317. (
  318. 'col' => 'name,type_id,state,cdate',
  319. 'value' => array
  320. (
  321. '"默认供应商", 1, 1,' . DEVER_TIME,
  322. ),
  323. ),
  324. 'request' => array
  325. (
  326. )
  327. );