detail.vue 4.4 KB

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