Blame view

merchant-web-master/src/views/comprehensive/OrderRhq/index.vue 5.96 KB
3f535f30   杨鑫   '初始'
1
2
  <!--  -->
  <template>
29cad55a   杨鑫   '验收'
3
4
5
6
7
8
  <div style="padding: 0 10px;background-color:#f7f7f7;">
    <div class="tab_show">
      <!-- <el-tabs v-model="formInline.type" @tab-click="handleClick">
        <el-tab-pane label="全部" :name="null" />
      </el-tabs> -->
      <!-- 搜索 -->
3f535f30   杨鑫   '初始'
9
  
29cad55a   杨鑫   '验收'
10
11
12
13
14
15
16
17
18
      <!-- 表格 -->
      <div class="tableBox">
        <el-table
          ref="multipleTable"
          v-loading="loading"
          :data="tableData"
       :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
          tooltip-effect="dark"
        >
3f535f30   杨鑫   '初始'
19
  
29cad55a   杨鑫   '验收'
20
21
22
23
24
25
26
27
28
29
30
31
32
          <el-table-column prop="afterFormid" label="订单号" width="220" />
          <el-table-column prop="afterId" label="售后类型" show-overflow-tooltip>
            <template slot-scope="scope">
              <span v-if="scope.row.afterType == 1">仅退款</span>
              <span v-if="scope.row.afterType == 2">退货退款</span>
            </template>
          </el-table-column>
          <el-table-column prop="price" label="退款金额(元)" show-overflow-tooltip />
          <el-table-column prop="afterStateName" label="审核状态" show-overflow-tooltip />
          <el-table-column prop="createTime" label="审核时间" show-overflow-tooltip />
          <el-table-column label="操作" show-overflow-tooltip>
            <template slot-scope="scope">
              <div class="btnList">
3f535f30   杨鑫   '初始'
33
  
29cad55a   杨鑫   '验收'
34
35
36
37
38
39
                 <div @click="view(scope.row)" class="tableBtn greens" >{{ scope.row.afterState == 1 ? '处理' : '查看' }}</div>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <div class="fenye">
8dca79c8   杨鑫   1
40
  		  <div style="line-height:200%">共{{total}}条</div>
29cad55a   杨鑫   '验收'
41
42
43
44
45
          <el-pagination
          class="pagination"
            :current-page="currentPage"
            :page-size="10"
         background
29cad55a   杨鑫   '验收'
46
          :page-sizes="[10, 20, 50, 100]"
8dca79c8   杨鑫   1
47
         layout="prev, pager, next"
29cad55a   杨鑫   '验收'
48
49
50
51
            :total="total"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
3f535f30   杨鑫   '初始'
52
53
        </div>
      </div>
3f535f30   杨鑫   '初始'
54
    </div>
29cad55a   杨鑫   '验收'
55
56
57
58
59
    <after-details ref="afterDetails" />
  </div>
  
  
  
3f535f30   杨鑫   '初始'
60
61
62
  </template>
  
  <script>
29cad55a   杨鑫   '验收'
63
64
65
66
67
  // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  // 例如:import 《组件名称》 from '《组件路径》';
  import { aftersaleGetAll, afterOrderExport } from '@/api/order'
  import AfterDetails from './afterDetails';
  import { type } from 'os';
