|
|
|
@ -3,7 +3,7 @@ |
|
|
|
<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-form-item label="BU" v-if="pageData.flag !== 'poPartPrint'"> |
|
|
|
<el-select v-model="bu" placeholder="请选择" style="width: 295px"> |
|
|
|
<el-option |
|
|
|
v-for = "i in userBuList" |
|
|
|
@ -39,6 +39,7 @@ import { |
|
|
|
queryFileId, // 查询文件ID |
|
|
|
getSiteAndBuByUserName |
|
|
|
} from "@/api/qc/qc.js" |
|
|
|
import { uploadPoPartPrintExcel, queryFileIdWms } from '@/api/wms/wms.js' |
|
|
|
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js' |
|
|
|
import axios from 'axios' |
|
|
|
import Vue from 'vue' |
|
|
|
@ -101,7 +102,7 @@ export default { |
|
|
|
}, |
|
|
|
/*保修当前的数据*/ |
|
|
|
saveUploadFile(){ |
|
|
|
if (this.bu==''||this.bu == null){ |
|
|
|
if (this.pageData.flag !== 'poPartPrint' && (this.bu === '' || this.bu == null)){ |
|
|
|
this.$message.warning("请选择BU!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
@ -151,6 +152,29 @@ export default { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.pageData.flag === 'poPartPrint') { |
|
|
|
// 采购标签导入 |
|
|
|
formData.append("buNo", this.pageData.buNo); |
|
|
|
formData.append("orderNo", this.pageData.orderNo); |
|
|
|
formData.append("partNo", this.pageData.partNo); |
|
|
|
formData.append("partDesc", this.pageData.partDesc); |
|
|
|
formData.append("poOrderNo", this.pageData.poOrderNo); |
|
|
|
formData.append("poItemNo", this.pageData.poItemNo); |
|
|
|
formData.append("supplierId", this.pageData.supplierId); |
|
|
|
formData.append("supplierName", this.pageData.supplierName); |
|
|
|
formData.append("orderQty", this.pageData.orderQty); |
|
|
|
formData.append("inspectionNo", this.pageData.inspectionNo); |
|
|
|
uploadPoPartPrintExcel(formData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.$message.success(data.msg); |
|
|
|
// 清空文件上传记录 |
|
|
|
this.$refs.uploadFile.clearFiles(); |
|
|
|
// 关闭窗口并刷新页面 |
|
|
|
this.closeDialog(); |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.bu = ''; |
|
|
|
}, |
|
|
|
@ -203,8 +227,22 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.pageData.flag === 'poPartPrint') { // 采购标签导入 |
|
|
|
tempData.orderRef1 = 'wms'; |
|
|
|
tempData.orderRef2 = 'PoPartPrint'; |
|
|
|
await queryFileIdWms(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
file.id = data.data.id |
|
|
|
file.fileName = data.data.fileName |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
await downLoadObjectFile(file).then(({data}) => { |
|
|
|
console.log(file) |
|
|
|
// 不限制文件下载类型 |
|
|
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
|
|
|
// 下载文件名称 |
|
|
|
|