main.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <!-- <div class=""> -->
  3. <!-- 123456 -->
  4. <el-timeline reverse>
  5. <el-timeline-item v-for="(item, index) in options"
  6. :key="item.time + index" :timestamp="item.addtime" placement="top">
  7. <!-- <el-card> -->
  8. <!-- 111 -->
  9. <h4>王小虎 {{item.status_name}}</h4>
  10. <!-- <p>王小虎 提交于 2018/4/12 20:46</p> -->
  11. <!-- </el-card> -->
  12. </el-timeline-item>
  13. </el-timeline>
  14. <!-- </div> -->
  15. </template>
  16. <script>
  17. import asyncRequest from "@/apis/components/process-time-line";
  18. import resToken from "@/mixins/resToken";
  19. export default {
  20. name: "processTimeLine",
  21. props: ["type", "orderCode", "newTime"],
  22. mixins: [resToken],
  23. data() {
  24. return {
  25. options: [],
  26. loading: false,
  27. };
  28. },
  29. watch: {
  30. newTime: function (val) {
  31. console.log(val);
  32. if (val) {
  33. this.getList();
  34. }
  35. },
  36. },
  37. mounted() {
  38. this.getList();
  39. },
  40. methods: {
  41. async getList() {
  42. console.log(123456);
  43. if (!this.loading) {
  44. this.loading=true
  45. this.options = [];
  46. const res = await asyncRequest.list({
  47. type: this.type,
  48. orderCode: this.orderCode,
  49. });
  50. if (res && res.code === 0 && res.data) {
  51. this.options = res.data;
  52. // this.recursion(this.options);
  53. } else {
  54. this.options = [];
  55. }
  56. this.loading=false
  57. }
  58. },
  59. },
  60. };
  61. </script>
  62. <style lang="scss">
  63. .date-picker.el-input {
  64. // width: 150px !important;
  65. }
  66. </style>