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 label="添加图片" v-loading="loading" prop="images" label-width="100px">
<el-upload
ref="upload"
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
@ -271,9 +272,24 @@ export default {
handleAvatarSuccess (res, file) {
this.loading = 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.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 () {
this.loading = 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-upload
class="upload-demo"
ref="upload"
:disabled="isAble"
:action="uploadFileUrl"
:before-remove="beforeFileRemove"
@ -97,7 +98,8 @@ export default {
dialogVisible: false,
isAutoRemoveFile: true,
fileloading: false,
pageloading: true
pageloading: true,
isGoToInfo: '0' // 01
}
},
computed: {
@ -134,6 +136,7 @@ export default {
}
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
}
},
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) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
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 })
@ -231,7 +245,7 @@ export default {
//
backToUserRelationList () {
this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} 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-upload
class="upload-demo"
ref="upload"
:disabled="isAble"
:action="uploadFileUrl"
:before-remove="beforeFileRemove"
@ -111,7 +112,8 @@ export default {
isAutoRemoveFile: true,
fileloading: false,
pageloading: true,
options: []
options: [],
isGoToInfo: '0' // 01
}
},
computed: {
@ -152,6 +154,7 @@ export default {
}
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
}
},
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) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
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 })
@ -262,7 +276,7 @@ export default {
//
backToUserRelationList () {
this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} 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-upload
class="upload-demo"
ref="upload"
:disabled="isAble"
:action="uploadFileUrl"
:before-remove="beforeFileRemove"
@ -108,7 +109,8 @@ export default {
dialogVisible: false,
isAutoRemoveFile: true,
fileloading: false,
pageloading: true
pageloading: true,
isGoToInfo: '0' // 01
}
},
computed: {
@ -155,6 +157,7 @@ export default {
}
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
this.isGoToInfo = '1'
}
},
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) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
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 })
@ -252,7 +266,7 @@ export default {
//
backToUserRelationList () {
this.$emit('refreshDataList')
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
if (this.isGoToInfo === '1') {
this.$parent.selectComponent = 'Monthrecordinfo'
this.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} else {

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

@ -54,7 +54,8 @@ export default {
isAble: false,
pageDisabled: false,
pageloading: true,
options: []
options: [],
isAdd: '0' // 01
}
},
computed: {
@ -71,6 +72,7 @@ export default {
},
components: {},
mounted () {
this.isAdd = this.$route.query.isAdd
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) {
this.dataForm.infoId = this.$route.query.infoId
}
@ -144,7 +146,7 @@ export default {
//
backToUserRelationList () {
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.$router.push({ path: '/workRecord-Monthrecordinforoute' })
} 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-upload
class="upload-demo"
ref="upload"
:action="uploadFileUrl"
:before-remove="beforeFileRemove"
:file-list="dataForm.files"
@ -216,6 +217,11 @@ export default {
handleAvatarSuccess (res, file) {
this.loading = 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.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) {
this.fileloading = false
this.isAble = false
if (res === null || res.data === null || res.data.imgUrl === null) {
this.$message.error('文件上传失败!')
this.handleErrorRemove(file)
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 })

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

@ -53,6 +53,7 @@
</el-form-item>
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="90px">
<el-upload
ref="upload"
class="upload-demo"
:action="uploadFileUrl"
:before-remove="beforeFileRemove"
@ -198,6 +199,11 @@ export default {
handleAvatarSuccess (res, file) {
this.loading = 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.hideUpload = this.dataForm.images.length >= 9
},
@ -207,6 +213,16 @@ export default {
this.isAble = false
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) {
for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i]

Loading…
Cancel
Save