|
|
@ -241,6 +241,18 @@
|
|
|
|
title="上传图纸"
|
|
|
|
title="上传图纸"
|
|
|
|
width="30%"
|
|
|
|
width="30%"
|
|
|
|
@before-close="blueprintModel = false">
|
|
|
|
@before-close="blueprintModel = false">
|
|
|
|
|
|
|
|
<el-form ref="form">
|
|
|
|
|
|
|
|
<el-form-item label="选择BOM图纸">
|
|
|
|
|
|
|
|
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM图纸" multiple filterable :clearable="false">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="item in attachInfoList"
|
|
|
|
|
|
|
|
:key="item.attachId"
|
|
|
|
|
|
|
|
:label="item.attachName"
|
|
|
|
|
|
|
|
:value="item.attachId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
<el-upload
|
|
|
|
<el-upload
|
|
|
|
single
|
|
|
|
single
|
|
|
|
ref="drawingUpload"
|
|
|
|
ref="drawingUpload"
|
|
|
@ -303,6 +315,18 @@
|
|
|
|
title="上传SOP附件"
|
|
|
|
title="上传SOP附件"
|
|
|
|
width="30%"
|
|
|
|
width="30%"
|
|
|
|
@before-close="sopViewModel = false">
|
|
|
|
@before-close="sopViewModel = false">
|
|
|
|
|
|
|
|
<el-form ref="form">
|
|
|
|
|
|
|
|
<el-form-item label="选择BOM的SOP">
|
|
|
|
|
|
|
|
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM的SOP" multiple filterable :clearable="false">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="item in attachInfoList"
|
|
|
|
|
|
|
|
:key="item.attachId"
|
|
|
|
|
|
|
|
:label="item.attachName"
|
|
|
|
|
|
|
|
:value="item.attachId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
<el-upload
|
|
|
|
<el-upload
|
|
|
|
single
|
|
|
|
single
|
|
|
|
ref="drawingUpload"
|
|
|
|
ref="drawingUpload"
|
|
|
@ -397,6 +421,8 @@ import {getConfigKey} from "@//api/system/config"
|
|
|
|
import {deepClone} from "@//utils/index";
|
|
|
|
import {deepClone} from "@//utils/index";
|
|
|
|
import {getToken} from "@//utils/auth";
|
|
|
|
import {getToken} from "@//utils/auth";
|
|
|
|
import applyRawOutstock from '@//views/wms/common/applyRawOutstock.vue';
|
|
|
|
import applyRawOutstock from '@//views/wms/common/applyRawOutstock.vue';
|
|
|
|
|
|
|
|
import {getBomAttachInfo, listMaterialBom} from "@/api/mes/materialBom";
|
|
|
|
|
|
|
|
import {listMaterialinfo} from "@/api/mes/materialinfo";
|
|
|
|
|
|
|
|
|
|
|
|
let id = 0
|
|
|
|
let id = 0
|
|
|
|
let deepSearch = (arr, target) => {
|
|
|
|
let deepSearch = (arr, target) => {
|
|
|
@ -579,9 +605,21 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
id: 1,
|
|
|
|
id: 1,
|
|
|
|
|
|
|
|
|
|
|
|
processUsers: []
|
|
|
|
processUsers: [],
|
|
|
|
|
|
|
|
//物料BOMList
|
|
|
|
|
|
|
|
attachInfoList: [],
|
|
|
|
|
|
|
|
//选中的BOMList
|
|
|
|
|
|
|
|
materialBomAttachIdList: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
'materialBomAttachIdList': {
|
|
|
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
|
|
|
console.log("val:",newVal,oldVal)
|
|
|
|
|
|
|
|
this.updateAttachInfoByBom(newVal, oldVal);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
const productOrderId = this.$route.params && this.$route.params.productOrderId;
|
|
|
|
const productOrderId = this.$route.params && this.$route.params.productOrderId;
|
|
|
|
if (productOrderId) {
|
|
|
|
if (productOrderId) {
|
|
|
@ -592,6 +630,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getConfigValues();
|
|
|
|
this.getConfigValues();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
@ -616,7 +655,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
getConfigKey("mes.sop.maxSize").then(res => {
|
|
|
|
getConfigKey("mes.sop.maxSize").then(res => {
|
|
|
|
if(res.msg){
|
|
|
|
if (res.msg) {
|
|
|
|
this.sopFileSize = res.msg;
|
|
|
|
this.sopFileSize = res.msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -1160,6 +1199,16 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
|
|
|
this.materialBomAttachIdList = [];
|
|
|
|
|
|
|
|
getBomAttachInfo("1", this.addProductPlanObject.materialBomId).then(response => {
|
|
|
|
|
|
|
|
this.attachInfoList = response.data;
|
|
|
|
|
|
|
|
for (let e of this.fileList) {
|
|
|
|
|
|
|
|
let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
|
|
|
|
|
|
|
|
if (attachInfo != null){
|
|
|
|
|
|
|
|
this.materialBomAttachIdList.push(attachInfo.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
this.blueprintModel = true;
|
|
|
|
this.blueprintModel = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -1215,9 +1264,10 @@ export default {
|
|
|
|
handleRemoveDrawing(file) {
|
|
|
|
handleRemoveDrawing(file) {
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
|
|
|
|
console.log("index",index)
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
// this.uploadAttachList.splice(index, 1);
|
|
|
|
// this.uploadAttachList.splice(index, 1);
|
|
|
|
// this.fileList.splice(index, 1);
|
|
|
|
this.fileList.splice(index, 1);
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
let num = 0;
|
|
|
|
let num = 0;
|
|
|
|
arrPic.map((item) => {
|
|
|
|
arrPic.map((item) => {
|
|
|
@ -1226,6 +1276,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
num++;
|
|
|
|
num++;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
let attachInfo = this.attachInfoList.find(item => item.attachPath === file.url);
|
|
|
|
|
|
|
|
if (attachInfo != null){
|
|
|
|
|
|
|
|
this.materialBomAttachIdList = this.materialBomAttachIdList.filter(item => item !== attachInfo.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1282,6 +1336,16 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
|
|
|
this.materialBomAttachIdList = [];
|
|
|
|
|
|
|
|
getBomAttachInfo("2", this.addProductPlanObject.materialBomId).then(response => {
|
|
|
|
|
|
|
|
this.attachInfoList = response.data;
|
|
|
|
|
|
|
|
for (let e of this.fileList) {
|
|
|
|
|
|
|
|
let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
|
|
|
|
|
|
|
|
if (attachInfo != null){
|
|
|
|
|
|
|
|
this.materialBomAttachIdList.push(attachInfo.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
this.sopViewModel = true;
|
|
|
|
this.sopViewModel = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -1339,6 +1403,7 @@ export default {
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
|
|
|
|
this.fileList.splice(index, 1);
|
|
|
|
let num = 0;
|
|
|
|
let num = 0;
|
|
|
|
arrPic.map((item) => {
|
|
|
|
arrPic.map((item) => {
|
|
|
|
if (item.uid === file.uid) {
|
|
|
|
if (item.uid === file.uid) {
|
|
|
@ -1346,19 +1411,20 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
num++;
|
|
|
|
num++;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
let attachInfo = this.attachInfoList.find(item => item.attachPath === file.url);
|
|
|
|
|
|
|
|
if (attachInfo != null){
|
|
|
|
|
|
|
|
this.materialBomAttachIdList = this.materialBomAttachIdList.filter(item => item !== attachInfo.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 上传前loading加载
|
|
|
|
// 上传前loading加载
|
|
|
|
handleBeforeUpload(file) {
|
|
|
|
handleBeforeUpload(file) {
|
|
|
|
let fileType,fileSize;
|
|
|
|
let fileType, fileSize;
|
|
|
|
if(this.sopViewModel){
|
|
|
|
if (this.sopViewModel) {
|
|
|
|
fileType = this.sopFileType;
|
|
|
|
fileType = this.sopFileType;
|
|
|
|
fileSize = this.sopFileSize;
|
|
|
|
fileSize = this.sopFileSize;
|
|
|
|
}else if(this.blueprintModel){
|
|
|
|
} else if (this.blueprintModel) {
|
|
|
|
fileType = this.drawingFileType;
|
|
|
|
fileType = this.drawingFileType;
|
|
|
|
fileSize = this.drawingFileSize;
|
|
|
|
fileSize = this.drawingFileSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1421,6 +1487,60 @@ export default {
|
|
|
|
closeRawOutstockDialog() {
|
|
|
|
closeRawOutstockDialog() {
|
|
|
|
this.applyRawOutstockOpen = false;
|
|
|
|
this.applyRawOutstockOpen = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//根据BOM更新图纸或SOP
|
|
|
|
|
|
|
|
updateAttachInfoByBom(newVal, oldVal) {
|
|
|
|
|
|
|
|
if (newVal.length === 0) {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let result = [];
|
|
|
|
|
|
|
|
let targetAttachIds = newVal.filter(item => !oldVal.includes(item));
|
|
|
|
|
|
|
|
for (let targetAttachId of targetAttachIds) {
|
|
|
|
|
|
|
|
result.push(this.attachInfoList.find(item => item.attachId === targetAttachId));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log("result:",result);
|
|
|
|
|
|
|
|
let isDrawing = this.blueprintModel;
|
|
|
|
|
|
|
|
//图纸
|
|
|
|
|
|
|
|
if (isDrawing) {
|
|
|
|
|
|
|
|
for (let e of result) {
|
|
|
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
|
|
|
let groupAttachFile = {};
|
|
|
|
|
|
|
|
groupAttachFile.dispatchCode = this.addProductPlanObject.dispatchCode;
|
|
|
|
|
|
|
|
groupAttachFile.processId = this.addProductPlanObject.processId;
|
|
|
|
|
|
|
|
groupAttachFile.attachId = e.attachId;
|
|
|
|
|
|
|
|
groupAttachFile.attachPath = e.attachPath;
|
|
|
|
|
|
|
|
groupAttachFile.attachName = e.attachName;
|
|
|
|
|
|
|
|
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
|
|
|
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
|
|
|
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupAttachFile);
|
|
|
|
|
|
|
|
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
|
|
|
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
|
|
|
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//SOP
|
|
|
|
|
|
|
|
for (let e of result) {
|
|
|
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
|
|
|
let groupSopFile = {};
|
|
|
|
|
|
|
|
groupSopFile.dispatchCode = this.addProductPlanObject.dispatchCode;
|
|
|
|
|
|
|
|
groupSopFile.processId = this.addProductPlanObject.processId;
|
|
|
|
|
|
|
|
groupSopFile.attachId = e.attachId;
|
|
|
|
|
|
|
|
groupSopFile.attachPath = e.attachPath;
|
|
|
|
|
|
|
|
groupSopFile.attachName = e.attachName;
|
|
|
|
|
|
|
|
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
|
|
|
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
|
|
|
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupSopFile);
|
|
|
|
|
|
|
|
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
|
|
|
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
|
|
|
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(e.attachId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -1431,3 +1551,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
;
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
/deep/.el-icon-close{display:none}
|
|
|
|
|
|
|
|
</style>
|
|
|
|