detail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <!-- <view class="bg-blue padding" style="height: 100rpx;">
  4. <view class="text-xxl ">
  5. <text v-if="dataDetail.handleStatus==-1">已撤销</text>
  6. <text v-else-if="dataDetail.handleStatus==0">待处理</text>
  7. <text v-else-if="dataDetail.handleStatus==1">已处理</text>
  8. </view>
  9. <view class="text-df padding-top-xs">
  10. <text v-if="dataDetail.handleStatus==-1">当前工单已取消</text>
  11. <text v-else-if="dataDetail.handleStatus==0">当前工单待处理,请耐心等待</text>
  12. <text v-else-if="dataDetail.handleStatus==1">当前工单已完成</text>
  13. </view>
  14. </view> -->
  15. <view class=" bg-white padding solid-bottom">
  16. <view class="flex justify-between">
  17. <view class="text-black">
  18. <text>工单编号:{{dataDetail.repairNo}}</text>
  19. <text class="text-blue padding-left-sm" @click="copy(dataDetail.repairNo)">复制</text>
  20. </view>
  21. <view class="text-red">
  22. <text v-if="dataDetail.handleStatus==-1">已撤销</text>
  23. <text v-else-if="dataDetail.handleStatus==0">待处理</text>
  24. <text v-else-if="dataDetail.handleStatus==1">已处理</text>
  25. </view>
  26. </view>
  27. </view>
  28. <u-cell-group>
  29. <u-cell-item :arrow="false" icon="home" title="所在小区" :value="dataDetail.residentialName"></u-cell-item>
  30. <u-cell-item :arrow="false" icon="map" title="维修位置" :value="dataDetail.reportPosition"></u-cell-item>
  31. <u-cell-item :arrow="false" icon="clock" title="创建时间" :value="dataDetail.createTime"></u-cell-item>
  32. <u-cell-item v-if="dataDetail.handleStatus==1" :arrow="false" icon="clock" title="完成时间" :value="dataDetail.handleTime"></u-cell-item>
  33. </u-cell-group>
  34. <view class="cu-card dynamic no-card bg-white" style="padding: 30rpx;">
  35. <view class="cu-item shadow">
  36. <view class=" grid flex-sub col-4 grid-square" >
  37. <view @click="previewPic(index,picArr)" v-for="(item,index) in picArr" :key="index" class="bg-img" :style="{backgroundImage: 'url(' + item + ')'}">
  38. </view>
  39. </view>
  40. </view>
  41. <view class="padding-top-20">
  42. <text>故障描述:</text>
  43. <text class="content">
  44. {{dataDetail.reportDetail}}
  45. </text>
  46. </view>
  47. </view>
  48. <!-- <view class="margin-top-sm margin-bottom-sm padding bg-white flex" style="box-sizing: border-box;">
  49. <view class="">
  50. <text class="">故障描述:</text>
  51. </view>
  52. <view class="flex-sub" >
  53. <text class="">{{dataDetail.reportDetail}}</text>
  54. </view>
  55. </view> -->
  56. <view v-if="dataDetail.handleStatus==1&&dataDetail.estimateStatus==1" class="margin-top-sm margin-bottom-sm padding bg-white flex" style="box-sizing: border-box;">
  57. <view class="">
  58. <text class="">工单评价:</text>
  59. </view>
  60. <view class="flex-sub" >
  61. <text class="">{{dataDetail.comment}}</text>
  62. </view>
  63. </view>
  64. <view class="footer-fixed padding-sm bg-white flex justify-end margin-right-30" style="box-sizing: border-box;z-index: 999;padding: 20rpx;">
  65. <!-- 待处理,取消工单 -->
  66. <view class="cu-btn sm lineBlue round " v-if="dataDetail.handleStatus==0" @click="cancelItem()">
  67. 取消工单
  68. </view>
  69. <!-- 已撤销工单,删除工单 -->
  70. <view class="cu-btn sm lineBlue round margin-right-20" v-if="dataDetail.handleStatus==-1||dataDetail.handleStatus==1" @click="deleteItem()" >
  71. 删除工单
  72. </view>
  73. <!-- v-if="dataDetail.handleStatus==1&&dataDetail.estimateStatus==0" -->
  74. <!-- 已处理,待评价 -->
  75. <navigator url="./comment" v-if="dataDetail.handleStatus==1&&dataDetail.estimateStatus==0" class="cu-btn sm bg-blue round " >
  76. 写评价
  77. </navigator>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. var app=getApp()
  83. var that=this
  84. export default {
  85. data() {
  86. return {
  87. //报修编号
  88. id:'',
  89. content:'',
  90. dataDetail:{},
  91. picArr:[]
  92. }
  93. },
  94. onLoad(options) {
  95. that=this
  96. this.id=options.id
  97. },
  98. onShow() {
  99. this.fetchDetail()
  100. },
  101. methods: {
  102. previewPic(index,picArr){
  103. console.log(index);
  104. uni.previewImage({
  105. urls:picArr,
  106. current:index
  107. })
  108. },
  109. copy(data){
  110. uni.setClipboardData({
  111. data:data
  112. })
  113. },
  114. fetchDetail(){
  115. let operation='estateRepair/estateRepairDetail'
  116. let data={
  117. id:this.id
  118. }
  119. app.globalData.postRequest(data, operation, function (res) {
  120. app.globalData.dataDetail=res.data.estateRepairDetail
  121. that.dataDetail=res.data.estateRepairDetail
  122. that.picArr=that.dataDetail.pic.split(',')
  123. });
  124. },
  125. cancelItem(){
  126. app.globalData.twoFailHint("确定要取消该工单?",function(){
  127. //取消状态
  128. that.dataDetail.handleStatus=-1
  129. let operation='estateRepair/addEstateRepair'
  130. app.globalData.postRequest(that.dataDetail, operation, function (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. app.globalData.postRequest(that.dataDetail, operation, function (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">
  163. .bg-blue{
  164. background-color: #59a5f0;
  165. color: #FFFFFF;
  166. }
  167. .lineBlue{
  168. color: #59a5f0;
  169. border: 1rpx solid #59a5f0;
  170. }
  171. </style>