Browse Source

首道工序扫描卷 2022年12月7日 sxm

master
[li_she] 3 years ago
parent
commit
5717711016
  1. 2
      config/index.js
  2. 377
      src/views/modules/yieldReport/com_produce_key_material.vue

2
config/index.js

@ -13,7 +13,7 @@ module.exports = {
// 代理列表, 是否开启代理通过[./dev.env.js]配置
proxyTable: devEnv.OPEN_PROXY === false ? {} : {
'/proxyApi': {
target: 'http://127.0.0.1:9090',
target: 'http://192.168.1.83:9091',
changeOrigin: true,
pathRewrite: {
// 把 /proxyApi 替换成 /

377
src/views/modules/yieldReport/com_produce_key_material.vue

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