out_order.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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:#003366'),
  6. 3 => array('name' => '已驳回', 'style' => 'font-weight:bold;color:#993333'),
  7. );
  8. $audit = array
  9. (
  10. //1 => '待审核',
  11. 2 => '审核通过',
  12. 3 => '审核未通过',
  13. );
  14. $type = function() {
  15. return Dever::db('scm_servicer/out_order_type')->state();
  16. };
  17. $store = array();
  18. $servicer_id = Dever::input('search_option_servicer_id');
  19. if ($servicer_id) {
  20. $store = function() use($servicer_id) {
  21. return Dever::db('scm_servicer/store')->state(array('servicer_id' => $servicer_id));
  22. };
  23. }
  24. $servicer = function() {
  25. return Dever::db('scm_servicer/info')->state();
  26. };
  27. $in_type = array
  28. (
  29. 1 => '不生成',
  30. 2 => '生成仓库入库单',
  31. //3 => '生成经销商入库单',
  32. );
  33. return array
  34. (
  35. # 表名
  36. 'name' => 'out_order',
  37. # 显示给用户看的名称
  38. 'lang' => '出库单查询',
  39. 'order' => 8,
  40. 'set' => array
  41. (
  42. 'status' => $status,
  43. ),
  44. 'end' => array
  45. (
  46. 'insert' => 'scm_product/lib/order.updateOrderNum?table=scm_servicer/out_order&prefix=CO',
  47. 'update' => 'scm_product/lib/stock.update_commit?table=scm_servicer/out_order&stock=scm_servicer/store_goods&type=out&col=servicer_store_id',
  48. ),
  49. # 数据结构
  50. 'struct' => array
  51. (
  52. 'id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => 'ID',
  56. 'default' => '',
  57. 'desc' => '',
  58. 'match' => 'is_numeric',
  59. 'search' => 'order',
  60. //'list' => true,
  61. ),
  62. 'order_num' => array
  63. (
  64. 'type' => 'varchar-100',
  65. 'name' => '订单号',
  66. 'default' => '',
  67. 'desc' => '订单号',
  68. 'match' => 'is_string',
  69. 'search' => 'fulltext',
  70. 'list_name' => '订单信息',
  71. 'list' => 'Dever::load("scm_servicer/lib/out.info", {id})',
  72. ),
  73. 'servicer_id' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '配送商',
  77. 'default' => '',
  78. 'desc' => '配送商',
  79. 'match' => 'is_numeric',
  80. 'update' => 'hidden',
  81. 'searchs' => array
  82. (
  83. 'api' => 'scm_role/seller-like',
  84. 'col' => 'name',
  85. 'result' => 'id',
  86. ),
  87. 'search' => 'select',
  88. 'option' => $servicer,
  89. 'value' => $servicer_id,
  90. //'list' => 'Dever::load("scm_servicer/info-one#name", {servicer_id})',
  91. ),
  92. 'servicer_store_id' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '出库仓库',
  96. 'default' => '',
  97. 'desc' => '出库仓库',
  98. 'match' => 'is_numeric',
  99. 'update' => 'select',
  100. 'option' => $store,
  101. //'list' => 'Dever::load("scm_servicer/store-one#name", {servicer_store_id})',
  102. ),
  103. 'type' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '出库类型',
  107. 'default' => '1',
  108. 'desc' => '出库类型',
  109. 'match' => 'is_numeric',
  110. 'update' => 'radio',
  111. 'option' => $type,
  112. 'list' => true,
  113. 'control' => 'type',
  114. ),
  115. 'relate_order_num' => array
  116. (
  117. 'type' => 'varchar-300',
  118. 'name' => '关联单据号',
  119. 'default' => '',
  120. 'desc' => '关联单据号',
  121. 'match' => 'option',
  122. 'update' => 'text',
  123. //'list' => true,
  124. ),
  125. 'in_type' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '同时生成入库单',
  129. 'default' => '1',
  130. 'desc' => '同时生成入库单',
  131. 'match' => 'is_numeric',
  132. 'update' => 'select',
  133. 'option' => $in_type,
  134. //'list' => true,
  135. 'control' => 'in_type',
  136. ),
  137. 'in_type_id' => array
  138. (
  139. 'type' => 'int-11',
  140. 'name' => '入库组织',
  141. 'default' => '',
  142. 'desc' => '入库组织',
  143. 'match' => 'is_numeric',
  144. 'update' => 'select',
  145. 'update_search' => 'scm_product/lib/manage.searchRole?servicer_id='.$servicer_id.'&{in_type}',
  146. 'show' => 'type=1',
  147. 'show' => 'in_type=2,3',
  148. //'list' => 'Dever::load("scm_servicer/store-one#name", {servicer_store_id})',
  149. ),
  150. 'info' => array
  151. (
  152. 'type' => 'varchar-300',
  153. 'name' => '订单备注',
  154. 'default' => '',
  155. 'desc' => '订单备注',
  156. 'match' => 'option',
  157. 'update' => 'text',
  158. //'list' => true,
  159. ),
  160. 'address' => array
  161. (
  162. 'type' => 'varchar-1000',
  163. 'name' => '收货信息',
  164. 'default' => '',
  165. 'desc' => '收货信息',
  166. 'match' => 'is_string',
  167. ),
  168. 'scm_servicer-out_order_goods'=> array
  169. (
  170. 'name' => '商品设置',
  171. 'default' => '',
  172. 'desc' => '商品设置',
  173. 'match' => 'option',
  174. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  175. 'sync' => array('id', 'order_id'),
  176. 'update' => array(1),
  177. # 1纵向展示 2横向展示
  178. 'update_type' => 2,
  179. 'list_name' => '商品信息',
  180. 'list' => 'Dever::load("scm_product/lib/manage.getGoods", {id}, "scm_servicer/out_order_goods")',
  181. ),
  182. 'audit' => array
  183. (
  184. 'type' => 'tinyint-1',
  185. 'name' => '审核状态',
  186. 'default' => '2',
  187. 'desc' => '审核状态',
  188. 'match' => 'is_numeric',
  189. 'option' => $audit,
  190. //'update' => 'radio',
  191. ),
  192. 'audit_desc' => array
  193. (
  194. 'type' => 'varchar-500',
  195. 'name' => '审核备注',
  196. 'default' => '',
  197. 'desc' => '审核备注',
  198. 'match' => 'option',
  199. //'update' => 'textarea',
  200. ),
  201. 'audit_admin' => array
  202. (
  203. 'type' => 'int-11',
  204. 'name' => '审核人',
  205. 'default' => '',
  206. 'match' => 'is_numeric',
  207. 'desc' => '审核人',
  208. //'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  209. ),
  210. 'status' => array
  211. (
  212. 'type' => 'tinyint-1',
  213. 'name' => '订单状态',
  214. 'default' => '1',
  215. 'desc' => '订单状态',
  216. 'match' => 'is_numeric',
  217. 'option' => $status,
  218. 'search' => 'select',
  219. 'list' => true,
  220. //'search_after' => '<br />',
  221. //'mul' => true,
  222. //'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
  223. ),
  224. 'state' => array
  225. (
  226. 'type' => 'tinyint-1',
  227. 'name' => '状态',
  228. 'default' => '1',
  229. 'desc' => '请选择状态',
  230. 'match' => 'is_numeric',
  231. ),
  232. 'cdate' => array
  233. (
  234. 'type' => 'int-11',
  235. 'name' => '下单时间',
  236. 'match' => array('is_numeric', time()),
  237. 'desc' => '',
  238. # 只有insert时才生效
  239. 'insert' => true,
  240. 'search' => 'sdate',
  241. 'list' => 'date("Y-m-d H:i", {cdate})',
  242. ),
  243. ),
  244. 'manage' => array
  245. (
  246. 'delete' => false,
  247. 'edit' => false,
  248. 'insert' => false,
  249. //'excel' => $excel,
  250. //'mul' => $mul,
  251. 'button' => array
  252. (
  253. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  254. '类型配置' => array('list', 'out_order_type&oper_parent=out_order'),
  255. ),
  256. 'list_button' => array
  257. (
  258. 'list' => array('查看详情', '"out_order_goods&page_type=1&order_id={id}"'),
  259. 'fast' => array('审核', '"out_order&where_id={id}&col=audit,audit_desc"', '{status} == 1'),
  260. ),
  261. ),
  262. 'request' => array
  263. (
  264. ),
  265. );