Browse Source

工具替换

master
rui_li 4 years ago
parent
commit
700a3a724d
  1. 13
      src/api/yieldReport/com_replace_tool.js
  2. 34
      src/views/modules/yieldReport/com_finish_roll.vue
  3. 93
      src/views/modules/yieldReport/com_produce_report_normal.vue
  4. 3
      src/views/modules/yieldReport/com_produce_tool.vue
  5. 348
      src/views/modules/yieldReport/com_replace_tool.vue

13
src/api/yieldReport/com_replace_tool.js

@ -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)

34
src/views/modules/yieldReport/com_finish_roll.vue

@ -532,6 +532,19 @@ export default {
this.pageData.totalManufactureTime = data.row.totalManufactureTime;
this.pageData.totalManufactureDowntimeTime = data.row.totalManufactureDowntimeTime;
this.pageData.totalPureManufactureTime = data.row.totalPureManufactureTime;
//
//=
this.pageData.sfdcProdTime = this.pageData.totalProdTime;
//=
this.pageData.sfdcSetupTime = this.pageData.totalSetupTime;
//=
this.pageData.sfdcManufactureTime = this.pageData.totalManufactureTime;
//=
this.pageData.sfdcDownTime = this.pageData.totalDowntimeTimeSetup;
//=
this.pageData.sfdcProdSetupTime = this.pageData.totalDowntimeTimeProd;
//=
this.pageData.sfdcDownTime = this.pageData.totalManufactureDowntimeTime;
});
}).then(() => {
//3.
@ -547,14 +560,19 @@ export default {
}).then(() => {
//5.Sfdc
getSfdcTimeData(this.scheduleData).then(({data}) => {
//
this.pageData.eventTime = data.row.finishTime;
this.pageData.sfdcProdTime = data.row.sfdcProdTime;
this.pageData.sfdcSetupTime = data.row.sfdcSetupTime;
this.pageData.sfdcManufactureTime = data.row.sfdcManufactureTime;
this.pageData.sfdcDownTime = data.row.sfdcDownTime;
this.pageData.sfdcSetupDownTime = data.row.sfdcSetupDownTime;
this.pageData.sfdcProdSetupTime = data.row.sfdcProdSetupTime;
//
if(data.resultCode == 200){
//
this.pageData.eventTime = data.row.finishTime;
this.pageData.sfdcProdTime = data.row.sfdcProdTime;
this.pageData.sfdcSetupTime = data.row.sfdcSetupTime;
this.pageData.sfdcManufactureTime = data.row.sfdcManufactureTime;
this.pageData.sfdcDownTime = data.row.sfdcDownTime;
this.pageData.sfdcSetupDownTime = data.row.sfdcSetupDownTime;
this.pageData.sfdcProdSetupTime = data.row.sfdcProdSetupTime;
}else{
//
}
});
}).then(() => {
//6.

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

@ -151,6 +151,17 @@
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
fixed="left"
header-align="center"
align="center"
width="75"
:label="'操作'">
<template slot-scope="scope">
<a class="customer-a" v-if="scope.row.finishedFlag == 'N'" @click="replaceToolModal(scope.row)"
>刀模替换</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnToolArray" :key="index"
:sortable="item.columnSortable"
@ -249,6 +260,7 @@
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnDefectArray" :key="index"
:sortable="item.columnSortable"
@ -423,10 +435,18 @@
<!-- 生产过程的工具组件 -->
<comProduceTool ref="comProduceTool" :close-on-click-modal="false"
:visible.sync="showToolFlag">
:visible.sync="showToolFlag"
@refreshPageData="refreshPageData">
</comProduceTool>
<!-- 切换刀模的组件 -->
<comReplaceTool ref="comReplaceTool" :close-on-click-modal="false"
:visible.sync="showReplaceToolFlag"
@refreshPageData="refreshPageData">
</comReplaceTool>
<!-- 生产过程的材料组件 -->
<comProduceMaterial ref="comProduceMaterial" :close-on-click-modal="false"
:visible.sync="showMaterialFlag">
@ -470,8 +490,11 @@ import comStartTuning from "./com_start_tuning";/*开始调机组件*/
import comStartProduce from "./com_start_produce";/*开始生产组件*/
import comDefectRoll from "./com_defect_roll";/*报告不良品卷*/
import comProduceTool from "./com_produce_tool";/*生产过程的工具组件*/
import comReplaceTool from "./com_replace_tool";/*生产过程的工具组件*/
import comProduceMaterial from "./com_produce_material";/*生产过程的材料组件*/
import comProduceDown from "./com_produce_down";/*生产过程的停机组件*/
import comProduceDown from "./com_produce_down";
import com_replace_tool from "./com_replace_tool";
/*生产过程的停机组件*/
export default {
name: "com_produce_report_normal",
data() {
@ -486,6 +509,7 @@ export default {
showProduceFlag: false,
showDefectFlag: false,
showToolFlag: false,
showReplaceToolFlag: false,
showMaterialFlag: false,
showDownFlag: false,
activeTable: 'sfdc_time',
@ -2637,6 +2661,30 @@ export default {
fixed: false
}
],
searchData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
seqNo: '',
orderNo: '',
itemNo: 0,
resourceId: '',
scheduledDate: '',
shiftNo: '',
partNo: '',
workCenterNo: '',
workCenterDesc: '',
resourceDesc: '',
rollNo: '',
partDesc: '',
planStartTime: '',
planFinishTime: '',
qtyRequiredOriginal: 0,
preItemDesc: '',
nextItemDesc: '',
nextItemNo: 0,
operatorId: '',
functionName: ''
},
scheduleData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
@ -2702,6 +2750,7 @@ export default {
comStartProduce,/*开始生产组件*/
comDefectRoll,/*报告不良品*/
comProduceTool,/*生产过程的工具组件*/
comReplaceTool,/*刀模切换组件*/
comProduceMaterial,/*生产过程的材料组件*/
comProduceDown,/*生产过程的停机组件*/
},
@ -2728,11 +2777,13 @@ export default {
});
},
//
getCurrentRollOpsBySeqNo() {
getCurrentRollOpsBySeqNoFun() {
getCurrentRollOpsBySeqNo(this.currentRollOps).then(({data}) => {
this.currentRollOps.rollNo = data.row.rollNo;
this.scheduleData.rollNo = data.row.rollNo;
this.currentRollOps.finishedFlag = data.row.finishedFlag;
//
this.searchData = JSON.parse(JSON.stringify(this.scheduleData));
});
},
@ -2744,56 +2795,56 @@ export default {
//
getSfdcTimeList() {
getSfdcTimeByCon(this.scheduleData).then(({data}) => {
getSfdcTimeByCon(this.searchData).then(({data}) => {
this.sfdcTimeList = data.rows;
});
},
//
getOrderToolList() {
getOrderToolByCon(this.scheduleData).then(({data}) => {
getOrderToolByCon(this.searchData).then(({data}) => {
this.orderToolList = data.rows;
});
},
//
getSfdcToolList() {
getSfdcToolByCon(this.scheduleData).then(({data}) => {
getSfdcToolByCon(this.searchData).then(({data}) => {
this.sfdcToolList = data.rows;
});
},
//bom
getOrderBomList() {
getOrderBomByCon(this.scheduleData).then(({data}) => {
getOrderBomByCon(this.searchData).then(({data}) => {
this.orderBomList = data.rows;
});
},
//
getSfdcMaterialList() {
getSfdcMaterialByCon(this.scheduleData).then(({data}) => {
getSfdcMaterialByCon(this.searchData).then(({data}) => {
this.sfdcMaterialList = data.rows;
});
},
//
getSfdcRollOpsList() {
getSfdcRollOpsByCon(this.scheduleData).then(({data}) => {
getSfdcRollOpsByCon(this.searchData).then(({data}) => {
this.sfdcRollOpsList = data.rows;
});
},
//
getSfdcDefectList() {
getSfdcDefectByCon(this.scheduleData).then(({data}) => {
getSfdcDefectByCon(this.searchData).then(({data}) => {
this.sfdcDefectList = data.rows;
});
},
//
getSfdcRollList() {
getSfdcRollByCon(this.scheduleData).then(({data}) => {
getSfdcRollByCon(this.searchData).then(({data}) => {
this.sfdcRollList = data.rows;
});
},
@ -2803,9 +2854,9 @@ export default {
//
if (this.scheduleData.currentRollFlag) {
//
this.scheduleData.rollNo = this.currentRollOps.rollNo;
this.searchData.rollNo = this.currentRollOps.rollNo;
} else {
this.scheduleData.rollNo = '';
this.searchData.rollNo = '';
}
//
if (this.activeTable == 'sfdc_time') {
@ -2859,7 +2910,7 @@ export default {
//
this.visibleFlag = true;
//
this.getCurrentRollOpsBySeqNo();
this.getCurrentRollOpsBySeqNoFun();
}).then(() => {
//table
this.activeTable = 'sfdc_time';
@ -3104,6 +3155,18 @@ export default {
});
},
/*替换工具的组件*/
replaceToolModal(toolRow) {
//1.
//checkProduceButton('produceDownFlag');
console.log(this.scheduleData,this.scheduleData)
//
this.$nextTick(() => {
this.showReplaceToolFlag = true;
this.$refs.comReplaceTool.init(this.scheduleData, this.operatorData, toolRow)
});
},
//
createNewRollDo() {
createNewRoll(this.scheduleData).then(({data}) => {
@ -3131,6 +3194,8 @@ export default {
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
}

3
src/views/modules/yieldReport/com_produce_tool.vue

@ -130,7 +130,6 @@ export default {
//
init(scheduleData, operatorData, histSeqNo) {
debugger;
//
this.scheduleData = scheduleData;
//
@ -168,6 +167,8 @@ export default {
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
//
this.$emit('refreshPageData')
},
/*检查新的工具实例信息*/

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

@ -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>
Loading…
Cancel
Save