5 changed files with 468 additions and 23 deletions
-
13src/api/yieldReport/com_replace_tool.js
-
34src/views/modules/yieldReport/com_finish_roll.vue
-
93src/views/modules/yieldReport/com_produce_report_normal.vue
-
3src/views/modules/yieldReport/com_produce_tool.vue
-
348src/views/modules/yieldReport/com_replace_tool.vue
@ -0,0 +1,13 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
//工具上机
|
|||
export const countToolUsedQty = data => createAPI('schedule/countToolUsedQty', 'POST', data) |
|||
|
|||
//检查工具实例编码
|
|||
export const checkConnectToolInstanceId = data => createAPI('schedule/checkConnectToolInstanceId', 'POST', data) |
|||
|
|||
//工具上机
|
|||
export const connectToolInstanceId = data => createAPI('schedule/connectToolInstanceId', 'POST', data) |
|||
|
|||
// 获取不良代码的信息
|
|||
export const reportDefectCode = data => createAPI('schedule/reportDefectCode', 'POST', data) |
|||
|
|||
@ -0,0 +1,348 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
|||
width="465px" style="height: 680px;" class="customer-dialog"> |
|||
<el-container style="height: 225px;"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<!-- 扫描工具实例编码 --> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'工具实例编号:'"> |
|||
<el-input ref="toolInstanceId" v-model="pageData.toolInstanceId" |
|||
@keyup.enter.native="checkConnectToolInstanceIdBun" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 换刀模 --> |
|||
<el-container> |
|||
<fieldset class="customer-fieldset" style="width: 230px;"> |
|||
<legend>换刀模</legend> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item class="customer-item"> |
|||
<el-checkbox disabled="disabled" true-label="Y" false-label="N" |
|||
v-model="pageData.replaceFlag">换刀模</el-checkbox> |
|||
</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.oriToolInstanceId" :readonly="readonlyFlag" style="width: 100px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="本卷生产数量:"> |
|||
<el-input v-model="pageData.consumeQty" type="number" @blur="changeToolQty" style="width: 100px;" ></el-input> |
|||
</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.oriConsumeQty" type="number" :readonly="readonlyFlag" style="width: 100px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="累计生产数量:"> |
|||
<el-input v-model="pageData.totalConsumeQty" type="number" :readonly="readonlyFlag" style="width: 100px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</fieldset> |
|||
</el-container> |
|||
|
|||
<!-- 停机信息 --> |
|||
<el-container style="margin-left: 235px; margin-top: -144px;"> |
|||
<fieldset class="customer-fieldset" style="width: 210px;"> |
|||
<legend>停机</legend> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item class="customer-item"> |
|||
<el-checkbox disabled="disabled" true-label="Y" false-label="N" |
|||
v-model="pageData.downTimeFlag">停机</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 原工具信息 --> |
|||
<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