更新plus

This commit is contained in:
2024-12-25 18:08:09 +08:00
parent f49879b7aa
commit ec00532542
5 changed files with 201 additions and 110 deletions

View File

@@ -387,7 +387,7 @@
<script>
import { messageData, messageUpdate } from '@/api/system/resource'
import {messageData, messageUpdate} from '@/api/system/resource'
import {
listMaterial,
materialCheckFlag, materialFinalData, materialNext,
@@ -397,7 +397,7 @@ import {
stepSubmit,
stepUpdate
} from '@/api/system/process'
import { getFaultMessage, newIP } from '@/api/system/common'
import {getFaultMessage, newIP} from '@/api/system/common'
export default {
name: 'index',
@@ -471,16 +471,15 @@ export default {
stepSubmit(step).then(res => {
// 判断目前的物料是否为第一个或者最后一个
materialCheckFlag(this.processing).then(res => {
if (res.data === 0) {
this.stepFlag = step.state
this.nextMaterial()
if (res.data === 1) {
// 表示当前料进行处理了
this.stepFlag = step.state
this.nextMaterial()
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
}
})
})
})
@@ -491,12 +490,14 @@ export default {
stepUpdate(step).then(res => {
materialCheckFlag(processing).then(res => {
this.stepFlag = step.state
this.nextMaterial()
if (res.data === 0) {
if (res.data === 1) {
this.checkFinal()
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
} else {
this.nextMaterial()
}
})
})
@@ -516,9 +517,7 @@ export default {
this.getDataList()
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
})
})
}
},
@@ -529,13 +528,29 @@ export default {
let stepFlag = this.stepFlag
if (step && step.state !== 0 && stepFlag !== -1 && stepFlag !== 0) {
let material = this.processing
// 这里又进行了一次校验
material.stepFlag = stepFlag
materialNext(material).then(res => {
if (res.data === 2) {
// 如果返回值为2表示全部发生异常了
this.finalFlag = 1
this.dialogVisible = true
this.finalData = this.dataList
}
if (res.data === 0) {
// 返回值等于0 表示没有切换物料
}
this.getDataList()
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
if (res.data === 1) {
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
} else {
this.submitButton = res.data === 0
}
// 表示这是第一次穷尽
if (this.finalFlag === 0) {
// 检测是否穷尽
@@ -551,7 +566,8 @@ export default {
state: 1
}
materialStart(params).then(res => {
if (res.data !== 0) {
if (res.data === 1) {
this.$message('开始轧制')
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
this.getDataList()
@@ -563,29 +579,25 @@ export default {
},
finishProcess() {
if (this.processing.batchId === -1) {
alert('该批次存在某道次尚未处理')
} else {
stepCheck(this.processing.batchId).then(res => {
if (res.data === 0) {
// get
stepFinish(this.processing.batchId).then(res => {
alert('轧制完成')
})
stepCheck(this.processBatchId).then(res => {
if (res.data === 0) {
// get
stepFinish(this.processBatchId).then(res => {
alert('轧制完成')
})
this.dataList = []
this.passList = []
this.processing = { batchId: -1, id: null }
} else {
alert('该批次存在某道次尚未处理')
}
})
}
this.dataList = []
this.passList = []
this.processing = {batchId: -1, id: null}
} else {
alert('该批次存在某道次尚未处理')
}
})
},
checkFinal() {
stepCheck(this.processing.batchId).then(res => {
stepCheck(this.processBatchId).then(res => {
// 返回值等于0说明都轧完了
if (res.data === 0) {
this.finalFlag = 1
@@ -607,7 +619,6 @@ export default {
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 1
@@ -615,13 +626,12 @@ export default {
listMaterial(params).then(res => {
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] : {
batchId: -1,
id: null
}
this.processBatchId = res.rows[0].batchId
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
if (this.processing.state === 3) {
@@ -632,7 +642,7 @@ export default {
})
}
if (this.processing.batchId != -1 && this.processing.state != 3) {
if (this.processing.batchId !== -1 && this.processing.state !== 3) {
this.getStepDataList()
if (this.newHTML) {
this.submitButtonCheck()
@@ -640,6 +650,7 @@ export default {
}
}
})
this.dataList = res.rows
}
})
},
@@ -650,7 +661,7 @@ export default {
batchId: this.processing.batchId
}
stepProcess(params).then(res => {
this.nowPass = res.data.filter(item => item.operation == 1)[0]
this.nowPass = res.data.filter(item => item.operation === 1)[0]
this.passList = res.data
this.stepFlag = this.nowPass.state
let nowPass = this.nowPass
@@ -658,9 +669,9 @@ export default {
if (temp === 1) {
this.circleStart = 0
} else if (temp === 2) {
this.circleStart = 90
} else if (temp === 3) {
this.circleStart = 45
} else if (temp === 3) {
this.circleStart = 90
} else if (temp === 0) {
this.circleStart = 315
} else if (temp === 4) {
@@ -705,14 +716,15 @@ export default {
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault()
this.getPLCData()
this.getDataList() // 接口方法
}, 2000)
// TODO
// clearInterval(this.intervalTime)
// this.getDataList() // 接口方法
//
// this.intervalTime = setInterval(() => {
// this.getFault()
// this.getPLCData()
// this.getDataList() // 接口方法
// }, 2000)
},
computed: {},
created() {