|
@@ -13,8 +13,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="上线状态:">
|
|
<el-form-item label="上线状态:">
|
|
<el-select v-model="form.status" placeholder="请选择">
|
|
<el-select v-model="form.status" placeholder="请选择">
|
|
- <el-option label="已上线" value="shanghai"></el-option>
|
|
|
|
- <el-option label="已下线" value="beijing"></el-option>
|
|
|
|
|
|
+ <el-option label="已上线" value="shanghai" />
|
|
|
|
+ <el-option label="已下线" value="beijing" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="创建时间:">
|
|
<el-form-item label="创建时间:">
|
|
@@ -23,8 +23,8 @@
|
|
type="daterange"
|
|
type="daterange"
|
|
range-separator="至"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
- end-placeholder="结束日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="onSubmit">搜索</el-button>
|
|
<el-button type="primary" @click="onSubmit">搜索</el-button>
|
|
@@ -51,9 +51,10 @@
|
|
<el-table-column class-name="status-col" label="上线状态" width="150" align="center" prop="status">
|
|
<el-table-column class-name="status-col" label="上线状态" width="150" align="center" prop="status">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
<el-tag>
|
|
<el-tag>
|
|
- {{ row.status*1 === 1 ? '已下线' : '已上线' }}
|
|
|
|
|
|
+ {{ row.status === 1 ? '已下线' : '已上线' }}
|
|
</el-tag>
|
|
</el-tag>
|
|
- <el-button type="primary" size="mini" @click="handleEdit(row)">{{ row.status*1 === 1 ? '上线' : '下线' }}</el-button>
|
|
|
|
|
|
+ <el-button v-if="row.status === 1" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
|
|
|
|
+ <el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column align="center" label="会所地址" width="350" prop="address" />
|
|
<el-table-column align="center" label="会所地址" width="350" prop="address" />
|
|
@@ -61,12 +62,12 @@
|
|
<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}">
|
|
<router-link :to="'/club/form/'">
|
|
<router-link :to="'/club/form/'">
|
|
- <el-button type="primary" size="mini">编辑</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small">编辑</el-button>
|
|
</router-link>
|
|
</router-link>
|
|
<router-link :to="'/club/operateList/'">
|
|
<router-link :to="'/club/operateList/'">
|
|
- <el-button type="primary" size="mini">查看运营人员</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small">查看运营人员</el-button>
|
|
</router-link>
|
|
</router-link>
|
|
- <el-button type="success" size="mini" @click="handleEdit(row)">添加运营人员</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="handleEdit(row.id)">添加运营人员</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -74,26 +75,33 @@
|
|
<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.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
|
|
|
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
|
- <el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:24%;">
|
|
|
|
|
|
+ <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-form-item label="姓名" prop="classifyName">
|
|
- <el-input v-model="temp.classifyName" />
|
|
|
|
|
|
+ <el-input v-model="addPeople.classifyName" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="*手机号" prop="telephone">
|
|
|
|
- <el-input v-model="temp.telephone" />
|
|
|
|
|
|
+ <el-form-item label="手机号" prop="telephone">
|
|
|
|
+ <el-input v-model="addPeople.telephone" />
|
|
</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 type="primary" @click="dialogStatus==='create' ? createData() : updateData()">保存</el-button>
|
|
|
|
- <el-button type="primary" @click="dialogStatus==='create' ? createData() : updateData()">保存生成邀请码</el-button>
|
|
|
|
|
|
+ <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="createData()">保存</el-button>
|
|
|
|
+ <el-button type="primary" @click="updateData()">保存生成邀请码</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
+ <el-dialog title="系统提示" :visible.sync="dialogVisible" width="15%">
|
|
|
|
+ <span>{{ dialogVisibleText }}</span>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="handleConfim()">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getCategory, updateCategory, createCategory } from '@/api/goods'
|
|
|
|
|
|
+import { getCategory, updateCategory, createCategory } from '@/api/club'
|
|
import Pagination from '@/components/Pagination'
|
|
import Pagination from '@/components/Pagination'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -112,7 +120,7 @@ export default {
|
|
list: null,
|
|
list: null,
|
|
listLoading: true,
|
|
listLoading: true,
|
|
searchTimeVal: '',
|
|
searchTimeVal: '',
|
|
- total: 0,
|
|
|
|
|
|
+ total: 100,
|
|
listQuery: {
|
|
listQuery: {
|
|
page: 1,
|
|
page: 1,
|
|
limit: 10,
|
|
limit: 10,
|
|
@@ -132,30 +140,24 @@ export default {
|
|
imageUrl: '',
|
|
imageUrl: '',
|
|
doorwayImageUrl: ''
|
|
doorwayImageUrl: ''
|
|
},
|
|
},
|
|
- temp: {
|
|
|
|
- id: 1,
|
|
|
|
- organizeID: 1,
|
|
|
|
- classifyName: '针剂',
|
|
|
|
- classifyImage: 'dfgdfsgsd',
|
|
|
|
- sort: 60,
|
|
|
|
- status: 1,
|
|
|
|
- postage: 1,
|
|
|
|
- addTime: new Date(),
|
|
|
|
- updateTime: new Date(),
|
|
|
|
- delFlag: 0
|
|
|
|
|
|
+ addPeople: {
|
|
|
|
+ classifyName: '',
|
|
|
|
+ telephone: ''
|
|
},
|
|
},
|
|
|
|
+ updateTatusId: '',
|
|
|
|
+ updateTatusType: '',
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ dialogVisibleText: '',
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
dialogStatus: '',
|
|
dialogStatus: '',
|
|
textMap: {
|
|
textMap: {
|
|
update: '添加运营人员',
|
|
update: '添加运营人员',
|
|
- create: 'Create'
|
|
|
|
|
|
+ create: 'Create',
|
|
|
|
+ titleText: '系统提示'
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- classifyName: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
|
|
|
|
- sort: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
|
|
|
|
- classifyImage: [{ type: 'file', required: true, message: '请上传分类图标', trigger: 'change' }],
|
|
|
|
- postage: [{ required: true, message: '请选择邮费是否到付', trigger: 'change' }],
|
|
|
|
- status: [{ required: true, message: '请选择状态', trigger: 'change' }]
|
|
|
|
|
|
+ classifyName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
|
|
|
+ telephone: [{ required: true, message: '手机号码不能为空', trigger: 'blur' }]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -177,7 +179,7 @@ export default {
|
|
classifyName: '商城测试演示会所',
|
|
classifyName: '商城测试演示会所',
|
|
classifyNum: '2020010120201110',
|
|
classifyNum: '2020010120201110',
|
|
classifyPeo: '吴小研',
|
|
classifyPeo: '吴小研',
|
|
- telephone: 138888888888,
|
|
|
|
|
|
+ telephone: 13888888888,
|
|
address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
createTime: '2020-01-01:20:30:56',
|
|
createTime: '2020-01-01:20:30:56',
|
|
status: 1
|
|
status: 1
|
|
@@ -188,7 +190,7 @@ export default {
|
|
classifyName: '商城测试演示会所',
|
|
classifyName: '商城测试演示会所',
|
|
classifyNum: '2020010120201110',
|
|
classifyNum: '2020010120201110',
|
|
classifyPeo: '吴小研',
|
|
classifyPeo: '吴小研',
|
|
- telephone: 138888888888,
|
|
|
|
|
|
+ telephone: 13888888888,
|
|
address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
address: '广东省深圳市福田区上步村1001号锦峰大厦A座',
|
|
createTime: '2020-01-01:20:30:56',
|
|
createTime: '2020-01-01:20:30:56',
|
|
status: 1
|
|
status: 1
|
|
@@ -198,31 +200,23 @@ export default {
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
},
|
|
},
|
|
handleEdit(row) {
|
|
handleEdit(row) {
|
|
- this.temp = Object.assign({}, row)
|
|
|
|
- this.temp.timestamp = new Date(this.temp.timestamp)
|
|
|
|
|
|
+ this.addPeople = Object.assign({}, { id: row })
|
|
this.dialogStatus = 'update'
|
|
this.dialogStatus = 'update'
|
|
this.dialogFormVisible = true
|
|
this.dialogFormVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs['dataForm'].clearValidate()
|
|
this.$refs['dataForm'].clearValidate()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- updateData() {
|
|
|
|
|
|
+ createData() {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- const tempData = Object.assign({}, this.temp)
|
|
|
|
- tempData.updateTime = +new Date(tempData.updateTime)
|
|
|
|
- updateCategory(tempData).then(() => {
|
|
|
|
- for (const v of this.list) {
|
|
|
|
- if (v.id === this.temp.id) {
|
|
|
|
- const index = this.list.indexOf(v)
|
|
|
|
- this.list.splice(index, 1, this.temp)
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ const addPeopleData = Object.assign({}, this.addPeople)
|
|
|
|
+ console.log(addPeopleData)
|
|
|
|
+ updateCategory(addPeopleData).then(() => {
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
this.$notify({
|
|
this.$notify({
|
|
title: 'Success',
|
|
title: 'Success',
|
|
- message: '更新成功',
|
|
|
|
|
|
+ message: '保存成功',
|
|
type: 'success',
|
|
type: 'success',
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
@@ -230,21 +224,55 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- createData() {
|
|
|
|
|
|
+ updateData() {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- createCategory(this.temp).then(() => {
|
|
|
|
- this.list.unshift(this.temp)
|
|
|
|
|
|
+ const addPeopleData = Object.assign({}, this.addPeople)
|
|
|
|
+ console.log(addPeopleData)
|
|
|
|
+ updateCategory(addPeopleData).then(() => {
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
- this.$notify({
|
|
|
|
- title: 'Success',
|
|
|
|
- message: '添加分类成功',
|
|
|
|
- type: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ handOnline(row) {
|
|
|
|
+ console.log(row.id)
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
+ this.dialogVisibleText = '确定上线该会所吗?'
|
|
|
|
+ this.updateTatusId = row.id
|
|
|
|
+ this.updateTatusType = 'online'
|
|
|
|
+ },
|
|
|
|
+ handOffline(row) {
|
|
|
|
+ console.log(row.id)
|
|
|
|
+ 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
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: 'Success',
|
|
|
|
+ message: '上线成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ console.log(this.updateTatusId)
|
|
|
|
+ this.list[1].status = 2
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: 'Success',
|
|
|
|
+ message: '下线成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.dialogVisible = false
|
|
|
|
+ },
|
|
|
|
+ onSubmit() {
|
|
|
|
+ console.log('search')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|