From 64985934b6b7378d1c101313083b456a231c7fd5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 03 十二月 2024 17:36:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
admin/src/components/common/MemberSearch/src/index.vue | 143 +++++++++++++++++++++++------------------------
1 files changed, 70 insertions(+), 73 deletions(-)
diff --git a/admin/src/components/common/MemberSearch/src/index.vue b/admin/src/components/common/MemberSearch/src/index.vue
index f3db2c9..899b602 100644
--- a/admin/src/components/common/MemberSearch/src/index.vue
+++ b/admin/src/components/common/MemberSearch/src/index.vue
@@ -1,23 +1,57 @@
<template>
- <GlobalWindow title="閫夋嫨瀹㈡埛" width="1000px" @close="close" :visible.sync="isShowMemberList">
+ <GlobalWindow title="閫夋嫨瀹㈡埛" width="80%" :withFooter="false" @close="close" :visible.sync="isShowMemberList">
<div>
<div class="df_ac mb20">
<el-input v-model="modalSearchValue" placeholder="璇疯緭鍏ュ鎴峰悕绉�" class="w400" @keyup.enter.native="queryList">
- <!-- <el-button slot="append" icon="el-icon-search" @click="queryList()" /> -->
</el-input>
<el-button class="ml10" type="primary" @click="queryList()">鏌ヨ</el-button>
+ <el-button class="ml10" @click="clear()">閲嶇疆</el-button>
</div>
<el-table ref="table" v-loading="listLoading" :data="list" element-loading-text="Loading" border fit
:header-row-class-name="'table-header'" class="doumee-element-table doumee-element-tableb"
@row-click="rowClick">
-
- <el-table-column align="center" label="瀹㈡埛绫诲瀷" prop="cardName" show-overflow-tooltip min-width="80" />
- <el-table-column align="center" label="瀹㈡埛鍚嶇О" show-overflow-tooltip prop="remainingMoney" min-width="80" />
- <el-table-column align="center" label="鑱旂郴浜�" show-overflow-tooltip prop="remainingGiveMoney" min-width="80" />
- <el-table-column label="鑱旂郴鐢佃瘽" prop="createTime" min-width="100" align="center" />
- <el-table-column label="缁熶竴淇$敤浠g爜" prop="createTime" min-width="120" align="center" />
- <el-table-column label="钀ヤ笟鏈熼檺" prop="createTime" min-width="100" align="center" />
- <el-table-column label="榛樿鍙戠エ绫诲瀷" prop="createTime" min-width="100" align="center" />
+ <el-table-column align="center" label="瀹㈡埛绫诲瀷" show-overflow-tooltip min-width="80">
+ <template slot-scope="{row}">
+ <span v-if="row.type === 0">涓汉</span>
+ <span v-if="row.type === 1">浼佷笟</span>
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="瀹㈡埛鍚嶇О" show-overflow-tooltip prop="name" min-width="80" />
+ <el-table-column align="center" label="鑱旂郴浜�" show-overflow-tooltip prop="memberName" min-width="80" />
+ <el-table-column label="鑱旂郴鐢佃瘽" prop="memberPhone" min-width="100" align="center" />
+ <el-table-column label="缁熶竴淇$敤浠g爜" prop="creditCard" min-width="120" align="center">
+ <template slot-scope="{row}">
+ <div v-if="row.type === 1">
+ <span v-if="row.fpType === 0">澧炲�肩◣鏅�氬彂绁�</span>
+ <span v-else-if="row.fpType === 1">澧炲�肩◣涓撶敤鍙戠エ</span>
+ <span v-else>-</span>
+ </div>
+ <div v-else>-</div>
+ </template>
+ </el-table-column>
+ <el-table-column label="钀ヤ笟鏈熼檺" prop="validity" min-width="100" align="center">
+ <template slot-scope="{row}">
+ <div v-if="row.type === 1">
+ <span>{{row.validity || '-'}}</span>
+ </div>
+ <div v-else>-</div>
+ </template>
+ </el-table-column>
+ <el-table-column label="榛樿鍙戠エ绫诲瀷" min-width="100" align="center">
+ <template slot-scope="{row}">
+ <div v-if="row.type === 1">
+ <span v-if="row.fpType === 0">澧炲�肩◣鏅�氬彂绁�</span>
+ <span v-else-if="row.fpType === 1">澧炲�肩◣涓撶敤鍙戠エ</span>
+ <span v-else>-</span>
+ </div>
+ <div v-else>-</div>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" min-width="100" align="center">
+ <template slot-scope="{row}">
+ <span class="primaryColor cu" @click="selectItem(row)">閫夋嫨</span>
+ </template>
+ </el-table-column>
</el-table>
<Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
</div>
@@ -25,11 +59,8 @@
</template>
<script>
-import { memberList, memberDetailInfo } from '@/api'
+import { fetchList } from '@/api/customer'
import GlobalWindow from '@/components/common/GlobalWindow'
-import dayjs from 'dayjs'
-// import { debounce } from '@/utils/debounce'
-
import Pagination from '@/components/common/Pagination'
export default {
components: {
@@ -40,104 +71,70 @@
isShowChooseBtn: {
type: Boolean,
default: () => true
- },
- type: { // (10: 鍟嗗搧鎶樻墸 20: 璁㈠満鎶樻墸 30: 闂ㄧエ鎶樻墸 40: 濂楅鎶樻墸 50锛氭椿鍔ㄦ姌鎵� 60锛氳绋嬫姌鎵�)
- type: String,
- default: 'default'
}
},
- data() {
+ data () {
return {
- searchValue: '',
isShowMemberList: false,
modalSearchValue: '',
list: [],
- totalCount: 0,
pagination: {
pageSize: 10,
page: 1,
total: 0
},
- listLoading: false,
-
+ listLoading: false
}
},
- created() {
- // (10: 鍟嗗搧鎶樻墸 20: 璁㈠満鎶樻墸 30: 闂ㄧエ鎶樻墸 40: 濂楅鎶樻墸 50锛氭椿鍔ㄦ姌鎵� 60锛氳绋嬫姌鎵�)
- },
methods: {
- clearSearch() {
- this.searchValue = ''
+ open () {
this.modalSearchValue = ''
+ this.filters = {}
+ this.pagination.page = 1
+ this.pagination.pageSize = 10
+ this.isShowMemberList = true
+ this.getList()
},
- handleMemberSelect(item) {
- memberDetailInfo({ param: { memberId: item.id } }).then((res) => {
- if (res.errorCode !== '000000') return
- const obj = res.record || {}
- obj.searchValue = this.searchValue
- this.$emit('select', obj)
- })
- },
- clear() {
- this.searchValue = ''
- setTimeout(() => {
- this.$refs.searchValueRef.focus()
- })
- this.$emit('clear')
- },
- rowClick(item) {
- memberDetailInfo({ param: { memberId: item.id } }).then((res) => {
- if (res.errorCode !== '000000') return
- const obj = res.record || {}
- this.searchValue = obj.nickName
- obj.searchValue = this.modalSearchValue
- if (item.phone) {
- this.searchValue += '-' + item.phone
- }
- if (item.number) {
- this.searchValue += '锛�' + item.number + '锛�'
- }
- this.$emit('select', obj)
- })
- this.isShowMemberList = false
- },
- getList() {
+ getList () {
const { pagination, modalSearchValue } = this
this.listLoading = true
- memberList({ pagination, param: { keyword: modalSearchValue } }).then((res) => {
+ fetchList({
+ capacity: pagination.pageSize,
+ page: pagination.page,
+ model: {
+ name: modalSearchValue
+ }
+ }).then((res) => {
this.listLoading = false
- if (res.errorCode !== '000000') return
- this.list = res.recordList
+ this.list = res.records
this.pagination.total = res.total || 0
- this.totalCount = res.totalCount
}, () => {
this.listLoading = false
})
},
- openModal() {
- this.modalSearchValue = ''
- // this.queryList()
- this.isShowMemberList = true
+ selectItem (row) {
+ this.$emit('select', row)
+ this.isShowMemberList = false
},
- queryList() {
+ queryList () {
this.pagination.page = 1
this.getList()
},
- currentChange(val) {
+ currentChange (val) {
this.pagination.page = val
this.getList()
},
- clear() {
+ clear () {
this.filters = {}
this.pagination.pageSize = 10
this.pagination.page = 1
this.getList()
},
- handleSizeChange(capacity) {
+ handleSizeChange (capacity) {
this.pagination.pageSize = capacity
this.getList()
},
- close() {
+ close () {
this.isShowMemberList = false
}
}
--
Gitblit v1.9.3