out_order.php 8.3 KB

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