Recment.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /**
  2. * 待收款
  3. */
  4. Ext.define('saas.view.home.infoCardList.Recment', {
  5. extend: 'saas.view.home.infoCardList.InfoList',
  6. xtype: 'home-infocardlist-recment',
  7. listUrl: '/api/sale/prodinout/homepageList/',
  8. idField: 'id',
  9. codeField: 'pi_inoutno',
  10. // detailTitle: '出货单',
  11. // detailXType: 'sale-saleout-formpanel',
  12. condition: 'pi_class in (\'出货单\',\'销售退货单\') and prodinout.companyId=#{companyId} and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=#{companyId} and ifnull(sl_namount,0)<>0)',
  13. listColumns: [{
  14. text: 'id',
  15. dataIndex: 'id',
  16. hidden:true,
  17. xtype: 'numbercolumn'
  18. }, {
  19. text: '出货单号',
  20. dataIndex: 'pi_inoutno',
  21. width: 150
  22. }, {
  23. text: '单据日期',
  24. dataIndex: 'pi_date',
  25. xtype:'datecolumn',
  26. width: 110
  27. },{
  28. text: '客户名称',
  29. dataIndex: 'pi_custname',
  30. width: 250
  31. }, {
  32. text: '单据状态',
  33. align: 'center',
  34. dataIndex: 'pi_status',
  35. width: 90
  36. }, {
  37. text: '明细序号',
  38. dataIndex: 'pd_pdno',
  39. xtype: 'numbercolumn',
  40. width: 100,
  41. renderer : function(v) {
  42. var format = '0'
  43. return Ext.util.Format.number(v, format);
  44. }
  45. }, {
  46. text: '关联销售单号',
  47. dataIndex: 'pd_ordercode',
  48. width: 150
  49. }, {
  50. text: '订单序号',
  51. dataIndex: 'pd_orderdetno',
  52. xtype:'numbercolumn',
  53. width: 100,
  54. renderer : function(v) {
  55. if (v == 0) {
  56. v= '';
  57. }
  58. var format = '0'
  59. return Ext.util.Format.number(v, format);
  60. }
  61. }, {
  62. text: '物料编号',
  63. dataIndex: 'pd_prodcode',
  64. width: 150
  65. }, {
  66. text: '物料名称',
  67. dataIndex: 'pr_detail',
  68. width: 150
  69. }, {
  70. text: '出货数量',
  71. // dataIndex: 'pd_outqty',
  72. dataIndex: 'qty',
  73. xtype:'numbercolumn',
  74. width: 110,
  75. renderer : function(v) {
  76. var arr = (v + '.').split('.');
  77. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  78. var format = '0.' + xr.join();
  79. return Ext.util.Format.number(v, format);
  80. }
  81. }, {
  82. text: '销售单价',
  83. dataIndex: 'pd_sendprice',
  84. xtype:'numbercolumn',
  85. width: 110,
  86. renderer : function(v) {
  87. var arr = (v + '.').split('.');
  88. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  89. var format = '0.' + xr.join();
  90. return Ext.util.Format.number(v, format);
  91. }
  92. }, {
  93. text: '金额',
  94. dataIndex: 'pd_ordertotal',
  95. xtype:'numbercolumn',
  96. width: 110,
  97. renderer : function(v) {
  98. var arr = (v + '.').split('.');
  99. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  100. var format = '0.' + xr.join();
  101. return Ext.util.Format.number(v, format);
  102. }
  103. }, {
  104. text: '税率',
  105. dataIndex: 'pd_taxrate',
  106. xtype:'numbercolumn',
  107. width: 80,
  108. renderer : function(v) {
  109. return Ext.util.Format.number(v, '0');
  110. }
  111. }, {
  112. text: '成本单价',
  113. dataIndex: 'pd_price',
  114. xtype:'numbercolumn',
  115. width: 110,
  116. renderer : function(v) {
  117. var arr = (v + '.').split('.');
  118. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  119. var format = '0.' + xr.join();
  120. return Ext.util.Format.number(v, format);
  121. }
  122. }, {
  123. text: '备注',
  124. dataIndex: 'pd_remark',
  125. width: 250
  126. }],
  127. listeners: {
  128. beforeopendetail: function(grid, record) {
  129. var pi_class = record.get('pi_class'),
  130. detailTitle = '出货单',
  131. detailXType = 'sale-saleout-formpanel';
  132. if(pi_class == '销售退货单') {
  133. detailTitle = '销售退货单';
  134. detailXType = 'sale-salein-formpanel';
  135. }
  136. grid.detailTitle = detailTitle;
  137. grid.detailXType = detailXType;
  138. return true;
  139. }
  140. }
  141. });