-
+
@@ -181,10 +181,15 @@
dialogImageUrl: '', // 图片预览路径
dialogVisible: false, // 图片预览框是否显示
labelPosition: 'right', // labe对齐方式
- mapShow: false // 是否显示地图
+ mapShow: false, // 是否显示地图
+ loading: true
}
},
- mounted() {
+ // mounted() {
+ // const jobId = this.$route.params.id
+ // this.getJobInfo(jobId)
+ // },
+ activated() {
const jobId = this.$route.params.id
this.getJobInfo(jobId)
},
@@ -195,9 +200,10 @@
},
// 获取工单详情
getJobInfo: function(jobId) {
- console.log('getJobInfo')
+ 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
@@ -229,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: '待处理',
@@ -251,7 +258,7 @@
timestamp: job.confirmJobTime
}
this.activities.push(activity)
- this.activeStep = 2
+ this.activeStep += 1
} else if (job.alarmType === '1') { // 若无人确认且为数据异常插入空的待确认
if (job.jobStatus !== '4' && job.jobStatus !== '3') { // 状态不为已取消的话,显示待确认
const activity = {
@@ -279,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 === '完成') {
// 特殊情况处理:已确认之后结束的工单,将完成人和时间用确认人代替