doum
3 天以前 7c626e30b790489978150e57a2c7359934df32c7
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
<template>
  <GlobalWindow
      :title="title"
      width="100%"
      :visible.sync="visible"
  >
    <div style="display: block">
      <div class="header">
        <div  class="header-b">用户信息</div>
        <div v-if="info.phone!=null && info.phone!=''" class="header-blue">已授权手机号</div>
      </div>
      <div class="info-item">
          <div class="info-item-a">微信openid:<span>{{info.openId}}</span></div>
          <div class="info-item-a">昵称:<span>{{info.nickname}}</span></div>
          <div class="info-item-a">客户姓名:<span>{{info.name}}</span></div>
      </div>
      <div class="info-item">
        <div class="info-item-a">授权手机号:<span>{{info.phone}}</span></div>
        <div class="info-item-a">关联经销商:<span>{{info.shopName}}</span> <span class="blue btn" @click="showChangeRecord">变更记录</span></div>
        <div class="info-item-a"></div>
      </div>
      <div class="info-item"></div>
    </div>
    <div style="display: block">
      <div class="header">
        <div  class="header-b">积分明细</div>
        <div v-if="info.phone!=null && info.phone!=''" class="header-btn">
          <el-button style="display: inline" type="primary" @click="changeIntegral">积分调整</el-button>
        </div>
      </div>
      <TableLayout >
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <div >
              <div style="float: left; margin-bottom: 20px;width:50%;">
                  <div class="info-item">
                    <div class="info-item-a">现有积分:<span>{{info.integral || 0}}</span></div>
                    <div class="info-item-a">累计积分:<span>{{info.totalIntegral||0}}</span></div>
                  </div>
              </div>
              <div style="float: right; margin-bottom: 20px;">
                <el-select  v-model="searchForm.type"  placeholder="全部"  clearable @change="search" style="width: 120px;" >
                  <el-option  :key="0" :value="0"  label="获得"  ></el-option>
                  <el-option   :key="1" :value="1" label="扣除"  ></el-option>
                </el-select>
                <el-button @click="search" type="点击刷新"  icon="el-icon-refresh"  style="margin-left: 10px;" ></el-button>
              </div>
            </div>
            <el-table
                v-loading="isWorking.search"
                :data="tableData.list"
                stripe
                border
                @selection-change="handleSelectionChange"
            >
              <el-table-column prop="type"  label="获得/扣除" align="center" min-width="150px">
                <template slot-scope="{row}">
                  {{ row.saleType == 1?'扣除':'获得'}}
                </template>
              </el-table-column>
              <el-table-column prop="num" label="数量" fixed align="center" min-width="100px">  </el-table-column>
              <el-table-column prop="strObjType" label="消费类型" align="center" min-width="100px"></el-table-column>
              <el-table-column prop="orderCode" label="关联订单" align="center" min-width="150px"></el-table-column>
              <el-table-column prop="remark" label="备注" align="center" min-width="200px"></el-table-column>
              <el-table-column prop="createDate" label="变动时间" align="center" min-width="200px"></el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
                @current-change="handlePageChange"
                :pagination="tableData.pagination"
            >
            </pagination>
        </template>
      </TableLayout>
    </div>
    <template  v-slot:footer>
      <el-button @click="visible=false">返回</el-button>
    </template>
    <OperaChangeShopRecordWindow ref="OperaChangeShopRecordWindow"/>
    <OperaChangeIntegralWindow ref="OperaChangeIntegralWindow" @success="successBiz"/>
  </GlobalWindow>
</template>
 
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaChangeShopRecordWindow from '@/components/business/OperaChangeShopRecordWindow'
import OperaChangeIntegralWindow from '@/components/business/OperaChangeIntegralWindow'
import { detail } from '@/api/business/member'
export default {
  name: 'OperaShopGoodsWindow',
  extends: BaseTable,
  components: { GlobalWindow, TableLayout, Pagination, OperaChangeShopRecordWindow,OperaChangeIntegralWindow },
  data () {
    return {
      title: '',
      visible: false,
      tabelHeight: null,
      info: {},
      // 搜索
      searchForm: {
        memberId: '',
        userType: 0,
        type: null
      }
    }
  },
 
  created () {
    this.config({
      module: '用户信息表',
      api: '/business/integral',
      'field.id': 'id',
      'field.main': 'id'
    })
  },
  methods: {
    successBiz(){
      this.handlePageChange()
      this.loadInfo()
      this.$emit('success')
    },
    loadInfo(){
      detail(this.info.id).then(res => {
        this.info =res || this.info
      })
    },
    loadInfo(){
      this.handlePageChange()
      this.$emit('success')
    },
    showChangeRecord () {
      if (this.info) {
        this.$refs.OperaChangeShopRecordWindow.open('客户经销商变更记录', this.info)
      }
    },
    changeIntegral () {
      if (this.info) {
        this.$refs.OperaChangeIntegralWindow.open('客户积分调整', this.info)
      }
    },
    open (title, goods) {
      this.title = title
      this.visible = true
      this.info = goods
      this.searchForm.memberId = goods.id
      this.search()
    },
    handleClick (val) {
    }
  }
}
</script>
<style scoped>
.table-pagination{
  position: fixed !important;
  bottom: 50px;
}
.header-b{
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
}
.header-blue{
  display: inline-block;
  font-size: 12px;
  border: 1px solid #216EEE;
  padding: 2px 10px;
  margin-left: 20px;
  color: #216EEE;
  border-radius: 5px ;
}
.header-btn{
  display: inline-block;
  border: none;
  padding: 2px 10px;
  margin-left: 20px;
}
.info-item{
  display: flex;
  width: 100%;
  margin: 15px;
}
.info-item-a{
  flex: 1;
  font-size: 14px;
 
}
.info-item-a span{
  font-weight: 600;
}
.info-item-a  .btn{
  font-size: 12px !important;
  cursor: pointer !important;
}
</style>