Commit b64f4cde authored by zhengke's avatar zhengke

行程保存后 获取行程详情

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