index.vue 11 KB

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