Commit 624b8a09 authored by 黄奎's avatar 黄奎

页面修改

parent b7d1b09a
...@@ -5,60 +5,23 @@ ...@@ -5,60 +5,23 @@
/ 编辑品牌管理 / 编辑品牌管理
</div> </div>
<div class="content"> <div class="content">
<el-form <el-form :rules="rules" :model="addMsg" ref="addMsg" label-width="150px" style="width: 70%">
:rules="rules"
:model="addMsg"
ref="addMsg"
label-width="150px"
style="width: 70%"
>
<el-form-item label="品牌分类" class="is-required" prop="BrandClassId"> <el-form-item label="品牌分类" class="is-required" prop="BrandClassId">
<el-select <el-select class="w300" v-model="addMsg.CategoryId" size="small" placeholder="请选择">
class="w300"
v-model="addMsg.CategoryId"
size="small"
placeholder="请选择"
>
<el-option :key="0" label="请选择" :value="0"></el-option> <el-option :key="0" label="请选择" :value="0"></el-option>
<el-option <el-option v-for="item in CategoryList" :key="item.Id" :label="item.Name" :value="item.Id">
v-for="item in CategoryList"
:key="item.Id"
:label="item.Name"
:value="item.Id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="品牌名" prop="Name" class="is-required" size="small">
label="品牌名" <el-input v-model="addMsg.Name" class="w600" placeholder="请输入品牌名" maxlength="100" />
prop="Name"
class="is-required"
size="small"
>
<el-input
v-model="addMsg.Name"
class="w600"
placeholder="请输入品牌名"
maxlength="100"
/>
</el-form-item> </el-form-item>
<el-form-item label="Logo" class="is-required" prop="Logo" size="small"> <el-form-item label="Logo" class="is-required" prop="Logo" size="small">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button> <el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
<div <div class="app-gallery-item" style="position: relative; width: 100px; margin-top: 10px">
class="app-gallery-item" <img v-if="!addMsg.Logo || addMsg.Logo == ''" src="../../assets/img/default.png"
style="position: relative; width: 100px; margin-top: 10px" style="width: 80px; height: 80px" alt="" />
> <el-image v-else style="width: 80px; height: 80px" :src="addMsg.Logo">
<img
v-if="!addMsg.Logo || addMsg.Logo == ''"
src="../../assets/img/default.png"
style="width: 80px; height: 80px"
alt=""
/>
<el-image
v-else
style="width: 80px; height: 80px"
:src="addMsg.Logo"
>
</el-image> </el-image>
</div> </div>
</el-form-item> </el-form-item>
...@@ -66,71 +29,39 @@ ...@@ -66,71 +29,39 @@
<div class="nav_Main"> <div class="nav_Main">
<div class="nav_IconContent"> <div class="nav_IconContent">
<draggable v-model="addMsg.BrandImgList"> <draggable v-model="addMsg.BrandImgList">
<div <div style="
style="
position: relative; position: relative;
margin-right: 20px; margin-right: 20px;
display: inline-block; display: inline-block;
" " v-for="(item, index) in addMsg.BrandImgList" :key="index + '2'">
v-for="(item, index) in addMsg.BrandImgList"
:key="index + '2'"
>
<el-image style="width: 100px;height: 100px" :src="item.Path"> <el-image style="width: 100px;height: 100px" :src="item.Path">
</el-image </el-image><br />
><br /> <el-input v-model="item.Name" style="width: 100px;" placeholder="描述"></el-input>
<el-input <el-button @click="ClearCarouse(index)" class="delBtn" type="danger" icon="el-icon-close" circle>
v-model="item.Name"
style="width: 100px;"
placeholder="描述"
></el-input>
<el-button
@click="ClearCarouse(index)"
class="delBtn"
type="danger"
icon="el-icon-close"
circle
>
</el-button> </el-button>
</div> </div>
</draggable> </draggable>
</div> </div>
<div <div @click="openChangeDig(2)" v-if="addMsg.BrandImgList.length < 9" class="add-image-btn 2222"
@click="openChangeDig(2)" style="cursor: pointer">
v-if="addMsg.BrandImgList.length < 9"
class="add-image-btn 2222"
style="cursor: pointer"
>
+ 添加图片 + 添加图片
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="热门推荐" size="small">
<el-form-item label="热门推荐" size="small" prop="hotRec">
<el-radio v-model="addMsg.IsHot" :label="1"></el-radio> <el-radio v-model="addMsg.IsHot" :label="1"></el-radio>
<el-radio v-model="addMsg.IsHot" :label="0"></el-radio> <el-radio v-model="addMsg.IsHot" :label="0"></el-radio>
</el-form-item> </el-form-item>
<el-form-item label="更多描述" size="small" prop="MoreDesc"> <el-form-item label="更多描述" size="small">
<el-input <el-input v-model="addMsg.MoreDesc" placeholder="请输入更多描述" class="w600" maxlength="500" />
v-model="addMsg.MoreDesc"
placeholder="请输入更多描述"
class="w600"
maxlength="500"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注描述" size="small" prop="RemarkDesc"> <el-form-item label="备注描述" size="small">
<el-input <el-input v-model="addMsg.RemarkDesc" placeholder="请输入备注描述" class="w600" maxlength="500" />
v-model="addMsg.RemarkDesc"
placeholder="请输入备注描述"
class="w600"
maxlength="500"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<el-button size="small" type="primary" @click="Save('addMsg')" <el-button size="small" type="primary" @click="Save('addMsg')">保存</el-button>
>保存</el-button
>
</div> </div>
<!-- 选择文件 --> <!-- 选择文件 -->
<el-dialog title="选择文件" :visible.sync="isShowIamge" width="1240px"> <el-dialog title="选择文件" :visible.sync="isShowIamge" width="1240px">
...@@ -139,289 +70,288 @@ ...@@ -139,289 +70,288 @@
</div> </div>
</template> </template>
<script> <script>
import ChooseImg from "@/components/global/ChooseImg.vue"; import ChooseImg from "@/components/global/ChooseImg.vue";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
export default { export default {
components: { components: {
ChooseImg, ChooseImg,
draggable draggable
},
data() {
return {
addMsg: {
Id: 0,
Name: "", //品牌名称
Logo: "", //Logo
IsHot: 0,
CategoryId: "", //品牌分类
MoreDesc: "", //更多描述
RemarkDesc: "", //备注描述
BrandImgList: [] //品牌介绍图
},
CategoryList: [], //品牌分类列表
isShowIamge: false,
chooseType: 0,
loading: false,
rules: {
Name: [{ required: true, message: "请输入品牌名称", trigger: "blur" }],
hotRec: [{ required: true, message: "请选择", trigger: "blur" }],
MoreDesc: [
{ required: true, message: "请输入更多描述", trigger: "blur" }
],
RemarkDesc: [
{ required: true, message: "请输入备注描述", trigger: "blur" }
]
}
};
},
created() {
this.getCategoryList();
},
mounted() {
if (this.$route.query.Id) {
this.addMsg.Id = this.$route.query.Id;
this.initData();
}
},
methods: {
//删除图片
ClearCarouse(index) {
if (this.addMsg.BrandImgList && this.addMsg.BrandImgList.length > 0) {
this.addMsg.BrandImgList.splice(index, 1);
}
}, },
initData() { data() {
var qMsg = { return {
BrandId: this.addMsg.Id addMsg: {
}; Id: 0,
this.apipost("/api/Assess/GetBrandInfo", qMsg, res => { Name: "", //品牌名称
if (res.data.resultCode == 1) { Logo: "", //Logo
var tempData = res.data.data; IsHot: 0,
if (tempData) { CategoryId: "", //品牌分类
let { MoreDesc: "", //更多描述
Id, RemarkDesc: "", //备注描述
Name, BrandImgList: [] //品牌介绍图
Logo, },
CategoryId, CategoryList: [], //品牌分类列表
IsHot, isShowIamge: false,
MoreDesc, chooseType: 0,
RemarkDesc loading: false,
} = tempData; rules: {
this.addMsg = { Name: [{
Id, required: true,
Name, message: "请输入品牌名称",
Logo, trigger: "blur"
CategoryId, }],
IsHot,
MoreDesc,
RemarkDesc
};
if (tempData.BrandImgList && tempData.BrandImgList.length > 0) {
this.addMsg.BrandImgList = tempData.BrandImgList;
}
}
} }
}); };
}, },
SelectId(msg) { created() {
let url = this.getIconLink(msg.url); this.getCategoryList();
if (this.chooseType == 1) {
this.addMsg.Logo = url;
}
if (this.chooseType == 2) {
this.addMsg.BrandImgList.push({
Sort: 1,
Name: "",
Path: url
});
}
this.isShowIamge = false;
}, },
//显示图片弹窗 mounted() {
openChangeDig(type) { if (this.$route.query.Id) {
this.chooseType = type; this.addMsg.Id = this.$route.query.Id;
this.isShowIamge = true; this.initData();
}
}, },
//获取品牌分类 methods: {
getCategoryList() { //删除图片
this.apipost("/api/Assess/GetCategoryDropList", {}, res => { ClearCarouse(index) {
if (res.data.resultCode == 1) { if (this.addMsg.BrandImgList && this.addMsg.BrandImgList.length > 0) {
this.CategoryList = res.data.data; this.addMsg.BrandImgList.splice(index, 1);
} }
}); },
}, initData() {
//保存品牌 var qMsg = {
Save(formName) { BrandId: this.addMsg.Id
this.$refs[formName].validate(valid => { };
if (valid) { this.apipost("/api/Assess/GetBrandInfo", qMsg, res => {
this.apipost("/api/Assess/SetBrandInfo", this.addMsg, res => { if (res.data.resultCode == 1) {
if (res.data.resultCode == 1) { var tempData = res.data.data;
this.CommonJump("hbrand"); if (tempData) {
this.Success(res.data.message); let {
} else { Id,
this.Error(res.data.message); Name,
Logo,
CategoryId,
IsHot,
MoreDesc,
RemarkDesc
} = tempData;
this.addMsg = {
Id,
Name,
Logo,
CategoryId,
IsHot,
MoreDesc,
RemarkDesc
};
if (tempData.BrandImgList && tempData.BrandImgList.length > 0) {
this.addMsg.BrandImgList = tempData.BrandImgList;
}
} }
}
});
},
SelectId(msg) {
let url = this.getIconLink(msg.url);
if (this.chooseType == 1) {
this.addMsg.Logo = url;
}
if (this.chooseType == 2) {
this.addMsg.BrandImgList.push({
Sort: 1,
Name: "",
Path: url
}); });
} else {
return false;
} }
}); this.isShowIamge = false;
},
//显示图片弹窗
openChangeDig(type) {
this.chooseType = type;
this.isShowIamge = true;
},
//获取品牌分类
getCategoryList() {
this.apipost("/api/Assess/GetCategoryDropList", {}, res => {
if (res.data.resultCode == 1) {
this.CategoryList = res.data.data;
}
});
},
//保存品牌
Save(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.apipost("/api/Assess/SetBrandInfo", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump("hbrand");
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
});
} else {
return false;
}
});
}
} }
} };
};
</script> </script>
<style> <style>
.app-add-cat .el-checkbox-group { .app-add-cat .el-checkbox-group {
font-size: 14px !important; font-size: 14px !important;
} }
.app-add-cat .el-checkbox { .app-add-cat .el-checkbox {
margin-right: 0; margin-right: 0;
} }
.app-add-cat .el-dialog__body { .app-add-cat .el-dialog__body {
padding: 10px 20px !important; padding: 10px 20px !important;
} }
.app-add-cat .tag-box .tag-item { .app-add-cat .tag-box .tag-item {
margin-right: 5px; margin-right: 5px;
} }
.app-add-cat .tag-box { .app-add-cat .tag-box {
margin: 20px 0; margin: 20px 0;
} }
.app-add-cat .app-goods-cat-list .active { .app-add-cat .app-goods-cat-list .active {
background: #fafafa; background: #fafafa;
} }
.app-add-cat .app-goods-cat-list .cat-item { .app-add-cat .app-goods-cat-list .cat-item {
cursor: pointer; cursor: pointer;
padding: 5px 10px; padding: 5px 10px;
} }
.app-add-cat .app-goods-cat-list { .app-add-cat .app-goods-cat-list {
border: 1px solid #e8eaee; border: 1px solid #e8eaee;
border-radius: 5px; border-radius: 5px;
margin-top: -5px; margin-top: -5px;
padding: 10px 0; padding: 10px 0;
overflow: scroll; overflow: scroll;
height: 400px; height: 400px;
} }
.h_edit_brand .blue { .h_edit_brand .blue {
color: #409eff; color: #409eff;
} }
.h_edit_brand .content { .h_edit_brand .content {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 10px;
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.h_edit_brand .gez_list { .h_edit_brand .gez_list {
/*width: 650px;*/ /*width: 650px;*/
margin-bottom: 12px; margin-bottom: 12px;
padding: 20px; padding: 20px;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
background-color: #fff; background-color: #fff;
color: #303133; color: #303133;
} }
.h_edit_brand .quyu { .h_edit_brand .quyu {
background-color: #f4f4f5; background-color: #f4f4f5;
color: #909399; color: #909399;
padding: 10px; padding: 10px;
line-height: 30px; line-height: 30px;
height: 30px; height: 30px;
font-size: 12px; font-size: 12px;
border-radius: 4px; border-radius: 4px;
white-space: nowrap; white-space: nowrap;
margin: 5px; margin: 5px;
} }
.h_edit_brand .el-tag + .el-tag { .h_edit_brand .el-tag+.el-tag {
margin-left: 10px; margin-left: 10px;
} }
.h_edit_brand .button-new-tag { .h_edit_brand .button-new-tag {
margin-left: 10px; margin-left: 10px;
height: 32px; height: 32px;
line-height: 30px; line-height: 30px;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.h_edit_brand .input-new-tag { .h_edit_brand .input-new-tag {
width: 90px; width: 90px;
margin-left: 10px; margin-left: 10px;
vertical-align: bottom; vertical-align: bottom;
} }
.h_edit_brand .ue-style .el-form-item__content { .h_edit_brand .ue-style .el-form-item__content {
line-height: 0; line-height: 0;
} }
.h_edit_brand .app-gallery-item { .h_edit_brand .app-gallery-item {
border: none; border: none;
} }
.h_edit_brand .nav_Main { .h_edit_brand .nav_Main {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
} }
.h_edit_brand .nav_IconContent { .h_edit_brand .nav_IconContent {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
} }
/* .h_edit_brand .nav_IconContent div>div { /* .h_edit_brand .nav_IconContent div>div {
display: inline-block; display: inline-block;
} */ } */
.h_edit_brand .colapp-image { .h_edit_brand .colapp-image {
background-size: cover; background-size: cover;
background-position: center center; background-position: center center;
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 0%; border-radius: 0%;
} }
.h_edit_brand .add-image-btn { .h_edit_brand .add-image-btn {
width: 100px; width: 100px;
height: 100px; height: 100px;
line-height: 100px; line-height: 100px;
color: #419efb; color: #419efb;
border: 1px solid #e2e2e2; border: 1px solid #e2e2e2;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
} }
.h_edit_brand .delBtn { .h_edit_brand .delBtn {
position: absolute; position: absolute;
right: -8px; right: -8px;
top: -8px; top: -8px;
padding: 4px 4px !important; padding: 4px 4px !important;
} }
.h_edit_brand .w600 { .h_edit_brand .w600 {
width: 600px; width: 600px;
} }
.h_edit_brand .brandShuxing { .h_edit_brand .brandShuxing {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 850px; width: 850px;
} }
.h_edit_brand .brandShuxing_item { .h_edit_brand .brandShuxing_item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 50%; width: 50%;
} }
</style> </style>
\ No newline at end of file
...@@ -6,84 +6,34 @@ ...@@ -6,84 +6,34 @@
<div class="content"> <div class="content">
<div style="margin-bottom:20px"> <div style="margin-bottom:20px">
<span>分类</span> <span>分类</span>
<el-select <el-select style="margin:0 10px" class="w200" @change="(msg.pageIndex = 1), getList()" v-model="msg.CategoryId"
style="margin:0 10px" size="small" placeholder="请选择" clearable>
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 <el-option v-for="item in CategoryList" :key="item.Id" :label="item.Name" :value="item.Id">
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 <el-input type="text" style="width:250px" size="small" maxlength="100" v-model="msg.BrandName"
type="text" @input="(msg.pageIndex = 1), getList()" clearable>
style="width:250px"
size="small"
maxlength="100"
v-model="msg.BrandName"
@input="(msg.pageIndex = 1), getList()"
clearable
>
</el-input> </el-input>
<span style="margin-left: 10px">咨询用户</span> <span style="margin-left: 10px">咨询用户</span>
<el-select <el-select size="small" v-model="msg.UserId" @change="(msg.pageIndex = 1), getList()" placeholder="请选择"
size="small" :filter-method="ChangeListName" filterable clearable>
v-model="msg.UserId"
@change="(msg.pageIndex = 1), getList()"
placeholder="请选择"
:filter-method="ChangeListName"
filterable
clearable
>
<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"></el-option>
v-for="item in userList"
:key="item.Id"
:label="item.Name"
:value="item.Id"
></el-option>
</el-select> </el-select>
<span>是否回复</span> <span>是否回复</span>
<el-select <el-select style="margin:0 10px" @change="(msg.pageIndex = 1), getList()" v-model="msg.IsReply" size="small"
style="margin:0 10px" placeholder="请选择">
@change="(msg.pageIndex = 1), getList()"
v-model="msg.IsReply"
size="small"
placeholder="请选择"
>
<el-option label="不限" :value="0"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option <el-option v-for="item in ReplyList" :key="item.Id" :label="item.Name" :value="item.Id">
v-for="item in ReplyList"
:key="item.Id"
:label="item.Name"
:value="item.Id"
>
</el-option> </el-option>
</el-select> </el-select>
<el-button <el-button @click="(msg.pageIndex = 1), getList()" size="small" type="primary">
@click="(msg.pageIndex = 1), getList()"
size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
</div> </div>
<el-table <el-table :data="tableData" v-loading="loading" border style="width: 100%">
:data="tableData"
v-loading="loading"
border
style="width: 100%"
>
<el-table-column prop="Id" label="编号" width="150"> </el-table-column> <el-table-column prop="Id" label="编号" width="150"> </el-table-column>
<el-table-column prop="UserName" label="用户昵称"></el-table-column> <el-table-column prop="UserName" label="用户昵称"></el-table-column>
<el-table-column prop="CategoryName" label="分类"></el-table-column> <el-table-column prop="CategoryName" label="分类"></el-table-column>
...@@ -107,43 +57,24 @@ ...@@ -107,43 +57,24 @@
<el-table-column prop="ReplyDate" label="回复时间"> </el-table-column> <el-table-column prop="ReplyDate" label="回复时间"> </el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-tooltip v-if="scope.row.ReplyDate == ''" class="item" effect="dark" content="回复" placement="top">
v-if="scope.row.ReplyDate == ''" <img @click="showReplayForm(scope.row, 1)" class="app-order-icon"
size="mini" src="../../assets/img/userman/add_remark.png" alt="" />
type="info" </el-tooltip>
plain <el-tooltip class="item" effect="dark" content="查看" placement="top">
@click="showReplayForm(scope.row, 1)" <img @click="showReplayForm(scope.row, 2)" class="app-order-icon"
> src="../../assets/img/userman/detail.png" alt="" />
回复 </el-tooltip>
</el-button>
<el-button
size="mini"
type="info"
plain
@click="showReplayForm(scope.row, 2)"
>查看</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
style="text-align:right" :current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total">
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>
<!-- 回复 --> <!-- 回复 -->
<el-dialog <el-dialog :title="editTitle" :visible.sync="isShowReplayForm" width="600px">
:title="editTitle" <el-form label-width="150px" >
:visible.sync="isShowReplayForm"
width="600px"
>
<el-form label-width="150px" :rules="rules">
<el-form-item label="咨询用户"> <el-form-item label="咨询用户">
{{ replayMsg.UserName }} {{ replayMsg.UserName }}
</el-form-item> </el-form-item>
...@@ -158,18 +89,10 @@ ...@@ -158,18 +89,10 @@
</el-form-item> </el-form-item>
<el-form-item label="商品图片"> <el-form-item label="商品图片">
<div class="shopImg"> <div class="shopImg">
<div <div class="indexApp_image" v-for="(item, index) in replayMsg.GoodsImgList" :key="index">
class="indexApp_image"
v-for="(item, index) in replayMsg.GoodsImgList"
:key="index"
>
<div> <div>
<el-image <el-image style="width: 100px; height: 100px" v-if="item.Path" :src="item.Path"
style="width: 100px; height: 100px" :preview-src-list="srcList"></el-image>
v-if="item.Path"
:src="item.Path"
:preview-src-list="srcList"
></el-image>
<br /> <br />
{{ item.Name }} {{ item.Name }}
</div> </div>
...@@ -178,18 +101,9 @@ ...@@ -178,18 +101,9 @@
</el-form-item> </el-form-item>
<el-form-item label="更多照片"> <el-form-item label="更多照片">
<div class="shopImg"> <div class="shopImg">
<div <div class="indexApp_more-image" v-for="(item, index) in replayMsg.MoreImgList" :key="index">
class="indexApp_more-image"
v-for="(item, index) in replayMsg.MoreImgList"
:key="index"
>
<div> <div>
<el-image <el-image style="width: 100px; height: 100px" v-if="item.Path" :src="item.Path"></el-image><br />
style="width: 100px; height: 100px"
v-if="item.Path"
:src="item.Path"
></el-image
><br />
{{ item.Name }} {{ item.Name }}
</div> </div>
</div> </div>
...@@ -200,14 +114,8 @@ ...@@ -200,14 +114,8 @@
</el-form-item> </el-form-item>
<el-form-item label="回复内容" prop="ReplyContent"> <el-form-item label="回复内容" prop="ReplyContent">
<template v-if="showType == 1"> <template v-if="showType == 1">
<el-input <el-input style="width:300px" size="small" maxlength="200" :rows="3" type="textarea"
style="width:250px" v-model="replayMsg.ReplyContent">
size="small"
maxlength="200"
:rows="3"
type="textarea"
v-model="replayMsg.ReplyContent"
>
</el-input> </el-input>
</template> </template>
<template v-else> <template v-else>
...@@ -216,177 +124,170 @@ ...@@ -216,177 +124,170 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowReplayForm = false" <el-button size="small" @click="isShowReplayForm = false">取 消</el-button>
>取 消</el-button <el-button size="small" type="primary" @click="saveData()" v-if="showType == 1">确 定</el-button>
>
<el-button
size="small"
type="primary"
@click="saveData()"
v-if="showType == 1"
>确 定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</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,
BrandName: "", BrandName: "",
CategoryId: "", CategoryId: "",
BrandId: "", BrandId: "",
UserId: "", UserId: "",
IsReply: "" IsReply: ""
}, },
//回复状态 //回复状态
ReplyList: [ ReplyList: [{
{ Id: 1,
Id: 1, Name: "已回复"
Name: "已回复" },
{
Id: 2,
Name: "未回复"
}
],
editTitle: "回复",
//回复信息
replayMsg: {
GoodsId: 0,
GoodsImgList: [],
MoreImgList: [],
ReplyContent: "", //回复内容
Remark: "", //备注信息
CategoryName: "", //分类名称
BrandName: "", //品牌名称
UserName: "", //咨询用户
CreateDate: "" //咨询时间
},
isShowCategoryForm: false,
isShowChooseImage: false,
CategoryList: [], //分类列表
isShowReplayForm: false, //是否显示回复弹窗
showType: 1, //回复类型(1-回复,2-查看)
userList: [], //用户列表
//用户查询
userMsg: {
pageIndex: 1,
pageSize: 50,
Name: "",
Source: 0,
MemberGrade: 0,
Id: 0,
Moblie: ""
}, },
{
Id: 2,
Name: "未回复"
}
],
editTitle: "回复",
//回复信息
replayMsg: {
GoodsId: 0,
GoodsImgList: [],
MoreImgList: [],
ReplyContent: "", //回复内容
Remark: "", //备注信息
CategoryName: "", //分类名称
BrandName: "", //品牌名称
UserName: "", //咨询用户
CreateDate: "" //咨询时间
},
isShowCategoryForm: false,
isShowChooseImage: false,
CategoryList: [], //分类列表
isShowReplayForm: false, //是否显示回复弹窗
showType: 1, //回复类型(1-回复,2-查看)
userList: [], //用户列表
//用户查询
userMsg: {
pageIndex: 1,
pageSize: 50,
Name: "",
Source: 0,
MemberGrade: 0,
Id: 0,
Moblie: ""
},
//放大商品图片 //放大商品图片
srcList: [] srcList: []
}; };
},
created() {
this.getCategoryList();
this.getuserList();
},
mounted() {
this.getList();
},
methods: {
//搜索用户
ChangeListName(val) {
this.userMsg.Name = val;
this.getuserList();
}, },
//获取用户列表 created() {
getuserList() { this.getCategoryList();
this.apipost("/api/user/GetMemberUserDropDownList", this.userMsg, res => { this.getuserList();
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.userList = pageData;
}
});
},
showReplayForm(item, showType) {
this.replayMsg.GoodsId = item.Id;
this.replayMsg.GoodsImgList = item.GoodsImgList;
this.replayMsg.MoreImgList = item.MoreImgList;
this.replayMsg.Remark = item.Remark;
this.replayMsg.CategoryName = item.CategoryName;
this.replayMsg.BrandName = item.BrandName;
this.replayMsg.UserName = item.UserName;
this.replayMsg.CreateDate = item.CreateDate;
this.showType = showType;
this.srcList = item.GoodsImgList.map(v => v.Path);
if (this.showType == 2) {
this.replayMsg.ReplyContent = item.ReplyContent;
}
this.isShowReplayForm = true;
},
//获取分类列表
getCategoryList() {
this.apipost("/api/Assess/GetCategoryDropList", {}, res => {
if (res.data.resultCode == 1) {
this.CategoryList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
//获取数据
getList() {
this.isShowCategoryForm = false;
this.loading = true;
this.assetsApipost("/api/Assess/GetGoodsPageList", 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) { mounted() {
this.msg.pageIndex = val;
this.getList(); this.getList();
}, },
//设置咨询回复 methods: {
saveData() { //搜索用户
this.assetsApipost("/api/Assess/SetGoodsReply", this.replayMsg, res => { ChangeListName(val) {
if (res.data.resultCode == 1) { this.userMsg.Name = val;
this.isShowReplayForm = false; this.getuserList();
this.Success(res.data.message); },
this.getList(); //获取用户列表
} else { getuserList() {
this.Error(res.data.message); this.apipost("/api/user/GetMemberUserDropDownList", this.userMsg, res => {
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.userList = pageData;
}
});
},
showReplayForm(item, showType) {
this.replayMsg.GoodsId = item.Id;
this.replayMsg.GoodsImgList = item.GoodsImgList;
this.replayMsg.MoreImgList = item.MoreImgList;
this.replayMsg.Remark = item.Remark;
this.replayMsg.CategoryName = item.CategoryName;
this.replayMsg.BrandName = item.BrandName;
this.replayMsg.UserName = item.UserName;
this.replayMsg.CreateDate = item.CreateDate;
this.showType = showType;
this.srcList = item.GoodsImgList.map(v => v.Path);
if (this.showType == 2) {
this.replayMsg.ReplyContent = item.ReplyContent;
} }
}); this.isShowReplayForm = true;
},
//获取分类列表
getCategoryList() {
this.apipost("/api/Assess/GetCategoryDropList", {}, res => {
if (res.data.resultCode == 1) {
this.CategoryList = res.data.data;
} else {
this.Error(res.data.message);
}
});
},
//获取数据
getList() {
this.isShowCategoryForm = false;
this.loading = true;
this.assetsApipost("/api/Assess/GetGoodsPageList", 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();
},
//设置咨询回复
saveData() {
this.assetsApipost("/api/Assess/SetGoodsReply", this.replayMsg, res => {
if (res.data.resultCode == 1) {
this.isShowReplayForm = false;
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
});
}
} }
} };
};
</script> </script>
<style> <style>
.performanceStatics .content { .performanceStatics .content {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 10px;
padding: 20px; padding: 20px;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
.shopImg {
display: flex; .shopImg {
flex-wrap: wrap; display: flex;
margin-bottom: 20px; flex-wrap: wrap;
} margin-bottom: 20px;
.shopImg > div { }
width: 33%;
} .shopImg>div {
</style> width: 33%;
}
</style>
\ No newline at end of file
...@@ -45,8 +45,9 @@ ...@@ -45,8 +45,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="el-icon-s-tools" size="mini" type="info" plain @click="showBrandForm(scope.row)"></el-button> <img @click="showBrandForm(scope.row)" src="../../assets/img/userman/edit.png" alt="" />
<el-button class="el-icon-delete-solid" size="mini" type="info" plain @click="RemmoveBrand(scope.row)"></el-button> <img @click="RemmoveBrand(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png"
alt="" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -2,50 +2,25 @@ ...@@ -2,50 +2,25 @@
<div class="performanceStatics"> <div class="performanceStatics">
<div class="head-title"> <div class="head-title">
分类管理 分类管理
<el-button <el-button style="float:right;margin-top: -5px;" type="primary" class="el-button--small"
style="float:right;margin-top: -5px;" @click="showCategoryForm(null)">新增</el-button>
type="primary"
class="el-button--small"
@click="showCategoryForm(null)"
>新增</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-input <el-input type="text" style="width:250px" size="small" maxlength="50" v-model="msg.Name"
type="text" @input="(msg.pageIndex = 1), getList()" clearable>
style="width:250px"
size="small"
maxlength="100"
v-model="msg.Name"
@input="(msg.pageIndex = 1), getList()"
clearable
>
</el-input> </el-input>
<el-button <el-button @click="(msg.pageIndex = 1), getList()" size="small" type="primary">
@click="(msg.pageIndex = 1), getList()"
size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
</div> </div>
<el-table <el-table :data="tableData" v-loading="loading" border style="width: 100%">
:data="tableData"
v-loading="loading"
border
style="width: 100%"
>
<el-table-column prop="Id" label="编号" width="150"> </el-table-column> <el-table-column prop="Id" label="编号" width="150"> </el-table-column>
<el-table-column prop="Name" label="名称"></el-table-column> <el-table-column prop="Name" label="名称"></el-table-column>
<el-table-column label="Logo" width="300px"> <el-table-column label="Logo" width="300px">
<template slot-scope="scope"> <template slot-scope="scope">
<img <img :src="scope.row.Image" style="width:35px;height:35px;" alt="" />
:src="scope.row.Image"
style="width:35px;height:35px;"
alt=""
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="启用状态" width="300px"> <el-table-column label="启用状态" width="300px">
...@@ -56,64 +31,29 @@ ...@@ -56,64 +31,29 @@
<el-table-column prop="Sort" label="排序"> </el-table-column> <el-table-column prop="Sort" label="排序"> </el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <img @click="showCategoryForm(scope.row)" src="../../assets/img/userman/edit.png" alt="" />
class="el-icon-s-tools" <img @click="RemmoveCategory(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png"
size="mini" alt="" />
type="info"
plain
@click="showCategoryForm(scope.row)"
></el-button>
<el-button
class="el-icon-delete-solid"
size="mini"
type="info"
plain
@click="RemmoveCategory(scope.row)"
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
style="text-align:right" :current-page.sync="msg.pageIndex" layout="prev, pager, next" :total="total">
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>
<!-- 修改分类 --> <!-- 修改分类 -->
<el-dialog <el-dialog :title="editTitle" :visible.sync="isShowCategoryForm" width="500px">
:title="editTitle"
:visible.sync="isShowCategoryForm"
width="500px"
>
<el-form :model="postMsg" :rules="rules" label-width="150px"> <el-form :model="postMsg" :rules="rules" label-width="150px">
<el-form-item label="分类名称" prop="Name"> <el-form-item label="分类名称" prop="Name">
<el-input <el-input type="text" style="width:250px" size="small" maxlength="100" v-model="postMsg.Name">
type="text"
style="width:250px"
size="small"
maxlength="100"
v-model="postMsg.Name"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="Logo" prop="file"> <el-form-item label="Logo" prop="file">
<div> <div>
<el-button @click="openChangeDig()" size="small" <el-button @click="openChangeDig()" size="small">选择文件</el-button>
>选择文件</el-button
>
</div> </div>
<div class="indexApp_image"> <div class="indexApp_image">
<img <img v-if="postMsg.Image" :src="postMsg.Image" alt="" style="width:100px;height:100px;" />
v-if="postMsg.Image"
:src="postMsg.Image"
alt=""
style="width:100px;height:100px;"
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="启用状态" prop="Enable"> <el-form-item label="启用状态" prop="Enable">
...@@ -121,166 +61,158 @@ ...@@ -121,166 +61,158 @@
<el-radio v-model="postMsg.Enable" :label="2">禁用</el-radio> <el-radio v-model="postMsg.Enable" :label="2">禁用</el-radio>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="Sort"> <el-form-item label="排序" prop="Sort">
<el-input <el-input style="width:250px" size="small" maxlength="200" v-model="postMsg.Sort">
style="width:250px"
size="small"
maxlength="200"
v-model="postMsg.Sort"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowCategoryForm = false" <el-button size="small" @click="isShowCategoryForm = false">取 消</el-button>
>取 消</el-button <el-button size="small" type="primary" @click="saveData()">确 定</el-button>
>
<el-button size="small" type="primary" @click="saveData()"
>确 定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
<!-- 选择文件 --> <!-- 选择文件 -->
<el-dialog <el-dialog title="选择文件" :visible.sync="isShowChooseImage" width="1240px">
title="选择文件"
:visible.sync="isShowChooseImage"
width="1240px"
>
<ChooseImg @SelectId="SelectId"></ChooseImg> <ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import ChooseImg from "@/components/global/ChooseImg.vue"; import ChooseImg from "@/components/global/ChooseImg.vue";
export default { export default {
components: { components: {
ChooseImg ChooseImg
},
data() {
return {
loading: false,
tableData: [],
total: 0,
msg: {
pageIndex: 1,
pageSize: 15,
Name: ""
},
dateList: [], //日期
editTitle: "新增分类分类",
postMsg: {
Id: 0,
Name: "",
Image: "",
Enable: 1,
Sort: 0
},
isShowCategoryForm: false,
isShowChooseImage: false,
rules: {
Name: [
{ required: true, message: "请输入名称", trigger: "blur" }
],
Sort: [
{ required: true, message: "请输入排序", trigger: "blur" }
],
Enable: [
{ required: true, message: "请选择状态", trigger: "change" }
]
}
};
},
created() {},
mounted() {
this.getList();
},
methods: {
openChangeDig() {
this.isShowChooseImage = true;
}, },
SelectId(msg) { data() {
let url = this.getIconLink(msg.url); return {
this.postMsg.Image = url; loading: false,
this.isShowChooseImage = false; tableData: [],
}, total: 0,
//获取数据 msg: {
getList() { pageIndex: 1,
this.isShowCategoryForm = false; pageSize: 15,
this.loading = true; Name: ""
this.assetsApipost("/api/Assess/GetCategoryPageList", this.msg, res => { },
this.loading = false; dateList: [], //日期
if (res.data.resultCode == 1) { editTitle: "新增分类分类",
this.total = res.data.data.count; postMsg: {
this.tableData = res.data.data.pageData; Id: 0,
} else { Name: "",
this.Error(res.data.message); Image: "",
Enable: 1,
Sort: 0
},
isShowCategoryForm: false,
isShowChooseImage: false,
rules: {
Name: [{
required: true,
message: "请输入名称",
trigger: "blur"
}],
Sort: [{
required: true,
message: "请输入排序",
trigger: "blur"
}],
Enable: [{
required: true,
message: "请选择状态",
trigger: "change"
}]
} }
}); };
}, },
handleCurrentChange(val) { created() {},
this.msg.pageIndex = val; mounted() {
this.getList(); this.getList();
}, },
//显示表单 methods: {
showCategoryForm(item) { openChangeDig() {
if (item) { this.isShowChooseImage = true;
this.editTitle = "修改分类"; },
this.postMsg.Id = item.Id; SelectId(msg) {
this.postMsg.Name = item.Name; let url = this.getIconLink(msg.url);
this.postMsg.Image = item.Image; this.postMsg.Image = url;
this.postMsg.Enable = item.Enable; this.isShowChooseImage = false;
this.postMsg.Sort = item.Sort; },
} else { //获取数据
this.editTitle = "新增分类"; getList() {
this.postMsg.Id = 0; this.isShowCategoryForm = false;
this.postMsg.Name = ""; this.loading = true;
this.postMsg.Image = ""; this.assetsApipost("/api/Assess/GetCategoryPageList", this.msg, res => {
this.postMsg.Enable = 1; this.loading = false;
this.postMsg.Sort = 0; if (res.data.resultCode == 1) {
} this.total = res.data.data.count;
this.isShowCategoryForm = true; this.tableData = res.data.data.pageData;
}, } else {
//新增修改分类 this.Error(res.data.message);
saveData() { }
this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => { });
if (res.data.resultCode == 1) { },
this.Success(res.data.message); handleCurrentChange(val) {
this.getList(); this.msg.pageIndex = val;
this.getList();
},
//显示表单
showCategoryForm(item) {
if (item) {
this.editTitle = "修改分类";
this.postMsg.Id = item.Id;
this.postMsg.Name = item.Name;
this.postMsg.Image = item.Image;
this.postMsg.Enable = item.Enable;
this.postMsg.Sort = item.Sort;
} else { } else {
this.Error(res.data.message); this.editTitle = "新增分类";
this.postMsg.Id = 0;
this.postMsg.Name = "";
this.postMsg.Image = "";
this.postMsg.Enable = 1;
this.postMsg.Sort = 0;
} }
}); this.isShowCategoryForm = true;
}, },
//删除分类 //新增修改分类
RemmoveCategory(item) { saveData() {
let that = this; this.assetsApipost("/api/Assess/SetCategoryInfo", this.postMsg, res => {
that.Confirm("是否删除此分类?", function() { if (res.data.resultCode == 1) {
that.apipost( this.Success(res.data.message);
"/api/Assess/DelCategoryInfo", this.getList();
{ } else {
CategoryId: item.Id this.Error(res.data.message);
},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
} else {
that.Error(res.data.message);
}
} }
); });
}); },
//删除分类
RemmoveCategory(item) {
let that = this;
that.Confirm("是否删除此分类?", function () {
that.apipost(
"/api/Assess/DelCategoryInfo", {
CategoryId: item.Id
},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
} else {
that.Error(res.data.message);
}
}
);
});
}
} }
} };
};
</script> </script>
<style> <style>
.performanceStatics .content { .performanceStatics .content {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 10px;
padding: 20px; padding: 20px;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
</style> </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 to comment