Browse Source

路由跳转BUG

master
wanggongfeng 6 years ago
parent
commit
1a9de8b1e8
  1. 16
      src/views/modules/workRecord/dailyrecordinfoDetail.vue
  2. 18
      src/views/modules/workRecord/monthexcellentcaseDetail.vue
  3. 18
      src/views/modules/workRecord/monthexcellentgridDetail.vue
  4. 18
      src/views/modules/workRecord/monthexcellentpersonDetail.vue
  5. 6
      src/views/modules/workRecord/monthgridsortDetail.vue
  6. 17
      src/views/modules/workRecord/monthrecordinfoDetail.vue
  7. 16
      src/views/modules/workRecord/weekrecordinfoDetail.vue

16
src/views/modules/workRecord/dailyrecordinfoDetail.vue

@ -60,6 +60,7 @@
</el-form-item> </el-form-item>
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="100px"> <el-form-item label="添加图片" v-loading="loading" prop="images" label-width="100px">
<el-upload <el-upload
ref="upload"
:action="uploadUrl" :action="uploadUrl"
:class="{hide:hideUpload}" :class="{hide:hideUpload}"
list-type="picture-card" list-type="picture-card"
@ -271,9 +272,24 @@ export default {
handleAvatarSuccess (res, file) { handleAvatarSuccess (res, file) {
this.loading = false this.loading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false
}
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1 }) this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1 })
this.hideUpload = this.dataForm.images.length >= 9 this.hideUpload = this.dataForm.images.length >= 9
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handelError () { handelError () {
this.loading = false this.loading = false
this.isAble = false this.isAble = false

18
src/views/modules/workRecord/monthexcellentcaseDetail.vue

@ -35,6 +35,7 @@
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px"> <el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload"
:disabled="isAble" :disabled="isAble"
:action="uploadFileUrl" :action="uploadFileUrl"
:before-remove="beforeFileRemove" :before-remove="beforeFileRemove"
@ -97,7 +98,8 @@ export default {
dialogVisible: false, dialogVisible: false,
isAutoRemoveFile: true, isAutoRemoveFile: true,
fileloading: false, fileloading: false,
pageloading: true pageloading: true,
isGoToInfo: '0' // 01
} }
}, },
computed: { computed: {
@ -134,6 +136,7 @@ export default {
} }
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
} }
}, },
methods: { methods: {
@ -219,11 +222,22 @@ export default {
} }
} }
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handleAvatarFileSuccess (res, file) { handleAvatarFileSuccess (res, file) {
this.fileloading = false this.fileloading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!') this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false return false
} }
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 2, fileName: res.data.fileName, name: res.data.fileName }) this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 2, fileName: res.data.fileName, name: res.data.fileName })
@ -231,7 +245,7 @@ export default {
// //
backToUserRelationList () { backToUserRelationList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo' this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' }) this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else { } else {

18
src/views/modules/workRecord/monthexcellentgridDetail.vue

@ -47,6 +47,7 @@
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px"> <el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload"
:disabled="isAble" :disabled="isAble"
:action="uploadFileUrl" :action="uploadFileUrl"
:before-remove="beforeFileRemove" :before-remove="beforeFileRemove"
@ -111,7 +112,8 @@ export default {
isAutoRemoveFile: true, isAutoRemoveFile: true,
fileloading: false, fileloading: false,
pageloading: true, pageloading: true,
options: [] options: [],
isGoToInfo: '0' // 01
} }
}, },
computed: { computed: {
@ -152,6 +154,7 @@ export default {
} }
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
} }
}, },
methods: { methods: {
@ -250,11 +253,22 @@ export default {
} }
} }
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handleAvatarFileSuccess (res, file) { handleAvatarFileSuccess (res, file) {
this.fileloading = false this.fileloading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!') this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false return false
} }
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 4, fileName: res.data.fileName, name: res.data.fileName }) this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 4, fileName: res.data.fileName, name: res.data.fileName })
@ -262,7 +276,7 @@ export default {
// //
backToUserRelationList () { backToUserRelationList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo' this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' }) this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else { } else {

18
src/views/modules/workRecord/monthexcellentpersonDetail.vue

@ -47,6 +47,7 @@
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px"> <el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload"
:disabled="isAble" :disabled="isAble"
:action="uploadFileUrl" :action="uploadFileUrl"
:before-remove="beforeFileRemove" :before-remove="beforeFileRemove"
@ -108,7 +109,8 @@ export default {
dialogVisible: false, dialogVisible: false,
isAutoRemoveFile: true, isAutoRemoveFile: true,
fileloading: false, fileloading: false,
pageloading: true pageloading: true,
isGoToInfo: '0' // 01
} }
}, },
computed: { computed: {
@ -155,6 +157,7 @@ export default {
} }
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
} }
}, },
methods: { methods: {
@ -240,11 +243,22 @@ export default {
} }
} }
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handleAvatarFileSuccess (res, file) { handleAvatarFileSuccess (res, file) {
this.fileloading = false this.fileloading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!') this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false return false
} }
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 3, fileName: res.data.fileName, name: res.data.fileName }) this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 3, fileName: res.data.fileName, name: res.data.fileName })
@ -252,7 +266,7 @@ export default {
// //
backToUserRelationList () { backToUserRelationList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo' this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' }) this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else { } else {

6
src/views/modules/workRecord/monthgridsortDetail.vue

@ -54,7 +54,8 @@ export default {
isAble: false, isAble: false,
pageDisabled: false, pageDisabled: false,
pageloading: true, pageloading: true,
options: [] options: [],
isAdd: '0' // 01
} }
}, },
computed: { computed: {
@ -71,6 +72,7 @@ export default {
}, },
components: {}, components: {},
mounted () { mounted () {
this.isAdd = this.$route.query.isAdd
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId this.dataForm.infoId = this.$route.query.infoId
} }
@ -144,7 +146,7 @@ export default {
// //
backToUserRelationList () { backToUserRelationList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
if (this.$route.query.isAdd === '1' || this.$route.query.isAdd === '2') { if (this.isAdd === '1' || this.isAdd === '2') {
this.$parent.selectComponent = 'Monthrecordinfo' this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' }) this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else { } else {

17
src/views/modules/workRecord/monthrecordinfoDetail.vue

@ -44,6 +44,7 @@
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px"> <el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload"
:action="uploadFileUrl" :action="uploadFileUrl"
:before-remove="beforeFileRemove" :before-remove="beforeFileRemove"
:file-list="dataForm.files" :file-list="dataForm.files"
@ -216,6 +217,11 @@ export default {
handleAvatarSuccess (res, file) { handleAvatarSuccess (res, file) {
this.loading = false this.loading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false
}
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, recordType: 1, fileName: res.data.fileName }) this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, recordType: 1, fileName: res.data.fileName })
this.hideUpload = this.dataForm.images.length >= 9 this.hideUpload = this.dataForm.images.length >= 9
}, },
@ -268,11 +274,22 @@ export default {
} }
} }
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handleAvatarFileSuccess (res, file) { handleAvatarFileSuccess (res, file) {
this.fileloading = false this.fileloading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) { if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!') this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false return false
} }
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 1, fileName: res.data.fileName, name: res.data.fileName }) this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 1, fileName: res.data.fileName, name: res.data.fileName })

