增加转售管理界面及搜索、列表展示、审核、详情等功能

This commit is contained in:
jia 2023-08-09 14:52:35 +08:00
parent c1747bf8e5
commit 5fe0d58c15
3 changed files with 364 additions and 0 deletions

View File

@ -517,3 +517,22 @@ export function specsDeteleApi(id) {
export function merSpecsList(data) {
return request.get(`store/params/temp/merlst`, data)
}
/** 转售管理参数模板 -- 列表 */
export function resaleList(data) {
return request.get(`product/resale/lst`, data)
}
/** 转售管理参数模板 -- 详情 */
export function resaleDetail(id) {
return request.get(`product/resale/detail/${id}`)
}
/** 转售管理参数模板 -- 是否显示 */
export function resaleShow(id, status) {
return request.post(`product/resale/show/${id}`, {status})
}
/** 转售管理参数模板 -- 审核 */
export function resaleStatus(id, data) {
return request.post(`product/resale/status/${id}`, data)
}

View File

@ -131,7 +131,17 @@ const productRouter =
noCache: true
},
component: () => import('@/views/product/productGuarantee/index.vue')
},
{
path: 'resale',
name: 'ProductResale',
meta: {
title: '转售管理',
noCache: true
},
component: () => import('@/views/product/ProductResale/index.vue')
}
]
}

View File

