detail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div v-loading="loading" class="report-detail__container">
  3. <el-tabs v-model="activeTabs">
  4. <el-tab-pane name="1" :label="title">
  5. <el-collapse v-model="collapses">
  6. <el-collapse-item v-if="type === 'add' || type === 'edit'" name="1" :title="title">
  7. {{sitem.status}}
  8. <base-form :id="id" :type="type" />
  9. </el-collapse-item>
  10. <base-detail
  11. v-else
  12. ref="baseForm"
  13. :sitem="sitem"
  14. @change-num="handleChangeNum"
  15. @change-status="handleChangeStatus"
  16. @change-order-code="handleChangeOrderCode"
  17. @change-detail="(detail) =>
  18. {sitem = detail;
  19. status = detail.status}
  20. "
  21. />
  22. <el-collapse-item
  23. name="2"
  24. title="是否合规设置"
  25. v-if="(!isSupertube && type !== 'add' && type !== 'edit') && Number(status) === 0 && _process.includes('0')"
  26. >
  27. <compliance-form :sitem="sitem" @refresh="refresh" />
  28. </el-collapse-item>
  29. <el-collapse-item v-if="status === '3'" name="4" title="发货单">
  30. <shipment-request :order-code="orderCode" />
  31. </el-collapse-item>
  32. </el-collapse>
  33. </el-tab-pane>
  34. </el-tabs>
  35. </div>
  36. </template>
  37. <script>
  38. import ShipmentRequest from "./cpns/shipment-request.vue";
  39. import asyncRequest from "@/apis/service/sellOut/filing";
  40. import ComplianceForm from "./cpns/complianceForm.vue";
  41. import baseDetail from "./cpns/baseDetail.vue";
  42. import ExamForms from "./cpns/exam-form.vue";
  43. import BaseForm from "./cpns/baseForm.vue";
  44. import { mapGetters } from "vuex";
  45. export default {
  46. components: {
  47. BaseForm,
  48. ExamForms,
  49. baseDetail,
  50. ComplianceForm,
  51. ShipmentRequest
  52. },
  53. data() {
  54. return {
  55. activeTabs: "1",
  56. collapses: ["1", "2", "3", "4"],
  57. loading: false,
  58. orderCode: "",
  59. status: "",
  60. sitem: {},
  61. num: "0"
  62. };
  63. },
  64. computed: {
  65. ...mapGetters(["isSupertube"]),
  66. title() {
  67. const mapTitle = {
  68. add: "新建报备单",
  69. edit: "编辑报备单",
  70. view: "报备单详情"
  71. };
  72. return mapTitle[this.$route.query.type];
  73. },
  74. type() {
  75. return this.$route.query.type;
  76. },
  77. id() {
  78. return this.$route.query.id;
  79. },
  80. getNewTime() {
  81. this.newTime = new Date().valueOf();
  82. },
  83. _process() {
  84. const { roleProcess } = this.$store.getters;
  85. const tran = roleProcess.find(i => i.process_type === "BBD") || {};
  86. const { action } = tran ?? {};
  87. return action ?? [];
  88. }
  89. },
  90. methods: {
  91. refresh() {
  92. if (!this.$refs.baseForm) return;
  93. this.$refs.baseForm.initData();
  94. },
  95. async examFormSubmit({ companyCode, ...rest } = {}) {
  96. const { id } = this.$route.query;
  97. this.loading = true;
  98. await asyncRequest.status({
  99. ...rest,
  100. id,
  101. companyCode: Array.isArray(companyCode) ? companyCode[0] : companyCode
  102. });
  103. await this.$refs.baseForm.initData();
  104. this.loading = false;
  105. console.log(this.loading);
  106. // this.handleRefresh()
  107. },
  108. handleChangeStatus(status) {
  109. this.status = status;
  110. },
  111. handleChangeOrderCode(orderCode) {
  112. this.orderCode = orderCode;
  113. },
  114. async handleRefresh() {
  115. this.loading = true;
  116. this.$refs.baseForm.initData();
  117. this.loading = false;
  118. },
  119. handleChangeNum(num) {
  120. this.num = num;
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .report-detail__container {
  127. padding: 15px;
  128. }
  129. </style>