/**

  • 每日销量与欠货量统计 */ Ext.define('Erp.view.finance.dialog.ProductOfSizeAndTotalSalesDetail', { extend: 'Erp.ux.Window', requires: ['Erp.ux.Window', 'Erp.ux.ComboBoxTree', 'Erp.model.store.ClassifyTree'], xtype: 'product-of-size-and-total-sales-detail-win',

    title: '销量统计', /**

    • 初始化配置
    • @private */ _initConfig() { this.doSearch() this._items()

    }, productSkcId: null, width: '100%', height: '100%', maxWidth: '100%', maxHeight: '100%', minWidth: '100%', minHeight: '100%', fields: ['VALUE'], tag: null, plain: true, modal: true, seriesSize: [], series: [], datas: [], bodyStyle: 'background:white;', layout: { type: 'vbox', },

    draggable: false,

    $data: {}, items: [],

    /**

    • 容器

    • @private */ _items() { let me = this; this.items = [ { height: '10%', region: 'north', items: [{ xtype: 'ux-combobox', itemId: 'dimensionId', values: [['1', '总体'], ['2', '尺码总体']], value: '1', listeners: { change: function (field, newValue) { var chart = me.down('#chartId');

                       me.series = me.getSeries(newValue)
                       chart.series = new Ext.util.MixedCollection(false, function (a) {
                           return a.seriesId || (a.seriesId = Ext.id(null, 'ext-chart-series-'));
                       });
      
                       if (me.series) {
                           me.refresh(chart);
                           chart.series.clear();
                           chart.series.addAll(me.series);
                       }
                       chart.getStore().load();
                   }
               }
           }]
       },
       {
           height: '30%',
           region: 'north',
           xtype: 'chart',
           itemId: 'chartId',
           shadow: true,
           animate: true, // 是否支持动态数据变化
           legend: {
               position: 'bottom',
           },
           store: Ext.create('Ext.data.Store', {
               fields: me.fields,
               timeout: 600000,
               proxy: {
                   type: 'ajax',
                   url: ctx + '/pdd/pdd-owe-goods-management/get-line-data-of-sku-size',
                   reader: {
                       type: 'json',
                       root: 'result'
                   }
               },
               autoLoad: true,
               listeners: {
                   'beforeload': function (store, operation, eOpts) {
                       var new_params = {
                           productSkcId: me.productSkcId,
                           dimensionId: me.down('#dimensionId').getValue()
                       };
                       Ext.apply(store.proxy.extraParams, new_params);
                   },
               }
           }),
           axes: [{
               type: 'Numeric',
               position: 'left',
               title: false,
               grid: true
           }, {
               type: 'Category',
               position: 'bottom',
               fields: 'REPORT_DATE',
               title: false
           }],
           series: me.series,
      
       }
      

      ] },

    getSeries: function (selectType) { var me = this; let defaultArrays = [ { type: 'line', axis: ['left', 'bottom'], xField: 'REPORT_DATE', yField: 'VALUE', title: '销量', markerConfig: { // 详细参数请参考API radius: 3 // 曲线图上点的样式 }, label: { field: 'lable', display: 'over' }, tips: { trackMouse: true, autoShow: false, width: 157, renderer: function (storeItem, item) { this.setTitle( <p>销量:${storeItem.get('VALUE')}</p> ); } } } ]

     let siezeArrays = [];
    
     let size = me.seriesSize;
     for (let i = 0; i < size.length; i++) {
         siezeArrays.push({
             type: 'line',
             axis: ['left', 'bottom'],
             xField: 'REPORT_DATE',
             yField: size[i],
             title: size[i],
             markerConfig: { // 详细参数请参考API
                 radius: 3
                 // 曲线图上点的样式
             },
             label: {
                 field: 'lable',
                 display: 'over'
             },
             tips: {
                 trackMouse: true,
                 autoShow: false,
                 width: 157,
                 renderer: function (storeItem, item) {
                     debugger
                     let title = '';
                     for (let j = 0; j < size.length; j++) {
                         title += `<p>${size[j]}:${storeItem.get(size[j])}</p>`
                     }
                     this.setTitle(title);
                 }
             }
         },
         )
     }
     return selectType == '1' ? defaultArrays : siezeArrays;
    

    },

    refresh: function (chart) { let ls = chart.legend.items; for (let i = 0; i < ls.length; i++) { let l = ls[i]; l.series.hideAll(); l.label.setAttributes({opacity: 0.5}, true); } }, /**

    • 查询 */ doSearch() { let me = this; me.series = this.getSeries('1'); me.seriesSize = []; //重置尺码使用 Utils.Context.request({ url: ctx + '/pdd/pdd-owe-goods-management/get-line-data-leg', params: { productSkcId: me.productSkcId }, success: function (chartsData) { if (!chartsData) { Ext.Msg.alert('提示', '暂无数据展示') return } me.fields = chartsData; me.seriesSize = chartsData; } }) },

})

每日销量与欠货量统计

原文地址: https://www.cveoy.top/t/topic/p4pC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录