product-detail.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="production">
  3. <!-- <el-dialog
  4. title="生产监控详情"
  5. width="70%"
  6. :close-on-click-modal="false"
  7. :visible.sync="visible"
  8. @close="handleClose"
  9. > -->
  10. <div class="my-title">生产详情</div>
  11. <el-form
  12. :model="dataForm"
  13. :rules="dataRule"
  14. ref="dataForm"
  15. label-width="auto"
  16. >
  17. <el-row class="my-row">
  18. <el-col :span="8">
  19. <el-form-item label="产品编号:">
  20. <el-input v-model="dataForm.prodCode" disabled></el-input>
  21. </el-form-item>
  22. </el-col>
  23. </el-row>
  24. <el-row
  25. class="my-row"
  26. style="height: 350px; background-color: #efefef;"
  27. >
  28. <work-flow
  29. ref="workFlow"
  30. :nodeData="workFlowData"
  31. :selectOperator="true"
  32. :disabled="true"
  33. ></work-flow>
  34. </el-row>
  35. </el-form>
  36. <span slot="footer" class="dialog-footer">
  37. <el-button @click="onChose">返回</el-button>
  38. </span>
  39. <!-- </el-dialog> -->
  40. </div>
  41. </template>
  42. <script>
  43. import { getProdInfoById } from '@/api/trace'
  44. import WorkFlow from '@/components/work-flow/home'
  45. export default {
  46. name: 'product-detail',
  47. components: {
  48. WorkFlow
  49. },
  50. data () {
  51. return {
  52. mouldId: '',
  53. visible: false,
  54. dataForm: {},
  55. operatorList: [],
  56. operatorIds: [],
  57. productList: [],
  58. display: false,
  59. workFlowData: {
  60. nodeList: [],
  61. lineList: []
  62. },
  63. // 是否点击了流程图保存按钮
  64. clickFlowSave: false,
  65. datas: {},
  66. dataRule: {
  67. mouldName: [
  68. { required: true, message: '请输入模板名称', trigger: 'blur' }
  69. ]
  70. },
  71. dataRule1: {
  72. operatorIds: [
  73. { required: true, message: '操作人员不能为空', trigger: 'change' }
  74. ]
  75. }
  76. }
  77. },
  78. mounted () {
  79. this.visible = true
  80. },
  81. methods: {
  82. onChose () {
  83. this.$emit('onChose')
  84. },
  85. // 初始化表单
  86. async init (id, prodCode, disable) {
  87. console.log(prodCode)
  88. this.visible = true
  89. this.display = disable
  90. this.nodeList = []
  91. this.linkList = []
  92. this.mouldId = id
  93. this.dataForm.prodCode = prodCode
  94. await getProdInfoById(id).then(async ({ data }) => {
  95. if (data && data.code === '200') {
  96. this.dataForm = {
  97. ...this.dataForm
  98. }
  99. // 流程图展示
  100. this.workFlowData = {
  101. nodeList: data.data.nodeList,
  102. lineList: data.data.lineList
  103. }
  104. }
  105. })
  106. },
  107. handleClose () {
  108. this.$emit('close')
  109. }
  110. }
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. /deep/ .my-row .super-flow__node {
  115. width: 180px;
  116. height: 80px;
  117. }
  118. </style>