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
}
})

View File

@@ -135,7 +135,6 @@ export default {
})
},
success() {
stepDel(this.selectData).then(res => {
alert(res.msg)
this.getDataList()

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() {

View File

@@ -54,7 +54,7 @@
<el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="工艺" align="center" prop="technology" />
<el-table-column label="钽靶编号" align="center" prop="id" />
<el-table-column label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.state===0" type="info">未开始</el-tag>