index.vue 8.2 KB

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