2 changed files with 358 additions and 3 deletions
-
36src/views/modules/yieldReport/com_produce_report_normal.vue
-
325src/views/modules/yieldReport/com_replace_material.vue
@ -0,0 +1,325 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="405px" style="height: 310px;" class="customer-dialog"> |
||||
|
<el-container style="height: 135px;"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<!-- 换材料 --> |
||||
|
<el-container> |
||||
|
<fieldset class="customer-fieldset" style="width: 165px;"> |
||||
|
<legend>换材料</legend> |
||||
|
<!-- 材料卷号 序号 --> |
||||
|
<!-- 材料卷号和BOM序号 --> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item :label="'材料卷号:'"> |
||||
|
<el-input ref="rmRollNo" @keyup.native="recordTime" |
||||
|
@keyup.enter.native="checkRmRollNo" |
||||
|
v-model="pageData.rmRollNo" |
||||
|
style="width: 120px"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item :label="'BOM 序号:'"> |
||||
|
<el-select v-model="pageData.bomItemNo" :disabled="selectFlag" style="width: 120px"> |
||||
|
<el-option |
||||
|
v-for="(item, index) in bomList" |
||||
|
:key="index" |
||||
|
:label="item.itemNo" |
||||
|
:value="item.itemNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</fieldset> |
||||
|
</el-container> |
||||
|
|
||||
|
<!-- 停机信息 --> |
||||
|
<el-container style="margin-left: 170px; margin-top: -120px;"> |
||||
|
<fieldset class="customer-fieldset" style="width: 210px;"> |
||||
|
<legend>停机</legend> |
||||
|
<!-- 原工具信息 --> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label="开始时间:"> |
||||
|
<el-date-picker v-model="pageData.reportDate" format="yyyy-MM-dd" |
||||
|
value-format="yyyy-MM-dd" style="width: 100px;"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label=" "> |
||||
|
<el-time-picker v-model="pageData.reportTime" format="HH:mm:ss" |
||||
|
value-format="HH:mm:ss" style="width: 80px;"></el-time-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item class="customer-item" label="时长:"> |
||||
|
<el-input v-model="pageData.downTimeQty" @blur="changeTimeQty"type="number" style="width: 100px;" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</fieldset> |
||||
|
</el-container> |
||||
|
|
||||
|
</el-form> |
||||
|
</el-container> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="connectToolInstanceIdBun">确 定</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
countToolUsedQty, |
||||
|
checkConnectToolInstanceId, |
||||
|
connectToolInstanceId, |
||||
|
} |
||||
|
from '@/api/yieldReport/com_replace_tool.js'; |
||||
|
export default { |
||||
|
name: "com_defect_roll", |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '换料', |
||||
|
readonlyFlag: true, |
||||
|
scheduleData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
seqNo: '', |
||||
|
orderNo: '', |
||||
|
itemNo: 0, |
||||
|
partNo: '', |
||||
|
workCenterNo: '', |
||||
|
workCenterDesc: '', |
||||
|
resourceDesc: '', |
||||
|
rollNo: '', |
||||
|
partDesc: '', |
||||
|
planStartTime: '', |
||||
|
planFinishTime: '', |
||||
|
qtyRequiredOriginal: 0, |
||||
|
scheduledDate: '', |
||||
|
shiftNo: '', |
||||
|
preItemDesc: '', |
||||
|
nextItemDesc: '', |
||||
|
nextItemNo: 0, |
||||
|
operatorId: '', |
||||
|
functionName: '', |
||||
|
currentRollFlag: false |
||||
|
}, |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderNo: '', |
||||
|
itemNo: '', |
||||
|
seqNo: '', |
||||
|
rollNo: '', |
||||
|
operatorId: '', |
||||
|
histSeqNo: 0, |
||||
|
toolInstanceId: '', |
||||
|
oriToolInstanceId: '', |
||||
|
replaceFlag: 'Y', |
||||
|
reportDate: this.dayjs(new Date()).format('YYYY-MM-DD'), |
||||
|
reportTime: this.dayjs(new Date()).format('HH:mm:ss'), |
||||
|
downTimeFlag: 'Y', |
||||
|
downTimeQty: 0, |
||||
|
consumeQty: 0, |
||||
|
oriConsumeQty: 0, |
||||
|
totalConsumeQty: 0, |
||||
|
checkFlag: false, |
||||
|
}, |
||||
|
operatorData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
operatorId: '', |
||||
|
operatorName: '', |
||||
|
status: '', |
||||
|
seqNo: '', |
||||
|
showFlag: false |
||||
|
}, |
||||
|
oriToolData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderNo: '', |
||||
|
itemNo: 0, |
||||
|
seqNo: '', |
||||
|
toolInstanceId: '' |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
//初始化组件的参数 |
||||
|
init(scheduleData, operatorData, oriToolData) { |
||||
|
//初始化参数 |
||||
|
this.scheduleData = scheduleData; |
||||
|
this.oriToolData = oriToolData; |
||||
|
//初始化操作员对象 |
||||
|
this.operatorData = JSON.parse(JSON.stringify(operatorData)); |
||||
|
//设置参数 |
||||
|
this.pageData.orderNo = scheduleData.orderNo; |
||||
|
this.pageData.itemNo = scheduleData.itemNo; |
||||
|
this.pageData.seqNo = scheduleData.seqNo; |
||||
|
this.pageData.rollNo = scheduleData.rollNo; |
||||
|
this.pageData.operatorId = operatorData.operatorId; |
||||
|
this.pageData.histSeqNo = oriToolData.histSeqNo; |
||||
|
this.pageData.oriToolInstanceId = oriToolData.toolInstanceId; |
||||
|
//自动获取焦点 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.toolInstanceId.focus(); |
||||
|
}); |
||||
|
//区分是否是切换切换的 |
||||
|
this.pageData.toolInstanceId = ''; |
||||
|
this.pageData.consumeQty = 0; |
||||
|
this.pageData.oriConsumeQty = 0; |
||||
|
this.pageData.totalConsumeQty = 0; |
||||
|
this.pageData.downTimeQty = 0; |
||||
|
this.readonlyFlag = true; |
||||
|
this.replaceFlag = true; |
||||
|
//重置校验的标记 |
||||
|
this.pageData.checkFlag = false; |
||||
|
//刷新当前工具实例的数量数据 |
||||
|
this.refreshToolUsedQty(); |
||||
|
}, |
||||
|
|
||||
|
/*添加刀模记录*/ |
||||
|
refreshToolUsedQty(){ |
||||
|
countToolUsedQty(this.pageData).then(({data}) => { |
||||
|
this.pageData.oriConsumeQty = parseFloat(data.usedQty); |
||||
|
this.pageData.totalConsumeQty = parseFloat(data.usedQty); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*数量失去焦点的事件*/ |
||||
|
changeToolQty(){ |
||||
|
let consumeQty = parseFloat(this.pageData.consumeQty); |
||||
|
if(consumeQty <= 0){ |
||||
|
this.$message.error('本卷生产数量不能小于0!'); |
||||
|
return false; |
||||
|
} |
||||
|
//汇总数量 |
||||
|
this.pageData.totalConsumeQty = this.pageData.oriConsumeQty + consumeQty; |
||||
|
}, |
||||
|
|
||||
|
/*验证时长的参数*/ |
||||
|
changeTimeQty(){ |
||||
|
let downTimeQty = this.pageData.downTimeQty; |
||||
|
if(downTimeQty <= 0){ |
||||
|
this.$message.error('时长必须大于0!'); |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog(){ |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*检查新的工具实例信息*/ |
||||
|
checkConnectToolInstanceIdBun(){ |
||||
|
/*验证工具的实例*/ |
||||
|
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){ |
||||
|
this.$message.error('请扫描工具实例!'); |
||||
|
return false; |
||||
|
} |
||||
|
/*调用检查的方法检验下*/ |
||||
|
checkConnectToolInstanceId(this.pageData).then(({data}) => { |
||||
|
//判断是否存在异常 |
||||
|
if(data.code == 500){ |
||||
|
this.$message.error(data.msg); |
||||
|
}else if (data.resultMap.resultCode == 201){ |
||||
|
let msg = data.resultMap.resultMsg; |
||||
|
this.$confirm(msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
this.pageData.checkFlag = true; |
||||
|
}).catch(() => { |
||||
|
this.pageData.checkFlag = false; |
||||
|
}); |
||||
|
}else{ |
||||
|
this.pageData.checkFlag = true; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*检查新的工具实例信息*/ |
||||
|
connectToolInstanceIdBun(){ |
||||
|
/*验证工具的实例*/ |
||||
|
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){ |
||||
|
this.$message.error('请扫描工具实例!'); |
||||
|
return false; |
||||
|
} |
||||
|
/*耗用的参数*/ |
||||
|
let consumeQty = parseFloat(this.pageData.consumeQty); |
||||
|
if(consumeQty <= 0){ |
||||
|
this.$message.error('本卷生产数量不能小于0!'); |
||||
|
return false; |
||||
|
} |
||||
|
/*验证时长的参数*/ |
||||
|
let downTimeQty = this.pageData.downTimeQty; |
||||
|
if(downTimeQty <= 0){ |
||||
|
this.$message.error('时长必须大于0!'); |
||||
|
return false; |
||||
|
} |
||||
|
checkConnectToolInstanceId(this.pageData).then(({data}) => { |
||||
|
//判断是否存在异常 |
||||
|
if(data.code == 500){ |
||||
|
this.$message.error(data.msg); |
||||
|
}else if (data.resultMap.resultCode == 201){ |
||||
|
let msg = data.resultMap.resultMsg; |
||||
|
this.$confirm(msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
//调用存储过程实现 |
||||
|
this.connectToolInstanceIdOperation(); |
||||
|
}).catch(() => { |
||||
|
this.pageData.checkFlag = false; |
||||
|
}); |
||||
|
}else{ |
||||
|
//调用存储过程实现 |
||||
|
this.connectToolInstanceIdOperation(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*替换刀模的功能*/ |
||||
|
connectToolInstanceIdOperation(){ |
||||
|
connectToolInstanceId(this.pageData).then(({data}) => { |
||||
|
//如果成功关闭当前的页面 刷新原始的菜单 |
||||
|
if(data.code == 500){ |
||||
|
this.$message.error(data.msg); |
||||
|
}else{ |
||||
|
this.$message.success(data.msg); |
||||
|
//关闭当前的组件 |
||||
|
this.closeDialog(); |
||||
|
//刷新报工的页面 |
||||
|
this.$emit('refreshPageData') |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
// this.factoryList() |
||||
|
// this.getLanguageList() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue