Commit 28678855 authored by Mac's avatar Mac

新增品牌列表

parent cb4985ec
<template>
<div v-loading="loading" class="addbrand">
<div class="head-title">
<span @click="CommonJump('lecturermanage')" class="blue point">品牌管理</span> / 编辑品牌管理
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:50%">
<el-form-item label="品牌名称" prop="Name" class="is-required" size="small">
<el-input v-model="addMsg.Name" placeholder="请输入品牌名称" />
</el-form-item>
<el-form-item label="头像" class="is-required" size="small">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.TeacherLogo || addMsg.TeacherLogo==''" src="../../assets/img/default.png"
style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.TeacherLogo" alt="">
</div>
</el-form-item>
<el-form-item label="关联用户" size="small">
<el-select size="small" v-model="addMsg.UserId" filterable remote reserve-keyword placeholder="关联用户"
:remote-method="remoteMethod" :loading="loadingPeople">
<el-option v-for="item in peopleData" :key="item.Id" :label="`${item.AliasName}`" :value="item.Id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电话" prop="Telephone" class="is-required" size="small">
<el-input v-model="addMsg.Telephone" placeholder="请输入电话" type="number" />
</el-form-item>
<el-form-item label="专业" prop="Major" class="is-required" size="small">
<el-input v-model="addMsg.Major" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="工作年限" prop="WorkYears" class="is-required" size="small">
<el-input v-model="addMsg.WorkYears" @keyup.native="checkInteger(addMsg,'WorkYears')" placeholder="请输入工作年限" />
</el-form-item>
<el-form-item label="品牌国籍" prop="Nationality" class="is-required" size="small">
<el-input v-model="addMsg.Nationality" />
</el-form-item>
<el-form-item label="国旗" class="is-required" size="small">
<el-button @click="openChangeDig(2)" size="small">选择文件</el-button>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.ForeignersUrl || addMsg.ForeignersUrl==''" src="../../assets/img/default.png"
style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.ForeignersUrl" alt="">
</div>
</el-form-item>
<el-form-item label="上架状态" size="small">
<el-switch v-model="addMsg.TeacherStatus" active-color="#409EFF" :active-value="1" :inactive-value="2">
</el-switch>
</el-form-item>
<el-form-item label="标签" size="small">
<el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="false" @close="handleClose(tag)">
{{tag}}
</el-tag>
<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
@keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 标签</el-button>
</el-form-item>
<el-form-item label="擅长课程" size="small">
<el-tag :key="tag" v-for="tag in dynamicTags2" closable :disable-transitions="false"
@close="handleClose2(tag)">
{{tag}}
</el-tag>
<el-input class="input-new-tag" v-if="inputVisible2" v-model="inputValue2" ref="saveTagInput2" size="small"
@keyup.enter.native="handleInputConfirm2" @blur="handleInputConfirm2">
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput2">+ 标签</el-button>
</el-form-item>
<el-form-item label="简介">
<UE style="width:750px;" :defaultMsg="defaultMsg" :config="config" :IsMultiple="true" ref="ue"></UE>
</el-form-item>
</el-form>
</div>
<div style="margin-top:20px">
<el-button size="small" type="primary" @click="Save('addMsg')">保存</el-button>
</div>
<!-- 选择文件 -->
<el-dialog title="选择文件" :visible.sync="changeState" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog>
</div>
</template>
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
import UE from "@/components/global/UE.vue";
export default {
components: {
ChooseImg,
UE
},
data() {
return {
addMsg: {
addMsg: {
ID: 0,
Logo: "", //
BannerList: [], //品牌介绍图
VideoUrl: "", //品牌视频
FullBrandName: "", //品牌全名
BrandName: 0, //品牌名
ShopNum: "", //店铺数量
BuiltUpArea: "", //建筑面积小
EndBuiltUpArea: "", //建筑面积大
CustomerType: 1, //客群定位
BrandType: 0, //品牌定位
StoreExpansion: 1, //扩店区域
ProjectType: 1, //商铺性质
AreaRequirement: 1, //
EndAreaRequirement: 1, //
Advertising: 1, //广告
Other: 1, //其他
ShopSize: 1, //店铺开口尺寸
Plumbing: 1, //上下水
Caliber: 1, //管径
Sewage: 1, //排污
RanQi: 1, //燃气
DianLiang: 1, //电量
PaiYan: 1, //排烟量
KongTiao: 1, //空调
XinFeng: 1, //新风
BrandClassId: 0, //品牌分类Id
},
},
loadingPeople: false,
dynamicTags: [],
dynamicTags2: [],
inputVisible: false,
inputValue: '',
inputVisible2: false,
inputValue2: '',
defaultMsg: "",
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
Picindex: 0,
rules: {
Name: [{
required: true,
message: '请输入品牌名称',
trigger: 'blur'
}],
Telephone: [{
required: true,
message: '请输入品牌电话',
trigger: 'blur'
}],
Introduction: [{
required: true,
message: '请输入品牌简介',
trigger: 'blur'
}],
Major: [{
required: true,
message: '请输入品牌专业',
trigger: 'blur'
}],
Nationality: [{
required: true,
message: '请输入品牌国籍',
trigger: 'blur'
}],
WorkYears: [{
required: true,
message: '请输入品牌年限',
trigger: 'blur'
}],
},
loading: false,
changeState: false,
imgType: 0,
peopleData: [],
};
},
created() {
if (this.$route.query.ID) {
this.getData(this.$route.query.ID)
}
},
methods: {
SelectId(msg) {
if (this.imgType == 1) {
let url = this.getIconLink(msg.url)
this.addMsg.TeacherLogo = url
}
if (this.imgType == 2) {
let url = this.getIconLink(msg.url)
this.addMsg.ForeignersUrl = url
}
this.changeState = false;
},
openChangeDig(num) {
this.changeState = true;
this.imgType = num;
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.addMsg.TeacherLogo == '') {
this.Error('请上传品牌Logo')
return false
}
if (this.addMsg.ForeignersUrl == '') {
this.Error('请上传国家国旗')
return false
}
this.addMsg.LableNameList = this.dynamicTags
if (this.dynamicTags2.length == '' || this.dynamicTags2.length == 0) {
this.Error('请填写教师擅长课程')
return false
}
this.addMsg.GoodCourseList = this.dynamicTags2
let content = this.$refs.ue.getUEContent();
this.addMsg.Introduction = content;
let msg = this.addMsg
if (msg.UserId == '') {
msg.UserId = 0
}
this.apipost("/api/Education/AddOrUpdateTeacher", msg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('lecturermanage');
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
})
} else {
return false;
}
});
},
handleClose(tag) {
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
},
handleClose2(tag) {
this.dynamicTags2.splice(this.dynamicTags2.indexOf(tag), 1);
},
showInput() {
this.inputVisible = true;
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
showInput2() {
this.inputVisible2 = true;
this.$nextTick(_ => {
this.$refs.saveTagInput2.$refs.input.focus();
});
},
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.dynamicTags.push(inputValue);
}
this.inputVisible = false;
this.inputValue = '';
},
handleInputConfirm2() {
let inputValue = this.inputValue2;
if (inputValue) {
this.dynamicTags2.push(inputValue);
}
this.inputVisible2 = false;
this.inputValue2 = '';
},
getData(ID) {
this.loading = true;
this.apipost("/api/Education/GetTeacherModel", {
ID: ID
}, res => {
this.loading = false;
this.addMsg = res.data.data;
if (this.addMsg.Introduction && this.addMsg.Introduction != "") {
this.defaultMsg = this.addMsg.Introduction;
}
if (this.addMsg.LableNameList != null) {
this.dynamicTags = this.addMsg.LableNameList
}
if (this.addMsg.GoodCourseList != null) {
this.dynamicTags2 = this.addMsg.GoodCourseList
}
if (this.addMsg.UserId == 0) {
this.addMsg.UserId = ''
} else if (this.addMsg.UserId > 0) {
this.peopleData = [{
Id: this.addMsg.UserId,
AliasName: this.addMsg.UserName
}]
}
})
},
remoteMethod(val) {
this.loadingPeople = true;
this.apipost("/api/User/GetListByPhoneOrAliasName", {
'AliasName': val,
SmallShopId: 0
}, res => {
this.loadingPeople = false;
if (res.data.resultCode == 1) {
this.peopleData = res.data.data
} else {
this.Info(res.data.message);
}
})
},
},
mounted() {}
};
</script>
<style>
.app-add-cat .el-checkbox-group {
font-size: 14px !important;
}
.app-add-cat .el-checkbox {
margin-right: 0;
}
.app-add-cat .el-dialog__body {
padding: 10px 20px !important;
}
.app-add-cat .tag-box .tag-item {
margin-right: 5px;
}
.app-add-cat .tag-box {
margin: 20px 0;
}
.app-add-cat .app-goods-cat-list .active {
background: #FAFAFA;
}
.app-add-cat .app-goods-cat-list .cat-item {
cursor: pointer;
padding: 5px 10px;
}
.app-add-cat .app-goods-cat-list {
border: 1px solid #E8EAEE;
border-radius: 5px;
margin-top: -5px;
padding: 10px 0;
overflow: scroll;
height: 400px;
}
.addbrand .blue {
color: #409EFF;
}
.addbrand .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.addbrand .gez_list {
/*width: 650px;*/
margin-bottom: 12px;
padding: 20px;
border: 1px solid #EBEEF5;
background-color: #FFF;
color: #303133;
}
.addbrand .quyu {
background-color: #f4f4f5;
color: #909399;
padding: 10px;
line-height: 30px;
height: 30px;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
margin: 5px;
}
.addbrand .el-tag+.el-tag {
margin-left: 10px;
}
.addbrand .button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.addbrand .input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.addbrand .el-form-item__content {
line-height: 0;
}
.addbrand .app-gallery-item {
border: none
}
</style>
<template>
<div class="brandClassification">
<template v-if="!isShowAdd">
<div class="head-title">
品牌分类管理
<el-button style="float:right;margin-top: -5px;" size="small" type="primary" @click="isShowAdd=true,clearMsg()">
新增</el-button>
</div>
<div class="content">
<div>
<div class="searchInput" style="width:250px">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" @clear="msg.pageIndex=1,getList()"
style="display:inline-block;width:225px;height:30px" placeholder="请输入品牌分类名称" v-model="msg.ClassName" size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search"
style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
<el-table :data="tableData" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column prop="ID" label="编号" width="100">
</el-table-column>
<el-table-column prop="ClassName" label="品牌分类名称">
</el-table-column>
<el-table-column prop="Logo" width="150" label="封面图">
<template slot-scope="scope">
<div class="app-image"
:style="{backgroundImage:'url(' + scope.row.Logo + ')',backgroundSize:'cover'}">
</div>
</template>
</el-table-column>
<el-table-column prop="CreateDate" width="200" label="创建时间">
</el-table-column>
<el-table-column prop="address" width="200" label="操作">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img @click="editNews(scope.row)" style="width:32px;height:32px" src="../../assets/img/userman/edit.png"
alt="">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<img @click="delNews(scope.row)" style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/del.png" alt="">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:page-size="msg.pageSize" :current-page.sync="msg.pageIndex" layout="total,prev, pager, next" :total="total">
</el-pagination>
</div>
</template>
<template v-else>
<div class="head-title">
<span @click="isShowAdd=false" style="color:rgb(64, 158, 255);cursor:pointer;">品牌分类管理</span><span
style="margin:0 9px;color:#C0C4CC">/</span><span>品牌分类信息</span>
</div>
<div class="content">
<el-form label-width="120px" :model="addMsg" :rules="rules" ref="addMsg">
<el-form-item label="品牌分类名称" class="is-required" prop="ClassName">
<el-input type="text" class="w400" v-model="addMsg.ClassName" size="small" placeholder="品牌分类名称" maxlength="100">
</el-input>
</el-form-item>
<el-form-item label="Logo" size="small" class="is-required" prop="Logo">
<el-button @click="isShowImage=true" size="small">选择文件</el-button>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;border:none;">
<img v-if="!addMsg.Logo || addMsg.Logo==''" src="../../assets/img/default.png"
style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.Logo" alt="">
</div>
</el-form-item>
</el-form>
</div>
<el-button size="small" style="margin-top:20px;padding:9px 25px;" type="primary" @click="submitform('addMsg')">保存
</el-button>
</template>
<!-- 选择文件 -->
<el-dialog title="选择文件" :visible.sync="isShowImage" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog>
</div>
</template>
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
import UE from "@/components/global/UE.vue";
export default {
components: {
ChooseImg,
UE,
},
data() {
return {
defaultMsg: "",
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
msg: {
pageIndex: 1,
pageSize: 10,
ClassName: '',
},
total: 0,
tableData: [], //数据列表
isShowImage: false, //是否显示选择图片弹窗
isShowAdd: false, //是否显示新增
addMsg: {
ID: 0, //主键编号
Logo: "", //封面图
ClassName: "", //品牌分类标题
},
rules: {
ClassName: [{
required: true,
message: '请输入品牌分类名称',
trigger: 'blur'
}],
Logo: [{
required: true,
message: '请输入品牌Logo',
trigger: 'blur'
}],
},
};
},
created() {
this.getList();
},
methods: {
SelectId(msg) {
let url = this.getIconLink(msg.url)
this.addMsg.Logo = url
this.isShowImage = false;
},
clearMsg() {
this.addMsg.ID = 0;
this.addMsg.Logo = "";
this.addMsg.ClassName = "";
},
getList() {
this.loading = true;
this.apipost("/api/Trade/GetBrandClassPageList", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
let pageData = res.data.data.pageData;
this.tableData = pageData;
}
})
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
//删除品牌分类
delNews(item) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/Trade/RemoveBrandClass", {
Id: item.ID,
Status: 1
},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
} else {
that.Error(res.data.message);
}
},
);
});
},
//修改品牌分类
editNews(item) {
this.apipost("/api/Trade/GetBrandClassDetails", {
ID: item.ID
}, res => {
if (res.data.resultCode == 1) {
this.isShowAdd = true;
var tempData = res.data.data;
this.addMsg.ID = tempData.ID;
this.addMsg.Logo = tempData.Logo;
this.addMsg.ClassName = tempData.ClassName;
} else {
this.Error(res.data.message);
}
})
}, //新增修改
submitform(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.apipost("/api/Trade/GetSetBrandClass", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.isShowAdd = false;
this.getList();
this.clearMsg();
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
})
} else {
return false;
}
});
}
},
mounted() {}
};
</script>
<style>
.brandClassification .remark_name {
color: #888888;
font-size: 12px;
margin-left: 10px;
float: right;
}
.brandClassification .app-image {
background-position: center center;
width: 50px;
height: 50px;
border-radius: 0%;
float: left;
margin-right: 8px;
}
.brandClassification .blue {
color: #409EFF;
}
.brandClassification .content .searchInput {
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.brandClassification .content .searchInput .el-input__inner {
border: none;
outline: none;
height: 30px;
line-height: 30px;
}
.brandClassification .content .searchInput {
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width: 250px;
margin-right: 20px;
}
.brandClassification .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.brandClassification .el-form-item__content {
line-height: 0;
}
</style>
<template> <template>
<div> <div class="brandManagement">
1233 <div class="el-card__header">
<span>品牌列表</span>
<div style="display: flex;flex-direction: row;align-items: center">
<el-button type="primary" class="el-button--small" @click="addTopic">新增</el-button>
</div>
</div>
<div class="content">
<div style="display: flex;flex-direction: row;align-items: center">
<div class="block">
<span style="margin-left: 10px">品牌名</span>
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" @clear="msg.pageIndex=1,getList()"
style="display:inline-block;width:225px;height:30px" placeholder="请输入品牌名" v-model="msg.BrandName" size="small"
clearable>
</el-input>
<span style="margin-left: 10px">商铺性质</span>
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" @clear="msg.pageIndex=1,getList()"
style="display:inline-block;width:225px;height:30px" placeholder="请输入商铺性质" v-model="msg.ProjectType" size="small"
clearable>
</el-input>
<span style="margin-left: 10px">品牌分类</span>
<el-select class="w100" @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="x.ClassName" :value="x.ID" v-for="(x,y) in BrandClassList" :key="y"></el-option>
</el-select>
</div>
</div>
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: wrap">
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>上下水</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>管径</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>排污</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>燃气</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>电量</span>
<el-select class="w100" @change="msg.pageIndex=1,getList()" style="margin-left: 5px;" v-model="msg.DianLiang" size="small"
placeholder="请选择">
<el-option label="不限" :value="-1"></el-option>
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>排烟量</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>空调</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
<div class="block" style="margin-top: 15px;margin-left: 10px">
<span>新风</span>
<el-select class="w100" @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="0"></el-option>
</el-select>
</div>
</div>
</div>
<div style="padding: 20px;background: #fff;">
<el-table :data="dataList" header-cell-class-name="headClass" style="width: 100%" border>
<el-table-column prop="Id" label="ID" width="100">
<template slot-scope="scope">
<span @click="goRecruit(scope.row.Id)">{{scope.row.Id}}</span>
</template>
</el-table-column>
<el-table-column prop="Content" label="品牌">
</el-table-column>
<el-table-column prop="CoverPhoto" label="图片">
<template slot-scope="scope">
<img v-if="scope.row.CoverPhoto" :src="scope.row.CoverPhoto" style="width:40px;height:40px;" alt="" />
</template>
</el-table-column>
<el-table-column prop="IsOpen" label="是否显示">
<template slot-scope="scope">
<el-switch @change="changeSwitch(scope.row)" v-model="scope.row.IsOpen" active-color="#409EFF"
:active-value="1" :inactive-value="2">
</el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="180">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img src="../../assets/img/setup/edit.png" alt="" class="imgstyle" @click="Edit(scope.row)">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../assets/img/setup/del.png" alt="" class="imgstyle" @click="delete_b(scope.row)">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
layout="prev, pager, next" :current-page.sync="msg.pageIndex" :total="pageCount">
</el-pagination>
</div>
</div> </div>
</template> </template>
<script>
export default {
name: "brandManagement",
data() {
return {
msg: {
pageIndex: 1,
pageSize: 20,
BrandName: '',//品牌名
ProjectType: '',//商铺性质
Plumbing: -1,//上下水(0-否1-有)
Caliber: -1,//管径(0-否1-有)
Sewage: -1,//排污(0-否1-有)
RanQi: -1,//燃气(0-否1-有)
DianLiang: -1,//电量(0-否1-有)
PaiYan: -1,//排烟量(0-否1-有)
KongTiao: -1,//空调(0-否1-有)
XinFeng : -1,//新风(0-否1-有)
BrandClassId : 0,//分类
},
dataList: [],
pageCount: 0,
loading: false,
BrandClassList:[],
}
},
created() {
this.getList();
this.getBrandClassList()
},
methods: {
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.pageCount;
} 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/Education/DelEducationTalk", {
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>
<style>
.brandManagement .el-card__header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background: #fff;
}
.brandManagement .content {
background: #fff;
margin-top: 10px;
padding: 15px;
box-sizing: border-box;
}
</style>
...@@ -219,6 +219,10 @@ ...@@ -219,6 +219,10 @@
@click="isChecked='/realAuthentication',CommonJump('realAuthentication')"> @click="isChecked='/realAuthentication',CommonJump('realAuthentication')">
<i class="el-icon-menu"></i><span>实名认证</span> <i class="el-icon-menu"></i><span>实名认证</span>
</li> </li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/brandClassification'}"
@click="isChecked='/brandClassification',CommonJump('brandClassification')">
<i class="el-icon-menu"></i><span>品牌分类</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/brandManagement'}" <li class="menu_item" :class="{'Fchecked':isChecked=='/brandManagement'}"
@click="isChecked='/brandManagement',CommonJump('brandManagement')"> @click="isChecked='/brandManagement',CommonJump('brandManagement')">
<i class="el-icon-menu"></i><span>品牌管理</span> <i class="el-icon-menu"></i><span>品牌管理</span>
......
...@@ -704,6 +704,18 @@ export default new Router({ ...@@ -704,6 +704,18 @@ export default new Router({
name: 'realAuthentication', name: 'realAuthentication',
component: resolve => require(['@/components/tradePavilion/realAuthentication'], resolve), component: resolve => require(['@/components/tradePavilion/realAuthentication'], resolve),
}, },
//贸易管理--品牌分类
{
path: '/brandClassification',
name: 'brandClassification',
component: resolve => require(['@/components/tradePavilion/brandClassification'], resolve),
},
//贸易管理--新增修改品牌
{
path: '/addbrand',
name: 'addbrand',
component: resolve => require(['@/components/tradePavilion/addbrand'], resolve),
},
//贸易管理--品牌管理 //贸易管理--品牌管理
{ {
path: '/brandManagement', path: '/brandManagement',
......
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