|
@@ -0,0 +1,289 @@
|
|
|
+<template>
|
|
|
+ <div class="tab">
|
|
|
+ <div class="tab-search">
|
|
|
+ <el-form :inline="true" :model="getTypesList">
|
|
|
+ <el-form-item label="搜索">
|
|
|
+ <el-input @input="ListBack" v-model="getTypesList.search" placeholder="请输入搜索内容"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="search">搜索</el-button>
|
|
|
+ <el-button type="primary" @click="dialogVisibleTyep">新增</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="tab-header">
|
|
|
+
|
|
|
+ <el-table :data="tableData.list" border row-key="id">
|
|
|
+ <!-- <el-table-column type="selection" width="55" :selectable="selectable" /> -->
|
|
|
+ <el-table-column type="index" width="50" label="序号" />
|
|
|
+ <el-table-column prop="name" label="名字" />
|
|
|
+ <el-table-column prop="id" label="标签id" />
|
|
|
+ <el-table-column prop="updateTime" label="创建时间" />
|
|
|
+ <el-table-column prop="state" label="审核">
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <!-- 未通过 -->
|
|
|
+ <div v-if="scope.row.state == 3">
|
|
|
+ <!-- <el-button type="text" @click="checkRow(scope.row)">查看</el-button> -->
|
|
|
+ <el-button type="danger">不通过</el-button>
|
|
|
+ </div>
|
|
|
+ <!-- 通过审核 -->
|
|
|
+ <div v-else-if="scope.row.state == 2">
|
|
|
+ <!-- <el-button type="text" @click="checkRow(scope.row)">查看</el-button> -->
|
|
|
+ <el-button type="success">审核通过</el-button>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.row.state == 1">
|
|
|
+ <el-button type="warning">审核中</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="status" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button type="text" @click="checkRow(scope.row)">查看</el-button> -->
|
|
|
+ <el-button type="text" @click="updateRow(scope.row)">修改</el-button>
|
|
|
+ <el-button type="text" @click="deleteRow(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination layout="total, sizes, prev, pager, next, jumper" :total="tableData.total"
|
|
|
+ :page-sizes="[10, 20, 50]" :page-size="getTypesList.pageSize" @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <!-- 新增 -->
|
|
|
+ <el-dialog :visible.sync="dialogVisible" title="新增会员标签" width=500>
|
|
|
+ <el-form :model="classifyDetail" label-width="5rem">
|
|
|
+ <el-form-item label="标签名称">
|
|
|
+ <el-input v-model="classifyDetail.name" placeholder="请输入标签名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="add(1)">确定</el-button>
|
|
|
+ <el-button @click="add(0)">取消</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 修改 -->
|
|
|
+ <el-dialog :visible.sync="updataType" title="修改会员标签" width=500>
|
|
|
+ <el-form :model="putMemberList" label-width="80px">
|
|
|
+ <el-form-item label="标签名称">
|
|
|
+ <el-input v-model="putMemberList.name" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="success" @click="passLabels">通过</el-button>
|
|
|
+ <el-button type="danger" @click="backLabels">不通过</el-button>
|
|
|
+ <el-button @click="stopLabels">取消</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { updateByIdApi, checkMemberLabelsApi, memberLabelsApi, deleteMemberLabelsApi, putMemberLabelsApi } from '@/api/rm-bank'
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // searchText:''
|
|
|
+ getTypesList: {
|
|
|
+ search: '',
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
+ tableData: [],
|
|
|
+ dialogVisible: false,
|
|
|
+ updataType: false,
|
|
|
+ //分类
|
|
|
+ classifyDetail: {
|
|
|
+ "parentId": 0,
|
|
|
+ "name": '',
|
|
|
+ "sort": '',
|
|
|
+ "type": 2
|
|
|
+ },
|
|
|
+ putMemberList: {
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ state: '',
|
|
|
+ },
|
|
|
+ fatherList: [],
|
|
|
+ value: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.getTreeTypeList()
|
|
|
+ this.getMemberList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.getTypesList.pageSize = val
|
|
|
+ this.getMemberList()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.getTypesList.page = val
|
|
|
+ this.getMemberList()
|
|
|
+ },
|
|
|
+
|
|
|
+ async getMemberList() {
|
|
|
+ const res = await checkMemberLabelsApi(this.getTypesList)
|
|
|
+ this.tableData = res.data
|
|
|
+ console.log(res.data);
|
|
|
+ },
|
|
|
+ //查看详情
|
|
|
+ async checkRow(row) {
|
|
|
+ // console.log(row);
|
|
|
+ const choseId = { id: row.id }
|
|
|
+ const res = await labelByIdApi(
|
|
|
+ choseId
|
|
|
+ )
|
|
|
+ // console.log(res);
|
|
|
+ },
|
|
|
+ // 修改信息
|
|
|
+ async updateRow(e) {
|
|
|
+ this.updataType = true
|
|
|
+ // console.log(e.id);
|
|
|
+ this.putMemberList.name = e.name
|
|
|
+ this.putMemberList.id = e.id
|
|
|
+ this.putMemberList.state = e.state
|
|
|
+ // console.log(e.state);
|
|
|
+ },
|
|
|
+ async updateConfirm() {
|
|
|
+ // console.log(this.classifyDetail);
|
|
|
+ const res = await putMemberLabelsApi(this.putMemberList)
|
|
|
+ // console.log(res.data);
|
|
|
+ this.getMemberList()
|
|
|
+ this.updataType = false
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ closeUpdata() {
|
|
|
+ this.updataType = false
|
|
|
+ },
|
|
|
+ // 删除信息
|
|
|
+ deleteRow(row) {
|
|
|
+ // this.deleteWindow()
|
|
|
+ const deleteId = { id: row.id }
|
|
|
+ // const res = await deleteByIdApi(deleteId)
|
|
|
+ this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const res = await deleteMemberLabelsApi(deleteId)
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!',
|
|
|
+ });
|
|
|
+ this.getMemberList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: "删除失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 搜索信息
|
|
|
+ async search() {
|
|
|
+ console.log(this.getTypesList.search);
|
|
|
+ if (!this.getTypesList.search) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = await checkMemberLabelsApi(this.getTypesList)
|
|
|
+ // console.log(res);
|
|
|
+ this.tableData = res.data
|
|
|
+ },
|
|
|
+ async add(e) {
|
|
|
+ this.dialogVisibleTyep()
|
|
|
+ if(e){
|
|
|
+ const res = await memberLabelsApi({ name: this.classifyDetail.name })
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.getMemberList()
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.dialogVisibleTyep()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.classifyDetail.name = ''
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ dialogVisibleTyep() {
|
|
|
+ this.dialogVisible = !this.dialogVisible
|
|
|
+ // console.log(123);
|
|
|
+ },
|
|
|
+
|
|
|
+ ListBack() {
|
|
|
+ if (!this.getTypesList.search) {
|
|
|
+ this.getTypesList = {
|
|
|
+ search: '',
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getMemberList()
|
|
|
+
|
|
|
+ }, 500);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 通过审核
|
|
|
+ async passLabels() {
|
|
|
+ this.putMemberList.state = 'PENDING_PASS'
|
|
|
+ const res = await putMemberLabelsApi(this.putMemberList)
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.updataType = false
|
|
|
+ this.getMemberList()
|
|
|
+ }
|
|
|
+ // console.log(res);
|
|
|
+ },
|
|
|
+ // 不通过审核
|
|
|
+ async backLabels() {
|
|
|
+ this.putMemberList.state = 'PENDING_FAIL'
|
|
|
+ // this.updataType = false
|
|
|
+ const res = await putMemberLabelsApi(this.putMemberList)
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.updataType = false
|
|
|
+ this.getMemberList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async stopLabels() {
|
|
|
+ if (this.putMemberList.state == 1 ) {
|
|
|
+ this.putMemberList.state = 'PENDING_AUDIT'
|
|
|
+ }else if(this.putMemberList.state == 2){
|
|
|
+ this.putMemberList.state = 'PENDING_PASS'
|
|
|
+ }else if(this.putMemberList.state == 3){
|
|
|
+ this.putMemberList.state = 'PENDING_FAIL'
|
|
|
+ }
|
|
|
+ const res = await putMemberLabelsApi(this.putMemberList)
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.updataType = false
|
|
|
+ this.getMemberList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import url("../../../styles/elDialog.scss");
|
|
|
+
|
|
|
+.tab {
|
|
|
+ margin-top: 1.25rem;
|
|
|
+
|
|
|
+ /* padding-left: 1.25rem; */
|
|
|
+ .tab-top {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tab-search {
|
|
|
+ padding-left: 1.25rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|