index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <!-- 现货合同详情-->
  3. <a-modal class="add-custom custom-detail" title="现货合同详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
  4. <template #footer>
  5. <a-button key="submit" type="primary" :loading="loading" @click="cancel">关闭</a-button>
  6. </template>
  7. <a-tabs v-model:activeKey="activeKey" @change="tabClick">
  8. <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
  9. </a-tabs>
  10. <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
  11. <div class="tableDatas" v-else>
  12. <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
  13. <template #status="{ text }">
  14. <span class="yellow">{{ text }}</span>
  15. <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow' -->
  16. </template>
  17. <template #applystatus="{ text }">
  18. <a>{{ getApplyStatusName(text) }}</a>
  19. </template>
  20. <!-- 发票金额-->
  21. <template #invoicetype="{ text }">
  22. <a>{{ invoiceStatusName(text) }}</a>
  23. </template>
  24. <!-- 发票类型-->
  25. <template #contracttype="{ text }">
  26. <a>{{ getReceiptName(text) }}</a>
  27. </template>
  28. <!-- 出入库类型 -->
  29. <template #inouttype="{ text }">
  30. <a>{{ InOutTypeName(text) }}</a>
  31. </template>
  32. <!-- 款项类型 -->
  33. <template #kxtype="{ record }">
  34. <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
  35. </template>
  36. <!-- 金额-->
  37. <template #payamount="{ text, record }">
  38. <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
  39. </template>
  40. <!-- 调整付保证金-->
  41. <template #addmargin="{ record }">
  42. <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
  43. </template>
  44. <!-- 交收量 -->
  45. <template #reckonrealqty="{ record }">
  46. <span>{{ formatValue(record.reckonrealqty) }}</span>
  47. </template>
  48. <!-- 其他费用 -->
  49. <template #reckonotheramount="{ record }">
  50. <span>{{ formatValue(record.reckonotheramount) }}</span>
  51. </template>
  52. <!-- 申请人 -->
  53. <template #applyname="{ record }">
  54. <span>{{ formatValue(record.applyname) }}</span>
  55. </template>
  56. <!-- 款项记录 款项类型为退款 则金额使用deductamount-->
  57. </a-table>
  58. </div>
  59. </a-modal>
  60. </template>
  61. <script lang="ts">
  62. import { defineComponent, PropType, ref } from 'vue';
  63. import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
  64. import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  65. import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
  66. import { QueryBusinessDj, QueryBusinessJs } from '@/services/go/ermcp/business-review';
  67. import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
  68. import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
  69. import { QueryPaTradeLinkDetail } from '@/services/go/ermcp/patrade-link';
  70. import InfoDetail from '../infoDetail/index.vue';
  71. import { getApplyStatusName, getReceiptName } from '@/common/constants/enumsName';
  72. import { getTableColumns } from '@/common/setup/table';
  73. import { invoiceStatusName, stateName } from '@/views/manage/finance-review/setup';
  74. import { getPlanContractType } from '@/views/business/plan/setup';
  75. import { InOutTypeName } from '@/views/manage/inventory-review/setup';
  76. import { kxtypeName } from '@/views/manage/finance-review/setup';
  77. import { _closeModal } from '@/common/setup/modal/modal';
  78. import { formatValue } from '@/common/methods';
  79. import { columnsPaTradeLink } from './setup';
  80. export default defineComponent({
  81. name: 'spot-contract-detail',
  82. components: { InfoDetail },
  83. emits: ['cancel', 'update'],
  84. props: {
  85. selectedRow: {
  86. type: Object as PropType<Ermcp3ContractRsp>,
  87. default: {},
  88. },
  89. },
  90. setup: function (props, context) {
  91. const { visible, cancel } = _closeModal(context);
  92. const tabList = ref<{ key: number; name: string }[]>([]);
  93. const activeKey = ref<number>(1);
  94. const loading = ref<boolean>(false);
  95. const tableList = ref<any[]>([]);
  96. // 表头数据
  97. const { columns, registerColumn } = getTableColumns();
  98. // 审核拒绝和未提交不显示后面的选项
  99. tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
  100. ? [{ key: 1, name: '合同详情' }]
  101. : [
  102. { key: 1, name: '合同详情' },
  103. { key: 2, name: '点价记录' },
  104. { key: 3, name: '交收记录' },
  105. { key: 4, name: '款项记录' },
  106. { key: 5, name: '发票记录' },
  107. { key: 6, name: props.selectedRow.contracttype === 1 ? '入库记录' : '出库记录' },
  108. { key: 8, name: '变更记录' },
  109. { key: 9, name: '关联记录' },
  110. ];
  111. activeKey.value = 1;
  112. function tabClick() {
  113. const relatedid = props.selectedRow.spotcontractid;
  114. switch (activeKey.value) {
  115. case 1:
  116. break;
  117. case 2: // 点价记录
  118. registerColumn('table_pcweb_someprice_detail_dj', []);
  119. queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
  120. tableList.value = res;
  121. });
  122. break;
  123. case 3: // 交收记录
  124. registerColumn('table_pcweb_someprice_detail_js', []);
  125. queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
  126. tableList.value = res;
  127. });
  128. break;
  129. case 4: //款项记录
  130. registerColumn('table_pcweb_someprice_detail_kx', []);
  131. queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
  132. tableList.value = res;
  133. });
  134. break;
  135. case 5: // 发票记录
  136. registerColumn('table_pcweb_someprice_detail_fp', []);
  137. queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
  138. tableList.value = res;
  139. });
  140. break;
  141. case 6: // 入库记录
  142. registerColumn('table_pcweb_someprice_detail_stock', []);
  143. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  144. spotcontractid: relatedid,
  145. inouttype: '1,3',
  146. }).then((res) => {
  147. tableList.value = res;
  148. });
  149. break;
  150. case 7: // 出库记录
  151. registerColumn('table_pcweb_someprice_detail_stock_out', []);
  152. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  153. spotcontractid: relatedid,
  154. inouttype: '2,4',
  155. }).then((res) => {
  156. tableList.value = res;
  157. });
  158. break;
  159. case 8: //// 变更记录
  160. registerColumn('table_pcweb_someprice_detail_change', []);
  161. queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
  162. tableList.value = res;
  163. });
  164. break;
  165. case 9: //// 关联记录
  166. columns.value.length = 0;
  167. columns.value.push(...columnsPaTradeLink);
  168. queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
  169. tableList.value = res;
  170. });
  171. break;
  172. }
  173. }
  174. return {
  175. visible,
  176. cancel,
  177. loading,
  178. maskClosableFlag: false,
  179. activeKey,
  180. columns,
  181. tableList,
  182. tabList,
  183. tabClick,
  184. getApplyStatusName,
  185. invoiceStatusName,
  186. getPlanContractType,
  187. InOutTypeName,
  188. kxtypeName,
  189. formatValue,
  190. getReceiptName,
  191. stateName,
  192. };
  193. },
  194. });
  195. </script>
  196. <style lang="less">
  197. .custom-detail {
  198. .ant-modal-content {
  199. .ant-modal-body {
  200. padding-top: 0;
  201. padding-left: 0;
  202. padding-right: 0;
  203. .ant-tabs {
  204. background: @m-black11;
  205. width: 100%;
  206. padding: 0 24px;
  207. .ant-tabs-bar {
  208. margin-bottom: 0;
  209. border-bottom: 0;
  210. }
  211. .anticon {
  212. color: @m-grey2;
  213. }
  214. .ant-tabs-nav-container {
  215. .ant-tabs-nav-wrap {
  216. .ant-tabs-nav {
  217. .ant-tabs-tab {
  218. width: 70px;
  219. margin-right: 43px;
  220. text-align: center;
  221. font-size: 16px;
  222. color: @m-grey2;
  223. padding: 0;
  224. line-height: 45px;
  225. }
  226. .ant-tabs-tab-active.ant-tabs-tab {
  227. color: @m-blue0;
  228. }
  229. .ant-tabs-ink-bar {
  230. width: 70px !important;
  231. background: @m-blue0;
  232. .rounded-corners(1px);
  233. }
  234. }
  235. }
  236. }
  237. }
  238. }
  239. }
  240. .tableDatas {
  241. margin-top: 26px;
  242. padding: 0 24px;
  243. overflow: hidden;
  244. .dialogTable {
  245. width: 100%;
  246. overflow: overlay;
  247. }
  248. }
  249. .ant-form.inlineForm {
  250. margin-top: 20px;
  251. padding: 0 24px;
  252. }
  253. }
  254. </style
  255. >;