Commit 63532b41 by 肖康

x

parent 3a2a46b5
.brandxk{
.brand-con{
background: #FFFFFF;
border-radius: 4px;
border: 1px solid #E5EBF6;
padding:20px;
}
.search-btn{
cursor: pointer;
width: 76px;
height: 37px;
line-height: 37px;
background: #1969F9;
border-radius: 2px;
font-size: 14px;
color:#fff;
text-align: center;
&:hover{
background: #0050E0;
}
}
.btn-nav{
margin-top: 11px;
margin-bottom: 22px;
.dcg{
width: 66px;
height: 26px;
border-radius: 2px;
text-align: center;
line-height: 26px;
border: 1px solid #1969F9;
background: #E5EEFF;;
color:#1969F9;
margin-right: 10px;
font-size: 14px;
transition: all 0.5s;
&:hover{
background: #1969F9;
cursor: pointer;
color:#fff;
}
&.delbtn{
border:1px solid #FC1F00;
background: #FFE7E3;
color:#FC1F00;
&:hover{
background: #FF715D;
color:#fff;
}
}
&.updatex{
}
}
.updatex{
width: 66px;
height: 26px;
line-height: 26px;
text-align: center;
background: #FFEEDD;
border: 1px solid #FF870D;
border-radius: 2px;
color:#FF870D;
font-size: 14px;
cursor: pointer;
width: 66px;
&:hover{
background: #FCA955;
color:#fff;
}
}
}
.brand-img{
width: 80%;
height: 40px;
}
}
\ No newline at end of file
.brandxk .brand-con{background:#FFFFFF;border-radius:4px;border:1px solid #E5EBF6;padding:20px}.brandxk .search-btn{cursor:pointer;width:76px;height:37px;line-height:37px;background:#1969F9;border-radius:2px;font-size:14px;color:#fff;text-align:center}.brandxk .search-btn:hover{background:#0050E0}.brandxk .btn-nav{margin-top:11px;margin-bottom:22px}.brandxk .btn-nav .dcg{width:66px;height:26px;border-radius:2px;text-align:center;line-height:26px;border:1px solid #1969F9;background:#E5EEFF;color:#1969F9;margin-right:10px;font-size:14px;transition:all .5s}.brandxk .btn-nav .dcg:hover{background:#1969F9;cursor:pointer;color:#fff}.brandxk .btn-nav .dcg.delbtn{border:1px solid #FC1F00;background:#FFE7E3;color:#FC1F00}.brandxk .btn-nav .dcg.delbtn:hover{background:#FF715D;color:#fff}.brandxk .btn-nav .updatex{height:26px;line-height:26px;text-align:center;background:#FFEEDD;border:1px solid #FF870D;border-radius:2px;color:#FF870D;font-size:14px;cursor:pointer;width:66px}.brandxk .btn-nav .updatex:hover{background:#FCA955;color:#fff}.brandxk .brand-img{width:80%;height:40px}
\ No newline at end of file
......@@ -389,8 +389,9 @@ body {
}
//js跟随提示框
.el-tooltip__popper {
border:0px!important;
box-shadow: 0px 0px 10px #ccc;
box-shadow: 1px 2px 10px 0px rgba(119, 135, 145, 0.5);
border: 1px solid #387FFF!important;
border-radius: 0px!important;
.boxxrth2021 {
width : 150px;
background : #fff;
......@@ -407,8 +408,8 @@ body {
}
}
.el-tooltip__popper[x-placement="top"] .popper__arrow{border-top-color:#fff!important;}
.el-tooltip__popper[x-placement="bottom"] .popper__arrow{border-bottom-color:#fff!important;}
.el-tooltip__popper[x-placement="top"] .popper__arrow{border-top-color:#387FFF!important;}
.el-tooltip__popper[x-placement="bottom"] .popper__arrow{border-bottom-color:#387FFF!important;}
......
<template>
<div class="brand">
我是品牌信息
<Menu/>
<div class="brandxk pagex">
<div class="brand-con">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="品牌">
<el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false"
:fetch-suggestions="querySearchAsync2" placeholder="请输入品牌" @select="handleSelectBrandName">
</el-autocomplete>
</el-form-item>
<el-form-item label="关键词">
<el-input v-model="formInline.keyword" placeholder="请输入关键词"></el-input>
</el-form-item>
<el-form-item>
<div @click="submit" class="search-btn">搜索</div>
</el-form-item>
</el-form>
<div class="btn-nav clr">
<div class="fl dcg updatex" @click="updateBrand">修改</div>
<div class="fl dcg " @click="downOut">导出</div>
<div class="fl dcg delbtn" @click="del">删除</div>
</div>
<div class="data-box th-all" v-if="tableData">
<el-table :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="37">
</el-table-column>
<el-table-column prop="internal_standard_name" label="内部标准名称" min-width="15%">
</el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="15%">
</el-table-column>
<el-table-column prop="region" label="地区" min-width="15%">
</el-table-column>
<el-table-column prop="brand_logo" label="LOGO" min-width="10%">
<template slot-scope="scope" v-if="scope.row.brand_logo">
<img :src="scope.row.brand_logo" class="brand-img" alt="">
</template>
</el-table-column>
<el-table-column prop="sku_num" label="型号量" min-width="10%">
</el-table-column>
<el-table-column prop="remark" label="品牌备注" min-width="15%">
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="15%">
</el-table-column>
<el-table-column prop="update_time" label="更新时间" min-width="15%">
</el-table-column>
</el-table>
<el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total"
@current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
<!--修改品牌弹窗-->
<el-dialog title="修改品牌" :visible.sync="dialogVisible" width="1000px">
<div class="kc-mask">
<el-table :data="updateBranddata" border style="width: 100%">
<el-table-column prop="brand_name" label="品牌" width="180">
</el-table-column>
<el-table-column prop="region" label="地区" width="100">
</el-table-column>
<el-table-column prop="brand_logo" label="LOGO" min-width="120">
<template slot-scope="scope" v-if="scope.row.brand_logo">
<img :src="scope.row.brand_logo" class="brand-img" alt="">
</template>
</el-table-column>
<el-table-column prop="internal_standard_name" label="内部标准名称" min-width="170">
<template slot-scope="scope">
<el-input v-model="scope.row.internal_standard_name" placeholder="点击修改"></el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="品牌备注" width="320">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="点击修改"></el-input>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitUpdate">确 定</el-button>
</span>
</el-dialog>
</div>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '../../tool'
import {
Form,
FormItem,
Select,
Option,
Input,
Button,
Message
Table,
TableColumn,
Message,
MessageBox,
Dialog,
Pagination,
Autocomplete
} from 'element-ui'
Vue.use(Button)
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(
Autocomplete)
Vue.use(TableColumn).use(Table)
export default {
name: "brand",
data() {
return {};
return {
dialogVisible: false,
updateBranddata: [],
total: 0,
limit: 10,
page: 1,
formInline: {
brand_name: '',
brand_id: '',
keyword: ''
},
tableData: "",
multipleSelection: []
};
},
watch: {},
created() {
this.getData();
},
computed: {},
methods: {
ceshi() {
//this.$message.error('上传头像图片只能是 JPG 格式!');
Message('这是一条消息提示');
this.$http('get', "/getJoke1", {
page: 1, count: 2, type: 'video'
getData() {
this.$http('get', "/api/brand/get_brand_list", {
page: this.page,
limit: this.limit,
brand_id: this.formInline.brand_id,
brand_name: this.formInline.brand_name,
keyword: this.formInline.keyword,
}).then(res => {
if (res.err_code === 0) {
this.tableData = res.data.list || [];
this.total = res.data.total || 0;
} else {
Message(res.err_msg);
}
})
},
updateBrand() {
if (this.multipleSelection.length > 1) {
Message("只能选择一条数据")
return
}
if (this.multipleSelection.length == 0) {
Message("请至少选择一条数据")
return
}
this.updateBranddata = JSON.parse(JSON.stringify(this.multipleSelection));
this.dialogVisible = true
},
submitUpdate() {
},
querySearchAsync2(queryString, cb) {
this.$http('get', "/api/search/getbrand", {
brand_name: this.formInline.brand_name
}).then(res => {
if (res.err_code == 0) {
var arrlist_ = res.data || [];
this.brandList = []
this.formInline.brand_id = ""
for (var i = 0; i < arrlist_.length; i++) {
this.brandList.push({
value: arrlist_[i]['brand_name'],
brand_id: arrlist_[i]['brand_id']
})
}
cb(this.brandList);
}
})
.then(res => {
console.log(res)
},
handleSelectBrandName(item) {
this.formInline.brand_name = item.value;
this.formInline.brand_id = item.brand_id;
},
submit() {
this.page = 1;
this.getData();
},
downOut() {
this.$http('post', "/api/brand/export_brand", {
brand_id: this.formInline.brand_id,
keyword: this.formInline.keyword,
}).then(res => {})
},
del() {
if (this.multipleSelection.length == 0) {
Message("请至少选择一条数据")
return
}
var arr = [];
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
})
.catch(err => {
console.log(err.message);
.then(() => {
this.$http('post', "/api/brand/delete_brand", {
id: arr.join(",")
}).then(res => {
if (res.err_code === 0) {
Message("删除成功");
this.getData()
} else {
Message(res.err_msg);
}
})
})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val || [];
console.log(this.multipleSelection)
}
},
components: {
Menu
......@@ -47,5 +247,5 @@
};
</script>
<style scoped>
/* @import "../../assets/css/index/index.min.css"; */
@import "../../assets/css/goods/brand.min.css";
</style>
\ No newline at end of file
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 sign in to comment