detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" leftText="详情" @clickLeft="back">
  4. <template slot="float">
  5. <view class="nav-icon-caozuo iconfont icon-caozuo" @click="setOptionShow"></view>
  6. </template>
  7. </uni-nav-bar>
  8. <!-- 进度组件 根据状态显示不同列表 -->
  9. <popupOper :optionShow="optionShow" @operate="operate" :operationList="operationList"></popupOper>
  10. <view style="padding-bottom: 110rpx;" v-if="worksheetInfo">
  11. <uni-collapse ref="collapse">
  12. <uni-collapse-item :open="false" :typeOpen="1" title="基本信息">
  13. <view class="bg" >
  14. <CellInfo label="工单单号" :value="worksheetInfo.code"></CellInfo>
  15. <CellInfo label="计划单号" :value="worksheetInfo.type.name"></CellInfo>
  16. <CellInfo label="巡检部门" :value="worksheetInfo.maintainDept"></CellInfo>
  17. <CellInfo label="保养名称" :value="worksheetInfo.maintainName"></CellInfo>
  18. <CellInfo label="保养类型" :value="worksheetInfo.maintainType == '1' ? '普通保养' : '润滑保养'"></CellInfo>
  19. <CellInfo label="保养负责人" :value="worksheetInfo.maintainPrincipal.name"></CellInfo>
  20. <CellInfo label="保养人员" :value="worksheetInfo.maintainPerson"></CellInfo>
  21. <CellInfo label="计划开始时间" :value="worksheetInfo.appointTime"></CellInfo>
  22. <CellInfo label="计划结束时间" :value="worksheetInfo.finishTime"></CellInfo>
  23. <CellInfo label="创建人" :value="worksheetInfo.creator.name"></CellInfo>
  24. <CellInfo label="创建部门" value="null"></CellInfo>
  25. <CellInfo label="创建时间" :value="worksheetInfo.createTime"></CellInfo>
  26. </view>
  27. </uni-collapse-item>
  28. </uni-collapse>
  29. <!-- 巡点检明细 -->
  30. <template >
  31. <CellTip title="保养明细"> </CellTip>
  32. <OrderDetail
  33. v-for="item in worksheetInfo.details" :key="item.id" :border="true"
  34. :value1="item.equipmentName" :value2="item.equipmentPlace"
  35. :value3="worksheetInfo.executor.name" :value4="item.maintainPart"
  36. ></OrderDetail>
  37. </template>
  38. <!-- 执行信息 -->
  39. <template>
  40. <CellTip title="执行信息"> </CellTip>
  41. <CellInfo label="确认结果" :value="worksheetInfo.mainStatus.name"></CellInfo>
  42. <CellInfo label="实际开始时间" :value="worksheetInfo.acceptTime"></CellInfo>
  43. <CellInfo label="实际结束时间" :value="worksheetInfo.endTime"></CellInfo>
  44. </template>
  45. <!-- 执行处理结果 -->
  46. <template>
  47. <CellTip title="执行处理结果"> </CellTip>
  48. <OrderDetail :border="true"
  49. value1="数控机床" value2="TO5636633221653"
  50. value3="通用设备-机床" value4="DFRTE-896365"
  51. value5="一车间" value6="x1"
  52. ></OrderDetail>
  53. </template>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. get
  60. } from "@/utils/api.js"
  61. import CellTip from '@/components/CellTip.vue'
  62. import CellInfo from '@/components/CellInfo.vue'
  63. import OrderDetail from '../components/OrderDetail.vue'
  64. import popupOper from '@/components/PopupOper.vue'
  65. export default {
  66. components: {
  67. popupOper,
  68. OrderDetail,
  69. CellTip,
  70. CellInfo
  71. },
  72. data() {
  73. return {
  74. pageId:"",
  75. worksheetInfo: null,
  76. optionShow: false,
  77. operationList: [{
  78. title: '报工',
  79. class: 'iconfont icon-zhuanpai',
  80. type: 1
  81. },
  82. {
  83. title: '转派',
  84. class: 'iconfont icon-zhuanpai',
  85. type: 2
  86. }
  87. ],
  88. }
  89. },
  90. onLoad(options) {
  91. this.pageId = options.id;
  92. this.getInfo();
  93. },
  94. methods: {
  95. getInfo(){
  96. get(this.apiUrl+ "/maintain/worksheet/info",{id: this.pageId}).then(res=>{
  97. console.log(res)
  98. this.worksheetInfo = res.data;
  99. })
  100. },
  101. //选择对应的操作
  102. operate(type) {
  103. if (type === 2) { //转派
  104. uni.navigateTo({
  105. url: "../turn_send/turn_send?id=" + this.pageId
  106. })
  107. } else if (type === 1) { //报工
  108. uni.navigateTo({
  109. url: "../submitted_ministry/submitted_ministry?id=" + this.pageId
  110. })
  111. }
  112. },
  113. //点击显示弹窗
  114. setOptionShow() {
  115. this.optionShow = !this.optionShow;
  116. },
  117. }
  118. }
  119. </script>
  120. <style>
  121. </style>