index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. onLoad() { },
  78. onShow() {
  79. this.recordList = []
  80. this.params.pageNum = 1
  81. this.selectData();
  82. },
  83. //下拉执行的时候触发 (下拉刷新)
  84. methods: {
  85. onReachBottom() {
  86. let that = this
  87. console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑");
  88. console.log(that.params)
  89. console.log(that.params.total)
  90. console.log(that.recordList)
  91. console.log(that.params.pageNum)
  92. if (that.params.total == that.recordList.length) {
  93. return
  94. }
  95. that.params.pageNum += 1;
  96. that.selectData();
  97. },
  98. goNavigator(id) {
  99. uni.navigateTo({
  100. url: "/pages/subPackages/repairDispatch-app/add",
  101. });
  102. },
  103. jumpPageDetails(id) {
  104. uni.navigateTo({
  105. url: "/pages/subPackages/repairDispatch-app/detail?id=" + id,
  106. });
  107. },
  108. async getByCodes() {
  109. let that = this;
  110. let data = await getByCodes(JSON.stringify(this.dic_key));
  111. that.dic_SelectList = that.$common.handleDicList(data);
  112. that.selectData();
  113. },
  114. // auth.currUser().id
  115. selectData() {
  116. const _this = this;
  117. repairList2(this.params).then((res) => {
  118. if (res.data) {
  119. this.params.total = res.data.total
  120. // _this.recordList = [];
  121. res.data.rows.forEach(function (item) {
  122. const jsonMap = _this.getItemJson(item);
  123. _this.recordList.push(jsonMap);
  124. });
  125. }
  126. });
  127. },
  128. getItemJson: function (item) {
  129. const fileUrls =
  130. item.fileUrl && item.fileUrl.length > 0 ? item.fileUrl.split(",") : [];
  131. console.log(fileUrls);
  132. const fileUrl = {
  133. url:
  134. this.$constant.BASE_URI +
  135. "/wx/fileController/download/" +
  136. fileUrls[0],
  137. };
  138. item.fileUrl = fileUrl;
  139. // fileUrls.forEach((item) => {
  140. // item.url = this.$constant.BASE_URI + "/wx/fileController/download/" + item;
  141. // // item.isImage = true;
  142. // fileUrl.push({ url: item, isImage: true });
  143. // });
  144. // const fileUrls = item.fileUrl !== "" ? JSON.parse(item.fileUrl) : [];
  145. // console.log(fileUrls);
  146. // item.fileUrl = fileUrls;
  147. // item.createdAt = this.$common.transServDate(item.createdAt);
  148. // console.log(item.status);
  149. // console.log(this.dic_SelectList.REPAIR_STATUS);
  150. // let index = this.dic_SelectList.REPAIR_STATUS.findIdex((e)=>e.value==item.status)
  151. // item.statusName = this.dic_SelectList.REPAIR_STATUS[index];
  152. console.log(item);
  153. return item;
  154. },
  155. /**
  156. *
  157. */
  158. quickSelect(item) {
  159. if (this.quickSleced.val && this.quickSleced.val === item.val) {
  160. this.quickSleced = {};
  161. } else {
  162. this.quickSleced = item;
  163. }
  164. },
  165. /**
  166. * 上传文件
  167. */
  168. afterRead(file) {
  169. console.log(file);
  170. },
  171. /**
  172. * 设置状态样式
  173. */
  174. setStatusStyle(status) {
  175. let statusClass = null;
  176. switch (status) {
  177. case "unAcceptance":
  178. statusClass = "pending-btn";
  179. break;
  180. case "acceptance":
  181. statusClass = "accepted-btn";
  182. break;
  183. case "processed":
  184. statusClass = "processed-btn";
  185. break;
  186. case "evaluated":
  187. statusClass = "evaluated-btn";
  188. break;
  189. }
  190. return statusClass;
  191. },
  192. },
  193. /**
  194. * 过滤器
  195. */
  196. filters: {
  197. /**
  198. * 状态:0、待受理 1、已受理 2、已处理 3、已评价
  199. */
  200. statusFilter(val) {
  201. let res = null;
  202. switch (val) {
  203. case "unAcceptance":
  204. res = "待处理";
  205. break;
  206. case "acceptance":
  207. res = "已受理";
  208. break;
  209. case "processed":
  210. res = "已处理";
  211. break;
  212. case "evaluated":
  213. res = "已评价";
  214. break;
  215. }
  216. return res;
  217. },
  218. },
  219. };
  220. </script>
  221. <style lang="scss" type="text/scss" scoped>
  222. .repair {
  223. .lz-status {
  224. background-color: rgb(149, 242, 4);
  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. .lz-status-no {
  234. background-color: #eb8488;
  235. padding: 5px;
  236. width: 50px;
  237. position: absolute;
  238. left: 30rpx;
  239. color: white;
  240. text-align: center;
  241. font-size: 20rpx;
  242. }
  243. .top-add {
  244. background-color: #fff;
  245. padding: 30rpx;
  246. margin-bottom: 20rpx;
  247. text-align: right;
  248. box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0, 0, 0, 0.05);
  249. i {
  250. font-size: 36rpx;
  251. color: $text6;
  252. margin-right: 15rpx;
  253. }
  254. .txt {
  255. font-size: 32rpx;
  256. color: $text6;
  257. }
  258. }
  259. .info-repairList2 {
  260. // height: calc(100vh - 124rpx);
  261. // overflow-y: auto;
  262. .info-item {
  263. position: relative;
  264. background-color: #fff;
  265. padding: 20rpx 30rpx;
  266. margin-bottom: 20rpx;
  267. .info-top {
  268. @include flex;
  269. .left {
  270. width: 286rpx;
  271. height: 168rpx;
  272. font-size: 0;
  273. border-radius: 10rpx;
  274. overflow: hidden;
  275. img {
  276. width: 100%;
  277. height: 100%;
  278. }
  279. }
  280. .right {
  281. align-self: flex-start;
  282. width: 380rpx;
  283. .tit {
  284. width: 380rpx;
  285. font-size: 32rpx;
  286. line-height: 1.4;
  287. font-weight: bold;
  288. color: #333333;
  289. @include line-clamp;
  290. margin-bottom: 20rpx;
  291. }
  292. .txt {
  293. font-size: 28rpx;
  294. color: #666;
  295. }
  296. }
  297. }
  298. .info-bottom {
  299. margin-top: 20rpx;
  300. padding-top: 20rpx;
  301. border-top: 1rpx dashed #dbdbdb;
  302. @include flex;
  303. .left {
  304. i {
  305. font-size: 30rpx;
  306. color: #999999;
  307. margin-left: 10rpx;
  308. }
  309. span {
  310. font-size: 28rpx;
  311. color: #999999;
  312. }
  313. }
  314. .right {}
  315. }
  316. }
  317. }
  318. }
  319. </style>