|
|
|
@ -71,20 +71,7 @@ |
|
|
|
<el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartAttrUpload()">物料属性导入</el-button> |
|
|
|
<el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartTemplateUpload()">检验模板导入</el-button> |
|
|
|
<el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartStandardUpload()">检验标准导入</el-button> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
:data="exportData" |
|
|
|
type="xls" |
|
|
|
:name="exportName" |
|
|
|
:header="exportHeader" |
|
|
|
:footer="exportFooter" |
|
|
|
:fetch="createExportData" |
|
|
|
:before-generate="startDownload" |
|
|
|
:before-finish="finishDownload" |
|
|
|
worksheet="导出信息" |
|
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
|
{{ "导出" }} |
|
|
|
</download-excel> |
|
|
|
<el-button type="primary" :loading="exportLoading" @click="exportExcel()">导出</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -1090,7 +1077,8 @@ |
|
|
|
updatePatrolConfig as updatePatrolConfigApi, |
|
|
|
deletePatrolConfig as deletePatrolConfigApi, |
|
|
|
getPatrolOperationDescList as getPatrolOperationDescListApi, |
|
|
|
getPartAttributeFileList |
|
|
|
getPartAttributeFileList, |
|
|
|
exportQcExcel |
|
|
|
} from "@/api/qc/qc.js" |
|
|
|
import { getSiteData } from '@/api/board.js' |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
@ -1114,13 +1102,7 @@ |
|
|
|
maintainFlagProps: ['iqcFlag', 'ipqcFlag', 'fqcFlag', 'oqcFlag', 'sqcFlag'], |
|
|
|
// 是否收藏 |
|
|
|
favorite: false, |
|
|
|
// 导出 start |
|
|
|
exportData: [], |
|
|
|
exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
|
exportHeader: ["根据物料设置检验模板"], |
|
|
|
exportFooter: [], |
|
|
|
exportList: [], |
|
|
|
// 导出 end |
|
|
|
exportLoading: false, |
|
|
|
tagNo: '', |
|
|
|
patrolConfigDialogFlag: false, |
|
|
|
patrolConfigLoading: false, |
|
|
|
@ -3317,32 +3299,28 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//导出excel |
|
|
|
async createExportData() { |
|
|
|
this.searchData.limit = -1 |
|
|
|
this.searchData.page = 1 |
|
|
|
await qcPartAttributeSearch(this.searchData).then(({data}) => { |
|
|
|
this.exportList= data.page.list |
|
|
|
exportExcel () { |
|
|
|
this.exportLoading = true |
|
|
|
const query = Object.assign({}, this.searchData, { page: 1, limit: 1000 }) |
|
|
|
exportQcExcel('partAttr', query).then(({data}) => { |
|
|
|
this.bindExportBlob(data, '物料属性' + this.dayjs().format('YYYYMMDDHHmmss') + '.xlsx') |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('导出失败') |
|
|
|
}).finally(() => { |
|
|
|
this.exportLoading = false |
|
|
|
}) |
|
|
|
return this.exportList |
|
|
|
}, |
|
|
|
|
|
|
|
startDownload() {}, |
|
|
|
|
|
|
|
finishDownload() {}, |
|
|
|
|
|
|
|
fields () { |
|
|
|
let json = "{" |
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
if (index == this.columnList.length - 1) { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|
|
|
} else { |
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|
|
|
} |
|
|
|
}) |
|
|
|
json += "}" |
|
|
|
let s = eval("(" + json + ")") |
|
|
|
return s |
|
|
|
bindExportBlob (data, fileName) { |
|
|
|
const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}) |
|
|
|
const linkNode = document.createElement('a') |
|
|
|
linkNode.download = fileName |
|
|
|
linkNode.style.display = 'none' |
|
|
|
linkNode.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(linkNode) |
|
|
|
linkNode.click() |
|
|
|
URL.revokeObjectURL(linkNode.href) |
|
|
|
document.body.removeChild(linkNode) |
|
|
|
}, |
|
|
|
|
|
|
|
qcPartAttrUpload () { |
|
|
|
@ -3359,7 +3337,7 @@ |
|
|
|
flag: flag, |
|
|
|
title: title, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
site: this.$store.state.user.site |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.qcUpload.init(currentData) |
|
|
|
@ -3371,7 +3349,7 @@ |
|
|
|
let currentData = { |
|
|
|
flag: 'partAttribute', |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
site: this.$store.state.user.site |
|
|
|
} |
|
|
|
//打开组件 去做新增业务 |
|
|
|
this.$nextTick(() => { |
|
|
|
|