| | |
| | | <el-table-column label="操作" width="220"> |
| | | <template slot-scope="scope"> |
| | | <span class="table_do" @click="changeShowDetail(scope.row)"> 查看详情 </span> |
| | | <span class="table_do" @click="downloadFile(scope.row)"> 下载附件 </span> |
| | | <span class="table_do" v-if="scope.row.type == 2" @click="saleCheck(scope)"> 审核 </span> |
| | | <span class="table_do" v-else> </span> |
| | | <span class="table_do" v-if="scope.row.type == 2" |
| | |
| | | this.selectRawInspectsList() |
| | | }, |
| | | methods: { |
| | | downloadFile(row) { |
| | | let baseIp = "http://192.168.18.16:9999" |
| | | this.axios.post(this.$api.url.saleDownload, { |
| | | id: row.id |
| | | }).then(res => { |
| | | const fileUrls = []; // 文件的urls |
| | | res.data.forEach(item=>{ |
| | | let url=baseIp+item |
| | | fileUrls.push(url) |
| | | }) |
| | | const downloadFile = (url, fileName) => { |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = fileName; |
| | | // link.style.display = 'none'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }; |
| | | |
| | | console.log(fileUrls); |
| | | fileUrls.forEach((url, index) => { |
| | | let s=url.split(".") |
| | | const fileName = row.name+`附件(${index + 1}).`+s[s.length-1]; |
| | | downloadFile(url, fileName); |
| | | }); |
| | | }) |
| | | }, |
| | | //销售订单导出 |
| | | exportSale(){ |
| | | this.$axios.post(this.$api.url.exportSale,{ |