|
@@ -1,30 +1,40 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<div class="app-header-search">
|
|
|
- <el-form :inline="true" :model="form" class="demo-form-inline">
|
|
|
+ <el-form :inline="true" ref="searchForm" :model="searchForm" class="demo-form-inline">
|
|
|
<el-form-item label="会所名称:">
|
|
|
- <el-input v-model="form.classifyName" placeholder="请输入会所名称" maxlength="50" style="width:200px" />
|
|
|
+ <el-input v-model="searchForm.name" placeholder="请输入会所名称" maxlength="50" style="width:200px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联系人:">
|
|
|
- <el-input v-model="form.contacts" placeholder="请输入联系人姓名" maxlength="10" style="width:150px" />
|
|
|
+ <el-input v-model="searchForm.linkName" placeholder="请输入联系人姓名" maxlength="10" style="width:150px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机号:">
|
|
|
- <el-input v-model="form.telephone" placeholder="请输入手机号" maxlength="11" style="width:130px" />
|
|
|
+ <el-input v-model="searchForm.mobile" placeholder="请输入手机号" maxlength="11" style="width:130px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上线状态:">
|
|
|
- <el-select v-model="form.status" placeholder="请选择" style="width:100px">
|
|
|
- <el-option label="已上线" value="shanghai" />
|
|
|
- <el-option label="已下线" value="beijing" />
|
|
|
+ <el-select v-model="searchForm.clubStatus" placeholder="请选择" style="width:100px">
|
|
|
+ <el-option label="已上线" value="90" />
|
|
|
+ <el-option label="已下线" value="91" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="创建时间:">
|
|
|
<el-date-picker
|
|
|
- v-model="searchTimeVal"
|
|
|
- type="daterange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- />
|
|
|
+ v-model="startTime"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ 至
|
|
|
+ <el-date-picker
|
|
|
+ v-model="endTime"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="success" @click="onSubmit">搜索</el-button>
|
|
@@ -50,49 +60,55 @@
|
|
|
{{ scope.$index+1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="账号" width="150" align="center" prop="classifyNum" />
|
|
|
- <el-table-column label="会所名称" width="150" align="center" prop="classifyName" />
|
|
|
- <el-table-column label="联系人" width="80" align="center" prop="classifyPeo" />
|
|
|
- <el-table-column label="手机号" width="110" align="center" prop="telephone" />
|
|
|
+ <el-table-column label="账号" width="150" align="center" prop="account" />
|
|
|
+ <el-table-column label="会所名称" width="150" align="center" prop="name" />
|
|
|
+ <el-table-column label="联系人" width="80" align="center" prop="linkMan" />
|
|
|
+ <el-table-column label="手机号" width="110" align="center" prop="bindMobile" />
|
|
|
<el-table-column class-name="status-col" label="上线状态" width="150" align="center" prop="status">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-tag>
|
|
|
- {{ row.status === 1 ? '已下线' : '已上线' }}
|
|
|
+ {{ row.clubStatus === '91' ? '已下线' : '已上线' }}
|
|
|
</el-tag>
|
|
|
- <el-button v-if="row.status === 1" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
|
|
|
+ <el-button v-if="row.clubStatus === '91'" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
|
|
|
<el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="会所地址" width="350" prop="address" />
|
|
|
- <el-table-column align="center" label="创建时间" width="180" prop="createTime" />
|
|
|
+ <el-table-column align="center" label="创建时间" width="180" prop="registerTime" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="{row}">
|
|
|
<router-link :to="'/club/form/'">
|
|
|
<el-button type="primary" size="small">编辑</el-button>
|
|
|
</router-link>
|
|
|
- <router-link :to="'/club/operateList/'">
|
|
|
+ <router-link :to="{path:'/club/operateList',query:{clubID:row.clubID,userID:row.userID}}">
|
|
|
<el-button type="primary" size="small">查看运营人员</el-button>
|
|
|
</router-link>
|
|
|
- <el-button type="primary" size="small" @click="handleEdit(row.id)">添加运营人员</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleEdit(row)">添加运营人员</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
|
|
|
-
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page-size = "10"
|
|
|
+ :page.sync="listQuery.page"
|
|
|
+ :limit.sync="listQuery.limit"
|
|
|
+ @pagination="fetchData"
|
|
|
+ />
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
|
|
<el-form ref="dataForm" :rules="rules" :model="addPeople" label-position="left" label-width="70px" style="width: 400px; margin-left:24%;">
|
|
|
- <el-form-item label="姓名" prop="classifyName">
|
|
|
- <el-input v-model="addPeople.classifyName" />
|
|
|
+ <el-form-item label="姓名" prop="linkName">
|
|
|
+ <el-input v-model="addPeople.linkName" maxlength="11"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号" prop="telephone">
|
|
|
- <el-input v-model="addPeople.telephone" />
|
|
|
+ <el-form-item label="手机号" prop="mobile">
|
|
|
+ <el-input v-model="addPeople.mobile" maxlength="11"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="createOperator()">保存</el-button>
|
|
|
- <el-button type="primary" @click="preservOperator()">保存生成邀请码</el-button>
|
|
|
+ <el-button type="primary" @click="handleCreateOperator()">保存</el-button>
|
|
|
+ <el-button type="primary" @click="handlePreservOperator()">保存生成邀请码</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -131,8 +147,7 @@ export default {
|
|
|
return {
|
|
|
list: null,
|
|
|
listLoading: true,
|
|
|
- searchTimeVal: '',
|
|
|
- total: 100,
|
|
|
+ total: 0,
|
|
|
listQuery: {
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
@@ -141,22 +156,19 @@ export default {
|
|
|
type: undefined,
|
|
|
sort: '+id'
|
|
|
},
|
|
|
- form: {
|
|
|
- classifyName: '',
|
|
|
- telephone: '',
|
|
|
- contacts: '',
|
|
|
- businessNum: '',
|
|
|
- address: '',
|
|
|
- radio: 1,
|
|
|
- status: '请选择',
|
|
|
- imageUrl: '',
|
|
|
- doorwayImageUrl: ''
|
|
|
+ searchForm: {
|
|
|
+ name: '',
|
|
|
+ linkName: '',
|
|
|
+ mobile: '',
|
|
|
+ clubStatus: ''
|
|
|
},
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
addPeople: {
|
|
|
- classifyName: '',
|
|
|
- telephone: ''
|
|
|
+ linkName: '',
|
|
|
+ mobile: ''
|
|
|
},
|
|
|
- updateTatusId: '',
|
|
|
+ updateTemp:{},
|
|
|
updateTatusType: '',
|
|
|
dialogVisible: false,
|
|
|
dialogVisibleText: '',
|
|
@@ -179,55 +191,36 @@ export default {
|
|
|
methods: {
|
|
|
fetchData() {
|
|
|
this.listLoading = true
|
|
|
- let params = {
|
|
|
- userOrganizeID:this.userOrganizeID
|
|
|
- }
|
|
|
+ let params = {userOrganizeID: this.organizeID,index:1,pageSize:10}
|
|
|
getClubList(params).then(response => {
|
|
|
- this.list = response.data.items
|
|
|
- this.listLoading = false
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}).catch(() => {
|
|
|
// 封装静态数据
|
|
|
- this.list = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- organizeID: 1,
|
|
|
- classifyName: '商城测试演示会所',
|
|
|
- classifyNum: '2020010120201110',
|
|
|
- classifyPeo: '吴小研',
|
|
|
- telephone: 13888888888,
|
|
|
- address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
|
- createTime: '2020-01-01:20:30:56',
|
|
|
- status: 1
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- organizeID: 1,
|
|
|
- classifyName: '商城测试演示会所',
|
|
|
- classifyNum: '2020010120201110',
|
|
|
- classifyPeo: '吴小研',
|
|
|
- telephone: 13888888888,
|
|
|
- address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
|
- createTime: '2020-01-01:20:30:56',
|
|
|
- status: 1
|
|
|
- }
|
|
|
- ]
|
|
|
})
|
|
|
this.listLoading = false
|
|
|
},
|
|
|
- handleEdit(row) {
|
|
|
- this.addPeople = Object.assign({}, { id: row })
|
|
|
+ handleEdit(row) {//添加运营
|
|
|
+ console.log(row)
|
|
|
this.dialogStatus = 'update'
|
|
|
this.dialogFormVisible = true
|
|
|
+ this.addPeople = Object.assign({}, {clubID: row.clubID,userID: row.userID})
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs['dataForm'].clearValidate()
|
|
|
})
|
|
|
},
|
|
|
- createOperator() {
|
|
|
+ handleCreateOperator() {//保存
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const addPeopleData = Object.assign({}, this.addPeople)
|
|
|
- console.log(addPeopleData)
|
|
|
- createOperator(addPeopleData).then(() => {
|
|
|
+ let Formobj = {userOrganizeID: this.organizeID,configFlag:1}
|
|
|
+ const params = Object.assign(Formobj, this.addPeople)
|
|
|
+ createOperator(params).then(response => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$message({
|
|
|
message: '保存成功',
|
|
@@ -238,12 +231,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- preservOperator() {
|
|
|
+ handlePreservOperator() {//保存并生成邀请码
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- const addPeopleData = Object.assign({}, this.addPeople)
|
|
|
- console.log(addPeopleData)
|
|
|
- preservOperator(addPeopleData).then(() => {
|
|
|
+ let Formobj = {userOrganizeID: this.organizeID,configFlag:1}
|
|
|
+ const params = Object.assign(Formobj, this.addPeople)
|
|
|
+ preservOperator(params).then(response => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$message({
|
|
|
message: '生成邀请码成功',
|
|
@@ -255,47 +248,75 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handOnline(row) {
|
|
|
- console.log(row.id)
|
|
|
+ this.updateTemp = Object.assign({}, {
|
|
|
+ clubID: row.clubID,
|
|
|
+ userID: row.userID,
|
|
|
+ clubStatus: row.clubStatus,
|
|
|
+ userOrganizeID: this.organizeID
|
|
|
+ })
|
|
|
this.dialogVisible = true
|
|
|
this.dialogVisibleText = '确定上线该会所吗?'
|
|
|
- this.updateTatusId = row.id
|
|
|
this.updateTatusType = 'online'
|
|
|
},
|
|
|
handOffline(row) {
|
|
|
console.log(row.id)
|
|
|
+ this.updateTemp = Object.assign({}, {
|
|
|
+ clubID: row.clubID,
|
|
|
+ userID: row.userID,
|
|
|
+ clubStatus: row.clubStatus,
|
|
|
+ userOrganizeID: this.organizeID
|
|
|
+ })
|
|
|
this.dialogVisible = true
|
|
|
this.dialogVisibleText = '确定下线该会所吗?'
|
|
|
- this.updateTatusId = row.id
|
|
|
this.updateTatusType = 'offline'
|
|
|
- },
|
|
|
+ },
|
|
|
handleConfim() {
|
|
|
if (this.updateTatusType === 'online') {
|
|
|
- console.log(this.updateTatusId)
|
|
|
- this.list[0].status = 2
|
|
|
- // preservOperator(addPeopleData).then(() => {
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // })
|
|
|
- this.$message({
|
|
|
- message: '上线会所成功',
|
|
|
- type: 'success',
|
|
|
- center: true
|
|
|
- });
|
|
|
+ const params = Object.assign({},this.updateTemp)
|
|
|
+ updateStatus(params).then(response => {
|
|
|
+ if(response.code === '1'){
|
|
|
+ this.$message({ message: '上线会所成功',type: 'success',center: true});
|
|
|
+ this.list =[]
|
|
|
+ this.fetchData()
|
|
|
+ }else{
|
|
|
+ this.$message.error(response.msg);
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ })
|
|
|
} else {
|
|
|
- // preservOperator(addPeopleData).then(() => {
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // })
|
|
|
- console.log(this.updateTatusId)
|
|
|
- this.list[1].status = 2
|
|
|
- this.$message({
|
|
|
- message: '下线会所成功',
|
|
|
- type: 'success',
|
|
|
- center: true
|
|
|
- });
|
|
|
+ const params = Object.assign({},this.updateTemp)
|
|
|
+ updateStatus(params).then(response => {
|
|
|
+ if(response.code === '1'){
|
|
|
+ this.$message({message: '下线会所成功',type: 'success',center: true });
|
|
|
+ this.list =[]
|
|
|
+ this.fetchData()
|
|
|
+ }else{
|
|
|
+ this.$message.error(response.msg);
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ })
|
|
|
}
|
|
|
- this.dialogVisible = false
|
|
|
},
|
|
|
onSubmit() {
|
|
|
- console.log('search')
|
|
|
+ this.$refs['searchForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let Fromobj = {userOrganizeID: this.organizeID,startTime:this.startTime,endTime:this.endTime,index:1,pageSize:10}
|
|
|
+ const params = Object.assign(Fromobj, this.searchForm)
|
|
|
+ console.log(params)
|
|
|
+ getClubList(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);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ // 封装静态数据
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|