rk
2 天以前 11c5ab8d97809bdeddb60b22a4fe161a67aa3b05
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<template>
  <GlobalWindow
      :title="title"
      width="100%"
      :visible.sync="visible"
  >
    <div style="display: block;">
      <div class="platgroup_tabs">
        <div class="tab" :class="{ active: activeGroup === item.id }" @click="groupClick(item)"
             v-for="(item, i) in groupList" :key="i">
          {{ item.name }}
        </div>
      </div>
    </div>
    <template v-if="activeGroup ==0">
      <div style="display: block;">
        <div class="header">
          <div  class="header-b">基本信息</div>
          <div v-if="info.status !=1" class="header-green">正常</div>
          <div v-if="info.status ==1" class="header-red">禁用</div>
        </div>
        <div class="info-item">
          <div class="info-item-a">经销商名称:<span>{{info.name || ''}}</span><span class="blue header-blue">{{ info.saleType == 1?'自由采购':'平台铺货'}}</span></div>
          <div class="info-item-a">门店ID:<span>{{info.code || ''}}</span></div>
          <div class="info-item-a">登录账号:<span>{{info.username || ''}}</span></div>
        </div>
        <div class="info-item">
          <div class="info-item-a">所属地区:<span>{{info.bigAreaName || ''}}</span></div>
          <div class="info-item-a">省市区:<span v-if="info.areas">{{(info.areas.provinceName||'') + (info.areas.cityName||'') + (info.areas.name||'')}}</span></div>
          <div class="info-item-a">详细地址:<span>{{info.addr || ''}}</span></div>
        </div>
        <div class="info-item">
          <div class="info-item-a">联系人:<span>{{info.realname || ''}}</span></div>
          <div class="info-item-a">手机号:<span>{{info.phone || ''}}</span></div>
          <div class="info-item-a">创建时间:<span>{{info.createDate || ''}}</span></div>
        </div>
        <div class="info-item">
          <div class="info-item-a">定位信息:<span>经度:{{info.longitude  || '-'}} 维度:{{info.latitude|| '-'}}</span></div>
          <div class="info-item-a">营业时间:<span>{{info.startTime || ''}}</span></div>
          <div class="info-item-a"></div>
        </div>
        <div class="info-item">
          <div class="info-item-a">门头图:
            <div> <el-image v-if="info.imgurlfull" style="margin-left: 100px; width: 100px; height: 100px; border-radius: 2px;" :src="info.imgurlfull" :preview-src-list="[info.imgurlfull]"></el-image></div>
          </div>
          <div class="info-item-a"></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>
        <div class="info-item">
          <div class="info-item-a">法人姓名:<span>{{info.legalPersonName || ''}}</span></div>
          <div class="info-item-a">联系电话:<span>{{info.legalPersonPhone || ''}}</span></div>
          <div class="info-item-a"></div>
        </div>
        <div class="info-item">
          <div class="info-item-a"> 身份证:
            <div style="display: inline-block;width: 300px;margin-left: 100px;">
              <el-image v-if="info.idcardImg" style="width: 100px; height: 100px; border-radius: 2px;display: inline-block;"
                        :src="info.imgFullUrl +info.idcardImg"
                        :preview-src-list="[info.imgFullUrl +info.idcardImg]"></el-image>
              <el-image v-if="info.idcardImgBack" style="margin-left:10px;width: 100px; height: 100px; border-radius: 2px;display: inline-block;"
                        :src="info.imgFullUrl +info.idcardImgBack"
                        :preview-src-list="[info.imgFullUrl +info.idcardImgBack]"></el-image>
            </div>
          </div>
          <div class="info-item-a">营业执照:
            <div  style="display: inline-block;width: 300px;margin-left: 100px;">
              <el-image v-if="info.businessImg" style="width: 100px; height: 100px; border-radius: 2px;"
                        :src="info.imgFullUrl +info.businessImg"
                        :preview-src-list="[info.imgFullUrl +info.businessImg]"></el-image>
            </div>
          </div>
          <div class="info-item-a"></div>
        </div>
        <div class="info-item"></div>
      </div>
      <div style="display: block;margin-bottom: 50px;">
        <div class="header">
          <div  class="header-b">销售模式变更记录</div>
        </div>
        <TableLayout >
          <!-- 表格和分页 -->
          <template v-slot:table-wrap>
            <el-table
                v-loading="isWorking.search0"
                :data="tableData0.list"
                stripe
                border
            >
              <el-table-column prop="type" label="变更类型" fixed align="center" min-width="150px">销售模式</el-table-column>
              <el-table-column prop="beforeInfo" label="变更前" fixed align="center" min-width="150px">  </el-table-column>
              <el-table-column prop="afterInfo" label="变更后" fixed align="center" min-width="150px">  </el-table-column>
              <el-table-column prop="remark" label="备注" align="center" min-width="300px"></el-table-column>
              <el-table-column prop="createName" label="操作人" align="center" min-width="100px"></el-table-column>
              <el-table-column prop="createDate" label="操作时间" align="center" min-width="150px"></el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange0"
                @current-change="handlePageChange0"
                :pagination="tableData0.pagination"
            >
            </pagination>
          </template>
        </TableLayout>
      </div>
    </template>
    <template v-else-if="activeGroup == 2">
      <div style="display: block;margin-bottom: 50px;">
        <div class="header">
          <div  class="header-b">积分明细</div>
          <div  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="searchForm2.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="handlePageChange2(1)" type="点击刷新"  icon="el-icon-refresh"  style="margin-left: 10px;" ></el-button>
              </div>
            </div>
            <el-table
                v-loading="isWorking.search2"
                :data="tableData2.list"
                stripe
                border
            >
              <el-table-column prop="type"  label="获得/扣除" align="center" min-width="150px">
                <template slot-scope="{row}">
                  <span v-if="row.type==0" class="green">获得</span>
                  <span v-else class="red">扣除</span>
                </template>
              </el-table-column>
              <el-table-column prop="num" label="数量" fixed align="center" min-width="100px">  </el-table-column>
              <el-table-column prop="totalNum" 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="content" label="来源" align="center" min-width="150px" show-overflow-tooltip></el-table-column>
              <el-table-column prop="remark" label="备注" align="center" min-width="200px"></el-table-column>
              <el-table-column prop="orderCode" label="关联订单" align="center" min-width="150px"></el-table-column>
              <el-table-column prop="createDate" label="变动时间" align="center" min-width="200px"></el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange2"
                @current-change="handlePageChange2"
                :pagination="tableData2.pagination"
            >
            </pagination>
          </template>
        </TableLayout>
      </div>
    </template>
    <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 { shopDetail as detail } from '@/api/business/shop'
