|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="任务编号:">{{ form.orderCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划开始时间:">{{ form.planBeginTime }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px">
|
|
|
|
|
{{
|
|
|
|
|
form.planAmount
|
|
|
|
@ -20,7 +20,7 @@
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品名称:">{{ form.materialName }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划结束时间:">{{ form.planEndTime }}</el-form-item>
|
|
|
|
|
<el-form-item label="任务状态:">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.plan_status" :value="form.orderStatus"/>
|
|
|
|
@ -149,7 +149,7 @@
|
|
|
|
|
|| scope.row.planStatus=== PLAN_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.RECALLED || form.orderStatus===ORDER_STATUS.DELETED"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择计划开始时间"
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd"
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -160,7 +160,7 @@
|
|
|
|
|
|| scope.row.planStatus=== PLAN_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.RECALLED || form.orderStatus===ORDER_STATUS.DELETED"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请选择计划完成时间"
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd"/>
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
@ -289,8 +289,8 @@
|
|
|
|
|
<!-- 上传提示 -->
|
|
|
|
|
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
|
|
|
|
|
请上传
|
|
|
|
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f67c7c">{{ fileSize }}MB</b></template>
|
|
|
|
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
|
|
|
|
|
<template v-if="drawingFileSize"> 大小不超过 <b style="color: #f67c7c">{{ drawingFileSize }}MB</b></template>
|
|
|
|
|
<template v-if="drawingFileType"> 格式为 <b style="color: #f56c6c">{{ drawingFileType.join("/") }}</b></template>
|
|
|
|
|
的文件
|
|
|
|
|
</div>
|
|
|
|
|
<el-button type="primary" @click="drawingFileUploadSubmit">确 定</el-button>
|
|
|
|
@ -351,8 +351,8 @@
|
|
|
|
|
<!-- 上传提示 -->
|
|
|
|
|
<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>
|
|
|
|
|
<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>
|
|
|
|
@ -393,6 +393,7 @@ import {
|
|
|
|
|
getProcessUsers,
|
|
|
|
|
uploadFile
|
|
|
|
|
} from "@//api/mes/productplan";
|
|
|
|
|
import {getConfigKey} from "@//api/system/config"
|
|
|
|
|
import {deepClone} from "@//utils/index";
|
|
|
|
|
import {getToken} from "@//utils/auth";
|
|
|
|
|
import applyRawOutstock from '@//views/wms/common/applyRawOutstock.vue';
|
|
|
|
@ -429,25 +430,17 @@ export default {
|
|
|
|
|
// sop文件数量限制
|
|
|
|
|
sopLimit: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 10,
|
|
|
|
|
default: 20,
|
|
|
|
|
},
|
|
|
|
|
// 图纸数量限制
|
|
|
|
|
drawingLimit: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 10,
|
|
|
|
|
default: 20,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文件大小限制(K)
|
|
|
|
|
fileSize: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 500,
|
|
|
|
|
},
|
|
|
|
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
|
|
fileType: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => ["png", "jpg", "jpeg"],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 是否显示提示
|
|
|
|
|
isShowTip: {
|
|
|
|
|
type: Boolean,
|
|
|
|
@ -533,6 +526,17 @@ export default {
|
|
|
|
|
|
|
|
|
|
previewSopFlag: {},//是否预览过SOP
|
|
|
|
|
previewDrawingFlag: {},//是否预览过图纸
|
|
|
|
|
|
|
|
|
|
// SOP文件大小限制(MB)
|
|
|
|
|
sopFileSize: 50,
|
|
|
|
|
// SOP文件类型,
|
|
|
|
|
sopFileType: ["png", "jpg", "jpeg"],
|
|
|
|
|
|
|
|
|
|
// 图纸文件大小限制(MB)
|
|
|
|
|
drawingFileSize: 50,
|
|
|
|
|
// 图纸文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
|
|
drawingFileType: ["dxf", "dwg"],
|
|
|
|
|
|
|
|
|
|
//文件上传-生产派工对象
|
|
|
|
|
addProductPlanObject: {},
|
|
|
|
|
headers: {
|
|
|
|
@ -583,9 +587,37 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getConfigValues();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getConfigValues(){
|
|
|
|
|
//图纸支持格式
|
|
|
|
|
getConfigKey("mes.drawing.allowedExtension").then(res => {
|
|
|
|
|
if(res.msg){
|
|
|
|
|
this.drawingFileType = res.msg.split(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getConfigKey("mes.drawing.maxSize").then(res => {
|
|
|
|
|
if(res.msg){
|
|
|
|
|
this.drawingFileSize = res.msg;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getConfigKey("mes.sop.allowedExtension").then(res => {
|
|
|
|
|
if(res.msg){
|
|
|
|
|
this.sopFileType = res.msg.split(",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getConfigKey("mes.sop.maxSize").then(res => {
|
|
|
|
|
if(res.msg){
|
|
|
|
|
this.sopFileSize = res.msg;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getProcessUsers(productOrderId) {
|
|
|
|
|
getProcessUsers(this.form.dispatchId).then(res => {
|
|
|
|
|
res.data.forEach(processUser => {
|
|
|
|
@ -800,6 +832,17 @@ export default {
|
|
|
|
|
|
|
|
|
|
if (processUser.userId && processUser.userId !== '') {
|
|
|
|
|
toUpdatedProductPlan.userId = processUser.userId;
|
|
|
|
|
if (processUser.planBeginTime && processUser.planBeginTime !== '' &&
|
|
|
|
|
(processUser.planBeginTime < this.form.planBeginTime || processUser.planBeginTime > this.form.planEndTime)){
|
|
|
|
|
this.$modal.msgError("序号" + (parseInt(e.index) + 1) + ":计划开始时间不在生产工单时间范围内");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (processUser.planEndTime && processUser.planEndTime !== '' &&
|
|
|
|
|
(processUser.planEndTime < this.form.planBeginTime || processUser.planEndTime > this.form.planEndTime)) {
|
|
|
|
|
this.$modal.msgError("序号" + (parseInt(e.index) + 1) + ":计划结束时间不在生产工单时间范围内");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (processUser.planBeginTime && processUser.planBeginTime !== '' &&
|
|
|
|
|
processUser.planEndTime && processUser.planEndTime !== '' &&
|
|
|
|
|
processUser.planBeginTime >= processUser.planEndTime) {
|
|
|
|
@ -1154,6 +1197,7 @@ export default {
|
|
|
|
|
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.$modal.closeLoading();
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
@ -1275,6 +1319,7 @@ export default {
|
|
|
|
|
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);
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
}, (err) => {
|
|
|
|
|
this.$refs.drawingUpload.clearFiles(); //上传失败后清除当前上传的图片
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
@ -1303,34 +1348,43 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 上传前loading加载
|
|
|
|
|
handleBeforeUpload(file) {
|
|
|
|
|
// let isImg = false;
|
|
|
|
|
// if (this.fileType.length) {
|
|
|
|
|
// let fileExtension = "";
|
|
|
|
|
// if (file.name.lastIndexOf(".") > -1) {
|
|
|
|
|
// fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
|
|
|
|
// }
|
|
|
|
|
// isImg = this.fileType.some(type => {
|
|
|
|
|
// if (file.type.indexOf(type) > -1) return true;
|
|
|
|
|
// if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
|
|
|
|
// return false;
|
|
|
|
|
// });
|
|
|
|
|
// } else {
|
|
|
|
|
// isImg = file.type.indexOf("image") > -1;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (!isImg) {
|
|
|
|
|
// this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// if (this.fileSize) {
|
|
|
|
|
// const isLt = file.size / 1024 / 1024 < this.fileSize;
|
|
|
|
|
// if (!isLt) {
|
|
|
|
|
// this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// this.$modal.loading("正在上传图片,请稍候...");
|
|
|
|
|
// this.number++;
|
|
|
|
|
let fileType,fileSize;
|
|
|
|
|
if(this.sopViewModel){
|
|
|
|
|
fileType = this.sopFileType;
|
|
|
|
|
fileSize = this.sopFileSize;
|
|
|
|
|
}else if(this.blueprintModel){
|
|
|
|
|
fileType = this.drawingFileType;
|
|
|
|
|
fileSize = this.drawingFileSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let isImg = false;
|
|
|
|
|
if (fileType.length) {
|
|
|
|
|
let fileExtension = "";
|
|
|
|
|
if (file.name.lastIndexOf(".") > -1) {
|
|
|
|
|
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
|
|
|
|
}
|
|
|
|
|
isImg = fileType.some(type => {
|
|
|
|
|
if (file.type.indexOf(type) > -1) return true;
|
|
|
|
|
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
isImg = file.type.indexOf("image") > -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isImg) {
|
|
|
|
|
this.$modal.msgError(`文件格式不正确, 请上传${fileType.join("/")}格式文件!`);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (fileSize) {
|
|
|
|
|
const isLt = file.size / 1024 / 1024 < fileSize;
|
|
|
|
|
if (!isLt) {
|
|
|
|
|
this.$modal.msgError(`上传文件大小不能超过 ${fileSize} MB!`);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$modal.loading("正在上传文件,请稍候...");
|
|
|
|
|
this.number++;
|
|
|
|
|
},
|
|
|
|
|
// 文件个数超出
|
|
|
|
|
handleExceed() {
|
|
|
|
|