-
+
@@ -39,6 +39,11 @@
+
+
+
+
+
@@ -148,6 +153,7 @@
alarmType: '',
alarmTypeName: '', // 告警类型
alarmContentName: '', // 报警内容
+ alarmMessage: '', // 告警详情
jobStatusName: '', // 工单处理状态
firstState: '', // 现场情况描述
firstStatePhotos: '', // 现场情况图片
@@ -175,11 +181,16 @@
dialogImageUrl: '', // 图片预览路径
dialogVisible: false, // 图片预览框是否显示
labelPosition: 'right', // labe对齐方式
- mapShow: false // 是否显示地图
+ mapShow: false, // 是否显示地图
+ loading: true
}
},
- mounted() {
- const jobId = this.$route.query.jobId
+ // mounted() {
+ // const jobId = this.$route.params.id
+ // this.getJobInfo(jobId)
+ // },
+ activated() {
+ const jobId = this.$route.params.id
this.getJobInfo(jobId)
},
methods: {
@@ -189,13 +200,18 @@
},
// 获取工单详情
getJobInfo: function(jobId) {
+ this.loading = true
const base_url = process.env.BASE_API + '/static/'
getJobInfo(jobId).then(response => {
+ this.loading = false
if (response.code === 200) {
+ if (response.data.length <= 0) {
+ return
+ }
const job = response.data[0]
this.jobForm = job
// 处理现场图片
- if (job.firstStatePhotos.length > 0) {
+ if (job.firstStatePhotos !== '') {
this.firstImageList = []
const urls = job.firstStatePhotos.split(';')
for (const url of urls) {
@@ -207,7 +223,7 @@
this.firstImageList = []
}
// 处理维护图片
- if (job.handlePhotos.length > 0) {
+ if (job.handlePhotos.length !== '') {
this.handleImageList = []
const urls = job.handlePhotos.split(';')
for (const url of urls) {
@@ -219,14 +235,15 @@
this.handleImageList = []
}
// 处理工单动态
- // 若有getJobTime有值,表示有人接单,状态改为已接单
+ // 若有getJobTime有值,表示有人接单
+ this.activities = []
if (job.getJobTime) {
const activity = {
content: job.getJobPerson + '已接单',
timestamp: job.getJobTime
}
this.activities.push(activity)
- this.activeStep = 1
+ this.activeStep += 1
} else { // 否则添加空的状态
const activity = {
content: '待处理',
@@ -241,9 +258,9 @@
timestamp: job.confirmJobTime
}
this.activities.push(activity)
- this.activeStep = 2
+ this.activeStep += 1
} else if (job.alarmType === '1') { // 若无人确认且为数据异常插入空的待确认
- if (job.jobStatus !== '4') { // 状态不为已取消的话,显示待确认
+ if (job.jobStatus !== '4' && job.jobStatus !== '3') { // 状态不为已取消的话,显示待确认
const activity = {
content: '待确认',
timestamp: ''
@@ -269,14 +286,14 @@
}
this.activities.push(activity1)
this.activities.push(activity2)
- this.activeStep = 3
+ this.activeStep += 1
} else if (job.jobStatus === '4') { // 已取消
const activity1 = {
content: handleJobPerson + '已取消',
timestamp: job.handleJobTime
}
this.activities.push(activity1)
- this.activeStep = 2
+ this.activeStep += 1
}
} else if (this.jobForm.jobStatusName === '完成') {
// 特殊情况处理:已确认之后结束的工单,将完成人和时间用确认人代替