Commit 4c84831b authored by 黄奎's avatar 黄奎

页面修改

parent 7d300bd0
...@@ -2,19 +2,9 @@ ...@@ -2,19 +2,9 @@
<div class="brandManagement"> <div class="brandManagement">
<div class="el-card__header"> <div class="el-card__header">
<span>品牌列表</span> <span>品牌列表</span>
<div <div style="display: flex; flex-direction: row; align-items: center" v-if="!readonly">
style="display: flex; flex-direction: row; align-items: center" <el-button type="primary" class="el-button--small" @click="addTopic">新增</el-button>
v-if="!readonly" <el-button class="el-button--small" @click="dialogVisible = true" style="float: right" type="primary">批量导出
>
<el-button type="primary" class="el-button--small" @click="addTopic"
>新增</el-button
>
<el-button
class="el-button--small"
@click="dialogVisible = true"
style="float: right"
type="primary"
>批量导出
</el-button> </el-button>
</div> </div>
</div> </div>
...@@ -22,89 +12,42 @@ ...@@ -22,89 +12,42 @@
<div style="display: flex; flex-direction: row; align-items: center"> <div style="display: flex; flex-direction: row; align-items: center">
<div class="block"> <div class="block">
<span style="margin-left: 10px">品牌名</span> <span style="margin-left: 10px">品牌名</span>
<el-input <el-input @keyup.enter.native="(msg.pageIndex = 1), getList()" @clear="(msg.pageIndex = 1), getList()"
@keyup.enter.native="(msg.pageIndex = 1), getList()" style="display: inline-block; width: 225px; height: 30px" placeholder="请输入品牌名" v-model="msg.BrandName"
@clear="(msg.pageIndex = 1), getList()" size="small" clearable>
style="display: inline-block; width: 225px; height: 30px"
placeholder="请输入品牌名"
v-model="msg.BrandName"
size="small"
clearable
>
</el-input> </el-input>
<span style="margin-left: 10px">商铺性质</span> <span style="margin-left: 10px">商铺性质</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 10px"
class="w100" v-model="msg.ProjectType" size="small" placeholder="请选择商铺性质">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 10px"
v-model="msg.ProjectType"
size="small"
placeholder="请选择商铺性质"
>
<el-option label="不限" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option <el-option :label="x.Name" :value="x.Id" v-for="(x, y) in ProjectTypeList" :key="y"></el-option>
:label="x.Name"
:value="x.Id"
v-for="(x, y) in ProjectTypeList"
:key="y"
></el-option>
</el-select> </el-select>
<span style="margin-left: 10px">品牌分类</span> <span style="margin-left: 10px">品牌分类</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 10px"
class="w100" v-model="msg.BrandClassId" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 10px"
v-model="msg.BrandClassId"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option <el-option :label="x.ClassName" :value="x.ID" v-for="(x, y) in BrandClassList" :key="y"></el-option>
:label="x.ClassName"
:value="x.ID"
v-for="(x, y) in BrandClassList"
:key="y"
></el-option>
</el-select> </el-select>
<span style="margin-left: 10px">认证用户</span> <span style="margin-left: 10px">认证用户</span>
<el-select <el-select size="small" v-model="msg.UserId" :filter-method="ChangeListName" filterable
size="small" @change="(msg.pageIndex = 1), getList()" placeholder="请选择">
v-model="msg.UserId"
:filter-method="ChangeListName"
filterable
@change="(msg.pageIndex = 1), getList()"
placeholder="请选择"
>
<el-option label="不限" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option <el-option v-for="item in userList" :key="item.Id" :label="item.Name" :value="item.Id">
v-for="item in userList"
:key="item.Id"
:label="item.Name"
:value="item.Id"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div <div style="
style="
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
" ">
>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>上下水</span> <span>上下水</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px"
class="w100" v-model="msg.Plumbing" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.Plumbing"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -112,14 +55,8 @@ ...@@ -112,14 +55,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>管径</span> <span>管径</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px"
class="w100" v-model="msg.Caliber" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.Caliber"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -127,14 +64,8 @@ ...@@ -127,14 +64,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>排污</span> <span>排污</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px" v-model="msg.Sewage"
class="w100" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.Sewage"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -142,14 +73,8 @@ ...@@ -142,14 +73,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>燃气</span> <span>燃气</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px" v-model="msg.RanQi"
class="w100" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.RanQi"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -157,14 +82,8 @@ ...@@ -157,14 +82,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>排烟量</span> <span>排烟量</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px" v-model="msg.PaiYan"
class="w100" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.PaiYan"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -172,14 +91,8 @@ ...@@ -172,14 +91,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>空调</span> <span>空调</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px"
class="w100" v-model="msg.KongTiao" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.KongTiao"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -187,14 +100,8 @@ ...@@ -187,14 +100,8 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>新风</span> <span>新风</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px"
class="w100" v-model="msg.XinFeng" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.XinFeng"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
...@@ -202,29 +109,18 @@ ...@@ -202,29 +109,18 @@
</div> </div>
<div class="block" style="margin-top: 15px; margin-left: 10px"> <div class="block" style="margin-top: 15px; margin-left: 10px">
<span>成都落地</span> <span>成都落地</span>
<el-select <el-select class="w100" @change="(msg.pageIndex = 1), getList()" style="margin-left: 5px"
class="w100" v-model="msg.IsInChengdu" size="small" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
style="margin-left: 5px"
v-model="msg.IsInChengdu"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="-1"></el-option> <el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<!-- <el-option label="否" :value="0"></el-option> --> <!-- <el-option label="否" :value="0"></el-option> -->
</el-select> </el-select>
</div> </div>
</div> </div>
</div> </div>
<div style="padding: 20px; background: #fff"> <div style="padding: 20px; background: #fff">
<el-table <el-table :data="dataList" header-cell-class-name="headClass" style="width: 100%" border>
:data="dataList"
header-cell-class-name="headClass"
style="width: 100%"
border
>
<el-table-column prop="Id" label="ID" width="100"> <el-table-column prop="Id" label="ID" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span @click="goRecruit(scope.row.ID)">{{ scope.row.ID }}</span> <span @click="goRecruit(scope.row.ID)">{{ scope.row.ID }}</span>
...@@ -235,12 +131,8 @@ ...@@ -235,12 +131,8 @@
<el-table-column prop="BrandName" label="品牌"> </el-table-column> <el-table-column prop="BrandName" label="品牌"> </el-table-column>
<el-table-column prop="Logo" label="Logo" width="100"> <el-table-column prop="Logo" label="Logo" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <el-image v-if="scope.row.Logo" :src="scope.row.Logo" style="width: 50px"
v-if="scope.row.Logo" :preview-src-list="scope.row.LogoList">
:src="scope.row.Logo"
style="width: 50px"
:preview-src-list="scope.row.LogoList"
>
</el-image> </el-image>
</template> </template>
</el-table-column> </el-table-column>
...@@ -248,10 +140,8 @@ ...@@ -248,10 +140,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="BuiltUpArea" label="建筑面积" width="200"> <el-table-column prop="BuiltUpArea" label="建筑面积" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span>{{ scope.row.BuiltUpArea }}
>{{ scope.row.BuiltUpArea }} {{ scope.row.EndBuiltUpArea }}</span>
{{ scope.row.EndBuiltUpArea }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="ProjectName" label="商铺性质" width="150"> <el-table-column prop="ProjectName" label="商铺性质" width="150">
...@@ -260,330 +150,321 @@ ...@@ -260,330 +150,321 @@
</el-table-column> </el-table-column>
<el-table-column prop="CustomerType" label="客群定位" width="160"> <el-table-column prop="CustomerType" label="客群定位" width="160">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="UserName" width="100" label="认证用户"></el-table-column>
prop="UserName"
width="100"
label="认证用户"
></el-table-column>
<el-table-column fixed="right" label="操作" width="120"> <el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope" v-if="!readonly"> <template slot-scope="scope" v-if="!readonly">
<el-tooltip <el-tooltip class="item" effect="dark" content="编辑" placement="top">
class="item" <img src="../../assets/img/setup/edit.png" alt="" class="imgstyle" @click="Edit(scope.row)" />
effect="dark"
content="编辑"
placement="top"
>
<img
src="../../assets/img/setup/edit.png"
alt=""
class="imgstyle"
@click="Edit(scope.row)"
/>
</el-tooltip> </el-tooltip>
<el-tooltip <el-tooltip class="item" effect="dark" content="删除" placement="top">
class="item" <img src="../../assets/img/setup/del.png" alt="" class="imgstyle" @click="delete_b(scope.row)" />
effect="dark"
content="删除"
placement="top"
>
<img
src="../../assets/img/setup/del.png"
alt=""
class="imgstyle"
@click="delete_b(scope.row)"
/>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination style="text-align: right" background @current-change="handleCurrentChange"
style="text-align: right" :page-size="msg.pageSize" layout="total, prev, pager, next" :current-page.sync="msg.pageIndex"
background :total="pageCount">
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="total, prev, pager, next"
:current-page.sync="msg.pageIndex"
:total="pageCount"
>
</el-pagination> </el-pagination>
</div> </div>
<!-- 选择导出信息 --> <!-- 选择导出信息 -->
<el-dialog title="选择导出信息" :visible.sync="dialogVisible" width="960px"> <el-dialog title="选择导出信息" :visible.sync="dialogVisible" width="960px">
<el-form <div v-loading="downLoadLoading" :element-loading-text="loadingText">
style="border: 1px solid #f0f2f7" <el-form style="border: 1px solid #f0f2f7" :model="addMsg" ref="addMsg" label-width="100px">
:model="addMsg" <div style="
ref="addMsg"
label-width="100px"
>
<div
style="
box-sizing: border-box; box-sizing: border-box;
background-color: #f3f5f6; background-color: #f3f5f6;
width: 100%; width: 100%;
padding-left: 20px; padding-left: 20px;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
" ">
> <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
<el-checkbox </el-checkbox>
:indeterminate="isIndeterminate" </div>
v-model="checkAll" <div style="margin: 15px 0"></div>
@change="handleCheckAllChange" <div style="padding: 10px 25px 20px">
>全选 <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
</el-checkbox> <el-checkbox style="margin-bottom: 10px; width: 135px" v-for="city in cities" :label="city.Id"
</div> :key="city.Name">
<div style="margin: 15px 0"></div> {{ city.Name }}</el-checkbox>
<div style="padding: 10px 25px 20px"> </el-checkbox-group>
<el-checkbox-group </div>
v-model="checkedCities" </el-form>
@change="handleCheckedCitiesChange" <div style="text-align: right; margin-top: 20px">
> <el-button size="small" type="primary" @click="Export">导出</el-button>
<el-checkbox
style="margin-bottom: 10px; width: 135px"
v-for="city in cities"
:label="city.Id"
:key="city.Name"
>
{{ city.Name }}</el-checkbox
>
</el-checkbox-group>
</div> </div>
</el-form>
<div style="text-align: right; margin-top: 20px">
<el-button size="small" type="primary" @click="Export">导出</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { import {
name: "brandManagement", setInterval,
data() { clearInterval
return { } from 'timers';
msg: { export default {
pageIndex: 1, name: "brandManagement",
pageSize: 20, data() {
BrandName: "", //品牌名 return {
ProjectType: 0, //商铺性质 msg: {
Plumbing: -1, //上下水(0-否1-有) pageIndex: 1,
Caliber: -1, //管径(0-否1-有) pageSize: 20,
Sewage: -1, //排污(0-否1-有) BrandName: "", //品牌名
RanQi: -1, //燃气(0-否1-有) ProjectType: 0, //商铺性质
DianLiang: "", //电量(0-否1-有) Plumbing: -1, //上下水(0-否1-有)
PaiYan: -1, //排烟量(0-否1-有) Caliber: -1, //管径(0-否1-有)
KongTiao: -1, //空调(0-否1-有) Sewage: -1, //排污(0-否1-有)
XinFeng: -1, //新风(0-否1-有) RanQi: -1, //燃气(0-否1-有)
IsInChengdu:-1,//成都落地 DianLiang: "", //电量(0-否1-有)
BrandClassId: 0, //分类 PaiYan: -1, //排烟量(0-否1-有)
ExcelEnumIds: [], KongTiao: -1, //空调(0-否1-有)
UserId: 0, //用户认证 XinFeng: -1, //新风(0-否1-有)
PrizeId: 0, IsInChengdu: -1, //成都落地
}, BrandClassId: 0, //分类
usermsg: { ExcelEnumIds: [],
pageIndex: 1, UserId: 0, //用户认证
pageSize: 20, PrizeId: 0,
Name: "", },
Source: 0, usermsg: {
MemberGrade: 0, pageIndex: 1,
Id: 0, pageSize: 20,
Moblie: "", Name: "",
}, Source: 0,
userList: [], MemberGrade: 0,
addMsg: {}, Id: 0,
dialogVisible: false, Moblie: "",
dataList: [], },
checkAll: false, userList: [],
checkedCities: [], addMsg: {},
cities: [], dialogVisible: false,
cityOptions: [], dataList: [],
isIndeterminate: false, checkAll: false,
pageCount: 0, checkedCities: [],
loading: false, cities: [],
BrandClassList: [], //品牌分类列表 cityOptions: [],
ProjectTypeList: [], //商铺性质列表 isIndeterminate: false,
readonly: false, pageCount: 0,
}; loading: false,
}, BrandClassList: [], //品牌分类列表
created() { ProjectTypeList: [], //商铺性质列表
if (this.$route.query && this.$route.query.UserId) { readonly: false,
this.msg.UserId = Number(this.$route.query.UserId); downLoadLoading: false, //导出Loading
this.usermsg.Id = Number(this.$route.query.UserId); download_timer: null, //下载文件timer
this.getuserList(1); loadingText: "", //下载文件提示名称
} else { };
this.getuserList();
}
this.getBrandClassList();
this.getProjectType();
this.getDown();
},
mounted() {
if (this.$route.query && this.$route.query.readonly) {
this.readonly = this.$route.query.readonly;
}
if (this.$route.query && this.$route.query.PrizeId) {
this.msg.PrizeId = this.$route.query.PrizeId;
}
this.getList();
},
methods: {
ChangeListName(val) {
this.usermsg.Name = val;
this.getuserList();
},
getuserList(type = 0) {
this.apipost(
"/api/user/GetMemberUserDropDownList",
this.usermsg,
(res) => {
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.userList = pageData;
if (type == 1) {
this.usermsg.Id = 0;
}
}
}
);
}, },
Export() { created() {
this.msg.ExcelEnumIds = this.checkedCities; if (this.$route.query && this.$route.query.UserId) {
let msg = JSON.parse(JSON.stringify(this.msg)); this.msg.UserId = Number(this.$route.query.UserId);
if (!msg.Id || msg.Id == "") { this.usermsg.Id = Number(this.$route.query.UserId);
msg.Id = 0; this.getuserList(1);
} else {
this.getuserList();
} }
this.GetLocalFile( this.getBrandClassList();
"/api/Trade/GetBrandListToExcel", this.getProjectType();
msg, this.getDown();
"品牌信息.xls",
null,
() => {
this.checkedCities = [];
}
);
},
getDown() {
this.cityOptions = [];
this.apipost("/api/Trade/GetBusinessExportEnumList", {}, (res) => {
this.cities = res.data.data;
let data = res.data.data;
data.forEach((item) => {
this.cityOptions.push(item.Id);
});
});
},
//获取商铺性质
getProjectType() {
this.apipost("/api/Trade/GetProjectTypeEnumList", {}, (res) => {
if (res.data.resultCode == 1) {
this.ProjectTypeList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
handleCheckAllChange(val) {
this.checkedCities = val ? this.cityOptions : [];
this.isIndeterminate = false;
}, },
handleCheckedCitiesChange(value) { mounted() {
let checkedCount = value.length; if (this.$route.query && this.$route.query.readonly) {
this.checkAll = checkedCount === this.cities.length; this.readonly = this.$route.query.readonly;
this.isIndeterminate = }
checkedCount > 0 && checkedCount < this.cities.length; if (this.$route.query && this.$route.query.PrizeId) {
}, this.msg.PrizeId = this.$route.query.PrizeId;
getList() { }
this.apipost("/api/Trade/GetBrandPageList", this.msg, (res) => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.pageCount = res.data.data.count;
this.dataList.forEach((x) => {
x.LogoList = [];
x.LogoList.push(x.Logo);
});
} else {
this.Error(res.data.message);
}
});
},
getBrandClassList() {
this.apipost("/api/Trade/GetBrandClassList", {}, (res) => {
if (res.data.resultCode == 1) {
this.BrandClassList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList(); this.getList();
}, },
//新增品牌 methods: {
addTopic() { ChangeListName(val) {
this.$router.push("/addbrand"); this.usermsg.Name = val;
}, this.getuserList();
//删除品牌 },
delete_b(row) { getuserList(type = 0) {
let that = this; this.apipost(
that.Confirm("是否删除?", function () { "/api/user/GetMemberUserDropDownList",
that.apipost( this.usermsg,
"/api/Trade/RemoveBrand",
{
Id: row.ID,
},
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
that.Success(res.data.message); let pageData = res.data.data.pageData;
that.getList(); this.userList = pageData;
} else { if (type == 1) {
that.Error(res.data.message); this.usermsg.Id = 0;
}
} }
} }
); );
}); },
}, //批量导出
//编辑数据 Export() {
Edit(row) { this.msg.ExcelEnumIds = this.checkedCities;
this.$router.push({ let msg = JSON.parse(JSON.stringify(this.msg));
name: "addbrand", if (!msg.Id || msg.Id == "") {
query: { msg.Id = 0;
ID: row.ID,
blank: "y",
},
});
},
//切换
changeSwitch(item) {
let msg = {
Id: item.Id,
IsOpen: item.IsOpen,
};
this.apipost("/api/Education/UpdateEducationTalkShow", msg, (res) => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} }
}); this.checkedCities = [];
this.downLoadLoading = true;
this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";
var that = this;
this.download_timer = setInterval(function () {
that.checkFile(msg)
}, 2000);
},
checkFile(msg) {
var that = this;
this.apipost(
"/api/Trade/CheckBrandFile",
msg,
(res) => {
if (res.data.resultCode == 1) {
clearInterval(this.download_timer);
this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";;
var filepath = res.data.data;
var key = res.data.message;
var params = {
fileUrl: filepath
}
var deleteparams = {
key: key
};
that.GetLocalFile(
"/api/Trade/GetFile", params, "品牌信息.xls", null,
() => {
that.downLoadLoading = false;
that.loadingText = "";
that.apipost("/api/Trade/DeleteKey", deleteparams, (res) => {
})
}
);
}
}
);
},
getDown() {
this.cityOptions = [];
this.apipost("/api/Trade/GetBusinessExportEnumList", {}, (res) => {
this.cities = res.data.data;
let data = res.data.data;
data.forEach((item) => {
this.cityOptions.push(item.Id);
});
});
},
//获取商铺性质
getProjectType() {
this.apipost("/api/Trade/GetProjectTypeEnumList", {}, (res) => {
if (res.data.resultCode == 1) {
this.ProjectTypeList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
handleCheckAllChange(val) {
this.checkedCities = val ? this.cityOptions : [];
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate =
checkedCount > 0 && checkedCount < this.cities.length;
},
getList() {
this.apipost("/api/Trade/GetBrandPageList", this.msg, (res) => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.pageCount = res.data.data.count;
this.dataList.forEach((x) => {
x.LogoList = [];
x.LogoList.push(x.Logo);
});
} else {
this.Error(res.data.message);
}
});
},
getBrandClassList() {
this.apipost("/api/Trade/GetBrandClassList", {}, (res) => {
if (res.data.resultCode == 1) {
this.BrandClassList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
//新增品牌
addTopic() {
this.$router.push("/addbrand");
},
//删除品牌
delete_b(row) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/Trade/RemoveBrand", {
Id: row.ID,
},
(res) => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
} else {
that.Error(res.data.message);
}
}
);
});
},
//编辑数据
Edit(row) {
this.$router.push({
name: "addbrand",
query: {
ID: row.ID,
blank: "y",
},
});
},
//切换
changeSwitch(item) {
let msg = {
Id: item.Id,
IsOpen: item.IsOpen,
};
this.apipost("/api/Education/UpdateEducationTalkShow", msg, (res) => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
}
});
},
}, },
}, };
};
</script> </script>
<style> <style>
.brandManagement .el-card__header { .brandManagement .el-card__header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
background: #fff; background: #fff;
} }
.brandManagement .content {
background: #fff;
margin-top: 10px;
padding: 15px;
box-sizing: border-box;
}
.brandManagement .content {
background: #fff;
margin-top: 10px;
padding: 15px;
box-sizing: border-box;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment