BenchQueryPanel.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. Ext.define('make.view.money.billOutAP.BenchQueryPanel', {
  2. extend: 'saas.view.core.bench.Query',
  3. xtype: 'money-billoutap-benchpanel',
  4. viewModel: 'money-billoutap-benchquery',
  5. caller:'BillOutAP',
  6. items: [
  7. {
  8. itemId: 'All',
  9. xtype: 'money-billoutap-querypanel'
  10. },
  11. {
  12. //待开票 采购出入库
  13. itemId: 'money-billoutap-benchpanel-1',
  14. xtype: 'purchase-purchasein-querypanel-6',
  15. countGroupFields:'pi_vendcode,pi_currency',
  16. defaultCondition:"((pi_class in('采购验收单','采购验退单','PURCIN','PURCOUT') and pi_status='已审核') or (pi_class='ESTIMATE' and prodiodetail.pd_type in('采购入库','采购退货'))) "
  17. +"and abs(round(ifnull(prodiodetail.pd_ordertotal,0),2))>abs(round(ifnull(prodiodetail.pd_billamount,0),2))",
  18. _needCount: true
  19. },
  20. {
  21. //待开票 外协出入库
  22. itemId: 'money-billoutap-benchpanel-2',
  23. xtype: 'osmake-osmakecheckin-querypanel-5',
  24. countGroupFields:'pi_vendcode,pi_currency',
  25. baseVastUrl: '/api/make/prodinout/',
  26. defaultCondition:"((pi_status='已审核' and pi_class in('OSMAKEIN','OSMAKEINBACK')) or(pi_class='ESTIMATE' and prodiodetail.pd_type in('外协验收','外协验退'))) "
  27. +"and abs(round(ifnull(prodiodetail.pd_ordertotal,0),2))>abs(round(ifnull(prodiodetail.pd_billamount,0),2))",
  28. _needCount: true
  29. },
  30. {
  31. //待开票 采购对账单
  32. itemId: 'money-billoutap-benchpanel-3',
  33. xtype: 'purchase-b2b-reconciliation-querypanel-4',
  34. countGroupFields:'ac_vendcode,ac_currency',
  35. defaultCondition:"ac_class='PURC' and ac_statuscode='AUDITED' and abs(ifnull(apcheckdetail.ad_billqty,0))<abs(ifnull(ad_b2bqty,0))",
  36. _needCount: true
  37. },
  38. {
  39. //待开票 外协对账单
  40. itemId: 'money-billoutap-benchpanel-4',
  41. xtype: 'osmake-reconciliation-querypanel-4',
  42. countGroupFields:'ac_vendcode,ac_currency',
  43. defaultCondition:"ac_class='OS' and ac_statuscode='AUDITED' and abs(ifnull(apcheckdetail.ad_billqty,0))<abs(ifnull(ad_b2bqty,0))",
  44. _needCount: true
  45. },
  46. {
  47. //待审核
  48. itemId: 'money-billoutap-benchpanel-5',
  49. xtype: 'money-billoutap-querypanel-1',
  50. _needCount: true,//是否需计数 如果存在明细数据按整单合计,同时配置 countGroupFields 如:sa_code 多个分组 sa_code,sa_custcode
  51. defaultCondition:"bi_statuscode <> 'AUDITED'"
  52. },
  53. {
  54. //已审核
  55. itemId: 'money-billoutap-benchpanel-6',
  56. xtype: 'money-billoutap-querypanel-2',
  57. _needCount: false,//是否需计数
  58. defaultCondition:"bi_statuscode='AUDITED'"
  59. }
  60. ],
  61. countUrl:'money/billoutap/count',
  62. addBtnText:'',
  63. hiddenMe:true,
  64. isFirst:1,//第一次打开自动切换到对应待处理panel 再次切回来(非重新打开时,不处理)
  65. listeners: {
  66. onTabActivate:function(tabView){
  67. var me=this;
  68. if(me.isFirst){
  69. var BillOutAPSource=Ext.getCmp('mainView').getViewModel().get('BillOutAPSource')
  70. if("CHECK"==BillOutAPSource){
  71. itemId='money-billoutap-benchpanel-3';
  72. }else if("PRODIO"==BillOutAPSource){
  73. itemId='money-billoutap-benchpanel-1';
  74. }else{
  75. itemId='money-billoutap-benchpanel-5';
  76. }
  77. tabView.benchRefresh(tabView, itemId);
  78. Ext.defer(function(){
  79. tabView.updateCount();
  80. },200);
  81. me.isFirst=0;
  82. }
  83. }
  84. }
  85. });