main.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div class="processTimeLine">
  3. <el-steps
  4. direction="vertical"
  5. :active="options.length"
  6. :space="80"
  7. :finish-status="finishStatus"
  8. :process-status="finishStatus"
  9. >
  10. <el-step
  11. icon="el-icon-success"
  12. v-for="(item, index) in options"
  13. :key="item.time + index"
  14. :finish-status="finishStatus"
  15. :process-status="finishStatus"
  16. style="margin: 0 0 0 150px; position: relative"
  17. >
  18. <div
  19. slot="title"
  20. style="position: absolute; width: 142px; left: -150px; text-align: right"
  21. >
  22. {{ item.status_name }}
  23. </div>
  24. <!-- v-if="index + 1 !== options.length" -->
  25. <div slot="description" style="padding: 20px 0 0 0">
  26. <p class="name">
  27. &nbsp;操&nbsp;作&nbsp;人&nbsp;:
  28. {{ item.action_name ? item.action_name : "未知" }}
  29. </p>
  30. <p class="item">
  31. 账号来源:
  32. {{ item.source + "" === "2" ? "供应商端" : "采销平台" }}
  33. </p>
  34. <p class="time">
  35. {{ item.addtime }}
  36. </p>
  37. </div>
  38. </el-step>
  39. </el-steps>
  40. </div>
  41. </template>
  42. <script>
  43. import asyncRequest from "@/apis/components/process-time-line";
  44. import resToken from "@/mixins/resToken";
  45. export default {
  46. name: "processTimeLine",
  47. props: ["type", "orderCode", "newTime"],
  48. mixins: [resToken],
  49. data() {
  50. return {
  51. options: [],
  52. loading: false,
  53. };
  54. },
  55. watch: {
  56. newTime: function (val) {
  57. if (val) {
  58. this.getList();
  59. }
  60. },
  61. },
  62. mounted() {
  63. this.getList();
  64. },
  65. methods: {
  66. async getList() {
  67. if (!this.loading) {
  68. this.loading = true;
  69. this.options = [];
  70. const res = await asyncRequest.list({
  71. type: this.type,
  72. orderCode: this.orderCode,
  73. });
  74. if (res && res.code === 0 && res.data) {
  75. this.options = res.data;
  76. } else {
  77. this.options = [];
  78. }
  79. this.loading = false;
  80. }
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang="scss">
  86. .date-picker.el-input {
  87. // width: 150px !important;
  88. }
  89. </style>