Browse Source

2023-07-05 设备和质量修改

java8
杨奉源 3 years ago
parent
commit
87f945c171
  1. 1
      src/api/qc/qc.js
  2. 20
      src/views/modules/qc/qcItem.vue
  3. 183
      src/views/modules/qc/qc_upload.vue

1
src/api/qc/qc.js

@ -83,6 +83,7 @@ export const qcFamilyAttributeSearch = data => createAPI(`/pms/qc/qcFamilyAttrib
export const qcFamilyAttributeSave = data => createAPI(`/pms/qc/qcFamilyAttributeSave`,'post',data)
export const qcFamilyAttributeDelete = data => createAPI(`/pms/qc/qcFamilyAttributeDelete`,'post',data)
export const uploadFamilyAttributeExcel = data => createAPI(`/pms/qc/uploadFamilyAttributeExcel`,'post',data)
export const queryFileId = data => createAPI(`/pms/qc/queryFileId`,'post',data)
// ===================================== FAI检验 =====================================
export const qcFAIInspectionSearch = data => createAPI(`/pms/qc/qcFAIInspectionSearch`,'post',data)

20
src/views/modules/qc/qcItem.vue

@ -538,13 +538,10 @@
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
console.log(this.$route.meta.menuId)
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
// let flag=false;
if(this.$route.meta.menuId==data.list[i].menuId){
this.favorite = true
// flag=true;
}
}
@ -557,17 +554,10 @@
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
//
// this.$confirm(``, '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
// })
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
@ -587,7 +577,7 @@
return this.exportList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {

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

@ -27,6 +27,7 @@ import {
uploadTemplateExcel, //
uploadPartAttributeExcel, //
uploadFamilyAttributeExcel, //
queryFileId, // ID
} from "@/api/qc/qc.js"
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js'
import axios from 'axios'
@ -82,7 +83,7 @@ export default {
formData.append("file", this.fileList[0].raw);
formData.append("createBy", this.pageData.createBy);
formData.append("site", this.pageData.site);
if (this.pageData.flag == 'item'){
if (this.pageData.flag === 'item'){
uploadExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg);
@ -94,7 +95,7 @@ export default {
this.$message.warning(data.msg);
}
})
} else if (this.pageData.flag == 'template'){
} else if (this.pageData.flag === 'template'){
uploadTemplateExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg);
@ -106,7 +107,7 @@ export default {
this.$message.warning(data.msg);
}
})
}else if (this.pageData.flag == 'partAttribute'){
}else if (this.pageData.flag === 'partAttribute'){
uploadPartAttributeExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg);
@ -118,7 +119,7 @@ export default {
this.$message.warning(data.msg);
}
})
}else if (this.pageData.flag == 'familyAttribute'){
}else if (this.pageData.flag === 'familyAttribute'){
uploadFamilyAttributeExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg);
@ -133,117 +134,70 @@ export default {
}
},
//
downloadFile(){
if(this.pageData.flag == 'item'){
let file = {
id: 61,
fileName: '检验项目格式.xlsx',
}
// axios.get('/proxyApi/pms/eamObject/downLoadObjectFile/' + file.id, {
// responseType: 'blob',
// headers: {
// 'Content-Type': 'application/json',
// 'token': Vue.cookie.get('token')
// }
// })
downLoadObjectFile(file)
.then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = file.fileName
// a
const linkNode = document.createElement('a')
// adownload
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)
async downloadFile(){
let file = {
id: 0,
fileName: ''
}
let tempData = {
orderRef1: '',
orderRef2: ''
}
if(this.pageData.flag === 'item'){ //
tempData.orderRef1 = 'qc';
tempData.orderRef2 = 'itemFormat';
await queryFileId(tempData).then(({data}) => {
if (data && data.code === 0) {
file.id = data.data.id
file.fileName = data.data.fileName
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}else if (this.pageData.flag == 'template'){
let file = {
id: 62,
fileName: '检验模板格式.xlsx',
}
// axios.get('/proxyApi/pms/eamObject/downLoadObjectFile/' + file.id, {
// responseType: 'blob',
// headers: {
// 'Content-Type': 'application/json',
// 'token': Vue.cookie.get('token')
// }
// })
downLoadObjectFile(file)
.then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = file.fileName
// a
const linkNode = document.createElement('a')
// adownload
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)
}else if (this.pageData.flag === 'template'){ //
tempData.orderRef1 = 'qc';
tempData.orderRef2 = 'templateFormat';
await queryFileId(tempData).then(({data}) => {
if (data && data.code === 0) {
file.id = data.data.id
file.fileName = data.data.fileName
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}else if (this.pageData.flag == 'partAttribute'){
let file = {
id: 63,
fileName: '物料属性设置.xlsx',
}
// axios.get('/proxyApi/pms/eamObject/downLoadObjectFile/' + file.id, {
// responseType: 'blob',
// headers: {
// 'Content-Type': 'application/json',
// 'token': Vue.cookie.get('token')
// }
// })
downLoadObjectFile(file)
.then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = file.fileName
// a
const linkNode = document.createElement('a')
// adownload
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)
}else if (this.pageData.flag === 'partAttribute'){ //
tempData.orderRef1 = 'qc';
tempData.orderRef2 = 'partAttributeFormat';
await queryFileId(tempData).then(({data}) => {
if (data && data.code === 0) {
file.id = data.data.id
file.fileName = data.data.fileName
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}else if (this.pageData.flag == 'familyAttribute'){
let file = {
id: 64,
fileName: '分类属性设置.xlsx',
}
// axios.get('/proxyApi/pms/eamObject/downLoadObjectFile/' + file.id, {
// responseType: 'blob',
// headers: {
// 'Content-Type': 'application/json',
// 'token': Vue.cookie.get('token')
// }
// })
downLoadObjectFile(file)
.then(({data}) => {
}else if (this.pageData.flag === 'familyAttribute'){ //
tempData.orderRef1 = 'qc';
tempData.orderRef2 = 'familyAttributeFormat';
await queryFileId(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}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
@ -262,13 +216,8 @@ export default {
URL.revokeObjectURL(linkNode.href)
document.body.removeChild(linkNode)
})
}
},
},
created() {
}
}
</script>

Loading…
Cancel
Save