|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="production">
|
|
|
- <div class="my-title">生产监控详情</div>
|
|
|
+ <div class="my-title">详情</div>
|
|
|
<div v-for="(item, index) in dataList">
|
|
|
<el-table
|
|
|
:data="item.nodeList"
|
|
@@ -125,10 +125,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getMonitoringDetail } from '@/api/production'
|
|
|
+import {getMonitoringDetail, getRecordingDetail} from '@/api/production'
|
|
|
+import { getProductionDetail } from '@/api/sale'
|
|
|
import AttachDetail from '@/views/modules/common/attach-detail'
|
|
|
import AttachDetailDialog from '@/views/modules/common/attach-detail-dialog'
|
|
|
import InspectTypeDialog from '@/views/modules/production/inspect-type-dialog'
|
|
|
+import {getProdInfoById} from '@/api/trace'
|
|
|
export default {
|
|
|
name: 'prod-management-details',
|
|
|
components: {InspectTypeDialog, AttachDetailDialog, AttachDetail},
|
|
@@ -154,15 +156,45 @@ export default {
|
|
|
this.$emit('onChose')
|
|
|
},
|
|
|
// 初始化表单
|
|
|
- async init (id) {
|
|
|
- await getMonitoringDetail(id).then(async ({ data }) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataList = data.data
|
|
|
- } else {
|
|
|
- this.$message.error(data.msg)
|
|
|
- this.handleClose()
|
|
|
- }
|
|
|
- })
|
|
|
+ async init (id, type) {
|
|
|
+ // type: 详情来源,1: 生产监控;2:生产记录;3:发货管理;4:追溯中心
|
|
|
+ if (type === 1) {
|
|
|
+ await getMonitoringDetail(id).then(async ({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ this.handleClose()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 2) {
|
|
|
+ await getRecordingDetail(id).then(async ({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ this.handleClose()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 3) {
|
|
|
+ await getProductionDetail(id).then(async ({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ this.handleClose()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 4) {
|
|
|
+ await getProdInfoById(id).then(async ({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ this.handleClose()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
handleClose () {
|
|
|
this.$emit('close')
|