|
|
<template> <div class="customer-css"> <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" width="305px" 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="checkToolInstanceIdFun" style="width: 120px"></el-input> </el-form-item> </el-col> </el-row> <!-- 换刀模 --> <el-container> <fieldset class="customer-fieldset" style="width: 280px;"> <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" :readonly="readonlyFlag" 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" :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" :readonly="readonlyFlag" 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="addToolInstanceIdFun">确 定</el-button> <el-button type="primary" @click="closeDialog">关闭</el-button> </span> </el-dialog> </div></template>
<script>import { checkToolInstanceId, addToolInstanceId,} from '@/api/yieldReport/com_produce_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: '', toolInstanceId: '', oriToolInstanceId: '', 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 }, dataListLoading: false, } }, methods: {
//初始化组件的参数
init(scheduleData, operatorData, histSeqNo) { 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.operatorId = operatorData.operatorId; //自动获取焦点
this.$nextTick(() => { this.$refs.toolInstanceId.focus(); }); //区分是否是切换切换的
this.pageData.toolInstanceId = ''; this.pageData.oriToolInstanceId = ''; if(histSeqNo > 0){ this.pageData.consumeQty = 0; this.pageData.oriConsumeQty = 0; this.pageData.totalConsumeQty = 0; this.readonlyFlag = false; this.replaceFlag = true; }else{ this.pageData.consumeQty = ''; this.pageData.oriConsumeQty = ''; this.pageData.totalConsumeQty = ''; this.readonlyFlag = true; this.replaceFlag = false; } //重置校验的标记
this.pageData.checkFlag = false; },
/*关闭modal*/ closeDialog(){ this.$emit('update:visible', false); },
/*检查新的工具实例信息*/ checkToolInstanceIdFun(){ if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){ this.$message.error('请扫描工具实例!'); return false; } checkToolInstanceId(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; } }); },
/*添加刀模记录*/ addToolInstanceIdFun(){ //判断是否校验通过
if(!this.pageData.checkFlag){ this.$message.error('校验失败,请重试!') return false; } addToolInstanceId(this.pageData).then(({data}) => { if(data.code == 500){ this.$message.error(data.msg); }else{ //清空数据再次准备
this.pageData.toolInstanceId = ''; this.pageData.oriToolInstanceId = ''; this.pageData.consumeQty = ''; this.pageData.oriConsumeQty = ''; this.pageData.totalConsumeQty = ''; } }); },
}, created() { // this.factoryList()
// this.getLanguageList()
}}
</script>
<style scoped lang="scss">
</style>
|