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

@@ -274,30 +274,52 @@
<el-table
:data="finalData"
stripe
style="width: 100%"
>
style="width: 100%">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column
prop="id"
label="钽靶批号"
width="180"
>
<templete slot-scope="scope">
<div v-if="scope.row.id">{{ scope.row.id }}</div>
<div class="kong" v-else>-</div>
</templete>
</el-table-column>
<el-table-column
prop="finalWidth"
label="最终厚度"
<el-table-column
prop="width"
label="轧前厚度"
width="180"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalWidth"
placeholder="请输入该批号的最终厚度"
<div v-if="scope.row.width">{{ scope.row.width }}</div>
<div class="kong" v-else>-</div>
</templete>
</el-table-column>
<el-table-column
prop="finalWidth"
label="最终厚度D1"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.finalWidth"
placeholder="请输入该批号的最终厚度1"
></el-input>
<el-input v-if="scope.row.id && scope.row.state==3" v-model="scope.row.finalWidth"
<el-input v-if="scope.row.id && scope.row.state===3" v-model="scope.row.finalWidth"
placeholder="该批次发生异常" disabled
></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
</templete>
</el-table-column>
<el-table-column
prop="finalWidth2"
label="最终厚度D2"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.finalWidth2"
placeholder="请输入该批号的最终厚度2"
></el-input>
<el-input v-if="scope.row.id && scope.row.state===3" v-model="scope.row.finalWidth2"
placeholder="该批次发生异常" disabled
></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
@@ -305,13 +327,51 @@
</el-table-column>
<el-table-column
prop="finalDiameter"
label="最终直径"
label="最终直径L1"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalDiameter"
placeholder="请输入该批号的最终直径"
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.finalDiameter"
placeholder="请输入该批号的最终直径1"
></el-input>
<el-input v-if="scope.row.id && scope.row.state==3 " placeholder="该批次发生异常" disabled></el-input>
<el-input v-if="scope.row.id && scope.row.state===3 " placeholder="该批次发生异常" disabled></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
</templete>
</el-table-column>
<el-table-column
prop="finalDiameter2"
label="最终直径L2"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.finalDiameter2"
placeholder="请输入该批号的最终直径2"
></el-input>
<el-input v-if="scope.row.id && scope.row.state===3 " placeholder="该批次发生异常" disabled></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
</templete>
</el-table-column>
<el-table-column
prop="createBy"
label="轧制人员1"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.createBy"
placeholder="请输入轧制人员"
></el-input>
<el-input v-if="scope.row.id && scope.row.state===3 " placeholder="该批次发生异常" disabled></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
</templete>
</el-table-column>
<el-table-column
prop="updateBy"
label="轧制人员2"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!==3" v-model="scope.row.updateBy"
placeholder="请输入轧制人员2"
></el-input>
<el-input v-if="scope.row.id && scope.row.state===3 " placeholder="该批次发生异常" disabled></el-input>
<div class="kong" v-if="!scope.row.id">-</div>
</templete>
</el-table-column>
@@ -399,41 +459,39 @@ export default {
submit(state) {
this.submitButton = false
// 获取正在运行的对象
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 => {
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 => {
// 判断目前的物料是否为第一个或者最后一个
materialCheckFlag(this.processing).then(res => {
if (res.data === 0) {
// 表示当前料进行处理了
this.stepFlag = step.state
this.nextMaterial()
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
}
})
materialCheckFlag(this.processing).then(res => {
this.stepFlag = params.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
if (res.data === 0) {
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
}
})
})
}
} else if (state == 1) {
} else if (state === 1) {
let processing = this.processing
params.state = 1
stepUpdate(params).then(res => {
step.state = 1
stepUpdate(step).then(res => {
materialCheckFlag(processing).then(res => {
this.stepFlag = params.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
this.stepFlag = step.state
this.nextMaterial()
if (res.data === 0) {
this.$notify({
title: '提示',
@@ -441,25 +499,14 @@ export default {
})
}
})
})
}
// 表示这是第一次穷尽
if (this.finalFlag == 0) {
// 检测是否穷尽
this.checkFinal()
}
},
// 下道次
nextStep() {
let params = this.nowPass
if (params && params.state == 0) {
if (params && params.state === 0) {
alert('请操作当前道次')
this.nextStepLoading = false
} else {
@@ -477,19 +524,25 @@ 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.stepFlag
if (params && params.state != 0 && stepFlag != -1 && stepFlag != 0) {
params = this.processing
params.stepFlag = stepFlag
materialNext(params).then(res => {
if (step && step.state !== 0 && stepFlag !== -1 && stepFlag !== 0) {
let material = this.processing
// 这里又进行了一次校验
material.stepFlag = stepFlag
materialNext(material).then(res => {
this.getDataList()
})
setTimeout(() => {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
// 表示这是第一次穷尽
if (this.finalFlag === 0) {
// 检测是否穷尽
this.checkFinal()
}
})
}, 500)
})
}
},
@@ -501,10 +554,8 @@ export default {
if (res.data !== 0) {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
this.getDataList()
})
alert('开始轧制')
this.getDataList()
} else {
alert('该批次已经开始轧制')
}
@@ -512,14 +563,14 @@ export default {
},
finishProcess() {
if (this.processing.batchId == -1) {
if (this.processing.batchId === -1) {
alert('该批次存在某道次尚未处理')
} else {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
if (res.data === 0) {
// get
stepFinish(this.processing.batchId).then(res => {
alert('该批次轧制完成')
alert('轧制完成')
})
this.dataList = []
@@ -535,7 +586,8 @@ export default {
checkFinal() {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
// 返回值等于0说明都轧完了
if (res.data === 0) {
this.finalFlag = 1
this.dialogVisible = true
this.finalData = this.dataList
@@ -555,6 +607,7 @@ export default {
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 1
@@ -563,32 +616,30 @@ export default {
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) {
let params = this.processing
params.stepFlag = 1
materialNext(this.processing).then(res => {
this.getDataList()
})
setTimeout(() => {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
if (this.processing.state === 3) {
let params = this.processing
params.stepFlag = 1
materialNext(this.processing).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
}
}
})
}
})
},
@@ -602,38 +653,33 @@ export default {
this.nowPass = res.data.filter(item => item.operation == 1)[0]
this.passList = res.data
this.stepFlag = this.nowPass.state
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() {