Commit 7b9fa245 authored by 黄奎's avatar 黄奎

页面修改

parent 1753764d
This diff is collapsed.
This diff is collapsed.
...@@ -2,28 +2,62 @@ ...@@ -2,28 +2,62 @@
<div class="performanceStatics"> <div class="performanceStatics">
<div class="head-title"> <div class="head-title">
品牌管理 品牌管理
<el-button style="float:right;margin-top: -5px;" type="primary" class="el-button--small" <el-button
@click="CommonJump('hbrandedit')">新增</el-button> style="float:right;margin-top: -5px;"
type="primary"
class="el-button--small"
@click="CommonJump('hbrandedit')"
>新增</el-button
>
</div> </div>
<div class="content"> <div class="content">
<div style="margin-bottom:20px"> <div style="margin-bottom:20px">
<span>分类</span> <span>分类</span>
<el-select style="margin:0 10px" class="w200" @change="msg.pageIndex=1,getList()" v-model="msg.CategoryId" <el-select
size="small" placeholder="请选择" clearable> style="margin:0 10px"
class="w200"
@change="(msg.pageIndex = 1), getList()"
v-model="msg.CategoryId"
size="small"
placeholder="请选择"
clearable
>
<el-option label="不限" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option v-for="item in CategoryList" :key="item.Id" :label="item.Name" :value="item.Id"> <el-option
v-for="item in CategoryList"
:key="item.Id"
:label="item.Name"
:value="item.Id"
>
</el-option> </el-option>
</el-select> </el-select>
<span>品牌名称</span> <span>品牌名称</span>
<el-input type="text" style="width:250px" size="small" maxlength="100" v-model="msg.Name" clearable <el-input
@input="msg.pageIndex=1,getList()"> type="text"
style="width:250px"
size="small"
maxlength="100"
v-model="msg.Name"
clearable
@input="(msg.pageIndex = 1), getList()"
>
</el-input> </el-input>
<el-button @click="msg.pageIndex=1,getList()" size="small" type="primary"> <el-button
@click="(msg.pageIndex = 1), getList()"
size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
</div> </div>
<el-table :data="tableData" v-loading="loading" border style="width: 100%"> <el-table
<el-table-column prop="Id" label="编号" width="100"> :data="tableData"
v-loading="loading"
border
style="width: 100%"
>
<el-table-column prop="Id" label="编号" width="100"> </el-table-column>
<el-table-column prop="CategoryName" label="所属分类" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="Name" label="品牌名称" width="200"> <el-table-column prop="Name" label="品牌名称" width="200">
</el-table-column> </el-table-column>
...@@ -34,118 +68,145 @@ ...@@ -34,118 +68,145 @@
</el-table-column> </el-table-column>
<el-table-column label="是否热门" width="100px"> <el-table-column label="是否热门" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsHot==1" effect="dark"> <el-tag v-if="scope.row.IsHot == 1" effect="dark">
热门 热门
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="RemarkDesc" label="上传描述"> <el-table-column prop="RemarkDesc" label="上传描述"> </el-table-column>
</el-table-column> <el-table-column prop="MoreDesc" label="备注描述"> </el-table-column>
<el-table-column prop="MoreDesc" label="备注描述"> <el-table-column label="操作" width="150px">
</el-table-column>
<el-table-column label="操作" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<img @click="showBrandForm(scope.row)" src="../../assets/img/userman/edit.png" alt="" /> <el-tooltip
<img @click="RemmoveBrand(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png" class="item"
alt="" /> effect="dark"
content="编辑"
placement="top"
>
<img
class="edit-img"
src="../../assets/img/userman/edit.png"
@click="showBrandForm(scope.row)"
/>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
>
<img
src="../../assets/img/userman/del.png"
@click="RemmoveBrand(scope.row)"
/>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize" <el-pagination
:current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total"> style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
:current-page.sync="msg.pageIndex"
layout="prev, pager, next"
:total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
loading: false, loading: false,
tableData: [], tableData: [],
total: 0, total: 0,
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
CategoryId: 0, //分类编号 CategoryId: 0, //分类编号
Name: '', //品牌名称 Name: "" //品牌名称
}, },
CategoryList: [], //分类列表 CategoryList: [], //分类列表
dateList: [], //日期 dateList: [] //日期
} };
}, },
created() { created() {
this.getCategoryList() this.getCategoryList();
},
mounted() {
this.getList();
},
methods: {
//获取分类列表
getCategoryList() {
this.apipost("/api/Assess/GetCategoryDropList", {}, res => {
if (res.data.resultCode == 1) {
this.CategoryList = res.data.data;
} else {
this.Error(res.data.message);
}
});
}, },
mounted() { refreshPage() {},
this.getList(); //新增修改品牌
showBrandForm(item) {
this.CommonJump("hbrandedit", {
Id: item.Id
});
}, },
methods: { //删除品牌
//获取分类列表 RemmoveBrand(item) {
getCategoryList() { let that = this;
this.apipost("/api/Assess/GetCategoryDropList", {}, res => { that.Confirm("是否删除此品牌?", function() {
if (res.data.resultCode == 1) { that.apipost(
this.CategoryList = res.data.data; "/api/Assess/DelBrandInfo",
} else { {
this.Error(res.data.message); BrandId: item.Id
} },
}) res => {
}, if (res.data.resultCode == 1) {
refreshPage() { that.Success(res.data.message);
that.getList();
}, } else {
//新增修改品牌 that.Error(res.data.message);
showBrandForm(item) { }
this.CommonJump('hbrandedit', {
Id: item.Id
})
},
//删除品牌
RemmoveBrand(item) {
let that = this;
that.Confirm("是否删除此品牌?", function () {
that.apipost(
"/api/Assess/DelBrandInfo", {
BrandId: item.Id,
},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
} else {
that.Error(res.data.message);
}
},
);
});
},
//获取数据
getList() {
this.loading = true;
this.assetsApipost("/api/Assess/GetBrandPageList", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
this.tableData = res.data.data.pageData;
} else {
this.Error(res.data.message);
} }
}) );
}, });
handleCurrentChange(val) { },
this.msg.pageIndex = val; //获取数据
this.getList(); getList() {
}, this.loading = true;
this.assetsApipost("/api/Assess/GetBrandPageList", this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
this.tableData = res.data.data.pageData;
} else {
this.Error(res.data.message);
}
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
} }
};
</script>
<style>
.performanceStatics .content {
background: #fff;
margin-top: 10px;
padding: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
} }
</style> };
\ No newline at end of file </script>
<style scope>
.performanceStatics .content {
background: #fff;
margin-top: 10px;
padding: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.edit-img {
margin-right: 10px;
}
</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