Commit b43fa97b by cen

fix: 报错

1 parent 38f5fa34
No preview for this file type
...@@ -21,7 +21,7 @@ const HOST = { ...@@ -21,7 +21,7 @@ const HOST = {
dj: djDomain, dj: djDomain,
eva: evaluationDomain, eva: evaluationDomain,
merchant: merchantDomain, merchant: merchantDomain,
ip: 'http://192.168.1.169:8292' ip: 'http://192.168.1.221:5003'
} }
uni.$api = api uni.$api = api
// uni.$lock = false // uni.$lock = false
...@@ -33,7 +33,7 @@ uni.$logger = logger ...@@ -33,7 +33,7 @@ uni.$logger = logger
uni.$dbTempRecord = new DBRecord() uni.$dbTempRecord = new DBRecord()
uni.$dbManager = new DBManager() uni.$dbManager = new DBManager()
uni.$track = new Track() uni.$track = new Track()
console.log('init.js', HOST['eva'])
uni.signHttpConfig = { uni.signHttpConfig = {
baseURL: `${HOST['eva']}${pathEnum.evaluation}`, baseURL: `${HOST['eva']}${pathEnum.evaluation}`,
timeout: 300000, timeout: 300000,
...@@ -68,12 +68,6 @@ uni.signHttpConfig = { ...@@ -68,12 +68,6 @@ uni.signHttpConfig = {
}, },
error: (error, config) => { error: (error, config) => {
console.log('error事件触发', error, config) console.log('error事件触发', error, config)
uni.hideLoading()
uni.showToast({
title: error.msg || '请求失败',
icon: 'none'
})
return Promise.reject(error)
}, },
logout: config => { logout: config => {
console.log('logout事件触发', config) console.log('logout事件触发', config)
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<uni-calendar class="calendar" :showMonth="false" @change="calendarChange" /> <uni-calendar class="calendar" :showMonth="false" @change="calendarChange" />
</template> </template>
</GeneralPopup> </GeneralPopup>
<GeneralPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips"> <GeneralPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips" :noTitle="true">
<template #content> <template #content>
<view> <view>
<image class="tipsPopupBg" :src="bg" /> <image class="tipsPopupBg" :src="bg" />
...@@ -99,6 +99,17 @@ ...@@ -99,6 +99,17 @@
</template> </template>
</GeneralPopup> </GeneralPopup>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup> <NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
<GeneralPopup ref="editTipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips" :noTitle="true">
<template #content>
<view>
<image class="tipsPopupBg" :src="bg" />
<view class="title">提示</view>
<view class="tipsConent">
<view>您未对表单内容进行任何修改, 请修改后重新提交。</view>
</view>
</view>
</template>
</GeneralPopup>
</view> </view>
</template> </template>
<script> <script>
...@@ -607,6 +618,16 @@ export default { ...@@ -607,6 +618,16 @@ export default {
} }
} }
}) })
const licensePlateField = that.formFields.find(field => field.key === 'licensePlate')
if (licensePlateField) {
that.$set(licensePlateField, 'disabled', true)
}
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
...@@ -831,6 +852,12 @@ export default { ...@@ -831,6 +852,12 @@ export default {
console.log('用户点击了取消') console.log('用户点击了取消')
}) })
} }
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
} }
...@@ -973,12 +1000,20 @@ export default { ...@@ -973,12 +1000,20 @@ export default {
}) })
.then(res => { .then(res => {
console.log('res:', res) console.log('res:', res)
if (res.data.data.status == 1) { if (res.data.code == 0) {
this.formData.carBaseReqDTO.vin = res.data.data.vin if (res.data.data.status == 1) {
uni.hideLoading() this.formData.carBaseReqDTO.vin = res.data.data.vin
uni.hideLoading()
} else {
uni.showToast({ title: res.data.data.errorMessage, icon: 'none' })
uni.hideLoading()
}
} else { } else {
uni.showToast({ title: res.data.data.errorMessage, icon: 'none' })
uni.hideLoading() uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
...@@ -994,18 +1029,26 @@ export default { ...@@ -994,18 +1029,26 @@ export default {
.then(res => { .then(res => {
console.log('res:', res) console.log('res:', res)
uni.hideLoading() uni.hideLoading()
if (res.data.data.status == 1) { if (res.data.code == 0) {
this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber if (res.data.data.status == 1) {
this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate this.formData.carBaseReqDTO.engineNumber = res.data.data.engineNumber
this.formData.carBaseReqDTO.vin = res.data.data.vin this.formData.carBaseReqDTO.licensePlate = res.data.data.licensePlate
this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate this.formData.carBaseReqDTO.vin = res.data.data.vin
this.formData.carLicenseReqDTO.previousOwnerAddress = res.data.data.previousOwnerAddress this.formData.carBaseReqDTO.registrationDate = res.data.data.registrationDate
this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName this.formData.carLicenseReqDTO.previousOwnerAddress = res.data.data.previousOwnerAddress
this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName this.formData.carLicenseReqDTO.previousOwnerName = res.data.data.previousOwnerName
this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName this.formData.carLicenseReqDTO.carSeriesName = res.data.data.carSeriesName
this.formData.carLicenseReqDTO.carTypeName = res.data.data.carTypeName
} else {
uni.hideLoading()
uni.showToast({ title: res.data.data.errorMessage, icon: 'none' })
}
} else { } else {
uni.hideLoading() uni.hideLoading()
uni.showToast({ title: res.data.data.errorMessage, icon: 'none' }) uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
...@@ -1066,6 +1109,12 @@ export default { ...@@ -1066,6 +1109,12 @@ export default {
delta: 1 delta: 1
}) })
}, 300) }, 300)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
} else if (this.query.type === 'edit') { } else if (this.query.type === 'edit') {
const res = await uni.$api.evaluationApi.evalOrderUpdate(this.formData) const res = await uni.$api.evaluationApi.evalOrderUpdate(this.formData)
...@@ -1081,6 +1130,16 @@ export default { ...@@ -1081,6 +1130,16 @@ export default {
delta: 1 delta: 1
}) })
}, 300) }, 300)
} else {
if (res.data.code == 3004) {
this.$refs.editTipsPopup.open()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
}
} }
} }
}, },
......
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
<!-- 显示已上传的媒体列表 --> <!-- 显示已上传的媒体列表 -->
<view v-for="(media, index) in getMedia(field)" :key="index" class="uploaded-media-container"> <view v-for="(media, index) in getMedia(field)" :key="index" class="uploaded-media-container">
<!-- 图片显示 --> <!-- 图片显示 -->
<image v-if="isImage(media)" :src="media.url || media" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(media, 1)"></image> <image v-if="field.accept == 'image'" :src="media.url || media" mode="aspectFill" class="uploaded-media" @click.stop="previewMedia(media, 1)"></image>
<!-- 视频显示 --> <!-- 视频显示 -->
<view v-else class="video-container" @click.stop="previewMedia(media, 2)"> <view v-else class="video-container" @click.stop="previewMedia(media, 2)">
<!-- <video :src="media.url || media" mode="aspectFill" controls class="uploaded-media"></video> --> <!-- <video :src="media.url || media" mode="aspectFill" controls class="uploaded-media"></video> -->
<image :src="media.url + videoProcess" mode="aspectFill" @click.stop="previewMedia(media, 1)"></image> <image :src="media.url + videoProcess" mode="aspectFill" @click.stop="previewMedia(media, 1)"></image>
<view class="video-play-icon"> <view class="video-play-icon">
<view class="sprites-icon icon-play"></view> <view class="sprites-icon icon-play"></view>
...@@ -235,6 +236,8 @@ export default { ...@@ -235,6 +236,8 @@ export default {
// 获取指定字段的媒体数组 // 获取指定字段的媒体数组
getMedia(field) { getMedia(field) {
console.log('this.mediaData', this.mediaData)
console.log('this.mediaData[field.key]', field)
// 确保返回的是数组 // 确保返回的是数组
return Array.isArray(this.mediaData[field.key]) ? this.mediaData[field.key] : [] return Array.isArray(this.mediaData[field.key]) ? this.mediaData[field.key] : []
}, },
......
...@@ -262,6 +262,12 @@ export default { ...@@ -262,6 +262,12 @@ export default {
}) })
this.pdfUrl = res.fileDownloadUrl this.pdfUrl = res.fileDownloadUrl
console.log('this.pdfUrl', this.pdfUrl) console.log('this.pdfUrl', this.pdfUrl)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}) })
...@@ -313,6 +319,12 @@ export default { ...@@ -313,6 +319,12 @@ export default {
delta: 1 delta: 1
}) })
}, 500) }, 500)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}, },
handleImageUpload(field) { handleImageUpload(field) {
......
...@@ -548,6 +548,12 @@ export default { ...@@ -548,6 +548,12 @@ export default {
console.log('res:', res) console.log('res:', res)
if (res.data.code == 0) { if (res.data.code == 0) {
that.detailsInfo = res.data.data that.detailsInfo = res.data.data
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
...@@ -620,6 +626,12 @@ export default { ...@@ -620,6 +626,12 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `${url}` url: `${url}`
}) })
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
} }
......
...@@ -270,6 +270,11 @@ export default { ...@@ -270,6 +270,11 @@ export default {
// this.dataList = res.records // this.dataList = res.records
this.$refs.paging.complete(res.data.data.records) this.$refs.paging.complete(res.data.data.records)
} else { } else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
this.$refs.paging.complete(false) this.$refs.paging.complete(false)
console.log(err) console.log(err)
} }
...@@ -292,6 +297,12 @@ export default { ...@@ -292,6 +297,12 @@ export default {
}) })
// this.$set(this.typeList, item.count, res[item.keyNum]) // this.$set(this.typeList, item.count, res[item.keyNum])
console.log('this.typeList:', this.typeList) console.log('this.typeList:', this.typeList)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
...@@ -338,6 +349,12 @@ export default { ...@@ -338,6 +349,12 @@ export default {
}) })
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}, },
jumpToDetails(e) { jumpToDetails(e) {
...@@ -402,6 +419,12 @@ export default { ...@@ -402,6 +419,12 @@ export default {
}) })
} }
}) })
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}, },
confirmDelivery(e) { confirmDelivery(e) {
...@@ -446,6 +469,12 @@ export default { ...@@ -446,6 +469,12 @@ export default {
this.$refs.requotePopup.closePopup() this.$refs.requotePopup.closePopup()
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}, },
cancelSign(e) { cancelSign(e) {
...@@ -469,6 +498,12 @@ export default { ...@@ -469,6 +498,12 @@ export default {
}) })
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
.catch(() => { .catch(() => {
...@@ -502,6 +537,12 @@ export default { ...@@ -502,6 +537,12 @@ export default {
console.log('res:', res) console.log('res:', res)
this.currentPage = 1 this.currentPage = 1
this.search() this.search()
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}) })
......
...@@ -870,6 +870,12 @@ export default { ...@@ -870,6 +870,12 @@ export default {
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 500) }, 500)
} else {
uni.hideLoading()
uni.showToast({
title: res.data.msg || '请求失败',
icon: 'none'
})
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!