Recment.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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: 'pi_sacode',
  39. width: 150
  40. },{
  41. text: '总金额',
  42. dataIndex: 'pi_total',
  43. xtype:'numbercolumn',
  44. width: 110
  45. },{
  46. text: '收款状态',
  47. align: 'center',
  48. dataIndex: 'pi_prstatus',
  49. width: 90
  50. }, {
  51. text: '备注',
  52. dataIndex: 'pi_remark',
  53. width: 250
  54. },{
  55. text: '明细序号',
  56. dataIndex: 'pd_pdno',
  57. xtype: 'numbercolumn',
  58. width: 100,
  59. hidden:true,
  60. renderer : function(v) {
  61. var format = '0'
  62. return Ext.util.Format.number(v, format);
  63. }
  64. }, {
  65. text: '关联销售单号',
  66. dataIndex: 'pd_ordercode',
  67. width: 150,
  68. hidden:true
  69. }, {
  70. text: '订单序号',
  71. dataIndex: 'pd_orderdetno',
  72. xtype:'numbercolumn',
  73. width: 100,
  74. hidden:true,
  75. renderer : function(v) {
  76. if (v == 0) {
  77. v= '';
  78. }
  79. var format = '0'
  80. return Ext.util.Format.number(v, format);
  81. }
  82. }, {
  83. text: '物料编号',
  84. dataIndex: 'pd_prodcode',
  85. hidden:true,
  86. width: 150
  87. }, {
  88. text: '物料名称',
  89. dataIndex: 'pr_detail',
  90. hidden:true,
  91. width: 150
  92. }, {
  93. text: '出货数量',
  94. // dataIndex: 'pd_outqty',
  95. dataIndex: 'qty',
  96. xtype:'numbercolumn',
  97. width: 110,
  98. hidden:true,
  99. renderer : function(v) {
  100. var arr = (v + '.').split('.');
  101. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  102. var format = '0.' + xr.join('');
  103. return Ext.util.Format.number(v, format);
  104. }
  105. }, {
  106. text: '销售单价(元)',
  107. dataIndex: 'pd_sendprice',
  108. xtype:'numbercolumn',
  109. hidden:true,
  110. width: 110,
  111. renderer : function(v) {
  112. var arr = (v + '.').split('.');
  113. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  114. var format = '0.' + xr.join('');
  115. return Ext.util.Format.number(v, format);
  116. }
  117. }, {
  118. text: '金额',
  119. dataIndex: 'pd_ordertotal',
  120. xtype:'numbercolumn',
  121. width: 110,
  122. hidden:true,
  123. renderer : function(v) {
  124. var arr = (v + '.').split('.');
  125. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  126. var format = '0.' + xr.join('');
  127. return Ext.util.Format.number(v, format);
  128. }
  129. }, {
  130. text: '税率',
  131. dataIndex: 'pd_taxrate',
  132. xtype:'numbercolumn',
  133. width: 80,
  134. hidden:true,
  135. renderer : function(v) {
  136. return Ext.util.Format.number(v, '0');
  137. }
  138. }, {
  139. text: '成本单价',
  140. dataIndex: 'pd_price',
  141. xtype:'numbercolumn',
  142. width: 110,
  143. hidden:true,
  144. renderer : function(v) {
  145. var arr = (v + '.').split('.');
  146. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  147. var format = '0.' + xr.join('');
  148. return Ext.util.Format.number(v, format);
  149. }
  150. }, {
  151. text: '备注',
  152. dataIndex: 'pd_remark',
  153. hidden:true,
  154. width: 250
  155. }],
  156. listeners: {
  157. beforeopendetail: function(grid, record) {
  158. var pi_class = record.get('pi_class'),
  159. detailTitle = '出货单',
  160. detailXType = 'sale-saleout-formpanel';
  161. if(pi_class == '销售退货单') {
  162. detailTitle = '销售退货单';
  163. detailXType = 'sale-salein-formpanel';
  164. }
  165. grid.detailTitle = detailTitle;
  166. grid.detailXType = detailXType;
  167. return true;
  168. }
  169. }
  170. });