index.vue 7.6 KB

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