in_order.php 8.7 KB

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