后道触摸屏功能修改
This commit is contained in:
parent
6a638f47b5
commit
f4ea511edf
@ -105,6 +105,30 @@ export function ScanInnerLabel(query) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 箱标签扫描
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function ScanPackageLabel(query) {
|
||||
return request({
|
||||
url: '/mes/qc/BackEnd/QcBackEndController/ScanPackageLabel',
|
||||
method: 'post',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否要扫描箱标签
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function CheckPackageIsFullAndNeedScanPackageLabel(query) {
|
||||
return request({
|
||||
url: '/mes/qc/BackEnd/QcBackEndController/CheckPackageIsFullAndNeedScanPackageLabel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束工单,并生成质量报表
|
||||
* @param {查询条件} data
|
||||
|
||||
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<el-dialog v-loading="loading" :visible.sync="show" title="已满箱,请扫外箱标签" width="80%" append-to-body :close-on-click-modal="false">
|
||||
<el-form label-width="auto">
|
||||
<el-form-item label="零件号">
|
||||
<div class="number-text">{{ partnumber }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格">
|
||||
<div class="number-text">{{ specification }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="颜色">
|
||||
<div class="number-text">{{ color }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
<div class="number-text">{{ description }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="零件数">
|
||||
<div class="number-text">{{ number }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签内容">
|
||||
<div class="number-text">{{ labelCode }}</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<scanInput @scanInput="handleScanPackageLabel"></scanInput>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close">取消</el-button>
|
||||
<el-button :disabled="loading" type="primary" @click="submit">继续</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scanInput from '../../components/scanInput.vue'
|
||||
import * as QcBackEndApi from '@/api/qualityManagement/BackEnd/qcBackEndService'
|
||||
export default {
|
||||
name: 'ScanPackageLabelDialog',
|
||||
components: { scanInput },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
show: false,
|
||||
workOrder: '',
|
||||
partnumber: '',
|
||||
specification: '',
|
||||
color: '',
|
||||
description: '',
|
||||
number: '',
|
||||
labelCode: '',
|
||||
isOnetime: 0,
|
||||
isBack: 0,
|
||||
isPolish: 0,
|
||||
isOut: 0,
|
||||
// 需要传入
|
||||
team: '',
|
||||
siteNo: '',
|
||||
comNo: '未知串口',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 扫外箱标签的情况
|
||||
handleScanPackageLabel(label = '', comNo = '未知串口') {
|
||||
const params = {
|
||||
label,
|
||||
// type === 1 获取详细物料信息 2只判断零件号是否正确
|
||||
type: 1,
|
||||
}
|
||||
QcBackEndApi.AnalyzeLabel(params).then((res) => {
|
||||
if (res.code === 200 && res.data.isOk) {
|
||||
this.partnumber = res.data.partnumber
|
||||
this.specification = res.data.specification
|
||||
this.color = res.data.color
|
||||
this.number = res.data.number
|
||||
this.description = res.data.description
|
||||
this.labelCode = res.data.labelCode
|
||||
this.comNo = comNo
|
||||
} else {
|
||||
this.showErrorMessage(3, '标签存在异常!' + res.data.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
showErrorMessage(code, message) {
|
||||
this.$emit('showWarningMessage', code, message)
|
||||
},
|
||||
// 确认录入箱标签
|
||||
submit() {
|
||||
const params = {
|
||||
workOrder: this.workOrder,
|
||||
partNumber: this.partnumber,
|
||||
description: this.description,
|
||||
specification: this.specification,
|
||||
color: this.color,
|
||||
team: this.team,
|
||||
siteNo: this.siteNo,
|
||||
comNo: this.comNo,
|
||||
isOnetime: this.isPolish === 0 ? 1 : 0,
|
||||
isBack: this.isBack,
|
||||
isPolish: this.isPolish,
|
||||
isOut: this.isOut,
|
||||
label: this.labelCode,
|
||||
}
|
||||
if (params.partNumber === '' || params.label === '') {
|
||||
this.showErrorMessage(3, '标签信息为空!请检查标签!')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
this.changeFormStatus(2)
|
||||
// 扫入箱标签
|
||||
QcBackEndApi.ScanPackageLabel(params).then((res) => {
|
||||
this.loading = false
|
||||
if (res.code === 200 && res.data === 'ok') {
|
||||
this.showErrorMessage(0)
|
||||
this.close()
|
||||
} else {
|
||||
this.showErrorMessage(3, res.data)
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
changeFormStatus(type) {
|
||||
// type = 2 进入内标签扫码模式
|
||||
this.$emit('changeFormStatus', type)
|
||||
},
|
||||
// 发送已扫外箱标签信号
|
||||
emitSubmit(formData) {
|
||||
this.$emit('submit', formData)
|
||||
},
|
||||
open(data) {
|
||||
this.show = true
|
||||
this.loading = false
|
||||
this.workOrder = data.workOrder
|
||||
this.team = data.team
|
||||
this.siteNo = data.siteNo
|
||||
this.partnumber = ''
|
||||
this.specification = ''
|
||||
this.color = ''
|
||||
this.description = ''
|
||||
this.number = ''
|
||||
this.labelCode = ''
|
||||
this.isOnetime = 0
|
||||
this.isBack = 0
|
||||
this.isPolish = 0
|
||||
this.isOut = 0
|
||||
},
|
||||
close() {
|
||||
this.changeFormStatus(2)
|
||||
this.show = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.number-text {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
@ -16,8 +16,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-button v-if="formStatus === 1" type="success" @click="doBtnStartWorkOrder">开启工单</el-button>
|
||||
<el-button v-if="formStatus === 2" type="info" @click="doBtnGenerateLabel">修改合格数</el-button>
|
||||
<el-button v-if="formStatus === 2" type="warning" @click="doBtnEndWorkOrder">结束工单</el-button>
|
||||
<el-button v-if="formStatus != 1" type="info" @click="doBtnGenerateLabel">修改合格数</el-button>
|
||||
<el-button v-if="formStatus != 1" type="warning" @click="doBtnEndWorkOrder">结束工单</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workorder-card-action-box">
|
||||
@ -92,6 +92,7 @@
|
||||
@startWorkOrder="handleStartWorkOrder"
|
||||
@refresh="doRefresh"
|
||||
/>
|
||||
<ScanPackageLabelDialog ref="ScanPackageLabelDialogRef" @changeFormStatus="changeFormStatus" @showWarningMessage="showErrorMessage" @submit="handleStartWorkOrder" />
|
||||
<EndWorkOrderDialog ref="EndWorkOrderDialogRef" @changeFormStatus="changeFormStatus" @endWorkOrder="handleEndWorkOrder" />
|
||||
<GenerateLabelDialog ref="GenerateLabelDialogRef" @generateLabelSuccess="handleGenerateLabelSuccess"></GenerateLabelDialog>
|
||||
</div>
|
||||
@ -101,10 +102,11 @@
|
||||
import StartWorkOrderDialog from './StartWorkOrderDialog.vue'
|
||||
import EndWorkOrderDialog from './EndWorkOrderDialog.vue'
|
||||
import GenerateLabelDialog from './GenerateLabelDialog.vue'
|
||||
import ScanPackageLabelDialog from './ScanPackageLabelDialog.vue'
|
||||
import * as QcBackEndApi from '@/api/qualityManagement/BackEnd/qcBackEndService'
|
||||
export default {
|
||||
name: 'WorkOrderCard',
|
||||
components: { StartWorkOrderDialog, EndWorkOrderDialog, GenerateLabelDialog },
|
||||
components: { StartWorkOrderDialog, EndWorkOrderDialog, GenerateLabelDialog, ScanPackageLabelDialog },
|
||||
props: {
|
||||
message: String,
|
||||
messageClass: String,
|
||||
@ -113,6 +115,7 @@ export default {
|
||||
return {
|
||||
StartWorkOrderDialogRef: null,
|
||||
EndWorkOrderDialogRef: null,
|
||||
ScanPackageLabelDialogRef: null,
|
||||
sessionKey: '_touchScreenB02',
|
||||
|
||||
teamOptions: [],
|
||||
@ -175,6 +178,10 @@ export default {
|
||||
showErrorMessage(code, message) {
|
||||
this.$emit('showWarningMessage', code, message)
|
||||
},
|
||||
// 打开需要扫箱标签菜单
|
||||
showScanPackageLabelMessage(code, message) {
|
||||
this.$emit('showScanPackageLabelMessage', code, message)
|
||||
},
|
||||
async init() {
|
||||
try {
|
||||
// 初始化数据
|
||||
@ -225,7 +232,8 @@ export default {
|
||||
changeFormStatus(type) {
|
||||
this.formStatus = type
|
||||
},
|
||||
setMqttMessage(LabelCode, ComNo, SiteNo) {
|
||||
async setMqttMessage(LabelCode, ComNo, SiteNo) {
|
||||
console.log(this.formStatus)
|
||||
if (SiteNo !== this.site) {
|
||||
return
|
||||
}
|
||||
@ -237,13 +245,33 @@ export default {
|
||||
}
|
||||
// 扫内标签模式
|
||||
if (this.formStatus === 2) {
|
||||
const workorder = this.formData.workOrder
|
||||
const checkRes1 = await QcBackEndApi.CheckPackageIsFullAndNeedScanPackageLabel({ workorder })
|
||||
// 需要扫箱标签
|
||||
if (checkRes1.code === 200 && checkRes1.data) {
|
||||
const obj = {
|
||||
workOrder: workorder,
|
||||
team: this.team,
|
||||
siteNo: this.site,
|
||||
}
|
||||
this.changeFormStatus(3)
|
||||
this.$refs.ScanPackageLabelDialogRef.open(obj)
|
||||
|
||||
//this.$refs.ScanPackageLabelDialogRef.handleScanPackageLabel(LabelCode, ComNo)
|
||||
return
|
||||
}
|
||||
// 扫内标签模式
|
||||
this.handleScanInnerLabel(LabelCode, ComNo)
|
||||
return
|
||||
}
|
||||
// 扫箱标签验证模式
|
||||
if (this.formStatus === 3) {
|
||||
this.$refs.ScanPackageLabelDialogRef.handleScanPackageLabel(LabelCode, ComNo)
|
||||
return
|
||||
}
|
||||
},
|
||||
// 扫内标签的情况
|
||||
handleScanInnerLabel(label = '', comNo = '未知串口') {
|
||||
async handleScanInnerLabel(label = '', comNo = '未知串口') {
|
||||
const params = {
|
||||
workOrder: this.formData.workOrder,
|
||||
partNumber: this.formData.partNumber,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user