| | |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-date" size="mini" @click="handleRowHide">隐藏列设置</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-upload" size="mini" :disabled="single" |
| | | @click="handleFileUpload">附件上传</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-download" size="mini" :disabled="multiple" |
| | | @click="handleBatchFileDownload">附件下载</el-button> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | <div class="tableBox" v-loading="loading"> |
| | | <el-table :data="tableData" ref="tableData" max-height="710" :summary-method="getSummaries" |
| | |
| | | <el-input v-model="fileUploadForm.billNo" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="附件"> |
| | | <el-upload class="upload-demo" ref="fileUpload" action="" :on-preview="handleFilePreview" |
| | | :on-remove="handleFileRemove" :on-change="handleFileChange" :file-list="fileList" |
| | | <el-upload class="upload-demo" ref="fileUpload" :action="upload.url + '?updateSupport=' + upload.updateSupport" :on-preview="handleFilePreview" |
| | | :on-remove="handleFileRemove" :on-change="handleFileChange" :file-list="fileList" :on-success="handleFileSuccess" :on-error="handleFileError" |
| | | :auto-upload="false" :limit="10" :on-exceed="handleFileExceed" |
| | | accept=".jpg,.png,.jpeg,.pdf,.doc,.docx,.xls,.xlsx,.zip,.rar"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | |
| | | <!-- 附件批量下载 --> |
| | | <el-dialog title="附件批量下载" :visible.sync="openBatchDownload" width="900px" append-to-body> |
| | | <div style="margin-bottom: 10px;"> |
| | | <el-alert :title="`已选择 ${selectedBillCount} 条单据,共 ${batchFileList.length} 个附件`" type="info" show-icon :closable="false" /> |
| | | <el-alert :title="`已选择 ${selectedBillCount} 条单据,共 ${batchFileList.length} 个附件`" type="info" |
| | | show-icon :closable="false" /> |
| | | </div> |
| | | <el-table :data="batchFileList" border v-loading="batchDownloadLoading" max-height="400" |
| | | @selection-change="handleBatchFileSelectionChange"> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="batchDownloadFiles" :loading="batchDownloadLoading" :disabled="selectedBatchFiles.length === 0">批量下载选中</el-button> |
| | | <el-button type="primary" @click="batchDownloadFiles" :loading="batchDownloadLoading" |
| | | :disabled="selectedBatchFiles.length === 0">批量下载选中</el-button> |
| | | <el-button type="primary" @click="downloadAllFiles" :loading="batchDownloadLoading">下载全部</el-button> |
| | | <el-button @click="openBatchDownload = false">关 闭</el-button> |
| | | </div> |
| | |
| | | components: { BarCodeDetail, PackStockDetail, Edit, RowSettings, PrintList, PayMentOtherBillTranEdit, GyCar, GyDriver }, |
| | | data() { |
| | | return { |
| | | upload: { |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否禁用上传 |
| | | isUploading: false, |
| | | // 是否更新已经存在的数据 |
| | | updateSupport: 0, |
| | | // 设置上传的请求头部 |
| | | // headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: 'http://220.189.218.155:9010/File' |
| | | }, |
| | | baseURL: process.env.VUE_APP_BASE_API, //后端接口前缀(后端服务器ip地址) |
| | | |
| | | HModName: "Cg_ContractTransportBillMainList", |
| | | HBillType: "WL_YayBill", |
| | | OperationType: null, //保存类型(新增1修改3) |
| | |
| | | handleFileRemove(file, fileList) { |
| | | this.uploadFiles = fileList |
| | | }, |
| | | handleFileSuccess(response, file, fileList){ |
| | | console.log(file) |
| | | }, |
| | | handleFileError(response, file, fileList){ |
| | | console.log(response, file, fileList) |
| | | }, |
| | | handleFilePreview(file) { |
| | | |
| | | if (file.url) { |
| | | window.open(file.url, '_blank') |
| | | } else if (file.raw) { |
| | |
| | | this.$modal.msgWarning('请先选择要上传的文件') |
| | | return |
| | | } |
| | | console.log(this.uploadFiles) |
| | | this.fileUploadLoading = true |
| | | const formData = new FormData() |
| | | this.uploadFiles.forEach(file => { |
| | | formData.append('files', file.raw) |
| | | }) |
| | | |
| | | // formData.append('HBillNo', this.fileUploadForm.billNo) |
| | | formData.append('HInterID', this.fileUploadForm.hInterID) |
| | | formData.append('HUserName', sessionStorage["HUserName"] || '') |
| | | axios.get(this.$baseUrl + '/WLYayBillController/saveFileAddress', formData, { |
| | | // axios.get(this.$baseUrl + '/WLYayBillController/saveFileAddress', formData, { |
| | | // headers: { |
| | | // 'Content-Type': 'multipart/form-data' |
| | | // }, |
| | | // params:{ |
| | | // HInterID:this.fileUploadForm.hInterID, |
| | | // HFileAddress:this.fileUploadPath + '/' + this.uploadFiles[0].name, |
| | | // CurUserName:sessionStorage["HUserName"] |
| | | // } |
| | | // }) |
| | | axios('', { |
| | | headers: { |
| | | 'Content-Type': 'multipart/form-data' |
| | | }, |
| | | params:{ |
| | | HInterID:this.fileUploadForm.hInterID, |
| | | CurUserName:sessionStorage["HUserName"] |
| | | } |
| | | methods: 'post', |
| | | data: formData |
| | | }).then(response => { |
| | | console.log(response) |
| | | this.fileUploadLoading = false |
| | | if (response.data.code == 1) { |
| | | this.$modal.msgSuccess(response.data.Message || '文件上传成功') |