|
|
|
@ -192,7 +192,7 @@
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="handleSOP(scope.row)"
|
|
|
|
|
@click="handleSop(scope.row)"
|
|
|
|
|
v-if="scope.row.processType !== PROCESS_TYPE.AUTO && scope.row.children != null && scope.row.children !== undefined"
|
|
|
|
|
>SOP
|
|
|
|
|
</el-button>
|
|
|
|
@ -242,9 +242,9 @@
|
|
|
|
|
single
|
|
|
|
|
ref="drawingUpload"
|
|
|
|
|
list-type="picture-card"
|
|
|
|
|
action="uploadImgUrl"
|
|
|
|
|
action="uploadDrawingUrl"
|
|
|
|
|
:auto-upload="true"
|
|
|
|
|
:limit="limit"
|
|
|
|
|
:limit="drawingLimit"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
|
:http-request="httpRequest"
|
|
|
|
@ -275,7 +275,7 @@
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleRemove(file)"
|
|
|
|
|
@click="handleRemoveDrawing(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
@ -306,7 +306,7 @@
|
|
|
|
|
list-type="picture-card"
|
|
|
|
|
action="uploadImgUrl"
|
|
|
|
|
:auto-upload="true"
|
|
|
|
|
:limit="limit"
|
|
|
|
|
:limit="sopLimit"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
|
:http-request="httpSopRequest"
|
|
|
|
@ -337,7 +337,7 @@
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleRemove(file)"
|
|
|
|
|
@click="handleRemoveSop(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
@ -423,15 +423,22 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
value: [String, Object, Array, Number],
|
|
|
|
|
// 文件数量限制
|
|
|
|
|
limit: {
|
|
|
|
|
// sop文件数量限制
|
|
|
|
|
sopLimit: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 10,
|
|
|
|
|
},
|
|
|
|
|
// 图纸数量限制
|
|
|
|
|
drawingLimit: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 3,
|
|
|
|
|
default: 10,
|
|
|
|
|
},
|
|
|
|
|
// 文件大小限制(MB)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文件大小限制(K)
|
|
|
|
|
fileSize: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 5,
|
|
|
|
|
default: 500000,
|
|
|
|
|
},
|
|
|
|
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
|
|
fileType: {
|
|
|
|
@ -456,6 +463,7 @@ export default {
|
|
|
|
|
checkedMesProductPlanList: [],
|
|
|
|
|
// 上传的文件服务器地址
|
|
|
|
|
uploadImgUrl: process.env.VUE_APP_BASE_API,
|
|
|
|
|
uploadDrawingUrl: process.env.VUE_APP_BASE_API + "/file/upload2SharePath",
|
|
|
|
|
// 选中选项卡的 name
|
|
|
|
|
activeName: "columnInfo",
|
|
|
|
|
// 表格的高度
|
|
|
|
@ -509,15 +517,19 @@ export default {
|
|
|
|
|
// 根据工序和派工单号分组Sop文件
|
|
|
|
|
groupSopFile: {},
|
|
|
|
|
// 根据工序和派工单号分组Sop文件列表
|
|
|
|
|
groupSopFileList: [],
|
|
|
|
|
groupSopFileList: {},
|
|
|
|
|
// 上传SOP文件回调列表
|
|
|
|
|
uploadSopList: [],
|
|
|
|
|
|
|
|
|
|
// 根据工序和派工单号分组图纸文件
|
|
|
|
|
groupAttachFile: {},
|
|
|
|
|
// 根据工序和派工单号分组图纸文件列表
|
|
|
|
|
groupAttachFileList: [],
|
|
|
|
|
groupAttachFileList: {},
|
|
|
|
|
// 上传图纸文件回调列表
|
|
|
|
|
uploadAttachList: [],
|
|
|
|
|
// 上传SOP文件回调列表
|
|
|
|
|
uploadSopList: [],
|
|
|
|
|
uploadAttachList: {},
|
|
|
|
|
|
|
|
|
|
previewSopFlag: {},//是否预览过SOP
|
|
|
|
|
previewDrawingFlag: {},//是否预览过图纸
|
|
|
|
|
//文件上传-生产派工对象
|
|
|
|
|
addProductPlanObject: {},
|
|
|
|
|
headers: {
|
|
|
|
@ -768,10 +780,10 @@ export default {
|
|
|
|
|
|
|
|
|
|
if (processUser.userId && processUser.userId !== '') {
|
|
|
|
|
toUpdatedProductPlan.userId = processUser.userId;
|
|
|
|
|
if(processUser.planBeginTime && processUser.planBeginTime!=='' &&
|
|
|
|
|
processUser.planEndTime && processUser.planEndTime!=='' &&
|
|
|
|
|
processUser.planBeginTime >= processUser.planEndTime){
|
|
|
|
|
this.$modal.msgError("序号"+(parseInt(e.index)+1)+":计划开始时间须小于计划结束时间");
|
|
|
|
|
if (processUser.planBeginTime && processUser.planBeginTime !== '' &&
|
|
|
|
|
processUser.planEndTime && processUser.planEndTime !== '' &&
|
|
|
|
|
processUser.planBeginTime >= processUser.planEndTime) {
|
|
|
|
|
this.$modal.msgError("序号" + (parseInt(e.index) + 1) + ":计划开始时间须小于计划结束时间");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
toUpdatedProductPlan.planBeginTime = processUser.planBeginTime;
|
|
|
|
@ -802,11 +814,11 @@ export default {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(e.firstFlag && e.firstFlag==="1"){//第一个标识,校验派工数量
|
|
|
|
|
if (e.firstFlag && e.firstFlag === "1") {//第一个标识,校验派工数量
|
|
|
|
|
let dispatchAmount = e.dispatchAmount;
|
|
|
|
|
const numericAmount = parseInt(dispatchAmount, 10);
|
|
|
|
|
if (!this.isPositiveInteger(numericAmount) || numericAmount <= 0) {
|
|
|
|
|
this.$modal.msgError( "派工数量须为大于等于0的正整数!");
|
|
|
|
|
this.$modal.msgError("派工数量须为大于等于0的正整数!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1045,11 +1057,13 @@ export default {
|
|
|
|
|
window.open(file.url);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查看图纸 */
|
|
|
|
|
handleDrawing(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.uploadAttachList = [];
|
|
|
|
|
if (row.oldRowFlag) {
|
|
|
|
|
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 => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
@ -1057,52 +1071,36 @@ export default {
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
this.uploadAttachList.push(e.attachId);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.groupAttachFileList.forEach(e => {
|
|
|
|
|
if (e.dispatchCode === row.dispatchCode && e.processId === row.processId) {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
this.uploadAttachList.push(e.attachId);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.blueprintModel = true;
|
|
|
|
|
},
|
|
|
|
|
let groupAttachFile = {};
|
|
|
|
|
groupAttachFile.dispatchCode = row.dispatchCode;
|
|
|
|
|
groupAttachFile.processId = row.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);
|
|
|
|
|
|
|
|
|
|
/** 查看SOP附件 */
|
|
|
|
|
handleSOP(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.uploadSopList = [];
|
|
|
|
|
if (row.oldRowFlag) {
|
|
|
|
|
getDispatchSOPAttachList(row.dispatchCode, row.processId).then(res => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
|
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 {
|
|
|
|
|
if (this.groupAttachFileList[row.dispatchCode + "-" + row.processId]) {
|
|
|
|
|
this.groupAttachFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
this.uploadSopList.push(e.attachId);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.groupSopFileList.forEach(e => {
|
|
|
|
|
if (e.dispatchCode === row.dispatchCode && e.processId === row.processId) {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
this.uploadSopList.push(e.attachId);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.sopViewModel = true;
|
|
|
|
|
this.blueprintModel = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//添加图纸提交
|
|
|
|
@ -1112,28 +1110,14 @@ export default {
|
|
|
|
|
|
|
|
|
|
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
|
|
|
|
|
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
|
|
|
|
|
this.mesProductPlanList[i].attachId = this.uploadAttachList.join(",");
|
|
|
|
|
this.mesProductPlanList[i].attachId = this.uploadAttachList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].join(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.uploadAttachList = [];
|
|
|
|
|
// this.uploadAttachList = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.blueprintModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//添加SOP附件提交
|
|
|
|
|
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.join(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.uploadSopList = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.sopViewModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//图纸图片上传
|
|
|
|
|
httpRequest(file) {
|
|
|
|
@ -1145,6 +1129,10 @@ export default {
|
|
|
|
|
formData.append("attachType", "1");
|
|
|
|
|
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 groupAttachFile = {};
|
|
|
|
|
groupAttachFile.dispatchCode = this.addProductPlanObject.dispatchCode;
|
|
|
|
@ -1152,8 +1140,9 @@ export default {
|
|
|
|
|
groupAttachFile.attachId = res.attachId;
|
|
|
|
|
groupAttachFile.attachPath = res.imgUrl;
|
|
|
|
|
groupAttachFile.attachName = res.fileName;
|
|
|
|
|
this.groupAttachFileList.push(groupAttachFile);
|
|
|
|
|
this.uploadAttachList.push(res.attachId);
|
|
|
|
|
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);
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
@ -1161,17 +1150,110 @@ 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.splice(index, 1);
|
|
|
|
|
// this.fileList.splice(index, 1);
|
|
|
|
|
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].splice(index, 1);
|
|
|
|
|
let num = 0;
|
|
|
|
|
arrPic.map((item) => {
|
|
|
|
|
if (item.uid === file.uid) {
|
|
|
|
|
arrPic.splice(num, 1);
|
|
|
|
|
}
|
|
|
|
|
num++;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//SOP图片上传
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查看sop */
|
|
|
|
|
handleSop(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 => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
|
|
|
|
|
let groupSopFile = {};
|
|
|
|
|
groupSopFile.dispatchCode = row.dispatchCode;
|
|
|
|
|
groupSopFile.processId = row.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);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId]) {
|
|
|
|
|
this.groupSopFileList[row.dispatchCode + "-" + row.processId].forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.sopViewModel = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//添加sop提交
|
|
|
|
|
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(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// this.uploadAttachList = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.sopViewModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Sop图片上传
|
|
|
|
|
httpSopRequest(file) {
|
|
|
|
|
// 文件信息
|
|
|
|
|
const fileData = file.file;
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", fileData);
|
|
|
|
|
formData.append("processId", this.addProductPlanObject.processId);
|
|
|
|
|
formData.append("attachType", "1");
|
|
|
|
|
formData.append("attachType", "2");
|
|
|
|
|
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 groupSopFile = {};
|
|
|
|
|
groupSopFile.dispatchCode = this.addProductPlanObject.dispatchCode;
|
|
|
|
@ -1179,8 +1261,9 @@ export default {
|
|
|
|
|
groupSopFile.attachId = res.attachId;
|
|
|
|
|
groupSopFile.attachPath = res.imgUrl;
|
|
|
|
|
groupSopFile.attachName = res.fileName;
|
|
|
|
|
this.groupSopFileList.push(groupSopFile);
|
|
|
|
|
this.uploadSopList.push(res.attachId);
|
|
|
|
|
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);
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
@ -1188,21 +1271,12 @@ export default {
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 上传结束处理
|
|
|
|
|
uploadedSuccessfully() {
|
|
|
|
|
if (this.number > 0 && this.uploadList.length === this.number) {
|
|
|
|
|
this.fileList = this.fileList.concat(this.uploadList);
|
|
|
|
|
this.uploadList = [];
|
|
|
|
|
this.number = 0;
|
|
|
|
|
this.form.monitorPic = this.fileList[0];
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//删除上传的图片
|
|
|
|
|
handleRemove(file) {
|
|
|
|
|
handleRemoveSop(file) {
|
|
|
|
|
let arrPic = this.$refs.drawingUpload.uploadFiles;
|
|
|
|
|
let index = arrPic.indexOf(file);
|
|
|
|
|
this.uploadList.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);
|
|
|
|
|
let num = 0;
|
|
|
|
|
arrPic.map((item) => {
|
|
|
|
|
if (item.uid === file.uid) {
|
|
|
|
@ -1211,6 +1285,11 @@ export default {
|
|
|
|
|
num++;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 上传前loading加载
|
|
|
|
|
handleBeforeUpload(file) {
|
|
|
|
|
// let isImg = false;
|
|
|
|
|