index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <!-- 现货合同详情-->
  3. <a-modal class="add-custom custom-detail"
  4. title="现货合同详情"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="maskClosableFlag"
  8. @cancel="cancel"
  9. width="890px">
  10. <template #footer>
  11. <a-button key="submit"
  12. type="primary"
  13. :loading="loading"
  14. @click="cancel">关闭</a-button>
  15. </template>
  16. <a-tabs v-model:activeKey="activeKey"
  17. @change="tabClick">
  18. <a-tab-pane v-for="item in tabList"
  19. :key="item.key"
  20. :tab="item.name">
  21. </a-tab-pane>
  22. </a-tabs>
  23. <InfoDetail :selectedRow="selectedRow"
  24. v-if="activeKey == 1" />
  25. <div class="tableDatas"
  26. v-else>
  27. <a-table class="dialogTable"
  28. :columns="columns"
  29. :data-source="tableList"
  30. :pagination="false">
  31. <template #status="{ text }">
  32. <span class="yellow">{{ text }}</span>
  33. <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow' -->
  34. </template>
  35. </a-table>
  36. </div>
  37. </a-modal>
  38. </template>
  39. <script lang="ts">
  40. import { defineComponent, PropType, ref } from 'vue';
  41. import { closeModal } from '@/common/setup/modal/index';
  42. import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
  43. import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  44. import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
  45. import { QueryBusinessJs } from '@/services/go/ermcp/business-review';
  46. import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
  47. import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
  48. import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
  49. import InfoDetail from '../infoDetail/index.vue';
  50. import { columnsPointPrice, columnsFund, columnsSettlement, columnsInvoice, columnsInWarehouse } from './setup';
  51. export default defineComponent({
  52. name: 'spot-contract-detail',
  53. components: { InfoDetail },
  54. props: {
  55. selectedRow: {
  56. type: Object as PropType<Ermcp3ContractRsp>,
  57. default: {},
  58. },
  59. businessManager: {
  60. type: Array as PropType<ErmcpLoginUserEx[]>,
  61. default: [],
  62. },
  63. },
  64. setup: function(props, context) {
  65. const { visible, cancel } = closeModal('detail');
  66. const tabList = [
  67. { key: 1, name: '合同详情' },
  68. { key: 2, name: '点价记录' },
  69. { key: 3, name: '交收记录' },
  70. { key: 4, name: '款项记录' },
  71. { key: 5, name: '发票记录' },
  72. { key: 6, name: '入库记录' },
  73. { key: 7, name: '变更记录' },
  74. ];
  75. const activeKey = ref<number>(1);
  76. const loading = ref<boolean>(false);
  77. const columns = ref<any[]>([]);
  78. const tableList = ref<any[]>([]);
  79. function tabClick() {
  80. const relatedid = props.selectedRow.spotcontractid;
  81. switch (activeKey.value) {
  82. case 1:
  83. break;
  84. case 2: // 点价记录
  85. queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
  86. columns.value = columnsPointPrice;
  87. tableList.value = res;
  88. });
  89. break;
  90. case 3: // 交收记录
  91. queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
  92. columns.value = columnsSettlement;
  93. tableList.value = res;
  94. });
  95. break;
  96. case 4: //款项记录
  97. queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
  98. columns.value = columnsFund;
  99. tableList.value = res;
  100. });
  101. break;
  102. case 5: // 发票记录
  103. queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
  104. columns.value = columnsInvoice;
  105. tableList.value = res;
  106. });
  107. break;
  108. case 6: // 入库记录
  109. queryResultLoadingAndInfo(QueryAreaStockApply, loading, { spotcontractid: relatedid, inouttype: '1,3' }).then((res) => {
  110. columns.value = columnsInWarehouse;
  111. tableList.value = res;
  112. });
  113. break;
  114. case 7: // 变更记录
  115. queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
  116. columns.value = columnsInWarehouse;
  117. tableList.value = res;
  118. });
  119. break;
  120. }
  121. }
  122. return {
  123. visible,
  124. cancel,
  125. loading,
  126. maskClosableFlag: false,
  127. activeKey,
  128. columns,
  129. tableList,
  130. tabList,
  131. tabClick,
  132. };
  133. },
  134. });
  135. </script>
  136. <style lang="less">
  137. .custom-detail {
  138. .ant-modal-content {
  139. .ant-modal-body {
  140. padding-top: 0;
  141. padding-left: 0;
  142. padding-right: 0;
  143. .ant-tabs {
  144. background: @m-black11;
  145. width: 100%;
  146. padding: 0 24px;
  147. .ant-tabs-bar {
  148. margin-bottom: 0;
  149. border-bottom: 0;
  150. }
  151. .ant-tabs-nav-container {
  152. .ant-tabs-nav-wrap {
  153. .ant-tabs-nav {
  154. .ant-tabs-tab {
  155. width: 70px;
  156. margin-right: 43px;
  157. text-align: center;
  158. font-size: 16px;
  159. color: #88a0ae;
  160. padding: 0;
  161. line-height: 45px;
  162. }
  163. .ant-tabs-tab-active.ant-tabs-tab {
  164. color: #3a87f7;
  165. }
  166. .ant-tabs-ink-bar {
  167. width: 70px !important;
  168. background: #3a87f7;
  169. .rounded-corners(1px);
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. .tableDatas {
  178. margin-top: 26px;
  179. padding: 0 24px;
  180. overflow: hidden;
  181. .dialogTable {
  182. width: 100%;
  183. overflow: overlay;
  184. }
  185. }
  186. .ant-form.inlineForm {
  187. margin-top: 20px;
  188. padding: 0 24px;
  189. }
  190. }
  191. </style
  192. >;