out_order_goods.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待审',
  5. 2 => '已审核',
  6. 3 => '未通过',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'out_order_goods',
  12. # 显示给用户看的名称
  13. 'lang' => '订单商品表',
  14. 'menu' => false,
  15. 'status' => $status,
  16. # 验证库存
  17. 'start' => array
  18. (
  19. 'insert' => 'scm/lib/stock.out_check?table=scm_servicer/store_goods&order_table=scm_servicer/out_order&col=servicer_store_id',
  20. ),
  21. 'end' => array
  22. (
  23. 'insert' => 'scm/lib/order.updateGoods?table=scm_servicer/out_order_goods',
  24. 'update' => 'scm/lib/order.updateGoods?table=scm_servicer/out_order_goods',
  25. ),
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'update' => 'hidden',
  38. //'list' => true,
  39. ),
  40. 'order_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '订单表id',
  44. 'default' => '',
  45. 'desc' => '订单表id',
  46. 'match' => 'is_numeric',
  47. ),
  48. 'goods' => array
  49. (
  50. 'type' => 'varchar-2000',
  51. 'name' => '商品',
  52. 'default' => '',
  53. 'desc' => '商品',
  54. 'match' => 'option',
  55. 'update' => 'select',
  56. 'update_search' => 'scm_product/lib/manage.searchProduct?{servicer_id,servicer_store_id}',
  57. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showInfo', 'scm_product'), 'col' => 'servicer_store_id')),
  58. ),
  59. 'goods_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '库存',
  63. 'default' => '',
  64. 'desc' => '商品',
  65. 'match' => 'is_numeric',
  66. 'update' => 'show',
  67. 'value' => '暂无',
  68. ),
  69. 'sku_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => 'sku_id',
  73. 'default' => '-1',
  74. 'desc' => 'sku_id',
  75. 'match' => 'is_numeric',
  76. ),
  77. 'store_goods_list_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '关联仓库商品id',
  81. 'default' => '',
  82. 'desc' => '关联仓库商品id',
  83. 'match' => 'is_numeric',
  84. 'value' => '暂无',
  85. ),
  86. 'unit_id' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '单位',
  90. 'default' => '',
  91. 'desc' => '单位',
  92. 'match' => 'is_numeric',
  93. 'update' => 'select',
  94. 'option' => array(0 => '请先选择商品'),
  95. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showPriceByUnit', 'scm_product'), 'col' => 'servicer_store_id,goods')),
  96. ),
  97. 'batch' => array
  98. (
  99. 'type' => 'varchar-800',
  100. 'name' => '出库批次号',
  101. 'default' => '',
  102. 'desc' => '批次号',
  103. 'match' => 'option',
  104. 'update' => 'text',
  105. 'value' => date('Ymd'),
  106. ),
  107. 'cash' => array
  108. (
  109. 'type' => 'decimal-11,2',
  110. 'name' => '单价(入库价平均价)',
  111. 'default' => '',
  112. 'desc' => '单价',
  113. 'match' => 'option',
  114. 'update' => 'text',
  115. ),
  116. 'num' => array
  117. (
  118. 'type' => 'decimal-11,2',
  119. 'name' => '数量',
  120. 'default' => '1',
  121. 'desc' => '数量',
  122. 'match' => 'option',
  123. 'update' => 'text',
  124. ),
  125. 'status' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '状态',
  129. 'default' => '1',
  130. 'desc' => '状态',
  131. 'match' => 'is_numeric',
  132. //'update' => 'select',
  133. 'option' => $status,
  134. 'search' => 'select',
  135. 'list' => true,
  136. 'edit' => true,
  137. ),
  138. 'state' => array
  139. (
  140. 'type' => 'tinyint-1',
  141. 'name' => '状态',
  142. 'default' => '1',
  143. 'desc' => '请选择状态',
  144. 'match' => 'is_numeric',
  145. ),
  146. 'cdate' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '创建时间',
  150. 'match' => array('is_numeric', time()),
  151. 'desc' => '',
  152. # 只有insert时才生效
  153. 'insert' => true,
  154. 'search' => 'date',
  155. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  156. ),
  157. ),
  158. 'manage' => array
  159. (
  160. 'insert' => false,
  161. 'delete' => false,
  162. 'page_list' => 'order_goods',
  163. ),
  164. 'request' => array
  165. (
  166. 'getNum' => array
  167. (
  168. # 匹配的正则或函数 选填项
  169. 'option' => array
  170. (
  171. 'start' => array('yes-t_2.cdate', '>='),
  172. 'end' => array('yes-t_2.cdate', '<='),
  173. 'start_o' => array('yes-t_2.operdate', '>='),
  174. 'end_o' => array('yes-t_2.operdate', '<='),
  175. 'servicer_id' => array('yes-t_2.servicer_id'),
  176. 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
  177. 'goods_id' => array('yes-t_1.goods_id'),
  178. 'status' => array('yes-t_2.status', 'in'),
  179. 'state_2' => 'yes-t_2.state-1',
  180. 'state_1' => 'yes-t_1.state-1',
  181. 'status_1' => 'yes-t_1.status-1',
  182. ),
  183. # 联表
  184. 'join' => array
  185. (
  186. array
  187. (
  188. 'table' => 'scm_servicer/out_order',
  189. 'type' => 'left join',
  190. 'on' => array('order_id','id'),
  191. ),
  192. ),
  193. 'type' => 'all',
  194. 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
  195. 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
  196. ),
  197. ),
  198. );