应用层PC端前端服务

expressDeliveryDialog.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="快递信息"
  5. :visible="showDelivery"
  6. @close="cancel"
  7. center
  8. :distroy-on-close="true"
  9. >
  10. <div class="loading" v-if="flagLoading">
  11. <i class="el-icon-loading"></i>
  12. </div>
  13. <div v-else>
  14. <div class="noData" v-if="noData">暂无快递信息!</div>
  15. <div v-else>
  16. <div class="deliverName">
  17. {{ applicantdelivery.company }} {{ applicantdelivery.no }}
  18. </div>
  19. <el-divider></el-divider>
  20. <el-timeline :reverse="reverse">
  21. <el-timeline-item
  22. v-for="(activity, index) in activities"
  23. :key="index"
  24. :timestamp="activity.timestamp"
  25. >
  26. {{ activity.content }}
  27. </el-timeline-item>
  28. </el-timeline>
  29. </div>
  30. </div>
  31. <div slot="footer" class="dialog-footer">
  32. <el-button @click="cancel" class="endbutton"
  33. ><span>取 消</span></el-button
  34. >
  35. </div>
  36. </el-dialog>
  37. </div>
  38. </template>
  39. <script>
  40. export default {
  41. props: ["showDelivery", "deliveryDataArr", "flagLoading"],
  42. data() {
  43. return {
  44. // key: value
  45. reverse: true,
  46. applicantdelivery: {}, //申请人物流信息
  47. activities: [],
  48. noData: false,
  49. };
  50. },
  51. watch: {
  52. deliveryDataArr: {
  53. handler(val) {
  54. if (val) {
  55. val.forEach((item) => {
  56. if (item.identityType == 1) {
  57. let applicantdata = item.logisticsInfo;
  58. this.applicantdelivery = JSON.parse(applicantdata);
  59. if (this.applicantdelivery.list) {
  60. this.activities = this.applicantdelivery.list;
  61. this.activities.forEach((item) => {
  62. item.content = item.datetime;
  63. item.timestamp = item.remark;
  64. });
  65. } else {
  66. this.noData = true;
  67. return;
  68. }
  69. }
  70. });
  71. }
  72. },
  73. },
  74. },
  75. methods: {
  76. cancel() {
  77. this.$emit("closeDeliveryModel");
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. ::v-deep .el-dialog {
  84. width: 600px;
  85. background: #ffffff;
  86. border-radius: 20px;
  87. }
  88. .deliverName {
  89. margin-left: 6%;
  90. font-size: 16px;
  91. font-weight: 500;
  92. }
  93. .endbutton {
  94. width: 154px;
  95. height: 37px;
  96. background: #ffffff;
  97. border: 1px solid #d0d0d0;
  98. border-radius: 19px;
  99. span {
  100. width: 31px;
  101. height: 13px;
  102. font-size: 16px;
  103. font-family: Microsoft YaHei;
  104. font-weight: 400;
  105. color: #959595;
  106. }
  107. }
  108. .loading {
  109. width: 100%;
  110. height: 100%;
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. .el-icon-loading {
  115. font-size: 50px;
  116. }
  117. }
  118. .noData {
  119. width: 100%;
  120. font-size: 20px;
  121. font-weight: 700;
  122. color: #959595;
  123. display: flex;
  124. justify-content: center;
  125. align-items: center;
  126. }
  127. </style>