Commit f565a70f authored by Mac's avatar Mac

司导页面

parent 8b4daf1a
<template>
<div v-loading="loading" class="addCar">
<div class="head-title">
<span @click="CommonJump('directorCarList')" 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">
<el-input v-model="addMsg.Name" placeholder="请输入车辆名称" />
</el-form-item>
<el-form-item label="LOGO">
<el-tooltip class="item" effect="dark" content="建议尺寸100*100" placement="top">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
</el-tooltip>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.CarLogo || addMsg.CarLogo==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.CarLogo"
alt="">
</div>
</el-form-item>
<el-form-item label="车辆分类" prop="SiteId" class="is-required">
<el-select class="w200" v-model="addMsg.CarClass" size="small"
placeholder="请选择">
<el-option v-for="item in CarClassList" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆品牌" prop="SiteId" class="is-required">
<el-select class="w200" v-model="addMsg.CarBrandId" size="small"
placeholder="请选择">
<el-option v-for="item in CarBrandList" :key="item.ID" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="车辆型号" prop="CarType" class="is-required">
<el-input v-model="addMsg.CarType" placeholder="请输入车辆型号" />
</el-form-item>
<el-form-item label="可乘坐人数" prop="GuestNum" class="is-required">
<el-input v-model="addMsg.GuestNum" placeholder="请输入可乘坐人数" type="number"/>
</el-form-item>
<el-form-item label="车辆颜色" class="is-required">
<div class="gez_list el-card" v-for="(item,index) in addMsg.ColorList" :key="index" v-if="addMsg.ColorList&& addMsg.ColorList.length>0">
<div style="width: 650px;display: flex;flex-direction: row;align-items: center;justify-content: space-between">
<div style="width: 200px;">
<el-input v-model="item.ColorName" placeholder="请输入颜色名称" size="small"/>
</div>
<div style="width: 50px;display: flex;flex-direction: row;justify-content: space-around">
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../assets/img/setup/del.png" alt="" class="imgstyle" @click="delete_b(index)">
</el-tooltip>
</div>
</div>
<div style=" display: flex;flex-wrap: wrap;justify-content: flex-start;margin-top: 30px">
<div class="nav_IconContent" >
<div v-for="(x, index2) in item.PicList" :key="index2"
style="margin-right: 20px; position: relative; " v-if="item.PicList&& item.PicList.length>0">
<div class="colapp-image" :style="{
backgroundImage: 'url(' + x + ')'
}"></div>
<el-button @click="ClearCarouse(index,index2)" class="delBtn" type="danger" icon="el-icon-close"
circle></el-button>
</div>
<div @click="openChangeDig(2),Picindex = index" v-if="item.PicList&&item.PicList.length<9"
class="add-image-btn">
+ 添加图片
</div>
</div>
</div>
</div>
<div>
<span style="color: #409EFF;font-size: 14px;cursor: pointer;" @click="addOf">+新增车辆颜色</span>
<span style="color:#DCDFE6;font-size: 12px;">最多支持上传9张</span>
</div>
</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>
<el-dialog title="选择文件" :visible.sync="changeState2" width="1240px">
<ChooseImg @SelectId="SelectId2" :IsMultiple="true"></ChooseImg>
</el-dialog>
</div>
</template>
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
components: {
ChooseImg,
},
data() {
return {
addMsg: {
ID: 0,
CarLogo:'',
Name:'',
CarType:'',
CarClass:'',
CarBrandId:'',
GuestNum:'',
ColorList:[],
},
Picindex:0,
rules: {
Name: [{
required: true,
message: '请输入车辆名称',
trigger: 'blur'
}],
CarType: [{
required: true,
message: '请输入车辆型号',
trigger: 'blur'
}],
GuestNum: [{
required: true,
message: '请输入可乘坐人数',
trigger: 'blur'
}],
},
CarClassList:[],
CarBrandList:[],
loading: false,
CarSiteList:[],
changeState:false,
changeState2:false,
imgType:0,
};
},
created() {
if(this.$route.query.ID){
this.getData(this.$route.query.ID)
}
this.getCarClassList()//获取车辆的分类
this.getGuideCarBrandList()//获取车辆品牌
},
methods: {
SelectId(msg){
if(this.imgType==1){
let url = this.getIconLink(msg.url)
this.addMsg.CarLogo = url
}
this.changeState = false;
},
SelectId2(msg){
let that = this;
let data =[]
if(msg && msg.length > 0){
msg.forEach(item => {
let obj = this.getIconLink(item.url)
data.push(obj)
})
}
that.addMsg.ColorList[that.Picindex].PicList=that.addMsg.ColorList[that.Picindex].PicList.concat(data);
this.changeState2 = false;
},
openChangeDig(num) {
if(num==2){
this.changeState2 = true
}else {
this.changeState = true;
}
this.imgType=num;
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.CarLogo==''){
this.Error('请上传Logo')
return false
}
if(this.addMsg.CarClass==''){
this.Error('请选择车辆分类')
return false
}
if(this.addMsg.CarBrandId==''){
this.Error('请选择车辆品牌')
return false
}
if(this.addMsg.ColorList.length==0){
this.Error('请选择车辆颜色')
return false
}
this.apipost("/api/GuideCar/AddOrUpdateGuideCar", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('directorCarList');
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
})
} else {
return false;
}
});
},
getGuideCarBrandList(){
this.apipost("/api/GuideCar/GetGuideCarBrandList", {}, res => {
if(res.data.resultCode==1){
this.CarBrandList = res.data.data;
}else {
this.Info(res.data.message);
}
})
},
getCarClassList(){
this.apipost("/api/GuideCar/GetCarClassList", {}, res => {
if (res.data.resultCode == 1) {
this.CarClassList = res.data.data
} else {
this.Error(res.data.message);
}
})
},
getData(ID) {
this.loading = true;
this.apipost("/api/GuideCar/GetGuideCarModel", {
ID: ID
}, res => {
this.loading = false;
this.addMsg = res.data.data;
})
},
delete_b(index){
this.addMsg.ColorList.splice(index,1)
},
ClearCarouse(index,index2) {
this.addMsg.ColorList[index].PicList.splice(index2, 1);
},
addOf(){
let obj = {
ID:0,
PicList:[],
ColorName:'',
}
this.addMsg.ColorList.push(obj)
},
},
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;
}
.addCar .tip {
margin-left: 10px;
display: inline-block;
height: 30px;
line-height: 30px;
color: #ff4544;
background-color: #FEF0F0;
padding: 0 20px;
border-radius: 5px;
}
.addCar .app-image {
background-size: cover;
background-position: center center;
width: 80px;
height: 80px;
border-radius: 0%;
}
.addCar .setTable .el-table__body .cell {
display: flex;
align-items: center;
}
.addCar .commonLabel .el-form-item__label {
margin-top: -4px;
}
.addCar .discount .el-form-item__label {
padding-right: 30px;
margin-top: -4px;
}
.addCar .el-form-item .elzk {
position: absolute;
left: -25px;
top: 8px;
}
.addCar .el-form-item {
position: relative;
}
.addCar .blue {
color: #409EFF;
}
.addCar .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.addCar .gez_list{
/*width: 650px;*/
margin-bottom: 12px;
padding: 20px;
border: 1px solid #EBEEF5;
background-color: #FFF;
color: #303133;
}
.addCar .quyu{
background-color: #f4f4f5;
color: #909399;
padding: 10px;
line-height: 30px;
height: 30px;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
margin: 5px;
}
.addCar .imgstyle{
width: 32px;
height: 32px;
margin: 0 5px;
}
.addCar .add-image-btn {
width: 100px;
height: 100px;
line-height: 100px;
color: #419efb;
border: 1px solid #e2e2e2;
cursor: pointer;
text-align: center;
}
.addCar .nav_IconContent {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.addCar .nav_IconContent div>div {
display: inline-block;
}
.addCar .colapp-image {
background-size: cover;
background-position: center center;
width: 100px;
height: 100px;
border-radius: 0%;
}
.addCar .delBtn {
position: absolute;
right: -8px;
top: -8px;
padding: 4px 4px !important;
}
</style>
<template>
<div v-loading="loading" class="addCarBrand">
<div class="head-title">
<span @click="CommonJump('directorCarBrandList')" 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">
<el-input v-model="addMsg.Name" placeholder="请输入车辆名称" />
</el-form-item>
<el-form-item label="LOGO" class="is-required">
<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.BrandLogo || addMsg.BrandLogo==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.BrandLogo"
alt="">
</div>
</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";
export default {
components: {
ChooseImg,
},
data() {
return {
addMsg: {
ID: 0,
BrandLogo:'',
Name:'',
},
Picindex:0,
rules: {
Name: [{
required: true,
message: '请输入品牌名称',
trigger: 'blur'
}],
},
loading: false,
changeState:false,
imgType:0,
};
},
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.BrandLogo = url
}
this.changeState = false;
},
openChangeDig(num) {
this.changeState = true;
this.imgType=num;
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.BrandLogo==''){
this.Error('请上传品牌Logo')
return false
}
this.apipost("/api/GuideCar/AddOrUpdateGuideCarBrand", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('directorCarBrandList');
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
})
} else {
return false;
}
});
},
getData(ID) {
this.loading = true;
this.apipost("/api/GuideCar/GetGuideCarBrandModel", {
ID: ID
}, res => {
this.loading = false;
this.addMsg = res.data.data;
})
},
},
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;
}
.addCarBrand .blue {
color: #409EFF;
}
.addCarBrand .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.addCarBrand .gez_list{
/*width: 650px;*/
margin-bottom: 12px;
padding: 20px;
border: 1px solid #EBEEF5;
background-color: #FFF;
color: #303133;
}
.addCarBrand .quyu{
background-color: #f4f4f5;
color: #909399;
padding: 10px;
line-height: 30px;
height: 30px;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
margin: 5px;
}
</style>
<template>
<div v-loading="loading" class="addGuide">
<div class="head-title">
<span @click="CommonJump('directorGuideList')" class="blue point">导游管理</span> / 编辑导游管理
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:60%">
<el-form-item label="导游名称" prop="Name" class="is-required">
<el-input v-model="addMsg.Name" placeholder="请输入站点名称" />
</el-form-item>
<el-form-item label="用户头像">
<el-tooltip class="item" effect="dark" content="建议尺寸100*100" placement="top">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
</el-tooltip>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.GuidePhoto || addMsg.GuidePhoto==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img v-else style="width:80px;height:80px" :src="addMsg.GuidePhoto"
alt="">
</div>
</el-form-item>
<el-form-item label="工作年限" prop="WorkYears" class="is-required">
<el-input v-model="addMsg.WorkYears" placeholder="请输入工作年限" />
</el-form-item>
<el-form-item label="站点" prop="SiteId" class="is-required">
<el-select class="w120" v-model="addMsg.SiteId" size="small"
placeholder="请选择">
<el-option v-for="item in CarSiteList" :key="item.ID" :label="item.SiteName" :value="item.ID">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系电话" prop="Telephone" class="is-required">
<el-input v-model="addMsg.Telephone" placeholder="请输入联系电话" type="number"/>
</el-form-item>
<el-form-item label="紧急联系电话" prop="EmergencyPhone" class="is-required">
<el-input v-model="addMsg.EmergencyPhone" placeholder="请输入紧急联系电话" type="number"/>
</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: {
ID: 0,
Name:'',
GuidePhoto:'',
WorkYears:0,
SiteId:'',
Telephone:'',
EmergencyPhone:'',
Introduction:'',
},
defaultMsg: "",
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
rules: {
Name: [{
required: true,
message: '请输入导游名称',
trigger: 'blur'
}],
WorkYears: [{
required: true,
message: '请输入工作年限名称',
trigger: 'blur'
}],
Telephone: [{
required: true,
message: '请输入联系电话名称',
trigger: 'blur'
}],
EmergencyPhone: [{
required: true,
message: '请输入紧急联系电话名称',
trigger: 'blur'
}],
},
loading: false,
CarSiteList:[],
changeState:false,
imgType:0,
};
},
created() {
if(this.$route.query.ID){
this.getData(this.$route.query.ID)
}
this.getAllGuideCarSiteList()//获取站点下拉
},
methods: {
SelectId(msg){
if(this.imgType==1){
let url = this.getIconLink(msg.url)
this.addMsg.GuidePhoto = url
}
this.changeState = false;
},
openChangeDig(num) {
this.changeState = true;
this.imgType=num;
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.GuidePhoto==''){
this.Error('请上传头像')
return false
}
if(this.addMsg.teId==''){
this.Error('请选择站点')
return false
}
let content = this.$refs.ue.getUEContent();
this.addMsg.Introduction = content;
this.apipost("/api/GuideCar/AddOrUpdateGuideCarGuide", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('directorGuideList');
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
})
} else {
return false;
}
});
},
getAllGuideCarSiteList(){
this.apipost("/api/GuideCar/GetAllGuideCarSiteList", {}, res => {
if (res.data.resultCode == 1) {
this.CarSiteList = res.data.data
} else {
this.Error(res.data.message);
}
})
},
getData(ID) {
this.loading = true;
this.apipost("/api/GuideCar/GetGuideCarGuideModel", {
ID: ID
}, res => {
this.loading = false;
this.addMsg = res.data.data;
if (this.addMsg.Introduction && this.addMsg.Introduction != "") {
this.defaultMsg = this.addMsg.Introduction;
}
})
},
},
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;
}
.addGuide .tip {
margin-left: 10px;
display: inline-block;
height: 30px;
line-height: 30px;
color: #ff4544;
background-color: #FEF0F0;
padding: 0 20px;
border-radius: 5px;
}
.addGuide .app-image {
background-size: cover;
background-position: center center;
width: 80px;
height: 80px;
border-radius: 0%;
}
.addGuide .setTable .el-table__body .cell {
display: flex;
align-items: center;
}
.addGuide .commonLabel .el-form-item__label {
margin-top: -4px;
}
.addGuide .discount .el-form-item__label {
padding-right: 30px;
margin-top: -4px;
}
.addGuide .el-form-item .elzk {
position: absolute;
left: -25px;
top: 8px;
}
.addGuide .el-form-item {
position: relative;
}
.addGuide .blue {
color: #409EFF;
}
.addGuide .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.addGuide .gez_list{
width: 650px;
margin-bottom: 12px;
padding: 20px;
border: 1px solid #EBEEF5;
background-color: #FFF;
color: #303133;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.addGuide .quyu{
background-color: #f4f4f5;
color: #909399;
padding: 10px;
line-height: 30px;
height: 30px;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
margin: 5px;
}
.addGuide .imgstyle{
width: 32px;
height: 32px;
margin: 0 5px;
}
</style>
<template>
<div class="directorCarBrandList">
<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="addRecharge">新增</el-button>
</div>
</div>
<div class="content">
<div style="display: flex;flex-direction: row;align-items: center">
<div class="block" >
<div class="searchInput" style="width:200px">
<el-input style="display:inline-block;width:170px;height:30px"
placeholder="请输入车辆品牌搜索"
v-model="msg.Name"
size="small"
@clear="getList"
@keyup.enter.native="getList"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
</div>
</div>
<div style="padding: 20px;background: #fff;">
<el-table
:data="tableData"
header-cell-class-name="headClass"
style="width: 100%"
border
>
<el-table-column
prop="ID"
label="ID"
width="100">
</el-table-column>
<el-table-column
prop="BrandLogo"
label="车辆图片">
<template slot-scope="scope">
<img :src="scope.row.BrandLogo" alt="" style="width: 100px;height: 100px">
</template>
</el-table-column>
<el-table-column
prop="Name"
label="名称"
>
</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="count">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: "directorCarBrandList",
data(){
return{
msg:{
pageIndex:1,
pageSize:20,
Name:'',
},
dateList:[],
tableData:[],
count:0,
loading:false,
}
},
created(){
this.getDateList();
},
methods:{
getDateList(){
this.loading=true;
this.apipost("/api/GuideCar/GetGuideCarBrandPageList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.tableData = res.data.data.pageData;
this.count = res.data.data.count;
}else {
this.Info(res.data.message);
}
})
},
addRecharge(){
this.$router.push('/addCarBrand');
},
Edit(row){
this.$router.push({
name: 'addCarBrand',
query: {
ID:row.ID,
blank: "y"
}
});
},
delete_b(row){
let that=this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/GuideCar/DelGuideCarBrandInfo",
{Ids:row.ID},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getDateList();
} else {
that.Error(res.data.message);
}
},
);
});
},
getList(){
this.msg.pageIndex = 1
this.getDateList()
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getDateList();
},
},
}
</script>
<style >
.directorCarBrandList .el-card__header{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background: #fff;
}
.directorCarBrandList .el-button--small{
padding: 9px 15px;
}
.directorCarBrandList .content .searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
/*margin-left: 10px;*/
}
.directorCarBrandList .content .searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.directorCarBrandList .content .searchInput{
line-height: normal;
display: inline-table;
border-collapse: separate;
border-spacing: 0;
width:250px;
}
.directorCarBrandList .content{
background: #fff;
margin-top:10px;
padding: 15px;
box-sizing: border-box;
}
.directorCarBrandList .el-tag{
margin-right: 5px;
}
.directorCarBrandList .app-image{
background-position: center center;
width: 50px;
height: 50px;
border-radius:0%;
float: left;
margin-right: 8px;
}
</style>
<template>
<div class="directorCarList">
<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="addRecharge">新增</el-button>
</div>
</div>
<div class="content">
<div style="display: flex;flex-direction: row;align-items: center">
<div class="block" >
<div class="searchInput" style="width:200px">
<el-input style="display:inline-block;width:170px;height:30px"
placeholder="请输入车辆名称搜索"
v-model="msg.Name"
size="small"
@clear="getList"
@keyup.enter.native="getList"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<span style="margin-left:15px">品牌:</span>
<el-select class="w120" @change="msg.pageIndex=1,getList()" v-model="msg.CarBrand" size="small" placeholder="请选择">
<el-option label="不限" :value='0'></el-option>
<el-option v-for="item in CarBrandList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
<span style="margin-left:15px">分类:</span>
<el-select class="w120" @change="msg.pageIndex=1,getList()" v-model="msg.CarClass" size="small" placeholder="请选择">
<el-option label="不限" :value='0'></el-option>
<el-option v-for="item in CarClassList" :key="item.Id" :label="item.Name" :value="item.Id"></el-option>
</el-select>
</div>
</div>
</div>
<div style="padding: 20px;background: #fff;">
<el-table
:data="tableData"
header-cell-class-name="headClass"
style="width: 100%"
border
>
<el-table-column
prop="ID"
label="ID"
width="100">
</el-table-column>
<el-table-column
prop="Name"
label="车辆信息">
<template slot-scope="scope">
<div class="app-image" :style="{backgroundImage:'url(' + scope.row.CarLogo + ')',backgroundSize:'cover'}"></div>
<div flex="dir:left cross:center">
{{scope.row.CarBrand}}
</div>
</template>
</el-table-column>
<el-table-column
prop="CarType"
label="型号"
>
</el-table-column>
<el-table-column
prop="CarClassStr"
label="分类"
width="120">
</el-table-column>
<el-table-column
prop="ColorList"
label="车辆颜色">
<template slot-scope="scope">
<el-button v-for="(x, index2) in scope.row.ColorList" :key="index2" size="mini" @click="showImg(x)">{{x.ColorName}}</el-button>
</template>
</el-table-column>
<el-table-column
prop="GoodsNum"
width="100"
label="商品数">
</el-table-column>
<el-table-column
prop="OrderNum"
width="100"
label="订单数">
</el-table-column>
<el-table-column
prop="GuestNum"
width="100"
label="可乘人数">
</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="count">
</el-pagination>
</div>
<el-dialog :title="itemdata.ColorName+'车辆'" :visible.sync="changeState" width="1240px">
<div style="display: flex;flex-direction: row;flex-wrap: wrap;">
<img v-for="(x, index) in itemdata.CarPic" :key="index" style="width:200px;height:200px;margin: 10px" :src="x" alt="">
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "directorCarList",
data(){
return{
msg:{
pageIndex:1,
pageSize:20,
Name:'',
CarBrand:0,
CarClass:0,
},
changeState:false,
dateList:[],
CarClassList:[],
CarBrandList:[],
tableData:[],
count:0,
loading:false,
itemdata:{},
EnableMsg:{
Ids:'',
IsEnable:0,
},
}
},
created(){
this.getDateList();
this.getCarClassList()//获取车辆的分类
this.getGuideCarBrandList()//获取车辆品牌
},
methods:{
getDateList(){
this.loading=true;
this.apipost("/api/GuideCar/GetGuideCarPageList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.tableData = res.data.data.pageData;
this.count = res.data.data.count;
}else {
this.Info(res.data.message);
}
})
},
getCarClassList(){
this.apipost("/api/GuideCar/GetCarClassList", {}, res => {
if(res.data.resultCode==1){
this.CarClassList = res.data.data;
}else {
this.Info(res.data.message);
}
})
},
getGuideCarBrandList(){
this.apipost("/api/GuideCar/GetGuideCarBrandList", {}, res => {
if(res.data.resultCode==1){
this.CarBrandList = res.data.data;
}else {
this.Info(res.data.message);
}
})
},
addRecharge(){
this.$router.push('/addCar');
},
showImg(item){//显示图片
this.changeState = true;
this.itemdata = item
this.itemdata.CarPic = JSON.parse(this.itemdata.CarPic)
},
Edit(row){
this.$router.push({
name: 'addCar',
query: {
ID:row.ID,
blank: "y"
}
});
},
delete_b(row){
let that=this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/GuideCar/DelGuideCarSiteInfo",
{Id:row.ID},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getDateList();
} else {
that.Error(res.data.message);
}
},
);
});
},
getList(){
this.msg.pageIndex = 1
this.getDateList()
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getDateList();
},
},
}
</script>
<style >
.directorCarList .el-card__header{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background: #fff;
}
.directorCarList .el-button--small{
padding: 9px 15px;
}
.directorCarList .content .searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
/*margin-left: 10px;*/
}
.directorCarList .content .searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.directorCarList .content .searchInput{
line-height: normal;
display: inline-table;
border-collapse: separate;
border-spacing: 0;
width:250px;
}
.directorCarList .content{
background: #fff;
margin-top:10px;
padding: 15px;
box-sizing: border-box;
}
.directorCarList .el-tag{
margin-right: 5px;
}
.directorCarList .app-image{
background-position: center center;
width: 50px;
height: 50px;
border-radius:0%;
float: left;
margin-right: 8px;
}
</style>
<template>
<div class="directorGuideList">
<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="addRecharge">新增</el-button>
</div>
</div>
<div class="content">
<div style="display: flex;flex-direction: row;align-items: center">
<div class="block" >
<div class="searchInput" style="width:200px">
<el-input style="display:inline-block;width:170px;height:30px"
placeholder="请输入导游名称搜索"
v-model="msg.Name"
size="small"
@clear="getList"
@keyup.enter.native="getList"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<div class="searchInput" style="width:190px">
<el-input style="display:inline-block;width:160px;height:30px"
placeholder="请输入导游编号搜索"
v-model="msg.ID"
size="small"
@clear="getList"
@keyup.enter.native="getList"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<span style="margin-left:15px">状态:</span>
<el-select class="w120" @change="msg.pageIndex=1,getList()" v-model="msg.IsEnable" size="small"
placeholder="请选择">
<el-option v-for="item in IsEnableList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<span style="margin-left: 15px">时间:</span>
<el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange" range-separator="至"
value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
<el-button @click="SetProduct(0)" style="margin-left:10px;" size="mini">启用导游</el-button>
<el-button @click="SetProduct(1)" style="margin-left:10px;" size="mini">冻结导游</el-button>
</div>
</div>
</div>
<div class="content" style="margin-top: 0px">
<div style="display: flex;flex-direction: row;align-items: center">
<div class="block" >
<span style="margin-left: 10px">工作年限范围:</span>
<el-input style="display:inline-block;width:100px;height:30px" placeholder="请输入" v-model="msg.StartWorkYears" size="small" clearable type="number"></el-input>
<span style="margin: 0 10px ;">~</span>
<el-input style="display:inline-block;width:100px;height:30px" placeholder="请输入" v-model="msg.EndWorkYears" size="small" clearable type="number"></el-input>
<el-button type="primary" @click="getList()" size="small" style="margin-left: 5px">确定</el-button>
<span style="margin-left: 20px">评分范围:</span>
<el-input style="display:inline-block;width:100px;height:30px" placeholder="请输入" v-model="msg.StartScore" size="small" clearable type="number"></el-input>
<span style="margin: 0 10px ;">~</span>
<el-input style="display:inline-block;width:100px;height:30px" placeholder="请输入" v-model="msg.EndScore" size="small" clearable type="number"></el-input>
<el-button type="primary" @click="getList()" size="small" style="margin-left: 5px">确定</el-button>
</div>
</div>
</div>
<div style="padding: 20px;background: #fff;">
<el-table
:data="tableData"
header-cell-class-name="headClass"
style="width: 100%"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" style="text-align:center;"></el-table-column>
<el-table-column
prop="ID"
label="编号"
width="100">
</el-table-column>
<el-table-column
prop="Name"
label="导游信息">
<template slot-scope="scope">
<div class="app-image" :style="{backgroundImage:'url(' + scope.row.GuidePhoto + ')',backgroundSize:'cover'}"></div>
<div flex="dir:left cross:center">
{{scope.row.Name}}
</div>
</template>
</el-table-column>
<el-table-column
prop="WorkYears"
label="工作年限"
width="120">
</el-table-column>
<el-table-column
prop="Score"
label="评分"
width="120">
</el-table-column>
<el-table-column
prop="SiteName"
label="站点名称">
</el-table-column>
<el-table-column
prop="OrderNum"
width="100"
label="订单数">
</el-table-column>
<el-table-column
prop="GoodsNum"
width="100"
label="商品数">
</el-table-column>
<el-table-column
prop="CreateDateStr"
width="170"
label="注册时间">
</el-table-column>
<el-table-column
prop="IsEnable"
width="100"
label="状态">
<template slot-scope="scope">
<span v-if="scope.row.IsEnable==0">正常</span>
<span v-if="scope.row.IsEnable==1">冻结</span>
</template>
</el-table-column>
<el-table-column
prop="Telephone"
label="联系电话">
</el-table-column>
<el-table-column
prop="EmergencyPhone"
label="紧急联系电话">
</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="count">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: "directorGuideList",
data(){
return{
msg:{
pageIndex:1,
pageSize:20,
Name:'',
ID:0,
StartWorkYears:'',
EndWorkYears:'',
IsEnable:-1,
StartTime:'',
EndTime:'',
StartScore:'',
EndScore:'',
},
dateList:[],
IsEnableList:[
{id:-1,name:'查看全部'},
{id:0,name:'正常'},
{id:1,name:'冻结'},
],
tableData:[],
count:0,
loading:false,
EnableMsg:{
Ids:'',
IsEnable:0,
},
}
},
created(){
this.getDateList();
},
methods:{
getDateList(){
this.loading=true;
if(this.msg.ID==''){
this.msg.ID=0
}
if (this.dateList && this.dateList.length > 0) {
this.msg.StartTime = this.dateList[0];
this.msg.EndTime = this.dateList[1];
} else {
this.msg.StartTime = '';
this.msg.EndTime = '';
}
if(this.msg.StartWorkYears > this.msg.EndWorkYears){
this.Error('工作年限由低到高')
return false
}
if(this.msg.StartScore > this.msg.EndScore){
this.Error('评分由低到高')
return false
}
this.apipost("/api/GuideCar/GetGuidePageListRepository", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.tableData = res.data.data.pageData;
this.count = res.data.data.count;
}else {
this.Info(res.data.message);
}
})
},
addRecharge(){
this.$router.push('/addGuide');
},
Edit(row){
this.$router.push({
name: 'addGuide',
query: {
ID:row.ID,
blank: "y"
}
});
},
delete_b(row){
let that=this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/GuideCar/DelGuideCarSiteInfo",
{Id:row.ID},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getDateList();
} else {
that.Error(res.data.message);
}
},
);
});
},
enableGuideCar(){
this.apipost("/api/GuideCar/EnableGuideCarGuideInfo", this.EnableMsg, res => {
if(res.data.resultCode==1){
this.Success(res.data.message)
this.getList()
}
})
},
SetProduct(type){
this.EnableMsg.IsEnable = type;
if(this.EnableMsg.Ids.length==0){
this.Info('请选择导游');
return
}
this.EnableMsg.Ids = this.EnableMsg.Ids.join(",");
this.enableGuideCar()
},
handleSelectionChange(val){
var selectRow = JSON.parse(JSON.stringify(val));
let array= [];
selectRow.forEach(x => {
let obj = {}
obj = x.ID;
array.push(obj)
});
this.EnableMsg.Ids = array
},
getList(){
this.msg.pageIndex = 1
this.getDateList()
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getDateList();
},
},
}
</script>
<style >
.directorGuideList .el-card__header{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
background: #fff;
}
.directorGuideList .el-button--small{
padding: 9px 15px;
}
.directorGuideList .content .searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
/*margin-left: 10px;*/
}
.directorGuideList .content .searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.directorGuideList .content .searchInput{
line-height: normal;
display: inline-table;
border-collapse: separate;
border-spacing: 0;
width:250px;
}
.directorGuideList .content{
background: #fff;
margin-top:10px;
padding: 15px;
box-sizing: border-box;
}
.directorGuideList .el-tag{
margin-right: 5px;
}
.directorGuideList .app-image{
background-position: center center;
width: 50px;
height: 50px;
border-radius:0%;
float: left;
margin-right: 8px;
}
</style>
......@@ -175,6 +175,15 @@
<li class="menu_item" :class="{'Fchecked':isChecked=='/guideCarSiteList'}" @click="isChecked='/guideCarSiteList',CommonJump('guideCarSiteList')">
<i class="el-icon-menu"></i><span>站点管理</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/directorGuideList'}" @click="isChecked='/directorGuideList',CommonJump('directorGuideList')">
<i class="el-icon-menu"></i><span>导游管理</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/directorCarList'}" @click="isChecked='/directorCarList',CommonJump('directorCarList')">
<i class="el-icon-menu"></i><span>车辆管理</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/directorCarBrandList'}" @click="isChecked='/directorCarBrandList',CommonJump('directorCarBrandList')">
<i class="el-icon-menu"></i><span>车辆品牌管理</span>
</li>
</ul>
</div>
......
......@@ -34,7 +34,7 @@
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.userPath || addMsg.userPath==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img style="width:80px;height:80px" :src="addMsg.userPath"
<img v-else style="width:80px;height:80px" :src="addMsg.userPath"
alt="">
</div>
</el-form-item>
......@@ -55,7 +55,7 @@
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;">
<img v-if="!addMsg.pjPath || addMsg.pjPath==''"
src="../../assets/img/default.png" style="width:80px;height:80px" alt="">
<img style="width:80px;height:80px" :src="addMsg.pjPath"
<img v-else style="width:80px;height:80px" :src="addMsg.pjPath"
alt="">
</div>
</el-form-item>
......
......@@ -197,6 +197,42 @@ export default new Router({
name: 'addSite',
component: resolve => require(['@/components/director/addSite'], resolve),
},
//司导专区 导游列表
{
path: '/directorGuideList',
name: 'directorGuideList',
component: resolve => require(['@/components/director/directorGuideList'], resolve),
},
//司导专区 导游新增与修改
{
path: '/addGuide',
name: 'addGuide',
component: resolve => require(['@/components/director/addGuide'], resolve),
},
//司导专区 车辆管理
{
path: '/directorCarList',
name: 'directorCarList',
component: resolve => require(['@/components/director/directorCarList'], resolve),
},
//司导专区 车辆编辑
{
path: '/addCar',
name: 'addCar',
component: resolve => require(['@/components/director/addCar'], resolve),
},
//司导专区 车辆品牌
{
path: '/directorCarBrandList',
name: 'directorCarBrandList',
component: resolve => require(['@/components/director/directorCarBrandList'], resolve),
},
//司导专区 品牌修改
{
path: '/addCarBrand',
name: 'addCarBrand',
component: resolve => require(['@/components/director/addCarBrand'], resolve),
},
]
},
......
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