buy_order.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待支付', 'style' => 'font-weight:bold;color:#F8046E'),
  5. 2 => array('name' => '待审核', 'style' => 'font-weight:bold;color:#436EEE'),
  6. 3 => array('name' => '待处理', 'style' => 'font-weight:bold;color:#003366'),
  7. 4 => array('name' => '待确认', 'style' => 'font-weight:bold;color:#003366'),
  8. 5 => array('name' => '已完成', 'style' => 'font-weight:bold;color:#0978F8'),
  9. 6 => array('name' => '已完成(有退款)', 'style' => 'font-weight:bold;color:#0978F8'),
  10. 7 => array('name' => '已取消', 'style' => 'font-weight:bold;color:#993333'),
  11. 8 => array('name' => '已退款', 'style' => 'font-weight:bold;color:#993333'),
  12. 11 => array('name' => '已过期', 'style' => 'font-weight:bold;color:#993333'),
  13. );
  14. $audit = array
  15. (
  16. 1 => '待审核',
  17. 2 => '审核通过',
  18. 3 => '审核未通过',
  19. );
  20. $shop = array();
  21. $seller_id = Dever::input('search_option_seller_id');
  22. if ($seller_id) {
  23. $shop = function() use($seller_id) {
  24. return Dever::db('scm_seller/shop')->state(array('seller_id' => $seller_id, 'status' => 1));
  25. };
  26. }
  27. $seller = function() {
  28. return Dever::db('scm_seller/info')->state();
  29. };
  30. $col = Dever::input('col');
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'buy_order',
  35. # 显示给用户看的名称
  36. 'lang' => '采购单查询',
  37. 'order' => 20,
  38. 'set' => array
  39. (
  40. 'status' => $status,
  41. 'audit' => $audit,
  42. ),
  43. 'end' => array
  44. (
  45. 'insert' => 'scm/lib/order.updateOrderNum?table=scm_seller/buy_order&prefix=BU',
  46. ),
  47. # 数据结构
  48. 'struct' => array
  49. (
  50. 'id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => 'ID',
  54. 'default' => '',
  55. 'desc' => '',
  56. 'match' => 'is_numeric',
  57. 'search' => 'order',
  58. //'list' => true,
  59. ),
  60. 'order_num' => array
  61. (
  62. 'type' => 'varchar-100',
  63. 'name' => '订单号',
  64. 'default' => '',
  65. 'desc' => '订单号',
  66. 'match' => 'is_string',
  67. 'search' => 'fulltext',
  68. 'list_name' => '订单信息',
  69. 'list' => 'Dever::load("scm_seller/lib/manage.info", "buy", {id})',
  70. ),
  71. 'seller_id' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '经销商',
  75. 'default' => '',
  76. 'desc' => '经销商',
  77. 'match' => 'is_numeric',
  78. 'update' => 'hidden',
  79. 'searchs' => array
  80. (
  81. 'api' => 'scm_role/seller-like',
  82. 'col' => 'name',
  83. 'result' => 'id',
  84. ),
  85. 'search' => 'select',
  86. 'option' => $seller,
  87. 'value' => $seller_id,
  88. //'list' => 'Dever::load("scm_seller/info-one#name", {seller_id})',
  89. ),
  90. 'seller_shop_id' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '门店',
  94. 'default' => '',
  95. 'desc' => '门店',
  96. 'match' => 'is_numeric',
  97. 'update' => 'select',
  98. 'option' => $shop,
  99. //'list' => 'Dever::load("scm_seller/shop-one#name", {servicer_shop_id})',
  100. ),
  101. 'relate_order_num' => array
  102. (
  103. 'type' => 'varchar-300',
  104. 'name' => '关联单据号',
  105. 'default' => '',
  106. 'desc' => '关联单据号',
  107. 'match' => 'option',
  108. //'update' => 'text',
  109. //'list' => true,
  110. ),
  111. 'info' => array
  112. (
  113. 'type' => 'varchar-300',
  114. 'name' => '订单备注',
  115. 'default' => '',
  116. 'desc' => '订单备注',
  117. 'match' => 'option',
  118. 'update' => 'text',
  119. //'list' => true,
  120. ),
  121. 'address' => array
  122. (
  123. 'type' => 'varchar-1000',
  124. 'name' => '收货信息',
  125. 'default' => '',
  126. 'desc' => '收货信息',
  127. 'match' => 'is_string',
  128. //'update' => 'text',
  129. //'search' => 'fulltext',
  130. //'list' => true,
  131. ),
  132. 'scm_seller-buy_order_goods'=> array
  133. (
  134. 'name' => '商品设置',
  135. 'default' => '',
  136. 'desc' => '商品设置',
  137. 'match' => 'option',
  138. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  139. 'sync' => array('id', 'order_id'),
  140. 'update' => array(1),
  141. # 1纵向展示 2横向展示
  142. 'update_type' => 2,
  143. 'list_name' => '商品信息',
  144. 'list' => 'Dever::load("scm_product/lib/manage.getGoods", {id}, "scm_seller/buy_order_goods")',
  145. ),
  146. 'audit' => array
  147. (
  148. 'type' => 'tinyint-1',
  149. 'name' => '审核状态',
  150. 'default' => '2',
  151. 'desc' => '审核状态',
  152. 'match' => 'is_numeric',
  153. 'option' => $audit,
  154. 'update' => $col ? 'radio' : false,
  155. ),
  156. 'audit_desc' => array
  157. (
  158. 'type' => 'varchar-500',
  159. 'name' => '审核备注',
  160. 'default' => '',
  161. 'desc' => '审核备注',
  162. 'match' => 'option',
  163. 'update' => $col ? 'textarea' : false,
  164. ),
  165. 'audit_admin' => array
  166. (
  167. 'type' => 'int-11',
  168. 'name' => '审核人',
  169. 'default' => '',
  170. 'match' => 'is_numeric',
  171. 'desc' => '审核人',
  172. //'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  173. ),
  174. 'status' => array
  175. (
  176. 'type' => 'tinyint-1',
  177. 'name' => '订单状态',
  178. 'default' => '2',
  179. 'desc' => '订单状态',
  180. 'match' => 'is_numeric',
  181. 'option' => $status,
  182. 'search' => 'select',
  183. 'list' => true,
  184. //'search_after' => '<br />',
  185. //'mul' => true,
  186. //'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
  187. ),
  188. 'state' => array
  189. (
  190. 'type' => 'tinyint-1',
  191. 'name' => '状态',
  192. 'default' => '1',
  193. 'desc' => '请选择状态',
  194. 'match' => 'is_numeric',
  195. ),
  196. 'cdate' => array
  197. (
  198. 'type' => 'int-11',
  199. 'name' => '下单时间',
  200. 'match' => array('is_numeric', time()),
  201. 'desc' => '',
  202. # 只有insert时才生效
  203. 'insert' => true,
  204. 'search' => 'sdate',
  205. 'list' => 'date("Y-m-d H:i", {cdate})',
  206. ),
  207. ),
  208. 'manage' => array
  209. (
  210. # 后台提交时,检测该值是否为空,多个用逗号隔开
  211. 'update_check' => 'scm_seller-buy_order_goods',
  212. 'delete' => false,
  213. 'edit' => false,
  214. 'insert' => false,
  215. //'excel' => $excel,
  216. //'mul' => $mul,
  217. 'list_button' => array
  218. (
  219. 'list' => array('查看详情', '"buy_order_goods&type=buy&page_type=1&order_id={id}"'),
  220. 'list1' => array('审核', '"buy_order_goods&type=buy&page_type=1&order_id={id}&audit=1"', '{status} == 2'),
  221. ),
  222. ),
  223. 'request' => array
  224. (
  225. ),
  226. );