parent
614fca2709
commit
1cde61422e
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
class="my-form"
|
||||
>
|
||||
<el-form-item label="商户名称" prop="posName">
|
||||
<el-input v-model="form.posName" placeholder="请输入商户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="linkMan">
|
||||
<el-input v-model="form.linkMan" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phoneNumber">
|
||||
<el-input v-model="form.phoneNumber" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="城市" prop="city">
|
||||
<el-input v-model="form.city" placeholder="请输入城市" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址信息" prop="address">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.address"
|
||||
placeholder="请输入地址信息"
|
||||
:rows="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频广告">
|
||||
<div class="info-container">
|
||||
<video
|
||||
:src="form.videoPath"
|
||||
class="avatar"
|
||||
controls="controls"
|
||||
></video>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="submitForm"
|
||||
>提交</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getShanghu, updateShanghu, addShanghu } from "@/api/netEwm/shanghu";
|
||||
import { getPoster } from "@/api/netEwm/poster";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
posName: [
|
||||
{ required: true, message: "商户名称不能为空", trigger: "blur" },
|
||||
],
|
||||
phoneNumber: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
],
|
||||
linkMan: [
|
||||
{ required: true, message: "联系人不能为空", trigger: "blur" },
|
||||
],
|
||||
city: [{ required: true, message: "城市不能为空", trigger: "blur" }],
|
||||
address: [
|
||||
{ required: true, message: "地址信息不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
getShanghu(2).then((response) => {
|
||||
if (response.data.posterId) {
|
||||
getPoster(response.data.posterId).then((info) => {
|
||||
let url = {
|
||||
videoPath: this.baseUrl + info.data.videoPath,
|
||||
};
|
||||
this.form = { ...response.data, ...url };
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateShanghu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.my-form {
|
||||
margin: auto;
|
||||
width: 1000px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,167 @@
|
||||
<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="68px"
|
||||
>
|
||||
<el-form-item label="商户名称" prop="posName">
|
||||
<el-input
|
||||
v-model="queryParams.posName"
|
||||
placeholder="请输入商户名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="linkMan">
|
||||
<el-input
|
||||
v-model="queryParams.linkMan"
|
||||
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-button
|
||||
type="warning"
|
||||
icon="el-icon-document-copy"
|
||||
size="mini"
|
||||
@click="handleMultiplefp"
|
||||
:disabled="multiple"
|
||||
>批量分配</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="shanghuList"
|
||||
@selection-change="handleSelectionChange"
|
||||
:height="tableHeigth"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="商户名称" align="center" prop="posName" />
|
||||
<el-table-column label="联系人" align="center" prop="linkMan" />
|
||||
<el-table-column label="手机号" align="center" prop="phoneNumber" />
|
||||
<el-table-column label="城市" align="center" prop="city" />
|
||||
</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 { listShanghu } from "@/api/netEwm/shanghu";
|
||||
import { batchAllocation } from "@/api/netEwm/poster";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//分配弹出层
|
||||
fpShow: false,
|
||||
loading: false,
|
||||
shanghuList: [],
|
||||
total: 0,
|
||||
tableHeigth: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
posName: null,
|
||||
linkMan: null,
|
||||
city: null,
|
||||
},
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
ids: [],
|
||||
posterId: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openDialog(id) {
|
||||
this.posterId = id;
|
||||
this.getHeigth();
|
||||
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;
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
//批量分配广告
|
||||
handleMultiplefp() {
|
||||
let data = {
|
||||
posterId: this.posterId,
|
||||
shanghuIds: this.ids,
|
||||
};
|
||||
batchAllocation(data).then((res) => {
|
||||
this.$modal.msgSuccess("分配成功");
|
||||
});
|
||||
},
|
||||
/** 查询商户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listShanghu(this.queryParams).then((response) => {
|
||||
this.shanghuList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
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