2 changed files with 240 additions and 4 deletions
-
211src/views/modules/yieldReport/com_cutting_material.vue
-
33src/views/modules/yieldReport/com_produce_report_normal.vue
@ -0,0 +1,211 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
|||
width="200px" style="height: 360px;" class="customer-dialog"> |
|||
<el-container style="height: 150px;"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<!-- 材料卷号和BOM序号 --> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item :label="'材料卷号:'"> |
|||
<el-input v-model="pageData.rmRollNo" disabled="disabled" style="width: 120px"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item :label="'退料数量:'"> |
|||
<el-input ref="transQty" @blur="checkValidQty" |
|||
v-model="pageData.transQty" |
|||
style="width: 120px"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item :label="'BOM 序号:'"> |
|||
<el-input v-model="pageData.bomItemNo" disabled="disabled" |
|||
style="width: 120px"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-container> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="feedingMaterialRollFun">确定</el-button> |
|||
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getBomItemNosByPartNo, |
|||
feedingMaterialRoll, |
|||
} from "@/api/yieldReport/com_produce_material.js"; |
|||
export default { |
|||
data() { |
|||
return { |
|||
titleCon: '材料退料', |
|||
sfdcTimeList: [], |
|||
selectFlag: 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 |
|||
}, |
|||
timeArray: [], |
|||
pageData: { |
|||
site: this.$store.state.user.site, |
|||
userName: this.$store.state.user.name, |
|||
seqNo: '', |
|||
orderNo: '', |
|||
itemNo: 0, |
|||
rollNo: '', |
|||
rmRollNo: '', |
|||
transQty: 20, |
|||
bomItemNo: '', |
|||
histSeqNo: -1, |
|||
operatorId: '', |
|||
closedFlag: 'N' |
|||
}, |
|||
operatorData: { |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
operatorId: '', |
|||
operatorName: '', |
|||
status: '', |
|||
seqNo: '', |
|||
showFlag: false |
|||
}, |
|||
dataListLoading: false, |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
//初始化页面的参数 |
|||
init(scheduleData, operatorData, materialData) { |
|||
debugger; |
|||
|
|||
//初始化参数 |
|||
this.scheduleData = scheduleData; |
|||
//初始化操作员对象 |
|||
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.rmRollNo = materialData.rmRollNo; |
|||
this.pageData.bomItemNo = materialData.sAPBOMItemNo; |
|||
this.pageData.transQty = materialData.transQty |
|||
this.pageData.histSeqNo = materialData.histSeqNo; |
|||
this.pageData.operatorId = operatorData.operatorId; |
|||
//自动获取焦点 |
|||
this.$nextTick(() => { |
|||
this.$refs.transQty.focus(); |
|||
}); |
|||
//清空当前的时间数据 |
|||
this.timeArray = []; |
|||
}, |
|||
|
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
this.$emit('update:visible', false); |
|||
}, |
|||
|
|||
/*检查材料卷号的数据*/ |
|||
checkValidQty() { |
|||
//首先判断时间是否超过100毫秒 |
|||
let transQty = this.pageData.transQty; |
|||
//判断时间是否在范围之内 |
|||
if(transQty <= 0){ |
|||
this.$message.error('请输入有效的数量!'); |
|||
} |
|||
}, |
|||
|
|||
/*获取BOM行号*/ |
|||
refreshSomItemNos(){ |
|||
getBomItemNosByPartNo(this.pageData).then(({data}) => { |
|||
//判断是否成功 |
|||
if(data.code == 500){ |
|||
this.$message.error(data.msg); |
|||
return false; |
|||
} |
|||
this.bomList = data.rows; |
|||
//首先判断行号是否只有一行 |
|||
if(this.bomList.length == 1){ |
|||
//禁用下拉框 |
|||
this.selectFlag = true; |
|||
//选中第一个 |
|||
this.pageData.bomItemNo = data.rows[0].itemNo; |
|||
}else{ |
|||
//启用下拉框 |
|||
this.selectFlag = false; |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
/*保存材料上机的记录*/ |
|||
feedingMaterialRollFun(){ |
|||
//判断卷号是否为空 |
|||
if (this.pageData.rmRollNo == null || this.pageData.rmRollNo == ''){ |
|||
this.$message.error('请扫描材料卷号!') |
|||
return false; |
|||
} |
|||
//判断是否选中行号 |
|||
if(this.pageData.bomItemNo == '请选择' || this.pageData.bomItemNo === ''){ |
|||
this.$message.error('请选择BOM行号!') |
|||
return false; |
|||
} |
|||
//调用方法执行上材料 |
|||
feedingMaterialRoll(this.pageData).then(({data}) => { |
|||
if(data.code == 500){ |
|||
this.$message.error(data.msg); |
|||
}else{ |
|||
this.$message.info(data.msg); |
|||
//清空信息二次操作 |
|||
this.pageData.rmRollNo = ''; |
|||
this.pageData.bomItemNo = -1; |
|||
this.bomList = []; |
|||
this.timeArray = []; |
|||
} |
|||
}); |
|||
|
|||
}, |
|||
|
|||
}, |
|||
created() { |
|||
// this.factoryList() |
|||
// this.getLanguageList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue