index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <div class="repair">
  3. <!-- <div class="top-add" @click="goNavigator('repairprocessing-add-app')">-->
  4. <!-- <i class="iconfont icon-xinzeng"></i>-->
  5. <!-- <span class="txt">新增报修</span>-->
  6. <!-- </div>-->
  7. <div class="info-list">
  8. <div class="info-item" v-for="item in recordList" :key="item.id" @click="goNavigator(item.id)">
  9. <div class="info-top">
  10. <div class="left">
  11. <img :src="item.fileUrl != null ? item.fileUrl.url : ''" alt="" />
  12. </div>
  13. <div class="right">
  14. <p class="tit">
  15. {{ item.description }}
  16. </p>
  17. <p class="txt">{{ item.companyName }}</p>
  18. </div>
  19. </div>
  20. <div class="info-bottom">
  21. <div class="left">
  22. <i class="iconfont icon-shijian"></i>
  23. <span>
  24. {{ item.createdAt }}
  25. </span>
  26. </div>
  27. <div class="right">
  28. <span v-if="item.status == '2'" class="normal-tip yd z-bg">待确认 </span>
  29. <span v-if="item.status == '3'" class="normal-tip yd z-bg">已确认 </span>
  30. <span v-if="item.status == '4'" class="normal-tip yd z-bg">处理退回 </span>
  31. <span v-if="item.status == '5'" class="normal-tip yd z-bg">已退回 </span>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. // import { list } from "@/service/api_repair";
  40. import {
  41. getByCodes,
  42. getUserLocalStorageInfo,
  43. confirmList,
  44. } from "@/js_sdk/http";
  45. // import Base from "@/pages/base/base";
  46. // import auth from "@/service/auth";
  47. export default {
  48. data() {
  49. return {
  50. dic_key: ["REPAIR_STATUS"],
  51. dic_SelectList: {},
  52. recordList: [],
  53. dic_SelectList: {},
  54. BASE_URI: this.$constant.BASE_URI,
  55. params: {
  56. pageNum: 1,
  57. pageSize: 10,
  58. // status: 'acceptance',
  59. // groupId: '870261874875170816',
  60. // handleUserId: getUserLocalStorageInfo().user.id,
  61. },
  62. totalPage: 1,
  63. allData: [],
  64. list: [
  65. {
  66. title: "关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  67. name: "无锡 XXXX有限公司",
  68. date: "2020-09-18 19:34:06",
  69. type: "1",
  70. },
  71. {
  72. title:
  73. "关于组织2020年无锡市服务业提质增效资金项目申报的通知关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  74. name: "无锡 XXXX有限公司",
  75. date: "2020-09-18 19:34:06",
  76. type: "2",
  77. },
  78. ],
  79. };
  80. },
  81. onShow() {
  82. this.parmas =
  83. getUserLocalStorageInfo().user.id +
  84. getUserLocalStorageInfo().user.truename +
  85. getUserLocalStorageInfo().user.phone;
  86. this.getByCodes();
  87. this.params.userId = getUserLocalStorageInfo().user.id;
  88. },
  89. methods: {
  90. goNavigator(id) {
  91. uni.navigateTo({
  92. url: "/pages/subPackages/serve-confirm/detail?id=" + id,
  93. fail: (fail) => {
  94. console.log(fail);
  95. },
  96. });
  97. },
  98. async getByCodes() {
  99. let data = await getByCodes(JSON.stringify(this.dic_key));
  100. this.dic_SelectList = this.$common.handleDicList(data);
  101. this.selectData();
  102. },
  103. goBack() {
  104. this.$router.push({ path: "/home-app" });
  105. },
  106. selectData() {
  107. const _this = this;
  108. _this.recordList = [];
  109. _this.params;
  110. confirmList(this.params).then((res) => {
  111. console.log(res.data);
  112. if (res.data) {
  113. res.data.rows.forEach(function (item) {
  114. const jsonMap = _this.getItemJson(item);
  115. _this.recordList.push(jsonMap);
  116. });
  117. }
  118. });
  119. },
  120. getItemJson: function (item) {
  121. item.createdAt = this.$common.transServDate(item.createdAt);
  122. console.log(item.status)
  123. // let index = this.dic_SelectList.REPAIR_STATUS.findIndex((e) => {
  124. // console.log('e.value, item.status', e.value == item.status)
  125. // console.log('e.value, item.status', e.value, item.status)
  126. // return e.value == item.status
  127. // }
  128. // );
  129. // console.log(index)
  130. const fileUrls =
  131. item.fileUrl && item.fileUrl.length > 0 ? item.fileUrl.split(",") : [];
  132. console.log(fileUrls);
  133. const fileUrl = {
  134. url:
  135. this.$constant.BASE_URI +
  136. "/wx/fileController/download/" +
  137. fileUrls[0],
  138. };
  139. item.fileUrl = fileUrl;
  140. console.log(this.dic_SelectList.REPAIR_STATUS);
  141. // item.statusName = this.dic_SelectList.REPAIR_STATUS[index].label;
  142. return item;
  143. },
  144. /**
  145. *
  146. */
  147. quickSelect(item) {
  148. if (this.quickSleced.val && this.quickSleced.val === item.val) {
  149. this.quickSleced = {};
  150. } else {
  151. this.quickSleced = item;
  152. }
  153. },
  154. /**
  155. * 上传文件
  156. */
  157. afterRead(file) {
  158. console.log(file);
  159. },
  160. /**
  161. * 设置状态样式
  162. */
  163. setStatusStyle(status) {
  164. let statusClass = null;
  165. switch (status) {
  166. case "unAcceptance":
  167. statusClass = "pending-btn";
  168. break;
  169. case "acceptance":
  170. statusClass = "accepted-btn";
  171. break;
  172. case "processed":
  173. statusClass = "processed-btn";
  174. break;
  175. case "evaluated":
  176. statusClass = "evaluated-btn";
  177. break;
  178. }
  179. return statusClass;
  180. },
  181. },
  182. /**
  183. * 过滤器
  184. */
  185. filters: {
  186. /**
  187. * 状态:0、待受理 1、已受理 2、已处理 3、已评价
  188. */
  189. statusFilter(val) {
  190. let res = null;
  191. switch (val) {
  192. case "unAcceptance":
  193. res = "待处理";
  194. break;
  195. case "acceptance":
  196. res = "已受理";
  197. break;
  198. case "processed":
  199. res = "已处理";
  200. break;
  201. case "evaluated":
  202. res = "已评价";
  203. break;
  204. }
  205. return res;
  206. },
  207. },
  208. };
  209. </script>
  210. <style lang="scss" type="text/scss" scoped>
  211. .repair {
  212. .top-add {
  213. background-color: #fff;
  214. padding: 30rpx;
  215. margin-bottom: 20rpx;
  216. text-align: right;
  217. box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0, 0, 0, 0.05);
  218. i {
  219. font-size: 36rpx;
  220. color: $text6;
  221. margin-right: 15rpx;
  222. }
  223. .txt {
  224. font-size: 32rpx;
  225. color: $text6;
  226. }
  227. }
  228. .info-list {
  229. height: calc(100vh - 124rpx);
  230. overflow-y: auto;
  231. .info-item {
  232. background-color: #fff;
  233. padding: 20rpx 30rpx;
  234. margin-bottom: 20rpx;
  235. .info-top {
  236. @include flex;
  237. .left {
  238. width: 286rpx;
  239. height: 168rpx;
  240. font-size: 0;
  241. border-radius: 10rpx;
  242. overflow: hidden;
  243. img {
  244. width: 100%;
  245. height: 100%;
  246. }
  247. }
  248. .right {
  249. align-self: flex-start;
  250. width: 380rpx;
  251. .tit {
  252. width: 380rpx;
  253. font-size: 32rpx;
  254. line-height: 1.4;
  255. font-weight: bold;
  256. color: #333333;
  257. @include line-clamp;
  258. margin-bottom: 20rpx;
  259. }
  260. .txt {
  261. font-size: 28rpx;
  262. color: #666;
  263. }
  264. }
  265. }
  266. .info-bottom {
  267. margin-top: 20rpx;
  268. padding-top: 20rpx;
  269. border-top: 1rpx dashed #dbdbdb;
  270. @include flex;
  271. .left {
  272. i {
  273. font-size: 30rpx;
  274. color: #999999;
  275. margin-left: 10rpx;
  276. }
  277. span {
  278. font-size: 28rpx;
  279. color: #999999;
  280. }
  281. }
  282. .right {}
  283. }
  284. }
  285. }
  286. }
  287. </style>