orderMixin.js 1.43 KB
export default {
  data() {
    return {
      date: '',
      searchObj: {},
      statusEnum: {
        0: '未支付',
        1: '已支付',
        2: '已发货',
        3: '已完成',
        4: '售后中',
        5: '退款失败',
        6: '已退款',
      },
      channlList: [{
        label: '海威',
        value: 'HW'
      }],
      statusList: [{
          label: '待收货',
          value: [1, 2]
        }, {
          label: '已完成',
          value: [3]
        }, {
          label: '已退款',
          value: [6]
        },
        {
          label: '售后中',
          value: [4]
        }
      ],
      appereanceList: [{
        label: '卡券',
        value: 1
      }, {
        label: '直充',
        value: 2
      }],

    }
  },
  watch: {
    'date' (n, o) {
      let [orderDateStart, orderDateEnd] = n
      this.searchObj.orderDateStart = orderDateStart ? `${orderDateStart} 00:00:00` : ''
      this.searchObj.orderDateEnd = orderDateEnd ? `${orderDateEnd} 23:59:59` : ''
    }
  },
  methods: {
    search() {
      this.$refs.table.refreshTable()
    },
    reset() {
      this.date = ''
      this.searchObj = {}
      this.$nextTick(() => {
        this.search()
      })
    },
    handleClick({ name }) {
      let orderStatus = name ? name.split(',').map(e => Number(e)) : ''
      this.searchObj.orderStatus = orderStatus
      this.$nextTick(() => {
        this.search()
      })
    }
  },
}