|
|
|
@ -92,7 +92,7 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
|
|
|
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
@ -101,6 +101,13 @@
|
|
|
|
|
@click="handleDrawing(scope.row)"
|
|
|
|
|
>图纸
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="handleSOP(scope.row)"
|
|
|
|
|
>SOP
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -174,6 +181,68 @@
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="sopViewModel"
|
|
|
|
|
title="上传SOP附件"
|
|
|
|
|
width="30%"
|
|
|
|
|
@before-close="sopViewModel = false">
|
|
|
|
|
<el-upload
|
|
|
|
|
single
|
|
|
|
|
ref="drawingUpload"
|
|
|
|
|
list-type="picture-card"
|
|
|
|
|
action="uploadImgUrl"
|
|
|
|
|
:auto-upload="true"
|
|
|
|
|
:limit="limit"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
|
:http-request="httpRequest"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
>
|
|
|
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
|
|
|
<div slot="file" slot-scope="{file}">
|
|
|
|
|
<img
|
|
|
|
|
v-if="isAssetTypeAnImage(file.name)"
|
|
|
|
|
:alt="file.name"
|
|
|
|
|
:src="file.url" class="el-upload-list__item-thumbnail"
|
|
|
|
|
>
|
|
|
|
|
<span v-else>{{ file.name }}</span>
|
|
|
|
|
<span class="el-upload-list__item-actions">
|
|
|
|
|
<span
|
|
|
|
|
v-if="isAssetTypeAnImage(file.name)"
|
|
|
|
|
class="el-upload-list__item-preview"
|
|
|
|
|
@click="handlePictureCardPreview(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-zoom-in"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleDownload(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-download"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleRemove(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<!-- 上传提示 -->
|
|
|
|
|
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
|
|
|
|
|
请上传
|
|
|
|
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
|
|
|
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
|
|
|
|
|
的文件
|
|
|
|
|
</div>
|
|
|
|
|
<el-button type="primary" @click="sopFileUploadSubmit">确 定</el-button>
|
|
|
|
|
<el-button @click="sopViewModel = false">取 消</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="pictureDetailModel"
|
|
|
|
|
title="图纸预览"
|
|
|
|
@ -193,7 +262,7 @@
|
|
|
|
|
import {getProductOrder, updateProductOrder} from "@//api/mes/productOrder";
|
|
|
|
|
import {
|
|
|
|
|
delProductplan,
|
|
|
|
|
getDispatchCode, getDispatchDrawingList,
|
|
|
|
|
getDispatchCode, getDispatchDrawingList, getDispatchSOPAttachList,
|
|
|
|
|
getProductPlan,
|
|
|
|
|
orderAddMesProductPlanList,
|
|
|
|
|
updateProductplan,
|
|
|
|
@ -231,6 +300,7 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
blueprintModel: false,
|
|
|
|
|
sopViewModel: false,
|
|
|
|
|
pictureDetailModel: false,
|
|
|
|
|
// 图片预览地址
|
|
|
|
|
dialogImageUrl: '',
|
|
|
|
@ -417,7 +487,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 关闭按钮 */
|
|
|
|
|
close() {
|
|
|
|
|
const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), pageNum: this.$route.query.pageNum}};
|
|
|
|
|
const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), queryParams: this.$route.query.queryParams}};
|
|
|
|
|
this.$tab.closeOpenPage(obj);
|
|
|
|
|
},
|
|
|
|
|
/** 查看图纸 */
|
|
|
|
@ -439,6 +509,27 @@ export default {
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.blueprintModel = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查看SOP附件 */
|
|
|
|
|
handleSOP(row) {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.uploadList = [];
|
|
|
|
|
if (row.planId != null) {
|
|
|
|
|
getDispatchSOPAttachList(row.planId).then(res => {
|
|
|
|
|
let attachList = res.data;
|
|
|
|
|
attachList.forEach(e => {
|
|
|
|
|
let previewFile = {};
|
|
|
|
|
previewFile.url = e.attachPath;
|
|
|
|
|
previewFile.name = e.attachName;
|
|
|
|
|
this.fileList.push(previewFile);
|
|
|
|
|
this.uploadList.push(e.attachId);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.addProductPlanObject = row;
|
|
|
|
|
this.sopViewModel = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 生产计划添加按钮操作 */
|
|
|
|
|
handleAddMesProductPlan() {
|
|
|
|
|
let dispatchCode = "";
|
|
|
|
@ -449,7 +540,7 @@ export default {
|
|
|
|
|
this.$modal.msgError("工艺路线未维护工位信息!");
|
|
|
|
|
}
|
|
|
|
|
let lastProcessId = null;
|
|
|
|
|
res.data.forEach(e => {
|
|
|
|
|
res.data.forEach((e, index) => {
|
|
|
|
|
let obj = {};
|
|
|
|
|
obj.dispatchCode = dispatchCode;
|
|
|
|
|
obj.processId = e.processId;
|
|
|
|
@ -471,8 +562,10 @@ export default {
|
|
|
|
|
obj.materialBomId = this.form.materialBomId;
|
|
|
|
|
obj.productOrderId = this.form.productOrderId;
|
|
|
|
|
// 上一工序ID
|
|
|
|
|
if (lastProcessId == null || lastProcessId === obj.processId) {
|
|
|
|
|
if (lastProcessId == null) {
|
|
|
|
|
obj.lastProcessId = 0;
|
|
|
|
|
} else if(lastProcessId === obj.processId){
|
|
|
|
|
obj.lastProcessId = this.mesProductPlanList[index - 1].lastProcessId;
|
|
|
|
|
} else {
|
|
|
|
|
obj.lastProcessId = lastProcessId;
|
|
|
|
|
}
|
|
|
|
@ -519,6 +612,30 @@ export default {
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.blueprintModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//添加SOP附件提交
|
|
|
|
|
sopFileUploadSubmit() {
|
|
|
|
|
// 新添加列标识 false=新添加,true=历史行
|
|
|
|
|
if (this.addProductPlanObject.oldRowFlag) {
|
|
|
|
|
updateProductplan({
|
|
|
|
|
planId: this.addProductPlanObject.planId,
|
|
|
|
|
sopId: this.uploadList.join(","),
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$modal.msgSuccess("上传SOP附件成功!");
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
for (let i = 0; i < this.mesProductPlanList.length; i++) {
|
|
|
|
|
if (this.mesProductPlanList[i].index === this.addProductPlanObject.index) {
|
|
|
|
|
this.mesProductPlanList[i].sopId = this.uploadList.join(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.uploadList = [];
|
|
|
|
|
this.addProductPlanObject = null;
|
|
|
|
|
this.sopViewModel = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//图片上传
|
|
|
|
|
httpRequest(file) {
|
|
|
|
|
// 文件信息
|
|
|
|
@ -526,6 +643,7 @@ export default {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", fileData);
|
|
|
|
|
formData.append("processId", this.addProductPlanObject.processId);
|
|
|
|
|
formData.append("attachType", "1");
|
|
|
|
|
uploadFile(formData).then(
|
|
|
|
|
(res) => {
|
|
|
|
|
// 存储附件信息主键
|
|
|
|
|