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