2 changed files with 378 additions and 1 deletions
@ -0,0 +1,377 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="200px" style="height: 580px;" class="customer-dialog"> |
||||
|
<el-container style="height: 105px;"> |
||||
|
<el-form :inline="true" label-position="top" label-width="80px"> |
||||
|
<!-- 材料卷号和BOM序号 --> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item :label=labels.rmRollNo> |
||||
|
<el-input ref="scanRmRollNo" @keyup.native="recordTime" |
||||
|
@keyup.enter.native="checkRmRollNo" |
||||
|
v-model="pageData.scanRmRollNo" |
||||
|
style="width: 120px"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item :label=labels.bomItemNo> |
||||
|
<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-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</el-container> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="feedingMaterialRollFun">{{ buttons.confirmButton }}</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">{{ buttons.closeButton }}</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getBomItemNosByPartNo, |
||||
|
getBomItemNosByKeyPartNo, |
||||
|
feedingMaterialRoll, |
||||
|
feedingKeyMaterialRoll |
||||
|
} from "@/api/yieldReport/com_produce_material.js"; |
||||
|
|
||||
|
import { |
||||
|
searchSysLanguagePackList, |
||||
|
searchSysLanguageParam, |
||||
|
searchFunctionButtonList, |
||||
|
saveButtonList, |
||||
|
searchSysLanguage, |
||||
|
searchLanguageListByLanguageCode, |
||||
|
saveSysLanguageOne, |
||||
|
searchPageLanguageData, |
||||
|
removerLanguage, |
||||
|
saveSysLanguageList |
||||
|
} from "@/api/sysLanguage.js"; |
||||
|
|
||||
|
var functionId = 'C10000013'; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '材料', |
||||
|
showDefault: false, |
||||
|
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: [], |
||||
|
bomList: [], |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
seqNo: '', |
||||
|
orderNo: '', |
||||
|
itemNo: 0, |
||||
|
rollNo: '', |
||||
|
scanRmRollNo: '',/*扫描的时候用的*/ |
||||
|
rmRollNo: '', |
||||
|
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, |
||||
|
buttons: { |
||||
|
confirmButton: '确定', |
||||
|
closeButton: '关闭', |
||||
|
}, |
||||
|
buttonList: [ |
||||
|
{ |
||||
|
functionId: functionId, |
||||
|
languageValue: '确定', |
||||
|
objectId: 'confirmButton', |
||||
|
objectType: 'button', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '关闭', |
||||
|
objectId: 'closeButton', |
||||
|
objectType: 'button', |
||||
|
tableId: '*' |
||||
|
}, |
||||
|
], |
||||
|
queryButton: { |
||||
|
functionId: functionId, |
||||
|
table_id: '*', |
||||
|
languageCode: this.$i18n.locale, |
||||
|
objectType: 'button' |
||||
|
}, |
||||
|
labels: { |
||||
|
titleCon: '材料', |
||||
|
rmRollNo: '材料卷号:', |
||||
|
bomItemNo: 'BOM序号:', |
||||
|
pleaseScanEnter: '请扫码输入!', |
||||
|
materialRollCantBeNull: '材料卷号不能为空!', |
||||
|
pleaseScanMaterialRollNo: '请扫描材料卷号!', |
||||
|
pleaseSelectBomItemNo: '请选择BOM行号!', |
||||
|
}, |
||||
|
labelsList: [ |
||||
|
{ |
||||
|
functionId: functionId, |
||||
|
languageValue: '材料', |
||||
|
objectId: 'titleCon', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '材料卷号:', |
||||
|
objectId: 'rmRollNo', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: 'BOM序号:', |
||||
|
objectId: 'bomItemNo', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '请扫码输入!', |
||||
|
objectId: 'pleaseScanEnter', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '材料卷号不能为空!', |
||||
|
objectId: 'materialRollCantBeNull', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '请扫描材料卷号!', |
||||
|
objectId: 'pleaseScanMaterialRollNo', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, { |
||||
|
functionId: functionId, |
||||
|
languageValue: '请选择BOM行号!', |
||||
|
objectId: 'pleaseSelectBomItemNo', |
||||
|
objectType: 'label', |
||||
|
tableId: '*' |
||||
|
}, |
||||
|
], |
||||
|
queryLabel: { |
||||
|
functionId: functionId, |
||||
|
table_id: '*', |
||||
|
languageCode: this.$i18n.locale, |
||||
|
objectType: 'label' |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
//初始化页面的参数 |
||||
|
init(scheduleData, operatorData) { |
||||
|
//初始化参数 |
||||
|
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.scanRmRollNo = ''; |
||||
|
this.pageData.rmRollNo = ''; |
||||
|
this.pageData.bomItemNo = ''; |
||||
|
this.pageData.histSeqNo = -1; |
||||
|
this.pageData.operatorId = operatorData.operatorId; |
||||
|
//判断是否启用多语言 |
||||
|
this.getMultiLanguageList(); //刷新多语言的信息 |
||||
|
//自动获取焦点 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.scanRmRollNo.focus(); |
||||
|
}); |
||||
|
//清空当前的时间数据 |
||||
|
this.timeArray = []; |
||||
|
|
||||
|
//重置标题 |
||||
|
this.titleCon = this.labels.titleCon; |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog() { |
||||
|
//刷新报工的页面 |
||||
|
this.$emit('refreshPageData'); |
||||
|
//关闭当前的页面 |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*记录每一次录入字符串的时间*/ |
||||
|
recordTime() { |
||||
|
//判断是否清掉所有的内容 |
||||
|
if (this.pageData.scanRmRollNo.trim().length == 0) { |
||||
|
this.timeArray = []; |
||||
|
} else { |
||||
|
this.timeArray.push(new Date().getTime()); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*检查材料卷号的数据*/ |
||||
|
checkRmRollNo() { |
||||
|
//首先判断时间是否超过100毫秒 |
||||
|
let len = this.timeArray.length; |
||||
|
let timeDiff = this.timeArray[len - 1] - this.timeArray[0]; |
||||
|
//判断时间是否在范围之内 |
||||
|
if (timeDiff > 1000) { |
||||
|
this.$message.error(this.labels.pleaseScanEnter); |
||||
|
} |
||||
|
//判断null和空字符串 |
||||
|
if (this.pageData.scanRmRollNo == null || this.pageData.scanRmRollNo == '') { |
||||
|
this.$message.error(this.labels.materialRollCantBeNull); |
||||
|
return false; |
||||
|
} else { |
||||
|
this.pageData.rmRollNo = this.pageData.scanRmRollNo.trim(); |
||||
|
} |
||||
|
//处理扫描材料卷号 |
||||
|
this.refreshSomItemNos(); |
||||
|
}, |
||||
|
|
||||
|
/*获取BOM行号*/ |
||||
|
refreshSomItemNos() { |
||||
|
getBomItemNosByKeyPartNo(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.scanRmRollNo == null || this.pageData.scanRmRollNo == '') { |
||||
|
this.$message.error(this.labels.pleaseScanMaterialRollNo) |
||||
|
return false; |
||||
|
} |
||||
|
//判断是否选中行号 |
||||
|
if (this.pageData.bomItemNo == '请选择' || this.pageData.bomItemNo === '') { |
||||
|
this.$message.error(this.labels.pleaseSelectBomItemNo) |
||||
|
return false; |
||||
|
} |
||||
|
//把扫描卷的属性 赋值给rmRollNo |
||||
|
this.pageData.rmRollNo = this.pageData.scanRmRollNo; |
||||
|
//清空当前扫描卷属性值 防止重复点击确认 |
||||
|
this.pageData.scanRmRollNo = ''; |
||||
|
//调用方法执行上材料 |
||||
|
feedingKeyMaterialRoll(this.pageData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else { |
||||
|
this.$message.success(data.msg); |
||||
|
//清空信息二次操作 |
||||
|
this.pageData.rmRollNo = ''; |
||||
|
this.pageData.bomItemNo = -1; |
||||
|
this.bomList = []; |
||||
|
this.timeArray = []; |
||||
|
//刷新报工的页面 |
||||
|
this.$emit('refreshPageData'); |
||||
|
//关闭当前的页面 |
||||
|
this.$emit('update:visible', false); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 保存 默认配置 列 |
||||
|
async saveMultiLanguage() { |
||||
|
// 保存页面 button label title 属性 |
||||
|
let buttons = this.buttonList; |
||||
|
let labels = this.labelsList; |
||||
|
await saveButtonList(buttons) |
||||
|
await saveButtonList(labels) |
||||
|
}, |
||||
|
|
||||
|
getMultiLanguageList() { |
||||
|
//首先查询当前按钮的多语言 |
||||
|
searchFunctionButtonList(this.queryButton).then(({data}) => { |
||||
|
if (data && data.code == 0) { |
||||
|
this.buttons = data.data |
||||
|
} else { |
||||
|
// saveButtonList(this.buttonList).then(({data}) => { |
||||
|
// }) |
||||
|
} |
||||
|
}); |
||||
|
//其次查询当前标签的多语言 |
||||
|
searchFunctionButtonList(this.queryLabel).then(({data}) => { |
||||
|
if (data && data.code == 0) { |
||||
|
this.labels = data.data |
||||
|
} else { |
||||
|
// saveButtonList(this.buttonList).then(({data}) => { |
||||
|
// }) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
// this.factoryList() |
||||
|
// this.getLanguageList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue