quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
  <!--
      作者:luoyiming
      时间:2020-06-25
      描述:插件中心-砍价-砍价记录-砍价详情
    -->
<el-dialog title="砍价详情" :visible.sync="dialogVisible" @close="dialogFormVisible" :close-on-click-modal="false" :close-on-press-escape="false" width="600px">
 
    <!--内容-->
      <div class="table-wrap">
        <el-table size="small" :data="tableData" border style="width: 100%" highlight-current-row v-loading="loading">
          <el-table-column prop="nickName" label="用户信息" width="200">
            <template slot-scope="scope">
              <div class="user-info d-s-c">
                <img :src="scope.row.user.avatarUrl" />
                <div class="ml10">
                  <span>{{ scope.row.user.nickName }}</span>
                  <span class="gray">ID:{{ scope.row.user.user_id }}</span>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="bargain_price" label="砍价">
            <template slot-scope="scope">
              <div class="red fb">-{{ scope.row.cut_money }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="create_time" label="创建时间" width="140"></el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <div class="pagination">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          background
          :current-page="curPage"
          :page-sizes="[2, 10, 20, 50, 100]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="totalDataNumber"
        ></el-pagination>
      </div>
  </el-dialog>
</template>
 
<script>
import BargainApi from '@/api/bargain.js';
  export default {
    data() {
      return {
        /*是否加载完成*/
        loading: true,
        /*是否显示*/
        dialogVisible: false,
        /*表格数据*/
        tableData: [],
        /*一页多少条*/
        pageSize: 10,
        /*一共多少条数据*/
        totalDataNumber: 0,
        /*当前是第几页*/
        curPage: 1,
      };
    },
    props: ['is_detail','curModel'],
    watch:{
      is_detail:function(n,o){
        if(n!=o){
          if(n){
            this.specsList=[];
            this.dialogVisible=n;
            this.getData();
          }
        }
      }
    },
    created() {
 
    },
    methods: {
 
      /*获取规格列表*/
      getData() {
        let self = this;
        let Params = {};
        Params.bargain_task_id=self.curModel.bargain_task_id;
        Params.page = self.curPage;
        Params.list_rows = self.pageSize;
        self.loading = true;
        BargainApi.help(Params, true)
          .then(res => {
            self.loading = false;
            self.tableData = res.data.list.data;
            self.totalDataNumber = res.data.list.total;
          })
          .catch(error => {});
      },
 
      /*选择第几页*/
      handleCurrentChange(val) {
        this.curPage = val;
        this.getData();
      },
 
      /*每页多少条*/
      handleSizeChange(val) {
        this.curPage = 1;
        this.pageSize = val;
        this.getData();
      },
 
      /*关闭弹窗*/
      dialogFormVisible() {
        this.$emit('close', false);
      },
 
    }
  };
</script>
 
<style>
</style>