Browse Source

修改日常巡检通过时不能选择相关负责人及照片上传后点击删除,未删除图片的问题

zhanglei
yunuo970428 3 years ago
parent
commit
74bcf3c043
  1. 5
      anrui-scm/anrui-scm-ui/src/api/portal/Upload.js
  2. 16
      anrui-scm/anrui-scm-ui/src/components/uploadFile/FaImages.vue
  3. 2
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/cheliangweihu/richangxunjian/xunjiandan.vue

5
anrui-scm/anrui-scm-ui/src/api/portal/Upload.js

@ -19,8 +19,7 @@ export const uploadFile_yanchejiancha = '/api/scm/file/upload'
export function deleteFilesOss(data) {
return request({
url: '/base/v1/baseVehicleAppendixs/deleteFilesOss', // data,
method: 'post',
data: qs.stringify(data),
// headers: { 'Content-Type': 'multipart/form-data' }
method: 'post',
params: { fullPath: data }
})
}

16
anrui-scm/anrui-scm-ui/src/components/uploadFile/FaImages.vue

@ -13,7 +13,7 @@
</template>
<script>
import { uploadFile } from '@/api/portal/Upload'
import { uploadFile, deleteFilesOss } from '@/api/portal/Upload'
import { getStorage } from '@/utils/auth.js'
export default {
model: {
@ -139,13 +139,17 @@ export default {
},
removeImage(file, ImageFileList) {
this.files.splice(this.files.indexOf(file), 1)
const imgFiles = []
deleteFilesOss(file.url).then((res) => {
if (res.success) {
this.files.splice(this.files.indexOf(file), 1)
const imgFiles = []
this.files.forEach((o) => {
imgFiles.push(o.url)
this.files.forEach((o) => {
imgFiles.push(o.url)
})
this.$emit('fileChange', this.files)
}
})
this.$emit('fileChange', this.files)
},
handlePictureCardPreview(file) {
this.dialogVisible = true

2
anrui-scm/anrui-scm-ui/src/views/kucunguanli/cheliangweihu/richangxunjian/xunjiandan.vue

@ -196,6 +196,8 @@ export default {
if (this.formobj.dutyName !== '') {
this.$message({ showClose: true, type: 'error', message: '因已选择相关责任人,不能点击通过' })
return
} else {
this.formobj.dutySid = ''
}
console.log(this.formobj)
this.$refs['form_obj'].validate((valid) => {

Loading…
Cancel
Save