|
|
|
@ -409,13 +409,13 @@
|
|
|
|
|
import {getProductOrder} from "@//api/mes/productOrder";
|
|
|
|
|
import {
|
|
|
|
|
deleteProductPlansByDispatchCode,
|
|
|
|
|
getDispatchCode, getDispatchDrawingList, getDispatchSOPAttachList,
|
|
|
|
|
getDispatchCode,
|
|
|
|
|
selectProductPlans,
|
|
|
|
|
checkAddMesProductPlanList,
|
|
|
|
|
orderAddMesProductPlanList,
|
|
|
|
|
getBaseRouteProcesses,
|
|
|
|
|
getProcessUsers,
|
|
|
|
|
uploadFile
|
|
|
|
|
uploadFile, getAttachInfoList
|
|
|
|
|
} from "@//api/mes/productplan";
|
|
|
|
|
import {getConfigKey} from "@//api/system/config"
|
|
|
|
|
import {deepClone} from "@//utils/index";
|
|
|
|
@ -604,7 +604,10 @@ export default {
|
|
|
|
|
INTERNAL: '2',//对内生产
|
|
|
|
|
},
|
|
|
|
|
id: 1,
|
|
|
|
|
|
|
|
|
|
ATTACH_TYPE: {
|
|
|
|
|
DRAWING: "1",//附件类别:加工图纸
|
|
|
|
|
SOP: "2",//附件类别:SOP
|
|
|
|
|
},
|
|
|
|
|
processUsers: [],
|
|
|
|
|
//物料BOMList
|
|
|
|
|
attachInfoList: [],
|
|
|
|
@ -615,7 +618,6 @@ export default {
|
|
|
|
|
watch: {
|
|
|
|
|
'materialBomAttachIdList': {
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
console.log("val:",newVal,oldVal)
|
|
|
|
|
this.updateAttachInfoByBom(newVal, oldVal);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
@ -804,21 +806,23 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.$set(data.children, data.children.length, {
|
|
|
|
|
id: id,
|
|
|
|
|
dispatchCode: scope.row.dispatchCode,
|
|
|
|
|
processId: scope.row.processId,
|
|
|
|
|
productionTime: scope.row.productionTime,
|
|
|
|
|
materialBomId: scope.row.materialBomId,
|
|
|
|
|
planStatus: this.PLAN_STATUS.DISPATCHED,
|
|
|
|
|
userId: ""
|
|
|
|
|
userId: null
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$set(data, 'children', [
|
|
|
|
|
{
|
|
|
|
|
id: id,
|
|
|
|
|
dispatchCode: scope.row.dispatchCode,
|
|
|
|
|
processId: scope.row.processId,
|
|
|
|
|
productionTime: scope.row.productionTime,
|
|
|
|
|
materialBomId: scope.row.materialBomId,
|
|
|
|
|
planStatus: this.PLAN_STATUS.DISPATCHED,
|
|
|
|
|
userId: "",
|
|
|
|
|
userId: null,
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
@ -901,8 +905,8 @@ export default {
|
|
|
|
|
toUpdatedProductPlan.planEndTime = processUser.planEndTime;
|
|
|
|
|
toUpdatedProductPlan.planId = processUser.planId;
|
|
|
|
|
toUpdatedProductPlan.planStatus = processUser.planStatus;
|
|
|
|
|
toUpdatedProductPlan.attachId = e.attachId;
|
|
|
|
|
toUpdatedProductPlan.sopId = e.sopId;
|
|
|
|
|
toUpdatedProductPlan.attachId = processUser.attachId;
|
|
|
|
|
toUpdatedProductPlan.sopId = processUser.sopId;
|
|
|
|
|
toUpdatedProductPlan.planAmount = planDispatchAmount;
|
|
|
|
|
toUpdatedProductPlan.dispatchAmount = planDispatchAmount;
|
|
|
|
|
toUpdatedProductPlan.children = null;
|
|
|
|
@ -1117,11 +1121,12 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
obj.children = [{
|
|
|
|
|
id: this.id,
|
|
|
|
|
dispatchCode: obj.dispatchCode,
|
|
|
|
|
processId: obj.processId,
|
|
|
|
|
materialBomId: obj.materialBomId,
|
|
|
|
|
planStatus: this.PLAN_STATUS.DISPATCHED,
|
|
|
|
|
productionTime: obj.productionTime,
|
|
|
|
|
userId: ""
|
|
|
|
|
userId: null
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1166,10 +1171,10 @@ export default {
|
|
|
|
|
/** 查看图纸 */
|
|
|
|
|
handleDrawing(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
if (row.planId != null && (!this.previewDrawingFlag[row.dispatchCode + "-" + row.processId]
|
|
|
|
|
|| this.previewDrawingFlag[row.dispatchCode + "-" + row.processId] !== "1")) {
|
|
|
|
|
this.previewDrawingFlag[row.dispatchCode + "-" + row.processId] = "1";
|
|
|
|
|
getDispatchDrawingList(row.dispatchCode, row.processId).then(res => {
|
|
|
|
|
if (row.planId != null && (!this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
|
|
|
|
|
|| this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
|
|
|
|
|
this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
|
|
|
|
|
getAttachInfoList(this.ATTACH_TYPE.DRAWING, row.dispatchCode, row.processId, row.userId).then(res => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
@ -1183,19 +1188,19 @@ export default {
|
|
|
|
|
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 groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].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);
|
|
|
|
|
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (this.groupAttachFileList[row.dispatchCode + "-" + row.processId]) {
|
|
|
|
|
this.groupAttachFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
|
|
|
|
|
if (this.groupAttachFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
|
|
|
|
|
this.groupAttachFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
@ -1206,7 +1211,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.materialBomAttachIdList = [];
|
|
|
|
|
getBomAttachInfo("1", this.addProductPlanObject.materialBomId).then(response => {
|
|
|
|
|
getBomAttachInfo(this.ATTACH_TYPE.DRAWING, 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);
|
|
|
|
@ -1222,9 +1227,12 @@ export default {
|
|
|
|
|
drawingFileUploadSubmit() {
|
|
|
|
|
for (let i = 0; i < this.mesProductPlanList.length; i++) {
|
|
|
|
|
let mesProductPlan = this.mesProductPlanList[i];
|
|
|
|
|
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
|
|
|
|
|
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
|
|
|
|
|
this.mesProductPlanList[i].attachId = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].join(",");
|
|
|
|
|
for (let child of mesProductPlan.children) {
|
|
|
|
|
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
|
|
|
|
|
&& mesProductPlan.processId === this.addProductPlanObject.processId
|
|
|
|
|
&& child.userId === this.addProductPlanObject.userId) {
|
|
|
|
|
child.attachId = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].join(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// this.uploadAttachList = [];
|
|
|
|
@ -1240,12 +1248,12 @@ export default {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", fileData);
|
|
|
|
|
formData.append("processId", this.addProductPlanObject.processId);
|
|
|
|
|
formData.append("attachType", "1");
|
|
|
|
|
formData.append("attachType", this.ATTACH_TYPE.DRAWING);
|
|
|
|
|
uploadFile(formData).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
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(res.attachId);
|
|
|
|
|
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(res.attachId);
|
|
|
|
|
|
|
|
|
|
// 存储附件信息主键
|
|
|
|
|
let groupAttachFile = {};
|
|
|
|
@ -1254,9 +1262,9 @@ export default {
|
|
|
|
|
groupAttachFile.attachId = res.attachId;
|
|
|
|
|
groupAttachFile.attachPath = res.imgUrl;
|
|
|
|
|
groupAttachFile.attachName = res.fileName;
|
|
|
|
|
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 groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupAttachFile);
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
@ -1269,10 +1277,10 @@ export default {
|
|
|
|
|
handleRemoveDrawing(file) {
|
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
|
|
|
|
|
// this.uploadAttachList.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 + "-" + this.addProductPlanObject.userId].splice(index, 1);
|
|
|
|
|
let num = 0;
|
|
|
|
|
arrPic.map((item) => {
|
|
|
|
|
if (item.uid === file.uid) {
|
|
|
|
@ -1290,10 +1298,10 @@ export default {
|
|
|
|
|
/** 查看sop */
|
|
|
|
|
handleSop(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
if (row.planId != null && (!this.previewSopFlag[row.dispatchCode + "-" + row.processId]
|
|
|
|
|
|| this.previewSopFlag[row.dispatchCode + "-" + row.processId] !== "1")) {
|
|
|
|
|
this.previewSopFlag[row.dispatchCode + "-" + row.processId] = "1";
|
|
|
|
|
getDispatchSOPAttachList(row.dispatchCode, row.processId).then(res => {
|
|
|
|
|
if (row.planId != null && (!this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
|
|
|
|
|
|| this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
|
|
|
|
|
this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
|
|
|
|
|
getAttachInfoList(this.ATTACH_TYPE.SOP, row.dispatchCode, row.processId, row.userId).then(res => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
@ -1307,19 +1315,19 @@ export default {
|
|
|
|
|
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 groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].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);
|
|
|
|
|
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId]) {
|
|
|
|
|
this.groupSopFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
|
|
|
|
|
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
|
|
|
|
|
this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
@ -1330,7 +1338,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.materialBomAttachIdList = [];
|
|
|
|
|
getBomAttachInfo("2", this.addProductPlanObject.materialBomId).then(response => {
|
|
|
|
|
getBomAttachInfo(this.ATTACH_TYPE.SOP, 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);
|
|
|
|
@ -1346,10 +1354,12 @@ export default {
|
|
|
|
|
sopFileUploadSubmit() {
|
|
|
|
|
for (let i = 0; i < this.mesProductPlanList.length; i++) {
|
|
|
|
|
let mesProductPlan = this.mesProductPlanList[i];
|
|
|
|
|
|
|
|
|
|
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
|
|
|
|
|
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
|
|
|
|
|
this.mesProductPlanList[i].sopId = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].join(",");
|
|
|
|
|
for (let child of mesProductPlan.children) {
|
|
|
|
|
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
|
|
|
|
|
&& mesProductPlan.processId === this.addProductPlanObject.processId
|
|
|
|
|
&& child.userId === this.addProductPlanObject.userId) {
|
|
|
|
|
child.sopId = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].join(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// this.uploadAttachList = [];
|
|
|
|
@ -1365,12 +1375,12 @@ export default {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", fileData);
|
|
|
|
|
formData.append("processId", this.addProductPlanObject.processId);
|
|
|
|
|
formData.append("attachType", "2");
|
|
|
|
|
formData.append("attachType", this.ATTACH_TYPE.SOP);
|
|
|
|
|
uploadFile(formData).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
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(res.attachId);
|
|
|
|
|
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(res.attachId);
|
|
|
|
|
|
|
|
|
|
// 存储附件信息主键
|
|
|
|
|
let groupSopFile = {};
|
|
|
|
@ -1379,9 +1389,9 @@ export default {
|
|
|
|
|
groupSopFile.attachId = res.attachId;
|
|
|
|
|
groupSopFile.attachPath = res.imgUrl;
|
|
|
|
|
groupSopFile.attachName = res.fileName;
|
|
|
|
|
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 groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
@ -1394,8 +1404,8 @@ export default {
|
|
|
|
|
handleRemoveSop(file) {
|
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].splice(index, 1);
|
|
|
|
|
this.fileList.splice(index, 1);
|
|
|
|
|
let num = 0;
|
|
|
|
|
arrPic.map((item) => {
|
|
|
|
@ -1505,12 +1515,12 @@ export default {
|
|
|
|
|
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);
|
|
|
|
|
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupAttachFile);
|
|
|
|
|
let uploadAttachList = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadAttachList ? this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//SOP
|
|
|
|
@ -1525,12 +1535,12 @@ export default {
|
|
|
|
|
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);
|
|
|
|
|
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
|
|
|
|
|
let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
|
|
|
|
|
this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|