@ -0,0 +1,335 @@
<template>
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="container">
<el-form inline size="small" label-width="110px">
<el-form-item label="审核状态">
<el-select v-model="tableFrom.status" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="分类名称:" style="display: inline-block;">
<el-select v-model="tableFrom.category_id" clearable filterable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-option v-for="item in cateSelect" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="是否显示">
<el-select v-model="tableFrom.is_show" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)">
<el-option label="显示" value="1" />
<el-option label="不显示" value="0" />
</el-select>
</el-form-item>
<el-form-item label="发布者:">
<el-input v-model="tableFrom.username" @keyup.enter.native="getList(1)" placeholder="请输入文章作者" class="selWidth">
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
</el-input>
</el-form-item>
<el-form-item label="关键字:">
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入文章标题" class="selWidth">
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small">
<el-table-column label="ID" prop="community_id" min-width="100" />
<el-table-column label="标题" prop="title" min-width="100" />
<el-table-column label="发布者" prop="author.nickname" min-width="100" />
<el-table-column label="封面" min-width="210">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image v-for="(item,index) in scope.row.image" :key="index" :src="item" class="mr5" :preview-src-list="[item]" />
</div>
</template>
</el-table-column>
<el-table-column label="分类" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.category && scope.row.category.cate_name || '暂无' }}</span>
</template>
</el-table-column>
<el-table-column prop="create_time" label="发布时间" min-width="100" />
<el-table-column prop="status" label="是否显示">
<template slot-scope="scope">
<el-switch v-model="scope.row.is_show" :active-value="1" :inactive-value="0" active-text="显示" inactive-text="隐藏" @change="onchangeIsShow(scope.row)" />
</template>
</el-table-column>
<el-table-column label="状态" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.status | communityStatus }}</span>
<span v-if="scope.row.status == -1" style="display: block; font-size: 12px; color: red;">原因 {{ scope.row.refusal }}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="onDetail(scope.row.community_id)">详情</el-button>
<el-button type="text" size="small" @click="onAudit(scope.row.community_id)">审核</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="pageChange" />
</div>
</el-card>
<!--审核-->
<el-dialog v-if="dialogVisible" :title="isExamine ? '审核' : '详情'" :visible.sync="dialogVisible" width="700px">
<div v-loading="loading">
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="120px" class="demo-ruleForm">
<el-form-item label="'封面:'">
<div v-for="(item, index) in formData.image" :key="index" style="display: inline-block; margin: 0 10px 10px 0">
<el-image style="width: 80px; height: 80px" :src="item || ''" :preview-src-list="[item?item:'']" />
</div>
</el-form-item>
<el-form-item v-if="formData.is_type == 2" label="短视频:">
<div style="margin: 0 10px 10px 0">
<video style="width:40%;height: 180px;border-radius: 10px;" :src="formData.video_link" controls="controls">
您的浏览器不支持 video 标签
</video>
</div>
</el-form-item>
<el-form-item v-if="formData.topic && formData.topic.topic_name" label="标题:">
<div>{{formData.topic.topic_name}}</div>
</el-form-item>
<el-form-item label="发布者:">
<span>{{formData.author && formData.author.nickname}}</span>
</el-form-item>
<el-form-item label="作者ID">
<span>{{formData.author && formData.author.uid}}</span>
</el-form-item>
<el-form-item label="发布时间:">
<span>{{formData.create_time}}</span>
</el-form-item>
<el-form-item v-if="isExamine" label="审核状态:" prop="status">
<el-radio-group v-model="ruleForm.status">
<el-radio :label="1">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.status===-1 && isExamine" label="原因" prop="refusal">
<el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" />
</el-form-item>
<el-form-item v-if="isExamine">
<el-button type="primary" @click="onSubmit(formData)">提交</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
communityAuditApi, communityDetailApi,
communityCateOptionApi,
} from '@/api/community'
import { resaleList, resaleShow, resaleStatus, resaleDetail } from '@/api/product'
export default {
name: 'communityTopic',
data() {
return {
moren: require("@/assets/images/f.png"),
colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
isChecked: false,
listLoading: true,
tableData: {
data: [],
total: 0
},
tableFrom: {
page: 1,
limit: 20,
status: "",
keyword: "",
username: "",
category_id: "",
is_show: '',
},
statusList: [
{ label: "审核通过", value: 1 },
{ label: "待审核", value: 0 },
{ label: "审核未通过", value: -1 },
{ label: "下架", value: -2 },
],
cateSelect: [],
topicSelect: [],
dialogVisible: false,
loading: false,
isExamine: false,
community_id: "",
formData: {},
rules: {
status: [
{ required: true, message: '请选择审核状态', trigger: 'change' }
],
refusal: [
{ required: true, message: '请填写拒绝原因', trigger: 'blur' }
]
},
ruleForm: {
refusal: '',
status: 1,
},
}
},
mounted() {
this.getList(1)
this.getCateSelect()
},
methods: {
//
getCateSelect() {
communityCateOptionApi()
.then((res) => {
this.cateSelect = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getList(num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page
resaleList(this.tableFrom).then(res => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
this.listLoading = false
}).catch(res => {
this.listLoading = false
this.$message.error(res.message)
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList('')
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList('')
},
// 1: -1:
onSubmit(item) {
if (this.ruleForm.status == 1) {
resaleStatus(item.community_id, { "status": 1 }).then((res) => {
this.$message.success(res.message)
this.dialogVisible = false
this.formData = res.data
}).catch(({ message }) => {
this.$message.error(message)
})
} else {
resaleStatus(item.community_id, { "status": -1, "refusal": this.ruleForm.refusal }).then((res) => {
this.$message.success(res.message)
this.dialogVisible = false
this.formData = res.data
}).catch(({ message }) => {
this.$message.error(message)
})
}
},
//
onAudit(id) {
this.community_id = id;
this.dialogVisible = true;
this.isExamine = true;
resaleDetail(id).then((res) => {
this.formData = res.data
}).catch(({ message }) => {
this.$message.error(message)
})
},
//
onDetail(id) {
this.community_id = id;
this.dialogVisible = true;
this.isExamine = false;
resaleDetail(id).then((res) => {
this.formData = res.data
}).catch(({ message }) => {
this.$message.error(message)
})
},
//
onchangeIsShow(row) {
resaleShow(row.community_id, row.is_show).then(({ message }) => {
this.$message.success(message)
}).catch(({ message }) => {
this.$message.error(message)
})
}
}
}
</script>
<style scoped lang="scss">
.box-container {
overflow: hidden;
}
.box-container .list {
float: left;
line-height: 40px;
}
.box-container .sp {
width: 50%;
}
.box-container .sp3 {
width: 33.3333%;
}
.box-container .sp100 {
width: 100%;
}
.box-container .list .name {
display: inline-block;
width: 150px;
text-align: right;
color: #606266;
}
.box-container .list.image {
margin-bottom: 40px;
}
.box-container .list.image img {
position: relative;
top: 40px;
}
/deep/.el-form-item__content .el-rate {
position: relative;
top: 8px;
}
</style>