card.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="">
  3. <view @click="goDetail(item)" class="data" v-for="(item, index) in list" :key="index">
  4. <view class="top">
  5. <view class="left">
  6. <view class="title">
  7. <text>工单编号:{{item.repairNo}}</text>
  8. <text @click.stop="copy(item.repairNo)" class="padding-left-20">复制</text>
  9. </view>
  10. </view>
  11. <view class="right">
  12. <text class="text-orange" v-if="item.handleStatus==0">待处理</text>
  13. <text class="" v-if="item.handleStatus==1">处理中</text>
  14. <text class="text-green" v-if="item.handleStatus==2">已处理</text>
  15. <text class="text-red" v-if="item.handleStatus==3">不做处理</text>
  16. </view>
  17. </view>
  18. <view class="item">
  19. <view class="left">
  20. <view style="padding: 0 30rpx;">
  21. <view class="content">
  22. <text class="padding-right-10">受理状态:</text>
  23. <text class="text-orange" v-if="item.acceptStatus==0">待受理</text>
  24. <text class="text-green" v-if="item.acceptStatus==1">已受理</text>
  25. <text class="text-red" v-if="item.acceptStatus==2">拒绝受理</text>
  26. </view>
  27. <view class="content">
  28. <text class="padding-right-10">维修位置:</text>
  29. <text>{{item.reportPosition}}</text>
  30. </view>
  31. <view class="content">
  32. <text class="padding-right-10">故障描述:</text>
  33. <text style="line-height: 50rpx;">{{item.reportDetail}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="bottom">
  39. <button @click.stop="" open-type="contact" class="cu-btn sm round line-black margin-right-20">
  40. 联系物业
  41. </button>
  42. <!-- 待处理,显示取消工单 -->
  43. <view v-if="item.handleStatus==0" class="cu-btn sm round bg-blue" @click.stop="cancel(item)">
  44. 取消工单
  45. </view>
  46. <!-- 已取消,显示删除订单 -->
  47. <view v-if="item.handleStatus==-1" class="cu-btn sm round bg-blue" @click.stop="deleteItem(item)">
  48. 删除工单
  49. </view>
  50. <!-- 已完成,显示写评价 -->
  51. <view v-if="item.handleStatus==1" class="cu-btn sm round bg-blue" @click.stop="comment(item)">
  52. 写评价
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. name: 'card',
  61. props: {
  62. list: {
  63. type: Array,
  64. default: () => {
  65. []
  66. }
  67. }
  68. },
  69. data() {
  70. return {
  71. };
  72. },
  73. onLoad() {
  74. },
  75. methods: {
  76. copy(data) {
  77. uni.setClipboardData({
  78. data: data
  79. })
  80. },
  81. goDetail(item) {
  82. getApp().globalData.dataDetail = item
  83. uni.navigateTo({
  84. url: "../detail?id=" + item.id
  85. })
  86. },
  87. cancel(item) {
  88. this.$emit('cancel', item)
  89. },
  90. comment(item) {
  91. getApp().globalData.dataDetail = item
  92. uni.navigateTo({
  93. url: "../comment"
  94. })
  95. },
  96. deleteItem(item) {
  97. this.$emit('deleteItem', item)
  98. },
  99. }
  100. };
  101. </script>
  102. <style lang="scss">
  103. .bg-blue {
  104. background-color: #59a5f0;
  105. color: #FFFFFF;
  106. }
  107. .data {
  108. background-color: #ffffff;
  109. margin: 10rpx;
  110. border-radius: 6rpx;
  111. box-sizing: border-box;
  112. padding: 20rpx;
  113. font-size: 28rpx;
  114. .top {
  115. display: flex;
  116. justify-content: space-between;
  117. padding-bottom: 20rpx;
  118. border-bottom: 1rpx solid $dt-border-color-sm;
  119. .left {
  120. display: flex;
  121. align-items: center;
  122. .title {
  123. margin: 0 10rpx;
  124. font-size: 30rpx;
  125. }
  126. }
  127. .right {
  128. margin-right: 10rpx;
  129. }
  130. }
  131. .item {
  132. margin: 5rpx 0 20rpx 0;
  133. .content {
  134. border-bottom: 1rpx dashed #DDDDDD;
  135. padding: 30rpx 0;
  136. }
  137. }
  138. .bottom {
  139. display: flex;
  140. margin-top: 30rpx;
  141. justify-content: flex-end;
  142. align-items: center;
  143. }
  144. }
  145. </style>