Commit d9f20ed3 authored by 黄奎's avatar 黄奎

线路

parent 72ef2902
<template>
<div v-loading="loading" class="adddzline">
<div class="head-title">
<span @click="CommonJump('dzlineList')" class="blue point">线路管理</span> / 编辑车辆管理
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:70%">
<el-form-item label="出发类型" class="is-required" >
<el-radio v-model="addMsg.StartCityType" :label="1" @change="addMsg.StartCityId=''">城市</el-radio>
<el-radio v-model="addMsg.StartCityType" :label="2" @change="addMsg.StartCityId=''">景点</el-radio>
</el-form-item>
<el-form-item label="出发景点" class="is-required" v-if="addMsg.StartCityType==2">
<el-select filterable class='w200' v-model='addMsg.StartCityId' placeholder="请选择">
<el-option v-for="item in ScenicList" :key="item.Id" :label="item.Name"
:value="item.Id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="出发城市" class="is-required" v-if="addMsg.StartCityType==1">
<div style="display: flex;align-items: center;">
<el-select filterable v-model='goProvinceId' @change="getProvinceList(goProvinceId,2,1)" >
<el-option v-for='item in provinceList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.StartCityId' @change="getProvinceList(addMsg.StartCityId,3,1)" >
<el-option v-for='item in cityList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.startdistrict' @change="$forceUpdate()" >
<el-option v-for='item in district'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="到达类型" class="is-required" >
<el-radio v-model="addMsg.ArriveCityType" :label="1" @change="addMsg.ArriveCityId=''">城市</el-radio>
<el-radio v-model="addMsg.ArriveCityType" :label="2" @change="addMsg.ArriveCityId=''">景点</el-radio>
</el-form-item>
<el-form-item label="到达景点" class="is-required" v-if="addMsg.ArriveCityType==2">
<el-select filterable class='w200' v-model='addMsg.ArriveCityId' placeholder="请选择">
<el-option v-for="item in ScenicList" :key="item.Id" :label="item.Name"
:value="item.Id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="到达城市" class="is-required" v-if="addMsg.ArriveCityType==1">
<div style="display: flex;align-items: center;">
<el-select filterable v-model='daProvinceId' @change="getProvinceList(daProvinceId,2,2)" >
<el-option v-for='item in provinceList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.ArriveCityId' @change="getProvinceList(addMsg.ArriveCityId,3,2)" >
<el-option v-for='item in cityList2'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.arrivedistrict' @change="$forceUpdate()" >
<el-option v-for='item in district2'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="线路状态" class="is-required" prop="ProductState">
<el-radio v-model="addMsg.ProductState" :label="1">上架</el-radio>
<el-radio v-model="addMsg.ProductState" :label="2">下架</el-radio>
</el-form-item>
<el-form-item label="预计价格" prop="Price" class="is-required">
<el-input v-model="addMsg.Price" placeholder="请输入价格" type="number" :min="0" class="w400">
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="站点列表" class="is-required">
<div class="gez_list el-card" v-for="(item,index) in addMsg.SiteList" :key="index">
<div style="width: 60%;">
<el-form label-width="150px" style="width:80%">
<el-form-item label="站点名称" class="is-required">
<el-input v-model="item.Name" placeholder="请输入站点名称" class="w300"></el-input>
</el-form-item>
<el-form-item label="距离上个地点的时间" class="is-required">
<el-input v-model="item.Time" placeholder="请输入时间" class="w300" type="number" :min="0">
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="上车类型" class="is-required">
<div style="display: flex;align-items: center;height:40px">
<el-radio v-model="item.Type" :label="1">上车点</el-radio>
<el-radio v-model="item.Type" :label="2">下车点</el-radio>
</div>
</el-form-item>
<el-form-item label="地点描述" class="is-required">
<el-input type="text" class="w300" v-model="item.SubName" size="small" placeholder="请输入地点描述">
<el-button slot="append" @click="getMapShow(),mapindex = index">地图</el-button>
</el-input>
</el-form-item>
<el-form-item label="经纬度" class="is-required">
<el-input v-model="item.Lonlat" placeholder="请选择经纬度" disabled="" class="w300" ></el-input>
</el-form-item>
</el-form>
</div>
<div style="width: 110px;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>
<el-tooltip class="item" effect="dark" content="上移" placement="top" v-if="index!=0">
<img src="../../../assets/img/setup/del.png" alt="" class="imgstyle" @click="shangyi(index)">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top" v-if="index!=addMsg.SiteList.length-1">
<img src="../../../assets/img/setup/del.png" alt="" class="imgstyle" @click="xiayi(index)">
</el-tooltip>
</div>
</div>
<span style="color: #409EFF;font-size: 14px;cursor: pointer;" @click="addOf">+新增站点</span>
</el-form-item>
<el-form-item label="备注" >
<el-input v-model="addMsg.Description" placeholder="请输入备注" type="textarea" class="w400">
</el-input>
</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="$t('hotel.hotel_mapLocation')" center :visible.sync="isShowMap" width="958px">
<tencentMap @map-submit="mapEvent" ></tencentMap>
</el-dialog>
</div>
</template>
<script>
import tencentMap from "../../commonPage/tencentMap.vue";
export default {
components: {
tencentMap: tencentMap,
},
data() {
return {
mapindex:0,
isShowMap:false,
addMsg: {
ID: 0,
StartCityId:'',
StartCityType:1,
ArriveCityId:'',
ArriveCityType:1,
ProductState:1,
Price:0,
Description:'',
startdistrict:'',
arrivedistrict:'',
SiteList:[
{
Id:0,
Name:'',
Sort:1,
Time:'',
Type:1,
SubName:'',
Lonlat:'',
},{
Id:0,
Name:'',
Sort:1,
Time:'',
Type:1,
SubName:'',
Lonlat:'',
}
]
},
gotpye:[{Id:1,Name:'城市'},{Id:2,Name:'景点'},],
producttpye:[{Id:1,Name:'上架'},{Id:2,Name:'下架'}],
goProvinceId:'',
daProvinceId:'',
provinceList: "",
cityList: "",
cityList2: "",
district: "",
district2: "",
Picindex:0,
rules: {
Name: [{
required: true,
message: '请输入品牌名称',
trigger: 'blur'
}],
StartCityType: [{
required: true,
message: '请选择出发类型',
trigger: 'blur'
}],
ArriveCityType: [{
required: true,
message: '请输入到达类型',
trigger: 'blur'
}],
ProductState: [{
required: true,
message: '请输入线路状态',
trigger: 'blur'
}],
Price: [{
required: true,
message: '请输入价格',
trigger: 'blur'
}],
},
loading: false,
changeState:false,
imgType:0,
ScenicList:[],
};
},
created() {
if(this.$route.query.ID){
this.getData(this.$route.query.ID)
}
},
methods: {
//得到地图信息
mapEvent(e) {
this.addMsg.SiteList[this.mapindex].Lonlat = e.long+','+ e.lat
this.addMsg.SiteList[this.mapindex].SubName = e.address
this.isShowMap = false;
},
getMapShow() {
this.isShowMap = true;
},
addOf(){
let obj = {
Id:0,
Name:'',
Sort:1,
Time:'',
Type:1,
SubName:'',
Lonlat:'',
}
this.addMsg.SiteList.push(obj)
},
delete_b(index){
if( this.addMsg.SiteList.length>2){
this.addMsg.SiteList.splice(index,1)
}else{
this.Error('站点列表只是有2条')
}
},
swapItems(arr, index1, index2){
 arr[index1] = arr.splice(index2,1,arr[index1])[0]
   return arr
},
shangyi(index){//上移
if (this.addMsg.SiteList.length > 1 && index !== 0) {
this.addMsg.SiteList = this.swapItems(this.addMsg.SiteList, index, index - 1)
  }
},
xiayi(index){//下移
this.addMsg.SiteList = this.swapItems(this.addMsg.SiteList, index, index + 1)
  
},
getProvinceList(ID,type,type_t=0) {
//根据省份获取城市
let msg = { Id: ID };
if (type == 1) {
this.goProvinceId = '';
this.daProvinceId = '';
} else if (type == 2) {
if(type_t==1){
this.addMsg.StartCityId = '';
this.addMsg.startdistrict = '';
}else if(type_t==2){
this.addMsg.ArriveCityId = '';
this.addMsg.arrivedistrict = '';
}
} else if (type == 3) {
if(type_t==1){
this.addMsg.startdistrict = '';
}else if(type_t==2){
this.addMsg.arrivedistrict = '';
}
}
this.apipost(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
if(type_t==1){
this.cityList = res.data.data;
}else if(type_t==2){
this.cityList2 = res.data.data;
}
} else if (type == 3) {
if(type_t==1){
this.district = res.data.data;
}else if(type_t==2){
this.district2 = res.data.data;
}
}
},
err => {}
);
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let addMsg = JSON.parse(JSON.stringify(this.addMsg))
if(addMsg.StartCityType==1 && addMsg.startdistrict!=''){
addMsg.StartCityId = addMsg.startdistrict
}
if(addMsg.ArriveCityType==1 && addMsg.arrivedistrict!=''){
addMsg.ArriveCityId = addMsg.arrivedistrict
}
if(addMsg.StartCityId==''){
this.Error('请选择出发城市')
return false
}
if(addMsg.ArriveCityId==''){
this.Error('请选择到达城市')
return false
}
if(addMsg.SiteList.length<2){
this.Error('站点列表不能小于2条')
return false
}
let show = false
addMsg.SiteList.map((x,i)=>{
x.Sort=i+1;
if(x.Name==''){
this.Error('请填写站点名称')
show = true
return false
}
if(x.Time==''){
this.Error('请填写距离上个地点的时间')
show = true
return false
}
if(x.SubName==''){
this.Error('请填写地点描述')
show = true
return false
}
if(x.Lonlat==''){
this.Error('请选择经纬度')
show = true
return false
}
})
if(show == true){
return false
}
addMsg.SiteList[0].Time='0';
if(addMsg.SiteList[addMsg.SiteList.length-1].Type==1){
this.Error('排序有问题,最后一个为下车点')
show = true
return false
}
this.apipost('car_post_SetLineProductInfo', addMsg, res => {
if(res.data.resultCode == 1) {
this.CommonJump('dzlineList');
this.Success(res.data.message);
}
}, err => {})
} else {
return false;
}
});
},
getData(ID) {
this.loading = true;
this.apipost('car_get_GetLineProductInfo', {ProductId:ID}, res => {
if(res.data.resultCode == 1) {
this.loading = false;
this.addMsg = res.data.data;
this.addMsg.SiteList.forEach(x=>{
x.Time = x.Time.toString()
})
if(this.addMsg.StartCityType==1){
this.goProvinceId = this.addMsg.SProvinceId;
this.getProvinceList(this.goProvinceId,2,1)
this.addMsg.StartCityId = this.addMsg.SCityId
this.getProvinceList(this.addMsg.SCityId,3,1)
this.addMsg.startdistrict = this.addMsg.SDistrictId
}
if(this.addMsg.ArriveCityType==1){
this.daProvinceId = this.addMsg.EProvinceId;
this.getProvinceList(this.goProvinceId,2,2)
this.addMsg.ArriveCityId = this.addMsg.ECityId
this.getProvinceList(this.addMsg.ECityId,3,2)
this.addMsg.arrivedistrict = this.addMsg.EDistrictId
}
}
}, err => {})
},
GetScenicList(Name){
this.apipost('car_get_GetScenicList', {Name:Name}, res => {
if(res.data.resultCode == 1) {
this.ScenicList = res.data.data;
}
}, err => {})
}
},
mounted() {
this.getProvinceList(2,1);
this.GetScenicList('')
}
};
</script>
<style>
@import '../Lxy/css/index.css';
.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;
}
.adddzline .blue {
color: #409EFF;
}
.adddzline .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.adddzline .gez_list{
/*width: 650px;*/
margin-bottom: 12px;
padding: 20px;
border: 1px solid #EBEEF5;
background-color: #FFF;
color: #303133;
}
.adddzline .quyu{
background-color: #f4f4f5;
color: #909399;
padding: 10px;
line-height: 30px;
height: 30px;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
margin: 5px;
}
.adddzline .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;
}
.adddzline .imgstyle{
width: 32px;
height: 32px;
margin: 0 5px;
}
</style>
<template>
<div class="flexOne">
<div class="flexOne dzlineList">
<div class="query-box">
<ul>
<li><span><em>车辆类型</em><el-select filterable v-model='msg.CarType' >
<el-option :label="$t('pub.unlimitedSel')" value='0'></el-option>
<el-option v-for='item in companyList'
<li style="display: block;width: 100%">
<span><em>出发类型</em>
<el-select filterable v-model='msg.StartCityType' >
<el-option v-for='item in gotpye'
:label='item.Name'
:value='item.Id'
:key='item.Id'>
</el-option>
</el-select>
</span></li>
<li><span><em>车辆名称</em><el-input v-model='msg.CarName' class="permiss-input"></el-input></span></li>
<li><span><em>车辆品牌</em><el-input v-model='msg.BrandName' class="permiss-input"></el-input></span></li>
</el-select>
</span>
<span v-if="msg.StartCityType==2"><em>出发景点</em>
<el-select filterable v-model='msg.StartCityId' @change="chufa()" >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in ScenicList'
:label='item.Name'
:value='item.Id'
:key='item.Id'>
</el-option>
</el-select>
</span>
<span v-if="msg.StartCityType==1"><em>出发城市</em>
<el-select filterable v-model='goProvinceId' @change="getProvinceList(goProvinceId,2,1)" >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in provinceList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='msg.StartCityId' @change="getProvinceList(msg.StartCityId,3,1)" >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in cityList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='msg.startdistrict' >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in district'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</span>
</li>
<li style="display: block;width: 100%">
<span><em>到达类型</em>
<el-select filterable v-model='msg.ArriveCityType' @change="daoda()" >
<el-option v-for='item in gotpye'
:label='item.Name'
:value='item.Id'
:key='item.Id'>
</el-option>
</el-select>
</span>
<span v-if="msg.ArriveCityType==2"><em>到达景点</em>
<el-select filterable v-model='msg.ArriveCityId' >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in ScenicList'
:label='item.Name'
:value='item.Id'
:key='item.Id'>
</el-option>
</el-select>
</span>
<span v-if="msg.ArriveCityType==1"><em>到达城市</em>
<el-select filterable v-model='daProvinceId' @change="getProvinceList(daProvinceId,2,2)" >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in provinceList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='msg.ArriveCityId' @change="getProvinceList(msg.ArriveCityId,3,2)" >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in cityList2'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='msg.arrivedistrict' >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in district2'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</span>
</li>
<li style="display: block;width: 100%">
<span><em>线路状态</em>
<el-select filterable v-model='msg.ProductState' >
<el-option label="不限" value='0'></el-option>
<el-option v-for='item in producttpye'
:label='item.Name'
:value='item.Id'
:key='item.Id'>
</el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()" />
<input type="button" class="normalBtn" value="新增" @click="CommonJump('dzaddcar')" />
<input type="button" class="normalBtn" value="新增" @click="CommonJump('adddzline')" />
</li>
</ul>
</div>
<el-table :data="dataList" stripe style="width: 100%" max-height="700" v-loading='loading'>
<el-table :data="dataList" stripe style="width: 100%" max-height="700" v-loading='loading' ref="table">
<el-table-column fixed prop="Id" label="Id" width="80"> </el-table-column>
<el-table-column prop="CarName" label="名称">
<template slot-scope="scope">
<el-table-column fixed prop="StartCityName" label="出/到城市" >
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<div class="app-image" :style="{backgroundImage:'url(' + scope.row.CarLogo + ')',backgroundSize:'cover'}"></div>
<div flex="dir:left cross:center">
{{scope.row.CarName}}
</div>
{{scope.row.StartCityName}} - {{scope.row.ArriveCityName}}
</div>
</template>
</el-table-column>
<el-table-column prop="CarTypeName" label="类型"> </el-table-column>
<el-table-column prop="CarModel" label="型号"> </el-table-column>
<el-table-column prop="CarColor" label="颜色"> </el-table-column>
<el-table-column prop="BrandName" label="品牌"> </el-table-column>
<el-table-column prop="CarNo" label="车牌号"> </el-table-column>
<el-table-column prop="GuestNum" label="荷载人数"> </el-table-column>
<el-table-column prop="ImageList" label="图片列表">
<template slot-scope="scope">
</el-table-column>
<el-table-column fixed prop="Price" label="预计价格" width="120"> </el-table-column>
<el-table-column fixed prop="SiteList" label="站点列表" >
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<div class="app-image" :style="{backgroundImage:'url(' + scope.row.ImageList[0] + ')',backgroundSize:'cover'}"></div>
<div v-if='scope.row.ImageList.length>2' @click='lookgd(scope.row)' style="cursor:pointer;color:#409EFF">查看更多</div>
</div>
</template>
</el-table-column>
<el-table-column prop="UpdateByName" label="创建人">
<template slot-scope="scope">
<div flex="dir:left cross:center">
{{scope.row.UpdateByName}}
<div v-show="scope.row.show==false">
<div class="line-h">
<div class="line-h-l">{{scope.row.SiteList[0].Type==1?'上':'下'}}</div>
<div>{{scope.row.SiteList[0].Time}}</div>
<div style="margin-left:10px">{{scope.row.SiteList[0].Name}} </div>
</div>
<div v-if="scope.row.SiteList.length>2" style="cursor:pointer;color:#409EFF" @click="getlistshow(scope.$index)">····展开</div>
<div class="line-h">
<div class="line-h-l">{{scope.row.SiteList[scope.row.SiteList.length-1].Type==1?'上':'下'}}</div>
<div>{{scope.row.SiteList[scope.row.SiteList.length-1].Time}}</div>
<div style="margin-left:10px">{{scope.row.SiteList[scope.row.SiteList.length-1].Name}} </div>
</div>
</div>
<div v-show="scope.row.show==true">
<div class="line-h" v-for="(activity, index) in scope.row.SiteList" :key="index">
<div class="line-h-l">{{activity.Type==1?'上':'下'}}</div>
<div>{{activity.Time}}</div>
<div style="margin-left:10px">{{activity.Name}} </div>
</div>
<span v-if="scope.row.show==true" style="cursor:pointer;color:#409EFF" @click="getlistshow(scope.$index)">收起</span>
</div>
</div>
<div flex="dir:left cross:center">
{{scope.row.UpdateDate}}
</template>
</el-table-column>
<el-table-column fixed prop="ProductState" label="状态" width="80">
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<el-switch
v-model="scope.row.ProductState"
:active-value="1"
:inactive-value="2"
@change="Editstate(scope.row)"
>
</el-switch>
</div>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column fixed prop="Description" label="备注" > </el-table-column>
<el-table-column fixed="right" label="操作" width="120" >
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top" >
......@@ -73,11 +193,7 @@
</el-table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total>
</el-pagination>
<el-dialog title="图片列表" :visible.sync="changeState" width="1240px">
<div style="display: flex;flex-direction: row;flex-wrap: wrap;">
<img v-for="(x, index) in CarPic" :key="index" style="width:200px;height:200px;margin: 10px" :src="x" alt="">
</div>
</el-dialog>
</div>
</template>
......@@ -91,48 +207,131 @@
total: 0,
pageSize: '',
currentPage: 1,
changeState:false,
goProvinceId:'0',
daProvinceId:'0',
ScenicList:[],
//请求数据
msg: {
pageIndex: 1,
pageSize: 15,
CarType: '0',
CarName: '',
BrandName: '',
Id: 0,
StartCityId:'0',
StartCityType:1,
ArriveCityId:'0',
ArriveCityType:1,
ProductState:'0',
startdistrict:'0',
arrivedistrict:'0',
},
gotpye:[{Id:1,Name:'城市'},{Id:2,Name:'景点'},],
producttpye:[{Id:1,Name:'上架'},{Id:2,Name:'下架'}],
//返回数据
dataList: [],
companyList: [],
CarPic:[]
provinceList: "",
cityList: "",
cityList2: "",
district: "",
district2: "",
}
},
methods: {
getCompany() {
this.apipost('car_get_GetCarCustomTypeEnumList', {}, res => {
if(res.data.resultCode == 1) {
this.companyList = res.data.data;
Editstate(row){
let that = this
that.apipost('car_post_SetLineProductState', {ProductId:row.Id,Type:row.ProductState}, res => {
if(res.data.resultCode == 1) {
that.$message.success(res.data.message)
that.getList()
} else {
that.$message.error(res.data.message)
}
}, err => {})
},
getProvinceList(ID,type,type_t=0) {
//根据省份获取城市
let msg = { Id: ID };
if (type == 1) {
this.goProvinceId = '0';
this.daProvinceId = '0';
} else if (type == 2) {
if(type_t==1){
this.msg.StartCityId = '0';
}else if(type_t==2){
this.msg.ArriveCityId = '0';
}
}, err => {})
} else if (type == 3) {
if(type_t==1){
this.msg.startdistrict = '0';
}else if(type_t==2){
this.msg.arrivedistrict = '0';
}
}
this.apipost(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
if(type_t==1){
this.cityList = res.data.data;
}else if(type_t==2){
this.cityList2 = res.data.data;
}
} else if (type == 3) {
if(type_t==1){
this.district = res.data.data;
}else if(type_t==2){
this.district2 = res.data.data;
}
}
},
err => {}
);
},
chufa(){
this.msg.StartCityId='0';
this.msg.startdistrict='0';
},
daoda(){
this.msg.ArriveCityId='0';
this.msg.arrivedistrict='0';
},
getlistshow(index){
this.dataList[index].show = !this.dataList[index].show;
this.$set(this.dataList,index,this.dataList[index])
this.$forceUpdate();
},
lookgd(row){
this.changeState = true;
this.CarPic = row.ImageList
},
getList() {
this.loading=true
this.apipost('car_get_GetCarInfoPageList', this.msg, res => {
let msg = JSON.parse(JSON.stringify(this.msg))
if(msg.startdistrict!=0){
msg.StartCityId = msg.startdistrict
}
if(msg.arrivedistrict!=0){
msg.ArriveCityId = msg.arrivedistrict
}
delete msg.startdistrict
delete msg.arrivedistrict
this.apipost('car_get_GetLineProductPageList', msg, res => {
if(res.data.resultCode == 1) {
this.loading=false
this.$nextTick(() => {
this.dataList = res.data.data.pageData;
});
// this.$nextTick(() => {
this.dataList = res.data.data.pageData;
this.dataList.forEach(x=>{
x.show=false
})
// });
this.total = res.data.data.count;
}
......@@ -148,14 +347,14 @@
},
Edit(row){
console.log(row)
this.$router.push("/dzaddcar?obj="+encodeURIComponent(JSON.stringify(row)))
this.$router.push("/adddzline?ID="+row.Id)
},
delete_b(row){
let that=this;
that.Confirm("是否删除", function () {
that.apipost('car_post_DelCarInfo', {CarId:row.Id}, res => {
that.apipost('car_post_SetLineProductState', {ProductId:row.Id,Type:3}, res => {
if(res.data.resultCode == 1) {
that.$message.success(res.data.message)
that.getList()
......@@ -165,11 +364,21 @@
}, err => {})
});
},
GetScenicList(Name){
this.apipost('car_get_GetScenicList', {Name:Name}, res => {
if(res.data.resultCode == 1) {
this.ScenicList = res.data.data;
}
}, err => {})
}
},
mounted() {
this.getProvinceList(2,1)//只查中国的
this.getList()
this.getCompany()
this.GetScenicList('')//获取景点下啦
}
}
</script>
......@@ -190,5 +399,23 @@
border-radius:0%;
float: left;
margin-right: 8px;
}
.dzlineList .line-h{
display: flex;
align-items: center;
margin: 6px 0;
}
.line-h .line-h-l{
width: 25px;
height: 25px;
border-radius: 50%;
color: #FFF;
display: flex;
align-items: center;
justify-content: center;
background: #F56C6C;
margin-right: 15px;
}
</style>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()" />
<input type="button" @click="outerVisible = true,dialogTitle='新增景点'" class="normalBtn" :value="$t('pub.addBtn')" />
<input type="button" @click="addjd(),dialogTitle='新增景点'" class="normalBtn" :value="$t('pub.addBtn')" />
</li>
</ul>
</div>
......@@ -58,6 +58,10 @@
<el-form-item label="景点名称" prop="Name">
<el-input class='w600' type="text" v-model="addMsg.Name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="景点拼音">
<el-input class='w600' type="text" v-model="addMsg.PinYin" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="景点地址">
<el-select v-model="addMsg.ProvinceId" class="w150" filterable @change="getProvinceList(addMsg.ProvinceId,2)" :placeholder="$t('hotel.hotel_province')">
......@@ -122,7 +126,8 @@
Name:'',
DistrictId:'',
CityId:'',
ProvinceId:''
ProvinceId:'',
PinYin:'',
},
rules:{
......@@ -155,6 +160,17 @@
this.getProvinceList(2,1)
},
methods: {
addjd(){
this.outerVisible=true;
this.addMsg={
Id:'-1',
Name:'',
DistrictId:'',
CityId:'',
ProvinceId:'',
PinYin:'',
}
},
getProvinceList(ID,type) {
//根据省份获取城市
let msg = { Id: ID };
......@@ -200,13 +216,17 @@
}, err => {})
},
Edit(row){
this.outerVisible=true;
this.dialogTitle='修改景点'
this.addMsg.Name = row.Name;
this.addMsg.Id = row.Id;
this.addMsg.ProvinceId = row.ProvinceId;
this.getProvinceList(this.addMsg.ProvinceId,2)
this.addMsg.CityId = row.CityId;
this.getProvinceList(this.addMsg.CityId,3)
this.addMsg.DistrictId = row.DistrictId;
this.outerVisible=true;
},
addNotice(_status){
......
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