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

View File

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

View File

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

View File

@@ -54,7 +54,7 @@
<el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" /> <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="状态"> <el-table-column label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.state===0" type="info">未开始</el-tag> <el-tag v-if="scope.row.state===0" type="info">未开始</el-tag>

View File

@@ -35,8 +35,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8082`, target: `http://localhost:8081`,
// target: `http://localhost:8081`, // target: `http://localhost:8082`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''