Browse Source

报工 小功能

master
rui_li 4 years ago
parent
commit
d50e2e5782
  1. 211
      src/views/modules/yieldReport/com_cutting_material.vue
  2. 33
      src/views/modules/yieldReport/com_produce_report_normal.vue

211
src/views/modules/yieldReport/com_cutting_material.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>

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

@ -237,14 +237,14 @@
fixed="left"
header-align="center"
align="center"
width="75"
width="115"
:label="'操作'">
<template slot-scope="scope">
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="replaceMaterialModal(scope.row)"
>换料</a>
<a class="customer-a" v-else-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="cuttingMaterialModal(scope.row)"
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="cuttingMaterialModal(scope.row)"
>下料</a>
<a class="customer-a" v-else-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料' && scope.row.keyRMFlag == 'N'" @click="replaceMaterialModal(scope.row)"
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料' && scope.row.keyRMFlag == 'N'" @click="replaceMaterialModal(scope.row)"
>生产结束</a>
</template>
</el-table-column>
@ -482,6 +482,13 @@
</comReplaceMaterial>
<!-- 换料组件 -->
<comCuttingMaterial ref="comCuttingMaterial" :close-on-click-modal="false"
:visible.sync="showCuttingMaterialFlag"
@refreshPageData="refreshPageData">
</comCuttingMaterial>
<!-- 生产过程的停机组件 -->
<comProduceDown ref="comProduceDown" :close-on-click-modal="false"
:visible.sync="showDownFlag"
@ -529,6 +536,7 @@ import comProduceTool from "./com_produce_tool";/*生产过程的工具组件*/
import comReplaceTool from "./com_replace_tool";/*生产过程的工具组件*/
import comProduceMaterial from "./com_produce_material";/*生产过程的材料组件*/
import comReplaceMaterial from "./com_replace_material"/*换料组件*/
import comCuttingMaterial from "./com_cutting_material"/*材料下料*/
import comProduceDown from "./com_produce_down";/*停机组件*/
import comFinishSchedule from "./com_finish_schedule";/*结束派工单组件*/
/*生产过程的停机组件*/
@ -549,6 +557,7 @@ export default {
showReplaceToolFlag: false,
showMaterialFlag: false,
showReplaceMaterialFlag: false,
showCuttingMaterialFlag: false,
showDownFlag: false,
showFinishScheduleFlag: false,
activeTable: 'sfdc_time',
@ -2792,6 +2801,7 @@ export default {
comReplaceTool,/*刀模切换组件*/
comProduceMaterial,/*生产过程的材料组件*/
comReplaceMaterial,/*换料的组件*/
comCuttingMaterial,/*材料下料的功能*/
comProduceDown,/*生产过程的停机组件*/
comFinishSchedule,/*结束派工单的组件*/
},
@ -3190,7 +3200,6 @@ export default {
});
},
/*生产过程的停机组件*/
produceDownModal() {
//1.
@ -3224,6 +3233,22 @@ export default {
});
},
/*材料下料的modal*/
cuttingMaterialModal(materialRow){
this.$nextTick(() => {
this.showCuttingMaterialFlag = true;
this.$refs.comCuttingMaterial.init(this.scheduleData, this.operatorData, materialRow);
});
},
/*材料结束生产的modal*/
finishMaterialModal(materialRow){
this.$nextTick(() => {
this.showMaterialFlag = true;
this.$refs.comProduceMaterial.init(this.scheduleData, this.operatorData)
});
},
//modal
showFinishScheduleModal() {
//

Loading…
Cancel
Save