index.vue 9.6 KB

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