out_order.php 9.0 KB

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