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