index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. },
  95. methods: {
  96. goNavigator(id) {
  97. uni.navigateTo({
  98. url: "/pages/subPackages/repairprocessing-app/detail?id=" + id,
  99. fail: (fail) => {
  100. console.log(fail);
  101. },
  102. });
  103. },
  104. async getByCodes() {
  105. let data = await getByCodes(JSON.stringify(this.dic_key));
  106. this.dic_SelectList = this.$common.handleDicList(data);
  107. this.selectData();
  108. },
  109. goBack() {
  110. this.$router.push({ path: "/home-app" });
  111. },
  112. selectData() {
  113. const _this = this;
  114. _this.recordList = [];
  115. getRepairList(this.params).then((res) => {
  116. console.log(res.data);
  117. if (res.data) {
  118. res.data.forEach(function (item) {
  119. const jsonMap = _this.getItemJson(item);
  120. _this.recordList.push(jsonMap);
  121. });
  122. }
  123. });
  124. },
  125. getItemJson: function (item) {
  126. item.createdAt = this.$common.transServDate(item.createdAt);
  127. let index = this.dic_SelectList.REPAIR_STATUS.findIndex(
  128. (e) => e.value == item.status
  129. );
  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. }
  288. </style>