repairAcceptance.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="repairAcceptance">
  3. <div class="whiteBoard">
  4. <div class="addRepair" @tap="addRepair">新增报修 <van-icon name="add" style="margin-left: 8rpx"/></div>
  5. <div class="repairItem" v-for="item in recordList" @click="toDetail(item)">
  6. <div class="repairItemTitleRow">
  7. <span class="titleName">{{item.description}}</span>
  8. <span class="titleTag" :class="item.statusName==='已受理'?'titleTag2':item.type==='已处理'?'titleTag3':'titleTag'">{{item.statusName}}</span>
  9. </div>
  10. <div class="companyBox">
  11. <img src="https://www.idea-co-sf.com/gardenProduct/image/gs.svg" class="gsIcon">
  12. <span class="companyName">{{item.companyName}}</span>
  13. </div>
  14. <div class="upTimeBox">上报时间:{{ item.createdAt }}</div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { repairList,getUserLocalStorageInfo,getByCodes } from "@/js_sdk/http";
  21. export default {
  22. name: "repairAcceptance",
  23. data(){
  24. return{
  25. dc_key: ['REPAIR_STATUS'],
  26. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  27. recordList:[
  28. // {name:'上月水费不太对,怀疑水表异常',type:'待受理'},
  29. // {name:'空调坏了,不能使用',type:'待处理'},
  30. // {name:'空调坏了,不能使用',type:'已处理'},
  31. ],
  32. params: {
  33. pageNum: 1,
  34. pageSize: 10,
  35. dispatchUserId: getUserLocalStorageInfo().userId,
  36. handleUserId: getUserLocalStorageInfo().userId,
  37. },
  38. checkList:[]
  39. }
  40. },
  41. onShow(){
  42. this.getByCodes()
  43. },
  44. mounted(){
  45. },
  46. methods:{
  47. onPullDownRefresh() {
  48. this.getByCodes()
  49. setTimeout(function () {
  50. uni.stopPullDownRefresh();
  51. }, 1000);
  52. },
  53. async getByCodes() {
  54. let data = await getByCodes(JSON.stringify(this.dc_key));
  55. this.dic_SelectList = this.$common.handleDicList(data);
  56. this.checkList = this.dic_SelectList.REPAIR_STATUS
  57. this.getList()
  58. },
  59. getList(){
  60. this.recordList = []
  61. const _this = this
  62. repairList(this.params).then((res) => {
  63. if (res.code=='409'){
  64. uni.clearStorageSync();
  65. uni.reLaunch({
  66. url: "/pages/login/login",
  67. });
  68. }
  69. if (res.data) {
  70. res.data.forEach(function(item) {
  71. const jsonMap = _this.getItemJson(item)
  72. _this.recordList.push(jsonMap)
  73. })
  74. }
  75. })
  76. },
  77. addRepair(){
  78. uni.navigateTo({
  79. url:'/pages/subPackages/todo/addRepair'
  80. })
  81. },
  82. toDetail(item) {
  83. uni.navigateTo({
  84. url:'/pages/subPackages/todo/dispatch?item=' + JSON.stringify(item)
  85. })
  86. },
  87. getItemJson: function(item) {
  88. item.createdAt = this.$common.transServDate(item.createdAt)
  89. let transformedObject = this.checkList.reduce((acc, obj) => {
  90. acc[obj.value] = obj.label;
  91. return acc;
  92. }, {});
  93. item.statusName = transformedObject[item.status]
  94. return item
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .repairAcceptance{
  101. .whiteBoard{
  102. background: white;
  103. margin-top: 24rpx;
  104. box-sizing: border-box;
  105. padding: 32rpx;
  106. min-height: 1424rpx;
  107. .addRepair{
  108. display: flex;
  109. justify-content: flex-end;
  110. align-items: center;
  111. color: rgba(3, 101, 249, 1);
  112. }
  113. .repairItem{
  114. background: rgba(245, 247, 250, 1);
  115. border-radius: 16rpx;
  116. width: 686rpx;
  117. height: 224rpx;
  118. padding: 32rpx 0 24rpx 0;
  119. box-sizing: border-box;
  120. margin-top: 24rpx;
  121. .repairItemTitleRow{
  122. display: flex;
  123. justify-content: space-between;
  124. padding: 0 32rpx;
  125. .titleName{
  126. color: rgba(34, 34, 34, 1);
  127. font-size: 32rpx;
  128. font-weight: 600;
  129. }
  130. .titleTag{
  131. width: 112rpx;
  132. height: 48rpx;
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. border-radius: 4rpx;
  137. color: rgba(242, 25, 18, 1);
  138. font-size: 28rpx;
  139. background: rgba(242, 25, 18, 0.20);
  140. }
  141. .titleTag2{
  142. width: 112rpx;
  143. height: 48rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. border-radius: 4rpx;
  148. color: rgba(255, 107, 24, 1);
  149. font-size: 28rpx;
  150. background: rgba(255, 107, 24, 0.20);
  151. }
  152. .titleTag3{
  153. width: 112rpx;
  154. height: 48rpx;
  155. display: flex;
  156. align-items: center;
  157. justify-content: center;
  158. border-radius: 4rpx;
  159. color: rgba(34, 181, 101, 1);
  160. font-size: 28rpx;
  161. background: rgba(34, 181, 101, 0.20);
  162. }
  163. }
  164. .companyBox{
  165. display: flex;
  166. align-items: center;
  167. padding: 8rpx 32rpx 24rpx 32rpx;
  168. .gsIcon{
  169. width: 32rpx;
  170. height: 32rpx;
  171. }
  172. .companyName{
  173. font-size: 28rpx;
  174. color: rgba(102, 102, 102, 1);
  175. margin-left: 8rpx;
  176. }
  177. }
  178. .upTimeBox{
  179. padding: 16rpx 32rpx 0 32rpx;
  180. border-top: 1px solid rgba(230, 230, 230, 1);
  181. color: rgba(102, 102, 102, 1);
  182. font-size: 28rpx;
  183. }
  184. }
  185. }
  186. }
  187. </style>