|
|
|
@ -3,6 +3,16 @@ |
|
|
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
|
|
|
<el-form :inline="true" label-position="top" label-width="80px"> |
|
|
|
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button> |
|
|
|
<el-form-item label="BU"> |
|
|
|
<el-select v-model="bu" placeholder="请选择" style="width: 295px"> |
|
|
|
<el-option |
|
|
|
v-for = "i in userBuList" |
|
|
|
:key = "i.buNo" |
|
|
|
:label = "i.sitename" |
|
|
|
:value = "i.buNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" |
|
|
|
@ -28,6 +38,7 @@ import { |
|
|
|
uploadPartAttributeExcel, // 导入物料属性文件 |
|
|
|
uploadFamilyAttributeExcel, // 导入类别属性文件 |
|
|
|
queryFileId, // 查询文件ID |
|
|
|
getSiteAndBuByUserName |
|
|
|
} from "@/api/qc/qc.js" |
|
|
|
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js' |
|
|
|
import axios from 'axios' |
|
|
|
@ -38,6 +49,8 @@ export default { |
|
|
|
titleCon: '文件导入', |
|
|
|
visible: false, |
|
|
|
fileList: [], |
|
|
|
bu: '', |
|
|
|
userBuList:[], |
|
|
|
pageData: { |
|
|
|
flag: '', |
|
|
|
createBy: '', |
|
|
|
@ -45,7 +58,21 @@ export default { |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
this.getSiteAndBu(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取用户的bu |
|
|
|
getSiteAndBu () { |
|
|
|
let tempData = { |
|
|
|
username: this.$store.state.user.name, |
|
|
|
} |
|
|
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.userBuList = data.rows |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//初始化组件的参数 |
|
|
|
init(currentRow) { |
|
|
|
// 获得类别 |
|
|
|
@ -75,6 +102,10 @@ export default { |
|
|
|
}, |
|
|
|
/*保修当前的数据*/ |
|
|
|
saveUploadFile(){ |
|
|
|
if (this.bu==''||this.bu == null){ |
|
|
|
this.$message.warning("请选择BU!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
/*判断文件是否上传*/ |
|
|
|
if(null == this.fileList || 0 == this.fileList.length){ |
|
|
|
this.$message.error("请先上传文件!"); |
|
|
|
@ -97,6 +128,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.pageData.flag === 'template'){ |
|
|
|
formData.set('site',this.bu) |
|
|
|
uploadTemplateExcel(formData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.$message.success(data.msg); |
|
|
|
@ -133,6 +165,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.bu = ''; |
|
|
|
}, |
|
|
|
// 下载 |
|
|
|
async downloadFile(){ |
|
|
|
|