|
|
|
@ -186,7 +186,7 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleDrawing(scope.row)"
|
|
|
|
|
|
|
|
|
|
v-if=" scope.row.userId != null"
|
|
|
|
|
>图纸
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
@ -194,7 +194,7 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="handleSop(scope.row)"
|
|
|
|
|
v-if="scope.row.processType !== PROCESS_TYPE.AUTO && scope.row.children != null && scope.row.children !== undefined"
|
|
|
|
|
v-if=" scope.row.userId != null"
|
|
|
|
|
>SOP
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
@ -238,12 +238,13 @@
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="blueprintModel"
|
|
|
|
|
title="上传图纸"
|
|
|
|
|
title="选择图纸"
|
|
|
|
|
width="30%"
|
|
|
|
|
@before-close="blueprintModel = false">
|
|
|
|
|
<el-form ref="form">
|
|
|
|
|
<el-form-item label="选择BOM图纸">
|
|
|
|
|
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM图纸" multiple filterable :clearable="false" :disabled="!(nowRow.processType !== PROCESS_TYPE.AUTO && nowRow.children != null && nowRow.children !== undefined)">
|
|
|
|
|
<el-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM图纸" multiple filterable :clearable="false"
|
|
|
|
|
:disabled="(addProductPlanObject.planStatus !== PLAN_STATUS.DISPATCHED)">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in attachInfoList"
|
|
|
|
|
:key="item.attachId"
|
|
|
|
@ -292,7 +293,7 @@
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleRemoveDrawing(file)"
|
|
|
|
|
v-if="nowRow.processType !== PROCESS_TYPE.AUTO && nowRow.children != null && nowRow.children !== undefined"
|
|
|
|
|
v-if="addProductPlanObject.planStatus === PLAN_STATUS.DISPATCHED"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
@ -308,12 +309,13 @@
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="sopViewModel"
|
|
|
|
|
title="上传SOP附件"
|
|
|
|
|
title="选择SOP"
|
|
|
|
|
width="30%"
|
|
|
|
|
@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-select v-model="materialBomAttachIdList" placeholder="请选择选择BOM的SOP" multiple filterable :clearable="false"
|
|
|
|
|
:disabled="(addProductPlanObject.planStatus !== PLAN_STATUS.DISPATCHED)">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in attachInfoList"
|
|
|
|
|
:key="item.attachId"
|
|
|
|
@ -362,6 +364,7 @@
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleRemoveSop(file)"
|
|
|
|
|
v-if="addProductPlanObject.planStatus === PLAN_STATUS.DISPATCHED"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
@ -370,12 +373,12 @@
|
|
|
|
|
</el-upload>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<!-- 上传提示 -->
|
|
|
|
|
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
|
|
|
|
|
请上传
|
|
|
|
|
<template v-if="sopFileSize"> 大小不超过 <b style="color: #f56c6c">{{ sopFileSize }}MB</b></template>
|
|
|
|
|
<template v-if="sopFileType"> 格式为 <b style="color: #f56c6c">{{ sopFileType.join("/") }}</b></template>
|
|
|
|
|
的文件
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="el-upload__tip" slot="tip" v-if="isShowTip">-->
|
|
|
|
|
<!-- 请上传-->
|
|
|
|
|
<!-- <template v-if="sopFileSize"> 大小不超过 <b style="color: #f56c6c">{{ sopFileSize }}MB</b></template>-->
|
|
|
|
|
<!-- <template v-if="sopFileType"> 格式为 <b style="color: #f56c6c">{{ sopFileType.join("/") }}</b></template>-->
|
|
|
|
|
<!-- 的文件-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<el-button type="primary" @click="sopFileUploadSubmit">确 定</el-button>
|
|
|
|
|
<el-button @click="sopViewModel = false">取 消</el-button>
|
|
|
|
|
</span>
|
|
|
|
@ -406,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";
|
|
|
|
@ -477,7 +480,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
nowRow:{},
|
|
|
|
|
blueprintModel: false,
|
|
|
|
|
sopViewModel: false,
|
|
|
|
|
pictureDetailModel: false,
|
|
|
|
@ -602,7 +604,10 @@ export default {
|
|
|
|
|
INTERNAL: '2',//对内生产
|
|
|
|
|
},
|
|
|
|
|
id: 1,
|
|
|
|
|
|
|
|
|
|
ATTACH_TYPE: {
|
|
|
|
|
DRAWING: "1",//附件类别:加工图纸
|
|
|
|
|
SOP: "2",//附件类别:SOP
|
|
|
|
|
},
|
|
|
|
|
processUsers: [],
|
|
|
|
|
//物料BOMList
|
|
|
|
|
attachInfoList: [],
|
|
|
|
@ -613,7 +618,6 @@ export default {
|
|
|
|
|
watch: {
|
|
|
|
|
'materialBomAttachIdList': {
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
console.log("val:",newVal,oldVal)
|
|
|
|
|
this.updateAttachInfoByBom(newVal, oldVal);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
@ -734,6 +738,8 @@ export default {
|
|
|
|
|
obj.processOrder = groupedProductPlan.processOrder;
|
|
|
|
|
obj.displayFlag = groupedProductPlan.displayFlag;
|
|
|
|
|
obj.finalProcessFlag = groupedProductPlan.finalProcessFlag;
|
|
|
|
|
obj.attachId = groupedProductPlan.attachId;
|
|
|
|
|
obj.sopId = groupedProductPlan.sopId;
|
|
|
|
|
|
|
|
|
|
obj.planBeginTime = this.form.planBeginTime;
|
|
|
|
|
obj.planEndTime = this.form.planEndTime;
|
|
|
|
@ -800,19 +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,
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
@ -895,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;
|
|
|
|
@ -1111,9 +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
|
|
|
|
|
productionTime: obj.productionTime,
|
|
|
|
|
userId: null
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1158,10 +1171,10 @@ export default {
|
|
|
|
|
/** 查看图纸 */
|
|
|
|
|
handleDrawing(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
if (row.oldRowFlag && (!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 = {};
|
|
|
|
@ -1175,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;
|
|
|
|
@ -1198,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);
|
|
|
|
@ -1214,14 +1227,16 @@ 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 = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.addProductPlanObject = {};
|
|
|
|
|
this.blueprintModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1233,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 = {};
|
|
|
|
@ -1247,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(); //上传失败后清除当前上传的图片
|
|
|
|
@ -1262,11 +1277,10 @@ export default {
|
|
|
|
|
handleRemoveDrawing(file) {
|
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
|
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 + "-" + 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) {
|
|
|
|
@ -1281,25 +1295,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查看sop */
|
|
|
|
|
handleSop(row) {
|
|
|
|
|
this.nowRow = row
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
if (row.oldRowFlag && (!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 = {};
|
|
|
|
@ -1313,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;
|
|
|
|
@ -1336,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);
|
|
|
|
@ -1352,14 +1354,16 @@ 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 = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.addProductPlanObject = {};
|
|
|
|
|
this.sopViewModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1371,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 = {};
|
|
|
|
@ -1385,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(); //上传失败后清除当前上传的图片
|
|
|
|
@ -1400,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) => {
|
|
|
|
@ -1511,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
|
|
|
|
@ -1531,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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|