DetailsIndex.vue 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="app-container">
  3. <el-radio-group v-model="tabPosition" style="margin: 5px" @change="handleTabChange">
  4. <el-radio-button label="first">物资清单</el-radio-button>
  5. <el-radio-button label="second">领取记录</el-radio-button>
  6. <el-radio-button label="third">检查计划</el-radio-button>
  7. <el-radio-button label="fourth">检查记录</el-radio-button>
  8. <el-radio-button label="fifth">维修/更换记录</el-radio-button>
  9. </el-radio-group>
  10. <!-- 物资清单 -->
  11. <div v-if="tabPosition == 'first'" class="materialsListcon">
  12. <MaterialInfromation :cabinetId="cabinetId"/>
  13. </div>
  14. <!-- 领取记录 -->
  15. <div v-if="tabPosition == 'second'" class="materialsListcon">
  16. <CollectionManagement :cabinetId="cabinetId"/>
  17. </div>
  18. <!-- 检查计划 -->
  19. <div v-if="tabPosition == 'third'" class="materialsListcon">
  20. <InspectionPlan :cabinetId="cabinetId" @planId="handlePlanId"/>
  21. </div>
  22. <!-- 检查记录 -->
  23. <div v-if="tabPosition == 'fourth'" class="materialsListcon">
  24. <InspectionRecords :cabinetId="cabinetId" :planName="planName" :planId="planId" @recordId="handleRecordId"/>
  25. </div>
  26. <!-- 更换记录 -->
  27. <div v-if="tabPosition == 'fifth'" class="materialsListcon">
  28. <ReplacementRecords :cabinetId="cabinetId" :recordId="recordId"/>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import MaterialInfromation from '@/views/mes/material/materialinformation/index.vue'
  34. import CollectionManagement from '@/views/mes/material/collectionmanagement/index.vue'
  35. import InspectionPlan from '@/views/mes/material/inspectionplan/index.vue'
  36. import InspectionRecords from '@/views/mes/material/Inspectionrecords/index.vue'
  37. import ReplacementRecords from '@/views/mes/material/replacementrecords/index.vue'
  38. export default {
  39. components: {
  40. MaterialInfromation,
  41. CollectionManagement,
  42. InspectionPlan,
  43. InspectionRecords,
  44. ReplacementRecords
  45. },
  46. data() {
  47. return {
  48. tabPosition: 'first', //顶部切换
  49. cabinetId: null,
  50. planId: null,
  51. planName: '',
  52. recordId: null,
  53. PlanData:null,//接收传递的planId和planName
  54. }
  55. },
  56. created() {
  57. this.cabinetId = this.$route.query.cabinetId || ''
  58. },
  59. methods: {
  60. handleTabChange(newTab) {
  61. // 切换tab的操作
  62. this.tabPosition = newTab
  63. this.PlanData=null
  64. this.planId = null
  65. this.planName = ''
  66. },
  67. handlePlanId(data) {
  68. console.log('接收到的 planId:', data)
  69. this.PlanData = data
  70. if (this.PlanData) {
  71. this.planId = this.PlanData.planId
  72. this.planName = this.PlanData.planName
  73. }
  74. this.tabPosition = 'fourth'
  75. },
  76. handleRecordId(recordId) {
  77. console.log('接收到的 recordId:', recordId)
  78. this.recordId = recordId
  79. this.tabPosition = 'fifth'
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. </style>