in_order.php 8.7 KB

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