diff --git a/src/views/transit/exception-disposal.vue b/src/views/transit/exception-disposal.vue index 483ce97..82f4c19 100644 --- a/src/views/transit/exception-disposal.vue +++ b/src/views/transit/exception-disposal.vue @@ -283,68 +283,103 @@ - 异常信息 - - - - {{ field.label }} - - - {{ detail[field.prop] }} - - {{ detail[field.prop] || '-' }} - - - - + + + + + {{ field.label }} + + + {{ detail[field.prop] }} + + {{ detail[field.prop] || '-' }} + + + + + - 现场照片 - - - - - - - - + + - - + + + - 历史跟进 - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + {{ file.name || '附件' + (index + 1) }} + + + - + + + + @@ -417,12 +452,9 @@ export default { page: { current: 1, size: 10, total: 0 }, dialog: { visible: false, mode: 'follow', loading: false, submitting: false }, detail: {}, - followForm: { followContent: '' }, + followForm: { followContent: '', attachments: [] }, followRules: { - followContent: [ - { required: true, message: '请输入跟进说明', trigger: 'blur' }, - { max: 500, message: '跟进说明不能超过500个字符', trigger: 'blur' }, - ], + followContent: [{ max: 500, message: '跟进说明不能超过500个字符', trigger: 'blur' }], }, editForm: { exceptionType: '', @@ -503,7 +535,7 @@ export default { }, async openDisposal(row, mode) { this.dialog = { visible: true, mode, loading: true, submitting: false }; - this.followForm = { followContent: '' }; + this.followForm = { followContent: '', attachments: [] }; try { const res = await api.getDetail(row.id); this.detail = this.decorateRow(res.data?.data || res.data || res || {}); @@ -582,9 +614,18 @@ export default { }, async submitFollow() { await this.$refs.followFormRef.validate(); + const followContent = (this.followForm.followContent || '').trim(); + const attachmentsJson = this.followForm.attachments.length + ? JSON.stringify(this.followForm.attachments) + : ''; + // 后端要求二者至少有其一 + if (!followContent && !attachmentsJson) { + this.$message.warning('请填写跟进说明或上传附件'); + return; + } this.dialog.submitting = true; try { - await api.follow({ id: this.detail.id, followContent: this.followForm.followContent }); + await api.follow({ id: this.detail.id, followContent, attachmentsJson }); this.$message.success('跟进成功'); this.dialog.visible = false; this.loadTable(); @@ -592,6 +633,16 @@ export default { this.dialog.submitting = false; } }, + parseAttachments(value) { + if (!value) return []; + if (Array.isArray(value)) return value; + try { + const parsed = JSON.parse(value); + return Array.isArray(parsed) ? parsed.filter(item => item && item.url) : []; + } catch (error) { + return []; + } + }, async completeRow(row) { await this.$confirm('确认完成该异常处置?', '提示', { type: 'warning' }); await api.complete({ id: row.id }); @@ -751,12 +802,9 @@ export default { padding: 4px 0 0; } -.dialog-section-title { - margin: 12px 0; - padding-left: 12px; - border-left: 4px solid #409eff; - font-size: 16px; - font-weight: 600; +.exception-disposal-page__attachment-link { + display: block; + margin-bottom: 2px; } .exception-disposal-page__detail-grid { @@ -799,10 +847,6 @@ export default { } } -.exception-disposal-page__follow-form { - margin-top: 16px; -} - .exception-disposal-page__dialog :deep(.section-card + .section-card) { margin-top: 16px; }