Browse Source

检验模板维护功能:导入功能升级

java8
赵宏斌 6 months ago
parent
commit
04174acf76
  1. 33
      src/views/modules/qc/qc_upload.vue

33
src/views/modules/qc/qc_upload.vue

@ -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(){

Loading…
Cancel
Save