detail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="sellOutOrderDetail pagePadding">
  3. <el-tabs v-model="activeTabs">
  4. <el-tab-pane label="业务详情" name="1">
  5. <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
  6. <el-collapse-item title="发货申请单详情" name="1">
  7. <show-data-table
  8. :newTime="newTime"
  9. v-if="newTime !== ''"
  10. :sitem="sitem"
  11. :columns="showColumns"
  12. >
  13. <template slot="status">
  14. <el-tag
  15. :size="'mini'"
  16. :type="sitem.status == '0' ? 'warning' : ''"
  17. v-text="
  18. (statusOptions.find((item) => item.value == sitem.status) || {})
  19. .label || '--'
  20. "
  21. ></el-tag>
  22. </template>
  23. <template slot="order_type">
  24. <el-tag
  25. :size="'mini'"
  26. v-text="
  27. (
  28. xs_order_type_options.find((item) => item.id == sitem.order_type) ||
  29. {}
  30. ).label || '--'
  31. "
  32. ></el-tag>
  33. </template>
  34. </show-data-table>
  35. </el-collapse-item>
  36. <el-collapse-item title="商品信息" name="2">
  37. <show-goods-data-table
  38. :newTime="newTime"
  39. v-if="newTime !== ''"
  40. :type="sitem.order_type"
  41. :skucode="sitem.skuCode"
  42. :spucode="sitem.good_code"
  43. />
  44. </el-collapse-item>
  45. <el-collapse-item title="库管发货" name="3" v-if="status === '1'">
  46. <want-deliver
  47. :newTime="newTime"
  48. v-if="newTime !== ''"
  49. :sitem="sitem"
  50. @refresh="initData"
  51. />
  52. </el-collapse-item>
  53. </el-collapse>
  54. </el-tab-pane>
  55. <!-- <el-tab-pane label="审批记录" name="2">
  56. <process-time-line
  57. v-if="newTime !== ''"
  58. :newTime="newTime"
  59. :type="'CKD'"
  60. :orderCode="queryId"
  61. />
  62. </el-tab-pane> -->
  63. <!-- <el-tab-pane
  64. label="物流进度"
  65. name="3"
  66. v-if="newTime !== '' && (status === '2' || status === '3')"
  67. >
  68. <logis-time-line v-if="newTime !== ''" :orderCode="sitem.post_code" />
  69. </el-tab-pane> -->
  70. </el-tabs>
  71. </div>
  72. </template>
  73. <script>
  74. import mixinPage from "@/mixins/elPaginationHandle";
  75. import resToken from "@/mixins/resToken";
  76. import asyncRequest from "@/apis/sellOutOrder";
  77. import { showColumns, statusOptions } from "./columns";
  78. import { xs_order_type_options } from "@/assets/js/statusList";
  79. import wantDeliver from "./want-deliver";
  80. export default {
  81. name: "sellOutOrderDetail",
  82. mixins: [mixinPage, resToken],
  83. components: {
  84. wantDeliver,
  85. },
  86. data() {
  87. return {
  88. xs_order_type_options,
  89. statusOptions,
  90. showColumns,
  91. activeTabs: "1",
  92. activeNames: ["0", "1", "2", "3", "4"],
  93. status: "", //存储详情接口状态
  94. sitem: null,
  95. newTime: "",
  96. loading: false,
  97. queryId: "",
  98. };
  99. },
  100. mounted() {
  101. this.queryId = this.$route.query.id;
  102. this.initData();
  103. },
  104. methods: {
  105. getNewTime() {
  106. this.newTime = new Date().valueOf();
  107. },
  108. async initData() {
  109. this.returnCode = "";
  110. this.returnCode_type = "";
  111. const res = await asyncRequest.detail({
  112. outCode: this.queryId,
  113. });
  114. if (res && res.code === 0 && res.data) {
  115. this.sitem = res.data;
  116. const { status, id } = this.sitem;
  117. this.status = status;
  118. this.getNewTime();
  119. } else if (res && res.code >= 100 && res.code <= 104) {
  120. await this.logout();
  121. } else {
  122. this.$message.warning(res.message);
  123. }
  124. },
  125. },
  126. };
  127. </script>