Payment.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /**
  2. * 待付款
  3. */
  4. Ext.define('saas.view.home.infoCardList.Payment', {
  5. extend: 'saas.view.home.infoCardList.InfoList',
  6. xtype: 'home-infocardlist-payment',
  7. listUrl: '/api/purchase/prodinout/homepageList',
  8. idField: 'id',
  9. codeField: 'pi_inoutno',
  10. // detailTitle: '采购验收单',
  11. // detailXType: 'purchase-purchasein-formpanel',
  12. condition: 'pi_class in (\'采购验收单\',\'采购验退单\') and prodinout.companyId=#{companyId} and ( TO_DAYS(pi_date) + ifnull(ve_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: 'pu_id',
  16. xtype: 'numbercolumn',
  17. hidden: true
  18. }, {
  19. text: '单据编号',
  20. dataIndex: 'pi_inoutno',
  21. width: 150
  22. }, {
  23. text: '单据类型',
  24. dataIndex: 'pd_piclass',
  25. width: 0
  26. }, {
  27. text: '单据日期',
  28. dataIndex: 'pi_date',
  29. xtype: 'datecolumn',
  30. width: 110
  31. }, {
  32. text: '供应商编号',
  33. dataIndex: 'pi_vendcode',
  34. width: 0
  35. }, {
  36. text: '供应商名称',
  37. dataIndex: 'pi_vendname',
  38. width: 250
  39. }, {
  40. text: '审核状态',
  41. align: 'center',
  42. dataIndex: 'pi_status',
  43. width: 90
  44. }, {
  45. text: '序号',
  46. dataIndex: 'pd_pdno',
  47. width: 80
  48. }, {
  49. text: '相关单号',
  50. dataIndex: 'pd_ordercode',
  51. width: 150
  52. }, {
  53. text: '物料编号',
  54. dataIndex: 'pd_prodcode',
  55. width: 150
  56. }, {
  57. text: '物料名称',
  58. dataIndex: 'pr_detail',
  59. width: 200
  60. }, {
  61. text: '物料规格',
  62. dataIndex: 'pr_spec',
  63. width: 150
  64. }, {
  65. text: '单位',
  66. dataIndex: 'pr_unit',
  67. width: 80
  68. }, {
  69. text: '数量',
  70. // dataIndex: 'pd_inqty',
  71. dataIndex: 'qty',
  72. xtype: 'numbercolumn',
  73. width: 110,
  74. renderer: function (v) {
  75. var arr = (v + '.').split('.');
  76. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  77. var format = '0,000.' + xr.join('');
  78. return Ext.util.Format.number(v, format);
  79. },
  80. }, {
  81. text: '仓库',
  82. dataIndex: 'pd_whname',
  83. width: 150
  84. }, {
  85. text: '单价',
  86. dataIndex: 'pd_orderprice',
  87. xtype: 'numbercolumn',
  88. renderer: function (v) {
  89. var arr = (v + '.').split('.');
  90. var xr = (new Array(arr[1].length)).fill('0');
  91. var format = '0,000.' + xr.join('');
  92. return Ext.util.Format.number(v, format);
  93. },
  94. width: 110
  95. }, {
  96. text: '税率',
  97. dataIndex: 'pd_taxrate',
  98. xtype: 'numbercolumn',
  99. width: 80,
  100. renderer: function (v) {
  101. return Ext.util.Format.number(v, '0');
  102. },
  103. }, {
  104. text: '金额',
  105. dataIndex: 'pd_total',
  106. xtype: 'numbercolumn',
  107. width: 110,
  108. renderer: function (v) {
  109. var arr = (v + '.').split('.');
  110. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  111. var format = '0,000.' + xr.join('');
  112. return Ext.util.Format.number(v, format);
  113. },
  114. }],
  115. listeners: {
  116. beforeopendetail: function(grid, record) {
  117. var pi_class = record.get('pi_class'),
  118. detailTitle = '采购验收单',
  119. detailXType = 'purchase-purchasein-formpanel';
  120. if(pi_class == '采购验退单') {
  121. detailTitle = '采购验退单';
  122. detailXType = 'purchase-purchaseout-formpanel';
  123. }
  124. grid.detailTitle = detailTitle;
  125. grid.detailXType = detailXType;
  126. return true;
  127. }
  128. }
  129. });