| | |
| | | <template> |
| | | <div> |
| | | <el-dialog title="工单审核" :visible.sync="auditingOpen" width="1000px" append-to-body> |
| | | <el-dialog :before-close="cancelAuditing" title="工单审核" :visible.sync="auditingOpen" width="1000px" append-to-body> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form ref="auditingForm" :model="auditingForm" :rules="auditingRules" label-width="80px"> |
| | |
| | | > |
| | | <el-card> |
| | | <div v-html="condition.ywCondition"></div> |
| | | <el-link type="primary" |
| | | v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials" |
| | | :underline="false" :key="item.id" @click="handleDownload(item)" |
| | | >{{ item.substring(item.lastIndexOf('/') + 1) }} |
| | | </el-link> |
| | | <div v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials" |
| | | :key="item.id"> |
| | | <el-image |
| | | v-if="isImageFile(item)" |
| | | :src="getPreview(item)" |
| | | :preview-src-list="[getPreview(item)]" |
| | | fit="cover" |
| | | style="width: 100px; height: 100px; margin: 5px;" |
| | | > |
| | | </el-image> |
| | | <el-link |
| | | v-else |
| | | type="primary" |
| | | :underline="false" |
| | | @click="handleDownload(item)" |
| | | > |
| | | {{ getFileName(item) }} |
| | | </el-link> |
| | | </div> |
| | | </el-card> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getPreview(url) { |
| | | // 使用全局配置的图片前缀 |
| | | return this.$img + url; |
| | | }, |
| | | isImageFile(url) { |
| | | const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp']; |
| | | return imageExtensions.some(ext => |
| | | url.toLowerCase().endsWith(ext) |
| | | ); |
| | | }, |
| | | getFileName(url) { |
| | | return url.substring(url.lastIndexOf('/') + 1); |
| | | }, |
| | | /** 下载按钮操作 */ |
| | | handleDownload(data) { |
| | | this.$download.resource(data) |
| | | }, |
| | | // 提交审核 |
| | | submitAuditing() { |
| | | this.$refs['auditingForm'].validate(valid => { |
| | |
| | | auditing(this.auditingForm).then(res => { |
| | | this.$emit('close', false); |
| | | this.$modal.msgSuccess('操作成功') |
| | | this.getList() |
| | | this.$emit('getList', false); |
| | | }) |
| | | } |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |