| | |
| | | <el-dialog title="附件查看" :visible.sync="isShow" width="80%" @closed="$emit('closeFilesLook')"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <ul class="tab"> |
| | | <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li> |
| | | <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }" |
| | | @click="handleDataVisibleTab(m, i)">{{ m.label }}</li> |
| | | </ul> |
| | | <el-upload :action="action" |
| | | :auto-upload="true" |
| | | :data="{orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId}" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" |
| | | :before-upload="beforeUpload" |
| | | style="width: 80px !important;" |
| | | :on-error="onError" ref='upload'> |
| | | <el-upload :action="action" :auto-upload="true" |
| | | :data="{ orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId }" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="uploadHeader" |
| | | :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref='upload'> |
| | | <el-button size="small" type="primary" style="height: 38px">附件上传</el-button> |
| | | </el-upload> |
| | | </div> |
| | | <div style="height: 70vh;overflow-y: auto;" v-if="filesDialogVisible"> |
| | | <ValueTable ref="fileList" |
| | | :url="$api.insOrderPlan.getFileList" |
| | | :delUrl="$api.insOrderPlan.delfile" |
| | | class="value-table" |
| | | :key="upIndex" |
| | | :componentData="componentData"/> |
| | | <ValueTable ref="fileList" :url="$api.insOrderPlan.getFileList" :delUrl="$api.insOrderPlan.delfile" |
| | | class="value-table" :key="upIndex" :componentData="componentData" /> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | export default { |
| | | name: "filesLookVisible", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: {ValueTable}, |
| | | components: { ValueTable }, |
| | | props: { |
| | | filesDialogVisible: { |
| | | type: Boolean, |
| | |
| | | }, |
| | | filesLookInfo: { |
| | | type: Object, |
| | | default: () => {} |
| | | default: () => { } |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | dataVisibleIndex: 0, // tab栏选择值 |
| | | componentData: { |
| | | entity: { |
| | | insOrderId:'' |
| | | insOrderId: '' |
| | | }, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: false, |
| | | sort: false, |
| | | init:false, |
| | | init: false, |
| | | do: [ |
| | | { |
| | | id: 'parent', |
| | | font: '下载', |
| | | type: 'text', |
| | | method: 'handleDown' |
| | | },{ |
| | | }, { |
| | | id: 'delete', |
| | | font: '删除', |
| | | type: 'text', |
| | |
| | | isPage: false, |
| | | linkEvent: {}, |
| | | tagField: { |
| | | type:{ |
| | | select:[ |
| | | type: { |
| | | select: [ |
| | | { |
| | | value: 1, |
| | | label: '图片' |
| | |
| | | // 方法集合 |
| | | methods: { |
| | | // 切换数据查看tab栏 |
| | | handleDataVisibleTab (m, i) { |
| | | handleDataVisibleTab(m, i) { |
| | | this.dataVisibleIndex = i |
| | | this.refreshTable() |
| | | }, |
| | |
| | | this.$refs['fileList'].selectList(e) |
| | | }) |
| | | }, |
| | | handleDown(row){ |
| | | handleDown(row) { |
| | | this.$axios.post(this.$api.insOrderPlan.downFile, { |
| | | id: row.id, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | let url = ''; |
| | | if(res.data.type==1){ |
| | | url = this.javaApi+'/img/'+res.data.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+res.data.fileUrl |
| | | if (res.data.type == 1) { |
| | | url = this.javaApi + '/img/' + res.data.fileUrl |
| | | file.downloadIamge(url, row.fileName) |
| | | } else { |
| | | url = this.javaApi + '/word/' + res.data.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | |
| | | |
| | | }) |
| | | }, |
| | | handleSuccessUp(response, ) { |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('上传成功'); |