afterSalesManage.vue 6.16 KB
<template>
  <d2-container>
    <el-card shadow="never">
      <el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
        <el-form-item label="售后订单号">
          <el-input v-model="formInline.afterSaleOrderNumber" placeholder="请输入售后订单号" />
        </el-form-item>
        <el-form-item label="申请商户">
          <el-input v-model="formInline.merchantName" placeholder="请输入申请商户" />
        </el-form-item>
        <el-form-item label="售后类型">
          <el-select v-model="formInline.type" placeholder="请选择">
            <el-option value="" label="全部">全部</el-option>
            <el-option value="1" label="退货">退货</el-option>
            <el-option value="2" label="返修">返修</el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="售后状态">
          <el-select v-model="formInline.status" placeholder="请选择">
            <el-option value="" label="全部">全部</el-option>
            <el-option value="0" label="待维修">待维修</el-option>
            <el-option value="1" label="维修中">维修中</el-option>
            <el-option value="2" label="取消维修">取消维修</el-option>
            <el-option value="3" label="已完成">已完成</el-option>
            <el-option value="4" label="待退货">待退货</el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
        </el-form-item>
      </el-form>
    </el-card>

    <!-- 表格区域 开始 -->
    <div class="table_box">
      <el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
        <el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
        <el-table-column prop="afterSaleOrderNumber" label="售后订单号" :width="tdWidth" />
        <el-table-column prop="type" label="售后类型" :width="tdWidth">
          <template slot-scope="scope">{{ AFTERSALESTYPE[scope.row.type] }}</template>
        </el-table-column>
        <el-table-column prop="orderTime" label="提交时间" :width="tdWidth">
          <template slot-scope="scope">{{ DATEFORMATE(scope.row.orderTime) }}</template>
        </el-table-column>
        <el-table-column prop="merchantName" label="申请商户" :width="tdWidth" />
        <el-table-column prop="productName" label="产品名称" :width="tdWidth" />
        <el-table-column prop="createdBy1111" label="规格" :width="tdWidth" />
        <el-table-column prop="number" label="数量" :width="tdWidth" />
        <el-table-column prop="status" label="状态" :width="tdWidth">
          <template slot-scope="scope">{{ SALESSTATUS[scope.row.status] }}</template>
        </el-table-column>
        <el-table-column prop="repairCost" label="维修费用" :width="tdWidth">
          <template slot-scope="scope">¥{{ scope.row.repairCost||'0.00' }}</template>
        </el-table-column>
        <el-table-column prop="操作" label="操作" :width="tdWidth" fixed="right">
          <template slot-scope="scope">
            <el-button type="primary" size="mini" v-if="scope.row.status == 1 || scope.row.status == 0 || scope.row.status == 4">处理</el-button>
            <el-button type="primary" size="mini" v-if="scope.row.status == 0 || scope.row.status == 4">取消</el-button>
            <el-button type="primary" size="mini" v-if="scope.row.status == 3">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination_list">
        <el-pagination
          background
          layout="sizes, total,prev, pager, next, jumper"
          :total="pageTotal"
          :page-size="pageSize"
          :page-sizes="pageSizes"
          @current-change="getList"
          @size-change="changePageSize"
        />
      </div>
    </div>
    <!-- 表格区域 end -->

  </d2-container>
</template>

<script>
import {
  GETLISTMAINTAINPRODUCT
} from '@/http/interface'
export default {
  data() {
    return {
      formInline: {},
      tableData: [],
      dialogVisible: false,
      tableLoading: false,
      pageTotal: 0,
      userInfo: {},
      currentPage: 1,
      pageSizes: [10, 20, 30, 40],
      pageSize: 10,
      orderDate: [],
      tdWidth: 170,
      DATEFORMATE: (str, type) => {
        return this.$Util.dateFormate(str, type)
      },
      deviceTypeList: [],
      SALESSTATUS: {
        0: '待维修',
        1: '待审核',
        2: '待寄回',
        3: '待发货',
        4: '待签收',
        5: '已完成',
        6: '已驳回',
        7: '已取消',
        8: '已寄回',
        9: '部分发货',
        10: '部分签收'
      },
      AFTERSALESTYPE: {
        1: '退货',
        2: '返修'
      }
    }
  },
  created() {

  },

  mounted: function() {
    this.getList()
  },
  methods: {

    /**
       * 查询列表
       */
    getList: function(current) {
      const _this = this
      const oParams = _this.getParams()
      console.log(current)
      oParams.pageNum = current || _this.currentPage
      _this.tableLoading = true
      GETLISTMAINTAINPRODUCT(oParams).then(res => {
        console.log(res)
        _this.tableLoading = false
        if (res.returnCode == 0) {
          const {
            data
          } = res
          const {
            total,
            list
          } = data
          _this.tableData = list || []
          _this.pageTotal = total
        }
      })
    },

    /**
       * 获取查询参数
       */
    getParams: function() {
      const n = this.formInline
      let oParams = {}
      const m = this.orderDate
      if (m && m.length > 0) {
        n.startDate = m[0]
        n.endDate = m[1]
      }else{
        delete n.startDate
        delete n.endDate
      }

      oParams.condition = n
      oParams.pageSize = this.pageSize
      oParams.pageStart = 0
      return oParams
    },

    /**
       * 每页展示
       */
    changePageSize: function(e) {
      this.pageSize = e
      this.getList()
    }

  }

}
</script>

<style lang="scss">
  .table_box {
    margin: 20px 0;
  }
</style>