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,316 +1,412 @@
<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
</div> v-model="value1"
<div style="margin-left: 10px;"> placeholder="请输入商品名"
<el-select v-model="selectValue" placeholder="请选择"> :input-style="inputStyle"
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> clearable
</el-option> ></el-input>
</el-select> </div>
</div> <div style="margin-left: 10px">
<div style="margin-left: 10px;"> <el-select v-model="selectValue" placeholder="请选择">
<div><el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button></div> <el-option
</div> v-for="item in options"
<div style="margin-left: 10px;"> :key="item.value"
<div><el-button type="primary" icon="el-icon-search" @click="getdetail('批量审核', ids)">批量审核</el-button></div> :label="item.label"
</div> :value="item.value"
</div> >
</el-header> </el-option>
<div class="scTable" ref="scTableMain" v-loading="loading"> </el-select>
<div class="scTable-table"> </div>
<el-table :data="tableData" style="width: 100%" ref="scTable" :height="tableHeight" <div style="margin-left: 10px">
@selection-change="handleSelectionChange"> <div>
<el-table-column type="selection" width="55"></el-table-column> <el-button type="primary" icon="el-icon-search" @click="getData"
<el-table-column type="index" label="序号" width="80"> </el-table-column> >搜索</el-button
<el-table-column prop="domainInfo.name" label="商品"> </el-table-column> >
<el-table-column prop="domainInfo.introduce" label="简介"> </el-table-column> </div>
<el-table-column prop="shopInfo.userName" label="作者"> </el-table-column> </div>
<el-table-column prop="workTag" label="标签"> </el-table-column> <div style="margin-left: 10px">
<el-table-column prop="typeName" label="类型"> <div>
<template #default="scope"> <el-button
<span>{{ scope.row.typeName }} - {{ scope.row.typesName }}</span> type="primary"
</template> icon="el-icon-search"
</el-table-column> @click="getdetail('批量审核', ids)"
<el-table-column prop="examineState" label="审核状态"> >批量审核</el-button
<template #default="scope"> >
<span v-if="scope.row.domainInfo.examineState == '0'" style="color:#409EFF;">未审核</span> </div>
<span v-else-if="scope.row.domainInfo.examineState == '1'" style="color:#67C23A;">通过</span> </div>
<span v-else-if="scope.row.domainInfo.examineState == '2'" style="color:#F56C6C;">拒绝</span> </div>
</template> </el-header>
</el-table-column> <div class="scTable" ref="scTableMain" v-loading="loading">
<el-table-column prop="examineUser" label="审核人"> <div class="scTable-table">
<template #default="scope"> <el-table
<span v-if="scope.row.domainInfo.examineUser">{{ scope.row.domainInfo.examineUser }}</span> :data="tableData"
<span v-else>暂无</span> style="width: 100%"
</template> ref="scTable"
</el-table-column> :height="tableHeight"
<el-table-column prop="examineDate" label="审核时间"> @selection-change="handleSelectionChange"
<template #default="scope"> >
<span v-if="scope.row.domainInfo.examineDate">{{ scope.row.domainInfo.examineDate }}</span> <el-table-column type="selection" width="55"></el-table-column>
<span v-else>暂无</span> <el-table-column type="index" label="序号" width="80">
</template> </el-table-column>
</el-table-column> <el-table-column prop="goodsName" label="商品"> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column prop="introduce" label="简介"> </el-table-column>
<template #default="scope"> <el-table-column prop="shopInfo.userName" label="作者">
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;" </el-table-column>
@click.stop="getdetail('审核', scope.row.id)" v-if="scope.row.domainInfo.examineState == '0'">审核</span> <el-table-column prop="workTag" label="标签"> </el-table-column>
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;" <el-table-column prop="typeName" label="类型">
@click.stop="getdetails('详情', scope.row)">详情</span> <template #default="scope">
</template> <span>{{ scope.row.typeName }} - {{ scope.row.typesName }}</span>
</el-table-column> </template>
</el-table> </el-table-column>
</div> <el-table-column prop="examineState" label="审核状态">
<div class="scTable-page"> <template #default="scope">
<div class="scTable-pagination"> <span v-if="scope.row.examineState == '0'" style="color: #409eff"
<el-pagination background :small="true" layout="total, prev, pager, next, jumper" :total="total" >未审核</span
:page-size="pageSize" v-model:currentPage="currentPage" >
@current-change="paginationChange"></el-pagination> <span
</div> v-else-if="scope.row.examineState == '1'"
<div class="scTable-do"> style="color: #67c23a"
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button> >通过</span
</div> >
</div> <span
</div> v-else-if="scope.row.examineState == '2'"
<el-dialog v-model="open" :title="title" destroy-on-close :before-close="before" width="50%"> style="color: #f56c6c"
<el-form :model="formState" label-width="100px"> >拒绝</span
<el-form-item label="状态" name="userName"> >
<el-radio-group v-model="formState.resource"> </template>
<el-radio :label="true">通过</el-radio> </el-table-column>
<el-radio :label="false">不通过</el-radio> <el-table-column prop="examineUser" label="审核人">
</el-radio-group> <template #default="scope">
</el-form-item> <span v-if="scope.row.examineUser">{{
<!-- <el-form-item label="简介" name="artAtt"> scope.row.examineUser
}}</span>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column prop="examineDate" label="审核时间">
<template #default="scope">
<span v-if="scope.row.examineDate">{{
scope.row.examineDate
}}</span>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<span
style="
font-size: 14px;
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>
</el-table-column>
</el-table>
</div>
<div class="scTable-page">
<div class="scTable-pagination">
<el-pagination
background
:small="true"
layout="total, prev, pager, next, jumper"
:total="total"
:page-size="pageSize"
v-model:currentPage="currentPage"
@current-change="paginationChange"
></el-pagination>
</div>
<div class="scTable-do">
<el-button
@click="refresh"
icon="el-icon-refresh"
circle
style="margin-left: 15px"
></el-button>
</div>
</div>
</div>
<el-dialog
v-model="open"
:title="title"
destroy-on-close
:before-close="before"
width="50%"
>
<el-form :model="formState" label-width="100px">
<el-form-item label="状态" name="userName">
<el-radio-group v-model="formState.resource">
<el-radio :label="true">通过</el-radio>
<el-radio :label="false">不通过</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="简介" name="artAtt">
<el-input type="textarea" v-model="formState.desc"></el-input> <el-input type="textarea" v-model="formState.desc"></el-input>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<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>
确定 </span>
</el-button> </template>
</span> </el-dialog>
</template> <el-dialog
</el-dialog> v-model="opens"
<el-dialog v-model="opens" :title="title" destroy-on-close :before-close="before" width="50%"> :title="title"
<el-form :model="detailForm" label-width="100px"> destroy-on-close
<el-form-item label="商品名称"> :before-close="before"
<el-input v-model="detailForm.name"></el-input> width="50%"
</el-form-item> >
<el-form-item label="作者"> <el-form :model="detailForm" label-width="100px">
<el-input v-model="detailForm.userName"></el-input> <el-form-item label="商品名称">
</el-form-item> <el-input v-model="detailForm.goodsName"></el-input>
<!-- <el-form-item label="简介"> </el-form-item>
<el-form-item label="作者">
<el-input v-model="detailForm.userName"></el-input>
</el-form-item>
<!-- <el-form-item label="简介">
<el-input type="textarea" v-model="detailForm.introduce"></el-input> <el-input type="textarea" v-model="detailForm.introduce"></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="网盘地址"> <el-form-item label="网盘地址">
<el-input v-model="detailForm.wpPath"></el-input> <el-input v-model="detailForm.wpPath"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="提取码"> <el-form-item label="提取码">
<el-input v-model="detailForm.code"></el-input> <el-input v-model="detailForm.code"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件"> <el-form-item label="文件">
<sc-upload-multiple :accept="''" v-model="imgList"></sc-upload-multiple> <sc-upload-multiple :accept="''" v-model="imgList"></sc-upload-multiple>
<!-- <div v-for="(v,i) in imgList" :key="i"> <!-- <div v-for="(v,i) in imgList" :key="i">
<a :href="v" target="_blank">{{ v }}</a> <a :href="v" target="_blank">{{ v }}</a>
</div> --> </div> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<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>
确定 </span>
</el-button> </template>
</span> </el-dialog>
</template>
</el-dialog>
</template> </template>
<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,
}, },
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",
created() { label: "未审核",
this.$nextTick(() => { },
this.upTableHeight() ],
}) };
}, },
mounted() { created() {
this.getData() this.$nextTick(() => {
}, this.upTableHeight();
methods: { });
// },
upTableHeight() { mounted() {
this.tableHeight = (this.$refs.scTableMain.offsetHeight - 50) + "px" this.getData();
}, },
handleSelectionChange(val) { methods: {
this.multipleSelection = val; //
let arr = [] upTableHeight() {
this.multipleSelection.forEach(item => { this.tableHeight = this.$refs.scTableMain.offsetHeight - 50 + "px";
arr.push(item.id) },
}) handleSelectionChange(val) {
this.ids = arr.join(',') this.multipleSelection = val;
}, let arr = [];
// this.multipleSelection.forEach((item) => {
getData() { arr.push(item.id);
let parame = { });
typesOf:"1", this.ids = arr.join(",");
examineState: this.selectValue, },
title: this.value1, //
page: this.currentPage, getData() {
size: this.pageSize let parame = {
} typesOf: "1",
http.get("/api/goods/examineList", parame).then((res) => { examineState: this.selectValue,
if (res.code == 200) { title: this.value1,
this.tableData = res.data.records page: this.currentPage,
this.total = res.data.total size: this.pageSize,
this.currentPage = res.data.current };
this.loading = false http
} .get("/api/goods/examineList", parame)
}).catch(err => { .then((res) => {
console.log(err) if (res.code == 200) {
this.loading = false this.tableData = res.data.records;
}); this.total = res.data.total;
}, this.currentPage = res.data.current;
// this.loading = false;
paginationChange() { }
this.getData() })
}, .catch((err) => {
// console.log(err);
refresh() { this.loading = false;
this.$refs.scTable.clearSelection(); });
this.loading = true },
this.getData() //
}, paginationChange() {
before() { this.getData();
this.open = false; },
this.opens = false; //
// router.replace(); refresh() {
}, this.$refs.scTable.clearSelection();
handleClose() { this.loading = true;
this.open = false; this.getData();
this.formState.desc = '' },
this.formState.resource = true before() {
}, this.open = false;
onFinish() { this.opens = false;
// let parame = { // router.replace();
// ids: this.ids, },
// examineState: this.formState.resource handleClose() {
// } this.open = false;
http.post("/api/goods/examine?examineState=" + this.formState.resource + '&ids=' + this.ids).then((res) => { this.formState.desc = "";
if (res.code == 200) { this.formState.resource = true;
this.tableData = [] },
this.total = 0 onFinish() {
this.currentPage = 1 // let parame = {
this.loading = true // ids: this.ids,
this.open = false // examineState: this.formState.resource
this.getData() // }
} http
}).catch(err => { .post(
console.log(err) "/api/goods/examine?examineState=" +
}); this.formState.resource +
}, "&ids=" +
getdetail(title, value) { this.ids
this.title = title )
this.open = true .then((res) => {
this.ids = value if (res.code == 200) {
}, this.tableData = [];
getdetails(title, value) { this.total = 0;
this.imgList = [] this.currentPage = 1;
this.title = title this.loading = true;
this.opens = true this.open = false;
this.detailForm.name = value.domainInfo.name this.getData();
this.detailForm.wpPath = value.domainInfo.wpPath }
this.detailForm.code = value.domainInfo.code })
this.detailForm.userName=value.shopInfo.userName .catch((err) => {
let img1 = value.domainInfo.file.split(',') console.log(err);
if (img1.length > 0) { });
img1.forEach(ele => { },
this.imgList.push({ getdetail(title, value) {
path: ele, this.title = title;
preview: ele this.open = true;
}) this.ids = value;
}) },
} getdetails(title, value) {
this.imgList = [];
}, this.title = title;
handleCloses() { this.opens = true;
this.opens = false; this.detailForm.goodsName = value.goodsName;
this.detailForm = {} this.detailForm.userName = value.shopInfo.userName;
this.imgList = [] this.detailForm.wpPath = value.panUrl;
}, this.detailForm.code = value.panCode;
} let img1 = null;
} if (value.file) {
img1 = value.file.split(",");
if (img1.length > 0) {
img1.forEach((ele) => {
this.imgList.push({
path: ele,
preview: ele,
});
});
}
}
},
handleCloses() {
this.opens = false;
this.detailForm = {};
this.imgList = [];
},
},
};
</script> </script>
<style scoped> <style scoped>
.scTable { .scTable {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100% - 60px); height: calc(100% - 60px);
} }
.scTable-table { .scTable-table {
flex: 1; flex: 1;
} }
.scTable-page { .scTable-page {
height: 50px; height: 50px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 15px; padding: 0 15px;
background-color: #fff; background-color: #fff;
} }
.scTable-do { .scTable-do {
white-space: nowrap; white-space: nowrap;
} }
</style> </style>