设备管理-导出
This commit is contained in:
		
							parent
							
								
									0a97ae9147
								
							
						
					
					
						commit
						01bb842ed6
					
				| 
						 | 
					@ -85,6 +85,7 @@
 | 
				
			||||||
          已选择 {{ selectList.length }} 条需更改数据
 | 
					          已选择 {{ selectList.length }} 条需更改数据
 | 
				
			||||||
        </span>
 | 
					        </span>
 | 
				
			||||||
        <el-button icon="el-icon-upload2" size="mini" @click="handleSynch">检验报告同步</el-button>
 | 
					        <el-button icon="el-icon-upload2" size="mini" @click="handleSynch">检验报告同步</el-button>
 | 
				
			||||||
 | 
					        <el-button icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
 | 
				
			||||||
      </el-form-item>
 | 
					      </el-form-item>
 | 
				
			||||||
    </el-form>
 | 
					    </el-form>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -520,6 +521,7 @@ import { downloadFile, downloadFileData } from '@/utils/download'
 | 
				
			||||||
import { getToken } from '@/utils/auth'
 | 
					import { getToken } from '@/utils/auth'
 | 
				
			||||||
import QRCode from 'qrcodejs2'
 | 
					import QRCode from 'qrcodejs2'
 | 
				
			||||||
import html2canvas from 'html2canvas'
 | 
					import html2canvas from 'html2canvas'
 | 
				
			||||||
 | 
					import { formatTime } from '@/utils/bonus'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  name: 'Device',
 | 
					  name: 'Device',
 | 
				
			||||||
| 
						 | 
					@ -1178,6 +1180,18 @@ export default {
 | 
				
			||||||
          this.getList();
 | 
					          this.getList();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 导出
 | 
				
			||||||
 | 
					    handleExport() {
 | 
				
			||||||
 | 
					      try {
 | 
				
			||||||
 | 
					        let fileName = `设备管理_${formatTime(new Date())}.xLsx`
 | 
				
			||||||
 | 
					        let url = '/material/ma_machine/export'
 | 
				
			||||||
 | 
					        const params = { ...this.queryParams }
 | 
				
			||||||
 | 
					        console.log('🚀 ~ 导出 ~ params:', params)
 | 
				
			||||||
 | 
					        this.download(url, params, fileName)
 | 
				
			||||||
 | 
					      } catch (error) {
 | 
				
			||||||
 | 
					        console.log('导出数据失败', error)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    // 列表复选框
 | 
					    // 列表复选框
 | 
				
			||||||
    handleSelectionChange(validSelection) {
 | 
					    handleSelectionChange(validSelection) {
 | 
				
			||||||
      this.selectList = validSelection;
 | 
					      this.selectList = validSelection;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue