Browse Source

材料替换

master
Rui_Li 4 years ago
parent
commit
68aa2f805d
  1. 7
      src/api/yieldReport/com_replace_material.js
  2. 4
      src/views/modules/yieldReport/com_produce_report_normal.vue
  3. 167
      src/views/modules/yieldReport/com_replace_material.vue
  4. 10
      src/views/modules/yieldReport/com_replace_tool.vue

7
src/api/yieldReport/com_replace_material.js

@ -0,0 +1,7 @@
import { createAPI } from '@/utils/httpRequest.js'
//检查工具实例编码
export const checkConnectMaterialRoll = data => createAPI('schedule/checkConnectMaterialRoll', 'POST', data)
//工具上机
export const connectMaterialRoll = data => createAPI('schedule/connectMaterialRoll', 'POST', data)

4
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -233,7 +233,7 @@
width="75"
:label="'操作'">
<template slot-scope="scope">
<a class="customer-a" v-if="scope.row.finishedFlag == 'N'" @click="replaceMaterialModal(scope.row)"
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="replaceMaterialModal(scope.row)"
>换料</a>
</template>
</el-table-column>
@ -3193,7 +3193,7 @@ export default {
//
this.$nextTick(() => {
this.showReplaceMaterialFlag = true;
this.$refs.comReplaceTool.init(this.scheduleData, this.operatorData, materialRow)
this.$refs.comReplaceMaterial.init(this.scheduleData, this.operatorData, materialRow)
});
},

167
src/views/modules/yieldReport/com_replace_material.vue

@ -14,7 +14,7 @@
<el-col :span="16">
<el-form-item :label="'材料卷号:'">
<el-input ref="rmRollNo" @keyup.native="recordTime"
@keyup.enter.native="checkRmRollNo"
@keyup.enter.native="checkRmRollNoBun"
v-model="pageData.rmRollNo"
style="width: 120px">
</el-input>
@ -24,14 +24,7 @@
<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-input v-model="pageData.bomItemNo" readonly style="width: 120px"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -70,7 +63,7 @@
</el-form>
</el-container>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="connectToolInstanceIdBun"> </el-button>
<el-button type="primary" @click="connectMaterialRollBun"> </el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
@ -79,17 +72,16 @@
<script>
import {
countToolUsedQty,
checkConnectToolInstanceId,
connectToolInstanceId,
checkConnectMaterialRoll,
connectMaterialRoll,
}
from '@/api/yieldReport/com_replace_tool.js';
from '@/api/yieldReport/com_replace_material.js';
export default {
name: "com_defect_roll",
data() {
return {
titleCon: '换料',
readonlyFlag: true,
timeArray: [],
scheduleData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
@ -123,12 +115,11 @@ export default {
rollNo: '',
operatorId: '',
histSeqNo: 0,
toolInstanceId: '',
oriToolInstanceId: '',
replaceFlag: 'Y',
bomItemNo: -1,
rmRollNo: '',
oriRmRollNo: '',
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,
@ -144,13 +135,14 @@ export default {
seqNo: '',
showFlag: false
},
oriToolData: {
oriMaterialData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
orderNo: '',
itemNo: 0,
seqNo: '',
toolInstanceId: ''
histSeqNo: '',
rmRollNo: '',
},
dataListLoading: false,
}
@ -158,10 +150,10 @@ export default {
methods: {
//
init(scheduleData, operatorData, oriToolData) {
init(scheduleData, operatorData, oriMaterialData) {
//
this.scheduleData = scheduleData;
this.oriToolData = oriToolData;
this.oriMaterialData = oriMaterialData;
//
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
@ -170,43 +162,31 @@ export default {
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.pageData.histSeqNo = oriMaterialData.histSeqNo;
this.pageData.oriRmRollNo = oriMaterialData.rmRollNo;
this.pageData.bomItemNo = oriMaterialData.sAPBOMItemNo;
this.pageData.rmRollNo = '';
//
this.$nextTick(() => {
this.$refs.toolInstanceId.focus();
this.$refs.rmRollNo.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);
});
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
/*数量失去焦点的事件*/
changeToolQty(){
let consumeQty = parseFloat(this.pageData.consumeQty);
if(consumeQty <= 0){
this.$message.error('本卷生产数量不能小于0!');
return false;
/*记录每一次录入字符串的时间*/
recordTime(){
//
if(this.pageData.rmRollNo.trim().length === 0){
this.timeArray = [];
}else{
this.timeArray.push(new Date().getTime());
}
//
this.pageData.totalConsumeQty = this.pageData.oriConsumeQty + consumeQty;
},
/*验证时长的参数*/
@ -218,89 +198,54 @@ export default {
}
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
/*检查材料卷号的数据*/
checkRmRollNoBun() {
//100
let len = this.timeArray.length;
let timeDiff = this.timeArray[len - 1] - this.timeArray[0];
//
if(timeDiff > 1000){
this.$message.error('请扫码输入!');
return false;
}
//null
if (this.pageData.rmRollNo == null || this.pageData.rmRollNo === '') {
this.$message.error('材料卷号不能为空!');
return false;
}else{
this.pageData.rmRollNo = this.pageData.rmRollNo.trim();
}
//()
this.checkConnectRmRollNoOperation();
},
/*检查新的工具实例信息*/
checkConnectToolInstanceIdBun(){
/*验证工具的实例*/
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){
this.$message.error('请扫描工具实例!');
return false;
}
checkConnectRmRollNoOperation(){
/*调用检查的方法检验下*/
checkConnectToolInstanceId(this.pageData).then(({data}) => {
checkConnectMaterialRoll(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;
}
/*验证时长的参数*/
/*接料操作*/
connectMaterialRollBun(){
let downTimeQty = this.pageData.downTimeQty;
if(downTimeQty <= 0){
this.$message.error('时长必须大于0!');
return false;
}
checkConnectToolInstanceId(this.pageData).then(({data}) => {
connectMaterialRoll(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.closeDialog();
this.$message.success(data.msg);
//
this.closeDialog();

10
src/views/modules/yieldReport/com_replace_tool.vue

@ -9,7 +9,7 @@
<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>
@keyup.enter.native="checkConnectToolInstanceIdBun" style="width: 120px"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -195,10 +195,6 @@ export default {
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;
@ -209,6 +205,10 @@ export default {
this.replaceFlag = true;
//
this.pageData.checkFlag = false;
//
this.$nextTick(() => {
this.$refs.toolInstanceId.focus();
});
//
this.refreshToolUsedQty();
},

Loading…
Cancel
Save