detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view>
  3. <view class=" bg-white padding solid-bottom">
  4. <view class="flex justify-between">
  5. <view class="text-black">
  6. <text>工单编号:{{dataDetail.repairNo}}</text>
  7. <text class="text-blue padding-left-sm" @click="copy(dataDetail.repairNo)">复制</text>
  8. </view>
  9. <view>
  10. <text class="text-orange" v-if="dataDetail.handleStatus==0">待处理</text>
  11. <text class="" v-if="dataDetail.handleStatus==1">处理中</text>
  12. <text class="text-orange" v-if="dataDetail.handleStatus==2">已处理</text>
  13. <text class="text-red" v-if="dataDetail.handleStatus==3">不做处理</text>
  14. </view>
  15. </view>
  16. </view>
  17. <u-cell-group>
  18. <u-cell-item :arrow="false" title="所在小区" :value="dataDetail.residentialName"></u-cell-item>
  19. <u-cell-item :arrow="false" title="维修位置" :value="dataDetail.reportPosition"></u-cell-item>
  20. <u-cell-item :arrow="false" title="创建时间" :value="dataDetail.createTime"></u-cell-item>
  21. <u-cell-item :arrow="false" title="受理状态" :value="acceptStatus"></u-cell-item>
  22. </u-cell-group>
  23. <view class="cu-card dynamic no-card bg-white" style="padding: 30rpx;">
  24. <view class="cu-item shadow">
  25. <view class=" grid flex-sub col-5 grid-square">
  26. <view @click="previewPic(index,picArr)" v-for="(item,index) in picArr" :key="index" class="bg-img"
  27. :style="{backgroundImage: 'url(' + item + ')'}">
  28. </view>
  29. </view>
  30. </view>
  31. <view class="padding-top-30">
  32. <text>故障描述:</text>
  33. <text class="content">
  34. {{dataDetail.reportDetail}}
  35. </text>
  36. </view>
  37. </view>
  38. <view v-if="dataDetail.jobStatus==1&&dataDetail.estimateStatus==1"
  39. class="margin-top-sm margin-bottom-sm padding bg-white flex" style="box-sizing: border-box;">
  40. <view class="">
  41. <text class="">工单评价:</text>
  42. </view>
  43. <view class="flex-sub">
  44. <text class="">{{dataDetail.comment}}</text>
  45. </view>
  46. </view>
  47. <view class="margin-top-10">
  48. <history></history>
  49. </view>
  50. <view class="footer-fixed padding-sm bg-white flex justify-end margin-right-30"
  51. style="box-sizing: border-box;z-index: 999;padding: 20rpx;">
  52. <!-- 待处理,取消工单 -->
  53. <view class="cu-btn sm lineBlue round " v-if="dataDetail.jobStatus==0" @click="cancelItem()">
  54. 取消工单
  55. </view>
  56. <!-- 已撤销工单,删除工单 -->
  57. <view class="cu-btn sm lineBlue round margin-right-20"
  58. v-if="dataDetail.jobStatus==-1||dataDetail.jobStatus==1" @click="deleteItem()">
  59. 删除工单
  60. </view>
  61. <!-- 已处理,待评价 -->
  62. <navigator url="./comment" v-if="dataDetail.jobStatus==1&&dataDetail.estimateStatus==0"
  63. class="cu-btn sm bg-blue round ">
  64. 写评价
  65. </navigator>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import history from "./list/history.vue"
  71. var app = getApp()
  72. var that = this
  73. export default {
  74. components: {
  75. history
  76. },
  77. data() {
  78. return {
  79. //报修编号
  80. id: '',
  81. content: '',
  82. dataDetail: {},
  83. picArr: []
  84. }
  85. },
  86. onLoad(options) {
  87. that = this
  88. this.id = options.id
  89. },
  90. onShow() {
  91. this.fetchDetail()
  92. },
  93. computed:{
  94. acceptStatus(){
  95. let status={
  96. 0:'等待受理',
  97. 1:'已受理',
  98. 2:'拒绝受理'
  99. }
  100. return status[this.dataDetail.acceptStatus]
  101. }
  102. },
  103. methods: {
  104. previewPic(index, picArr) {
  105. console.log(index);
  106. uni.previewImage({
  107. urls: picArr,
  108. current: index
  109. })
  110. },
  111. copy(data) {
  112. uni.setClipboardData({
  113. data: data
  114. })
  115. },
  116. fetchDetail() {
  117. let data = {
  118. id: this.id
  119. }
  120. that.$http.estateRepairDetail(data).then(res => {
  121. that.dataDetail = res.data.data
  122. that.picArr = that.dataDetail.pic.split(',')
  123. });
  124. },
  125. cancelItem() {
  126. app.globalData.twoFailHint("确定要取消该工单?", function() {
  127. //取消状态
  128. that.dataDetail.jobStatus = -1
  129. // let operation='estateRepair/addEstateRepair'
  130. that.$http.addEstateRepair(that.dataDetail).then(res => {
  131. if (res.data.add_result == true) {
  132. app.globalData.oneFailHint("取消成功", function() {
  133. that.fetchDetail()
  134. });
  135. } else {
  136. app.globalData.oneFailHint(res.data.add_result);
  137. }
  138. });
  139. })
  140. },
  141. deleteItem() {
  142. app.globalData.twoFailHint("确定要删除该工单?", function() {
  143. //删除状态
  144. that.dataDetail.status = -1
  145. // let operation='estateRepair/addEstateRepair'
  146. that.$http.addEstateRepair(that.dataDetail).then(res => {
  147. if (res.data.add_result == true) {
  148. app.globalData.oneFailHint("删除成功", function() {
  149. uni.navigateBack({
  150. delta: "1"
  151. })
  152. });
  153. } else {
  154. app.globalData.oneFailHint(res.data.add_result);
  155. }
  156. });
  157. })
  158. },
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .bg-blue {
  164. background-color: #59a5f0;
  165. color: #FFFFFF;
  166. }
  167. .lineBlue {
  168. color: #59a5f0;
  169. border: 1rpx solid #59a5f0;
  170. }
  171. /deep/ .u-cell.data-v-65423b64 {
  172. display: flex;
  173. flex-direction: row;
  174. align-items: center;
  175. position: relative;
  176. box-sizing: border-box;
  177. width: 100%;
  178. padding: 18rpx 32rpx;
  179. font-size: 28rpx;
  180. line-height: 54rpx;
  181. color: #606266;
  182. background-color: #fff;
  183. text-align: left;
  184. }
  185. </style>