parent
5aa4bf85a4
commit
3c38242455
@ -1,44 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询广告列表
|
||||
export function listPoster(query) {
|
||||
return request({
|
||||
url: '/netEwm/poster/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/netEwm/poster/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询广告详细
|
||||
export function getPoster(id) {
|
||||
return request({
|
||||
url: '/netEwm/poster/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/netEwm/poster/" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增广告
|
||||
export function addPoster(data) {
|
||||
return request({
|
||||
url: '/netEwm/poster',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/netEwm/poster",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改广告
|
||||
export function updatePoster(data) {
|
||||
return request({
|
||||
url: '/netEwm/poster',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/netEwm/poster",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除广告
|
||||
export function delPoster(id) {
|
||||
return request({
|
||||
url: '/netEwm/poster/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/netEwm/poster/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
//广告批量分配给商户
|
||||
export function batchAllocation(data) {
|
||||
return request({
|
||||
url: "/netEwm/poster/batchAllocation",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<!-- 配方广告 -->
|
||||
<el-dialog
|
||||
title="分配广告"
|
||||
:visible.sync="fpShow"
|
||||
width="1200px"
|
||||
append-to-body
|
||||
>
|
||||
<div class="fp-table app-container" ref="appMain">
|
||||
<div ref="search">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="广告名称" prop="posterName">
|
||||
<el-input
|
||||
v-model="queryParams.posterName"
|
||||
placeholder="请输入广告名称"
|
||||
clearable
|
||||
@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>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="posterList" :height="tableHeigth">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="广告名称" align="center" prop="posterName" />
|
||||
<el-table-column label="有效起始时间" align="center" prop="startTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效结束时间" align="center" prop="endTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="点击预览广告"
|
||||
align="center"
|
||||
prop="posterName"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" :href="baseUrl + scope.row.videoPath">{{
|
||||
scope.row.videoPath
|
||||
}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="shanghuPosterId == scope.row.id"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleFp(scope.row)"
|
||||
>分配</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div ref="pagination">
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPoster, batchAllocation } from "@/api/netEwm/poster";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
loading: false,
|
||||
posterList: [],
|
||||
total: 0,
|
||||
fpShow: false,
|
||||
tableHeigth: 0,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
posterName: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
fpData: {},
|
||||
shanghuPosterId: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openDialog(data, posterId) {
|
||||
this.shanghuPosterId = posterId;
|
||||
this.fpData = data;
|
||||
this.getList();
|
||||
},
|
||||
/**适配高度 */
|
||||
getHeigth() {
|
||||
this.fpShow = true;
|
||||
let _this = this;
|
||||
this.$nextTick(() => {
|
||||
let total = this.$refs.appMain.clientHeight;
|
||||
let search = this.$refs.search.clientHeight;
|
||||
_this.tableHeigth = total - search - 40;
|
||||
});
|
||||
},
|
||||
/** 查询广告列表 */
|
||||
getList() {
|
||||
this.getHeigth();
|
||||
this.loading = true;
|
||||
listPoster(this.queryParams).then((response) => {
|
||||
this.posterList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleFp(row) {
|
||||
let _this = this;
|
||||
this.fpData.posterId = row.id;
|
||||
this.$modal
|
||||
.confirm("您确定要将该广告分配给当前商户吗?")
|
||||
.then(function () {
|
||||
return batchAllocation(_this.fpData);
|
||||
})
|
||||
.then(() => {
|
||||
_this.shanghuPosterId = row.id;
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("分配成功");
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.fp-table {
|
||||
height: 550px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue