This commit is contained in:
2024-12-24 09:56:43 +08:00
parent a80c644265
commit 4d2fd51cd1
5 changed files with 255 additions and 228 deletions

View File

@@ -70,7 +70,9 @@
</div>
<div style="width:45%;">
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap" style="font-size: small">
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="font-size: small"
>
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">批号</th>
@@ -381,7 +383,7 @@ export default {
messageData: {},
newHTML: true,
nowPass: {},
nextStepLoading:false
nextStepLoading: false
}
},
methods: {
@@ -399,42 +401,39 @@ export default {
submit(state) {
// 获取正在运行的对象
let params = this.passList.filter(item => item.operation == 1)[0]
if (state == 2) {
if (confirm('是否将钽靶【' + params.materialId + '】移动至异常品内处理?')) {
params.state = state
let data = this.processing
data.state = 3
materialUpdate(data)
stepSubmit(params).then(res => {
this.getStepDataList()
})
materialCheckFlagError(this.processing).then(res => {
this.nextStepFlagError = params.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
if (res.data === 0) {
this.$notify({
title: '提醒',
message: '该道次已完成,请点击下道次'
let step = this.passList.filter(item => item.operation === 1)[0]
if (state === 2) {
if (confirm('是否将钽靶【' + step.materialId + '】移动至异常品内处理?')) {
step.state = state
let material = this.processing
material.state = 3
materialUpdate(material).then(() => {
stepSubmit(step).then(res => {
this.getStepDataList()
materialCheckFlagError(this.processing).then(res => {
this.nextStepFlagError = step.state
this.nextMaterial()
if (res.data === 0) {
this.$notify({
title: '提醒',
message: '该道次已完成,请点击下道次'
})
}
})
}
})
})
}
} else if (state == 1) {
let processing = this.processing
let pass = this.passList.filter(item => item.operation == 1)[0]
pass.state = 1
stepUpdate(pass).then(res => {
} else if (state === 1) {
let material = this.processing
let step = this.passList.filter(item => item.operation === 1)[0]
step.state = 1
stepUpdate(step).then(res => {
this.getStepDataList()
materialCheckFlagError(processing).then(res => {
this.nextStepFlagError = pass.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
materialCheckFlagError(material).then(res => {
this.nextStepFlagError = step.state
this.nextMaterial()
if (res.data === 0) {
this.$notify({
title: '提醒',
@@ -442,32 +441,22 @@ export default {
})
}
})
})
}
// 表示这是第一次穷尽
if (this.finalFlag == 0) {
// 检测是否穷尽
this.checkFinal()
}
},
// 下道次
nextStep() {
let params = this.passList.filter(item => item.operation == 1)[0]
if (params && params.state === 0) {
let step = this.passList.filter(item => item.operation === 1)[0]
if (step && step.state === 0) {
alert('请操作当前道次')
this.nextStepLoading = false
} else {
this.nextStepLoading = true
stepNextError(params).then(res => {
stepNextError(step).then(res => {
this.getDataList()
this.nextStepLoading = false
materialNextStepFlagError().then(res => {
this.nextStepLoading = false
this.submitButton = res.data === 0
})
})
@@ -475,19 +464,22 @@ export default {
},
nextMaterial() {
let params = this.passList.filter(item => item.operation == 1)[0]
let step = this.passList.filter(item => item.operation === 1)[0]
let stepFlag = this.nextStepFlagError
if (params && params.state != 0 && stepFlag != -1 && stepFlag != 0) {
params = this.processing
params.stepFlag = stepFlag
materialNextError(params).then(res => {
if (step && step.state !== 0 && stepFlag !== -1 && stepFlag !== 0) {
let material = this.processing
material.stepFlag = stepFlag
materialNextError(material).then(res => {
this.getDataList()
})
setTimeout(() => {
// 表示这是第一次穷尽
if (this.finalFlag === 0) {
// 检测是否穷尽
this.checkFinal()
}
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
}, 500)
})
}
},
@@ -500,7 +492,6 @@ export default {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
alert('开始轧制')
this.getDataList()
} else {
@@ -511,7 +502,7 @@ export default {
finishProcess() {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
if (res.data === 0) {
// get
stepFinishError(this.processing.batchId)
alert('该批次轧制完成')
@@ -526,7 +517,7 @@ export default {
checkFinal() {
stepCheckAbnormal(this.processing.batchId).then(res => {
if (res.msg == -1) {
if (res.data === 0) {
this.finalFlag = 1
this.dialogVisible = true
this.finalData = this.dataList
@@ -552,34 +543,31 @@ export default {
state: 5
}
listMaterial(params).then(res => {
if (res.total != 0) {
if (res.total !== 0) {
this.batchSize = res.total
this.dataList = res.rows
this.processing = res.rows.filter(item => item.operation == 1)[0] ? res.rows.filter(item => item.operation == 1)[0] : {
this.processing = res.rows.filter(item => item.operation === 1)[0] ? res.rows.filter(item => item.operation === 1)[0] : {
batchId: -1,
id: null
}
if (this.processing.state === 3) {
params = this.processing
params.stepFlag = 1
materialNextError(params).then(res => {
this.getDataList()
})
setTimeout(() => {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
if (this.processing.state === 3) {
let material = this.processing
material.stepFlag = 1
materialNextError(material).then(res => {
this.getDataList()
})
}, 500)
}
if (this.processing.batchId != -1 && this.processing.state != 3) {
this.getStepDataList()
if (this.newHTML) {
this.submitButtonCheck()
this.newHTML = false
}
}
if (this.processing.batchId !== -1 && this.processing.state !== 3) {
this.getStepDataList()
if (this.newHTML) {
this.submitButtonCheck()
this.newHTML = false
}
}
})
}
@@ -593,41 +581,37 @@ export default {
}
stepProcess(params).then(res => {
this.passList = res.data
this.nextStepFlagError = res.data.filter(item => item.operation == 1)[0].state
this.nowPass = this.passList.filter(item => item.operation == 1)[0]
this.nextStepFlagError = res.data.filter(item => item.operation === 1)[0].state
this.nowPass = this.passList.filter(item => item.operation === 1)[0]
let nowPass = this.nowPass
let temp = nowPass.step % 8
if (temp === 1) {
this.circleStart = 0
} else if (temp === 2) {
this.circleStart = 90
} else if (temp === 3) {
this.circleStart = 45
} else if (temp === 0) {
this.circleStart = 315
} else if (temp === 4) {
this.circleStart = 135
} else if (temp === 5) {
this.circleStart = 180
} else if (temp === 6) {
this.circleStart = 225
} else if (temp === 7) {
this.circleStart = 270
}
})
let nowPass = this.nowPass
let temp = nowPass.step % 8
if (temp === 1) {
this.circleStart = 0
} else if (temp === 2) {
this.circleStart = 90
} else if (temp === 3) {
this.circleStart = 45
} else if (temp === 0) {
this.circleStart = 315
} else if (temp === 4) {
this.circleStart = 135
} else if (temp === 5) {
this.circleStart = 180
} else if (temp === 6) {
this.circleStart = 225
} else if (temp === 7) {
this.circleStart = 270
}
},
getPLCData() {
let params = this.passList.filter(item => item.operation == 1)[0]
let params = this.passList.filter(item => item.operation === 1)[0]
stepPLC(params).then(res => {
this.plcData = res.data
})
},
getFault() {
getFaultMessage().then(res => {
if (res.data !== 0) {
@@ -643,9 +627,7 @@ export default {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
this.passList.forEach(item => {
if (item.operation === 1 && item.state === 0) {
this.submitButton = true
}
})