index.vue 8.2 KB

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