3f535f30   杨鑫   '初始'
68
  export default {
29cad55a   杨鑫   '验收'
69
70
    components: { AfterDetails },
    data() {
3f535f30   杨鑫   '初始'
71
72
      // 这里存放数据
      return {
29cad55a   杨鑫   '验收'
73
        loading: false,
3f535f30   杨鑫   '初始'
74
        activeName: 'first',
29cad55a   杨鑫   '验收'
75
76
77
        total: 1,
        tableData: [],
        currentPage: 1,
3f535f30   杨鑫   '初始'
78
        formInline: {
29cad55a   杨鑫   '验收'
79
          searchType: '1', // 搜索类型  1-订单ID 2-买家账户 3-收件人姓名 4-收件人手机号 5-商品ID
3f535f30   杨鑫   '初始'
80
          search: '', // 搜索字段
29cad55a   杨鑫   '验收'
81
82
83
84
          state: '', // 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已关闭
          afterState: '', // 售后状态 0-无售后 1-售后中 2-售后成功 3-售后关闭
          afterType: '', // 售后类型  1-仅退款  2-退货退款
          type: null, // 列表类型 1-待商家处理 2-待商家收货
3f535f30   杨鑫   '初始'
85
          page: 1,
29cad55a   杨鑫   '验收'
86
87
          pageSize: 10,
          afterStateList:[9,10]
3f535f30   杨鑫   '初始'
88
        },
29cad55a   杨鑫   '验收'
89
90
  
        multipleSelection: []
3f535f30   杨鑫   '初始'
91
92
      }
    },
29cad55a   杨鑫   '验收'
93
94
95
96
97
98
    // 监听属性 类似于data概念
    computed: {},
    // 监控data中的数据变化
    watch: {},
    // 生命周期 - 创建完成(可以访问当前this实例)
    created() {},
3f535f30   杨鑫   '初始'
99
100
101
    // 生命周期 - 挂载完成(可以访问DOM元素)
    mounted() {
      this.getAll(this.formInline)
3f535f30   杨鑫   '初始'
102
103
104
    },
    // 方法集合
    methods: {
29cad55a   杨鑫   '验收'
105
      handleSizeChange(val) {
3f535f30   杨鑫   '初始'
106
107
108
        this.formInline.pageSize = val
        this.getAll(this.formInline)
      },
29cad55a   杨鑫   '验收'
109
      handleCurrentChange(val) {
3f535f30   杨鑫   '初始'
110
111
112
        this.formInline.page = val
        this.getAll(this.formInline)
      },
29cad55a   杨鑫   '验收'
113
114
      handleClick(tab, event) {
        this.formInline.type = tab.name
3f535f30   杨鑫   '初始'
115
116
117
        this.getAll(this.formInline)
      },
      //  查询
29cad55a   杨鑫   '验收'
118
      search() {
3f535f30   杨鑫   '初始'
119
120
121
122
        this.total = 1
        this.formInline.page = 1
        this.getAll(this.formInline)
      },
29cad55a   杨鑫   '验收'
123
124
125
      // 处理
      view(row) {
        this.$refs.afterDetails.show(row.afterId)
3f535f30   杨鑫   '初始'
126
127
      },
      // 初始化查询所有数据
29cad55a   杨鑫   '验收'
128
129
130
131
132
133
134
135
136
      async getAll(formInline) {
        this.loading = true
        try {
          const res = await aftersaleGetAll(formInline)
          this.total = res.data.total
          this.tableData = res.data.list
        } finally {
          this.loading = false
        }
3f535f30   杨鑫   '初始'
137
138
      },
      // 导出订单
29cad55a   杨鑫   '验收'
139
      async afterOrderDataExport() {
3f535f30   杨鑫   '初始'
140
141
142
143
        this.$message({
          message: '数据导出中,请勿重复操作!',
          type: 'success'
        })
29cad55a   杨鑫   '验收'
144
145
146
        console.log(this.formInline, 'this.formInline')
        const res = await afterOrderExport(this.formInline)
        if (!res) {
3f535f30   杨鑫   '初始'
147
148
          return
        }
29cad55a   杨鑫   '验收'
149
150
        const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) // 把得到的结果用流对象转一下
        const fileName = '售后订单数据明细表.xls'
3f535f30   杨鑫   '初始'
151
        if ('download' in document.createElement('a')) {
29cad55a   杨鑫   '验收'
152
153
154
155
156
157
158
159
160
161
          // 非IE下载
          const elink = document.createElement('a')
          elink.download = fileName
          elink.href = URL.createObjectURL(blob) // 将流文件写入a标签的href属性值
          elink.style.display = 'none' // 障眼法藏起来a标签
          document.body.appendChild(elink) // 将a标签追加到文档对象中
          elink.click() // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
          URL.revokeObjectURL(elink.href) // 释放URL 对象
          document.body.removeChild(elink)
        } else {
3f535f30   杨鑫   '初始'
162
163
164
165
166
167
168
169
170
171
172
          // IE10+下载
          navigator.msSaveBlob(blob, fileName)
        }
      },
    }
  }
  </script>
  <style lang='scss' scoped>
  //@import url(); 引入公共css类
  @import url("../../../styles/elDialog.scss");
  .tab_show {
29cad55a   杨鑫   '验收'
173
    padding: 0 20px 20px 20px;
3f535f30   杨鑫   '初始'
174
175
    background-color:#fff;
  }
29cad55a   杨鑫   '验收'
176
177
178
  .fenye {
    margin-top: 20px;
    display: flex;
8dca79c8   杨鑫   1
179
    justify-content: space-between;
29cad55a   杨鑫   '验收'
180
    position: relative;
3f535f30   杨鑫   '初始'
181
  }
29cad55a   杨鑫   '验收'
182
183
184
185
186
187
188
189
190
191
    ::v-deep .el-pagination__total {
      position: absolute;
      left: 10px;
    }
    .formSearch {
        display: flex;
        width: 100%;
        font-size: 14px;
        justify-content: space-between;
      }
3f535f30   杨鑫   '初始'
192
  </style>