Prodiodetail.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. Ext.define('trade.saas.view.stock.report.Prodiodetail', {
  2. extend: 'saas.view.core.report.ReportPanel',
  3. xtype: 'stock-report-prodiodetail',
  4. controller: 'stock-report-prodiodetail',
  5. viewModel: 'stock-report-prodiodetail',
  6. viewName: 'stock-report-prodiodetail',
  7. //groupField: 'pd_prodcode',
  8. //groupHeaderTpl: '物料:{[values.rows[0].data.pr_detail]}({[values.rows[0].data.pd_prodcode]})',
  9. listUrl: '/api/storage/report/prodioDetail',
  10. defaultCondition: null,
  11. reportTitle: '库存收发明细表',
  12. QueryWidth:0.2,
  13. showMySummary: false,
  14. allowCust: true,
  15. caller:'ProdioDetailReport',
  16. hasOtherInfo: false,
  17. otherInfoDetail:{},
  18. searchItems: [ {
  19. xtype: 'condatefield',
  20. name: 'pi_date',
  21. fieldLabel: '日期',
  22. labelWidth:50,
  23. columnWidth: 0.4
  24. },{
  25. xtype: 'multicombo',
  26. name: 'pi_class',
  27. fieldLabel: '业务类型',
  28. allowBlank: true,
  29. columnWidth: 0.15,
  30. datas: [
  31. ["PURCIN", "采购入库"],
  32. ["PURCOUT", "采购退货"],
  33. ["SALEOUT", "销售出货"],
  34. ["SALERETURN", "销售退货"],
  35. ["OTHERIN", "其它入库"],
  36. ["OTHEROUT", "其它出库"],
  37. ["RESERVEINITIALIZE","库存初始化"],
  38. ["STOCKPROFIT","盘盈入库"],
  39. ["STOCKLOSS","盘亏出库"]
  40. ]
  41. },{
  42. xtype: 'multiqueryField',
  43. columnWidth: 0.35,
  44. name: 'multi_query',
  45. querys: {
  46. "Prod": {"field": "pd_prodcode", "dbfinds": [{
  47. from: 'pr_code',
  48. to: 'pd_prodcode'
  49. },{
  50. from: 'pr_detail',
  51. to: 'pr_detail'
  52. }]},
  53. "Wh":{"field": "pd_whname", "dbfinds": [{//仓库
  54. from: 'wh_description',
  55. to: 'pd_whname'
  56. }]
  57. },
  58. "Cust":{"field": "pi_custcode", "dbfinds": [{//客户名称
  59. from: 'cu_code',
  60. to: 'pi_custcode'
  61. }]
  62. },
  63. "Vend":{"field": "pi_vendcode", "dbfinds": [{//供应商
  64. from: 've_code',
  65. to: 'pi_vendcode'
  66. }]},
  67. "BillCode": {"field": "pi_inoutno" ,"desc": "订单号"},//单号
  68. "Emp":{"field": "pi_seller", "dbfinds": [{ //人员 。。
  69. from: 'em_name',
  70. to: 'pi_seller'
  71. }]}
  72. }
  73. }],
  74. reportColumns: [{
  75. text: 'id',
  76. dataIndex: 'id',
  77. hidden: true
  78. },{
  79. text: '物料编号',
  80. dataIndex: 'pd_prodcode',
  81. width: 120 ,
  82. locked: true
  83. }, {
  84. text: '物料名称',
  85. dataIndex: 'pr_detail',
  86. width: 150,
  87. locked: true
  88. },{
  89. text: '单据日期',
  90. dataIndex: 'pi_date',
  91. xtype: 'datecolumn',
  92. width: 100,
  93. locked: true
  94. }, {
  95. text: '序号',
  96. dataIndex: 'pd_pdno',
  97. exportFormat: 'Integer',
  98. align: 'center',
  99. xtype: 'numbercolumn',
  100. width: 60,
  101. locked: true,
  102. renderer: function(v) {
  103. return saas.util.BaseUtil.numberFormat(v, 0, false);
  104. }
  105. }, {
  106. text: '单号',
  107. dataIndex: 'pi_inoutno',
  108. width: 130,
  109. locked: true
  110. }, {
  111. text: '业务类型',
  112. dataIndex: 'pi_class',
  113. width: 90,
  114. locked: true,
  115. renderer: function(v) {
  116. if(v=="PURCIN"){
  117. return "采购验收";
  118. }else if(v=="PURCOUT"){
  119. return "采购验退";
  120. }else if(v=="SALEOUT"){
  121. return "销售出货";
  122. }else if(v=="SALERETURN"){
  123. return "销售退货";
  124. }else if(v=="OTHERIN"){
  125. return "其它入库";
  126. }else if(v=="OTHEROUT"){
  127. return "其它出库";
  128. }else if(v=="RESERVEINITIALIZE"){
  129. return "库存初始化";
  130. }else if(v=="STOCKPROFIT"){
  131. return "盘盈入库";
  132. }else if(v=="STOCKLOSS"){
  133. return "盘亏出库";
  134. }else if(v=="MOVEOUT" || v=="MOVEIN"){
  135. return "移仓单";
  136. }else if(v=="MAKEPICK"){
  137. return "生产领料";
  138. }else if(v=="MAKERETURN"){
  139. return "生产退料";
  140. }else if(v=="MAKEIN"){
  141. return "完工入库";
  142. }else if(v=="OSMAKEPICK"){
  143. return "外协领料";
  144. }else if(v=="OSMAKERETURN"){
  145. return "外协退料";
  146. }else if(v=="OSMAKEIN"){
  147. return "外协验收";
  148. }else if(v=="OSMAKEINBACK"){
  149. return "外协验退";
  150. }else{
  151. return v;
  152. }
  153. }
  154. }, {
  155. text: '往来单位',
  156. dataIndex: 'bizname',
  157. width: 180
  158. }, {
  159. text: '入库数量',
  160. xtype: 'numbercolumn',
  161. exportFormat: 'Quantity',
  162. dataIndex: 'inqty',
  163. width: 110,
  164. renderer: function(v) {
  165. return saas.util.BaseUtil.numberFormat(v, 6, true);
  166. },
  167. summaryType: 'sum',
  168. summaryRenderer: function(v) {
  169. return saas.util.BaseUtil.numberFormat(v, 6, true);
  170. }
  171. }, {
  172. text: '出库数量',
  173. xtype: 'numbercolumn',
  174. exportFormat: 'Quantity',
  175. dataIndex: 'outqty',
  176. width: 110,
  177. renderer: function(v) {
  178. return saas.util.BaseUtil.numberFormat(v, 6, true);
  179. },
  180. summaryType: 'sum',
  181. summaryRenderer: function(v) {
  182. return saas.util.BaseUtil.numberFormat(v, 6, true);
  183. }
  184. }, {
  185. text: '单位',
  186. dataIndex: 'pr_unit',
  187. width: 65
  188. }, {
  189. text: '仓库',
  190. dataIndex: 'pd_whname',
  191. width: 120
  192. }, {
  193. text: '成本单价(元)',
  194. xtype: 'numbercolumn',
  195. exportFormat: 'Price',
  196. dataIndex: 'pd_price',
  197. width: 120,
  198. renderer: function(v) {
  199. return saas.util.BaseUtil.numberFormat(v, 8, true);
  200. }
  201. }, {
  202. text: '成本金额(元)',
  203. xtype: 'numbercolumn',
  204. exportFormat: 'Amount',
  205. dataIndex: 'pd_total',
  206. width: 120,
  207. renderer: function(v) {
  208. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  209. },
  210. /*summaryType: 'sum',
  211. summaryRenderer: function(v) {
  212. return saas.util.BaseUtil.numberFormat(v, 6, true);
  213. }*/
  214. }, {
  215. text: '结存数量',
  216. xtype: 'numbercolumn',
  217. exportFormat: 'Quantity',
  218. dataIndex: 'qty_sum',
  219. width: 110,
  220. renderer: function(v) {
  221. return saas.util.BaseUtil.numberFormat(v, 6, true);
  222. },
  223. /*summaryType: 'sum',
  224. summaryRenderer: function(v) {
  225. return saas.util.BaseUtil.numberFormat(v, 6, true);
  226. }*/
  227. }, {
  228. text: '结存金额(元)',
  229. xtype: 'numbercolumn',
  230. exportFormat: 'Amount',
  231. dataIndex: 'amount_sum',
  232. width: 120,
  233. renderer: function(v) {
  234. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  235. }
  236. }, {
  237. text: '关联单号',
  238. dataIndex: 'pd_ordercode',
  239. width: 150
  240. }, {
  241. text: '录入人',
  242. dataIndex: 'creatorName',
  243. width: 100
  244. }, {
  245. text: '审核人',
  246. dataIndex: 'pi_auditman',
  247. width: 100
  248. }, {
  249. text: '备注',
  250. dataIndex: 'pd_remark',
  251. width: 250
  252. }, {
  253. text: '型号',
  254. dataIndex: 'pr_orispeccode',
  255. width: 150
  256. }, {
  257. text: '规格',
  258. dataIndex: 'pr_spec',
  259. width: 200
  260. }],
  261. setOtherInfo:function(){ //库存查询双击跳转库存收发明细表并赋值
  262. var me = this,
  263. form = me.down('form'),
  264. trigger = form.down('[name="multi_query"]');
  265. trigger.down('[xtype="productDbfindTrigger"]').setValue(me.otherInfoDetail.code);
  266. trigger.down('[xtype="textfield"]').setValue(me.otherInfoDetail.detail);
  267. trigger.setBindValue(me.otherInfoDetail.code);
  268. }
  269. });