import { fetchList as actionList } from '@/api/business/userAction'
import { fetchList as integralList } from '@/api/business/integral'
export default {
  name: 'OperaShopInfoWindow',
  extends: BaseTable,
  components: { GlobalWindow, TableLayout, Pagination, OperaChangeShopRecordWindow, OperaChangeIntegralWindow },
  data () {
    return {
      title: '',
      visible: false,
      tabelHeight: null,
      activeGroup: -1,
      groupList: [{ id: 0, name: '基本信息' }, { id: 1, name: '销售信息' }, { id: 2, name: '积分信息' }],
      info: {},
      // 搜索
      searchForm2: {
        memberId: '',
        userType: 1,
        type: null
      },
      isWorking: {
        search0: false,
        search1: false,
        search2: false
      },
      tableData0: {
        // 已选中的数据
        selectedRows: [],
        // 排序的字段
        sorts: [],
        // 当前页数据
        list: [],
        // 分页
        pagination: {
          pageIndex: 1,
          pageSize: 10,
          total: 0
        }
      },
      tableData2: {
        // 已选中的数据
        selectedRows: [],
        // 排序的字段
        sorts: [],
        // 当前页数据
        list: [],
        // 分页
        pagination: {
          pageIndex: 1,
          pageSize: 10,
          total: 0
        }
      }
    }
  },
 
  created () {
    this.config({
      module: '用户信息表',
      api: '/business/integral',
      'field.id': 'id',
      'field.main': 'id'
    })
  },
  methods: {
    groupClick(item){
      this.activeGroup = item.id
    },
    successBiz () {
      this.handlePageChange2(1)
      this.loadInfo()
      this.$emit('success')
    },
    loadInfo () {
      detail(this.info.id).then(res => {
        this.info = res || this.info
      })
    },
    showChangeRecord () {
      if (this.info) {
        this.$refs.OperaChangeShopRecordWindow.open('客户经销商变更记录', this.info)
      }
    },
    changeIntegral () {
      if (this.info) {
        this.$refs.OperaChangeIntegralWindow.open('经销商积分调整', this.info, 1)
      }
    },
    open (title, info) {
      this.title = title
      this.visible = true
      this.info = info
      this.activeGroup = 0
      this.searchForm2.memberId = info.id
      if (this.info.imgurl) {
        this.info.imgurlfull = this.info.imgFullUrl + this.info.imgurl
      }
      this.handlePageChange0(1)
      this.handlePageChange2(1)
    },
    handleSizeChange0 (pageSize) {
      this.tableData0.pagination.pageSize = pageSize
      this.search0()
    },
    // 页码变更处理
    handlePageChange0 (pageIndex) {
      this.tableData0.pagination.pageIndex = pageIndex || this.tableData0.pagination.pageIndex
      this.isWorking.search0 = true
      actionList({
        page: this.tableData0.pagination.pageIndex,
        capacity: this.tableData0.pagination.pageSize,
        model: { type: 1, memberId: this.info.id }, // 销售模式变更
        sorts: this.tableData0.sorts
      })
        .then(data => {
          this.tableData0.list = data.records
          this.tableData0.pagination.total = data.total
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking.search0 = false
        })
    },
    handleSizeChange2 (pageSize) {
      this.tableData0.pagination.pageSize = pageSize
      this.search0()
    },
    // 页码变更处理
    handlePageChange2 (pageIndex) {
      this.tableData2.pagination.pageIndex = pageIndex || this.tableData2.pagination.pageIndex
      this.isWorking.search2 = true
      integralList({
        page: this.tableData0.pagination.pageIndex,
        capacity: this.tableData0.pagination.pageSize,
        model: this.searchForm2, // 销售模式变更
        sorts: this.tableData2.sorts
      })
        .then(data => {
          this.tableData2.list = data.records
          this.tableData2.pagination.total = data.total
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking.search2 = false
        })
    }
  }
}
</script>
<style lang="scss"  scoped>
.platgroup_tabs {
  flex: 1;
  display: flex;
  border-bottom: 1px solid #dfe2e8;
  margin-bottom: 30px;
  .tab {
    color: #666666;
    margin-right: 40px;
    cursor: pointer;
    padding-bottom: 10px;
    border-bottom: 2px solid #fff;
  }
 
  .active {
    font-weight: 500;
    font-size: 15px;
    color: #216EEE;
    border-bottom: 2px solid #216EEE;
  }
}
.table-pagination{
  position: fixed !important;
  bottom: 50px;
}
.header-b{
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
}
.header-green{
  display: inline-block;
  font-size: 12px;
  border: 1px solid green;
  padding: 2px 10px;
  margin-left: 20px;
  color: green;
  border-radius: 5px ;
}
.header-red{
  display: inline-block;
  font-size: 12px;
  border: 1px solid red;
  padding: 2px 10px;
  margin-left: 20px;
  color: red;
  border-radius: 5px ;
}
.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>