Initial commit

This commit is contained in:
2024-11-25 09:33:57 +08:00
commit a80c644265
521 changed files with 29740 additions and 0 deletions

View File

@@ -0,0 +1,862 @@
<template>
<div>
<!--导航栏 -->
<div class="hxjx_root">
<div style="width:55%;overflow:hidden;">
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">钽靶批号</th>
<th class="hxjx_table_th_width">规格</th>
<th class="hxjx_table_th_width">工艺</th>
<th class="hxjx_table_th_width">直径</th>
</tr>
</thead>
<tbody>
<tr v-if="dataList.length>0" v-for="(item,index) in dataList">
<td class="hxjx_table_btnColumn"
:class="[{table_td_warn: item.operation==1},{table_td_error:item.state==3}]"
>{{ index + 1 }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_warn: item.operation==1},{table_td_error:item.state==3}]"
>{{ item.id }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_warn: item.operation==1},{table_td_error:item.state==3}]"
>
{{ item.specification }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_warn: item.operation==1},{table_td_error:item.state==3}]"
>
{{ item.technology }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_warn: item.operation==1},{table_td_error:item.state==3}]"
>{{ item.diameter }}
</td>
</tr>
<tr v-if="dataList.length<=0">
<td class="hxjx_table_btnColumn"
style="height: 150px;vertical-align: middle;text-align: center;" colspan="5" rowspan="8"
>
等待下一批次材料轧制
</td>
</tr>
</tbody>
</table>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td class="hxjx_footer_main" style="padding: 0;">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="nextStep" v-loading="nextStepLoading"
>下道次</a>
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="startProcess"
>开始轧制</a>
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="finishProcess"
style="margin-right: 0;"
>轧制完成</a>
</div>
</td>
</tr>
</table>
</div>
<div style="width:45%;">
<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>
<th class="hxjx_table_th_width">轧制道次</th>
<th class="hxjx_table_th_width">压下量</th>
<th class="hxjx_table_th_width">辊缝设定值</th>
<th class="hxjx_table_th_width">喂料角度</th>
<th class="hxjx_table_th_width">完成</th>
</tr>
</thead>
<tbody>
<td class="hxjx_table_btnColumn" rowspan="5"
style="vertical-align: middle;text-align: center;" v-if="processing.id!=null"
>
{{ processing.id }}
</td>
<td class="hxjx_table_btnColumn" rowspan="5"
style="vertical-align: middle;text-align: center;" v-else
>
当前无可用操作批号
</td>
<tr v-for="(item,index) in passList">
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation==1}">{{ item.step }}</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation==1}">
{{ item.reduction }}
</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation==1}">{{ item.setValue }}
</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation==1}">{{ item.angle }}</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation==1}">
<div class="circle_finish" v-if="item.state==1"></div>
<div class="circle_error" v-if="item.state==2"></div>
<div class="circle_unstart" v-if="item.state==0 && item.operation===1"></div>
<div class="circle_unstart2" v-if="item.state==0 && item.operation!==1"></div>
</td>
</tr>
<tr v-if="passList==[]" v-for="item in 4">
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn">
<div class="circle_unstart"></div>
</td>
</tr>
</tbody>
</table>
<!-- 旋转角度 -->
<div style="width:100%;height:350px;display: flex;justify-content: space-between">
<div style="display: flex;margin-bottom: 15px;">
<img src="../../../assets/img/FlowChart-2-1.png" class="imageCircle"
:style="{transform: 'rotate(-' + circleStart + 'deg)'}"
/>
<img src="../../../assets/img/FlowChart-2-2.png" class="image-circle-rows">
</div>
<div style="">
<el-button type="success" plain
@click="submit(1)" :loading="!submitButton"
>确认
</el-button>
<el-button type="danger" plain
style="margin-right: 0;" :loading="!submitButton" @click="submit(2)"
>异常
</el-button>
</div>
</div>
</div>
</div>
<div style="margin-top: -150px">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">传动侧油缸位置:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="runPosition"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.circleContainerAddress+'mm'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">操作侧油缸位置:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="operatePosition"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.operationContainerAddress+'mm'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">传动侧压力:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="runPressure"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.convey+'吨'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">操作侧压力:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="operatePressure"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.operation+'吨'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">上辊电流:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="upElectric"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.highElectric+'A'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">下辊电流:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="downElectric"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.lowElectric+'A'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">轧机反馈速度:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="speed"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.machineBackSpeed+'米/分钟'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label"></td>
<td class="hxjx_table_label_format hxjx_table_text"></td>
</tr>
</tbody>
</table>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.createTime }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.faultName }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{ messageData.faultMessage }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure"
>确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
<el-dialog
title="请填写轧制后的最终厚度与直径"
:visible.sync="dialogVisible"
width="70%"
>
<el-table
:data="finalData"
stripe
style="width: 100%"
>
<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="最终厚度"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalWidth"
placeholder="请输入该批号的最终厚度"
></el-input>
<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="finalDiameter"
label="最终直径"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalDiameter"
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>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="dialogVisible = false"> </el-button>-->
<el-button type="primary" @click="submitFinalData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { messageData, messageUpdate } from '@/api/system/resource'
import {
listMaterial,
materialFinalData,
materialUpdate,
stepCheck, stepPLC, stepProcess,
stepSubmit,
stepUpdate
} from '@/api/system/process'
import {
materialAbnormalStart,
materialCheckFlagError, materialNextError,
materialNextStepFlagError, stepCheckAbnormal, stepFinishError,
stepNextError
} from '@/api/system/abnormal'
import { getFaultMessage, newIP } from '@/api/system/common'
export default {
name: 'index',
data() {
return {
MessageParams: {
state: 0
},
showFault: false,
dialogVisible: false,
passList: [],
dataList: [],
processing: {
id: null,
batchId: ''
},
finalData: [],
activeIndex: 0,
batchSize: 0,
flag: 1,
intervalTime: '',
submitButton: false,
// 保证同一批次只弹出一次
finalFlag: 0,
plcData: {
circleContainerAddress: 0.00,
operationContainerAddress: 0.00,
convey: 0.00,
operation: 0.00,
highElectric: 0.00,
lowElectric: 0.00,
machineBackSpeed: 0.00,
agc: 0.00,
ordinary: 0.00
},
nextStepFlagError: -1,
messageData: {},
newHTML: true,
nowPass: {},
nextStepLoading:false
}
},
methods: {
ensure() {
let data = {
state: 1
}
messageUpdate(data).then(res => {
this.showFault = false
})
},
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: '该道次已完成,请点击下道次'
})
}
})
}
} 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 => {
this.getStepDataList()
materialCheckFlagError(processing).then(res => {
this.nextStepFlagError = pass.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
if (res.data === 0) {
this.$notify({
title: '提醒',
message: '该道次已完成,请点击下道次'
})
}
})
})
}
// 表示这是第一次穷尽
if (this.finalFlag == 0) {
// 检测是否穷尽
this.checkFinal()
}
},
// 下道次
nextStep() {
let params = this.passList.filter(item => item.operation == 1)[0]
if (params && params.state === 0) {
alert('请操作当前道次')
this.nextStepLoading = false
} else {
this.nextStepLoading = true
stepNextError(params).then(res => {
this.getDataList()
this.nextStepLoading = false
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
})
}
},
nextMaterial() {
let params = 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 => {
this.getDataList()
})
setTimeout(() => {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
}, 500)
}
},
startProcess() {
let params = {
state: 5
}
materialAbnormalStart(params).then(res => {
if (res.data !== 0) {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
alert('开始轧制')
this.getDataList()
} else {
alert('该批次已经开始轧制')
}
})
},
finishProcess() {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
// get
stepFinishError(this.processing.batchId)
alert('该批次轧制完成')
this.dataList = []
this.passList = []
this.processing = { batchId: -1, id: null }
} else {
alert('该批次存在某道次尚未处理')
}
})
},
checkFinal() {
stepCheckAbnormal(this.processing.batchId).then(res => {
if (res.msg == -1) {
this.finalFlag = 1
this.dialogVisible = true
this.finalData = this.dataList
}
})
},
// 提交最终数据
submitFinalData() {
let data = this.finalData
materialFinalData(data).then(res => {
if (res.code === 200) {
this.$message('提交成功,请点击轧制完成')
this.dialogVisible = false
}
})
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 5
}
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
}
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
})
}, 500)
}
if (this.processing.batchId != -1 && this.processing.state != 3) {
this.getStepDataList()
if (this.newHTML) {
this.submitButtonCheck()
this.newHTML = false
}
}
}
})
},
getStepDataList() {
let params = {
materialId: this.processing.id,
delFlag: 1,
batchId: this.processing.batchId
}
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]
})
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]
stepPLC(params).then(res => {
this.plcData = res.data
})
},
getFault() {
getFaultMessage().then(res => {
if (res.data !== 0) {
this.showFault = true
messageData(this.MessageParams).then(res => {
this.messageData = res.data
})
}
})
},
submitButtonCheck() {
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
this.passList.forEach(item => {
if (item.operation === 1 && item.state === 0) {
this.submitButton = true
}
})
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault()
this.getPLCData()
this.getDataList() // 接口方法
}, 3000)
},
computed: {},
created() {
newIP()
this.getFault()
materialNextStepFlagError().then(res => {
this.submitButton = res.data === 0
})
},
beforeDestroy() {
// 清除定时器
clearInterval(this.intervalTime)
}
}
</script>
<style scoped>
.imageCircle {
position: absolute;
width: 200px;
height: 200px;
}
.image-circle-rows {
z-index: 999;
position: relative;
width: 200px;
height: 200px;
}
.hxjx_root {
padding: 20px;
display: flex;
flex-wrap: wrap;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 1rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: right !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
.table td, .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
.circle_finish {
width: 20px;
height: 20px;
background-color: #28a745;
border-radius: 50%;
}
.circle_error {
width: 20px;
height: 20px;
background-color: #dc3545;
border-radius: 50%;
}
.circle_unstart {
width: 20px;
height: 20px;
background-color: yellow;
border-radius: 50%;
}
.circle_unstart2 {
width: 20px;
height: 20px;
background-color: #ccc;
border-radius: 50%;
}
.table_td_warn {
background-color: yellow;
}
.table_td_error {
background-color: #ccc;
}
.table_td_unstart {
background-color: #eaeaea;
}
.kong {
display: flex;
justify-content: center;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_popup {
position: fixed;
left: 400px;
top: 200px;
width: 640px;
height: 360px;
font-size: 14px;
}
.hxjx_popup_header_danger {
width: 100%;
height: 40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width: 100%;
height: 320px;
padding: 20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>

View File

@@ -0,0 +1,315 @@
<template>
<div>
<!--导航栏 -->
<div class="hxjx_root">
<!--产品信息-->
<div>
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">选择</th>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">钽靶批号</th>
<th class="hxjx_table_th_width">规格</th>
<th class="hxjx_table_th_width">工艺</th>
<th class="hxjx_table_th_width">当前道次</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in dataList">
<td class="hxjx_table_btnColumn">
<input :value="item" v-model="selectData" type="checkbox" style="width:16px;height:16px;"
name="technology"/>
</td>
<td class="hxjx_table_btnColumn">{{index + 1}}</td>
<td class="hxjx_table_btnColumn">{{item.materialId}}</td>
<td class="hxjx_table_btnColumn">{{item.specification}}</td>
<td class="hxjx_table_btnColumn">{{item.technology}}</td>
<td class="hxjx_table_btnColumn">{{item.step}}</td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<div>
<table class="table">
<tr>
<td class="hxjx_footer_main" style="padding: 0;">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="success">处理</a>
</div>
</td>
</tr>
</table>
</div>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{messageData.createTime}}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{messageData.faultName}}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{messageData.faultMessage}}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure">确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import { getFaultMessage, newIP } from '@/api/system/common'
import { messageData, messageUpdate } from '@/api/system/resource'
import { stepAbnormal, stepDel } from '@/api/system/abnormal'
export default {
name: 'index',
data() {
return {
MessageParams: {
state: 0
},
showFault: false,
dataList: [],
selectData: [],
messageData: {}
};
},
methods: {
ensure() {
let data = {
state:1
}
messageUpdate(data).then(res => {
this.showFault = false
})
},
getDataList() {
stepAbnormal().then(res => {
this.dataList = res.data
})
},
success() {
stepDel(this.selectData).then(res => {
alert(res.msg)
this.getDataList()
})
},
getFault() {
getFaultMessage().then(res => {
if (res.data !== 0) {
this.showFault = true
messageData(this.MessageParams).then(res => {
this.messageData = res.data;
})
}
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault();
this.getDataList(); // 接口方法
}, 3000);
},
created() {
newIP();
this.getFault()
this.getDataList()
},
}
</script>
<style scoped>
.hxjx_root {
padding: 20px;
display: table;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 1rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: right !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
.table td, .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_popup {
position: fixed;
left: 400px;
top: 200px;
width: 640px;
height: 360px;
font-size: 14px;
}
.hxjx_popup_header_danger {
width: 100%;
height: 40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width: 100%;
height: 320px;
padding: 20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>

View File

@@ -0,0 +1,522 @@
<template>
<div>
<!--导航栏 -->
<div class="hxjx_root">
<!--产品信息-->
<div style="width:60%;">
<span>产品信息:</span>
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">钽靶批号</th>
<th class="hxjx_table_th_width">规格</th>
<th class="hxjx_table_th_width">工艺</th>
<th class="hxjx_table_th_width">直径</th>
</tr>
</thead>
<tbody>
<tr v-if="dataList.length>0 " v-for="(item,index) in dataList" @click="getTechnologyInfo(index)">
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ index + 1 }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.id }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.specification }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.technology }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.diameter }}
</td>
</tr>
</tbody>
</table>
</div>
<!--粗轧道次表-->
<div style="width:60%;" id="rollingpass">
<span>粗轧道次表:</span>
<!-- 表1 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="5" rowspan="2">
<span id="hxjx-table-title"></span>
轧制工艺单
</th>
<th class="hxjx_table_th_width table_tdth" colspan="4"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth">制作人</th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth">审核人</th>
<th class="hxjx_table_th_width table_tdth"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">道次</th>
<th class="hxjx_table_th_width table_tdth" colspan="3">粗轧工艺设计</th>
<th class="hxjx_table_th_width table_tdth" colspan="3">检移票号码</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">粗轧操作记录</th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth">压下量</th>
<th class="hxjx_table_th_width table_tdth">轧前厚度</th>
<th class="hxjx_table_th_width table_tdth">轧后厚度</th>
<th class="hxjx_table_th_width table_tdth">喂料角度</th>
<th class="hxjx_table_th_width table_tdth">设定值</th>
<th class="hxjx_table_th_width table_tdth">判定确认</th>
<th class="hxjx_table_th_width table_tdth">程序设定员</th>
<th class="hxjx_table_th_width table_tdth">备注</th>
</tr>
</thead>
<tbody id="hxjx-tbody-one">
<tr v-for="(item,index) in technologyInfoList">
<td class="hxjx_table_btnColumn table_tdth">{{ item.step }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.reduction }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.thicknessFront }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.thicknessBehind }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.angle }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.setValue }}</td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
</tr>
</tbody>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="2">粗轧后厚度</th>
<th class="hxjx_table_th_width table_tdth" colspan="2"></th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth">轧制员</th>
<th class="hxjx_table_th_width table_tdth" colspan="3"></th>
</tr>
</thead>
</table>
<!-- 表2 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">道次</th>
<th class="hxjx_table_th_width table_tdth" colspan="5">四辊精轧记录</th>
<th class="hxjx_table_th_width table_tdth" colspan="3" rowspan="2" style="vertical-align: middle;">
程序设定员
</th>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">备注</th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="2">设定值范围(±0.2)</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">辊缝设定</th>
<th class="hxjx_table_th_width table_tdth">判定</th>
</tr>
</thead>
<tbody id="hxjx-tbody-two">
<tr v-for="(item,index) in technologyInfoListByFour">
<td class="hxjx_table_btnColumn table_tdth">{{ item.step }}</td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2">{{ item.setValue }}</td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
</tr>
</tbody>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="3">
厚度标准值
<span id="hxjx-table-thickness"></span>
</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">精轧后厚度值</th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth" colspan="2">OK NG </th>
<th class="hxjx_table_th_width table_tdth"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="3">轧制日期</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">轧制人员签字确认</th>
<th class="hxjx_table_th_width table_tdth" colspan="5"></th>
</tr>
</thead>
</table>
<!-- 表3 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="9">
精轧参数参考设定值实际压下量根据产品厚度及厚度均匀性进行设定精轧实际设定值在设定值范围内即可
</th>
</tr>
</thead>
</table>
</div>
<!-- 按钮操作 -->
</div>
<div style="display: flex;justify-content: center;">
<div class="">
<el-button href="#" type="primary"
style="margin-right: 0;" @click="success"
>确定
</el-button>
</div>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.createTime }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.faultName }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{ messageData.faultMessage }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure"
>确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import { getFaultMessage, newIP } from '@/api/system/common'
import { listTechnology, messageData, messageUpdate } from '@/api/system/resource'
import { materialAbnormalList, materialSubmit } from '@/api/system/abnormal'
export default {
name: 'index',
data() {
return {
MessageParams: {
state: 0
},
showFault: false,
dataList: [],
indexSelect: 0,
// 粗轧请求参数
params: {
state: 0,
pageSize: 999
},
// 精轧请求参数
params2: {
state: 1,
pageSize: 999
},
technologyInfoList: [],
technologyInfoListByFour: [],
messageData: {}
}
},
methods: {
ensure() {
let data = {
state: 1
}
messageUpdate(data).then(res => {
this.showFault = false
})
},
success() {
if (this.dataList.length == 0) {
alert('钽靶原料列表为空,不可提交')
return
// TODO 考虑原料列表队列问题 及上一批材料未处理完毕 又来了一批材料
}
let data = {
batchId: this.dataList[0].batchId,
state: 4
}
materialSubmit(data).then(res => {
if (res.data !== 0) {
// 提交成功 给个提醒
// 列表制空
alert('异常钽靶料成功提交至异常轧制页面')
this.dataList = []
} else {
alert('提交失败,请检查工艺是否相同')
}
})
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 4,
delFlag: 1
}
materialAbnormalList(params).then(res => {
this.dataList = res.rows
this.dataList = res.rows
if (res.rows[0].id != null && this.indexSelect === 0) {
this.getTechnologyInfo(0)
}
})
},
// 选择材料
getTechnologyInfo(index) {
this.indexSelect = index
let params = this.params
params.technologyId = this.dataList[index].technology
listTechnology(params).then(res => {
this.technologyInfoList = res.rows
})
let params2 = this.params2
params2.technologyId = this.dataList[index].technology
listTechnology(params2).then(res => {
this.technologyInfoListByFour = res.rows
})
},
getFault() {
getFaultMessage().then(res => {
if (res.data !== 0) {
this.showFault = true
messageData(this.MessageParams).then(res => {
this.messageData = res.data
})
}
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault()
this.getDataList() // 接口方法
}, 3000)
},
created() {
newIP()
this.getFault()
this.getDataList()
}
}
</script>
<style scoped>
.hxjx_root {
padding: 20px;
display: flex;
flex-wrap: wrap;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 1rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: center !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
#product .table td, #product .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
#rollingpass .table td, #rollingpass .table th {
padding: 0;
}
.table_td_select {
background-color: yellow;
}
.table_tdth {
vertical-align: middle;
text-align: center;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_popup {
position: fixed;
left: 400px;
top: 200px;
width: 640px;
height: 360px;
font-size: 14px;
}
.hxjx_popup_header_danger {
width: 100%;
height: 40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width: 100%;
height: 320px;
padding: 20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>

View File

@@ -0,0 +1,396 @@
<template>
<div>
<!--导航栏 -->
<div class="hxjx_root">
<div class="text-nowrap hxjx_navigator_info">
<!--导航块 -->
故障信息
</div>
<!--产品信息-->
<div>
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">报警名称</th>
<th class="hxjx_table_th_width">报警信息</th>
<th class="hxjx_table_th_width">记录时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in dataList">
<td class="hxjx_table_btnColumn">{{index + 1 + (pageNum - 1) * pageSize}}</td>
<td style="word-break:break-all;white-space:normal;">{{item.faultName}}</td>
<td style="word-break:break-all;white-space:normal;">{{item.faultMessage}}</td>
<td class="hxjx_table_btnColumn">{{item.createTime}}</td>
</tr>
</tbody>
</table>
</div>
<!-- 页码布局块 -->
<div>
<table class="table">
<tr>
<td class="hxjx_table_btnColumn" style="padding-left: 0;">
<div class="hxjx_btn_margin_right5 hxjx_footer_pagefont" style="padding-left: 0;">
<span class="hxjx-sum">
{{((pageNum - 1) * pageSize)+1}}-{{((pageNum - 1) * pageSize)+dataList.length}}{{total}}条记录
</span>
</div>
</td>
<td class="hxjx_footer_main" style="padding-right: 0;">
<div class="btn-group btn-group-sm hxjx-buttongroup">
<button class="hxjx-jump btn btn-outline-primary hxjx_btn_margin_right5" @click="getPageData(1)">首页</button>
<button class="hxjx-jump btn btn-outline-primary hxjx_btn_margin_right5" @click="getPageData(--pageNum)">上一页</button>
<button class="hxjx-jump btn btn-outline-primary hxjx_btn_margin_right5" @click="getPageData(++pageNum)">下一页</button>
<button class="hxjx-jump btn btn-outline-primary hxjx_btn_margin_right5" @click="getPageData(pageTotal)">末页</button>
<input type=text v-model.number="pageNum" @input="handleInputPage">
<span class="hxjx_btn_margin_right5 hxjx_footer_pagefont" ></span>
<button class="hxjx-button-jump btn btn-outline-primary" @click="getPageData(pageNum)">跳转</button>
</div>
</td>
</tr>
</table>
</div>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{messageData.createTime}}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{messageData.faultName}}</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{messageData.faultMessage}}</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure">确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import { messageUpdate } from '@/api/system/resource'
import { listFault } from '@/api/system/fault'
import { getFaultMessage, newIP } from '@/api/system/common'
export default {
name: 'index',
data() {
return {
MessageParams:{
state:0
},
showFault: false,
pageNum:1,
pageSize:5,
pageTotal:4,
total:0,
inputPage:"",
dataList: [],
messageData:{}
};
},
methods: {
ensure() {
let data = {
state:1
}
messageUpdate(data).then(res=>{
this.showFault = false
})
},
getPageData(pageNum){
this.pageNum = pageNum<=1?1:pageNum
pageNum = this.pageNum
this.pageNum = pageNum>this.pageTotal?this.pageTotal:pageNum
if (this.total===0){
this.pageNum=1;
this.pageSize=5;
return
}
this.getDataList()
},
handleInputPage(){
this.pageNum = this.pageNum<=0?1:this.pageNum
this.pageNum = this.pageNum >this.pageTotal?this.pageTotal:this.pageNum
},
getDataList(){
let params = {
pageNum:this.pageNum,
pageSize:this.pageSize
}
listFault(params).then(res=>{
this.dataList = res.rows
this.total = Math.trunc(res.total)
this.pageTotal = Math.trunc(res.total/this.pageSize)
if (res.total%this.pageSize!=0) this.pageTotal++
})
},
getFault(){
getFaultMessage().then(res=>{
if (res.data!==0){
this.showFault = true
get("/work/message/data",this.MessageParams).then(res=>{
this.messageData = res.data;
})
}
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault();
this.getDataList(); // 接口方法
}, 3000);
},
created() {
newIP();
this.getFault()
this.getDataList()
},
}
</script>
<style scoped>
.hxjx_root {
padding: 20px;
display: table;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 1rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: right !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
.table td, .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
.hxjx_footer_text {
width: 40px;
border: #007bff 1px solid
}
.hxjx_footer_pagefont {
font-size: 14px;
font-weight: 400;
color: #007bff;
padding: 5px
}
.hxjx-store-data {
display: none
}
input{
border: none;
background: #f0f7ff;
width: 50px;
align-self: center;
text-align: center;
}
input[type=text]:focus {
border-width: 1px;
outline:1px;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
.table td, .table th {
padding:0.5rem ;
}
.hxjx_popup {
position:fixed;
left:400px;
top:200px;
width:640px;
height:360px;
font-size: 14px;
}
.hxjx_popup_header_danger {
width:100%;
height:40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width:100%;
height:320px;
padding:20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>

View File

@@ -0,0 +1,865 @@
<template>
<div>
<!--导航栏 -->
<div class="hxjx_root">
<div style="width:55%;overflow: hidden">
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">钽靶批号</th>
<th class="hxjx_table_th_width">规格</th>
<th class="hxjx_table_th_width">工艺</th>
<th class="hxjx_table_th_width">直径</th>
</tr>
</thead>
<tbody>
<tr v-if="dataList.length>0" v-for="(item,index) in dataList">
<td class="hxjx_table_btnColumn"
:class="[{table_td_error:item.state===3},{table_td_warn: item.operation===1}]"
>{{ index + 1 }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_error:item.state===3},{table_td_warn: item.operation===1}]"
>{{ item.id }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_error:item.state===3},{table_td_warn: item.operation===1}]"
>
{{ item.specification }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_error:item.state===3},{table_td_warn: item.operation===1}]"
>
{{ item.technology }}
</td>
<td class="hxjx_table_btnColumn"
:class="[{table_td_error:item.state===3},{table_td_warn: item.operation===1}]"
>{{ item.diameter }}
</td>
</tr>
<tr v-if="dataList.length<=0">
<td class="hxjx_table_btnColumn"
style="height: 150px;vertical-align: middle;text-align: center;" colspan="5" rowspan="8"
>
等待下一批次材料轧制
</td>
</tr>
</tbody>
</table>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td class="hxjx_footer_main" style="padding: 0;">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="nextStep" v-loading="nextStepLoading"
>下道次</a>
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="startProcess"
>开始轧制</a>
<a href="#" class="btn btn-primary btn-sm custom hxjx_foot_btn_custom"
@click="finishProcess"
style="margin-right: 0;"
>轧制完成</a>
</div>
</td>
</tr>
</table>
</div>
<div style="width:45%;">
<div>
<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>
<th class="hxjx_table_th_width">轧制道次</th>
<th class="hxjx_table_th_width">压下量</th>
<th class="hxjx_table_th_width">辊缝设定值</th>
<th class="hxjx_table_th_width">喂料角度</th>
<th class="hxjx_table_th_width">完成</th>
</tr>
</thead>
<tbody style="font-size: small">
<td class="hxjx_table_btnColumn" rowspan="5"
style="vertical-align: middle;text-align: center;" v-if="processing.id!=null"
>
{{ processing.id }}
</td>
<td class="hxjx_table_btnColumn" rowspan="5"
style="vertical-align: middle;text-align: center;" v-else
>
当前无可用操作批号
</td>
<tr v-for="(item,index) in passList">
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation===1}">{{ item.step }}</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation===1}">
{{ item.reduction }}
</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation===1}">{{ item.setValue }}
</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation===1}">{{ item.angle }}</td>
<td class="hxjx_table_btnColumn" :class="{table_td_unstart: item.operation===1}">
<div class="circle_finish" v-if="item.state==1"></div>
<div class="circle_error" v-if="item.state==2"></div>
<div class="circle_unstart" v-if="item.state==0 && item.operation===1"></div>
<div class="circle_unstart2" v-if="item.state==0 && item.operation!==1"></div>
</td>
</tr>
<tr v-if="passList==[]" v-for="item in 4">
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn"></td>
<td class="hxjx_table_btnColumn">
<div class="circle_unstart"></div>
</td>
</tr>
</tbody>
</table>
<!-- 旋转角度 -->
<div style="width:100%;height:350px;display: flex;justify-content: space-between">
<div style="display: flex;margin-bottom: 15px;">
<img src="../../../assets/img/FlowChart-2-1.png" class="imageCircle"
:style="{transform: 'rotate(-' + circleStart + 'deg)'}"
/>
<img src="../../../assets/img/FlowChart-2-2.png" class="image-circle-rows">
</div>
<div style="">
<el-button type="success" plain
@click="submit(1)" :loading="!submitButton"
>确认
</el-button>
<el-button type="danger" plain
style="margin-right: 0;" :loading="!submitButton" @click="submit(2)"
>异常
</el-button>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: -150px">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">传动侧油缸位置:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="runPosition"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.circleContainerAddress+'mm'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">操作侧油缸位置:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="operatePosition"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.operationContainerAddress+'mm'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">传动侧压力:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="runPressure"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.convey+'吨'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">操作侧压力:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="operatePressure"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.operation+'吨'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">上辊电流:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="upElectric"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.highElectric+'A'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label">下辊电流:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="downElectric"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.lowElectric+'A'"
/>
</td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label">轧机反馈速度:</td>
<td class="hxjx_table_label_format hxjx_table_text">
<input class="text-nowrap form-control" type="text" name="speed"
style="background-color: rgb(255, 192, 0);color:#fff;text-align: right;width:300px;"
:value="plcData.machineBackSpeed+'米/分钟'"
/>
</td>
<td class="hxjx_table_label_format hxjx_table_label"></td>
<td class="hxjx_table_label_format hxjx_table_text"></td>
</tr>
</tbody>
</table>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.createTime }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.faultName }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{ messageData.faultMessage }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure"
>确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
<el-dialog
title="请填写轧制后的最终厚度与直径"
:visible.sync="dialogVisible"
width="70%"
>
<el-table
:data="finalData"
stripe
style="width: 100%"
>
<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="最终厚度"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalWidth"
placeholder="请输入该批号的最终厚度"
></el-input>
<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="finalDiameter"
label="最终直径"
>
<templete slot-scope="scope">
<el-input v-if="scope.row.id && scope.row.state!=3" v-model="scope.row.finalDiameter"
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>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="dialogVisible = false"> </el-button>-->
<el-button type="primary" @click="submitFinalData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { messageData, messageUpdate } from '@/api/system/resource'
import {
listMaterial,
materialCheckFlag, materialFinalData, materialNext,
materialNextStepFlag, materialStart,
materialUpdate, stepCheck, stepFinish,
stepNext, stepPLC, stepProcess,
stepSubmit,
stepUpdate
} from '@/api/system/process'
import { getFaultMessage, newIP } from '@/api/system/common'
export default {
name: 'index',
data() {
return {
MessageParams: {
state: 0
},
showFault: false,
dialogVisible: false,
passList: [],
dataList: [],
processing: {
id: null,
batchId: ''
},
finalData: [],
activeIndex: 0,
batchSize: 0,
flag: 1,
intervalTime: '',
submitButton: true,
// 保证同一批次只弹出一次
finalFlag: 0,
plcData: {
circleContainerAddress: 0.00,
operationContainerAddress: 0.00,
convey: 0.00,
operation: 0.00,
highElectric: 0.00,
lowElectric: 0.00,
machineBackSpeed: 0.00,
AGC: 0.00,
ordinary: 0.00
},
stepFlag: -1,
messageData: {},
circleStart: 0,
circleEnd: 0,
passStateLoading: false,
nowPass: {},
newHTML: true,
nextStepLoading: false
}
},
methods: {
ensure() {
let data = {
state: 1
}
messageUpdate(data).then(res => {
this.showFault = false
})
},
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 => {
})
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) {
let processing = this.processing
params.state = 1
stepUpdate(params).then(res => {
materialCheckFlag(processing).then(res => {
this.stepFlag = params.state
setTimeout(() => {
this.nextMaterial()
}, 1000)
if (res.data === 0) {
this.$notify({
title: '提示',
message: '该道次已完成,请点击下道次'
})
}
})
})
}
// 表示这是第一次穷尽
if (this.finalFlag == 0) {
// 检测是否穷尽
this.checkFinal()
}
},
// 下道次
nextStep() {
let params = this.nowPass
if (params && params.state == 0) {
alert('请操作当前道次')
this.nextStepLoading = false
} else {
this.nextStepLoading = true
stepNext(params).then(res => {
this.nextStepLoading = false
this.getDataList()
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
})
})
}
},
nextMaterial() {
let params = 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 => {
this.getDataList()
})
setTimeout(() => {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
})
}, 500)
}
},
startProcess() {
let params = {
state: 1
}
materialStart(params).then(res => {
if (res.data !== 0) {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
})
alert('开始轧制')
this.getDataList()
} else {
alert('该批次已经开始轧制')
}
})
},
finishProcess() {
if (this.processing.batchId == -1) {
alert('该批次存在某道次尚未处理')
} else {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
// get
stepFinish(this.processing.batchId).then(res => {
alert('该批次轧制完成')
})
this.dataList = []
this.passList = []
this.processing = { batchId: -1, id: null }
} else {
alert('该批次存在某道次尚未处理')
}
})
}
},
checkFinal() {
stepCheck(this.processing.batchId).then(res => {
if (res.msg == -1) {
this.finalFlag = 1
this.dialogVisible = true
this.finalData = this.dataList
}
})
},
// 提交最终数据
submitFinalData() {
let data = this.finalData
materialFinalData(data).then(res => {
if (res.code === 200) {
this.$message('提交成功,请点击轧制完成')
this.dialogVisible = false
}
})
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 1
}
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
}
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
})
}, 500)
}
if (this.processing.batchId != -1 && this.processing.state != 3) {
this.getStepDataList()
if (this.newHTML) {
this.submitButtonCheck()
this.newHTML = false
}
}
}
})
},
getStepDataList() {
let params = {
materialId: this.processing.id,
batchId: this.processing.batchId
}
stepProcess(params).then(res => {
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
}
},
getPLCData() {
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) {
this.showFault = true
messageData(this.MessageParams).then(res => {
this.messageData = res.data
})
}
})
},
submitButtonCheck() {
materialNextStepFlag().then(res => {
this.submitButton = res.data === 0
this.passList.forEach(item => {
if (item.operation === 1 && item.state === 0) {
this.submitButton = true
}
})
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
this.getFault()
this.getPLCData()
this.getDataList() // 接口方法
}, 2000)
},
computed: {},
created() {
this.getPLCData()
this.getDataList() // 接口方法
newIP()
this.getFault()
},
beforeDestroy() {
// 清除定时器
clearInterval(this.intervalTime)
}
}
</script>
<style scoped>
.imageCircle {
position: absolute;
width: 200px;
height: 200px;
}
.image-circle-rows {
z-index: 999;
position: relative;
width: 200px;
height: 200px;
}
.hxjx_root {
padding: 20px;
display: flex;
flex-wrap: wrap;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 0.875rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: right !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
.table td, .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
.circle_finish {
width: 20px;
height: 20px;
background-color: #28a745;
border-radius: 50%;
}
.circle_error {
width: 20px;
height: 20px;
background-color: #dc3545;
border-radius: 50%;
}
.circle_unstart {
width: 20px;
height: 20px;
background-color: yellow;
border-radius: 50%;
}
.circle_unstart2 {
width: 20px;
height: 20px;
background-color: #ccc;
border-radius: 50%;
}
.table_td_unstart {
background-color: #eaeaea;
}
.table_td_warn {
background-color: yellow;
}
.table_td_error {
background-color: #ccc;
}
.kong {
display: flex;
justify-content: center;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_popup {
position: fixed;
left: 400px;
top: 200px;
width: 640px;
height: 360px;
font-size: 0.875rem
}
.hxjx_popup_header_danger {
width: 100%;
height: 40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width: 100%;
height: 320px;
padding: 20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>

View File

@@ -0,0 +1,285 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="工艺" prop="technology">
<el-input
v-model="queryParams.technology"
placeholder="请输入工艺"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<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="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.state===0" type="info">未开始</el-tag>
<el-tag v-if="scope.row.state===1" type="warning">正在轧制</el-tag>
<el-tag v-if="scope.row.state===2" type="success">轧制完成</el-tag>
<el-tag v-if="scope.row.state===3" type="danger">存在异常</el-tag>
<el-tag v-if="scope.row.state===4" type="warning">已丢入异常品堆</el-tag>
<el-tag v-if="scope.row.state===5" type="warning">异常品轧制中</el-tag>
<el-tag v-if="scope.row.state===6" type="success">轧制完成</el-tag>
</template>
</el-table-column>
<el-table-column label="直径" align="center" prop="diameter" />
<el-table-column label="厚度" align="center" prop="width" />
<el-table-column label="最终厚度" align="center" prop="finalWidth" />
<el-table-column label="最终直径" align="center" prop="finalDiameter" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改钽靶主类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="最终厚度" prop="finalWidth">
<el-input v-model="form.finalWidth" placeholder="请输入最终厚度" />
</el-form-item>
<el-form-item label="最终直径" prop="finalDiameter">
<el-input v-model="form.finalDiameter" placeholder="请输入最终直径" />
</el-form-item>
<!-- <el-form-item label="最大轧制力" prop="weight">-->
<!-- <el-input v-model="form.weight" placeholder="请输入最大轧制力" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/system/material";
export default {
name: "Material",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 钽靶主类表格数据
materialList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
specification: null,
technology: null,
operation: null,
stepSize: null,
diameter: null,
width: null,
batchId: null,
sort: null,
state: null,
finalWidth: null,
finalDiameter: null,
weight: null
},
// 表单参数
form: {},
// 表单校验
rules: {
batchId: [
{ required: true, message: "批次号不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询钽靶主类列表 */
getList() {
this.loading = true;
listMaterial(this.queryParams).then(response => {
this.materialList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
specification: null,
technology: null,
operation: null,
stepSize: null,
diameter: null,
width: null,
batchId: null,
sort: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
state: null,
finalWidth: null,
finalDiameter: null,
weight: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加钽靶主类";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMaterial(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改钽靶主类";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMaterial(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMaterial(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除钽靶主类编号为"' + ids + '"的数据项?').then(function() {
return delMaterial(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/material/export', {
...this.queryParams
}, `material_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,541 @@
<template>
<div>
<div class="hxjx_root">
<!--产品信息-->
<div>
<div style="width:60%;">
<span>产品信息:</span>
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap">
<thead class="hxjx_table_th">
<tr>
<th class="hxjx_table_th_width">序号</th>
<th class="hxjx_table_th_width">钽靶批号</th>
<th class="hxjx_table_th_width">规格</th>
<th class="hxjx_table_th_width">工艺</th>
<th class="hxjx_table_th_width">直径</th>
</tr>
</thead>
<tbody>
<tr v-if="dataList.length>0 " v-for="(item,index) in dataList" @click="getTechnologyInfo(index)">
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ index + 1 }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.id }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.specification }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.technology }}
</td>
<td class="hxjx_table_btnColumn"
:class="{table_td_select:index===indexSelect && item.id!=null}"
>{{ item.diameter }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--粗轧道次表-->
<div style="width:60%;margin-left:1%;" id="rollingpass">
<span>粗轧道次表:</span>
<!-- 表1 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="5" rowspan="2">
<span id="hxjx-table-title"></span>
{{ technologyId }}轧制工艺单
</th>
<th class="hxjx_table_th_width table_tdth" colspan="4"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth">制作人</th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth">审核人</th>
<th class="hxjx_table_th_width table_tdth"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">道次</th>
<th class="hxjx_table_th_width table_tdth" colspan="3">粗轧工艺设计</th>
<th class="hxjx_table_th_width table_tdth" colspan="3">检移票号码</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">粗轧操作记录</th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth">压下量</th>
<th class="hxjx_table_th_width table_tdth">轧前厚度</th>
<th class="hxjx_table_th_width table_tdth">轧后厚度</th>
<th class="hxjx_table_th_width table_tdth">喂料角度</th>
<th class="hxjx_table_th_width table_tdth">设定值</th>
<th class="hxjx_table_th_width table_tdth">判定确认</th>
<th class="hxjx_table_th_width table_tdth">程序设定员</th>
<th class="hxjx_table_th_width table_tdth">备注</th>
</tr>
</thead>
<tbody id="hxjx-tbody-one">
<tr v-for="(item,index) in technologyInfoList">
<td class="hxjx_table_btnColumn table_tdth">{{ item.step }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.reduction }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.thicknessFront }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.thicknessBehind }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.angle }}</td>
<td class="hxjx_table_btnColumn table_tdth">{{ item.setValue }}</td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
</tr>
</tbody>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="2">粗轧后厚度</th>
<th class="hxjx_table_th_width table_tdth" colspan="2"></th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth">轧制员</th>
<th class="hxjx_table_th_width table_tdth" colspan="3"></th>
</tr>
</thead>
</table>
<!-- 表2 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">道次</th>
<th class="hxjx_table_th_width table_tdth" colspan="5">四辊精轧记录</th>
<th class="hxjx_table_th_width table_tdth" colspan="3" rowspan="2" style="vertical-align: middle;">
程序设定员
</th>
<th class="hxjx_table_th_width table_tdth" rowspan="2" style="vertical-align: middle;">备注</th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="2">设定值范围(±0.2)</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">辊缝设定</th>
<th class="hxjx_table_th_width table_tdth">判定</th>
</tr>
</thead>
<tbody id="hxjx-tbody-two">
<tr v-for="(item,index) in technologyInfoListByFour">
<td class="hxjx_table_btnColumn table_tdth">{{ item.step }}</td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2">{{ item.setValue }}</td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth" colspan="2"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
<td class="hxjx_table_btnColumn table_tdth"></td>
</tr>
</tbody>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="3">
厚度标准值
<span id="hxjx-table-thickness"></span>
</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">精轧后厚度值</th>
<th class="hxjx_table_th_width table_tdth"></th>
<th class="hxjx_table_th_width table_tdth" colspan="2">OK NG </th>
<th class="hxjx_table_th_width table_tdth"></th>
</tr>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="3">轧制日期</th>
<th class="hxjx_table_th_width table_tdth" colspan="2">轧制人员签字确认</th>
<th class="hxjx_table_th_width table_tdth" colspan="5"></th>
</tr>
</thead>
</table>
<!-- 表3 -->
<table class="table table-hover table-bordered table-striped table-condensed text-nowrap"
style="vertical-align: middle;"
>
<thead>
<tr>
<th class="hxjx_table_th_width table_tdth" colspan="9">
精轧参数参考设定值实际压下量根据产品厚度及厚度均匀性进行设定精轧实际设定值在设定值范围内即可
</th>
</tr>
</thead>
</table>
</div>
</div>
<!-- 按钮操作 -->
<div style="display: flex;justify-content: center;">
<el-button style="margin-right: 0;"
@click="success"
>确定</el-button>
<el-button style="margin-left: 20px;"
@click="clear"
>初始化</el-button>
</div>
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
<!-- 表头-->
<div class="hxjx_popup_header_danger">
<span style="float:left">故障</span>
<!-- <span id="hxjx_popup_header_close" style="float:right"><i class='fa fa-times' style="font-size: 20px;cursor: pointer;"></i></span> -->
</div>
<!-- body-->
<div class="hxjx_popup_body_danger">
<div style="width:100%;height:227px;">
<table class="table table-borderless hxjx_table_text_left">
<tbody>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">时间:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.createTime }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障名称:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">{{ messageData.faultName }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
<tr>
<td class="hxjx_table_label_format hxjx_table_label" style="padding:0.25rem;">故障信息:</td>
<td class="hxjx_table_label_format hxjx_table_text" style="padding:0.25rem;">
{{ messageData.faultMessage }}
</td>
<td class="hxjx_table_label_format hxjx_table_text_rule"
style="padding:0.25rem;vertical-align: middle;"
></td>
</tr>
</tbody>
</table>
</div>
<!-- 按钮操作 -->
<table class="table">
<tr>
<td style="padding: 20px 0 0 0;text-align: right; border-top:0px solid #dc3545">
<div class="btn-group btn-group-sm">
<a href="#" class="hxjx-button-ensure btn btn-danger btn-sm custom hxjx_foot_btn_custom"
style="margin-right: 0;" @click="ensure"
>确定</a>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<script>
import {
listMaterial1,
listTechnology,
materialClear,
messageData,
messageUpdate,
updateResource
} from '@/api/system/resource'
import { getFaultMessage, newIP } from '@/api/system/common'
export default {
name: 'index',
data() {
return {
MessageParams: {
state: 0
},
showFault: false,
dataList: [],
indexSelect: 0,
technologyId: '',
// 粗轧请求参数
params: {
state: 0,
pageSize: 999
},
// 精轧请求参数
params2: {
state: 1,
pageSize: 999
},
technologyInfoList: [],
technologyInfoListByFour: [],
messageData: {}
}
},
methods: {
success() {
if (this.dataList.length == 0) {
alert('钽靶原料列表为空,不可提交')
return
// TODO 考虑原料列表队列问题 及上一批材料未处理完毕 又来了一批材料
}
let data = {
batchId: this.dataList[0].batchId,
state: 0
}
updateResource(data).then(res => {
if (res.data === 1) {
// 提交成功 给个提醒
// 列表制空
alert('钽靶原料成功提交至轧制')
this.dataList = []
} else {
alert('提交失败,请检查工艺是否相同')
}
})
},
// 选择材料
getTechnologyInfo(index) {
this.indexSelect = index
let params = this.params
params.technologyId = this.dataList[index].technology
this.technologyId = params.technologyId
if (params.technologyId == null) {
return
}
listTechnology(params).then(res => {
this.technologyInfoList = res.rows
})
let params2 = this.params2
params2.technologyId = this.dataList[index].technology
listTechnology(params2).then(res => {
this.technologyInfoListByFour = res.rows
})
},
getDataList() {
//state==0表示并未送进轧制页面的新进材料
let params = {
state: 0
}
listMaterial1(params).then(res => {
this.dataList = res.rows
console.log(res.rows)
if (res.rows[0].id != null && this.indexSelect === 0) {
this.getTechnologyInfo(0)
}
})
},
getFault() {
getFaultMessage().then(res => {
if (res.data !== 0) {
this.showFault = true
messageData(this.MessageParams).then(res => {
this.messageData = res.data
})
}
})
},
ensure() {
let data = {
state: 1
}
messageUpdate(data).then(res => {
this.showFault = false
})
},
clear() {
materialClear().then(res => {
alert('初始化成功')
})
}
},
mounted() {
clearInterval(this.intervalTime)
this.getDataList() // 接口方法
this.intervalTime = setInterval(() => {
newIP()
this.getFault()
this.getDataList() // 接口方法
}, 3000)
},
created() {
}
}
</script>
<style scoped>
.hxjx_root {
padding: 20px;
display: flex;
flex-wrap: wrap;
width: 100%;
font-size: 0.875rem;
}
.hxjx_navigator_info {
height: 40px;
border-radius: 5px;
position: relative;
font-size: 1rem;
font-weight: 700;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.hxjx_btn_margin_right5 {
margin-right: 5px;
}
.hxjx_footer_main {
background-color: white;
border: solid 1px transparent !important;
}
.hxjx_table_btnColumn {
word-break: keep-all !important;
white-space: nowrap !important;
}
.hxjx_foot_btn_custom {
width: 90px !important;
margin-right: 5px;
}
/* 后添加的样式 */
.hxjx_footer_main {
text-align: center !important;
}
.hxjx_table_btnColumn {
border-top: 0 !important;
}
.hxjx_table_btn {
width: 50px !important;
margin: 2px;
}
.hxix_table_border {
border: 1px solid #CCC;
}
#product .table td, #product .table th {
padding: 0.5rem;
}
.hxjx_table_th {
background-color: rgb(91, 155, 213);
color: #fff;
}
#rollingpass .table td, #rollingpass .table th {
padding: 0;
}
.table_td_select {
background-color: yellow;
}
.table_tdth {
vertical-align: middle;
text-align: center;
}
.hxjx_table_label_format {
word-break: keep-all;
white-space: nowrap;
}
.hxjx_table_text_rule {
color: red;
}
.hxjx_table_text {
width: 300px !important;
text-align: left;
padding: 6px;
}
.hxjx_table_label {
padding: 0px !important;
vertical-align: middle !important;
width: 100px;
}
.hxjx_table_text_left {
text-align: left;
}
.table td, .table th {
padding: 0.5rem;
}
.hxjx_popup {
position: fixed;
left: 400px;
top: 200px;
width: 640px;
height: 360px;
font-size: 14px;
}
.hxjx_popup_header_danger {
width: 100%;
height: 40px;
padding: 9px;
background-color: #dc3545;
color: #fff;
}
.hxjx_popup_body_danger {
width: 100%;
height: 320px;
padding: 20px;
background-color: #fff;
border: 1px solid #dc3545;
}
</style>