This commit is contained in:
朱文强 2022-09-09 16:48:26 +08:00
parent 344261e302
commit 9492b471dc
7 changed files with 781 additions and 1 deletions

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-15 08:20:28 * @Date: 2021-11-15 08:20:28
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-11 16:22:10 * @LastEditTime: 2022-09-06 15:26:36
* @Description: * @Description:
*/ */
/** /**
@ -57,6 +57,7 @@ const mainRoutes = {
{ path: '/order-current-order', component: _import('order/current-order'), name: 'order-current-order', meta: { title: '当前订单列表', isTab: true } }, { path: '/order-current-order', component: _import('order/current-order'), name: 'order-current-order', meta: { title: '当前订单列表', isTab: true } },
{ path: '/order-current-order-task', component: _import('order/components/current-order-task'), name: 'order-current-order-task', meta: { title: '当前订单任务详情', isTab: true } }, { path: '/order-current-order-task', component: _import('order/components/current-order-task'), name: 'order-current-order-task', meta: { title: '当前订单任务详情', isTab: true } },
{ path: '/order-current-task', component: _import('order/current-task'), name: 'order-current-task', meta: { title: '当前任务列表', isTab: true } }, { path: '/order-current-task', component: _import('order/current-task'), name: 'order-current-task', meta: { title: '当前任务列表', isTab: true } },
{ path: '/order-current-task-new', component: _import('order/current-task-new'), name: 'order-current-task-new', meta: { title: '任务列表', isTab: true } },
{ path: '/order-current-task-detail', component: _import('order/components/current-task-detail'), name: 'order-current-task-detail', meta: { title: '当前执行任务详情', isTab: true } }, { path: '/order-current-task-detail', component: _import('order/components/current-task-detail'), name: 'order-current-task-detail', meta: { title: '当前执行任务详情', isTab: true } },
{ path: '/report-kiln-alarm', component: _import('report/kiln-alarm'), name: 'report-kiln-alarm', meta: { title: '工业炉报警', isTab: true } }, { 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-car-alarm', component: _import('report/car-alarm'), name: 'report-car-alarm', meta: { title: '车辆运行报警', isTab: true } },

View File

@ -134,6 +134,13 @@
<icon-svg name="editor" class="site-sidebar__menu-icon"></icon-svg> <icon-svg name="editor" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">当前任务列表</span> <span slot="title">当前任务列表</span>
</el-menu-item> </el-menu-item>
<el-menu-item
index="current-task"
@click="$router.push({ name: 'order-current-task-new' })"
>
<icon-svg name="editor" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">任务列表</span>
</el-menu-item>
</el-submenu> </el-submenu>
<!-- <el-submenu index="energy"> <!-- <el-submenu index="energy">
<template slot="title"> <template slot="title">

View File

@ -0,0 +1,150 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-09-09 16:26:17
* @Description:
-->
<template>
<el-dialog title="修改"
:before-close="handleClose"
:visible.sync="visible">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-form-item label="加工炉" prop="kilnId">
<el-select
v-model="dataForm.kilnId"
filterable
placeholder="请选择加工炉"
>
<el-option
v-for="item in kilnInfoArr"
:key="item.id"
:label="item.kilnName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="dataForm.status"
filterable
placeholder="请选择状态"
>
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</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 {
props: {
kilnInfoArr: {
type: Array,
default: () => {
return []
}
}
},
data () {
return {
visible: false,
btnLoad: false,
dataForm: {
id: '',
kilnId: '',
status: ''
},
statusList: [
{
value: 0,
label: '等待执行'
},
{
value: 1,
label: '执行中'
},
{
value: 2,
label: '执行完成'
}
],
dataRule: {
kilnId: [
{ required: true, message: '加工炉不能为空', trigger: 'change' }
],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
}
}
},
methods: {
init (id, status, kilnId) {
this.btnLoad = false
this.dataForm = {
id: '',
kilnId: '',
status: ''
}
this.dataForm.id = id
this.dataForm.status = status
this.dataForm.kilnId = kilnId
this.visible = true
},
//
dataFormSubmit () {
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)
}
})
}
})
},
handleClose () {
this.visible = false
this.$refs['dataForm'].resetFields()
}
}
}
</script>

View File

@ -0,0 +1,243 @@
<template>
<div style="margin:20px">
<el-table
:data="dataList"
ref="dataList"
size="mini"
height="250"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
width: '100%'
}"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="taskCode" label="任务编码"> </el-table-column>
<el-table-column prop="createTime" label="发起时间">
<template slot-scope="scope">
{{
scope.row.createTime ? scope.row.createTime.replace("T", " ") : ""
}}
</template>
</el-table-column>
<el-table-column prop="kilnName" label="工业炉">
<template slot-scope="scope">
<span>{{
kilnInfoArr.find(item => {
return item.id === scope.row.kilnId;
})
? kilnInfoArr.find(item => {
return item.id === scope.row.kilnId;
}).kilnName
: ""
}}</span>
</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="任务类型">
<template slot-scope="scope">
<span>{{
scope.row.taskType === 0
? "入库到工业炉"
: scope.row.taskType === 1
? "入库到缓存"
: scope.row.taskType === 2
? "工业炉出库到缓存区"
: "缓存区出库"
}}</span>
</template>
</el-table-column> -->
<el-table-column prop="isAuto" label="多步骤">
<template slot-scope="scope">
<span>{{ scope.row.isAuto === 1 ? "是" : "否" }}</span>
</template>
</el-table-column>
<el-table-column prop="craftCodeId" label="工艺"> </el-table-column>
<el-table-column prop="startPosition" label="开始位置"> </el-table-column>
<el-table-column prop="targetPosition" 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.id,
scope.row.status,
scope.row.kilnId
)
"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<icon-svg class="iconClass" name="编辑"></icon-svg>
</el-tooltip>
</el-button>
<el-button
type="text"
:disabled="scope.row.status === 1"
size="small"
@click="runTask(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="执行"
placement="top"
>
<icon-svg class="iconClass" name="维护开始"></icon-svg>
</el-tooltip>
</el-button>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
>
<icon-svg class="iconClass" name="删除"></icon-svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:kiln-info-arr="kilnInfoArr"
@refreshDataList="reDataList"
></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './current-task-new-add'
//
const statusList = {
0: '等待执行',
1: '执行中',
2: '执行完成'
}
export default {
props: {
dataList: {
type: Array,
default: () => {
return []
}
},
kilnInfoArr: {
type: Array,
default: () => {
return []
}
}
},
data () {
return {
statusList,
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {},
methods: {
init () {
console.log(1)
},
// /
addOrUpdateHandle (id, status, kilnId) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, status, kilnId)
})
},
reDataList () {
this.$emit('refreshDataList')
},
//
deleteHandle (id) {
this.$confirm(`确定对[${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/currTask/deleteById'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.reDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
},
//
runTask (id) {
this.$http({
url: this.$http.adornUrl('/currTask/runTask'),
method: 'post',
data: this.$http.adornData({ id })
// params: this.$http.adornParams({ id }, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.reDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}
}
}
</script>
<style></style>

View File

@ -0,0 +1,78 @@
<!--
* @Author: zwq
* @Date: 2022-09-09 14:35:52
* @LastEditors: zwq
* @LastEditTime: 2022-09-09 15:25:54
* @Description:
-->
<template>
<div style="margin:20px">
<el-table
:data="detDataList"
:stripe="true"
size="mini"
ref="detDataList"
height="250"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
width: '100%'
}"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</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>
</div>
</template>
<script>
//
const statusList = {
0: '等待执行',
1: '执行中',
2: '执行完成',
3: '追加后完成'
}
export default {
props: {
detDataList: {
type: Array,
default: () => {
return []
}
}
},
data () {
return {
statusList
}
},
components: {
},
activated () {},
methods: {
init () {
console.log(2)
}
}
}
</script>
<style></style>

View File

@ -0,0 +1,105 @@
<!--
* @Author: zwq
* @Date: 2022-09-09 15:19:56
* @LastEditors: zwq
* @LastEditTime: 2022-09-09 15:26:04
* @Description:
-->
<template>
<div style="margin:20px">
<el-table
:data="dataList"
ref="dataList"
size="mini"
height="250"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
width: '100%'
}"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="inTime" label="入库时间">
<template slot-scope="scope">
{{
scope.row.inTime ? scope.row.inTime.replace("T", " ") : ""
}}
</template>
</el-table-column>
<el-table-column prop="kilnName" label="工业炉名称"></el-table-column>
<el-table-column prop="locationName" label=" 库位名称"> </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="topList(scope.row.id)"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
//
const statusList = {
0: '等待执行',
1: '执行中',
2: '执行完成',
3: '追加后完成'
}
export default {
props: {
dataList: {
type: Array,
default: () => {
return []
}
}
},
data () {
return {
statusList
}
},
components: {
},
activated () {},
methods: {
init () {
console.log(3)
},
topList (id) {
this.$http({
url: this.$http.adornUrl('/inStockInfo/top'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
} else {
this.$message.error(data.msg)
}
})
}
}
}
</script>
<style></style>

View File

@ -0,0 +1,196 @@
<template>
<div class="mod-config">
<el-table
:data="dataList"
:row-class-name="tableRowClassName"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
ref="dataList"
>
<el-table-column type="expand">
<template slot-scope="props">
<div style="height:300px">
<el-tabs @tab-click="val => handleClick(val, props.row)">
<el-tab-pane label="任务步骤详情">
<tab-table1
:data-list="props.row.currTaskVoList"
:kiln-info-arr="kilnInfoArr"
ref="tab1Ref"
@refreshDataList="getDataList"
>
</tab-table1>
</el-tab-pane>
<el-tab-pane label="缓存详情">
<tab-table3
:data-list="props.row.inStockInfoVoList"
ref="tab3Ref"
@refreshDataList="getDataList"
>
</tab-table3>
</el-tab-pane>
<el-tab-pane label="标识卡详情">
<tab-table2
:det-data-list="props.row.currTaskDetVoList"
ref="tab2Ref"
@refreshDataList="getDataList"
>
</tab-table2>
</el-tab-pane>
</el-tabs>
</div>
</template>
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<span>{{
scope.row.status === 0
? "等待执行"
: scope.row.status === 1
? "执行中"
: "缓存中"
}}</span>
</template>
</el-table-column>
<el-table-column prop="allStep" width="250" label="所有步骤">
</el-table-column>
<el-table-column prop="nowStep" label="当前步骤"> </el-table-column>
<el-table-column prop="isAuto" label="多步骤">
<template slot-scope="scope">
<span>{{ scope.row.isAuto === 0 ? "否" : "是" }}</span>
</template>
</el-table-column>
<el-table-column prop="sheetNo" label="生产单号"> </el-table-column>
<el-table-column prop="startPosition" label="开始位置"> </el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="添加时间"
>
<template slot-scope="scope">
{{
scope.row.createTime ? scope.row.createTime.replace("T", " ") : ""
}}
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './components/current-task-new-add'
import tabTable1 from './components/current-task-new-table1'
import tabTable2 from './components/current-task-new-table2'
import tabTable3 from './components/current-task-new-table3'
export default {
data () {
return {
dataList: [],
kilnInfoArr: [],
dataListLoading: false,
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate,
tabTable1,
tabTable2,
tabTable3
},
activated () {
this.getDataList()
},
created () {
this.$http({
url: this.$http.adornUrl('/kilnInfo/list'),
method: 'post',
data: this.$http.adornData({
current: 1,
size: 500
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.kilnInfoArr = data.data
} else {
this.kilnInfoArr = []
}
})
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/currTask/currentTaskInfo'),
method: 'post',
data: this.$http.adornData({
current: 1,
size: 500
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.data
} else {
this.dataList = []
}
this.dataListLoading = false
})
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
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 ''
}
}
}
</script>
<style>
.el-table .warning-row {
background-color: oldlace;
}
.el-table .success-row {
background-color: #f0f9eb;
}
</style>