故障审核和广告审核完善

This commit is contained in:
SjS 2025-04-21 18:31:20 +08:00
parent f2692ef3aa
commit d03ee7792f
2 changed files with 466 additions and 345 deletions

View File

@ -42,3 +42,12 @@ export function delAd(adId) {
method: 'delete' method: 'delete'
}) })
} }
export function handleAudit(data){
return request({
url: '/bst/ad/handle',
method: 'put',
data: data
})
}

View File

@ -1,353 +1,465 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="跳转链接" prop="url">
<el-input
v-model="queryParams.url"
placeholder="请输入跳转链接"
clearable
@input="handleQuery"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-has-permi="['bst:ad:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-has-permi="['bst:ad:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="adList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="广告所属" align="center" prop="belong">
<template slot-scope="scope">
<dict-tag :options="dict.type.ad_belong" :value="scope.row.belong"/>
</template>
</el-table-column>
<el-table-column label="所属运营区" align="center" prop="areaName">
<template slot-scope="scope">
<span>{{ scope.row.areaName || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="广告图片" align="center" prop="picture" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="跳转类型" align="center" prop="urlType">
<template slot-scope="scope">
<dict-tag :options="dict.type.ad_url_type" :value="scope.row.urlType"/>
</template>
</el-table-column>
<el-table-column label="跳转链接" align="center" prop="url" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-has-permi="['bst:ad:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-has-permi="['bst:ad:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改广告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" label-width="80px" v-loading="detailLoading">
<el-form-item label="运营区" prop="areaId" >
<area-remote-select
v-model="form.areaId"
:init-options="initAreaOptions"
v-if="!detailLoading"
placeholder="请选择运营区"
style="width: 58%"
/>
</el-form-item>
<el-form-item label="广告所属" prop="belong" v-if="isSysAdmin()">
<el-select v-model="form.belong" placeholder="请选择广告所属">
<el-option
v-for="dict in dict.type.ad_belong"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="广告图片" prop="picture">
<div class="upload-wrapper">
<image-upload v-model="form.picture" :limit="1"/>
</div>
</el-form-item>
<el-form-item label="跳转类型" prop="urlType">
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
<el-option
v-for="dict in dict.type.ad_url_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="跳转链接" prop="url"> <el-form-item label="跳转链接" prop="url">
<el-input v-model="form.url" placeholder="请输入跳转链接" /> <el-input
v-model="queryParams.url"
placeholder="请输入跳转链接"
clearable
@input="handleQuery"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script> <el-row :gutter="10" class="mb8">
import { listAd, getAd, delAd, addAd, updateAd } from "@/api/bst/ad"; <el-col :span="1.5">
import { $showColumns } from '@/utils/mixins'; <el-button
import FormCol from "@/components/FormCol/index.vue"; type="primary"
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue"; plain
import {isSysAdmin} from "@/utils/permission"; icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-has-permi="['bst:ad:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-has-permi="['bst:ad:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="adList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="广告所属" align="center" prop="belong">
<template slot-scope="scope">
<dict-tag :options="dict.type.ad_belong" :value="scope.row.belong"/>
</template>
</el-table-column>
<el-table-column label="所属运营区" align="center" prop="areaName">
<template slot-scope="scope">
<span>{{ scope.row.areaName || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="广告图片" align="center" prop="picture" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="跳转类型" align="center" prop="urlType">
<template slot-scope="scope">
<dict-tag :options="dict.type.ad_url_type" :value="scope.row.urlType"/>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.ad_audit_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="跳转链接" align="center" prop="url" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['bst:ad:edit']">
{{ scope.row.auditStatus === '1' ? '审核' : '查看详情' }}
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-has-permi="['bst:ad:edit']"-->
<!-- >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-has-permi="['bst:ad:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 在index.vue的template中添加弹窗结构 -->
<el-dialog
:title="`广告详情`"
:visible.sync="detailVisible"
width="800px"
append-to-body>
<!-- 申请信息区块 -->
<div class="info-section">
<el-descriptions title="申报信息" :column="2" border>
<el-descriptions-item label="广告所属">
<dict-tag :options="dict.type.ad_belong" :value="detailForm.belong"/>
</el-descriptions-item>
<el-descriptions-item label="所属运营区">{{ detailForm.areaName }}</el-descriptions-item>
<el-descriptions-item label="广告图片" :span="2">
<image-preview :src="detailForm.picture" :width="200" />
</el-descriptions-item>
<el-descriptions-item label="跳转链接" :span="24">{{ detailForm.url }}</el-descriptions-item>
<el-descriptions-item label="跳转类型" :span="2">
<dict-tag :options="dict.type.ad_url_type" :value="detailForm.urlType"/>
</el-descriptions-item>
<el-descriptions-item label="审核状态">
<dict-tag :value="detailForm.auditStatus" :options="dict.type.ad_audit_status"/>
</el-descriptions-item>
</el-descriptions>
</div>
<!-- 审核区块 -->
<template v-if="detailForm.auditStatus === '1'">
<el-divider />
<div class="verify-area">
<el-input
v-model="verifyRemark"
type="textarea"
:rows="4"
placeholder="请输入审核意见"
style="margin:20px 0"
/>
<div class="dialog-footer" style="display: flex; justify-content: flex-end; gap: 10px;">
<el-button type="danger" @click="reject" v-hasPermi="['bst:ad:edit']"> </el-button>
<el-button type="success" @click="audit" v-hasPermi="['bst:ad:edit']"> </el-button>
</div>
</div>
</template>
<template v-if="['0','2'].includes(detailForm.auditStatus)">
<el-divider />
<el-descriptions title="审核信息" :column="1" border>
<el-descriptions-item label="审核人">{{ detailForm.verifyName || '-' }}</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ detailForm.verifyEndTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="审核意见">
<pre style="white-space: pre-wrap;">{{ detailForm.verifyRemark || '无' }}</pre>
</el-descriptions-item>
</el-descriptions>
</template>
</el-dialog>
<!-- 添加或修改广告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" label-width="80px" v-loading="detailLoading">
<el-form-item label="运营区" prop="areaId" >
<area-remote-select
v-model="form.areaId"
:init-options="initAreaOptions"
v-if="!detailLoading"
placeholder="请选择运营区"
style="width: 58%"
/>
</el-form-item>
<el-form-item label="广告所属" prop="belong" v-if="isSysAdmin()">
<el-select v-model="form.belong" placeholder="请选择广告所属">
<el-option
v-for="dict in dict.type.ad_belong"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="广告图片" prop="picture">
<div class="upload-wrapper">
<image-upload v-model="form.picture" :limit="1"/>
</div>
</el-form-item>
<el-form-item label="跳转类型" prop="urlType">
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
<el-option
v-for="dict in dict.type.ad_url_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="跳转链接" prop="url">
<el-input v-model="form.url" placeholder="请输入跳转链接" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAd, getAd, delAd, addAd, updateAd } from "@/api/bst/ad";
import { $showColumns } from '@/utils/mixins';
import FormCol from "@/components/FormCol/index.vue";
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
import {isSysAdmin} from "@/utils/permission";
import {handleAudit} from "@/api/bst/ad";
// //
const defaultSort = { const defaultSort = {
prop: "createTime", prop: "createTime",
order: "descending" order: "descending"
}
export default {
name: "Ad",
dicts:['ad_type','ad_url_type','ad_belong'],
props:{
id: {
type: [String, Number],
default: null
},
},
mixins: [$showColumns],
components: {AreaRemoteSelect, FormCol},
data() {
return {
span: 24,
//
columns: [
{key: 'adId', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'type', visible: true, label: '广告类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'areaName', visible: true, label: '所属运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'picture', visible: true, label: '广告图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'url', visible: true, label: '跳转链接', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'deleted', visible: true, label: '01', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'urlType', visible: true, label: '12', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 广
adList: [],
//
title: "",
//
open: false,
defaultSort,
//
queryParams: {
pageNum: 1,
pageSize: 20,
orderByColumn: defaultSort.prop,
isAsc: defaultSort.order,
type: null,
picture: null,
url: null,
deleted: null,
urlType: null,
belong: null
},
//
form: {},
detailLoading: false,
};
},
computed:{
initAreaOptions() {
return [{id: this.form.areaId, name: this.form.areaName}]
},
},
created() {
this.getList();
},
methods: {
isSysAdmin,
/** 当排序按钮被点击时触发 **/
onSortChange(column) {
if (column.order == null) {
this.queryParams.orderByColumn = defaultSort.prop;
this.queryParams.isAsc = defaultSort.order;
} else {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
}
this.getList();
},
/** 查询广告列表 */
getList() {
this.loading = true;
listAd(this.queryParams).then(response => {
this.adList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
adId: null,
areaId: null,
type: null,
picture: null,
url: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
deleted: null,
urlType: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.adId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const adId = row.adId || this.ids
this.detailLoading = true;
getAd(adId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改广告";
}).finally(() => {
this.detailLoading = false;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.adId != null) {
updateAd(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAd(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const adIds = row.adId || this.ids;
this.$modal.confirm('是否确认删除广告编号为"' + adIds + '"的数据项?').then(function() {
return delAd(adIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('bst/ad/export', {
...this.queryParams
}, `ad_${new Date().getTime()}.xlsx`)
}
} }
};
</script> export default {
name: "Ad",
dicts:['ad_type','ad_url_type','ad_belong','ad_audit_status'],
props:{
id: {
type: [String, Number],
default: null
},
},
mixins: [$showColumns],
components: {AreaRemoteSelect, FormCol},
data() {
return {
span: 24,
//
columns: [
{key: 'adId', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'type', visible: true, label: '广告类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'areaName', visible: true, label: '所属运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'picture', visible: true, label: '广告图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'url', visible: true, label: '跳转链接', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'auditStatus', visible: true, label: '审核状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'deleted', visible: true, label: '01', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'urlType', visible: true, label: '12', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
detailVisible: false, //
detailForm: {}, //
verifyRemark: '',
// 广
adList: [],
//
title: "",
//
open: false,
defaultSort,
//
queryParams: {
pageNum: 1,
pageSize: 20,
orderByColumn: defaultSort.prop,
isAsc: defaultSort.order,
type: null,
picture: null,
url: null,
deleted: null,
urlType: null,
belong: null
},
//
form: {},
detailLoading: false,
};
},
computed:{
initAreaOptions() {
return [{id: this.form.areaId, name: this.form.areaName}]
},
},
created() {
this.getList();
},
methods: {
//
reject() {
this.handleVerify(false);
},
//
audit() {
this.handleVerify(true);
},
//
handleVerify(Pass) {
if (!this.verifyRemark) {
this.$message.warning('请填写审核意见');
return;
}
const action = Pass ? '通过' : '驳回';
this.$modal.confirm(`确认${action}该申请吗?`).then(() => {
handleAudit({
id: this.detailForm.adId,
pass: Pass, // truefalse
verifyRemark: this.verifyRemark
}).then(() => {
this.$modal.msgSuccess(`${action}成功`);
this.detailVisible = false;
this.getList();
});
});
},
isSysAdmin,
/** 当排序按钮被点击时触发 **/
onSortChange(column) {
if (column.order == null) {
this.queryParams.orderByColumn = defaultSort.prop;
this.queryParams.isAsc = defaultSort.order;
} else {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
}
this.getList();
},
/** 查询广告列表 */
getList() {
this.loading = true;
listAd(this.queryParams).then(response => {
this.adList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
adId: null,
areaId: null,
type: null,
picture: null,
url: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
deleted: null,
urlType: null
};
this.resetForm("form");
},
/** 查看详情 */
handleView(row) {
this.loading = true;
getAd(row.adId).then(response => {
this.detailForm = response.data;
this.detailVisible = true;
this.verifyRemark = '';
}).finally(() => {
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.adId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加广告";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const adId = row.adId || this.ids
this.detailLoading = true;
getAd(adId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改广告";
}).finally(() => {
this.detailLoading = false;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.adId != null) {
updateAd(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAd(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const adIds = row.adId || this.ids;
this.$modal.confirm('是否确认删除广告编号为"' + adIds + '"的数据项?').then(function() {
return delAd(adIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('bst/ad/export', {
...this.queryParams
}, `ad_${new Date().getTime()}.xlsx`)
}
}
};
</script>