index.vue 7.2 KB

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