|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <div class="app-title">当前会所: <span class="span"></span>商城测试演示会所</span> </div>
|
|
|
|
|
|
+ <div class="app-title">当前会所:<span class="span">商城测试演示会所</span> </div>
|
|
<el-table
|
|
<el-table
|
|
v-loading="listLoading"
|
|
v-loading="listLoading"
|
|
:data="list"
|
|
:data="list"
|
|
@@ -18,74 +18,84 @@
|
|
<el-table-column label="账号" width="150" align="center" prop="account" />
|
|
<el-table-column label="账号" width="150" align="center" prop="account" />
|
|
<el-table-column label="姓名" width="150" align="center" prop="linkName" />
|
|
<el-table-column label="姓名" width="150" align="center" prop="linkName" />
|
|
<el-table-column label="手机号码" width="110" align="center" prop="mobile" />
|
|
<el-table-column label="手机号码" width="110" align="center" prop="mobile" />
|
|
- <el-table-column label="邀请码" width="130" align="center" prop="code">
|
|
|
|
|
|
+ <el-table-column label="邀请码" width="130" align="center" prop="invitationCode">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <span v-if="row.codeType" style="text-align: center;float:left">{{ row.code }}</span>
|
|
|
|
- <span v-if="row.codeType" :style="{color: rexpStautsColor(row.status)}">{{ rexpStautsText(row.status) }}</span>
|
|
|
|
- <el-tag v-else type="info">—— ——</el-tag>
|
|
|
|
|
|
+ <span v-if="row.invitationCode" style="text-align: center;float:left">{{ row.invitationCode }}</span>
|
|
|
|
+ <span v-if="row.invitationCode" :style="{color: rexpStautsColor(row.effectiveFlag)}">{{ rexpStautsText(row.effectiveFlag) }}</span>
|
|
|
|
+ <span v-else type="info">----</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column class-name="status-col" label="状态" width="100" align="center" prop="status">
|
|
<el-table-column class-name="status-col" label="状态" width="100" align="center" prop="status">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <i v-if="row.status === 2" class="el-icon-success" style="color:#67C23A;font-size: 20px;" />
|
|
|
|
|
|
+ <i v-if="row.effectiveFlag === 2" class="el-icon-success" style="color:#67C23A;font-size: 20px;" />
|
|
<!-- <i v-else class="el-icon-error" style="color: #E6A23C;font-size: 20px;" /> -->
|
|
<!-- <i v-else class="el-icon-error" style="color: #E6A23C;font-size: 20px;" /> -->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column align="center" label="微信昵称" width="110" prop="nickName" />
|
|
|
|
- <el-table-column align="center" label="OpenID" width="250" prop="openid" />
|
|
|
|
- <el-table-column align="center" label="添加时间" width="160" prop="addTime" />
|
|
|
|
- <el-table-column align="center" label="绑定时间" width="160" prop="bindTime" />
|
|
|
|
|
|
+ <el-table-column align="center" label="微信昵称" width="110" prop="nickName">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <span v-if="row.nickName">{{ row.nickName }}</span>
|
|
|
|
+ <span v-else>----</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="OpenID" width="250" prop="openid">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <span v-if="row.openid">{{ row.openid }}</span>
|
|
|
|
+ <span v-else>----</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="添加时间" width="160" prop="addTime">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <span v-if="row.addTime">{{ row.addTime }}</span>
|
|
|
|
+ <span v-else>----</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="绑定时间" width="160" prop="bindTime">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <span v-if="row.bindTime">{{ row.bindTime }}</span>
|
|
|
|
+ <span v-else>----</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
- <el-button v-if="row.codeType" type="primary" size="mini" @click="handleEdit(row)">编辑</el-button>
|
|
|
|
- <el-button v-if="row.codeType" type="primary" size="mini" @click="handleUntying(row)">解绑</el-button>
|
|
|
|
- <el-button v-else type="primary" size="small" @click="handleGenerateCode(row)">生成邀请码</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="handleEdit(row)">编辑</el-button>
|
|
|
|
+ <el-button v-if="row.status === '2'" type="primary" size="mini" @click="handleUntying(row)">解绑</el-button>
|
|
|
|
+ <el-button v-else type="primary" size="small" @click="handleGenerateCode(row)">{{ row.invitationCode ? '更新邀请码' : '生成邀请码' }}</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
- <pagination
|
|
|
|
- v-show="total>0"
|
|
|
|
- :total="total"
|
|
|
|
- :page-size = "10"
|
|
|
|
- :page.sync="listQuery.page"
|
|
|
|
- :limit.sync="listQuery.limit"
|
|
|
|
- @pagination="fetchData"
|
|
|
|
- />
|
|
|
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="initOperatorListData" />
|
|
|
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="40%">
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="40%">
|
|
- <el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:24%;">
|
|
|
|
- <el-form-item label="姓名" prop="classifyName">
|
|
|
|
- <el-input v-model="temp.classifyName" />
|
|
|
|
|
|
+ <el-form ref="dataForm" :rules="rules" :model="editTemp" label-position="left" label-width="70px" style="width: 400px; margin-left:24%;">
|
|
|
|
+ <el-form-item label="姓名" prop="linkName">
|
|
|
|
+ <el-input v-model="editTemp.linkName" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="手机号" prop="telephone">
|
|
|
|
- <el-input v-model="temp.telephone" />
|
|
|
|
|
|
+ <el-form-item label="手机号" prop="mobile">
|
|
|
|
+ <el-input v-model="editTemp.mobile" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
- <el-button type="primary" @click="updateData()">确定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" :loading="loadingbut" @click="updateData()">{{ loadingbuttext }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogVisible" width="20%">
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogVisible" width="20%">
|
|
<span>{{ dialogVisibleText }}</span>
|
|
<span>{{ dialogVisibleText }}</span>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
- <el-button type="primary" @click="handleConfirm()">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" :loading="loadingbut" @click="handleConfirm()">{{ loadingbuttext }}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {
|
|
|
|
- getOperatorList, //初始化
|
|
|
|
- createOperatorCode, //生成邀请码
|
|
|
|
- updateOperatorCode, //更新邀请码
|
|
|
|
- unbindOperator, //解绑运营
|
|
|
|
- preservOperator, //保存
|
|
|
|
- createOperator, //保存并生成
|
|
|
|
- queryOperatorList //条件查询
|
|
|
|
|
|
+import {
|
|
|
|
+ getOperatorList,
|
|
|
|
+ updateOperatorCode,
|
|
|
|
+ unbindOperator,
|
|
|
|
+ preservOperator
|
|
} from '@/api/club'
|
|
} from '@/api/club'
|
|
import Pagination from '@/components/Pagination'
|
|
import Pagination from '@/components/Pagination'
|
|
|
|
|
|
@@ -102,8 +112,6 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- clubID:this.$route.query.clubID,
|
|
|
|
- userID:this.$route.query.userID,
|
|
|
|
list: null,
|
|
list: null,
|
|
listLoading: true,
|
|
listLoading: true,
|
|
total: 100,
|
|
total: 100,
|
|
@@ -111,27 +119,28 @@ export default {
|
|
dialogVisibleText: '',
|
|
dialogVisibleText: '',
|
|
handleConfirmType: '',
|
|
handleConfirmType: '',
|
|
listQuery: {
|
|
listQuery: {
|
|
- page: 1,
|
|
|
|
- limit: 10,
|
|
|
|
- importance: undefined,
|
|
|
|
- title: undefined,
|
|
|
|
- type: undefined,
|
|
|
|
- sort: '+id'
|
|
|
|
|
|
+ index: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ clubID: this.$route.query.clubID,
|
|
|
|
+ userID: this.$route.query.userID,
|
|
|
|
+ userOrganizeID: this.organizeID
|
|
},
|
|
},
|
|
- temp: {
|
|
|
|
- id: 1,
|
|
|
|
- organizeID: 1,
|
|
|
|
- classifyName: '',
|
|
|
|
- telephone: ''
|
|
|
|
|
|
+ editTemp: {
|
|
|
|
+ userOrganizeID: this.organizeID,
|
|
|
|
+ linkName: '',
|
|
|
|
+ mobile: ''
|
|
},
|
|
},
|
|
|
|
+ codeRemp: {},
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
dialogStatus: '',
|
|
dialogStatus: '',
|
|
|
|
+ loadingbut: false,
|
|
|
|
+ loadingbuttext: '确定',
|
|
textMap: {
|
|
textMap: {
|
|
- edit: '编辑',
|
|
|
|
|
|
+ edit: '编辑运营人员',
|
|
update: '提示',
|
|
update: '提示',
|
|
untying: '解绑',
|
|
untying: '解绑',
|
|
generate: '生成邀请码',
|
|
generate: '生成邀请码',
|
|
- create: 'Create'
|
|
|
|
|
|
+ updateCode: '更新邀请码'
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
|
classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
|
@@ -140,85 +149,121 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
-
|
|
|
|
- this.fetchData()
|
|
|
|
|
|
+ this.initOperatorListData()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- fetchData() {
|
|
|
|
|
|
+ initOperatorListData() {
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
- let params = { userOrganizeID: this.organizeID,clubID:this.clubID,userID:this.userID,index:1,pageSize:10}
|
|
|
|
- getOperatorList(params).then(response => {
|
|
|
|
- if(response.code === '1'){
|
|
|
|
- let data = response.data
|
|
|
|
- this.list = data.results
|
|
|
|
- this.listLoading = false
|
|
|
|
- this.total = data.totalRecord
|
|
|
|
- }else{
|
|
|
|
- this.$message.error(response.msg);
|
|
|
|
- }
|
|
|
|
|
|
+ getOperatorList(this.listQuery).then(response => {
|
|
|
|
+ const operatorListPage = response.data
|
|
|
|
+ this.list = operatorListPage.results
|
|
|
|
+ this.total = operatorListPage.totalRecord
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
- }).catch(() => {
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- this.listLoading = false
|
|
|
|
- },
|
|
|
|
- handleEdit(row) {
|
|
|
|
- this.temp = Object.assign({}, row)
|
|
|
|
- console.log(this.temp)
|
|
|
|
- this.dialogStatus = 'edit'
|
|
|
|
- this.dialogFormVisible = true
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs['dataForm'].clearValidate()
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleUntying(row) {
|
|
|
|
- this.dialogVisible = true
|
|
|
|
- this.dialogStatus = 'untying'
|
|
|
|
- this.dialogVisibleText = '确定解绑该运营人员吗?'
|
|
|
|
- this.handleConfirmType = 'untying'
|
|
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ console.log(val)
|
|
},
|
|
},
|
|
handleGenerateCode(row) {
|
|
handleGenerateCode(row) {
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
- this.dialogStatus = 'generate'
|
|
|
|
- this.dialogVisibleText = '确定生成邀请码,并短信提醒该人员?'
|
|
|
|
|
|
+ if (row.invitationCode) {
|
|
|
|
+ this.dialogStatus = 'updateCode'
|
|
|
|
+ this.dialogVisibleText = '确定更新邀请码,并短信提醒该人员?'
|
|
|
|
+ } else {
|
|
|
|
+ this.dialogStatus = 'generate'
|
|
|
|
+ this.dialogVisibleText = '确定生成邀请码,并短信提醒该人员?'
|
|
|
|
+ }
|
|
this.handleConfirmType = 'generate'
|
|
this.handleConfirmType = 'generate'
|
|
|
|
+ this.codeRemp = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ clubID: row.clubID,
|
|
|
|
+ userID: row.userID,
|
|
|
|
+ userOrganizeID: this.organizeID
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleConfirm() {
|
|
handleConfirm() {
|
|
switch (this.handleConfirmType) {
|
|
switch (this.handleConfirmType) {
|
|
case 'untying':
|
|
case 'untying':
|
|
- this.untyingRequst()
|
|
|
|
|
|
+ this.unbindOperators()
|
|
break
|
|
break
|
|
case 'generate':
|
|
case 'generate':
|
|
this.generateRequst()
|
|
this.generateRequst()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- untyingRequst() {
|
|
|
|
- this.dialogVisible = false
|
|
|
|
- this.$message({
|
|
|
|
- message: '解绑成功',
|
|
|
|
- type: 'success',
|
|
|
|
- center: true
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
generateRequst() {
|
|
generateRequst() {
|
|
- this.dialogVisible = false
|
|
|
|
- this.$message({
|
|
|
|
- message: '邀请码生成成功',
|
|
|
|
- type: 'success',
|
|
|
|
- center: true
|
|
|
|
- });
|
|
|
|
|
|
+ const params = this.codeRemp
|
|
|
|
+ this.loadingbut = true
|
|
|
|
+ this.loadingbuttext = '请稍候...'
|
|
|
|
+ updateOperatorCode(params).then(response => {
|
|
|
|
+ this.$message({ message: '邀请码生成成功', type: 'success', center: true })
|
|
|
|
+ this.initOperatorListData()
|
|
|
|
+ this.loadingbut = false
|
|
|
|
+ this.loadingbuttext = '确定'
|
|
|
|
+ this.dialogVisible = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleUntying(row) {
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
+ this.dialogStatus = 'untying'
|
|
|
|
+ this.dialogVisibleText = '确定解绑该运营人员吗?'
|
|
|
|
+ this.handleConfirmType = 'untying'
|
|
|
|
+ this.editTemp = { userOrganizeID: this.organizeID, id: row.id, clubID: row.clubID, userID: row.userID }
|
|
|
|
+ },
|
|
|
|
+ unbindOperators() {
|
|
|
|
+ const params = this.editTemp
|
|
|
|
+ this.loadingbut = true
|
|
|
|
+ this.loadingbuttext = '解绑中...'
|
|
|
|
+ unbindOperator(params).then(response => {
|
|
|
|
+ this.$message({ message: '解绑成功', type: 'success', center: true })
|
|
|
|
+ this.initOperatorListData()
|
|
|
|
+ this.dialogVisible = false
|
|
|
|
+ this.loadingbut = false
|
|
|
|
+ this.loadingbuttext = '确定'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleEdit(row) {
|
|
|
|
+ const rowTemp = { userOrganizeID: this.organizeID, configFlag: 1, id: row.id, clubID: row.clubID, userID: row.userID, linkName: row.linkName, mobile: row.mobile }
|
|
|
|
+ this.editTemp = Object.assign({}, rowTemp)
|
|
|
|
+ console.log(this.editTemp)
|
|
|
|
+ this.dialogStatus = 'edit'
|
|
|
|
+ this.dialogFormVisible = true
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ updateData() {
|
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const params = Object.assign({}, this.editTemp)
|
|
|
|
+ this.loadingbut = true
|
|
|
|
+ this.loadingbuttext = '保存中...'
|
|
|
|
+ preservOperator(params).then(response => {
|
|
|
|
+ if (response.code === '1') {
|
|
|
|
+ this.$message({ message: '保存成功', type: 'success', center: true })
|
|
|
|
+ this.initOperatorListData()
|
|
|
|
+ this.dialogFormVisible = false
|
|
|
|
+ this.loadingbut = false
|
|
|
|
+ this.loadingbuttext = '确定'
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(response.msg)
|
|
|
|
+ this.loadingbut = false
|
|
|
|
+ this.loadingbuttext = '确定'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
rexpStautsText(status) {
|
|
rexpStautsText(status) {
|
|
let text = ''
|
|
let text = ''
|
|
switch (status) {
|
|
switch (status) {
|
|
- case 1:
|
|
|
|
|
|
+ case '1':
|
|
text = '有效'
|
|
text = '有效'
|
|
break
|
|
break
|
|
- case 2:
|
|
|
|
|
|
+ case '2':
|
|
text = '已使用'
|
|
text = '已使用'
|
|
break
|
|
break
|
|
- case 3:
|
|
|
|
|
|
+ case '3':
|
|
text = '已失效'
|
|
text = '已失效'
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -227,33 +272,17 @@ export default {
|
|
rexpStautsColor(status) {
|
|
rexpStautsColor(status) {
|
|
let textColor = ''
|
|
let textColor = ''
|
|
switch (status) {
|
|
switch (status) {
|
|
- case 1:
|
|
|
|
|
|
+ case '1':
|
|
textColor = '#E6A441'
|
|
textColor = '#E6A441'
|
|
break
|
|
break
|
|
- case 2:
|
|
|
|
|
|
+ case '2':
|
|
textColor = '#417DE6'
|
|
textColor = '#417DE6'
|
|
break
|
|
break
|
|
- case 3:
|
|
|
|
|
|
+ case '3':
|
|
textColor = '#C5C5C5'
|
|
textColor = '#C5C5C5'
|
|
break
|
|
break
|
|
}
|
|
}
|
|
return textColor
|
|
return textColor
|
|
- },
|
|
|
|
- updateData() {
|
|
|
|
- this.$refs['dataForm'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- const tempData = Object.assign({}, this.temp)
|
|
|
|
- this.dialogFormVisible = false
|
|
|
|
- this.$message({
|
|
|
|
- message: '保存成功',
|
|
|
|
- type: 'success',
|
|
|
|
- center: true
|
|
|
|
- });
|
|
|
|
- updateCategory(tempData).then(() => {
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -264,8 +293,7 @@ export default {
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
color: #999999;
|
|
color: #999999;
|
|
- margin-bottom: 10px;
|
|
|
|
-
|
|
|
|
|
|
+ margin-bottom:10px;
|
|
}
|
|
}
|
|
.app-title .span{
|
|
.app-title .span{
|
|
color: #417DE6;
|
|
color: #417DE6;
|