16
src/views/modules/workRecord/weekrecordinfoDetail.vue

@ -53,6 +53,7 @@
</el-form-item> </el-form-item>
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px"> <el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px">
<el-upload <el-upload
ref="upload"
class="upload-demo" class="upload-demo"
:action="uploadFileUrl" :action="uploadFileUrl"
:before-remove="beforeFileRemove" :before-remove="beforeFileRemove"
@ -198,6 +199,11 @@ export default {
handleAvatarSuccess (res, file) { handleAvatarSuccess (res, file) {
this.loading = false this.loading = false
this.isAble = false this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
return false
}
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName }) this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName })
this.hideUpload = this.dataForm.images.length >= 9 this.hideUpload = this.dataForm.images.length >= 9
}, },
@ -207,6 +213,16 @@ export default {
this.isAble = false this.isAble = false
this.$message.error('上传文件失败!') this.$message.error('上传文件失败!')
}, },
handleErrorRemove (file) {
//
let fileList = this.$refs.upload.uploadFiles
for (var i = 0; i < fileList.length; i++) {
let item = fileList[i]
if (item.url === file.url) {
fileList.splice(i, 1)
}
}
},
handleRemove (file, fileList) { handleRemove (file, fileList) {
for (var i = 0; i < this.dataForm.images.length; i++) { for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i] let item = this.dataForm.images[i]

Loading…
Cancel
Save