Commit f488ceb4 authored by 罗超's avatar 罗超

Merge branch 'router' of http://gitlab.oytour.com/viitto/pptist into router

parents 94ac46d5 904a1829
......@@ -167,6 +167,13 @@ class ConfigService{
return Api.Post("hotel_post_GetPicList",params)
}
/**
* 新增国家
*/
static async SetTemplateCountryData(params : any):Promise<HttpResponse>{
return Api.Post("dict_post_Set",params)
}
/**
* 新增颜色
*/
......
......@@ -52,7 +52,9 @@
</el-button>
</p>
<div class="row q-mt-md">
<el-select v-model="queryObj.CountryName" filterable class="m-2" placeholder="请选择国家">
<el-select v-model="queryObj.CountryName" filterable class="m-2" placeholder="请选择国家"
@change="getCountryId">
<el-option label="不限" value=""/>
<el-option
v-for="item in dispositionObj.CountryList"
:key="item.CountryValue"
......@@ -60,10 +62,10 @@
:value="item.CountryValue"
/>
</el-select>
<el-button v-if="!datas.EditAddCountryShow" class="button-new-tag q-ml-md ml-1"
<!-- <el-button v-if="!datas.EditAddCountryShow" class="button-new-tag q-ml-md ml-1"
@click="EditAddDatas(1,0)">
编辑
</el-button>
</el-button> -->
</div>
<div class="EditAddElement" v-if="datas.EditAddCountryShow">
<p class="q-mt-md row flex-between">
......@@ -375,6 +377,7 @@
datas.EditAddType = type
if(!num) {
datas.EditAddCountryShow=!datas.EditAddCountryShow
datas.EditAddShow=false
if(type) datas.addEditCountry = {
CountryId: '',
CountryName: queryObj.value.CountryName,
......@@ -382,6 +385,7 @@
}
else {
datas.EditAddShow=!datas.EditAddShow
datas.EditAddCountryShow=false
if(type) datas.addEditColor = {
ColorId: queryObj.value.ColorId,
ColorValue: queryObj.value.ColorStr,
......@@ -389,6 +393,11 @@
}
}
}
const getCountryId = () => {
let obj = dispositionObj.value.CountryList.filter(x=>{
return x.CountryName==queryObj.value.CountryName
})
}
const CancelEditAdd = (num:Number) =>{
if(!num){
datas.EditAddCountryShow = false
......@@ -408,9 +417,9 @@
const setEditAdd = async (num:Number) => {
if(!num){
await setCountry()
}else{
setColor()
await setColor()
}
}
const setCountry = async () => {
......@@ -424,19 +433,25 @@
}
try {
datas.addEditLoading = true
let dataRes = await ConfigService.SetTemplateConfigData(datas.addEditCountry)
let params = {
ID: 0,
Code: '',
Content: datas.addEditCountry.CountryName,
DictKey: 'Trip_Template_Country'
}
let dataRes = await ConfigService.SetTemplateCountryData(params)
if (dataRes.data.resultCode == 1) {
ElMessage({
showClose: true,
message: '新增颜色成功',
message: '新增国家成功',
type: 'success',
})
GetTemplateConfigDatas()
CancelEditAdd()
CancelEditAdd(0)
}else {
ElMessage({
showClose: true,
message: '新增颜色失败',
message: '新增国家失败',
type: 'warning',
})
}
......@@ -471,7 +486,7 @@
type: 'success',
})
GetTemplateConfigDatas()
CancelEditAdd()
CancelEditAdd(1)
}else {
ElMessage({
showClose: true,
......@@ -649,6 +664,7 @@
let response = await LineService.GetTemplateConfigData()
if (response.data.resultCode == 1) {
dispositionObj.value = response.data.data;
getCountryId()
}
} catch (error) {
}
......
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