properties.js 3.88 KB
import util from '../../../utils/util.js'
const toolList = ['新车精品升级']
const rankingText = ['金额', '人数']
const toolText = ['累计', '日期']
const topCondition = 0
const trapezoidColor = ['#5B84FE', '#57BDFF', '#58E39F']
const resultList = [{
    key: 'totalPriceCount',
    title: '销售额(元)'
  },
  // {
  //   key: 'shopProfitMoneyCount',
  //   title: '店面分润(元)'
  // },
  {
    key: 'customerUnitCost',
    title: '客单价(元)'
  }
]
const trapezoid = [{
    name: '发券量',
    key: 'getTotal'
  },
  {
    name: '核券量',
    key: 'usedTotal'
  },
  {
    name: '转化量',
    key: 'upgradeTotal'
  }
]
const orderObj = [{
    label: '客户姓名:',
    key: 'customerName'
  },
  {
    label: '车架号:',
    key: 'standNo'
  },
  {
    label: '转化产品:',
    key: 'goodsListName'
  },
  {
    label: '转化金额:',
    key: 'totalPrice'
  },
 // 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
  {
    label: {
      3: '工单时间:',
      4: '工单时间:',
      5: '工单时间:',
      6: '工单时间:',
    },
    enum: true,
    key: 'time'
  }
]
const canvasObj = {
  usedRatio: {
    color: '#58E39F',
    title: '核券率',
    val: 0
  },
  upgradeRatio: {
    color: '#FFAB00',
    title: '转化率',
    val: 0

  }
}
const maxDate = new Date().format('yyyy-MM-dd')
const rankingTime = {
  startDate: new Date().format('yyyy-MM'),
  endDate: new Date().format('yyyy-MM')
}
 // 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
const orderStatus = {

  1: {
    text: '待跟进',
    color: '#A3A5AD'
  },
  2: {
    text: '不升级',
    color: '#EF4342'
  },
  3: {
    text: '待支付',
    color: '#FF9834'
  },
  4: {
    text: '已支付',
    color: '#07C160'
  },
  6: {
    text: '已评价',
    color: '#05BAA0'
  },
  9:{
    text:'已撤销',
    color: '#999'
  }
}
module.exports = {
  pageData: {
    maxDate,
    toolList,
    orderObj,
    trapezoid,
    canvasObj,
    resultList,
    rankingText,
    rankingTime,
    topCondition,
    trapezoidColor,
    usedRatio: () => {},
    upgradeRatio: () => {},
    rankingList: [],
    orderList: [],
    orderStatus,
    chartShow: false,
    toolText,
    toolIndex: 0,
    couponIndex:0,
    couponList:[]
  },
  methods: {
    initChart(F2, config, options) {
      let {
        val,
        title,
        color
      } = options
      if(!val) val = 0
      config.padding = [10, 0, 20, 0]
      const chart = new F2.Chart(config)
      const data = [{
        x: '0',
        y: util.decimal(val * 100, 2)
      }]
      chart.source(data, {
        y: {
          max: 100,
          min: 0
        }
      })
      chart.legend(false)
      chart.coord('polar', {
        transposed: true,
        innerRadius: 0.8,
        radius: 0.85
      })
      chart.axis(false)
      chart.tooltip(false)
      chart.guide().text({
        position: ['50%', '50%'],
        content: `${util.decimal(val,2)}%`,
        style: {
          fill: '#333',
          fontSize: 12
        }
      })
      chart.guide().text({
        position: ['50%', '105%'],
        content: title,
        style: {
          fill: '#666',
          fontSize: 8
        }
      })
      chart.guide().arc({
        start: [0, 0],
        end: [1, 99.99],
        top: false,
        style: {
          lineWidth: 6.5,
          stroke: '#eaeaea'
        }
      })
      chart.interval()
        .position('x*y')
        .size(9)
        .color(color)
        .animate({
          appear: {
            duration: 1200,
            easing: 'cubicIn'
          }
        })
      chart.render()
      return chart
    }
  }
}