|
@@ -23,7 +23,7 @@
|
|
<script>
|
|
<script>
|
|
import SearchBoxVue from './components/SearchBox2.vue'
|
|
import SearchBoxVue from './components/SearchBox2.vue'
|
|
import TableBoxVue from './components/TableBox2.vue'
|
|
import TableBoxVue from './components/TableBox2.vue'
|
|
-import { errorDetailsListExport } from '@/api/excel'
|
|
|
|
|
|
+import { errorDetailsListExport, errorDetailsLCListExport } from '@/api/excel'
|
|
import { dateFormat, getDaysInMonth } from '@/utils'
|
|
import { dateFormat, getDaysInMonth } from '@/utils'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -140,6 +140,36 @@ export default {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
handelExport() {
|
|
handelExport() {
|
|
|
|
+ if(this.type_name == 'lc'){
|
|
|
|
+ this.lcExport()
|
|
|
|
+ }else{
|
|
|
|
+ this.flcExport()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 临床导出
|
|
|
|
+ lcExport() {
|
|
|
|
+ errorDetailsLCListExport({...this.searchData, error_rule: this.error_rule, is_export: 1}).then(res => {
|
|
|
|
+ const content = res.data; // 后台返回二进制数据
|
|
|
|
+ const blob = new Blob([content]);
|
|
|
|
+ const fileName = `缺陷问题详情.csv`;
|
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
|
+ // 非IE下载
|
|
|
|
+ const elink = document.createElement('a');
|
|
|
|
+ elink.download = fileName;
|
|
|
|
+ elink.style.display = 'none';
|
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click();
|
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
+ } else {
|
|
|
|
+ // IE10+下载
|
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 非临床导出
|
|
|
|
+ flcExport() {
|
|
errorDetailsListExport({...this.searchData, error_rule: this.error_rule}).then(res => {
|
|
errorDetailsListExport({...this.searchData, error_rule: this.error_rule}).then(res => {
|
|
const content = res.data; // 后台返回二进制数据
|
|
const content = res.data; // 后台返回二进制数据
|
|
const blob = new Blob([content]);
|
|
const blob = new Blob([content]);
|