index.vue 7.6 KB

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