|
|
@ -33,6 +33,7 @@ |
|
|
<el-button v-if="!authSearch" @click="getDataList">查询</el-button> |
|
|
<el-button v-if="!authSearch" @click="getDataList">查询</el-button> |
|
|
<el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button> |
|
|
<el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button> |
|
|
<el-button v-if="!authDelete" type="primary" @click="delModal">删除</el-button> |
|
|
<el-button v-if="!authDelete" type="primary" @click="delModal">删除</el-button> |
|
|
|
|
|
<!-- <el-button type="primary" @click="exportWordOrPdf">导出Word</el-button>--> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
:data="exportData" |
|
|
:data="exportData" |
|
|
@ -998,6 +999,7 @@ import { |
|
|
getBomEngChgLevel, // 获取物料的BOM版本号 |
|
|
getBomEngChgLevel, // 获取物料的BOM版本号 |
|
|
queryPartListAll, // 查询包含Purchase(Raw)的物料 |
|
|
queryPartListAll, // 查询包含Purchase(Raw)的物料 |
|
|
batchSaveBomComponent, // 批量新增子件 |
|
|
batchSaveBomComponent, // 批量新增子件 |
|
|
|
|
|
exportWordOrPdf, 导出word |
|
|
} from '@/api/part/bomManagement.js' |
|
|
} from '@/api/part/bomManagement.js' |
|
|
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" |
|
|
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" |
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
@ -2105,6 +2107,33 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 导出word |
|
|
|
|
|
exportWordOrPdf () { |
|
|
|
|
|
let tempData = { |
|
|
|
|
|
isPdf: true, |
|
|
|
|
|
code: '123' |
|
|
|
|
|
} |
|
|
|
|
|
exportWordOrPdf(tempData).then(({data}) => { |
|
|
|
|
|
// 不限制文件下载类型 |
|
|
|
|
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
|
|
|
|
|
// 下载文件名称 |
|
|
|
|
|
const fileName = tempData.isPdf ? tempData.code + '.pdf' : tempData.code + '.doc' |
|
|
|
|
|
// a标签下载 |
|
|
|
|
|
const linkNode = document.createElement('a') |
|
|
|
|
|
// a标签的download属性规定下载文件的名称 |
|
|
|
|
|
linkNode.download = fileName |
|
|
|
|
|
linkNode.style.display = 'none' |
|
|
|
|
|
// 生成一个Blob URL |
|
|
|
|
|
linkNode.href = URL.createObjectURL(blob) |
|
|
|
|
|
document.body.appendChild(linkNode) |
|
|
|
|
|
// 模拟在按钮上的一次鼠标单击 |
|
|
|
|
|
linkNode.click() |
|
|
|
|
|
// 释放URL 对象 |
|
|
|
|
|
URL.revokeObjectURL(linkNode.href) |
|
|
|
|
|
document.body.removeChild(linkNode) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// bu改变事件 |
|
|
// bu改变事件 |
|
|
userBuChange () { |
|
|
userBuChange () { |
|
|
this.modalData.site = this.modalData.bu.split('_')[0] |
|
|
this.modalData.site = this.modalData.bu.split('_')[0] |
|
|
@ -3728,7 +3757,6 @@ export default { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(() => { |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -3758,7 +3786,6 @@ export default { |
|
|
this.alternativeChange() |
|
|
this.alternativeChange() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(() => { |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
|