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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<template>
  <!--
          作者:luoyiming
          时间:2020-06-01
          描述:插件中心-分销-分销订单
      -->
  <div class="user">
    <div class="common-seach-wrap">
      <el-form size="small" :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="佣金结算">
          <el-select v-model="formInline.is_settled" placeholder="是否结算佣金">
            <el-option label="全部" value="-1"></el-option>
            <el-option label="已结算" value="1"></el-option>
            <el-option label="未结算" value="0"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用户id"><el-input v-model="formInline.user_id" placeholder="请输入用户ID"></el-input></el-form-item>
        <el-form-item><el-button type="primary" @click="onSubmit">查询</el-button></el-form-item>
      </el-form>
    </div>
 
    <!--内容-->
    <div class="product-content">
      <div class="table-wrap">
        <el-table :data="tableData" size="small" border style="width: 100%" v-loading="loading">
          <el-table-column prop="order_master.create_time" label="商品信息">
            <template slot-scope="scope">
              <div class="product-info p-10-0" v-for="(item, index) in scope.row.order_master.product" :key="index">
                <div class="pic"><img v-img-url="item.image.file_path" alt="" /></div>
                <div class="info">
                  <div class="name gray3">{{ item.product_name }}</div>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="referee.value" label="代理" width="400">
            <template slot-scope="scope">
              <div class="d-s-s d-c">
                <div class="d-s-c ww100 border-b-d">
                  <p class="referee-name text-ellipsis">
                    <span class="gray9">分红:</span>
                    <span class="orange">¥{{ scope.row.bonus_money }}</span>
                  </p>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="nickName" label="单价/数量" width="150">
            <template slot-scope="scope">
              <div v-for="(item, index) in scope.row.order_master.product" :key="index">
                <span class="orange">¥{{ item.product_price }}</span>
                ×{{ item.total_num }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="order_master.pay_price" label="实付款" width="100">
            <template slot-scope="scope">
              <span class="fb orange">{{ scope.row.order_master.pay_price }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="order_master.user.nickName" label="买家" width="100"></el-table-column>
          <el-table-column prop="mobile" label="交易状态" width="130">
            <template slot-scope="scope">
              <p>
                <span class="gray9">付款状态:</span>
                {{ scope.row.order_master.pay_status.text }}
              </p>
              <p>
                <span class="gray9">发货状态:</span>
                {{ scope.row.order_master.delivery_status.text }}
              </p>
              <p>
                <span class="gray9">收货状态:</span>
                {{ scope.row.order_master.receipt_status.text }}
              </p>
            </template>
          </el-table-column>
          <el-table-column prop="referee.value" label="佣金结算" width="70">
            <template slot-scope="scope">
              <span class="green" v-if="scope.row.is_settled == 1">已结算</span>
              <span class="red" v-if="scope.row.is_settled == 0">未结算</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
 
      <!--分页-->
      <div class="pagination">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          background
          :current-page="curPage"
          :page-size="pageSize"
          layout="total, prev, pager, next, jumper"
          :total="totalDataNumber"
        ></el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import PlusApi from '@/api/plus/region.js';
export default {
  components: {
    /*编辑组件*/
  },
  data() {
    return {
      /*是否加载完成*/
      loading: true,
      /*列表数据*/
      tableData: [],
      /*一页多少条*/
      pageSize: 20,
      /*一共多少条数据*/
      totalDataNumber: 0,
      /*当前是第几页*/
      curPage: 1,
      formInline: {
        is_settled: '-1',
        /*用户ID*/
        user_id: ''
      },
      /*是否打开编辑弹窗*/
      open_edit: false,
      /*当前编辑的对象*/
      userModel: {}
    };
  },
  props: {},
  watch: {
    $route(to, from) {
      if (to.query.user_id != null) {
        this.formInline.user_id = to.query.user_id;
      } else {
        this.formInline.user_id = '';
      }
      this.curPage = 1;
      this.getData();
    }
  },
  created() {
    if (this.$route.query.user_id != null) {
      this.formInline.user_id = this.$route.query.user_id;
    }
    /*获取列表*/
    this.getData();
  },
  methods: {
    /*选择第几页*/
    handleCurrentChange(val) {
      let self = this;
      self.curPage = val;
      self.loading = true;
      self.getData();
    },
 
    /*获取数据*/
    getData(user_id) {
      let self = this;
      let Params = {
        user_id: self.formInline.user_id,
        page: self.curPage,
        list_rows: self.pageSize,
        is_settled: self.is_settled
      };
 
      PlusApi.regionOrder(Params, true)
        .then(data => {
          self.loading = false;
          self.tableData = data.data.list.data;
          self.totalDataNumber = data.data.list.total;
        })
        .catch(error => {
          self.loading = false;
        });
    },
 
    //搜索
    onSubmit() {
      let self = this;
      self.loading = true;
      self.is_settled = self.formInline.is_settled;
      self.getData();
    },
 
    /*每页多少条*/
    handleSizeChange(val) {
      this.curPage = 1;
      this.pageSize = val;
      this.getData();
    },
 
    /*打开弹出层编辑*/
    editClick(item) {
      this.userModel = item;
      this.open_edit = true;
    },
 
    /*关闭弹窗*/
    closeDialogFunc(e, f) {
      if (f == 'add') {
        this.open_add = e.openDialog;
        if (e.type == 'success') {
          this.getData();
        }
      }
      if (f == 'edit') {
        this.open_edit = e.openDialog;
        if (e.type == 'success') {
          this.getData();
        }
      }
    }
  }
};
</script>
 
<style scoped="">
  .referee-name{ width: 33.333333%;}
</style>