check-detail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="container py2">
  3. <view class="mx3 p3 bg-color-white" style="border-radius: 16rpx">
  4. <!-- <view class="f-size-32 f-weight-6 py2 mb-2 title">任务信息</view> -->
  5. <equipment-line title="任务名称" :content="infoData.name" />
  6. <equipment-line title="计划名称" :content="infoData.planName" />
  7. <equipment-line title="设备" :content="infoData.sbName" />
  8. <equipment-line title="部件" :content="infoData.partName" />
  9. <equipment-line title="部件编号" :content="infoData.partNo" />
  10. <equipment-line title="任务开始时间" :content="infoData.startTime" />
  11. <equipment-line title="任务结束时间" :content="infoData.endTime" />
  12. <equipment-line
  13. title="实际开始时间"
  14. :content="infoData.actualStartTime"
  15. />
  16. <equipment-line title="实际结束时间" :content="infoData.actualEndTime" />
  17. <equipment-line
  18. title="设备状态"
  19. :content="sbStatusMap[infoData.sbStatus]"
  20. />
  21. <equipment-line title="任务状态" :content="statusMap[infoData.status]" />
  22. <equipment-line title="要求" :content="infoData.requirement" />
  23. <equipment-line title="检查结果" :content="infoData.feedback" />
  24. <equipment-line title="备注" :content="infoData.remark" />
  25. <view class="d-flex py3 border-bottom">
  26. <view class="f-size-26 text-color-9 w200">图片</view>
  27. <view class="f-size-26 text-color-3 d-flex">
  28. <block v-for="(item,index) in imagesList" :key='index'>
  29. <u-image width="100" class="mr-2" :src="item" @click="handlePre(index)" mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
  30. </block>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="p-fixed d-flex j-around a-center footer">
  35. <view class="main-color-bg text-color-white common" @tap="handleUpdate"
  36. >执行</view
  37. >
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. infoData: {},
  46. detailId: "",
  47. statusMap: null,
  48. sbStatusMap: null,
  49. imagesList: []
  50. };
  51. },
  52. onLoad(options) {
  53. this.detailId = options.detailId;
  54. this.statusMap = this.$DictCache.getLabelByValueMapByType(
  55. this.$DictCache.TYPE.CHECK_JOB_STATUS
  56. );
  57. this.sbStatusMap = this.$DictCache.getLabelByValueMapByType(
  58. this.$DictCache.TYPE.SB_INFO_STATUS
  59. );
  60. },
  61. onShow() {
  62. this.initData();
  63. },
  64. methods: {
  65. handleUpdate() {
  66. this.$Http.execute(this.infoData).then((res) => {
  67. uni.navigateTo({
  68. url: "/pages/check-add/check-add?detailId=" + this.detailId,
  69. });
  70. });
  71. },
  72. handlePre(index) {
  73. uni.previewImage({
  74. urls: this.imagesList,
  75. current:this.imagesList[index],
  76. success() {
  77. }
  78. });
  79. },
  80. initData() {
  81. this.$Http
  82. .fetchCheckJob({
  83. id: this.detailId,
  84. })
  85. .then((res) => {
  86. this.infoData = res.data;
  87. if(res.data.fileList != null && res.data.fileList.length >0){
  88. this.imagesList = res.data.fileList.map(item => {
  89. return this.$BaseTool.UserUtil.getFileUrl(item.url);
  90. })
  91. }
  92. });
  93. },
  94. },
  95. };
  96. </script>
  97. <style lang="less">
  98. page {
  99. background-color: #f4f4f4;
  100. }
  101. .container {
  102. padding-bottom: 100rpx;
  103. .footer {
  104. bottom: 0;
  105. left: 0;
  106. right: 0;
  107. background-color: #fff;
  108. z-index: 10000;
  109. }
  110. .title {
  111. border-bottom: 1rpx solid #f4f4f4;
  112. }
  113. .img {
  114. width: 100rpx;
  115. height: 100rpx;
  116. }
  117. .p-fixed {
  118. border-top: 1rpx solid #f4f4f4;
  119. height: 100rpx;
  120. .common {
  121. padding: 15rpx 200rpx;
  122. border-radius: 30rpx;
  123. background-color: #0082ff;
  124. color: #fff;
  125. }
  126. }
  127. }
  128. </style>