diff --git a/src/views/work/abnormal_process/index.vue b/src/views/work/abnormal_process/index.vue index 5383cb0..9eb0067 100644 --- a/src/views/work/abnormal_process/index.vue +++ b/src/views/work/abnormal_process/index.vue @@ -70,7 +70,9 @@
- +
@@ -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 } }) diff --git a/src/views/work/abnormal_product/index.vue b/src/views/work/abnormal_product/index.vue index f0f1508..0c9f14f 100644 --- a/src/views/work/abnormal_product/index.vue +++ b/src/views/work/abnormal_product/index.vue @@ -135,7 +135,6 @@ export default { }) }, success() { - stepDel(this.selectData).then(res => { alert(res.msg) this.getDataList() diff --git a/src/views/work/process/index.vue b/src/views/work/process/index.vue index b07643a..2a38298 100644 --- a/src/views/work/process/index.vue +++ b/src/views/work/process/index.vue @@ -274,30 +274,52 @@ + style="width: 100%"> +
{{ scope.row.id }}
-
- - {{ scope.row.width }} +
-
+
+
+ + + + - +
-
+
+
+ + + +
-
@@ -305,13 +327,51 @@
- - + +
-
+
+
+ + + + +
-
+
+
+ + + + + +
-
+
+
+ + + + +
-
@@ -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() { diff --git a/src/views/work/record/index.vue b/src/views/work/record/index.vue index 61b170f..21be023 100644 --- a/src/views/work/record/index.vue +++ b/src/views/work/record/index.vue @@ -54,7 +54,7 @@ - +
批号