index.vue 7.9 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 class="info-item" v-for="item in recordList" :key="item.id" @click="jumpPageDetails(item.id)">
  9. <div class="lz-status-no" v-if="item.returnFlag=='1'">
  10. 有退回
  11. </div>
  12. <!-- <div class="lz-status" v-if>-->
  13. <!-- 有退回-->
  14. <!-- </div>-->
  15. <div class="info-top">
  16. <div class="left">
  17. <img :src="item.fileUrl.url" alt="" />
  18. </div>
  19. <div class="right">
  20. <p class="tit">
  21. {{ item.description }}
  22. </p>
  23. <p class="txt">{{ item.companyName }}</p>
  24. </div>
  25. </div>
  26. <div class="info-bottom">
  27. <div class="left">
  28. <i class="iconfont icon-shijian"></i>
  29. <span>
  30. {{ item.createdAt }}
  31. </span>
  32. </div>
  33. <div class="right">
  34. <span v-if="item.status == 'unAcceptance'" class="normal-tip yd h-bg">待派单</span>
  35. <span v-if="item.status != 'unAcceptance'" class="normal-tip yd z-bg">已派单</span>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { repairList2, getByCodes } from "@/js_sdk/http.js";
  44. // import Base from "@/pages/base/base";
  45. export default {
  46. data() {
  47. return {
  48. BASE_URI: this.$constant.BASE_URI,
  49. dic_key: ["REPAIR_STATUS"],
  50. dic_SelectList: {},
  51. recordList: [],
  52. params: {
  53. pageNum: 1,
  54. pageSize: 10,
  55. // groupId: "870261874875170816",
  56. // createdBy: '877225455206268928' // auth.currUser().id
  57. },
  58. totalPage: 1,
  59. allData: [],
  60. repairList2: [
  61. {
  62. title: "关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  63. name: "无锡 XXXX有限公司",
  64. date: "2020-09-18 19:34:06",
  65. type: "1",
  66. },
  67. {
  68. title:
  69. "关于组织2020年无锡市服务业提质增效资金项目申报的通知关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  70. name: "无锡 XXXX有限公司",
  71. date: "2020-09-18 19:34:06",
  72. type: "2",
  73. },
  74. ],
  75. };
  76. },
  77. mounted() {
  78. // if (window.history && window.history.pushState) {
  79. // // 向历史记录中插入了当前页
  80. // history.pushState(null, null, document.URL);
  81. // window.addEventListener("popstate", this.goBack, false);
  82. // }
  83. },
  84. onLoad() { },
  85. onShow() {
  86. this.getByCodes();
  87. },
  88. methods: {
  89. goNavigator(id) {
  90. uni.navigateTo({
  91. url: "/pages/subPackages/repairDispatch-app/add",
  92. });
  93. },
  94. jumpPageDetails(id) {
  95. uni.navigateTo({
  96. url: "/pages/subPackages/repairDispatch-app/detail?id=" + id,
  97. });
  98. },
  99. async getByCodes() {
  100. let that = this;
  101. let data = await getByCodes(JSON.stringify(this.dic_key));
  102. that.dic_SelectList = that.$common.handleDicList(data);
  103. that.selectData();
  104. },
  105. // auth.currUser().id
  106. selectData() {
  107. const _this = this;
  108. repairList2(this.params).then((res) => {
  109. if (res.data) {
  110. _this.recordList = [];
  111. res.data.rows.forEach(function (item) {
  112. const jsonMap = _this.getItemJson(item);
  113. _this.recordList.push(jsonMap);
  114. });
  115. }
  116. });
  117. },
  118. getItemJson: function (item) {
  119. const fileUrls =
  120. item.fileUrl && item.fileUrl.length > 0 ? item.fileUrl.split(",") : [];
  121. console.log(fileUrls);
  122. const fileUrl = {
  123. url:
  124. this.$constant.BASE_URI +
  125. "/wx/fileController/download/" +
  126. fileUrls[0],
  127. };
  128. item.fileUrl = fileUrl;
  129. // fileUrls.forEach((item) => {
  130. // item.url = this.$constant.BASE_URI + "/wx/fileController/download/" + item;
  131. // // item.isImage = true;
  132. // fileUrl.push({ url: item, isImage: true });
  133. // });
  134. // const fileUrls = item.fileUrl !== "" ? JSON.parse(item.fileUrl) : [];
  135. // console.log(fileUrls);
  136. // item.fileUrl = fileUrls;
  137. // item.createdAt = this.$common.transServDate(item.createdAt);
  138. // console.log(item.status);
  139. // console.log(this.dic_SelectList.REPAIR_STATUS);
  140. // let index = this.dic_SelectList.REPAIR_STATUS.findIdex((e)=>e.value==item.status)
  141. // item.statusName = this.dic_SelectList.REPAIR_STATUS[index];
  142. console.log(item);
  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. .lz-status {
  214. background-color: rgb(149, 242, 4);
  215. padding: 5px;
  216. width: 50px;
  217. position: absolute;
  218. left: 30rpx;
  219. color: white;
  220. text-align: center;
  221. font-size: 20rpx;
  222. }
  223. .lz-status-no {
  224. background-color: #eb8488;
  225. padding: 5px;
  226. width: 50px;
  227. position: absolute;
  228. left: 30rpx;
  229. color: white;
  230. text-align: center;
  231. font-size: 20rpx;
  232. }
  233. .top-add {
  234. background-color: #fff;
  235. padding: 30rpx;
  236. margin-bottom: 20rpx;
  237. text-align: right;
  238. box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0, 0, 0, 0.05);
  239. i {
  240. font-size: 36rpx;
  241. color: $text6;
  242. margin-right: 15rpx;
  243. }
  244. .txt {
  245. font-size: 32rpx;
  246. color: $text6;
  247. }
  248. }
  249. .info-repairList2 {
  250. height: calc(100vh - 124rpx);
  251. overflow-y: auto;
  252. .info-item {
  253. position: relative;
  254. background-color: #fff;
  255. padding: 20rpx 30rpx;
  256. margin-bottom: 20rpx;
  257. .info-top {
  258. @include flex;
  259. .left {
  260. width: 286rpx;
  261. height: 168rpx;
  262. font-size: 0;
  263. border-radius: 10rpx;
  264. overflow: hidden;
  265. img {
  266. width: 100%;
  267. height: 100%;
  268. }
  269. }
  270. .right {
  271. align-self: flex-start;
  272. width: 380rpx;
  273. .tit {
  274. width: 380rpx;
  275. font-size: 32rpx;
  276. line-height: 1.4;
  277. font-weight: bold;
  278. color: #333333;
  279. @include line-clamp;
  280. margin-bottom: 20rpx;
  281. }
  282. .txt {
  283. font-size: 28rpx;
  284. color: #666;
  285. }
  286. }
  287. }
  288. .info-bottom {
  289. margin-top: 20rpx;
  290. padding-top: 20rpx;
  291. border-top: 1rpx dashed #dbdbdb;
  292. @include flex;
  293. .left {
  294. i {
  295. font-size: 30rpx;
  296. color: #999999;
  297. margin-left: 10rpx;
  298. }
  299. span {
  300. font-size: 28rpx;
  301. color: #999999;
  302. }
  303. }
  304. .right {}
  305. }
  306. }
  307. }
  308. }
  309. </style>