out_order.php 9.2 KB

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