Compare commits

...

2 Commits
master ... zwq

Author SHA1 Message Date
zwq
84359c8e43 更新 2022-12-13 16:37:14 +08:00
zwq
6f547d5dc5 更新 2022-11-21 15:38:44 +08:00
17 changed files with 1213 additions and 217 deletions

View File

@ -5,7 +5,6 @@
<script>
import * as echarts from 'echarts'
import resize from './mixins/resize'
import moment from 'moment'
export default {
mixins: [resize],
@ -100,22 +99,15 @@ export default {
})
}
if (this.chartType.indexOf('折线') >= 0) {
this.series.push({
name: this.title + 'line',
type: 'line',
symbolSize: 10,
symbol: 'circle',
colorBy: 'data',
color: '#5B8FF9',
label: {
show: true,
position: 'top',
formatter (p) {
return p.value > 0 ? p.value : ''
}
},
data: this.dataList.map(item => {
return item.value
this.dataList.forEach(item => {
this.series.push({
name: item[0].code,
type: 'line',
symbolSize: 5,
symbol: 'circle',
data: item.map(item1 => {
return item1
})
})
})
}
@ -131,7 +123,6 @@ export default {
},
chartType: {
handler (val) {
console.log(val)
if (val.length) {
this.series = []
if (val.indexOf('柱状') >= 0) {
@ -155,23 +146,15 @@ export default {
})
}
if (val.indexOf('折线') >= 0) {
this.series.push({
name: this.title + 'line',
type: 'line',
symbolSize: 10,
symbol: 'circle',
color: '#5B8FF9',
colorBy: 'data',
barBorderRadius: 0,
label: {
show: true,
position: 'top',
formatter (p) {
return p.value > 0 ? p.value : ''
}
},
data: this.dataList.map(item => {
return item.value
this.dataList.forEach(item => {
this.series.push({
name: item[0].code,
type: 'line',
symbolSize: 5,
symbol: 'circle',
data: item.map(item1 => {
return item1
})
})
})
}
@ -204,22 +187,15 @@ export default {
})
}
if (this.chartType.indexOf('折线') >= 0) {
this.series.push({
name: this.title + 'line',
type: 'line',
symbolSize: 10,
symbol: 'circle',
color: '#5B8FF9',
colorBy: 'data',
label: {
show: true,
position: 'top',
formatter (p) {
return p.value > 0 ? p.value : ''
}
},
data: this.dataList.map(item => {
return item.value
this.dataList.forEach(item => {
this.series.push({
name: item[0].code,
type: 'line',
symbolSize: 5,
symbol: 'circle',
data: item.map(item1 => {
return item1
})
})
})
}
@ -231,9 +207,6 @@ export default {
this.chart.dispose()
}
this.chart = echarts.init(document.getElementById(this.id))
const xData = this.dataList.map(item => {
return moment(item.time).format('M-D HH:mm')
})
this.chart.setOption({
title: {
text: this.title === 'Mix-Chart' ? 'Mix-Chart' : this.titleHeader + this.title + this.titleFooter,
@ -247,10 +220,18 @@ export default {
},
tooltip: {
trigger: 'axis',
confine: true,
axisPointer: {
textStyle: {
color: '#fff'
}
},
formatter: function (params) {
let info = params[0].dataIndex + 1 + '<br/>'
params.forEach(item => {
info += item.marker + item.data.code + '<br/>' + '值: ' + item.value + '<br/>' + '时间: ' + item.data.time.split('T')[0] + ' ' + item.data.time.split('T')[1] + '<br/>'
})
return info
}
},
grid: {
@ -268,11 +249,7 @@ export default {
top: 55,
textStyle: {
color: '#90979c'
},
data: this.series.map(item => {
console.log(item)
return this.title + item.type
})
}
},
calculable: true,
xAxis: [
@ -293,10 +270,8 @@ export default {
show: false
},
axisLabel: {
interval: 0,
rotate: 45
},
data: xData
show: false
}
}
],
yAxis: [
@ -328,7 +303,7 @@ export default {
xAxisIndex: [0],
bottom: 10,
start: 0,
end: 100,
end: 20,
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
handleSize: '110%',
handleStyle: {
@ -344,7 +319,7 @@ export default {
show: true,
height: 15,
start: 1,
end: 35
end: 20
}
],
series: this.series

View File

@ -346,7 +346,7 @@ export default {
xAxisIndex: [0],
bottom: 10,
start: 0,
end: 100,
end: 10,
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
handleSize: '110%',
handleStyle: {
@ -361,8 +361,8 @@ export default {
type: 'inside',
show: true,
height: 15,
start: 1,
end: 35
start: 0,
end: 10
}
],
series: this.series

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-15 08:20:28
* @LastEditors: zwq
* @LastEditTime: 2022-09-06 15:26:36
* @LastEditTime: 2022-11-23 09:42:21
* @Description:
*/
/**
@ -62,7 +62,8 @@ const mainRoutes = {
{ path: '/report-kiln-alarm', component: _import('report/kiln-alarm'), name: 'report-kiln-alarm', meta: { title: '工业炉报警', isTab: true } },
{ path: '/report-car-alarm', component: _import('report/car-alarm'), name: 'report-car-alarm', meta: { title: '车辆运行报警', isTab: true } },
{ path: '/report-order-history', component: _import('report/order-history'), name: 'report-order-history', meta: { title: '订单历史列表', isTab: true } },
{ path: '/report-APMS-work', component: _import('report/APMS-work'), name: 'report-APMS-work', meta: { title: 'APMS报工', isTab: true } },
{ path: '/report-APMS-table', component: _import('report/APMS-table'), name: 'report-APMS-table', meta: { title: 'APMS报工', isTab: true } },
{ path: '/report-APMS-work', component: _import('report/APMS-work'), name: 'report-APMS-work', meta: { title: 'APMS未出单报工', isTab: true } },
{ path: '/report-order-history-task', component: _import('report/components/order-history-task'), name: 'report-order-history-task', meta: { title: '订单历史任务详情', isTab: true } },
{ path: '/report-task-history', component: _import('report/task-history'), name: 'report-task-history', meta: { title: '执行任务历史列表', isTab: true } },
{ path: '/report-task-history-detail', component: _import('report/components/task-history-detail'), name: 'report-task-history-detail', meta: { title: '执行任务历史详情', isTab: true } },

View File

@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2021-11-15 08:20:28
* @LastEditors: zwq
* @LastEditTime: 2022-11-30 15:44:44
* @Description:
*/
/**
* 邮箱
* @param {*} s
@ -29,3 +36,11 @@ export function isPhone (s) {
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
}
/**
* 配炉号
* @param {*} s
*/
export function isStoveCode (s) {
return /^[A-Z]{3}\d{1}\W{1}\d{2}\W{1}\d{10}$/.test(s)
}

View File

@ -185,7 +185,8 @@ export default {
} else if (sessionStorage.getItem('autoTaskList')) {
const taskList = JSON.parse(sessionStorage.getItem('autoTaskList'))
taskList.push(this.dataForm)
sessionStorage.setItem('autoTaskList', JSON.stringify(taskList))
const taskList1 = taskList.reduce((all, next) => all.some((item) => item.idenCardNum === next.idenCardNum) ? all : [...all, next], [])
sessionStorage.setItem('autoTaskList', JSON.stringify(taskList1))
} else {
const arr = [this.dataForm]
sessionStorage.setItem('autoTaskList', JSON.stringify(arr))

View File

@ -159,7 +159,8 @@
} else if (sessionStorage.getItem('taskList')) {
const taskList = JSON.parse(sessionStorage.getItem('taskList'))
taskList.push(this.dataForm)
sessionStorage.setItem('taskList', JSON.stringify(taskList))
const taskList1 = taskList.reduce((all, next) => all.some((item) => item.idenCardNum === next.idenCardNum) ? all : [...all, next], [])
sessionStorage.setItem('taskList', JSON.stringify(taskList1))
} else {
const arr = [this.dataForm]
sessionStorage.setItem('taskList', JSON.stringify(arr))

View File

@ -339,12 +339,19 @@
<icon-svg name="job" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">执行任务历史列表</span>
</el-menu-item>
<el-menu-item
index="report-APMS-table"
@click="$router.push({ name: 'report-APMS-table' })"
>
<icon-svg name="job" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">APMS报工</span>
</el-menu-item>
<el-menu-item
index="report-APMS-work"
@click="$router.push({ name: 'report-APMS-work' })"
>
<icon-svg name="job" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">APMS报工</span>
<span slot="title">APMS未出单报工</span>
</el-menu-item>
</el-submenu>
<el-menu-item index="Problem" @click="$router.push({ name: 'Problem' })">

View File

@ -0,0 +1,158 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-11-21 14:43:03
* @Description:
-->
<template>
<el-dialog title="修改" :before-close="handleClose" :visible.sync="visible">
<el-form
:rules="dataRule"
v-if="showForm"
ref="dataForm"
>
<el-form-item
:label="
item.idenCardNum + '--' + item.customer + '--' + item.productName
"
v-for="(item, index) in subList"
:key="item.id"
>
<el-input v-model="item.quantity" placeholder="数量"
><template slot="prepend"
>数量:</template
></el-input
>
<el-input v-model="item.weight" placeholder="重量"
><template slot="prepend"
>重量:</template
></el-input
>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(index)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<icon-svg class="iconClass" name="删除"></icon-svg>
</el-tooltip>
</el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" :loading="btnLoad" @click="dataFormSubmit()"
>确定</el-button
>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
btnLoad: false,
showForm: false,
subList: [],
updataList: [],
autoExeTaskId: '',
dataRule: {}
}
},
methods: {
init (allStep, autoExeTaskId, dataList, updataList) {
this.btnLoad = false
this.showForm = false
this.autoExeTaskId = autoExeTaskId
this.updataList = updataList
const list = JSON.parse(JSON.stringify(dataList))
this.subList = list.filter(item => {
if (item.allStep === allStep) {
this.showForm = true
return item
}
})
this.visible = true
},
//
dataFormSubmit () {
const arr = this.updataList.filter(item => {
if (item.autoExeTaskId === this.autoExeTaskId) {
item.currTaskDetVoList.forEach(item1 => {
const index = this.subList.findIndex(value => { return value.id === item1.id })
item1.weight = this.subList[index].weight
item1.quantity = this.subList[index].quantity
})
return item
}
})
if (this.showForm) {
this.btnLoad = true
this.$http({
url: this.$http.adornUrl('/currTask/oneStepToApms'),
method: 'post',
data: this.$http.adornData(
arr[0], false
)
}).then(({ data }) => {
if (data && data.code === 0) {
this.btnLoad = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.btnLoad = false
this.$message.error(data.msg)
}
})
}
// this.$refs['dataForm'].validate(valid => {
// if (valid) {
// this.btnLoad = true
// this.$http({
// url: this.$http.adornUrl('/currTask/updateCurrTaskStatus'),
// method: 'post',
// data: this.$http.adornData({
// id: this.dataForm.id || undefined,
// kilnId: this.dataForm.kilnId,
// status: this.dataForm.status
// })
// }).then(({ data }) => {
// if (data && data.code === 0) {
// this.btnLoad = false
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.visible = false
// this.$emit('refreshDataList')
// }
// })
// } else {
// this.btnLoad = false
// this.$message.error(data.msg)
// }
// })
// }
// })
},
deleteHandle (index) {
this.subList.splice(index, 1)
},
handleClose () {
this.visible = false
}
}
}
</script>

View File

@ -20,6 +20,8 @@
>
</el-table-column>
<el-table-column prop="taskCode" label="任务编码"> </el-table-column>
<el-table-column align="center" width="180" prop="stoveCode" label="炉号">
</el-table-column>
<el-table-column prop="createTime" label="发起时间">
<template slot-scope="scope">
{{
@ -98,6 +100,7 @@
<el-button
type="text"
:disabled="scope.row.status === 1"
:loading="btnLoading"
size="small"
@click="runTask(scope.row.id)"
>
@ -164,6 +167,7 @@ export default {
data () {
return {
statusList,
btnLoading: false,
addOrUpdateVisible: false
}
},
@ -173,6 +177,7 @@ export default {
activated () {},
methods: {
init () {
this.btnLoading = false
console.log(1)
},
// /
@ -216,6 +221,7 @@ export default {
},
//
runTask (id) {
this.btnLoading = true
this.$http({
url: this.$http.adornUrl('/currTask/runTask'),
method: 'post',
@ -223,6 +229,7 @@ export default {
// params: this.$http.adornParams({ id }, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.btnLoading = false
this.$message({
message: '操作成功',
type: 'success',
@ -232,6 +239,7 @@ export default {
}
})
} else {
this.btnLoading = false
this.$message.error(data.msg)
}
})

View File

@ -2,10 +2,13 @@
<div class="mod-config">
<el-form style="display: flex; align-items: center; justify-content: right;" :inline="true" ref="dataForm" :rules="dataRule" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input size="small" v-model="dataForm.idenCardNum" placeholder="标识卡号" />
<el-input size="small" v-model="dataForm.idenCardNum" clearable placeholder="标识卡号" />
</el-form-item>
<el-form-item>
<el-input size="small" v-model="dataForm.idenCardNum" placeholder="订单号" />
<el-input size="small" v-model="dataForm.orderNo" clearable placeholder="订单号" />
</el-form-item>
<el-form-item>
<el-input size="small" v-model="dataForm.customerName" clearable placeholder="客户名称" />
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">查询</el-button>
@ -153,7 +156,8 @@
return {
dataForm: {
idenCardNum: '',
orderNo: ''
orderNo: '',
customerName: ''
},
dataList: [],
options1: [],
@ -164,12 +168,6 @@
dataListLoading: false,
orderDetailVisible: false,
dataRule: {
idenCardNum: [
{ required: true, message: '标识卡号不能为空', trigger: 'change' }
],
orderNo: [
{ required: true, message: '订单号不能为空', trigger: 'change' }
]
},
statusList,
orderVoidList
@ -192,7 +190,8 @@
'current': this.pageIndex,
'size': this.pageSize,
'orderNo': this.dataForm.orderNo,
'idenCardNum': this.dataForm.idenCardNum
'idenCardNum': this.dataForm.idenCardNum,
'customerName': this.dataForm.customerName
})
}).then(({data}) => {
if (data && data.code === 0) {

View File

@ -112,6 +112,7 @@
<el-button
type="text"
:disabled="scope.row.status === 1"
:loading="btnLoading"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
@ -176,6 +177,7 @@ export default {
pageIndex: 1,
pageSize: 30,
totalPage: 0,
btnLoading: false,
dataListLoading: false,
statusList,
processList: []
@ -203,6 +205,7 @@ export default {
//
getDataList () {
this.dataListLoading = true
this.btnLoading = false
this.$http({
url: this.$http.adornUrl('/currTask/currentTaskNow'),
method: 'post',
@ -249,6 +252,7 @@ export default {
},
//
addOrUpdateHandle (id) {
this.btnLoading = true
this.$http({
url: this.$http.adornUrl('/currTask/runTask'),
method: 'post',
@ -256,6 +260,7 @@ export default {
// params: this.$http.adornParams({ id }, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.btnLoading = false
this.$message({
message: '操作成功',
type: 'success',
@ -265,6 +270,7 @@ export default {
}
})
} else {
this.btnLoading = false
this.$message.error(data.msg)
}
})

View File

@ -0,0 +1,200 @@
<template>
<div class="mod-config">
<el-table
:data="dataList"
:span-method="objectSpanMethod"
:header-cell-style="{background:'#eef1f6',color:'#606266',height: '56px'}"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50">
</el-table-column>
<el-table-column prop="allStep" width="250" label="所有步骤"></el-table-column>
<el-table-column prop="idenCardNum" label="标识卡号"> </el-table-column>
<el-table-column prop="orderNo" label="订单名"> </el-table-column>
<el-table-column prop="customer" label="客户名称"> </el-table-column>
<el-table-column prop="productName" label="产品名称"> </el-table-column>
<el-table-column prop="productModel" label="产品型号"> </el-table-column>
<el-table-column prop="materialDes" label="材料号牌"> </el-table-column>
<el-table-column prop="craftIll" width="120" label="生产工艺要求">
</el-table-column>
<el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column prop="quantity" label="数量"> </el-table-column>
<el-table-column prop="weight" label="重量"> </el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.allStep,scope.row.autoExeTaskId)">
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<icon-svg class="iconClass" name="编辑"></icon-svg>
</el-tooltip>
</el-button>
<el-button type="text" size="small" @click="completeOrder(scope.row.autoExeTaskId)">
报工
</el-button>
</template>
</el-table-column>
</el-table>
<tableEdit
v-if="tableEditVisible"
ref="tableEdit"
@refreshDataList="getDataList"
></tableEdit>
</div>
</template>
<script>
import tableEdit from './components/APMS-table-edit'
export default {
data () {
return {
dataList: [],
updataList: [],
dataListLoading: false,
tableEditVisible: false
}
},
components: {
tableEdit
},
activated () {
this.getDataList()
},
created () {
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/currTask/taskInfoNotToApms'),
method: 'post',
data: this.$http.adornData({
current: 1,
size: 500
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = []
this.updataList = JSON.parse(JSON.stringify(data.data))
data.data.forEach(item => {
if (item.currTaskDetVoList.length > 0) {
item.currTaskDetVoList.forEach(item1 => {
item1.allStep = item.allStep
item1.autoExeTaskId = item.autoExeTaskId
})
} else {
let arr = {'allStep': item.allStep}
item.currTaskDetVoList.push(arr)
}
this.dataList = [...this.dataList, ...item.currTaskDetVoList]
})
this.setSpan()
} else {
this.dataList = []
}
this.dataListLoading = false
})
},
setSpan () {
this.dataList.forEach(item => {
item.rowspan = 1
})
//
for (let i = 0; i < this.dataList.length; i++) {
for (let j = i + 1; j < this.dataList.length; j++) {
// id
if (this.dataList[i].allStep === this.dataList[j].allStep) {
this.dataList[i].rowspan++
this.dataList[j].rowspan--
}
}
//
i = i + this.dataList[i].rowspan - 1
}
},
objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
return {
rowspan: row.rowspan,
colspan: 1
}
}
if (columnIndex === 12) {
return {
rowspan: row.rowspan,
colspan: 1
}
}
},
// /
addOrUpdateHandle (allStep, autoExeTaskId) {
this.tableEditVisible = true
this.$nextTick(() => {
this.$refs.tableEdit.init(allStep, autoExeTaskId, this.dataList, this.updataList)
})
},
handleClick (tab) {
if (tab.index === '0') {
this.$nextTick(() => {
this.$refs.tab1Ref.init()
})
} else {
this.$nextTick(() => {
this.$refs.tab2Ref.init()
})
}
},
tableRowClassName ({ row, rowIndex }) {
if (row.status === 1) {
return 'success-row'
} else if (row.status === 2) {
return 'warning-row'
}
return ''
},
completeOrder (autoExeTaskId) {
const arr = this.updataList.filter(item => {
if (item.autoExeTaskId === autoExeTaskId) {
return item
}
})
this.$http({
url: this.$http.adornUrl('/currTask/oneStepToApms'),
method: 'post',
data: this.$http.adornData(
arr[0], false
)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
} else {
this.$message.error(data.msg)
}
})
}
}
}
</script>
<style>
.el-table .warning-row {
background-color: oldlace;
}
.el-table .success-row {
background-color: #f0f9eb;
}
</style>

View File

@ -35,7 +35,13 @@
</el-col>
<el-col :span="8">
<el-form-item label="配炉号" prop="stoveCode">
<el-select
<el-input
v-model="dataForm.stoveCode"
placeholder="请输入配炉号"
clearable
:style="{ width: '100%' }"
></el-input>
<!-- <el-select
v-model="dataForm.stoveCode"
:style="{ width: '100%' }"
filterable
@ -48,7 +54,7 @@
:value="item.code"
>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="8">
@ -91,7 +97,7 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
@ -100,7 +106,7 @@
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
</div>
<el-card class="box-card">
@ -162,10 +168,18 @@
</template>
<script>
import { isStoveCode } from '@/utils/validate'
export default {
components: {},
props: [],
data () {
var validateMobile = (rule, value, callback) => {
if (!isStoveCode(value)) {
callback(new Error('配炉号格式错误'))
} else {
callback()
}
}
return {
stoveCodeArr: [],
techCodeArr: [],
@ -205,7 +219,8 @@ export default {
required: true,
message: '请输入配炉号',
trigger: 'blur'
}
},
{ validator: validateMobile, trigger: 'blur' }
],
workShopCode: [
{
@ -215,7 +230,13 @@ export default {
}
],
techCode: [],
stoveRemark: [],
stoveRemark: [
{
required: true,
message: '请输入炉号备注',
trigger: 'blur'
}
],
remark: [],
itemCode: []
}

View File

@ -0,0 +1,134 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-11-21 16:26:53
* @Description:
-->
<template>
<el-dialog title="修改" :before-close="handleClose" :visible.sync="visible">
<el-form
:rules="dataRule"
v-if="showForm"
ref="dataForm"
>
<el-form-item
:label="
item.idenCardNum + '--' + item.customer + '--' + item.productName
"
v-for="(item, index) in subList"
:key="item.id"
>
<el-input v-model="item.quantity" placeholder="数量"
><template slot="prepend"
>数量:</template
></el-input
>
<el-input v-model="item.weight" placeholder="重量"
><template slot="prepend"
>重量:</template
></el-input
>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(index)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<icon-svg class="iconClass" name="删除"></icon-svg>
</el-tooltip>
</el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" :loading="btnLoad" @click="dataFormSubmit()"
>确定</el-button
>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
btnLoad: false,
showForm: false,
subList: [],
updataList: [],
autoExeTaskId: '',
dataRule: {}
}
},
methods: {
init (allStep, autoExeTaskId, dataList, updataList) {
this.btnLoad = false
this.showForm = false
this.autoExeTaskId = autoExeTaskId
this.updataList = JSON.parse(JSON.stringify(updataList))
const list = JSON.parse(JSON.stringify(dataList))
this.subList = list.filter(item => {
if (item.allStep === allStep) {
return item
}
})
if (this.subList[0].id) {
this.showForm = true
}
this.visible = true
},
//
dataFormSubmit () {
const arr = this.updataList.filter(item => {
if (item.autoExeTaskId === this.autoExeTaskId) {
item.currTaskDetVoList.forEach(item1 => {
const index = this.subList.findIndex(value => { return value.id === item1.id })
if (index >= 0) {
item1.weight = this.subList[index].weight
item1.quantity = this.subList[index].quantity
}
})
return item
}
})
if (this.showForm) {
this.btnLoad = true
this.$http({
url: this.$http.adornUrl('/currTask/oneStepToApms'),
method: 'post',
data: this.$http.adornData(
arr[0], false
)
}).then(({ data }) => {
if (data && data.code === 0) {
this.btnLoad = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.btnLoad = false
this.$message.error(data.msg)
}
})
} else {
this.visible = false
}
},
deleteHandle (index) {
this.subList.splice(index, 1)
},
handleClose () {
this.visible = false
}
}
}
</script>

View File

@ -1,63 +1,341 @@
<!--
* @Author: gtz
* @Date: 2022-03-05 16:06:02
* @LastEditors: gtz
* @LastEditTime: 2022-03-05 17:59:47
* @LastEditors: zwq
* @LastEditTime: 2022-11-30 15:12:05
* @Description: file content
* @FilePath: \mt-qj-wms-ui\src\views\report\components\task-ele.vue
-->
<template>
<div class="chart-container">
<el-row :gutter="20">
<el-col :span="12" v-for="(item, index) in dataList.ele" v-if="item.length" :key="'ele' + index">
<el-card class="base-container" style="height: 444px; position: relative; margin: 10px 0">
<el-row style="position: absolute; z-index: 10; right: 20px">
<el-checkbox-group size="small" :min="1" v-model="chartTypeEle[index]" style="float: left">
<el-checkbox-button label="折线" />
<el-checkbox-button label="柱状" />
</el-checkbox-group>
</el-row>
<el-col>
<el-card
class="base-container"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-table
:data="checkResultList"
border
height="400"
style="width: 100%;"
>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="95"
label="添加时间"
>
<template slot-scope="scope">
{{ scope.row.createTime ? scope.row.createTime.replace('T', ' ') : '' }}
</template>
</el-table-column>
<el-table-column
prop="stoveCode"
header-align="center"
align="center"
label="炉号"
>
</el-table-column>
<el-table-column
prop="sheetNo"
header-align="center"
align="center"
label="生产单号"
>
</el-table-column>
<el-table-column
prop="idenCardNum"
header-align="center"
align="center"
label="标识卡号"
>
</el-table-column>
<el-table-column
prop="hardness"
header-align="center"
align="center"
label="硬度检验"
>
</el-table-column>
<el-table-column
prop="metallography"
header-align="center"
align="center"
label="金相检验"
>
</el-table-column>
<el-table-column
prop="heartHardness"
header-align="center"
align="center"
label="心部硬度"
>
</el-table-column>
<el-table-column
prop="remake"
header-align="center"
align="center"
label="备注"
>
</el-table-column>
<el-table-column
header-align="center"
label="硬度检验">
<el-table-column
prop="hardnessValueOne"
header-align="center"
align="center"
label="结果1"
>
</el-table-column>
<el-table-column
prop="hardnessValueTwo"
header-align="center"
align="center"
label="结果2"
>
</el-table-column>
<el-table-column
prop="hardnessValueThree"
header-align="center"
align="center"
label="结果3"
>
</el-table-column>
</el-table-column>
<el-table-column
header-align="center"
label="金相检验渗碳淬火">
<el-table-column
prop="metallographyStchStccsd"
header-align="center"
align="center"
label="渗碳层深度"
>
</el-table-column>
<el-table-column
prop="metallographyStchMstost"
header-align="center"
align="center"
label="表面为马氏体、残余奥氏体(级)"
>
</el-table-column>
<el-table-column
prop="metallographyStchXxklzthw"
header-align="center"
align="center"
label="细小颗粒状碳化物"
>
</el-table-column>
<el-table-column
prop="metallographyStchDtmstyltst"
header-align="center"
align="center"
label="心部为低碳马氏体加游离铁素体(级)"
>
</el-table-column>
</el-table-column>
<el-table-column
header-align="center"
label="金相检验整体淬火">
<el-table-column
prop="metallographyZtchHhmst"
header-align="center"
align="center"
label="基体为回火马氏体(级)"
>
</el-table-column>
<el-table-column
prop="metallographyZtchHhtst"
header-align="center"
align="center"
label="基体为回火托式体(级)"
>
</el-table-column>
<el-table-column
prop="metallographyXchHhsst"
header-align="center"
align="center"
label="基体为回火素式体(级)"
>
</el-table-column>
</el-table-column>
<el-table-column
header-align="center"
label="金相检验氮化">
<el-table-column
prop="metallographyDhDhhwcs"
header-align="center"
align="center"
label="表面亮白色的为氮化合物层深"
>
</el-table-column>
<el-table-column
prop="metallographyDhKscs"
header-align="center"
align="center"
label="向内为扩散层深"
>
</el-table-column>
<el-table-column
prop="metallographyDhXb"
header-align="center"
align="center"
label="心部"
>
</el-table-column>
</el-table-column>
<el-table-column
header-align="center"
label="金相检验表面淬火">
<el-table-column
prop="metallographyBmchBtmst"
header-align="center"
align="center"
label="表面为板条马氏体(级)"
>
</el-table-column>
<el-table-column
prop="metallographyBmchXb"
header-align="center"
align="center"
label="心部"
>
</el-table-column>
</el-table-column>
<el-table-column
header-align="center"
label="金相检验">
<el-table-column
prop="metallographyBz"
header-align="center"
align="center"
label="备注"
>
</el-table-column>
<el-table-column
prop="metallographyXbydXbydjyjg"
header-align="center"
align="center"
label="心部硬度"
>
</el-table-column>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col
:span="24"
v-for="(item,index) in eleName"
:key="item"
>
<el-card
class="base-container"
v-if="Array.isArray(eleList[item])&&eleList[item].length>0"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-row style="height: 400px">
<chart height="100%" width="100%" :title="item[0].name" :id="'ele' + index" :dataList="item" :chartType="chartTypeEle[index]" />
<chart
height="100%"
width="100%"
:title="eleList[item][0][0]?eleList[item][0][0].name + '/' + eleList[item][0][0].unit : ''"
:id="item + index"
:task-ids="taskIds"
:dataList="eleList[item]"
:chartType="['折线']"
/>
</el-row>
</el-card>
</el-col>
<el-col :span="12" v-for="(item, index) in dataList.gas" v-if="item.length" :key="'gas' + index">
<el-card class="base-container" style="height: 444px; position: relative; margin: 10px 0">
<el-row style="position: absolute; z-index: 10; right: 20px">
<el-checkbox-group size="small" :min="1" v-model="chartTypeGas[index]" style="float: left">
<el-checkbox-button label="折线" />
<el-checkbox-button label="柱状" />
</el-checkbox-group>
</el-row>
</el-row>
<el-row :gutter="20" v-if="false">
<el-col
:span="24"
v-for="(item, index) in dataList.temp"
:key="'temp' + index"
>
<el-card
class="base-container"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-row style="height: 400px">
<chart height="100%" width="100%" :title="item[0].name" :id="'gas' + index" :dataList="item" :chartType="chartTypeGas[index]" />
<chart
height="100%"
width="100%"
:title="item[taskIds[0]][0].name + '/' + item[taskIds[0]][0].unit"
:id="'temp' + index"
:task-ids="taskIds"
:dataList="item"
:chartType="['折线']"
/>
</el-row>
</el-card>
</el-col>
<el-col :span="12" v-for="(item, index) in dataList.rot" v-if="item.length" :key="'rot' + index">
<el-card class="base-container" style="height: 444px; position: relative; margin: 10px 0">
<el-row style="position: absolute; z-index: 10; right: 20px">
<el-checkbox-group size="small" :min="1" v-model="chartTypeRot[index]" style="float: left">
<el-checkbox-button label="折线" />
<el-checkbox-button label="柱状" />
</el-checkbox-group>
</el-row>
<el-col
:span="24"
v-for="(item, index) in dataList.gas"
:key="'gas' + index"
>
<el-card
class="base-container"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-row style="height: 400px">
<chart height="100%" width="100%" :title="item[0].name" :id="'rot' + index" :dataList="item" :chartType="chartTypeRot[index]" />
<chart
height="100%"
width="100%"
:title="item[taskIds[0]][0].name + '/' + item[taskIds[0]][0].unit"
:id="'gas' + index"
:task-ids="taskIds"
:dataList="item"
:chartType="['折线']"
/>
</el-row>
</el-card>
</el-col>
<el-col :span="12" v-for="(item, index) in dataList.temp" v-if="item.length" :key="'temp' + index">
<el-card class="base-container" style="height: 444px; position: relative; margin: 10px 0">
<el-row style="position: absolute; z-index: 10; right: 20px">
<el-checkbox-group size="small" :min="1" v-model="chartTypeTemp[index]" style="float: left">
<el-checkbox-button label="折线" />
<el-checkbox-button label="柱状" />
</el-checkbox-group>
</el-row>
<el-col
:span="24"
v-for="(item, index) in dataList.rot"
:key="'rot' + index"
>
<el-card
class="base-container"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-row style="height: 400px">
<chart height="100%" width="100%" :title="item[0].name" :id="'temp' + index" :dataList="item" :chartType="chartTypeTemp[index]" />
<chart
height="100%"
width="100%"
:title="item[taskIds[0]][0].name + '/' + item[taskIds[0]][0].unit"
:id="'rot' + index"
:task-ids="taskIds"
:dataList="item"
:chartType="['折线']"
/>
</el-row>
</el-card>
</el-col>
<el-col
:span="24"
v-for="(item, index) in dataList.ele"
:key="'ele' + index"
>
<el-card
class="base-container"
style="height: 444px; position: relative; margin: 10px 0"
>
<el-row style="height: 400px">
<chart
height="100%"
width="100%"
:title="item[taskIds[0]][0].name + '/' + item[taskIds[0]][0].unit"
:id="'ele' + index"
:task-ids="taskIds"
:dataList="item"
:chartType="['折线']"
/>
</el-row>
</el-card>
</el-col>
@ -80,14 +358,39 @@ export default {
rot: [],
temp: []
},
chartTypeEle: [],
chartTypeGas: [],
chartTypeRot: [],
chartTypeTemp: [],
showId: 0
eleName: [
'temp',
'carbon',
'met',
'propane',
'ammon',
'nit',
'ele',
'car',
'oilTemp',
'outer1Temp',
'outer2Temp',
'rot1',
'rot2',
'aCurr',
'aVol',
'bCurr',
'bVol',
'cCurr',
'cVol'
],
eleList: [],
checkResultList: [],
chartTypeEle: ['折线'],
chartTypeGas: ['折线'],
chartTypeRot: ['折线'],
chartTypeTemp: ['折线'],
showId: 0,
taskIds: []
}
},
activated () {
this.taskIds = this.$route.query.taskIds
this.getEleList()
},
mounted () {},
@ -95,29 +398,87 @@ export default {
//
getEleList () {
this.$http({
url: this.$http.adornUrl('/electric/energyList'),
url: this.$http.adornUrl('/electric/eletric'),
method: 'post',
data: this.$http.adornData({
'taskId': this.$route.query.taskId
taskIds: this.taskIds
})
}).then(({data}) => {
}).then(({ data }) => {
if (data.code === 0 && data.data) {
console.log(JSON.parse(data.data))
this.dataList = JSON.parse(data.data)
this.dataList.ele.map(item => {
this.chartTypeEle.push(['柱状'])
})
this.dataList.gas.map(item => {
this.chartTypeGas.push(['柱状'])
})
this.dataList.rot.map(item => {
this.chartTypeRot.push(['柱状'])
})
this.dataList.temp.map(item => {
this.chartTypeTemp.push(['柱状'])
this.eleList = data.data
this.checkResultList = []
this.eleList.checkResult.forEach(item => {
this.checkResultList = [...this.checkResultList, ...item]
})
}
})
// this.$http({
// url: this.$http.adornUrl('/electric/energyList'),
// method: 'post',
// data: this.$http.adornData({
// 'taskIds': this.taskIds
// })
// }).then(({data}) => {
// if (data.code === 0 && data.data) {
// console.log(JSON.parse(data.data))
// this.taskIds.forEach((objId, index) => {
// console.log(objId)
// if (JSON.parse(data.data)[objId].ele) {
// if (index === 0) {
// JSON.parse(data.data)[objId].ele.forEach(item => {
// const obj = {}
// obj[objId] = item
// this.dataList.ele.push(obj)
// })
// } else {
// JSON.parse(data.data)[objId].ele.forEach((item, i) => {
// this.dataList.ele[i][objId] = item
// })
// }
// }
// if (JSON.parse(data.data)[objId].gas) {
// if (index === 0) {
// JSON.parse(data.data)[objId].gas.forEach(item => {
// const obj = {}
// obj[objId] = item
// this.dataList.gas.push(obj)
// })
// } else {
// JSON.parse(data.data)[objId].gas.forEach((item, i) => {
// this.dataList.gas[i][objId] = item
// })
// }
// }
// if (JSON.parse(data.data)[objId].rot) {
// if (index === 0) {
// JSON.parse(data.data)[objId].rot.forEach(item => {
// const obj = {}
// obj[objId] = item
// this.dataList.rot.push(obj)
// })
// } else {
// JSON.parse(data.data)[objId].rot.forEach((item, i) => {
// this.dataList.rot[i][objId] = item
// })
// }
// }
// if (JSON.parse(data.data)[objId].temp) {
// if (index === 0) {
// JSON.parse(data.data)[objId].temp.forEach(item => {
// const obj = {}
// obj[objId] = item
// this.dataList.temp.push(obj)
// })
// } else {
// JSON.parse(data.data)[objId].temp.forEach((item, i) => {
// this.dataList.temp[i][objId] = item
// })
// }
// }
// })
// console.log(this.dataList)
// }
// })
}
}
}
@ -133,10 +494,11 @@ export default {
<style lang="scss">
.chart-container {
.el-tabs__item{
.el-tabs__item {
height: 120px;
}
.el-tabs__nav-next, .el-tabs__nav-prev {
.el-tabs__nav-next,
.el-tabs__nav-prev {
line-height: 120px;
}
}

View File

@ -85,11 +85,10 @@
}
},
activated () {
this.id = this.$route.query.id
this.getDataList()
},
created () {
console.log(this.$route.query.id)
this.id = this.$route.query.id
},
methods: {
//

View File

@ -4,7 +4,6 @@
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<!-- <el-form-item>
<el-select
@ -22,12 +21,35 @@
</el-option>
</el-select>
</el-form-item> -->
<el-form-item prop="stoveCode">
<el-input
v-model="dataForm.stoveCode"
placeholder="炉号"
clearable
></el-input>
</el-form-item>
<el-form-item prop="kilnId">
<el-select
size="small"
v-model="dataForm.kilnId"
clearable
filterable
placeholder="加工炉"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.code"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
size="small"
v-model="dataForm.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@ -35,16 +57,35 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">查询</el-button>
<el-button size="small" @click="getDataList(1)">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
ref="dataTable"
:stripe="true"
:header-cell-style="{background:'#eef1f6',color:'#606266',height: '56px'}"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
:row-key="
row => {
return row.id;
}
"
style="width: 100%;"
>
<el-table-column
type="selection"
header-align="center"
reserve-selection
align="center"
width="50"
>
</el-table-column>
<el-table-column
type="index"
header-align="center"
@ -53,36 +94,38 @@
width="50"
>
</el-table-column>
<el-table-column
<!-- <el-table-column
prop="taskCode"
label="任务编码"
>
</el-table-column> -->
<el-table-column align="center" width="180" prop="stoveCode" label="炉号">
</el-table-column>
<el-table-column
prop="createTime"
label="发起时间"
>
<el-table-column align="center" prop="sheetNo" label="生产单号">
</el-table-column>
<el-table-column align="center" prop="targetPosition" label="加工炉">
</el-table-column>
<el-table-column align="center" prop="plcValue" label="工艺号">
</el-table-column>
<el-table-column align="center" prop="beginTime" label="进炉时间">
<template slot-scope="scope">
{{ scope.row.createTime ? scope.row.createTime.replace('T', ' ') : '' }}
{{
scope.row.beginTime ? scope.row.beginTime.replace("T", " ") : ""
}}
</template>
</el-table-column>
<el-table-column
<!-- <el-table-column
align="center"
prop="taskSource"
label="任务来源"
>
</el-table-column> -->
<el-table-column align="center" prop="status" label="任务状态">
<template slot-scope="scope">
{{ scope.row.status >= 0 ? statusList[scope.row.status] : "" }}
</template>
</el-table-column>
<el-table-column
prop="status"
label="任务状态"
>
<template slot-scope="scope">
{{ scope.row.status >= 0 ? statusList[scope.row.status] : '' }}
</template>
</el-table-column>
<el-table-column
prop="taskType"
label="任务类型"
>
<el-table-column align="center" prop="taskType" label="任务类型">
<template slot-scope="scope">
<span>{{
scope.row.taskType === 0
@ -95,15 +138,7 @@
}}</span>
</template>
</el-table-column>
<el-table-column
prop="startPosition"
label="开始位置"
>
</el-table-column>
<el-table-column
prop="targetPosition"
label="目标位置"
>
<el-table-column align="center" prop="startPosition" label="开始位置">
</el-table-column>
<!-- <el-table-column
prop="vehicleName"
@ -114,32 +149,47 @@
fixed="right"
header-align="center"
align="center"
width="80"
label="检验">
<template slot-scope="scope">
<el-button type="text" size="small" @click="checkResult(scope.row.sheetNo)">检验结果</el-button>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="80"
label="能耗情况">
<template slot-scope="scope">
<el-button type="text" size="small" @click="eleHandle(scope.row.taskId)">详情</el-button>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="80"
label="订单详情"
width="100"
label="检验"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="LocationBtn(scope.row.taskId)"
>订单详情</el-button
<el-button
type="text"
size="small"
@click="checkResult(scope.row.sheetNo)"
>检验结果</el-button
>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="能耗情况"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="eleHandle(scope.row.taskId, scope.row.targetPosition)"
>详情</el-button
>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="生产单详情"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="LocationBtn(scope.row.taskId)"
>生产单详情</el-button
>
</template>
</el-table-column>
@ -154,7 +204,10 @@
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<task-history-result v-if="taskHistoryResultVisible" ref="addOrUpdate" @refreshDataList="getDataList"></task-history-result>
<task-history-result
v-if="taskHistoryResultVisible"
ref="addOrUpdate"
></task-history-result>
</div>
</template>
@ -173,11 +226,15 @@ export default {
return {
dataForm: {
vehicleId: '',
stoveCode: '',
kilnId: '',
time: []
},
taskHistoryResultVisible: false,
dataList: [],
options2: [],
options: [],
dataListSelections: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
@ -190,13 +247,30 @@ export default {
taskHistoryResult
},
activated () {
this.getDataList()
this.$http({
url: this.$http.adornUrl('/kilnInfo/page'),
method: 'post',
data: this.$http.adornData({
current: 1,
size: 500
// paramKey: this.dataForm.paramKey
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.options = data.data.records
} else {
this.options = []
}
})
this.getDataList(1)
},
methods: {
//
getDataList () {
getDataList (val) {
this.dataListLoading = true
console.log(this.dataForm.time)
if (val) {
this.$refs.dataTable.clearSelection()
}
this.$http({
url: this.$http.adornUrl('/taskHis/taskHis'),
method: 'post',
@ -204,6 +278,8 @@ export default {
current: this.pageIndex,
size: this.pageSize,
vehicleId: this.dataForm.vehicleId,
stoveCode: this.dataForm.stoveCode,
kilnId: this.dataForm.kilnId,
startTime:
this.dataForm.time && this.dataForm.time.length > 0
? this.dataForm.time[0]
@ -238,17 +314,50 @@ export default {
LocationBtn (id) {
this.$router.push({ name: 'report-task-history-detail', query: { id } })
},
eleHandle (taskId) {
this.$router.push({
name: 'report-task-ele',
query: { taskId }
})
eleHandle (taskId, targetPosition) {
const a = this.dataListSelections.findIndex(
item => item.targetPosition !== targetPosition
)
if (a !== 0) {
const taskIdArr = this.dataListSelections.map(item => {
return item.taskId
})
const taskIds = [...new Set([...taskIdArr, taskId])]
this.$router.push({
name: 'report-task-ele',
query: { taskIds }
})
} else {
this.$message({
message: '加工炉必须一致',
type: 'info',
duration: 1500
})
}
},
checkResult (sheetNo) {
this.taskHistoryResultVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(sheetNo)
})
},
//
selectionChangeHandle (val) {
let targetPosition = val[0] ? val[0].targetPosition : ''
let arr = []
val.forEach(item => {
if (targetPosition === item.targetPosition) {
arr.push(item)
} else {
this.$message({
message: '加工炉必须一致',
type: 'info',
duration: 1500
})
this.$refs.dataTable.toggleRowSelection(item, false)
}
})
this.dataListSelections = arr
}
}
}