This commit is contained in:
姚宇浩 2024-01-25 11:46:26 +08:00
parent c57ba0040f
commit 749068ea41
2 changed files with 385 additions and 289 deletions

View File

@ -4,7 +4,7 @@
<div style="margin-left: 10px"> <div style="margin-left: 10px">
<el-input <el-input
v-model="value1" v-model="value1"
placeholder="请输入标题" placeholder="请输入商品名"
:input-style="inputStyle" :input-style="inputStyle"
clearable clearable
></el-input> ></el-input>

View File

@ -1,32 +1,60 @@
<template> <template>
<el-header> <el-header>
<div style="display: flex;"> <div style="display: flex">
<div style="margin-left: 10px;"> <div style="margin-left: 10px">
<el-input v-model="value1" placeholder="请输入标题" :input-style="inputStyle" clearable></el-input> <el-input
v-model="value1"
placeholder="请输入商品名"
:input-style="inputStyle"
clearable
></el-input>
</div> </div>
<div style="margin-left: 10px;"> <div style="margin-left: 10px">
<el-select v-model="selectValue" placeholder="请选择"> <el-select v-model="selectValue" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> <el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div style="margin-left: 10px;"> <div style="margin-left: 10px">
<div><el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button></div> <div>
<el-button type="primary" icon="el-icon-search" @click="getData"
>搜索</el-button
>
</div>
</div>
<div style="margin-left: 10px">
<div>
<el-button
type="primary"
icon="el-icon-search"
@click="getdetail('批量审核', ids)"
>批量审核</el-button
>
</div> </div>
<div style="margin-left: 10px;">
<div><el-button type="primary" icon="el-icon-search" @click="getdetail('批量审核', ids)">批量审核</el-button></div>
</div> </div>
</div> </div>
</el-header> </el-header>
<div class="scTable" ref="scTableMain" v-loading="loading"> <div class="scTable" ref="scTableMain" v-loading="loading">
<div class="scTable-table"> <div class="scTable-table">
<el-table :data="tableData" style="width: 100%" ref="scTable" :height="tableHeight" <el-table
@selection-change="handleSelectionChange"> :data="tableData"
style="width: 100%"
ref="scTable"
:height="tableHeight"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80"> </el-table-column> <el-table-column type="index" label="序号" width="80">
<el-table-column prop="domainInfo.name" label="商品"> </el-table-column> </el-table-column>
<el-table-column prop="domainInfo.introduce" label="简介"> </el-table-column> <el-table-column prop="goodsName" label="商品"> </el-table-column>
<el-table-column prop="shopInfo.userName" label="作者"> </el-table-column> <el-table-column prop="introduce" label="简介"> </el-table-column>
<el-table-column prop="shopInfo.userName" label="作者">
</el-table-column>
<el-table-column prop="workTag" label="标签"> </el-table-column> <el-table-column prop="workTag" label="标签"> </el-table-column>
<el-table-column prop="typeName" label="类型"> <el-table-column prop="typeName" label="类型">
<template #default="scope"> <template #default="scope">
@ -35,45 +63,93 @@
</el-table-column> </el-table-column>
<el-table-column prop="examineState" label="审核状态"> <el-table-column prop="examineState" label="审核状态">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.domainInfo.examineState == '0'" style="color:#409EFF;">未审核</span> <span v-if="scope.row.examineState == '0'" style="color: #409eff"
<span v-else-if="scope.row.domainInfo.examineState == '1'" style="color:#67C23A;">通过</span> >未审核</span
<span v-else-if="scope.row.domainInfo.examineState == '2'" style="color:#F56C6C;">拒绝</span> >
<span
v-else-if="scope.row.examineState == '1'"
style="color: #67c23a"
>通过</span
>
<span
v-else-if="scope.row.examineState == '2'"
style="color: #f56c6c"
>拒绝</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="examineUser" label="审核人"> <el-table-column prop="examineUser" label="审核人">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.domainInfo.examineUser">{{ scope.row.domainInfo.examineUser }}</span> <span v-if="scope.row.examineUser">{{
scope.row.examineUser
}}</span>
<span v-else>暂无</span> <span v-else>暂无</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="examineDate" label="审核时间"> <el-table-column prop="examineDate" label="审核时间">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.domainInfo.examineDate">{{ scope.row.domainInfo.examineDate }}</span> <span v-if="scope.row.examineDate">{{
scope.row.examineDate
}}</span>
<span v-else>暂无</span> <span v-else>暂无</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template #default="scope"> <template #default="scope">
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;" <span
@click.stop="getdetail('审核', scope.row.id)" v-if="scope.row.domainInfo.examineState == '0'">审核</span> style="
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;" font-size: 14px;
@click.stop="getdetails('详情', scope.row)">详情</span> color: #409eff;
margin-right: 10px;
cursor: pointer;
"
@click.stop="getdetail('审核', scope.row.id)"
v-if="scope.row.examineState == '0'"
>审核</span
>
<span
style="
font-size: 14px;
color: #409eff;
margin-right: 10px;
cursor: pointer;
"
@click.stop="getdetails('详情', scope.row)"
>详情</span
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="scTable-page"> <div class="scTable-page">
<div class="scTable-pagination"> <div class="scTable-pagination">
<el-pagination background :small="true" layout="total, prev, pager, next, jumper" :total="total" <el-pagination
:page-size="pageSize" v-model:currentPage="currentPage" background
@current-change="paginationChange"></el-pagination> :small="true"
layout="total, prev, pager, next, jumper"
:total="total"
:page-size="pageSize"
v-model:currentPage="currentPage"
@current-change="paginationChange"
></el-pagination>
</div> </div>
<div class="scTable-do"> <div class="scTable-do">
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button> <el-button
@click="refresh"
icon="el-icon-refresh"
circle
style="margin-left: 15px"
></el-button>
</div> </div>
</div> </div>
</div> </div>
<el-dialog v-model="open" :title="title" destroy-on-close :before-close="before" width="50%"> <el-dialog
v-model="open"
:title="title"
destroy-on-close
:before-close="before"
width="50%"
>
<el-form :model="formState" label-width="100px"> <el-form :model="formState" label-width="100px">
<el-form-item label="状态" name="userName"> <el-form-item label="状态" name="userName">
<el-radio-group v-model="formState.resource"> <el-radio-group v-model="formState.resource">
@ -88,16 +164,20 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="handleClose">取消</el-button> <el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="onFinish()"> <el-button type="primary" @click="onFinish()"> 确定 </el-button>
确定
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="opens" :title="title" destroy-on-close :before-close="before" width="50%"> <el-dialog
v-model="opens"
:title="title"
destroy-on-close
:before-close="before"
width="50%"
>
<el-form :model="detailForm" label-width="100px"> <el-form :model="detailForm" label-width="100px">
<el-form-item label="商品名称"> <el-form-item label="商品名称">
<el-input v-model="detailForm.name"></el-input> <el-input v-model="detailForm.goodsName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="作者"> <el-form-item label="作者">
<el-input v-model="detailForm.userName"></el-input> <el-input v-model="detailForm.userName"></el-input>
@ -121,9 +201,7 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="handleCloses">取消</el-button> <el-button @click="handleCloses">取消</el-button>
<el-button type="primary" @click="handleCloses"> <el-button type="primary" @click="handleCloses"> 确定 </el-button>
确定
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -132,7 +210,7 @@
<script> <script>
import http from "@/utils/request"; import http from "@/utils/request";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
const scEditor = defineAsyncComponent(() => import('@/components/scEditor')); const scEditor = defineAsyncComponent(() => import("@/components/scEditor"));
export default { export default {
components: { components: {
scEditor, scEditor,
@ -140,94 +218,102 @@ export default {
data() { data() {
return { return {
inputStyle: { inputStyle: {
paddingRight: '30px' paddingRight: "30px",
}, },
tableData: [], tableData: [],
pageSize: 20, pageSize: 20,
total: 0, total: 0,
currentPage: 1, currentPage: 1,
loading: false, loading: false,
tableHeight: '100%', tableHeight: "100%",
paginationLayout: "total, prev, pager, next, jumper", paginationLayout: "total, prev, pager, next, jumper",
value1: '', value1: "",
open: false, open: false,
opens: false, opens: false,
title: '修改', title: "修改",
formState: { formState: {
resource: true, resource: true,
desc: '' desc: "",
}, },
detailForm: {}, detailForm: {},
imgList: [], imgList: [],
multipleSelection: [], multipleSelection: [],
ids: '', ids: "",
selectValue: '', selectValue: "",
options: [{ options: [
value: '', {
label: '全部' value: "",
}, { label: "全部",
value: '1', },
label: '已通过' {
}, { value: "1",
value: '2', label: "已通过",
label: '未通过' },
}, { {
value: '0', value: "2",
label: '未审核' label: "未通过",
}], },
} {
value: "0",
label: "未审核",
},
],
};
}, },
created() { created() {
this.$nextTick(() => { this.$nextTick(() => {
this.upTableHeight() this.upTableHeight();
}) });
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
// //
upTableHeight() { upTableHeight() {
this.tableHeight = (this.$refs.scTableMain.offsetHeight - 50) + "px" this.tableHeight = this.$refs.scTableMain.offsetHeight - 50 + "px";
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
let arr = [] let arr = [];
this.multipleSelection.forEach(item => { this.multipleSelection.forEach((item) => {
arr.push(item.id) arr.push(item.id);
}) });
this.ids = arr.join(',') this.ids = arr.join(",");
}, },
// //
getData() { getData() {
let parame = { let parame = {
typesOf:"1", typesOf: "1",
examineState: this.selectValue, examineState: this.selectValue,
title: this.value1, title: this.value1,
page: this.currentPage, page: this.currentPage,
size: this.pageSize size: this.pageSize,
} };
http.get("/api/goods/examineList", parame).then((res) => { http
.get("/api/goods/examineList", parame)
.then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tableData = res.data.records this.tableData = res.data.records;
this.total = res.data.total this.total = res.data.total;
this.currentPage = res.data.current this.currentPage = res.data.current;
this.loading = false this.loading = false;
} }
}).catch(err => { })
console.log(err) .catch((err) => {
this.loading = false console.log(err);
this.loading = false;
}); });
}, },
// //
paginationChange() { paginationChange() {
this.getData() this.getData();
}, },
// //
refresh() { refresh() {
this.$refs.scTable.clearSelection(); this.$refs.scTable.clearSelection();
this.loading = true this.loading = true;
this.getData() this.getData();
}, },
before() { before() {
this.open = false; this.open = false;
@ -236,58 +322,68 @@ export default {
}, },
handleClose() { handleClose() {
this.open = false; this.open = false;
this.formState.desc = '' this.formState.desc = "";
this.formState.resource = true this.formState.resource = true;
}, },
onFinish() { onFinish() {
// let parame = { // let parame = {
// ids: this.ids, // ids: this.ids,
// examineState: this.formState.resource // examineState: this.formState.resource
// } // }
http.post("/api/goods/examine?examineState=" + this.formState.resource + '&ids=' + this.ids).then((res) => { http
.post(
"/api/goods/examine?examineState=" +
this.formState.resource +
"&ids=" +
this.ids
)
.then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tableData = [] this.tableData = [];
this.total = 0 this.total = 0;
this.currentPage = 1 this.currentPage = 1;
this.loading = true this.loading = true;
this.open = false this.open = false;
this.getData() this.getData();
} }
}).catch(err => { })
console.log(err) .catch((err) => {
console.log(err);
}); });
}, },
getdetail(title, value) { getdetail(title, value) {
this.title = title this.title = title;
this.open = true this.open = true;
this.ids = value this.ids = value;
}, },
getdetails(title, value) { getdetails(title, value) {
this.imgList = [] this.imgList = [];
this.title = title this.title = title;
this.opens = true this.opens = true;
this.detailForm.name = value.domainInfo.name this.detailForm.goodsName = value.goodsName;
this.detailForm.wpPath = value.domainInfo.wpPath this.detailForm.userName = value.shopInfo.userName;
this.detailForm.code = value.domainInfo.code this.detailForm.wpPath = value.panUrl;
this.detailForm.userName=value.shopInfo.userName this.detailForm.code = value.panCode;
let img1 = value.domainInfo.file.split(',') let img1 = null;
if (value.file) {
img1 = value.file.split(",");
if (img1.length > 0) { if (img1.length > 0) {
img1.forEach(ele => { img1.forEach((ele) => {
this.imgList.push({ this.imgList.push({
path: ele, path: ele,
preview: ele preview: ele,
}) });
}) });
}
} }
}, },
handleCloses() { handleCloses() {
this.opens = false; this.opens = false;
this.detailForm = {} this.detailForm = {};
this.imgList = [] this.imgList = [];
}, },
} },
} };
</script> </script>
<style scoped> <style scoped>