Commit b64f4cde authored by zhengke's avatar zhengke

行程保存后 获取行程详情

parent 96a68288
...@@ -95,12 +95,11 @@ const GetTripConfig = async (ConfigId) =>{ ...@@ -95,12 +95,11 @@ const GetTripConfig = async (ConfigId) =>{
ConfigId: ConfigId ConfigId: ConfigId
} }
let datasRes = await ConfigService.triptemplateGetTripConfig(queryMsg); let datasRes = await ConfigService.triptemplateGetTripConfig(queryMsg);
if (datasRes.data.resultCode == 1) { if (datasRes.data.resultCode == 1 && datasRes.data.data && datasRes.data.data.TempId) {
if(datasRes.data.data&&datasRes.data.data.length>0&&datasRes.data.data[0].TempId){ let dataObj = datasRes.data.data
isModelStore.setIsModel(true) isModelStore.setIsModel(true)
marketStore.setMarket(!market) marketStore.setMarket(!market)
TempIdStore.setTempId(datasRes.data.data[0].TempId) TempIdStore.setTempId(dataObj.TempId)
}
}else{ }else{
return ElMessage({ return ElMessage({
showClose: true, showClose: true,
......
...@@ -134,28 +134,24 @@ queryObj.value = inject(injectKeyDataSource).queryObj ...@@ -134,28 +134,24 @@ queryObj.value = inject(injectKeyDataSource).queryObj
* 行程保存成功获取行程详情 * 行程保存成功获取行程详情
*/ */
const GetTripConfig = async () =>{ const GetTripConfig = async () =>{
console.log('获取行程','----------')
try { try {
let queryMsg = { let queryMsg = {
ConfigId: ConfigId.value ConfigId: ConfigId.value
} }
let datasRes = await ConfigService.triptemplateGetTripConfig(queryMsg); let datasRes = await ConfigService.triptemplateGetTripConfig(queryMsg);
if (datasRes.data.resultCode == 1) { if (datasRes.data.resultCode == 1 && datasRes.data.data && datasRes.data.data.TempId) {
if(datasRes.data.data&&datasRes.data.data.length>0){ let dataObj = datasRes.data.data
let SlidesData = JSON.parse(dataRes.data.data.TempData) let SlidesData = JSON.parse(dataObj.TempData)
let newSlides = [] let newSlides = []
if(typeof SlidesData=='object'&&!SlidesData.length){ SlidesData.forEach((x,i)=>{
let obj = { newSlides.push(x)
...SlidesData if(SlidesData.length-1==i){
}
newSlides.push(obj)
}else if(SlidesData.length>0){
newSlides = SlidesData
}
slidesStore.setSlides(newSlides) slidesStore.setSlides(newSlides)
} }
})
}else{ }else{
return ElMessage({ ElMessage({
showClose: true, showClose: true,
message: datasRes.data.message, message: datasRes.data.message,
type: 'warning', type: 'warning',
......
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